cortex-react-components 2.17.3 → 2.17.5
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-P7S6XFU4.mjs → chunk-23XORW7A.mjs} +1 -1
- package/dist/{chunk-2OOJ4ZFB.mjs → chunk-2GZQYAN3.mjs} +1 -1
- package/dist/{chunk-PNUBVBSR.mjs → chunk-4NHQXOKZ.mjs} +1 -1
- package/dist/{chunk-KUFXQZI5.mjs → chunk-57HKHEQN.mjs} +1 -1
- package/dist/{chunk-GETYSIZV.mjs → chunk-5KS3DITB.mjs} +1 -1
- package/dist/{chunk-PTZT4QJW.mjs → chunk-66ODXUVL.mjs} +1 -1
- package/dist/{chunk-LAQ3QAUW.mjs → chunk-75WE6ZXB.mjs} +1 -1
- package/dist/{chunk-5NIEZE7A.mjs → chunk-AGWQ5S2Z.mjs} +1 -1
- package/dist/{chunk-2GM2LPLB.mjs → chunk-BDNY6OKE.mjs} +1 -1
- package/dist/{chunk-FYQBRCQM.mjs → chunk-BGADMIWV.mjs} +1 -1
- package/dist/{chunk-HKMNAXLM.mjs → chunk-BN747TQM.mjs} +1 -1
- package/dist/{chunk-AQQCH7Z2.mjs → chunk-CNCT3JZV.mjs} +1 -1
- package/dist/{chunk-3GROWGZ5.mjs → chunk-CQAMS7RZ.mjs} +1 -1
- package/dist/{chunk-JCWFPKF3.mjs → chunk-CYWA6TR2.mjs} +1 -1
- package/dist/{chunk-UCPJ4KXN.mjs → chunk-DA2BPW6D.mjs} +1 -1
- package/dist/{chunk-LHO4WFYP.mjs → chunk-ERHNVIOZ.mjs} +1 -1
- package/dist/{chunk-O24GFE6Q.mjs → chunk-GIL2SMPM.mjs} +1 -1
- package/dist/{chunk-GQEGZKN6.mjs → chunk-I6OBIS4J.mjs} +1 -1
- package/dist/{chunk-GAZHKHGB.mjs → chunk-JLUX7EHB.mjs} +1 -1
- package/dist/{chunk-MO4HRQEL.mjs → chunk-JT65KF7C.mjs} +1 -1
- package/dist/{chunk-R6AYIVIR.mjs → chunk-JUFFNFV6.mjs} +1 -1
- package/dist/{chunk-FEWOSBUJ.mjs → chunk-KRLNPNMZ.mjs} +1 -1
- package/dist/{chunk-RQLUMNJE.mjs → chunk-L5NPH5RX.mjs} +1 -1
- package/dist/{chunk-HDKHF3EA.mjs → chunk-M74BIPBM.mjs} +1 -1
- package/dist/{chunk-4SRUEQTP.mjs → chunk-NXG2Y4N4.mjs} +1 -1
- package/dist/chunk-ONNK2NEI.mjs +4 -0
- package/dist/{chunk-RS4VD3ML.mjs → chunk-PMYLKWPE.mjs} +1 -1
- package/dist/{chunk-7OMPPFGG.mjs → chunk-PRK2XFAZ.mjs} +1 -1
- package/dist/{chunk-ZFUP5NVF.mjs → chunk-PXLSH6S2.mjs} +1 -1
- package/dist/{chunk-P6OSMPUQ.mjs → chunk-PZZTGPEO.mjs} +1 -1
- package/dist/chunk-RBJOTC2X.mjs +4 -0
- package/dist/chunk-RZELSUQT.mjs +4 -0
- package/dist/{chunk-KVLUT4U2.mjs → chunk-S3P6OGB7.mjs} +1 -1
- package/dist/chunk-SK2QJG6J.mjs +4 -0
- package/dist/{chunk-F64CA5CH.mjs → chunk-T36QUKC6.mjs} +1 -1
- package/dist/{chunk-HSQAHQNP.mjs → chunk-TKCFCYEQ.mjs} +1 -1
- package/dist/{chunk-AGDKFAMN.mjs → chunk-UECG3SCG.mjs} +1 -1
- package/dist/{chunk-KG3MNGT6.mjs → chunk-UENQZNU3.mjs} +1 -1
- package/dist/{chunk-3ANJOET7.mjs → chunk-UX5OJ3WS.mjs} +1 -1
- package/dist/{chunk-BQQ4V4PX.mjs → chunk-WDZOGIT2.mjs} +1 -1
- package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
- package/dist/{chunk-NSWNM3O5.mjs → chunk-X5UJBRSB.mjs} +1 -1
- package/dist/{chunk-U3FYDDE2.mjs → chunk-Y62OBV2E.mjs} +1 -1
- package/dist/{chunk-RFRNTKO7.mjs → chunk-ZAAHG2J7.mjs} +1 -1
- package/dist/chunk-ZCBUDRT7.mjs +4 -0
- package/dist/chunk-ZNSW443Y.mjs +4 -0
- 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/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/example-usage.mjs +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/KnowledgeView.js +1 -1
- package/dist/components/DigitalColleagues/Views/KnowledgeView.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.js +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/document-edit.js +1 -1
- package/dist/components/DigitalColleagues/document-edit.mjs +1 -1
- package/dist/components/DigitalColleagues/document-preview-examples.js +5 -5
- package/dist/components/DigitalColleagues/document-preview-examples.mjs +1 -1
- package/dist/components/DigitalColleagues/document-preview.js +1 -1
- package/dist/components/DigitalColleagues/document-preview.mjs +1 -1
- package/dist/components/DigitalColleagues/index.js +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/DigitalColleagues/knowledge-browser.js +1 -1
- package/dist/components/DigitalColleagues/knowledge-browser.mjs +1 -1
- package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
- package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/RichText/index.js +1 -1
- package/dist/components/Foundary/RichText/index.mjs +1 -1
- package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
- package/dist/components/Foundary/Views/KnowledgeView.js +2 -2
- package/dist/components/Foundary/Views/KnowledgeView.mjs +2 -1
- package/dist/components/Foundary/Views/index.js +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/document-edit.js +1 -1
- package/dist/components/Foundary/document-edit.mjs +1 -1
- package/dist/components/Foundary/document-preview-examples.js +3 -3
- package/dist/components/Foundary/document-preview-examples.mjs +1 -1
- package/dist/components/Foundary/document-preview.js +1 -1
- package/dist/components/Foundary/document-preview.mjs +1 -1
- package/dist/components/Foundary/index.js +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/Foundary/knowledge-browser.js +1 -1
- package/dist/components/Foundary/knowledge-browser.mjs +1 -1
- package/dist/components/HeaderFooter/Header.mjs +1 -1
- package/dist/components/HeaderFooter/HeaderDesktop.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/PostHero/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/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/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Payload/RichText/index.mjs +1 -1
- package/dist/components/Payload/RichText/serialize.mjs +1 -1
- package/dist/components/Payload/index.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.js +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +17 -17
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/globals.css +1 -1
- package/dist/index.js +14 -14
- 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/BlogListSection.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-AREQGH47.mjs +0 -4
- package/dist/chunk-RHR3YOLG.mjs +0 -4
- package/dist/chunk-SX456QYL.mjs +0 -4
- package/dist/chunk-TNQS3NVB.mjs +0 -1
- package/dist/chunk-UK7PR73C.mjs +0 -4
- package/dist/chunk-ZXPDSSCF.mjs +0 -4
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
"use client"
|
|
4
4
|
|
|
5
|
-
"use strict";var Ad=Object.create;var hr=Object.defineProperty;var Id=Object.getOwnPropertyDescriptor;var Md=Object.getOwnPropertyNames;var Ed=Object.getPrototypeOf,Bd=Object.prototype.hasOwnProperty;var Fd=(e,t)=>{for(var a in t)hr(e,a,{get:t[a],enumerable:!0})},Ls=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Md(t))!Bd.call(e,r)&&r!==a&&hr(e,r,{get:()=>t[r],enumerable:!(o=Id(t,r))||o.enumerable});return e};var ie=(e,t,a)=>(a=e!=null?Ad(Ed(e)):{},Ls(t||!e||!e.__esModule?hr(a,"default",{value:e,enumerable:!0}):a,e)),Ld=e=>Ls(hr({},"__esModule",{value:!0}),e);var ym={};Fd(ym,{AppSidebarLeft:()=>Dr,ColleagueCard:()=>ul,ColleagueForm:()=>vl,ColleagueTypeSelection:()=>qr,ColleaguesView:()=>gs,DashboardHeader:()=>fn,DashboardPage:()=>us,DigitalColleageusLayout:()=>zr,DigitalColleagueClone:()=>bl,DigitalColleagueOptions:()=>Xr,DocumentEdit:()=>ti,DocumentPreview:()=>ai,FileView:()=>gr,KnowledgeBrowser:()=>oi,KnowledgeSearch:()=>rr,KnowledgeView:()=>mr,MainPage:()=>is,ManagementSidebar:()=>Jr,PlanningView:()=>ui,ProjectView:()=>Ts,ProjectsIndexView:()=>As,SearchableSelect:()=>ml,TeamForm:()=>Qr,TeamsIndexView:()=>Is});module.exports=Ld(ym);var gn=require("lucide-react");var go=ie(require("@radix-ui/react-collapsible")),hi=go.Root,Os=go.CollapsibleTrigger,js=go.CollapsibleContent;var Li=ie(require("clsx"));var Ws=require("clsx");var wi="-",Od=e=>{let t=Hd(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let s=l.split(wi);return s[0]===""&&s.length!==1&&s.shift(),Us(s,t)||jd(l)},getConflictingClassGroupIds:(l,s)=>{let c=a[l]||[];return s&&o[l]?[...c,...o[l]]:c}}},Us=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Us(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(wi);return t.validators.find(({validator:l})=>l(i))?.classGroupId},Hs=/^\[(.+)\]$/,jd=e=>{if(Hs.test(e)){let t=Hs.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Hd=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Ud(Object.entries(e.classGroups),a).forEach(([i,l])=>{yi(l,o,i,t)}),o},yi=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:zs(t,r);i.classGroupId=a;return}if(typeof r=="function"){if(zd(r)){yi(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([i,l])=>{yi(l,zs(t,i),a,o)})})},zs=(e,t)=>{let a=e;return t.split(wi).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},zd=e=>e.isThemeGetter,Ud=(e,t)=>t?e.map(([a,o])=>{let r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,s])=>[t+l,s])):i);return[a,r]}):e,Vd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(i,l)=>{a.set(i,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(i){let l=a.get(i);if(l!==void 0)return l;if((l=o.get(i))!==void 0)return r(i,l),l},set(i,l){a.has(i)?a.set(i,l):r(i,l)}}},Vs="!",Kd=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],i=t.length,l=s=>{let c=[],n=0,d=0,p;for(let m=0;m<s.length;m++){let D=s[m];if(n===0){if(D===r&&(o||s.slice(m,m+i)===t)){c.push(s.slice(d,m)),d=m+i;continue}if(D==="/"){p=m;continue}}D==="["?n++:D==="]"&&n--}let x=c.length===0?s:s.substring(d),u=x.startsWith(Vs),h=u?x.substring(1):x,b=p&&p>d?p-d:void 0;return{modifiers:c,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:b}};return a?s=>a({className:s,parseClassName:l}):l},Gd=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},$d=e=>({cache:Vd(e.cacheSize),parseClassName:Kd(e),...Od(e)}),_d=/\s+/,Wd=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],l=e.trim().split(_d),s="";for(let c=l.length-1;c>=0;c-=1){let n=l[c],{modifiers:d,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:u}=a(n),h=!!u,b=o(h?x.substring(0,u):x);if(!b){if(!h){s=n+(s.length>0?" "+s:s);continue}if(b=o(x),!b){s=n+(s.length>0?" "+s:s);continue}h=!1}let m=Gd(d).join(":"),D=p?m+Vs:m,R=D+b;if(i.includes(R))continue;i.push(R);let S=r(b,h);for(let M=0;M<S.length;++M){let ee=S[M];i.push(D+ee)}s=n+(s.length>0?" "+s:s)}return s};function Jd(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ks(t))&&(o&&(o+=" "),o+=a);return o}var Ks=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ks(e[o]))&&(a&&(a+=" "),a+=t);return a};function qd(e,...t){let a,o,r,i=l;function l(c){let n=t.reduce((d,p)=>p(d),e());return a=$d(n),o=a.cache.get,r=a.cache.set,i=s,s(c)}function s(c){let n=o(c);if(n)return n;let d=Wd(c,a);return r(c,d),d}return function(){return i(Jd.apply(null,arguments))}}var $e=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Gs=/^\[(?:([a-Js-]+):)?(.+)\]$/i,Xd=/^\d+\/\d+$/,Yd=new Set(["px","full","screen"]),Qd=/^(\d+(\.\d+)?)?(xr|sm|md|lg|ja)$/,Zd=/\d+(%|px|r?em|[sdl]?Js([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ec=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tc=/^(inset_)?-?((\d+)?\.?(\d+)[a-Js]+|0)Js-?((\d+)?\.?(\d+)[a-Js]+|0)/,ac=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ya=e=>fo(e)||Yd.has(e)||Xd.test(e),Ea=e=>vo(e,"length",cc),fo=e=>!!e&&!Number.isNaN(Number(e)),xi=e=>vo(e,"number",fo),Vo=e=>!!e&&Number.isInteger(Number(e)),oc=e=>e.endsWith("%")&&fo(e.slice(0,-1)),ue=e=>Gs.test(e),Ba=e=>Qd.test(e),rc=new Set(["length","size","percentage"]),ic=e=>vo(e,rc,$s),sc=e=>vo(e,"position",$s),nc=new Set(["image","url"]),lc=e=>vo(e,nc,pc),dc=e=>vo(e,"",mc),Ko=()=>!0,vo=(e,t,a)=>{let o=Gs.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},cc=e=>Zd.test(e)&&!ec.test(e),$s=()=>!1,mc=e=>tc.test(e),pc=e=>ac.test(e);var uc=()=>{let e=$e("colors"),t=$e("spacing"),a=$e("blur"),o=$e("brightness"),r=$e("borderColor"),i=$e("borderRadius"),l=$e("borderSpacing"),s=$e("borderWidth"),c=$e("contrast"),n=$e("grayscale"),d=$e("hueRotate"),p=$e("invert"),x=$e("gap"),u=$e("gradientColorStops"),h=$e("gradientColorStopPositions"),b=$e("inset"),m=$e("margin"),D=$e("opacity"),R=$e("padding"),S=$e("saturate"),M=$e("scale"),ee=$e("sepia"),k=$e("skew"),Z=$e("space"),A=$e("translate"),O=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",ue,t],N=()=>[ue,t],je=()=>["",ya,Ea],C=()=>["auto",fo,ue],Ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ce=()=>["solid","dashed","dotted","double","none"],Dt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],lt=()=>["start","end","center","between","around","evenly","stretch"],Ot=()=>["","0",ue],zt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>[fo,ue];return{cacheSize:500,separator:":",theme:{colors:[Ko],spacing:[ya,Ea],blur:["none","",Ba,ue],brightness:E(),borderColor:[e],borderRadius:["none","","full",Ba,ue],borderSpacing:N(),borderWidth:je(),contrast:E(),grayscale:Ot(),hueRotate:E(),invert:Ot(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[oc,Ea],inset:W(),margin:W(),opacity:E(),padding:N(),saturate:E(),scale:E(),sepia:Ot(),skew:E(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",ue]}],container:["container"],columns:[{columns:[Ba]}],"break-after":[{"break-after":zt()}],"break-before":[{"break-before":zt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ne(),ue]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],Js:[{Js:["auto",Vo,ue]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ue]}],grow:[{grow:Ot()}],shrink:[{shrink:Ot()}],order:[{order:["first","last","none",Vo,ue]}],"grid-cols":[{"grid-cols":[Ko]}],"col-start-end":[{col:["auto",{span:["full",Vo,ue]},ue]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Ko]}],"row-start-end":[{row:["auto",{span:[Vo,ue]},ue]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ue]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...lt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...lt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...lt(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],xr:[{xr:[R]}],Js:[{Js:[R]}],pt:[{pt:[R]}],ja:[{ja:[R]}],pb:[{pb:[R]}],xr:[{xr:[R]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[Z]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Z]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ue,t]}],"min-w":[{"min-w":[ue,t,"min","max","fit"]}],"max-w":[{"max-w":[ue,t,"none","full","min","max","fit","prose",{screen:[Ba]},Ba]}],h:[{h:[ue,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ue,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ue,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ue,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ba,Ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",xi]}],"font-family":[{font:[Ko]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ue]}],"line-clamp":[{"line-clamp":["none",fo,xi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ya,ue]}],"list-image":[{"list-image":["none",ue]}],"list-style-type":[{list:["none","disc","decimal",ue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[D]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[D]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ya,Ea]}],"underline-offset":[{"underline-offset":["auto",ya,ue]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[D]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ne(),sc]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ic]}],"bg-image":[{bg:["none",{"gradient-to":["t","Js","r","br","b","bl","l","Tn"]},lc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[u]}],"gradient-via":[{via:[u]}],"gradient-to":[{to:[u]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Js":[{"rounded-Js":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-Tn":[{"rounded-Tn":[i]}],"rounded-Js":[{"rounded-Js":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[D]}],"border-style":[{border:[...ce(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[D]}],"divide-style":[{divide:ce()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...ce()]}],"outline-offset":[{"outline-offset":[ya,ue]}],"outline-w":[{outline:[ya,Ea]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[D]}],"ring-offset-w":[{"ring-offset":[ya,Ea]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ba,dc]}],"shadow-color":[{shadow:[Ko]}],opacity:[{opacity:[D]}],"mix-blend":[{"mix-blend":[...Dt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Dt()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ba,ue]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[S]}],sepia:[{sepia:[ee]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[D]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ue]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",ue]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",ue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Vo,ue]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ue]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Js-resize","nw-resize","Js-resize","sw-resize","ew-resize","xr-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-xr":[{"scroll-xr":N()}],"scroll-Js":[{"scroll-Js":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-ja":[{"scroll-ja":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-xr":[{"scroll-xr":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ya,Ea,xi]}],stroke:[{stroke:[e,"none"]}],ja:["ja-only","not-ja-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","xr","Js","pt","ja","pb","xr"],px:["ja","xr"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-Js","rounded-ee","rounded-es","rounded-Tn","rounded-Js","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Js","rounded-ee"],"rounded-t":["rounded-Tn","rounded-Js"],"rounded-r":["rounded-Js","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-Tn","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-xr","scroll-Js","scroll-pt","scroll-ja","scroll-pb","scroll-xr"],"scroll-px":["scroll-ja","scroll-xr"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var _s=qd(uc);function f(...e){return _s((0,Ws.clsx)(e))}var Js=require("react/jsx-runtime");function Tt({className:e,...t}){return(0,Js.jsx)("div",{className:f("animate-pulse rounded-md bg-primary/10",e),...t})}var be=ie(require("react")),yo=require("@radix-ui/react-slot"),cn=require("class-variance-authority");var xr=require("react"),qs=(e=768)=>{let[t,a]=(0,xr.useState)(!1);return(0,xr.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var Qs=ie(require("react")),yr=(0,cn.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),w=Qs.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},i)=>(0,Js.jsx)(e?yo.Slot:"button",{className:f(yr({className:t,size:a,variant:o})),ref:i,...r}));w.displayName="Button";var en=ie(require("react"));var $=en.forwardRef(({className:e,type:t,...a},o)=>(0,Js.jsx)("input",{type:t,className:f("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));$.displayName="Input";var an=ie(require("react")),Ni=ie(require("@radix-ui/react-separator"));var Go=an.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},r)=>(0,Js.jsx)(Ni.Root,{ref:r,decorative:a,orientation:t,className:f("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Go.displayName=Ni.Root.displayName;var $o=ie(require("react")),ht=ie(require("@radix-ui/react-dialog")),rn=require("@radix-ui/react-icons");var nn=ht.Root;var gc=ht.Portal,ln=$o.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(ht.Overlay,{className:f("fixed inset-0 Js-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));ln.displayName=ht.Overlay.displayName;var fc=(0,cn.cva)("fixed Js-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ci=$o.forwardRef(({side:e="right",className:t,children:a,...o},r)=>(0,Js.jsxs)(gc,{children:[(0,Js.jsx)(ln,{}),(0,Js.jsxs)(ht.Content,{ref:r,className:f(fc({side:e}),t),...o,children:[(0,Js.jsxs)(ht.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,Js.jsx)(rn.Cross2Icon,{className:"h-4 w-4"}),(0,Js.jsx)("span",{className:"ja-only",children:"Close"})]}),a]})]}));Ci.displayName=ht.Content.displayName;var vc=({className:e,...t})=>(0,Js.jsx)("div",{className:f("flex flex-col space-y-2 text-center sm:text-left",e),...t});vc.displayName="SheetHeader";var bc=({className:e,...t})=>(0,Js.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});bc.displayName="SheetFooter";var hc=$o.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(ht.Title,{ref:a,className:f("text-lg font-semibold text-foreground",e),...t}));hc.displayName=ht.Title.displayName;var xc=$o.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(ht.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));xc.displayName=ht.Description.displayName;var dn=ie(require("react")),ia=ie(require("@radix-ui/react-tooltip"));var bo=ia.Provider,ho=ia.Root,xo=ia.Trigger,_a=dn.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Js.jsx)(ia.Portal,{children:(0,Js.jsx)(ia.Content,{ref:o,sideOffset:t,className:f("Js-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xr text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));_a.displayName=ia.Content.displayName;var yc="sidebar:state",wc=60*60*24*7,Nc="16rem",Cc="18rem",Sc="3rem",Dc="b",pn=be.createContext(null);function wr(){let e=be.useContext(pn);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var Di=be.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:r,children:i,...l},s)=>{let c=qs(),[n,d]=be.useState(!1),[p,x]=be.useState(e),u=t??p,h=be.useCallback(R=>{if(a)return a?.(typeof R=="function"?R(u):R);x(R),document.cookie=`${yc}=${u}; path=/; max-age=${wc}`},[a,u]),b=be.useCallback(()=>c?d(R=>!R):h(R=>!R),[c,h,d]);be.useEffect(()=>{let R=S=>{S.key===Dc&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),b())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[b]);let m=u?"expanded":"collapsed",D=be.useMemo(()=>({state:m,open:u,setOpen:h,isMobile:c,openMobile:n,setOpenMobile:d,toggleSidebar:b}),[m,u,h,c,n,d,b]);return(0,Js.jsx)(pn.Provider,{value:D,children:(0,Js.jsx)(bo,{delayDuration:0,children:(0,Js.jsx)("div",{style:{"--sidebar-width":Nc,"--sidebar-width-icon":Sc,...r},className:f("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...l,children:i})})})});Di.displayName="SidebarProvider";var ki=be.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:r,...i},l)=>{let{isMobile:s,state:c,openMobile:n,setOpenMobile:d}=wr();return a==="none"?(0,Js.jsx)("div",{className:f("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:l,...i,children:r}):s?(0,Js.jsx)(nn,{open:n,onOpenChange:d,...i,children:(0,Js.jsx)(Ci,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Cc},side:e,children:(0,Js.jsx)("div",{className:"flex h-full w-full flex-col",children:r})})}):(0,Js.jsxs)("div",{ref:l,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,Js.jsx)("div",{className:f("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)Js+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,Js.jsx)("div",{className:f("duration-200 fixed top-14 bottom-0 Js-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)Js+_theme(spacing.4)Js+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...i,children:(0,Js.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r})})]})});ki.displayName="Sidebar";var Ti=be.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:r}=wr();return(0,Js.jsxs)(w,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:f("h-7 w-7",e),onClick:i=>{t?.(i),r()},...a,children:[(0,Js.jsx)(gn.PanelLeft,{}),(0,Js.jsx)("span",{className:"ja-only",children:"Toggle Sidebar"})]})});Ti.displayName="SidebarTrigger";var kc=be.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=wr();return(0,Js.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:f("absolute inset-y-0 Js-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]Js&]:cursor-w-resize [[data-side=right]Js&]:cursor-e-resize","[[data-side=left][data-state=collapsed]Js&]:cursor-e-resize [[data-side=right][data-state=collapsed]Js&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]Js&]:-right-2","[[data-side=right][data-collapsible=offcanvas]Js&]:-left-2",e),...t})});kc.displayName="SidebarRail";var Pi=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("main",{ref:a,className:f("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-ja md:peer-data-[variant=inset]:shadow",e),...t}));Pi.displayName="SidebarInset";var Tc=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)($,{ref:a,"data-sidebar":"input",className:f("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Tc.displayName="SidebarInput";var Ri=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,"data-sidebar":"header",className:f("flex flex-col gap-2 p-2",e),...t}));Ri.displayName="SidebarHeader";var Ai=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,"data-sidebar":"footer",className:f("flex flex-col gap-2 p-2",e),...t}));Ai.displayName="SidebarFooter";var Pc=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Go,{ref:a,"data-sidebar":"separator",className:f("mx-2 w-auto bg-sidebar-border",e),...t}));Pc.displayName="SidebarSeparator";var Nr=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,"data-sidebar":"content",className:f("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Nr.displayName="SidebarContent";var Cr=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,"data-sidebar":"group",className:f("relative flex w-full min-w-0 flex-col p-2",e),...t}));Cr.displayName="SidebarGroup";var Rc=be.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Js.jsx)(t?yo.Slot:"div",{ref:o,"data-sidebar":"group-label",className:f("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xr font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a}));Rc.displayName="SidebarGroupLabel";var Ac=be.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Js.jsx)(t?yo.Slot:"button",{ref:o,"data-sidebar":"group-action",className:f("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Ac.displayName="SidebarGroupAction";var Ii=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,"data-sidebar":"group-content",className:f("w-full text-sm",e),...t}));Ii.displayName="SidebarGroupContent";var _o=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("ul",{ref:a,"data-sidebar":"menu",className:f("flex w-full min-w-0 flex-col gap-1",e),...t}));_o.displayName="SidebarMenu";var Wo=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("Js",{ref:a,"data-sidebar":"menu-item",className:f("group/menu-item relative",e),...t}));Wo.displayName="SidebarMenuItem";var Ic=(0,cn.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:ja-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xr",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Sr=be.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:r,className:i,...l},s)=>{let c=e?yo.Slot:"button",{isMobile:n,state:d}=wr(),p=(0,Js.jsx)(c,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:f(Ic({variant:a,size:o}),i),...l});return r?(typeof r=="string"&&(r={children:r}),(0,Js.jsxs)(ho,{children:[(0,Js.jsx)(xo,{asChild:!0,children:p}),(0,Js.jsx)(_a,{side:"right",align:"center",hidden:d!=="collapsed"||n,...r})]})):p});Sr.displayName="SidebarMenuButton";var Mi=be.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},r)=>(0,Js.jsx)(t?yo.Slot:"button",{ref:r,"data-sidebar":"menu-action",className:f("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...o}));Mi.displayName="SidebarMenuAction";var Mc=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:f("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xr font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Mc.displayName="SidebarMenuBadge";var Ec=be.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let r=be.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,Js.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:f("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,Js.jsx)(Tt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,Js.jsx)(Tt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});Ec.displayName="SidebarMenuSkeleton";var Ei=be.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:f("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Ei.displayName="SidebarMenuSub";var Bi=be.forwardRef(({...e},t)=>(0,Js.jsx)("Js",{ref:t,...e}));Bi.displayName="SidebarMenuSubItem";var Fi=be.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...r},i)=>(0,Js.jsx)(e?yo.Slot:"a",{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:f("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xr",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...r}));Fi.displayName="SidebarMenuSubButton";function Dr({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:i,menuHeading:l,onNavClick:s,loading:c=!1,LinkComponent:n,...d}){let x=n?u=>(0,Js.jsx)(n,{...u}):s?({href:u,children:h,...b})=>(0,Js.jsx)("button",{onClick:()=>s&&s(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:h}):u=>(0,Js.jsx)("a",{...u});return(0,Js.jsxs)(ki,{...d,variant:"inset",children:[(0,Js.jsx)(Ri,{children:(0,Js.jsx)(_o,{children:(0,Js.jsx)(Wo,{children:c?(0,Js.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Js.jsx)(Tt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Js.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Js.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,Js.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),c&&(0,Js.jsxs)(Nr,{children:[(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Js.jsx)(Tt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Js.jsxs)(Nr,{children:[(0,Js.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!c&&a.map((u,h)=>(0,Js.jsx)(un,{subNav:u,pathName:i,Link:x},h)),(0,Js.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!c&&e.map((u,h)=>(0,Js.jsx)(un,{subNav:u,pathName:i,Link:x},h)),(0,Js.jsx)(Cr,{className:"mt-auto",children:(0,Js.jsx)(Ii,{children:(0,Js.jsx)(_o,{children:t&&!c&&t.map(u=>(0,Js.jsx)(Wo,{children:(0,Js.jsx)(Sr,{asChild:!0,size:"sm",children:(0,Js.jsxs)(x,{href:u.url||"",children:[u.icon&&(0,Js.jsx)(u.icon,{}),(0,Js.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,Js.jsx)(Ai,{})]})}function un({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Js.jsx)(hi,{defaultOpen:!0,className:"group/collapsible",children:(0,Js.jsx)(Cr,{className:"py-0",children:(0,Js.jsx)(_o,{children:(0,Js.jsx)(hi,{asChild:!0,defaultOpen:o.isActive,children:(0,Js.jsxs)(Wo,{children:[(0,Js.jsx)(Sr,{asChild:!0,tooltip:o.label,className:(0,Li.default)(r&&"font-bold text-accent"),children:(0,Js.jsxs)(a,{href:o.url,children:[o.icon&&(0,Js.jsx)(o.icon,{}),(0,Js.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsx)(Os,{asChild:!0,children:(0,Js.jsxs)(Mi,{className:"data-[state=open]:rotate-90",children:[(0,Js.jsx)(gn.ChevronRight,{}),(0,Js.jsx)("span",{className:"ja-only",children:"Toggle"})]})}),(0,Js.jsx)(js,{children:(0,Js.jsx)(Ei,{children:o.links?.map(i=>(0,Js.jsx)(Bi,{children:(0,Js.jsx)(Fi,{asChild:!0,className:(0,Li.default)(i.url===t&&"font-bold text-accent"),children:(0,Js.jsx)(a,{href:i.url,children:(0,Js.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var kr=ie(require("react")),wa=ie(require("@radix-ui/react-avatar"));var Kt=kr.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(wa.Root,{ref:a,className:f("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Kt.displayName=wa.Root.displayName;var Wa=kr.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(wa.Image,{ref:a,className:f("aspect-square h-full w-full",e),...t}));Wa.displayName=wa.Image.displayName;var Gt=kr.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(wa.Fallback,{ref:a,className:f("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Gt.displayName=wa.Fallback.displayName;var Na=ie(require("react")),Ce=ie(require("@radix-ui/react-dropdown-menu"));var No=Ce.Root,Co=Ce.Trigger;var Bc=Na.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,Js.jsxs)(Ce.SubTrigger,{ref:r,className:f("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"xr-8",e),...o,children:[a,(0,Js.jsx)(rn.ChevronRightIcon,{className:"ml-auto"})]}));Bc.displayName=Ce.SubTrigger.displayName;var Fc=Na.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Ce.SubContent,{ref:a,className:f("Js-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Fc.displayName=Ce.SubContent.displayName;var Ja=Na.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Js.jsx)(Ce.Portal,{children:(0,Js.jsx)(Ce.Content,{ref:o,sideOffset:t,className:f("Js-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ja.displayName=Ce.Content.displayName;var ma=Na.forwardRef(({className:e,inset:t,...a},o)=>(0,Js.jsx)(Ce.Item,{ref:o,className:f("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"xr-8",e),...a}));ma.displayName=Ce.Item.displayName;var Lc=Na.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,Js.jsxs)(Ce.CheckboxItem,{ref:r,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 xr-8 ja-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,Js.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Js.jsx)(Ce.ItemIndicator,{children:(0,Js.jsx)(rn.CheckIcon,{className:"h-4 w-4"})})}),t]}));Lc.displayName=Ce.CheckboxItem.displayName;var Oc=Na.forwardRef(({className:e,children:t,...a},o)=>(0,Js.jsxs)(Ce.RadioItem,{ref:o,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 xr-8 ja-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,Js.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Js.jsx)(Ce.ItemIndicator,{children:(0,Js.jsx)(rn.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Oc.displayName=Ce.RadioItem.displayName;var Oi=Na.forwardRef(({className:e,inset:t,...a},o)=>(0,Js.jsx)(Ce.Label,{ref:o,className:f("px-2 py-1.5 text-sm font-semibold",t&&"xr-8",e),...a}));Oi.displayName=Ce.Label.displayName;var ji=Na.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Ce.Separator,{ref:a,className:f("-mx-1 my-1 h-px bg-muted",e),...t}));ji.displayName=Ce.Separator.displayName;var jc=({className:e,...t})=>(0,Js.jsx)("span",{className:f("ml-auto text-xr tracking-widest opacity-60",e),...t});jc.displayName="DropdownMenuShortcut";var fn=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Js.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 Js-50",children:(0,Js.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Js.jsx)(w,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Js.jsx)(gn.Menu,{className:"h-5 w-5"})}),(0,Js.jsx)("h1",{className:"text-2xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Js.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Js.jsxs)(w,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Js.jsx)(gn.Bell,{className:"h-5 w-5"}),(0,Js.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-xr text-white flex items-center justify-center",children:"3"})]}),(0,Js.jsxs)(No,{children:[(0,Js.jsx)(Co,{asChild:!0,children:(0,Js.jsx)(w,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Js.jsxs)(Kt,{className:"h-10 w-10",children:[(0,Js.jsx)(Wa,{src:"/avatars/01.png",alt:"@user"}),(0,Js.jsx)(Gt,{children:"JD"})]})})}),(0,Js.jsxs)(Ja,{className:"w-56",align:"end",forceMount:!0,children:[(0,Js.jsx)(Oi,{className:"font-normal",children:(0,Js.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Js.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Js.jsx)("p",{className:"text-xr leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Js.jsx)(ji,{}),(0,Js.jsxs)(ma,{children:[(0,Js.jsx)(gn.User,{className:"mr-2 h-4 w-4"}),(0,Js.jsx)("span",{children:"Profile"})]}),(0,Js.jsxs)(ma,{children:[(0,Js.jsx)(gn.Settings,{className:"mr-2 h-4 w-4"}),(0,Js.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var Lr=ie(require("react")),Ui=ie(require("next/link"));var Hc=(0,cn.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xr font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Y({className:e,variant:t,...a}){return(0,Js.jsx)("div",{className:f(Hc({variant:t}),e),...a})}var Hi=ie(require("react")),qt=ie(require("@radix-ui/react-scroll-area"));var pa=Hi.forwardRef(({className:e,children:t,...a},o)=>(0,Js.jsxs)(qt.Root,{ref:o,className:f("relative overflow-hidden",e),...a,children:[(0,Js.jsx)(qt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Js.jsx)(hn,{}),(0,Js.jsx)(qt.Corner,{})]}));pa.displayName=qt.Root.displayName;var hn=Hi.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Js.jsx)(qt.ScrollAreaScrollbar,{ref:o,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,Js.jsx)(qt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));hn.displayName=qt.ScrollAreaScrollbar.displayName;var Jo=ie(require("react")),yt=ie(require("@radix-ui/react-dialog"));var wt=yt.Root;var zc=yt.Portal;var yn=Jo.forwardRef(({className:e,...t},a)=>(0,$t.jsx)(yt.Overlay,{ref:a,className:f("fixed inset-0 Js-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));yn.displayName=yt.Overlay.displayName;var dt=Jo.forwardRef(({className:e,children:t,...a},o)=>(0,$t.jsxs)(zc,{children:[(0,$t.jsx)(yn,{}),(0,$t.jsxs)(yt.Content,{ref:o,className:f("fixed left-[50%] top-[50%] Js-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,$t.jsxs)(yt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,$t.jsx)(gn.X,{className:"h-4 w-4"}),(0,$t.jsx)("span",{className:"ja-only",children:"Close"})]})]})]}));dt.displayName=yt.Content.displayName;var ct=({className:e,...t})=>(0,$t.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ct.displayName="DialogHeader";var qo=({className:e,...t})=>(0,$t.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});qo.displayName="DialogFooter";var mt=Jo.forwardRef(({className:e,...t},a)=>(0,$t.jsx)(yt.Title,{ref:a,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));mt.displayName=yt.Title.displayName;var Xo=Jo.forwardRef(({className:e,...t},a)=>(0,$t.jsx)(yt.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));Xo.displayName=yt.Description.displayName;var Yo=ie(require("@radix-ui/react-checkbox")),Nn=ie(require("react")),Qo=Nn.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Yo.Root,{className:f("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,Js.jsx)(Yo.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,Js.jsx)(gn.Check,{className:"h-4 w-4"})})}));Qo.displayName=Yo.Root.displayName;var ua=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),Sn=[{id:"home",title:"Home",icon:(0,Js.jsx)(gn.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Js.jsx)(gn.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Js.jsx)(gn.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Me",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Js.jsx)(gn.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Js.jsx)(gn.FileText,{}),url:"/knowledge"}],Dn=[{id:"1",title:"New comment Js your post",description:"Alex Morgan commented Js your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"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")},{id:"4",title:"Update successful",description:"PixelMaster has been updated to 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")},{id:"5",title:"Storage limit reached",description:"You'Js used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"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")},{id:"7",title:"New tutorial available",description:"A new tutorial Js 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],kn=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Js.jsx)(gn.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Js.jsx)(gn.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Js.jsx)(gn.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Js.jsx)(gn.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Js.jsx)(gn.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Js.jsx)(gn.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Js.jsx)(gn.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Js.jsx)(gn.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"Js",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Js.jsx)(gn.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Js.jsx)(gn.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Ir=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var zi=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Rr=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Er=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Uc=[...Er,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems Js mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Vc=[...Ir,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Ar={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},Cn={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Er.filter(e=>e.epicId==="1")};var jp={empty:{initialProjects:Ar.projects,initialEpics:Ar.epics,initialSprints:Ar.sprints,initialTasks:Ar.tasks},default:{initialProjects:Ir,initialEpics:zi,initialSprints:Rr,initialTasks:Er},highDensity:{initialProjects:Ir,initialEpics:zi,initialSprints:Rr,initialTasks:Uc},singleEpic:{initialProjects:Ir,initialEpics:Cn.epics,initialSprints:Rr,initialTasks:Cn.tasks},multipleProjects:{initialProjects:Vc,initialEpics:zi,initialSprints:Rr,initialTasks:Er}},Mr=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(ua),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(ua),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused Js driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(ua),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(ua),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(ua),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(ua),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(ua),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(ua),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(ua),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(ua),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Hp=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Mr.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Mr.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Mr.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var zp=Mr.filter(e=>e.type==="digital");function Fr(e,t){let[a,o]=(0,xr.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{o(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,xr.useEffect)(()=>{r(a)},[]),[a,r]}function Vi({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=kn[0],onBusinessUnitChange:i,onSearch:l,className:s,logo:c="/headerlogo.png",appName:n="Nuvia",tagline:d="Collaboration Platform"}){let[p,x]=Lr.useState({}),[u,h]=Fr("sidebar-favorites",{}),[b,m]=Lr.useState(null),[D,R]=Lr.useState(""),S=C=>{x(Ne=>({...Ne,[C]:!Ne[C]}))},M=C=>{i?.(C)},ee=()=>{D.trim()&&l?.(D.trim())},k=C=>{C.key==="Enter"&&(C.preventDefault(),ee())},Z=(C,Ne)=>{let ce=u[C]||[],Dt=ce.includes(Ne)?ce.filter(lt=>lt!==Ne):ce.concat(Ne);h({...u,[C]:Dt})},A=C=>{if(!C.items||!C.maxItems||C.items.length<=C.maxItems)return C.items||[];let Ne=u[C.id]||[],ce=C.items.filter(lt=>Ne.includes(lt.id)),Dt=C.items.filter(lt=>!Ne.includes(lt.id));return[...ce,...Dt].slice(0,C.maxItems)},O=C=>C.maxItems&&C.items&&C.items.length>C.maxItems,j=e,W=C=>{let Ne=O(C),ce=A(C),Dt=(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[C.icon,(0,Js.jsx)("span",{children:C.title})]}),C.badge&&(0,Js.jsx)(Y,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xr",children:C.badge}),C.items&&(0,Js.jsx)(gn.ChevronDown,{className:f("ml-2 h-4 w-4 transition-transform",p[C.title]?"rotate-180":"")})]}),lt=f("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",C.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return C.url?(0,Js.jsx)(Ui.default,{href:C.url,className:lt,onClick:a?o:void 0,children:Dt}):(0,Js.jsx)("button",{className:lt,onClick:()=>C.items&&S(C.title),children:Dt})},N=()=>{let C=e.find(ce=>ce.id===b);if(!C||!C.items||!C.maxItems)return null;let Ne=u[C.id]||[];return(0,Js.jsx)(wt,{open:!!b,onOpenChange:ce=>!ce&&m(null),children:(0,Js.jsxs)(dt,{className:"sm:max-w-md",children:[(0,Js.jsxs)(ct,{children:[(0,Js.jsxs)(mt,{children:["Manage ",C.title," Favorites"]}),(0,Js.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",C.maxItems," items to show in ",C.title.toLowerCase(),"."]})]}),(0,Js.jsx)(pa,{className:"max-h-96 ja-4",children:(0,Js.jsx)("div",{className:"space-y-4",children:C.items.map(ce=>(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)(Qo,{id:ce.id,checked:Ne.includes(ce.id),onCheckedChange:()=>Z(C.id,ce.id),disabled:!Ne.includes(ce.id)&&Ne.length>=(C.maxItems||0)}),(0,Js.jsxs)("label",{htmlFor:ce.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[ce.title,ce.badge&&(0,Js.jsx)(Y,{variant:"outline",className:"text-xr",children:ce.badge})]})]},ce.id))})})]})})},je=(0,Js.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Js.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Js.jsx)("img",{src:c,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h2",{className:"font-semibold",children:n}),(0,Js.jsx)("p",{className:"text-xr text-muted-foreground",children:d})]})]}),a&&(0,Js.jsx)(w,{variant:"ghost",size:"icon",onClick:o,children:(0,Js.jsx)(gn.X,{className:"h-5 w-5"})})]}),(0,Js.jsx)("div",{className:"px-3 py-2",children:(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)(gn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Js.jsx)($,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted xr-9 ja-4 py-2",value:D,onChange:C=>R(C.target.value),onKeyPress:k})]})}),(0,Js.jsx)(pa,{className:"flex-1 px-3 py-2",children:(0,Js.jsx)("div",{className:"space-y-1",children:j.map(C=>(0,Js.jsxs)("div",{className:"mb-1",children:[W(C),C.items&&p[C.title]&&(0,Js.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l xr-3",children:[A(C).map(Ne=>(0,Js.jsxs)(Ui.default,{href:Ne.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[Ne.title,Ne.badge&&(0,Js.jsx)(Y,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xr",children:Ne.badge})]},Ne.id)),O(C)&&C.items&&C.items.length>A(C).length&&(0,Js.jsxs)("button",{onClick:()=>m(C.id),className:"w-full px-3 py-2 text-xr text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",C.items.length-A(C).length," more available"]})]})]},C.id))})}),(0,Js.jsx)("div",{className:"p-3",children:(0,Js.jsx)("div",{className:"space-y-1",children:(0,Js.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Js.jsx)(gn.Settings,{className:"h-5 w-5"}),(0,Js.jsx)("span",{children:"Settings"})]})})}),(0,Js.jsx)(N,{})]});return a?(0,Js.jsx)("div",{className:f("fixed inset-y-0 left-0 Js-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:je}):(0,Js.jsx)("div",{className:f("fixed inset-y-0 left-0 Js-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:je})}var ja=require("motion/react");var Tn=require("next-themes");function Pn(){let{setTheme:e,theme:t}=(0,Tn.useTheme)();return(0,Js.jsx)(bo,{children:(0,Js.jsxs)(ho,{children:[(0,Js.jsx)(xo,{asChild:!0,children:(0,Js.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Js.jsx)(gn.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Js.jsx)(gn.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Js.jsx)("span",{className:"ja-only",children:"Toggle theme"})]})}),(0,Js.jsx)(_a,{children:"Toggle theme"})]})})}function Rn({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:i}){let l=e.filter(n=>!n.read),s=l.length,c=n=>{switch(n){case"info":return(0,Js.jsx)(gn.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Js.jsx)(gn.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Js.jsx)(gn.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Js.jsx)(gn.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Js.jsx)(ja.AnimatePresence,{children:t&&(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsx)(ja.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 Js-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Js.jsx)(ja.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:f("fixed inset-y-0 right-0 Js-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,Js.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.Bell,{className:"h-5 w-5"}),(0,Js.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Js.jsxs)(Y,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Js.jsxs)(w,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Js.jsx)(gn.X,{className:"h-5 w-5"}),(0,Js.jsx)("span",{className:"ja-only",children:"Close"})]})]}),s>0&&(0,Js.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Js.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Js.jsx)(w,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,Js.jsx)(pa,{className:"flex-1",children:(0,Js.jsx)("div",{className:"divide-y",children:l.map(n=>(0,Js.jsxs)("div",{className:f("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Js.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(n.type)}),(0,Js.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)("p",{className:"font-medium",children:n.title}),(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)("p",{className:"text-xr text-muted-foreground",children:n.time}),(0,Js.jsx)(w,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(n.id),title:"Dismiss",children:(0,Js.jsx)(gn.Check,{className:"h-3 w-3"})})]})]}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description}),n.actionLabel&&(0,Js.jsxs)(w,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:n.onAction,children:[n.actionLabel,(0,Js.jsx)(gn.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},n.id))})}):(0,Js.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Js.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Js.jsx)(gn.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Js.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Js.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'Js appear here."})]})]})})]})})}var qa=ie(require("@radix-ui/react-tabs"));function An({className:e,...t}){return(0,Js.jsx)(qa.Root,{"data-slot":"tabs",className:f("flex flex-col gap-2",e),...t})}function In({className:e,...t}){return(0,Js.jsx)(qa.List,{"data-slot":"tabs-list",className:f("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Mn({className:e,...t}){return(0,Js.jsx)(qa.Trigger,{"data-slot":"tabs-trigger",className:f("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function So({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:i=6}){let l=a.find(s=>s.value===e);return(0,Js.jsxs)(ja.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Js.jsx)("div",{className:"hidden lg:block",children:(0,Js.jsx)(An,{value:e,onValueChange:t,children:(0,Js.jsx)(In,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(i,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Js.jsx)(Mn,{value:s.value,className:"w-full h-8 rounded-ja data-[state=active]:rounded-ja transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Js.jsx)("div",{className:"lg:hidden",children:(0,Js.jsxs)(No,{children:[(0,Js.jsx)(Co,{asChild:!0,children:(0,Js.jsxs)(w,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,Js.jsx)(gn.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Js.jsx)(Ja,{align:"center",className:"w-[180px]",children:a.map(s=>(0,Js.jsx)(ma,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function Bn({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:i,activeTab:l="assistant",onTabChange:s,showTabs:c=!0,tabOptions:n=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:p=(0,Js.jsx)(gn.Bot,{className:"mr-2 h-4 w-4"}),actionText:x="Action",onNotificationRemove:u,onRemoveAll:h,logo:b="/headerlogo.png",appName:m="Nuvia",tagline:D="Collaboration Platform"}){let[R,S]=(0,xr.useState)(!1),[M,ee]=(0,xr.useState)(t),k=M.filter(O=>!O.read).length,Z=O=>{ee(j=>j.filter(W=>W.id!==O)),u?.(O)},A=()=>{ee(O=>O.filter(j=>j.read)),h?.()};return(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsxs)("header",{className:`sticky top-0 Js-10 flex h-16 items-center gap-3 xr-2 ja-4 backdrop-blur ${i||""}`,children:[(0,Js.jsx)(w,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Js.jsx)(gn.Menu,{className:"h-5 w-5"})}),(0,Js.jsx)(w,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Js.jsx)(gn.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,Js.jsxs)(ja.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Js.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Js.jsx)("img",{src:b,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h2",{className:"font-semibold text-sm",children:m}),(0,Js.jsx)("p",{className:"text-xr text-muted-foreground",children:D})]})]}),(0,Js.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Js.jsx)(So,{activeTab:l,onTabChange:s,tabOptions:n}),(0,Js.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Js.jsx)(ja.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Js.jsxs)(w,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:d,children:[p,x]})})}),(0,Js.jsx)(Pn,{}),(0,Js.jsx)(bo,{children:(0,Js.jsxs)(ho,{children:[(0,Js.jsx)(xo,{asChild:!0,children:(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Js.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>S(!0),children:[(0,Js.jsx)(ja.motion.div,{animate:k>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:k>0?1/0:0,repeatDelay:3},children:(0,Js.jsx)(gn.Bell,{className:"h-5 w-5"})}),k>0&&(0,Js.jsx)(ja.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xr text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:k})]})})}),(0,Js.jsx)(_a,{children:"Notifications"})]})}),(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Js.jsxs)(Kt,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Js.jsx)(Wa,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Js.jsx)(Gt,{})]})})]})]})]}),(0,Js.jsx)(Rn,{notifications:M,open:R,onClose:()=>S(!1),onNotificationRemove:Z,onRemoveAll:A})]})}var Fn=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Js.jsx)(gn.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function zr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Fn[0],onBusinessUnitChange:i,onSearch:l,businessUnits:s=Fn,activeTab:c,onTabChange:n,showTabs:d=!1,onActionClick:p,actionIcon:x,actionText:u="Action",onNotificationRemove:h,onRemoveAll:b,logo:m="/headerlogo.png",appName:D="Nuvia",tagline:R="Collaboration Platform",sidebarInitiallyClosed:S=!1}){let[M,ee]=(0,xr.useState)(!S),[k,Z]=(0,xr.useState)(!1),[A,O]=(0,xr.useState)(r),j=W=>{O(W),i?.(W)};return(0,Js.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-ja bg-background w-[]",children:[k&&(0,Js.jsx)("div",{className:"fixed inset-0 Js-40 bg-black/50 md:hidden",onClick:()=>Z(!1)}),(0,Js.jsx)("div",{className:"md:hidden",children:(0,Js.jsx)(Vi,{items:e,isOpen:k,isMobile:!0,onClose:()=>Z(!1),currentBusinessUnit:A,onBusinessUnitChange:j,onSearch:l,logo:m,appName:D,tagline:R})}),(0,Js.jsx)("div",{className:"hidden md:block",children:(0,Js.jsx)(Vi,{items:e,isOpen:M,isMobile:!1,currentBusinessUnit:A,onBusinessUnitChange:j,onSearch:l,logo:m,appName:D,tagline:R})}),(0,Js.jsxs)("div",{className:f("min-h-screen fixed w-full transition-all duration-300 ease-in-out",M?"md:xr-64":"md:xr-0"),children:[(0,Js.jsx)(Bn,{title:a,notifications:o,onToggleSidebar:()=>ee(!M),onToggleMobileMenu:()=>Z(!0),sidebarOpen:M,activeTab:c,onTabChange:n,showTabs:d,onActionClick:p,actionIcon:x,actionText:u,onNotificationRemove:h,onRemoveAll:b,logo:m,appName:D,tagline:R}),(0,Js.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Do=ie(require("react"));var $i=Do.forwardRef(({...e},t)=>(0,Js.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));$i.displayName="Breadcrumb";var _i=Do.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("ol",{ref:a,className:f("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));_i.displayName="BreadcrumbList";var Vr=Do.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("Js",{ref:a,className:f("inline-flex items-center gap-1.5",e),...t}));Vr.displayName="BreadcrumbItem";var Wi=Do.forwardRef(({asChild:e,className:t,...a},o)=>(0,Js.jsx)(e?yo.Slot:"a",{ref:o,className:f("transition-colors hover:text-foreground",t),...a}));Wi.displayName="BreadcrumbLink";var Ji=Do.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:f("font-normal text-foreground",e),...t}));Ji.displayName="BreadcrumbPage";var qi=({children:e,className:t,...a})=>(0,Js.jsx)("Js",{role:"presentation","aria-hidden":"true",className:f("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,Js.jsx)(rn.ChevronRightIcon,{})});qi.displayName="BreadcrumbSeparator";var Kc=({className:e,...t})=>(0,Js.jsxs)("span",{role:"presentation","aria-hidden":"true",className:f("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,Js.jsx)(rn.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,Js.jsx)("span",{className:"ja-only",children:"More"})]});Kc.displayName="BreadcrumbElipssis";var $r=ie(require("react")),Gc=1,$c=1e6;var Xi=0;function _c(){return Xi=(Xi+1)%Number.MAX_SAFE_INTEGER,Xi.toString()}var Yi=new Map,jn=e=>{if(Yi.has(e))return;let t=setTimeout(()=>{Yi.delete(e),er({type:"REMOVE_TOAST",toastId:e})},$c);Yi.set(e,t)},Wc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Gc)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?jn(a):e.toasts.forEach(o=>{jn(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},Kr=[],Gr={toasts:[]};function er(e){Gr=Wc(Gr,e),Kr.forEach(t=>{t(Gr)})}function Jc({...e}){let t=_c(),a=r=>er({type:"UPDATE_TOAST",toast:{...r,id:t}}),o=()=>er({type:"DISMISS_TOAST",toastId:t});return er({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||o()}}}),{id:t,dismiss:o,update:a}}function Hn(){let[e,t]=$r.useState(Gr);return $r.useEffect(()=>(Kr.push(t),()=>{let a=Kr.indexOf(t);a>-1&&Kr.splice(a,1)}),[e]),{...e,toast:Jc,dismiss:a=>er({type:"DISMISS_TOAST",toastId:a})}}var Xa=ie(require("react")),pt=ie(require("@radix-ui/react-toast"));var Vn=pt.Provider,Qi=Xa.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(pt.Viewport,{ref:a,className:f("fixed top-0 Js-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Qi.displayName=pt.Viewport.displayName;var qc=(0,cn.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 ja-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Zi=Xa.forwardRef(({className:e,variant:t,...a},o)=>(0,Js.jsx)(pt.Root,{ref:o,className:f(qc({variant:t}),e),...a}));Zi.displayName=pt.Root.displayName;var Xc=Xa.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(pt.Action,{ref:a,className:f("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Xc.displayName=pt.Action.displayName;var es=Xa.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(pt.Close,{ref:a,className:f("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,Js.jsx)(gn.X,{className:"h-4 w-4"})}));es.displayName=pt.Close.displayName;var ts=Xa.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(pt.Title,{ref:a,className:f("text-sm font-semibold [&+div]:text-xr",e),...t}));ts.displayName=pt.Title.displayName;var as=Xa.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(pt.Description,{ref:a,className:f("text-sm opacity-90",e),...t}));as.displayName=pt.Description.displayName;function Kn(){let{toasts:e}=Hn();return(0,Js.jsxs)(Vn,{children:[e.map(function({id:t,title:a,description:o,action:r,...i}){return(0,Js.jsxs)(Zi,{...i,children:[(0,Js.jsxs)("div",{className:"grid gap-1",children:[a&&(0,Js.jsx)(ts,{children:a}),o&&(0,Js.jsx)(as,{children:o})]}),r,(0,Js.jsx)(es,{})]},t)}),(0,Js.jsx)(Qi,{})]})}var Gn=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let r=e.includes("gn-")?e+" ":"gn-"+e+" ",i="gn-"+t,l=o??"",s=r+i+" gn-"+a+" "+l;return(0,$n.jsx)("i",{className:s})};var ko=require("@headlessui/react"),Wn=require("@heroicons/react/20/solid");var Yc=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Js.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Js.jsxs)("span",{className:"relative",children:[e,(0,Js.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,Js.jsxs)(ko.Popover,{children:[(0,Js.jsxs)(ko.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Js.jsxs)("span",{className:"relative",children:[e,(0,Js.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,Js.jsx)(Wn.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Js.jsxs)(ko.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -Js-10 bg-popover mt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,Js.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 ja:gap-x-8 Js-50",children:t&&t.map(r=>(0,Js.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Js.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Js.jsx)(_n,{icon:r.icon,size:"4x"})}),(0,Js.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Js.jsx)("span",{className:"absolute inset-0"})]}),(0,Js.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Js.jsx)("div",{className:"bg-gray-50",children:(0,Js.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Js.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Js.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Js.jsx)(_n,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),_n=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Js.jsx)(Gn,{...e,size:a});if("src"in e)return(0,Js.jsx)("div",{className:f(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Js.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Jn=Yc;var qn=ie(require("next/link"));function Xn({children:e,href:t,openNewTab:a,...o}){return(0,Js.jsx)(qn.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var os=ie(require("next/image"));function ar({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Js.jsxs)(Xn,{href:"/",className:f(a?"py-1":"py-2"),children:[(0,Js.jsx)(os.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,Js.jsx)(os.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function el({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:i=!1}){let[l,s]=(0,xr.useState)(!1),[c,n]=(0,xr.useState)(""),d=["light","dark"],{theme:p,setTheme:x}=(0,Tn.useTheme)();(0,xr.useEffect)(()=>{n(p||"dark")},[p]);let u=()=>{let h=d[(d.indexOf(c)+1)%d.length];n(h),x(h)};return(0,xr.useEffect)(()=>{let h=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,Js.jsx)(Js.Fragment,{children:(0,Js.jsx)("header",{className:`Js-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Js.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Js.jsxs)("div",{className:f("flex items-center justify-between px-9 py-0",!i&&"container"),children:[(0,Js.jsx)(ar,{logoDark:a,logoLight:t}),(0,Js.jsx)(ko.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(h=>(0,Js.jsx)(Jn,{...h},h.name))}),r&&(0,Js.jsx)("button",{className:"fixed right-4 Js-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:u,children:(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)(gn.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Js.jsx)(gn.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Wr=require("@heroicons/react/24/outline");var rs=["light","dark"];function al({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,i]=(0,xr.useState)(!1),{theme:l,setTheme:s}=(0,Tn.useTheme)(),[c,n]=(0,xr.useState)(!1),[d,p]=(0,xr.useState)("light");(0,xr.useEffect)(()=>{let u=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",u,{passive:!0}),()=>window.removeEventListener("scroll",u)},[]),(0,xr.useEffect)(()=>{p(l||"dark")},[l]);let x=()=>{let u=rs[(rs.indexOf(d)+1)%rs.length];p(u),s(u)};return(0,Js.jsx)(Js.Fragment,{children:(0,Js.jsxs)("header",{className:`Js-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Js.jsx)("nav",{className:f("backdrop-blur-sm text-white p-0",c&&"hidden"),children:(0,Js.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&Js.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,Js.jsx)(ar,{logoDark:t,logoLight:e,mobile:!0}),(0,Js.jsx)("div",{className:"flex items-center space-x-4",children:(0,Js.jsxs)("button",{type:"button",onClick:()=>n(!0),className:"fixed right-4 Js-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Js.jsx)("span",{className:"ja-only",children:"Open main menu"}),(0,Js.jsx)(Wr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Js.jsxs)(ko.Dialog,{open:c,onClose:n,className:"lg:hidden",children:[(0,Js.jsx)("div",{className:"fixed inset-0 Js-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Js.jsxs)(ko.DialogPanel,{className:"fixed inset-y-0 right-0 Js-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Js.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Js.jsx)(ar,{logoDark:t,logoLight:e,mobile:!0}),(0,Js.jsxs)("button",{type:"button",onClick:()=>n(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,Js.jsx)("span",{className:"ja-only",children:"Close menu"}),(0,Js.jsx)(Wr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Js.jsx)("div",{className:"mt-6 flow-root",children:(0,Js.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Js.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(u=>(0,Js.jsx)(Qc,{...u},u.name))})})})]})]})]})})}function Qc({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Js.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,Js.jsxs)(ko.Disclosure,{as:"div",className:"-mx-3",children:[(0,Js.jsx)(ko.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 xr-3 ja-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Js.jsx)(ko.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Js.jsx)(ko.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 xr-6 ja-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}function ol({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:i,themeControl:l=!1}){return(0,Js.jsxs)("div",{className:f("fixed top-0 left-0 right-0 Js-50",r),children:[(0,Js.jsx)(el,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:i}),(0,Js.jsx)(al,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var rl="../../cortex-reply-light-27IMI3G7.png";var il="../../cortex-reply-dark-XPAJJJYY.png";function is({...e}){return(0,Js.jsxs)("div",{className:"bg-sidebar",children:[(0,Js.jsx)(ol,{isMenuOpen:!0,logoLight:rl,logoDark:il,...e.header,className:"bg-sidebar",wide:!0}),(0,Js.jsxs)(Di,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Js.jsx)(Dr,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Js.jsxs)(Pi,{className:"grow overflow-hidden",children:[(0,Js.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Js.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Js.jsx)(Ti,{className:"-ml-1"}),(0,Js.jsx)(Go,{orientation:"vertical",className:"mr-2 h-4"}),(0,Js.jsx)($i,{children:(0,Js.jsxs)(_i,{children:[(0,Js.jsx)(Vr,{className:"hidden md:block",children:(0,Js.jsx)(Wi,{href:"#",children:"Building Your Application"})}),(0,Js.jsx)(qi,{className:"hidden md:block"}),(0,Js.jsx)(Vr,{children:(0,Js.jsx)(Ji,{children:"Data Fetching"})})]})})]})}),(0,Js.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,Js.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Js.jsx)("div",{className:"aspect-video rounded-ja bg-muted/50"}),(0,Js.jsx)("div",{className:"aspect-video rounded-ja bg-muted/50"}),(0,Js.jsx)("div",{className:"aspect-video rounded-ja bg-muted/50"})]}),(0,Js.jsx)("div",{className:"flex-1 rounded-ja bg-muted/50 md:min-h-min"})]})]})]}),(0,Js.jsx)(Kn,{})]})}var tm=[{key:"kanban",icon:gn.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:gn.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:gn.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:gn.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:gn.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Jr=({currentView:e,onViewChange:t,children:a})=>(0,Js.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Js.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:tm.map(o=>{let r=o.icon,i=e===o.key;return(0,Js.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:xr-3`,title:o.title,children:[(0,Js.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Js.jsx)("span",{className:"text-xr font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Js.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Js.jsx)("div",{className:"w-full h-full",children:a})})]});var sl=ie(require("react")),ss=ie(require("@radix-ui/react-label"));var am=(0,cn.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=sl.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(ss.Root,{ref:a,className:f(am(),e),...t}));I.displayName=ss.Root.displayName;var Se=ie(require("@radix-ui/react-select")),Ua=ie(require("react")),ot=Se.Root;var Rt=Se.Value,et=Ua.forwardRef(({children:e,className:t,...a},o)=>(0,Js.jsxs)(Se.Trigger,{className:f("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,Js.jsx)(Se.Icon,{asChild:!0,children:(0,Js.jsx)(gn.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));et.displayName=Se.Trigger.displayName;var dl=Ua.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Se.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Js.jsx)(gn.ChevronUp,{className:"h-4 w-4"})}));dl.displayName=Se.ScrollUpButton.displayName;var cl=Ua.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Se.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Js.jsx)(gn.ChevronDown,{className:"h-4 w-4"})}));cl.displayName=Se.ScrollDownButton.displayName;var tt=Ua.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,Js.jsx)(Se.Portal,{children:(0,Js.jsxs)(Se.Content,{className:f("relative Js-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:r,...o,children:[(0,Js.jsx)(dl,{}),(0,Js.jsx)(Se.Viewport,{className:f("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Js.jsx)(cl,{})]})}));tt.displayName=Se.Content.displayName;var om=Ua.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Se.Label,{className:f("py-1.5 xr-8 ja-2 text-sm font-semibold",e),ref:a,...t}));om.displayName=Se.Label.displayName;var ye=Ua.forwardRef(({children:e,className:t,...a},o)=>(0,Js.jsxs)(Se.Item,{className:f("relative flex w-full cursor-default select-none items-center rounded py-1.5 xr-8 ja-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,Js.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Js.jsx)(Se.ItemIndicator,{children:(0,Js.jsx)(gn.Check,{className:"h-4 w-4"})})}),(0,Js.jsx)(Se.ItemText,{children:e})]}));ye.displayName=Se.Item.displayName;var rm=Ua.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(Se.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));rm.displayName=Se.Separator.displayName;var ml=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:l=!1})=>{let[s,c]=(0,xr.useState)(!1),[n,d]=(0,xr.useState)(""),p=o.find(m=>m.value===t),x=o.filter(m=>m.label.toLowerCase().includes(n.toLowerCase())),u=m=>{a(m),c(!1),d("")},h=()=>{i&&n.trim()&&!o.find(m=>m.value===n.trim())&&(a(n.trim()),c(!1),d(""))};return(0,Js.jsxs)("div",{className:"space-y-1",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:e}),(0,Js.jsxs)(ot,{value:t,onValueChange:u,open:s,onOpenChange:m=>{l||c(m)},disabled:l,children:[(0,Js.jsx)(et,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Js.jsx)(Y,{variant:"secondary",className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!l&&c(!s),children:p?.label||t||"Select..."})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsx)("div",{className:"p-2",children:(0,Js.jsx)($,{placeholder:r,value:n,onChange:m=>d(m.target.value),onKeyDown:m=>{m.key==="Enter"&&i&&h()},className:"mb-2"})}),x.map(m=>(0,Js.jsx)(ye,{value:m.value,children:m.label},m.value)),i&&n.trim()&&!x.find(m=>m.value===n.trim())&&(0,Js.jsxs)(ye,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var Za=ie(require("react"));var U=Za.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,className:f("rounded-ja border bg-card text-card-foreground shadow",e),...t}));U.displayName="Card";var Le=Za.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,className:f("flex flex-col space-y-1.5 p-6",e),...t}));Le.displayName="CardHeader";var We=Za.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,className:f("font-semibold leading-none tracking-tight",e),...t}));We.displayName="CardTitle";var eo=Za.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,className:f("text-sm text-muted-foreground",e),...t}));eo.displayName="CardDescription";var fe=Za.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,className:f("p-6 pt-0",e),...t}));fe.displayName="CardContent";var to=Za.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("div",{ref:a,className:f("flex items-center p-6 pt-0",e),...t}));to.displayName="CardFooter";function ul({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:i=!1,className:l}){let[s,c]=(0,xr.useState)(!1),n=x=>{switch(x){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=x=>{switch(x){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},p=x=>{if(!x)return"Never";let h=Math.floor((new Date().getTime()-x.getTime())/(1e3*60));return h<1?"Just now":h<60?`${h}m ago`:h<1440?`${Math.floor(h/60)}h ago`:`${Math.floor(h/1440)}d ago`};return(0,Js.jsxs)(U,{className:f("hover:shadow-md transition-shadow",i&&"p-2",l),children:[(0,Js.jsx)(Le,{className:f("pb-3",i&&"pb-2"),children:(0,Js.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Js.jsx)("div",{className:"relative",children:(0,Js.jsxs)(Kt,{className:f("h-12 w-12",i&&"h-8 w-8"),children:[(0,Js.jsx)(Wa,{src:"/placeholder.svg",alt:e.name}),(0,Js.jsx)(Gt,{children:e.name.split(" ").map(x=>x[0]).join("")})]})}),(0,Js.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)("h3",{className:f("font-semibold text-sm truncate",i&&"text-xr"),children:e.name}),e.type==="digital"?(0,Js.jsx)(gn.Bot,{className:f("h-4 w-4 text-blue-500",i&&"h-3 w-3")}):(0,Js.jsx)(gn.User,{className:f("h-4 w-4 text-green-500",i&&"h-3 w-3")})]}),(0,Js.jsx)("p",{className:f("text-sm text-muted-foreground truncate",i&&"text-xr"),children:e.type==="human"?e.role:e.description}),!i&&(0,Js.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[e.type==="human"&&(0,Js.jsx)(Y,{variant:"secondary",className:"text-xr",children:e.department}),e.type==="digital"&&(0,Js.jsxs)(Y,{variant:"secondary",className:"text-xr",children:["Js",e.version]}),(0,Js.jsx)(Y,{variant:"outline",className:"text-xr",children:d(e.status)})]})]})]}),r&&(0,Js.jsxs)(No,{children:[(0,Js.jsx)(Co,{asChild:!0,children:(0,Js.jsx)(w,{variant:"ghost",size:"icon",className:f("h-8 w-8",i&&"h-6 w-6"),children:(0,Js.jsx)(gn.MoreHorizontal,{className:f("h-4 w-4",i&&"h-3 w-3")})})}),(0,Js.jsxs)(Ja,{align:"end",children:[e.type==="digital"&&(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsxs)(ma,{onClick:()=>o?.(e),children:[(0,Js.jsx)(gn.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,Js.jsxs)(ma,{onClick:()=>t?.(e),children:[(0,Js.jsx)(gn.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,Js.jsxs)(ma,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Js.jsx)(gn.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!i&&(0,Js.jsxs)(fe,{className:"pt-0",children:[(0,Js.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Js.jsx)(gn.Mail,{className:"h-3 w-3"}),(0,Js.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Js.jsxs)(Js.Fragment,{children:[e.phone&&(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Js.jsx)(gn.Phone,{className:"h-3 w-3"}),(0,Js.jsx)("span",{children:e.phone})]}),e.location&&(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Js.jsx)(gn.MapPin,{className:"h-3 w-3"}),(0,Js.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Js.jsx)(gn.Settings,{className:"h-3 w-3"}),(0,Js.jsxs)("span",{children:["Js",e.version]})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Js.jsx)(gn.Clock,{className:"h-3 w-3"}),(0,Js.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Js.jsx)("div",{className:"mt-3",children:(0,Js.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(x=>(0,Js.jsx)(Y,{variant:"outline",className:"text-xr",children:x},x)),e.skills.length>3&&(0,Js.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xr",onClick:()=>c(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Js.jsx)("div",{className:"mt-3",children:(0,Js.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(x=>(0,Js.jsx)(Y,{variant:"outline",className:"text-xr",children:x},x)),e.capabilities.length>2&&(0,Js.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xr",onClick:()=>c(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var gl=ie(require("react")),Ie=gl.forwardRef(({className:e,...t},a)=>(0,Js.jsx)("textarea",{className:f("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background 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",e),ref:a,...t}));Ie.displayName="Textarea";function rr({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:i,disabled:l=!1}){let[s,c]=(0,xr.useState)(""),[n,d]=(0,xr.useState)([]),[p,x]=(0,xr.useState)(!1);(0,xr.useEffect)(()=>{if(!s.trim()){d([]),x(!1);return}let m=a.filter(D=>{if(e.map(M=>M.id).includes(D.id))return!1;let S=s.toLowerCase();return D.title.toLowerCase().includes(S)||D.description?.toLowerCase().includes(S)||D.tags?.some(M=>M.toLowerCase().includes(S))||Object.values(D.metadata||{}).some(M=>String(M).toLowerCase().includes(S))});d(m),x(!0)},[s,e,a]);let u=m=>{i&&e.length>=i||(t([...e,m]),c(""),x(!1))},h=m=>{t(e.filter(D=>D.id!==m))},b=!i||e.length<i;return(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:o}),(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)(gn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Js.jsx)($,{value:s,onChange:m=>c(m.target.value),placeholder:b?r:`Maximum ${i} documents selected`,className:"xr-9",disabled:l||!b,onFocus:()=>s&&x(!0)})]}),p&&n.length>0&&(0,Js.jsx)(U,{className:"absolute top-full left-0 right-0 Js-10 mt-1 max-h-60",children:(0,Js.jsx)(pa,{className:"h-full",children:(0,Js.jsx)(fe,{className:"p-2",children:n.map(m=>(0,Js.jsx)(w,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>u(m),disabled:l,children:(0,Js.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Js.jsx)(gn.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Js.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Js.jsx)("div",{className:"font-medium text-sm truncate",children:m.title}),m.description&&(0,Js.jsx)("div",{className:"text-xr text-muted-foreground mt-1 line-clamp-2",children:m.description}),m.tags&&m.tags.length>0&&(0,Js.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[m.tags.slice(0,3).map(D=>(0,Js.jsx)(Y,{variant:"outline",className:"text-xr",children:D},D)),m.tags.length>3&&(0,Js.jsxs)(Y,{variant:"outline",className:"text-xr",children:["+",m.tags.length-3," more"]})]})]})]})},m.id))})})}),p&&s&&n.length===0&&(0,Js.jsx)(U,{className:"absolute top-full left-0 right-0 Js-10 mt-1",children:(0,Js.jsxs)(fe,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,i&&`/${i}`,")"]}),(0,Js.jsx)("div",{className:"space-y-2",children:e.map(m=>(0,Js.jsx)(U,{className:"p-3",children:(0,Js.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Js.jsx)(gn.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Js.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Js.jsx)("div",{className:"font-medium text-sm",children:m.title}),m.description&&(0,Js.jsx)("div",{className:"text-xr text-muted-foreground mt-1",children:m.description}),m.tags&&m.tags.length>0&&(0,Js.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:m.tags.map(D=>(0,Js.jsxs)(Y,{variant:"outline",className:"text-xr",children:[(0,Js.jsx)(gn.Tag,{className:"h-3 w-3 mr-1"}),D]},D))})]}),(0,Js.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(m.id),disabled:l,children:(0,Js.jsx)(gn.X,{className:"h-3 w-3"})})]})},m.id))})]}),p&&(0,Js.jsx)("div",{className:"fixed inset-0 Js-0",onClick:()=>x(!1)})]})}function vl({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:l="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,d]=(0,xr.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,x]=(0,xr.useState)(""),[u,h]=(0,xr.useState)(""),[b,m]=(0,xr.useState)(!s);(0,xr.useEffect)(()=>{e&&d(e)},[e]);let D=A=>{A.preventDefault();let O=n.version?parseInt(n.version):0,j=e?(O+1).toString():"1",W={id:n.id||Date.now().toString(),name:n.name,type:"digital",status:"active",joinedDate:n.joinedDate||new Date,lastActive:n.lastActive||new Date,description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],knowledge:n.knowledge||[],coreKnowledge:n.coreKnowledge||[],version:j,lastUpdated:n.lastUpdated||new Date,isActive:!0};t(W)},R=(A,O,j)=>{if(!O.trim())return;let W=n[A]||[];d({...n,[A]:[...W,O.trim()]}),j("")},S=(A,O)=>{let j=n[A]||[];d({...n,[A]:j.filter((W,N)=>N!==O)})},M=A=>{A.preventDefault(),m(!b)},ee=(A,O,j,W,N)=>{let je=n[A]||[];return(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:O}),b&&(0,Js.jsxs)("div",{className:"flex gap-2",children:[(0,Js.jsx)($,{value:j,onChange:C=>W(C.target.value),placeholder:N,onKeyPress:C=>{C.key==="Enter"&&(C.preventDefault(),R(A,j,W))},disabled:o}),(0,Js.jsx)(w,{type:"button",variant:"outline",size:"icon",onClick:()=>R(A,j,W),disabled:o,children:(0,Js.jsx)(gn.Plus,{className:"h-4 w-4"})})]}),(0,Js.jsx)("div",{className:"flex flex-wrap gap-2",children:je.map((C,Ne)=>(0,Js.jsxs)(Y,{className:"gap-1",children:[C,b&&(0,Js.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>S(A,Ne),disabled:o,children:(0,Js.jsx)(gn.X,{className:"h-3 w-3"})})]},`${A}-${Ne}-${C}`))})]})},k=r||(b?e?"Edit Colleague":"Add New Colleague":"View Colleague"),Z=i||(e?"Update Colleague":"Add Colleague");return(0,Js.jsxs)(U,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Js.jsx)(Le,{children:(0,Js.jsxs)(We,{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.Bot,{className:"h-5 w-5"}),k]})}),(0,Js.jsx)(fe,{children:(0,Js.jsxs)("form",{onSubmit:D,className:"space-y-6",children:[(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,Js.jsx)($,{id:"name",value:n.name||"",onChange:A=>d({...n,name:A.target.value}),required:!0,disabled:o||!b})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Js.jsx)(Ie,{id:"description",value:n.description||"",onChange:A=>d({...n,description:A.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!b})]})]}),(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Js.jsx)(Ie,{id:"jobDescription",value:n.jobDescription||"",onChange:A=>d({...n,jobDescription:A.target.value}),rows:4,required:n.type==="digital",disabled:o||!b})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Js.jsx)(Ie,{id:"workInstructions",value:n.workInstructions||"",onChange:A=>d({...n,workInstructions:A.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!b})]}),ee("capabilities","Capabilities",u,h,"Add capability"),(0,Js.jsx)(rr,{selectedDocuments:n.knowledge||[],onDocumentsChange:A=>d({...n,knowledge:A}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:o||!b,availableDocuments:c}),(0,Js.jsx)(rr,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:A=>d({...n,coreKnowledge:A}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!b,availableDocuments:c})]}),(0,Js.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Js.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:b?l:"Close"}),b?(0,Js.jsx)(w,{type:"submit",disabled:o,children:o?"Saving...":Z}):(0,Js.jsxs)(w,{type:"button",onClick:M,disabled:o,className:"gap-2",children:[(0,Js.jsx)(gn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function qr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Js.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Js.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Js.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Js.jsx)(gn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Js.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,Js.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Js.jsxs)(U,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Js.jsxs)(Le,{className:"text-center pb-4",children:[(0,Js.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Js.jsx)(gn.User,{className:"h-8 w-8 text-blue-600"})}),(0,Js.jsx)(We,{className:"text-ja",children:"Add Human Colleague"})]}),(0,Js.jsxs)(fe,{className:"text-center",children:[(0,Js.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add as team members."}),(0,Js.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.Users,{className:"h-4 w-4 text-blue-600"}),(0,Js.jsx)("span",{children:"Browse existing users"})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.User,{className:"h-4 w-4 text-blue-600"}),(0,Js.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Js.jsx)(w,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Js.jsxs)(U,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Js.jsxs)(Le,{className:"text-center pb-4",children:[(0,Js.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Js.jsx)(gn.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Js.jsx)(We,{className:"text-ja",children:"Add Digital Colleague"})]}),(0,Js.jsxs)(fe,{className:"text-center",children:[(0,Js.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague Js create a new AI assistant for your team."}),(0,Js.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Js.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.Users,{className:"h-4 w-4 text-purple-600"}),(0,Js.jsx)("span",{children:"Create from templates"})]})]}),(0,Js.jsx)(w,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function bl({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,i]=(0,xr.useState)(""),[l,s]=(0,xr.useState)("all"),c=(0,xr.useMemo)(()=>e.filter(p=>p.name.toLowerCase().includes(r.toLowerCase())),[e,r,l]),n=p=>{let x={...p,id:Date.now(),name:`${p.name} (Copy)`};t(x)},d=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,Js.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Js.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Js.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Js.jsx)(gn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Js.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,Js.jsx)(U,{children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Js.jsx)("div",{className:"flex-1",children:(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)(gn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Js.jsx)($,{placeholder:"Search by name, job description, Js capabilities...",value:r,onChange:p=>i(p.target.value),className:"xr-9"})]})}),(0,Js.jsxs)("select",{value:l,onChange:p=>s(p.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Js.jsx)("option",{value:"all",children:"All Status"}),(0,Js.jsx)("option",{value:"active",children:"Active"}),(0,Js.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Js.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(p=>(0,Js.jsx)(ja.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Js.jsxs)(U,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===p.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>n(p),children:[(0,Js.jsx)(Le,{className:"pb-3",children:(0,Js.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Js.jsx)(Kt,{children:(0,Js.jsx)(Gt,{className:"bg-blue-100",children:(0,Js.jsx)(gn.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Js.jsx)("div",{children:(0,Js.jsx)(We,{className:"text-lg flex items-center gap-2",children:p.name})})]}),(0,Js.jsxs)(w,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:x=>{x.stopPropagation(),n(p)},children:[(0,Js.jsx)(gn.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Js.jsx)(fe,{className:"pt-0",children:(0,Js.jsxs)("div",{className:"space-y-3",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Js.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,Js.jsxs)("div",{children:[(0,Js.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Js.jsx)("div",{className:"flex flex-wrap gap-1",children:p.capabilities.length>3&&(0,Js.jsxs)(Y,{variant:"outline",className:"text-xr",children:["+",p.capabilities.length-3]})})]}),(0,Js.jsxs)("div",{className:"flex items-center justify-between text-xr text-muted-foreground",children:[(0,Js.jsx)("div",{className:"flex items-center gap-1",children:(0,Js.jsx)(gn.Calendar,{className:"h-3 w-3"})}),p.knowledge&&(0,Js.jsx)("div",{className:"flex items-center gap-1",children:(0,Js.jsx)(gn.Users,{className:"h-3 w-3"})})]}),p.workInstructions&&(0,Js.jsxs)("div",{children:[(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Js.jsx)("p",{className:"text-xr line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),c.length===0&&(0,Js.jsx)(U,{children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsxs)("div",{className:"text-center py-8",children:[(0,Js.jsx)(gn.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Js.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Js.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Js filters."})]})})})]},"colleague-clone")})})}function Xr({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Js.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Js.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Js.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Js.jsx)(gn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Js.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,Js.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Js.jsxs)(U,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Js.jsxs)(Le,{className:"text-center pb-4",children:[(0,Js.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Js.jsx)(gn.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Js.jsx)(We,{className:"text-ja",children:"Clone Existing"})]}),(0,Js.jsxs)(fe,{className:"text-center",children:[(0,Js.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize Js for your needs."}),(0,Js.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Js.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Js.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Js.jsx)(w,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Js.jsxs)(U,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Js.jsxs)(Le,{className:"text-center pb-4",children:[(0,Js.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Js.jsx)(gn.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Js.jsx)(We,{className:"text-ja",children:"Create New"})]}),(0,Js.jsxs)(fe,{className:"text-center",children:[(0,Js.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Js.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.Plus,{className:"h-4 w-4 text-green-600"}),(0,Js.jsx)("span",{children:"Custom job description"})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Js.jsx)(gn.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Js.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Js.jsx)(w,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var hl=ie(require("react")),nr=ie(require("@radix-ui/react-switch"));var Io=hl.forwardRef(({className:e,...t},a)=>(0,Js.jsx)(nr.Root,{className:f("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,Js.jsx)(nr.Thumb,{className:f("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")})}));Io.displayName=nr.Root.displayName;function Qr({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:l="Cancel",readOnly:s=!1}){let[c,n]=(0,xr.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,p]=(0,xr.useState)(!s);(0,xr.useEffect)(()=>{e&&n(e)},[e]);let x=m=>{m.preventDefault();let D={id:c.id||Date.now(),name:c.name,description:c.description||null,systemMsg:c.systemMsg||null,useProjects:c.useProjects||!1,useKnowledge:c.useKnowledge||!1,useFiles:c.useFiles||!1,useChat:c.useChat||!1,updatedAt:new Date().toISOString(),createdAt:c.createdAt||new Date().toISOString()};t(D)},u=m=>{m.preventDefault(),p(!d)},h=r||(d?e?"Edit Team":"Create New Team":"View Team"),b=i||(e?"Update Team":"Create Team");return(0,Js.jsxs)(U,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Js.jsx)(Le,{children:(0,Js.jsxs)(We,{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.Users,{className:"h-5 w-5"}),h]})}),(0,Js.jsx)(fe,{children:(0,Js.jsxs)("form",{onSubmit:x,className:"space-y-6",children:[(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"name",children:"Team Name *"}),(0,Js.jsx)($,{id:"name",value:c.name||"",onChange:m=>n({...c,name:m.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Js.jsx)(Ie,{id:"description",value:c.description||"",onChange:m=>n({...c,description:m.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!d})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Js.jsx)(Ie,{id:"systemMsg",value:c.systemMsg||"",onChange:m=>n({...c,systemMsg:m.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Js.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)(Io,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:m=>n({...c,useProjects:m}),disabled:o||!d}),(0,Js.jsx)(I,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)(Io,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:m=>n({...c,useKnowledge:m}),disabled:o||!d}),(0,Js.jsx)(I,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)(Io,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:m=>n({...c,useFiles:m}),disabled:o||!d}),(0,Js.jsx)(I,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)(Io,{id:"useChat",checked:c.useChat||!1,onCheckedChange:m=>n({...c,useChat:m}),disabled:o||!d}),(0,Js.jsx)(I,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Js.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Js.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?l:"Close"}),d?(0,Js.jsx)(w,{type:"submit",disabled:o||!c.name?.trim(),children:o?"Saving...":b}):(0,Js.jsxs)(w,{type:"button",onClick:u,disabled:o,className:"gap-2",children:[(0,Js.jsx)(gn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}var Zr=require("react-icons/gn");function ze({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:i,children:l,className:s}){let[c,n]=Fr(`hero-section-minimized-${e.replace(/\s+/Js,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||c;return(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Js.jsx)(Y,{className:"bg-white/20 text-white hover:bg-white/30 rounded-ja",children:a}),(0,Js.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,Js.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,Js.jsx)("button",{"aria-label":c?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>n(!c),style:{lineHeight:0},children:c?(0,Js.jsx)(Zr.FaChevronDown,{size:22}):(0,Js.jsx)(Zr.FaChevronUp,{size:22})})]})]}),!d&&(0,Js.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Js.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Js.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,Js.jsx)(w,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),l&&(0,Js.jsx)("div",{className:"hidden lg:block",children:l})]})]})}var yl=ie(require("react")),dr=ie(require("@radix-ui/react-progress"));var cr=yl.forwardRef(({className:e,value:t,...a},o)=>(0,Js.jsx)(dr.Root,{ref:o,className:f("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Js.jsx)(dr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));cr.displayName=dr.Root.displayName;function cs({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,Js.jsxs)(U,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Js.jsx)(Le,{className:"pb-2",children:(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Js.jsx)(Y,{className:"rounded-ja bg-amber-500",children:"New"}):(0,Js.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Js.jsx)(gn.Star,{className:"h-4 w-4"})})]})}),(0,Js.jsxs)(fe,{className:"pb-2",children:[(0,Js.jsx)(We,{className:"text-lg",children:e.name}),(0,Js.jsx)(eo,{children:e.description}),o&&e.progress<100&&(0,Js.jsxs)("div",{className:"mt-2",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Js.jsx)("span",{children:"Installation"}),(0,Js.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Js.jsx)(cr,{value:e.progress,className:"h-2 mt-1 rounded-ja"})]})]}),(0,Js.jsx)(to,{children:(0,Js.jsx)(w,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var im=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 Mo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:i}){return(0,Js.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${i||""}`,children:[r&&(0,Js.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Js.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Js.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Js.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Js.jsx)("div",{className:"divide-y",children:e.map(l=>(0,Js.jsxs)(ja.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?.(l),children:[(0,Js.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Js.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Js.jsx)("div",{children:(0,Js.jsx)("p",{className:"font-medium",children:l.name})})]}),(0,Js.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:im(l.filesize)}),(0,Js.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Js.jsx)("span",{className:"text-sm md:text-base",children:new Date(l.createdAt).toLocaleDateString()}),(0,Js.jsx)("div",{className:"flex gap-1",children:(0,Js.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-ja text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(l)},children:(0,Js.jsx)(gn.Trash2,{className:"h-4 w-4"})})})]})]},l.name))})]})}function ei({project:e,onOpen:t,onShare:a,className:o}){return(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Js.jsxs)(U,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Js.jsxs)(Le,{children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)(We,{children:e.name}),(0,Js.jsxs)(Y,{variant:"outline",className:"rounded-ja",children:["Due ",e.dueDate]})]}),(0,Js.jsx)(eo,{children:e.description})]}),(0,Js.jsxs)(fe,{className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Js.jsx)("span",{children:"Progress"}),(0,Js.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Js.jsx)(cr,{value:e.progress,className:"h-2 rounded-ja"})]}),(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Js.jsxs)("div",{className:"flex items-center",children:[(0,Js.jsx)(gn.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,Js.jsxs)("div",{className:"flex items-center",children:[(0,Js.jsx)(gn.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Js.jsxs)(to,{className:"flex gap-2",children:[(0,Js.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Js.jsx)(w,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Js.jsx)(gn.Share2,{className:"h-4 w-4"})})]})]})})}var ms=[{name:"PixelMaster",icon:(0,Js.jsx)(gn.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Js.jsx)(gn.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Js.jsx)(gn.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Js.jsx)(gn.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Js.jsx)(gn.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Js.jsx)(gn.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Js.jsx)(gn.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Js.jsx)(gn.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Js.jsx)(gn.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Js.jsx)(gn.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Js.jsx)(gn.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Js.jsx)(gn.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],kl=[{id: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},{id: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},{id: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},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/ui-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id: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},{id: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},{id: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 Tl=[{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"}];function ti({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:r=[]}){let[i,l]=(0,xr.useState)({...e,updatedAt:new Date}),s=()=>{let b=new Set,m=new Set;return r.forEach(D=>{D.menuConfig.groupBy.forEach(R=>b.add(R))}),o.forEach(D=>{D.metadata&&Object.keys(D.metadata).forEach(R=>m.add(R))}),{contextKeys:Array.from(b).sort(),documentKeys:Array.from(m).sort(),allKeys:Array.from(new Set([...b,...m])).sort()}},c=b=>{let m=new Set;return o.forEach(D=>{D.metadata?.[b]&&m.add(String(D.metadata[b]))}),Array.from(m).sort()},n=s(),d=()=>{t(i)},p=(b,m)=>{l(D=>({...D,metadata:{...D.metadata,[b]:m}}))},x=(b,m)=>{m==="__custom__"?p(b,""):p(b,m)},u=()=>{let b=`field_${Date.now()}`;p(b,"")},h=b=>{l(m=>{let D={...m.metadata};return delete D[b],{...m,metadata:D}})};return(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Js.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Js.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Js.jsx)("div",{className:"flex-shrink-0 p-3 rounded-ja bg-primary/10 border border-primary/20",children:(0,Js.jsx)(gn.Edit3,{className:"h-6 w-6 text-primary"})}),(0,Js.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,Js.jsxs)("div",{className:"flex gap-2",children:[(0,Js.jsxs)(w,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,Js.jsx)(gn.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Js.jsxs)(w,{size:"sm",onClick:d,className:"gap-2",children:[(0,Js.jsx)(gn.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,Js.jsx)($,{value:i.title,onChange:b=>l(m=>({...m,title:b.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,Js.jsx)(Ie,{value:i.description||"",onChange:b=>l(m=>({...m,description:b.target.value})),placeholder:"Document description...",rows:2})]}),(0,Js.jsxs)("div",{children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),n.contextKeys.length>0&&(0,Js.jsxs)("p",{className:"text-xr text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,Js.jsxs)(w,{type:"button",variant:"outline",size:"sm",onClick:u,className:"gap-1 h-8",children:[(0,Js.jsx)(gn.Plus,{className:"h-3 w-3"}),"Add"]})]}),i.metadata&&Object.keys(i.metadata).length>0?(0,Js.jsx)("div",{className:"space-y-2",children:Object.entries(i.metadata).map(([b,m])=>{let D=c(b);return(0,Js.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Js.jsx)($,{value:b,onChange:R=>{let S=R.target.value,M=i.metadata?.[b];l(ee=>{let k={...ee.metadata};return delete k[b],S&&(k[S]=M||""),{...ee,metadata:k}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${b}`}),(0,Js.jsx)("datalist",{id:`metadata-keys-${b}`,children:n.allKeys.map(R=>(0,Js.jsx)("option",{value:R},R))}),(0,Js.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),D.length>0?(0,Js.jsxs)(ot,{value:String(m||""),onValueChange:R=>x(b,R),children:[(0,Js.jsx)(et,{className:"flex-1 h-8 text-sm",children:(0,Js.jsx)(Rt,{placeholder:"Value"})}),(0,Js.jsxs)(tt,{children:[D.map(R=>(0,Js.jsx)(ye,{value:R,children:R},R)),(0,Js.jsx)(ye,{value:"__custom__",children:(0,Js.jsx)("span",{className:"text-muted-foreground text-xr",children:"Custom..."})})]})]}):(0,Js.jsx)($,{value:String(m||""),onChange:R=>p(b,R.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Js.jsx)(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(b),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Js.jsx)(gn.X,{className:"h-3 w-3"})})]},b)})}):(0,Js.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,Js.jsx)("p",{className:"text-xr text-muted-foreground",children:'No metadata \u2022 Click "Add" to create fields'})})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,Js.jsx)(Y,{variant:"secondary",className:"font-mono",children:i.format.toUpperCase()})]})]})]}),(0,Js.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Js.jsxs)("div",{className:"p-8",children:[(0,Js.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,Js.jsx)(Ie,{value:i.content||"",onChange:b=>l(m=>({...m,content:b.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var El=e=>(0,Js.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/Js,"<br>").replace(/\*\*(.*?)\*\*/Js,"<strong>$1</strong>").replace(/\*(.*?)\*/Js,"<em>$1</em>").replace(/`(.*?)`/Js,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-ja font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),Al=e=>(0,Js.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),sm=e=>(0,Js.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Js.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,Js.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Js.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Js.jsx)("pre",{className:"text-sm",children:e})]}),nm=e=>(0,Js.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Js.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,Js.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Js.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),El(e)]});function ai({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:r=[],knowledgeContexts:i=[]}){let[l,s]=(0,xr.useState)(!1),c=u=>{switch(u){case"markdown":case"mdx":return(0,Js.jsx)(gn.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Js.jsx)(gn.File,{className:"h-6 w-6 text-success"});case"text":return(0,Js.jsx)(gn.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Js.jsx)(gn.File,{className:"h-6 w-6 text-muted-foreground"})}},n=u=>{switch(u){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"}},d=(u,h)=>{let b={markdown:El,mdx:nm,richtext:sm,text:Al},m=o?.[h]||b[h];return m?m(u):Al(u)},p=u=>{s(!1),t?.(u)},x=()=>{s(!1)};return l?(0,Js.jsx)(ti,{document:e,onSave:p,onCancel:x,availableDocuments:r,knowledgeContexts:i}):(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Js.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Js.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Js.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Js.jsx)("div",{className:"flex-shrink-0 p-3 rounded-ja bg-muted border border-border",children:c(e.format)}),(0,Js.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Js.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Js.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,Js.jsx)("div",{className:"flex-shrink-0",children:(0,Js.jsxs)(w,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,Js.jsx)(gn.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Js.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Js.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(u=>(0,Js.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",u]},u))]})]}),(0,Js.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Js.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Js.jsxs)("div",{className:"mb-6",children:[(0,Js.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Js.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,Js.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xr",children:Object.entries(e.metadata).map(([u,h])=>(0,Js.jsxs)("div",{className:"flex gap-1",children:[(0,Js.jsxs)("span",{className:"text-muted-foreground font-medium",children:[u.replace(/([A-Z])/Js," $1").trim(),":"]}),(0,Js.jsx)("span",{className:"text-foreground truncate",children:String(h)})]},u))})})]}),(0,Js.jsx)("div",{className:"space-y-4",children:e.content?(0,Js.jsx)("div",{className:"relative",children:(0,Js.jsx)("div",{className:"bg-card border border-border rounded-ja p-6 overflow-hidden",children:d(e.content,e.format)})}):(0,Js.jsxs)("div",{className:"text-center py-12 bg-muted rounded-ja border-2 border-dashed border-border",children:[(0,Js.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Js.jsx)(gn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Js.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Js.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Bl({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:l=!0}){let[s,c]=(0,xr.useState)(o===0),n=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((u,h)=>u+h.documents.length,0):0),p=u=>{switch(u){case"markdown":case"mdx":return(0,Js.jsx)(gn.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Js.jsx)(gn.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Js.jsx)(gn.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},x=u=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[u%h.length]};return(0,Js.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,Js.jsxs)(ja.motion.div,{className:`group flex items-center gap-3 p-3 rounded-ja 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:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Js.jsx)("div",{className:`w-1 h-6 rounded-full ${x(o)}`}),(0,Js.jsx)(ja.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Js.jsx)(gn.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Js.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Js.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Js.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),l&&d>0&&(0,Js.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Js.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xr font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Js.jsx)(ja.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Js.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((u,h)=>(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${i===u.id?"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?.(u),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Js.jsx)("div",{className:"flex-shrink-0",children:p(u.format)}),(0,Js.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Js.jsx)("p",{className:`text-sm truncate transition-colors ${i===u.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:u.title}),u.description&&(0,Js.jsx)("p",{className:"text-xr text-muted-foreground truncate mt-0.5",children:u.description})]}),u.tags&&u.tags.length>0&&(0,Js.jsx)("div",{className:"flex-shrink-0",children:(0,Js.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xr font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:u.tags[0]})})]},u.id)),a&&Object.entries(a).map(([u,h])=>(0,Js.jsx)(Bl,{label:u,documents:h.documents,children:h.children,level:o+1,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:l},u))]})})]})}function oi({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:i,className:l,editable:s=!0}){let[c,n]=(0,xr.useState)(""),[d,p]=(0,xr.useState)(null),x=(0,xr.useMemo)(()=>c?e.filter(b=>b.title.toLowerCase().includes(c.toLowerCase())||b.description?.toLowerCase().includes(c.toLowerCase())||b.tags?.some(m=>m.toLowerCase().includes(c.toLowerCase()))||Object.values(b.metadata||{}).some(m=>String(m).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),u=(0,xr.useMemo)(()=>{let b=(m,D)=>{if(D.length===0)return{};let[R,...S]=D;return m.reduce((ee,k)=>{let Z=k.metadata?.[R]||"Uncategorized",A=String(Z);if(ee[A]||(ee[A]={documents:[],children:{}}),S.length===0)ee[A].documents.push(k);else{let O=b([k],S),j=Object.keys(O)[0];j&&(ee[A].children||(ee[A].children={}),ee[A].children[j]?ee[A].children[j].documents.push(...O[j].documents):ee[A].children[j]=O[j])}return ee},{})};return b(x,t.groupBy)},[x,t.groupBy]),h=b=>{p(b),a?.(b)};return(0,Js.jsxs)("div",{className:`flex h-full ${l||""}`,children:[(0,Js.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Js.jsx)("div",{className:"p-6 border-b border-border",children:(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)("div",{className:"absolute inset-y-0 left-0 xr-3 flex items-center pointer-events-none",children:(0,Js.jsx)(gn.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Js.jsx)($,{placeholder:"Search knowledge base...",value:c,onChange:b=>n(b.target.value),className:"xr-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-ja h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Js.jsx)(pa,{className:"h-[calc(100%-100px)]",children:(0,Js.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(u).map(([b,m])=>(0,Js.jsx)(Bl,{label:b,documents:m.documents,children:m.children,level:0,onDocumentClick:h,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},b)),Object.keys(u).length===0&&(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Js.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Js.jsx)(gn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Js.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Js.jsx)("p",{className:"text-xr mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Js.jsx)("div",{className:"flex-1 bg-background",children:d?(0,Js.jsx)(ai,{document:d,onDocumentUpdate:r,editable:s}):(0,Js.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Js.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Js.jsx)(gn.FileText,{className:"h-10 w-10 text-primary"})}),(0,Js.jsx)("h3",{className:"text-ja font-semibold text-foreground mb-2",children:"Select a document"}),(0,Js.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function mr({documents:e=[],contexts:t=[],onDocumentClick:a=l=>console.log("Document clicked:",l),onDocumentShare:o=l=>console.log("Share document:",l),onLoadDocumentContent:r,selectedDocumentId:i}){let[l,s]=(0,xr.useState)(t[0]);return!t||t.length===0?(0,Js.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Js.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Js.jsx)(ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Js.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Js.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,Js.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Js.jsx)(ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Js.jsxs)("div",{className:"mt-6",children:[(0,Js.jsx)("div",{className:"border-b border-border",children:(0,Js.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,Js.jsxs)("button",{onClick:()=>s(c),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${l.id===c.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[c.icon,c.label]},c.id))})}),l.description&&(0,Js.jsx)("div",{className:"mt-3 px-1",children:(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:l.description})})]})]}),(0,Js.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Js.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Js.jsx)(oi,{documents:e,menuConfig:l.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:i})})})]})}function us({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:i,onOpenProject:l,sidebarItems:s,initialColleagues:c,users:n,onColleagueAdd:d,onColleagueEdit:p,onColleagueDelete:x}){let[u,h]=(0,xr.useState)("home"),[b,m]=(0,xr.useState)(t[0]),D=N=>{console.log("Opening app:",N.name)},R=N=>{console.log("Favoriting app:",N.name)},S=N=>{console.log("Opening file:",N.name)},M=N=>{console.log("Sharing file:",N.name)},ee=N=>{console.log("Opening project:",N.name),l(N)},k=N=>{console.log("Sharing project:",N.name)},Z=N=>{m(N),console.log("Business unit changed to:",N.name)},A=()=>{console.log("Copilot clicked - navigating to chat"),h("chat")},O=N=>{console.log("Notification removed:",N)},j=()=>{console.log("All notifications removed")},W=()=>{switch(u){case"home":return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsxs)("section",{className:"text-center py-12",children:[(0,Js.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",b.name," team"]}),(0,Js.jsx)("p",{className:"text-ja text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),(0,Js.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,Js.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Js.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,Js.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,Js.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Js.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,Js.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,Js.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Js.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,Js.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,Js.jsx)(ze,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>h("chat")}})]});case"colleagues":return(0,Js.jsx)("div",{children:(0,Js.jsx)("h1",{children:"Colleagues"})});case"chat":return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsxs)("section",{className:"text-center py-12",children:[(0,Js.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,Js.jsxs)("p",{className:"text-ja text-muted-foreground mb-8",children:["Connect with your ",b.name," team members and collaborate in real-time."]})]}),(0,Js.jsx)(ze,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,Js.jsxs)("div",{className:"space-y-8",children:[(0,Js.jsx)(ze,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,Js.jsxs)("section",{className:"space-y-4",children:[(0,Js.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,Js.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:ms.filter(N=>N.new).map(N=>(0,Js.jsx)(cs,{app:N,showProgress:!0,onOpen:D,onFavorite:R},N.name))})]}),(0,Js.jsxs)("section",{className:"space-y-4",children:[(0,Js.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,Js.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:ms.map(N=>(0,Js.jsx)(cs,{app:N,onOpen:D,onFavorite:R},N.name))})]})]});case"knowledge":return(0,Js.jsx)(mr,{});case"files":return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsx)(ze,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,Js.jsxs)("section",{className:"space-y-4",children:[(0,Js.jsx)("div",{className:"flex items-center justify-between",children:(0,Js.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,Js.jsx)(Mo,{files:kl,onFileClick:S})]})]});case"projects":return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsx)(ze,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:i}}),(0,Js.jsxs)("section",{className:"space-y-4",children:[(0,Js.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Js.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:a.map(N=>(0,Js.jsx)(ei,{project:N,onOpen:ee,onShare:k},N.name))})]})]});case"learn":return(0,Js.jsxs)("div",{className:"space-y-8",children:[(0,Js.jsx)(ze,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),(0,Js.jsxs)("section",{className:"space-y-4",children:[(0,Js.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,Js.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:Tl.slice(0,3).map(N=>(0,Js.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,Js.jsx)("h3",{className:"font-semibold mb-2",children:N.title}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:N.description}),(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Js.jsx)("span",{children:N.duration}),(0,Js.jsx)("span",{children:N.level})]})]},N.title))})]})]});default:return null}};return(0,Js.jsx)(zr,{sidebarItems:Sn,title:e,notifications:Dn,businessUnits:t,currentBusinessUnit:b,onBusinessUnitChange:Z,activeTab:u,onTabChange:h,showTabs:!0,onActionClick:A,actionIcon:(0,Js.jsx)(gn.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:O,onRemoveAll:j,children:(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsx)(ja.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:W()},u)})})}function Ol({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,i]=(0,xr.useState)(""),l=(0,xr.useMemo)(()=>e.filter(c=>c.name?.toLowerCase().includes(r.toLowerCase())||c.email.toLowerCase().includes(r.toLowerCase())),[e,r]),s=c=>{t(c)};return(0,Js.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Js.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Js.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Js.jsx)(gn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Js.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),(0,Js.jsx)(U,{className:"container",children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Js.jsx)("div",{className:"flex-1",children:(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)(gn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Js.jsx)($,{placeholder:"Search users by name, email, role, Js skills...",value:r,onChange:c=>i(c.target.value),className:"xr-9"})]})})})})}),(0,Js.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(c=>(0,Js.jsx)(ja.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Js.jsxs)(U,{className:`cursor-pointer transition-all hover:shadow-lg ${o===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,Js.jsx)(Le,{className:"pb-3",children:(0,Js.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Js.jsx)(Kt,{children:(0,Js.jsx)(Gt,{children:(0,Js.jsx)(gn.User,{className:"h-4 w-4"})})}),(0,Js.jsx)("div",{children:(0,Js.jsx)(We,{className:"text-lg",children:c.name})})]}),o===c.id&&(0,Js.jsx)(gn.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Js.jsx)(fe,{className:"pt-0",children:(0,Js.jsxs)("div",{className:"space-y-3",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Js.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,Js.jsx)("div",{children:(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},c.id))}),l.length===0&&(0,Js.jsx)(U,{className:"container mt-4",children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsxs)("div",{className:"text-center py-8",children:[(0,Js.jsx)(gn.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Js.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Js.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Js filters."})]})})})]},"user-selection")})})}function gs({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:i=["Design","Engineering","Marketing","Product","Sales","Operations"],className:l,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,d]=(0,xr.useState)(e||[]),[p,x]=(0,xr.useState)(""),[u,h]=(0,xr.useState)("all"),[b,m]=(0,xr.useState)("all"),[D,R]=(0,xr.useState)("all"),[S,M]=(0,xr.useState)(null),[ee,k]=(0,xr.useState)(null);(0,xr.useEffect)(()=>{d(e||[])},[e]);let Z=Array.isArray(s)?s:[],A=Array.isArray(c)?c:[],[O,j]=(0,xr.useState)("main"),W=n.filter(H=>!H||!H.name?!1:H.name.toLowerCase().includes(p.toLowerCase())||H.type==="human"&&H.email?.toLowerCase().includes(p.toLowerCase())||H.type==="digital"&&H.jobDescription?.toLowerCase().includes(p.toLowerCase())),N=W.filter(H=>H.type==="human"),je=W.filter(H=>H.type==="digital"),C=()=>{j("typeSelection")},Ne=H=>{H.type==="digital"&&(M(H),j("form")),console.log("Editing colleague:",H),a?.(H)},ce=H=>{H.type==="digital"&&(k(H),j("view"))},Dt=H=>{let Je={id:`human-${Date.now()}`,type:"human",name:H.name||"",email:H.email,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};d(Fe=>[...Fe,Je]),t?.(Je),j("main")},lt=H=>{if(!H||!H.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",H);return}d(Je=>[...Je,H]),t?.(H),j("main")},Ot=()=>{M(null),j("form")},zt=H=>{if(!H||!H.id){console.error("Invalid colleague provided to handleSaveColleague:",H);return}S?(d(Je=>Je.map(Fe=>Fe.id===H.id?H:Fe)),a?.(H)):(d(Je=>[...Je,H]),t?.(H)),j("main"),M(null)},E=()=>{j("main"),M(null),k(null)},De=()=>{j("main"),k(null)},Ge=()=>{ee&&(M(ee),k(null),j("form"))},Ut=H=>{o?.(H,n.find(Je=>Je.id===H).type),d(Je=>Je.filter(Fe=>Fe.id!==H))},Me=()=>{x(""),h("all"),m("all")},jt=()=>{let H=[];return A.forEach(Fe=>{Fe.knowledge&&Array.isArray(Fe.knowledge)&&H.push(...Fe.knowledge),Fe.coreKnowledge&&Array.isArray(Fe.coreKnowledge)&&H.push(...Fe.coreKnowledge)}),n.forEach(Fe=>{Fe.type==="digital"&&(Fe.knowledge&&Array.isArray(Fe.knowledge)&&H.push(...Fe.knowledge),Fe.coreKnowledge&&Array.isArray(Fe.coreKnowledge)&&H.push(...Fe.coreKnowledge))}),H.filter((Fe,ca,xa)=>ca===xa.findIndex(Ia=>Ia.id===Fe.id))};return O==="typeSelection"?(0,Js.jsx)(qr,{onSelectHuman:()=>j("userSelection"),onSelectDigital:()=>j("digitalOptions"),onCancel:()=>j("main")}):O==="userSelection"?(0,Js.jsx)(Ol,{users:Z,onUserSelect:Dt,onCancel:()=>j("typeSelection")}):O==="digitalOptions"?(0,Js.jsx)(Xr,{onCloneExisting:()=>j("digitalClone"),onCreateNew:Ot,onCancel:()=>j("typeSelection")}):(0,Js.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsx)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Js.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,Js.jsx)(ze,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:C}}),(0,Js.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Js.jsxs)(U,{children:[(0,Js.jsxs)(Le,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Js.jsx)(We,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Js.jsx)(gn.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Js.jsxs)(fe,{children:[(0,Js.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,Js.jsx)("p",{className:"text-xr text-muted-foreground"})]})]}),(0,Js.jsxs)(U,{children:[(0,Js.jsxs)(Le,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Js.jsx)(We,{className:"text-sm font-medium",children:"Human Members"}),(0,Js.jsx)(gn.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Js.jsxs)(fe,{children:[(0,Js.jsx)("div",{className:"text-2xl font-bold",children:n.filter(H=>H.type==="human").length}),(0,Js.jsx)("p",{className:"text-xr text-muted-foreground",children:"active"})]})]}),(0,Js.jsxs)(U,{children:[(0,Js.jsxs)(Le,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Js.jsx)(We,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Js.jsx)(gn.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Js.jsxs)(fe,{children:[(0,Js.jsx)("div",{className:"text-2xl font-bold",children:n.filter(H=>H.type==="digital").length}),(0,Js.jsx)("p",{className:"text-xr text-muted-foreground",children:"active"})]})]})]}),(0,Js.jsx)(U,{children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Js.jsx)("div",{className:"flex-1",children:(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)(gn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Js.jsx)($,{placeholder:"Search colleagues...",value:p,onChange:H=>x(H.target.value),className:"xr-9"})]})}),(0,Js.jsxs)(ot,{value:u,onValueChange:h,children:[(0,Js.jsx)(et,{className:"w-full md:w-[180px]",children:(0,Js.jsx)(Rt,{placeholder:"Department"})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsx)(ye,{value:"all",children:"All Departments"}),i.map(H=>(0,Js.jsx)(ye,{value:H,children:H},H))]})]}),(0,Js.jsxs)(ot,{value:b,onValueChange:m,children:[(0,Js.jsx)(et,{className:"w-full md:w-[140px]",children:(0,Js.jsx)(Rt,{placeholder:"Status"})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsx)(ye,{value:"all",children:"All Status"}),(0,Js.jsx)(ye,{value:"active",children:"Active"}),(0,Js.jsx)(ye,{value:"inactive",children:"Inactive"})]})]}),(p||u!=="all"||b!=="all")&&(0,Js.jsxs)(w,{variant:"outline",onClick:Me,className:"gap-2",children:[(0,Js.jsx)(gn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsx)(So,{activeTab:D,onTabChange:R,tabOptions:[{value:"all",label:`All (${W.length})`},{value:"human",label:`Human (${N.length})`},{value:"digital",label:`Digital (${je.length})`}],maxWidth:"400px",gridCols:3}),D==="all"&&(0,Js.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"}`}),D==="human"&&(0,Js.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"}`}),D==="digital"&&(0,Js.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"}`})]}),W.length===0&&(0,Js.jsx)(U,{children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsxs)("div",{className:"text-center py-8",children:[(0,Js.jsx)(gn.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Js.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Js.jsx)("p",{className:"text-muted-foreground mb-4",children:p||u!=="all"||b!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,Js.jsxs)(w,{onClick:C,className:"gap-2",children:[(0,Js.jsx)(gn.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var jl=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,xr.useState)(null),[i,l]=(0,xr.useState)(""),[s,c]=(0,xr.useState)(""),[n,d]=(0,xr.useState)(""),p=u=>{let h=u.target.files?.[0];h&&(r(h),i||l(h.name))},x=async u=>{if(u.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",i),s&&h.append("description",s),n&&h.append("tags",n),a?.(h),t(),r(null),l(""),c(""),d("")};return(0,Js.jsx)(wt,{open:e,onOpenChange:t,children:(0,Js.jsxs)(dt,{className:"sm:max-w-md",children:[(0,Js.jsx)(ct,{children:(0,Js.jsx)(mt,{children:"Add New File"})}),(0,Js.jsxs)("form",{onSubmit:x,className:"grid gap-4",children:[(0,Js.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Js.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,Js.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Js.jsx)(lm,{className:"w-10 h-10 text-gray-400"}),(0,Js.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Js.jsx)("span",{className:"font-semibold",children:"Click to upload"})," Js drag and drop"]}),(0,Js.jsx)("p",{className:"text-xr text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Js GIF (MAX. 800x400px)"})]}),(0,Js.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:p})]})}),o&&(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("p",{className:"font-medium",children:o.name}),(0,Js.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Js.jsx)(w,{type:"submit",onClick:x,children:"Upload"})]})]})]})})};function lm(e){return(0,Js.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,Js.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Js.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Js.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function gr({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:i=!1,className:l}){let[s,c]=(0,xr.useState)(e),[n,d]=(0,xr.useState)(""),[p,x]=(0,xr.useState)("all"),[u,h]=(0,xr.useState)("all"),[b,m]=(0,xr.useState)(!1),D=(0,xr.useRef)(""),R=W=>W.map(N=>`${N.id}-${new Date(N.createdAt).getTime()}-${new Date(N.updatedAt).getTime()}`).join("-");(0,xr.useEffect)(()=>{let W=R(e);W!==D.current&&(c(e),D.current=W)},[e]);let S=s.filter(W=>W.name.toLowerCase().includes(n.toLowerCase())),M=S.slice(0,10),ee=S.filter(Boolean),k=()=>{m(!0)},Z=W=>{a?.(W)},A=W=>{console.log("deleting file",W),c(N=>N.filter(je=>je.name!==W.name)),o?.(W.id.toString())},O=W=>{r?.(W)},j=()=>{d(""),x("all")};return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsx)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Js.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,Js.jsx)(ze,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:k},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Js.jsx)(U,{children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Js.jsx)("div",{className:"flex-1",children:(0,Js.jsxs)("div",{className:"relative",children:[(0,Js.jsx)(gn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Js.jsx)($,{placeholder:"Search files...",value:n,onChange:W=>d(W.target.value),className:"xr-9"})]})}),(n||p!=="all")&&(0,Js.jsxs)(w,{variant:"outline",onClick:j,className:"gap-2",children:[(0,Js.jsx)(gn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsx)(So,{activeTab:u,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${S.length})`},{value:"recent",label:`Recent (${M.length})`}],maxWidth:"500px",gridCols:3}),u==="all"&&(0,Js.jsx)(Mo,{files:S,onFileClick:O,onFileEdit:Z,onFileDelete:A,showHeader:!i}),u==="recent"&&(0,Js.jsx)(Mo,{files:M,onFileClick:O,onFileEdit:Z,onFileDelete:A,showHeader:!i}),u==="shared"&&(0,Js.jsx)(Mo,{files:ee,onFileClick:O,onFileEdit:Z,onFileDelete:A,showHeader:!i})]}),S.length===0&&(0,Js.jsx)(U,{children:(0,Js.jsx)(fe,{className:"pt-6",children:(0,Js.jsxs)("div",{className:"text-center py-8",children:[(0,Js.jsx)(gn.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Js.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Js.jsx)("p",{className:"text-muted-foreground mb-4",children:n||p!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Js.jsxs)(w,{onClick:k,className:"gap-2",children:[(0,Js.jsx)(gn.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Js.jsx)(jl,{isOpen:b,onClose:()=>m(!1),onAddFile:t})]})}var Oe=ie(require("react"));var Hl=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:i=!1,height:l})=>{let s=d=>{d.preventDefault()},c=d=>{d.preventDefault(),r(t)};return(0,Js.jsxs)(U,{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-xr":""}`,style:{height:l||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Js.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Js.jsx)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Js.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var fr=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let i=d=>{a(e)},l=()=>{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"}},c=()=>{switch(e.type){case"story":return(0,Js.jsx)(gn.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Js.jsx)(gn.Bug,{className:"h-3 w-3"});case"spike":return(0,Js.jsx)(gn.Zap,{className:"h-3 w-3"});case"task":default:return(0,Js.jsx)(gn.AlertCircle,{className:"h-3 w-3"})}},n=()=>{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,Js.jsx)(U,{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:l,children:(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xr font-medium ${n()}`,children:c()}),(0,Js.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Js.jsxs)(U,{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:l,children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Js.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,Js.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Js.jsxs)("div",{className:"flex gap-1",children:[(0,Js.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xr font-medium ${s()}`,children:e.priority}),(0,Js.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xr font-medium",children:e.storyPoints})]})]}),(0,Js.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Js.jsx)(gn.User,{className:"h-4 w-4"}),(0,Js.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Js.jsx)(gn.Calendar,{className:"h-4 w-4"}),(0,Js.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var no=ie(require("react")),Bo=ie(require("@radix-ui/react-toggle-group"));var zl=ie(require("react")),fs=ie(require("@radix-ui/react-toggle"));var vs=(0,cn.cva)("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=Js]:bg-accent data-[state=Js]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),dm=zl.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,Js.jsx)(fs.Root,{ref:r,className:f(vs({variant:t,size:a,className:e})),...o}));dm.displayName=fs.Root.displayName;var Kl=no.createContext({size:"default",variant:"default"}),lo=no.forwardRef(({className:e,variant:t,size:a,children:o,...r},i)=>(0,Js.jsx)(Bo.Root,{ref:i,className:f("flex items-center justify-center gap-1",e),...r,children:(0,Js.jsx)(Kl.Provider,{value:{variant:t,size:a},children:o})}));lo.displayName=Bo.Root.displayName;var co=no.forwardRef(({className:e,children:t,variant:a,size:o,...r},i)=>{let l=no.useContext(Kl);return(0,Js.jsx)(Bo.Item,{ref:i,className:f(vs({variant:l.variant||a,size:l.size||o}),e),...r,children:t})});co.displayName=Bo.Item.displayName;var cm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:gn.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:gn.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:gn.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:gn.Zap}],mm=[{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"}],Fo=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:i,defaultEpicId:l})=>{let[s,c]=(0,xr.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,xr.useEffect)(()=>{e&&l&&c(p=>({...p,epic:l}))},[e,l]),(0,xr.useEffect)(()=>{e&&c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"none",assignee:""})},[e]);let n=p=>{p.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}),c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"",assignee:""}),t())},d=(p,x)=>{c(u=>({...u,[p]:x}))};return(0,Js.jsx)(wt,{open:e,onOpenChange:t,children:(0,Js.jsxs)(dt,{className:"sm:max-w-md",children:[(0,Js.jsx)(ct,{children:(0,Js.jsx)(mt,{children:"Add New Task"})}),(0,Js.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"name",children:"Task Title"}),(0,Js.jsx)($,{id:"name",value:s.name,onChange:p=>d("name",p.target.value),placeholder:"Enter task title",required:!0})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Js.jsx)(Ie,{id:"description",value:s.description,onChange:p=>d("description",p.target.value),placeholder:"Enter task description",rows:3})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"Type"}),(0,Js.jsx)(lo,{type:"single",value:s.type||"",onValueChange:p=>p&&d("type",p),children:cm.map(p=>{let x=p.icon;return(0,Js.jsxs)(co,{value:p.value,className:"flex items-center gap-2 data-[state=Js]:bg-primary data-[state=Js]:text-primary-foreground",children:[(0,Js.jsx)(x,{className:"h-4 w-4"}),p.label]},p.value)})})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"Priority"}),(0,Js.jsx)(lo,{type:"single",value:s.priority||"",onValueChange:p=>p&&d("priority",p),children:mm.map(p=>(0,Js.jsx)(co,{value:p.value,className:"data-[state=Js]:bg-primary data-[state=Js]:text-primary-foreground",children:p.label},p.value))})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"points",children:"Story Points"}),(0,Js.jsx)($,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:p=>d("storyPoints",parseInt(p.target.value)||1),placeholder:"Enter story points",required:!0})]}),!l&&(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"epic",children:"Epic"}),(0,Js.jsxs)(ot,{value:s.epic,onValueChange:p=>d("epic",p),children:[(0,Js.jsx)(et,{children:(0,Js.jsx)(Rt,{placeholder:"Select an epic"})}),(0,Js.jsx)(tt,{children:o.map(p=>(0,Js.jsx)(ye,{value:p.id.toString(),children:(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)("div",{className:`w-3 h-3 rounded-full ${p.color}`}),p.name]})},p.id))})]})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Js.jsxs)(ot,{value:s.sprint,onValueChange:p=>d("sprint",p),children:[(0,Js.jsx)(et,{children:(0,Js.jsx)(Rt,{placeholder:"Select a sprint"})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsx)(ye,{value:"none",children:"No Sprint"}),r.map(p=>(0,Js.jsx)(ye,{value:p.id.toString(),children:(0,Js.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"sprint",children:"Assignee"}),(0,Js.jsxs)(ot,{value:s.assignee,onValueChange:p=>d("assignee",p),children:[(0,Js.jsx)(et,{children:(0,Js.jsx)(Rt,{placeholder:"Select an Assignee"})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsx)(ye,{value:"none",children:"No Assignee"}),i.map(p=>(0,Js.jsx)(ye,{value:p.id.toString(),children:(0,Js.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,Js.jsxs)(qo,{children:[(0,Js.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Js.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var hs=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:i="",disabled:l=!1})=>{let[s,c]=(0,xr.useState)(!1),[n,d]=(0,xr.useState)(""),p=()=>{l||(c(!0),d(t))},x=async()=>{n!==t&&await r(e,n),c(!1)},u=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?x():h.key==="Escape"&&(c(!1),d(""))};return(0,Js.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Js.jsx)(I,{children:a}),s?o?(0,Js.jsx)(Ie,{value:n,onChange:h=>d(h.target.value),onBlur:x,onKeyDown:u,autoFocus:!0,rows:4,className:"resize-none"}):(0,Js.jsx)($,{value:n,onChange:h=>d(h.target.value),onBlur:x,onKeyPress:u,autoFocus:!0,className:"text-lg font-medium"}):(0,Js.jsxs)("div",{onClick:p,className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Js.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!l&&(0,Js.jsx)(gn.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var _l=({comments:e,onAddComment:t})=>{let[a,o]=(0,$l.useState)(""),r=l=>l.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{a.trim()&&(t(a),o(""))};return(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.MessageSquare,{className:"h-5 w-5"}),(0,Js.jsx)(I,{className:"text-lg font-medium",children:"Comments"}),(0,Js.jsx)(Y,{variant:"secondary",children:e.length})]}),(0,Js.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(l=>(0,Js.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Js.jsx)(Kt,{className:"h-8 w-8 mt-1",children:(0,Js.jsx)(Gt,{className:"text-xr bg-muted text-muted-foreground",children:r(l.author)})}),(0,Js.jsxs)("div",{className:"flex-1",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Js.jsx)("span",{className:"font-medium text-sm",children:l.author}),(0,Js.jsxs)("span",{className:"text-xr text-muted-foreground",children:[l.createdAt.toLocaleDateString()," at ",l.createdAt.toLocaleTimeString()]})]}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground",children:l.text})]})]},l.id))}),(0,Js.jsxs)("div",{className:"flex gap-2",children:[(0,Js.jsx)(Ie,{value:a,onChange:l=>o(l.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Js.jsx)(w,{onClick:i,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Js.jsx)(gn.Send,{className:"h-4 w-4"})})]})]})};var ci=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:i=!1})=>{let[l,s]=(0,xr.useState)(!1),c=o.find(d=>d.value===t);return(0,Js.jsxs)("div",{className:"space-y-1",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:e}),(0,Js.jsxs)(ot,{value:t,onValueChange:a,open:l,onOpenChange:d=>{i||s(d)},disabled:i,children:[(0,Js.jsx)(et,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Js.jsxs)(Y,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!l),children:[r&&c?.color&&(0,Js.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,Js.jsx)(tt,{children:o.map(d=>(0,Js.jsx)(ye,{value:d.value,children:r&&d.color?(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var Jl=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:l=!1})=>{let[s,c]=(0,xr.useState)(!1),[n,d]=(0,xr.useState)(""),p=o.find(m=>m.value===t),x=o.filter(m=>m.label.toLowerCase().includes(n.toLowerCase())),u=m=>{a(m),c(!1),d("")},h=()=>{i&&n.trim()&&!o.find(m=>m.value===n.trim())&&(a(n.trim()),c(!1),d(""))};return(0,Js.jsxs)("div",{className:"space-y-1",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:e}),(0,Js.jsxs)(ot,{value:t,onValueChange:u,open:s,onOpenChange:m=>{l||c(m)},disabled:l,children:[(0,Js.jsx)(et,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Js.jsx)(Y,{variant:"secondary",className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!l&&c(!s),children:p?.label||t||"Select..."})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsx)("div",{className:"p-2",children:(0,Js.jsx)($,{placeholder:r,value:n,onChange:m=>d(m.target.value),onKeyDown:m=>{m.key==="Enter"&&i&&h()},className:"mb-2"})}),x.map(m=>(0,Js.jsx)(ye,{value:m.value,children:m.label},m.value)),i&&n.trim()&&!x.find(m=>m.value===n.trim())&&(0,Js.jsxs)(ye,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var nt=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var pm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:gn.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:gn.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:gn.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:gn.Zap}],um=[{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 ql=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:i,onDelete:l,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:d})=>{let[p,x]=(0,xr.useState)(e.storyPoints),u=(0,xr.useRef)(null),[h,b]=(0,xr.useState)(d);(0,xr.useEffect)(()=>{b(d)},[d]);let m=(0,xr.useCallback)((S,M)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{r(S,M)},500)},[r]);(0,xr.useEffect)(()=>{m("storyPoints",p?.toString()||"1")},[p]);let D=S=>S.split(" ").map(M=>M[0]).join("").toUpperCase(),R=()=>n==="loading"?(0,Js.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xr gap-1",children:[(0,Js.jsx)(gn.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,Js.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xr gap-1",children:[(0,Js.jsx)(gn.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,Js.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xr gap-1",children:[(0,Js.jsx)(gn.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Js.jsxs)(w,{onClick:l,variant:"destructive",className:"w-full h-8 text-xr gap-1",disabled:s||c,children:[(0,Js.jsx)(gn.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Js.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Js.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:"Status"}),(0,Js.jsx)(ci,{label:"",value:e.status,onValueChange:S=>r("status",S),options:[{value:"todo",label:"xr Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:"Type"}),(0,Js.jsx)(lo,{type:"single",value:e.type||"",onValueChange:S=>S&&r("type",S),className:"grid grid-cols-2 gap-1",disabled:s,children:pm.map(S=>{let M=S.icon;return(0,Js.jsxs)(co,{value:S.value,className:"flex items-center gap-1 text-xr h-8 data-[state=Js]:bg-primary data-[state=Js]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Js.jsx)(M,{className:"h-3 w-3"}),S.label]},S.value)})})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:"Priority"}),(0,Js.jsx)(lo,{type:"single",value:e.priority||"",onValueChange:S=>S&&r("priority",S),className:"grid grid-cols-3 gap-1",disabled:s,children:um.map(S=>(0,Js.jsx)(co,{value:S.value,className:"text-xr h-8 data-[state=Js]:bg-primary data-[state=Js]:text-primary-foreground",size:"sm",disabled:s,children:S.label},S.value))})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:"Story Points"}),(0,Js.jsx)("input",{type:"number",min:"1",max:"100",value:p||1,onChange:S=>{let M=Number(S.target.value);M<1?x(1):M>100?x(100):x(M)},className:"w-full h-8 px-2 text-xr 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,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:"Epic"}),(0,Js.jsx)(ci,{label:"",value:nt(e.epic).toString(),onValueChange:S=>r("epic",S),options:(t||[]).map(S=>({value:S.id.toString(),label:S?.name,color:S.color})),showColor:!0,disabled:s})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:"Sprint"}),(0,Js.jsx)(ci,{label:"",value:nt(e.sprint).toString()||"none",onValueChange:S=>r("sprint",S==="none"?"":S),options:[{value:"none",label:"No Sprint"},...(a||[]).map(S=>({value:S.id.toString(),label:`${S?.name}`}))],disabled:s})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{className:"text-xr text-muted-foreground",children:"Assignee"}),(0,Js.jsx)(Jl,{label:"",value:e.assignee?.value?.name,onValueChange:S=>r("assignee",S),options:h.map(S=>({value:`${typeof S.email=="string"?"users":"digital-colleagues"}:${S.id}`,label:S?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Js.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(w,{onClick:i,variant:"outline",className:"w-full h-8 text-xr",disabled:s||c,children:"Close"}),R()]}),(0,Js.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Js.jsx)("div",{className:"text-xr text-muted-foreground font-medium mb-2",children:"Information"}),(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)("span",{className:"text-xr text-muted-foreground",children:"Logged By"}),(0,Js.jsxs)("div",{className:"flex items-center gap-1 text-xr text-muted-foreground",children:[(0,Js.jsx)(gn.User,{className:"h-3 w-3"}),(0,Js.jsx)("span",{children:"System"})]})]}),(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)("span",{className:"text-xr text-muted-foreground",children:"Created"}),(0,Js.jsxs)("div",{className:"flex items-center gap-1 text-xr text-muted-foreground",children:[(0,Js.jsx)(gn.Calendar,{className:"h-3 w-3"}),(0,Js.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)("span",{className:"text-xr text-muted-foreground",children:"Last Updated"}),(0,Js.jsxs)("div",{className:"flex items-center gap-1 text-xr text-muted-foreground",children:[(0,Js.jsx)(gn.Clock,{className:"h-3 w-3"}),(0,Js.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Xl=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:i,onDeleteTask:l,onAddComment:s,colleagues:c})=>{let[n,d]=(0,xr.useState)(a),[p,x]=(0,xr.useState)(new Date),[u,h]=(0,xr.useState)("idle"),[b,m]=(0,xr.useState)("idle"),[D,R]=(0,xr.useState)([]),[S,M]=(0,xr.useState)(c);(0,xr.useEffect)(()=>{d(a)},[a]);let ee=async(N,je)=>{if(je!==n[N]){h("loading");try{await i(n.id.toString(),{[N]:je}),x(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(C){console.log("error",C),h("error"),setTimeout(()=>h("idle"),3e3)}}},k=async(N,je)=>{if(je!==n[N]){h("loading");try{await i(n.id.toString(),{[N]:je}),x(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(C){console.log("error",C),h("error"),setTimeout(()=>h("idle"),3e3)}}},Z=async N=>{if(s){h("loading");try{await s?.({content:N,taskId:n.id.toString()}),x(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},A=async()=>{m("loading");try{await l(n.id.toString()),m("success"),setTimeout(()=>{t(),m("idle")},1e3)}catch{m("error"),setTimeout(()=>m("idle"),3e3)}},O=u!=="loading"&&b!=="loading",j=()=>{O&&t()},W=()=>u==="loading"?(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Js.jsx)(gn.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Js.jsx)("span",{children:"Updating..."})]}):u==="success"?(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Js.jsx)(gn.Check,{className:"h-4 w-4"}),(0,Js.jsx)("span",{children:"Updated successfully"})]}):u==="error"?(0,Js.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Js.jsx)(gn.X,{className:"h-4 w-4"}),(0,Js.jsx)("span",{children:"Update failed"})]}):null;return(0,Js.jsx)(wt,{open:e,onOpenChange:j,children:(0,Js.jsxs)(dt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Js.jsxs)(ct,{children:[(0,Js.jsx)(mt,{className:"ja-only",children:n?.name}),(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)("div",{className:"flex-1",children:W()}),!O&&(0,Js.jsx)("div",{className:"text-xr text-muted-foreground",children:"Please wait..."})]})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Js.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Js.jsx)(hs,{fieldName:"name",value:n.name||"",label:"",onSave:ee,className:"border-b border-border pb-3",disabled:u==="loading"}),(0,Js.jsx)(hs,{fieldName:"description",value:n.description||"",label:"Description",multiline:!0,onSave:ee,disabled:u==="loading"}),(0,Js.jsx)(_l,{comments:(n?.comments||[]).map(N=>({author:N.author.value.name||"",createdAt:new Date(N.timestamp),text:N.text,id:N.id||""})),onAddComment:Z})]}),(0,Js.jsx)(ql,{task:n,epics:o,sprints:r,lastUpdated:p,onUpdateTask:k,onClose:j,onDelete:A,isUpdating:u==="loading",isDeleting:b==="loading",deleteState:b,teamMembers:S})]})]})})};var Oo=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,xr.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"],l=[{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"}],c=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())},n=(d,p)=>{r(x=>({...x,[d]:p}))};return(0,Js.jsx)(wt,{open:e,onOpenChange:t,children:(0,Js.jsxs)(dt,{className:"sm:max-w-md",children:[(0,Js.jsx)(ct,{children:(0,Js.jsx)(mt,{children:"Add New Epic"})}),(0,Js.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"name",children:"Epic Name"}),(0,Js.jsx)($,{id:"name",value:o.name,onChange:d=>n("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Js.jsx)(Ie,{id:"description",value:o.description,onChange:d=>n("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"Color"}),(0,Js.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,Js.jsx)("button",{type:"button",onClick:()=>n("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"Confidence"}),(0,Js.jsxs)(ot,{value:o.confidence,onValueChange:d=>n("confidence",d),children:[(0,Js.jsx)(et,{children:(0,Js.jsx)(Rt,{})}),(0,Js.jsx)(tt,{children:l.map(d=>(0,Js.jsx)(ye,{value:d.value,children:d.label},d.value))})]})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"Phase"}),(0,Js.jsxs)(ot,{value:o.phase.toString(),onValueChange:d=>n("phase",parseInt(d)),children:[(0,Js.jsx)(et,{children:(0,Js.jsx)(Rt,{})}),(0,Js.jsx)(tt,{children:s.map(d=>(0,Js.jsx)(ye,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"Start Date"}),(0,Js.jsx)($,{type:"date",value:o.startDate,onChange:d=>n("startDate",d.target.value)})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"End Date"}),(0,Js.jsx)($,{type:"date",value:o.endDate,onChange:d=>n("endDate",d.target.value)})]})]}),(0,Js.jsxs)(qo,{children:[(0,Js.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Js.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Ql=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:l,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:d,onAddComment:p})=>{let[x,u]=(0,Oe.useState)([]),[h,b]=(0,Oe.useState)([]),[m,D]=(0,Oe.useState)([]),[R,S]=(0,Oe.useState)(!1),[M,ee]=(0,Oe.useState)(!1),[k,Z]=(0,Oe.useState)(null),[A,O]=(0,Oe.useState)(null),[j,W]=(0,Oe.useState)([]),[N,je]=(0,Oe.useState)([]),[C,Ne]=(0,Oe.useState)(0),ce=(0,Oe.useRef)(null),Dt=(0,Oe.useRef)(null),lt=Oe.default.useMemo(()=>[...h.map(F=>F.id),0],[h]),Ot=(0,Oe.useRef)(""),zt=(0,Oe.useRef)(""),E=(0,Oe.useRef)(""),De=(0,Oe.useRef)(""),Ge=F=>F.map(y=>`${y.id}-${new Date(y.createdAt).getTime()}-${new Date(y.updatedAt).getTime()}`).join("-");(0,Oe.useEffect)(()=>{let F=Ge(e);F!==Ot.current&&(u(e),k&&Z(e.find(y=>y.id===k.id)||null),Ot.current=F)},[e]),(0,Oe.useEffect)(()=>{let F=Ge(t);F!==zt.current&&(b(t),zt.current=F)},[t]),(0,Oe.useEffect)(()=>{let F=Ge(a);F!==E.current&&(D(a),E.current=F)},[a]),(0,Oe.useEffect)(()=>{let F=Ge(r.map(y=>({id:y.id,updatedAt:y.updatedAt,createdAt:y.createdAt})));F!==De.current&&(je(r),De.current=F)},[r]),(0,Oe.useEffect)(()=>{let F=()=>{if(ce.current){let ae=ce.current.offsetHeight;Ne(ae)}};F();let y=new ResizeObserver(F);ce.current&&y.observe(ce.current);let T=()=>{setTimeout(F,100)};return window.addEventListener("storage",T),()=>{y.disconnect(),window.removeEventListener("storage",T)}},[]),(0,Oe.useEffect)(()=>{let F=setTimeout(()=>{ce.current&&Ne(ce.current.offsetHeight)},300);return()=>clearTimeout(F)},[R,M]);let Ut=x.filter(F=>!0),Me=F=>Ut.filter(y=>y.status===F),jt=F=>{let y={};return h.forEach(T=>{y[T.id]=F.filter(ae=>nt(ae.epic)===T.id)}),y["no-epic"]=F.filter(T=>!nt(T.epic)),y},H=F=>{O(F)},Je=F=>{A&&(u(y=>y.map(T=>T.id===A.id?{...T,status:F}:T)),s?.(A.id.toString(),{status:F}),O(null))},Fe=F=>{let y={...F,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};u(T=>[...T,y]),l?.(F)},ca=async(F,y)=>{u(T=>T.map(ae=>ae.id===Number(F)?{...ae,...y}:ae)),s&&await s(F,y),k?.id===Number(F)&&Z(T=>({...T,...y}))},xa=async F=>{u(y=>y.filter(T=>T.id!==Number(F))),k?.id===Number(F)&&Z(null),c&&await c(F)},Ia=F=>{let y={...F,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};b(T=>[...T,y]),d?.(F)},Ma=F=>{Z(F),n?.(F)},po=[{id:"todo",title:"xr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],uo=C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)";return(0,Js.jsxs)("div",{ref:Dt,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Js.jsx)("div",{ref:ce,className:"flex-shrink-0",children:(0,Js.jsx)(ze,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>S(!0)},secondaryAction:{label:"Add epic",onClick:()=>ee(!0)}})}),(0,Js.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Js.jsx)("div",{className:"h-full",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:(0,Js.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:po.map(F=>{let y=Me(F.status),T=jt(y);return(0,Js.jsxs)(Hl,{title:F.title,status:F.status,taskCount:y.length,onDrop:Je,isCompact:F.status==="done",height:uo,children:[T["no-epic"].map(ae=>(0,Js.jsx)(fr,{epic:null,task:ae,onDragStart:H,onTaskClick:Ma,isCompact:F.status==="done"},ae.id)),lt.map(ae=>{let ke=h.find(Ze=>Ze.id===ae),at=T[ae]||[];return at.length===0?null:(0,Js.jsxs)("div",{className:"mb-6",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Js.jsx)("div",{className:`w-3 h-3 rounded-full ${ke?.color}`}),(0,Js.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:ke?.name||"No Epic"}),(0,Js.jsx)(Y,{variant:"secondary",className:"text-xr",children:at.length})]})," ",(0,Js.jsx)("div",{className:"space-y-3",children:at.map(Ze=>(0,Js.jsx)(fr,{task:Ze,epic:ke,onDragStart:H,onTaskClick:Ma,isCompact:F.status==="done"},Ze.id))})]},ae)})]},F.id)})})})}),(0,Js.jsx)(Fo,{isOpen:R,onClose:()=>S(!1),onAddTask:Fe,assignees:[...N,...j],epics:h,sprints:m}),(0,Js.jsx)(Oo,{isOpen:M,onClose:()=>ee(!1),onAddEpic:Ia}),k&&(0,Js.jsx)(Xl,{isOpen:!!k,onClose:()=>Z(null),initialTask:k,epics:h,sprints:m,onUpdateTask:ca,onDeleteTask:xa,colleagues:N,onAddComment:p})]})};var Zl=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:l,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,d]=(0,xr.useState)(t),[p,x]=(0,xr.useState)(null),[u,h]=(0,xr.useState)(null),[b,m]=(0,xr.useState)({}),[D,R]=(0,xr.useState)(0),[S,M]=(0,xr.useState)(!1),[ee,k]=(0,xr.useState)(!1),[Z,A]=(0,xr.useState)(null),O=(0,xr.useRef)(null),j=(0,xr.useRef)(null);(0,xr.useEffect)(()=>{d(t)},[t]),(0,xr.useEffect)(()=>{let E=()=>{if(O.current){let Ut=O.current.offsetHeight;R(Ut)}};E();let De=new ResizeObserver(E);O.current&&De.observe(O.current);let Ge=()=>{setTimeout(E,100)};return window.addEventListener("storage",Ge),()=>{De.disconnect(),window.removeEventListener("storage",Ge)}},[]),(0,xr.useEffect)(()=>{let E=setTimeout(()=>{O.current&&R(O.current.offsetHeight)},300);return()=>clearTimeout(E)},[u]);let W=E=>{x(E)},N=E=>{E.preventDefault()},je=(E,De)=>{E.preventDefault(),p&&nt(p.epic).toString()!==De&&(o(p.id.toString(),{epic:Number(De)}),x(null))},C=E=>e.filter(De=>nt(De.epic).toString()===E),Ne=E=>{h(E.id.toString()),m({name:E.name,description:E.description,confidence:E.confidence,phase:E.phase})},ce=async()=>{u&&b.name&&(await s(u.toString(),b),d(E=>E.map(De=>De.id.toString()===u?{...De,...b}:De)),h(null),m({}))},Dt=()=>{h(null),m({})},lt=async E=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await c(E),d(De=>De.filter(Ge=>Ge.id.toString()!==E)))},Ot=E=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[E]||`Phase ${E}`,zt=E=>{switch(E){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,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsxs)("div",{ref:j,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Js.jsx)("div",{ref:O,className:"flex-shrink-0",children:(0,Js.jsx)(ze,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>M(!0)}})}),(0,Js.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Js.jsx)("div",{className:"h-full overflow-y-auto",style:{height:D>0?`calc(100vh - ${D+120}px)`:"calc(100vh - 12rem)"},children:(0,Js.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 ja:grid-cols-4 gap-6 auto-rows-max",children:n.map(E=>{let De=C(E.id.toString()),Ge=De.reduce((Me,jt)=>Me+(jt.storyPoints||0),0),Ut=D>0?`calc(100vh - ${D+200}px)`:"calc(100vh - 14rem)";return(0,Js.jsxs)(U,{className:`flex flex-col ${u===E.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:u===E.id.toString()?"auto":Ut,minHeight:"400px"},onDragOver:N,onDrop:Me=>je(Me,E.id.toString()),children:[(0,Js.jsx)("div",{className:"p-4 border-b border-border",children:u===E.id.toString()?(0,Js.jsxs)("div",{className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)($,{value:b.name||"",onChange:Me=>m({...b,name:Me.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Js.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:ce,className:"p-1 h-8 w-8",children:(0,Js.jsx)(gn.Check,{className:"h-4 w-4"})}),(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:Dt,className:"p-1 h-8 w-8",children:(0,Js.jsx)(gn.X,{className:"h-4 w-4"})})]})]}),(0,Js.jsx)(Ie,{value:b.description||"",onChange:Me=>m({...b,description:Me.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("label",{className:"text-xr text-muted-foreground",children:"Confidence"}),(0,Js.jsxs)("select",{value:b.confidence||E.confidence,onChange:Me=>m({...b,confidence:Me.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xr 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,Js.jsx)("option",{value:"low",children:"Low"}),(0,Js.jsx)("option",{value:"medium",children:"Medium"}),(0,Js.jsx)("option",{value:"high",children:"High"})]})]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)("label",{className:"text-xr text-muted-foreground",children:"Phase"}),(0,Js.jsx)("select",{value:b.phase?.toString()||E.phase.toString(),onChange:Me=>m({...b,phase:parseInt(Me.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xr 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(Me=>(0,Js.jsxs)("option",{value:Me.toString(),children:["Phase ",Me]},Me))})]})]})]}):(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Js.jsx)("div",{className:`w-4 h-4 rounded-full ${E.color}`}),(0,Js.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:E.name}),(0,Js.jsxs)("div",{className:"flex gap-1",children:[(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>Ne(E),className:"p-1 h-8 w-8",children:(0,Js.jsx)(gn.Edit2,{className:"h-3 w-3"})}),(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>lt(E.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Js.jsx)(gn.Trash2,{className:"h-3 w-3"})})]})]}),(0,Js.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Js.jsxs)(Y,{className:`text-xr ${zt(E.confidence)}`,children:[E.confidence," confidence"]}),(0,Js.jsxs)(Y,{variant:"outline",className:"text-xr",children:["Phase ",E.phase]}),(0,Js.jsxs)(Y,{variant:"secondary",className:"text-xr bg-muted text-muted-foreground",children:[De.length," tasks"]}),(0,Js.jsxs)(Y,{variant:"secondary",className:"text-xr bg-muted text-muted-foreground",children:[Ge," pts"]})]}),E.description&&(0,Js.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:E.description}),(0,Js.jsxs)(w,{onClick:()=>{k(!0),A(E)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Js.jsx)(gn.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Js.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Js.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${p?"border-primary bg-primary/10":"border-border"}`,children:De.length===0?(0,Js.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,Js.jsx)(gn.Move,{className:"h-8 w-8 mb-2"}),(0,Js.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):De.map(Me=>(0,Js.jsx)(fr,{task:Me,epic:E,onDragStart:W,onTaskClick:r,isCompact:!0},Me.id))})})]},E.id)})})})})]}),(0,Js.jsx)(Oo,{isOpen:S,onClose:()=>M(!1),onAddEpic:l}),(0,Js.jsx)(Fo,{isOpen:ee,onClose:()=>k(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:Z?.id.toString()||"",sprints:a})]})};var ed=require("react-day-picker");function mi({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Js.jsx)(ed.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:f("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:f(yr({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:f("relative p-0 text-center text-sm focus-within:relative focus-within:Js-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:f(yr({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}mi.displayName="Calendar";var ad=ie(require("react")),ha=ie(require("@radix-ui/react-popover"));var ws=ha.Root,Ns=ha.Trigger;var pi=ad.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,Js.jsx)(ha.Portal,{children:(0,Js.jsx)(ha.Content,{ref:r,align:t,sideOffset:a,className:f("Js-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));pi.displayName=ha.Content.displayName;var Ss=require("date-fns");var rd=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,xr.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())},l=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Js.jsx)(wt,{open:e,onOpenChange:l,children:(0,Js.jsxs)(dt,{className:"sm:max-w-md",children:[(0,Js.jsx)(ct,{children:(0,Js.jsx)(mt,{children:"Add New Sprint"})}),(0,Js.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"name",children:"Sprint Name *"}),(0,Js.jsx)($,{id:"name",value:o.name,onChange:s=>r(c=>({...c,name:s.target.value})),placeholder:"e.Js., Sprint 3",required:!0})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Js.jsx)(Ie,{id:"description",value:o.description,onChange:s=>r(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"Start Date *"}),(0,Js.jsxs)(ws,{children:[(0,Js.jsx)(Ns,{asChild:!0,children:(0,Js.jsxs)(w,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Js.jsx)(gn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ss.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Js.jsx)(pi,{className:"w-auto p-0",align:"start",children:(0,Js.jsx)(mi,{mode:"single",selected:o.startDate,onSelect:s=>r(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{children:"End Date *"}),(0,Js.jsxs)(ws,{children:[(0,Js.jsx)(Ns,{asChild:!0,children:(0,Js.jsxs)(w,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Js.jsx)(gn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ss.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Js.jsx)(pi,{className:"w-auto p-0",align:"start",children:(0,Js.jsx)(mi,{mode:"single",selected:o.endDate,onSelect:s=>r(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,Js.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Js.jsx)(w,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),(0,Js.jsx)(w,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var ui=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:i,onUpdateSprint:l,onDeleteSprint:s})=>{let[c,n]=(0,xr.useState)([]),[d,p]=(0,xr.useState)(new Set),[x,u]=(0,xr.useState)(null),[h,b]=(0,xr.useState)(!1),[m,D]=(0,xr.useState)(null),[R,S]=(0,xr.useState)(null),[M,ee]=(0,xr.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[k,Z]=(0,xr.useState)([]),[A,O]=(0,xr.useState)("upcoming"),[j,W]=(0,xr.useState)(!1),[N,je]=(0,xr.useState)(0),C=(0,xr.useRef)(null),Ne=(0,xr.useRef)(null);(0,xr.useEffect)(()=>{let y=()=>{C.current&&je(C.current.offsetHeight)};y();let T=new ResizeObserver(y);return C.current&&T.observe(C.current),()=>T.disconnect()},[]);let ce=y=>t.find(T=>T.id===Number(y)),Dt=y=>a.find(T=>T.id===Number(y)),lt=y=>{let T={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 T[y]||T.medium},Ot=y=>{if(!y||y?.length===0)return"";let T=y?.trim().split(" ");if(T?.length===1)return T[0];let ae=T[0],ke=T[T.length-1][0].toUpperCase();return`${ae} ${ke}`},zt=y=>{let T={},ae=[];return y.forEach(ke=>{ke.epic?(T[nt(ke.epic)]||(T[nt(ke.epic)]=[]),T[nt(ke.epic)].push(ke)):ae.push(ke)}),{tasksByEpic:T,unassignedTasks:ae}};(0,xr.useEffect)(()=>{Z(a)},[a]);let E=k.filter(y=>{switch(A){default:return!0}}),De=k.filter(y=>c.includes(y.id.toString())),Ge=e.filter(y=>!y.sprint||y.status==="backlog"),Ut=Ge.reduce((y,T)=>y+(T.storyPoints||0),0),Me=y=>{n(T=>T.includes(y)?T.filter(ae=>ae!==y):T?.length<3?[...T,y]:T)},jt=y=>{p(T=>{let ae=new Set(T);return ae.has(y)?ae.delete(y):ae.add(y),ae})},H=y=>{i(y),b(!1)},Je=y=>{S(y.id.toString()),ee({name:y.name,description:y.description||"",startDate:y.startDate?new Date(y.startDate).toISOString().split("T")[0]:y.startDate,endDate:y.endDate?new Date(y.endDate).toISOString().split("T")[0]:y.endDate,isActive:!1})},Fe=()=>{R&&(l(R,{name:M.name,description:M.description,startDate:M.startDate,endDate:M.endDate}),Z(y=>y.map(T=>(T.id===Number(R)&&(T.name=M.name,T.description=M.description,T.startDate=M.startDate,T.endDate=M.endDate),T))),S(null))},ca=()=>{S(null),ee({name:"",description:"",startDate:"",endDate:"",isActive:!1})},xa=(y,T)=>{u(T),y.dataTransfer.effectAllowed="move"},Ia=y=>{y.preventDefault(),y.dataTransfer.dropEffect="move"},Ma=y=>{D(y)},po=()=>{D(null)},uo=(y,T)=>{if(y.preventDefault(),D(null),!x)return;(nt(x.sprint)||void 0)!==Number(T)&&o(x.id.toString(),{sprint:Number(T)}),u(null)},F=({task:y,showSprint:T=!1})=>{let ae=y.epic?ce(nt(y.epic).toString()):null,ke=y.sprint?Dt(nt(y.sprint).toString()):null;return(0,Js.jsx)(U,{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:Mt=>{Mt.dataTransfer.effectAllowed="move",Mt.dataTransfer.setData("text/plain",y.id.toString()),xa(Mt,y)},onClick:Mt=>{x===null&&r(y)},style:{userSelect:"none"},children:(0,Js.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Js.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Js.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:y.name}),(0,Js.jsx)(Y,{className:`text-xr ${lt(y.priority||"medium")}`,children:y.priority?.[0]?.toUpperCase()})]}),(0,Js.jsxs)("div",{className:"flex items-center justify-between text-xr",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-1",children:[ae&&(0,Js.jsx)("div",{className:`w-2 h-2 rounded-full ${ae.color}`}),(0,Js.jsx)("span",{className:"text-muted-foreground truncate",children:ae?.name})]}),(0,Js.jsx)("span",{className:"text-muted-foreground",children:Ot(y.assignee?.value?.name)})]}),T&&ke&&(0,Js.jsxs)("div",{className:"flex items-center gap-1 text-xr text-muted-foreground",children:[(0,Js.jsx)(gn.Calendar,{className:"h-3 w-3"}),(0,Js.jsx)("span",{children:ke.name})]})]})})};return(0,Js.jsxs)("div",{ref:Ne,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Js.jsx)("div",{ref:C,className:"flex-shrink-0",children:(0,Js.jsx)(ze,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>b(!0)}})}),(0,Js.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Js.jsxs)("div",{className:"h-full",style:{height:N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)"},children:[(0,Js.jsxs)("div",{className:"mb-4",children:[(0,Js.jsx)(U,{className:"p-3 bg-card shadow-sm",children:(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Js.jsxs)("p",{className:"text-xr text-muted-foreground",children:[c?.length,"/3 selected"]})]}),c?.length>0&&(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)("span",{className:"text-xr text-muted-foreground",children:"Viewing:"}),(0,Js.jsx)("div",{className:"flex flex-wrap gap-1",children:De.map(y=>(0,Js.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xr",children:[(0,Js.jsx)("span",{className:"max-w-[80px] truncate",children:y.name}),(0,Js.jsx)("button",{onClick:()=>Me(y.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Js.jsx)(gn.X,{className:"h-4 w-4"})})]},y.id))})]})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsxs)(w,{onClick:()=>b(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Js.jsx)(gn.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Js.jsxs)(w,{onClick:()=>W(!j),variant:"outline",size:"sm",className:"gap-1",children:[(0,Js.jsx)(gn.Calendar,{className:"h-3 w-3"}),j?"Close":"Select"]})]})]})}),j&&(0,Js.jsx)("div",{className:"fixed inset-0 bg-black/20 Js-[5]",onClick:()=>W(!1)}),(0,Js.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-ja Js-10 transition-all duration-300 ease-in-out ${j?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Js.jsxs)(U,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Js.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Js.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Js.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>W(!1),className:"h-8 w-8 p-0",children:(0,Js.jsx)(gn.X,{className:"h-4 w-4"})})]}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Js.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Js.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(y=>(0,Js.jsxs)(w,{variant:A===y.key?"default":"outline",size:"sm",onClick:()=>O(y.key),className:"text-xr h-8 px-3 flex-1",children:[y.label," (",y.count,")"]},y.key))}),(0,Js.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:E.length>0?E.map(y=>{let T=c.includes(y.id.toString()),ae=e.filter(at=>nt(at.sprint)===y.id).length,ke=!T&&c.length<3;return(0,Js.jsx)("div",{className:`p-3 rounded-lg border transition-all ${T?"bg-primary/10 border-primary/30":ke?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:R===y.id.toString()?(0,Js.jsxs)("div",{className:"space-y-3",children:[(0,Js.jsx)($,{value:M.name,onChange:at=>ee(Ze=>({...Ze,name:at.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Js.jsx)(Ie,{value:M.description,onChange:at=>ee(Ze=>({...Ze,description:at.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Js.jsxs)("div",{className:"flex gap-2",children:[(0,Js.jsxs)(w,{size:"sm",onClick:()=>Fe(),className:"flex-1",children:[(0,Js.jsx)(gn.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Js.jsxs)(w,{size:"sm",variant:"outline",onClick:ca,className:"flex-1",children:[(0,Js.jsx)(gn.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Js.jsxs)("div",{children:[(0,Js.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Js.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Js.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:y.name}),(0,Js.jsx)(Y,{variant:"default",className:"text-xr bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Js.jsx)("p",{className:"text-xr text-muted-foreground line-clamp-2 mb-2",children:y.description}),(0,Js.jsxs)("div",{className:"flex items-center gap-3 text-xr text-muted-foreground",children:[(0,Js.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Js.jsx)(gn.CalendarDays,{className:"h-3 w-3"}),new Date(y.startDate).toLocaleDateString()]}),(0,Js.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Js.jsx)(gn.User,{className:"h-3 w-3"}),ae," tasks"]})]})]}),(0,Js.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>Je(y),className:"h-6 w-6 p-0",children:(0,Js.jsx)(gn.Edit2,{className:"h-3 w-3"})}),(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Js.jsx)(gn.Trash2,{className:"h-3 w-3"})})]})]}),(0,Js.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Js.jsx)(w,{variant:T?"default":"outline",size:"sm",className:"text-xr w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Me(y.id.toString()),disabled:!T&&c?.length>=3,children:(0,Js.jsx)("span",{className:"pointer-events-none select-none",children:T?"Deselect":c?.length>=3?"Limit Reached":"Select"})})})]})},y.id)}):(0,Js.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Js.jsx)(gn.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Js.jsxs)("p",{className:"text-sm",children:['No sprints found for "',A,'" filter']}),(0,Js.jsx)(w,{variant:"link",size:"sm",onClick:()=>O("all"),className:"text-xr",children:"Show all sprints"})]})}),c?.length===0&&(0,Js.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Js.jsxs)("div",{className:"text-center",children:[(0,Js.jsx)(gn.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Js.jsx)("p",{className:"text-xr text-muted-foreground mt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Js.jsx)("div",{className:"lg:col-span-1",children:(0,Js.jsxs)(U,{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:Ia,onDragEnter:()=>Ma("backlog"),onDragLeave:po,onDrop:y=>uo(y,"backlog"),style:{height:N>0?`calc(100vh - ${N+200}px)`:"calc(100vh - 16rem)"},children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Js.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsxs)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Ge?.length," tasks"]}),(0,Js.jsxs)(Y,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Ut," pts"]})]})]}),(0,Js.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${m==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:y,unassignedTasks:T}=zt(Ge);return(0,Js.jsxs)(Js.Fragment,{children:[Object.entries(y).map(([ae,ke])=>{let at=ce(ae);if(!at)return null;let Ze=d.has(ae);return(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xr cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>jt(ae),children:[(0,Js.jsx)("div",{className:`w-3 h-3 rounded-full ${at.color}`}),(0,Js.jsx)("span",{className:"font-medium text-muted-foreground",children:at.name}),(0,Js.jsxs)("span",{className:"text-muted-foreground",children:["(",ke?.length,")"]}),(0,Js.jsx)("div",{className:"ml-auto",children:Ze?(0,Js.jsx)(gn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Js.jsx)(gn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ze&&(0,Js.jsx)("div",{className:"space-y-2 xr-2",children:ke.map(Mt=>(0,Js.jsx)(F,{task:Mt},Mt.id))})]},ae)}),T?.length>0&&(()=>{let ae=d.has("no-epic");return(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xr cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>jt("no-epic"),children:[(0,Js.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Js.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Js.jsxs)("span",{className:"text-muted-foreground",children:["(",T?.length,")"]}),(0,Js.jsx)("div",{className:"ml-auto",children:ae?(0,Js.jsx)(gn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Js.jsx)(gn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ae&&(0,Js.jsx)("div",{className:"space-y-2 xr-2",children:T?.map(ke=>(0,Js.jsx)(F,{task:ke},ke.id))})]})})(),Ge?.length===0&&(0,Js.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),Ge?.length>0&&Object.keys(y).length===0&&T.length===0&&(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)("div",{className:"text-xr text-muted-foreground mb-2",children:"Direct backlog tasks:"}),Ge?.map(ae=>(0,Js.jsx)(F,{task:ae},ae.id))]})]})})()})]})}),De.map(y=>{let T=e.filter(ke=>nt(ke?.sprint)===y.id),ae=T.reduce((ke,at)=>ke+(at?.storyPoints||0),0);return(0,Js.jsxs)(U,{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:Ia,onDragEnter:()=>Ma(y.id.toString()),onDragLeave:po,onDrop:ke=>uo(ke,y.id.toString()),style:{height:N>0?`calc(100vh - ${N+200}px)`:"calc(100vh - 16rem)"},children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Js.jsx)("div",{children:(0,Js.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:y.name})}),(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsxs)(Y,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[T?.length," tasks"]}),(0,Js.jsxs)(Y,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[ae," pts"]}),(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>{W(!0),Je(y)},className:"h-6 px-2",children:(0,Js.jsx)(gn.Edit2,{className:"h-3 w-3"})}),(0,Js.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Js.jsx)(gn.Trash2,{className:"h-3 w-3"})})]})]}),(0,Js.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:ke,unassignedTasks:at}=zt(T);return(0,Js.jsxs)(Js.Fragment,{children:[Object.entries(ke).map(([Ze,Mt])=>{let Ho=ce(Ze);if(!Ho)return null;let zo=d.has(Ze);return(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xr cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>jt(Ze),children:[(0,Js.jsx)("div",{className:`w-3 h-3 rounded-full ${Ho.color}`}),(0,Js.jsx)("span",{className:"font-medium text-muted-foreground",children:Ho.name}),(0,Js.jsxs)("span",{className:"text-muted-foreground",children:["(",Mt?.length,")"]}),(0,Js.jsx)("div",{className:"ml-auto",children:zo?(0,Js.jsx)(gn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Js.jsx)(gn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!zo&&(0,Js.jsx)("div",{className:"space-y-2 xr-2",children:Mt?.map(Uo=>(0,Js.jsx)(F,{task:Uo},Uo.id))})]},Ze)}),at?.length>0&&(()=>{let Ze=d.has("no-epic");return(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xr cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>jt("no-epic"),children:[(0,Js.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Js.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Js.jsxs)("span",{className:"text-muted-foreground",children:["(",at?.length,")"]}),(0,Js.jsx)("div",{className:"ml-auto",children:Ze?(0,Js.jsx)(gn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Js.jsx)(gn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ze&&(0,Js.jsx)("div",{className:"space-y-2 xr-2",children:at?.map(Mt=>(0,Js.jsx)(F,{task:Mt},Mt.id))})]})})(),T?.length===0&&(0,Js.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},y.id)})]}),(0,Js.jsx)(rd,{isOpen:h,onClose:()=>b(!1),onAddSprint:H})]})})]})};var gm=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),fm=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Ds=(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},ks=e=>{let t=new Date;return e.toDateString()===t.toDateString()},vm=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},bm=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,i]=(0,xr.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[l,s]=(0,xr.useState)(!1),c=d=>{if(d.preventDefault(),!e.find(u=>u?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let x={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(x),o(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,xr.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let n=e.filter(Boolean);return(0,Js.jsx)(wt,{open:a,onOpenChange:o,children:(0,Js.jsxs)(dt,{className:"max-w-2xl",children:[(0,Js.jsx)(ct,{children:(0,Js.jsx)(mt,{children:"Add New Reminder"})}),(0,Js.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Js.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"title",children:"Title"}),(0,Js.jsx)($,{id:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"description",children:"Description"}),(0,Js.jsx)(Ie,{id:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"dueDate",children:"Due Date"}),(0,Js.jsx)($,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Js.jsx)($,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{className:`${l?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Js.jsxs)(ot,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,Js.jsx)(et,{className:`${l?"text-destructive border-red-500":""}`,children:(0,Js.jsx)(Rt,{className:`${l?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Js.jsx)(tt,{children:n.map(d=>(0,Js.jsx)(ye,{value:d.id.toString(),children:d.name},d.id))})]}),l&&(0,Js.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Js.jsx)(I,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-4 xr-6",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Js.jsxs)(ot,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,Js.jsx)(et,{children:(0,Js.jsx)(Rt,{})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsx)(ye,{value:"daily",children:"Daily"}),(0,Js.jsx)(ye,{value:"weekly",children:"Weekly"}),(0,Js.jsx)(ye,{value:"monthly",children:"Monthly"}),(0,Js.jsx)(ye,{value:"yearly",children:"Yearly"})]})]})]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Js.jsx)($,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Js.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Js.jsx)(w,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Js.jsx)(w,{type:"submit",children:"Add Reminder"})]})]})]})})},hm=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[i,l]=(0,xr.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=n=>{n.preventDefault(),a(e.id.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},c=t.filter(Boolean);return(0,Js.jsx)(wt,{open:o,onOpenChange:r,children:(0,Js.jsxs)(dt,{className:"max-w-2xl",children:[(0,Js.jsx)(ct,{children:(0,Js.jsx)(mt,{children:"Edit Reminder"})}),(0,Js.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Js.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"edit-title",children:"Title"}),(0,Js.jsx)($,{id:"edit-title",value:i.title,onChange:n=>l({...i,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"edit-description",children:"Description"}),(0,Js.jsx)(Ie,{id:"edit-description",value:i.description||"",onChange:n=>l({...i,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Js.jsx)($,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:n=>l({...i,dueDate:n.target.value}),required:!0})]}),(0,Js.jsxs)("div",{children:[(0,Js.jsx)(I,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Js.jsx)($,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:n=>l({...i,dueTime:n.target.value})})]})]}),(0,Js.jsx)("div",{className:"space-y-2",children:(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:n=>l({...i,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,Js.jsx)(I,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Js.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Js.jsx)(w,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Js.jsx)(w,{type:"submit",children:"Save Changes"})]})]})]})})},xm=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,i]=(0,xr.useState)(!1);if(!e||!e.id)return null;let l=Ds(new Date(e.dueDate||""),e.dueTime||""),s=ks(new Date(e.dueDate||"")),c=vm(new Date(e.dueDate||"")),n=()=>{a(e.id.toString(),{})},d=()=>s?"Today":c?"Tomorrow":gm(new Date(e.dueDate||""));return(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsx)(hm,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>i(!1)}),(0,Js.jsx)(U,{children:(0,Js.jsx)(fe,{className:"p-4",children:(0,Js.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Js.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Js.jsx)("button",{onClick:n,className:"mt-1 text-primary hover:text-primary/80"}),(0,Js.jsxs)("div",{className:"flex-1",children:[(0,Js.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Js.jsx)("h3",{children:e.title})}),(0,Js.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Js.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Js.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Js.jsx)(gn.Calendar,{className:"h-4 w-4"}),(0,Js.jsx)("span",{className:l?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Js.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Js.jsx)(gn.Clock,{className:"h-4 w-4"}),(0,Js.jsx)("span",{children:fm(e.dueTime)})]}),(0,Js.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Js.jsx)(gn.User,{className:"h-4 w-4"}),(0,Js.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Js.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Js.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Js.jsx)(gn.Edit2,{className:"h-4 w-4"})}),(0,Js.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Js.jsx)(gn.Trash2,{className:"h-4 w-4"})})]})]})})})]})},id=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[i,l]=(0,xr.useState)(e.filter(Boolean)),[s,c]=(0,xr.useState)(t.filter(Boolean)),[n,d]=(0,xr.useState)("all"),[p,x]=(0,xr.useState)(""),[u,h]=(0,xr.useState)(!1);(0,xr.useEffect)(()=>{l(e.filter(Boolean))},[e]),(0,xr.useEffect)(()=>{c(t.filter(Boolean))},[t]);let b=k=>{if(!k.title){console.error("Invalid reminder data:",k);return}let Z={...k,id:Date.now(),createdAt:new Date().toISOString()};l(A=>[...A,Z]),a?.(k)},m=(k,Z)=>{if(!k){console.error("No reminder ID provided for update");return}l(A=>A.map(O=>O?.id.toString()===k?{...O,...Z}:O)),o?.(k,Z)},D=k=>{if(!k){console.error("No reminder ID provided for deletion");return}l(Z=>Z.filter(A=>A?.id.toString()!==k)),r?.(k)},S=i.filter(k=>{if(!k)return!1;if(p){let Z=p.toLowerCase();if(!(k.title.toLowerCase().includes(Z)||k.description?.toLowerCase().includes(Z)))return!1}switch(n){case"pending":case"completed":case"overdue":return Ds(new Date(k.dueDate||""),k.dueTime||"");case"today":return ks(new Date(k.dueDate||""));default:return!0}}).sort((k,Z)=>{if(!k||!Z)return 0;let A={high:3,medium:2,low:1},O=0;return O!==0?O:new Date(k.dueDate||"").getTime()-new Date(Z.dueDate||"").getTime()}),M={total:i.filter(Boolean).length,overdue:i.filter(k=>k&&Ds(new Date(k.dueDate||""),k.dueTime||"")).length,today:i.filter(k=>k&&ks(new Date(k.dueDate||""))).length},ee=s.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsx)(ze,{title:"Task Reminders",description:"Manage reminders and stay Js top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,Js.jsxs)("div",{className:"h-full bg-background",children:[(0,Js.jsx)(bm,{colleagues:s,onAddReminder:b,open:u,setOpen:h}),(0,Js.jsxs)("div",{className:"p-6",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Js.jsxs)("div",{children:[(0,Js.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Js.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Js.jsxs)(w,{className:"flex items-center space-x-2",onClick:()=>h(!0),children:[(0,Js.jsx)(gn.Plus,{className:"h-4 w-4"}),(0,Js.jsx)("span",{children:"Add Reminder"})]})]}),(0,Js.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Js.jsxs)(U,{className:"p-4",children:[(0,Js.jsx)("div",{className:"text-2xl font-bold text-foreground",children:M.total}),(0,Js.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Js.jsxs)(U,{className:"p-4",children:[(0,Js.jsx)("div",{className:"text-2xl font-bold text-primary",children:M.overdue}),(0,Js.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Js.jsxs)(U,{className:"p-4",children:[(0,Js.jsx)("div",{className:"text-2xl font-bold text-success",children:M.today}),(0,Js.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Js.jsxs)(U,{className:"p-4",children:[(0,Js.jsx)("div",{className:"text-2xl font-bold text-destructive",children:M.overdue}),(0,Js.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Js.jsxs)(U,{className:"p-4",children:[(0,Js.jsx)("div",{className:"text-2xl font-bold text-warning",children:M.today}),(0,Js.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Js.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Js.jsx)("div",{className:"flex-1",children:(0,Js.jsx)($,{placeholder:"Search reminders...",value:p,onChange:k=>x(k.target.value),className:"max-w-md"})}),(0,Js.jsxs)(ot,{value:n,onValueChange:k=>d(k),children:[(0,Js.jsx)(et,{className:"w-40",children:(0,Js.jsx)(Rt,{})}),(0,Js.jsxs)(tt,{children:[(0,Js.jsxs)(ye,{value:"all",children:["All (",M.total,")"]}),(0,Js.jsxs)(ye,{value:"overdue",children:["Overdue (",M.overdue,")"]}),(0,Js.jsxs)(ye,{value:"overdue",children:["Overdue (",M.overdue,")"]}),(0,Js.jsxs)(ye,{value:"today",children:["Today (",M.today,")"]})]})]})]}),(0,Js.jsx)("div",{className:"space-y-4",children:S.length===0?(0,Js.jsxs)(U,{className:"p-8 text-center",children:[(0,Js.jsx)("div",{className:"text-muted-foreground",children:p||n!=="all"?"No reminders match your filters":"No reminders yet"}),!p&&n==="all"&&(0,Js.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):S.map(k=>k&&(0,Js.jsx)(xm,{reminder:k,colleagues:s,onUpdateReminder:m,onDeleteReminder:D},k.id))})]})]})]})};var sd=require("next/navigation");function Ts({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:l=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:d,onUpdateTask:p,onDeleteTask:x,onTaskClick:u,onAddEpic:h,onUpdateEpic:b,onDeleteEpic:m,onAddTaskToEpic:D,onAddSprint:R,onUpdateSprint:S,onDeleteSprint:M,onAddProject:ee,onUpdateProject:k,onDeleteProject:Z,onFileAdd:A,onFileEdit:O,onFileDelete:j,onFileClick:W,onAddReminder:N,onUpdateReminder:je,onDeleteReminder:C,onViewChange:Ne,onToggleMobileMenu:ce,onTeamClick:Dt,onTeamChange:lt,onCopilotClick:Ot,handleAddComment:zt}){let[E,De]=(0,xr.useState)(t),[Ge,Ut]=(0,xr.useState)(a),[Me,jt]=(0,xr.useState)(o),[H,Je]=(0,xr.useState)(r),[Fe,ca]=(0,xr.useState)(i),[xa,Ia]=(0,xr.useState)(l),[Ma,po]=(0,xr.useState)(s),[uo,F]=(0,xr.useState)(c),[y,T]=(0,xr.useState)(!1),[ae,ke]=(0,xr.useState)(!1),[at,Ze]=(0,xr.useState)(null),[Mt,Ho]=(0,xr.useState)(null),[zo,Uo]=(0,xr.useState)(null),[$a,Ms]=(0,xr.useState)(n||"kanban"),[wm,md]=(0,xr.useState)(!1),pd=(0,sd.useRouter)();(0,xr.useEffect)(()=>{De(t)},[t]),(0,xr.useEffect)(()=>{jt(o)},[o]),(0,xr.useEffect)(()=>{Ut(a)},[a]),(0,xr.useEffect)(()=>{Je(r)},[r]),(0,xr.useEffect)(()=>{F(c)},[c]),(0,xr.useEffect)(()=>{po(s)},[s]),(0,xr.useEffect)(()=>{Ia(l)},[l]),(0,xr.useEffect)(()=>{ca(i)},[i]),(0,xr.useEffect)(()=>{Ms(n)},[n]);let ud=E.filter(P=>{}),Nm=P=>ud.filter(X=>X.status===P),Cm=P=>{let X={};return Ge.forEach(me=>{}),X},Sm=P=>{Uo(P)},Dm=P=>{zo&&(De(X=>X.map(me=>me.id===zo.id?{...me,status:P}:me)),Uo(null))},Es=P=>{let X={...P,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};De(me=>[...me,X]),d?.(X)},br=async(P,X)=>(De(me=>me.map(bt=>bt.id===Number(P)?{...bt,...X}:bt)),await p?.(P,X)),km=async(P,X)=>{br(P,X)},Bs=P=>{De(X=>X.filter(me=>me.id!==Number(P))),at?.id===Number(P)&&Ze(null),x?.(P)},Tm=async P=>{Bs(P)},Pm=P=>{let X={...P,id:Date.now()};Je(me=>[...me,X]),ee?.(P)},Rm=(P,X)=>{Je(me=>me.map(bt=>bt.id===Number(P)?{...bt,...X}:bt)),k?.(P,X)},Am=P=>{Je(X=>X.filter(me=>me.id!==Number(P))),Z?.(P)},Fs=P=>{let X={...P,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Ut(me=>[...me,X]),h?.({...X})},gd=()=>{ke(!0)},fd=(P,X)=>{Ut(me=>me.map(bt=>bt.id===Number(P)?{...bt,...X}:bt)),b?.(P,X)},vd=P=>{Ut(X=>X.filter(me=>me.id!==Number(P))),De(X=>X.filter(me=>nt(me.epic)!==Number(P))),m?.(P)},bd=P=>{let X={...P,id:Date.now()};jt(me=>[...me,X]),R?.(P)},hd=(P,X)=>{jt(me=>me.map(bt=>bt.id===Number(P)?{...bt,...X}:bt)),S?.(P,X)},xd=P=>{P==="backlog"||P==="all-tasks"||(jt(X=>X.filter(me=>me.id!==Number(P))),De(X=>X.map(me=>nt(me.sprint)===Number(P)?{...me,sprint:void 0}:me)),M?.(P))},vi=P=>{Ze(P)},yd=P=>{P==="planning"&&window.innerWidth<768||(Ms(P),Ne?.(P))},Im=()=>{md(P=>!P),ce?.()},Mm=()=>{pd.push("/")},Em=P=>{console.log("Switching to team:",P)},Bm=P=>{console.log("Switching to team:",P)},wd=P=>{T(!0)},Nd=()=>{T(!1),Ho(null)},Cd=P=>{let X={...P,id:Date.now(),createdAt:new Date().toISOString()};ca(me=>[...me,X]),N?.(P)},Sd=(P,X)=>{ca(me=>me.map(bt=>bt.id===Number(P)?{...bt,...X}:bt)),je?.(P,X)},Dd=P=>{ca(X=>X.filter(me=>me.id!==Number(P))),C?.(P)},kd=()=>{A?.()},Td=P=>{O?.(P)},Pd=P=>{F(X=>X.filter(me=>me.name!==P)),j?.(P)},Rd=P=>{W?.(P)},Fm=[{id:"todo",title:"xr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Lm=()=>{switch($a){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"}},bi=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],Om=bi.sort((P,X)=>X.lastUsed.getTime()-P.lastUsed.getTime()).slice(0,3),jm=bi.length>3,Hm=bi.slice(3);return(0,Js.jsxs)(Jr,{currentView:$a,onViewChange:yd,children:[$a==="kanban"&&(0,Js.jsx)("div",{className:"h-full overflow-hidden",children:(0,Js.jsx)(Ql,{initialProjects:H,initialEpics:Ge,initialSprints:Me.map(P=>({...P,isSelected:!1})),initialTasks:E,initialColleagues:xa,initialUsers:Ma,onAddTask:Es,onUpdateTask:br,onDeleteTask:Bs,onTaskClick:vi,onAddEpic:Fs,onAddComment:zt})}),$a==="planning"&&(0,Js.jsx)("div",{className:"hidden md:block h-full",children:(0,Js.jsx)(ui,{tasks:E,epics:Ge,sprints:Me,onUpdateTask:br,onTaskClick:vi,onAddSprint:bd,onUpdateSprint:hd,onDeleteSprint:xd})}),$a==="tasks"&&(0,Js.jsx)("div",{className:"h-full",children:(0,Js.jsx)(id,{initialReminders:Fe,initialColleagues:xa,onAddReminder:Cd,onUpdateReminder:Sd,onDeleteReminder:Dd})}),$a==="files"&&(0,Js.jsx)("div",{className:"h-full",children:(0,Js.jsx)(gr,{initialFiles:uo,onFileAdd:kd,onFileEdit:Td,onFileDelete:Pd,onFileClick:Rd,compactView:!1})}),$a==="epics"&&(0,Js.jsx)("div",{className:"h-full",children:(0,Js.jsx)(Zl,{tasks:E,epics:Ge,sprints:Me,onUpdateTask:br,onTaskClick:vi,onAddTaskToEpic:wd,onAddEpic:gd,onUpdateEpic:fd,onDeleteEpic:vd})}),(0,Js.jsx)(Fo,{isOpen:y,onClose:Nd,onAddTask:Es,epics:Ge,sprints:Me,assignees:[...xa,...Ma],defaultEpicId:Mt||void 0}),(0,Js.jsx)(Oo,{isOpen:ae,onClose:()=>ke(!1),onAddEpic:Fs})]})}var nd=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[i,l]=(0,xr.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,c]=(0,xr.useState)({}),n=()=>{let x={};return i.name.trim()?i.name.trim().length<3&&(x.name="Project name must be at least 3 characters"):x.name="Project name is required",i.objectives.trim()?i.objectives.trim().length<10&&(x.objectives="Please provide more detailed objectives (at least 10 characters)"):x.objectives="Project objectives are required",i.workInstructions.trim()?i.workInstructions.trim().length<20&&(x.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):x.workInstructions="Work instructions are required",c(x),Object.keys(x).length===0},d=async x=>{if(x.preventDefault(),!!n())try{await e(i)}catch(u){console.error("Error submitting project form:",u)}},p=(x,u)=>{l(h=>({...h,[x]:u})),s[x]&&c(h=>({...h,[x]:void 0}))};return(0,Js.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,Js.jsxs)("div",{className:"mb-4",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Js.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,Js.jsxs)("form",{onSubmit:d,children:[(0,Js.jsxs)("div",{className:"space-y-6",children:[(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Js.jsx)($,{id:"name",type:"text",placeholder:"Enter project name",value:i.name,onChange:x=>p("name",x.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,Js.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Js.jsx)($,{id:"description",type:"text",placeholder:"Enter project description",value:i.description,onChange:x=>p("description",x.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,Js.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Js.jsx)(Ie,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:i.objectives,onChange:x=>p("objectives",x.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Js.jsxs)("div",{className:"flex justify-between text-xr text-gray-500",children:[(0,Js.jsx)("span",{children:s.objectives&&(0,Js.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Js.jsxs)("span",{children:[i.objectives.length,"/1000"]})]})]}),(0,Js.jsxs)("div",{className:"space-y-2",children:[(0,Js.jsx)(I,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Js.jsx)(Ie,{id:"workInstructions",placeholder:"Provide detailed instructions Js how the work should be carried out, including processes, standards, and expectations...",value:i.workInstructions,onChange:x=>p("workInstructions",x.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Js.jsxs)("div",{className:"flex justify-between text-xr text-gray-500",children:[(0,Js.jsx)("span",{children:s.workInstructions&&(0,Js.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Js.jsxs)("span",{children:[i.workInstructions.length,"/2000"]})]})]}),(0,Js.jsxs)("div",{className:"space-y-3",children:[(0,Js.jsx)(I,{className:"text-sm font-medium",children:"Project Management"}),(0,Js.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Js.jsx)(Qo,{id:"plan",checked:i.plan,onCheckedChange:x=>p("plan",x===!0),disabled:a}),(0,Js.jsx)(I,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Js.jsx)("p",{className:"text-xr text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,Js.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Js.jsxs)(w,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Js.jsx)(w,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsx)(gn.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsx)(gn.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function As({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,i]=(0,xr.useState)(!1),[l,s]=(0,xr.useState)(!1),c=async d=>{s(!0);try{await t(d),i(!1)}catch(p){console.error("Error creating project:",p)}finally{s(!1)}},n=()=>{i(!0)};return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Js.jsx)(ze,{title:"Project Management",description:"Organize your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,Js.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Js.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Js.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Js.jsx)(ei,{project:d,onOpen:a,onShare:o},d.id))})]})]},"projects-index-view")}),(0,Js.jsx)(wt,{open:r,onOpenChange:i,children:(0,Js.jsxs)(dt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Js.jsxs)(ct,{className:"ja-only",children:[(0,Js.jsx)(mt,{children:"Create New Project"}),(0,Js.jsx)(Xo,{children:"Fill out the form below to create a new project."})]}),(0,Js.jsx)(nd,{onSubmit:c,onCancel:()=>i(!1),isLoading:l,className:"border-0 shadow-none"})]})})]})}function dd({team:e,onOpen:t,className:a}){return(0,Js.jsx)(ja.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Js.jsxs)(U,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Js.jsxs)(Le,{children:[(0,Js.jsx)(We,{className:"text-lg",children:e.name}),(0,Js.jsx)(eo,{className:"mt-1 text-sm",children:e.description})]}),(0,Js.jsxs)(fe,{className:"space-y-4",children:[(0,Js.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.Users,{className:"h-4 w-4 text-blue-500"}),(0,Js.jsx)("span",{children:"Human"})]}),(0,Js.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Js.jsx)("span",{children:"Digital"})]}),(0,Js.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Js.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,Js.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Js.jsx)(gn.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Js.jsx)("span",{children:"Projects"})]}),(0,Js.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Js.jsx)(to,{className:"flex gap-2",children:(0,Js.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Is({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,xr.useState)(!1),i=()=>{r(!0)},l=n=>{t?.(n),r(!1)},s=()=>{r(!1)},c=n=>{a?.(n)};return(0,Js.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Js.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Js.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Js.jsx)(ze,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:i}}),(0,Js.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Js.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Js.jsxs)("div",{className:"text-center py-12",children:[(0,Js.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'Js not part of any teams yet."}),(0,Js.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team Js ask to be added to an existing one."})]}):(0,Js.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,Js.jsx)(dd,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,Js.jsx)(wt,{open:o,onOpenChange:r,children:(0,Js.jsxs)(dt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto p-0",children:[(0,Js.jsx)("div",{className:"ja-only",children:(0,Js.jsxs)(ct,{children:[(0,Js.jsx)(mt,{children:"Create New Team"}),(0,Js.jsx)(Xo,{children:"Set up a new team to collaborate with colleagues Js projects."})]})}),(0,Js.jsx)(Qr,{title:"Create New Team",submitLabel:"Create Team",onSave:l,onCancel:s})]})})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleageusLayout,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});
|
|
5
|
+
"use strict";var Ad=Object.create;var yr=Object.defineProperty;var Id=Object.getOwnPropertyDescriptor;var Md=Object.getOwnPropertyNames;var Ed=Object.getPrototypeOf,Bd=Object.prototype.hasOwnProperty;var Fd=(e,t)=>{for(var a in t)yr(e,a,{get:t[a],enumerable:!0})},zs=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Md(t))!Bd.call(e,r)&&r!==a&&yr(e,r,{get:()=>t[r],enumerable:!(o=Id(t,r))||o.enumerable});return e};var ie=(e,t,a)=>(a=e!=null?Ad(Ed(e)):{},zs(t||!e||!e.__esModule?yr(a,"default",{value:e,enumerable:!0}):a,e)),Ld=e=>zs(yr({},"__esModule",{value:!0}),e);var ym={};Fd(ym,{AppSidebarLeft:()=>Tr,ColleagueCard:()=>bl,ColleagueForm:()=>yl,ColleagueTypeSelection:()=>Yr,ColleaguesView:()=>ys,DashboardHeader:()=>xn,DashboardPage:()=>xs,DigitalColleageusLayout:()=>Vr,DigitalColleagueClone:()=>wl,DigitalColleagueOptions:()=>Qr,DocumentEdit:()=>oi,DocumentPreview:()=>ri,FileView:()=>vr,KnowledgeBrowser:()=>ii,KnowledgeSearch:()=>sr,KnowledgeView:()=>ur,MainPage:()=>ns,ManagementSidebar:()=>Xr,PlanningView:()=>fi,ProjectView:()=>Is,ProjectsIndexView:()=>Bs,SearchableSelect:()=>fl,TeamForm:()=>ei,TeamsIndexView:()=>Fs});module.exports=Ld(ym);var hn=require("lucide-react");var go=ie(require("@radix-ui/react-collapsible")),yi=go.Root,Us=go.CollapsibleTrigger,Vs=go.CollapsibleContent;var ji=ie(require("clsx"));var Ys=require("clsx");var Ci="-",Od=e=>{let t=Hd(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{let s=d.split(Ci);return s[0]===""&&s.length!==1&&s.shift(),Gs(s,t)||jd(d)},getConflictingClassGroupIds:(d,s)=>{let c=a[d]||[];return s&&o[d]?[...c,...o[d]]:c}}},Gs=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Gs(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(Ci);return t.validators.find(({validator:d})=>d(i))?.classGroupId},Ks=/^\[(.+)\]$/,jd=e=>{if(Ks.test(e)){let t=Ks.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Hd=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Ud(Object.entries(e.classGroups),a).forEach(([i,d])=>{Ni(d,o,i,t)}),o},Ni=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:$s(t,r);i.classGroupId=a;return}if(typeof r=="function"){if(zd(r)){Ni(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([i,d])=>{Ni(d,$s(t,i),a,o)})})},$s=(e,t)=>{let a=e;return t.split(Ci).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},zd=e=>e.isThemeGetter,Ud=(e,t)=>t?e.map(([a,o])=>{let r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([d,s])=>[t+d,s])):i);return[a,r]}):e,Vd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(i,d)=>{a.set(i,d),t++,t>e&&(t=0,o=a,a=new Map)};return{get(i){let d=a.get(i);if(d!==void 0)return d;if((d=o.get(i))!==void 0)return r(i,d),d},set(i,d){a.has(i)?a.set(i,d):r(i,d)}}},_s="!",Kd=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],i=t.length,d=s=>{let c=[],n=0,l=0,m;for(let p=0;p<s.length;p++){let I=s[p];if(n===0){if(I===r&&(o||s.slice(p,p+i)===t)){c.push(s.slice(l,p)),l=p+i;continue}if(I==="/"){m=p;continue}}I==="["?n++:I==="]"&&n--}let b=c.length===0?s:s.substring(l),f=b.startsWith(_s),h=f?b.substring(1):b,N=m&&m>l?m-l:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:N}};return a?s=>a({className:s,parseClassName:d}):d},$d=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},Gd=e=>({cache:Vd(e.cacheSize),parseClassName:Kd(e),...Od(e)}),_d=/\s+/,Wd=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],d=e.trim().split(_d),s="";for(let c=d.length-1;c>=0;c-=1){let n=d[c],{modifiers:l,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:f}=a(n),h=!!f,N=o(h?b.substring(0,f):b);if(!N){if(!h){s=n+(s.length>0?" "+s:s);continue}if(N=o(b),!N){s=n+(s.length>0?" "+s:s);continue}h=!1}let p=$d(l).join(":"),I=m?p+_s:p,F=I+N;if(i.includes(F))continue;i.push(F);let k=r(N,h);for(let E=0;E<k.length;++E){let te=k[E];i.push(I+te)}s=n+(s.length>0?" "+s:s)}return s};function Jd(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ws(t))&&(o&&(o+=" "),o+=a);return o}var Ws=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ws(e[o]))&&(a&&(a+=" "),a+=t);return a};function qd(e,...t){let a,o,r,i=d;function d(c){let n=t.reduce((l,m)=>m(l),e());return a=Gd(n),o=a.cache.get,r=a.cache.set,i=s,s(c)}function s(c){let n=o(c);if(n)return n;let l=Wd(c,a);return r(c,l),l}return function(){return i(Jd.apply(null,arguments))}}var Ge=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Js=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xd=/^\d+\/\d+$/,Yd=new Set(["px","full","screen"]),Qd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|Qs)$/,Zd=/\d+(%|px|r?em|[sdl]?Qs([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ec=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)Qs-?((\d+)?\.?(\d+)[a-z]+|0)/,ac=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wa=e=>fo(e)||Yd.has(e)||Xd.test(e),Ea=e=>vo(e,"length",cc),fo=e=>!!e&&!Number.isNaN(Number(e)),wi=e=>vo(e,"number",fo),$o=e=>!!e&&Number.isInteger(Number(e)),oc=e=>e.endsWith("%")&&fo(e.slice(0,-1)),ue=e=>Js.test(e),Ba=e=>Qd.test(e),rc=new Set(["length","size","percentage"]),ic=e=>vo(e,rc,qs),sc=e=>vo(e,"position",qs),nc=new Set(["image","url"]),lc=e=>vo(e,nc,pc),dc=e=>vo(e,"",mc),Go=()=>!0,vo=(e,t,a)=>{let o=Js.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},cc=e=>Zd.test(e)&&!ec.test(e),qs=()=>!1,mc=e=>tc.test(e),pc=e=>ac.test(e);var uc=()=>{let e=Ge("colors"),t=Ge("spacing"),a=Ge("blur"),o=Ge("brightness"),r=Ge("borderColor"),i=Ge("borderRadius"),d=Ge("borderSpacing"),s=Ge("borderWidth"),c=Ge("contrast"),n=Ge("grayscale"),l=Ge("hueRotate"),m=Ge("invert"),b=Ge("gap"),f=Ge("gradientColorStops"),h=Ge("gradientColorStopPositions"),N=Ge("inset"),p=Ge("margin"),I=Ge("opacity"),F=Ge("padding"),k=Ge("saturate"),E=Ge("scale"),te=Ge("sepia"),x=Ge("skew"),P=Ge("space"),C=Ge("translate"),A=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",ue,t],S=()=>[ue,t],je=()=>["",wa,Ea],D=()=>["auto",fo,ue],Ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ce=()=>["solid","dashed","dotted","double","none"],kt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],dt=()=>["start","end","center","between","around","evenly","stretch"],Ht=()=>["","0",ue],Vt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[fo,ue];return{cacheSize:500,separator:":",theme:{colors:[Go],spacing:[wa,Ea],blur:["none","",Ba,ue],brightness:B(),borderColor:[e],borderRadius:["none","","full",Ba,ue],borderSpacing:S(),borderWidth:je(),contrast:B(),grayscale:Ht(),hueRotate:B(),invert:Ht(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[oc,Ea],inset:q(),margin:q(),opacity:B(),padding:S(),saturate:B(),scale:B(),sepia:Ht(),skew:B(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",ue]}],container:["container"],columns:[{columns:[Ba]}],"break-after":[{"break-after":Vt()}],"break-before":[{"break-before":Vt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ne(),ue]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[N]}],"inset-x":[{"inset-x":[N]}],"inset-y":[{"inset-y":[N]}],start:[{start:[N]}],end:[{end:[N]}],top:[{top:[N]}],right:[{right:[N]}],bottom:[{bottom:[N]}],left:[{left:[N]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",$o,ue]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ue]}],grow:[{grow:Ht()}],shrink:[{shrink:Ht()}],order:[{order:["first","last","none",$o,ue]}],"grid-cols":[{"grid-cols":[Go]}],"col-start-end":[{col:["auto",{span:["full",$o,ue]},ue]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Go]}],"row-start-end":[{row:["auto",{span:[$o,ue]},ue]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","wr",ue]}],"auto-rows":[{"auto-rows":["auto","min","max","wr",ue]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...dt()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...dt(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...dt(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],Qs:[{Qs:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],Qs:[{Qs:[F]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],Qs:[{Qs:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],gn:[{gn:[p]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ue,t]}],"min-w":[{"min-w":[ue,t,"min","max","fit"]}],"max-w":[{"max-w":[ue,t,"none","full","min","max","fit","prose",{screen:[Ba]},Ba]}],h:[{h:[ue,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ue,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ue,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ue,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ba,Ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wi]}],"font-family":[{font:[Go]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ue]}],"line-clamp":[{"line-clamp":["none",fo,wi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",wa,ue]}],"list-image":[{"list-image":["none",ue]}],"list-style-type":[{list:["none","disc","decimal",ue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[I]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",wa,Ea]}],"underline-offset":[{"underline-offset":["auto",wa,ue]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[I]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ne(),sc]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ic]}],"bg-image":[{bg:["none",{"gradient-to":["t","ja","r","br","b","bl","l","Qs"]},lc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Qs":[{"rounded-Qs":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-Qs":[{"rounded-Qs":[i]}],"rounded-ja":[{"rounded-ja":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[I]}],"border-style":[{border:[...ce(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[I]}],"divide-style":[{divide:ce()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...ce()]}],"outline-offset":[{"outline-offset":[wa,ue]}],"outline-w":[{outline:[wa,Ea]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[I]}],"ring-offset-w":[{"ring-offset":[wa,Ea]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ba,dc]}],"shadow-color":[{shadow:[Go]}],opacity:[{opacity:[I]}],"mix-blend":[{"mix-blend":[...kt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":kt()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ba,ue]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[m]}],saturate:[{saturate:[k]}],sepia:[{sepia:[te]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[I]}],"backdrop-saturate":[{"backdrop-saturate":[k]}],"backdrop-sepia":[{"backdrop-sepia":[te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ue]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ue]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[$o,ue]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ue]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Qs-resize","nw-resize","Qs-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ue]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-Qs":[{"scroll-Qs":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-gn":[{"scroll-gn":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-Qs":[{"scroll-Qs":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-Qs":[{"scroll-Qs":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ue]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[wa,Ea,wi]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","Qs","pt","pr","pb","Qs"],px:["pr","Qs"],py:["pt","pb"],m:["mx","my","Qs","me","mt","mr","mb","gn"],mx:["mr","gn"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-Qs","rounded-ee","rounded-es","rounded-Qs","rounded-ja","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Qs","rounded-ee"],"rounded-t":["rounded-Qs","rounded-ja"],"rounded-r":["rounded-ja","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-Qs","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-Qs","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-gn"],"scroll-mx":["scroll-mr","scroll-gn"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-Qs","scroll-pt","scroll-pr","scroll-pb","scroll-Qs"],"scroll-px":["scroll-pr","scroll-Qs"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Xs=qd(uc);function g(...e){return Xs((0,Ys.clsx)(e))}var Qs=require("react/jsx-runtime");function Rt({className:e,...t}){return(0,Qs.jsx)("div",{className:g("animate-pulse rounded-md bg-primary/10",e),...t})}var be=ie(require("react")),yo=require("@radix-ui/react-slot"),gn=require("class-variance-authority");var wr=require("react"),Zs=(e=768)=>{let[t,a]=(0,wr.useState)(!1);return(0,wr.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var an=ie(require("react")),Nr=(0,gn.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),w=an.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},i)=>(0,Qs.jsx)(e?yo.Slot:"button",{className:g(Nr({className:t,size:a,variant:o})),ref:i,...r}));w.displayName="Button";var rn=ie(require("react"));var W=rn.forwardRef(({className:e,type:t,...a},o)=>(0,Qs.jsx)("input",{type:t,className:g("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));W.displayName="Input";var nn=ie(require("react")),Si=ie(require("@radix-ui/react-separator"));var _o=nn.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},r)=>(0,Qs.jsx)(Si.Root,{ref:r,decorative:a,orientation:t,className:g("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));_o.displayName=Si.Root.displayName;var Wo=ie(require("react")),xt=ie(require("@radix-ui/react-dialog")),dn=require("@radix-ui/react-icons");var mn=xt.Root;var gc=xt.Portal,pn=Wo.forwardRef(({className:e,...t},a)=>(0,$t.jsx)(xt.Overlay,{className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));pn.displayName=xt.Overlay.displayName;var fc=(0,gn.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Di=Wo.forwardRef(({side:e="right",className:t,children:a,...o},r)=>(0,$t.jsxs)(gc,{children:[(0,$t.jsx)(pn,{}),(0,$t.jsxs)(xt.Content,{ref:r,className:g(fc({side:e}),t),...o,children:[(0,$t.jsxs)(xt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,$t.jsx)(dn.Cross2Icon,{className:"h-4 w-4"}),(0,$t.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));Di.displayName=xt.Content.displayName;var vc=({className:e,...t})=>(0,$t.jsx)("div",{className:g("flex flex-col space-y-2 text-center sm:text-left",e),...t});vc.displayName="SheetHeader";var bc=({className:e,...t})=>(0,$t.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});bc.displayName="SheetFooter";var hc=Wo.forwardRef(({className:e,...t},a)=>(0,$t.jsx)(xt.Title,{ref:a,className:g("text-lg font-semibold text-foreground",e),...t}));hc.displayName=xt.Title.displayName;var xc=Wo.forwardRef(({className:e,...t},a)=>(0,$t.jsx)(xt.Description,{ref:a,className:g("text-sm text-muted-foreground",e),...t}));xc.displayName=xt.Description.displayName;var un=ie(require("react")),na=ie(require("@radix-ui/react-tooltip"));var bo=na.Provider,ho=na.Root,xo=na.Trigger,_a=un.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Qs.jsx)(na.Portal,{children:(0,Qs.jsx)(na.Content,{ref:o,sideOffset:t,className:g("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));_a.displayName=na.Content.displayName;var yc="sidebar:state",wc=60*60*24*7,Nc="16rem",Cc="18rem",Sc="3rem",Dc="b",vn=be.createContext(null);function Cr(){let e=be.useContext(vn);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var Ti=be.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:r,children:i,...d},s)=>{let c=Zs(),[n,l]=be.useState(!1),[m,b]=be.useState(e),f=t??m,h=be.useCallback(F=>{if(a)return a?.(typeof F=="function"?F(f):F);b(F),document.cookie=`${yc}=${f}; path=/; max-age=${wc}`},[a,f]),N=be.useCallback(()=>c?l(F=>!F):h(F=>!F),[c,h,l]);be.useEffect(()=>{let F=k=>{k.key===Dc&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),N())};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[N]);let p=f?"expanded":"collapsed",I=be.useMemo(()=>({state:p,open:f,setOpen:h,isMobile:c,openMobile:n,setOpenMobile:l,toggleSidebar:N}),[p,f,h,c,n,l,N]);return(0,Qs.jsx)(vn.Provider,{value:I,children:(0,Qs.jsx)(bo,{delayDuration:0,children:(0,Qs.jsx)("div",{style:{"--sidebar-width":Nc,"--sidebar-width-icon":Sc,...r},className:g("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...d,children:i})})})});Ti.displayName="SidebarProvider";var Pi=be.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:r,...i},d)=>{let{isMobile:s,state:c,openMobile:n,setOpenMobile:l}=Cr();return a==="none"?(0,Qs.jsx)("div",{className:g("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:d,...i,children:r}):s?(0,Qs.jsx)(mn,{open:n,onOpenChange:l,...i,children:(0,Qs.jsx)(Di,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Cc},side:e,children:(0,Qs.jsx)("div",{className:"flex h-full w-full flex-col",children:r})})}):(0,Qs.jsxs)("div",{ref:d,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,Qs.jsx)("div",{className:g("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)Qs+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,Qs.jsx)("div",{className:g("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)Qs+_theme(spacing.4)Qs+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...i,children:(0,Qs.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r})})]})});Pi.displayName="Sidebar";var Ri=be.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:r}=Cr();return(0,Qs.jsxs)(w,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:g("h-7 w-7",e),onClick:i=>{t?.(i),r()},...a,children:[(0,Qs.jsx)(hn.PanelLeft,{}),(0,Qs.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Ri.displayName="SidebarTrigger";var kc=be.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=Cr();return(0,Qs.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:g("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]Qs&]:cursor-w-resize [[data-side=right]Qs&]:cursor-e-resize","[[data-side=left][data-state=collapsed]Qs&]:cursor-e-resize [[data-side=right][data-state=collapsed]Qs&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]Qs&]:-right-2","[[data-side=right][data-collapsible=offcanvas]Qs&]:-left-2",e),...t})});kc.displayName="SidebarRail";var Ai=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("main",{ref:a,className:g("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:gn-2 md:peer-data-[variant=inset]:gn-0 md:peer-data-[variant=inset]:rounded-Qs md:peer-data-[variant=inset]:shadow",e),...t}));Ai.displayName="SidebarInset";var Tc=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(W,{ref:a,"data-sidebar":"input",className:g("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Tc.displayName="SidebarInput";var Ii=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,"data-sidebar":"header",className:g("flex flex-col gap-2 p-2",e),...t}));Ii.displayName="SidebarHeader";var Mi=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,"data-sidebar":"footer",className:g("flex flex-col gap-2 p-2",e),...t}));Mi.displayName="SidebarFooter";var Pc=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(_o,{ref:a,"data-sidebar":"separator",className:g("mx-2 w-auto bg-sidebar-border",e),...t}));Pc.displayName="SidebarSeparator";var Sr=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,"data-sidebar":"content",className:g("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Sr.displayName="SidebarContent";var Dr=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,"data-sidebar":"group",className:g("relative flex w-full min-w-0 flex-col p-2",e),...t}));Dr.displayName="SidebarGroup";var Rc=be.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Qs.jsx)(t?yo.Slot:"div",{ref:o,"data-sidebar":"group-label",className:g("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...a}));Rc.displayName="SidebarGroupLabel";var Ac=be.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Qs.jsx)(t?yo.Slot:"button",{ref:o,"data-sidebar":"group-action",className:g("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Ac.displayName="SidebarGroupAction";var Ei=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,"data-sidebar":"group-content",className:g("w-full text-sm",e),...t}));Ei.displayName="SidebarGroupContent";var Jo=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("ul",{ref:a,"data-sidebar":"menu",className:g("flex w-full min-w-0 flex-col gap-1",e),...t}));Jo.displayName="SidebarMenu";var qo=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("ja",{ref:a,"data-sidebar":"menu-item",className:g("group/menu-item relative",e),...t}));qo.displayName="SidebarMenuItem";var Ic=(0,gn.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),kr=be.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:r,className:i,...d},s)=>{let c=e?yo.Slot:"button",{isMobile:n,state:l}=Cr(),m=(0,Qs.jsx)(c,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:g(Ic({variant:a,size:o}),i),...d});return r?(typeof r=="string"&&(r={children:r}),(0,Qs.jsxs)(ho,{children:[(0,Qs.jsx)(xo,{asChild:!0,children:m}),(0,Qs.jsx)(_a,{side:"right",align:"center",hidden:l!=="collapsed"||n,...r})]})):m});kr.displayName="SidebarMenuButton";var Bi=be.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},r)=>(0,Qs.jsx)(t?yo.Slot:"button",{ref:r,"data-sidebar":"menu-action",className:g("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...o}));Bi.displayName="SidebarMenuAction";var Mc=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:g("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Mc.displayName="SidebarMenuBadge";var Ec=be.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let r=be.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,Qs.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:g("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,Qs.jsx)(Rt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,Qs.jsx)(Rt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":r}})]})});Ec.displayName="SidebarMenuSkeleton";var Fi=be.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:g("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Fi.displayName="SidebarMenuSub";var Li=be.forwardRef(({...e},t)=>(0,Qs.jsx)("ja",{ref:t,...e}));Li.displayName="SidebarMenuSubItem";var Oi=be.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...r},i)=>(0,Qs.jsx)(e?yo.Slot:"a",{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:g("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...r}));Oi.displayName="SidebarMenuSubButton";function Tr({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:r,pathName:i,menuHeading:d,onNavClick:s,loading:c=!1,LinkComponent:n,...l}){let b=n?f=>(0,Qs.jsx)(n,{...f}):s?({href:f,children:h,...N})=>(0,Qs.jsx)("button",{onClick:()=>s&&s(f),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...N,children:h}):f=>(0,Qs.jsx)("a",{...f});return(0,Qs.jsxs)(Pi,{...l,variant:"inset",children:[(0,Qs.jsx)(Ii,{children:(0,Qs.jsx)(Jo,{children:(0,Qs.jsx)(qo,{children:c?(0,Qs.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qs.jsx)(Rt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Qs.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Qs.jsx)("span",{className:"truncate font-semibold",children:o}),r&&(0,Qs.jsx)("span",{className:"truncate text-sm",children:r})]})})})}),c&&(0,Qs.jsxs)(Sr,{children:[(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Qs.jsx)(Rt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Qs.jsxs)(Sr,{children:[(0,Qs.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!c&&a.map((f,h)=>(0,Qs.jsx)(bn,{subNav:f,pathName:i,Link:b},h)),(0,Qs.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!c&&e.map((f,h)=>(0,Qs.jsx)(bn,{subNav:f,pathName:i,Link:b},h)),(0,Qs.jsx)(Dr,{className:"mt-auto",children:(0,Qs.jsx)(Ei,{children:(0,Qs.jsx)(Jo,{children:t&&!c&&t.map(f=>(0,Qs.jsx)(qo,{children:(0,Qs.jsx)(kr,{asChild:!0,size:"sm",children:(0,Qs.jsxs)(b,{href:f.url||"",children:[f.icon&&(0,Qs.jsx)(f.icon,{}),(0,Qs.jsx)("span",{children:f.label})]})})},f.label))})})})]}),(0,Qs.jsx)(Mi,{})]})}function bn({subNav:e,pathName:t,Link:a}){let o=e,r=!1;return o.links&&o.links.map(i=>{i.url===t&&(r=!0)}),(0,Qs.jsx)(yi,{defaultOpen:!0,className:"group/collapsible",children:(0,Qs.jsx)(Dr,{className:"py-0",children:(0,Qs.jsx)(Jo,{children:(0,Qs.jsx)(yi,{asChild:!0,defaultOpen:o.isActive,children:(0,Qs.jsxs)(qo,{children:[(0,Qs.jsx)(kr,{asChild:!0,tooltip:o.label,className:(0,ji.default)(r&&"font-bold text-accent"),children:(0,Qs.jsxs)(a,{href:o.url,children:[o.icon&&(0,Qs.jsx)(o.icon,{}),(0,Qs.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsx)(Us,{asChild:!0,children:(0,Qs.jsxs)(Bi,{className:"data-[state=open]:rotate-90",children:[(0,Qs.jsx)(hn.ChevronRight,{}),(0,Qs.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,Qs.jsx)(Vs,{children:(0,Qs.jsx)(Fi,{children:o.links?.map(i=>(0,Qs.jsx)(Li,{children:(0,Qs.jsx)(Oi,{asChild:!0,className:(0,ji.default)(i.url===t&&"font-bold text-accent"),children:(0,Qs.jsx)(a,{href:i.url,children:(0,Qs.jsx)("span",{children:i.label})})})},i.label))})})]}):null]})},o.label)})})})}var Pr=ie(require("react")),Na=ie(require("@radix-ui/react-avatar"));var Gt=Pr.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Na.Root,{ref:a,className:g("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Gt.displayName=Na.Root.displayName;var Wa=Pr.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Na.Image,{ref:a,className:g("aspect-square h-full w-full",e),...t}));Wa.displayName=Na.Image.displayName;var _t=Pr.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Na.Fallback,{ref:a,className:g("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));_t.displayName=Na.Fallback.displayName;var Ca=ie(require("react")),Ce=ie(require("@radix-ui/react-dropdown-menu"));var No=Ce.Root,Co=Ce.Trigger;var Bc=Ca.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,Qs.jsxs)(Ce.SubTrigger,{ref:r,className:g("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"Qs-8",e),...o,children:[a,(0,Qs.jsx)(dn.ChevronRightIcon,{className:"gn-auto"})]}));Bc.displayName=Ce.SubTrigger.displayName;var Fc=Ca.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Ce.SubContent,{ref:a,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Fc.displayName=Ce.SubContent.displayName;var Ja=Ca.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Qs.jsx)(Ce.Portal,{children:(0,Qs.jsx)(Ce.Content,{ref:o,sideOffset:t,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ja.displayName=Ce.Content.displayName;var ua=Ca.forwardRef(({className:e,inset:t,...a},o)=>(0,Qs.jsx)(Ce.Item,{ref:o,className:g("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"Qs-8",e),...a}));ua.displayName=Ce.Item.displayName;var Lc=Ca.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,Qs.jsxs)(Ce.CheckboxItem,{ref:r,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 Qs-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,Qs.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Qs.jsx)(Ce.ItemIndicator,{children:(0,Qs.jsx)(dn.CheckIcon,{className:"h-4 w-4"})})}),t]}));Lc.displayName=Ce.CheckboxItem.displayName;var Oc=Ca.forwardRef(({className:e,children:t,...a},o)=>(0,Qs.jsxs)(Ce.RadioItem,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 Qs-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,Qs.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Qs.jsx)(Ce.ItemIndicator,{children:(0,Qs.jsx)(dn.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Oc.displayName=Ce.RadioItem.displayName;var Hi=Ca.forwardRef(({className:e,inset:t,...a},o)=>(0,Qs.jsx)(Ce.Label,{ref:o,className:g("px-2 py-1.5 text-sm font-semibold",t&&"Qs-8",e),...a}));Hi.displayName=Ce.Label.displayName;var zi=Ca.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Ce.Separator,{ref:a,className:g("-mx-1 my-1 h-px bg-muted",e),...t}));zi.displayName=Ce.Separator.displayName;var jc=({className:e,...t})=>(0,Qs.jsx)("span",{className:g("gn-auto text-xs tracking-widest opacity-60",e),...t});jc.displayName="DropdownMenuShortcut";var xn=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Qs.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,Qs.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Qs.jsx)(w,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Qs.jsx)(hn.Menu,{className:"h-5 w-5"})}),(0,Qs.jsx)("h1",{className:"text-2xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Qs.jsxs)(w,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Qs.jsx)(hn.Bell,{className:"h-5 w-5"}),(0,Qs.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-xs text-white flex items-center justify-center",children:"3"})]}),(0,Qs.jsxs)(No,{children:[(0,Qs.jsx)(Co,{asChild:!0,children:(0,Qs.jsx)(w,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Qs.jsxs)(Gt,{className:"h-10 w-10",children:[(0,Qs.jsx)(Wa,{src:"/avatars/01.png",alt:"@user"}),(0,Qs.jsx)(_t,{children:"JD"})]})})}),(0,Qs.jsxs)(Ja,{className:"w-56",align:"end",forceMount:!0,children:[(0,Qs.jsx)(Hi,{className:"font-normal",children:(0,Qs.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Qs.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Qs.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Qs.jsx)(zi,{}),(0,Qs.jsxs)(ua,{children:[(0,Qs.jsx)(hn.User,{className:"mr-2 h-4 w-4"}),(0,Qs.jsx)("span",{children:"Profile"})]}),(0,Qs.jsxs)(ua,{children:[(0,Qs.jsx)(hn.Settings,{className:"mr-2 h-4 w-4"}),(0,Qs.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var jr=ie(require("react")),Ki=ie(require("next/link"));var Hc=(0,gn.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ee({className:e,variant:t,...a}){return(0,Qs.jsx)("div",{className:g(Hc({variant:t}),e),...a})}var Ui=ie(require("react")),Yt=ie(require("@radix-ui/react-scroll-area"));var ga=Ui.forwardRef(({className:e,children:t,...a},o)=>(0,Qs.jsxs)(Yt.Root,{ref:o,className:g("relative overflow-hidden",e),...a,children:[(0,Qs.jsx)(Yt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Qs.jsx)(Nn,{}),(0,Qs.jsx)(Yt.Corner,{})]}));ga.displayName=Yt.Root.displayName;var Nn=Ui.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Qs.jsx)(Yt.ScrollAreaScrollbar,{ref:o,orientation:t,className:g("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,Qs.jsx)(Yt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Nn.displayName=Yt.ScrollAreaScrollbar.displayName;var Xo=ie(require("react")),wt=ie(require("@radix-ui/react-dialog"));var Nt=wt.Root;var zc=wt.Portal;var Sn=Xo.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(wt.Overlay,{ref:a,className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Sn.displayName=wt.Overlay.displayName;var ct=Xo.forwardRef(({className:e,children:t,...a},o)=>(0,Qs.jsxs)(zc,{children:[(0,Qs.jsx)(Sn,{}),(0,Qs.jsxs)(wt.Content,{ref:o,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,Qs.jsxs)(wt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Qs.jsx)(hn.Qs,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));ct.displayName=wt.Content.displayName;var mt=({className:e,...t})=>(0,Qs.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});mt.displayName="DialogHeader";var Yo=({className:e,...t})=>(0,Qs.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yo.displayName="DialogFooter";var pt=Xo.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(wt.Title,{ref:a,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));pt.displayName=wt.Title.displayName;var Qo=Xo.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(wt.Description,{ref:a,className:g("text-sm text-muted-foreground",e),...t}));Qo.displayName=wt.Description.displayName;var Zo=ie(require("@radix-ui/react-checkbox")),kn=ie(require("react")),er=kn.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Zo.Root,{className:g("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,Qs.jsx)(Zo.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,Qs.jsx)(hn.Check,{className:"h-4 w-4"})})}));er.displayName=Zo.Root.displayName;var fa=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),Pn=[{id:"home",title:"Home",icon:(0,Qs.jsx)(hn.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Qs.jsx)(hn.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Qs.jsx)(hn.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Qs",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Qs.jsx)(hn.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Qs.jsx)(hn.FileText,{}),url:"/knowledge"}],Rn=[{id:"1",title:"New comment Qs your post",description:"Alex Morgan commented Qs your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"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")},{id:"4",title:"Update successful",description:"PixelMaster has been updated to 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")},{id:"5",title:"Storage limit reached",description:"You'Qs used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"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")},{id:"7",title:"New tutorial available",description:"A new tutorial Qs 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],An=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Qs.jsx)(hn.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Qs.jsx)(hn.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Qs.jsx)(hn.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Qs.jsx)(hn.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"wr",name:"Human Resources",description:"People operations and talent management",icon:(0,Qs.jsx)(hn.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Qs.jsx)(hn.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Qs.jsx)(hn.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Qs.jsx)(hn.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"Qs",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Qs.jsx)(hn.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Qs.jsx)(hn.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Er=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Vi=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Ir=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Fr=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Uc=[...Fr,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems Qs mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Vc=[...Er,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Mr={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},Tn={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Fr.filter(e=>e.epicId==="1")};var jp={empty:{initialProjects:Mr.projects,initialEpics:Mr.epics,initialSprints:Mr.sprints,initialTasks:Mr.tasks},default:{initialProjects:Er,initialEpics:Vi,initialSprints:Ir,initialTasks:Fr},highDensity:{initialProjects:Er,initialEpics:Vi,initialSprints:Ir,initialTasks:Uc},singleEpic:{initialProjects:Er,initialEpics:Tn.epics,initialSprints:Ir,initialTasks:Tn.tasks},multipleProjects:{initialProjects:Vc,initialEpics:Vi,initialSprints:Ir,initialTasks:Fr}},Br=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(fa),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(fa),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused Qs driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(fa),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(fa),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(fa),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(fa),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(fa),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(fa),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(fa),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(fa),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Hp=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:Br.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:Br.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:Br.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var zp=Br.filter(e=>e.type==="digital");function Or(e,t){let[a,o]=(0,wr.useState)(()=>{if(typeof window>"Qs")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{o(i),typeof window<"Qs"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,wr.useEffect)(()=>{r(a)},[]),[a,r]}function $i({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:r=An[0],onBusinessUnitChange:i,onSearch:d,className:s,logo:c="/headerlogo.png",appName:n="Nuvia",tagline:l="Collaboration Platform"}){let[m,b]=jr.useState({}),[f,h]=Or("sidebar-favorites",{}),[N,p]=jr.useState(null),[I,F]=jr.useState(""),k=D=>{b(Ne=>({...Ne,[D]:!Ne[D]}))},E=D=>{i?.(D)},te=()=>{I.trim()&&d?.(I.trim())},x=D=>{D.key==="Enter"&&(D.preventDefault(),te())},P=(D,Ne)=>{let ce=f[D]||[],kt=ce.includes(Ne)?ce.filter(dt=>dt!==Ne):ce.concat(Ne);h({...f,[D]:kt})},C=D=>{if(!D.items||!D.maxItems||D.items.length<=D.maxItems)return D.items||[];let Ne=f[D.id]||[],ce=D.items.filter(dt=>Ne.includes(dt.id)),kt=D.items.filter(dt=>!Ne.includes(dt.id));return[...ce,...kt].slice(0,D.maxItems)},A=D=>D.maxItems&&D.items&&D.items.length>D.maxItems,L=e,q=D=>{let Ne=A(D),ce=C(D),kt=(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[D.icon,(0,Qs.jsx)("span",{children:D.title})]}),D.badge&&(0,Qs.jsx)(ee,{variant:"outline",className:"gn-auto rounded-full px-2 py-0.5 text-xs",children:D.badge}),D.items&&(0,Qs.jsx)(hn.ChevronDown,{className:g("gn-2 h-4 w-4 transition-transform",m[D.title]?"rotate-180":"")})]}),dt=g("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",D.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return D.url?(0,Qs.jsx)(Ki.default,{href:D.url,className:dt,onClick:a?o:void 0,children:kt}):(0,Qs.jsx)("button",{className:dt,onClick:()=>D.items&&k(D.title),children:kt})},S=()=>{let D=e.find(ce=>ce.id===N);if(!D||!D.items||!D.maxItems)return null;let Ne=f[D.id]||[];return(0,Qs.jsx)(Nt,{open:!!N,onOpenChange:ce=>!ce&&p(null),children:(0,Qs.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qs.jsxs)(mt,{children:[(0,Qs.jsxs)(pt,{children:["Manage ",D.title," Favorites"]}),(0,Qs.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",D.maxItems," items to show in ",D.title.toLowerCase(),"."]})]}),(0,Qs.jsx)(ga,{className:"max-h-96 pr-4",children:(0,Qs.jsx)("div",{className:"space-y-4",children:D.items.map(ce=>(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)(er,{id:ce.id,checked:Ne.includes(ce.id),onCheckedChange:()=>P(D.id,ce.id),disabled:!Ne.includes(ce.id)&&Ne.length>=(D.maxItems||0)}),(0,Qs.jsxs)("label",{htmlFor:ce.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[ce.title,ce.badge&&(0,Qs.jsx)(ee,{variant:"outline",className:"text-xs",children:ce.badge})]})]},ce.id))})})]})})},je=(0,Qs.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qs.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Qs.jsx)("img",{src:c,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h2",{className:"font-semibold",children:n}),(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground",children:l})]})]}),a&&(0,Qs.jsx)(w,{variant:"ghost",size:"icon",onClick:o,children:(0,Qs.jsx)(hn.Qs,{className:"h-5 w-5"})})]}),(0,Qs.jsx)("div",{className:"px-3 py-2",children:(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)(hn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qs.jsx)(W,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted Qs-9 pr-4 py-2",value:I,onChange:D=>F(D.target.value),onKeyPress:x})]})}),(0,Qs.jsx)(ga,{className:"flex-1 px-3 py-2",children:(0,Qs.jsx)("div",{className:"space-y-1",children:L.map(D=>(0,Qs.jsxs)("div",{className:"mb-1",children:[q(D),D.items&&m[D.title]&&(0,Qs.jsxs)("div",{className:"mt-1 gn-6 space-y-1 border-l Qs-3",children:[C(D).map(Ne=>(0,Qs.jsxs)(Ki.default,{href:Ne.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[Ne.title,Ne.badge&&(0,Qs.jsx)(ee,{variant:"outline",className:"gn-auto rounded-full px-2 py-0.5 text-xs",children:Ne.badge})]},Ne.id)),A(D)&&D.items&&D.items.length>C(D).length&&(0,Qs.jsxs)("button",{onClick:()=>p(D.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",D.items.length-C(D).length," more available"]})]})]},D.id))})}),(0,Qs.jsx)("div",{className:"p-3",children:(0,Qs.jsx)("div",{className:"space-y-1",children:(0,Qs.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Qs.jsx)(hn.Settings,{className:"h-5 w-5"}),(0,Qs.jsx)("span",{children:"Settings"})]})})}),(0,Qs.jsx)(S,{})]});return a?(0,Qs.jsx)("div",{className:g("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:je}):(0,Qs.jsx)("div",{className:g("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:je})}var ja=require("motion/react");var In=require("next-themes");function Mn(){let{setTheme:e,theme:t}=(0,In.useTheme)();return(0,Qs.jsx)(bo,{children:(0,Qs.jsxs)(ho,{children:[(0,Qs.jsx)(xo,{asChild:!0,children:(0,Qs.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Qs.jsx)(hn.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Qs.jsx)(hn.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Qs.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Qs.jsx)(_a,{children:"Toggle theme"})]})})}function En({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:r,className:i}){let d=e.filter(n=>!n.read),s=d.length,c=n=>{switch(n){case"info":return(0,Qs.jsx)(hn.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Qs.jsx)(hn.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Qs.jsx)(hn.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Qs.jsx)(hn.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Qs.jsx)(ja.AnimatePresence,{children:t&&(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsx)(ja.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Qs.jsx)(ja.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:g("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",i),children:(0,Qs.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.Bell,{className:"h-5 w-5"}),(0,Qs.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Qs.jsxs)(ee,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Qs.jsxs)(w,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Qs.jsx)(hn.Qs,{className:"h-5 w-5"}),(0,Qs.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,Qs.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Qs.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Qs.jsx)(w,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),d.length>0?(0,Qs.jsx)(ga,{className:"flex-1",children:(0,Qs.jsx)("div",{className:"divide-y",children:d.map(n=>(0,Qs.jsxs)("div",{className:g("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Qs.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(n.type)}),(0,Qs.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)("p",{className:"font-medium",children:n.title}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground",children:n.time}),(0,Qs.jsx)(w,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(n.id),title:"Dismiss",children:(0,Qs.jsx)(hn.Check,{className:"h-3 w-3"})})]})]}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description}),n.actionLabel&&(0,Qs.jsxs)(w,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:n.onAction,children:[n.actionLabel,(0,Qs.jsx)(hn.ChevronRight,{className:"gn-1 h-3 w-3"})]})]})]},n.id))})}):(0,Qs.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Qs.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Qs.jsx)(hn.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Qs.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Qs.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var qa=ie(require("@radix-ui/react-tabs"));function Bn({className:e,...t}){return(0,Qs.jsx)(qa.Root,{"data-slot":"tabs",className:g("flex flex-col gap-2",e),...t})}function Fn({className:e,...t}){return(0,Qs.jsx)(qa.List,{"data-slot":"tabs-list",className:g("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Ln({className:e,...t}){return(0,Qs.jsx)(qa.Trigger,{"data-slot":"tabs-trigger",className:g("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function So({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:i=6}){let d=a.find(s=>s.value===e);return(0,Qs.jsxs)(ja.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Qs.jsx)("div",{className:"hidden lg:block",children:(0,Qs.jsx)(Bn,{value:e,onValueChange:t,children:(0,Qs.jsx)(Fn,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(i,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Qs.jsx)(Ln,{value:s.value,className:"w-full h-8 rounded-Qs data-[state=active]:rounded-Qs transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Qs.jsx)("div",{className:"lg:hidden",children:(0,Qs.jsxs)(No,{children:[(0,Qs.jsx)(Co,{asChild:!0,children:(0,Qs.jsxs)(w,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[d?.label||"Select",(0,Qs.jsx)(hn.ChevronDown,{className:"h-4 w-4 gn-2"})]})}),(0,Qs.jsx)(Ja,{align:"center",className:"w-[180px]",children:a.map(s=>(0,Qs.jsx)(ua,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function jn({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:r=!0,className:i,activeTab:d="assistant",onTabChange:s,showTabs:c=!0,tabOptions:n=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:l,actionIcon:m=(0,Qs.jsx)(hn.Bot,{className:"mr-2 h-4 w-4"}),actionText:b="Action",onNotificationRemove:f,onRemoveAll:h,logo:N="/headerlogo.png",appName:p="Nuvia",tagline:I="Collaboration Platform"}){let[F,k]=(0,wr.useState)(!1),[E,te]=(0,wr.useState)(t),x=E.filter(A=>!A.read).length,P=A=>{te(L=>L.filter(q=>q.id!==A)),f?.(A)},C=()=>{te(A=>A.filter(L=>L.read)),h?.()};return(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 Qs-2 pr-4 backdrop-blur ${i||""}`,children:[(0,Qs.jsx)(w,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Qs.jsx)(hn.Menu,{className:"h-5 w-5"})}),(0,Qs.jsx)(w,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Qs.jsx)(hn.PanelLeft,{className:"h-5 w-5"})}),!r&&(0,Qs.jsxs)(ja.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Qs.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Qs.jsx)("img",{src:N,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h2",{className:"font-semibold text-sm",children:p}),(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground",children:I})]})]}),(0,Qs.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Qs.jsx)(So,{activeTab:d,onTabChange:s,tabOptions:n}),(0,Qs.jsxs)("div",{className:"flex items-center gap-3 gn-auto",children:[(0,Qs.jsx)(ja.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qs.jsxs)(w,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:l,children:[m,b]})})}),(0,Qs.jsx)(Mn,{}),(0,Qs.jsx)(bo,{children:(0,Qs.jsxs)(ho,{children:[(0,Qs.jsx)(xo,{asChild:!0,children:(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qs.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>k(!0),children:[(0,Qs.jsx)(ja.motion.div,{animate:x>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:x>0?1/0:0,repeatDelay:3},children:(0,Qs.jsx)(hn.Bell,{className:"h-5 w-5"})}),x>0&&(0,Qs.jsx)(ja.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:x})]})})}),(0,Qs.jsx)(_a,{children:"Notifications"})]})}),(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Qs.jsxs)(Gt,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Qs.jsx)(Wa,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Qs.jsx)(_t,{})]})})]})]})]}),(0,Qs.jsx)(En,{notifications:E,open:F,onClose:()=>k(!1),onNotificationRemove:P,onRemoveAll:C})]})}var Hn=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Qs.jsx)(hn.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Vr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:r=Hn[0],onBusinessUnitChange:i,onSearch:d,businessUnits:s=Hn,activeTab:c,onTabChange:n,showTabs:l=!1,onActionClick:m,actionIcon:b,actionText:f="Action",onNotificationRemove:h,onRemoveAll:N,logo:p="/headerlogo.png",appName:I="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:k=!1}){let[E,te]=(0,wr.useState)(!k),[x,P]=(0,wr.useState)(!1),[C,A]=(0,wr.useState)(r),L=q=>{A(q),i?.(q)};return(0,Qs.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-Qs bg-background w-[]",children:[x&&(0,Qs.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>P(!1)}),(0,Qs.jsx)("div",{className:"md:hidden",children:(0,Qs.jsx)($i,{items:e,isOpen:x,isMobile:!0,onClose:()=>P(!1),currentBusinessUnit:C,onBusinessUnitChange:L,onSearch:d,logo:p,appName:I,tagline:F})}),(0,Qs.jsx)("div",{className:"hidden md:block",children:(0,Qs.jsx)($i,{items:e,isOpen:E,isMobile:!1,currentBusinessUnit:C,onBusinessUnitChange:L,onSearch:d,logo:p,appName:I,tagline:F})}),(0,Qs.jsxs)("div",{className:g("min-h-screen fixed w-full transition-all duration-300 ease-in-out",E?"md:Qs-64":"md:Qs-0"),children:[(0,Qs.jsx)(jn,{title:a,notifications:o,onToggleSidebar:()=>te(!E),onToggleMobileMenu:()=>P(!0),sidebarOpen:E,activeTab:c,onTabChange:n,showTabs:l,onActionClick:m,actionIcon:b,actionText:f,onNotificationRemove:h,onRemoveAll:N,logo:p,appName:I,tagline:F}),(0,Qs.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var Do=ie(require("react"));var Wi=Do.forwardRef(({...e},t)=>(0,Qs.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));Wi.displayName="Breadcrumb";var Ji=Do.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("ko",{ref:a,className:g("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Ji.displayName="BreadcrumbList";var $r=Do.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("ja",{ref:a,className:g("inline-flex items-center gap-1.5",e),...t}));$r.displayName="BreadcrumbItem";var qi=Do.forwardRef(({asChild:e,className:t,...a},o)=>(0,Qs.jsx)(e?yo.Slot:"a",{ref:o,className:g("transition-colors hover:text-foreground",t),...a}));qi.displayName="BreadcrumbLink";var Xi=Do.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:g("font-normal text-foreground",e),...t}));Xi.displayName="BreadcrumbPage";var Yi=({children:e,className:t,...a})=>(0,Qs.jsx)("ja",{role:"presentation","aria-hidden":"true",className:g("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,Qs.jsx)(dn.ChevronRightIcon,{})});Yi.displayName="BreadcrumbSeparator";var Kc=({className:e,...t})=>(0,Qs.jsxs)("span",{role:"presentation","aria-hidden":"true",className:g("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,Qs.jsx)(dn.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{className:"sr-only",children:"More"})]});Kc.displayName="BreadcrumbElipssis";var Wr=ie(require("react")),$c=1,Gc=1e6;var Qi=0;function _c(){return Qi=(Qi+1)%Number.MAX_SAFE_INTEGER,Qi.toString()}var Zi=new Map,Vn=e=>{if(Zi.has(e))return;let t=setTimeout(()=>{Zi.delete(e),ar({type:"REMOVE_TOAST",toastId:e})},Gc);Zi.set(e,t)},Wc=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,$c)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?Vn(a):e.toasts.forEach(o=>{Vn(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},Gr=[],_r={toasts:[]};function ar(e){_r=Wc(_r,e),Gr.forEach(t=>{t(_r)})}function Jc({...e}){let t=_c(),a=r=>ar({type:"UPDATE_TOAST",toast:{...r,id:t}}),o=()=>ar({type:"DISMISS_TOAST",toastId:t});return ar({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||o()}}}),{id:t,dismiss:o,update:a}}function Kn(){let[e,t]=Wr.useState(_r);return Wr.useEffect(()=>(Gr.push(t),()=>{let a=Gr.indexOf(t);a>-1&&Gr.splice(a,1)}),[e]),{...e,toast:Jc,dismiss:a=>ar({type:"DISMISS_TOAST",toastId:a})}}var Xa=ie(require("react")),ut=ie(require("@radix-ui/react-toast"));var _n=ut.Provider,es=Xa.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(ut.Viewport,{ref:a,className:g("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));es.displayName=ut.Viewport.displayName;var qc=(0,$n.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ts=Xa.forwardRef(({className:e,variant:t,...a},o)=>(0,Qs.jsx)(ut.Root,{ref:o,className:g(qc({variant:t}),e),...a}));ts.displayName=ut.Root.displayName;var Xc=Xa.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(ut.Action,{ref:a,className:g("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Xc.displayName=ut.Action.displayName;var as=Xa.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(ut.Close,{ref:a,className:g("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,Qs.jsx)(hn.Qs,{className:"h-4 w-4"})}));as.displayName=ut.Close.displayName;var os=Xa.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(ut.Title,{ref:a,className:g("text-sm font-semibold [&+div]:text-xs",e),...t}));os.displayName=ut.Title.displayName;var rs=Xa.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(ut.Description,{ref:a,className:g("text-sm opacity-90",e),...t}));rs.displayName=ut.Description.displayName;function Wn(){let{toasts:e}=Kn();return(0,Qs.jsxs)(_n,{children:[e.map(function({id:t,title:a,description:o,action:r,...i}){return(0,Qs.jsxs)(ts,{...i,children:[(0,Qs.jsxs)("div",{className:"grid gap-1",children:[a&&(0,Qs.jsx)(os,{children:a}),o&&(0,Qs.jsx)(rs,{children:o})]}),r,(0,Qs.jsx)(as,{})]},t)}),(0,Qs.jsx)(es,{})]})}var Jn=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let r=e.includes("fa-")?e+" ":"fa-"+e+" ",i="fa-"+t,d=o??"",s=r+i+" fa-"+a+" "+d;return(0,Qs.jsx)("i",{className:s})};var ko=require("@headlessui/react"),Yn=require("@heroicons/react/20/solid");var Yc=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Qs.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Qs.jsxs)("span",{className:"relative",children:[e,(0,Qs.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,Qs.jsxs)(ko.Popover,{children:[(0,Qs.jsxs)(ko.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Qs.jsxs)("span",{className:"relative",children:[e,(0,Qs.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,Qs.jsx)(Yn.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Qs.jsxs)(ko.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover mt-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,Qs.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 Qs:gap-x-8 z-50",children:t&&t.map(r=>(0,Qs.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Qs.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:r.icon&&(0,Qs.jsx)(Xn,{icon:r.icon,size:"4x"})}),(0,Qs.jsxs)("a",{href:r.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[r.name,(0,Qs.jsx)("span",{className:"absolute inset-0"})]}),(0,Qs.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:r.description})]},r.name))}),a.length>0&&(0,Qs.jsx)("div",{className:"bg-gray-50",children:(0,Qs.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Qs.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(r=>(0,Qs.jsxs)("a",{href:r.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[r.icon&&(0,Qs.jsx)(Xn,{icon:r.icon,className:"h-5 w-5 flex-none text-gray-400"}),r.name]},r.name))})})})]})]}),Xn=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Qs.jsx)(Jn,{...e,size:a});if("src"in e)return(0,Qs.jsx)("div",{className:g(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Qs.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},Qn=Yc;var Zn=ie(require("next/link"));function el({children:e,href:t,openNewTab:a,...o}){return(0,Qs.jsx)(Zn.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var is=ie(require("next/image"));function rr({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Qs.jsxs)(el,{href:"/",className:g(a?"py-1":"py-2"),children:[(0,Qs.jsx)(is.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,Qs.jsx)(is.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function rl({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:r=!1,wide:i=!1}){let[d,s]=(0,wr.useState)(!1),[c,n]=(0,wr.useState)(""),l=["light","dark"],{theme:m,setTheme:b}=(0,In.useTheme)();(0,wr.useEffect)(()=>{n(m||"dark")},[m]);let f=()=>{let h=l[(l.indexOf(c)+1)%l.length];n(h),b(h)};return(0,wr.useEffect)(()=>{let h=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,Qs.jsx)(Qs.Fragment,{children:(0,Qs.jsx)("header",{className:`z-50 pb-10 transition-all duration-300 hidden lg:block ${d||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Qs.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Qs.jsxs)("div",{className:g("flex items-center justify-between px-9 py-0",!i&&"container"),children:[(0,Qs.jsx)(rr,{logoDark:a,logoLight:t}),(0,Qs.jsx)(ko.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(h=>(0,Qs.jsx)(Qn,{...h},h.name))}),r&&(0,Qs.jsx)("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:f,children:(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)(hn.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Qs.jsx)(hn.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var qr=require("@heroicons/react/24/outline");var ss=["light","dark"];function sl({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[r,i]=(0,wr.useState)(!1),{theme:d,setTheme:s}=(0,In.useTheme)(),[c,n]=(0,wr.useState)(!1),[l,m]=(0,wr.useState)("light");(0,wr.useEffect)(()=>{let f=()=>{window.scrollY>100?i(!0):i(!1)};return window.addEventListener("scroll",f,{passive:!0}),()=>window.removeEventListener("scroll",f)},[]),(0,wr.useEffect)(()=>{m(d||"dark")},[d]);let b=()=>{let f=ss[(ss.indexOf(l)+1)%ss.length];m(f),s(f)};return(0,Qs.jsx)(Qs.Fragment,{children:(0,Qs.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block lg:hidden ${r||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Qs.jsx)("nav",{className:g("backdrop-blur-sm text-white p-0",c&&"hidden"),children:(0,Qs.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&Qs.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,Qs.jsx)(rr,{logoDark:t,logoLight:e,mobile:!0}),(0,Qs.jsx)("div",{className:"flex items-center space-x-4",children:(0,Qs.jsxs)("button",{type:"button",onClick:()=>n(!0),className:"fixed right-4 z-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,Qs.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,Qs.jsx)(qr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Qs.jsxs)(ko.Dialog,{open:c,onClose:n,className:"lg:hidden",children:[(0,Qs.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Qs.jsxs)(ko.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,Qs.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Qs.jsx)(rr,{logoDark:t,logoLight:e,mobile:!0}),(0,Qs.jsxs)("button",{type:"button",onClick:()=>n(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,Qs.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,Qs.jsx)(qr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Qs.jsx)("div",{className:"mt-6 flow-root",children:(0,Qs.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Qs.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(f=>(0,Qs.jsx)(Qc,{...f},f.name))})})})]})]})]})})}function Qc({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Qs.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,Qs.jsxs)(ko.Disclosure,{as:"div",className:"-mx-3",children:[(0,Qs.jsx)(ko.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 Qs-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Qs.jsx)(ko.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(r=>(0,Qs.jsx)(ko.DisclosureButton,{as:"a",href:r.href,className:"block rounded-lg py-2 Qs-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:r.name},r.name))})]})}function nl({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:r,wide:i,themeControl:d=!1}){return(0,Qs.jsxs)("div",{className:g("fixed top-0 left-0 right-0 z-50",r),children:[(0,Qs.jsx)(rl,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:d,wide:i}),(0,Qs.jsx)(sl,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var ll="../../cortex-reply-light-27IMI3G7.png";var dl="../../cortex-reply-dark-XPAJJJYY.png";function ns({...e}){return(0,Qs.jsxs)("div",{className:"bg-sidebar",children:[(0,Qs.jsx)(nl,{isMenuOpen:!0,logoLight:ll,logoDark:dl,...e.header,className:"bg-sidebar",wide:!0}),(0,Qs.jsxs)(Ti,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Qs.jsx)(Tr,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Qs.jsxs)(Ai,{className:"grow overflow-hidden",children:[(0,Qs.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Qs.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Qs.jsx)(Ri,{className:"-gn-1"}),(0,Qs.jsx)(_o,{orientation:"vertical",className:"mr-2 h-4"}),(0,Qs.jsx)(Wi,{children:(0,Qs.jsxs)(Ji,{children:[(0,Qs.jsx)($r,{className:"hidden md:block",children:(0,Qs.jsx)(qi,{href:"#",children:"Building Your Application"})}),(0,Qs.jsx)(Yi,{className:"hidden md:block"}),(0,Qs.jsx)($r,{children:(0,Qs.jsx)(Xi,{children:"Data Fetching"})})]})})]})}),(0,Qs.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,Qs.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Qs.jsx)("div",{className:"aspect-video rounded-Qs bg-muted/50"}),(0,Qs.jsx)("div",{className:"aspect-video rounded-Qs bg-muted/50"}),(0,Qs.jsx)("div",{className:"aspect-video rounded-Qs bg-muted/50"})]}),(0,Qs.jsx)("div",{className:"flex-1 rounded-Qs bg-muted/50 md:min-h-min"})]})]})]}),(0,Qs.jsx)(Wn,{})]})}var tm=[{key:"kanban",icon:hn.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:hn.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:hn.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:hn.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:hn.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Xr=({currentView:e,onViewChange:t,children:a})=>(0,Qs.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Qs.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:tm.map(o=>{let r=o.icon,i=e===o.key;return(0,Qs.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:Qs-3`,title:o.title,children:[(0,Qs.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Qs.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Qs.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Qs.jsx)("div",{className:"w-full h-full",children:a})})]});var cl=ie(require("react")),ls=ie(require("@radix-ui/react-label"));var am=(0,gn.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),M=cl.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(ls.Root,{ref:a,className:g(am(),e),...t}));M.displayName=ls.Root.displayName;var Se=ie(require("@radix-ui/react-select")),Ua=ie(require("react")),ot=Se.Root;var It=Se.Value,et=Ua.forwardRef(({children:e,className:t,...a},o)=>(0,Qs.jsxs)(Se.Trigger,{className:g("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,Qs.jsx)(Se.Icon,{asChild:!0,children:(0,Qs.jsx)(hn.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));et.displayName=Se.Trigger.displayName;var ul=Ua.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Se.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Qs.jsx)(hn.ChevronUp,{className:"h-4 w-4"})}));ul.displayName=Se.ScrollUpButton.displayName;var gl=Ua.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Se.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Qs.jsx)(hn.ChevronDown,{className:"h-4 w-4"})}));gl.displayName=Se.ScrollDownButton.displayName;var tt=Ua.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,Qs.jsx)(Se.Portal,{children:(0,Qs.jsxs)(Se.Content,{className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:r,...o,children:[(0,Qs.jsx)(ul,{}),(0,Qs.jsx)(Se.Viewport,{className:g("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Qs.jsx)(gl,{})]})}));tt.displayName=Se.Content.displayName;var om=Ua.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Se.Label,{className:g("py-1.5 Qs-8 pr-2 text-sm font-semibold",e),ref:a,...t}));om.displayName=Se.Label.displayName;var ye=Ua.forwardRef(({children:e,className:t,...a},o)=>(0,Qs.jsxs)(Se.Item,{className:g("relative flex w-full cursor-default select-none items-center rounded py-1.5 Qs-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,Qs.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Qs.jsx)(Se.ItemIndicator,{children:(0,Qs.jsx)(hn.Check,{className:"h-4 w-4"})})}),(0,Qs.jsx)(Se.ItemText,{children:e})]}));ye.displayName=Se.Item.displayName;var rm=Ua.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(Se.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));rm.displayName=Se.Separator.displayName;var fl=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:d=!1})=>{let[s,c]=(0,wr.useState)(!1),[n,l]=(0,wr.useState)(""),m=o.find(p=>p.value===t),b=o.filter(p=>p.label.toLowerCase().includes(n.toLowerCase())),f=p=>{a(p),c(!1),l("")},h=()=>{i&&n.trim()&&!o.find(p=>p.value===n.trim())&&(a(n.trim()),c(!1),l(""))};return(0,Qs.jsxs)("div",{className:"space-y-1",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:e}),(0,Qs.jsxs)(ot,{value:t,onValueChange:f,open:s,onOpenChange:p=>{d||c(p)},disabled:d,children:[(0,Qs.jsx)(et,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Qs.jsx)(ee,{variant:"secondary",className:`${d?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!d&&c(!s),children:m?.label||t||"Select..."})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsx)("div",{className:"p-2",children:(0,Qs.jsx)(W,{placeholder:r,value:n,onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Enter"&&i&&h()},className:"mb-2"})}),b.map(p=>(0,Qs.jsx)(ye,{value:p.value,children:p.label},p.value)),i&&n.trim()&&!b.find(p=>p.value===n.trim())&&(0,Qs.jsxs)(ye,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var Za=ie(require("react"));var V=Za.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,className:g("rounded-Qs border bg-card text-card-foreground shadow",e),...t}));V.displayName="Card";var Le=Za.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,className:g("flex flex-col space-y-1.5 p-6",e),...t}));Le.displayName="CardHeader";var We=Za.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,className:g("font-semibold leading-none tracking-tight",e),...t}));We.displayName="CardTitle";var eo=Za.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,className:g("text-sm text-muted-foreground",e),...t}));eo.displayName="CardDescription";var fe=Za.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,className:g("p-6 pt-0",e),...t}));fe.displayName="CardContent";var to=Za.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("div",{ref:a,className:g("flex items-center p-6 pt-0",e),...t}));to.displayName="CardFooter";function bl({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:r=!0,compact:i=!1,className:d}){let[s,c]=(0,wr.useState)(!1),n=b=>{switch(b){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},l=b=>{switch(b){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},m=b=>{if(!b)return"Never";let h=Math.floor((new Date().getTime()-b.getTime())/(1e3*60));return h<1?"Just now":h<60?`${h}m ago`:h<1440?`${Math.floor(h/60)}h ago`:`${Math.floor(h/1440)}d ago`};return(0,Qs.jsxs)(V,{className:g("hover:shadow-md transition-shadow",i&&"p-2",d),children:[(0,Qs.jsx)(Le,{className:g("pb-3",i&&"pb-2"),children:(0,Qs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qs.jsx)("div",{className:"relative",children:(0,Qs.jsxs)(Gt,{className:g("h-12 w-12",i&&"h-8 w-8"),children:[(0,Qs.jsx)(Wa,{src:"/placeholder.svg",alt:e.name}),(0,Qs.jsx)(_t,{children:e.name.split(" ").map(b=>b[0]).join("")})]})}),(0,Qs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)("h3",{className:g("font-semibold text-sm truncate",i&&"text-xs"),children:e.name}),e.type==="digital"?(0,Qs.jsx)(hn.Bot,{className:g("h-4 w-4 text-blue-500",i&&"h-3 w-3")}):(0,Qs.jsx)(hn.User,{className:g("h-4 w-4 text-green-500",i&&"h-3 w-3")})]}),(0,Qs.jsx)("p",{className:g("text-sm text-muted-foreground truncate",i&&"text-xs"),children:e.type==="human"?e.role:e.description}),!i&&(0,Qs.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[e.type==="human"&&(0,Qs.jsx)(ee,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,Qs.jsxs)(ee,{variant:"secondary",className:"text-xs",children:["Qs",e.version]}),(0,Qs.jsx)(ee,{variant:"outline",className:"text-xs",children:l(e.status)})]})]})]}),r&&(0,Qs.jsxs)(No,{children:[(0,Qs.jsx)(Co,{asChild:!0,children:(0,Qs.jsx)(w,{variant:"ghost",size:"icon",className:g("h-8 w-8",i&&"h-6 w-6"),children:(0,Qs.jsx)(hn.MoreHorizontal,{className:g("h-4 w-4",i&&"h-3 w-3")})})}),(0,Qs.jsxs)(Ja,{align:"end",children:[e.type==="digital"&&(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsxs)(ua,{onClick:()=>o?.(e),children:[(0,Qs.jsx)(hn.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,Qs.jsxs)(ua,{onClick:()=>t?.(e),children:[(0,Qs.jsx)(hn.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,Qs.jsxs)(ua,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Qs.jsx)(hn.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!i&&(0,Qs.jsxs)(fe,{className:"pt-0",children:[(0,Qs.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Qs.jsx)(hn.Mail,{className:"h-3 w-3"}),(0,Qs.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Qs.jsxs)(Qs.Fragment,{children:[e.phone&&(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Qs.jsx)(hn.Phone,{className:"h-3 w-3"}),(0,Qs.jsx)("span",{children:e.phone})]}),e.location&&(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Qs.jsx)(hn.MapPin,{className:"h-3 w-3"}),(0,Qs.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Qs.jsx)(hn.Settings,{className:"h-3 w-3"}),(0,Qs.jsxs)("span",{children:["Qs",e.version]})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Qs.jsx)(hn.Clock,{className:"h-3 w-3"}),(0,Qs.jsxs)("span",{children:["Last active: ",m(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Qs.jsx)("div",{className:"mt-3",children:(0,Qs.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(b=>(0,Qs.jsx)(ee,{variant:"outline",className:"text-xs",children:b},b)),e.skills.length>3&&(0,Qs.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>c(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Qs.jsx)("div",{className:"mt-3",children:(0,Qs.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(b=>(0,Qs.jsx)(ee,{variant:"outline",className:"text-xs",children:b},b)),e.capabilities.length>2&&(0,Qs.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>c(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var hl=ie(require("react")),Ee=hl.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background 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",e),ref:a,...t}));Ee.displayName="Textarea";function sr({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:r="Search knowledge documents...",maxSelections:i,disabled:d=!1}){let[s,c]=(0,wr.useState)(""),[n,l]=(0,wr.useState)([]),[m,b]=(0,wr.useState)(!1);(0,wr.useEffect)(()=>{if(!s.trim()){l([]),b(!1);return}let p=a.filter(I=>{if(e.map(E=>E.id).includes(I.id))return!1;let k=s.toLowerCase();return I.title.toLowerCase().includes(k)||I.description?.toLowerCase().includes(k)||I.tags?.some(E=>E.toLowerCase().includes(k))||Object.values(I.metadata||{}).some(E=>String(E).toLowerCase().includes(k))});l(p),b(!0)},[s,e,a]);let f=p=>{i&&e.length>=i||(t([...e,p]),c(""),b(!1))},h=p=>{t(e.filter(I=>I.id!==p))},N=!i||e.length<i;return(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:o}),(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)(hn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qs.jsx)(W,{value:s,onChange:p=>c(p.target.value),placeholder:N?r:`Maximum ${i} documents selected`,className:"Qs-9",disabled:d||!N,onFocus:()=>s&&b(!0)})]}),m&&n.length>0&&(0,Qs.jsx)(V,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60",children:(0,Qs.jsx)(ga,{className:"h-full",children:(0,Qs.jsx)(fe,{className:"p-2",children:n.map(p=>(0,Qs.jsx)(w,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>f(p),disabled:d,children:(0,Qs.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Qs.jsx)(hn.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Qs.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Qs.jsx)("div",{className:"font-medium text-sm truncate",children:p.title}),p.description&&(0,Qs.jsx)("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:p.description}),p.tags&&p.tags.length>0&&(0,Qs.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[p.tags.slice(0,3).map(I=>(0,Qs.jsx)(ee,{variant:"outline",className:"text-xs",children:I},I)),p.tags.length>3&&(0,Qs.jsxs)(ee,{variant:"outline",className:"text-xs",children:["+",p.tags.length-3," more"]})]})]})]})},p.id))})})}),m&&s&&n.length===0&&(0,Qs.jsx)(V,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,Qs.jsxs)(fe,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,i&&`/${i}`,")"]}),(0,Qs.jsx)("div",{className:"space-y-2",children:e.map(p=>(0,Qs.jsx)(V,{className:"p-3",children:(0,Qs.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Qs.jsx)(hn.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Qs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qs.jsx)("div",{className:"font-medium text-sm",children:p.title}),p.description&&(0,Qs.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:p.description}),p.tags&&p.tags.length>0&&(0,Qs.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:p.tags.map(I=>(0,Qs.jsxs)(ee,{variant:"outline",className:"text-xs",children:[(0,Qs.jsx)(hn.Tag,{className:"h-3 w-3 mr-1"}),I]},I))})]}),(0,Qs.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(p.id),disabled:d,children:(0,Qs.jsx)(hn.Qs,{className:"h-3 w-3"})})]})},p.id))})]}),m&&(0,Qs.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>b(!1)})]})}function yl({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:d="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,l]=(0,wr.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[m,b]=(0,wr.useState)(""),[f,h]=(0,wr.useState)(""),[N,p]=(0,wr.useState)(!s);(0,wr.useEffect)(()=>{e&&l(e)},[e]);let I=C=>{C.preventDefault();let A=n.version?parseInt(n.version):0,L=e?(A+1).toString():"1",q={id:n.id||Date.now().toString(),name:n.name,type:"digital",status:"active",joinedDate:n.joinedDate||new Date,lastActive:n.lastActive||new Date,description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],knowledge:n.knowledge||[],coreKnowledge:n.coreKnowledge||[],version:L,lastUpdated:n.lastUpdated||new Date,isActive:!0};t(q)},F=(C,A,L)=>{if(!A.trim())return;let q=n[C]||[];l({...n,[C]:[...q,A.trim()]}),L("")},k=(C,A)=>{let L=n[C]||[];l({...n,[C]:L.filter((q,S)=>S!==A)})},E=C=>{C.preventDefault(),p(!N)},te=(C,A,L,q,S)=>{let je=n[C]||[];return(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:A}),N&&(0,Qs.jsxs)("div",{className:"flex gap-2",children:[(0,Qs.jsx)(W,{value:L,onChange:D=>q(D.target.value),placeholder:S,onKeyPress:D=>{D.key==="Enter"&&(D.preventDefault(),F(C,L,q))},disabled:o}),(0,Qs.jsx)(w,{type:"button",variant:"outline",size:"icon",onClick:()=>F(C,L,q),disabled:o,children:(0,Qs.jsx)(hn.Plus,{className:"h-4 w-4"})})]}),(0,Qs.jsx)("div",{className:"flex flex-wrap gap-2",children:je.map((D,Ne)=>(0,Qs.jsxs)(ee,{className:"gap-1",children:[D,N&&(0,Qs.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>k(C,Ne),disabled:o,children:(0,Qs.jsx)(hn.Qs,{className:"h-3 w-3"})})]},`${C}-${Ne}-${D}`))})]})},x=r||(N?e?"Edit Colleague":"Add New Colleague":"View Colleague"),P=i||(e?"Update Colleague":"Add Colleague");return(0,Qs.jsxs)(V,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Qs.jsx)(Le,{children:(0,Qs.jsxs)(We,{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.Bot,{className:"h-5 w-5"}),x]})}),(0,Qs.jsx)(fe,{children:(0,Qs.jsxs)("form",{onSubmit:I,className:"space-y-6",children:[(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"name",children:"Name *"}),(0,Qs.jsx)(W,{id:"name",value:n.name||"",onChange:C=>l({...n,name:C.target.value}),required:!0,disabled:o||!N})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"description",children:"Description"}),(0,Qs.jsx)(Ee,{id:"description",value:n.description||"",onChange:C=>l({...n,description:C.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!N})]})]}),(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Qs.jsx)(Ee,{id:"jobDescription",value:n.jobDescription||"",onChange:C=>l({...n,jobDescription:C.target.value}),rows:4,required:n.type==="digital",disabled:o||!N})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Qs.jsx)(Ee,{id:"workInstructions",value:n.workInstructions||"",onChange:C=>l({...n,workInstructions:C.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!N})]}),te("capabilities","Capabilities",f,h,"Add capability"),(0,Qs.jsx)(sr,{selectedDocuments:n.knowledge||[],onDocumentsChange:C=>l({...n,knowledge:C}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:o||!N,availableDocuments:c}),(0,Qs.jsx)(sr,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:C=>l({...n,coreKnowledge:C}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!N,availableDocuments:c})]}),(0,Qs.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Qs.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:N?d:"Close"}),N?(0,Qs.jsx)(w,{type:"submit",disabled:o,children:o?"Saving...":P}):(0,Qs.jsxs)(w,{type:"button",onClick:E,disabled:o,className:"gap-2",children:[(0,Qs.jsx)(hn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Yr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Qs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Qs.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qs.jsx)(hn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,Qs.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qs.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Qs.jsxs)(Le,{className:"text-center pb-4",children:[(0,Qs.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Qs.jsx)(hn.User,{className:"h-8 w-8 text-blue-600"})}),(0,Qs.jsx)(We,{className:"text-Qs",children:"Add Human Colleague"})]}),(0,Qs.jsxs)(fe,{className:"text-center",children:[(0,Qs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add as team members."}),(0,Qs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.Users,{className:"h-4 w-4 text-blue-600"}),(0,Qs.jsx)("span",{children:"Browse existing users"})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.User,{className:"h-4 w-4 text-blue-600"}),(0,Qs.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Qs.jsx)(w,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qs.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Qs.jsxs)(Le,{className:"text-center pb-4",children:[(0,Qs.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Qs.jsx)(hn.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Qs.jsx)(We,{className:"text-Qs",children:"Add Digital Colleague"})]}),(0,Qs.jsxs)(fe,{className:"text-center",children:[(0,Qs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague Qs create a new AI assistant for your team."}),(0,Qs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Qs.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.Users,{className:"h-4 w-4 text-purple-600"}),(0,Qs.jsx)("span",{children:"Create from templates"})]})]}),(0,Qs.jsx)(w,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function wl({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[r,i]=(0,wr.useState)(""),[d,s]=(0,wr.useState)("all"),c=(0,wr.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(r.toLowerCase())),[e,r,d]),n=m=>{let b={...m,id:Date.now(),name:`${m.name} (Copy)`};t(b)},l=m=>new Intl.DateTimeFormat("yo-US",{month:"short",day:"numeric",year:"numeric"}).format(m);return(0,Qs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Qs.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qs.jsx)(hn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,Qs.jsx)(V,{children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Qs.jsx)("div",{className:"flex-1",children:(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)(hn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qs.jsx)(W,{placeholder:"Search by name, job description, Qs capabilities...",value:r,onChange:m=>i(m.target.value),className:"Qs-9"})]})}),(0,Qs.jsxs)("select",{value:d,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,Qs.jsx)("option",{value:"all",children:"All Status"}),(0,Qs.jsx)("option",{value:"active",children:"Active"}),(0,Qs.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Qs.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(m=>(0,Qs.jsx)(ja.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Qs.jsxs)(V,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===m.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>n(m),children:[(0,Qs.jsx)(Le,{className:"pb-3",children:(0,Qs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qs.jsx)(Gt,{children:(0,Qs.jsx)(_t,{className:"bg-blue-100",children:(0,Qs.jsx)(hn.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Qs.jsx)("div",{children:(0,Qs.jsx)(We,{className:"text-lg flex items-center gap-2",children:m.name})})]}),(0,Qs.jsxs)(w,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:b=>{b.stopPropagation(),n(m)},children:[(0,Qs.jsx)(hn.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Qs.jsx)(fe,{className:"pt-0",children:(0,Qs.jsxs)("div",{className:"space-y-3",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Qs.jsx)("p",{className:"text-sm line-clamp-2",children:m.jobDescription})]}),m.capabilities&&m.capabilities.length>0&&(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Qs.jsx)("div",{className:"flex flex-wrap gap-1",children:m.capabilities.length>3&&(0,Qs.jsxs)(ee,{variant:"outline",className:"text-xs",children:["+",m.capabilities.length-3]})})]}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,Qs.jsx)("div",{className:"flex items-center gap-1",children:(0,Qs.jsx)(hn.Calendar,{className:"h-3 w-3"})}),m.knowledge&&(0,Qs.jsx)("div",{className:"flex items-center gap-1",children:(0,Qs.jsx)(hn.Users,{className:"h-3 w-3"})})]}),m.workInstructions&&(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Qs.jsx)("p",{className:"text-xs line-clamp-2",children:m.workInstructions})]})]})})]})},m.id))}),c.length===0&&(0,Qs.jsx)(V,{children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsxs)("div",{className:"text-center py-8",children:[(0,Qs.jsx)(hn.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Qs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Qs filters."})]})})})]},"colleague-clone")})})}function Qr({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Qs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Qs.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qs.jsx)(hn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,Qs.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qs.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Qs.jsxs)(Le,{className:"text-center pb-4",children:[(0,Qs.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Qs.jsx)(hn.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Qs.jsx)(We,{className:"text-Qs",children:"Clone Existing"})]}),(0,Qs.jsxs)(fe,{className:"text-center",children:[(0,Qs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize Qs for your needs."}),(0,Qs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Qs.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Qs.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Qs.jsx)(w,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Qs.jsxs)(V,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Qs.jsxs)(Le,{className:"text-center pb-4",children:[(0,Qs.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Qs.jsx)(hn.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Qs.jsx)(We,{className:"text-Qs",children:"Create New"})]}),(0,Qs.jsxs)(fe,{className:"text-center",children:[(0,Qs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Qs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.Plus,{className:"h-4 w-4 text-green-600"}),(0,Qs.jsx)("span",{children:"Custom job description"})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Qs.jsx)(hn.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Qs.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Qs.jsx)(w,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Nl=ie(require("react")),dr=ie(require("@radix-ui/react-switch"));var Io=Nl.forwardRef(({className:e,...t},a)=>(0,Qs.jsx)(dr.Root,{className:g("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,Qs.jsx)(dr.Thumb,{className:g("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")})}));Io.displayName=dr.Root.displayName;function ei({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:r,submitLabel:i,cancelLabel:d="Cancel",readOnly:s=!1}){let[c,n]=(0,wr.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[l,m]=(0,wr.useState)(!s);(0,wr.useEffect)(()=>{e&&n(e)},[e]);let b=p=>{p.preventDefault();let I={id:c.id||Date.now(),name:c.name,description:c.description||null,systemMsg:c.systemMsg||null,useProjects:c.useProjects||!1,useKnowledge:c.useKnowledge||!1,useFiles:c.useFiles||!1,useChat:c.useChat||!1,updatedAt:new Date().toISOString(),createdAt:c.createdAt||new Date().toISOString()};t(I)},f=p=>{p.preventDefault(),m(!l)},h=r||(l?e?"Edit Team":"Create New Team":"View Team"),N=i||(e?"Update Team":"Create Team");return(0,Qs.jsxs)(V,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Qs.jsx)(Le,{children:(0,Qs.jsxs)(We,{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.Users,{className:"h-5 w-5"}),h]})}),(0,Qs.jsx)(fe,{children:(0,Qs.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"name",children:"Team Name *"}),(0,Qs.jsx)(W,{id:"name",value:c.name||"",onChange:p=>n({...c,name:p.target.value}),required:!0,disabled:o||!l,placeholder:"Enter team name..."})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"description",children:"Description"}),(0,Qs.jsx)(Ee,{id:"description",value:c.description||"",onChange:p=>n({...c,description:p.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!l})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Qs.jsx)(Ee,{id:"systemMsg",value:c.systemMsg||"",onChange:p=>n({...c,systemMsg:p.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!l})]})]}),(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Qs.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)(Io,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:p=>n({...c,useProjects:p}),disabled:o||!l}),(0,Qs.jsx)(M,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)(Io,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:p=>n({...c,useKnowledge:p}),disabled:o||!l}),(0,Qs.jsx)(M,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)(Io,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:p=>n({...c,useFiles:p}),disabled:o||!l}),(0,Qs.jsx)(M,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)(Io,{id:"useChat",checked:c.useChat||!1,onCheckedChange:p=>n({...c,useChat:p}),disabled:o||!l}),(0,Qs.jsx)(M,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Qs.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Qs.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:l?d:"Close"}),l?(0,Qs.jsx)(w,{type:"submit",disabled:o||!c.name?.trim(),children:o?"Saving...":N}):(0,Qs.jsxs)(w,{type:"button",onClick:f,disabled:o,className:"gap-2",children:[(0,Qs.jsx)(hn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}var ti=require("react-icons/fa");function ze({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:i,children:d,className:s}){let[c,n]=Or(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),l=!r&&!t||c;return(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${s||""}`,children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Qs.jsx)(ee,{className:"bg-white/20 text-white hover:bg-white/30 rounded-Qs",children:a}),(0,Qs.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[l&&o&&(0,Qs.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,Qs.jsx)("button",{"aria-label":c?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>n(!c),style:{lineHeight:0},children:c?(0,Qs.jsx)(ti.FaChevronDown,{size:22}):(0,Qs.jsx)(ti.FaChevronUp,{size:22})})]})]}),!l&&(0,Qs.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Qs.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Qs.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,Qs.jsx)(w,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),d&&(0,Qs.jsx)("div",{className:"hidden lg:block",children:d})]})]})}var Sl=ie(require("react")),mr=ie(require("@radix-ui/react-progress"));var pr=Sl.forwardRef(({className:e,value:t,...a},o)=>(0,Qs.jsx)(mr.Root,{ref:o,className:g("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Qs.jsx)(mr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));pr.displayName=mr.Root.displayName;function ps({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:r}){return(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:r,children:(0,Qs.jsxs)(V,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Qs.jsx)(Le,{className:"pb-2",children:(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Qs.jsx)(ee,{className:"rounded-Qs bg-amber-500",children:"New"}):(0,Qs.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Qs.jsx)(hn.Star,{className:"h-4 w-4"})})]})}),(0,Qs.jsxs)(fe,{className:"pb-2",children:[(0,Qs.jsx)(We,{className:"text-lg",children:e.name}),(0,Qs.jsx)(eo,{children:e.description}),o&&e.progress<100&&(0,Qs.jsxs)("div",{className:"mt-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qs.jsx)("span",{children:"Installation"}),(0,Qs.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Qs.jsx)(pr,{value:e.progress,className:"h-2 mt-1 rounded-Qs"})]})]}),(0,Qs.jsx)(to,{children:(0,Qs.jsx)(w,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var im=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 Mo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:i}){return(0,Qs.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${i||""}`,children:[r&&(0,Qs.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Qs.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Qs.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Qs.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Qs.jsx)("div",{className:"divide-y",children:e.map(d=>(0,Qs.jsxs)(ja.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?.(d),children:[(0,Qs.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Qs.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Qs.jsx)("div",{children:(0,Qs.jsx)("p",{className:"font-medium",children:d.name})})]}),(0,Qs.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:im(d.filesize)}),(0,Qs.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Qs.jsx)("span",{className:"text-sm md:text-base",children:new Date(d.createdAt).toLocaleDateString()}),(0,Qs.jsx)("div",{className:"flex gap-1",children:(0,Qs.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-Qs text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(d)},children:(0,Qs.jsx)(hn.Trash2,{className:"h-4 w-4"})})})]})]},d.name))})]})}function ai({project:e,onOpen:t,onShare:a,className:o}){return(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Qs.jsxs)(V,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Qs.jsxs)(Le,{children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)(We,{children:e.name}),(0,Qs.jsxs)(ee,{variant:"outline",className:"rounded-Qs",children:["Due ",e.dueDate]})]}),(0,Qs.jsx)(eo,{children:e.description})]}),(0,Qs.jsxs)(fe,{className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qs.jsx)("span",{children:"Progress"}),(0,Qs.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Qs.jsx)(pr,{value:e.progress,className:"h-2 rounded-Qs"})]}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Qs.jsxs)("div",{className:"flex items-center",children:[(0,Qs.jsx)(hn.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,Qs.jsxs)("div",{className:"flex items-center",children:[(0,Qs.jsx)(hn.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Qs.jsxs)(to,{className:"flex gap-2",children:[(0,Qs.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Qs.jsx)(w,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Qs.jsx)(hn.Share2,{className:"h-4 w-4"})})]})]})})}var us=[{name:"PixelMaster",icon:(0,Qs.jsx)(hn.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Qs.jsx)(hn.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Qs.jsx)(hn.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Qs.jsx)(hn.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Qs.jsx)(hn.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Qs.jsx)(hn.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Qs.jsx)(hn.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Qs.jsx)(hn.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Qs.jsx)(hn.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Qs.jsx)(hn.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Qs.jsx)(hn.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Qs.jsx)(hn.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Al=[{id: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},{id: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},{id: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},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/ui-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id: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},{id: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},{id: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 Il=[{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 Bo=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:i="",disabled:d=!1})=>{let[s,c]=(0,wr.useState)(!1),[n,l]=(0,wr.useState)(""),m=()=>{d||(c(!0),l(t))},b=async()=>{n!==t&&await r(e,n),c(!1)},f=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?b():h.key==="Escape"&&(c(!1),l(""))};return(0,Qs.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Qs.jsx)(M,{children:a}),s?o?(0,Qs.jsx)(Ee,{value:n,onChange:h=>l(h.target.value),onBlur:b,onKeyDown:f,autoFocus:!0,rows:4,className:"resize-none"}):(0,Qs.jsx)(W,{value:n,onChange:h=>l(h.target.value),onBlur:b,onKeyPress:f,autoFocus:!0,className:"text-lg font-medium"}):(0,Qs.jsxs)("div",{onClick:m,className:`${d?"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,Qs.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!d&&(0,Qs.jsx)(hn.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};function oi({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:r=[]}){let[i,d]=(0,wr.useState)({...e,updatedAt:new Date}),[s,c]=(0,wr.useState)(!1),[n,l]=(0,wr.useState)(()=>{let x=[],P=0,C=new Set;return r.forEach(A=>{A.menuConfig.groupBy.forEach(L=>C.add(L))}),C.forEach(A=>{x.push({id:`context_field_${P++}`,key:A,value:e.metadata?.[A]?String(e.metadata[A]):"",isContextKey:!0})}),e.metadata&&Object.entries(e.metadata).forEach(([A,L])=>{C.has(A)||x.push({id:`existing_field_${P++}`,key:A,value:String(L),isContextKey:!1})}),x}),m=x=>{switch(x){case"markdown":case"mdx":return(0,$.jsx)(hn.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,$.jsx)(hn.File,{className:"h-6 w-6 text-success"});case"text":return(0,$.jsx)(hn.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,$.jsx)(hn.File,{className:"h-6 w-6 text-muted-foreground"})}},b=x=>{switch(x){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"}},f=()=>{let x=new Set;return o.forEach(P=>{P.metadata&&Object.keys(P.metadata).forEach(C=>x.add(C))}),{documentKeys:Array.from(x).sort()}},h=x=>{let P=new Set;return o.forEach(C=>{C.metadata?.[x]&&P.add(String(C.metadata[x]))}),Array.from(P).sort()},N=f(),p=()=>{t(i)};(0,wr.useEffect)(()=>{let x=n.filter(P=>P.key.trim()!==""&&P.value.trim()!=="").reduce((P,C)=>({...P,[C.key]:C.value}),{});d(P=>({...P,metadata:Object.keys(x).length>0?x:void 0}))},[n]);let I=(x,P)=>{l(C=>C.map(A=>A.id===x?{...A,key:P}:A))},F=(x,P)=>{l(C=>C.map(A=>A.id===x?{...A,value:P}:A))},k=(x,P)=>{P==="__custom__"?F(x,""):F(x,P)},E=()=>{let x={id:`field_${Date.now()}`,key:"",value:"",isContextKey:!1};l(P=>[...P,x])},te=x=>{l(P=>P.filter(C=>C.id!==x))};return(0,$.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,$.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,$.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,$.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,$.jsx)("div",{className:"flex-shrink-0 p-3 rounded-Qs bg-muted border border-border",children:m(i.format)}),(0,$.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,$.jsxs)("div",{className:"flex items-start gap-4 mb-2 leading-tight",children:[(0,$.jsx)("div",{className:"flex-1 min-w-0",children:(0,$.jsx)(Bo,{fieldName:"title",value:i.title,label:"",onSave:(x,P)=>d(C=>({...C,title:P})),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,$.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${b(i.format)} flex-shrink-0 mt-1`,children:i.format.toUpperCase()})]}),(0,$.jsx)("div",{className:"mt-2",children:(0,$.jsx)(Bo,{fieldName:"description",value:i.description||"Click to add description...",label:"",multiline:!0,onSave:(x,P)=>d(C=>({...C,description:P})),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,$.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,$.jsxs)(w,{variant:"ghost",size:"sm",onClick:()=>c(!s),className:"gap-2",children:[(0,$.jsx)(hn.Info,{className:"h-4 w-4"}),"Metadata",n.filter(x=>x.key.trim()!==""&&x.value.trim()!=="").length>0&&(0,$.jsx)("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs font-medium bg-primary/10 text-primary rounded-full",children:n.filter(x=>x.key.trim()!==""&&x.value.trim()!=="").length}),s?(0,$.jsx)(hn.ChevronDown,{className:"h-4 w-4"}):(0,$.jsx)(hn.ChevronRight,{className:"h-4 w-4"})]}),(0,$.jsxs)(w,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,$.jsx)(hn.Qs,{className:"h-4 w-4"}),"Cancel"]}),(0,$.jsxs)(w,{size:"sm",onClick:p,className:"gap-2",children:[(0,$.jsx)(hn.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,$.jsx)(ja.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,$.jsxs)("div",{className:"pt-4 border-t border-border mt-4",children:[(0,$.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,$.jsx)(hn.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,$.jsxs)(w,{type:"button",variant:"outline",size:"sm",onClick:E,className:"gap-1 h-8",children:[(0,$.jsx)(hn.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),N.documentKeys.length>0&&(0,$.jsxs)("p",{className:"text-xs text-muted-foreground mb-3",children:["Additional from documents: ",N.documentKeys.slice(0,4).join(", "),N.documentKeys.length>4&&` +${N.documentKeys.length-4} more`]}),(0,$.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:n.length>0?(0,$.jsx)("div",{className:"space-y-2",children:n.map(x=>{let P=h(x.key);return(0,$.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,$.jsx)(W,{value:x.key,onChange:C=>I(x.id,C.target.value),placeholder:"Key",className:`w-32 h-8 text-sm ${x.isContextKey?"bg-primary/5 border-primary/30":""}`,list:`metadata-keys-${x.id}`,disabled:x.isContextKey}),(0,$.jsx)("datalist",{id:`metadata-keys-${x.id}`,children:N.documentKeys.map(C=>(0,$.jsx)("option",{value:C},C))}),(0,$.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),P.length>0?(0,$.jsxs)(ot,{value:x.value||"",onValueChange:C=>k(x.id,C),children:[(0,$.jsx)(et,{className:"flex-1 h-8 text-sm",children:(0,$.jsx)(It,{placeholder:"Value"})}),(0,$.jsxs)(tt,{children:[P.map(C=>(0,$.jsx)(ye,{value:C,children:C},C)),(0,$.jsx)(ye,{value:"__custom__",children:(0,$.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,$.jsx)(W,{value:x.value||"",onChange:C=>F(x.id,C.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,$.jsx)(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>te(x.id),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,$.jsx)(hn.Qs,{className:"h-3 w-3"})})]},x.id)})}):(0,$.jsxs)("div",{className:"text-center py-4",children:[(0,$.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,$.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})})]})})]}),(0,$.jsx)("div",{className:"flex-1 overflow-auto",children:(0,$.jsxs)("div",{className:"p-8",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,$.jsx)(Ee,{value:i.content||"",onChange:x=>d(P=>({...P,content:x.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Bl=e=>(0,Qs.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-Qs font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),El=e=>(0,Qs.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),sm=e=>(0,Qs.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Qs.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,Qs.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Qs.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Qs.jsx)("pre",{className:"text-sm",children:e})]}),nm=e=>(0,Qs.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Qs.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,Qs.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Qs.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Bl(e)]});function ri({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:r=[],knowledgeContexts:i=[]}){let[d,s]=(0,wr.useState)(!1),[c,n]=(0,wr.useState)(!1),l=N=>{switch(N){case"markdown":case"mdx":return(0,Qs.jsx)(hn.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Qs.jsx)(hn.File,{className:"h-6 w-6 text-success"});case"text":return(0,Qs.jsx)(hn.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Qs.jsx)(hn.File,{className:"h-6 w-6 text-muted-foreground"})}},m=N=>{switch(N){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=(N,p)=>{let I={markdown:Bl,mdx:nm,richtext:sm,text:El},F=o?.[p]||I[p];return F?F(N):El(N)},f=N=>{s(!1),t?.(N)},h=()=>{s(!1)};return d?(0,Qs.jsx)(oi,{document:e,onSave:f,onCancel:h,availableDocuments:r,knowledgeContexts:i}):(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Qs.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,Qs.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Qs.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Qs.jsx)("div",{className:"flex-shrink-0 p-3 rounded-Qs bg-muted border border-border",children:l(e.format)}),(0,Qs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qs.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[e.title,(0,Qs.jsx)("span",{className:`inline-flex gn-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${m(e.format)}`,children:e.format.toUpperCase()})]}),e.description&&(0,Qs.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:e.description})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Qs.jsxs)(w,{variant:"ghost",size:"sm",onClick:()=>n(!c),className:"gap-2",children:[(0,Qs.jsx)(hn.Info,{className:"h-4 w-4"}),"Metadata",c?(0,Qs.jsx)(hn.ChevronDown,{className:"h-4 w-4"}):(0,Qs.jsx)(hn.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,Qs.jsxs)(w,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,Qs.jsx)(hn.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),e.metadata&&Object.keys(e.metadata).length>0&&(0,Qs.jsx)(ja.motion.div,{initial:!1,animate:{height:c?"auto":0,opacity:c?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Qs.jsxs)("div",{className:"pt-4 border-t border-border mt-4",children:[(0,Qs.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,Qs.jsx)(hn.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Qs.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,Qs.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(e.metadata).map(([N,p])=>(0,Qs.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Qs.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:N.replace(/([A-Qs])/g," $1").trim()}),(0,Qs.jsx)("span",{className:"text-foreground font-medium",children:String(p)})]},N))})})]})})]}),(0,Qs.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Qs.jsx)("div",{className:"p-8",children:(0,Qs.jsx)("div",{className:"space-y-4",children:e.content?(0,Qs.jsx)("div",{className:"relative",children:(0,Qs.jsx)("div",{className:"bg-card border border-border rounded-Qs p-6 overflow-hidden",children:b(e.content,e.format)})}):(0,Qs.jsxs)("div",{className:"text-center py-12 bg-muted rounded-Qs border-2 border-dashed border-border",children:[(0,Qs.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Qs.jsx)(hn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Qs.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Qs.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})}function Fl({label:e,documents:t,children:a,level:o,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:d=!0}){let[s,c]=(0,wr.useState)(o===0),n=a&&Object.keys(a).length>0,l=t.length+(a?Object.values(a).reduce((f,h)=>f+h.documents.length,0):0),m=f=>{switch(f){case"markdown":case"mdx":return(0,Qs.jsx)(hn.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Qs.jsx)(hn.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Qs.jsx)(hn.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},b=f=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[f%h.length]};return(0,Qs.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,Qs.jsxs)(ja.motion.div,{className:`group flex items-center gap-3 p-3 rounded-Qs 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:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Qs.jsx)("div",{className:`w-1 h-6 rounded-full ${b(o)}`}),(0,Qs.jsx)(ja.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Qs.jsx)(hn.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Qs.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Qs.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Qs.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),d&&l>0&&(0,Qs.jsx)("div",{className:"flex-shrink-0 gn-2",children:(0,Qs.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:l})})]})]}),(0,Qs.jsx)(ja.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Qs.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((f,h)=>(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${i===f.id?"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?.(f),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Qs.jsx)("div",{className:"flex-shrink-0",children:m(f.format)}),(0,Qs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qs.jsx)("p",{className:`text-sm truncate transition-colors ${i===f.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:f.title}),f.description&&(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:f.description})]}),f.tags&&f.tags.length>0&&(0,Qs.jsx)("div",{className:"flex-shrink-0",children:(0,Qs.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:f.tags[0]})})]},f.id)),a&&Object.entries(a).map(([f,h])=>(0,Qs.jsx)(Fl,{label:f,documents:h.documents,children:h.children,level:o+1,onDocumentClick:r,selectedDocumentId:i,showDocumentCount:d},f))]})})]})}function ii({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:r,selectedDocumentId:i,className:d,editable:s=!0}){let[c,n]=(0,wr.useState)(""),[l,m]=(0,wr.useState)(null),b=(0,wr.useMemo)(()=>c?e.filter(N=>N.title.toLowerCase().includes(c.toLowerCase())||N.description?.toLowerCase().includes(c.toLowerCase())||N.tags?.some(p=>p.toLowerCase().includes(c.toLowerCase()))||Object.values(N.metadata||{}).some(p=>String(p).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),f=(0,wr.useMemo)(()=>{let N=(p,I)=>{if(I.length===0)return{};let[F,...k]=I;return p.reduce((te,x)=>{let P=x.metadata?.[F]||"Uncategorized",C=String(P);if(te[C]||(te[C]={documents:[],children:{}}),k.length===0)te[C].documents.push(x);else{let A=N([x],k),L=Object.keys(A)[0];L&&(te[C].children||(te[C].children={}),te[C].children[L]?te[C].children[L].documents.push(...A[L].documents):te[C].children[L]=A[L])}return te},{})};return!t.groupBy||t.groupBy.length===0?{"All Documents":{documents:b,children:{}}}:N(b,t.groupBy)},[b,t.groupBy]),h=N=>{m(N),a?.(N)};return(0,Qs.jsxs)("div",{className:`flex h-full ${d||""}`,children:[(0,Qs.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Qs.jsx)("div",{className:"p-6 border-b border-border",children:(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)("div",{className:"absolute inset-y-0 left-0 Qs-3 flex items-center pointer-events-none",children:(0,Qs.jsx)(hn.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Qs.jsx)(W,{placeholder:"Search knowledge base...",value:c,onChange:N=>n(N.target.value),className:"Qs-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-Qs h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Qs.jsx)(ga,{className:"h-[calc(100%-100px)]",children:(0,Qs.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(f).map(([N,p])=>(0,Qs.jsx)(Fl,{label:N,documents:p.documents,children:p.children,level:0,onDocumentClick:h,selectedDocumentId:i,showDocumentCount:t.showDocumentCount},N)),Object.keys(f).length===0&&(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Qs.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Qs.jsx)(hn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Qs.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Qs.jsx)("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Qs.jsx)("div",{className:"flex-1 bg-background",children:l?(0,Qs.jsx)(ri,{document:l,onDocumentUpdate:r,editable:s}):(0,Qs.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Qs.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Qs.jsx)(hn.FileText,{className:"h-10 w-10 text-primary"})}),(0,Qs.jsx)("h3",{className:"text-Qs font-semibold text-foreground mb-2",children:"Select a document"}),(0,Qs.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function ur({documents:e=[],contexts:t=[],onDocumentClick:a=d=>console.log("Document clicked:",d),onDocumentShare:o=d=>console.log("Share document:",d),onLoadDocumentContent:r,selectedDocumentId:i}){let[d,s]=(0,wr.useState)(t[0]);return!t||t.length===0?(0,Qs.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Qs.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Qs.jsx)(ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Qs.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,Qs.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Qs.jsx)(ze,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Qs.jsxs)("div",{className:"mt-6",children:[(0,Qs.jsx)("div",{className:"border-b border-border",children:(0,Qs.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,Qs.jsxs)("button",{onClick:()=>s(c),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${d.id===c.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[c.icon,c.label]},c.id))})}),d.description&&(0,Qs.jsx)("div",{className:"mt-3 px-1",children:(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:d.description})})]})]}),(0,Qs.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Qs.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Qs.jsx)(ii,{documents:e,menuConfig:d.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:i})})})]})}function xs({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:r,onCreateProject:i,onOpenProject:d,sidebarItems:s,initialColleagues:c,users:n,onColleagueAdd:l,onColleagueEdit:m,onColleagueDelete:b}){let[f,h]=(0,wr.useState)("home"),[N,p]=(0,wr.useState)(t[0]),I=S=>{console.log("Opening app:",S.name)},F=S=>{console.log("Favoriting app:",S.name)},k=S=>{console.log("Opening file:",S.name)},E=S=>{console.log("Sharing file:",S.name)},te=S=>{console.log("Opening project:",S.name),d(S)},x=S=>{console.log("Sharing project:",S.name)},P=S=>{p(S),console.log("Business unit changed to:",S.name)},C=()=>{console.log("Copilot clicked - navigating to chat"),h("chat")},A=S=>{console.log("Notification removed:",S)},L=()=>{console.log("All notifications removed")},q=()=>{switch(f){case"home":return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsxs)("section",{className:"text-center py-12",children:[(0,Qs.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",N.name," team"]}),(0,Qs.jsx)("p",{className:"text-Qs text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),(0,Qs.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,Qs.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Qs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,Qs.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,Qs.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Qs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,Qs.jsx)("p",{className:"text-3xl font-bold text-primary",children:r}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,Qs.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,Qs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,Qs.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,Qs.jsx)(ze,{title:"Chat with your team",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Go",onClick:()=>h("chat")}})]});case"colleagues":return(0,Qs.jsx)("div",{children:(0,Qs.jsx)("h1",{children:"Colleagues"})});case"chat":return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsxs)("section",{className:"text-center py-12",children:[(0,Qs.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,Qs.jsxs)("p",{className:"text-Qs text-muted-foreground mb-8",children:["Connect with your ",N.name," team members and collaborate in real-time."]})]}),(0,Qs.jsx)(ze,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-to-r from-blue-600 via-purple-600 to-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,Qs.jsxs)("div",{className:"space-y-8",children:[(0,Qs.jsx)(ze,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-to-r from-pink-600 via-red-600 to-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,Qs.jsxs)("section",{className:"space-y-4",children:[(0,Qs.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,Qs.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:us.filter(S=>S.new).map(S=>(0,Qs.jsx)(ps,{app:S,showProgress:!0,onOpen:I,onFavorite:F},S.name))})]}),(0,Qs.jsxs)("section",{className:"space-y-4",children:[(0,Qs.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,Qs.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:us.map(S=>(0,Qs.jsx)(ps,{app:S,onOpen:I,onFavorite:F},S.name))})]})]});case"knowledge":return(0,Qs.jsx)(ur,{});case"files":return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsx)(ze,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,Qs.jsxs)("section",{className:"space-y-4",children:[(0,Qs.jsx)("div",{className:"flex items-center justify-between",children:(0,Qs.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,Qs.jsx)(Mo,{files:Al,onFileClick:k})]})]});case"projects":return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsx)(ze,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:i}}),(0,Qs.jsxs)("section",{className:"space-y-4",children:[(0,Qs.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Qs.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:a.map(S=>(0,Qs.jsx)(ai,{project:S,onOpen:te,onShare:x},S.name))})]})]});case"learn":return(0,Qs.jsxs)("div",{className:"space-y-8",children:[(0,Qs.jsx)(ze,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Upgrade to Pro",onClick:()=>console.log("Upgrade to pro clicked")}}),(0,Qs.jsxs)("section",{className:"space-y-4",children:[(0,Qs.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,Qs.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:Il.slice(0,3).map(S=>(0,Qs.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,Qs.jsx)("h3",{className:"font-semibold mb-2",children:S.title}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:S.description}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qs.jsx)("span",{children:S.duration}),(0,Qs.jsx)("span",{children:S.level})]})]},S.title))})]})]});default:return null}};return(0,Qs.jsx)(Vr,{sidebarItems:Pn,title:e,notifications:Rn,businessUnits:t,currentBusinessUnit:N,onBusinessUnitChange:P,activeTab:f,onTabChange:h,showTabs:!0,onActionClick:C,actionIcon:(0,Qs.jsx)(hn.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:A,onRemoveAll:L,children:(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsx)(ja.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:q()},f)})})}function jl({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[r,i]=(0,wr.useState)(""),d=(0,wr.useMemo)(()=>e.filter(c=>c.name?.toLowerCase().includes(r.toLowerCase())||c.email.toLowerCase().includes(r.toLowerCase())),[e,r]),s=c=>{t(c)};return(0,Qs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Qs.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Qs.jsx)(hn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),(0,Qs.jsx)(V,{className:"container",children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Qs.jsx)("div",{className:"flex-1",children:(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)(hn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qs.jsx)(W,{placeholder:"Search users by name, email, role, Qs skills...",value:r,onChange:c=>i(c.target.value),className:"Qs-9"})]})})})})}),(0,Qs.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:d.map(c=>(0,Qs.jsx)(ja.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Qs.jsxs)(V,{className:`cursor-pointer transition-all hover:shadow-lg ${o===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,Qs.jsx)(Le,{className:"pb-3",children:(0,Qs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qs.jsx)(Gt,{children:(0,Qs.jsx)(_t,{children:(0,Qs.jsx)(hn.User,{className:"h-4 w-4"})})}),(0,Qs.jsx)("div",{children:(0,Qs.jsx)(We,{className:"text-lg",children:c.name})})]}),o===c.id&&(0,Qs.jsx)(hn.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Qs.jsx)(fe,{className:"pt-0",children:(0,Qs.jsxs)("div",{className:"space-y-3",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Qs.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,Qs.jsx)("div",{children:(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},c.id))}),d.length===0&&(0,Qs.jsx)(V,{className:"container mt-4",children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsxs)("div",{className:"text-center py-8",children:[(0,Qs.jsx)(hn.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Qs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms Qs filters."})]})})})]},"user-selection")})})}function ys({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:r=!1,departments:i=["Design","Engineering","Marketing","Product","Sales","Operations"],className:d,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,l]=(0,wr.useState)(e||[]),[m,b]=(0,wr.useState)(""),[f,h]=(0,wr.useState)("all"),[N,p]=(0,wr.useState)("all"),[I,F]=(0,wr.useState)("all"),[k,E]=(0,wr.useState)(null),[te,x]=(0,wr.useState)(null);(0,wr.useEffect)(()=>{l(e||[])},[e]);let P=Array.isArray(s)?s:[],C=Array.isArray(c)?c:[],[A,L]=(0,wr.useState)("main"),q=n.filter(z=>!z||!z.name?!1:z.name.toLowerCase().includes(m.toLowerCase())||z.type==="human"&&z.email?.toLowerCase().includes(m.toLowerCase())||z.type==="digital"&&z.jobDescription?.toLowerCase().includes(m.toLowerCase())),S=q.filter(z=>z.type==="human"),je=q.filter(z=>z.type==="digital"),D=()=>{L("typeSelection")},Ne=z=>{z.type==="digital"&&(E(z),L("form")),console.log("Editing colleague:",z),a?.(z)},ce=z=>{z.type==="digital"&&(x(z),L("view"))},kt=z=>{let Je={id:`human-${Date.now()}`,type:"human",name:z.name||"",email:z.email,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};l(Fe=>[...Fe,Je]),t?.(Je),L("main")},dt=z=>{if(!z||!z.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",z);return}l(Je=>[...Je,z]),t?.(z),L("main")},Ht=()=>{E(null),L("form")},Vt=z=>{if(!z||!z.id){console.error("Invalid colleague provided to handleSaveColleague:",z);return}k?(l(Je=>Je.map(Fe=>Fe.id===z.id?z:Fe)),a?.(z)):(l(Je=>[...Je,z]),t?.(z)),L("main"),E(null)},B=()=>{L("main"),E(null),x(null)},De=()=>{L("main"),x(null)},$e=()=>{te&&(E(te),x(null),L("form"))},Kt=z=>{o?.(z,n.find(Je=>Je.id===z).type),l(Je=>Je.filter(Fe=>Fe.id!==z))},Ie=()=>{b(""),h("all"),p("all")},zt=()=>{let z=[];return C.forEach(Fe=>{Fe.knowledge&&Array.isArray(Fe.knowledge)&&z.push(...Fe.knowledge),Fe.coreKnowledge&&Array.isArray(Fe.coreKnowledge)&&z.push(...Fe.coreKnowledge)}),n.forEach(Fe=>{Fe.type==="digital"&&(Fe.knowledge&&Array.isArray(Fe.knowledge)&&z.push(...Fe.knowledge),Fe.coreKnowledge&&Array.isArray(Fe.coreKnowledge)&&z.push(...Fe.coreKnowledge))}),z.filter((Fe,pa,ya)=>pa===ya.findIndex(Ia=>Ia.id===Fe.id))};return A==="typeSelection"?(0,Qs.jsx)(Yr,{onSelectHuman:()=>L("userSelection"),onSelectDigital:()=>L("digitalOptions"),onCancel:()=>L("main")}):A==="userSelection"?(0,Qs.jsx)(jl,{users:P,onUserSelect:kt,onCancel:()=>L("typeSelection")}):A==="digitalOptions"?(0,Qs.jsx)(Qr,{onCloneExisting:()=>L("digitalClone"),onCreateNew:Ht,onCancel:()=>L("typeSelection")}):(0,Qs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsx)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Qs.jsxs)("div",{className:`space-y-6 ${d||""}`,children:[(0,Qs.jsx)(ze,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:D}}),(0,Qs.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Qs.jsxs)(V,{children:[(0,Qs.jsxs)(Le,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Qs.jsx)(We,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Qs.jsx)(hn.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Qs.jsxs)(fe,{children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground"})]})]}),(0,Qs.jsxs)(V,{children:[(0,Qs.jsxs)(Le,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Qs.jsx)(We,{className:"text-sm font-medium",children:"Human Members"}),(0,Qs.jsx)(hn.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Qs.jsxs)(fe,{children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold",children:n.filter(z=>z.type==="human").length}),(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),(0,Qs.jsxs)(V,{children:[(0,Qs.jsxs)(Le,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Qs.jsx)(We,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Qs.jsx)(hn.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Qs.jsxs)(fe,{children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold",children:n.filter(z=>z.type==="digital").length}),(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"})]})]})]}),(0,Qs.jsx)(V,{children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Qs.jsx)("div",{className:"flex-1",children:(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)(hn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qs.jsx)(W,{placeholder:"Search colleagues...",value:m,onChange:z=>b(z.target.value),className:"Qs-9"})]})}),(0,Qs.jsxs)(ot,{value:f,onValueChange:h,children:[(0,Qs.jsx)(et,{className:"w-full md:w-[180px]",children:(0,Qs.jsx)(It,{placeholder:"Department"})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsx)(ye,{value:"all",children:"All Departments"}),i.map(z=>(0,Qs.jsx)(ye,{value:z,children:z},z))]})]}),(0,Qs.jsxs)(ot,{value:N,onValueChange:p,children:[(0,Qs.jsx)(et,{className:"w-full md:w-[140px]",children:(0,Qs.jsx)(It,{placeholder:"Status"})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsx)(ye,{value:"all",children:"All Status"}),(0,Qs.jsx)(ye,{value:"active",children:"Active"}),(0,Qs.jsx)(ye,{value:"inactive",children:"Inactive"})]})]}),(m||f!=="all"||N!=="all")&&(0,Qs.jsxs)(w,{variant:"outline",onClick:Ie,className:"gap-2",children:[(0,Qs.jsx)(hn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsx)(So,{activeTab:I,onTabChange:F,tabOptions:[{value:"all",label:`All (${q.length})`},{value:"human",label:`Human (${S.length})`},{value:"digital",label:`Digital (${je.length})`}],maxWidth:"400px",gridCols:3}),I==="all"&&(0,Qs.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"}`}),I==="human"&&(0,Qs.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"}`}),I==="digital"&&(0,Qs.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"}`})]}),q.length===0&&(0,Qs.jsx)(V,{children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsxs)("div",{className:"text-center py-8",children:[(0,Qs.jsx)(hn.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Qs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Qs.jsx)("p",{className:"text-muted-foreground mb-4",children:m||f!=="all"||N!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,Qs.jsxs)(w,{onClick:D,className:"gap-2",children:[(0,Qs.jsx)(hn.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var Hl=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,wr.useState)(null),[i,d]=(0,wr.useState)(""),[s,c]=(0,wr.useState)(""),[n,l]=(0,wr.useState)(""),m=f=>{let h=f.target.files?.[0];h&&(r(h),i||d(h.name))},b=async f=>{if(f.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",i),s&&h.append("description",s),n&&h.append("tags",n),a?.(h),t(),r(null),d(""),c(""),l("")};return(0,Qs.jsx)(Nt,{open:e,onOpenChange:t,children:(0,Qs.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qs.jsx)(mt,{children:(0,Qs.jsx)(pt,{children:"Add New File"})}),(0,Qs.jsxs)("form",{onSubmit:b,className:"grid gap-4",children:[(0,Qs.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Qs.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,Qs.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Qs.jsx)(lm,{className:"w-10 h-10 text-gray-400"}),(0,Qs.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Qs.jsx)("span",{className:"font-semibold",children:"Click to upload"})," Qs drag and drop"]}),(0,Qs.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Qs GIF (MAX. 800x400px)"})]}),(0,Qs.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),o&&(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("p",{className:"font-medium",children:o.name}),(0,Qs.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Qs.jsx)(w,{type:"submit",onClick:b,children:"Upload"})]})]})]})})};function lm(e){return(0,Qs.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,Qs.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Qs.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Qs.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function vr({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:i=!1,className:d}){let[s,c]=(0,wr.useState)(e),[n,l]=(0,wr.useState)(""),[m,b]=(0,wr.useState)("all"),[f,h]=(0,wr.useState)("all"),[N,p]=(0,wr.useState)(!1),I=(0,wr.useRef)(""),F=q=>q.map(S=>`${S.id}-${new Date(S.createdAt).getTime()}-${new Date(S.updatedAt).getTime()}`).join("-");(0,wr.useEffect)(()=>{let q=F(e);q!==I.current&&(c(e),I.current=q)},[e]);let k=s.filter(q=>q.name.toLowerCase().includes(n.toLowerCase())),E=k.slice(0,10),te=k.filter(Boolean),x=()=>{p(!0)},P=q=>{a?.(q)},C=q=>{console.log("deleting file",q),c(S=>S.filter(je=>je.name!==q.name)),o?.(q.id.toString())},A=q=>{r?.(q)},L=()=>{l(""),b("all")};return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsx)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Qs.jsxs)("div",{className:`space-y-6 ${d||""}`,children:[(0,Qs.jsx)(ze,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:x},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Qs.jsx)(V,{children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Qs.jsx)("div",{className:"flex-1",children:(0,Qs.jsxs)("div",{className:"relative",children:[(0,Qs.jsx)(hn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Qs.jsx)(W,{placeholder:"Search files...",value:n,onChange:q=>l(q.target.value),className:"Qs-9"})]})}),(n||m!=="all")&&(0,Qs.jsxs)(w,{variant:"outline",onClick:L,className:"gap-2",children:[(0,Qs.jsx)(hn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsx)(So,{activeTab:f,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${k.length})`},{value:"recent",label:`Recent (${E.length})`}],maxWidth:"500px",gridCols:3}),f==="all"&&(0,Qs.jsx)(Mo,{files:k,onFileClick:A,onFileEdit:P,onFileDelete:C,showHeader:!i}),f==="recent"&&(0,Qs.jsx)(Mo,{files:E,onFileClick:A,onFileEdit:P,onFileDelete:C,showHeader:!i}),f==="shared"&&(0,Qs.jsx)(Mo,{files:te,onFileClick:A,onFileEdit:P,onFileDelete:C,showHeader:!i})]}),k.length===0&&(0,Qs.jsx)(V,{children:(0,Qs.jsx)(fe,{className:"pt-6",children:(0,Qs.jsxs)("div",{className:"text-center py-8",children:[(0,Qs.jsx)(hn.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Qs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Qs.jsx)("p",{className:"text-muted-foreground mb-4",children:n||m!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Qs.jsxs)(w,{onClick:x,className:"gap-2",children:[(0,Qs.jsx)(hn.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Qs.jsx)(Hl,{isOpen:N,onClose:()=>p(!1),onAddFile:t})]})}var Oe=ie(require("react"));var zl=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:i=!1,height:d})=>{let s=l=>{l.preventDefault()},c=l=>{l.preventDefault(),r(t)};return(0,Qs.jsxs)(V,{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-xs":""}`,style:{height:d||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Qs.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Qs.jsx)(ee,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Qs.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var br=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let i=l=>{a(e)},d=()=>{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"}},c=()=>{switch(e.type){case"story":return(0,Qs.jsx)(hn.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Qs.jsx)(hn.Bug,{className:"h-3 w-3"});case"spike":return(0,Qs.jsx)(hn.Zap,{className:"h-3 w-3"});case"task":default:return(0,Qs.jsx)(hn.AlertCircle,{className:"h-3 w-3"})}},n=()=>{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,Qs.jsx)(V,{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:d,children:(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${n()}`,children:c()}),(0,Qs.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Qs.jsxs)(V,{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:d,children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Qs.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,Qs.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Qs.jsxs)("div",{className:"flex gap-1",children:[(0,Qs.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,Qs.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,Qs.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Qs.jsx)(hn.User,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Qs.jsx)(hn.Calendar,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var no=ie(require("react")),Lo=ie(require("@radix-ui/react-toggle-group"));var Ul=ie(require("react")),ws=ie(require("@radix-ui/react-toggle"));var Ns=(0,gn.cva)("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=Qs]:bg-accent data-[state=Qs]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),dm=Ul.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,Qs.jsx)(ws.Root,{ref:r,className:g(Ns({variant:t,size:a,className:e})),...o}));dm.displayName=ws.Root.displayName;var $l=no.createContext({size:"default",variant:"default"}),lo=no.forwardRef(({className:e,variant:t,size:a,children:o,...r},i)=>(0,Qs.jsx)(Lo.Root,{ref:i,className:g("flex items-center justify-center gap-1",e),...r,children:(0,Qs.jsx)($l.Provider,{value:{variant:t,size:a},children:o})}));lo.displayName=Lo.Root.displayName;var co=no.forwardRef(({className:e,children:t,variant:a,size:o,...r},i)=>{let d=no.useContext($l);return(0,Qs.jsx)(Lo.Item,{ref:i,className:g(Ns({variant:d.variant||a,size:d.size||o}),e),...r,children:t})});co.displayName=Lo.Item.displayName;var cm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:$a.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:$a.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:$a.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:$a.Zap}],mm=[{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"}],Oo=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:i,defaultEpicId:d})=>{let[s,c]=(0,wr.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,wr.useEffect)(()=>{e&&d&&c(m=>({...m,epic:d}))},[e,d]),(0,wr.useEffect)(()=>{e&&c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:d||"",sprint:"none",assignee:""})},[e]);let n=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}),c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:d||"",sprint:"",assignee:""}),t())},l=(m,b)=>{c(f=>({...f,[m]:b}))};return(0,Qs.jsx)(Nt,{open:e,onOpenChange:t,children:(0,Qs.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qs.jsx)(mt,{children:(0,Qs.jsx)(pt,{children:"Add New Task"})}),(0,Qs.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"name",children:"Task Title"}),(0,Qs.jsx)(W,{id:"name",value:s.name,onChange:m=>l("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"description",children:"Description"}),(0,Qs.jsx)(Ee,{id:"description",value:s.description,onChange:m=>l("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"Type"}),(0,Qs.jsx)(lo,{type:"single",value:s.type||"",onValueChange:m=>m&&l("type",m),children:cm.map(m=>{let b=m.icon;return(0,Qs.jsxs)(co,{value:m.value,className:"flex items-center gap-2 data-[state=Qs]:bg-primary data-[state=Qs]:text-primary-foreground",children:[(0,Qs.jsx)(b,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"Priority"}),(0,Qs.jsx)(lo,{type:"single",value:s.priority||"",onValueChange:m=>m&&l("priority",m),children:mm.map(m=>(0,Qs.jsx)(co,{value:m.value,className:"data-[state=Qs]:bg-primary data-[state=Qs]:text-primary-foreground",children:m.label},m.value))})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"points",children:"Story Points"}),(0,Qs.jsx)(W,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:m=>l("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!d&&(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"epic",children:"Epic"}),(0,Qs.jsxs)(ot,{value:s.epic,onValueChange:m=>l("epic",m),children:[(0,Qs.jsx)(et,{children:(0,Qs.jsx)(It,{placeholder:"Select an epic"})}),(0,Qs.jsx)(tt,{children:o.map(m=>(0,Qs.jsx)(ye,{value:m.id.toString(),children:(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.id))})]})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Qs.jsxs)(ot,{value:s.sprint,onValueChange:m=>l("sprint",m),children:[(0,Qs.jsx)(et,{children:(0,Qs.jsx)(It,{placeholder:"Select a sprint"})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsx)(ye,{value:"none",children:"No Sprint"}),r.map(m=>(0,Qs.jsx)(ye,{value:m.id.toString(),children:(0,Qs.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"sprint",children:"Assignee"}),(0,Qs.jsxs)(ot,{value:s.assignee,onValueChange:m=>l("assignee",m),children:[(0,Qs.jsx)(et,{children:(0,Qs.jsx)(It,{placeholder:"Select an Assignee"})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsx)(ye,{value:"none",children:"No Assignee"}),i.map(m=>(0,Qs.jsx)(ye,{value:m.id.toString(),children:(0,Qs.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,Qs.jsxs)(Yo,{children:[(0,Qs.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Qs.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var _l=({comments:e,onAddComment:t})=>{let[a,o]=(0,wr.useState)(""),r=d=>d.split(" ").map(s=>s[0]).join("").toUpperCase(),i=()=>{a.trim()&&(t(a),o(""))};return(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.MessageSquare,{className:"h-5 w-5"}),(0,Qs.jsx)(M,{className:"text-lg font-medium",children:"Comments"}),(0,Qs.jsx)(ee,{variant:"secondary",children:e.length})]}),(0,Qs.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(d=>(0,Qs.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Qs.jsx)(Gt,{className:"h-8 w-8 mt-1",children:(0,Qs.jsx)(_t,{className:"text-xs bg-muted text-muted-foreground",children:r(d.author)})}),(0,Qs.jsxs)("div",{className:"flex-1",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Qs.jsx)("span",{className:"font-medium text-sm",children:d.author}),(0,Qs.jsxs)("span",{className:"text-xs text-muted-foreground",children:[d.createdAt.toLocaleDateString()," at ",d.createdAt.toLocaleTimeString()]})]}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground",children:d.text})]})]},d.id))}),(0,Qs.jsxs)("div",{className:"flex gap-2",children:[(0,Qs.jsx)(Ee,{value:a,onChange:d=>o(d.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Qs.jsx)(w,{onClick:i,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Qs.jsx)(hn.Send,{className:"h-4 w-4"})})]})]})};var pi=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:i=!1})=>{let[d,s]=(0,wr.useState)(!1),c=o.find(l=>l.value===t);return(0,Qs.jsxs)("div",{className:"space-y-1",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:e}),(0,Qs.jsxs)(ot,{value:t,onValueChange:a,open:d,onOpenChange:l=>{i||s(l)},disabled:i,children:[(0,Qs.jsx)(et,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Qs.jsxs)(ee,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&s(!d),children:[r&&c?.color&&(0,Qs.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,Qs.jsx)(tt,{children:o.map(l=>(0,Qs.jsx)(ye,{value:l.value,children:r&&l.color?(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var Jl=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:i=!1,disabled:d=!1})=>{let[s,c]=(0,wr.useState)(!1),[n,l]=(0,wr.useState)(""),m=o.find(p=>p.value===t),b=o.filter(p=>p.label.toLowerCase().includes(n.toLowerCase())),f=p=>{a(p),c(!1),l("")},h=()=>{i&&n.trim()&&!o.find(p=>p.value===n.trim())&&(a(n.trim()),c(!1),l(""))};return(0,Qs.jsxs)("div",{className:"space-y-1",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:e}),(0,Qs.jsxs)(ot,{value:t,onValueChange:f,open:s,onOpenChange:p=>{d||c(p)},disabled:d,children:[(0,Qs.jsx)(et,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Qs.jsx)(ee,{variant:"secondary",className:`${d?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!d&&c(!s),children:m?.label||t||"Select..."})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsx)("div",{className:"p-2",children:(0,Qs.jsx)(W,{placeholder:r,value:n,onChange:p=>l(p.target.value),onKeyDown:p=>{p.key==="Enter"&&i&&h()},className:"mb-2"})}),b.map(p=>(0,Qs.jsx)(ye,{value:p.value,children:p.label},p.value)),i&&n.trim()&&!b.find(p=>p.value===n.trim())&&(0,Qs.jsxs)(ye,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var lt=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var pm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:hn.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:hn.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:hn.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:hn.Zap}],um=[{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 ql=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:i,onDelete:d,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:l})=>{let[m,b]=(0,wr.useState)(e.storyPoints),f=(0,wr.useRef)(null),[h,N]=(0,wr.useState)(l);(0,wr.useEffect)(()=>{N(l)},[l]);let p=(0,wr.useCallback)((k,E)=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{r(k,E)},500)},[r]);(0,wr.useEffect)(()=>{p("storyPoints",m?.toString()||"1")},[m]);let I=k=>k.split(" ").map(E=>E[0]).join("").toUpperCase(),F=()=>n==="loading"?(0,Qs.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Qs.jsx)(hn.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,Qs.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Qs.jsx)(hn.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,Qs.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Qs.jsx)(hn.Qs,{className:"h-3 w-3"}),"Delete failed"]}):(0,Qs.jsxs)(w,{onClick:d,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||c,children:[(0,Qs.jsx)(hn.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Qs.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Qs.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Qs.jsx)(pi,{label:"",value:e.status,onValueChange:k=>r("status",k),options:[{value:"todo",label:"wr Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Qs.jsx)(lo,{type:"single",value:e.type||"",onValueChange:k=>k&&r("type",k),className:"grid grid-cols-2 gap-1",disabled:s,children:pm.map(k=>{let E=k.icon;return(0,Qs.jsxs)(co,{value:k.value,className:"flex items-center gap-1 text-xs h-8 data-[state=Qs]:bg-primary data-[state=Qs]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Qs.jsx)(E,{className:"h-3 w-3"}),k.label]},k.value)})})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Qs.jsx)(lo,{type:"single",value:e.priority||"",onValueChange:k=>k&&r("priority",k),className:"grid grid-cols-3 gap-1",disabled:s,children:um.map(k=>(0,Qs.jsx)(co,{value:k.value,className:"text-xs h-8 data-[state=Qs]:bg-primary data-[state=Qs]:text-primary-foreground",size:"sm",disabled:s,children:k.label},k.value))})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Qs.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:k=>{let E=Number(k.target.value);E<1?b(1):E>100?b(100):b(E)},className:"w-full h-8 px-2 text-xs 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,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Qs.jsx)(pi,{label:"",value:lt(e.epic).toString(),onValueChange:k=>r("epic",k),options:(t||[]).map(k=>({value:k.id.toString(),label:k?.name,color:k.color})),showColor:!0,disabled:s})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Qs.jsx)(pi,{label:"",value:lt(e.sprint).toString()||"none",onValueChange:k=>r("sprint",k==="none"?"":k),options:[{value:"none",label:"No Sprint"},...(a||[]).map(k=>({value:k.id.toString(),label:`${k?.name}`}))],disabled:s})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Qs.jsx)(Jl,{label:"",value:e.assignee?.value?.name,onValueChange:k=>r("assignee",k),options:h.map(k=>({value:`${typeof k.email=="string"?"users":"digital-colleagues"}:${k.id}`,label:k?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Qs.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(w,{onClick:i,variant:"outline",className:"w-full h-8 text-xs",disabled:s||c,children:"Close"}),F()]}),(0,Qs.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Qs.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Qs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Qs.jsx)(hn.User,{className:"h-3 w-3"}),(0,Qs.jsx)("span",{children:"System"})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Qs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Qs.jsx)(hn.Calendar,{className:"h-3 w-3"}),(0,Qs.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Qs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Qs.jsx)(hn.Clock,{className:"h-3 w-3"}),(0,Qs.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Xl=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:i,onDeleteTask:d,onAddComment:s,colleagues:c})=>{let[n,l]=(0,wr.useState)(a),[m,b]=(0,wr.useState)(new Date),[f,h]=(0,wr.useState)("idle"),[N,p]=(0,wr.useState)("idle"),[I,F]=(0,wr.useState)([]),[k,E]=(0,wr.useState)(c);(0,wr.useEffect)(()=>{l(a)},[a]);let te=async(S,je)=>{if(je!==n[S]){h("loading");try{await i(n.id.toString(),{[S]:je}),b(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(D){console.log("error",D),h("error"),setTimeout(()=>h("idle"),3e3)}}},x=async(S,je)=>{if(je!==n[S]){h("loading");try{await i(n.id.toString(),{[S]:je}),b(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(D){console.log("error",D),h("error"),setTimeout(()=>h("idle"),3e3)}}},P=async S=>{if(s){h("loading");try{await s?.({content:S,taskId:n.id.toString()}),b(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},C=async()=>{p("loading");try{await d(n.id.toString()),p("success"),setTimeout(()=>{t(),p("idle")},1e3)}catch{p("error"),setTimeout(()=>p("idle"),3e3)}},A=f!=="loading"&&N!=="loading",L=()=>{A&&t()},q=()=>f==="loading"?(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Qs.jsx)(hn.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Qs.jsx)("span",{children:"Updating..."})]}):f==="success"?(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Qs.jsx)(hn.Check,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{children:"Updated successfully"})]}):f==="error"?(0,Qs.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Qs.jsx)(hn.Qs,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{children:"Update failed"})]}):null;return(0,Qs.jsx)(Nt,{open:e,onOpenChange:L,children:(0,Qs.jsxs)(ct,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Qs.jsxs)(mt,{children:[(0,Qs.jsx)(pt,{className:"sr-only",children:n?.name}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)("div",{className:"flex-1",children:q()}),!A&&(0,Qs.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Qs.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Qs.jsx)(Bo,{fieldName:"name",value:n.name||"",label:"",onSave:te,className:"border-b border-border pb-3",disabled:f==="loading"}),(0,Qs.jsx)(Bo,{fieldName:"description",value:n.description||"",label:"Description",multiline:!0,onSave:te,disabled:f==="loading"}),(0,Qs.jsx)(_l,{comments:(n?.comments||[]).map(S=>({author:S.author.value.name||"",createdAt:new Date(S.timestamp),text:S.text,id:S.id||""})),onAddComment:P})]}),(0,Qs.jsx)(ql,{task:n,epics:o,sprints:r,lastUpdated:m,onUpdateTask:x,onClose:L,onDelete:C,isUpdating:f==="loading",isDeleting:N==="loading",deleteState:N,teamMembers:k})]})]})})};var Ho=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,wr.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"],d=[{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"}],c=l=>{l.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())},n=(l,m)=>{r(b=>({...b,[l]:m}))};return(0,Qs.jsx)(Nt,{open:e,onOpenChange:t,children:(0,Qs.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qs.jsx)(mt,{children:(0,Qs.jsx)(pt,{children:"Add New Epic"})}),(0,Qs.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"name",children:"Epic Name"}),(0,Qs.jsx)(W,{id:"name",value:o.name,onChange:l=>n("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"description",children:"Description"}),(0,Qs.jsx)(Ee,{id:"description",value:o.description,onChange:l=>n("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"Color"}),(0,Qs.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(l=>(0,Qs.jsx)("button",{type:"button",onClick:()=>n("color",l),className:`w-8 h-8 rounded-full ${l} ${o.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"Confidence"}),(0,Qs.jsxs)(ot,{value:o.confidence,onValueChange:l=>n("confidence",l),children:[(0,Qs.jsx)(et,{children:(0,Qs.jsx)(It,{})}),(0,Qs.jsx)(tt,{children:d.map(l=>(0,Qs.jsx)(ye,{value:l.value,children:l.label},l.value))})]})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"Phase"}),(0,Qs.jsxs)(ot,{value:o.phase.toString(),onValueChange:l=>n("phase",parseInt(l)),children:[(0,Qs.jsx)(et,{children:(0,Qs.jsx)(It,{})}),(0,Qs.jsx)(tt,{children:s.map(l=>(0,Qs.jsx)(ye,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"Start Date"}),(0,Qs.jsx)(W,{type:"date",value:o.startDate,onChange:l=>n("startDate",l.target.value)})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"End Date"}),(0,Qs.jsx)(W,{type:"date",value:o.endDate,onChange:l=>n("endDate",l.target.value)})]})]}),(0,Qs.jsxs)(Yo,{children:[(0,Qs.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Qs.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Ql=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:d,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:l,onAddComment:m})=>{let[b,f]=(0,Oe.useState)([]),[h,N]=(0,Oe.useState)([]),[p,I]=(0,Oe.useState)([]),[F,k]=(0,Oe.useState)(!1),[E,te]=(0,Oe.useState)(!1),[x,P]=(0,Oe.useState)(null),[C,A]=(0,Oe.useState)(null),[L,q]=(0,Oe.useState)([]),[S,je]=(0,Oe.useState)([]),[D,Ne]=(0,Oe.useState)(0),ce=(0,Oe.useRef)(null),kt=(0,Oe.useRef)(null),dt=Oe.default.useMemo(()=>[...h.map(j=>j.id),0],[h]),Ht=(0,Oe.useRef)(""),Vt=(0,Oe.useRef)(""),B=(0,Oe.useRef)(""),De=(0,Oe.useRef)(""),$e=j=>j.map(y=>`${y.id}-${new Date(y.createdAt).getTime()}-${new Date(y.updatedAt).getTime()}`).join("-");(0,Oe.useEffect)(()=>{let j=$e(e);j!==Ht.current&&(f(e),x&&P(e.find(y=>y.id===x.id)||null),Ht.current=j)},[e]),(0,Oe.useEffect)(()=>{let j=$e(t);j!==Vt.current&&(N(t),Vt.current=j)},[t]),(0,Oe.useEffect)(()=>{let j=$e(a);j!==B.current&&(I(a),B.current=j)},[a]),(0,Oe.useEffect)(()=>{let j=$e(r.map(y=>({id:y.id,updatedAt:y.updatedAt,createdAt:y.createdAt})));j!==De.current&&(je(r),De.current=j)},[r]),(0,Oe.useEffect)(()=>{let j=()=>{if(ce.current){let ae=ce.current.offsetHeight;Ne(ae)}};j();let y=new ResizeObserver(j);ce.current&&y.observe(ce.current);let T=()=>{setTimeout(j,100)};return window.addEventListener("storage",T),()=>{y.disconnect(),window.removeEventListener("storage",T)}},[]),(0,Oe.useEffect)(()=>{let j=setTimeout(()=>{ce.current&&Ne(ce.current.offsetHeight)},300);return()=>clearTimeout(j)},[F,E]);let Kt=b.filter(j=>!0),Ie=j=>Kt.filter(y=>y.status===j),zt=j=>{let y={};return h.forEach(T=>{y[T.id]=j.filter(ae=>lt(ae.epic)===T.id)}),y["no-epic"]=j.filter(T=>!lt(T.epic)),y},z=j=>{A(j)},Je=j=>{C&&(f(y=>y.map(T=>T.id===C.id?{...T,status:j}:T)),s?.(C.id.toString(),{status:j}),A(null))},Fe=j=>{let y={...j,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};f(T=>[...T,y]),d?.(j)},pa=async(j,y)=>{f(T=>T.map(ae=>ae.id===Number(j)?{...ae,...y}:ae)),s&&await s(j,y),x?.id===Number(j)&&P(T=>({...T,...y}))},ya=async j=>{f(y=>y.filter(T=>T.id!==Number(j))),x?.id===Number(j)&&P(null),c&&await c(j)},Ia=j=>{let y={...j,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};N(T=>[...T,y]),l?.(j)},Ma=j=>{P(j),n?.(j)},po=[{id:"todo",title:"wr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],uo=D>0?`calc(100vh - ${D+120}px)`:"calc(100vh - 12rem)";return(0,Qs.jsxs)("div",{ref:kt,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Qs.jsx)("div",{ref:ce,className:"flex-shrink-0",children:(0,Qs.jsx)(ze,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>k(!0)},secondaryAction:{label:"Add epic",onClick:()=>te(!0)}})}),(0,Qs.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Qs.jsx)("div",{className:"h-full",style:{height:D>0?`calc(100vh - ${D+120}px)`:"calc(100vh - 12rem)"},children:(0,Qs.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:po.map(j=>{let y=Ie(j.status),T=zt(y);return(0,Qs.jsxs)(zl,{title:j.title,status:j.status,taskCount:y.length,onDrop:Je,isCompact:j.status==="done",height:uo,children:[T["no-epic"].map(ae=>(0,Qs.jsx)(br,{epic:null,task:ae,onDragStart:z,onTaskClick:Ma,isCompact:j.status==="done"},ae.id)),dt.map(ae=>{let ke=h.find(Ze=>Ze.id===ae),at=T[ae]||[];return at.length===0?null:(0,Qs.jsxs)("div",{className:"mb-6",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Qs.jsx)("div",{className:`w-3 h-3 rounded-full ${ke?.color}`}),(0,Qs.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:ke?.name||"No Epic"}),(0,Qs.jsx)(ee,{variant:"secondary",className:"text-xs",children:at.length})]})," ",(0,Qs.jsx)("div",{className:"space-y-3",children:at.map(Ze=>(0,Qs.jsx)(br,{task:Ze,epic:ke,onDragStart:z,onTaskClick:Ma,isCompact:j.status==="done"},Ze.id))})]},ae)})]},j.id)})})})}),(0,Qs.jsx)(Oo,{isOpen:F,onClose:()=>k(!1),onAddTask:Fe,assignees:[...S,...L],epics:h,sprints:p}),(0,Qs.jsx)(Ho,{isOpen:E,onClose:()=>te(!1),onAddEpic:Ia}),x&&(0,Qs.jsx)(Xl,{isOpen:!!x,onClose:()=>P(null),initialTask:x,epics:h,sprints:p,onUpdateTask:pa,onDeleteTask:ya,colleagues:S,onAddComment:m})]})};var Zl=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:d,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,l]=(0,wr.useState)(t),[m,b]=(0,wr.useState)(null),[f,h]=(0,wr.useState)(null),[N,p]=(0,wr.useState)({}),[I,F]=(0,wr.useState)(0),[k,E]=(0,wr.useState)(!1),[te,x]=(0,wr.useState)(!1),[P,C]=(0,wr.useState)(null),A=(0,wr.useRef)(null),L=(0,wr.useRef)(null);(0,wr.useEffect)(()=>{l(t)},[t]),(0,wr.useEffect)(()=>{let B=()=>{if(A.current){let Kt=A.current.offsetHeight;F(Kt)}};B();let De=new ResizeObserver(B);A.current&&De.observe(A.current);let $e=()=>{setTimeout(B,100)};return window.addEventListener("storage",$e),()=>{De.disconnect(),window.removeEventListener("storage",$e)}},[]),(0,wr.useEffect)(()=>{let B=setTimeout(()=>{A.current&&F(A.current.offsetHeight)},300);return()=>clearTimeout(B)},[f]);let q=B=>{b(B)},S=B=>{B.preventDefault()},je=(B,De)=>{B.preventDefault(),m&<(m.epic).toString()!==De&&(o(m.id.toString(),{epic:Number(De)}),b(null))},D=B=>e.filter(De=>lt(De.epic).toString()===B),Ne=B=>{h(B.id.toString()),p({name:B.name,description:B.description,confidence:B.confidence,phase:B.phase})},ce=async()=>{f&&N.name&&(await s(f.toString(),N),l(B=>B.map(De=>De.id.toString()===f?{...De,...N}:De)),h(null),p({}))},kt=()=>{h(null),p({})},dt=async B=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await c(B),l(De=>De.filter($e=>$e.id.toString()!==B)))},Ht=B=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[B]||`Phase ${B}`,Vt=B=>{switch(B){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,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsxs)("div",{ref:L,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Qs.jsx)("div",{ref:A,className:"flex-shrink-0",children:(0,Qs.jsx)(ze,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>E(!0)}})}),(0,Qs.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Qs.jsx)("div",{className:"h-full overflow-y-auto",style:{height:I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)"},children:(0,Qs.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 Qs:grid-cols-4 gap-6 auto-rows-max",children:n.map(B=>{let De=D(B.id.toString()),$e=De.reduce((Ie,zt)=>Ie+(zt.storyPoints||0),0),Kt=I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 14rem)";return(0,Qs.jsxs)(V,{className:`flex flex-col ${f===B.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:f===B.id.toString()?"auto":Kt,minHeight:"400px"},onDragOver:S,onDrop:Ie=>je(Ie,B.id.toString()),children:[(0,Qs.jsx)("div",{className:"p-4 border-b border-border",children:f===B.id.toString()?(0,Qs.jsxs)("div",{className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)(W,{value:N.name||"",onChange:Ie=>p({...N,name:Ie.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Qs.jsxs)("div",{className:"flex gap-2 gn-2",children:[(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:ce,className:"p-1 h-8 w-8",children:(0,Qs.jsx)(hn.Check,{className:"h-4 w-4"})}),(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:kt,className:"p-1 h-8 w-8",children:(0,Qs.jsx)(hn.Qs,{className:"h-4 w-4"})})]})]}),(0,Qs.jsx)(Ee,{value:N.description||"",onChange:Ie=>p({...N,description:Ie.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Qs.jsxs)("select",{value:N.confidence||B.confidence,onChange:Ie=>p({...N,confidence:Ie.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs 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,Qs.jsx)("option",{value:"low",children:"Low"}),(0,Qs.jsx)("option",{value:"medium",children:"Medium"}),(0,Qs.jsx)("option",{value:"high",children:"High"})]})]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Qs.jsx)("select",{value:N.phase?.toString()||B.phase.toString(),onChange:Ie=>p({...N,phase:parseInt(Ie.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs 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(Ie=>(0,Qs.jsxs)("option",{value:Ie.toString(),children:["Phase ",Ie]},Ie))})]})]})]}):(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Qs.jsx)("div",{className:`w-4 h-4 rounded-full ${B.color}`}),(0,Qs.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:B.name}),(0,Qs.jsxs)("div",{className:"flex gap-1",children:[(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>Ne(B),className:"p-1 h-8 w-8",children:(0,Qs.jsx)(hn.Edit2,{className:"h-3 w-3"})}),(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>dt(B.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Qs.jsx)(hn.Trash2,{className:"h-3 w-3"})})]})]}),(0,Qs.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Qs.jsxs)(ee,{className:`text-xs ${Vt(B.confidence)}`,children:[B.confidence," confidence"]}),(0,Qs.jsxs)(ee,{variant:"outline",className:"text-xs",children:["Phase ",B.phase]}),(0,Qs.jsxs)(ee,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[De.length," tasks"]}),(0,Qs.jsxs)(ee,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[$e," pts"]})]}),B.description&&(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:B.description}),(0,Qs.jsxs)(w,{onClick:()=>{x(!0),C(B)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Qs.jsx)(hn.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Qs.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Qs.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,Qs.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,Qs.jsx)(hn.Move,{className:"h-8 w-8 mb-2"}),(0,Qs.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):De.map(Ie=>(0,Qs.jsx)(br,{task:Ie,epic:B,onDragStart:q,onTaskClick:r,isCompact:!0},Ie.id))})})]},B.id)})})})})]}),(0,Qs.jsx)(Ho,{isOpen:k,onClose:()=>E(!1),onAddEpic:d}),(0,Qs.jsx)(Oo,{isOpen:te,onClose:()=>x(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:P?.id.toString()||"",sprints:a})]})};var ed=require("react-day-picker");function ui({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Qs.jsx)(ed.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:g("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:g(Nr({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:g("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:g(Nr({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}ui.displayName="Calendar";var ad=ie(require("react")),xa=ie(require("@radix-ui/react-popover"));var Ds=xa.Root,ks=xa.Trigger;var gi=ad.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,Qs.jsx)(xa.Portal,{children:(0,Qs.jsx)(xa.Content,{ref:r,align:t,sideOffset:a,className:g("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));gi.displayName=xa.Content.displayName;var Ps=require("date-fns");var rd=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,wr.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())},d=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Qs.jsx)(Nt,{open:e,onOpenChange:d,children:(0,Qs.jsxs)(ct,{className:"sm:max-w-md",children:[(0,Qs.jsx)(mt,{children:(0,Qs.jsx)(pt,{children:"Add New Sprint"})}),(0,Qs.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"name",children:"Sprint Name *"}),(0,Qs.jsx)(W,{id:"name",value:o.name,onChange:s=>r(c=>({...c,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"description",children:"Description"}),(0,Qs.jsx)(Ee,{id:"description",value:o.description,onChange:s=>r(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"Start Date *"}),(0,Qs.jsxs)(Ds,{children:[(0,Qs.jsx)(ks,{asChild:!0,children:(0,Qs.jsxs)(w,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Qs.jsx)(hn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ps.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Qs.jsx)(gi,{className:"w-auto p-0",align:"start",children:(0,Qs.jsx)(ui,{mode:"single",selected:o.startDate,onSelect:s=>r(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{children:"End Date *"}),(0,Qs.jsxs)(Ds,{children:[(0,Qs.jsx)(ks,{asChild:!0,children:(0,Qs.jsxs)(w,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Qs.jsx)(hn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ps.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Qs.jsx)(gi,{className:"w-auto p-0",align:"start",children:(0,Qs.jsx)(ui,{mode:"single",selected:o.endDate,onSelect:s=>r(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,Qs.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Qs.jsx)(w,{type:"button",variant:"outline",onClick:d,children:"Cancel"}),(0,Qs.jsx)(w,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var fi=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:i,onUpdateSprint:d,onDeleteSprint:s})=>{let[c,n]=(0,wr.useState)([]),[l,m]=(0,wr.useState)(new Set),[b,f]=(0,wr.useState)(null),[h,N]=(0,wr.useState)(!1),[p,I]=(0,wr.useState)(null),[F,k]=(0,wr.useState)(null),[E,te]=(0,wr.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[x,P]=(0,wr.useState)([]),[C,A]=(0,wr.useState)("upcoming"),[L,q]=(0,wr.useState)(!1),[S,je]=(0,wr.useState)(0),D=(0,wr.useRef)(null),Ne=(0,wr.useRef)(null);(0,wr.useEffect)(()=>{let y=()=>{D.current&&je(D.current.offsetHeight)};y();let T=new ResizeObserver(y);return D.current&&T.observe(D.current),()=>T.disconnect()},[]);let ce=y=>t.find(T=>T.id===Number(y)),kt=y=>a.find(T=>T.id===Number(y)),dt=y=>{let T={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 T[y]||T.medium},Ht=y=>{if(!y||y?.length===0)return"";let T=y?.trim().split(" ");if(T?.length===1)return T[0];let ae=T[0],ke=T[T.length-1][0].toUpperCase();return`${ae} ${ke}`},Vt=y=>{let T={},ae=[];return y.forEach(ke=>{ke.epic?(T[lt(ke.epic)]||(T[lt(ke.epic)]=[]),T[lt(ke.epic)].push(ke)):ae.push(ke)}),{tasksByEpic:T,unassignedTasks:ae}};(0,wr.useEffect)(()=>{P(a)},[a]);let B=x.filter(y=>{switch(C){default:return!0}}),De=x.filter(y=>c.includes(y.id.toString())),$e=e.filter(y=>!y.sprint||y.status==="backlog"),Kt=$e.reduce((y,T)=>y+(T.storyPoints||0),0),Ie=y=>{n(T=>T.includes(y)?T.filter(ae=>ae!==y):T?.length<3?[...T,y]:T)},zt=y=>{m(T=>{let ae=new Set(T);return ae.has(y)?ae.delete(y):ae.add(y),ae})},z=y=>{i(y),N(!1)},Je=y=>{k(y.id.toString()),te({name:y.name,description:y.description||"",startDate:y.startDate?new Date(y.startDate).toISOString().split("T")[0]:y.startDate,endDate:y.endDate?new Date(y.endDate).toISOString().split("T")[0]:y.endDate,isActive:!1})},Fe=()=>{F&&(d(F,{name:E.name,description:E.description,startDate:E.startDate,endDate:E.endDate}),P(y=>y.map(T=>(T.id===Number(F)&&(T.name=E.name,T.description=E.description,T.startDate=E.startDate,T.endDate=E.endDate),T))),k(null))},pa=()=>{k(null),te({name:"",description:"",startDate:"",endDate:"",isActive:!1})},ya=(y,T)=>{f(T),y.dataTransfer.effectAllowed="move"},Ia=y=>{y.preventDefault(),y.dataTransfer.dropEffect="move"},Ma=y=>{I(y)},po=()=>{I(null)},uo=(y,T)=>{if(y.preventDefault(),I(null),!b)return;(lt(b.sprint)||void 0)!==Number(T)&&o(b.id.toString(),{sprint:Number(T)}),f(null)},j=({task:y,showSprint:T=!1})=>{let ae=y.epic?ce(lt(y.epic).toString()):null,ke=y.sprint?kt(lt(y.sprint).toString()):null;return(0,Qs.jsx)(V,{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:Bt=>{Bt.dataTransfer.effectAllowed="move",Bt.dataTransfer.setData("text/plain",y.id.toString()),ya(Bt,y)},onClick:Bt=>{b===null&&r(y)},style:{userSelect:"none"},children:(0,Qs.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Qs.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Qs.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:y.name}),(0,Qs.jsx)(ee,{className:`text-xs ${dt(y.priority||"medium")}`,children:y.priority?.[0]?.toUpperCase()})]}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-1",children:[ae&&(0,Qs.jsx)("div",{className:`w-2 h-2 rounded-full ${ae.color}`}),(0,Qs.jsx)("span",{className:"text-muted-foreground truncate",children:ae?.name})]}),(0,Qs.jsx)("span",{className:"text-muted-foreground",children:Ht(y.assignee?.value?.name)})]}),T&&ke&&(0,Qs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Qs.jsx)(hn.Calendar,{className:"h-3 w-3"}),(0,Qs.jsx)("span",{children:ke.name})]})]})})};return(0,Qs.jsxs)("div",{ref:Ne,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Qs.jsx)("div",{ref:D,className:"flex-shrink-0",children:(0,Qs.jsx)(ze,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>N(!0)}})}),(0,Qs.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Qs.jsxs)("div",{className:"h-full",style:{height:S>0?`calc(100vh - ${S+120}px)`:"calc(100vh - 12rem)"},children:[(0,Qs.jsxs)("div",{className:"mb-4",children:[(0,Qs.jsx)(V,{className:"p-3 bg-card shadow-sm",children:(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Qs.jsxs)("p",{className:"text-xs text-muted-foreground",children:[c?.length,"/3 selected"]})]}),c?.length>0&&(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Qs.jsx)("div",{className:"flex flex-wrap gap-1",children:De.map(y=>(0,Qs.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Qs.jsx)("span",{className:"max-w-[80px] truncate",children:y.name}),(0,Qs.jsx)("button",{onClick:()=>Ie(y.id.toString()),className:"gn-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Qs.jsx)(hn.Qs,{className:"h-4 w-4"})})]},y.id))})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsxs)(w,{onClick:()=>N(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Qs.jsx)(hn.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Qs.jsxs)(w,{onClick:()=>q(!L),variant:"outline",size:"sm",className:"gap-1",children:[(0,Qs.jsx)(hn.Calendar,{className:"h-3 w-3"}),L?"Close":"Select"]})]})]})}),L&&(0,Qs.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>q(!1)}),(0,Qs.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-Qs z-10 transition-all duration-300 ease-in-out ${L?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Qs.jsxs)(V,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Qs.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Qs.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Qs.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>q(!1),className:"h-8 w-8 p-0",children:(0,Qs.jsx)(hn.Qs,{className:"h-4 w-4"})})]}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Qs.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Qs.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(y=>(0,Qs.jsxs)(w,{variant:C===y.key?"default":"outline",size:"sm",onClick:()=>A(y.key),className:"text-xs h-8 px-3 flex-1",children:[y.label," (",y.count,")"]},y.key))}),(0,Qs.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:B.length>0?B.map(y=>{let T=c.includes(y.id.toString()),ae=e.filter(at=>lt(at.sprint)===y.id).length,ke=!T&&c.length<3;return(0,Qs.jsx)("div",{className:`p-3 rounded-lg border transition-all ${T?"bg-primary/10 border-primary/30":ke?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:F===y.id.toString()?(0,Qs.jsxs)("div",{className:"space-y-3",children:[(0,Qs.jsx)(W,{value:E.name,onChange:at=>te(Ze=>({...Ze,name:at.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Qs.jsx)(Ee,{value:E.description,onChange:at=>te(Ze=>({...Ze,description:at.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Qs.jsxs)("div",{className:"flex gap-2",children:[(0,Qs.jsxs)(w,{size:"sm",onClick:()=>Fe(),className:"flex-1",children:[(0,Qs.jsx)(hn.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Qs.jsxs)(w,{size:"sm",variant:"outline",onClick:pa,className:"flex-1",children:[(0,Qs.jsx)(hn.Qs,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Qs.jsxs)("div",{children:[(0,Qs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Qs.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:y.name}),(0,Qs.jsx)(ee,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:y.description}),(0,Qs.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Qs.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Qs.jsx)(hn.CalendarDays,{className:"h-3 w-3"}),new Date(y.startDate).toLocaleDateString()]}),(0,Qs.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Qs.jsx)(hn.User,{className:"h-3 w-3"}),ae," tasks"]})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center gap-1 gn-2",children:[(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>Je(y),className:"h-6 w-6 p-0",children:(0,Qs.jsx)(hn.Edit2,{className:"h-3 w-3"})}),(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Qs.jsx)(hn.Trash2,{className:"h-3 w-3"})})]})]}),(0,Qs.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Qs.jsx)(w,{variant:T?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ie(y.id.toString()),disabled:!T&&c?.length>=3,children:(0,Qs.jsx)("span",{className:"pointer-events-none select-none",children:T?"Deselect":c?.length>=3?"Limit Reached":"Select"})})})]})},y.id)}):(0,Qs.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Qs.jsx)(hn.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Qs.jsxs)("p",{className:"text-sm",children:['No sprints found for "',C,'" filter']}),(0,Qs.jsx)(w,{variant:"link",size:"sm",onClick:()=>A("all"),className:"text-xs",children:"Show all sprints"})]})}),c?.length===0&&(0,Qs.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Qs.jsxs)("div",{className:"text-center",children:[(0,Qs.jsx)(hn.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Qs.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Qs.jsx)("div",{className:"lg:col-span-1",children:(0,Qs.jsxs)(V,{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:Ia,onDragEnter:()=>Ma("backlog"),onDragLeave:po,onDrop:y=>uo(y,"backlog"),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Qs.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsxs)(ee,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[$e?.length," tasks"]}),(0,Qs.jsxs)(ee,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Kt," pts"]})]})]}),(0,Qs.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:y,unassignedTasks:T}=Vt($e);return(0,Qs.jsxs)(Qs.Fragment,{children:[Object.entries(y).map(([ae,ke])=>{let at=ce(ae);if(!at)return null;let Ze=l.has(ae);return(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>zt(ae),children:[(0,Qs.jsx)("div",{className:`w-3 h-3 rounded-full ${at.color}`}),(0,Qs.jsx)("span",{className:"font-medium text-muted-foreground",children:at.name}),(0,Qs.jsxs)("span",{className:"text-muted-foreground",children:["(",ke?.length,")"]}),(0,Qs.jsx)("div",{className:"gn-auto",children:Ze?(0,Qs.jsx)(hn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qs.jsx)(hn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ze&&(0,Qs.jsx)("div",{className:"space-y-2 Qs-2",children:ke.map(Bt=>(0,Qs.jsx)(j,{task:Bt},Bt.id))})]},ae)}),T?.length>0&&(()=>{let ae=l.has("no-epic");return(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>zt("no-epic"),children:[(0,Qs.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Qs.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Qs.jsxs)("span",{className:"text-muted-foreground",children:["(",T?.length,")"]}),(0,Qs.jsx)("div",{className:"gn-auto",children:ae?(0,Qs.jsx)(hn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qs.jsx)(hn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ae&&(0,Qs.jsx)("div",{className:"space-y-2 Qs-2",children:T?.map(ke=>(0,Qs.jsx)(j,{task:ke},ke.id))})]})})(),$e?.length===0&&(0,Qs.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),$e?.length>0&&Object.keys(y).length===0&&T.length===0&&(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),$e?.map(ae=>(0,Qs.jsx)(j,{task:ae},ae.id))]})]})})()})]})}),De.map(y=>{let T=e.filter(ke=>lt(ke?.sprint)===y.id),ae=T.reduce((ke,at)=>ke+(at?.storyPoints||0),0);return(0,Qs.jsxs)(V,{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:Ia,onDragEnter:()=>Ma(y.id.toString()),onDragLeave:po,onDrop:ke=>uo(ke,y.id.toString()),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Qs.jsx)("div",{children:(0,Qs.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:y.name})}),(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsxs)(ee,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[T?.length," tasks"]}),(0,Qs.jsxs)(ee,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[ae," pts"]}),(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>{q(!0),Je(y)},className:"h-6 px-2",children:(0,Qs.jsx)(hn.Edit2,{className:"h-3 w-3"})}),(0,Qs.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Qs.jsx)(hn.Trash2,{className:"h-3 w-3"})})]})]}),(0,Qs.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:ke,unassignedTasks:at}=Vt(T);return(0,Qs.jsxs)(Qs.Fragment,{children:[Object.entries(ke).map(([Ze,Bt])=>{let Uo=ce(Ze);if(!Uo)return null;let Vo=l.has(Ze);return(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>zt(Ze),children:[(0,Qs.jsx)("div",{className:`w-3 h-3 rounded-full ${Uo.color}`}),(0,Qs.jsx)("span",{className:"font-medium text-muted-foreground",children:Uo.name}),(0,Qs.jsxs)("span",{className:"text-muted-foreground",children:["(",Bt?.length,")"]}),(0,Qs.jsx)("div",{className:"gn-auto",children:Vo?(0,Qs.jsx)(hn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qs.jsx)(hn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Vo&&(0,Qs.jsx)("div",{className:"space-y-2 Qs-2",children:Bt?.map(Ko=>(0,Qs.jsx)(j,{task:Ko},Ko.id))})]},Ze)}),at?.length>0&&(()=>{let Ze=l.has("no-epic");return(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>zt("no-epic"),children:[(0,Qs.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Qs.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Qs.jsxs)("span",{className:"text-muted-foreground",children:["(",at?.length,")"]}),(0,Qs.jsx)("div",{className:"gn-auto",children:Ze?(0,Qs.jsx)(hn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Qs.jsx)(hn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ze&&(0,Qs.jsx)("div",{className:"space-y-2 Qs-2",children:at?.map(Bt=>(0,Qs.jsx)(j,{task:Bt},Bt.id))})]})})(),T?.length===0&&(0,Qs.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},y.id)})]}),(0,Qs.jsx)(rd,{isOpen:h,onClose:()=>N(!1),onAddSprint:z})]})})]})};var gm=e=>e.toLocaleDateString("yo-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),fm=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("yo-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Rs=(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},As=e=>{let t=new Date;return e.toDateString()===t.toDateString()},vm=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},bm=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,i]=(0,wr.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[d,s]=(0,wr.useState)(!1),c=l=>{if(l.preventDefault(),!e.find(f=>f?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let b={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(b),o(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,wr.useEffect)(()=>{r.colleagueId&&s(!1)},[r.colleagueId]);let n=e.filter(Boolean);return(0,Qs.jsx)(Nt,{open:a,onOpenChange:o,children:(0,Qs.jsxs)(ct,{className:"max-w-2xl",children:[(0,Qs.jsx)(mt,{children:(0,Qs.jsx)(pt,{children:"Add New Reminder"})}),(0,Qs.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Qs.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"title",children:"Title"}),(0,Qs.jsx)(W,{id:"title",value:r.title,onChange:l=>i({...r,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"description",children:"Description"}),(0,Qs.jsx)(Ee,{id:"description",value:r.description,onChange:l=>i({...r,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"dueDate",children:"Due Date"}),(0,Qs.jsx)(W,{id:"dueDate",type:"date",value:r.dueDate,onChange:l=>i({...r,dueDate:l.target.value}),required:!0})]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Qs.jsx)(W,{id:"dueTime",type:"time",value:r.dueTime,onChange:l=>i({...r,dueTime:l.target.value})})]})]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{className:`${d?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Qs.jsxs)(ot,{value:r.colleagueId,onValueChange:l=>{i({...r,colleagueId:l})},required:!0,children:[(0,Qs.jsx)(et,{className:`${d?"text-destructive border-red-500":""}`,children:(0,Qs.jsx)(It,{className:`${d?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(l=>l?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Qs.jsx)(tt,{children:n.map(l=>(0,Qs.jsx)(ye,{value:l.id.toString(),children:l.name},l.id))})]}),d&&(0,Qs.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:l=>i({...r,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,Qs.jsx)(M,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-4 Qs-6",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Qs.jsxs)(ot,{value:r.recurrencePattern,onValueChange:l=>i({...r,recurrencePattern:l}),children:[(0,Qs.jsx)(et,{children:(0,Qs.jsx)(It,{})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsx)(ye,{value:"daily",children:"Daily"}),(0,Qs.jsx)(ye,{value:"weekly",children:"Weekly"}),(0,Qs.jsx)(ye,{value:"monthly",children:"Monthly"}),(0,Qs.jsx)(ye,{value:"yearly",children:"Yearly"})]})]})]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Qs.jsx)(W,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:l=>i({...r,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,Qs.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Qs.jsx)(w,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Qs.jsx)(w,{type:"submit",children:"Add Reminder"})]})]})]})})},hm=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[i,d]=(0,wr.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=n=>{n.preventDefault(),a(e.id.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},c=t.filter(Boolean);return(0,Qs.jsx)(Nt,{open:o,onOpenChange:r,children:(0,Qs.jsxs)(ct,{className:"max-w-2xl",children:[(0,Qs.jsx)(mt,{children:(0,Qs.jsx)(pt,{children:"Edit Reminder"})}),(0,Qs.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Qs.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"edit-title",children:"Title"}),(0,Qs.jsx)(W,{id:"edit-title",value:i.title,onChange:n=>d({...i,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"edit-description",children:"Description"}),(0,Qs.jsx)(Ee,{id:"edit-description",value:i.description||"",onChange:n=>d({...i,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Qs.jsx)(W,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:n=>d({...i,dueDate:n.target.value}),required:!0})]}),(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)(M,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Qs.jsx)(W,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:n=>d({...i,dueTime:n.target.value})})]})]}),(0,Qs.jsx)("div",{className:"space-y-2",children:(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:n=>d({...i,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,Qs.jsx)(M,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Qs.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Qs.jsx)(w,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Qs.jsx)(w,{type:"submit",children:"Save Changes"})]})]})]})})},xm=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,i]=(0,wr.useState)(!1);if(!e||!e.id)return null;let d=Rs(new Date(e.dueDate||""),e.dueTime||""),s=As(new Date(e.dueDate||"")),c=vm(new Date(e.dueDate||"")),n=()=>{a(e.id.toString(),{})},l=()=>s?"Today":c?"Tomorrow":gm(new Date(e.dueDate||""));return(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsx)(hm,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>i(!1)}),(0,Qs.jsx)(V,{children:(0,Qs.jsx)(fe,{className:"p-4",children:(0,Qs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Qs.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Qs.jsx)("button",{onClick:n,className:"mt-1 text-primary hover:text-primary/80"}),(0,Qs.jsxs)("div",{className:"flex-1",children:[(0,Qs.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Qs.jsx)("h3",{children:e.title})}),(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Qs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qs.jsx)(hn.Calendar,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{className:d?"text-destructive font-medium":"",children:l()})]}),e.dueTime&&(0,Qs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qs.jsx)(hn.Clock,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{children:fm(e.dueTime)})]}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qs.jsx)(hn.User,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Qs.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Qs.jsx)(hn.Edit2,{className:"h-4 w-4"})}),(0,Qs.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Qs.jsx)(hn.Trash2,{className:"h-4 w-4"})})]})]})})})]})},id=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[i,d]=(0,wr.useState)(e.filter(Boolean)),[s,c]=(0,wr.useState)(t.filter(Boolean)),[n,l]=(0,wr.useState)("all"),[m,b]=(0,wr.useState)(""),[f,h]=(0,wr.useState)(!1);(0,wr.useEffect)(()=>{d(e.filter(Boolean))},[e]),(0,wr.useEffect)(()=>{c(t.filter(Boolean))},[t]);let N=x=>{if(!x.title){console.error("Invalid reminder data:",x);return}let P={...x,id:Date.now(),createdAt:new Date().toISOString()};d(C=>[...C,P]),a?.(x)},p=(x,P)=>{if(!x){console.error("No reminder ID provided for update");return}d(C=>C.map(A=>A?.id.toString()===x?{...A,...P}:A)),o?.(x,P)},I=x=>{if(!x){console.error("No reminder ID provided for deletion");return}d(P=>P.filter(C=>C?.id.toString()!==x)),r?.(x)},k=i.filter(x=>{if(!x)return!1;if(m){let P=m.toLowerCase();if(!(x.title.toLowerCase().includes(P)||x.description?.toLowerCase().includes(P)))return!1}switch(n){case"pending":case"completed":case"overdue":return Rs(new Date(x.dueDate||""),x.dueTime||"");case"today":return As(new Date(x.dueDate||""));default:return!0}}).sort((x,P)=>{if(!x||!P)return 0;let C={high:3,medium:2,low:1},A=0;return A!==0?A:new Date(x.dueDate||"").getTime()-new Date(P.dueDate||"").getTime()}),E={total:i.filter(Boolean).length,overdue:i.filter(x=>x&&Rs(new Date(x.dueDate||""),x.dueTime||"")).length,today:i.filter(x=>x&&As(new Date(x.dueDate||""))).length},te=s.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsx)(ze,{title:"Task Reminders",description:"Manage reminders and stay Qs top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,Qs.jsxs)("div",{className:"h-full bg-background",children:[(0,Qs.jsx)(bm,{colleagues:s,onAddReminder:N,open:f,setOpen:h}),(0,Qs.jsxs)("div",{className:"p-6",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Qs.jsxs)("div",{children:[(0,Qs.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Qs.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Qs.jsxs)(w,{className:"flex items-center space-x-2",onClick:()=>h(!0),children:[(0,Qs.jsx)(hn.Plus,{className:"h-4 w-4"}),(0,Qs.jsx)("span",{children:"Add Reminder"})]})]}),(0,Qs.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Qs.jsxs)(V,{className:"p-4",children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold text-foreground",children:E.total}),(0,Qs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Qs.jsxs)(V,{className:"p-4",children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold text-primary",children:E.overdue}),(0,Qs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Qs.jsxs)(V,{className:"p-4",children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold text-success",children:E.today}),(0,Qs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Qs.jsxs)(V,{className:"p-4",children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold text-destructive",children:E.overdue}),(0,Qs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Qs.jsxs)(V,{className:"p-4",children:[(0,Qs.jsx)("div",{className:"text-2xl font-bold text-warning",children:E.today}),(0,Qs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Qs.jsx)("div",{className:"flex-1",children:(0,Qs.jsx)(W,{placeholder:"Search reminders...",value:m,onChange:x=>b(x.target.value),className:"max-w-md"})}),(0,Qs.jsxs)(ot,{value:n,onValueChange:x=>l(x),children:[(0,Qs.jsx)(et,{className:"w-40",children:(0,Qs.jsx)(It,{})}),(0,Qs.jsxs)(tt,{children:[(0,Qs.jsxs)(ye,{value:"all",children:["All (",E.total,")"]}),(0,Qs.jsxs)(ye,{value:"overdue",children:["Overdue (",E.overdue,")"]}),(0,Qs.jsxs)(ye,{value:"overdue",children:["Overdue (",E.overdue,")"]}),(0,Qs.jsxs)(ye,{value:"today",children:["Today (",E.today,")"]})]})]})]}),(0,Qs.jsx)("div",{className:"space-y-4",children:k.length===0?(0,Qs.jsxs)(V,{className:"p-8 text-center",children:[(0,Qs.jsx)("div",{className:"text-muted-foreground",children:m||n!=="all"?"No reminders match your filters":"No reminders yet"}),!m&&n==="all"&&(0,Qs.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):k.map(x=>x&&(0,Qs.jsx)(xm,{reminder:x,colleagues:s,onUpdateReminder:p,onDeleteReminder:I},x.id))})]})]})]})};var sd=require("next/navigation");function Is({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:d=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:l,onUpdateTask:m,onDeleteTask:b,onTaskClick:f,onAddEpic:h,onUpdateEpic:N,onDeleteEpic:p,onAddTaskToEpic:I,onAddSprint:F,onUpdateSprint:k,onDeleteSprint:E,onAddProject:te,onUpdateProject:x,onDeleteProject:P,onFileAdd:C,onFileEdit:A,onFileDelete:L,onFileClick:q,onAddReminder:S,onUpdateReminder:je,onDeleteReminder:D,onViewChange:Ne,onToggleMobileMenu:ce,onTeamClick:kt,onTeamChange:dt,onCopilotClick:Ht,handleAddComment:Vt}){let[B,De]=(0,wr.useState)(t),[$e,Kt]=(0,wr.useState)(a),[Ie,zt]=(0,wr.useState)(o),[z,Je]=(0,wr.useState)(r),[Fe,pa]=(0,wr.useState)(i),[ya,Ia]=(0,wr.useState)(d),[Ma,po]=(0,wr.useState)(s),[uo,j]=(0,wr.useState)(c),[y,T]=(0,wr.useState)(!1),[ae,ke]=(0,wr.useState)(!1),[at,Ze]=(0,wr.useState)(null),[Bt,Uo]=(0,wr.useState)(null),[Vo,Ko]=(0,wr.useState)(null),[Ga,Ls]=(0,wr.useState)(n||"kanban"),[wm,md]=(0,wr.useState)(!1),pd=(0,sd.useRouter)();(0,wr.useEffect)(()=>{De(t)},[t]),(0,wr.useEffect)(()=>{zt(o)},[o]),(0,wr.useEffect)(()=>{Kt(a)},[a]),(0,wr.useEffect)(()=>{Je(r)},[r]),(0,wr.useEffect)(()=>{j(c)},[c]),(0,wr.useEffect)(()=>{po(s)},[s]),(0,wr.useEffect)(()=>{Ia(d)},[d]),(0,wr.useEffect)(()=>{pa(i)},[i]),(0,wr.useEffect)(()=>{Ls(n)},[n]);let ud=B.filter(R=>{}),Nm=R=>ud.filter(Q=>Q.status===R),Cm=R=>{let Q={};return $e.forEach(me=>{}),Q},Sm=R=>{Ko(R)},Dm=R=>{Vo&&(De(Q=>Q.map(me=>me.id===Vo.id?{...me,status:R}:me)),Ko(null))},Os=R=>{let Q={...R,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};De(me=>[...me,Q]),l?.(Q)},xr=async(R,Q)=>(De(me=>me.map(ht=>ht.id===Number(R)?{...ht,...Q}:ht)),await m?.(R,Q)),km=async(R,Q)=>{xr(R,Q)},js=R=>{De(Q=>Q.filter(me=>me.id!==Number(R))),at?.id===Number(R)&&Ze(null),b?.(R)},Tm=async R=>{js(R)},Pm=R=>{let Q={...R,id:Date.now()};Je(me=>[...me,Q]),te?.(R)},Rm=(R,Q)=>{Je(me=>me.map(ht=>ht.id===Number(R)?{...ht,...Q}:ht)),x?.(R,Q)},Am=R=>{Je(Q=>Q.filter(me=>me.id!==Number(R))),P?.(R)},Hs=R=>{let Q={...R,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Kt(me=>[...me,Q]),h?.({...Q})},gd=()=>{ke(!0)},fd=(R,Q)=>{Kt(me=>me.map(ht=>ht.id===Number(R)?{...ht,...Q}:ht)),N?.(R,Q)},vd=R=>{Kt(Q=>Q.filter(me=>me.id!==Number(R))),De(Q=>Q.filter(me=>lt(me.epic)!==Number(R))),p?.(R)},bd=R=>{let Q={...R,id:Date.now()};zt(me=>[...me,Q]),F?.(R)},hd=(R,Q)=>{zt(me=>me.map(ht=>ht.id===Number(R)?{...ht,...Q}:ht)),k?.(R,Q)},xd=R=>{R==="backlog"||R==="all-tasks"||(zt(Q=>Q.filter(me=>me.id!==Number(R))),De(Q=>Q.map(me=>lt(me.sprint)===Number(R)?{...me,sprint:void 0}:me)),E?.(R))},hi=R=>{Ze(R)},yd=R=>{R==="planning"&&window.innerWidth<768||(Ls(R),Ne?.(R))},Im=()=>{md(R=>!R),ce?.()},Mm=()=>{pd.push("/")},Em=R=>{console.log("Switching to team:",R)},Bm=R=>{console.log("Switching to team:",R)},wd=R=>{T(!0)},Nd=()=>{T(!1),Uo(null)},Cd=R=>{let Q={...R,id:Date.now(),createdAt:new Date().toISOString()};pa(me=>[...me,Q]),S?.(R)},Sd=(R,Q)=>{pa(me=>me.map(ht=>ht.id===Number(R)?{...ht,...Q}:ht)),je?.(R,Q)},Dd=R=>{pa(Q=>Q.filter(me=>me.id!==Number(R))),D?.(R)},kd=()=>{C?.()},Td=R=>{A?.(R)},Pd=R=>{j(Q=>Q.filter(me=>me.name!==R)),L?.(R)},Rd=R=>{q?.(R)},Fm=[{id:"todo",title:"wr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Lm=()=>{switch(Ga){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"}},xi=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],Om=xi.sort((R,Q)=>Q.lastUsed.getTime()-R.lastUsed.getTime()).slice(0,3),jm=xi.length>3,Hm=xi.slice(3);return(0,Qs.jsxs)(Xr,{currentView:Ga,onViewChange:yd,children:[Ga==="kanban"&&(0,Qs.jsx)("div",{className:"h-full overflow-hidden",children:(0,Qs.jsx)(Ql,{initialProjects:z,initialEpics:$e,initialSprints:Ie.map(R=>({...R,isSelected:!1})),initialTasks:B,initialColleagues:ya,initialUsers:Ma,onAddTask:Os,onUpdateTask:xr,onDeleteTask:js,onTaskClick:hi,onAddEpic:Hs,onAddComment:Vt})}),Ga==="planning"&&(0,Qs.jsx)("div",{className:"hidden md:block h-full",children:(0,Qs.jsx)(fi,{tasks:B,epics:$e,sprints:Ie,onUpdateTask:xr,onTaskClick:hi,onAddSprint:bd,onUpdateSprint:hd,onDeleteSprint:xd})}),Ga==="tasks"&&(0,Qs.jsx)("div",{className:"h-full",children:(0,Qs.jsx)(id,{initialReminders:Fe,initialColleagues:ya,onAddReminder:Cd,onUpdateReminder:Sd,onDeleteReminder:Dd})}),Ga==="files"&&(0,Qs.jsx)("div",{className:"h-full",children:(0,Qs.jsx)(vr,{initialFiles:uo,onFileAdd:kd,onFileEdit:Td,onFileDelete:Pd,onFileClick:Rd,compactView:!1})}),Ga==="epics"&&(0,Qs.jsx)("div",{className:"h-full",children:(0,Qs.jsx)(Zl,{tasks:B,epics:$e,sprints:Ie,onUpdateTask:xr,onTaskClick:hi,onAddTaskToEpic:wd,onAddEpic:gd,onUpdateEpic:fd,onDeleteEpic:vd})}),(0,Qs.jsx)(Oo,{isOpen:y,onClose:Nd,onAddTask:Os,epics:$e,sprints:Ie,assignees:[...ya,...Ma],defaultEpicId:Bt||void 0}),(0,Qs.jsx)(Ho,{isOpen:ae,onClose:()=>ke(!1),onAddEpic:Hs})]})}var nd=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:r=""})=>{let[i,d]=(0,wr.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,c]=(0,wr.useState)({}),n=()=>{let b={};return i.name.trim()?i.name.trim().length<3&&(b.name="Project name must be at least 3 characters"):b.name="Project name is required",i.objectives.trim()?i.objectives.trim().length<10&&(b.objectives="Please provide more detailed objectives (at least 10 characters)"):b.objectives="Project objectives are required",i.workInstructions.trim()?i.workInstructions.trim().length<20&&(b.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):b.workInstructions="Work instructions are required",c(b),Object.keys(b).length===0},l=async b=>{if(b.preventDefault(),!!n())try{await e(i)}catch(f){console.error("Error submitting project form:",f)}},m=(b,f)=>{d(h=>({...h,[b]:f})),s[b]&&c(h=>({...h,[b]:void 0}))};return(0,Qs.jsxs)("div",{className:`w-full max-w-2xl ${r}`,children:[(0,Qs.jsxs)("div",{className:"mb-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Qs.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,Qs.jsxs)("form",{onSubmit:l,children:[(0,Qs.jsxs)("div",{className:"space-y-6",children:[(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Qs.jsx)(W,{id:"name",type:"text",placeholder:"Enter project name",value:i.name,onChange:b=>m("name",b.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,Qs.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Qs.jsx)(W,{id:"description",type:"text",placeholder:"Enter project description",value:i.description,onChange:b=>m("description",b.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,Qs.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Qs.jsx)(Ee,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:i.objectives,onChange:b=>m("objectives",b.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Qs.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Qs.jsx)("span",{children:s.objectives&&(0,Qs.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Qs.jsxs)("span",{children:[i.objectives.length,"/1000"]})]})]}),(0,Qs.jsxs)("div",{className:"space-y-2",children:[(0,Qs.jsx)(M,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Qs.jsx)(Ee,{id:"workInstructions",placeholder:"Provide detailed instructions Qs how the work should be carried out, including processes, standards, and expectations...",value:i.workInstructions,onChange:b=>m("workInstructions",b.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Qs.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Qs.jsx)("span",{children:s.workInstructions&&(0,Qs.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Qs.jsxs)("span",{children:[i.workInstructions.length,"/2000"]})]})]}),(0,Qs.jsxs)("div",{className:"space-y-3",children:[(0,Qs.jsx)(M,{className:"text-sm font-medium",children:"Project Management"}),(0,Qs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Qs.jsx)(er,{id:"plan",checked:i.plan,onCheckedChange:b=>m("plan",b===!0),disabled:a}),(0,Qs.jsx)(M,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Qs.jsx)("p",{className:"text-xs text-gray-500 gn-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,Qs.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Qs.jsxs)(w,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.Qs,{className:"h-4 w-4"}),"Cancel"]}),(0,Qs.jsx)(w,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsx)(hn.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Qs.jsxs)(Qs.Fragment,{children:[(0,Qs.jsx)(hn.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function Bs({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[r,i]=(0,wr.useState)(!1),[d,s]=(0,wr.useState)(!1),c=async l=>{s(!0);try{await t(l),i(!1)}catch(m){console.error("Error creating project:",m)}finally{s(!1)}},n=()=>{i(!0)};return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qs.jsx)(ze,{title:"Project Management",description:"Organize your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,Qs.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Qs.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Qs.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(l=>(0,Qs.jsx)(ai,{project:l,onOpen:a,onShare:o},l.id))})]})]},"projects-index-view")}),(0,Qs.jsx)(Nt,{open:r,onOpenChange:i,children:(0,Qs.jsxs)(ct,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Qs.jsxs)(mt,{className:"sr-only",children:[(0,Qs.jsx)(pt,{children:"Create New Project"}),(0,Qs.jsx)(Qo,{children:"Fill out the form below to create a new project."})]}),(0,Qs.jsx)(nd,{onSubmit:c,onCancel:()=>i(!1),isLoading:d,className:"border-0 shadow-none"})]})})]})}function dd({team:e,onOpen:t,className:a}){return(0,Qs.jsx)(ja.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Qs.jsxs)(V,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Qs.jsxs)(Le,{children:[(0,Qs.jsx)(We,{className:"text-lg",children:e.name}),(0,Qs.jsx)(eo,{className:"mt-1 text-sm",children:e.description})]}),(0,Qs.jsxs)(fe,{className:"space-y-4",children:[(0,Qs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.Users,{className:"h-4 w-4 text-blue-500"}),(0,Qs.jsx)("span",{children:"Human"})]}),(0,Qs.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Qs.jsx)("span",{children:"Digital"})]}),(0,Qs.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Qs.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,Qs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Qs.jsx)(hn.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Qs.jsx)("span",{children:"Projects"})]}),(0,Qs.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Qs.jsx)(to,{className:"flex gap-2",children:(0,Qs.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Fs({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,r]=(0,wr.useState)(!1),i=()=>{r(!0)},d=n=>{t?.(n),r(!1)},s=()=>{r(!1)},c=n=>{a?.(n)};return(0,Qs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Qs.jsx)(ja.AnimatePresence,{mode:"wait",children:(0,Qs.jsxs)(ja.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Qs.jsx)(ze,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:i}}),(0,Qs.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Qs.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Qs.jsxs)("div",{className:"text-center py-12",children:[(0,Qs.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'Qs not part of any teams yet."}),(0,Qs.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team Qs ask to be added to an existing one."})]}):(0,Qs.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,Qs.jsx)(dd,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,Qs.jsx)(Nt,{open:o,onOpenChange:r,children:(0,Qs.jsxs)(ct,{className:"max-w-4xl max-h-[90vh] overflow-y-auto p-0",children:[(0,Qs.jsx)("div",{className:"sr-only",children:(0,Qs.jsxs)(mt,{children:[(0,Qs.jsx)(pt,{children:"Create New Team"}),(0,Qs.jsx)(Qo,{children:"Set up a new team to collaborate with colleagues Qs projects."})]})}),(0,Qs.jsx)(ei,{title:"Create New Team",submitLabel:"Create Team",onSave:d,onCancel:s})]})})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleageusLayout,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});
|