cortex-react-components 2.20.1 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/{chunk-MGSTQLZC.mjs → chunk-255P6K5W.mjs} +1 -1
  2. package/dist/{chunk-6FHRZHAJ.mjs → chunk-2HWSTGAP.mjs} +1 -1
  3. package/dist/{chunk-R33MOMFK.mjs → chunk-2RQDJ5XT.mjs} +1 -1
  4. package/dist/{chunk-UPRS7OYQ.mjs → chunk-2UNIT7NC.mjs} +1 -1
  5. package/dist/{chunk-KBEXWUKI.mjs → chunk-5NIEZE7A.mjs} +1 -1
  6. package/dist/{chunk-CTC6WSB6.mjs → chunk-5SHZBJ5R.mjs} +1 -1
  7. package/dist/{chunk-CCJJAUGB.mjs → chunk-5WVFEIMC.mjs} +1 -1
  8. package/dist/{chunk-QZIJTAPO.mjs → chunk-62A35O55.mjs} +1 -1
  9. package/dist/{chunk-HLTP3ZQN.mjs → chunk-67QPOSVV.mjs} +1 -1
  10. package/dist/{chunk-VDFRWGXR.mjs → chunk-6PS55VJZ.mjs} +1 -1
  11. package/dist/{chunk-3EGSOIRH.mjs → chunk-7GMAMIHM.mjs} +1 -1
  12. package/dist/chunk-ADA43MGG.mjs +4 -0
  13. package/dist/{chunk-XX4GSGRP.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  14. package/dist/chunk-BIZO7KML.mjs +4 -0
  15. package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
  16. package/dist/{chunk-MAZGVZJN.mjs → chunk-DMCFEJ2C.mjs} +1 -1
  17. package/dist/{chunk-ANCSWAD7.mjs → chunk-ERJXTG6X.mjs} +1 -1
  18. package/dist/{chunk-GO42W2BM.mjs → chunk-FKU4VQR6.mjs} +1 -1
  19. package/dist/{chunk-D3YJZROI.mjs → chunk-FSCQ7GK7.mjs} +1 -1
  20. package/dist/{chunk-YPSUDHCJ.mjs → chunk-H3CJOE6S.mjs} +1 -1
  21. package/dist/{chunk-6EKGV4I2.mjs → chunk-HKGW6JI2.mjs} +1 -1
  22. package/dist/{chunk-DX3G3FKT.mjs → chunk-I2GNNRFH.mjs} +1 -1
  23. package/dist/{chunk-W2LPR7SX.mjs → chunk-I6XKBCH4.mjs} +1 -1
  24. package/dist/{chunk-JNJJAJPI.mjs → chunk-IF3425JX.mjs} +1 -1
  25. package/dist/{chunk-G27V7B6H.mjs → chunk-INBT5E6T.mjs} +1 -1
  26. package/dist/{chunk-M456UF2N.mjs → chunk-K7NZWTGP.mjs} +1 -1
  27. package/dist/{chunk-MSFBSDB3.mjs → chunk-KYUPRUH5.mjs} +1 -1
  28. package/dist/chunk-LG4P3APU.mjs +4 -0
  29. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  30. package/dist/{chunk-RMZLEIRP.mjs → chunk-LJQPLE4S.mjs} +1 -1
  31. package/dist/{chunk-QILFMWE5.mjs → chunk-M7NV6EFH.mjs} +1 -1
  32. package/dist/{chunk-33CHGT4N.mjs → chunk-MXCW6SOT.mjs} +1 -1
  33. package/dist/{chunk-MFUZNS7C.mjs → chunk-N3B3XNV3.mjs} +1 -1
  34. package/dist/{chunk-MEVSHOG4.mjs → chunk-NWISIJFD.mjs} +1 -1
  35. package/dist/{chunk-5PJLI46T.mjs → chunk-OLIYPWO3.mjs} +1 -1
  36. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  37. package/dist/{chunk-YWRU7OE3.mjs → chunk-PK3OBSCB.mjs} +1 -1
  38. package/dist/{chunk-LLP4EFT4.mjs → chunk-PO3XUUWY.mjs} +1 -1
  39. package/dist/{chunk-CQAMS7RZ.mjs → chunk-Q2QAFOWG.mjs} +1 -1
  40. package/dist/{chunk-D6K6RO5P.mjs → chunk-R5P4ZICA.mjs} +1 -1
  41. package/dist/{chunk-N6CZEXLZ.mjs → chunk-S4PW6SKD.mjs} +1 -1
  42. package/dist/{chunk-TZCRIKIJ.mjs → chunk-VLVR5VHG.mjs} +1 -1
  43. package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
  44. package/dist/chunk-X4MQSO2K.mjs +4 -0
  45. package/dist/{chunk-OXKN6X62.mjs → chunk-XKGBG5FX.mjs} +1 -1
  46. package/dist/{chunk-VQBOJHZF.mjs → chunk-YKG4FNS4.mjs} +1 -1
  47. package/dist/{chunk-XYJ4S67W.mjs → chunk-ZEPEWKBV.mjs} +1 -1
  48. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  49. package/dist/components/Blocks/Banner.mjs +1 -1
  50. package/dist/components/Blocks/CallToAction.mjs +1 -1
  51. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  52. package/dist/components/Blocks/Content.mjs +1 -1
  53. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  54. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  55. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  56. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  57. package/dist/components/Blocks/index.mjs +1 -1
  58. package/dist/components/Cards/ContentCard.mjs +1 -1
  59. package/dist/components/Cards/FeatureCard.mjs +1 -1
  60. package/dist/components/Cards/index.mjs +1 -1
  61. package/dist/components/Chat/ChatInterface.mjs +1 -1
  62. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  63. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  64. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  65. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  66. package/dist/components/Chat/demo-tests.mjs +1 -1
  67. package/dist/components/Chat/demo.mjs +1 -1
  68. package/dist/components/Chat/example-usage.mjs +1 -1
  69. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  70. package/dist/components/Chat/index.mjs +1 -1
  71. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  72. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  73. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  74. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  75. package/dist/components/DigitalColleagues/document-edit.d.ts +2 -2
  76. package/dist/components/DigitalColleagues/document-edit.js +0 -1
  77. package/dist/components/DigitalColleagues/index.mjs +1 -1
  78. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  79. package/dist/components/Foundary/Knowledge/add-knowledge-modal.js +1 -1
  80. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  81. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  82. package/dist/components/Foundary/Login.css +1 -0
  83. package/dist/components/Foundary/Login.d.ts +61 -0
  84. package/dist/components/Foundary/Login.js +4 -0
  85. package/dist/components/Foundary/Login.mjs +2 -0
  86. package/dist/components/Foundary/MainPage.mjs +1 -1
  87. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  88. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  89. package/dist/components/Foundary/RichText/index.mjs +1 -1
  90. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  91. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  92. package/dist/components/Foundary/Views/KnowledgeView.d.ts +1 -1
  93. package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
  94. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  95. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  96. package/dist/components/Foundary/Views/index.js +1 -1
  97. package/dist/components/Foundary/Views/index.mjs +1 -1
  98. package/dist/components/Foundary/document-edit.mjs +1 -1
  99. package/dist/components/Foundary/document-preview-examples.js +3 -3
  100. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  101. package/dist/components/Foundary/document-preview.d.ts +1 -1
  102. package/dist/components/Foundary/document-preview.js +1 -1
  103. package/dist/components/Foundary/document-preview.mjs +1 -1
  104. package/dist/components/Foundary/index.d.ts +1 -0
  105. package/dist/components/Foundary/index.js +1 -1
  106. package/dist/components/Foundary/index.mjs +1 -1
  107. package/dist/components/Foundary/knowledge-browser.d.ts +1 -1
  108. package/dist/components/Foundary/knowledge-browser.js +1 -1
  109. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  110. package/dist/components/HeaderFooter/Header.mjs +1 -1
  111. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  112. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  113. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  114. package/dist/components/HeaderFooter/index.mjs +1 -1
  115. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  116. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  117. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  118. package/dist/components/Heros/PostHero/index.mjs +1 -1
  119. package/dist/components/Heros/RenderHero.mjs +1 -1
  120. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  121. package/dist/components/Heros/index.mjs +1 -1
  122. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  123. package/dist/components/Holidays/index.mjs +1 -1
  124. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  125. package/dist/components/Layouts/Print.mjs +1 -1
  126. package/dist/components/Layouts/SlideShow.mjs +1 -1
  127. package/dist/components/Layouts/index.mjs +1 -1
  128. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  129. package/dist/components/Menus/SidebarRight.mjs +1 -1
  130. package/dist/components/Menus/index.mjs +1 -1
  131. package/dist/components/Other/index.mjs +1 -1
  132. package/dist/components/Payload/RichText/index.mjs +1 -1
  133. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  134. package/dist/components/Payload/index.mjs +1 -1
  135. package/dist/components/Projects/EpicsView.mjs +1 -1
  136. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  137. package/dist/components/Projects/ProjectPage.mjs +1 -1
  138. package/dist/components/Projects/ProjectView.mjs +1 -1
  139. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  140. package/dist/components/Projects/index.mjs +1 -1
  141. package/dist/components/dc-temp/index.mjs +1 -1
  142. package/dist/components/index.js +20 -20
  143. package/dist/components/index.mjs +1 -1
  144. package/dist/components/ui/index.mjs +1 -1
  145. package/dist/components/ui/sidebar.mjs +1 -1
  146. package/dist/globals.css +1 -1
  147. package/dist/index.js +25 -25
  148. package/dist/index.mjs +1 -1
  149. package/dist/metafile-cjs.json +1 -1
  150. package/dist/metafile-esm.json +1 -1
  151. package/dist/pages/Blog.mjs +1 -1
  152. package/dist/pages/Documentation.mjs +1 -1
  153. package/dist/pages/IndexPage.mjs +1 -1
  154. package/dist/pages/Intranet.mjs +1 -1
  155. package/dist/pages/LandingPage.mjs +1 -1
  156. package/dist/pages/Page.mjs +1 -1
  157. package/dist/pages/Publish.mjs +1 -1
  158. package/dist/pages/Website.mjs +1 -1
  159. package/dist/sections/AboutSection.mjs +1 -1
  160. package/dist/sections/BlogDetail.mjs +1 -1
  161. package/dist/sections/BlogList.mjs +1 -1
  162. package/dist/sections/BlogListSection.mjs +1 -1
  163. package/dist/sections/ContactSection.mjs +1 -1
  164. package/dist/sections/PageSections.mjs +1 -1
  165. package/dist/sections/PricingSection.mjs +1 -1
  166. package/dist/sections/ServiceDetail.mjs +1 -1
  167. package/dist/sections/ServiceDetailSection.mjs +1 -1
  168. package/dist/sections/ServiceSection.mjs +1 -1
  169. package/dist/sections/index.mjs +1 -1
  170. package/package.json +1 -1
  171. package/dist/chunk-4CHIFK3W.mjs +0 -4
  172. package/dist/chunk-PE5L5LZL.mjs +0 -4
  173. package/dist/chunk-V4W2JDQB.mjs +0 -4
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var um=Object.create;var Xi=Object.defineProperty;var gm=Object.getOwnPropertyDescriptor;var fm=Object.getOwnPropertyNames;var vm=Object.getPrototypeOf,hm=Object.prototype.hasOwnProperty;var bm=(e,t)=>{for(var a in t)Xi(e,a,{get:t[a],enumerable:!0})},zs=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fm(t))!hm.call(e,i)&&i!==a&&Xi(e,i,{get:()=>t[i],enumerable:!(o=gm(t,i))||o.enumerable});return e};var oe=(e,t,a)=>(a=e!=null?um(vm(e)):{},zs(t||!e||!e.__esModule?Xi(a,"default",{value:e,enumerable:!0}):a,e)),xm=e=>zs(Xi({},"__esModule",{value:!0}),e);var wu={};bm(wu,{AppSidebarLeft:()=>or,ColleagueCard:()=>Wo,ColleagueForm:()=>Ai,ColleagueTypeSelection:()=>Rr,ColleaguesView:()=>Hi,DashboardHeader:()=>bl,DashboardPage:()=>ks,DigitalColleagueClone:()=>Ar,DigitalColleagueOptions:()=>Ir,DocumentEdit:()=>Gr,DocumentPreview:()=>Wr,FileView:()=>Gi,FoundaryLayout:()=>xr,KnowledgeBrowser:()=>Jr,KnowledgeSearch:()=>Pr,KnowledgeView:()=>_i,MainPage:()=>qn,ManagementSidebar:()=>sd,PlanningView:()=>an,ProjectView:()=>Ms,ProjectsIndexView:()=>Ls,SearchableSelect:()=>kr,TeamForm:()=>Er,TeamsIndexView:()=>Fs});module.exports=xm(wu);var hl=require("lucide-react");var Fo=oe(require("@radix-ui/react-collapsible")),ln=Fo.Root,Vs=Fo.CollapsibleTrigger,Ks=Fo.CollapsibleContent;var Tn=oe(require("clsx"));var Ys=require("clsx");var mn="-",ym=e=>{let t=Nm(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let n=l.split(mn);return n[0]===""&&n.length!==1&&n.shift(),Gs(n,t)||wm(l)},getConflictingClassGroupIds:(l,n)=>{let m=a[l]||[];return n&&o[l]?[...m,...o[l]]:m}}},Gs=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Gs(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(mn);return t.validators.find(({validator:l})=>l(r))?.classGroupId},_s=/^\[(.+)\]$/,wm=e=>{if(_s.test(e)){let t=_s.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Nm=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Sm(Object.entries(e.classGroups),a).forEach(([r,l])=>{cn(l,o,r,t)}),o},cn=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:$s(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(Cm(i)){cn(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,l])=>{cn(l,$s(t,r),a,o)})})},$s=(e,t)=>{let a=e;return t.split(mn).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Cm=e=>e.isThemeGetter,Sm=(e,t)=>t?e.map(([a,o])=>{let i=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([l,n])=>[t+l,n])):r);return[a,i]}):e,Dm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,l)=>{a.set(r,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let l=a.get(r);if(l!==void 0)return l;if((l=o.get(r))!==void 0)return i(r,l),l},set(r,l){a.has(r)?a.set(r,l):i(r,l)}}},Ws="!",Tm=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,l=n=>{let m=[],s=0,c=0,d;for(let p=0;p<n.length;p++){let S=n[p];if(s===0){if(S===i&&(o||n.slice(p,p+r)===t)){m.push(n.slice(c,p)),c=p+r;continue}if(S==="/"){d=p;continue}}S==="["?s++:S==="]"&&s--}let u=m.length===0?n:n.substring(c),v=u.startsWith(Ws),h=v?u.substring(1):u,w=d&&d>c?d-c:void 0;return{modifiers:m,hasImportantModifier:v,baseClassName:h,maybePostfixModifierPosition:w}};return a?n=>a({className:n,parseClassName:l}):l},km=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},Pm=e=>({cache:Dm(e.cacheSize),parseClassName:Tm(e),...ym(e)}),Rm=/\s+/,Am=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],l=e.trim().split(Rm),n="";for(let m=l.length-1;m>=0;m-=1){let s=l[m],{modifiers:c,hasImportantModifier:d,baseClassName:u,maybePostfixModifierPosition:v}=a(s),h=!!v,w=o(h?u.substring(0,v):u);if(!w){if(!h){n=s+(n.length>0?" "+n:n);continue}if(w=o(u),!w){n=s+(n.length>0?" "+n:n);continue}h=!1}let p=km(c).join(":"),S=d?p+Ws:p,R=S+w;if(r.includes(R))continue;r.push(R);let y=i(w,h);for(let k=0;k<y.length;++k){let q=y[k];r.push(S+q)}n=s+(n.length>0?" "+n:n)}return n};function Im(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Js(t))&&(o&&(o+=" "),o+=a);return o}var Js=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Js(e[o]))&&(a&&(a+=" "),a+=t);return a};function Mm(e,...t){let a,o,i,r=l;function l(m){let s=t.reduce((c,d)=>d(c),e());return a=Pm(s),o=a.cache.get,i=a.cache.set,r=n,n(m)}function n(m){let s=o(m);if(s)return s;let c=Am(m,a);return i(m,c),c}return function(){return r(Im.apply(null,arguments))}}var et=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},qs=/^\[(?:([a-z-]+):)?(.+)\]$/i,Em=/^\d+\/\d+$/,Bm=new Set(["px","full","screen"]),Lm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|ul)$/,Fm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|tc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|Zs|min|max))|\Zs(calc|min|max|clamp)\(.+\)|^0$/,Om=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Hm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ha=e=>Oo(e)||Bm.has(e)||Em.test(e),Qa=e=>Ho(e,"length",Wm),Oo=e=>!!e&&!Number.isNaN(Number(e)),dn=e=>Ho(e,"number",Oo),fi=e=>!!e&&Number.isInteger(Number(e)),Um=e=>e.endsWith("%")&&Oo(e.slice(0,-1)),he=e=>qs.test(e),eo=e=>Lm.test(e),zm=new Set(["length","size","percentage"]),Vm=e=>Ho(e,zm,Xs),Km=e=>Ho(e,"position",Xs),_m=new Set(["image","url"]),$m=e=>Ho(e,_m,qm),Gm=e=>Ho(e,"",Jm),vi=()=>!0,Ho=(e,t,a)=>{let o=qs.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Wm=e=>Fm.test(e)&&!Om.test(e),Xs=()=>!1,Jm=e=>Hm.test(e),qm=e=>jm.test(e);var Xm=()=>{let e=et("colors"),t=et("spacing"),a=et("blur"),o=et("brightness"),i=et("borderColor"),r=et("borderRadius"),l=et("borderSpacing"),n=et("borderWidth"),m=et("contrast"),s=et("grayscale"),c=et("hueRotate"),d=et("invert"),u=et("gap"),v=et("gradientColorStops"),h=et("gradientColorStopPositions"),w=et("inset"),p=et("margin"),S=et("opacity"),R=et("padding"),y=et("saturate"),k=et("scale"),q=et("sepia"),C=et("skew"),A=et("space"),D=et("translate"),F=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",he,t],T=()=>[he,t],Ie=()=>["",Ha,Qa],P=()=>["auto",Oo,he],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],Te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ve=()=>["start","end","center","between","around","evenly","stretch"],mt=()=>["","0",he],Jt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Oo,he];return{cacheSize:500,separator:":",theme:{colors:[vi],spacing:[Ha,Qa],blur:["none","",eo,he],brightness:H(),borderColor:[e],borderRadius:["none","","full",eo,he],borderSpacing:T(),borderWidth:Ie(),contrast:H(),grayscale:mt(),hueRotate:H(),invert:mt(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[Um,Qa],inset:L(),margin:L(),opacity:H(),padding:T(),saturate:H(),scale:H(),sepia:mt(),skew:H(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[eo]}],"break-after":[{"break-after":Jt()}],"break-before":[{"break-before":Jt()}],"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:[...I(),he]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fi,he]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:mt()}],shrink:[{shrink:mt()}],order:[{order:["first","last","none",fi,he]}],"grid-cols":[{"grid-cols":[vi]}],"col-start-end":[{col:["auto",{span:["full",fi,he]},he]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[vi]}],"row-start-end":[{row:["auto",{span:[fi,he]},he]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...Ve()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ve(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ve(),"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]}],Zs:[{Zs:[R]}],Zs:[{Zs:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],Zs:[{Zs:[p]}],Zs:[{Zs:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,t]}],"min-w":[{"min-w":[he,t,"min","max","fit"]}],"max-w":[{"max-w":[he,t,"none","full","min","max","fit","prose",{screen:[eo]},eo]}],h:[{h:[he,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,t,"auto","min","max","fit"]}],"font-size":[{text:["base",eo,Qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dn]}],"font-family":[{font:[vi]}],"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",he]}],"line-clamp":[{"line-clamp":["none",Oo,dn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ha,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","Zs-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ha,Qa]}],"underline-offset":[{"underline-offset":["auto",Ha,he]}],"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],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",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),Km]}],"bg-repeat":[{bg:["Zs-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vm]}],"bg-image":[{bg:["none",{"gradient-hl":["t","tr","r","Zi","Zs","bl","l","ul"]},$m]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-hl-pos":[{hl:[h]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-hl":[{hl:[v]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-Zs":[{"rounded-Zs":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-Zs":[{"rounded-Zs":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-ul":[{"rounded-ul":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-Zi":[{"rounded-Zi":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-Zs":[{"border-Zs":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:_()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-Zs":[{"border-Zs":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[Ha,he]}],"outline-w":[{outline:[Ha,Qa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Ha,Qa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",eo,Gm]}],"shadow-color":[{shadow:[vi]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Te()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",eo,he]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"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",he]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[fi,he]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],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","Zs-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Zs-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-Zs":[{"scroll-Zs":T()}],"scroll-Zs":[{"scroll-Zs":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-Zs":[{"scroll-Zs":T()}],"scroll-Zs":[{"scroll-Zs":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",he]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ha,Qa,dn]}],stroke:[{stroke:[e,"none"]}],Zs:["Zs-only","not-Zs-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","Zs","Zs","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","Zs","Zs","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-Zs","rounded-l","rounded-ss","rounded-se","rounded-Zs","rounded-es","rounded-ul","rounded-tr","rounded-Zi","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-Zs"],"rounded-t":["rounded-ul","rounded-tr"],"rounded-r":["rounded-tr","rounded-Zi"],"rounded-Zs":["rounded-Zi","rounded-bl"],"rounded-l":["rounded-ul","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-Zs","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-Zs"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-Zs","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-Zs"],"scroll-m":["scroll-mx","scroll-my","scroll-Zs","scroll-Zs","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-Zs","scroll-Zs","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"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 Yi=Mm(Xm);function g(...e){return Yi((0,Ys.clsx)(e))}var Zs=require("react/jsx-runtime");function jt({className:e,...t}){return(0,Zs.jsx)("div",{className:g("animate-pulse rounded-md bg-primary/10",e),...t})}var we=oe(require("react")),jo=require("@radix-ui/react-slot"),ul=require("class-variance-authority");var Zi=require("react"),Qs=(e=768)=>{let[t,a]=(0,Zi.useState)(!1);return(0,Zi.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var al=oe(require("react")),hi=(0,ul.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"}}}),x=al.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,Zs.jsx)(e?jo.Slot:"button",{className:g(hi({className:t,size:a,variant:o})),ref:r,...i}));x.displayName="Button";var il=oe(require("react"));var z=il.forwardRef(({className:e,type:t,...a},o)=>(0,Zs.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}));z.displayName="Input";var nl=oe(require("react")),pn=oe(require("@radix-ui/react-separator"));var bi=nl.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,Zs.jsx)(pn.Root,{ref:i,decorative:a,orientation:t,className:g("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));bi.displayName=pn.Root.displayName;var xi=oe(require("react")),At=oe(require("@radix-ui/react-dialog")),ll=require("@radix-ui/react-icons");var cl=At.Root;var Ym=At.Portal,ml=xi.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(At.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}));ml.displayName=At.Overlay.displayName;var Zm=(0,ul.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-Zs data-[state=closed]:slide-out-hl-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-hl-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-hl-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-hl-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),un=xi.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,Zs.jsxs)(Ym,{children:[(0,Zs.jsx)(ml,{}),(0,Zs.jsxs)(At.Content,{ref:i,className:g(Zm({side:e}),t),...o,children:[(0,Zs.jsxs)(At.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,Zs.jsx)(ll.Cross2Icon,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{className:"Zs-only",children:"Close"})]}),a]})]}));un.displayName=At.Content.displayName;var Qm=({className:e,...t})=>(0,Zs.jsx)("div",{className:g("flex flex-col space-y-2 text-center sm:text-left",e),...t});Qm.displayName="SheetHeader";var ep=({className:e,...t})=>(0,Zs.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ep.displayName="SheetFooter";var tp=xi.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(At.Title,{ref:a,className:g("text-lg font-semibold text-foreground",e),...t}));tp.displayName=At.Title.displayName;var ap=xi.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(At.Description,{ref:a,className:g("text-sm text-muted-foreground",e),...t}));ap.displayName=At.Description.displayName;var pl=oe(require("react")),ha=oe(require("@radix-ui/react-tooltip"));var Ta=ha.Provider,ka=ha.Root,Pa=ha.Trigger,ba=pl.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Zs.jsx)(ha.Portal,{children:(0,Zs.jsx)(ha.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})}));ba.displayName=ha.Content.displayName;var op="sidebar:state",ip=60*60*24*7,rp="16rem",np="18rem",sp="3rem",lp="Zs",fl=we.createContext(null);function Qi(){let e=we.useContext(fl);if(!e)throw new Error("useSidebar must Zs used within a SidebarProvider.");return e}var fn=we.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...l},n)=>{let m=Qs(),[s,c]=we.useState(!1),[d,u]=we.useState(e),v=t??d,h=we.useCallback(R=>{if(a)return a?.(typeof R=="function"?R(v):R);u(R),document.cookie=`${op}=${v}; path=/; max-age=${ip}`},[a,v]),w=we.useCallback(()=>m?c(R=>!R):h(R=>!R),[m,h,c]);we.useEffect(()=>{let R=y=>{y.key===lp&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);let p=v?"expanded":"collapsed",S=we.useMemo(()=>({state:p,open:v,setOpen:h,isMobile:m,openMobile:s,setOpenMobile:c,toggleSidebar:w}),[p,v,h,m,s,c,w]);return(0,Zs.jsx)(fl.Provider,{value:S,children:(0,Zs.jsx)(Ta,{delayDuration:0,children:(0,Zs.jsx)("div",{style:{"--sidebar-width":rp,"--sidebar-width-icon":sp,...i},className:g("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:n,...l,children:r})})})});fn.displayName="SidebarProvider";var vn=we.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},l)=>{let{isMobile:n,state:m,openMobile:s,setOpenMobile:c}=Qi();return a==="none"?(0,Zs.jsx)("div",{className:g("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:l,...r,children:i}):n?(0,Zs.jsx)(cl,{open:s,onOpenChange:c,...r,children:(0,Zs.jsx)(un,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":np},side:e,children:(0,Zs.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,Zs.jsxs)("div",{ref:l,className:"group peer hidden md:block text-sidebar-foreground","data-state":m,"data-collapsible":m==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,Zs.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)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,Zs.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)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,Zs.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:i})})]})});vn.displayName="Sidebar";var hn=we.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=Qi();return(0,Zs.jsxs)(x,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:g("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,Zs.jsx)(hl.PanelLeft,{}),(0,Zs.jsx)("span",{className:"Zs-only",children:"Toggle Sidebar"})]})});hn.displayName="SidebarTrigger";var dp=we.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=Qi();return(0,Zs.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]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]: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]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});dp.displayName="SidebarRail";var bn=we.forwardRef(({className:e,...t},a)=>(0,Zs.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]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-ul md:peer-data-[variant=inset]:shadow",e),...t}));bn.displayName="SidebarInset";var cp=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(z,{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}));cp.displayName="SidebarInput";var xn=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,"data-sidebar":"header",className:g("flex flex-col gap-2 p-2",e),...t}));xn.displayName="SidebarHeader";var yn=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,"data-sidebar":"footer",className:g("flex flex-col gap-2 p-2",e),...t}));yn.displayName="SidebarFooter";var mp=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(bi,{ref:a,"data-sidebar":"separator",className:g("mx-2 w-auto bg-sidebar-border",e),...t}));mp.displayName="SidebarSeparator";var er=we.forwardRef(({className:e,...t},a)=>(0,Zs.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}));er.displayName="SidebarContent";var tr=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,"data-sidebar":"group",className:g("relative flex w-full min-w-0 flex-col p-2",e),...t}));tr.displayName="SidebarGroup";var pp=we.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Zs.jsx)(t?jo.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}));pp.displayName="SidebarGroupLabel";var up=we.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Zs.jsx)(t?jo.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}));up.displayName="SidebarGroupAction";var wn=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,"data-sidebar":"group-content",className:g("w-full text-sm",e),...t}));wn.displayName="SidebarGroupContent";var yi=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("ul",{ref:a,"data-sidebar":"menu",className:g("flex w-full min-w-0 flex-col gap-1",e),...t}));yi.displayName="SidebarMenu";var wi=we.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:g("group/menu-item relative",e),...t}));wi.displayName="SidebarMenuItem";var gp=(0,ul.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"}}),ar=we.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...l},n)=>{let m=e?jo.Slot:"button",{isMobile:s,state:c}=Qi(),d=(0,Zs.jsx)(m,{ref:n,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:g(gp({variant:a,size:o}),r),...l});return i?(typeof i=="string"&&(i={children:i}),(0,Zs.jsxs)(ka,{children:[(0,Zs.jsx)(Pa,{asChild:!0,children:d}),(0,Zs.jsx)(ba,{side:"right",align:"center",hidden:c!=="collapsed"||s,...i})]})):d});ar.displayName="SidebarMenuButton";var Nn=we.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,Zs.jsx)(t?jo.Slot:"button",{ref:i,"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}));Nn.displayName="SidebarMenuAction";var fp=we.forwardRef(({className:e,...t},a)=>(0,Zs.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}));fp.displayName="SidebarMenuBadge";var vp=we.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=we.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,Zs.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,Zs.jsx)(jt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,Zs.jsx)(jt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});vp.displayName="SidebarMenuSkeleton";var Cn=we.forwardRef(({className:e,...t},a)=>(0,Zs.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}));Cn.displayName="SidebarMenuSub";var Sn=we.forwardRef(({...e},t)=>(0,Zs.jsx)("li",{ref:t,...e}));Sn.displayName="SidebarMenuSubItem";var Dn=we.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...i},r)=>(0,Zs.jsx)(e?jo.Slot:"a",{ref:r,"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),...i}));Dn.displayName="SidebarMenuSubButton";function or({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:i,pathName:r,menuHeading:l,onNavClick:n,loading:m=!1,LinkComponent:s,...c}){let u=s?v=>(0,Zs.jsx)(s,{...v}):n?({href:v,children:h,...w})=>(0,Zs.jsx)("button",{onClick:()=>n&&n(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...w,children:h}):v=>(0,Zs.jsx)("a",{...v});return(0,Zs.jsxs)(vn,{...c,variant:"inset",children:[(0,Zs.jsx)(xn,{children:(0,Zs.jsx)(yi,{children:(0,Zs.jsx)(wi,{children:m?(0,Zs.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Zs.jsx)(jt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,Zs.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,Zs.jsx)("span",{className:"truncate font-semibold",children:o}),i&&(0,Zs.jsx)("span",{className:"truncate text-sm",children:i})]})})})}),m&&(0,Zs.jsxs)(er,{children:[(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"}),(0,Zs.jsx)(jt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,Zs.jsxs)(er,{children:[(0,Zs.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!m&&a.map((v,h)=>(0,Zs.jsx)(vl,{subNav:v,pathName:r,Link:u},h)),(0,Zs.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!m&&e.map((v,h)=>(0,Zs.jsx)(vl,{subNav:v,pathName:r,Link:u},h)),(0,Zs.jsx)(tr,{className:"mt-auto",children:(0,Zs.jsx)(wn,{children:(0,Zs.jsx)(yi,{children:t&&!m&&t.map(v=>(0,Zs.jsx)(wi,{children:(0,Zs.jsx)(ar,{asChild:!0,size:"sm",children:(0,Zs.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,Zs.jsx)(v.icon,{}),(0,Zs.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,Zs.jsx)(yn,{})]})}function vl({subNav:e,pathName:t,Link:a}){let o=e,i=!1;return o.links&&o.links.map(r=>{r.url===t&&(i=!0)}),(0,Zs.jsx)(ln,{defaultOpen:!0,className:"group/collapsible",children:(0,Zs.jsx)(tr,{className:"py-0",children:(0,Zs.jsx)(yi,{children:(0,Zs.jsx)(ln,{asChild:!0,defaultOpen:o.isActive,children:(0,Zs.jsxs)(wi,{children:[(0,Zs.jsx)(ar,{asChild:!0,tooltip:o.label,className:(0,Tn.default)(i&&"font-bold text-accent"),children:(0,Zs.jsxs)(a,{href:o.url,children:[o.icon&&(0,Zs.jsx)(o.icon,{}),(0,Zs.jsx)("span",{children:o.label})]})}),o.links?.length?(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(Vs,{asChild:!0,children:(0,Zs.jsxs)(Nn,{className:"data-[state=open]:rotate-90",children:[(0,Zs.jsx)(hl.ChevronRight,{}),(0,Zs.jsx)("span",{className:"Zs-only",children:"Toggle"})]})}),(0,Zs.jsx)(Ks,{children:(0,Zs.jsx)(Cn,{children:o.links?.map(r=>(0,Zs.jsx)(Sn,{children:(0,Zs.jsx)(Dn,{asChild:!0,className:(0,Tn.default)(r.url===t&&"font-bold text-accent"),children:(0,Zs.jsx)(a,{href:r.url,children:(0,Zs.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var ir=oe(require("react")),ja=oe(require("@radix-ui/react-avatar"));var ea=ir.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(ja.Root,{ref:a,className:g("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ea.displayName=ja.Root.displayName;var fo=ir.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(ja.Image,{ref:a,className:g("aspect-square h-full w-full",e),...t}));fo.displayName=ja.Image.displayName;var ta=ir.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(ja.Fallback,{ref:a,className:g("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ta.displayName=ja.Fallback.displayName;var Ua=oe(require("react")),ke=oe(require("@radix-ui/react-dropdown-menu"));var Ra=ke.Root,Aa=ke.Trigger;var hp=Ua.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,Zs.jsxs)(ke.SubTrigger,{ref:i,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&&"pl-8",e),...o,children:[a,(0,Zs.jsx)(ll.ChevronRightIcon,{className:"ml-auto"})]}));hp.displayName=ke.SubTrigger.displayName;var bp=Ua.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(ke.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}));bp.displayName=ke.SubContent.displayName;var xa=Ua.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Zs.jsx)(ke.Portal,{children:(0,Zs.jsx)(ke.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})}));xa.displayName=ke.Content.displayName;var qt=Ua.forwardRef(({className:e,inset:t,...a},o)=>(0,Zs.jsx)(ke.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&&"pl-8",e),...a}));qt.displayName=ke.Item.displayName;var xp=Ua.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,Zs.jsxs)(ke.CheckboxItem,{ref:i,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-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,Zs.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Zs.jsx)(ke.ItemIndicator,{children:(0,Zs.jsx)(ll.CheckIcon,{className:"h-4 w-4"})})}),t]}));xp.displayName=ke.CheckboxItem.displayName;var yp=Ua.forwardRef(({className:e,children:t,...a},o)=>(0,Zs.jsxs)(ke.RadioItem,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-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,Zs.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Zs.jsx)(ke.ItemIndicator,{children:(0,Zs.jsx)(ll.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));yp.displayName=ke.RadioItem.displayName;var kn=Ua.forwardRef(({className:e,inset:t,...a},o)=>(0,Zs.jsx)(ke.Label,{ref:o,className:g("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));kn.displayName=ke.Label.displayName;var Pn=Ua.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(ke.Separator,{ref:a,className:g("-mx-1 my-1 h-px bg-muted",e),...t}));Pn.displayName=ke.Separator.displayName;var wp=({className:e,...t})=>(0,Zs.jsx)("span",{className:g("ml-auto text-xs tracking-widest opacity-60",e),...t});wp.displayName="DropdownMenuShortcut";var bl=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,Zs.jsx)("header",{className:"border-Zs bg-white/80 backdrop-blur-md dark:bg-slate-900/80 sticky top-0 z-50",children:(0,Zs.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,Zs.jsx)(x,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Zs.jsx)(hl.Menu,{className:"h-5 w-5"})}),(0,Zs.jsx)("h1",{className:"text-2xl font-bold bg-gradient-hl-r from-blue-600 hl-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,Zs.jsxs)(x,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,Zs.jsx)(hl.Bell,{className:"h-5 w-5"}),(0,Zs.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,Zs.jsxs)(Ra,{children:[(0,Zs.jsx)(Aa,{asChild:!0,children:(0,Zs.jsx)(x,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,Zs.jsxs)(ea,{className:"h-10 w-10",children:[(0,Zs.jsx)(fo,{src:"/avatars/01.png",alt:"@user"}),(0,Zs.jsx)(ta,{children:"JD"})]})})}),(0,Zs.jsxs)(xa,{className:"w-56",align:"end",forceMount:!0,children:[(0,Zs.jsx)(kn,{className:"font-normal",children:(0,Zs.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,Zs.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,Zs.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,Zs.jsx)(Pn,{}),(0,Zs.jsxs)(qt,{children:[(0,Zs.jsx)(hl.User,{className:"mr-2 h-4 w-4"}),(0,Zs.jsx)("span",{children:"Profile"})]}),(0,Zs.jsxs)(qt,{children:[(0,Zs.jsx)(hl.Settings,{className:"mr-2 h-4 w-4"}),(0,Zs.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var fr=oe(require("react")),In=oe(require("next/link"));var yl=(0,ul.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 se({className:e,variant:t,...a}){return(0,Zs.jsx)("div",{className:g(yl({variant:t}),e),...a})}var Rn=oe(require("react")),la=oe(require("@radix-ui/react-scroll-area"));var Ia=Rn.forwardRef(({className:e,children:t,...a},o)=>(0,Zs.jsxs)(la.Root,{ref:o,className:g("relative overflow-hidden",e),...a,children:[(0,Zs.jsx)(la.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Zs.jsx)(Nl,{}),(0,Zs.jsx)(la.Corner,{})]}));Ia.displayName=la.Root.displayName;var Nl=Rn.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Zs.jsx)(la.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,Zs.jsx)(la.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Nl.displayName=la.ScrollAreaScrollbar.displayName;var Ni=oe(require("react")),Mt=oe(require("@radix-ui/react-dialog"));var Ue=Mt.Root;var nr=Mt.Portal;var Ci=Ni.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Mt.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}));Ci.displayName=Mt.Overlay.displayName;var Ke=Ni.forwardRef(({className:e,children:t,...a},o)=>(0,Zs.jsxs)(nr,{children:[(0,Zs.jsx)(Ci,{}),(0,Zs.jsxs)(Mt.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-hl-left-1/2 data-[state=closed]:slide-out-hl-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,Zs.jsxs)(Mt.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,Zs.jsx)(hl.Zs,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{className:"Zs-only",children:"Close"})]})]})]}));Ke.displayName=Mt.Content.displayName;var _e=({className:e,...t})=>(0,Zs.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_e.displayName="DialogHeader";var zo=({className:e,...t})=>(0,Zs.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});zo.displayName="DialogFooter";var $e=Ni.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Mt.Title,{ref:a,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));$e.displayName=Mt.Title.displayName;var Vo=Ni.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Mt.Description,{ref:a,className:g("text-sm text-muted-foreground",e),...t}));Vo.displayName=Mt.Description.displayName;var Si=oe(require("@radix-ui/react-checkbox")),Dl=oe(require("react")),vo=Dl.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Si.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,Zs.jsx)(Si.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,Zs.jsx)(hl.Check,{className:"h-4 w-4"})})}));vo.displayName=Si.Root.displayName;var Ma=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var kl=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Zs.jsx)(hl.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,Zs.jsx)(hl.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,Zs.jsx)(hl.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,Zs.jsx)(hl.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Zs",name:"Human Resources",description:"People operations and talent management",icon:(0,Zs.jsx)(hl.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,Zs.jsx)(hl.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,Zs.jsx)(hl.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,Zs.jsx)(hl.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"Zs",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Zs.jsx)(hl.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,Zs.jsx)(hl.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],cr=[{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 An=[{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}],lr=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned hl 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}],pr=[{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")}],Np=[...pr,{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 io 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")}],Cp=[...cr,{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}],dr={projects:[{id:"1",name:"Empty Project",description:"A project with Zs 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:[]},Tl={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:pr.filter(e=>e.epicId==="1")};var jg={empty:{initialProjects:dr.projects,initialEpics:dr.epics,initialSprints:dr.sprints,initialTasks:dr.tasks},default:{initialProjects:cr,initialEpics:An,initialSprints:lr,initialTasks:pr},highDensity:{initialProjects:cr,initialEpics:An,initialSprints:lr,initialTasks:Np},singleEpic:{initialProjects:cr,initialEpics:Tl.epics,initialSprints:lr,initialTasks:Tl.tasks},multipleProjects:{initialProjects:Cp,initialEpics:An,initialSprints:lr,initialTasks:pr}},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(Ma),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ma),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 io 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(Ma),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ma),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 hl 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(Ma),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ma),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(Ma),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ma),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 hl customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases hl human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Ma),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ma),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Ug=[{id:"1",title:"Review quarterly report",description:"Zi 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 hl production",description:"Deploy the latest version hl 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 zg=mr.filter(e=>e.type==="digital");function gr(e,t){let[a,o]=(0,Zi.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Zi.useEffect)(()=>{i(a)},[]),[a,i]}function Mn({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=kl[0],onBusinessUnitChange:r,onSearch:l,className:n,logo:m="/headerlogo.png",appName:s="Nuvia",tagline:c="Collaboration Platform"}){let[d,u]=fr.useState({}),[v,h]=gr("sidebar-favorites",{}),[w,p]=fr.useState(null),[S,R]=fr.useState(""),y=P=>{u(I=>({...I,[P]:!I[P]}))},k=P=>{r?.(P)},q=()=>{S.trim()&&l?.(S.trim())},C=P=>{P.key==="Enter"&&(P.preventDefault(),q())},A=(P,I)=>{let _=v[P]||[],Te=_.includes(I)?_.filter(Ve=>Ve!==I):_.concat(I);h({...v,[P]:Te})},D=P=>{if(!P.items||!P.maxItems||P.items.length<=P.maxItems)return P.items||[];let I=v[P.id]||[],_=P.items.filter(Ve=>I.includes(Ve.id)),Te=P.items.filter(Ve=>!I.includes(Ve.id));return[..._,...Te].slice(0,P.maxItems)},F=P=>P.maxItems&&P.items&&P.items.length>P.maxItems,U=e,L=P=>{let I=F(P),_=D(P),Te=(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,Zs.jsx)("span",{children:P.title})]}),P.badge&&(0,Zs.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:P.badge}),P.items&&(0,Zs.jsx)(hl.ChevronDown,{className:g("ml-2 h-4 w-4 transition-transform",d[P.title]?"rotate-180":"")})]}),Ve=g("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",P.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return P.url?(0,Zs.jsx)(In.default,{href:P.url,className:Ve,onClick:a?o:void 0,children:Te}):(0,Zs.jsx)("button",{className:Ve,onClick:()=>P.items&&y(P.title),children:Te})},T=()=>{let P=e.find(_=>_.id===w);if(!P||!P.items||!P.maxItems)return null;let I=v[P.id]||[];return(0,Zs.jsx)(Ue,{open:!!w,onOpenChange:_=>!_&&p(null),children:(0,Zs.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Zs.jsxs)(_e,{children:[(0,Zs.jsxs)($e,{children:["Manage ",P.title," Favorites"]}),(0,Zs.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up hl ",P.maxItems," items hl show in ",P.title.toLowerCase(),"."]})]}),(0,Zs.jsx)(Ia,{className:"max-h-96 pr-4",children:(0,Zs.jsx)("div",{className:"space-y-4",children:P.items.map(_=>(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)(vo,{id:_.id,checked:I.includes(_.id),onCheckedChange:()=>A(P.id,_.id),disabled:!I.includes(_.id)&&I.length>=(P.maxItems||0)}),(0,Zs.jsxs)("label",{htmlFor:_.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:[_.title,_.badge&&(0,Zs.jsx)(se,{variant:"outline",className:"text-xs",children:_.badge})]})]},_.id))})})]})})},Ie=(0,Zs.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Zs.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Zs.jsx)("img",{src:m,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h2",{className:"font-semibold",children:s}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})]}),a&&(0,Zs.jsx)(x,{variant:"ghost",size:"icon",onClick:o,children:(0,Zs.jsx)(hl.Zs,{className:"h-5 w-5"})})]}),(0,Zs.jsx)("div",{className:"px-3 py-2",children:(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)(hl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Zs.jsx)(z,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:S,onChange:P=>R(P.target.value),onKeyPress:C})]})}),(0,Zs.jsx)(Ia,{className:"flex-1 px-3 py-2",children:(0,Zs.jsx)("div",{className:"space-y-1",children:U.map(P=>(0,Zs.jsxs)("div",{className:"mb-1",children:[L(P),P.items&&d[P.title]&&(0,Zs.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[D(P).map(I=>(0,Zs.jsxs)(In.default,{href:I.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[I.title,I.badge&&(0,Zs.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:I.badge})]},I.id)),F(P)&&P.items&&P.items.length>D(P).length&&(0,Zs.jsxs)("button",{onClick:()=>p(P.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:["...",P.items.length-D(P).length," more available"]})]})]},P.id))})}),(0,Zs.jsx)("div",{className:"p-3",children:(0,Zs.jsx)("div",{className:"space-y-1",children:(0,Zs.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,Zs.jsx)(hl.Settings,{className:"h-5 w-5"}),(0,Zs.jsx)("span",{children:"Settings"})]})})}),(0,Zs.jsx)(T,{})]});return a?(0,Zs.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",n),children:Ie}):(0,Zs.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",n),children:Ie})}var io=require("motion/react");var Pl=require("next-themes");function Rl(){let{setTheme:e,theme:t}=(0,Pl.useTheme)();return(0,Zs.jsx)(Ta,{children:(0,Zs.jsxs)(ka,{children:[(0,Zs.jsx)(Pa,{asChild:!0,children:(0,Zs.jsxs)(x,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Zs.jsx)(hl.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Zs.jsx)(hl.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Zs.jsx)("span",{className:"Zs-only",children:"Toggle theme"})]})}),(0,Zs.jsx)(ba,{children:"Toggle theme"})]})})}function Al({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let l=e.filter(s=>!s.read),n=l.length,m=s=>{switch(s){case"info":return(0,Zs.jsx)(hl.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Zs.jsx)(hl.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Zs.jsx)(hl.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Zs.jsx)(hl.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Zs.jsx)(io.AnimatePresence,{children:t&&(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(io.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,Zs.jsx)(io.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",r),children:(0,Zs.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between border-Zs p-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.Bell,{className:"h-5 w-5"}),(0,Zs.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,Zs.jsxs)(se,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,Zs.jsxs)(x,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Zs.jsx)(hl.Zs,{className:"h-5 w-5"}),(0,Zs.jsx)("span",{className:"Zs-only",children:"Close"})]})]}),n>0&&(0,Zs.jsxs)("div",{className:"flex items-center justify-between border-Zs p-2",children:[(0,Zs.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,Zs.jsx)(x,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,Zs.jsx)(Ia,{className:"flex-1",children:(0,Zs.jsx)("div",{className:"divide-y",children:l.map(s=>(0,Zs.jsxs)("div",{className:g("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Zs.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:m(s.type)}),(0,Zs.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)("p",{className:"font-medium",children:s.title}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:s.time}),(0,Zs.jsx)(x,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(s.id),title:"Dismiss",children:(0,Zs.jsx)(hl.Check,{className:"h-3 w-3"})})]})]}),(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground",children:s.description}),s.actionLabel&&(0,Zs.jsxs)(x,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:s.onAction,children:[s.actionLabel,(0,Zs.jsx)(hl.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},s.id))})}):(0,Zs.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Zs.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Zs.jsx)(hl.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Zs.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Zs.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var ho=oe(require("@radix-ui/react-tabs"));function Il({className:e,...t}){return(0,Zs.jsx)(ho.Root,{"data-slot":"tabs",className:g("flex flex-col gap-2",e),...t})}function Ml({className:e,...t}){return(0,Zs.jsx)(ho.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 El({className:e,...t}){return(0,Zs.jsx)(ho.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 Ko({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let l=a.find(n=>n.value===e);return(0,$t.jsxs)(io.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,$t.jsx)("div",{className:"hidden lg:block",children:(0,$t.jsx)(Il,{value:e,onValueChange:t,children:(0,$t.jsx)(Ml,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,$t.jsx)(io.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,$t.jsx)(El,{value:n.value,className:"w-full h-8 rounded-ul data-[state=active]:rounded-ul transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,$t.jsx)("div",{className:"lg:hidden",children:(0,$t.jsxs)(Ra,{children:[(0,$t.jsx)(Aa,{asChild:!0,children:(0,$t.jsxs)(x,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,$t.jsx)(hl.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,$t.jsx)(xa,{align:"center",className:"w-[180px]",children:a.map(n=>(0,$t.jsx)(qt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function Ll({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:l="assistant",onTabChange:n,showTabs:m=!0,tabOptions:s=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:c,actionIcon:d=(0,Zs.jsx)(hl.Bot,{className:"mr-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:v,onRemoveAll:h,logo:w="/headerlogo.png",appName:p="Nuvia",tagline:S="Collaboration Platform"}){let[R,y]=(0,Zi.useState)(!1),[k,q]=(0,Zi.useState)(t),C=k.filter(F=>!F.read).length,A=F=>{q(U=>U.filter(L=>L.id!==F)),v?.(F)},D=()=>{q(F=>F.filter(U=>U.read)),h?.()};return(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,Zs.jsx)(x,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Zs.jsx)(hl.Menu,{className:"h-5 w-5"})}),(0,Zs.jsx)(x,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Zs.jsx)(hl.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,Zs.jsxs)(io.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Zs.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Zs.jsx)("img",{src:w,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h2",{className:"font-semibold text-sm",children:p}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:S})]})]}),(0,Zs.jsxs)("div",{className:"flex flex-1 items-center",children:[m&&(0,Zs.jsx)(Ko,{activeTab:l,onTabChange:n,tabOptions:s}),(0,Zs.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Zs.jsx)(io.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,Zs.jsx)(io.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Zs.jsxs)(x,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:c,children:[d,u]})})}),(0,Zs.jsx)(Rl,{}),(0,Zs.jsx)(Ta,{children:(0,Zs.jsxs)(ka,{children:[(0,Zs.jsx)(Pa,{asChild:!0,children:(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Zs.jsxs)(x,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>y(!0),children:[(0,Zs.jsx)(io.motion.div,{animate:C>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:C>0?1/0:0,repeatDelay:3},children:(0,Zs.jsx)(hl.Bell,{className:"h-5 w-5"})}),C>0&&(0,Zs.jsx)(io.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:C})]})})}),(0,Zs.jsx)(ba,{children:"Notifications"})]})}),(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Zs.jsxs)(ea,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Zs.jsx)(fo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Zs.jsx)(ta,{})]})})]})]})]}),(0,Zs.jsx)(Al,{notifications:k,open:R,onClose:()=>y(!1),onNotificationRemove:A,onRemoveAll:D})]})}var Fl=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Zs.jsx)(hl.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function xr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=Fl[0],onBusinessUnitChange:r,onSearch:l,businessUnits:n=Fl,activeTab:m,onTabChange:s,showTabs:c=!1,onActionClick:d,actionIcon:u,actionText:v="Action",onNotificationRemove:h,onRemoveAll:w,logo:p="/headerlogo.png",appName:S="Nuvia",tagline:R="Collaboration Platform",sidebarInitiallyClosed:y=!1}){let[k,q]=(0,Zi.useState)(!y),[C,A]=(0,Zi.useState)(!1),[D,F]=(0,Zi.useState)(i),U=L=>{F(L),r?.(L)};return(0,Zs.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-ul bg-background w-[]",children:[C&&(0,Zs.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>A(!1)}),(0,Zs.jsx)("div",{className:"md:hidden",children:(0,Zs.jsx)(Mn,{items:e,isOpen:C,isMobile:!0,onClose:()=>A(!1),currentBusinessUnit:D,onBusinessUnitChange:U,onSearch:l,logo:p,appName:S,tagline:R})}),(0,Zs.jsx)("div",{className:"hidden md:block",children:(0,Zs.jsx)(Mn,{items:e,isOpen:k,isMobile:!1,currentBusinessUnit:D,onBusinessUnitChange:U,onSearch:l,logo:p,appName:S,tagline:R})}),(0,Zs.jsxs)("div",{className:g("min-h-screen fixed w-full transition-all duration-300 ease-in-out",k?"md:pl-64":"md:pl-0"),children:[(0,Zs.jsx)(Ll,{title:a,notifications:o,onToggleSidebar:()=>q(!k),onToggleMobileMenu:()=>A(!0),sidebarOpen:k,activeTab:m,onTabChange:s,showTabs:c,onActionClick:d,actionIcon:u,actionText:v,onNotificationRemove:h,onRemoveAll:w,logo:p,appName:S,tagline:R}),(0,Zs.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var _o=oe(require("react"));var Ln=_o.forwardRef(({...e},t)=>(0,Zs.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));Ln.displayName="Breadcrumb";var Fn=_o.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("Zs",{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}));Fn.displayName="BreadcrumbList";var wr=_o.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("li",{ref:a,className:g("inline-flex items-center gap-1.5",e),...t}));wr.displayName="BreadcrumbItem";var On=_o.forwardRef(({asChild:e,className:t,...a},o)=>(0,Zs.jsx)(e?jo.Slot:"a",{ref:o,className:g("transition-colors hover:text-foreground",t),...a}));On.displayName="BreadcrumbLink";var Hn=_o.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:g("font-normal text-foreground",e),...t}));Hn.displayName="BreadcrumbPage";var jn=({children:e,className:t,...a})=>(0,Zs.jsx)("li",{role:"presentation","aria-hidden":"true",className:g("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,Zs.jsx)(ll.ChevronRightIcon,{})});jn.displayName="BreadcrumbSeparator";var Sp=({className:e,...t})=>(0,Zs.jsxs)("span",{role:"presentation","aria-hidden":"true",className:g("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,Zs.jsx)(ll.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{className:"Zs-only",children:"More"})]});Sp.displayName="BreadcrumbElipssis";var Sr=oe(require("react")),Dp=1,Tp=1e6;var Un=0;function kp(){return Un=(Un+1)%Number.MAX_SAFE_INTEGER,Un.toString()}var zn=new Map,jl=e=>{if(zn.has(e))return;let t=setTimeout(()=>{zn.delete(e),Ti({type:"REMOVE_TOAST",toastId:e})},Tp);zn.set(e,t)},Pp=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Dp)};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?jl(a):e.toasts.forEach(o=>{jl(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)}}},Nr=[],Cr={toasts:[]};function Ti(e){Cr=Pp(Cr,e),Nr.forEach(t=>{t(Cr)})}function Rp({...e}){let t=kp(),a=i=>Ti({type:"UPDATE_TOAST",toast:{...i,id:t}}),o=()=>Ti({type:"DISMISS_TOAST",toastId:t});return Ti({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||o()}}}),{id:t,dismiss:o,update:a}}function Ul(){let[e,t]=Sr.useState(Cr);return Sr.useEffect(()=>(Nr.push(t),()=>{let a=Nr.indexOf(t);a>-1&&Nr.splice(a,1)}),[e]),{...e,toast:Rp,dismiss:a=>Ti({type:"DISMISS_TOAST",toastId:a})}}var bo=oe(require("react")),Ct=oe(require("@radix-ui/react-toast"));var Kl=Ct.Provider,Vn=bo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Ct.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}));Vn.displayName=Ct.Viewport.displayName;var Ap=(0,ul.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-hl-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"}}),Kn=bo.forwardRef(({className:e,variant:t,...a},o)=>(0,Zs.jsx)(Ct.Root,{ref:o,className:g(Ap({variant:t}),e),...a}));Kn.displayName=Ct.Root.displayName;var Ip=bo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Ct.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}));Ip.displayName=Ct.Action.displayName;var _n=bo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Ct.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,Zs.jsx)(hl.Zs,{className:"h-4 w-4"})}));_n.displayName=Ct.Close.displayName;var $n=bo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Ct.Title,{ref:a,className:g("text-sm font-semibold [&+div]:text-xs",e),...t}));$n.displayName=Ct.Title.displayName;var Gn=bo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Ct.Description,{ref:a,className:g("text-sm opacity-90",e),...t}));Gn.displayName=Ct.Description.displayName;function _l(){let{toasts:e}=Ul();return(0,Zs.jsxs)(Kl,{children:[e.map(function({id:t,title:a,description:o,action:i,...r}){return(0,Zs.jsxs)(Kn,{...r,children:[(0,Zs.jsxs)("div",{className:"grid gap-1",children:[a&&(0,Zs.jsx)($n,{children:a}),o&&(0,Zs.jsx)(Gn,{children:o})]}),i,(0,Zs.jsx)(_n,{})]},t)}),(0,Zs.jsx)(Vn,{})]})}var $l=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let i=e.includes("hl-")?e+" ":"hl-"+e+" ",r="hl-"+t,l=o??"",n=i+r+" hl-"+a+" "+l;return(0,Zs.jsx)("i",{className:n})};var $o=require("@headlessui/react"),Jl=require("@heroicons/react/20/solid");var Mp=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,Zs.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,Zs.jsxs)("span",{className:"relative",children:[e,(0,Zs.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,Zs.jsxs)($o.Popover,{children:[(0,Zs.jsxs)($o.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,Zs.jsxs)("span",{className:"relative",children:[e,(0,Zs.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,Zs.jsx)(Jl.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,Zs.jsxs)($o.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,Zs.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 ul:gap-x-8 z-50",children:t&&t.map(i=>(0,Zs.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,Zs.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:i.icon&&(0,Zs.jsx)(Wl,{icon:i.icon,size:"4x"})}),(0,Zs.jsxs)("a",{href:i.href,className:"mt-6 block text-popover-foreground group-hover:text-accent",children:[i.name,(0,Zs.jsx)("span",{className:"absolute inset-0"})]}),(0,Zs.jsx)("p",{className:"mt-1 text-popover-foreground/80 group-hover:text-accent",children:i.description})]},i.name))}),a.length>0&&(0,Zs.jsx)("div",{className:"bg-gray-50",children:(0,Zs.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,Zs.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(i=>(0,Zs.jsxs)("a",{href:i.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:[i.icon&&(0,Zs.jsx)(Wl,{icon:i.icon,className:"h-5 w-5 flex-none text-gray-400"}),i.name]},i.name))})})})]})]}),Wl=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,Zs.jsx)($l,{...e,size:a});if("src"in e)return(0,Zs.jsx)("div",{className:g(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,Zs.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},ql=Mp;var Xl=oe(require("next/link"));function Yl({children:e,href:t,openNewTab:a,...o}){return(0,Zs.jsx)(Xl.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var Wn=oe(require("next/image"));function Pi({logoLight:e,logoDark:t,mobile:a=!1}){return(0,Zs.jsxs)(Yl,{href:"/",className:g(a?"py-1":"py-2"),children:[(0,Zs.jsx)(Wn.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,Zs.jsx)(Wn.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 td({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i=!1,wide:r=!1}){let[l,n]=(0,Zi.useState)(!1),[m,s]=(0,Zi.useState)(""),c=["light","dark"],{theme:d,setTheme:u}=(0,Pl.useTheme)();(0,Zi.useEffect)(()=>{s(d||"dark")},[d]);let v=()=>{let h=c[(c.indexOf(m)+1)%c.length];s(h),u(h)};return(0,Zi.useEffect)(()=>{let h=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,Zs.jsx)(Zs.Fragment,{children:(0,Zs.jsx)("header",{className:`z-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,Zs.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,Zs.jsxs)("div",{className:g("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,Zs.jsx)(Pi,{logoDark:a,logoLight:t}),(0,Zs.jsx)($o.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(h=>(0,Zs.jsx)(ql,{...h},h.name))}),i&&(0,Zs.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:v,children:(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)(hl.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,Zs.jsx)(hl.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Tr=require("@heroicons/react/24/outline");var Jn=["light","dark"];function od({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[i,r]=(0,Zi.useState)(!1),{theme:l,setTheme:n}=(0,Pl.useTheme)(),[m,s]=(0,Zi.useState)(!1),[c,d]=(0,Zi.useState)("light");(0,Zi.useEffect)(()=>{let v=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,Zi.useEffect)(()=>{d(l||"dark")},[l]);let u=()=>{let v=Jn[(Jn.indexOf(c)+1)%Jn.length];d(v),n(v)};return(0,Zs.jsx)(Zs.Fragment,{children:(0,Zs.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block lg:hidden ${i||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,Zs.jsx)("nav",{className:g("backdrop-blur-sm text-white p-0",m&&"hidden"),children:(0,Zs.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&_.logo-light]:[filter:brightness(0)_invert(1)] dark:border-Zs dark:border-accent",children:[(0,Zs.jsx)(Pi,{logoDark:t,logoLight:e,mobile:!0}),(0,Zs.jsx)("div",{className:"flex items-center space-x-4",children:(0,Zs.jsxs)("button",{type:"button",onClick:()=>s(!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,Zs.jsx)("span",{className:"Zs-only",children:"Open main menu"}),(0,Zs.jsx)(Tr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,Zs.jsxs)($o.Dialog,{open:m,onClose:s,className:"lg:hidden",children:[(0,Zs.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,Zs.jsxs)($o.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,Zs.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,Zs.jsx)(Pi,{logoDark:t,logoLight:e,mobile:!0}),(0,Zs.jsxs)("button",{type:"button",onClick:()=>s(!1),className:"-m-2.5 rounded-md p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,Zs.jsx)("span",{className:"Zs-only",children:"Close menu"}),(0,Zs.jsx)(Tr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,Zs.jsx)("div",{className:"mt-6 flow-root",children:(0,Zs.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,Zs.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,Zs.jsx)(Ep,{...v},v.name))})})})]})]})]})})}function Ep({name:e,items:t,actions:a,href:o}){return!t&&o?(0,Zs.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,Zs.jsxs)($o.Disclosure,{as:"div",className:"-mx-3",children:[(0,Zs.jsx)($o.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,Zs.jsx)($o.DisclosurePanel,{className:"mt-2 space-y-2",children:t&&t.map(i=>(0,Zs.jsx)($o.DisclosureButton,{as:"a",href:i.href,className:"block rounded-lg py-2 pl-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:i.name},i.name))})]})}function id({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:i,wide:r,themeControl:l=!1}){return(0,Zs.jsxs)("div",{className:g("fixed top-0 left-0 right-0 z-50",i),children:[(0,Zs.jsx)(td,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:r}),(0,Zs.jsx)(od,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var rd="../../cortex-reply-light-27IMI3G7.png";var nd="../../cortex-reply-dark-XPAJJJYY.png";function qn({...e}){return(0,Zs.jsxs)("div",{className:"bg-sidebar",children:[(0,Zs.jsx)(id,{isMenuOpen:!0,logoLight:rd,logoDark:nd,...e.header,className:"bg-sidebar",wide:!0}),(0,Zs.jsxs)(fn,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,Zs.jsx)(or,{...e.sidebarLeft,className:"flex-none top-24"}),(0,Zs.jsxs)(bn,{className:"grow overflow-hidden",children:[(0,Zs.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,Zs.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,Zs.jsx)(hn,{className:"-ml-1"}),(0,Zs.jsx)(bi,{orientation:"vertical",className:"mr-2 h-4"}),(0,Zs.jsx)(Ln,{children:(0,Zs.jsxs)(Fn,{children:[(0,Zs.jsx)(wr,{className:"hidden md:block",children:(0,Zs.jsx)(On,{href:"#",children:"Building Your Application"})}),(0,Zs.jsx)(jn,{className:"hidden md:block"}),(0,Zs.jsx)(wr,{children:(0,Zs.jsx)(Hn,{children:"Data Fetching"})})]})})]})}),(0,Zs.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,Zs.jsxs)("div",{className:"grid auto-rows-min gap-4 md:grid-cols-3",children:[(0,Zs.jsx)("div",{className:"aspect-video rounded-ul bg-muted/50"}),(0,Zs.jsx)("div",{className:"aspect-video rounded-ul bg-muted/50"}),(0,Zs.jsx)("div",{className:"aspect-video rounded-ul bg-muted/50"})]}),(0,Zs.jsx)("div",{className:"flex-1 rounded-ul bg-muted/50 md:min-h-min"})]})]})]}),(0,Zs.jsx)(_l,{})]})}var Fp=[{key:"kanban",icon:hl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:hl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:hl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:hl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:hl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],sd=({currentView:e,onViewChange:t,children:a})=>(0,Zs.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Zs.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Fp.map(o=>{let i=o.icon,r=e===o.key;return(0,Zs.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 ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Zs.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,Zs.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,Zs.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Zs.jsx)("div",{className:"w-full h-full",children:a})})]});var ld=oe(require("react")),Xn=oe(require("@radix-ui/react-label"));var Op=(0,ul.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),E=ld.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Xn.Root,{ref:a,className:g(Op(),e),...t}));E.displayName=Xn.Root.displayName;var Pe=oe(require("@radix-ui/react-select")),so=oe(require("react")),at=Pe.Root;var yt=Pe.Value,qe=so.forwardRef(({children:e,className:t,...a},o)=>(0,Zs.jsxs)(Pe.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,Zs.jsx)(Pe.Icon,{asChild:!0,children:(0,Zs.jsx)(hl.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));qe.displayName=Pe.Trigger.displayName;var md=so.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Pe.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Zs.jsx)(hl.ChevronUp,{className:"h-4 w-4"})}));md.displayName=Pe.ScrollUpButton.displayName;var pd=so.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Pe.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Zs.jsx)(hl.ChevronDown,{className:"h-4 w-4"})}));pd.displayName=Pe.ScrollDownButton.displayName;var Xe=so.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,Zs.jsx)(Pe.Portal,{children:(0,Zs.jsxs)(Pe.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:i,...o,children:[(0,Zs.jsx)(md,{}),(0,Zs.jsx)(Pe.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,Zs.jsx)(pd,{})]})}));Xe.displayName=Pe.Content.displayName;var Hp=so.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Pe.Label,{className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));Hp.displayName=Pe.Label.displayName;var xe=so.forwardRef(({children:e,className:t,...a},o)=>(0,Zs.jsxs)(Pe.Item,{className:g("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-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,Zs.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Zs.jsx)(Pe.ItemIndicator,{children:(0,Zs.jsx)(hl.Check,{className:"h-4 w-4"})})}),(0,Zs.jsx)(Pe.ItemText,{children:e})]}));xe.displayName=Pe.Item.displayName;var jp=so.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Pe.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));jp.displayName=Pe.Separator.displayName;var kr=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:l=!1})=>{let[n,m]=(0,Zi.useState)(!1),[s,c]=(0,Zi.useState)(""),d=o.find(p=>p.value===t),u=o.filter(p=>p.label.toLowerCase().includes(s.toLowerCase())),v=p=>{a(p),m(!1),c("")},h=()=>{r&&s.trim()&&!o.find(p=>p.value===s.trim())&&(a(s.trim()),m(!1),c(""))};return(0,Zs.jsxs)("div",{className:"space-y-1",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:e}),(0,Zs.jsxs)(at,{value:t,onValueChange:v,open:n,onOpenChange:p=>{l||m(p)},disabled:l,children:[(0,Zs.jsx)(qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Zs.jsx)(se,{variant:"secondary",className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!l&&m(!n),children:d?.label||t||"Select..."})}),(0,Zs.jsxs)(Xe,{children:[(0,Zs.jsx)("div",{className:"p-2",children:(0,Zs.jsx)(z,{placeholder:i,value:s,onChange:p=>c(p.target.value),onKeyDown:p=>{p.key==="Enter"&&r&&h()},className:"mb-2"})}),u.map(p=>(0,Zs.jsx)(xe,{value:p.value,children:p.label},p.value)),r&&s.trim()&&!u.find(p=>p.value===s.trim())&&(0,Zs.jsxs)(xe,{value:s.trim(),children:['Add "',s.trim(),'"']})]})]})]})};var wo=oe(require("react"));var W=wo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,className:g("rounded-ul border bg-card text-card-foreground shadow",e),...t}));W.displayName="Card";var ot=wo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,className:g("flex flex-col space-y-1.5 p-6",e),...t}));ot.displayName="CardHeader";var gt=wo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,className:g("font-semibold leading-none tracking-tight",e),...t}));gt.displayName="CardTitle";var No=wo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,className:g("text-sm text-muted-foreground",e),...t}));No.displayName="CardDescription";var Ne=wo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,className:g("p-6 pt-0",e),...t}));Ne.displayName="CardContent";var Co=wo.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)("div",{ref:a,className:g("flex items-center p-6 pt-0",e),...t}));Co.displayName="CardFooter";function Wo({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:l}){let[n,m]=(0,Zi.useState)(!1),s=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},c=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},d=u=>{if(!u)return"Never";let h=Math.floor((new Date().getTime()-u.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,Zs.jsxs)(W,{className:g("hover:shadow-md transition-shadow",r&&"p-2",l),children:[(0,Zs.jsx)(ot,{className:g("pb-3",r&&"pb-2"),children:(0,Zs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Zs.jsx)("div",{className:"relative",children:(0,Zs.jsxs)(ea,{className:g("h-12 w-12",r&&"h-8 w-8"),children:[(0,Zs.jsx)(fo,{src:"/placeholder.svg",alt:e.name||"name"}),(0,Zs.jsx)(ta,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,Zs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)("h3",{className:g("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,Zs.jsx)(hl.Bot,{className:g("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Zs.jsx)(hl.User,{className:g("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Zs.jsx)("p",{className:g("text-sm text-muted-foreground truncate",r&&"text-xs")}),!r&&(0,Zs.jsx)("div",{className:"flex items-center gap-2 mt-1"})]})]}),i&&(0,Zs.jsxs)(Ra,{children:[(0,Zs.jsx)(Aa,{asChild:!0,children:(0,Zs.jsx)(x,{variant:"ghost",size:"icon",className:g("h-8 w-8",r&&"h-6 w-6"),children:(0,Zs.jsx)(hl.MoreHorizontal,{className:g("h-4 w-4",r&&"h-3 w-3")})})}),(0,Zs.jsxs)(xa,{align:"end",children:[e.type==="digital"&&(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsxs)(qt,{onClick:()=>o?.(e),children:[(0,Zs.jsx)(hl.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,Zs.jsxs)(qt,{onClick:()=>t?.(e),children:[(0,Zs.jsx)(hl.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,Zs.jsxs)(qt,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,Zs.jsx)(hl.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,Zs.jsxs)(Ne,{className:"pt-0",children:[(0,Zs.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Zs.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Zs.jsx)(hl.Mail,{className:"h-3 w-3"}),(0,Zs.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,Zs.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,Zs.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,Zs.jsx)("div",{className:"mt-3",children:(0,Zs.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,n?e.capabilities.length:2).map(u=>(0,Zs.jsx)(se,{variant:"outline",className:"text-xs",children:typeof u.value=="number"?u.value:u.value.name},typeof u.value=="number"?u.value:u.value.name)),(e.capabilities?.length||0)>2&&(0,Zs.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>m(!n),children:n?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}var gd=oe(require("react")),He=gd.forwardRef(({className:e,...t},a)=>(0,Zs.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}));He.displayName="Textarea";function Pr({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:l=!1}){let[n,m]=(0,Zi.useState)(""),[s,c]=(0,Zi.useState)([]),[d,u]=(0,Zi.useState)(!1);(0,Zi.useEffect)(()=>{if(!n.trim()){c([]),u(!1);return}let p=a.filter(S=>{if(e.map(k=>k.id).includes(S.id))return!1;let y=n.toLowerCase();return S.title.toLowerCase().includes(y)||S.description?.toLowerCase().includes(y)||S.tags?.some(k=>k.toLowerCase().includes(y))||Object.values(S.metadata||{}).some(k=>String(k).toLowerCase().includes(y))});c(p),u(!0)},[n,e,a]);let v=p=>{r&&e.length>=r&&e.pop(),t([...e,p]),m(""),u(!1)},h=p=>{console.log("doc",p,e),t(e.filter(S=>S.id!==p))},w=!r||e.length<r;return(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:o}),(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)(hl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Zs.jsx)(z,{value:n,onChange:p=>m(p.target.value),placeholder:w?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:l||!w,onFocus:()=>n&&u(!0)})]}),d&&s.length>0&&(0,Zs.jsx)(W,{className:"absolute top-full left-0 right-0 z-10 mt-1 max-h-60",children:(0,Zs.jsx)(Ia,{className:"h-full",children:(0,Zs.jsx)(Ne,{className:"p-2",children:s.map(p=>(0,Zs.jsx)(x,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>v(p),disabled:l,children:(0,Zs.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Zs.jsx)(hl.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Zs.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Zs.jsx)("div",{className:"font-medium text-sm truncate",children:p.title}),p.description&&(0,Zs.jsx)("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:p.description}),p.tags&&p.tags.length>0&&(0,Zs.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[p.tags.slice(0,3).map(S=>(0,Zs.jsx)(se,{variant:"outline",className:"text-xs",children:S},S)),p.tags.length>3&&(0,Zs.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",p.tags.length-3," more"]})]})]})]})},p.id))})})}),d&&n&&s.length===0&&(0,Zs.jsx)(W,{className:"absolute top-full left-0 right-0 z-10 mt-1",children:(0,Zs.jsxs)(Ne,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',n,'"']})})]}),e.length>0&&(0,Zs.jsx)("div",{className:"space-y-2",children:(0,Zs.jsx)("div",{className:"space-y-2",children:e.map(p=>(0,Zs.jsx)(W,{className:"p-3",children:(0,Zs.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Zs.jsx)(hl.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Zs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Zs.jsx)("div",{className:"font-medium text-sm",children:p.title}),p.description&&(0,Zs.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:p.description}),p.tags&&p.tags.length>0&&(0,Zs.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:p.tags.map(S=>(0,Zs.jsxs)(se,{variant:"outline",className:"text-xs",children:[(0,Zs.jsx)(hl.Tag,{className:"h-3 w-3 mr-1"}),S]},S))})]}),(0,Zs.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(p.id),disabled:l,children:(0,Zs.jsx)(hl.Zs,{className:"h-3 w-3"})})]})},p.id))})}),d&&(0,Zs.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Ai({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:n=!1,availableKnowledgeDocuments:m=[]}){let[s,c]=(0,Zi.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e}),[d,u]=(0,Zi.useState)(""),[v,h]=(0,Zi.useState)(""),[w,p]=(0,Zi.useState)(!n);(0,Zi.useEffect)(()=>{e&&c(e)},[e]);let S=D=>{D.preventDefault();let F={id:s.id||parseInt(Date.now().toString()),name:s.name,type:"digital",description:s.description,jobDescription:s.jobDescription||"",workInstructions:s.workInstructions||"",capabilities:s.capabilities||[],capabilityLevel:s.capabilityLevel||0,coreKnowledge:s.coreKnowledge||null};t(F)},R=(D,F,U)=>{if(!F.trim())return;let L=s[D]||[];c({...s,[D]:[...L,F.trim()]}),U("")},y=(D,F)=>{let U=s[D]||[];c({...s,[D]:U.filter((L,T)=>T!==F)})},k=D=>{D.preventDefault(),p(!w)},q=(D,F,U,L,T)=>{let Ie=s[D]||[];return(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:F}),w&&(0,Zs.jsxs)("div",{className:"flex gap-2",children:[(0,Zs.jsx)(z,{value:U,onChange:P=>L(P.target.value),placeholder:T,onKeyPress:P=>{P.key==="Enter"&&(P.preventDefault(),R(D,U,L))},disabled:o}),(0,Zs.jsx)(x,{type:"button",variant:"outline",size:"icon",onClick:()=>R(D,U,L),disabled:o,children:(0,Zs.jsx)(hl.Plus,{className:"h-4 w-4"})})]}),(0,Zs.jsx)("div",{className:"flex flex-wrap gap-2",children:Ie.map((P,I)=>(0,Zs.jsxs)(se,{className:"gap-1",children:[P,w&&(0,Zs.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>y(D,I),disabled:o,children:(0,Zs.jsx)(hl.Zs,{className:"h-3 w-3"})})]},`${D}-${I}-${P}`))})]})},C=i||(w?e?"Edit Colleague":"Add New Colleague":"View Colleague"),A=r||(e?"Update Colleague":"Add Colleague");return(0,Zs.jsxs)(W,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll Zs-scrollbar",children:[(0,Zs.jsx)(ot,{children:(0,Zs.jsxs)(gt,{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.Bot,{className:"h-5 w-5"}),C]})}),(0,Zs.jsx)(Ne,{children:(0,Zs.jsxs)("form",{onSubmit:S,className:"space-y-6",children:[(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,Zs.jsx)(z,{id:"name",value:s.name||"",onChange:D=>c({...s,name:D.target.value}),required:!0,disabled:o||!w})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Zs.jsx)(He,{id:"description",value:s.description||"",onChange:D=>c({...s,description:D.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!w})]})]}),(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Zs.jsx)(He,{id:"jobDescription",value:s.jobDescription||"",onChange:D=>c({...s,jobDescription:D.target.value}),rows:4,required:s.type==="digital",disabled:o||!w})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Zs.jsx)(He,{id:"workInstructions",value:s.workInstructions||"",onChange:D=>c({...s,workInstructions:D.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!w})]}),q("capabilities","Capabilities",v,h,"Add capability"),(0,Zs.jsx)(Pr,{selectedDocuments:s.coreKnowledge?[{id:s.coreKnowledge?.id?.toString(),title:s.coreKnowledge?.name,format:"markdown",content:s.coreKnowledge?.content||"",createdAt:new Date(s.coreKnowledge?.createdAt),description:s.coreKnowledge?.description||"",metadata:s.coreKnowledge?.metadata||{},updatedAt:new Date(s.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:D=>{let F={createdAt:D[0]?.createdAt.toISOString(),id:parseInt(D[0]?.id),name:D[0]?.title,source:"payload",updatedAt:(D[0]?.updatedAt||new Date).toISOString()};console.log(D),c({...s,coreKnowledge:D&&D.length>0?F:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!w,availableDocuments:m.map(D=>({id:D.id.toString(),title:D.name,name:D.name,format:"markdown",content:D.content||"",createdAt:new Date(D.createdAt),source:D.source,description:D.description||"",metadata:D.metadata||{},updatedAt:new Date(D.updatedAt)}))})]}),(0,Zs.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Zs.jsx)(x,{type:"button",variant:"outline",onClick:a,disabled:o,children:w?l:"Close"}),w?(0,Zs.jsx)(x,{type:"submit",disabled:o,children:o?"Saving...":A}):(0,Zs.jsxs)(x,{type:"button",onClick:k,disabled:o,className:"gap-2",children:[(0,Zs.jsx)(hl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Rr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Zs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Zs.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Zs.jsx)(hl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague hl add"})]})]}),(0,Zs.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Zs.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Zs.jsxs)(ot,{className:"text-center pb-4",children:[(0,Zs.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Zs.jsx)(hl.User,{className:"h-8 w-8 text-blue-600"})}),(0,Zs.jsx)(gt,{className:"text-ul",children:"Add Human Colleague"})]}),(0,Zs.jsxs)(Ne,{className:"text-center",children:[(0,Zs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization hl add as team members."}),(0,Zs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.Users,{className:"h-4 w-4 text-blue-600"}),(0,Zs.jsx)("span",{children:"Browse existing users"})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.User,{className:"h-4 w-4 text-blue-600"}),(0,Zs.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Zs.jsx)(x,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Zs.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Zs.jsxs)(ot,{className:"text-center pb-4",children:[(0,Zs.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Zs.jsx)(hl.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Zs.jsx)(gt,{className:"text-ul",children:"Add Digital Colleague"})]}),(0,Zs.jsxs)(Ne,{className:"text-center",children:[(0,Zs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,Zs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Zs.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.Users,{className:"h-4 w-4 text-purple-600"}),(0,Zs.jsx)("span",{children:"Create from templates"})]})]}),(0,Zs.jsx)(x,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Ar({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,Zi.useState)(""),[l,n]=(0,Zi.useState)("all"),m=(0,Zi.useMemo)(()=>e.filter(d=>d.name.toLowerCase().includes(i.toLowerCase())||d.jobDescription?.toLowerCase().includes(i.toLowerCase())||d.workInstructions?.toLowerCase().includes(i.toLowerCase())),[e,i,l]),s=d=>{let u={...d,name:`${d.name} (Copy)`};t(u)},c=d=>new Intl.DateTimeFormat("hl-US",{month:"short",day:"numeric",year:"numeric"}).format(d);return(0,Zs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Zs.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Zs.jsx)($a.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague hl clone"})]})]}),(0,Zs.jsx)(W,{children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Zs.jsx)("div",{className:"flex-1",children:(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)($a.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Zs.jsx)(z,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:d=>r(d.target.value),className:"pl-9"})]})}),(0,Zs.jsxs)("select",{value:l,onChange:d=>n(d.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Zs.jsx)("option",{value:"all",children:"All Status"}),(0,Zs.jsx)("option",{value:"active",children:"Active"}),(0,Zs.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Zs.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(d=>(0,Zs.jsx)(io.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Zs.jsxs)(W,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===d.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>s(d),children:[(0,Zs.jsx)(ot,{className:"pb-3",children:(0,Zs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Zs.jsx)(ea,{children:(0,Zs.jsx)(ta,{className:"bg-blue-100",children:(0,Zs.jsx)($a.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Zs.jsx)("div",{children:(0,Zs.jsx)(gt,{className:"text-lg flex items-center gap-2",children:d.name})})]}),(0,Zs.jsxs)(x,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),s(d)},children:[(0,Zs.jsx)($a.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Zs.jsx)(Ne,{className:"pt-0",children:(0,Zs.jsxs)("div",{className:"space-y-3",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Zs.jsx)("p",{className:"text-sm line-clamp-2",children:d.jobDescription})]}),d.capabilities&&d.capabilities.length>0&&(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Zs.jsx)("div",{className:"flex flex-wrap gap-1",children:d.capabilities.length>3&&(0,Zs.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",d.capabilities.length-3]})})]}),(0,Zs.jsx)("div",{className:"flex items-center justify-between text-xs text-muted-foreground"}),d.workInstructions&&(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Zs.jsx)("p",{className:"text-xs line-clamp-2",children:d.workInstructions})]})]})})]})},d.id))}),m.length===0&&(0,Zs.jsx)(W,{children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsxs)("div",{className:"text-center py-8",children:[(0,Zs.jsx)($a.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Zs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Ir({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Zs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Zs.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Zs.jsx)(hl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"Choose how hl create your digital colleague"})]})]}),(0,Zs.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Zs.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Zs.jsxs)(ot,{className:"text-center pb-4",children:[(0,Zs.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Zs.jsx)(hl.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Zs.jsx)(gt,{className:"text-ul",children:"Clone Existing"})]}),(0,Zs.jsxs)(Ne,{className:"text-center",children:[(0,Zs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize Zs for your needs."}),(0,Zs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Zs.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Zs.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Zs.jsx)(x,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Zs.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Zs.jsxs)(ot,{className:"text-center pb-4",children:[(0,Zs.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Zs.jsx)(hl.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Zs.jsx)(gt,{className:"text-ul",children:"Create New"})]}),(0,Zs.jsxs)(Ne,{className:"text-center",children:[(0,Zs.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Zs.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.Plus,{className:"h-4 w-4 text-green-600"}),(0,Zs.jsx)("span",{children:"Custom job description"})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Zs.jsx)(hl.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Zs.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Zs.jsx)(x,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var vd=oe(require("react")),Ei=oe(require("@radix-ui/react-switch"));var Yo=vd.forwardRef(({className:e,...t},a)=>(0,Zs.jsx)(Ei.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,Zs.jsx)(Ei.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")})}));Yo.displayName=Ei.Root.displayName;function Er({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:n=!1}){let[m,s]=(0,Zi.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[c,d]=(0,Zi.useState)(!n);(0,Zi.useEffect)(()=>{e&&s(e)},[e]);let u=async p=>{p.preventDefault();let S={id:m.id||Date.now(),name:m.name,description:m.description||null,systemMsg:m.systemMsg||null,useProjects:m.useProjects||!1,useKnowledge:m.useKnowledge||!1,useFiles:m.useFiles||!1,useChat:m.useChat||!1,updatedAt:new Date().toISOString(),createdAt:m.createdAt||new Date().toISOString()};await t(S)},v=p=>{p.preventDefault(),d(!c)},h=i||(c?e?"Edit Team":"Create New Team":"View Team"),w=r||(e?"Update Team":"Create Team");return(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.Users,{className:"h-5 w-5"}),h]}),(0,Zs.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"name",children:"Team Name *"}),(0,Zs.jsx)(z,{id:"name",value:m.name||"",onChange:p=>s({...m,name:p.target.value}),required:!0,disabled:o||!c,placeholder:"Enter team name..."})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Zs.jsx)(He,{id:"description",value:m.description||"",onChange:p=>s({...m,description:p.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!c})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Zs.jsx)(He,{id:"systemMsg",value:m.systemMsg||"",onChange:p=>s({...m,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||!c})]})]}),(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Zs.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)(Yo,{id:"useProjects",checked:m.useProjects||!1,onCheckedChange:p=>s({...m,useProjects:p}),disabled:o||!c}),(0,Zs.jsx)(E,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)(Yo,{id:"useKnowledge",checked:m.useKnowledge||!1,onCheckedChange:p=>s({...m,useKnowledge:p}),disabled:o||!c}),(0,Zs.jsx)(E,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)(Yo,{id:"useFiles",checked:m.useFiles||!1,onCheckedChange:p=>s({...m,useFiles:p}),disabled:o||!c}),(0,Zs.jsx)(E,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)(Yo,{id:"useChat",checked:m.useChat||!1,onCheckedChange:p=>s({...m,useChat:p}),disabled:o||!c}),(0,Zs.jsx)(E,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Zs.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Zs.jsx)(x,{type:"button",variant:"outline",onClick:a,disabled:o,children:c?l:"Close"}),c?(0,Zs.jsx)(x,{type:"submit",disabled:o||!m.name?.trim(),children:o?"Saving...":w}):(0,Zs.jsxs)(x,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,Zs.jsx)(hl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Br=require("react-icons/hl");function ft({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:l,className:n}){let[m,s]=gr(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),c=!i&&!t||m;return(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${n||""}`,children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Zs.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-ul",children:a}),(0,Zs.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[c&&o&&(0,Zs.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,Zs.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>s(!m),style:{lineHeight:0},children:m?(0,Zs.jsx)(Br.FaChevronDown,{size:22}):(0,Zs.jsx)(Br.FaChevronUp,{size:22})})]})]}),!c&&(0,Zs.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Zs.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Zs.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,Zs.jsx)(x,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),l&&(0,Zs.jsx)("div",{className:"hidden lg:block",children:l})]})]})}var bd=oe(require("react")),Li=oe(require("@radix-ui/react-progress"));var Fi=bd.forwardRef(({className:e,value:t,...a},o)=>(0,Zs.jsx)(Li.Root,{ref:o,className:g("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Zs.jsx)(Li.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Fi.displayName=Li.Root.displayName;function es({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:i}){return(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:i,children:(0,Zs.jsxs)(W,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,Zs.jsx)(ot,{className:"pb-2",children:(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,Zs.jsx)(se,{className:"rounded-ul bg-amber-500",children:"New"}):(0,Zs.jsx)(x,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,Zs.jsx)(hl.Star,{className:"h-4 w-4"})})]})}),(0,Zs.jsxs)(Ne,{className:"pb-2",children:[(0,Zs.jsx)(gt,{className:"text-lg",children:e.name}),(0,Zs.jsx)(No,{children:e.description}),o&&e.progress<100&&(0,Zs.jsxs)("div",{className:"mt-2",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Zs.jsx)("span",{children:"Installation"}),(0,Zs.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Zs.jsx)(Fi,{value:e.progress,className:"h-2 mt-1 rounded-ul"})]})]}),(0,Zs.jsx)(Co,{children:(0,Zs.jsx)(x,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var Up=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 Zo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,Zs.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,Zs.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Zs.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Zs.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Zs.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Zs.jsx)("div",{className:"divide-y",children:e.map(l=>(0,Zs.jsxs)(io.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,Zs.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Zs.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Zs.jsx)("div",{children:(0,Zs.jsx)("p",{className:"font-medium",children:l.name})})]}),(0,Zs.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:Up(l.filesize)}),(0,Zs.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Zs.jsx)("span",{className:"text-sm md:text-base",children:new Date(l.createdAt).toLocaleDateString()}),(0,Zs.jsx)("div",{className:"flex gap-1",children:(0,Zs.jsx)(x,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-ul text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(l)},children:(0,Zs.jsx)(hl.Trash2,{className:"h-4 w-4"})})})]})]},l.name))})]})}function Lr({project:e,onOpen:t,onShare:a,className:o}){return(0,Zs.jsx)(io.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Zs.jsxs)(W,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Zs.jsxs)(ot,{children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)(gt,{children:e.name}),(0,Zs.jsxs)(se,{variant:"outline",className:"rounded-ul",children:["Due ",e.dueDate]})]}),(0,Zs.jsx)(No,{children:e.description})]}),(0,Zs.jsxs)(Ne,{className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Zs.jsx)("span",{children:"Progress"}),(0,Zs.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Zs.jsx)(Fi,{value:e.progress,className:"h-2 rounded-ul"})]}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Zs.jsxs)("div",{className:"flex items-center",children:[(0,Zs.jsx)(hl.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,Zs.jsxs)("div",{className:"flex items-center",children:[(0,Zs.jsx)(hl.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Zs.jsxs)(Co,{className:"flex gap-2",children:[(0,Zs.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Zs.jsx)(x,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Zs.jsx)(hl.Share2,{className:"h-4 w-4"})})]})]})})}var ts=[{name:"PixelMaster",icon:(0,Zs.jsx)(hl.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,Zs.jsx)(hl.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,Zs.jsx)(hl.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,Zs.jsx)(hl.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,Zs.jsx)(hl.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,Zs.jsx)(hl.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,Zs.jsx)(hl.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,Zs.jsx)(hl.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,Zs.jsx)(hl.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,Zs.jsx)(hl.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,Zs.jsx)(hl.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,Zs.jsx)(hl.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Sd=[{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 Dd=[{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 kd=[{id:"home",title:"Home",icon:(0,Zs.jsx)(hl.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Zs.jsx)(hl.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,Zs.jsx)(hl.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,Zs.jsx)(hl.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Zs.jsx)(hl.FileText,{}),url:"/knowledge"}],Pd=[{id:"1",title:"New comment io your post",description:"Alex Morgan commented io 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 Zi 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 hl 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'Zs 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 io 'Advanced Animation Techniques' Zi now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var ti=[{id:1,name:"E-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var as=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Fr=[{id:1,name:"Backlog",description:"Tasks not yet assigned hl a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],jr=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],zp=[...jr,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems io mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],Vp=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],Or={projects:[{id:"1",name:"Empty Project",description:"A project with Zs 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:[]},Td={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:jr.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var yb={empty:{initialProjects:Or.projects,initialEpics:Or.epics,initialSprints:Or.sprints,initialTasks:Or.tasks},default:{initialProjects:ti,initialEpics:as,initialSprints:Fr,initialTasks:jr},highDensity:{initialProjects:ti,initialEpics:as,initialSprints:Fr,initialTasks:zp},singleEpic:{initialProjects:ti,initialEpics:Td.epics,initialSprints:Fr,initialTasks:Td.tasks},multipleProjects:{initialProjects:Vp,initialEpics:as,initialSprints:Fr,initialTasks:jr}},Hr=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond hl customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases hl human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],wb=[{id:1,title:"Review quarterly report",description:"Zi through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:Hr.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:ti[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:Hr.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:ti[0]},{id:3,title:"Deploy hl production",description:"Deploy the latest version hl production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:Hr.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:ti[0]}];var Nb=Hr.filter(e=>e.type==="digital");function Rd({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,Zi.useState)(""),l=(0,Zi.useMemo)(()=>e.filter(m=>m.name?.toLowerCase().includes(i.toLowerCase())||m.email.toLowerCase().includes(i.toLowerCase())),[e,i]),n=m=>{t(m)};return(0,Zs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Zs.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Zs.jsx)(hl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"Choose a user hl add as a colleague"})]})]}),(0,Zs.jsx)(W,{className:"container",children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Zs.jsx)("div",{className:"flex-1",children:(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)(hl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Zs.jsx)(z,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:m=>r(m.target.value),className:"pl-9"})]})})})})}),(0,Zs.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:l.map(m=>(0,Zs.jsx)(io.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Zs.jsxs)(W,{className:`cursor-pointer transition-all hover:shadow-lg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>n(m),children:[(0,Zs.jsx)(ot,{className:"pb-3",children:(0,Zs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Zs.jsx)(ea,{children:(0,Zs.jsx)(ta,{children:(0,Zs.jsx)(hl.User,{className:"h-4 w-4"})})}),(0,Zs.jsx)("div",{children:(0,Zs.jsx)(gt,{className:"text-lg",children:m.name})})]}),o===m.id&&(0,Zs.jsx)(hl.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Zs.jsx)(Ne,{className:"pt-0",children:(0,Zs.jsxs)("div",{className:"space-y-3",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Zs.jsx)("p",{className:"text-sm font-medium",children:m.email})]}),(0,Zs.jsx)("div",{children:(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},m.id))}),l.length===0&&(0,Zs.jsx)(W,{className:"container mt-4",children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsxs)("div",{className:"text-center py-8",children:[(0,Zs.jsx)(hl.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Zs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function os(...e){return Yi((0,Ys.clsx)(e))}function Hi({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:l,availableUsers:n=[],existingDigitalColleagues:m=[],availableKnowledgeDocuments:s=[]}){let[c,d]=(0,Zi.useState)(e||[]),[u,v]=(0,Zi.useState)(""),[h,w]=(0,Zi.useState)("all"),[p,S]=(0,Zi.useState)("all"),[R,y]=(0,Zi.useState)("all"),[k,q]=(0,Zi.useState)(null),[C,A]=(0,Zi.useState)(null);(0,Zi.useEffect)(()=>{d(e||[])},[e]);let D=Array.isArray(n)?n:[],F=Array.isArray(m)?m:[],[U,L]=(0,Zi.useState)("main"),T=c.filter(O=>!O||!O.name?!1:O.name.toLowerCase().includes(u.toLowerCase())||O.type==="human"&&O.email?.toLowerCase().includes(u.toLowerCase())||O.type==="digital"&&O.jobDescription?.toLowerCase().includes(u.toLowerCase())),Ie=T.filter(O=>O.type==="human"),P=T.filter(O=>O.type==="digital"),I=()=>{L("typeSelection")},_=O=>{O.type==="digital"&&(q(O),L("form")),console.log("Editing colleague:",O),a?.(O)},Te=O=>{O.type==="digital"&&(A(O),L("view"))},Ve=O=>{let pt={id:`human-${Date.now()}`,type:"human",name:O.name,email:O.email,updatedAt:O.updatedAt,createdAt:O.createdAt,accounts:O.accounts};d(sa=>[...sa,pt]),t?.(pt),L("main")},mt=O=>{if(!O||!O.id){console.error("Invalid cloned colleague provided hl handleDigitalColleagueClone:",O);return}d(pt=>[...pt,{...O,type:"digital"}]),t?.({...O,type:"digital"}),L("main")},Jt=()=>{q(null),L("form")},H=O=>{if(!O||!O.id){console.error("Invalid colleague provided hl handleSaveColleague:",O);return}k?(d(pt=>pt.map(sa=>sa.id===O.id?{...O,type:"digital"}:sa)),a?.({...O,type:"digital"})):(d(pt=>[...pt,{...O,type:"digital"}]),t?.({...O,type:"digital"})),L("main"),q(null)},Ae=()=>{L("main"),q(null),A(null)},We=()=>{L("main"),A(null)},Zt=()=>{C&&(q(C),A(null),L("form"))},Le=O=>{console.log("deleting",O,c),o?.(O,c.find(pt=>pt.id.toString()===O.toString())?.type),d(pt=>pt.filter(sa=>sa.id!==O))},Vt=()=>{v(""),w("all"),S("all")};return U==="typeSelection"?(0,Zs.jsx)(Rr,{onSelectHuman:()=>L("userSelection"),onSelectDigital:()=>L("digitalOptions"),onCancel:()=>L("main")}):U==="userSelection"?(0,Zs.jsx)(Rd,{users:D,onUserSelect:Ve,onCancel:()=>L("typeSelection")}):U==="digitalOptions"?(0,Zs.jsx)(Ir,{onCloneExisting:()=>L("digitalClone"),onCreateNew:Jt,onCancel:()=>L("typeSelection")}):U==="digitalClone"?(0,Zs.jsx)(Ar,{digitalColleagues:F,onColleagueClone:mt,onCancel:()=>L("digitalOptions")}):U==="form"?(0,Zs.jsx)(Ai,{colleague:k||void 0,onSave:H,onCancel:Ae,availableKnowledgeDocuments:s}):U==="view"?(0,Zs.jsx)(Ai,{colleague:C||void 0,onSave:H,onCancel:We,readOnly:!0,availableKnowledgeDocuments:s}):(0,Zs.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsx)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Zs.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,Zs.jsx)(ft,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-hl-r from-green-600 via-emerald-600 hl-teal-600",primaryAction:{label:"Add colleague",onClick:I}}),(0,Zs.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Zs.jsxs)(W,{children:[(0,Zs.jsxs)(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Zs.jsx)(gt,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Zs.jsx)(hl.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Zs.jsxs)(Ne,{children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold",children:c.length}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]}),(0,Zs.jsxs)(W,{children:[(0,Zs.jsxs)(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Zs.jsx)(gt,{className:"text-sm font-medium",children:"Human Members"}),(0,Zs.jsx)(hl.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Zs.jsxs)(Ne,{children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold",children:c.filter(O=>O.type==="human").length}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),(0,Zs.jsxs)(W,{children:[(0,Zs.jsxs)(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Zs.jsx)(gt,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Zs.jsx)(hl.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Zs.jsxs)(Ne,{children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold",children:c.filter(O=>O.type==="digital").length}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]})]}),(0,Zs.jsx)(W,{children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Zs.jsx)("div",{className:"flex-1",children:(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)(hl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Zs.jsx)(z,{placeholder:"Search colleagues...",value:u,onChange:O=>v(O.target.value),className:"pl-9"})]})}),(0,Zs.jsxs)(at,{value:h,onValueChange:w,children:[(0,Zs.jsx)(qe,{className:"w-full md:w-[180px]",children:(0,Zs.jsx)(yt,{placeholder:"Department"})}),(0,Zs.jsxs)(Xe,{children:[(0,Zs.jsx)(xe,{value:"all",children:"All Departments"}),r.map(O=>(0,Zs.jsx)(xe,{value:O,children:O},O))]})]}),(0,Zs.jsxs)(at,{value:p,onValueChange:S,children:[(0,Zs.jsx)(qe,{className:"w-full md:w-[140px]",children:(0,Zs.jsx)(yt,{placeholder:"Status"})}),(0,Zs.jsxs)(Xe,{children:[(0,Zs.jsx)(xe,{value:"all",children:"All Status"}),(0,Zs.jsx)(xe,{value:"active",children:"Active"}),(0,Zs.jsx)(xe,{value:"inactive",children:"Inactive"})]})]}),(u||h!=="all"||p!=="all")&&(0,Zs.jsxs)(x,{variant:"outline",onClick:Vt,className:"gap-2",children:[(0,Zs.jsx)(hl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsx)(Ko,{activeTab:R,onTabChange:y,tabOptions:[{value:"all",label:`All (${T.length})`},{value:"human",label:`Human (${Ie.length})`},{value:"digital",label:`Digital (${P.length})`}],maxWidth:"400px",gridCols:3}),R==="all"&&(0,Zs.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:T.map(O=>(0,Zs.jsx)(Wo,{colleague:O,onEdit:_,onDelete:Le,onViewDetails:Te,compact:i,className:os([O.type==="digital"&&"border-teal-400"])},`${O}-${O.id}`))}),R==="human"&&(0,Zs.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:Ie.map(O=>(0,Zs.jsx)(Wo,{colleague:O,onEdit:_,onDelete:Le,onViewDetails:Te,compact:i},O.id))}),R==="digital"&&(0,Zs.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:P.map(O=>(0,Zs.jsx)(Wo,{colleague:O,onEdit:_,onDelete:Le,onViewDetails:Te,compact:i,className:os([O.type==="digital"&&"border-teal-400"])},O.id))})]}),T.length===0&&(0,Zs.jsx)(W,{children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsxs)("div",{className:"text-center py-8",children:[(0,Zs.jsx)(hl.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Zs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Zs.jsx)("p",{className:"text-muted-foreground mb-4",children:u||h!=="all"||p!=="all"?"Try adjusting your filters hl see more results.":"Get started by adding your first colleague."}),(0,Zs.jsxs)(x,{onClick:I,className:"gap-2",children:[(0,Zs.jsx)(hl.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var gc=oe(require("@radix-ui/react-dialog"));var ai=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:l=!1})=>{let[n,m]=(0,Zi.useState)(!1),[s,c]=(0,Zi.useState)(""),d=()=>{l||(m(!0),c(t))},u=async()=>{s!==t&&await i(e,s),m(!1)},v=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?u():h.key==="Escape"&&(m(!1),c(""))};return(0,Zs.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Zs.jsx)(E,{children:a}),n?o?(0,Zs.jsx)(He,{value:s,onChange:h=>c(h.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,Zs.jsx)(z,{value:s,onChange:h=>c(h.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,Zs.jsxs)("div",{onClick:d,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,Zs.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click hl edit..."}),!l&&(0,Zs.jsx)(hl.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var oc=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),ic=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),rc=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),nc=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),sc=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),lc=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),dc=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),_r=require("@payloadcms/richtext-lexical/lexical/list"),cc=require("@payloadcms/richtext-lexical/lexical/rich-text"),mc=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var tc=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Vi=require("@payloadcms/richtext-lexical/lexical/utils"),ye=require("@payloadcms/richtext-lexical/lexical"),gs=require("@payloadcms/richtext-lexical/lexical/selection");var zd=require("@radix-ui/react-dialog"),Vr=require("@payloadcms/richtext-lexical/client");var rs=oe(require("bson-objectid"));var Md=require("@payloadcms/ui");var Kp=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[i]=(0,tc.useLexicalComposerContext)(),[r,l]=(0,Zi.useState)(""),[n,m]=(0,Zi.useState)(""),[s,c]=(0,Zi.useState)(""),d=async p=>{console.log("fetchMedia",p)};(0,Zi.useEffect)(()=>{typeof a=="string"?a.length===24?d(a):(l(a||""),c(w(h())),m(v()||"")):typeof a=="object"&&(l(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),c(w(a.filesize)),m(a.mimeType?.split("/")[1]||""))},[]);let u=(0,Zi.useCallback)(()=>{i.update(()=>{(0,ye.$getNodeByKey)(o)?.remove()})},[i,o]),v=()=>{let p=e.data.value;return typeof p=="string"?p.split(";base64")[0]?.split("image/")[1]:""},h=()=>{let p=e.data.value;if(typeof p=="string"){let S=p.split(",")[1]?.length||0;return 4*Math.ceil(S/3)*.5624896334383812/1e3}return 0};function w(p){if(p>=1e6){let R=p/1e6;return`${R>=10?Math.round(R).toString():R.toFixed(1)} MB`}return`${Math.floor(p/1e3)} KB`}return(0,Zs.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Zs.jsxs)("div",{className:"border border-slate-800 rounded-ul overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Zs.jsxs)("div",{className:"flex gap-2 border-Zs border-Zs-slate-100/10",children:[(0,Zs.jsx)("div",{className:"flex-1",children:e.data.value?(0,Zs.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-hl":t,src:r}):(0,Zs.jsx)(Md.File,{})}),(0,Zs.jsx)(Ta,{children:(0,Zs.jsxs)(ka,{children:[(0,Zs.jsxs)(Pa,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Zs.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Zs.jsx)("button",{onClick:p=>{p.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,Zs.jsx)(hl.Zs,{width:24,height:24,strokeWidth:1})})]}),(0,Zs.jsx)(ba,{children:(0,Zs.jsx)("span",{children:"Remove image"})})]})})]}),(0,Zs.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Zs.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,Zs.jsx)("span",{children:s})]})]})})},Fd=Kp;function _p(e){if(e.hasAttribute("data-lexical-upload-relation-hl")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:oi({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var ji=class extends Vr.UploadNode{static importDOM(){return{img:()=>({conversion:_p,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new rs.default().toHexString(),t.version=3);let a={id:t.id??new rs.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=oi(a);return o.setFormat?.(t.format),o}decorate(){return(0,Zs.jsx)(Fd,{data:this.__data,nodeKey:this.getKey()})}};function oi(e){return new ji({data:e})}var $p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Gp=e=>$p?(e||window).getSelection():null,cx=(0,ye.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),ns=(0,ye.createCommand)("INSERT_UPLOAD_COMMAND");function Vd({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,Zi.useRef)(!1),[i,r]=(0,Zi.useState)(!0),[l,n]=(0,Zi.useState)(""),[m,s]=(0,Zi.useState)(""),[c,d]=(0,Zi.useState)(!1),[u,v]=(0,Zi.useState)("left"),h=l==="",w=k=>{d(k.target.checked)},p=k=>{v(k.target.value)},S=k=>{let q=new FileReader;q.onload=function(){return typeof q.result=="string"&&n(q.result),""},k!==null&&k[0]&&q.readAsDataURL(k[0])};(0,Zi.useEffect)(()=>{o.current=!1;let k=q=>{o.current=q.altKey};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k)}},[e]),(0,Zi.useEffect)(()=>{i||t()},[i]),(0,Zi.useEffect)(()=>{r(a)},[a]);let R=({editor:k,relationTo:q,replaceNodeKey:C,value:A})=>{if(C)k.update(()=>{let D=(0,ye.$getNodeByKey)(C);D&&D.replace(oi({id:"",fields:{},relationTo:"media",value:A}))});else{let D=k.dispatchCommand(ns,{fields:null,relationTo:"media",value:A})}},y=()=>{R({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:l,showCaption:c,position:u}.src}),r(!1),t()};return(0,Zs.jsx)(Ue,{open:i,onOpenChange:k=>r(k),children:(0,Zs.jsxs)(Ke,{children:[(0,Zs.jsxs)(_e,{children:[(0,Zs.jsx)($e,{children:"Upload Image"}),(0,Zs.jsx)(zd.DialogDescription,{children:"Description"})]}),(0,Zs.jsxs)("div",{className:"",children:[(0,Zs.jsx)("div",{style:{marginBottom:"1em"},children:(0,Zs.jsx)(z,{type:"file",onChange:k=>S(k.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Zs.jsx)("div",{style:{marginBottom:"1em"},children:(0,Zs.jsx)(z,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:k=>s(k.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,Zs.jsx)(x,{"data-test-id":"image-modal-file-upload-btn",disabled:h,onClick:()=>y(),children:"Confirm"})]})]})})}function ss({captionsEnabled:e}){let[t]=(0,tc.useLexicalComposerContext)();return(0,Zi.useEffect)(()=>{if(!t.hasNodes([Vr.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered io editor");return(0,Vi.mergeRegister)(t.registerCommand(ye.DRAGSTART_COMMAND,a=>Wp(a),ye.COMMAND_PRIORITY_HIGH),t.registerCommand(ye.DRAGOVER_COMMAND,a=>Jp(a),ye.COMMAND_PRIORITY_LOW),t.registerCommand(ye.DROP_COMMAND,a=>qp(a,t),ye.COMMAND_PRIORITY_HIGH))},[e,t]),null}function Wp(e){if(!ls())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function Jp(e){return ls()?(Kd(e)||e.preventDefault(),!0):!1}function qp(e,t){let a=ls();if(!a)return!1;if(e.preventDefault(),Kd(e)){let o=Xp(e);a.remove();let i=(0,ye.$createRangeSelection)();o!=null&&i.applyDOMRange(o),(0,ye.$setSelection)(i)}return!0}function ls(){let e=(0,ye.$getSelection)();if(!(0,ye.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,Vr.$isUploadNode)(a)?a:null}function Kd(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function Xp(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,i=Gp(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var Yp=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),_d=Yp;var Zp=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),$d=Zp;var Qp=()=>(0,Zs.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Zs.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Zs.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Gd=Qp;var eu=()=>(0,Zs.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Zs.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Zs.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Wd=eu;var tu=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),Jd=tu;var au=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),qd=au;var Xd=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Yd=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),Zd=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),Qd=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),ec=()=>(0,Zs.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Zs.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var us=1;function ou(){return(0,Zs.jsx)("span",{className:"border border-[#222222]"})}function fs(){let[e]=(0,tc.useLexicalComposerContext)(),t=(0,Zi.useRef)(null),[a,o]=(0,Zi.useState)(!1),[i,r]=(0,Zi.useState)(!1),[l,n]=(0,Zi.useState)(!1),[m,s]=(0,Zi.useState)(!1),[c,d]=(0,Zi.useState)(!1),[u,v]=(0,Zi.useState)(!1),[h,w]=(0,Zi.useState)(!1),[p,S]=(0,Zi.useState)(!1),[R,y]=(0,Zi.useState)(!1),[k,q]=(0,Zi.useState)("left"),[C,A]=(0,Zi.useState)("p"),D=I=>{e.update(()=>{let _=(0,ye.$getSelection)();(0,ye.$isRangeSelection)(_)&&(I==="p"?(0,gs.$setBlocksType)(_,()=>(0,ye.$createParagraphNode)()):(0,gs.$setBlocksType)(_,()=>(0,cc.$createHeadingNode)(I)))})},F=(0,Zi.useCallback)(()=>{let I=(0,ye.$getSelection)();if((0,ye.$isRangeSelection)(I)){n(I.hasFormat("bold")),s(I.hasFormat("italic")),d(I.hasFormat("underline")),v(I.hasFormat("strikethrough")),w(I.hasFormat("subscript")),S(I.hasFormat("superscript"));let _=I.anchor.getNode(),Te=_;for(;Te&&!(0,ye.$isParagraphNode)(Te)&&Te!==(0,ye.$getRoot)();){let mt=Te.getParent();mt&&(Te=mt)}if(Te){let mt=Te.getFormatType();q(mt||"left")}let Ve=_.getTopLevelElement()?.__tag;A(Ve||"p")}},[]);(0,Zi.useEffect)(()=>(0,Vi.mergeRegister)(e.registerUpdateListener(({editorState:I})=>{I.read(()=>{F()})}),e.registerCommand(ye.SELECTION_CHANGE_COMMAND,(I,_)=>(F(),!1),us),e.registerCommand(ye.CAN_UNDO_COMMAND,I=>(o(I),!1),us),e.registerCommand(ye.CAN_REDO_COMMAND,I=>(r(I),!1),us),(0,Vi.mergeRegister)(e.registerCommand(ns,I=>(e.update(()=>{let _=(0,ye.$getSelection)()||(0,ye.$getPreviousSelection)();if((0,ye.$isRangeSelection)(_)){let Te=oi({id:I.id,fields:I.fields,relationTo:I.relationTo,value:I.value}),{focus:Ve}=_,mt=Ve.getNode();(0,Vi.$insertNodeToNearestRoot)(Te),(0,ye.$isParagraphNode)(mt)&&!mt.__first&&mt.remove()}}),!0),ye.COMMAND_PRIORITY_EDITOR))),[e,F]);let U=[[{label:"Undo",icon:(0,Zs.jsx)(hl.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ye.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,Zs.jsx)(hl.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ye.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,Zs.jsx)(_d,{}),onClick:()=>{e.dispatchCommand(ye.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:l},{label:"Italic",icon:(0,Zs.jsx)($d,{}),onClick:()=>{e.dispatchCommand(ye.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,Zs.jsx)(Gd,{}),onClick:()=>{e.dispatchCommand(ye.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:c},{label:"Strikethrough",icon:(0,Zs.jsx)(Wd,{}),onClick:()=>{e.dispatchCommand(ye.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,Zs.jsx)(Jd,{}),onClick:()=>{e.dispatchCommand(ye.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:h},{label:"Superscript",icon:(0,Zs.jsx)(qd,{}),onClick:()=>{e.dispatchCommand(ye.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:p}]],L=[{label:"Left Align",direction:"left",icon:(0,Zs.jsx)(hl.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ye.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Zs.jsx)(hl.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ye.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Zs.jsx)(hl.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ye.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Zs.jsx)(hl.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ye.FORMAT_ELEMENT_COMMAND,"justify")}}],Ie=[{label:"Normal Text",value:"p",icon:(0,Zs.jsx)(Xd,{}),onClick:()=>D("p")},{label:"Heading 1",value:"h1",icon:(0,Zs.jsx)(Yd,{}),onClick:()=>D("h1")},{label:"Heading 2",value:"h2",icon:(0,Zs.jsx)(Zd,{}),onClick:()=>D("h2")},{label:"Heading 3",value:"h3",icon:(0,Zs.jsx)(Qd,{}),onClick:()=>D("h3")},{label:"Heading 4",value:"h4",icon:(0,Zs.jsx)(ec,{}),onClick:()=>D("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Zs.jsx)(hl.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_r.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"Zs",icon:(0,Zs.jsx)(hl.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_r.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],P=[{label:"Insert Image",icon:(0,Zs.jsx)(hl.ImageUp,{width:15,height:15}),onClick:()=>{y(!0)},disabled:!1}];return(0,Zs.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,Zs.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[U.map((I,_)=>(0,Zs.jsxs)(Zi.Fragment,{children:[(0,Zs.jsx)("div",{className:"flex items-center gap-2",children:I.map((Te,Ve)=>(0,Zs.jsx)("div",{role:"button","aria-disabled":Te.disabled||!1,onClick:Te.onClick,className:g("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",Te.active&&"bg-[#3c3c3c]"),"aria-label":Te.label,children:(0,Zs.jsx)(Ta,{children:(0,Zs.jsxs)(ka,{children:[(0,Zs.jsx)(Pa,{className:"text-[#b5b5b5]",children:Te.icon}),(0,Zs.jsx)(ba,{children:(0,Zs.jsx)("p",{children:Te.label})})]})})},Ve))}),(0,Zs.jsx)(ou,{})]},`toolbar-option-${I.length}-${_}`)),(0,Zs.jsxs)(Ra,{children:[(0,Zs.jsxs)(Aa,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[L.find(I=>I.direction===k)?.icon,L.find(I=>I.direction===k)?.label,(0,Zs.jsx)(hl.ChevronDown,{width:15,height:15})]}),(0,Zs.jsx)(xa,{className:"bg-black hover:bg-black",children:L.map((I,_)=>(0,Zs.jsxs)(qt,{onClick:I.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Zs.jsx)("span",{children:I.icon}),(0,Zs.jsx)("span",{children:I.label})]},`${I.label}-${_}`))})]}),(0,Zs.jsxs)(Ra,{children:[(0,Zs.jsxs)(Aa,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[Ie.find(I=>I.value===C)?.icon,Ie.find(I=>I.value===C)?.label,(0,Zs.jsx)(hl.ChevronDown,{width:15,height:15})]}),(0,Zs.jsx)(xa,{className:"bg-black hover:bg-black",children:Ie.map((I,_)=>(0,Zs.jsxs)(qt,{onClick:I.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Zs.jsx)("span",{children:I.icon}),(0,Zs.jsx)("span",{children:I.label})]},`heading-option-${I.label}-${_}`))})]}),(0,Zs.jsxs)(Ra,{children:[(0,Zs.jsxs)(Aa,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Zs.jsx)(hl.Plus,{width:15,height:15}),(0,Zs.jsx)(hl.ChevronDown,{width:15,height:15})]}),(0,Zs.jsx)(xa,{className:"bg-black hover:bg-black",children:P.map((I,_)=>(0,Zs.jsxs)(qt,{onClick:I.onClick,disabled:I.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Zs.jsx)("span",{children:I.icon}),(0,Zs.jsx)("span",{children:I.label})]},_))})]}),R&&(0,Zs.jsx)(Vd,{activeEditor:e,onClose:()=>{y(!1)},isOpen:R})]})})}var iu=({setValue:e,value:t,name:a,editable:o=!0})=>{let[i]=(0,tc.useLexicalComposerContext)(),r=l=>{l.read(()=>{let n=l.toJSON();e?.(()=>n)})};return(0,Zi.useEffect)(()=>{i.setEditable(o)},[o]),(0,Zi.useEffect)(()=>{t&&i.update(()=>{i.setEditorState(i.parseEditorState(t))})},[]),(0,Zs.jsx)("div",{className:"w-full",children:(0,Zs.jsxs)("div",{className:" ",children:[o&&(0,Zs.jsx)(fs,{}),(0,Zs.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Zs.jsx)(lc.RichTextPlugin,{contentEditable:(0,Zs.jsx)(rc.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:nc.LexicalErrorBoundary}),o&&(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(sc.HistoryPlugin,{}),(0,Zs.jsx)(oc.AutoFocusPlugin,{}),(0,Zs.jsx)(dc.ListPlugin,{}),(0,Zs.jsx)(mc.OnChangePlugin,{onChange:r}),(0,Zs.jsx)(ss,{})]})]})]})})},ru=({setValue:e,value:t,name:a,editable:o=!0})=>(0,Zs.jsx)(ic.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[_r.ListNode,_r.ListItemNode,cc.HeadingNode,ji],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},Zs:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Zs.jsx)(iu,{value:t,setValue:e,name:a,editable:o})}),$r=ru;function Gr({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[l,n]=(0,Zi.useState)({...e,updatedAt:new Date}),[m,s]=(0,Zi.useState)(!1),[c,d]=(0,Zi.useState)(l.richTextContent);(0,Zi.useEffect)(()=>{n(e)},[e]);let u=C=>{switch(C){case"markdown":case"mdx":return(0,Zs.jsx)(hl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Zs.jsx)(hl.File,{className:"h-6 w-6 text-success"});case"text":return(0,Zs.jsx)(hl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Zs.jsx)(hl.File,{className:"h-6 w-6 text-muted-foreground"})}},v=C=>{switch(C){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"}},h=()=>{let C=new Set,A=new Set;return r.forEach(D=>{D.menuConfig.groupBy.forEach(F=>C.add(F))}),i.forEach(D=>{D.metadata&&Object.keys(D.metadata).forEach(F=>A.add(F))}),{contextKeys:Array.from(C).sort(),documentKeys:Array.from(A).sort(),allKeys:Array.from(new Set([...C,...A])).sort()}},w=C=>{let A=new Set;return i.forEach(D=>{D.metadata?.[C]&&A.add(String(D.metadata[C]))}),Array.from(A).sort()},p=h(),S=()=>{t({...l,richTextContent:c})},R=(C,A)=>{n(D=>({...D,metadata:{...D.metadata,[C]:A}}))},y=(C,A)=>{A==="__custom__"?R(C,""):R(C,A)},k=()=>{R("","")},q=C=>{n(A=>{let D={...A.metadata};return delete D[C],{...A,metadata:D}})};return(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Zs.jsxs)("div",{className:"border-Zs border-border bg-card p-8 pb-6",children:[(0,Zs.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Zs.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Zs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Zs.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Zs.jsx)("div",{className:"flex-1 min-w-0",children:(0,Zs.jsx)(ai,{fieldName:"title",value:l.title,label:"",onSave:(C,A)=>n(D=>({...D,title:A})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Zs.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${v(l.format)} flex-shrink-0 mt-1`,children:l.format.toUpperCase()})]}),(0,Zs.jsx)("div",{className:"mt-2",children:(0,Zs.jsx)(ai,{fieldName:"description",value:l.description||"Click hl add description...",label:"",multiline:!0,onSave:(C,A)=>n(D=>({...D,description:A})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Zs.jsxs)(x,{variant:"ghost",size:"sm",onClick:()=>s(!m),className:"gap-2",children:[(0,Zs.jsx)(hl.Info,{className:"h-4 w-4"}),"Metadata",l.metadata&&Object.keys(l.metadata).length>0&&(0,Zs.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:Object.keys(l.metadata).length}),m?(0,Zs.jsx)(hl.ChevronDown,{className:"h-4 w-4"}):(0,Zs.jsx)(hl.ChevronRight,{className:"h-4 w-4"})]}),(0,Zs.jsxs)(x,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"}),"Cancel"]}),(0,Zs.jsxs)(x,{size:"sm",onClick:S,className:"gap-2",children:[(0,Zs.jsx)(hl.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,Zs.jsx)(io.motion.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,Zs.jsxs)("div",{className:"pt-4 border-t border-border mt-4 h-screen max-h-full flex",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Zs.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,Zs.jsx)(hl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Zs.jsxs)(x,{type:"button",variant:"outline",size:"sm",onClick:k,className:"gap-1 h-8",children:[(0,Zs.jsx)(hl.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,Zs.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:l.metadata&&Object.keys(l.metadata).length>0?(0,Zs.jsx)("div",{className:"space-y-2",children:Object.entries(l.metadata).map(([C,A],D)=>{let F=w(C);return(0,Zs.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Zs.jsx)(z,{value:C,onChange:U=>{let L=U.target.value||"",T=l.metadata?.[C];n(Ie=>{let P={...Ie.metadata};return delete P[C],L&&(P[L]=T||""),{...Ie,metadata:P}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${C}`}),(0,Zs.jsx)("datalist",{id:`metadata-keys-${C}`,children:p.allKeys.map(U=>(0,Zs.jsx)("option",{value:U},U))}),(0,Zs.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),F.length>0?(0,Zs.jsxs)(at,{value:String(A||""),onValueChange:U=>y(C,U),children:[(0,Zs.jsx)(qe,{className:"flex-1 h-8 text-sm",children:(0,Zs.jsx)(yt,{placeholder:"Value"})}),(0,Zs.jsxs)(Xe,{children:[F.map(U=>(0,Zs.jsx)(xe,{value:U,children:U},U)),(0,Zs.jsx)(xe,{value:"__custom__",children:(0,Zs.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Zs.jsx)(z,{value:String(A||""),onChange:U=>R(C,U.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Zs.jsx)(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>q(C),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Zs.jsx)(hl.Zs,{className:"h-3 w-3"})})]},`metadata-key-${D}`)})}):(0,Zs.jsxs)("div",{className:"text-center py-4",children:[(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" hl create metadata'})]})})]})})]}),(0,Zs.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Zs.jsx)("div",{className:"p-8 h-full max-h-full overflow-auto",children:l.format==="richText"?(0,Zs.jsx)($r,{setValue:d,value:c,name:"richTextContent"}):(0,Zs.jsx)(He,{value:l.content||"",onChange:C=>n(A=>({...A,content:C.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var fc=oe(require("react-markdown")),vc=oe(require("remark-gfm"));var hc=e=>(0,Zs.jsx)(fc.default,{remarkPlugins:[vc.default],components:{h1:({children:t})=>(0,Zs.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,Zs.jsx)("h2",{className:"text-ul font-bold",children:t}),h3:({children:t})=>(0,Zs.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,Zs.jsx)("h4",{className:"text-base font-bold",children:t}),Zs:({children:t})=>(0,Zs.jsx)("Zs",{className:"list-decimal",children:t}),ul:({children:t})=>(0,Zs.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,Zs.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,Zs.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:a})=>(0,Zs.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,Zs.jsx)("img",{src:t,alt:a,className:"mb-4"}),blockquote:({children:t})=>(0,Zs.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 mb-4",children:t})},children:e}),uc=e=>(0,Zs.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),nu=e=>(0,Zs.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,Zs.jsx)($r,{value:JSON.stringify(e),editable:!1,name:"richTextContent"})}),su=e=>(0,Zs.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Zs.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,Zs.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Zs.jsx)("strong",{children:"MDX Renderer:"})," This Zi a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),hc(e)]});function Wr({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:i,availableDocuments:r=[],knowledgeContexts:l=[]}){let[n,m]=(0,Zi.useState)(!1),[s,c]=(0,Zi.useState)(!1),[d,u]=(0,Zi.useState)(e);(0,Zi.useEffect)(()=>{u(e)},[e]);let v=y=>{switch(y){case"markdown":case"mdx":return(0,Zs.jsx)(hl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Zs.jsx)(hl.File,{className:"h-6 w-6 text-success"});case"text":return(0,Zs.jsx)(hl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Zs.jsx)(hl.File,{className:"h-6 w-6 text-muted-foreground"})}},h=y=>{switch(y){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"}},w=(y,k)=>{let q={markdown:hc,mdx:su,text:uc},C=i?.[k]||q[k];if(k==="richText"&&typeof y=="object")return nu(y);if(C&&typeof y=="string")return C(y);if(typeof y=="string")return uc(y)},p=y=>{m(!1),t?.(y),u(y)},S=()=>{m(!1)};return(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(Ue,{open:n||o==="create",onOpenChange:y=>!y&&S(),children:(0,Zs.jsxs)(nr,{children:[(0,Zs.jsx)(Ci,{}),(0,Zs.jsx)(gc.Content,{className:g("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:(0,Zs.jsx)(Gr,{mode:o==="create"?"create":"edit",document:d,onSave:p,onCancel:S,availableDocuments:r,knowledgeContexts:l})})]})}),(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Zs.jsxs)("div",{className:"border-Zs border-border bg-card p-8 pb-6",children:[(0,Zs.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Zs.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Zs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Zs.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[d.title,(0,Zs.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${h(d.format)}`,children:d.format.toUpperCase()})]}),d.description&&(0,Zs.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:d.description})]})}),(0,Zs.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[d.metadata&&Object.keys(d.metadata).length>0&&(0,Zs.jsxs)(x,{variant:"ghost",size:"sm",onClick:()=>c(!s),className:"gap-2",children:[(0,Zs.jsx)(hl.Info,{className:"h-4 w-4"}),"Metadata",s?(0,Zs.jsx)(hl.ChevronDown,{className:"h-4 w-4"}):(0,Zs.jsx)(hl.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,Zs.jsxs)(x,{variant:"outline",size:"sm",onClick:()=>m(!0),className:"gap-2",children:[(0,Zs.jsx)(hl.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),d.metadata&&Object.keys(d.metadata).length>0&&(0,Zs.jsx)(io.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Zs.jsxs)("div",{className:"pt-4 border-t border-border mt-4",children:[(0,Zs.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,Zs.jsx)(hl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,Zs.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,Zs.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(d.metadata).map(([y,k])=>(0,Zs.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Zs.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:y.replace(/([A-Zs])/g," $1").trim()}),(0,Zs.jsx)("span",{className:"text-foreground font-medium",children:String(k)})]},y))})})]})})]}),(0,Zs.jsx)("div",{className:"flex-1 ",children:(0,Zs.jsx)("div",{className:"py-4 h-full",children:(0,Zs.jsx)("div",{className:"space-y-4",children:d.content||d.richTextContent?(0,Zs.jsx)("div",{className:"relative",children:(0,Zs.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:w(d.format==="richText"?d.richTextContent:d.content,d.format)})}):(0,Zs.jsxs)("div",{className:"text-center p-12 bg-muted rounded-ul border-2 border-dashed border-border",children:[(0,Zs.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Zs.jsx)(hl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Zs.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Zs.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function xs({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l=!0}){let[n,m]=(0,Zi.useState)(o===0),s=a&&Object.keys(a).length>0,c=t.length+(a?Object.values(a).reduce((v,h)=>v+h.documents.length,0):0),d=v=>{switch(v){case"markdown":case"mdx":return(0,Zs.jsx)(hl.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,Zs.jsx)(hl.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Zs.jsx)(hl.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=v=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[v%h.length]};return(0,Zs.jsxs)("div",{className:"space-y-1",children:[(s||t.length>0)&&(0,Zs.jsxs)(io.motion.div,{className:`group flex items-center gap-3 p-3 rounded-ul cursor-pointer transition-all duration-200 ${n?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>m(!n),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Zs.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,Zs.jsx)(io.motion.div,{animate:{rotate:n?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Zs.jsx)(hl.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Zs.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Zs.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Zs.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),l&&c>0&&(0,Zs.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Zs.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:c})})]})]}),(0,Zs.jsx)(io.motion.div,{initial:!1,animate:{height:n?"auto":0,opacity:n?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Zs.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,h)=>(0,Zs.jsxs)(io.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 ${r===v.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:()=>i?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Zs.jsx)("div",{className:"flex-shrink-0",children:d(v.format)}),(0,Zs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Zs.jsx)("p",{className:`text-sm truncate transition-colors ${r===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,Zs.jsx)("div",{className:"flex-shrink-0",children:(0,Zs.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:v.tags[0]})})]},v.id)),a&&Object.entries(a).map(([v,h])=>(0,Zs.jsx)(xs,{label:v,documents:h.documents,children:h.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l},v))]})})]})}function Jr({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:l,editable:n=!0}){let[m,s]=(0,Zi.useState)(""),[c,d]=(0,Zi.useState)(null),[u,v]=(0,Zi.useState)(e);(0,Zi.useEffect)(()=>{v(e)},[e]);let h=(0,Zi.useMemo)(()=>m?u.filter(S=>S.title.toLowerCase().includes(m.toLowerCase())||S.description?.toLowerCase().includes(m.toLowerCase())||S.tags?.some(R=>R.toLowerCase().includes(m.toLowerCase()))||Object.values(S.metadata||{}).some(R=>String(R).toLowerCase().includes(m.toLowerCase()))):u,[u,m]),w=(0,Zi.useMemo)(()=>{let S=(R,y)=>{if(y.length===0)return{};let[k,...q]=y;return R.reduce((A,D)=>{let F=D.metadata?.[k]||"Uncategorized",U=String(F);if(A[U]||(A[U]={documents:[],children:{}}),q.length===0)A[U].documents.push(D);else{let L=S([D],q),T=Object.keys(L)[0];T&&(A[U].children||(A[U].children={}),A[U].children[T]?A[U].children[T].documents.push(...L[T].documents):A[U].children[T]=L[T])}return A},{})};return S(h,t.groupBy)},[h,t.groupBy]),p=S=>{d(S),a?.(S)};return(0,Zs.jsxs)("div",{className:`flex h-full ${l||""}`,children:[(0,Zs.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Zs.jsx)("div",{className:"p-6 border-Zs border-border",children:(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Zs.jsx)(hl.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Zs.jsx)(z,{placeholder:"Search knowledge base...",value:m,onChange:S=>s(S.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-ul h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Zs.jsx)(Ia,{className:"h-[calc(100%-100px)]",children:(0,Zs.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,Zs.jsx)(Zs.Fragment,{children:(0,Zs.jsx)(xs,{label:"Document",documents:h,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},"Document")}):(0,Zs.jsxs)(Zs.Fragment,{children:[Object.entries(w).map(([S,R])=>(0,Zs.jsx)(xs,{label:S,documents:R.documents,children:R.children,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},S)),Object.keys(w).length===0&&(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Zs.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Zs.jsx)(hl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Zs.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Zs.jsx)("p",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,Zs.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:c?(0,Zs.jsx)(Wr,{document:c,onDocumentUpdate:i,editable:n}):(0,Zs.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Zs.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Zs.jsx)(hl.FileText,{className:"h-10 w-10 text-primary"})}),(0,Zs.jsx)("h3",{className:"text-ul font-semibold text-foreground mb-2",children:"Select a document"}),(0,Zs.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base hl view its content and details"})]})})})]})}var bc=oe(require("react")),ys=oe(require("@radix-ui/react-toggle"));var ws=(0,ul.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=io]:bg-accent data-[state=io]: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"}}),lu=bc.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,Zs.jsx)(ys.Root,{ref:i,className:g(ws({variant:t,size:a,className:e})),...o}));lu.displayName=ys.Root.displayName;var ko=oe(require("react")),ni=oe(require("@radix-ui/react-toggle-group"));var wc=ko.createContext({size:"default",variant:"default"}),Po=ko.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,Zs.jsx)(ni.Root,{ref:r,className:g("flex items-center justify-center gap-1",e),...i,children:(0,Zs.jsx)(wc.Provider,{value:{variant:t,size:a},children:o})}));Po.displayName=ni.Root.displayName;var Ro=ko.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let l=ko.useContext(wc);return(0,Zs.jsx)(ni.Item,{ref:r,className:g(ws({variant:l.variant||a,size:l.size||o}),e),...i,children:t})});Ro.displayName=ni.Item.displayName;var Nc=oe(require("react")),La=oe(require("@radix-ui/react-popover"));var Cs=La.Root,Ss=La.Trigger;var Xr=Nc.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,Zs.jsx)(La.Portal,{children:(0,Zs.jsx)(La.Content,{ref:i,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})}));Xr.displayName=La.Content.displayName;var Cc=require("react-day-picker");function Yr({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Zs.jsx)(Cc.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(hi({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(hi({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})}Yr.displayName="Calendar";var Tc=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let i=()=>{let w=new Set;return o.forEach(p=>{p.menuConfig.groupBy.forEach(S=>w.add(S))}),{contextKeys:Array.from(w).sort(),allKeys:Array.from(w).sort()}},[r,l]=(0,Zi.useState)(()=>{let w=i();return{name:"",description:"",metadata:w.contextKeys.length>0?w.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}}),n=w=>{if(w.preventDefault(),!r.name)return;let p=r.metadata.filter(R=>R.key&&R.key.trim()&&R.value&&R.value.trim());a({name:r.name,description:r.description,metadata:p,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let S=i();l({name:"",description:"",metadata:S.contextKeys.length>0?S.contextKeys.map(R=>({key:R,value:""})):[{key:"",value:""}]}),t()},m=()=>{let w=i();l({name:"",description:"",metadata:w.contextKeys.length>0?w.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}),t()},s=i(),c=w=>{let p=new Set;return Array.from(p).sort()},d=(w,p)=>{l(S=>{let R=S.metadata.find(y=>y.key===w);return R&&(R.value=p),{...S,metadata:[...S.metadata.filter(y=>y.key!==w),{key:w,value:p}]}})},u=(w,p)=>{p==="__custom__"?d(w,""):d(w,p)},v=()=>{d(" ","")},h=w=>{l(p=>{let S=[...p.metadata],R=S.findIndex(y=>y.key===w);return R!==-1&&S.splice(R,1),{...p,metadata:S}})};return(0,Zs.jsx)(Ue,{open:e,onOpenChange:m,children:(0,Zs.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Add New Knowledge source"})}),(0,Zs.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,Zs.jsx)(z,{id:"name",value:r.name,onChange:w=>l(p=>({...p,name:w.target.value})),required:!0})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"name",children:"Description"}),(0,Zs.jsx)(z,{id:"name",value:r.description,onChange:w=>l(p=>({...p,description:w.target.value})),required:!0})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"metadata",children:"Metadata"}),s.contextKeys.length>0?(0,Zs.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Context keys: ",s.contextKeys.slice(0,4).join(", "),s.contextKeys.length>4&&` +${s.contextKeys.length-4} more`," \u2022 Fill in values or add more fields"]}):(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add key-value metadata hl organize and categorize your knowledge"})]}),(0,Zs.jsxs)(x,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,Zs.jsx)(hl.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,Zs.jsx)("div",{className:"space-y-2",children:r.metadata.map(({key:w,value:p},S)=>{let R=c(w);return(0,Zs.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Zs.jsx)(z,{value:w,onChange:y=>{let k=y.target.value||" ",q=r.metadata.find(C=>C.key===w)?.value;l(C=>{let A=[...C.metadata],D=A.findIndex(F=>F.key===w);return D!==-1&&A.splice(D,1),k&&A.push({key:k,value:q||""}),{...C,metadata:A}}),y.target.focus()},placeholder:s.allKeys.length>0?`e.g., ${s.allKeys[0]}`:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${w}`}),(0,Zs.jsx)("datalist",{id:`metadata-keys-${w}`,children:s.allKeys.map(y=>(0,Zs.jsx)("option",{value:y},y))}),(0,Zs.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),R.length>0?(0,Zs.jsxs)(at,{value:String(p||""),onValueChange:y=>u(w,y),children:[(0,Zs.jsx)(qe,{className:"flex-1 h-8 text-sm",children:(0,Zs.jsx)(yt,{placeholder:"Value"})}),(0,Zs.jsxs)(Xe,{children:[R.map(y=>(0,Zs.jsx)(xe,{value:y,children:y},y)),(0,Zs.jsx)(xe,{value:"__custom__",children:(0,Zs.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Zs.jsx)(z,{value:String(p||""),onChange:y=>d(w,y.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Zs.jsx)(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(w),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,Zs.jsx)(hl.Zs,{className:"h-3 w-3"})})]},`metadata-key-${S}`)})})]})]}),(0,Zs.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Zs.jsxs)(x,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"}),"Cancel"]}),(0,Zs.jsxs)(x,{type:"submit",children:[(0,Zs.jsx)(hl.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var kc=({isOpen:e,onClose:t,onAddTeamContext:a})=>{let[o,i]=(0,Zi.useState)({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),[r,l]=(0,Zi.useState)(""),n=d=>{d.preventDefault(),console.log("formData",o),o.label&&(a({id:o.label,label:o.label,description:o.description,menuConfig:{groupBy:o.groupBy,sortBy:o.sortBy||null,sortOrder:o.sortOrder,showDocumentCount:o.showDocumentCount}}),i({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}))},m=()=>{i({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),t()},s=[{value:"name",label:"Name"},{value:"createdAt",label:"Created Date"}],c=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}];return(0,Zs.jsx)(Ue,{open:e,onOpenChange:m,children:(0,Zs.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Add New Knowledge source"})}),(0,Zs.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"label",children:"Label *"}),(0,Zs.jsx)(z,{id:"label",value:o.label,onChange:d=>i(u=>({...u,label:d.target.value})),required:!0})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Zs.jsx)(z,{id:"description",value:o.description,onChange:d=>i(u=>({...u,description:d.target.value}))})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{children:"Group By"}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)("div",{className:"flex flex-wrap gap-2",children:o.groupBy.map(d=>(0,Zs.jsxs)(se,{variant:"secondary",className:"px-2 py-1",children:[d,(0,Zs.jsx)("button",{type:"button",className:"ml-1 inline-flex",onClick:()=>{i(u=>({...u,groupBy:u.groupBy.filter(v=>v!==d)}))},"aria-label":`Remove ${d}`,children:(0,Zs.jsx)(hl.Zs,{className:"h-3 w-3"})})]},d))}),(0,Zs.jsxs)("div",{className:"flex gap-2",children:[(0,Zs.jsx)(z,{placeholder:"Type a tag and press Enter",value:r,onChange:d=>l(d.target.value),onKeyDown:d=>{(d.key==="Enter"||d.key===",")&&(d.preventDefault(),i(u=>({...u,groupBy:[...u.groupBy,r]})),l(""))}}),(0,Zs.jsx)(x,{type:"button",onClick:()=>{i(d=>({...d,groupBy:[...d.groupBy,r]})),l("")},children:"Add"})]})]})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"sortBy",children:"Sort By"}),(0,Zs.jsxs)(at,{value:o.sortBy,onValueChange:d=>i(u=>({...u,sortBy:d})),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{placeholder:"Select sort field"})}),(0,Zs.jsx)(Xe,{children:s.map(d=>(0,Zs.jsx)(xe,{value:d.value,children:d.label},d.value))})]})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"sortOrder",children:"Sort Order"}),(0,Zs.jsxs)(at,{value:o.sortOrder,onValueChange:d=>i(u=>({...u,sortOrder:d})),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{placeholder:"Select sort order"})}),(0,Zs.jsx)(Xe,{children:c.map(d=>(0,Zs.jsx)(xe,{value:d.value,children:d.label},d.value))})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)(vo,{id:"showDocumentCount",checked:o.showDocumentCount,onCheckedChange:d=>i(u=>({...u,showDocumentCount:d}))}),(0,Zs.jsx)(E,{htmlFor:"showDocumentCount",className:"text-sm",children:"Show Document Count"})]})]}),(0,Zs.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Zs.jsxs)(x,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"}),"Cancel"]}),(0,Zs.jsxs)(x,{type:"submit",children:[(0,Zs.jsx)(hl.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};function _i({documents:e=[],contexts:t=[],onDocumentClick:a=s=>console.log("Document clicked:",s),onDocumentShare:o=s=>console.log("Share document:",s),onLoadDocumentContent:i,selectedDocumentId:r,onAddKnowledge:l,onAddTeamContext:n,onDocumentUpdate:m}){let[s,c]=(0,Zi.useState)(t[0]),[d,u]=(0,Zi.useState)(!1),[v,h]=(0,Zi.useState)(!1);(0,Zi.useEffect)(()=>{!s&&t&&t.length>0&&c(t[0])},[t]);let w=S=>{l&&l(S),u(!1)},p=S=>{n&&n(S),h(!1)};return(0,Zs.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Zs.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:t&&t.length>0&&(0,Zs.jsxs)("div",{className:"",children:[(0,Zs.jsx)("div",{className:"",children:(0,Zs.jsxs)("nav",{className:"-mb-px flex justify-between items-center",children:[(0,Zs.jsx)("div",{className:"flex space-x-8 overflow-x-auto",children:t.map(S=>(0,Zs.jsxs)("button",{onClick:()=>c(S),className:`group inline-flex items-center gap-2 py-3 px-1 border-Zs-2 font-medium text-sm whitespace-nowrap transition-colors ${s?.id===S.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[S.icon,S.label]},S.id))}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Zs.jsx)("button",{onClick:()=>u(!0),className:"inline-flex border border-primary rounded-ul items-center py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Knowledge"}),(0,Zs.jsx)("button",{onClick:()=>h(!0),className:"inline-flex border border-primary rounded-ul items-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Context"})]})]})}),s?.description&&(0,Zs.jsx)("div",{className:"mt-3 px-1",children:(0,Zs.jsx)("p",{className:"text-sm text-primary",children:s?.description})})]})}),s?(0,Zs.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Zs.jsx)("div",{className:"h-full rounded-ul border overflow-hidden",children:(0,Zs.jsx)(Jr,{documents:e,menuConfig:s?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r,onDocumentUpdate:m})})}):(0,Zs.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})}),(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(kc,{isOpen:v,onClose:()=>h(!1),onAddTeamContext:p}),(0,Zs.jsx)(Tc,{isOpen:d,onClose:()=>u(!1),onAddKnowledge:w,knowledgeContexts:t})]})]})}function ks({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:i,onCreateProject:r,onOpenProject:l,sidebarItems:n,initialColleagues:m,users:s,onColleagueAdd:c,onColleagueEdit:d,onColleagueDelete:u}){let[v,h]=(0,Zi.useState)("home"),[w,p]=(0,Zi.useState)(t[0]),S=T=>{console.log("Opening app:",T.name)},R=T=>{console.log("Favoriting app:",T.name)},y=T=>{console.log("Opening file:",T.name)},k=T=>{console.log("Sharing file:",T.name)},q=T=>{console.log("Opening project:",T.name),l(T)},C=T=>{console.log("Sharing project:",T.name)},A=T=>{p(T),console.log("Business unit changed hl:",T.name)},D=()=>{console.log("Copilot clicked - navigating hl chat"),h("chat")},F=T=>{console.log("Notification removed:",T)},U=()=>{console.log("All notifications removed")},L=()=>{switch(v){case"home":return(0,$.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,$.jsxs)("section",{className:"text-center py-12",children:[(0,$.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome hl the ",w.name," team"]}),(0,$.jsx)("p",{className:"text-ul text-muted-foreground mb-8",children:"This Zi your collaborative workspace for productivity and knowledge sharing."})]}),(0,$.jsxs)("section",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:i}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,$.jsx)(ft,{title:"Chat with your team",gradient:"bg-gradient-hl-r from-pink-600 via-red-600 hl-orange-600",primaryAction:{label:"Zi",onClick:()=>h("chat")}})]});case"colleagues":return(0,$.jsx)(Hi,{initialColleagues:m,availableUsers:s,onColleagueAdd:c,onColleagueEdit:d,onColleagueDelete:u});case"chat":return(0,$.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,$.jsxs)("section",{className:"text-center py-12",children:[(0,$.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,$.jsxs)("p",{className:"text-ul text-muted-foreground mb-8",children:["Connect with your ",w.name," team members and collaborate in real-time."]})]}),(0,$.jsx)(ft,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-hl-r from-blue-600 via-purple-600 hl-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,$.jsxs)("div",{className:"space-y-8",children:[(0,$.jsx)(ft,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-hl-r from-pink-600 via-red-600 hl-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:ts.filter(T=>T.new).map(T=>(0,$.jsx)(es,{app:T,showProgress:!0,onOpen:S,onFavorite:R},T.name))})]}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:ts.map(T=>(0,$.jsx)(es,{app:T,onOpen:S,onFavorite:R},T.name))})]})]});case"knowledge":return(0,$.jsx)(_i,{});case"files":return(0,$.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,$.jsx)(ft,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-hl-r from-teal-600 via-cyan-600 hl-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("div",{className:"flex items-center justify-between",children:(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,$.jsx)(Zo,{files:Sd,onFileClick:y})]})]});case"projects":return(0,$.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,$.jsx)(ft,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-hl-r from-purple-600 via-violet-600 hl-indigo-600",primaryAction:{label:"New Project",onClick:r}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:a.map(T=>(0,$.jsx)(Lr,{project:T,onOpen:q,onShare:C},T.name))})]})]});case"learn":return(0,$.jsxs)("div",{className:"space-y-8",children:[(0,$.jsx)(ft,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-hl-r from-green-600 via-emerald-600 hl-teal-600",primaryAction:{label:"Upgrade hl Pro",onClick:()=>console.log("Upgrade hl pro clicked")}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",children:Dd.slice(0,3).map(T=>(0,$.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,$.jsx)("h3",{className:"font-semibold mb-2",children:T.title}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:T.description}),(0,$.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,$.jsx)("span",{children:T.duration}),(0,$.jsx)("span",{children:T.level})]})]},T.title))})]})]});default:return null}};return(0,$.jsx)(xr,{sidebarItems:kd,title:e,notifications:Pd,businessUnits:t,currentBusinessUnit:w,onBusinessUnitChange:A,activeTab:v,onTabChange:h,showTabs:!0,onActionClick:D,actionIcon:(0,$.jsx)(hl.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:F,onRemoveAll:U,children:(0,$.jsx)(io.AnimatePresence,{mode:"wait",children:(0,$.jsx)(io.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:L()},v)})})}var Rc=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,$i.useState)(null),[r,l]=(0,$i.useState)(""),[n,m]=(0,$i.useState)(""),[s,c]=(0,$i.useState)(""),d=v=>{let h=v.target.files?.[0];h&&(i(h),r||l(h.name))},u=async v=>{if(v.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",r),n&&h.append("description",n),s&&h.append("tags",s),a?.(h),t(),i(null),l(""),m(""),c("")};return(0,Zs.jsx)(Ue,{open:e,onOpenChange:t,children:(0,Zs.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Add New File"})}),(0,Zs.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,Zs.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Zs.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,Zs.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Zs.jsx)(du,{className:"w-10 h-10 text-gray-400"}),(0,Zs.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Zs.jsx)("span",{className:"font-semibold",children:"Click hl upload"})," or drag and drop"]}),(0,Zs.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,Zs.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:d})]})}),o&&(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("p",{className:"font-medium",children:o.name}),(0,Zs.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Zs.jsx)(x,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function du(e){return(0,Zs.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,Zs.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Zs.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Zs.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function Gi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:l}){let[n,m]=(0,Zi.useState)(e),[s,c]=(0,Zi.useState)(""),[d,u]=(0,Zi.useState)("all"),[v,h]=(0,Zi.useState)("all"),[w,p]=(0,Zi.useState)(!1),S=(0,Zi.useRef)(""),R=L=>L.map(T=>`${T.id}-${new Date(T.createdAt).getTime()}-${new Date(T.updatedAt).getTime()}`).join("-");(0,Zi.useEffect)(()=>{let L=R(e);L!==S.current&&(m(e),S.current=L)},[e]);let y=n.filter(L=>L.name.toLowerCase().includes(s.toLowerCase())),k=y.slice(0,10),q=y.filter(Boolean),C=()=>{p(!0)},A=L=>{a?.(L)},D=L=>{console.log("deleting file",L),m(T=>T.filter(Ie=>Ie.name!==L.name)),o?.(L.id.toString())},F=L=>{i?.(L)},U=()=>{c(""),u("all")};return(0,Zs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsx)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Zs.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,Zs.jsx)(ft,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-hl-r from-blue-600 via-indigo-600 hl-purple-600",primaryAction:{label:"Upload file",onClick:C},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Zs.jsx)(W,{children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Zs.jsx)("div",{className:"flex-1",children:(0,Zs.jsxs)("div",{className:"relative",children:[(0,Zs.jsx)(hl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Zs.jsx)(z,{placeholder:"Search files...",value:s,onChange:L=>c(L.target.value),className:"pl-9"})]})}),(s||d!=="all")&&(0,Zs.jsxs)(x,{variant:"outline",onClick:U,className:"gap-2",children:[(0,Zs.jsx)(hl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsx)(Ko,{activeTab:v,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${y.length})`},{value:"recent",label:`Recent (${k.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,Zs.jsx)(Zo,{files:y,onFileClick:F,onFileEdit:A,onFileDelete:D,showHeader:!r}),v==="recent"&&(0,Zs.jsx)(Zo,{files:k,onFileClick:F,onFileEdit:A,onFileDelete:D,showHeader:!r}),v==="shared"&&(0,Zs.jsx)(Zo,{files:q,onFileClick:F,onFileEdit:A,onFileDelete:D,showHeader:!r})]}),y.length===0&&(0,Zs.jsx)(W,{children:(0,Zs.jsx)(Ne,{className:"pt-6",children:(0,Zs.jsxs)("div",{className:"text-center py-8",children:[(0,Zs.jsx)(hl.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Zs.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Zs.jsx)("p",{className:"text-muted-foreground mb-4",children:s||d!=="all"?"Try adjusting your filters hl see more results.":"Get started by uploading your first file."}),(0,Zs.jsxs)(x,{onClick:C,className:"gap-2",children:[(0,Zs.jsx)(hl.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Zs.jsx)(Rc,{isOpen:w,onClose:()=>p(!1),onAddFile:t})]})}var cu=[{key:"kanban",icon:hl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:hl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:hl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:hl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:hl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Ac=({currentView:e,onViewChange:t,children:a})=>(0,Zs.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Zs.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:cu.map(o=>{let i=o.icon,r=e===o.key;return(0,Zs.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 ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Zs.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,Zs.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,Zs.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Zs.jsx)("div",{className:"w-full h-full",children:a})})]});var Ge=oe(require("react"));var Ic=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:l})=>{let n=c=>{c.preventDefault()},m=c=>{c.preventDefault(),i(t)};return(0,Zs.jsxs)(W,{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 ${r?"lg:max-w-xs":""}`,style:{height:l||"calc(100vh - 350px)"},onDragOver:n,onDrop:m,children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Zs.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Zs.jsx)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Zs.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Wi=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=c=>{a(e)},l=()=>{o(e)},n=()=>{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"}},m=()=>{switch(e.type){case"story":return(0,Zs.jsx)(hl.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Zs.jsx)(hl.Bug,{className:"h-3 w-3"});case"spike":return(0,Zs.jsx)(hl.Zap,{className:"h-3 w-3"});case"task":default:return(0,Zs.jsx)(hl.AlertCircle,{className:"h-3 w-3"})}},s=()=>{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 i?(0,Zs.jsx)(W,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:l,children:(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${s()}`,children:m()}),(0,Zs.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Zs.jsxs)(W,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:l,children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Zs.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${s()}`,children:[m(),(0,Zs.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Zs.jsxs)("div",{className:"flex gap-1",children:[(0,Zs.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,Zs.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,Zs.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Zs.jsx)(hl.User,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Zs.jsx)(hl.Calendar,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var mu=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:hl.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:hl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:hl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:hl.Zap}],pu=[{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"}],li=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:l})=>{let[n,m]=(0,Zi.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Zi.useEffect)(()=>{e&&l&&m(d=>({...d,epic:l}))},[e,l]),(0,Zi.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"none",assignee:""})},[e]);let s=d=>{d.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"",assignee:""}),t())},c=(d,u)=>{m(v=>({...v,[d]:u}))};return(0,Zs.jsx)(Ue,{open:e,onOpenChange:t,children:(0,Zs.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Add New Task"})}),(0,Zs.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"name",children:"Task Title"}),(0,Zs.jsx)(z,{id:"name",value:n.name,onChange:d=>c("name",d.target.value),placeholder:"Enter task title",required:!0})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Zs.jsx)(He,{id:"description",value:n.description,onChange:d=>c("description",d.target.value),placeholder:"Enter task description",rows:3})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"Type"}),(0,Zs.jsx)(Po,{type:"single",value:n.type||"",onValueChange:d=>d&&c("type",d),children:mu.map(d=>{let u=d.icon;return(0,Zs.jsxs)(Ro,{value:d.value,className:"flex items-center gap-2 data-[state=io]:bg-primary data-[state=io]:text-primary-foreground",children:[(0,Zs.jsx)(u,{className:"h-4 w-4"}),d.label]},d.value)})})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"Priority"}),(0,Zs.jsx)(Po,{type:"single",value:n.priority||"",onValueChange:d=>d&&c("priority",d),children:pu.map(d=>(0,Zs.jsx)(Ro,{value:d.value,className:"data-[state=io]:bg-primary data-[state=io]:text-primary-foreground",children:d.label},d.value))})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"points",children:"Story Points"}),(0,Zs.jsx)(z,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:d=>c("storyPoints",parseInt(d.target.value)||1),placeholder:"Enter story points",required:!0})]}),!l&&(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"epic",children:"Epic"}),(0,Zs.jsxs)(at,{value:n.epic,onValueChange:d=>c("epic",d),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{placeholder:"Select an epic"})}),(0,Zs.jsx)(Xe,{children:o.map(d=>(0,Zs.jsx)(xe,{value:d.id.toString(),children:(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.name]})},d.id))})]})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Zs.jsxs)(at,{value:n.sprint,onValueChange:d=>c("sprint",d),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{placeholder:"Select a sprint"})}),(0,Zs.jsxs)(Xe,{children:[(0,Zs.jsx)(xe,{value:"none",children:"No Sprint"}),i.map(d=>(0,Zs.jsx)(xe,{value:d.id.toString(),children:(0,Zs.jsx)("div",{className:"flex items-center gap-2",children:d.name})},d.id))]})]})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"sprint",children:"Assignee"}),(0,Zs.jsxs)(at,{value:n.assignee,onValueChange:d=>c("assignee",d),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{placeholder:"Select an Assignee"})}),(0,Zs.jsxs)(Xe,{children:[(0,Zs.jsx)(xe,{value:"none",children:"No Assignee"}),r.map(d=>(0,Zs.jsx)(xe,{value:d.id.toString(),children:(0,Zs.jsx)("div",{className:"flex items-center gap-2",children:d.name})},d.id))]})]})]}),(0,Zs.jsxs)(zo,{children:[(0,Zs.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Zs.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Ec=({comments:e,onAddComment:t})=>{let[a,o]=(0,Zi.useState)(""),i=l=>l.split(" ").map(n=>n[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.MessageSquare,{className:"h-5 w-5"}),(0,Zs.jsx)(E,{className:"text-lg font-medium",children:"Comments"}),(0,Zs.jsx)(se,{variant:"secondary",children:e.length})]}),(0,Zs.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(l=>(0,Zs.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Zs.jsx)(ea,{className:"h-8 w-8 mt-1",children:(0,Zs.jsx)(ta,{className:"text-xs bg-muted text-muted-foreground",children:i(l.author)})}),(0,Zs.jsxs)("div",{className:"flex-1",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Zs.jsx)("span",{className:"font-medium text-sm",children:l.author}),(0,Zs.jsxs)("span",{className:"text-xs text-muted-foreground",children:[l.createdAt.toLocaleDateString()," at ",l.createdAt.toLocaleTimeString()]})]}),(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground",children:l.text})]})]},l.id))}),(0,Zs.jsxs)("div",{className:"flex gap-2",children:[(0,Zs.jsx)(He,{value:a,onChange:l=>o(l.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Zs.jsx)(x,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Zs.jsx)(hl.Send,{className:"h-4 w-4"})})]})]})};var tn=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[l,n]=(0,Zi.useState)(!1),m=o.find(c=>c.value===t);return(0,Zs.jsxs)("div",{className:"space-y-1",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:e}),(0,Zs.jsxs)(at,{value:t,onValueChange:a,open:l,onOpenChange:c=>{r||n(c)},disabled:r,children:[(0,Zs.jsx)(qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Zs.jsxs)(se,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&n(!l),children:[i&&m?.color&&(0,Zs.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} mr-1`}),m?.label||"Select..."]})}),(0,Zs.jsx)(Xe,{children:o.map(c=>(0,Zs.jsx)(xe,{value:c.value,children:i&&c.color?(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.label]}):c.label},c.value))})]})]})};var Nt=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var uu=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:hl.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:hl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:hl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:hl.Zap}],gu=[{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 Lc=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:l,isUpdating:n=!1,isDeleting:m=!1,deleteState:s="idle",teamMembers:c})=>{let[d,u]=(0,Zi.useState)(e.storyPoints),v=(0,Zi.useRef)(null),[h,w]=(0,Zi.useState)(c);(0,Zi.useEffect)(()=>{w(c)},[c]);let p=(0,Zi.useCallback)((y,k)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{i(y,k)},500)},[i]);(0,Zi.useEffect)(()=>{p("storyPoints",d?.toString()||"1")},[d]);let S=y=>y.split(" ").map(k=>k[0]).join("").toUpperCase(),R=()=>s==="loading"?(0,Zs.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Zs.jsx)(hl.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):s==="success"?(0,Zs.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Zs.jsx)(hl.Check,{className:"h-3 w-3"}),"Deleted"]}):s==="error"?(0,Zs.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Zs.jsx)(hl.Zs,{className:"h-3 w-3"}),"Delete failed"]}):(0,Zs.jsxs)(x,{onClick:l,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||m,children:[(0,Zs.jsx)(hl.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Zs.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Zs.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Zs.jsx)(tn,{label:"",value:e.status,onValueChange:y=>i("status",y),options:[{value:"todo",label:"io Zi"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Zs.jsx)(Po,{type:"single",value:e.type||"",onValueChange:y=>y&&i("type",y),className:"grid grid-cols-2 gap-1",disabled:n,children:uu.map(y=>{let k=y.icon;return(0,Zs.jsxs)(Ro,{value:y.value,className:"flex items-center gap-1 text-xs h-8 data-[state=io]:bg-primary data-[state=io]:text-primary-foreground",size:"sm",disabled:n,children:[(0,Zs.jsx)(k,{className:"h-3 w-3"}),y.label]},y.value)})})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Zs.jsx)(Po,{type:"single",value:e.priority||"",onValueChange:y=>y&&i("priority",y),className:"grid grid-cols-3 gap-1",disabled:n,children:gu.map(y=>(0,Zs.jsx)(Ro,{value:y.value,className:"text-xs h-8 data-[state=io]:bg-primary data-[state=io]:text-primary-foreground",size:"sm",disabled:n,children:y.label},y.value))})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Zs.jsx)("input",{type:"number",min:"1",max:"100",value:d||1,onChange:y=>{let k=Number(y.target.value);k<1?u(1):k>100?u(100):u(k)},className:"w-full h-8 px-2 text-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:n})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Zs.jsx)(tn,{label:"",value:Nt(e.epic).toString(),onValueChange:y=>i("epic",y),options:(t||[]).map(y=>({value:y.id.toString(),label:y?.name,color:y.color})),showColor:!0,disabled:n})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Zs.jsx)(tn,{label:"",value:Nt(e.sprint).toString()||"none",onValueChange:y=>i("sprint",y==="none"?"":y),options:[{value:"none",label:"No Sprint"},...(a||[]).map(y=>({value:y.id.toString(),label:`${y?.name}`}))],disabled:n})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Zs.jsx)(kr,{label:"",value:e.assignee?.value?.name,onValueChange:y=>i("assignee",y),options:h.map(y=>({value:`${typeof y.email=="string"?"users":"digital-colleagues"}:${y.id}`,label:y?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,Zs.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(x,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:n||m,children:"Close"}),R()]}),(0,Zs.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Zs.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Zs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Zs.jsx)(hl.User,{className:"h-3 w-3"}),(0,Zs.jsx)("span",{children:"System"})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Zs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Zs.jsx)(hl.Calendar,{className:"h-3 w-3"}),(0,Zs.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Zs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Zs.jsx)(hl.Clock,{className:"h-3 w-3"}),(0,Zs.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Fc=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:l,onAddComment:n,colleagues:m})=>{let[s,c]=(0,Zi.useState)(a),[d,u]=(0,Zi.useState)(new Date),[v,h]=(0,Zi.useState)("idle"),[w,p]=(0,Zi.useState)("idle"),[S,R]=(0,Zi.useState)([]),[y,k]=(0,Zi.useState)(m);(0,Zi.useEffect)(()=>{c(a)},[a]);let q=async(T,Ie)=>{if(Ie!==s[T]){h("loading");try{await r(s.id.toString(),{[T]:Ie}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(P){console.log("error",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},C=async(T,Ie)=>{if(Ie!==s[T]){h("loading");try{await r(s.id.toString(),{[T]:Ie}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(P){console.log("error",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},A=async T=>{if(n){h("loading");try{await n?.({content:T,taskId:s.id.toString()}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},D=async()=>{p("loading");try{await l(s.id.toString()),p("success"),setTimeout(()=>{t(),p("idle")},1e3)}catch{p("error"),setTimeout(()=>p("idle"),3e3)}},F=v!=="loading"&&w!=="loading",U=()=>{F&&t()},L=()=>v==="loading"?(0,Zs.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Zs.jsx)(hl.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Zs.jsx)("span",{children:"Updating..."})]}):v==="success"?(0,Zs.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Zs.jsx)(hl.Check,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{children:"Updated successfully"})]}):v==="error"?(0,Zs.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{children:"Update failed"})]}):null;return(0,Zs.jsx)(Ue,{open:e,onOpenChange:U,children:(0,Zs.jsxs)(Ke,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Zs.jsxs)(_e,{children:[(0,Zs.jsx)($e,{className:"Zs-only",children:s?.name}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)("div",{className:"flex-1",children:L()}),!F&&(0,Zs.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Zs.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Zs.jsx)(ai,{fieldName:"name",value:s.name||"",label:"",onSave:q,className:"border-Zs border-border pb-3",disabled:v==="loading"}),(0,Zs.jsx)(ai,{fieldName:"description",value:s.description||"",label:"Description",multiline:!0,onSave:q,disabled:v==="loading"}),(0,Zs.jsx)(Ec,{comments:(s?.comments||[]).map(T=>({author:T.author.value.name||"",createdAt:new Date(T.timestamp),text:T.text,id:T.id||""})),onAddComment:A})]}),(0,Zs.jsx)(Lc,{task:s,epics:o,sprints:i,lastUpdated:d,onUpdateTask:C,onClose:U,onDelete:D,isUpdating:v==="loading",isDeleting:w==="loading",deleteState:w,teamMembers:y})]})]})})};var ci=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,Zi.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}),r=["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"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=c=>{c.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}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},s=(c,d)=>{i(u=>({...u,[c]:d}))};return(0,Zs.jsx)(Ue,{open:e,onOpenChange:t,children:(0,Zs.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Add New Epic"})}),(0,Zs.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"name",children:"Epic Name"}),(0,Zs.jsx)(z,{id:"name",value:o.name,onChange:c=>s("name",c.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Zs.jsx)(He,{id:"description",value:o.description,onChange:c=>s("description",c.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"Color"}),(0,Zs.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(c=>(0,Zs.jsx)("button",{type:"button",onClick:()=>s("color",c),className:`w-8 h-8 rounded-full ${c} ${o.color===c?"ring-2 ring-gray-400":""}`},c))})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"Confidence"}),(0,Zs.jsxs)(at,{value:o.confidence,onValueChange:c=>s("confidence",c),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{})}),(0,Zs.jsx)(Xe,{children:l.map(c=>(0,Zs.jsx)(xe,{value:c.value,children:c.label},c.value))})]})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"Phase"}),(0,Zs.jsxs)(at,{value:o.phase.toString(),onValueChange:c=>s("phase",parseInt(c)),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{})}),(0,Zs.jsx)(Xe,{children:n.map(c=>(0,Zs.jsx)(xe,{value:c.value.toString(),children:c.label},c.value))})]})]})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"Start Date"}),(0,Zs.jsx)(z,{type:"date",value:o.startDate,onChange:c=>s("startDate",c.target.value)})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"End Date"}),(0,Zs.jsx)(z,{type:"date",value:o.endDate,onChange:c=>s("endDate",c.target.value)})]})]}),(0,Zs.jsxs)(zo,{children:[(0,Zs.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Zs.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Hc=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:l,onUpdateTask:n,onDeleteTask:m,onTaskClick:s,onAddEpic:c,onAddComment:d})=>{let[u,v]=(0,Ge.useState)([]),[h,w]=(0,Ge.useState)([]),[p,S]=(0,Ge.useState)([]),[R,y]=(0,Ge.useState)(!1),[k,q]=(0,Ge.useState)(!1),[C,A]=(0,Ge.useState)(null),[D,F]=(0,Ge.useState)(null),[U,L]=(0,Ge.useState)([]),[T,Ie]=(0,Ge.useState)([]),[P,I]=(0,Ge.useState)(0),_=(0,Ge.useRef)(null),Te=(0,Ge.useRef)(null),Ve=Ge.default.useMemo(()=>[...h.map(K=>K.id),0],[h]),mt=(0,Ge.useRef)(""),Jt=(0,Ge.useRef)(""),H=(0,Ge.useRef)(""),Ae=(0,Ge.useRef)(""),We=K=>K.map(N=>`${N.id}-${new Date(N.createdAt).getTime()}-${new Date(N.updatedAt).getTime()}`).join("-");(0,Ge.useEffect)(()=>{let K=We(e);K!==mt.current&&(v(e),C&&A(e.find(N=>N.id===C.id)||null),mt.current=K)},[e]),(0,Ge.useEffect)(()=>{let K=We(t);K!==Jt.current&&(w(t),Jt.current=K)},[t]),(0,Ge.useEffect)(()=>{let K=We(a);K!==H.current&&(S(a),H.current=K)},[a]),(0,Ge.useEffect)(()=>{let K=We(i.map(N=>({id:N.id,updatedAt:N.updatedAt,createdAt:N.createdAt})));K!==Ae.current&&(Ie(i),Ae.current=K)},[i]),(0,Ge.useEffect)(()=>{let K=()=>{if(_.current){let re=_.current.offsetHeight;I(re)}};K();let N=new ResizeObserver(K);_.current&&N.observe(_.current);let M=()=>{setTimeout(K,100)};return window.addEventListener("storage",M),()=>{N.disconnect(),window.removeEventListener("storage",M)}},[]),(0,Ge.useEffect)(()=>{let K=setTimeout(()=>{_.current&&I(_.current.offsetHeight)},300);return()=>clearTimeout(K)},[R,k]);let Zt=u.filter(K=>!0),Le=K=>Zt.filter(N=>N.status===K),Vt=K=>{let N={};return h.forEach(M=>{N[M.id]=K.filter(re=>Nt(re.epic)===M.id)}),N["Zs-epic"]=K.filter(M=>!Nt(M.epic)),N},O=K=>{F(K)},pt=K=>{D&&(v(N=>N.map(M=>M.id===D.id?{...M,status:K}:M)),n?.(D.id.toString(),{status:K}),F(null))},sa=K=>{let N={...K,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(M=>[...M,N]),l?.(K)},Ya=async(K,N)=>{v(M=>M.map(re=>re.id===Number(K)?{...re,...N}:re)),n&&await n(K,N),C?.id===Number(K)&&A(M=>({...M,...N}))},uo=async K=>{v(N=>N.filter(M=>M.id!==Number(K))),C?.id===Number(K)&&A(null),m&&await m(K)},Eo=K=>{let N={...K,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};w(M=>[...M,N]),c?.(K)},Za=K=>{A(K),s?.(K)},Bo=[{id:"todo",title:"io Zi",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Lo=P>0?`calc(100vh - ${P+120}px)`:"calc(100vh - 12rem)";return(0,Zs.jsxs)("div",{ref:Te,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Zs.jsx)("div",{ref:_,className:"flex-shrink-0",children:(0,Zs.jsx)(ft,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-hl-r from-purple-600 via-violet-600 hl-indigo-600",primaryAction:{label:"Add task",onClick:()=>y(!0)},secondaryAction:{label:"Add epic",onClick:()=>q(!0)}})}),(0,Zs.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Zs.jsx)("div",{className:"h-full",style:{height:P>0?`calc(100vh - ${P+120}px)`:"calc(100vh - 12rem)"},children:(0,Zs.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Bo.map(K=>{let N=Le(K.status),M=Vt(N);return(0,Zs.jsxs)(Ic,{title:K.title,status:K.status,taskCount:N.length,onDrop:pt,isCompact:K.status==="done",height:Lo,children:[M["Zs-epic"].map(re=>(0,Zs.jsx)(Wi,{epic:null,task:re,onDragStart:O,onTaskClick:Za,isCompact:K.status==="done"},re.id)),Ve.map(re=>{let Me=h.find(ut=>ut.id===re),ht=M[re]||[];return ht.length===0?null:(0,Zs.jsxs)("div",{className:"mb-6",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Zs.jsx)("div",{className:`w-3 h-3 rounded-full ${Me?.color}`}),(0,Zs.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Me?.name||"No Epic"}),(0,Zs.jsx)(se,{variant:"secondary",className:"text-xs",children:ht.length})]})," ",(0,Zs.jsx)("div",{className:"space-y-3",children:ht.map(ut=>(0,Zs.jsx)(Wi,{task:ut,epic:Me,onDragStart:O,onTaskClick:Za,isCompact:K.status==="done"},ut.id))})]},re)})]},K.id)})})})}),(0,Zs.jsx)(li,{isOpen:R,onClose:()=>y(!1),onAddTask:sa,assignees:[...T,...U],epics:h,sprints:p}),(0,Zs.jsx)(ci,{isOpen:k,onClose:()=>q(!1),onAddEpic:Eo}),C&&(0,Zs.jsx)(Fc,{isOpen:!!C,onClose:()=>A(null),initialTask:C,epics:h,sprints:p,onUpdateTask:Ya,onDeleteTask:uo,colleagues:T,onAddComment:d})]})};var jc=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:l,onUpdateEpic:n,onDeleteEpic:m})=>{let[s,c]=(0,Zi.useState)(t),[d,u]=(0,Zi.useState)(null),[v,h]=(0,Zi.useState)(null),[w,p]=(0,Zi.useState)({}),[S,R]=(0,Zi.useState)(0),[y,k]=(0,Zi.useState)(!1),[q,C]=(0,Zi.useState)(!1),[A,D]=(0,Zi.useState)(null),F=(0,Zi.useRef)(null),U=(0,Zi.useRef)(null);(0,Zi.useEffect)(()=>{c(t)},[t]),(0,Zi.useEffect)(()=>{let H=()=>{if(F.current){let Zt=F.current.offsetHeight;R(Zt)}};H();let Ae=new ResizeObserver(H);F.current&&Ae.observe(F.current);let We=()=>{setTimeout(H,100)};return window.addEventListener("storage",We),()=>{Ae.disconnect(),window.removeEventListener("storage",We)}},[]),(0,Zi.useEffect)(()=>{let H=setTimeout(()=>{F.current&&R(F.current.offsetHeight)},300);return()=>clearTimeout(H)},[v]);let L=H=>{u(H)},T=H=>{H.preventDefault()},Ie=(H,Ae)=>{H.preventDefault(),d&&Nt(d.epic).toString()!==Ae&&(o(d.id.toString(),{epic:Number(Ae)}),u(null))},P=H=>e.filter(Ae=>Nt(Ae.epic).toString()===H),I=H=>{h(H.id.toString()),p({name:H.name,description:H.description,confidence:H.confidence,phase:H.phase})},_=async()=>{v&&w.name&&(await n(v.toString(),w),c(H=>H.map(Ae=>Ae.id.toString()===v?{...Ae,...w}:Ae)),h(null),p({}))},Te=()=>{h(null),p({})},Ve=async H=>{window.confirm("Are you sure you want hl delete this epic? This will also delete all associated tasks.")&&(await m(H),c(Ae=>Ae.filter(We=>We.id.toString()!==H)))},mt=H=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[H]||`Phase ${H}`,Jt=H=>{switch(H){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsxs)("div",{ref:U,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Zs.jsx)("div",{ref:F,className:"flex-shrink-0",children:(0,Zs.jsx)(ft,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-hl-r from-rose-600 via-pink-600 hl-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>k(!0)}})}),(0,Zs.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Zs.jsx)("div",{className:"h-full overflow-y-auto",style:{height:S>0?`calc(100vh - ${S+120}px)`:"calc(100vh - 12rem)"},children:(0,Zs.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 ul:grid-cols-4 gap-6 auto-rows-max",children:s.map(H=>{let Ae=P(H.id.toString()),We=Ae.reduce((Le,Vt)=>Le+(Vt.storyPoints||0),0),Zt=S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 14rem)";return(0,Zs.jsxs)(W,{className:`flex flex-col ${v===H.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:v===H.id.toString()?"auto":Zt,minHeight:"400px"},onDragOver:T,onDrop:Le=>Ie(Le,H.id.toString()),children:[(0,Zs.jsx)("div",{className:"p-4 border-Zs border-border",children:v===H.id.toString()?(0,Zs.jsxs)("div",{className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)(z,{value:w.name||"",onChange:Le=>p({...w,name:Le.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Zs.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:_,className:"p-1 h-8 w-8",children:(0,Zs.jsx)(hl.Check,{className:"h-4 w-4"})}),(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:Te,className:"p-1 h-8 w-8",children:(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"})})]})]}),(0,Zs.jsx)(He,{value:w.description||"",onChange:Le=>p({...w,description:Le.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Zs.jsxs)("select",{value:w.confidence||H.confidence,onChange:Le=>p({...w,confidence:Le.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,Zs.jsx)("option",{value:"low",children:"Low"}),(0,Zs.jsx)("option",{value:"medium",children:"Medium"}),(0,Zs.jsx)("option",{value:"high",children:"High"})]})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Zs.jsx)("select",{value:w.phase?.toString()||H.phase.toString(),onChange:Le=>p({...w,phase:parseInt(Le.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(Le=>(0,Zs.jsxs)("option",{value:Le.toString(),children:["Phase ",Le]},Le))})]})]})]}):(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Zs.jsx)("div",{className:`w-4 h-4 rounded-full ${H.color}`}),(0,Zs.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:H.name}),(0,Zs.jsxs)("div",{className:"flex gap-1",children:[(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>I(H),className:"p-1 h-8 w-8",children:(0,Zs.jsx)(hl.Edit2,{className:"h-3 w-3"})}),(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>Ve(H.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Zs.jsx)(hl.Trash2,{className:"h-3 w-3"})})]})]}),(0,Zs.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Zs.jsxs)(se,{className:`text-xs ${Jt(H.confidence)}`,children:[H.confidence," confidence"]}),(0,Zs.jsxs)(se,{variant:"outline",className:"text-xs",children:["Phase ",H.phase]}),(0,Zs.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Ae.length," tasks"]}),(0,Zs.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[We," pts"]})]}),H.description&&(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:H.description}),(0,Zs.jsxs)(x,{onClick:()=>{C(!0),D(H)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Zs.jsx)(hl.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Zs.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Zs.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${d?"border-primary bg-primary/10":"border-border"}`,children:Ae.length===0?(0,Zs.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,Zs.jsx)(hl.Move,{className:"h-8 w-8 mb-2"}),(0,Zs.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):Ae.map(Le=>(0,Zs.jsx)(Wi,{task:Le,epic:H,onDragStart:L,onTaskClick:i,isCompact:!0},Le.id))})})]},H.id)})})})})]}),(0,Zs.jsx)(ci,{isOpen:y,onClose:()=>k(!1),onAddEpic:l}),(0,Zs.jsx)(li,{isOpen:q,onClose:()=>C(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:A?.id.toString()||"",sprints:a})]})};var Rs=require("date-fns");var zc=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,Zi.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=n=>{n.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()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},l=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Zs.jsx)(Ue,{open:e,onOpenChange:l,children:(0,Zs.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Add New Sprint"})}),(0,Zs.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"name",children:"Sprint Name *"}),(0,Zs.jsx)(z,{id:"name",value:o.name,onChange:n=>i(m=>({...m,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Zs.jsx)(He,{id:"description",value:o.description,onChange:n=>i(m=>({...m,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"Start Date *"}),(0,Zs.jsxs)(Cs,{children:[(0,Zs.jsx)(Ss,{asChild:!0,children:(0,Zs.jsxs)(x,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Zs.jsx)(hl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Rs.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Zs.jsx)(Xr,{className:"w-auto p-0",align:"start",children:(0,Zs.jsx)(Yr,{mode:"single",selected:o.startDate,onSelect:n=>i(m=>({...m,startDate:n})),initialFocus:!0})})]})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{children:"End Date *"}),(0,Zs.jsxs)(Cs,{children:[(0,Zs.jsx)(Ss,{asChild:!0,children:(0,Zs.jsxs)(x,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Zs.jsx)(hl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Rs.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Zs.jsx)(Xr,{className:"w-auto p-0",align:"start",children:(0,Zs.jsx)(Yr,{mode:"single",selected:o.endDate,onSelect:n=>i(m=>({...m,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,Zs.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Zs.jsx)(x,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),(0,Zs.jsx)(x,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var an=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:l,onDeleteSprint:n})=>{let[m,s]=(0,Zi.useState)([]),[c,d]=(0,Zi.useState)(new Set),[u,v]=(0,Zi.useState)(null),[h,w]=(0,Zi.useState)(!1),[p,S]=(0,Zi.useState)(null),[R,y]=(0,Zi.useState)(null),[k,q]=(0,Zi.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[C,A]=(0,Zi.useState)([]),[D,F]=(0,Zi.useState)("upcoming"),[U,L]=(0,Zi.useState)(!1),[T,Ie]=(0,Zi.useState)(0),P=(0,Zi.useRef)(null),I=(0,Zi.useRef)(null);(0,Zi.useEffect)(()=>{let N=()=>{P.current&&Ie(P.current.offsetHeight)};N();let M=new ResizeObserver(N);return P.current&&M.observe(P.current),()=>M.disconnect()},[]);let _=N=>t.find(M=>M.id===Number(N)),Te=N=>a.find(M=>M.id===Number(N)),Ve=N=>{let M={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 M[N]||M.medium},mt=N=>{if(!N||N?.length===0)return"";let M=N?.trim().split(" ");if(M?.length===1)return M[0];let re=M[0],Me=M[M.length-1][0].toUpperCase();return`${re} ${Me}`},Jt=N=>{let M={},re=[];return N.forEach(Me=>{Me.epic?(M[Nt(Me.epic)]||(M[Nt(Me.epic)]=[]),M[Nt(Me.epic)].push(Me)):re.push(Me)}),{tasksByEpic:M,unassignedTasks:re}};(0,Zi.useEffect)(()=>{A(a)},[a]);let H=C.filter(N=>{switch(D){default:return!0}}),Ae=C.filter(N=>m.includes(N.id.toString())),We=e.filter(N=>!N.sprint||N.status==="backlog"),Zt=We.reduce((N,M)=>N+(M.storyPoints||0),0),Le=N=>{s(M=>M.includes(N)?M.filter(re=>re!==N):M?.length<3?[...M,N]:M)},Vt=N=>{d(M=>{let re=new Set(M);return re.has(N)?re.delete(N):re.add(N),re})},O=N=>{r(N),w(!1)},pt=N=>{y(N.id.toString()),q({name:N.name,description:N.description||"",startDate:N.startDate?new Date(N.startDate).toISOString().split("T")[0]:N.startDate,endDate:N.endDate?new Date(N.endDate).toISOString().split("T")[0]:N.endDate,isActive:!1})},sa=()=>{R&&(l(R,{name:k.name,description:k.description,startDate:k.startDate,endDate:k.endDate}),A(N=>N.map(M=>(M.id===Number(R)&&(M.name=k.name,M.description=k.description,M.startDate=k.startDate,M.endDate=k.endDate),M))),y(null))},Ya=()=>{y(null),q({name:"",description:"",startDate:"",endDate:"",isActive:!1})},uo=(N,M)=>{v(M),N.dataTransfer.effectAllowed="move"},Eo=N=>{N.preventDefault(),N.dataTransfer.dropEffect="move"},Za=N=>{S(N)},Bo=()=>{S(null)},Lo=(N,M)=>{if(N.preventDefault(),S(null),!u)return;(Nt(u.sprint)||void 0)!==Number(M)&&o(u.id.toString(),{sprint:Number(M)}),v(null)},K=({task:N,showSprint:M=!1})=>{let re=N.epic?_(Nt(N.epic).toString()):null,Me=N.sprint?Te(Nt(N.sprint).toString()):null;return(0,Zs.jsx)(W,{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:Kt=>{Kt.dataTransfer.effectAllowed="move",Kt.dataTransfer.setData("text/plain",N.id.toString()),uo(Kt,N)},onClick:Kt=>{u===null&&i(N)},style:{userSelect:"none"},children:(0,Zs.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Zs.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Zs.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:N.name}),(0,Zs.jsx)(se,{className:`text-xs ${Ve(N.priority||"medium")}`,children:N.priority?.[0]?.toUpperCase()})]}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-1",children:[re&&(0,Zs.jsx)("div",{className:`w-2 h-2 rounded-full ${re.color}`}),(0,Zs.jsx)("span",{className:"text-muted-foreground truncate",children:re?.name})]}),(0,Zs.jsx)("span",{className:"text-muted-foreground",children:mt(N.assignee?.value?.name)})]}),M&&Me&&(0,Zs.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Zs.jsx)(hl.Calendar,{className:"h-3 w-3"}),(0,Zs.jsx)("span",{children:Me.name})]})]})})};return(0,Zs.jsxs)("div",{ref:I,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Zs.jsx)("div",{ref:P,className:"flex-shrink-0",children:(0,Zs.jsx)(ft,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-hl-r from-orange-600 via-amber-600 hl-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>w(!0)}})}),(0,Zs.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Zs.jsxs)("div",{className:"h-full",style:{height:T>0?`calc(100vh - ${T+120}px)`:"calc(100vh - 12rem)"},children:[(0,Zs.jsxs)("div",{className:"mb-4",children:[(0,Zs.jsx)(W,{className:"p-3 bg-card shadow-sm",children:(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Zs.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Zs.jsx)("div",{className:"flex flex-wrap gap-1",children:Ae.map(N=>(0,Zs.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Zs.jsx)("span",{className:"max-w-[80px] truncate",children:N.name}),(0,Zs.jsx)("button",{onClick:()=>Le(N.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"})})]},N.id))})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsxs)(x,{onClick:()=>w(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Zs.jsx)(hl.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Zs.jsxs)(x,{onClick:()=>L(!U),variant:"outline",size:"sm",className:"gap-1",children:[(0,Zs.jsx)(hl.Calendar,{className:"h-3 w-3"}),U?"Close":"Select"]})]})]})}),U&&(0,Zs.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>L(!1)}),(0,Zs.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-ul z-10 transition-all duration-300 ease-in-out ${U?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Zs.jsxs)(W,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Zs.jsxs)("div",{className:"p-4 border-Zs bg-muted/30 flex-shrink-0",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Zs.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Zs.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>L(!1),className:"h-8 w-8 p-0",children:(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"})})]}),(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up hl 3 sprints hl view in your planning board"})]}),(0,Zs.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Zs.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(N=>(0,Zs.jsxs)(x,{variant:D===N.key?"default":"outline",size:"sm",onClick:()=>F(N.key),className:"text-xs h-8 px-3 flex-1",children:[N.label," (",N.count,")"]},N.key))}),(0,Zs.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:H.length>0?H.map(N=>{let M=m.includes(N.id.toString()),re=e.filter(ht=>Nt(ht.sprint)===N.id).length,Me=!M&&m.length<3;return(0,Zs.jsx)("div",{className:`p-3 rounded-lg border transition-all ${M?"bg-primary/10 border-primary/30":Me?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:R===N.id.toString()?(0,Zs.jsxs)("div",{className:"space-y-3",children:[(0,Zs.jsx)(z,{value:k.name,onChange:ht=>q(ut=>({...ut,name:ht.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Zs.jsx)(He,{value:k.description,onChange:ht=>q(ut=>({...ut,description:ht.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Zs.jsxs)("div",{className:"flex gap-2",children:[(0,Zs.jsxs)(x,{size:"sm",onClick:()=>sa(),className:"flex-1",children:[(0,Zs.jsx)(hl.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Zs.jsxs)(x,{size:"sm",variant:"outline",onClick:Ya,className:"flex-1",children:[(0,Zs.jsx)(hl.Zs,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Zs.jsxs)("div",{children:[(0,Zs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Zs.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Zs.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:N.name}),(0,Zs.jsx)(se,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:N.description}),(0,Zs.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Zs.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Zs.jsx)(hl.CalendarDays,{className:"h-3 w-3"}),new Date(N.startDate).toLocaleDateString()]}),(0,Zs.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Zs.jsx)(hl.User,{className:"h-3 w-3"}),re," tasks"]})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>pt(N),className:"h-6 w-6 p-0",children:(0,Zs.jsx)(hl.Edit2,{className:"h-3 w-3"})}),(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>n(N.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Zs.jsx)(hl.Trash2,{className:"h-3 w-3"})})]})]}),(0,Zs.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Zs.jsx)(x,{variant:M?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Le(N.id.toString()),disabled:!M&&m?.length>=3,children:(0,Zs.jsx)("span",{className:"pointer-events-none select-none",children:M?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},N.id)}):(0,Zs.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Zs.jsx)(hl.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Zs.jsxs)("p",{className:"text-sm",children:['No sprints found for "',D,'" filter']}),(0,Zs.jsx)(x,{variant:"link",size:"sm",onClick:()=>F("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,Zs.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Zs.jsxs)("div",{className:"text-center",children:[(0,Zs.jsx)(hl.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints hl start planning"}),(0,Zs.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up hl 3 sprints hl view alongside your backlog"})]})})]})]})})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Zs.jsx)("div",{className:"lg:col-span-1",children:(0,Zs.jsxs)(W,{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:Eo,onDragEnter:()=>Za("backlog"),onDragLeave:Bo,onDrop:N=>Lo(N,"backlog"),style:{height:T>0?`calc(100vh - ${T+200}px)`:"calc(100vh - 16rem)"},children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Zs.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsxs)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[We?.length," tasks"]}),(0,Zs.jsxs)(se,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Zt," pts"]})]})]}),(0,Zs.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:N,unassignedTasks:M}=Jt(We);return(0,Zs.jsxs)(Zs.Fragment,{children:[Object.entries(N).map(([re,Me])=>{let ht=_(re);if(!ht)return null;let ut=c.has(re);return(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.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:()=>Vt(re),children:[(0,Zs.jsx)("div",{className:`w-3 h-3 rounded-full ${ht.color}`}),(0,Zs.jsx)("span",{className:"font-medium text-muted-foreground",children:ht.name}),(0,Zs.jsxs)("span",{className:"text-muted-foreground",children:["(",Me?.length,")"]}),(0,Zs.jsx)("div",{className:"ml-auto",children:ut?(0,Zs.jsx)(hl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Zs.jsx)(hl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ut&&(0,Zs.jsx)("div",{className:"space-y-2 pl-2",children:Me.map(Kt=>(0,Zs.jsx)(K,{task:Kt},Kt.id))})]},re)}),M?.length>0&&(()=>{let re=c.has("Zs-epic");return(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.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:()=>Vt("Zs-epic"),children:[(0,Zs.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Zs.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Zs.jsxs)("span",{className:"text-muted-foreground",children:["(",M?.length,")"]}),(0,Zs.jsx)("div",{className:"ml-auto",children:re?(0,Zs.jsx)(hl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Zs.jsx)(hl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!re&&(0,Zs.jsx)("div",{className:"space-y-2 pl-2",children:M?.map(Me=>(0,Zs.jsx)(K,{task:Me},Me.id))})]})})(),We?.length===0&&(0,Zs.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here hl move hl backlog"}),We?.length>0&&Object.keys(N).length===0&&M.length===0&&(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),We?.map(re=>(0,Zs.jsx)(K,{task:re},re.id))]})]})})()})]})}),Ae.map(N=>{let M=e.filter(Me=>Nt(Me?.sprint)===N.id),re=M.reduce((Me,ht)=>Me+(ht?.storyPoints||0),0);return(0,Zs.jsxs)(W,{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:Eo,onDragEnter:()=>Za(N.id.toString()),onDragLeave:Bo,onDrop:Me=>Lo(Me,N.id.toString()),style:{height:T>0?`calc(100vh - ${T+200}px)`:"calc(100vh - 16rem)"},children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Zs.jsx)("div",{children:(0,Zs.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:N.name})}),(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsxs)(se,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[M?.length," tasks"]}),(0,Zs.jsxs)(se,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[re," pts"]}),(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>{L(!0),pt(N)},className:"h-6 px-2",children:(0,Zs.jsx)(hl.Edit2,{className:"h-3 w-3"})}),(0,Zs.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>n(N.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Zs.jsx)(hl.Trash2,{className:"h-3 w-3"})})]})]}),(0,Zs.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:Me,unassignedTasks:ht}=Jt(M);return(0,Zs.jsxs)(Zs.Fragment,{children:[Object.entries(Me).map(([ut,Kt])=>{let pi=_(ut);if(!pi)return null;let ui=c.has(ut);return(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.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:()=>Vt(ut),children:[(0,Zs.jsx)("div",{className:`w-3 h-3 rounded-full ${pi.color}`}),(0,Zs.jsx)("span",{className:"font-medium text-muted-foreground",children:pi.name}),(0,Zs.jsxs)("span",{className:"text-muted-foreground",children:["(",Kt?.length,")"]}),(0,Zs.jsx)("div",{className:"ml-auto",children:ui?(0,Zs.jsx)(hl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Zs.jsx)(hl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ui&&(0,Zs.jsx)("div",{className:"space-y-2 pl-2",children:Kt?.map(gi=>(0,Zs.jsx)(K,{task:gi},gi.id))})]},ut)}),ht?.length>0&&(()=>{let ut=c.has("Zs-epic");return(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.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:()=>Vt("Zs-epic"),children:[(0,Zs.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Zs.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Zs.jsxs)("span",{className:"text-muted-foreground",children:["(",ht?.length,")"]}),(0,Zs.jsx)("div",{className:"ml-auto",children:ut?(0,Zs.jsx)(hl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Zs.jsx)(hl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ut&&(0,Zs.jsx)("div",{className:"space-y-2 pl-2",children:ht?.map(Kt=>(0,Zs.jsx)(K,{task:Kt},Kt.id))})]})})(),M?.length===0&&(0,Zs.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},N.id)})]}),(0,Zs.jsx)(zc,{isOpen:h,onClose:()=>w(!1),onAddSprint:O})]})})]})};var fu=e=>e.toLocaleDateString("hl-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),vu=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("hl-US",{hour:"numeric",minute:"2-digit",hour12:!0})},As=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},Is=e=>{let t=new Date;return e.toDateString()===t.toDateString()},hu=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},bu=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,Zi.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[l,n]=(0,Zi.useState)(!1),m=c=>{if(c.preventDefault(),!e.find(v=>v?.id.toString()===i.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let u={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(u),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Zi.useEffect)(()=>{i.colleagueId&&n(!1)},[i.colleagueId]);let s=e.filter(Boolean);return(0,Zs.jsx)(Ue,{open:a,onOpenChange:o,children:(0,Zs.jsxs)(Ke,{className:"max-w-2xl",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Add New Reminder"})}),(0,Zs.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Zs.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"title",children:"Title"}),(0,Zs.jsx)(z,{id:"title",value:i.title,onChange:c=>r({...i,title:c.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"description",children:"Description"}),(0,Zs.jsx)(He,{id:"description",value:i.description,onChange:c=>r({...i,description:c.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"dueDate",children:"Due Date"}),(0,Zs.jsx)(z,{id:"dueDate",type:"date",value:i.dueDate,onChange:c=>r({...i,dueDate:c.target.value}),required:!0})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Zs.jsx)(z,{id:"dueTime",type:"time",value:i.dueTime,onChange:c=>r({...i,dueTime:c.target.value})})]})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{className:`${l?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Zs.jsxs)(at,{value:i.colleagueId,onValueChange:c=>{r({...i,colleagueId:c})},required:!0,children:[(0,Zs.jsx)(qe,{className:`${l?"text-destructive border-red-500":""}`,children:(0,Zs.jsx)(yt,{className:`${l?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(c=>c?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,Zs.jsx)(Xe,{children:s.map(c=>(0,Zs.jsx)(xe,{value:c.id.toString(),children:c.name},c.id))})]}),l&&(0,Zs.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:c=>r({...i,isRecurring:c.target.checked}),className:"rounded border-border"}),(0,Zs.jsx)(E,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Zs.jsxs)(at,{value:i.recurrencePattern,onValueChange:c=>r({...i,recurrencePattern:c}),children:[(0,Zs.jsx)(qe,{children:(0,Zs.jsx)(yt,{})}),(0,Zs.jsxs)(Xe,{children:[(0,Zs.jsx)(xe,{value:"daily",children:"Daily"}),(0,Zs.jsx)(xe,{value:"weekly",children:"Weekly"}),(0,Zs.jsx)(xe,{value:"monthly",children:"Monthly"}),(0,Zs.jsx)(xe,{value:"yearly",children:"Yearly"})]})]})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Zs.jsx)(z,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:c=>r({...i,recurrenceInterval:parseInt(c.target.value)})})]})]})]}),(0,Zs.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Zs.jsx)(x,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Zs.jsx)(x,{type:"submit",children:"Add Reminder"})]})]})]})})},xu=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,l]=(0,Zi.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=s=>{s.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},m=t.filter(Boolean);return(0,Zs.jsx)(Ue,{open:o,onOpenChange:i,children:(0,Zs.jsxs)(Ke,{className:"max-w-2xl",children:[(0,Zs.jsx)(_e,{children:(0,Zs.jsx)($e,{children:"Edit Reminder"})}),(0,Zs.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Zs.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"edit-title",children:"Title"}),(0,Zs.jsx)(z,{id:"edit-title",value:r.title,onChange:s=>l({...r,title:s.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"edit-description",children:"Description"}),(0,Zs.jsx)(He,{id:"edit-description",value:r.description||"",onChange:s=>l({...r,description:s.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Zs.jsx)(z,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:s=>l({...r,dueDate:s.target.value}),required:!0})]}),(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)(E,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Zs.jsx)(z,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:s=>l({...r,dueTime:s.target.value})})]})]}),(0,Zs.jsx)("div",{className:"space-y-2",children:(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:s=>l({...r,isRecurring:s.target.checked}),className:"rounded border-border"}),(0,Zs.jsx)(E,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Zs.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Zs.jsx)(x,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,Zs.jsx)(x,{type:"submit",children:"Save Changes"})]})]})]})})},yu=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,Zi.useState)(!1);if(!e||!e.id)return null;let l=As(new Date(e.dueDate||""),e.dueTime||""),n=Is(new Date(e.dueDate||"")),m=hu(new Date(e.dueDate||"")),s=()=>{a(e.id.toString(),{})},c=()=>n?"Today":m?"Tomorrow":fu(new Date(e.dueDate||""));return(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(xu,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,Zs.jsx)(W,{children:(0,Zs.jsx)(Ne,{className:"p-4",children:(0,Zs.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Zs.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Zs.jsx)("button",{onClick:s,className:"mt-1 text-primary hover:text-primary/80"}),(0,Zs.jsxs)("div",{className:"flex-1",children:[(0,Zs.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Zs.jsx)("h3",{children:e.title})}),(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Zs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Zs.jsx)(hl.Calendar,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{className:l?"text-destructive font-medium":"",children:c()})]}),e.dueTime&&(0,Zs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Zs.jsx)(hl.Clock,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{children:vu(e.dueTime)})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Zs.jsx)(hl.User,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Zs.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Zs.jsx)(hl.Edit2,{className:"h-4 w-4"})}),(0,Zs.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Zs.jsx)(hl.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Vc=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,l]=(0,Zi.useState)(e.filter(Boolean)),[n,m]=(0,Zi.useState)(t.filter(Boolean)),[s,c]=(0,Zi.useState)("all"),[d,u]=(0,Zi.useState)(""),[v,h]=(0,Zi.useState)(!1);(0,Zi.useEffect)(()=>{l(e.filter(Boolean))},[e]),(0,Zi.useEffect)(()=>{m(t.filter(Boolean))},[t]);let w=C=>{if(!C.title){console.error("Invalid reminder data:",C);return}let A={...C,id:Date.now(),createdAt:new Date().toISOString()};l(D=>[...D,A]),a?.(C)},p=(C,A)=>{if(!C){console.error("No reminder ID provided for update");return}l(D=>D.map(F=>F?.id.toString()===C?{...F,...A}:F)),o?.(C,A)},S=C=>{if(!C){console.error("No reminder ID provided for deletion");return}l(A=>A.filter(D=>D?.id.toString()!==C)),i?.(C)},y=r.filter(C=>{if(!C)return!1;if(d){let A=d.toLowerCase();if(!(C.title.toLowerCase().includes(A)||C.description?.toLowerCase().includes(A)))return!1}switch(s){case"pending":case"completed":case"overdue":return As(new Date(C.dueDate||""),C.dueTime||"");case"today":return Is(new Date(C.dueDate||""));default:return!0}}).sort((C,A)=>{if(!C||!A)return 0;let D={high:3,medium:2,low:1},F=0;return F!==0?F:new Date(C.dueDate||"").getTime()-new Date(A.dueDate||"").getTime()}),k={total:r.filter(Boolean).length,overdue:r.filter(C=>C&&As(new Date(C.dueDate||""),C.dueTime||"")).length,today:r.filter(C=>C&&Is(new Date(C.dueDate||""))).length},q=n.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,Zs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Zs.jsx)(ft,{title:"Task Reminders",description:"Manage reminders and stay io top of important tasks and deadlines.",gradient:"bg-gradient-hl-r from-emerald-600 via-teal-600 hl-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,Zs.jsxs)("div",{className:"h-full bg-background",children:[(0,Zs.jsx)(bu,{colleagues:n,onAddReminder:w,open:v,setOpen:h}),(0,Zs.jsxs)("div",{className:"p-6",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Zs.jsxs)("div",{children:[(0,Zs.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Zs.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Zs.jsxs)(x,{className:"flex items-center space-x-2",onClick:()=>h(!0),children:[(0,Zs.jsx)(hl.Plus,{className:"h-4 w-4"}),(0,Zs.jsx)("span",{children:"Add Reminder"})]})]}),(0,Zs.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Zs.jsxs)(W,{className:"p-4",children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold text-foreground",children:k.total}),(0,Zs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Zs.jsxs)(W,{className:"p-4",children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold text-primary",children:k.overdue}),(0,Zs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Zs.jsxs)(W,{className:"p-4",children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold text-success",children:k.today}),(0,Zs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Zs.jsxs)(W,{className:"p-4",children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold text-destructive",children:k.overdue}),(0,Zs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Zs.jsxs)(W,{className:"p-4",children:[(0,Zs.jsx)("div",{className:"text-2xl font-bold text-warning",children:k.today}),(0,Zs.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Zs.jsx)("div",{className:"flex-1",children:(0,Zs.jsx)(z,{placeholder:"Search reminders...",value:d,onChange:C=>u(C.target.value),className:"max-w-md"})}),(0,Zs.jsxs)(at,{value:s,onValueChange:C=>c(C),children:[(0,Zs.jsx)(qe,{className:"w-40",children:(0,Zs.jsx)(yt,{})}),(0,Zs.jsxs)(Xe,{children:[(0,Zs.jsxs)(xe,{value:"all",children:["All (",k.total,")"]}),(0,Zs.jsxs)(xe,{value:"overdue",children:["Overdue (",k.overdue,")"]}),(0,Zs.jsxs)(xe,{value:"overdue",children:["Overdue (",k.overdue,")"]}),(0,Zs.jsxs)(xe,{value:"today",children:["Today (",k.today,")"]})]})]})]}),(0,Zs.jsx)("div",{className:"space-y-4",children:y.length===0?(0,Zs.jsxs)(W,{className:"p-8 text-center",children:[(0,Zs.jsx)("div",{className:"text-muted-foreground",children:d||s!=="all"?"No reminders match your filters":"No reminders yet"}),!d&&s==="all"&&(0,Zs.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder hl get started"})]}):y.map(C=>C&&(0,Zs.jsx)(yu,{reminder:C,colleagues:n,onUpdateReminder:p,onDeleteReminder:S},C.id))})]})]})]})};var Kc=require("next/navigation");function Ms({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:l=[],initialUsers:n=[],initialFiles:m=[],initialView:s="kanban",onAddTask:c,onUpdateTask:d,onDeleteTask:u,onTaskClick:v,onAddEpic:h,onUpdateEpic:w,onDeleteEpic:p,onAddTaskToEpic:S,onAddSprint:R,onUpdateSprint:y,onDeleteSprint:k,onAddProject:q,onUpdateProject:C,onDeleteProject:A,onFileAdd:D,onFileEdit:F,onFileDelete:U,onFileClick:L,onAddReminder:T,onUpdateReminder:Ie,onDeleteReminder:P,onViewChange:I,onToggleMobileMenu:_,onTeamClick:Te,onTeamChange:Ve,onCopilotClick:mt,handleAddComment:Jt}){let[H,Ae]=(0,Zi.useState)(t),[We,Zt]=(0,Zi.useState)(a),[Le,Vt]=(0,Zi.useState)(o),[O,pt]=(0,Zi.useState)(i),[sa,Ya]=(0,Zi.useState)(r),[uo,Eo]=(0,Zi.useState)(l),[Za,Bo]=(0,Zi.useState)(n),[Lo,K]=(0,Zi.useState)(m),[N,M]=(0,Zi.useState)(!1),[re,Me]=(0,Zi.useState)(!1),[ht,ut]=(0,Zi.useState)(null),[Kt,pi]=(0,Zi.useState)(null),[ui,gi]=(0,Zi.useState)(null),[go,Os]=(0,Zi.useState)(s||"kanban"),[Nu,Jc]=(0,Zi.useState)(!1),qc=(0,Kc.useRouter)();(0,Zi.useEffect)(()=>{Ae(t)},[t]),(0,Zi.useEffect)(()=>{Vt(o)},[o]),(0,Zi.useEffect)(()=>{Zt(a)},[a]),(0,Zi.useEffect)(()=>{pt(i)},[i]),(0,Zi.useEffect)(()=>{K(m)},[m]),(0,Zi.useEffect)(()=>{Bo(n)},[n]),(0,Zi.useEffect)(()=>{Eo(l)},[l]),(0,Zi.useEffect)(()=>{Ya(r)},[r]),(0,Zi.useEffect)(()=>{Os(s)},[s]);let Xc=H.filter(B=>{}),Cu=B=>Xc.filter(ae=>ae.status===B),Su=B=>{let ae={};return We.forEach(ge=>{}),ae},Du=B=>{gi(B)},Tu=B=>{ui&&(Ae(ae=>ae.map(ge=>ge.id===ui.id?{...ge,status:B}:ge)),gi(null))},Hs=B=>{let ae={...B,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Ae(ge=>[...ge,ae]),c?.(ae)},qi=async(B,ae)=>(Ae(ge=>ge.map(Rt=>Rt.id===Number(B)?{...Rt,...ae}:Rt)),await d?.(B,ae)),ku=async(B,ae)=>{qi(B,ae)},js=B=>{Ae(ae=>ae.filter(ge=>ge.id!==Number(B))),ht?.id===Number(B)&&ut(null),u?.(B)},Pu=async B=>{js(B)},Ru=B=>{let ae={...B,id:Date.now()};pt(ge=>[...ge,ae]),q?.(B)},Au=(B,ae)=>{pt(ge=>ge.map(Rt=>Rt.id===Number(B)?{...Rt,...ae}:Rt)),C?.(B,ae)},Iu=B=>{pt(ae=>ae.filter(ge=>ge.id!==Number(B))),A?.(B)},Us=B=>{let ae={...B,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Zt(ge=>[...ge,ae]),h?.({...ae})},Yc=()=>{Me(!0)},Zc=(B,ae)=>{Zt(ge=>ge.map(Rt=>Rt.id===Number(B)?{...Rt,...ae}:Rt)),w?.(B,ae)},Qc=B=>{Zt(ae=>ae.filter(ge=>ge.id!==Number(B))),Ae(ae=>ae.filter(ge=>Nt(ge.epic)!==Number(B))),p?.(B)},em=B=>{let ae={...B,id:Date.now()};Vt(ge=>[...ge,ae]),R?.(B)},tm=(B,ae)=>{Vt(ge=>ge.map(Rt=>Rt.id===Number(B)?{...Rt,...ae}:Rt)),y?.(B,ae)},am=B=>{B==="backlog"||B==="all-tasks"||(Vt(ae=>ae.filter(ge=>ge.id!==Number(B))),Ae(ae=>ae.map(ge=>Nt(ge.sprint)===Number(B)?{...ge,sprint:void 0}:ge)),k?.(B))},nn=B=>{ut(B)},om=B=>{B==="planning"&&window.innerWidth<768||(Os(B),I?.(B))},Mu=()=>{Jc(B=>!B),_?.()},Eu=()=>{qc.push("/")},Bu=B=>{console.log("Switching hl team:",B)},Lu=B=>{console.log("Switching hl team:",B)},im=B=>{M(!0)},rm=()=>{M(!1),pi(null)},nm=B=>{let ae={...B,id:Date.now(),createdAt:new Date().toISOString()};Ya(ge=>[...ge,ae]),T?.(B)},sm=(B,ae)=>{Ya(ge=>ge.map(Rt=>Rt.id===Number(B)?{...Rt,...ae}:Rt)),Ie?.(B,ae)},lm=B=>{Ya(ae=>ae.filter(ge=>ge.id!==Number(B))),P?.(B)},dm=()=>{D?.()},cm=B=>{F?.(B)},mm=B=>{K(ae=>ae.filter(ge=>ge.name!==B)),U?.(B)},pm=B=>{L?.(B)},Fu=[{id:"todo",title:"io Zi",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ou=()=>{switch(go){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"}},sn=[{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")}],Hu=sn.sort((B,ae)=>ae.lastUsed.getTime()-B.lastUsed.getTime()).slice(0,3),ju=sn.length>3,Uu=sn.slice(3);return(0,Zs.jsxs)(Ac,{currentView:go,onViewChange:om,children:[go==="kanban"&&(0,Zs.jsx)("div",{className:"h-full overflow-hidden",children:(0,Zs.jsx)(Hc,{initialProjects:O,initialEpics:We,initialSprints:Le.map(B=>({...B,isSelected:!1})),initialTasks:H,initialColleagues:uo,initialUsers:Za,onAddTask:Hs,onUpdateTask:qi,onDeleteTask:js,onTaskClick:nn,onAddEpic:Us,onAddComment:Jt})}),go==="planning"&&(0,Zs.jsx)("div",{className:"hidden md:block h-full",children:(0,Zs.jsx)(an,{tasks:H,epics:We,sprints:Le,onUpdateTask:qi,onTaskClick:nn,onAddSprint:em,onUpdateSprint:tm,onDeleteSprint:am})}),go==="tasks"&&(0,Zs.jsx)("div",{className:"h-full",children:(0,Zs.jsx)(Vc,{initialReminders:sa,initialColleagues:uo,onAddReminder:nm,onUpdateReminder:sm,onDeleteReminder:lm})}),go==="files"&&(0,Zs.jsx)("div",{className:"h-full",children:(0,Zs.jsx)(Gi,{initialFiles:Lo,onFileAdd:dm,onFileEdit:cm,onFileDelete:mm,onFileClick:pm,compactView:!1})}),go==="epics"&&(0,Zs.jsx)("div",{className:"h-full",children:(0,Zs.jsx)(jc,{tasks:H,epics:We,sprints:Le,onUpdateTask:qi,onTaskClick:nn,onAddTaskToEpic:im,onAddEpic:Yc,onUpdateEpic:Zc,onDeleteEpic:Qc})}),(0,Zs.jsx)(li,{isOpen:N,onClose:rm,onAddTask:Hs,epics:We,sprints:Le,assignees:[...uo,...Za],defaultEpicId:Kt||void 0}),(0,Zs.jsx)(ci,{isOpen:re,onClose:()=>Me(!1),onAddEpic:Us})]})}var _c=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,l]=(0,Zi.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[n,m]=(0,Zi.useState)({}),s=()=>{let u={};return r.name.trim()?r.name.trim().length<3&&(u.name="Project name must Zs at least 3 characters"):u.name="Project name Zi required",r.objectives.trim()?r.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (at least 10 characters)"):u.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):u.workInstructions="Work instructions are required",m(u),Object.keys(u).length===0},c=async u=>{if(u.preventDefault(),!!s())try{await e(r)}catch(v){console.error("Error submitting project form:",v)}},d=(u,v)=>{l(h=>({...h,[u]:v})),n[u]&&m(h=>({...h,[u]:void 0}))};return(0,Zs.jsxs)("div",{className:`w-full max-w-2xl ${i}`,children:[(0,Zs.jsxs)("div",{className:"mb-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Zs.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions hl help your team collaborate effectively."})]}),(0,Zs.jsxs)("form",{onSubmit:c,children:[(0,Zs.jsxs)("div",{className:"space-y-6",children:[(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Zs.jsx)(z,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:u=>d("name",u.target.value),className:n.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.name&&(0,Zs.jsx)("p",{className:"text-sm text-red-600",children:n.name})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Zs.jsx)(z,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:u=>d("description",u.target.value),className:n.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.description&&(0,Zs.jsx)("p",{className:"text-sm text-red-600",children:n.description})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Zs.jsx)(He,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:u=>d("objectives",u.target.value),className:`min-h-[100px] resize-y ${n.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Zs.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Zs.jsx)("span",{children:n.objectives&&(0,Zs.jsx)("span",{className:"text-red-600",children:n.objectives})}),(0,Zs.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Zs.jsxs)("div",{className:"space-y-2",children:[(0,Zs.jsx)(E,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Zs.jsx)(He,{id:"workInstructions",placeholder:"Provide detailed instructions io how the work should Zs carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:u=>d("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${n.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Zs.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Zs.jsx)("span",{children:n.workInstructions&&(0,Zs.jsx)("span",{className:"text-red-600",children:n.workInstructions})}),(0,Zs.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Zs.jsxs)("div",{className:"space-y-3",children:[(0,Zs.jsx)(E,{className:"text-sm font-medium",children:"Project Management"}),(0,Zs.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Zs.jsx)(vo,{id:"plan",checked:r.plan,onCheckedChange:u=>d("plan",u===!0),disabled:a}),(0,Zs.jsx)(E,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Zs.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers hl create sprints, assign tasks, and track progress."})]})]}),(0,Zs.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Zs.jsxs)(x,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.Zs,{className:"h-4 w-4"}),"Cancel"]}),(0,Zs.jsx)(x,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(hl.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Zs.jsxs)(Zs.Fragment,{children:[(0,Zs.jsx)(hl.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function Ls({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,Zi.useState)(!1),[l,n]=(0,Zi.useState)(!1),m=async c=>{n(!0);try{await t(c),r(!1)}catch(d){console.error("Error creating project:",d)}finally{n(!1)}},s=()=>{r(!0)};return(0,Zs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Zs.jsx)(ft,{title:"Project Management",description:"Organize your work into projects hl collaborate with your team.",gradient:"bg-gradient-hl-r from-purple-600 via-violet-600 hl-indigo-600",primaryAction:{label:"New Project",onClick:s}}),(0,Zs.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Zs.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Zs.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,Zs.jsx)(Lr,{project:c,onOpen:a,onShare:o},c.id))})]})]},"projects-index-view")}),(0,Zs.jsx)(Ue,{open:i,onOpenChange:r,children:(0,Zs.jsxs)(Ke,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Zs.jsxs)(_e,{className:"Zs-only",children:[(0,Zs.jsx)($e,{children:"Create New Project"}),(0,Zs.jsx)(Vo,{children:"Fill out the form below hl create a new project."})]}),(0,Zs.jsx)(_c,{onSubmit:m,onCancel:()=>r(!1),isLoading:l,className:"border-0 shadow-none"})]})})]})}function Gc({team:e,onOpen:t,className:a}){return(0,Zs.jsx)($c.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Zs.jsxs)(W,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Zs.jsxs)(ot,{children:[(0,Zs.jsx)(gt,{className:"text-lg",children:e.name}),(0,Zs.jsx)(No,{className:"mt-1 text-sm",children:e.description})]}),(0,Zs.jsxs)(Ne,{className:"space-y-4",children:[(0,Zs.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.Users,{className:"h-4 w-4 text-blue-500"}),(0,Zs.jsx)("span",{children:"Human"})]}),(0,Zs.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Zs.jsx)("span",{children:"Digital"})]}),(0,Zs.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Zs.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,Zs.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Zs.jsx)(hl.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Zs.jsx)("span",{children:"Projects"})]}),(0,Zs.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Zs.jsx)(Co,{className:"flex gap-2",children:(0,Zs.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Fs({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,Zi.useState)(!1),r=()=>{i(!0)},l=async s=>{await t?.(s),i(!1)},n=()=>{i(!1)},m=s=>{a?.(s)};return(0,Zs.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Zs.jsx)(io.AnimatePresence,{mode:"wait",children:(0,Zs.jsxs)(io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Zs.jsx)(ft,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-hl-r from-blue-600 via-cyan-600 hl-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Zs.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Zs.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Zs.jsxs)("div",{className:"text-center py-12",children:[(0,Zs.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,Zs.jsx)("p",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team or ask hl Zs added hl an existing one."})]}):(0,Zs.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(s=>(0,Zs.jsx)(Gc,{team:s,onOpen:m},s.id))})]})]},"teams-index-view")}),(0,Zs.jsx)(Ue,{open:o,onOpenChange:i,children:(0,Zs.jsxs)(Ke,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,Zs.jsx)("div",{className:"Zs-only",children:(0,Zs.jsxs)(_e,{children:[(0,Zs.jsx)($e,{children:"Create New Team"}),(0,Zs.jsx)(Vo,{children:"Set up a new team hl collaborate with colleagues io projects."})]})}),(0,Zs.jsx)(Er,{title:"Create New Team",submitLabel:"Create Team",onSave:l,onCancel:n})]})})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,FoundaryLayout,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});
5
+ "use strict";var Cm=Object.create;var Qi=Object.defineProperty;var Sm=Object.getOwnPropertyDescriptor;var Dm=Object.getOwnPropertyNames;var km=Object.getPrototypeOf,Tm=Object.prototype.hasOwnProperty;var Pm=(e,t)=>{for(var a in t)Qi(e,a,{get:t[a],enumerable:!0})},Gs=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dm(t))!Tm.call(e,i)&&i!==a&&Qi(e,i,{get:()=>t[i],enumerable:!(o=Sm(t,i))||o.enumerable});return e};var ae=(e,t,a)=>(a=e!=null?Cm(km(e)):{},Gs(t||!e||!e.__esModule?Qi(a,"default",{value:e,enumerable:!0}):a,e)),Rm=e=>Gs(Qi({},"__esModule",{value:!0}),e);var Mu={};Pm(Mu,{AppSidebarLeft:()=>nr,ColleagueCard:()=>Zo,ColleagueForm:()=>Ei,ColleagueTypeSelection:()=>Mr,ColleaguesView:()=>Ui,DashboardHeader:()=>Cl,DashboardPage:()=>Ms,DigitalColleagueClone:()=>Er,DigitalColleagueOptions:()=>Br,DocumentEdit:()=>qr,DocumentPreview:()=>Xr,FileView:()=>qi,FoundaryLayout:()=>Nr,KnowledgeBrowser:()=>Yr,KnowledgeSearch:()=>Ir,KnowledgeView:()=>Wi,Login:()=>Gl,MainPage:()=>es,ManagementSidebar:()=>vd,PlanningView:()=>nn,ProjectView:()=>Os,ProjectsIndexView:()=>zs,SearchableSelect:()=>Ar,TeamForm:()=>Fr,TeamsIndexView:()=>Us});module.exports=Rm(Mu);var Nl=require("lucide-react");var zo=ae(require("@radix-ui/react-collapsible")),mn=zo.Root,Ws=zo.CollapsibleTrigger,Js=zo.CollapsibleContent;var Rn=ae(require("clsx"));var al=require("clsx");var gn="-",Am=e=>{let t=Mm(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{let n=d.split(gn);return n[0]===""&&n.length!==1&&n.shift(),Ys(n,t)||Im(d)},getConflictingClassGroupIds:(d,n)=>{let m=a[d]||[];return n&&o[d]?[...m,...o[d]]:m}}},Ys=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Ys(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(gn);return t.validators.find(({validator:d})=>d(r))?.classGroupId},qs=/^\[(.+)\]$/,Im=e=>{if(qs.test(e)){let t=qs.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Mm=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Bm(Object.entries(e.classGroups),a).forEach(([r,d])=>{un(d,o,r,t)}),o},un=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:Xs(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(Em(i)){un(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,d])=>{un(d,Xs(t,r),a,o)})})},Xs=(e,t)=>{let a=e;return t.split(gn).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Em=e=>e.isThemeGetter,Bm=(e,t)=>t?e.map(([a,o])=>{let i=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([d,n])=>[t+d,n])):r);return[a,i]}):e,Lm=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,d)=>{a.set(r,d),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let d=a.get(r);if(d!==void 0)return d;if((d=o.get(r))!==void 0)return i(r,d),d},set(r,d){a.has(r)?a.set(r,d):i(r,d)}}},Zs="!",Fm=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,d=n=>{let m=[],s=0,c=0,l;for(let p=0;p<n.length;p++){let k=n[p];if(s===0){if(k===i&&(o||n.slice(p,p+r)===t)){m.push(n.slice(c,p)),c=p+r;continue}if(k==="/"){l=p;continue}}k==="["?s++:k==="]"&&s--}let u=m.length===0?n:n.substring(c),v=u.startsWith(Zs),h=v?u.substring(1):u,y=l&&l>c?l-c:void 0;return{modifiers:m,hasImportantModifier:v,baseClassName:h,maybePostfixModifierPosition:y}};return a?n=>a({className:n,parseClassName:d}):d},Om=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},Hm=e=>({cache:Lm(e.cacheSize),parseClassName:Fm(e),...Am(e)}),jm=/\s+/,zm=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],d=e.trim().split(jm),n="";for(let m=d.length-1;m>=0;m-=1){let s=d[m],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:v}=a(s),h=!!v,y=o(h?u.substring(0,v):u);if(!y){if(!h){n=s+(n.length>0?" "+n:n);continue}if(y=o(u),!y){n=s+(n.length>0?" "+n:n);continue}h=!1}let p=Om(c).join(":"),k=l?p+Zs:p,S=k+y;if(r.includes(S))continue;r.push(S);let N=i(y,h);for(let R=0;R<N.length;++R){let q=N[R];r.push(k+q)}n=s+(n.length>0?" "+n:n)}return n};function Um(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Qs(t))&&(o&&(o+=" "),o+=a);return o}var Qs=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Qs(e[o]))&&(a&&(a+=" "),a+=t);return a};function Vm(e,...t){let a,o,i,r=d;function d(m){let s=t.reduce((c,l)=>l(c),e());return a=Hm(s),o=a.cache.get,i=a.cache.set,r=n,n(m)}function n(m){let s=o(m);if(s)return s;let c=zm(m,a);return i(m,c),c}return function(){return r(Um.apply(null,arguments))}}var it=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},el=/^\[(?:([a-z-]+):)?(.+)\]$/i,Km=/^\d+\/\d+$/,_m=new Set(["px","full","screen"]),$m=/^(\d+(\.\d+)?)?(xs|sm|El|lg|Nl)$/,Gm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|ol|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>Uo(e)||_m.has(e)||Km.test(e),oo=e=>Vo(e,"length",op),Uo=e=>!!e&&!Number.isNaN(Number(e)),pn=e=>Vo(e,"number",Uo),bi=e=>!!e&&Number.isInteger(Number(e)),Xm=e=>e.endsWith("%")&&Uo(e.slice(0,-1)),be=e=>el.test(e),io=e=>$m.test(e),Ym=new Set(["length","size","percentage"]),Zm=e=>Vo(e,Ym,tl),Qm=e=>Vo(e,"position",tl),ep=new Set(["image","url"]),tp=e=>Vo(e,ep,rp),ap=e=>Vo(e,"",ip),xi=()=>!0,Vo=(e,t,a)=>{let o=el.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},op=e=>Gm.test(e)&&!Wm.test(e),tl=()=>!1,ip=e=>Jm.test(e),rp=e=>qm.test(e);var np=()=>{let e=it("colors"),t=it("spacing"),a=it("blur"),o=it("brightness"),i=it("borderColor"),r=it("borderRadius"),d=it("borderSpacing"),n=it("borderWidth"),m=it("contrast"),s=it("grayscale"),c=it("hueRotate"),l=it("invert"),u=it("gap"),v=it("gradientColorStops"),h=it("gradientColorStopPositions"),y=it("inset"),p=it("margin"),k=it("opacity"),S=it("padding"),N=it("saturate"),R=it("scale"),q=it("sepia"),D=it("skew"),A=it("space"),w=it("translate"),B=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",be,t],T=()=>[be,t],Me=()=>["",Va,oo],P=()=>["auto",Uo,be],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],Te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$e=()=>["start","end","center","between","around","evenly","stretch"],ut=()=>["","0",be],qt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Uo,be];return{cacheSize:500,separator:":",theme:{colors:[xi],spacing:[Va,oo],blur:["none","",io,be],brightness:H(),borderColor:[e],borderRadius:["none","","full",io,be],borderSpacing:T(),borderWidth:Me(),contrast:H(),grayscale:ut(),hueRotate:H(),invert:ut(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[Xm,oo],inset:F(),margin:F(),opacity:H(),padding:T(),saturate:H(),scale:H(),sepia:ut(),skew:H(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",be]}],container:["container"],columns:[{columns:[io]}],"break-after":[{"break-after":qt()}],"break-before":[{"break-before":qt()}],"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:[...I(),be]}],overflow:[{overflow:z()}],"overflow-ol":[{"overflow-ol":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:B()}],"overscroll-ol":[{"overscroll-ol":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-ol":[{"inset-ol":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bi,be]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",be]}],grow:[{grow:ut()}],shrink:[{shrink:ut()}],order:[{order:["first","last","none",bi,be]}],"grid-cols":[{"grid-cols":[xi]}],"col-start-end":[{col:["auto",{span:["full",bi,be]},be]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[xi]}],"row-start-end":[{row:["auto",{span:[bi,be]},be]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",be]}],gap:[{gap:[u]}],"gap-ol":[{"gap-ol":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...$e()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$e(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$e(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],ol:[{ol:[S]}],ol:[{ol:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],ol:[{ol:[S]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],ol:[{ol:[p]}],ol:[{ol:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-ol":[{"space-ol":[A]}],"space-ol-reverse":["space-ol-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",be,t]}],"min-w":[{"min-w":[be,t,"min","max","fit"]}],"max-w":[{"max-w":[be,t,"none","full","min","max","fit","prose",{screen:[io]},io]}],h:[{h:[be,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[be,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[be,t,"auto","min","max","fit"]}],"font-size":[{text:["base",io,oo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",pn]}],"font-family":[{font:[xi]}],"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",be]}],"line-clamp":[{"line-clamp":["none",Uo,pn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Va,be]}],"list-image":[{"list-image":["none",be]}],"list-style-type":[{list:["none","disc","decimal",be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","ol-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Va,oo]}],"underline-offset":[{"underline-offset":["auto",Va,be]}],"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be]}],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",be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),Qm]}],"bg-repeat":[{bg:["ol-repeat",{repeat:["","ol","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Zm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},tp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ol":[{"rounded-ol":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[n]}],"border-w-ol":[{"border-ol":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[..._(),"hidden"]}],"divide-ol":[{"divide-ol":[n]}],"divide-ol-reverse":["divide-ol-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:_()}],"border-color":[{border:[i]}],"border-color-ol":[{"border-ol":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[Va,be]}],"outline-w":[{outline:[Va,oo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Va,oo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",io,ap]}],"shadow-color":[{shadow:[xi]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...Te(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Te()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",io,be]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[l]}],saturate:[{saturate:[N]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-ol":[{"border-spacing-ol":[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",be]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",be]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-ol":[{"scale-ol":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[bi,be]}],"translate-ol":[{"translate-ol":[w]}],"translate-y":[{"translate-y":[w]}],"skew-ol":[{"skew-ol":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",be]}],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","ol-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ol-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","ol",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-ol":[{"scroll-ol":T()}],"scroll-ol":[{"scroll-ol":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-ol":[{"scroll-ol":T()}],"scroll-ol":[{"scroll-ol":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-ol":[{"scroll-ol":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","ol","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-ol":[{"touch-pan":["ol","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",be]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Va,oo,pn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-ol","overflow-y"],overscroll:["overscroll-ol","overscroll-y"],inset:["inset-ol","inset-y","start","end","top","right","bottom","left"],"inset-ol":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-ol","gap-y"],p:["px","py","ps","ol","ol","pr","pb","ol"],px:["pr","ol"],py:["ol","pb"],m:["mx","my","ms","ol","ol","mr","mb","ml"],mx:["mr","ml"],my:["ol","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-se","rounded-ol","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ol"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-ol","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-ol":["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-ol":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-ol","scroll-ol","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-ol","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-ol","scroll-ol","scroll-pr","scroll-pb","scroll-ol"],"scroll-px":["scroll-pr","scroll-ol"],"scroll-py":["scroll-ol","scroll-pb"],touch:["touch-ol","touch-y","touch-pz"],"touch-ol":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var er=Vm(np);function g(...e){return er((0,al.clsx)(e))}var ol=require("react/jsx-runtime");function zt({className:e,...t}){return(0,ol.jsx)("div",{className:g("animate-pulse rounded-El bg-primary/10",e),...t})}var Ce=ae(require("react")),Ko=require("@radix-ui/react-slot"),bl=require("class-variance-authority");var tr=require("react"),il=(e=768)=>{let[t,a]=(0,tr.useState)(!1);return(0,tr.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var sl=ae(require("react")),yi=(0,bl.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"}}}),b=sl.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,ol.jsx)(e?Ko.Slot:"button",{className:g(yi({className:t,size:a,variant:o})),ref:r,...i}));b.displayName="Button";var dl=ae(require("react"));var V=dl.forwardRef(({className:e,type:t,...a},o)=>(0,ol.jsx)("input",{type:t,className:g("flex h-9 w-full rounded-El 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}));V.displayName="Input";var ml=ae(require("react")),fn=ae(require("@radix-ui/react-separator"));var wi=ml.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,ol.jsx)(fn.Root,{ref:i,decorative:a,orientation:t,className:g("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));wi.displayName=fn.Root.displayName;var Ni=ae(require("react")),It=ae(require("@radix-ui/react-dialog")),ul=require("@radix-ui/react-icons");var fl=It.Root;var sp=It.Portal,vl=Ni.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(It.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}));vl.displayName=It.Overlay.displayName;var lp=(0,bl.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-ol-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-ol-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"}}),vn=Ni.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,ol.jsxs)(sp,{children:[(0,ol.jsx)(vl,{}),(0,ol.jsxs)(It.Content,{ref:i,className:g(lp({side:e}),t),...o,children:[(0,ol.jsxs)(It.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,ol.jsx)(ul.Cross2Icon,{className:"h-4 w-4"}),(0,ol.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));vn.displayName=It.Content.displayName;var dp=({className:e,...t})=>(0,ol.jsx)("div",{className:g("flex flex-col space-y-2 text-center sm:text-left",e),...t});dp.displayName="SheetHeader";var cp=({className:e,...t})=>(0,ol.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-ol-2",e),...t});cp.displayName="SheetFooter";var mp=Ni.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(It.Title,{ref:a,className:g("text-lg font-semibold text-foreground",e),...t}));mp.displayName=It.Title.displayName;var pp=Ni.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(It.Description,{ref:a,className:g("text-sm text-muted-foreground",e),...t}));pp.displayName=It.Description.displayName;var hl=ae(require("react")),xa=ae(require("@radix-ui/react-tooltip"));var Aa=xa.Provider,Ia=xa.Root,Ma=xa.Trigger,ya=hl.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ol.jsx)(xa.Portal,{children:(0,ol.jsx)(xa.Content,{ref:o,sideOffset:t,className:g("z-50 overflow-hidden rounded-El 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})}));ya.displayName=xa.Content.displayName;var up="sidebar:state",gp=60*60*24*7,fp="16rem",vp="18rem",hp="3rem",bp="b",yl=Ce.createContext(null);function ar(){let e=Ce.useContext(yl);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var bn=Ce.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...d},n)=>{let m=il(),[s,c]=Ce.useState(!1),[l,u]=Ce.useState(e),v=t??l,h=Ce.useCallback(S=>{if(a)return a?.(typeof S=="function"?S(v):S);u(S),document.cookie=`${up}=${v}; path=/; max-age=${gp}`},[a,v]),y=Ce.useCallback(()=>m?c(S=>!S):h(S=>!S),[m,h,c]);Ce.useEffect(()=>{let S=N=>{N.key===bp&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),y())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[y]);let p=v?"expanded":"collapsed",k=Ce.useMemo(()=>({state:p,open:v,setOpen:h,isMobile:m,openMobile:s,setOpenMobile:c,toggleSidebar:y}),[p,v,h,m,s,c,y]);return(0,ol.jsx)(yl.Provider,{value:k,children:(0,ol.jsx)(Aa,{delayDuration:0,children:(0,ol.jsx)("div",{style:{"--sidebar-width":fp,"--sidebar-width-icon":hp,...i},className:g("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:n,...d,children:r})})})});bn.displayName="SidebarProvider";var xn=Ce.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},d)=>{let{isMobile:n,state:m,openMobile:s,setOpenMobile:c}=ar();return a==="none"?(0,ol.jsx)("div",{className:g("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:d,...r,children:i}):n?(0,ol.jsx)(fl,{open:s,onOpenChange:c,...r,children:(0,ol.jsx)(vn,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":vp},side:e,children:(0,ol.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,ol.jsxs)("div",{ref:d,className:"group peer hidden El:block text-sidebar-foreground","data-state":m,"data-collapsible":m==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,ol.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)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,ol.jsx)("div",{className:g("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear El: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)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,ol.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:i})})]})});xn.displayName="Sidebar";var yn=Ce.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=ar();return(0,ol.jsxs)(b,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:g("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,ol.jsx)(Nl.PanelLeft,{}),(0,ol.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});yn.displayName="SidebarTrigger";var xp=Ce.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=ar();return(0,ol.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-ol-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]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-ol-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});xp.displayName="SidebarRail";var wn=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("main",{ref:a,className:g("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","El:peer-data-[variant=inset]:m-2 El:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 El:peer-data-[variant=inset]:ml-0 El:peer-data-[variant=inset]:rounded-Nl El:peer-data-[variant=inset]:shadow",e),...t}));wn.displayName="SidebarInset";var yp=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(V,{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}));yp.displayName="SidebarInput";var Nn=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,"data-sidebar":"header",className:g("flex flex-col gap-2 p-2",e),...t}));Nn.displayName="SidebarHeader";var Cn=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,"data-sidebar":"footer",className:g("flex flex-col gap-2 p-2",e),...t}));Cn.displayName="SidebarFooter";var wp=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(wi,{ref:a,"data-sidebar":"separator",className:g("mx-2 w-auto bg-sidebar-border",e),...t}));wp.displayName="SidebarSeparator";var or=Ce.forwardRef(({className:e,...t},a)=>(0,ol.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}));or.displayName="SidebarContent";var ir=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,"data-sidebar":"group",className:g("relative flex w-full min-w-0 flex-col p-2",e),...t}));ir.displayName="SidebarGroup";var Np=Ce.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,ol.jsx)(t?Ko.Slot:"div",{ref:o,"data-sidebar":"group-label",className:g("duration-200 flex h-8 shrink-0 items-center rounded-El 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]:-ol-8 group-data-[collapsible=icon]:opacity-0",e),...a}));Np.displayName="SidebarGroupLabel";var Cp=Ce.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,ol.jsx)(t?Ko.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-El 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:El:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Cp.displayName="SidebarGroupAction";var Sn=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,"data-sidebar":"group-content",className:g("w-full text-sm",e),...t}));Sn.displayName="SidebarGroupContent";var Ci=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("ul",{ref:a,"data-sidebar":"menu",className:g("flex w-full min-w-0 flex-col gap-1",e),...t}));Ci.displayName="SidebarMenu";var Si=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("li",{ref:a,"data-sidebar":"menu-item",className:g("group/menu-item relative",e),...t}));Si.displayName="SidebarMenuItem";var Sp=(0,bl.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-El 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"}}),rr=Ce.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...d},n)=>{let m=e?Ko.Slot:"button",{isMobile:s,state:c}=ar(),l=(0,ol.jsx)(m,{ref:n,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:g(Sp({variant:a,size:o}),r),...d});return i?(typeof i=="string"&&(i={children:i}),(0,ol.jsxs)(Ia,{children:[(0,ol.jsx)(Ma,{asChild:!0,children:l}),(0,ol.jsx)(ya,{side:"right",align:"center",hidden:c!=="collapsed"||s,...i})]})):l});rr.displayName="SidebarMenuButton";var Dn=Ce.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,ol.jsx)(t?Ko.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:g("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-El 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:El: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 El:opacity-0",e),...o}));Dn.displayName="SidebarMenuAction";var Dp=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:g("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-El 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}));Dp.displayName="SidebarMenuBadge";var kp=Ce.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=Ce.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,ol.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:g("rounded-El h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,ol.jsx)(zt,{className:"size-4 rounded-El","data-sidebar":"menu-skeleton-icon"}),(0,ol.jsx)(zt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});kp.displayName="SidebarMenuSkeleton";var kn=Ce.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:g("mx-3.5 flex min-w-0 translate-ol-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));kn.displayName="SidebarMenuSub";var Tn=Ce.forwardRef(({...e},t)=>(0,ol.jsx)("li",{ref:t,...e}));Tn.displayName="SidebarMenuSubItem";var Pn=Ce.forwardRef(({asChild:e=!1,size:t="El",isActive:a,className:o,...i},r)=>(0,ol.jsx)(e?Ko.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:g("flex h-7 min-w-0 -translate-ol-px items-center gap-2 overflow-hidden rounded-El 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==="El"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...i}));Pn.displayName="SidebarMenuSubButton";function nr({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:i,pathName:r,menuHeading:d,onNavClick:n,loading:m=!1,LinkComponent:s,...c}){let u=s?v=>(0,ol.jsx)(s,{...v}):n?({href:v,children:h,...y})=>(0,ol.jsx)("button",{onClick:()=>n&&n(v),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...y,children:h}):v=>(0,ol.jsx)("a",{...v});return(0,ol.jsxs)(xn,{...c,variant:"inset",children:[(0,ol.jsx)(Nn,{children:(0,ol.jsx)(Ci,{children:(0,ol.jsx)(Si,{children:m?(0,ol.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ol.jsx)(zt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,ol.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,ol.jsx)("span",{className:"truncate font-semibold",children:o}),i&&(0,ol.jsx)("span",{className:"truncate text-sm",children:i})]})})})}),m&&(0,ol.jsxs)(or,{children:[(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"}),(0,ol.jsx)(zt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,ol.jsxs)(or,{children:[(0,ol.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!m&&a.map((v,h)=>(0,ol.jsx)(wl,{subNav:v,pathName:r,Link:u},h)),(0,ol.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!m&&e.map((v,h)=>(0,ol.jsx)(wl,{subNav:v,pathName:r,Link:u},h)),(0,ol.jsx)(ir,{className:"ol-auto",children:(0,ol.jsx)(Sn,{children:(0,ol.jsx)(Ci,{children:t&&!m&&t.map(v=>(0,ol.jsx)(Si,{children:(0,ol.jsx)(rr,{asChild:!0,size:"sm",children:(0,ol.jsxs)(u,{href:v.url||"",children:[v.icon&&(0,ol.jsx)(v.icon,{}),(0,ol.jsx)("span",{children:v.label})]})})},v.label))})})})]}),(0,ol.jsx)(Cn,{})]})}function wl({subNav:e,pathName:t,Link:a}){let o=e,i=!1;return o.links&&o.links.map(r=>{r.url===t&&(i=!0)}),(0,ol.jsx)(mn,{defaultOpen:!0,className:"group/collapsible",children:(0,ol.jsx)(ir,{className:"py-0",children:(0,ol.jsx)(Ci,{children:(0,ol.jsx)(mn,{asChild:!0,defaultOpen:o.isActive,children:(0,ol.jsxs)(Si,{children:[(0,ol.jsx)(rr,{asChild:!0,tooltip:o.label,className:(0,Rn.default)(i&&"font-bold text-accent"),children:(0,ol.jsxs)(a,{href:o.url,children:[o.icon&&(0,ol.jsx)(o.icon,{}),(0,ol.jsx)("span",{children:o.label})]})}),o.links?.length?(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(Ws,{asChild:!0,children:(0,ol.jsxs)(Dn,{className:"data-[state=open]:rotate-90",children:[(0,ol.jsx)(Nl.ChevronRight,{}),(0,ol.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,ol.jsx)(Js,{children:(0,ol.jsx)(kn,{children:o.links?.map(r=>(0,ol.jsx)(Tn,{children:(0,ol.jsx)(Pn,{asChild:!0,className:(0,Rn.default)(r.url===t&&"font-bold text-accent"),children:(0,ol.jsx)(a,{href:r.url,children:(0,ol.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var sr=ae(require("react")),Ka=ae(require("@radix-ui/react-avatar"));var aa=sr.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Ka.Root,{ref:a,className:g("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));aa.displayName=Ka.Root.displayName;var xo=sr.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Ka.Image,{ref:a,className:g("aspect-square h-full w-full",e),...t}));xo.displayName=Ka.Image.displayName;var oa=sr.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Ka.Fallback,{ref:a,className:g("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));oa.displayName=Ka.Fallback.displayName;var _a=ae(require("react")),Pe=ae(require("@radix-ui/react-dropdown-menu"));var Ea=Pe.Root,Ba=Pe.Trigger;var Tp=_a.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,ol.jsxs)(Pe.SubTrigger,{ref:i,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&&"ol-8",e),...o,children:[a,(0,ol.jsx)(ul.ChevronRightIcon,{className:"ml-auto"})]}));Tp.displayName=Pe.SubTrigger.displayName;var Pp=_a.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Pe.SubContent,{ref:a,className:g("z-50 min-w-[8rem] overflow-hidden rounded-El 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}));Pp.displayName=Pe.SubContent.displayName;var wa=_a.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ol.jsx)(Pe.Portal,{children:(0,ol.jsx)(Pe.Content,{ref:o,sideOffset:t,className:g("z-50 min-w-[8rem] overflow-hidden rounded-El border bg-popover p-1 text-popover-foreground shadow-El","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})}));wa.displayName=Pe.Content.displayName;var Xt=_a.forwardRef(({className:e,inset:t,...a},o)=>(0,ol.jsx)(Pe.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&&"ol-8",e),...a}));Xt.displayName=Pe.Item.displayName;var Rp=_a.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,ol.jsxs)(Pe.CheckboxItem,{ref:i,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 ol-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,ol.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ol.jsx)(Pe.ItemIndicator,{children:(0,ol.jsx)(ul.CheckIcon,{className:"h-4 w-4"})})}),t]}));Rp.displayName=Pe.CheckboxItem.displayName;var Ap=_a.forwardRef(({className:e,children:t,...a},o)=>(0,ol.jsxs)(Pe.RadioItem,{ref:o,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 ol-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,ol.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ol.jsx)(Pe.ItemIndicator,{children:(0,ol.jsx)(ul.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ap.displayName=Pe.RadioItem.displayName;var An=_a.forwardRef(({className:e,inset:t,...a},o)=>(0,ol.jsx)(Pe.Label,{ref:o,className:g("px-2 py-1.5 text-sm font-semibold",t&&"ol-8",e),...a}));An.displayName=Pe.Label.displayName;var In=_a.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Pe.Separator,{ref:a,className:g("-mx-1 my-1 h-px bg-muted",e),...t}));In.displayName=Pe.Separator.displayName;var Ip=({className:e,...t})=>(0,ol.jsx)("span",{className:g("ml-auto text-xs tracking-widest opacity-60",e),...t});Ip.displayName="DropdownMenuShortcut";var Cl=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,ol.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-El dark:bg-slate-900/80 sticky top-0 z-50",children:(0,ol.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsxs)("div",{className:"flex items-center space-ol-4",children:[a&&(0,ol.jsx)(b,{variant:"ghost",size:"icon",className:"El:hidden",onClick:a,children:(0,ol.jsx)(Nl.Menu,{className:"h-5 w-5"})}),(0,ol.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,ol.jsxs)("div",{className:"flex items-center space-ol-4",children:[(0,ol.jsxs)(b,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,ol.jsx)(Nl.Bell,{className:"h-5 w-5"}),(0,ol.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,ol.jsxs)(Ea,{children:[(0,ol.jsx)(Ba,{asChild:!0,children:(0,ol.jsx)(b,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,ol.jsxs)(aa,{className:"h-10 w-10",children:[(0,ol.jsx)(xo,{src:"/avatars/01.png",alt:"@user"}),(0,ol.jsx)(oa,{children:"JD"})]})})}),(0,ol.jsxs)(wa,{className:"w-56",align:"end",forceMount:!0,children:[(0,ol.jsx)(An,{className:"font-normal",children:(0,ol.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,ol.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,ol.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,ol.jsx)(In,{}),(0,ol.jsxs)(Xt,{children:[(0,ol.jsx)(Nl.User,{className:"mr-2 h-4 w-4"}),(0,ol.jsx)("span",{children:"Profile"})]}),(0,ol.jsxs)(Xt,{children:[(0,ol.jsx)(Nl.Settings,{className:"mr-2 h-4 w-4"}),(0,ol.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var br=ae(require("react")),Bn=ae(require("next/link"));var Dl=(0,bl.cva)("inline-flex items-center rounded-El 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 se({className:e,variant:t,...a}){return(0,ol.jsx)("div",{className:g(Dl({variant:t}),e),...a})}var Mn=ae(require("react")),ca=ae(require("@radix-ui/react-scroll-area"));var La=Mn.forwardRef(({className:e,children:t,...a},o)=>(0,ol.jsxs)(ca.Root,{ref:o,className:g("relative overflow-hidden",e),...a,children:[(0,ol.jsx)(ca.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,ol.jsx)(Tl,{}),(0,ol.jsx)(ca.Corner,{})]}));La.displayName=ca.Root.displayName;var Tl=Mn.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,ol.jsx)(ca.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,ol.jsx)(ca.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Tl.displayName=ca.ScrollAreaScrollbar.displayName;var Di=ae(require("react")),Et=ae(require("@radix-ui/react-dialog"));var Ve=Et.Root;var dr=Et.Portal;var ki=Di.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Et.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}));ki.displayName=Et.Overlay.displayName;var Ge=Di.forwardRef(({className:e,children:t,...a},o)=>(0,ol.jsxs)(dr,{children:[(0,ol.jsx)(ki,{}),(0,ol.jsxs)(Et.Content,{ref:o,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-ol-[-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,ol.jsxs)(Et.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,ol.jsx)(Nl.ol,{className:"h-4 w-4"}),(0,ol.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Ge.displayName=Et.Content.displayName;var We=({className:e,...t})=>(0,ol.jsx)("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});We.displayName="DialogHeader";var $o=({className:e,...t})=>(0,ol.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-ol-2",e),...t});$o.displayName="DialogFooter";var Je=Di.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Et.Title,{ref:a,className:g("text-lg font-semibold leading-none tracking-tight",e),...t}));Je.displayName=Et.Title.displayName;var Go=Di.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Et.Description,{ref:a,className:g("text-sm text-muted-foreground",e),...t}));Go.displayName=Et.Description.displayName;var Ti=ae(require("@radix-ui/react-checkbox")),Al=ae(require("react")),yo=Al.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Ti.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,ol.jsx)(Ti.Indicator,{className:g("flex items-center justify-center text-current"),children:(0,ol.jsx)(Nl.Check,{className:"h-4 w-4"})})}));yo.displayName=Ti.Root.displayName;var Fa=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Ml=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,ol.jsx)(Nl.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,ol.jsx)(Nl.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,ol.jsx)(Nl.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,ol.jsx)(Nl.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,ol.jsx)(Nl.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,ol.jsx)(Nl.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,ol.jsx)(Nl.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,ol.jsx)(Nl.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,ol.jsx)(Nl.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,ol.jsx)(Nl.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],ur=[{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 En=[{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}],mr=[{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")}],Mp=[...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 Nl 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")}],Ep=[...ur,{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}],pr={projects:[{id:"1",name:"Empty Project",description:"A project with ol 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:[]},Il={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 Xg={empty:{initialProjects:pr.projects,initialEpics:pr.epics,initialSprints:pr.sprints,initialTasks:pr.tasks},default:{initialProjects:ur,initialEpics:En,initialSprints:mr,initialTasks:fr},highDensity:{initialProjects:ur,initialEpics:En,initialSprints:mr,initialTasks:Mp},singleEpic:{initialProjects:ur,initialEpics:Il.epics,initialSprints:mr,initialTasks:Il.tasks},multipleProjects:{initialProjects:Ep,initialEpics:En,initialSprints:mr,initialTasks:fr}},gr=[{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.tr","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 Nl 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}],Yg=[{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:gr.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:gr.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:gr.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 Zg=gr.filter(e=>e.type==="digital");function hr(e,t){let[a,o]=(0,tr.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,tr.useEffect)(()=>{i(a)},[]),[a,i]}function Ln({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=Ml[0],onBusinessUnitChange:r,onSearch:d,className:n,logo:m="/headerlogo.png",appName:s="Nuvia",tagline:c="Collaboration Platform"}){let[l,u]=br.useState({}),[v,h]=hr("sidebar-favorites",{}),[y,p]=br.useState(null),[k,S]=br.useState(""),N=P=>{u(I=>({...I,[P]:!I[P]}))},R=P=>{r?.(P)},q=()=>{k.trim()&&d?.(k.trim())},D=P=>{P.key==="Enter"&&(P.preventDefault(),q())},A=(P,I)=>{let _=v[P]||[],Te=_.includes(I)?_.filter($e=>$e!==I):_.concat(I);h({...v,[P]:Te})},w=P=>{if(!P.items||!P.maxItems||P.items.length<=P.maxItems)return P.items||[];let I=v[P.id]||[],_=P.items.filter($e=>I.includes($e.id)),Te=P.items.filter($e=>!I.includes($e.id));return[..._,...Te].slice(0,P.maxItems)},B=P=>P.maxItems&&P.items&&P.items.length>P.maxItems,z=e,F=P=>{let I=B(P),_=w(P),Te=(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[P.icon,(0,ol.jsx)("span",{children:P.title})]}),P.badge&&(0,ol.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:P.badge}),P.items&&(0,ol.jsx)(Nl.ChevronDown,{className:g("ml-2 h-4 w-4 transition-transform",l[P.title]?"rotate-180":"")})]}),$e=g("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",P.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return P.url?(0,ol.jsx)(Bn.default,{href:P.url,className:$e,onClick:a?o:void 0,children:Te}):(0,ol.jsx)("button",{className:$e,onClick:()=>P.items&&N(P.title),children:Te})},T=()=>{let P=e.find(_=>_.id===y);if(!P||!P.items||!P.maxItems)return null;let I=v[P.id]||[];return(0,ol.jsx)(Ve,{open:!!y,onOpenChange:_=>!_&&p(null),children:(0,ol.jsxs)(Ge,{className:"sm:max-w-El",children:[(0,ol.jsxs)(We,{children:[(0,ol.jsxs)(Je,{children:["Manage ",P.title," Favorites"]}),(0,ol.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",P.maxItems," items to show in ",P.title.toLowerCase(),"."]})]}),(0,ol.jsx)(La,{className:"max-h-96 pr-4",children:(0,ol.jsx)("div",{className:"space-y-4",children:P.items.map(_=>(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)(yo,{id:_.id,checked:I.includes(_.id),onCheckedChange:()=>A(P.id,_.id),disabled:!I.includes(_.id)&&I.length>=(P.maxItems||0)}),(0,ol.jsxs)("label",{htmlFor:_.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:[_.title,_.badge&&(0,ol.jsx)(se,{variant:"outline",className:"text-xs",children:_.badge})]})]},_.id))})})]})})},Me=(0,ol.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ol.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,ol.jsx)("img",{src:m,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h2",{className:"font-semibold",children:s}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:c})]})]}),a&&(0,ol.jsx)(b,{variant:"ghost",size:"icon",onClick:o,children:(0,ol.jsx)(Nl.ol,{className:"h-5 w-5"})})]}),(0,ol.jsx)("div",{className:"px-3 py-2",children:(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)(Nl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ol.jsx)(V,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted ol-9 pr-4 py-2",value:k,onChange:P=>S(P.target.value),onKeyPress:D})]})}),(0,ol.jsx)(La,{className:"flex-1 px-3 py-2",children:(0,ol.jsx)("div",{className:"space-y-1",children:z.map(P=>(0,ol.jsxs)("div",{className:"mb-1",children:[F(P),P.items&&l[P.title]&&(0,ol.jsxs)("div",{className:"ol-1 ml-6 space-y-1 border-l ol-3",children:[w(P).map(I=>(0,ol.jsxs)(Bn.default,{href:I.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[I.title,I.badge&&(0,ol.jsx)(se,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:I.badge})]},I.id)),B(P)&&P.items&&P.items.length>w(P).length&&(0,ol.jsxs)("button",{onClick:()=>p(P.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:["...",P.items.length-w(P).length," more available"]})]})]},P.id))})}),(0,ol.jsx)("div",{className:"p-3",children:(0,ol.jsx)("div",{className:"space-y-1",children:(0,ol.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,ol.jsx)(Nl.Settings,{className:"h-5 w-5"}),(0,ol.jsx)("span",{children:"Settings"})]})})}),(0,ol.jsx)(T,{})]});return a?(0,ol.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-ol-0":"-translate-ol-full",n),children:Me}):(0,ol.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-ol-0":"-translate-ol-full",n),children:Me})}var lo=require("motion/react");var El=require("next-themes");function Bl(){let{setTheme:e,theme:t}=(0,El.useTheme)();return(0,ol.jsx)(Aa,{children:(0,ol.jsxs)(Ia,{children:[(0,ol.jsx)(Ma,{asChild:!0,children:(0,ol.jsxs)(b,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,ol.jsx)(Nl.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,ol.jsx)(Nl.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,ol.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,ol.jsx)(ya,{children:"Toggle theme"})]})})}function Ll({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let d=e.filter(s=>!s.read),n=d.length,m=s=>{switch(s){case"info":return(0,ol.jsx)($t.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,ol.jsx)($t.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,ol.jsx)($t.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,ol.jsx)($t.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,ol.jsx)(lo.AnimatePresence,{children:t&&(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(lo.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm El:hidden",onClick:a}),(0,ol.jsx)(lo.motion.div,{initial:{ol:"100%"},animate:{ol:0},exit:{ol:"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 El:w-96",r),children:(0,ol.jsxs)("div",{className:"flex h-full flex-col",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)($t.Bell,{className:"h-5 w-5"}),(0,ol.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,ol.jsxs)(se,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,ol.jsxs)(b,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,ol.jsx)($t.ol,{className:"h-5 w-5"}),(0,ol.jsx)("span",{className:"sr-only",children:"Close"})]})]}),n>0&&(0,ol.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,ol.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,ol.jsx)(b,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),d.length>0?(0,ol.jsx)(La,{className:"flex-1",children:(0,ol.jsx)("div",{className:"divide-y",children:d.map(s=>(0,ol.jsxs)("div",{className:g("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,ol.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:m(s.type)}),(0,ol.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)("p",{className:"font-medium",children:s.title}),(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:s.time}),(0,ol.jsx)(b,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(s.id),title:"Dismiss",children:(0,ol.jsx)($t.Check,{className:"h-3 w-3"})})]})]}),(0,ol.jsx)("p",{className:"text-sm text-muted-foreground",children:s.description}),s.actionLabel&&(0,ol.jsxs)(b,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:s.onAction,children:[s.actionLabel,(0,ol.jsx)($t.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},s.id))})}):(0,ol.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,ol.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,ol.jsx)($t.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,ol.jsx)("h3",{className:"ol-4 text-lg font-medium",children:"No notifications"}),(0,ol.jsx)("p",{className:"ol-2 text-sm text-muted-foreground",children:"When you receive notifications, they'ol appear here."})]})]})})]})})}var wo=ae(require("@radix-ui/react-tabs"));function Fl({className:e,...t}){return(0,ol.jsx)(wo.Root,{"data-slot":"tabs",className:g("flex flex-col gap-2",e),...t})}function Ol({className:e,...t}){return(0,ol.jsx)(wo.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 Hl({className:e,...t}){return(0,ol.jsx)(wo.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-El 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 Wo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let d=a.find(n=>n.value===e);return(0,ol.jsxs)(lo.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,ol.jsx)("div",{className:"hidden lg:block",children:(0,ol.jsx)(Fl,{value:e,onValueChange:t,children:(0,ol.jsx)(Ol,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ol.jsx)(Hl,{value:n.value,className:"w-full h-8 rounded-Nl data-[state=active]:rounded-Nl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,ol.jsx)("div",{className:"lg:hidden",children:(0,ol.jsxs)(Ea,{children:[(0,ol.jsx)(Ba,{asChild:!0,children:(0,ol.jsxs)(b,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[d?.label||"Select",(0,ol.jsx)(Nl.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,ol.jsx)(wa,{align:"center",className:"w-[180px]",children:a.map(n=>(0,ol.jsx)(Xt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function zl({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:d="assistant",onTabChange:n,showTabs:m=!0,tabOptions:s=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:c,actionIcon:l=(0,ol.jsx)(Nl.Bot,{className:"mr-2 h-4 w-4"}),actionText:u="Action",onNotificationRemove:v,onRemoveAll:h,logo:y="/headerlogo.png",appName:p="Nuvia",tagline:k="Collaboration Platform"}){let[S,N]=(0,tr.useState)(!1),[R,q]=(0,tr.useState)(t),D=R.filter(B=>!B.read).length,A=B=>{q(z=>z.filter(F=>F.id!==B)),v?.(B)},w=()=>{q(B=>B.filter(z=>z.read)),h?.()};return(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 ol-2 pr-4 backdrop-blur ${r||""}`,children:[(0,ol.jsx)(b,{variant:"ghost",size:"icon",className:"El:hidden",onClick:o,children:(0,ol.jsx)(Nl.Menu,{className:"h-5 w-5"})}),(0,ol.jsx)(b,{variant:"ghost",size:"icon",className:"hidden El:flex",onClick:a,children:(0,ol.jsx)(Nl.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,ol.jsxs)(lo.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,ol:-20},animate:{opacity:1,ol:0},transition:{duration:.3},children:[(0,ol.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,ol.jsx)("img",{src:y,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h2",{className:"font-semibold text-sm",children:p}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:k})]})]}),(0,ol.jsxs)("div",{className:"flex flex-1 items-center",children:[m&&(0,ol.jsx)(Wo,{activeTab:d,onTabChange:n,tabOptions:s}),(0,ol.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,ol.jsx)(lo.motion.div,{className:"hidden El:flex gap-2",initial:{opacity:0,ol:20},animate:{opacity:1,ol:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ol.jsxs)(b,{className:"rounded-2xl transition-all duration-200 hover:shadow-El",onClick:c,children:[l,u]})})}),(0,ol.jsx)(Bl,{}),(0,ol.jsx)(Aa,{children:(0,ol.jsxs)(Ia,{children:[(0,ol.jsx)(Ma,{asChild:!0,children:(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ol.jsxs)(b,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>N(!0),children:[(0,ol.jsx)(lo.motion.div,{animate:D>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:D>0?1/0:0,repeatDelay:3},children:(0,ol.jsx)(Nl.Bell,{className:"h-5 w-5"})}),D>0&&(0,ol.jsx)(lo.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:D})]})})}),(0,ol.jsx)(ya,{children:"Notifications"})]})}),(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ol.jsxs)(aa,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-El cursor-pointer",children:[(0,ol.jsx)(xo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,ol.jsx)(oa,{})]})})]})]})]}),(0,ol.jsx)(Ll,{notifications:R,open:S,onClose:()=>N(!1),onNotificationRemove:A,onRemoveAll:w})]})}var Ul=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ol.jsx)(Nl.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Nr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=Ul[0],onBusinessUnitChange:r,onSearch:d,businessUnits:n=Ul,activeTab:m,onTabChange:s,showTabs:c=!1,onActionClick:l,actionIcon:u,actionText:v="Action",onNotificationRemove:h,onRemoveAll:y,logo:p="/headerlogo.png",appName:k="Nuvia",tagline:S="Collaboration Platform",sidebarInitiallyClosed:N=!1}){let[R,q]=(0,tr.useState)(!N),[D,A]=(0,tr.useState)(!1),[w,B]=(0,tr.useState)(i),z=F=>{B(F),r?.(F)};return(0,ol.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-Nl bg-background w-[]",children:[D&&(0,ol.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 El:hidden",onClick:()=>A(!1)}),(0,ol.jsx)("div",{className:"El:hidden",children:(0,ol.jsx)(Ln,{items:e,isOpen:D,isMobile:!0,onClose:()=>A(!1),currentBusinessUnit:w,onBusinessUnitChange:z,onSearch:d,logo:p,appName:k,tagline:S})}),(0,ol.jsx)("div",{className:"hidden El:block",children:(0,ol.jsx)(Ln,{items:e,isOpen:R,isMobile:!1,currentBusinessUnit:w,onBusinessUnitChange:z,onSearch:d,logo:p,appName:k,tagline:S})}),(0,ol.jsxs)("div",{className:g("min-h-screen fixed w-full transition-all duration-300 ease-in-out",R?"El:ol-64":"El:ol-0"),children:[(0,ol.jsx)(zl,{title:a,notifications:o,onToggleSidebar:()=>q(!R),onToggleMobileMenu:()=>A(!0),sidebarOpen:R,activeTab:m,onTabChange:s,showTabs:c,onActionClick:l,actionIcon:u,actionText:v,onNotificationRemove:h,onRemoveAll:y,logo:p,appName:k,tagline:S}),(0,ol.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var No=ae(require("react"));var W=No.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,className:g("rounded-Nl border bg-card text-card-foreground shadow",e),...t}));W.displayName="Card";var _e=No.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,className:g("flex flex-col space-y-1.5 p-6",e),...t}));_e.displayName="CardHeader";var Ye=No.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,className:g("font-semibold leading-none tracking-tight",e),...t}));Ye.displayName="CardTitle";var Ha=No.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,className:g("text-sm text-muted-foreground",e),...t}));Ha.displayName="CardDescription";var fe=No.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,className:g("p-6 ol-0",e),...t}));fe.displayName="CardContent";var Co=No.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("div",{ref:a,className:g("flex items-center p-6 ol-0",e),...t}));Co.displayName="CardFooter";var Kl=ae(require("clsx")),_l=ae(require("next/image")),Hn=e=>{let{loading:t,priority:a,className:o,alt:i="Cortex Reply Logo",src:r="/logo.png"}=e;return(0,$l.jsx)(_l.default,{alt:i,width:193,height:34,loading:t||"lazy",fetchPriority:a||"low",decoding:"async",className:(0,Kl.default)("max-w-[9.375rem] w-full h-[34px]",o),src:r})};var Bp=[{id:"ava",title:"Chat with Ava",description:"Start a conversation with our digital assistant for instant help and guidance.",icon:(0,ol.jsx)(Nl.Bot,{className:"h-12 w-12"}),color:"text-purple-600",gradient:"from-purple-500 to-blue-600",url:"/chat/ava"},{id:"team",title:"Collaborate with Team",description:"Work together with your colleagues Nl projects and share knowledge.",icon:(0,ol.jsx)(Nl.Users,{className:"h-12 w-12"}),color:"text-blue-600",gradient:"from-blue-500 to-green-600",url:"/workspace/team"}];function Gl({onLogin:e,isLoading:t=!1,className:a,title:o="Welcome to Cortex",subtitle:i="Click below to access your digital workspace",buttonText:r="Sign In to Continue",loadingText:d="Signing you in...",welcomeTitle:n="Welcome to Cortex",welcomeSubtitle:m="Choose how you'd like to get started",logoSrc:s="/logo.png",logoAlt:c="Cortex Logo",workspaceChoices:l=Bp}){let[u,v]=(0,tr.useState)(!1),[h,y]=(0,tr.useState)(!1),p=async()=>{y(!0),await new Promise(S=>setTimeout(S,1500)),y(!1),v(!0),e?.()},k=S=>{if(S.onClick){S.onClick();return}S.url?S.url.startsWith("http://")||S.url.startsWith("https://")?window.open(S.url,"_blank"):window.location.href=S.url:console.log(`User selected: ${S.title}`)};return u?(0,ol.jsx)("div",{className:g("min-h-screen bg-gradient-to-br from-slate-50 to-blue-50 flex items-center justify-center p-4",a),children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5,type:"spring",stiffness:100},className:"w-full max-w-4xl",children:[(0,ol.jsxs)("div",{className:"text-center mb-8",children:[(0,ol.jsx)(lo.motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.6},className:"mb-6 flex justify-center",children:(0,ol.jsx)("div",{className:"w-32 h-32 bg-white rounded-full flex items-center justify-center shadow-lg",children:(0,ol.jsx)(Hn,{className:"w-24 h-auto",loading:"eager",priority:"high",alt:c,src:s})})}),(0,ol.jsx)(lo.motion.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6},className:"text-4xl font-bold bg-primary bg-clip-text text-transparent mb-4",children:n}),(0,ol.jsx)(lo.motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.6},className:"text-lg text-muted-foreground",children:m})]}),(0,ol.jsx)("div",{className:"grid El:grid-cols-2 gap-6",children:(0,ol.jsx)(lo.AnimatePresence,{children:l.map((S,N)=>(0,ol.jsx)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4+N*.1,duration:.6,type:"spring",stiffness:100},whileHover:{scale:1.02},whileTap:{scale:.98},children:(0,ol.jsxs)(W,{className:"cursor-pointer transition-all duration-300 hover:shadow-Nl border-2 hover:border-primary/30 group h-full",onClick:()=>k(S),children:[(0,ol.jsxs)(_e,{className:"text-center pb-4",children:[(0,ol.jsx)("div",{className:g("mx-auto w-20 h-20 rounded-full flex items-center justify-center mb-4 transition-all duration-300","bg-gradient-to-br",S.gradient,"group-hover:scale-110"),children:(0,ol.jsx)("div",{className:"text-white",children:S.icon})}),(0,ol.jsx)(Ye,{className:"text-2xl font-semibold",children:S.title})]}),(0,ol.jsxs)(fe,{className:"text-center",children:[(0,ol.jsx)(Ha,{className:"text-base leading-relaxed mb-6",children:S.description}),(0,ol.jsx)(b,{className:g("w-full, text-white border-0 hover:opacity-90 transition-opacity duration-300"),size:"lg",children:"Get Started"})]})]})},S.id))})})]})}):(0,ol.jsx)("div",{className:g("min-h-screen bg-gradient-to-br from-slate-50 to-blue-50 flex items-center justify-center p-4",a),children:(0,ol.jsx)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,type:"spring",stiffness:100},className:"w-full max-w-El",children:(0,ol.jsxs)(W,{className:"shadow-2xl border-0",children:[(0,ol.jsxs)(_e,{className:"text-center pb-2",children:[(0,ol.jsx)(lo.motion.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,duration:.5,type:"spring",stiffness:200},className:"mx-auto w-20 h-20 bg-white rounded-full flex items-center justify-center mb-4 shadow-lg",children:(0,ol.jsx)(Hn,{className:"w-16 h-auto",loading:"eager",priority:"high",alt:c,src:s})}),(0,ol.jsx)(Ye,{className:"text-3xl font-bold bg-accent bg-clip-text text-transparent",children:o}),(0,ol.jsx)(Ha,{className:"text-base ol-2",children:i})]}),(0,ol.jsx)(fe,{className:"space-y-6 py-6",children:(0,ol.jsx)(b,{onClick:p,className:"w-full h-12 text-white border-0 font-medium text-lg transition-all duration-300 shadow-lg hover:shadow-Nl",disabled:h||t,children:h||t?(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(lo.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},className:"mr-3",children:(0,ol.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full"})}),d]}):(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(Nl.Lock,{className:"mr-3 h-5 w-5"}),r]})})})]})})})}var qo=ae(require("react"));var zn=qo.forwardRef(({...e},t)=>(0,ol.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));zn.displayName="Breadcrumb";var Un=qo.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("ol",{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}));Un.displayName="BreadcrumbList";var Sr=qo.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("li",{ref:a,className:g("inline-flex items-center gap-1.5",e),...t}));Sr.displayName="BreadcrumbItem";var Vn=qo.forwardRef(({asChild:e,className:t,...a},o)=>(0,ol.jsx)(e?Ko.Slot:"a",{ref:o,className:g("transition-colors hover:text-foreground",t),...a}));Vn.displayName="BreadcrumbLink";var Kn=qo.forwardRef(({className:e,...t},a)=>(0,ol.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:g("font-normal text-foreground",e),...t}));Kn.displayName="BreadcrumbPage";var _n=({children:e,className:t,...a})=>(0,ol.jsx)("li",{role:"presentation","aria-hidden":"true",className:g("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,ol.jsx)(ul.ChevronRightIcon,{})});_n.displayName="BreadcrumbSeparator";var Lp=({className:e,...t})=>(0,ol.jsxs)("span",{role:"presentation","aria-hidden":"true",className:g("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,ol.jsx)(ul.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,ol.jsx)("span",{className:"sr-only",children:"More"})]});Lp.displayName="BreadcrumbElipssis";var Tr=ae(require("react")),Fp=1,Op=1e6;var $n=0;function Hp(){return $n=($n+1)%Number.MAX_SAFE_INTEGER,$n.toString()}var Gn=new Map,Jl=e=>{if(Gn.has(e))return;let t=setTimeout(()=>{Gn.delete(e),Ri({type:"REMOVE_TOAST",toastId:e})},Op);Gn.set(e,t)},jp=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Fp)};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?Jl(a):e.toasts.forEach(o=>{Jl(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)}}},Dr=[],kr={toasts:[]};function Ri(e){kr=jp(kr,e),Dr.forEach(t=>{t(kr)})}function zp({...e}){let t=Hp(),a=i=>Ri({type:"UPDATE_TOAST",toast:{...i,id:t}}),o=()=>Ri({type:"DISMISS_TOAST",toastId:t});return Ri({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||o()}}}),{id:t,dismiss:o,update:a}}function ql(){let[e,t]=Tr.useState(kr);return Tr.useEffect(()=>(Dr.push(t),()=>{let a=Dr.indexOf(t);a>-1&&Dr.splice(a,1)}),[e]),{...e,toast:zp,dismiss:a=>Ri({type:"DISMISS_TOAST",toastId:a})}}var Do=ae(require("react")),St=ae(require("@radix-ui/react-toast"));var Zl=St.Provider,Wn=Do.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(St.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 El:max-w-[420px]",e),...t}));Wn.displayName=St.Viewport.displayName;var Up=(0,bl.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-ol-2 overflow-hidden rounded-El border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-ol-0 data-[swipe=end]:translate-ol-[var(--radix-toast-swipe-end-ol)] data-[swipe=move]:translate-ol-[var(--radix-toast-swipe-move-ol)] 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"}}),Jn=Do.forwardRef(({className:e,variant:t,...a},o)=>(0,ol.jsx)(St.Root,{ref:o,className:g(Up({variant:t}),e),...a}));Jn.displayName=St.Root.displayName;var Vp=Do.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(St.Action,{ref:a,className:g("inline-flex h-8 shrink-0 items-center justify-center rounded-El 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}));Vp.displayName=St.Action.displayName;var qn=Do.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(St.Close,{ref:a,className:g("absolute right-1 top-1 rounded-El 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,ol.jsx)(Nl.ol,{className:"h-4 w-4"})}));qn.displayName=St.Close.displayName;var Xn=Do.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(St.Title,{ref:a,className:g("text-sm font-semibold [&+div]:text-xs",e),...t}));Xn.displayName=St.Title.displayName;var Yn=Do.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(St.Description,{ref:a,className:g("text-sm opacity-90",e),...t}));Yn.displayName=St.Description.displayName;function Ql(){let{toasts:e}=ql();return(0,$a.jsxs)(Zl,{children:[e.map(function({id:t,title:a,description:o,action:i,...r}){return(0,$a.jsxs)(Jn,{...r,children:[(0,$a.jsxs)("div",{className:"grid gap-1",children:[a&&(0,$a.jsx)(Xn,{children:a}),o&&(0,$a.jsx)(Yn,{children:o})]}),i,(0,$a.jsx)(qn,{})]},t)}),(0,$a.jsx)(Wn,{})]})}var ed=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let i=e.includes("Nl-")?e+" ":"Nl-"+e+" ",r="Nl-"+t,d=o??"",n=i+r+" Nl-"+a+" "+d;return(0,ol.jsx)("i",{className:n})};var Xo=require("@headlessui/react"),od=require("@heroicons/react/20/solid");var Kp=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,ol.jsx)("a",{href:o,className:"flex items-center gap-ol-1 text-sm text-foreground group",children:(0,ol.jsxs)("span",{className:"relative",children:[e,(0,ol.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-ol-1/2 scale-ol-0 transition-transform duration-300 ease-in-out group-hover:scale-ol-100"})]})}):(0,ol.jsxs)(Xo.Popover,{children:[(0,ol.jsxs)(Xo.PopoverButton,{className:"flex items-center gap-ol-1 text-sm/6 text-foreground outline-none group",children:[(0,ol.jsxs)("span",{className:"relative",children:[e,(0,ol.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-ol-1/2 scale-ol-0 transition-transform duration-300 ease-in-out group-hover:scale-ol-100"})]}),(0,ol.jsx)(od.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,ol.jsxs)(Xo.PopoverPanel,{transition:!0,className:"absolute inset-ol-0 top-0 -z-10 bg-popover ol-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,ol.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-ol-4 px-6 py-10 lg:px-8 Nl:gap-ol-8 z-50",children:t&&t.map(i=>(0,ol.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,ol.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:i.icon&&(0,ol.jsx)(ad,{icon:i.icon,size:"4x"})}),(0,ol.jsxs)("a",{href:i.href,className:"ol-6 block text-popover-foreground group-hover:text-accent",children:[i.name,(0,ol.jsx)("span",{className:"absolute inset-0"})]}),(0,ol.jsx)("p",{className:"ol-1 text-popover-foreground/80 group-hover:text-accent",children:i.description})]},i.name))}),a.length>0&&(0,ol.jsx)("div",{className:"bg-gray-50",children:(0,ol.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,ol.jsx)("div",{className:"grid grid-cols-3 divide-ol divide-gray-900/5 border-ol border-gray-900/5",children:a.map(i=>(0,ol.jsxs)("a",{href:i.href,className:"flex items-center max-h-12 justify-center gap-ol-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[i.icon&&(0,ol.jsx)(ad,{icon:i.icon,className:"h-5 w-5 flex-none text-gray-400"}),i.name]},i.name))})})})]})]}),ad=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,ol.jsx)(ed,{...e,size:a});if("src"in e)return(0,ol.jsx)("div",{className:g(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,ol.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},id=Kp;var rd=ae(require("next/link"));function nd({children:e,href:t,openNewTab:a,...o}){return(0,ol.jsx)(rd.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var Zn=ae(require("next/image"));function Ii({logoLight:e,logoDark:t,mobile:a=!1}){return(0,ol.jsxs)(nd,{href:"/",className:g(a?"py-1":"py-2"),children:[(0,ol.jsx)(Zn.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,ol.jsx)(Zn.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 cd({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i=!1,wide:r=!1}){let[d,n]=(0,tr.useState)(!1),[m,s]=(0,tr.useState)(""),c=["light","dark"],{theme:l,setTheme:u}=(0,El.useTheme)();(0,tr.useEffect)(()=>{s(l||"dark")},[l]);let v=()=>{let h=c[(c.indexOf(m)+1)%c.length];s(h),u(h)};return(0,tr.useEffect)(()=>{let h=()=>{window.scrollY>100?n(!0):n(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,ol.jsx)(ol.Fragment,{children:(0,ol.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,ol.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,ol.jsxs)("div",{className:g("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,ol.jsx)(Ii,{logoDark:a,logoLight:t}),(0,ol.jsx)(Xo.PopoverGroup,{className:"hidden lg:flex lg:gap-ol-12",children:o&&o.map(h=>(0,ol.jsx)(id,{...h},h.name))}),i&&(0,ol.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:v,children:(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)(Nl.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,ol.jsx)(Nl.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Rr=require("@heroicons/react/24/outline");var Qn=["light","dark"];function pd({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[i,r]=(0,tr.useState)(!1),{theme:d,setTheme:n}=(0,El.useTheme)(),[m,s]=(0,tr.useState)(!1),[c,l]=(0,tr.useState)("light");(0,tr.useEffect)(()=>{let v=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",v,{passive:!0}),()=>window.removeEventListener("scroll",v)},[]),(0,tr.useEffect)(()=>{l(d||"dark")},[d]);let u=()=>{let v=Qn[(Qn.indexOf(c)+1)%Qn.length];l(v),n(v)};return(0,ol.jsx)(ol.Fragment,{children:(0,ol.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block lg:hidden ${i||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,ol.jsx)("nav",{className:g("backdrop-blur-sm text-white p-0",m&&"hidden"),children:(0,ol.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&_.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,ol.jsx)(Ii,{logoDark:t,logoLight:e,mobile:!0}),(0,ol.jsx)("div",{className:"flex items-center space-ol-4",children:(0,ol.jsxs)("button",{type:"button",onClick:()=>s(!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,ol.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,ol.jsx)(Rr.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,ol.jsxs)(Xo.Dialog,{open:m,onClose:s,className:"lg:hidden",children:[(0,ol.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,ol.jsxs)(Xo.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,ol.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,ol.jsx)(Ii,{logoDark:t,logoLight:e,mobile:!0}),(0,ol.jsxs)("button",{type:"button",onClick:()=>s(!1),className:"-m-2.5 rounded-El p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,ol.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,ol.jsx)(Rr.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,ol.jsx)("div",{className:"ol-6 flow-root",children:(0,ol.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,ol.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(v=>(0,ol.jsx)(_p,{...v},v.name))})})})]})]})]})})}function _p({name:e,items:t,actions:a,href:o}){return!t&&o?(0,ol.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,ol.jsxs)(Xo.Disclosure,{tr:"div",className:"-mx-3",children:[(0,ol.jsx)(Xo.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 ol-3 pr-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,ol.jsx)(Xo.DisclosurePanel,{className:"ol-2 space-y-2",children:t&&t.map(i=>(0,ol.jsx)(Xo.DisclosureButton,{tr:"a",href:i.href,className:"block rounded-lg py-2 ol-6 pr-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:i.name},i.name))})]})}function ud({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:i,wide:r,themeControl:d=!1}){return(0,ol.jsxs)("div",{className:g("fixed top-0 left-0 right-0 z-50",i),children:[(0,ol.jsx)(cd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:d,wide:r}),(0,ol.jsx)(pd,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var gd="../../cortex-reply-light-27IMI3G7.png";var fd="../../cortex-reply-dark-XPAJJJYY.png";function es({...e}){return(0,ol.jsxs)("div",{className:"bg-sidebar",children:[(0,ol.jsx)(ud,{isMenuOpen:!0,logoLight:gd,logoDark:fd,...e.header,className:"bg-sidebar",wide:!0}),(0,ol.jsxs)(bn,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,ol.jsx)(nr,{...e.sidebarLeft,className:"flex-none top-24"}),(0,ol.jsxs)(wn,{className:"grow overflow-hidden",children:[(0,ol.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,ol.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,ol.jsx)(yn,{className:"-ml-1"}),(0,ol.jsx)(wi,{orientation:"vertical",className:"mr-2 h-4"}),(0,ol.jsx)(zn,{children:(0,ol.jsxs)(Un,{children:[(0,ol.jsx)(Sr,{className:"hidden El:block",children:(0,ol.jsx)(Vn,{href:"#",children:"Building Your Application"})}),(0,ol.jsx)(_n,{className:"hidden El:block"}),(0,ol.jsx)(Sr,{children:(0,ol.jsx)(Kn,{children:"Data Fetching"})})]})})]})}),(0,ol.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 ol-0",children:[(0,ol.jsxs)("div",{className:"grid auto-rows-min gap-4 El:grid-cols-3",children:[(0,ol.jsx)("div",{className:"aspect-video rounded-Nl bg-muted/50"}),(0,ol.jsx)("div",{className:"aspect-video rounded-Nl bg-muted/50"}),(0,ol.jsx)("div",{className:"aspect-video rounded-Nl bg-muted/50"})]}),(0,ol.jsx)("div",{className:"flex-1 rounded-Nl bg-muted/50 El:min-h-min"})]})]})]}),(0,ol.jsx)(Ql,{})]})}var Wp=[{key:"kanban",icon:Nl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Nl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Nl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Nl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Nl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],vd=({currentView:e,onViewChange:t,children:a})=>(0,ol.jsxs)("div",{className:"flex w-full h-screen",children:[(0,ol.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Wp.map(o=>{let i=o.icon,r=e===o.key;return(0,ol.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 ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden El:flex":""} hover:w-28 hover:justify-start hover:ol-3`,title:o.title,children:[(0,ol.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,ol.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,ol.jsx)("div",{className:"flex-1 min-w-0 px-4 El:px-6 h-full overflow-auto",children:(0,ol.jsx)("div",{className:"w-full h-full",children:a})})]});var hd=ae(require("react")),ts=ae(require("@radix-ui/react-label"));var Jp=(0,bl.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),E=hd.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(ts.Root,{ref:a,className:g(Jp(),e),...t}));E.displayName=ts.Root.displayName;var Re=ae(require("@radix-ui/react-select")),po=ae(require("react")),nt=Re.Root;var wt=Re.Value,Qe=po.forwardRef(({children:e,className:t,...a},o)=>(0,ol.jsxs)(Re.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,ol.jsx)(Re.Icon,{asChild:!0,children:(0,ol.jsx)(Nl.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Qe.displayName=Re.Trigger.displayName;var yd=po.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Re.ScrollUpButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ol.jsx)(Nl.ChevronUp,{className:"h-4 w-4"})}));yd.displayName=Re.ScrollUpButton.displayName;var wd=po.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Re.ScrollDownButton,{className:g("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,ol.jsx)(Nl.ChevronDown,{className:"h-4 w-4"})}));wd.displayName=Re.ScrollDownButton.displayName;var et=po.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,ol.jsx)(Re.Portal,{children:(0,ol.jsxs)(Re.Content,{className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-El 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-ol-1 data-[side=right]:translate-ol-1 data-[side=top]:-translate-y-1",t),position:a,ref:i,...o,children:[(0,ol.jsx)(yd,{}),(0,ol.jsx)(Re.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,ol.jsx)(wd,{})]})}));et.displayName=Re.Content.displayName;var qp=po.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Re.Label,{className:g("py-1.5 ol-8 pr-2 text-sm font-semibold",e),ref:a,...t}));qp.displayName=Re.Label.displayName;var we=po.forwardRef(({children:e,className:t,...a},o)=>(0,ol.jsxs)(Re.Item,{className:g("relative flex w-full cursor-default select-none items-center rounded py-1.5 ol-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,ol.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,ol.jsx)(Re.ItemIndicator,{children:(0,ol.jsx)(Nl.Check,{className:"h-4 w-4"})})}),(0,ol.jsx)(Re.ItemText,{children:e})]}));we.displayName=Re.Item.displayName;var Xp=po.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Re.Separator,{className:g("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Xp.displayName=Re.Separator.displayName;var Ar=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:d=!1})=>{let[n,m]=(0,tr.useState)(!1),[s,c]=(0,tr.useState)(""),l=o.find(p=>p.value===t),u=o.filter(p=>p.label.toLowerCase().includes(s.toLowerCase())),v=p=>{a(p),m(!1),c("")},h=()=>{r&&s.trim()&&!o.find(p=>p.value===s.trim())&&(a(s.trim()),m(!1),c(""))};return(0,ol.jsxs)("div",{className:"space-y-1",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:e}),(0,ol.jsxs)(nt,{value:t,onValueChange:v,open:n,onOpenChange:p=>{d||m(p)},disabled:d,children:[(0,ol.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-El",children:(0,ol.jsx)(se,{variant:"secondary",className:`${d?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!d&&m(!n),children:l?.label||t||"Select..."})}),(0,ol.jsxs)(et,{children:[(0,ol.jsx)("div",{className:"p-2",children:(0,ol.jsx)(V,{placeholder:i,value:s,onChange:p=>c(p.target.value),onKeyDown:p=>{p.key==="Enter"&&r&&h()},className:"mb-2"})}),u.map(p=>(0,ol.jsx)(we,{value:p.value,children:p.label},p.value)),r&&s.trim()&&!u.find(p=>p.value===s.trim())&&(0,ol.jsxs)(we,{value:s.trim(),children:['Add "',s.trim(),'"']})]})]})]})};function Zo({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:d}){let[n,m]=(0,tr.useState)(!1),s=u=>{switch(u){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},c=u=>{switch(u){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},l=u=>{if(!u)return"Never";let h=Math.floor((new Date().getTime()-u.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,ol.jsxs)(W,{className:g("hover:shadow-El transition-shadow",r&&"p-2",d),children:[(0,ol.jsx)(_e,{className:g("pb-3",r&&"pb-2"),children:(0,ol.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ol.jsx)("div",{className:"relative",children:(0,ol.jsxs)(aa,{className:g("h-12 w-12",r&&"h-8 w-8"),children:[(0,ol.jsx)(xo,{src:"/placeholder.svg",alt:e.name||"name"}),(0,ol.jsx)(oa,{children:e.name?.split(" ").map(u=>u[0]).join("")})]})}),(0,ol.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)("h3",{className:g("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,ol.jsx)(Nl.Bot,{className:g("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,ol.jsx)(Nl.User,{className:g("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,ol.jsx)("p",{className:g("text-sm text-muted-foreground truncate",r&&"text-xs")}),!r&&(0,ol.jsx)("div",{className:"flex items-center gap-2 ol-1"})]})]}),i&&(0,ol.jsxs)(Ea,{children:[(0,ol.jsx)(Ba,{asChild:!0,children:(0,ol.jsx)(b,{variant:"ghost",size:"icon",className:g("h-8 w-8",r&&"h-6 w-6"),children:(0,ol.jsx)(Nl.MoreHorizontal,{className:g("h-4 w-4",r&&"h-3 w-3")})})}),(0,ol.jsxs)(wa,{align:"end",children:[e.type==="digital"&&(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsxs)(Xt,{onClick:()=>o?.(e),children:[(0,ol.jsx)(Nl.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,ol.jsxs)(Xt,{onClick:()=>t?.(e),children:[(0,ol.jsx)(Nl.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,ol.jsxs)(Xt,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,ol.jsx)(Nl.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,ol.jsxs)(fe,{className:"ol-0",children:[(0,ol.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,ol.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,ol.jsx)(Nl.Mail,{className:"h-3 w-3"}),(0,ol.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="digital"&&(0,ol.jsx)("div",{className:"flex items-center gap-2 text-muted-foreground",children:(0,ol.jsx)("span",{children:e.description})})]}),e.type==="digital"&&(0,ol.jsx)("div",{className:"ol-3",children:(0,ol.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,n?e.capabilities.length:2).map(u=>(0,ol.jsx)(se,{variant:"outline",className:"text-xs",children:typeof u.value=="number"?u.value:u.value.name},typeof u.value=="number"?u.value:u.value.name)),(e.capabilities?.length||0)>2&&(0,ol.jsx)(b,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>m(!n),children:n?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}var Cd=ae(require("react")),je=Cd.forwardRef(({className:e,...t},a)=>(0,ol.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}));je.displayName="Textarea";function Ir({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:d=!1}){let[n,m]=(0,tr.useState)(""),[s,c]=(0,tr.useState)([]),[l,u]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{if(!n.trim()){c([]),u(!1);return}let p=a.filter(k=>{if(e.map(R=>R.id).includes(k.id))return!1;let N=n.toLowerCase();return k.title.toLowerCase().includes(N)||k.description?.toLowerCase().includes(N)||k.tags?.some(R=>R.toLowerCase().includes(N))||Object.values(k.metadata||{}).some(R=>String(R).toLowerCase().includes(N))});c(p),u(!0)},[n,e,a]);let v=p=>{r&&e.length>=r&&e.pop(),t([...e,p]),m(""),u(!1)},h=p=>{console.log("doc",p,e),t(e.filter(k=>k.id!==p))},y=!r||e.length<r;return(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:o}),(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)(Nl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ol.jsx)(V,{value:n,onChange:p=>m(p.target.value),placeholder:y?i:`Maximum ${r} documents selected`,className:"ol-9",disabled:d||!y,onFocus:()=>n&&u(!0)})]}),l&&s.length>0&&(0,ol.jsx)(W,{className:"absolute top-full left-0 right-0 z-10 ol-1 max-h-60",children:(0,ol.jsx)(La,{className:"h-full",children:(0,ol.jsx)(fe,{className:"p-2",children:s.map(p=>(0,ol.jsx)(b,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>v(p),disabled:d,children:(0,ol.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,ol.jsx)(Nl.FileText,{className:"h-4 w-4 ol-0.5 text-muted-foreground flex-shrink-0"}),(0,ol.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,ol.jsx)("div",{className:"font-medium text-sm truncate",children:p.title}),p.description&&(0,ol.jsx)("div",{className:"text-xs text-muted-foreground ol-1 line-clamp-2",children:p.description}),p.tags&&p.tags.length>0&&(0,ol.jsxs)("div",{className:"flex flex-wrap gap-1 ol-2",children:[p.tags.slice(0,3).map(k=>(0,ol.jsx)(se,{variant:"outline",className:"text-xs",children:k},k)),p.tags.length>3&&(0,ol.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",p.tags.length-3," more"]})]})]})]})},p.id))})})}),l&&n&&s.length===0&&(0,ol.jsx)(W,{className:"absolute top-full left-0 right-0 z-10 ol-1",children:(0,ol.jsxs)(fe,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',n,'"']})})]}),e.length>0&&(0,ol.jsx)("div",{className:"space-y-2",children:(0,ol.jsx)("div",{className:"space-y-2",children:e.map(p=>(0,ol.jsx)(W,{className:"p-3",children:(0,ol.jsxs)("div",{className:"flex items-start gap-3",children:[(0,ol.jsx)(Nl.FileText,{className:"h-4 w-4 ol-0.5 text-muted-foreground flex-shrink-0"}),(0,ol.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ol.jsx)("div",{className:"font-medium text-sm",children:p.title}),p.description&&(0,ol.jsx)("div",{className:"text-xs text-muted-foreground ol-1",children:p.description}),p.tags&&p.tags.length>0&&(0,ol.jsx)("div",{className:"flex flex-wrap gap-1 ol-2",children:p.tags.map(k=>(0,ol.jsxs)(se,{variant:"outline",className:"text-xs",children:[(0,ol.jsx)(Nl.Tag,{className:"h-3 w-3 mr-1"}),k]},k))})]}),(0,ol.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(p.id),disabled:d,children:(0,ol.jsx)(Nl.ol,{className:"h-3 w-3"})})]})},p.id))})}),l&&(0,ol.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>u(!1)})]})}function Ei({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:d="Cancel",readOnly:n=!1,availableKnowledgeDocuments:m=[]}){let[s,c]=(0,tr.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,coreKnowledge:null,...e}),[l,u]=(0,tr.useState)(""),[v,h]=(0,tr.useState)(""),[y,p]=(0,tr.useState)(!n);(0,tr.useEffect)(()=>{e&&c(e)},[e]);let k=w=>{w.preventDefault();let B={id:s.id||parseInt(Date.now().toString()),name:s.name,type:"digital",description:s.description,jobDescription:s.jobDescription||"",workInstructions:s.workInstructions||"",capabilities:s.capabilities||[],capabilityLevel:s.capabilityLevel||0,coreKnowledge:s.coreKnowledge||null};t(B)},S=(w,B,z)=>{if(!B.trim())return;let F=s[w]||[];c({...s,[w]:[...F,B.trim()]}),z("")},N=(w,B)=>{let z=s[w]||[];c({...s,[w]:z.filter((F,T)=>T!==B)})},R=w=>{w.preventDefault(),p(!y)},q=(w,B,z,F,T)=>{let Me=s[w]||[];return(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:B}),y&&(0,ol.jsxs)("div",{className:"flex gap-2",children:[(0,ol.jsx)(V,{value:z,onChange:P=>F(P.target.value),placeholder:T,onKeyPress:P=>{P.key==="Enter"&&(P.preventDefault(),S(w,z,F))},disabled:o}),(0,ol.jsx)(b,{type:"button",variant:"outline",size:"icon",onClick:()=>S(w,z,F),disabled:o,children:(0,ol.jsx)(Nl.Plus,{className:"h-4 w-4"})})]}),(0,ol.jsx)("div",{className:"flex flex-wrap gap-2",children:Me.map((P,I)=>(0,ol.jsxs)(se,{className:"gap-1",children:[P,y&&(0,ol.jsx)(b,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>N(w,I),disabled:o,children:(0,ol.jsx)(Nl.ol,{className:"h-3 w-3"})})]},`${w}-${I}-${P}`))})]})},D=i||(y?e?"Edit Colleague":"Add New Colleague":"View Colleague"),A=r||(e?"Update Colleague":"Add Colleague");return(0,ol.jsxs)(W,{className:"m-8 w-full max-w-4xl mx-auto overflow-y-scroll ol-scrollbar",children:[(0,ol.jsx)(_e,{children:(0,ol.jsxs)(Ye,{className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.Bot,{className:"h-5 w-5"}),D]})}),(0,ol.jsx)(fe,{children:(0,ol.jsxs)("form",{onSubmit:k,className:"space-y-6",children:[(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,ol.jsx)(V,{id:"name",value:s.name||"",onChange:w=>c({...s,name:w.target.value}),required:!0,disabled:o||!y})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"description",children:"Description"}),(0,ol.jsx)(je,{id:"description",value:s.description||"",onChange:w=>c({...s,description:w.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!y})]})]}),(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"jobDescription",children:"Job Description *"}),(0,ol.jsx)(je,{id:"jobDescription",value:s.jobDescription||"",onChange:w=>c({...s,jobDescription:w.target.value}),rows:4,required:s.type==="digital",disabled:o||!y})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,ol.jsx)(je,{id:"workInstructions",value:s.workInstructions||"",onChange:w=>c({...s,workInstructions:w.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!y})]}),q("capabilities","Capabilities",v,h,"Add capability"),(0,ol.jsx)(Ir,{selectedDocuments:s.coreKnowledge?[{id:s.coreKnowledge?.id?.toString(),title:s.coreKnowledge?.name,format:"markdown",content:s.coreKnowledge?.content||"",createdAt:new Date(s.coreKnowledge?.createdAt),description:s.coreKnowledge?.description||"",metadata:s.coreKnowledge?.metadata||{},updatedAt:new Date(s.coreKnowledge?.updatedAt)}]:[],onDocumentsChange:w=>{let B={createdAt:w[0]?.createdAt.toISOString(),id:parseInt(w[0]?.id),name:w[0]?.title,source:"payload",updatedAt:(w[0]?.updatedAt||new Date).toISOString()};console.log(w),c({...s,coreKnowledge:w&&w.length>0?B:void 0})},label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:1,disabled:o||!y,availableDocuments:m.map(w=>({id:w.id.toString(),title:w.name,name:w.name,format:"markdown",content:w.content||"",createdAt:new Date(w.createdAt),source:w.source,description:w.description||"",metadata:w.metadata||{},updatedAt:new Date(w.updatedAt)}))})]}),(0,ol.jsxs)("div",{className:"flex justify-end gap-2 ol-4 border-t",children:[(0,ol.jsx)(b,{type:"button",variant:"outline",onClick:a,disabled:o,children:y?d:"Close"}),y?(0,ol.jsx)(b,{type:"submit",disabled:o,children:o?"Saving...":A}):(0,ol.jsxs)(b,{type:"button",onClick:R,disabled:o,className:"gap-2",children:[(0,ol.jsx)(Nl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Mr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,ol.jsx)("div",{className:"px-2 El:px-4 py-4 space-y-6",children:(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ol.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,ol.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ol.jsx)(Nl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,ol.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,ol.jsxs)("div",{className:"grid gap-6 El:grid-cols-2 max-w-4xl mx-auto",children:[(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ol.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,ol.jsxs)(_e,{className:"text-center pb-4",children:[(0,ol.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,ol.jsx)(Nl.User,{className:"h-8 w-8 text-blue-600"})}),(0,ol.jsx)(Ye,{className:"text-Nl",children:"Add Human Colleague"})]}),(0,ol.jsxs)(fe,{className:"text-center",children:[(0,ol.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add tr team members."}),(0,ol.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.Users,{className:"h-4 w-4 text-blue-600"}),(0,ol.jsx)("span",{children:"Browse existing users"})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.User,{className:"h-4 w-4 text-blue-600"}),(0,ol.jsx)("span",{children:"Import user details automatically"})]})]}),(0,ol.jsx)(b,{className:"ol-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ol.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,ol.jsxs)(_e,{className:"text-center pb-4",children:[(0,ol.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,ol.jsx)(Nl.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,ol.jsx)(Ye,{className:"text-Nl",children:"Add Digital Colleague"})]}),(0,ol.jsxs)(fe,{className:"text-center",children:[(0,ol.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone lo existing digital colleague or create a new AI assistant for your team."}),(0,ol.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.Bot,{className:"h-4 w-4 text-purple-600"}),(0,ol.jsx)("span",{children:"Clone existing colleagues"})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.Users,{className:"h-4 w-4 text-purple-600"}),(0,ol.jsx)("span",{children:"Create from templates"})]})]}),(0,ol.jsx)(b,{className:"ol-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Er({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,tr.useState)(""),[d,n]=(0,tr.useState)("all"),m=(0,tr.useMemo)(()=>e.filter(l=>l.name.toLowerCase().includes(i.toLowerCase())||l.jobDescription?.toLowerCase().includes(i.toLowerCase())||l.workInstructions?.toLowerCase().includes(i.toLowerCase())),[e,i,d]),s=l=>{let u={...l,name:`${l.name} (Copy)`};t(u)},c=l=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(l);return(0,ol.jsx)("div",{className:"px-2 El:px-4 py-4 space-y-6",children:(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ol.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,ol.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ol.jsx)(Nl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,ol.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,ol.jsx)(W,{children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsxs)("div",{className:"flex flex-col El:flex-row gap-4",children:[(0,ol.jsx)("div",{className:"flex-1",children:(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)(Nl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ol.jsx)(V,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:l=>r(l.target.value),className:"ol-9"})]})}),(0,ol.jsxs)("select",{value:d,onChange:l=>n(l.target.value),className:"h-10 px-3 rounded-El border border-input bg-background text-sm ring-offset-background",children:[(0,ol.jsx)("option",{value:"all",children:"All Status"}),(0,ol.jsx)("option",{value:"active",children:"Active"}),(0,ol.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,ol.jsx)("div",{className:"grid gap-4 El:grid-cols-2 lg:grid-cols-3",children:m.map(l=>(0,ol.jsx)(lo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,ol.jsxs)(W,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===l.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>s(l),children:[(0,ol.jsx)(_e,{className:"pb-3",children:(0,ol.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ol.jsx)(aa,{children:(0,ol.jsx)(oa,{className:"bg-blue-100",children:(0,ol.jsx)(Nl.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,ol.jsx)("div",{children:(0,ol.jsx)(Ye,{className:"text-lg flex items-center gap-2",children:l.name})})]}),(0,ol.jsxs)(b,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:u=>{u.stopPropagation(),s(l)},children:[(0,ol.jsx)(Nl.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,ol.jsx)(fe,{className:"ol-0",children:(0,ol.jsxs)("div",{className:"space-y-3",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,ol.jsx)("p",{className:"text-sm line-clamp-2",children:l.jobDescription})]}),l.capabilities&&l.capabilities.length>0&&(0,ol.jsxs)("div",{children:[(0,ol.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,ol.jsx)("div",{className:"flex flex-wrap gap-1",children:l.capabilities.length>3&&(0,ol.jsxs)(se,{variant:"outline",className:"text-xs",children:["+",l.capabilities.length-3]})})]}),(0,ol.jsx)("div",{className:"flex items-center justify-between text-xs text-muted-foreground"}),l.workInstructions&&(0,ol.jsxs)("div",{children:[(0,ol.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,ol.jsx)("p",{className:"text-xs line-clamp-2",children:l.workInstructions})]})]})})]})},l.id))}),m.length===0&&(0,ol.jsx)(W,{children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsxs)("div",{className:"text-center py-8",children:[(0,ol.jsx)(Nl.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,ol.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,ol.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function Br({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,ol.jsx)("div",{className:"px-2 El:px-4 py-4 space-y-6",children:(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ol.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,ol.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ol.jsx)(Nl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,ol.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,ol.jsxs)("div",{className:"grid gap-6 El:grid-cols-2 max-w-4xl mx-auto",children:[(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ol.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,ol.jsxs)(_e,{className:"text-center pb-4",children:[(0,ol.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,ol.jsx)(Nl.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,ol.jsx)(Ye,{className:"text-Nl",children:"Clone Existing"})]}),(0,ol.jsxs)(fe,{className:"text-center",children:[(0,ol.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with lo existing digital colleague and customize it for your needs."}),(0,ol.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.Bot,{className:"h-4 w-4 text-blue-600"}),(0,ol.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.Copy,{className:"h-4 w-4 text-blue-600"}),(0,ol.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,ol.jsx)(b,{className:"ol-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,ol.jsxs)(W,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,ol.jsxs)(_e,{className:"text-center pb-4",children:[(0,ol.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,ol.jsx)(Nl.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,ol.jsx)(Ye,{className:"text-Nl",children:"Create New"})]}),(0,ol.jsxs)(fe,{className:"text-center",children:[(0,ol.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,ol.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.Plus,{className:"h-4 w-4 text-green-600"}),(0,ol.jsx)("span",{children:"Custom job description"})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,ol.jsx)(Nl.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,ol.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,ol.jsx)(b,{className:"ol-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Dd=ae(require("react")),Fi=ae(require("@radix-ui/react-switch"));var ai=Dd.forwardRef(({className:e,...t},a)=>(0,ol.jsx)(Fi.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,ol.jsx)(Fi.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-ol-5 data-[state=unchecked]:translate-ol-0")})}));ai.displayName=Fi.Root.displayName;function Fr({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:d="Cancel",readOnly:n=!1}){let[m,s]=(0,tr.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[c,l]=(0,tr.useState)(!n);(0,tr.useEffect)(()=>{e&&s(e)},[e]);let u=async p=>{p.preventDefault();let k={id:m.id||Date.now(),name:m.name,description:m.description||null,systemMsg:m.systemMsg||null,useProjects:m.useProjects||!1,useKnowledge:m.useKnowledge||!1,useFiles:m.useFiles||!1,useChat:m.useChat||!1,updatedAt:new Date().toISOString(),createdAt:m.createdAt||new Date().toISOString()};await t(k)},v=p=>{p.preventDefault(),l(!c)},h=i||(c?e?"Edit Team":"Create New Team":"View Team"),y=r||(e?"Update Team":"Create Team");return(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.Users,{className:"h-5 w-5"}),h]}),(0,ol.jsxs)("form",{onSubmit:u,className:"space-y-6",children:[(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"name",children:"Team Name *"}),(0,ol.jsx)(V,{id:"name",value:m.name||"",onChange:p=>s({...m,name:p.target.value}),required:!0,disabled:o||!c,placeholder:"Enter team name..."})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"description",children:"Description"}),(0,ol.jsx)(je,{id:"description",value:m.description||"",onChange:p=>s({...m,description:p.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!c})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"systemMsg",children:"Ways of working"}),(0,ol.jsx)(je,{id:"systemMsg",value:m.systemMsg||"",onChange:p=>s({...m,systemMsg:p.target.value}),rows:3,placeholder:"Describe how this team works in tr much detail tr possible. Include processes, tools, systems, styles...",disabled:o||!c})]})]}),(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,ol.jsxs)("div",{className:"grid grid-cols-1 El:grid-cols-2 gap-4",children:[(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)(ai,{id:"useProjects",checked:m.useProjects||!1,onCheckedChange:p=>s({...m,useProjects:p}),disabled:o||!c}),(0,ol.jsx)(E,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)(ai,{id:"useKnowledge",checked:m.useKnowledge||!1,onCheckedChange:p=>s({...m,useKnowledge:p}),disabled:o||!c}),(0,ol.jsx)(E,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)(ai,{id:"useFiles",checked:m.useFiles||!1,onCheckedChange:p=>s({...m,useFiles:p}),disabled:o||!c}),(0,ol.jsx)(E,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)(ai,{id:"useChat",checked:m.useChat||!1,onCheckedChange:p=>s({...m,useChat:p}),disabled:o||!c}),(0,ol.jsx)(E,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,ol.jsxs)("div",{className:"flex justify-end gap-2 ol-4 border-t",children:[(0,ol.jsx)(b,{type:"button",variant:"outline",onClick:a,disabled:o,children:c?d:"Close"}),c?(0,ol.jsx)(b,{type:"submit",disabled:o||!m.name?.trim(),children:o?"Saving...":y}):(0,ol.jsxs)(b,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,ol.jsx)(Nl.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var Or=require("react-icons/Nl");function vt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:d,className:n}){let[m,s]=hr(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),c=!i&&!t||m;return(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${n||""}`,children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,ol.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-Nl",children:a}),(0,ol.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[c&&o&&(0,ol.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,ol.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>s(!m),style:{lineHeight:0},children:m?(0,ol.jsx)(Or.FaChevronDown,{size:22}):(0,ol.jsx)(Or.FaChevronUp,{size:22})})]})]}),!c&&(0,ol.jsxs)("div",{className:"flex flex-col gap-6 El:flex-row El:items-center El:justify-between",children:[(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,ol.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,ol.jsx)(b,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,ol.jsx)(b,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),d&&(0,ol.jsx)("div",{className:"hidden lg:block",children:d})]})]})}var Td=ae(require("react")),Hi=ae(require("@radix-ui/react-progress"));var ji=Td.forwardRef(({className:e,value:t,...a},o)=>(0,ol.jsx)(Hi.Root,{ref:o,className:g("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,ol.jsx)(Hi.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ji.displayName=Hi.Root.displayName;function rs({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:i}){return(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:i,children:(0,ol.jsxs)(W,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,ol.jsx)(_e,{className:"pb-2",children:(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,ol.jsx)(se,{className:"rounded-Nl bg-amber-500",children:"New"}):(0,ol.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,ol.jsx)(Nl.Star,{className:"h-4 w-4"})})]})}),(0,ol.jsxs)(fe,{className:"pb-2",children:[(0,ol.jsx)(Ye,{className:"text-lg",children:e.name}),(0,ol.jsx)(Ha,{children:e.description}),o&&e.progress<100&&(0,ol.jsxs)("div",{className:"ol-2",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,ol.jsx)("span",{children:"Installation"}),(0,ol.jsxs)("span",{children:[e.progress,"%"]})]}),(0,ol.jsx)(ji,{value:e.progress,className:"h-2 ol-1 rounded-Nl"})]})]}),(0,ol.jsx)(Co,{children:(0,ol.jsx)(b,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}var Yp=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 oi({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,ol.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,ol.jsxs)("div",{className:"bg-muted/50 p-3 hidden El:grid El:grid-cols-10 text-sm font-medium",children:[(0,ol.jsx)("div",{className:"col-span-6",children:"Name"}),(0,ol.jsx)("div",{className:"col-span-2",children:"Size"}),(0,ol.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,ol.jsx)("div",{className:"divide-y",children:e.map(d=>(0,ol.jsxs)(lo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 El:grid El:grid-cols-10 items-center flex flex-col El:flex-row gap-3 El:gap-0 cursor-pointer",onClick:()=>t?.(d),children:[(0,ol.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full El:w-auto",children:[(0,ol.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,ol.jsx)("div",{children:(0,ol.jsx)("p",{className:"font-medium",children:d.name})})]}),(0,ol.jsx)("div",{className:"col-span-2 text-sm El:text-base",children:Yp(d.filesize)}),(0,ol.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full El:w-auto",children:[(0,ol.jsx)("span",{className:"text-sm El:text-base",children:new Date(d.createdAt).toLocaleDateString()}),(0,ol.jsx)("div",{className:"flex gap-1",children:(0,ol.jsx)(b,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-Nl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(d)},children:(0,ol.jsx)(Nl.Trash2,{className:"h-4 w-4"})})})]})]},d.name))})]})}function Hr({project:e,onOpen:t,onShare:a,className:o}){return(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,ol.jsxs)(W,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,ol.jsxs)(_e,{children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)(Ye,{children:e.name}),(0,ol.jsxs)(se,{variant:"outline",className:"rounded-Nl",children:["Due ",e.dueDate]})]}),(0,ol.jsx)(Ha,{children:e.description})]}),(0,ol.jsxs)(fe,{className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,ol.jsx)("span",{children:"Progress"}),(0,ol.jsxs)("span",{children:[e.progress,"%"]})]}),(0,ol.jsx)(ji,{value:e.progress,className:"h-2 rounded-Nl"})]}),(0,ol.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,ol.jsxs)("div",{className:"flex items-center",children:[(0,ol.jsx)(Nl.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,ol.jsxs)("div",{className:"flex items-center",children:[(0,ol.jsx)(Nl.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,ol.jsxs)(Co,{className:"flex gap-2",children:[(0,ol.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,ol.jsx)(b,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,ol.jsx)(Nl.Share2,{className:"h-4 w-4"})})]})]})})}var ns=[{name:"PixelMaster",icon:(0,ol.jsx)(Nl.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,ol.jsx)(Nl.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,ol.jsx)(Nl.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,ol.jsx)(Nl.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,ol.jsx)(Nl.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,ol.jsx)(Nl.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,ol.jsx)(Nl.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,ol.jsx)(Nl.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,ol.jsx)(Nl.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,ol.jsx)(Nl.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,ol.jsx)(Nl.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,ol.jsx)(Nl.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Ed=[{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 Bd=[{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 Fd=[{id:"home",title:"Home",icon:(0,ol.jsx)(Nl.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,ol.jsx)(Nl.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,ol.jsx)(Nl.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,ol.jsx)(Nl.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,ol.jsx)(Nl.FileText,{}),url:"/knowledge"}],Od=[{id:"1",title:"New comment Nl your post",description:"Alex Morgan commented Nl 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 ol 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'ol 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 Nl 'Advanced Animation Techniques' ol now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var ni=[{id:1,name:"E-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var ss=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],jr=[{id:1,name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],Vr=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],Zp=[...Vr,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems Nl mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],Qp=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],zr={projects:[{id:"1",name:"Empty Project",description:"A project with ol 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:[]},Ld={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:Vr.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var Ob={empty:{initialProjects:zr.projects,initialEpics:zr.epics,initialSprints:zr.sprints,initialTasks:zr.tasks},default:{initialProjects:ni,initialEpics:ss,initialSprints:jr,initialTasks:Vr},highDensity:{initialProjects:ni,initialEpics:ss,initialSprints:jr,initialTasks:Zp},singleEpic:{initialProjects:ni,initialEpics:Ld.epics,initialSprints:jr,initialTasks:Ld.tasks},multipleProjects:{initialProjects:Qp,initialEpics:ss,initialSprints:jr,initialTasks:Vr}},Ur=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],Hb=[{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).toString(),dueTime:"14:30",assignedColleague:Ur.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:ni[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:Ur.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:ni[0]},{id:3,title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:Ur.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:ni[0]}];var jb=Ur.filter(e=>e.type==="digital");function Hd({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,tr.useState)(""),d=(0,tr.useMemo)(()=>e.filter(m=>m.name?.toLowerCase().includes(i.toLowerCase())||m.email.toLowerCase().includes(i.toLowerCase())),[e,i]),n=m=>{t(m)};return(0,ol.jsx)("div",{className:"px-2 El:px-4 py-4 space-y-6",children:(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ol.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,ol.jsxs)(b,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,ol.jsx)(Nl.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,ol.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add tr a colleague"})]})]}),(0,ol.jsx)(W,{className:"container",children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsx)("div",{className:"flex flex-col El:flex-row gap-4",children:(0,ol.jsx)("div",{className:"flex-1",children:(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)(Nl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ol.jsx)(V,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:m=>r(m.target.value),className:"ol-9"})]})})})})}),(0,ol.jsx)("div",{className:"container grid gap-4 El:grid-cols-2 lg:grid-cols-3",children:d.map(m=>(0,ol.jsx)(lo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,ol.jsxs)(W,{className:`cursor-pointer transition-all hover:shadow-lg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>n(m),children:[(0,ol.jsx)(_e,{className:"pb-3",children:(0,ol.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ol.jsx)(aa,{children:(0,ol.jsx)(oa,{children:(0,ol.jsx)(Nl.User,{className:"h-4 w-4"})})}),(0,ol.jsx)("div",{children:(0,ol.jsx)(Ye,{className:"text-lg",children:m.name})})]}),o===m.id&&(0,ol.jsx)(Nl.Check,{className:"h-5 w-5 text-primary"})]})}),(0,ol.jsx)(fe,{className:"ol-0",children:(0,ol.jsxs)("div",{className:"space-y-3",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,ol.jsx)("p",{className:"text-sm font-medium",children:m.email})]}),(0,ol.jsx)("div",{children:(0,ol.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},m.id))}),d.length===0&&(0,ol.jsx)(W,{className:"container ol-4",children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsxs)("div",{className:"text-center py-8",children:[(0,ol.jsx)(Nl.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,ol.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,ol.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ls(...e){return er((0,al.clsx)(e))}function Ui({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:d,availableUsers:n=[],existingDigitalColleagues:m=[],availableKnowledgeDocuments:s=[]}){let[c,l]=(0,tr.useState)(e||[]),[u,v]=(0,tr.useState)(""),[h,y]=(0,tr.useState)("all"),[p,k]=(0,tr.useState)("all"),[S,N]=(0,tr.useState)("all"),[R,q]=(0,tr.useState)(null),[D,A]=(0,tr.useState)(null);(0,tr.useEffect)(()=>{l(e||[])},[e]);let w=Array.isArray(n)?n:[],B=Array.isArray(m)?m:[],[z,F]=(0,tr.useState)("main"),T=c.filter(O=>!O||!O.name?!1:O.name.toLowerCase().includes(u.toLowerCase())||O.type==="human"&&O.email?.toLowerCase().includes(u.toLowerCase())||O.type==="digital"&&O.jobDescription?.toLowerCase().includes(u.toLowerCase())),Me=T.filter(O=>O.type==="human"),P=T.filter(O=>O.type==="digital"),I=()=>{F("typeSelection")},_=O=>{O.type==="digital"&&(q(O),F("form")),console.log("Editing colleague:",O),a?.(O)},Te=O=>{O.type==="digital"&&(A(O),F("view"))},$e=O=>{let gt={id:`human-${Date.now()}`,type:"human",name:O.name,email:O.email,updatedAt:O.updatedAt,createdAt:O.createdAt,accounts:O.accounts};l(da=>[...da,gt]),t?.(gt),F("main")},ut=O=>{if(!O||!O.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",O);return}l(gt=>[...gt,{...O,type:"digital"}]),t?.({...O,type:"digital"}),F("main")},qt=()=>{q(null),F("form")},H=O=>{if(!O||!O.id){console.error("Invalid colleague provided to handleSaveColleague:",O);return}R?(l(gt=>gt.map(da=>da.id===O.id?{...O,type:"digital"}:da)),a?.({...O,type:"digital"})):(l(gt=>[...gt,{...O,type:"digital"}]),t?.({...O,type:"digital"})),F("main"),q(null)},Ie=()=>{F("main"),q(null),A(null)},Xe=()=>{F("main"),A(null)},ea=()=>{D&&(q(D),A(null),F("form"))},Fe=O=>{console.log("deleting",O,c),o?.(O,c.find(gt=>gt.id.toString()===O.toString())?.type),l(gt=>gt.filter(da=>da.id!==O))},Kt=()=>{v(""),y("all"),k("all")};return z==="typeSelection"?(0,ol.jsx)(Mr,{onSelectHuman:()=>F("userSelection"),onSelectDigital:()=>F("digitalOptions"),onCancel:()=>F("main")}):z==="userSelection"?(0,ol.jsx)(Hd,{users:w,onUserSelect:$e,onCancel:()=>F("typeSelection")}):z==="digitalOptions"?(0,ol.jsx)(Br,{onCloneExisting:()=>F("digitalClone"),onCreateNew:qt,onCancel:()=>F("typeSelection")}):z==="digitalClone"?(0,ol.jsx)(Er,{digitalColleagues:B,onColleagueClone:ut,onCancel:()=>F("digitalOptions")}):z==="form"?(0,ol.jsx)(Ei,{colleague:R||void 0,onSave:H,onCancel:Ie,availableKnowledgeDocuments:s}):z==="view"?(0,ol.jsx)(Ei,{colleague:D||void 0,onSave:H,onCancel:Xe,readOnly:!0,availableKnowledgeDocuments:s}):(0,ol.jsx)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsx)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ol.jsxs)("div",{className:`space-y-6 ${d||""}`,children:[(0,ol.jsx)(vt,{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:I}}),(0,ol.jsxs)("div",{className:"grid grid-cols-1 El:grid-cols-3 gap-4",children:[(0,ol.jsxs)(W,{children:[(0,ol.jsxs)(_e,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,ol.jsx)(Ye,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,ol.jsx)(Nl.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,ol.jsxs)(fe,{children:[(0,ol.jsx)("div",{className:"text-2xl font-bold",children:c.length}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]}),(0,ol.jsxs)(W,{children:[(0,ol.jsxs)(_e,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,ol.jsx)(Ye,{className:"text-sm font-medium",children:"Human Members"}),(0,ol.jsx)(Nl.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,ol.jsxs)(fe,{children:[(0,ol.jsx)("div",{className:"text-2xl font-bold",children:c.filter(O=>O.type==="human").length}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"})]})]}),(0,ol.jsxs)(W,{children:[(0,ol.jsxs)(_e,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,ol.jsx)(Ye,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,ol.jsx)(Nl.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,ol.jsxs)(fe,{children:[(0,ol.jsx)("div",{className:"text-2xl font-bold",children:c.filter(O=>O.type==="digital").length}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:"0 active"})]})]})]}),(0,ol.jsx)(W,{children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsxs)("div",{className:"flex flex-col El:flex-row gap-4",children:[(0,ol.jsx)("div",{className:"flex-1",children:(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)(Nl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ol.jsx)(V,{placeholder:"Search colleagues...",value:u,onChange:O=>v(O.target.value),className:"ol-9"})]})}),(0,ol.jsxs)(nt,{value:h,onValueChange:y,children:[(0,ol.jsx)(Qe,{className:"w-full El:w-[180px]",children:(0,ol.jsx)(wt,{placeholder:"Department"})}),(0,ol.jsxs)(et,{children:[(0,ol.jsx)(we,{value:"all",children:"All Departments"}),r.map(O=>(0,ol.jsx)(we,{value:O,children:O},O))]})]}),(0,ol.jsxs)(nt,{value:p,onValueChange:k,children:[(0,ol.jsx)(Qe,{className:"w-full El:w-[140px]",children:(0,ol.jsx)(wt,{placeholder:"Status"})}),(0,ol.jsxs)(et,{children:[(0,ol.jsx)(we,{value:"all",children:"All Status"}),(0,ol.jsx)(we,{value:"active",children:"Active"}),(0,ol.jsx)(we,{value:"inactive",children:"Inactive"})]})]}),(u||h!=="all"||p!=="all")&&(0,ol.jsxs)(b,{variant:"outline",onClick:Kt,className:"gap-2",children:[(0,ol.jsx)(Nl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsx)(Wo,{activeTab:S,onTabChange:N,tabOptions:[{value:"all",label:`All (${T.length})`},{value:"human",label:`Human (${Me.length})`},{value:"digital",label:`Digital (${P.length})`}],maxWidth:"400px",gridCols:3}),S==="all"&&(0,ol.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 El:grid-cols-2 lg:grid-cols-4":"grid-cols-1 El:grid-cols-2 lg:grid-cols-3"}`,children:T.map(O=>(0,ol.jsx)(Zo,{colleague:O,onEdit:_,onDelete:Fe,onViewDetails:Te,compact:i,className:ls([O.type==="digital"&&"border-teal-400"])},`${O}-${O.id}`))}),S==="human"&&(0,ol.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 El:grid-cols-2 lg:grid-cols-4":"grid-cols-1 El:grid-cols-2 lg:grid-cols-3"}`,children:Me.map(O=>(0,ol.jsx)(Zo,{colleague:O,onEdit:_,onDelete:Fe,onViewDetails:Te,compact:i},O.id))}),S==="digital"&&(0,ol.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 El:grid-cols-2 lg:grid-cols-4":"grid-cols-1 El:grid-cols-2 lg:grid-cols-3"}`,children:P.map(O=>(0,ol.jsx)(Zo,{colleague:O,onEdit:_,onDelete:Fe,onViewDetails:Te,compact:i,className:ls([O.type==="digital"&&"border-teal-400"])},O.id))})]}),T.length===0&&(0,ol.jsx)(W,{children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsxs)("div",{className:"text-center py-8",children:[(0,ol.jsx)(Nl.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,ol.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,ol.jsx)("p",{className:"text-muted-foreground mb-4",children:u||h!=="all"||p!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,ol.jsxs)(b,{onClick:I,className:"gap-2",children:[(0,ol.jsx)(Nl.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}var Cc=ae(require("@radix-ui/react-dialog"));var si=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:d=!1})=>{let[n,m]=(0,tr.useState)(!1),[s,c]=(0,tr.useState)(""),l=()=>{d||(m(!0),c(t))},u=async()=>{s!==t&&await i(e,s),m(!1)},v=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?u():h.key==="Escape"&&(m(!1),c(""))};return(0,ol.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,ol.jsx)(E,{children:a}),n?o?(0,ol.jsx)(je,{value:s,onChange:h=>c(h.target.value),onBlur:u,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,ol.jsx)(V,{value:s,onChange:h=>c(h.target.value),onBlur:u,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,ol.jsxs)("div",{onClick:l,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,ol.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!d&&(0,ol.jsx)(Nl.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var pc=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),uc=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),gc=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),fc=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),vc=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),hc=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),bc=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Wr=require("@payloadcms/richtext-lexical/lexical/list"),xc=require("@payloadcms/richtext-lexical/lexical/rich-text"),yc=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var cc=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),$i=require("@payloadcms/richtext-lexical/lexical/utils"),Ne=require("@payloadcms/richtext-lexical/lexical"),xs=require("@payloadcms/richtext-lexical/lexical/selection");var Xd=require("@radix-ui/react-dialog"),$r=require("@payloadcms/richtext-lexical/client");var cs=ae(require("bson-objectid"));var Ud=require("@payloadcms/ui");var eu=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[i]=(0,cc.useLexicalComposerContext)(),[r,d]=(0,tr.useState)(""),[n,m]=(0,tr.useState)(""),[s,c]=(0,tr.useState)(""),l=async p=>{console.log("fetchMedia",p)};(0,tr.useEffect)(()=>{typeof a=="string"?a.length===24?l(a):(d(a||""),c(y(h())),m(v()||"")):typeof a=="object"&&(d(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),c(y(a.filesize)),m(a.mimeType?.split("/")[1]||""))},[]);let u=(0,tr.useCallback)(()=>{i.update(()=>{(0,Ne.$getNodeByKey)(o)?.remove()})},[i,o]),v=()=>{let p=e.data.value;return typeof p=="string"?p.split(";base64")[0]?.split("image/")[1]:""},h=()=>{let p=e.data.value;if(typeof p=="string"){let k=p.split(",")[1]?.length||0;return 4*Math.ceil(k/3)*.5624896334383812/1e3}return 0};function y(p){if(p>=1e6){let S=p/1e6;return`${S>=10?Math.round(S).toString():S.toFixed(1)} MB`}return`${Math.floor(p/1e3)} KB`}return(0,ol.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,ol.jsxs)("div",{className:"border border-slate-800 rounded-Nl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,ol.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,ol.jsx)("div",{className:"flex-1",children:e.data.value?(0,ol.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-to":t,src:r}):(0,ol.jsx)(Ud.File,{})}),(0,ol.jsx)(Aa,{children:(0,ol.jsxs)(Ia,{children:[(0,ol.jsxs)(Ma,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,ol.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,ol.jsx)("button",{onClick:p=>{p.preventDefault(),u()},className:"flex-1 flex justify-center items-center",children:(0,ol.jsx)(Nl.ol,{width:24,height:24,strokeWidth:1})})]}),(0,ol.jsx)(ya,{children:(0,ol.jsx)("span",{children:"Remove image"})})]})})]}),(0,ol.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,ol.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,ol.jsx)("span",{children:s})]})]})})},$d=eu;function tu(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:li({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var Vi=class extends $r.UploadNode{static importDOM(){return{img:()=>({conversion:tu,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new cs.default().toHexString(),t.version=3);let a={id:t.id??new cs.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=li(a);return o.setFormat?.(t.format),o}decorate(){return(0,ol.jsx)($d,{data:this.__data,nodeKey:this.getKey()})}};function li(e){return new Vi({data:e})}var au=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ou=e=>au?(e||window).getSelection():null,Tx=(0,Ne.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),ms=(0,Ne.createCommand)("INSERT_UPLOAD_COMMAND");function Yd({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,tr.useRef)(!1),[i,r]=(0,tr.useState)(!0),[d,n]=(0,tr.useState)(""),[m,s]=(0,tr.useState)(""),[c,l]=(0,tr.useState)(!1),[u,v]=(0,tr.useState)("left"),h=d==="",y=R=>{l(R.target.checked)},p=R=>{v(R.target.value)},k=R=>{let q=new FileReader;q.onload=function(){return typeof q.result=="string"&&n(q.result),""},R!==null&&R[0]&&q.readAsDataURL(R[0])};(0,tr.useEffect)(()=>{o.current=!1;let R=q=>{o.current=q.altKey};return document.addEventListener("keydown",R),()=>{document.removeEventListener("keydown",R)}},[e]),(0,tr.useEffect)(()=>{i||t()},[i]),(0,tr.useEffect)(()=>{r(a)},[a]);let S=({editor:R,relationTo:q,replaceNodeKey:D,value:A})=>{if(D)R.update(()=>{let w=(0,Ne.$getNodeByKey)(D);w&&w.replace(li({id:"",fields:{},relationTo:"media",value:A}))});else{let w=R.dispatchCommand(ms,{fields:null,relationTo:"media",value:A})}},N=()=>{S({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:d,showCaption:c,position:u}.src}),r(!1),t()};return(0,ol.jsx)(Ve,{open:i,onOpenChange:R=>r(R),children:(0,ol.jsxs)(Ge,{children:[(0,ol.jsxs)(We,{children:[(0,ol.jsx)(Je,{children:"Upload Image"}),(0,ol.jsx)(Xd.DialogDescription,{children:"Description"})]}),(0,ol.jsxs)("div",{className:"",children:[(0,ol.jsx)("div",{style:{marginBottom:"1em"},children:(0,ol.jsx)(V,{type:"file",onChange:R=>k(R.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,ol.jsx)("div",{style:{marginBottom:"1em"},children:(0,ol.jsx)(V,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:R=>s(R.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,ol.jsx)(b,{"data-test-id":"image-modal-file-upload-btn",disabled:h,onClick:()=>N(),children:"Confirm"})]})]})})}function ps({captionsEnabled:e}){let[t]=(0,cc.useLexicalComposerContext)();return(0,tr.useEffect)(()=>{if(!t.hasNodes([$r.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered Nl editor");return(0,$i.mergeRegister)(t.registerCommand(Ne.DRAGSTART_COMMAND,a=>iu(a),Ne.COMMAND_PRIORITY_HIGH),t.registerCommand(Ne.DRAGOVER_COMMAND,a=>ru(a),Ne.COMMAND_PRIORITY_LOW),t.registerCommand(Ne.DROP_COMMAND,a=>nu(a,t),Ne.COMMAND_PRIORITY_HIGH))},[e,t]),null}function iu(e){if(!us())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","_"),!0):!1}function ru(e){return us()?(Zd(e)||e.preventDefault(),!0):!1}function nu(e,t){let a=us();if(!a)return!1;if(e.preventDefault(),Zd(e)){let o=su(e);a.remove();let i=(0,Ne.$createRangeSelection)();o!=null&&i.applyDOMRange(o),(0,Ne.$setSelection)(i)}return!0}function us(){let e=(0,Ne.$getSelection)();if(!(0,Ne.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,$r.$isUploadNode)(a)?a:null}function Zd(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function su(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,i=ou(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var lu=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),Qd=lu;var du=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),ec=du;var cu=()=>(0,ol.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,ol.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,ol.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),tc=cu;var mu=()=>(0,ol.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,ol.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,ol.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),ac=mu;var pu=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),oc=pu;var uu=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),ic=uu;var rc=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),nc=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),sc=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),lc=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),dc=()=>(0,ol.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,ol.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var bs=1;function gu(){return(0,ol.jsx)("span",{className:"border border-[#222222]"})}function ys(){let[e]=(0,cc.useLexicalComposerContext)(),t=(0,tr.useRef)(null),[a,o]=(0,tr.useState)(!1),[i,r]=(0,tr.useState)(!1),[d,n]=(0,tr.useState)(!1),[m,s]=(0,tr.useState)(!1),[c,l]=(0,tr.useState)(!1),[u,v]=(0,tr.useState)(!1),[h,y]=(0,tr.useState)(!1),[p,k]=(0,tr.useState)(!1),[S,N]=(0,tr.useState)(!1),[R,q]=(0,tr.useState)("left"),[D,A]=(0,tr.useState)("p"),w=I=>{e.update(()=>{let _=(0,Ne.$getSelection)();(0,Ne.$isRangeSelection)(_)&&(I==="p"?(0,xs.$setBlocksType)(_,()=>(0,Ne.$createParagraphNode)()):(0,xs.$setBlocksType)(_,()=>(0,xc.$createHeadingNode)(I)))})},B=(0,tr.useCallback)(()=>{let I=(0,Ne.$getSelection)();if((0,Ne.$isRangeSelection)(I)){n(I.hasFormat("bold")),s(I.hasFormat("italic")),l(I.hasFormat("underline")),v(I.hasFormat("strikethrough")),y(I.hasFormat("subscript")),k(I.hasFormat("superscript"));let _=I.anchor.getNode(),Te=_;for(;Te&&!(0,Ne.$isParagraphNode)(Te)&&Te!==(0,Ne.$getRoot)();){let ut=Te.getParent();ut&&(Te=ut)}if(Te){let ut=Te.getFormatType();q(ut||"left")}let $e=_.getTopLevelElement()?.__tag;A($e||"p")}},[]);(0,tr.useEffect)(()=>(0,$i.mergeRegister)(e.registerUpdateListener(({editorState:I})=>{I.read(()=>{B()})}),e.registerCommand(Ne.SELECTION_CHANGE_COMMAND,(I,_)=>(B(),!1),bs),e.registerCommand(Ne.CAN_UNDO_COMMAND,I=>(o(I),!1),bs),e.registerCommand(Ne.CAN_REDO_COMMAND,I=>(r(I),!1),bs),(0,$i.mergeRegister)(e.registerCommand(ms,I=>(e.update(()=>{let _=(0,Ne.$getSelection)()||(0,Ne.$getPreviousSelection)();if((0,Ne.$isRangeSelection)(_)){let Te=li({id:I.id,fields:I.fields,relationTo:I.relationTo,value:I.value}),{focus:$e}=_,ut=$e.getNode();(0,$i.$insertNodeToNearestRoot)(Te),(0,Ne.$isParagraphNode)(ut)&&!ut.__first&&ut.remove()}}),!0),Ne.COMMAND_PRIORITY_EDITOR))),[e,B]);let z=[[{label:"Undo",icon:(0,ol.jsx)(Nl.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ne.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,ol.jsx)(Nl.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ne.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,ol.jsx)(Qd,{}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:d},{label:"Italic",icon:(0,ol.jsx)(ec,{}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,ol.jsx)(tc,{}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:c},{label:"Strikethrough",icon:(0,ol.jsx)(ac,{}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:u},{label:"Subscript",icon:(0,ol.jsx)(oc,{}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:h},{label:"Superscript",icon:(0,ol.jsx)(ic,{}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:p}]],F=[{label:"Left Align",direction:"left",icon:(0,ol.jsx)(Nl.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,ol.jsx)(Nl.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,ol.jsx)(Nl.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,ol.jsx)(Nl.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Ne.FORMAT_ELEMENT_COMMAND,"justify")}}],Me=[{label:"Normal Text",value:"p",icon:(0,ol.jsx)(rc,{}),onClick:()=>w("p")},{label:"Heading 1",value:"h1",icon:(0,ol.jsx)(nc,{}),onClick:()=>w("h1")},{label:"Heading 2",value:"h2",icon:(0,ol.jsx)(sc,{}),onClick:()=>w("h2")},{label:"Heading 3",value:"h3",icon:(0,ol.jsx)(lc,{}),onClick:()=>w("h3")},{label:"Heading 4",value:"h4",icon:(0,ol.jsx)(dc,{}),onClick:()=>w("h4")},...[{label:"Unordered List",value:"ul",icon:(0,ol.jsx)(Nl.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Wr.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,ol.jsx)(Nl.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Wr.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],P=[{label:"Insert Image",icon:(0,ol.jsx)(Nl.ImageUp,{width:15,height:15}),onClick:()=>{N(!0)},disabled:!1}];return(0,ol.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2",children:(0,ol.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[z.map((I,_)=>(0,ol.jsxs)(tr.Fragment,{children:[(0,ol.jsx)("div",{className:"flex items-center gap-2",children:I.map((Te,$e)=>(0,ol.jsx)("div",{role:"button","aria-disabled":Te.disabled||!1,onClick:Te.onClick,className:g("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",Te.active&&"bg-[#3c3c3c]"),"aria-label":Te.label,children:(0,ol.jsx)(Aa,{children:(0,ol.jsxs)(Ia,{children:[(0,ol.jsx)(Ma,{className:"text-[#b5b5b5]",children:Te.icon}),(0,ol.jsx)(ya,{children:(0,ol.jsx)("p",{children:Te.label})})]})})},$e))}),(0,ol.jsx)(gu,{})]},`toolbar-option-${I.length}-${_}`)),(0,ol.jsxs)(Ea,{children:[(0,ol.jsxs)(Ba,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[F.find(I=>I.direction===R)?.icon,F.find(I=>I.direction===R)?.label,(0,ol.jsx)(Nl.ChevronDown,{width:15,height:15})]}),(0,ol.jsx)(wa,{className:"bg-black hover:bg-black",children:F.map((I,_)=>(0,ol.jsxs)(Xt,{onClick:I.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,ol.jsx)("span",{children:I.icon}),(0,ol.jsx)("span",{children:I.label})]},`${I.label}-${_}`))})]}),(0,ol.jsxs)(Ea,{children:[(0,ol.jsxs)(Ba,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[Me.find(I=>I.value===D)?.icon,Me.find(I=>I.value===D)?.label,(0,ol.jsx)(Nl.ChevronDown,{width:15,height:15})]}),(0,ol.jsx)(wa,{className:"bg-black hover:bg-black",children:Me.map((I,_)=>(0,ol.jsxs)(Xt,{onClick:I.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,ol.jsx)("span",{children:I.icon}),(0,ol.jsx)("span",{children:I.label})]},`heading-option-${I.label}-${_}`))})]}),(0,ol.jsxs)(Ea,{children:[(0,ol.jsxs)(Ba,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,ol.jsx)(Nl.Plus,{width:15,height:15}),(0,ol.jsx)(Nl.ChevronDown,{width:15,height:15})]}),(0,ol.jsx)(wa,{className:"bg-black hover:bg-black",children:P.map((I,_)=>(0,ol.jsxs)(Xt,{onClick:I.onClick,disabled:I.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,ol.jsx)("span",{children:I.icon}),(0,ol.jsx)("span",{children:I.label})]},_))})]}),S&&(0,ol.jsx)(Yd,{activeEditor:e,onClose:()=>{N(!1)},isOpen:S})]})})}var fu=({setValue:e,value:t,name:a,editable:o=!0})=>{let[i]=(0,cc.useLexicalComposerContext)(),r=d=>{d.read(()=>{let n=d.toJSON();e?.(()=>n)})};return(0,tr.useEffect)(()=>{i.setEditable(o)},[o]),(0,tr.useEffect)(()=>{t&&i.update(()=>{i.setEditorState(i.parseEditorState(t))})},[]),(0,ol.jsx)("div",{className:"w-full",children:(0,ol.jsxs)("div",{className:" ",children:[o&&(0,ol.jsx)(ys,{}),(0,ol.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,ol.jsx)(hc.RichTextPlugin,{contentEditable:(0,ol.jsx)(gc.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:fc.LexicalErrorBoundary}),o&&(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(vc.HistoryPlugin,{}),(0,ol.jsx)(pc.AutoFocusPlugin,{}),(0,ol.jsx)(bc.ListPlugin,{}),(0,ol.jsx)(yc.OnChangePlugin,{onChange:r}),(0,ol.jsx)(ps,{})]})]})]})})},vu=({setValue:e,value:t,name:a,editable:o=!0})=>(0,ol.jsx)(uc.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Wr.ListNode,Wr.ListItemNode,xc.HeadingNode,Vi],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,ol.jsx)(fu,{value:t,setValue:e,name:a,editable:o})}),Jr=vu;function qr({document:e,onSave:t,mode:a="edit",onCancel:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[d,n]=(0,tr.useState)({...e,updatedAt:new Date}),[m,s]=(0,tr.useState)(!1),[c,l]=(0,tr.useState)(d.richTextContent);(0,tr.useEffect)(()=>{n(e)},[e]);let u=D=>{switch(D){case"markdown":case"mdx":return(0,ol.jsx)(Nl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,ol.jsx)(Nl.File,{className:"h-6 w-6 text-success"});case"text":return(0,ol.jsx)(Nl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,ol.jsx)(Nl.File,{className:"h-6 w-6 text-muted-foreground"})}},v=D=>{switch(D){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"}},h=()=>{let D=new Set,A=new Set;return r.forEach(w=>{w.menuConfig.groupBy.forEach(B=>D.add(B))}),i.forEach(w=>{w.metadata&&Object.keys(w.metadata).forEach(B=>A.add(B))}),{contextKeys:Array.from(D).sort(),documentKeys:Array.from(A).sort(),allKeys:Array.from(new Set([...D,...A])).sort()}},y=D=>{let A=new Set;return i.forEach(w=>{w.metadata?.[D]&&A.add(String(w.metadata[D]))}),Array.from(A).sort()},p=h(),k=()=>{t({...d,richTextContent:c})},S=(D,A)=>{n(w=>({...w,metadata:{...w.metadata,[D]:A}}))},N=(D,A)=>{A==="__custom__"?S(D,""):S(D,A)},R=()=>{S("","")},q=D=>{n(A=>{let w={...A.metadata};return delete w[D],{...A,metadata:w}})};return(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,ol.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,ol.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,ol.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,ol.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ol.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,ol.jsx)("div",{className:"flex-1 min-w-0",children:(0,ol.jsx)(si,{fieldName:"title",value:d.title,label:"",onSave:(D,A)=>n(w=>({...w,title:A})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,ol.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${v(d.format)} flex-shrink-0 ol-1`,children:d.format.toUpperCase()})]}),(0,ol.jsx)("div",{className:"ol-2",children:(0,ol.jsx)(si,{fieldName:"description",value:d.description||"Click to add description...",label:"",multiline:!0,onSave:(D,A)=>n(w=>({...w,description:A})),className:"[&>div:last-child]:text-muted-foreground [&>div:last-child]:text-lg [&>div:last-child]:leading-relaxed [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})})]})}),(0,ol.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,ol.jsxs)(b,{variant:"ghost",size:"sm",onClick:()=>s(!m),className:"gap-2",children:[(0,ol.jsx)(Nl.Info,{className:"h-4 w-4"}),"Metadata",d.metadata&&Object.keys(d.metadata).length>0&&(0,ol.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:Object.keys(d.metadata).length}),m?(0,ol.jsx)(Nl.ChevronDown,{className:"h-4 w-4"}):(0,ol.jsx)(Nl.ChevronRight,{className:"h-4 w-4"})]}),(0,ol.jsxs)(b,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"}),"Cancel"]}),(0,ol.jsxs)(b,{size:"sm",onClick:k,className:"gap-2",children:[(0,ol.jsx)(Nl.Save,{className:"h-4 w-4"}),"Save"]})]})]}),(0,ol.jsx)(lo.motion.div,{initial:!1,animate:{height:m?"auto":0,opacity:m?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden h-full max-h-full",children:(0,ol.jsxs)("div",{className:"ol-4 border-t border-border ol-4 h-screen max-h-full flex",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ol.jsxs)("h3",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[(0,ol.jsx)(Nl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,ol.jsxs)(b,{type:"button",variant:"outline",size:"sm",onClick:R,className:"gap-1 h-8",children:[(0,ol.jsx)(Nl.Plus,{className:"h-3 w-3"}),"Add Field"]})]}),(0,ol.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:d.metadata&&Object.keys(d.metadata).length>0?(0,ol.jsx)("div",{className:"space-y-2",children:Object.entries(d.metadata).map(([D,A],w)=>{let B=y(D);return(0,ol.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,ol.jsx)(V,{value:D,onChange:z=>{let F=z.target.value||"",T=d.metadata?.[D];n(Me=>{let P={...Me.metadata};return delete P[D],F&&(P[F]=T||""),{...Me,metadata:P}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${D}`}),(0,ol.jsx)("datalist",{id:`metadata-keys-${D}`,children:p.allKeys.map(z=>(0,ol.jsx)("option",{value:z},z))}),(0,ol.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),B.length>0?(0,ol.jsxs)(nt,{value:String(A||""),onValueChange:z=>N(D,z),children:[(0,ol.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,ol.jsx)(wt,{placeholder:"Value"})}),(0,ol.jsxs)(et,{children:[B.map(z=>(0,ol.jsx)(we,{value:z,children:z},z)),(0,ol.jsx)(we,{value:"__custom__",children:(0,ol.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,ol.jsx)(V,{value:String(A||""),onChange:z=>S(D,z.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,ol.jsx)(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>q(D),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,ol.jsx)(Nl.ol,{className:"h-3 w-3"})})]},`metadata-key-${w}`)})}):(0,ol.jsxs)("div",{className:"text-center py-4",children:[(0,ol.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"No metadata fields"}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:'Click "Add Field" to create metadata'})]})})]})})]}),(0,ol.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,ol.jsx)("div",{className:"p-8 h-full max-h-full overflow-auto",children:d.format==="richText"?(0,ol.jsx)(Jr,{setValue:l,value:c,name:"richTextContent"}):(0,ol.jsx)(je,{value:d.content||"",onChange:D=>n(A=>({...A,content:D.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})]})}var Sc=ae(require("react-markdown")),Dc=ae(require("remark-gfm"));var kc=e=>(0,ol.jsx)(Sc.default,{remarkPlugins:[Dc.default],components:{h1:({children:t})=>(0,ol.jsx)("h1",{className:"text-2xl font-bold",children:t}),h2:({children:t})=>(0,ol.jsx)("h2",{className:"text-Nl font-bold",children:t}),h3:({children:t})=>(0,ol.jsx)("h3",{className:"text-lg font-bold",children:t}),h4:({children:t})=>(0,ol.jsx)("h4",{className:"text-base font-bold",children:t}),ol:({children:t})=>(0,ol.jsx)("ol",{className:"list-decimal",children:t}),ul:({children:t})=>(0,ol.jsx)("ul",{className:"list-disc",children:t}),li:({children:t})=>(0,ol.jsx)("li",{className:"ml-4",children:t}),p:({children:t})=>(0,ol.jsx)("p",{className:"mb-4",children:t}),a:({children:t,href:a})=>(0,ol.jsx)("a",{href:a,className:"text-blue-500",children:t}),img:({src:t,alt:a})=>(0,ol.jsx)("img",{src:t,alt:a,className:"mb-4"}),blockquote:({children:t})=>(0,ol.jsx)("blockquote",{className:"border-l-4 border-gray-300 ol-4 mb-4",children:t})},children:e}),Nc=e=>(0,ol.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),hu=e=>(0,ol.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:e&&(0,ol.jsx)(Jr,{value:JSON.stringify(e),editable:!1,name:"richTextContent"},JSON.stringify(e))}),bu=e=>(0,ol.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,ol.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,ol.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,ol.jsx)("strong",{children:"MDX Renderer:"})," This ol a placeholder. Integrate with @mdx-tr/react for full MDX rendering."]})}),kc(e)]});function Xr({document:e,onDocumentUpdate:t,editable:a=!0,mode:o="view",renderers:i,availableDocuments:r=[],knowledgeContexts:d=[]}){let[n,m]=(0,tr.useState)(!1),[s,c]=(0,tr.useState)(!1),[l,u]=(0,tr.useState)(e),[v,h]=(0,tr.useState)(!1),y=(0,tr.useRef)(null),p=l.format==="richText"?l.richTextContent:l.content,k=(0,tr.useMemo)(()=>`${l.format}:${JSON.stringify(p)}`,[l.format,p]);(0,tr.useEffect)(()=>{u(e)},[e]);let S=w=>{switch(w){case"markdown":case"mdx":return(0,ol.jsx)(Nl.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,ol.jsx)(Nl.File,{className:"h-6 w-6 text-success"});case"text":return(0,ol.jsx)(Nl.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,ol.jsx)(Nl.File,{className:"h-6 w-6 text-muted-foreground"})}},N=w=>{switch(w){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},R=(w,B)=>{let z={markdown:kc,mdx:bu,text:Nc},F=i?.[B]||z[B];if(B==="richText"&&typeof w=="object")return hu(w);if(F&&typeof w=="string")return F(w);if(typeof w=="string")return Nc(w)},q=async w=>{h(!0),y.current=l,(0,tr.startTransition)(()=>{u({...w,richTextContent:w.richTextContent?structuredClone(w.richTextContent):void 0})});try{let B=await t?.(w);if(h(!1),!B)throw new Error("save failed");m(!1)}catch{y.current&&(0,tr.startTransition)(()=>u(y.current))}},D=()=>{m(!1)};return(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(Ve,{open:n||o==="create",onOpenChange:w=>!w&&D(),children:(0,ol.jsxs)(dr,{children:[(0,ol.jsx)(ki,{}),(0,ol.jsxs)(Cc.Content,{className:g("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[v&&(0,ol.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center",children:(0,ol.jsx)(Nl.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),(0,ol.jsx)(qr,{mode:o==="create"?"create":"edit",document:l,onSave:q,onCancel:D,availableDocuments:r,knowledgeContexts:d})]})]})}),(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,ol.jsxs)("div",{className:"border-b border-border bg-card p-8 pb-6",children:[(0,ol.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,ol.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,ol.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ol.jsxs)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:[l.title,(0,ol.jsx)("span",{className:`inline-flex ml-4 items-center px-3 py-1 rounded-full text-sm font-medium border ${N(l.format)}`,children:l.format.toUpperCase()})]}),l.description&&(0,ol.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed",children:l.description})]})}),(0,ol.jsxs)("div",{className:"items-center gap-2 flex-shrink-0 hidden lg:flex",children:[l.metadata&&Object.keys(l.metadata).length>0&&(0,ol.jsxs)(b,{variant:"ghost",size:"sm",onClick:()=>c(!s),className:"gap-2",children:[(0,ol.jsx)(Nl.Info,{className:"h-4 w-4"}),"Metadata",s?(0,ol.jsx)(Nl.ChevronDown,{className:"h-4 w-4"}):(0,ol.jsx)(Nl.ChevronRight,{className:"h-4 w-4"})]}),a&&(0,ol.jsxs)(b,{variant:"outline",size:"sm",onClick:()=>m(!0),className:"gap-2",children:[(0,ol.jsx)(Nl.Edit3,{className:"h-4 w-4"}),"Edit"]})]})]}),l.metadata&&Object.keys(l.metadata).length>0&&(0,ol.jsx)(lo.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,ol.jsxs)("div",{className:"ol-4 border-t border-border ol-4",children:[(0,ol.jsxs)("h3",{className:"text-sm font-semibold text-foreground mb-3 flex items-center gap-2",children:[(0,ol.jsx)(Nl.Info,{className:"h-4 w-4"}),"Document Metadata"]}),(0,ol.jsx)("div",{className:"bg-muted rounded-lg p-4 border border-border",children:(0,ol.jsx)("div",{className:"grid grid-cols-2 El:grid-cols-3 lg:grid-cols-4 gap-ol-6 gap-y-2 text-sm",children:Object.entries(l.metadata).map(([w,B])=>(0,ol.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ol.jsx)("span",{className:"text-muted-foreground font-medium text-xs uppercase tracking-wide",children:w.replace(/([A-ol])/g," $1").trim()}),(0,ol.jsx)("span",{className:"text-foreground font-medium",children:String(B)})]},w))})})]})})]}),(0,ol.jsx)("div",{className:"flex-1 ",children:(0,ol.jsx)("div",{className:"py-4 h-full",children:(0,ol.jsx)("div",{className:"space-y-4",children:l.content||l.richTextContent?(0,ol.jsx)("div",{className:"relative",children:(0,ol.jsx)("div",{className:"bg-background px-8 overflow-hidden h-full flex-1",children:R(l.format==="richText"?l.richTextContent:l.content,l.format)})},k):(0,ol.jsxs)("div",{className:"text-center p-12 bg-muted rounded-Nl border-2 border-dashed border-border",children:[(0,ol.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,ol.jsx)(Nl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,ol.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,ol.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})})})]})]})}function Ss({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:d=!0}){let[n,m]=(0,tr.useState)(o===0),s=a&&Object.keys(a).length>0,c=t.length+(a?Object.values(a).reduce((v,h)=>v+h.documents.length,0):0),l=v=>{switch(v){case"markdown":case"mdx":return(0,ol.jsx)(Nl.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richText":return(0,ol.jsx)(Nl.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,ol.jsx)(Nl.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},u=v=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[v%h.length]};return(0,ol.jsxs)("div",{className:"space-y-1",children:[(s||t.length>0)&&(0,ol.jsxs)(lo.motion.div,{className:`group flex items-center gap-3 p-3 rounded-Nl cursor-pointer transition-all duration-200 ${n?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>m(!n),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,ol.jsx)("div",{className:`w-1 h-6 rounded-full ${u(o)}`}),(0,ol.jsx)(lo.motion.div,{animate:{rotate:n?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,ol.jsx)(Nl.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,ol.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,ol.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,ol.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),d&&c>0&&(0,ol.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,ol.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:c})})]})]}),(0,ol.jsx)(lo.motion.div,{initial:!1,animate:{height:n?"auto":0,opacity:n?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,ol.jsxs)("div",{className:"ol-2 space-y-1",children:[t.map((v,h)=>(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,ol:-10},animate:{opacity:1,ol: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 ${r===v.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-ol-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(v),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,ol.jsx)("div",{className:"flex-shrink-0",children:l(v.format)}),(0,ol.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ol.jsx)("p",{className:`text-sm truncate transition-colors ${r===v.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:v.title}),v.description&&(0,ol.jsx)("p",{className:"text-xs text-muted-foreground truncate ol-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,ol.jsx)("div",{className:"flex-shrink-0",children:(0,ol.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-El text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:v.tags[0]})})]},v.id)),a&&Object.entries(a).map(([v,h])=>(0,ol.jsx)(Ss,{label:v,documents:h.documents,children:h.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:d},v))]})})]})}function Yr({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:d,editable:n=!0}){let[m,s]=(0,tr.useState)(""),[c,l]=(0,tr.useState)(null),[u,v]=(0,tr.useState)(e);(0,tr.useEffect)(()=>{v(e)},[e]),(0,tr.useEffect)(()=>{if(c?.id){let k=u.find(S=>S.id===c.id);k&&l(k)}},[u]);let h=(0,tr.useMemo)(()=>m?u.filter(k=>k.title.toLowerCase().includes(m.toLowerCase())||k.description?.toLowerCase().includes(m.toLowerCase())||k.tags?.some(S=>S.toLowerCase().includes(m.toLowerCase()))||Object.values(k.metadata||{}).some(S=>String(S).toLowerCase().includes(m.toLowerCase()))):u,[u,m]),y=(0,tr.useMemo)(()=>{let k=(S,N)=>{if(N.length===0)return{};let[R,...q]=N;return S.reduce((A,w)=>{let B=w.metadata?.[R]||"Uncategorized",z=String(B);if(A[z]||(A[z]={documents:[],children:{}}),q.length===0)A[z].documents.push(w);else{let F=k([w],q),T=Object.keys(F)[0];T&&(A[z].children||(A[z].children={}),A[z].children[T]?A[z].children[T].documents.push(...F[T].documents):A[z].children[T]=F[T])}return A},{})};return k(h,t.groupBy)},[h,t.groupBy]),p=k=>{l(k),a?.(k)};return(0,ol.jsxs)("div",{className:`flex h-full ${d||""}`,children:[(0,ol.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,ol.jsx)("div",{className:"p-6 border-b border-border",children:(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)("div",{className:"absolute inset-y-0 left-0 ol-3 flex items-center pointer-events-none",children:(0,ol.jsx)(Nl.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,ol.jsx)(V,{placeholder:"Search knowledge base...",value:m,onChange:k=>s(k.target.value),className:"ol-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-Nl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,ol.jsx)(La,{className:"h-[calc(100%-100px)]",children:(0,ol.jsx)("div",{className:"p-4 space-y-3",children:t.groupBy.length===0?(0,ol.jsx)(ol.Fragment,{children:(0,ol.jsx)(Ss,{label:"Document",documents:h,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},"Document")}):(0,ol.jsxs)(ol.Fragment,{children:[Object.entries(y).map(([k,S])=>(0,ol.jsx)(Ss,{label:k,documents:S.documents,children:S.children,level:0,onDocumentClick:p,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},k)),Object.keys(y).length===0&&(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,ol.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,ol.jsx)(Nl.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,ol.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,ol.jsx)("p",{className:"text-xs ol-1",children:"Try adjusting your search terms"})]})]})})})]}),(0,ol.jsx)("div",{className:"flex-1 bg-background overflow-scroll",children:c?(0,ol.jsx)(Xr,{document:c,onDocumentUpdate:i,editable:n}):(0,ol.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,ol.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,ol.jsx)(Nl.FileText,{className:"h-10 w-10 text-primary"})}),(0,ol.jsx)("h3",{className:"text-Nl font-semibold text-foreground mb-2",children:"Select a document"}),(0,ol.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}var Tc=ae(require("react")),Ds=ae(require("@radix-ui/react-toggle"));var ks=(0,bl.cva)("inline-flex items-center justify-center gap-2 rounded-El 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=Nl]:bg-accent data-[state=Nl]: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"}}),xu=Tc.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,ol.jsx)(Ds.Root,{ref:i,className:g(ks({variant:t,size:a,className:e})),...o}));xu.displayName=Ds.Root.displayName;var Ao=ae(require("react")),ci=ae(require("@radix-ui/react-toggle-group"));var Ac=Ao.createContext({size:"default",variant:"default"}),Io=Ao.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,ol.jsx)(ci.Root,{ref:r,className:g("flex items-center justify-center gap-1",e),...i,children:(0,ol.jsx)(Ac.Provider,{value:{variant:t,size:a},children:o})}));Io.displayName=ci.Root.displayName;var Mo=Ao.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let d=Ao.useContext(Ac);return(0,ol.jsx)(ci.Item,{ref:r,className:g(ks({variant:d.variant||a,size:d.size||o}),e),...i,children:t})});Mo.displayName=ci.Item.displayName;var Ic=ae(require("react")),ja=ae(require("@radix-ui/react-popover"));var Ps=ja.Root,Rs=ja.Trigger;var Qr=Ic.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,ol.jsx)(ja.Portal,{children:(0,ol.jsx)(ja.Content,{ref:i,align:t,sideOffset:a,className:g("z-50 w-72 rounded-El border bg-popover p-4 text-popover-foreground shadow-El 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})}));Qr.displayName=ja.Content.displayName;var Mc=require("react-day-picker");function en({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,ol.jsx)(Mc.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:g("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-ol-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center ol-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-ol-1 flex items-center",nav_button:g(yi({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-El w-8 font-normal text-[0.8rem]",row:"flex w-full ol-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-El",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-El [&:has(>.day-range-start)]:rounded-l-El first:[&:has([aria-selected])]:rounded-l-El last:[&:has([aria-selected])]:rounded-r-El":"[&:has([aria-selected])]:rounded-El"),day:g(yi({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})}en.displayName="Calendar";var Lc=({isOpen:e,onClose:t,onAddKnowledge:a,knowledgeContexts:o})=>{let i=()=>{let y=new Set;return o.forEach(p=>{p.menuConfig.groupBy.forEach(k=>y.add(k))}),{contextKeys:Array.from(y).sort(),allKeys:Array.from(y).sort()}},[r,d]=(0,tr.useState)(()=>{let y=i();return{name:"",description:"",metadata:y.contextKeys.length>0?y.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}}),n=y=>{if(y.preventDefault(),!r.name)return;let p=r.metadata.filter(S=>S.key&&S.key.trim()&&S.value&&S.value.trim());a({name:r.name,description:r.description,metadata:p,source:"payload",visibility:"public",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});let k=i();d({name:"",description:"",metadata:k.contextKeys.length>0?k.contextKeys.map(S=>({key:S,value:""})):[{key:"",value:""}]}),t()},m=()=>{let y=i();d({name:"",description:"",metadata:y.contextKeys.length>0?y.contextKeys.map(p=>({key:p,value:""})):[{key:"",value:""}]}),t()},s=i(),c=y=>{let p=new Set;return Array.from(p).sort()},l=(y,p)=>{d(k=>{let S=k.metadata.find(N=>N.key===y);return S&&(S.value=p),{...k,metadata:[...k.metadata.filter(N=>N.key!==y),{key:y,value:p}]}})},u=(y,p)=>{p==="__custom__"?l(y,""):l(y,p)},v=()=>{l(" ","")},h=y=>{d(p=>{let k=[...p.metadata],S=k.findIndex(N=>N.key===y);return S!==-1&&k.splice(S,1),{...p,metadata:k}})};return(0,ol.jsx)(Ve,{open:e,onOpenChange:m,children:(0,ol.jsxs)(Ge,{className:"sm:max-w-El",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Add New Knowledge source"})}),(0,ol.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"name",children:"Name *"}),(0,ol.jsx)(V,{id:"name",value:r.name,onChange:y=>d(p=>({...p,name:y.target.value})),required:!0})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"name",children:"Description"}),(0,ol.jsx)(V,{id:"name",value:r.description,onChange:y=>d(p=>({...p,description:y.target.value})),required:!0})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"metadata",children:"Metadata"}),s.contextKeys.length>0?(0,ol.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Context keys: ",s.contextKeys.slice(0,4).join(", "),s.contextKeys.length>4&&` +${s.contextKeys.length-4} more`," ","\u2022 Fill in values or add more fields"]}):(0,ol.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add key-value metadata to organize and categorize your knowledge"})]}),(0,ol.jsxs)(b,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,ol.jsx)(Nl.Plus,{className:"h-3 w-3"}),"Add"]})]}),(0,ol.jsx)("div",{className:"space-y-2",children:r.metadata.map(({key:y,value:p},k)=>{let S=c(y);return(0,ol.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,ol.jsx)(V,{value:y,onChange:N=>{let R=N.target.value||" ",q=r.metadata.find(D=>D.key===y)?.value;d(D=>{let A=[...D.metadata],w=A.findIndex(B=>B.key===y);return w!==-1&&A.splice(w,1),R&&A.push({key:R,value:q||""}),{...D,metadata:A}}),N.target.focus()},placeholder:s.allKeys.length>0?`e.g., ${s.allKeys[0]}`:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${y}`}),(0,ol.jsx)("datalist",{id:`metadata-keys-${y}`,children:s.allKeys.map(N=>(0,ol.jsx)("option",{value:N},N))}),(0,ol.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),S.length>0?(0,ol.jsxs)(nt,{value:String(p||""),onValueChange:N=>u(y,N),children:[(0,ol.jsx)(Qe,{className:"flex-1 h-8 text-sm",children:(0,ol.jsx)(wt,{placeholder:"Value"})}),(0,ol.jsxs)(et,{children:[S.map(N=>(0,ol.jsx)(we,{value:N,children:N},N)),(0,ol.jsx)(we,{value:"__custom__",children:(0,ol.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,ol.jsx)(V,{value:String(p||""),onChange:N=>l(y,N.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,ol.jsx)(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(y),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,ol.jsx)(Nl.ol,{className:"h-3 w-3"})})]},`metadata-key-${k}`)})})]})]}),(0,ol.jsxs)("div",{className:"flex justify-end gap-3 ol-4",children:[(0,ol.jsxs)(b,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"}),"Cancel"]}),(0,ol.jsxs)(b,{type:"submit",children:[(0,ol.jsx)(Nl.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};var Fc=({isOpen:e,onClose:t,onAddTeamContext:a})=>{let[o,i]=(0,tr.useState)({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),[r,d]=(0,tr.useState)(""),n=l=>{l.preventDefault(),console.log("formData",o),o.label&&(a({id:o.label,label:o.label,description:o.description,menuConfig:{groupBy:o.groupBy,sortBy:o.sortBy||null,sortOrder:o.sortOrder,showDocumentCount:o.showDocumentCount}}),i({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}))},m=()=>{i({label:"",description:"",groupBy:[],sortBy:"name",sortOrder:"asc",showDocumentCount:!0}),t()},s=[{value:"name",label:"Name"},{value:"createdAt",label:"Created Date"}],c=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}];return(0,ol.jsx)(Ve,{open:e,onOpenChange:m,children:(0,ol.jsxs)(Ge,{className:"sm:max-w-El",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Add New Knowledge source"})}),(0,ol.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"label",children:"Label *"}),(0,ol.jsx)(V,{id:"label",value:o.label,onChange:l=>i(u=>({...u,label:l.target.value})),required:!0})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"description",children:"Description"}),(0,ol.jsx)(V,{id:"description",value:o.description,onChange:l=>i(u=>({...u,description:l.target.value}))})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{children:"Group By"}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)("div",{className:"flex flex-wrap gap-2",children:o.groupBy.map(l=>(0,ol.jsxs)(se,{variant:"secondary",className:"px-2 py-1",children:[l,(0,ol.jsx)("button",{type:"button",className:"ml-1 inline-flex",onClick:()=>{i(u=>({...u,groupBy:u.groupBy.filter(v=>v!==l)}))},"aria-label":`Remove ${l}`,children:(0,ol.jsx)(Nl.ol,{className:"h-3 w-3"})})]},l))}),(0,ol.jsxs)("div",{className:"flex gap-2",children:[(0,ol.jsx)(V,{placeholder:"Type a tag and press Enter",value:r,onChange:l=>d(l.target.value),onKeyDown:l=>{(l.key==="Enter"||l.key===",")&&(l.preventDefault(),i(u=>({...u,groupBy:[...u.groupBy,r]})),d(""))}}),(0,ol.jsx)(b,{type:"button",onClick:()=>{i(l=>({...l,groupBy:[...l.groupBy,r]})),d("")},children:"Add"})]})]})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"sortBy",children:"Sort By"}),(0,ol.jsxs)(nt,{value:o.sortBy,onValueChange:l=>i(u=>({...u,sortBy:l})),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{placeholder:"Select sort field"})}),(0,ol.jsx)(et,{children:s.map(l=>(0,ol.jsx)(we,{value:l.value,children:l.label},l.value))})]})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"sortOrder",children:"Sort Order"}),(0,ol.jsxs)(nt,{value:o.sortOrder,onValueChange:l=>i(u=>({...u,sortOrder:l})),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{placeholder:"Select sort order"})}),(0,ol.jsx)(et,{children:c.map(l=>(0,ol.jsx)(we,{value:l.value,children:l.label},l.value))})]})]}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)(yo,{id:"showDocumentCount",checked:o.showDocumentCount,onCheckedChange:l=>i(u=>({...u,showDocumentCount:l}))}),(0,ol.jsx)(E,{htmlFor:"showDocumentCount",className:"text-sm",children:"Show Document Count"})]})]}),(0,ol.jsxs)("div",{className:"flex justify-end gap-3 ol-4",children:[(0,ol.jsxs)(b,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"}),"Cancel"]}),(0,ol.jsxs)(b,{type:"submit",children:[(0,ol.jsx)(Nl.Save,{className:"h-4 w-4"}),"Create"]})]})]})]})})};function Wi({documents:e=[],contexts:t=[],onDocumentClick:a=s=>console.log("Document clicked:",s),onDocumentShare:o=s=>console.log("Share document:",s),onLoadDocumentContent:i,selectedDocumentId:r,onAddKnowledge:d,onAddTeamContext:n,onDocumentUpdate:m}){let[s,c]=(0,tr.useState)(t[0]),[l,u]=(0,tr.useState)(!1),[v,h]=(0,tr.useState)(!1),[y,p]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{!s&&t&&t.length>0&&c(t[0])},[t]);let k=N=>{d&&(p(!0),d(N)),u(!1)},S=N=>{n&&n(N),h(!1)};return(0,ol.jsxs)("div",{className:"flex flex-col h-full",children:[(0,ol.jsxs)("div",{className:"px-2 El:px-4 py-4 flex-shrink-0",children:[y&&(0,ol.jsxs)("div",{className:"absolute inset-0 bg-background/90 z-[9999] flex flex-col items-center justify-center gap-4",children:[(0,ol.jsx)(Nl.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,ol.jsx)("p",{className:"font-semibold text-lg",children:"Initializing document..."})]}),t&&t.length>0&&(0,ol.jsxs)("div",{className:"",children:[(0,ol.jsx)("div",{className:"",children:(0,ol.jsxs)("nav",{className:"-mb-px flex justify-between items-center",children:[(0,ol.jsx)("div",{className:"flex space-ol-8 overflow-ol-auto",children:t.map(N=>(0,ol.jsxs)("button",{onClick:()=>c(N),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${s?.id===N.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[N.icon,N.label]},N.id))}),(0,ol.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,ol.jsx)("button",{onClick:()=>u(!0),className:"inline-flex border border-primary rounded-Nl items-center py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Knowledge"}),(0,ol.jsx)("button",{onClick:()=>h(!0),className:"inline-flex border border-primary rounded-Nl items-center gap-2 py-2 px-3 text-sm font-medium text-primary hover:text-primary/80 transition-colors whitespace-nowrap",children:"Add Context"})]})]})}),s?.description&&(0,ol.jsx)("div",{className:"ol-3 px-1",children:(0,ol.jsx)("p",{className:"text-sm text-primary",children:s?.description})})]})]}),s?(0,ol.jsx)("div",{className:"flex-1 min-h-0 px-2 El:px-4 pb-4",children:(0,ol.jsx)("div",{className:"h-full rounded-Nl border overflow-hidden",children:(0,ol.jsx)(Yr,{documents:e,menuConfig:s?.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r,onDocumentUpdate:m})})}):(0,ol.jsxs)("div",{children:[(0,ol.jsx)("div",{className:"flex-1 min-h-0 px-2 El:px-4 pb-4 flex items-center justify-center",children:(0,ol.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})}),(0,ol.jsx)("div",{className:"flex-1 min-h-0 px-2 El:px-4 pb-4 flex items-center justify-center",children:(0,ol.jsx)(b,{onClick:()=>h(!0),children:"Add Context"})})]}),(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(Fc,{isOpen:v,onClose:()=>h(!1),onAddTeamContext:S}),(0,ol.jsx)(Lc,{isOpen:l,onClose:()=>u(!1),onAddKnowledge:k,knowledgeContexts:t})]})]})}function Ms({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:i,onCreateProject:r,onOpenProject:d,sidebarItems:n,initialColleagues:m,users:s,onColleagueAdd:c,onColleagueEdit:l,onColleagueDelete:u}){let[v,h]=(0,tr.useState)("home"),[y,p]=(0,tr.useState)(t[0]),k=T=>{console.log("Opening app:",T.name)},S=T=>{console.log("Favoriting app:",T.name)},N=T=>{console.log("Opening file:",T.name)},R=T=>{console.log("Sharing file:",T.name)},q=T=>{console.log("Opening project:",T.name),d(T)},D=T=>{console.log("Sharing project:",T.name)},A=T=>{p(T),console.log("Business unit changed to:",T.name)},w=()=>{console.log("Copilot clicked - navigating to chat"),h("chat")},B=T=>{console.log("Notification removed:",T)},z=()=>{console.log("All notifications removed")},F=()=>{switch(v){case"home":return(0,$.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,$.jsxs)("section",{className:"text-center py-12",children:[(0,$.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome to the ",y.name," team"]}),(0,$.jsx)("p",{className:"text-Nl text-muted-foreground mb-8",children:"This ol your collaborative workspace for productivity and knowledge sharing."})]}),(0,$.jsxs)("section",{className:"grid grid-cols-1 El:grid-cols-3 gap-6",children:[(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:i}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,$.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,$.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,$.jsx)(vt,{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,$.jsx)(Ui,{initialColleagues:m,availableUsers:s,onColleagueAdd:c,onColleagueEdit:l,onColleagueDelete:u});case"chat":return(0,$.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,$.jsxs)("section",{className:"text-center py-12",children:[(0,$.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,$.jsxs)("p",{className:"text-Nl text-muted-foreground mb-8",children:["Connect with your ",y.name," team members and collaborate in real-time."]})]}),(0,$.jsx)(vt,{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,$.jsxs)("div",{className:"space-y-8",children:[(0,$.jsx)(vt,{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,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 El:grid-cols-3 lg:grid-cols-4",children:ns.filter(T=>T.new).map(T=>(0,$.jsx)(rs,{app:T,showProgress:!0,onOpen:k,onFavorite:S},T.name))})]}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 El:grid-cols-3 lg:grid-cols-4",children:ns.map(T=>(0,$.jsx)(rs,{app:T,onOpen:k,onFavorite:S},T.name))})]})]});case"knowledge":return(0,$.jsx)(Wi,{});case"files":return(0,$.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,$.jsx)(vt,{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,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("div",{className:"flex items-center justify-between",children:(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,$.jsx)(oi,{files:Ed,onFileClick:N})]})]});case"projects":return(0,$.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,$.jsx)(vt,{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:r}}),(0,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-3 El:grid-cols-2 lg:grid-cols-3",children:a.map(T=>(0,$.jsx)(Hr,{project:T,onOpen:q,onShare:D},T.name))})]})]});case"learn":return(0,$.jsxs)("div",{className:"space-y-8",children:[(0,$.jsx)(vt,{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,$.jsxs)("section",{className:"space-y-4",children:[(0,$.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-6 El:grid-cols-2 lg:grid-cols-3",children:Bd.slice(0,3).map(T=>(0,$.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,$.jsx)("h3",{className:"font-semibold mb-2",children:T.title}),(0,$.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:T.description}),(0,$.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,$.jsx)("span",{children:T.duration}),(0,$.jsx)("span",{children:T.level})]})]},T.title))})]})]});default:return null}};return(0,$.jsx)(Nr,{sidebarItems:Fd,title:e,notifications:Od,businessUnits:t,currentBusinessUnit:y,onBusinessUnitChange:A,activeTab:v,onTabChange:h,showTabs:!0,onActionClick:w,actionIcon:(0,$.jsx)(Nl.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:B,onRemoveAll:z,children:(0,$.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,$.jsx)(lo.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:F()},v)})})}var jc=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,tr.useState)(null),[r,d]=(0,tr.useState)(""),[n,m]=(0,tr.useState)(""),[s,c]=(0,tr.useState)(""),l=v=>{let h=v.target.files?.[0];h&&(i(h),r||d(h.name))},u=async v=>{if(v.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",r),n&&h.append("description",n),s&&h.append("tags",s),a?.(h),t(),i(null),d(""),m(""),c("")};return(0,ol.jsx)(Ve,{open:e,onOpenChange:t,children:(0,ol.jsxs)(Ge,{className:"sm:max-w-El",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Add New File"})}),(0,ol.jsxs)("form",{onSubmit:u,className:"grid gap-4",children:[(0,ol.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,ol.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,ol.jsxs)("div",{className:"flex flex-col items-center justify-center ol-5 pb-6",children:[(0,ol.jsx)(yu,{className:"w-10 h-10 text-gray-400"}),(0,ol.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,ol.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,ol.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,ol.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:l})]})}),o&&(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)("p",{className:"font-medium",children:o.name}),(0,ol.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,ol.jsx)(b,{type:"submit",onClick:u,children:"Upload"})]})]})]})})};function yu(e){return(0,ol.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,ol.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,ol.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,ol.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function qi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:d}){let[n,m]=(0,tr.useState)(e),[s,c]=(0,tr.useState)(""),[l,u]=(0,tr.useState)("all"),[v,h]=(0,tr.useState)("all"),[y,p]=(0,tr.useState)(!1),k=(0,tr.useRef)(""),S=F=>F.map(T=>`${T.id}-${new Date(T.createdAt).getTime()}-${new Date(T.updatedAt).getTime()}`).join("-");(0,tr.useEffect)(()=>{let F=S(e);F!==k.current&&(m(e),k.current=F)},[e]);let N=n.filter(F=>F.name.toLowerCase().includes(s.toLowerCase())),R=N.slice(0,10),q=N.filter(Boolean),D=()=>{p(!0)},A=F=>{a?.(F)},w=F=>{console.log("deleting file",F),m(T=>T.filter(Me=>Me.name!==F.name)),o?.(F.id.toString())},B=F=>{i?.(F)},z=()=>{c(""),u("all")};return(0,ol.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsx)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ol.jsxs)("div",{className:`space-y-6 ${d||""}`,children:[(0,ol.jsx)(vt,{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:D},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,ol.jsx)(W,{children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsxs)("div",{className:"flex flex-col El:flex-row gap-4",children:[(0,ol.jsx)("div",{className:"flex-1",children:(0,ol.jsxs)("div",{className:"relative",children:[(0,ol.jsx)(Nl.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,ol.jsx)(V,{placeholder:"Search files...",value:s,onChange:F=>c(F.target.value),className:"ol-9"})]})}),(s||l!=="all")&&(0,ol.jsxs)(b,{variant:"outline",onClick:z,className:"gap-2",children:[(0,ol.jsx)(Nl.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsx)(Wo,{activeTab:v,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${N.length})`},{value:"recent",label:`Recent (${R.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,ol.jsx)(oi,{files:N,onFileClick:B,onFileEdit:A,onFileDelete:w,showHeader:!r}),v==="recent"&&(0,ol.jsx)(oi,{files:R,onFileClick:B,onFileEdit:A,onFileDelete:w,showHeader:!r}),v==="shared"&&(0,ol.jsx)(oi,{files:q,onFileClick:B,onFileEdit:A,onFileDelete:w,showHeader:!r})]}),N.length===0&&(0,ol.jsx)(W,{children:(0,ol.jsx)(fe,{className:"ol-6",children:(0,ol.jsxs)("div",{className:"text-center py-8",children:[(0,ol.jsx)(Nl.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,ol.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,ol.jsx)("p",{className:"text-muted-foreground mb-4",children:s||l!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,ol.jsxs)(b,{onClick:D,className:"gap-2",children:[(0,ol.jsx)(Nl.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,ol.jsx)(jc,{isOpen:y,onClose:()=>p(!1),onAddFile:t})]})}var wu=[{key:"kanban",icon:Nl.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Nl.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Nl.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Nl.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Nl.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],zc=({currentView:e,onViewChange:t,children:a})=>(0,ol.jsxs)("div",{className:"flex w-full h-screen",children:[(0,ol.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:wu.map(o=>{let i=o.icon,r=e===o.key;return(0,ol.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 ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden El:flex":""} hover:w-28 hover:justify-start hover:ol-3`,title:o.title,children:[(0,ol.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,ol.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,ol.jsx)("div",{className:"flex-1 min-w-0 px-4 El:px-6 h-full overflow-auto",children:(0,ol.jsx)("div",{className:"w-full h-full",children:a})})]});var qe=ae(require("react"));var Uc=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:d})=>{let n=c=>{c.preventDefault()},m=c=>{c.preventDefault(),i(t)};return(0,ol.jsxs)(W,{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-El transition-shadow duration-200 flex flex-col ${r?"lg:max-w-xs":""}`,style:{height:d||"calc(100vh - 350px)"},onDragOver:n,onDrop:m,children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ol.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,ol.jsx)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,ol.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Xi=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=c=>{a(e)},d=()=>{o(e)},n=()=>{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"}},m=()=>{switch(e.type){case"story":return(0,ol.jsx)(Nl.BookOpen,{className:"h-3 w-3"});case"bug":return(0,ol.jsx)(Nl.Bug,{className:"h-3 w-3"});case"spike":return(0,ol.jsx)(Nl.Zap,{className:"h-3 w-3"});case"task":default:return(0,ol.jsx)(Nl.AlertCircle,{className:"h-3 w-3"})}},s=()=>{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 i?(0,ol.jsx)(W,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:d,children:(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${s()}`,children:m()}),(0,ol.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,ol.jsxs)(W,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-El",draggable:!0,onDragStart:r,onClick:d,children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ol.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${s()}`,children:[m(),(0,ol.jsx)("span",{className:"capitalize",children:e.type})]}),(0,ol.jsxs)("div",{className:"flex gap-1",children:[(0,ol.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,ol.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,ol.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,ol.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,ol.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ol.jsx)(Nl.User,{className:"h-4 w-4"}),(0,ol.jsx)("span",{children:e.assignee?.value?.name})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ol.jsx)(Nl.Calendar,{className:"h-4 w-4"}),(0,ol.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Nu=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Nl.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Nl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Nl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Nl.Zap}],Cu=[{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"}],mi=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:d})=>{let[n,m]=(0,tr.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,tr.useEffect)(()=>{e&&d&&m(l=>({...l,epic:d}))},[e,d]),(0,tr.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:d||"",sprint:"none",assignee:""})},[e]);let s=l=>{l.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:d||"",sprint:"",assignee:""}),t())},c=(l,u)=>{m(v=>({...v,[l]:u}))};return(0,ol.jsx)(Ve,{open:e,onOpenChange:t,children:(0,ol.jsxs)(Ge,{className:"sm:max-w-El",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Add New Task"})}),(0,ol.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"name",children:"Task Title"}),(0,ol.jsx)(V,{id:"name",value:n.name,onChange:l=>c("name",l.target.value),placeholder:"Enter task title",required:!0})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"description",children:"Description"}),(0,ol.jsx)(je,{id:"description",value:n.description,onChange:l=>c("description",l.target.value),placeholder:"Enter task description",rows:3})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"Type"}),(0,ol.jsx)(Io,{type:"single",value:n.type||"",onValueChange:l=>l&&c("type",l),children:Nu.map(l=>{let u=l.icon;return(0,ol.jsxs)(Mo,{value:l.value,className:"flex items-center gap-2 data-[state=Nl]:bg-primary data-[state=Nl]:text-primary-foreground",children:[(0,ol.jsx)(u,{className:"h-4 w-4"}),l.label]},l.value)})})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"Priority"}),(0,ol.jsx)(Io,{type:"single",value:n.priority||"",onValueChange:l=>l&&c("priority",l),children:Cu.map(l=>(0,ol.jsx)(Mo,{value:l.value,className:"data-[state=Nl]:bg-primary data-[state=Nl]:text-primary-foreground",children:l.label},l.value))})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"points",children:"Story Points"}),(0,ol.jsx)(V,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:l=>c("storyPoints",parseInt(l.target.value)||1),placeholder:"Enter story points",required:!0})]}),!d&&(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"epic",children:"Epic"}),(0,ol.jsxs)(nt,{value:n.epic,onValueChange:l=>c("epic",l),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{placeholder:"Select lo epic"})}),(0,ol.jsx)(et,{children:o.map(l=>(0,ol.jsx)(we,{value:l.id.toString(),children:(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.name]})},l.id))})]})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,ol.jsxs)(nt,{value:n.sprint,onValueChange:l=>c("sprint",l),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{placeholder:"Select a sprint"})}),(0,ol.jsxs)(et,{children:[(0,ol.jsx)(we,{value:"none",children:"No Sprint"}),i.map(l=>(0,ol.jsx)(we,{value:l.id.toString(),children:(0,ol.jsx)("div",{className:"flex items-center gap-2",children:l.name})},l.id))]})]})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"sprint",children:"Assignee"}),(0,ol.jsxs)(nt,{value:n.assignee,onValueChange:l=>c("assignee",l),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{placeholder:"Select lo Assignee"})}),(0,ol.jsxs)(et,{children:[(0,ol.jsx)(we,{value:"none",children:"No Assignee"}),r.map(l=>(0,ol.jsx)(we,{value:l.id.toString(),children:(0,ol.jsx)("div",{className:"flex items-center gap-2",children:l.name})},l.id))]})]})]}),(0,ol.jsxs)($o,{children:[(0,ol.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,ol.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Kc=({comments:e,onAddComment:t})=>{let[a,o]=(0,tr.useState)(""),i=d=>d.split(" ").map(n=>n[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.MessageSquare,{className:"h-5 w-5"}),(0,ol.jsx)(E,{className:"text-lg font-medium",children:"Comments"}),(0,ol.jsx)(se,{variant:"secondary",children:e.length})]}),(0,ol.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(d=>(0,ol.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,ol.jsx)(aa,{className:"h-8 w-8 ol-1",children:(0,ol.jsx)(oa,{className:"text-xs bg-muted text-muted-foreground",children:i(d.author)})}),(0,ol.jsxs)("div",{className:"flex-1",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ol.jsx)("span",{className:"font-medium text-sm",children:d.author}),(0,ol.jsxs)("span",{className:"text-xs text-muted-foreground",children:[d.createdAt.toLocaleDateString()," tr ",d.createdAt.toLocaleTimeString()]})]}),(0,ol.jsx)("p",{className:"text-sm text-muted-foreground",children:d.text})]})]},d.id))}),(0,ol.jsxs)("div",{className:"flex gap-2",children:[(0,ol.jsx)(je,{value:a,onChange:d=>o(d.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,ol.jsx)(b,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,ol.jsx)(Nl.Send,{className:"h-4 w-4"})})]})]})};var rn=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[d,n]=(0,tr.useState)(!1),m=o.find(c=>c.value===t);return(0,ol.jsxs)("div",{className:"space-y-1",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:e}),(0,ol.jsxs)(nt,{value:t,onValueChange:a,open:d,onOpenChange:c=>{r||n(c)},disabled:r,children:[(0,ol.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-El",children:(0,ol.jsxs)(se,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&n(!d),children:[i&&m?.color&&(0,ol.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} mr-1`}),m?.label||"Select..."]})}),(0,ol.jsx)(et,{children:o.map(c=>(0,ol.jsx)(we,{value:c.value,children:i&&c.color?(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.label]}):c.label},c.value))})]})]})};var Ct=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Su=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Nl.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Nl.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Nl.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Nl.Zap}],Du=[{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 $c=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:d,isUpdating:n=!1,isDeleting:m=!1,deleteState:s="idle",teamMembers:c})=>{let[l,u]=(0,tr.useState)(e.storyPoints),v=(0,tr.useRef)(null),[h,y]=(0,tr.useState)(c);(0,tr.useEffect)(()=>{y(c)},[c]);let p=(0,tr.useCallback)((N,R)=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{i(N,R)},500)},[i]);(0,tr.useEffect)(()=>{p("storyPoints",l?.toString()||"1")},[l]);let k=N=>N.split(" ").map(R=>R[0]).join("").toUpperCase(),S=()=>s==="loading"?(0,ol.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ol.jsx)(Nl.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):s==="success"?(0,ol.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ol.jsx)(Nl.Check,{className:"h-3 w-3"}),"Deleted"]}):s==="error"?(0,ol.jsxs)(b,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,ol.jsx)(Nl.ol,{className:"h-3 w-3"}),"Delete failed"]}):(0,ol.jsxs)(b,{onClick:d,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||m,children:[(0,ol.jsx)(Nl.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,ol.jsxs)("div",{className:"flex flex-col h-full",children:[(0,ol.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:"Status"}),(0,ol.jsx)(rn,{label:"",value:e.status,onValueChange:N=>i("status",N),options:[{value:"todo",label:"Nl Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:"Type"}),(0,ol.jsx)(Io,{type:"single",value:e.type||"",onValueChange:N=>N&&i("type",N),className:"grid grid-cols-2 gap-1",disabled:n,children:Su.map(N=>{let R=N.icon;return(0,ol.jsxs)(Mo,{value:N.value,className:"flex items-center gap-1 text-xs h-8 data-[state=Nl]:bg-primary data-[state=Nl]:text-primary-foreground",size:"sm",disabled:n,children:[(0,ol.jsx)(R,{className:"h-3 w-3"}),N.label]},N.value)})})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,ol.jsx)(Io,{type:"single",value:e.priority||"",onValueChange:N=>N&&i("priority",N),className:"grid grid-cols-3 gap-1",disabled:n,children:Du.map(N=>(0,ol.jsx)(Mo,{value:N.value,className:"text-xs h-8 data-[state=Nl]:bg-primary data-[state=Nl]:text-primary-foreground",size:"sm",disabled:n,children:N.label},N.value))})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,ol.jsx)("input",{type:"number",min:"1",max:"100",value:l||1,onChange:N=>{let R=Number(N.target.value);R<1?u(1):R>100?u(100):u(R)},className:"w-full h-8 px-2 text-xs border border-border rounded-El focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,ol.jsx)(rn,{label:"",value:Ct(e.epic).toString(),onValueChange:N=>i("epic",N),options:(t||[]).map(N=>({value:N.id.toString(),label:N?.name,color:N.color})),showColor:!0,disabled:n})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,ol.jsx)(rn,{label:"",value:Ct(e.sprint).toString()||"none",onValueChange:N=>i("sprint",N==="none"?"":N),options:[{value:"none",label:"No Sprint"},...(a||[]).map(N=>({value:N.id.toString(),label:`${N?.name}`}))],disabled:n})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,ol.jsx)(Ar,{label:"",value:e.assignee?.value?.name,onValueChange:N=>i("assignee",N),options:h.map(N=>({value:`${typeof N.email=="string"?"users":"digital-colleagues"}:${N.id}`,label:N?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,ol.jsxs)("div",{className:"ol-auto ol-4 space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(b,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:n||m,children:"Close"}),S()]}),(0,ol.jsxs)("div",{className:"ol-4 border-t border-border space-y-2",children:[(0,ol.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,ol.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ol.jsx)(Nl.User,{className:"h-3 w-3"}),(0,ol.jsx)("span",{children:"System"})]})]}),(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,ol.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ol.jsx)(Nl.Calendar,{className:"h-3 w-3"}),(0,ol.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,ol.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ol.jsx)(Nl.Clock,{className:"h-3 w-3"}),(0,ol.jsxs)("span",{children:[new Date(o).toLocaleDateString()," tr"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Gc=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:d,onAddComment:n,colleagues:m})=>{let[s,c]=(0,tr.useState)(a),[l,u]=(0,tr.useState)(new Date),[v,h]=(0,tr.useState)("idle"),[y,p]=(0,tr.useState)("idle"),[k,S]=(0,tr.useState)([]),[N,R]=(0,tr.useState)(m);(0,tr.useEffect)(()=>{c(a)},[a]);let q=async(T,Me)=>{if(Me!==s[T]){h("loading");try{await r(s.id.toString(),{[T]:Me}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(P){console.log("error",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},D=async(T,Me)=>{if(Me!==s[T]){h("loading");try{await r(s.id.toString(),{[T]:Me}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(P){console.log("error",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},A=async T=>{if(n){h("loading");try{await n?.({content:T,taskId:s.id.toString()}),u(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},w=async()=>{p("loading");try{await d(s.id.toString()),p("success"),setTimeout(()=>{t(),p("idle")},1e3)}catch{p("error"),setTimeout(()=>p("idle"),3e3)}},B=v!=="loading"&&y!=="loading",z=()=>{B&&t()},F=()=>v==="loading"?(0,ol.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,ol.jsx)(Nl.Loader2,{className:"h-4 w-4 animate-spin"}),(0,ol.jsx)("span",{children:"Updating..."})]}):v==="success"?(0,ol.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,ol.jsx)(Nl.Check,{className:"h-4 w-4"}),(0,ol.jsx)("span",{children:"Updated successfully"})]}):v==="error"?(0,ol.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"}),(0,ol.jsx)("span",{children:"Update failed"})]}):null;return(0,ol.jsx)(Ve,{open:e,onOpenChange:z,children:(0,ol.jsxs)(Ge,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,ol.jsxs)(We,{children:[(0,ol.jsx)(Je,{className:"sr-only",children:s?.name}),(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)("div",{className:"flex-1",children:F()}),!B&&(0,ol.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,ol.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,ol.jsx)(si,{fieldName:"name",value:s.name||"",label:"",onSave:q,className:"border-b border-border pb-3",disabled:v==="loading"}),(0,ol.jsx)(si,{fieldName:"description",value:s.description||"",label:"Description",multiline:!0,onSave:q,disabled:v==="loading"}),(0,ol.jsx)(Kc,{comments:(s?.comments||[]).map(T=>({author:T.author.value.name||"",createdAt:new Date(T.timestamp),text:T.text,id:T.id||""})),onAddComment:A})]}),(0,ol.jsx)($c,{task:s,epics:o,sprints:i,lastUpdated:l,onUpdateTask:D,onClose:z,onDelete:w,isUpdating:v==="loading",isDeleting:y==="loading",deleteState:y,teamMembers:N})]})]})})};var ui=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,tr.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}),r=["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"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=c=>{c.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}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},s=(c,l)=>{i(u=>({...u,[c]:l}))};return(0,ol.jsx)(Ve,{open:e,onOpenChange:t,children:(0,ol.jsxs)(Ge,{className:"sm:max-w-El",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Add New Epic"})}),(0,ol.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"name",children:"Epic Name"}),(0,ol.jsx)(V,{id:"name",value:o.name,onChange:c=>s("name",c.target.value),placeholder:"Enter epic name",required:!0})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"description",children:"Description"}),(0,ol.jsx)(je,{id:"description",value:o.description,onChange:c=>s("description",c.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"Color"}),(0,ol.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(c=>(0,ol.jsx)("button",{type:"button",onClick:()=>s("color",c),className:`w-8 h-8 rounded-full ${c} ${o.color===c?"ring-2 ring-gray-400":""}`},c))})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"Confidence"}),(0,ol.jsxs)(nt,{value:o.confidence,onValueChange:c=>s("confidence",c),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{})}),(0,ol.jsx)(et,{children:d.map(c=>(0,ol.jsx)(we,{value:c.value,children:c.label},c.value))})]})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"Phase"}),(0,ol.jsxs)(nt,{value:o.phase.toString(),onValueChange:c=>s("phase",parseInt(c)),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{})}),(0,ol.jsx)(et,{children:n.map(c=>(0,ol.jsx)(we,{value:c.value.toString(),children:c.label},c.value))})]})]})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"Start Date"}),(0,ol.jsx)(V,{type:"date",value:o.startDate,onChange:c=>s("startDate",c.target.value)})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"End Date"}),(0,ol.jsx)(V,{type:"date",value:o.endDate,onChange:c=>s("endDate",c.target.value)})]})]}),(0,ol.jsxs)($o,{children:[(0,ol.jsx)(b,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,ol.jsx)(b,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Jc=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:d,onUpdateTask:n,onDeleteTask:m,onTaskClick:s,onAddEpic:c,onAddComment:l})=>{let[u,v]=(0,qe.useState)([]),[h,y]=(0,qe.useState)([]),[p,k]=(0,qe.useState)([]),[S,N]=(0,qe.useState)(!1),[R,q]=(0,qe.useState)(!1),[D,A]=(0,qe.useState)(null),[w,B]=(0,qe.useState)(null),[z,F]=(0,qe.useState)([]),[T,Me]=(0,qe.useState)([]),[P,I]=(0,qe.useState)(0),_=(0,qe.useRef)(null),Te=(0,qe.useRef)(null),$e=qe.default.useMemo(()=>[...h.map(K=>K.id),0],[h]),ut=(0,qe.useRef)(""),qt=(0,qe.useRef)(""),H=(0,qe.useRef)(""),Ie=(0,qe.useRef)(""),Xe=K=>K.map(C=>`${C.id}-${new Date(C.createdAt).getTime()}-${new Date(C.updatedAt).getTime()}`).join("-");(0,qe.useEffect)(()=>{let K=Xe(e);K!==ut.current&&(v(e),D&&A(e.find(C=>C.id===D.id)||null),ut.current=K)},[e]),(0,qe.useEffect)(()=>{let K=Xe(t);K!==qt.current&&(y(t),qt.current=K)},[t]),(0,qe.useEffect)(()=>{let K=Xe(a);K!==H.current&&(k(a),H.current=K)},[a]),(0,qe.useEffect)(()=>{let K=Xe(i.map(C=>({id:C.id,updatedAt:C.updatedAt,createdAt:C.createdAt})));K!==Ie.current&&(Me(i),Ie.current=K)},[i]),(0,qe.useEffect)(()=>{let K=()=>{if(_.current){let re=_.current.offsetHeight;I(re)}};K();let C=new ResizeObserver(K);_.current&&C.observe(_.current);let M=()=>{setTimeout(K,100)};return window.addEventListener("storage",M),()=>{C.disconnect(),window.removeEventListener("storage",M)}},[]),(0,qe.useEffect)(()=>{let K=setTimeout(()=>{_.current&&I(_.current.offsetHeight)},300);return()=>clearTimeout(K)},[S,R]);let ea=u.filter(K=>!0),Fe=K=>ea.filter(C=>C.status===K),Kt=K=>{let C={};return h.forEach(M=>{C[M.id]=K.filter(re=>Ct(re.epic)===M.id)}),C["ol-epic"]=K.filter(M=>!Ct(M.epic)),C},O=K=>{B(K)},gt=K=>{w&&(v(C=>C.map(M=>M.id===w.id?{...M,status:K}:M)),n?.(w.id.toString(),{status:K}),B(null))},da=K=>{let C={...K,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};v(M=>[...M,C]),d?.(K)},to=async(K,C)=>{v(M=>M.map(re=>re.id===Number(K)?{...re,...C}:re)),n&&await n(K,C),D?.id===Number(K)&&A(M=>({...M,...C}))},ho=async K=>{v(C=>C.filter(M=>M.id!==Number(K))),D?.id===Number(K)&&A(null),m&&await m(K)},Oo=K=>{let C={...K,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};y(M=>[...M,C]),c?.(K)},ao=K=>{A(K),s?.(K)},Ho=[{id:"todo",title:"Nl Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],jo=P>0?`calc(100vh - ${P+120}px)`:"calc(100vh - 12rem)";return(0,ol.jsxs)("div",{ref:Te,className:"h-full flex flex-col px-2 El:px-4 py-4",children:[(0,ol.jsx)("div",{ref:_,className:"flex-shrink-0",children:(0,ol.jsx)(vt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>N(!0)},secondaryAction:{label:"Add epic",onClick:()=>q(!0)}})}),(0,ol.jsx)("div",{className:"flex-1 min-h-0 ol-8",children:(0,ol.jsx)("div",{className:"h-full",style:{height:P>0?`calc(100vh - ${P+120}px)`:"calc(100vh - 12rem)"},children:(0,ol.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Ho.map(K=>{let C=Fe(K.status),M=Kt(C);return(0,ol.jsxs)(Uc,{title:K.title,status:K.status,taskCount:C.length,onDrop:gt,isCompact:K.status==="done",height:jo,children:[M["ol-epic"].map(re=>(0,ol.jsx)(Xi,{epic:null,task:re,onDragStart:O,onTaskClick:ao,isCompact:K.status==="done"},re.id)),$e.map(re=>{let Ee=h.find(ft=>ft.id===re),bt=M[re]||[];return bt.length===0?null:(0,ol.jsxs)("div",{className:"mb-6",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,ol.jsx)("div",{className:`w-3 h-3 rounded-full ${Ee?.color}`}),(0,ol.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Ee?.name||"No Epic"}),(0,ol.jsx)(se,{variant:"secondary",className:"text-xs",children:bt.length})]})," ",(0,ol.jsx)("div",{className:"space-y-3",children:bt.map(ft=>(0,ol.jsx)(Xi,{task:ft,epic:Ee,onDragStart:O,onTaskClick:ao,isCompact:K.status==="done"},ft.id))})]},re)})]},K.id)})})})}),(0,ol.jsx)(mi,{isOpen:S,onClose:()=>N(!1),onAddTask:da,assignees:[...T,...z],epics:h,sprints:p}),(0,ol.jsx)(ui,{isOpen:R,onClose:()=>q(!1),onAddEpic:Oo}),D&&(0,ol.jsx)(Gc,{isOpen:!!D,onClose:()=>A(null),initialTask:D,epics:h,sprints:p,onUpdateTask:to,onDeleteTask:ho,colleagues:T,onAddComment:l})]})};var qc=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:d,onUpdateEpic:n,onDeleteEpic:m})=>{let[s,c]=(0,tr.useState)(t),[l,u]=(0,tr.useState)(null),[v,h]=(0,tr.useState)(null),[y,p]=(0,tr.useState)({}),[k,S]=(0,tr.useState)(0),[N,R]=(0,tr.useState)(!1),[q,D]=(0,tr.useState)(!1),[A,w]=(0,tr.useState)(null),B=(0,tr.useRef)(null),z=(0,tr.useRef)(null);(0,tr.useEffect)(()=>{c(t)},[t]),(0,tr.useEffect)(()=>{let H=()=>{if(B.current){let ea=B.current.offsetHeight;S(ea)}};H();let Ie=new ResizeObserver(H);B.current&&Ie.observe(B.current);let Xe=()=>{setTimeout(H,100)};return window.addEventListener("storage",Xe),()=>{Ie.disconnect(),window.removeEventListener("storage",Xe)}},[]),(0,tr.useEffect)(()=>{let H=setTimeout(()=>{B.current&&S(B.current.offsetHeight)},300);return()=>clearTimeout(H)},[v]);let F=H=>{u(H)},T=H=>{H.preventDefault()},Me=(H,Ie)=>{H.preventDefault(),l&&Ct(l.epic).toString()!==Ie&&(o(l.id.toString(),{epic:Number(Ie)}),u(null))},P=H=>e.filter(Ie=>Ct(Ie.epic).toString()===H),I=H=>{h(H.id.toString()),p({name:H.name,description:H.description,confidence:H.confidence,phase:H.phase})},_=async()=>{v&&y.name&&(await n(v.toString(),y),c(H=>H.map(Ie=>Ie.id.toString()===v?{...Ie,...y}:Ie)),h(null),p({}))},Te=()=>{h(null),p({})},$e=async H=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await m(H),c(Ie=>Ie.filter(Xe=>Xe.id.toString()!==H)))},ut=H=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[H]||`Phase ${H}`,qt=H=>{switch(H){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsxs)("div",{ref:z,className:"h-full flex flex-col px-2 El:px-4 py-4",children:[(0,ol.jsx)("div",{ref:B,className:"flex-shrink-0",children:(0,ol.jsx)(vt,{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:()=>R(!0)}})}),(0,ol.jsx)("div",{className:"flex-1 min-h-0 ol-8",children:(0,ol.jsx)("div",{className:"h-full overflow-y-auto",style:{height:k>0?`calc(100vh - ${k+120}px)`:"calc(100vh - 12rem)"},children:(0,ol.jsx)("div",{className:"grid grid-cols-1 El:grid-cols-2 lg:grid-cols-3 Nl:grid-cols-4 gap-6 auto-rows-max",children:s.map(H=>{let Ie=P(H.id.toString()),Xe=Ie.reduce((Fe,Kt)=>Fe+(Kt.storyPoints||0),0),ea=k>0?`calc(100vh - ${k+200}px)`:"calc(100vh - 14rem)";return(0,ol.jsxs)(W,{className:`flex flex-col ${v===H.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:v===H.id.toString()?"auto":ea,minHeight:"400px"},onDragOver:T,onDrop:Fe=>Me(Fe,H.id.toString()),children:[(0,ol.jsx)("div",{className:"p-4 border-b border-border",children:v===H.id.toString()?(0,ol.jsxs)("div",{className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)(V,{value:y.name||"",onChange:Fe=>p({...y,name:Fe.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,ol.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:_,className:"p-1 h-8 w-8",children:(0,ol.jsx)(Nl.Check,{className:"h-4 w-4"})}),(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:Te,className:"p-1 h-8 w-8",children:(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"})})]})]}),(0,ol.jsx)(je,{value:y.description||"",onChange:Fe=>p({...y,description:Fe.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,ol.jsxs)("select",{value:y.confidence||H.confidence,onChange:Fe=>p({...y,confidence:Fe.target.value}),className:"flex h-8 w-full rounded-El 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,ol.jsx)("option",{value:"low",children:"Low"}),(0,ol.jsx)("option",{value:"medium",children:"Medium"}),(0,ol.jsx)("option",{value:"high",children:"High"})]})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,ol.jsx)("select",{value:y.phase?.toString()||H.phase.toString(),onChange:Fe=>p({...y,phase:parseInt(Fe.target.value)}),className:"flex h-8 w-full rounded-El 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(Fe=>(0,ol.jsxs)("option",{value:Fe.toString(),children:["Phase ",Fe]},Fe))})]})]})]}):(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,ol.jsx)("div",{className:`w-4 h-4 rounded-full ${H.color}`}),(0,ol.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:H.name}),(0,ol.jsxs)("div",{className:"flex gap-1",children:[(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>I(H),className:"p-1 h-8 w-8",children:(0,ol.jsx)(Nl.Edit2,{className:"h-3 w-3"})}),(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>$e(H.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,ol.jsx)(Nl.Trash2,{className:"h-3 w-3"})})]})]}),(0,ol.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,ol.jsxs)(se,{className:`text-xs ${qt(H.confidence)}`,children:[H.confidence," confidence"]}),(0,ol.jsxs)(se,{variant:"outline",className:"text-xs",children:["Phase ",H.phase]}),(0,ol.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Ie.length," tasks"]}),(0,ol.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Xe," pts"]})]}),H.description&&(0,ol.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:H.description}),(0,ol.jsxs)(b,{onClick:()=>{D(!0),w(H)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,ol.jsx)(Nl.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,ol.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,ol.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${l?"border-primary bg-primary/10":"border-border"}`,children:Ie.length===0?(0,ol.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,ol.jsx)(Nl.Move,{className:"h-8 w-8 mb-2"}),(0,ol.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):Ie.map(Fe=>(0,ol.jsx)(Xi,{task:Fe,epic:H,onDragStart:F,onTaskClick:i,isCompact:!0},Fe.id))})})]},H.id)})})})})]}),(0,ol.jsx)(ui,{isOpen:N,onClose:()=>R(!1),onAddEpic:d}),(0,ol.jsx)(mi,{isOpen:q,onClose:()=>D(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:A?.id.toString()||"",sprints:a})]})};var Bs=require("date-fns");var Yc=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,tr.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=n=>{n.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()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},d=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,ol.jsx)(Ve,{open:e,onOpenChange:d,children:(0,ol.jsxs)(Ge,{className:"sm:max-w-El",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Add New Sprint"})}),(0,ol.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"name",children:"Sprint Name *"}),(0,ol.jsx)(V,{id:"name",value:o.name,onChange:n=>i(m=>({...m,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"description",children:"Description"}),(0,ol.jsx)(je,{id:"description",value:o.description,onChange:n=>i(m=>({...m,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"Start Date *"}),(0,ol.jsxs)(Ps,{children:[(0,ol.jsx)(Rs,{asChild:!0,children:(0,ol.jsxs)(b,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,ol.jsx)(Nl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Bs.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,ol.jsx)(Qr,{className:"w-auto p-0",align:"start",children:(0,ol.jsx)(en,{mode:"single",selected:o.startDate,onSelect:n=>i(m=>({...m,startDate:n})),initialFocus:!0})})]})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{children:"End Date *"}),(0,ol.jsxs)(Ps,{children:[(0,ol.jsx)(Rs,{asChild:!0,children:(0,ol.jsxs)(b,{variant:"outline",className:g("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,ol.jsx)(Nl.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Bs.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,ol.jsx)(Qr,{className:"w-auto p-0",align:"start",children:(0,ol.jsx)(en,{mode:"single",selected:o.endDate,onSelect:n=>i(m=>({...m,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,ol.jsxs)("div",{className:"flex justify-end gap-3 ol-4",children:[(0,ol.jsx)(b,{type:"button",variant:"outline",onClick:d,children:"Cancel"}),(0,ol.jsx)(b,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var nn=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:d,onDeleteSprint:n})=>{let[m,s]=(0,tr.useState)([]),[c,l]=(0,tr.useState)(new Set),[u,v]=(0,tr.useState)(null),[h,y]=(0,tr.useState)(!1),[p,k]=(0,tr.useState)(null),[S,N]=(0,tr.useState)(null),[R,q]=(0,tr.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[D,A]=(0,tr.useState)([]),[w,B]=(0,tr.useState)("upcoming"),[z,F]=(0,tr.useState)(!1),[T,Me]=(0,tr.useState)(0),P=(0,tr.useRef)(null),I=(0,tr.useRef)(null);(0,tr.useEffect)(()=>{let C=()=>{P.current&&Me(P.current.offsetHeight)};C();let M=new ResizeObserver(C);return P.current&&M.observe(P.current),()=>M.disconnect()},[]);let _=C=>t.find(M=>M.id===Number(C)),Te=C=>a.find(M=>M.id===Number(C)),$e=C=>{let M={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 M[C]||M.medium},ut=C=>{if(!C||C?.length===0)return"";let M=C?.trim().split(" ");if(M?.length===1)return M[0];let re=M[0],Ee=M[M.length-1][0].toUpperCase();return`${re} ${Ee}`},qt=C=>{let M={},re=[];return C.forEach(Ee=>{Ee.epic?(M[Ct(Ee.epic)]||(M[Ct(Ee.epic)]=[]),M[Ct(Ee.epic)].push(Ee)):re.push(Ee)}),{tasksByEpic:M,unassignedTasks:re}};(0,tr.useEffect)(()=>{A(a)},[a]);let H=D.filter(C=>{switch(w){default:return!0}}),Ie=D.filter(C=>m.includes(C.id.toString())),Xe=e.filter(C=>!C.sprint||C.status==="backlog"),ea=Xe.reduce((C,M)=>C+(M.storyPoints||0),0),Fe=C=>{s(M=>M.includes(C)?M.filter(re=>re!==C):M?.length<3?[...M,C]:M)},Kt=C=>{l(M=>{let re=new Set(M);return re.has(C)?re.delete(C):re.add(C),re})},O=C=>{r(C),y(!1)},gt=C=>{N(C.id.toString()),q({name:C.name,description:C.description||"",startDate:C.startDate?new Date(C.startDate).toISOString().split("T")[0]:C.startDate,endDate:C.endDate?new Date(C.endDate).toISOString().split("T")[0]:C.endDate,isActive:!1})},da=()=>{S&&(d(S,{name:R.name,description:R.description,startDate:R.startDate,endDate:R.endDate}),A(C=>C.map(M=>(M.id===Number(S)&&(M.name=R.name,M.description=R.description,M.startDate=R.startDate,M.endDate=R.endDate),M))),N(null))},to=()=>{N(null),q({name:"",description:"",startDate:"",endDate:"",isActive:!1})},ho=(C,M)=>{v(M),C.dataTransfer.effectAllowed="move"},Oo=C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},ao=C=>{k(C)},Ho=()=>{k(null)},jo=(C,M)=>{if(C.preventDefault(),k(null),!u)return;(Ct(u.sprint)||void 0)!==Number(M)&&o(u.id.toString(),{sprint:Number(M)}),v(null)},K=({task:C,showSprint:M=!1})=>{let re=C.epic?_(Ct(C.epic).toString()):null,Ee=C.sprint?Te(Ct(C.sprint).toString()):null;return(0,ol.jsx)(W,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-El transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:_t=>{_t.dataTransfer.effectAllowed="move",_t.dataTransfer.setData("text/plain",C.id.toString()),ho(_t,C)},onClick:_t=>{u===null&&i(C)},style:{userSelect:"none"},children:(0,ol.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,ol.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,ol.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:C.name}),(0,ol.jsx)(se,{className:`text-xs ${$e(C.priority||"medium")}`,children:C.priority?.[0]?.toUpperCase()})]}),(0,ol.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-1",children:[re&&(0,ol.jsx)("div",{className:`w-2 h-2 rounded-full ${re.color}`}),(0,ol.jsx)("span",{className:"text-muted-foreground truncate",children:re?.name})]}),(0,ol.jsx)("span",{className:"text-muted-foreground",children:ut(C.assignee?.value?.name)})]}),M&&Ee&&(0,ol.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,ol.jsx)(Nl.Calendar,{className:"h-3 w-3"}),(0,ol.jsx)("span",{children:Ee.name})]})]})})};return(0,ol.jsxs)("div",{ref:I,className:"h-full flex flex-col px-2 El:px-4 py-4",children:[(0,ol.jsx)("div",{ref:P,className:"flex-shrink-0",children:(0,ol.jsx)(vt,{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:()=>y(!0)}})}),(0,ol.jsx)("div",{className:"flex-1 min-h-0 ol-8",children:(0,ol.jsxs)("div",{className:"h-full",style:{height:T>0?`calc(100vh - ${T+120}px)`:"calc(100vh - 12rem)"},children:[(0,ol.jsxs)("div",{className:"mb-4",children:[(0,ol.jsx)(W,{className:"p-3 bg-card shadow-sm",children:(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,ol.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,ol.jsx)("div",{className:"flex flex-wrap gap-1",children:Ie.map(C=>(0,ol.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,ol.jsx)("span",{className:"max-w-[80px] truncate",children:C.name}),(0,ol.jsx)("button",{onClick:()=>Fe(C.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"})})]},C.id))})]})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsxs)(b,{onClick:()=>y(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,ol.jsx)(Nl.Plus,{className:"h-3 w-3"}),"Add"]}),(0,ol.jsxs)(b,{onClick:()=>F(!z),variant:"outline",size:"sm",className:"gap-1",children:[(0,ol.jsx)(Nl.Calendar,{className:"h-3 w-3"}),z?"Close":"Select"]})]})]})}),z&&(0,ol.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>F(!1)}),(0,ol.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-Nl z-10 transition-all duration-300 ease-in-out ${z?"translate-ol-0 opacity-100 visible":"translate-ol-full opacity-0 invisible"}`,children:(0,ol.jsxs)(W,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,ol.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ol.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,ol.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>F(!1),className:"h-8 w-8 p-0",children:(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"})})]}),(0,ol.jsx)("p",{className:"text-sm text-muted-foreground ol-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,ol.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,ol.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(C=>(0,ol.jsxs)(b,{variant:w===C.key?"default":"outline",size:"sm",onClick:()=>B(C.key),className:"text-xs h-8 px-3 flex-1",children:[C.label," (",C.count,")"]},C.key))}),(0,ol.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:H.length>0?H.map(C=>{let M=m.includes(C.id.toString()),re=e.filter(bt=>Ct(bt.sprint)===C.id).length,Ee=!M&&m.length<3;return(0,ol.jsx)("div",{className:`p-3 rounded-lg border transition-all ${M?"bg-primary/10 border-primary/30":Ee?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:S===C.id.toString()?(0,ol.jsxs)("div",{className:"space-y-3",children:[(0,ol.jsx)(V,{value:R.name,onChange:bt=>q(ft=>({...ft,name:bt.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,ol.jsx)(je,{value:R.description,onChange:bt=>q(ft=>({...ft,description:bt.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,ol.jsxs)("div",{className:"flex gap-2",children:[(0,ol.jsxs)(b,{size:"sm",onClick:()=>da(),className:"flex-1",children:[(0,ol.jsx)(Nl.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,ol.jsxs)(b,{size:"sm",variant:"outline",onClick:to,className:"flex-1",children:[(0,ol.jsx)(Nl.ol,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,ol.jsxs)("div",{children:[(0,ol.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ol.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,ol.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:C.name}),(0,ol.jsx)(se,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:C.description}),(0,ol.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,ol.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ol.jsx)(Nl.CalendarDays,{className:"h-3 w-3"}),new Date(C.startDate).toLocaleDateString()]}),(0,ol.jsxs)("span",{className:"flex items-center gap-1",children:[(0,ol.jsx)(Nl.User,{className:"h-3 w-3"}),re," tasks"]})]})]}),(0,ol.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>gt(C),className:"h-6 w-6 p-0",children:(0,ol.jsx)(Nl.Edit2,{className:"h-3 w-3"})}),(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>n(C.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,ol.jsx)(Nl.Trash2,{className:"h-3 w-3"})})]})]}),(0,ol.jsx)("div",{className:"flex items-center justify-between ol-2",children:(0,ol.jsx)(b,{variant:M?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Fe(C.id.toString()),disabled:!M&&m?.length>=3,children:(0,ol.jsx)("span",{className:"pointer-events-none select-none",children:M?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},C.id)}):(0,ol.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,ol.jsx)(Nl.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,ol.jsxs)("p",{className:"text-sm",children:['No sprints found for "',w,'" filter']}),(0,ol.jsx)(b,{variant:"link",size:"sm",onClick:()=>B("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,ol.jsx)("div",{className:"ol-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,ol.jsxs)("div",{className:"text-center",children:[(0,ol.jsx)(Nl.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,ol.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,ol.jsx)("p",{className:"text-xs text-muted-foreground ol-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,ol.jsx)("div",{className:"lg:col-span-1",children:(0,ol.jsxs)(W,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-El transition-shadow duration-200 flex flex-col",onDragOver:Oo,onDragEnter:()=>ao("backlog"),onDragLeave:Ho,onDrop:C=>jo(C,"backlog"),style:{height:T>0?`calc(100vh - ${T+200}px)`:"calc(100vh - 16rem)"},children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ol.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsxs)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Xe?.length," tasks"]}),(0,ol.jsxs)(se,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[ea," pts"]})]})]}),(0,ol.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:C,unassignedTasks:M}=qt(Xe);return(0,ol.jsxs)(ol.Fragment,{children:[Object.entries(C).map(([re,Ee])=>{let bt=_(re);if(!bt)return null;let ft=c.has(re);return(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.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:()=>Kt(re),children:[(0,ol.jsx)("div",{className:`w-3 h-3 rounded-full ${bt.color}`}),(0,ol.jsx)("span",{className:"font-medium text-muted-foreground",children:bt.name}),(0,ol.jsxs)("span",{className:"text-muted-foreground",children:["(",Ee?.length,")"]}),(0,ol.jsx)("div",{className:"ml-auto",children:ft?(0,ol.jsx)(Nl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ol.jsx)(Nl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ft&&(0,ol.jsx)("div",{className:"space-y-2 ol-2",children:Ee.map(_t=>(0,ol.jsx)(K,{task:_t},_t.id))})]},re)}),M?.length>0&&(()=>{let re=c.has("ol-epic");return(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.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:()=>Kt("ol-epic"),children:[(0,ol.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ol.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,ol.jsxs)("span",{className:"text-muted-foreground",children:["(",M?.length,")"]}),(0,ol.jsx)("div",{className:"ml-auto",children:re?(0,ol.jsx)(Nl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ol.jsx)(Nl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!re&&(0,ol.jsx)("div",{className:"space-y-2 ol-2",children:M?.map(Ee=>(0,ol.jsx)(K,{task:Ee},Ee.id))})]})})(),Xe?.length===0&&(0,ol.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"}),Xe?.length>0&&Object.keys(C).length===0&&M.length===0&&(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),Xe?.map(re=>(0,ol.jsx)(K,{task:re},re.id))]})]})})()})]})}),Ie.map(C=>{let M=e.filter(Ee=>Ct(Ee?.sprint)===C.id),re=M.reduce((Ee,bt)=>Ee+(bt?.storyPoints||0),0);return(0,ol.jsxs)(W,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-El transition-shadow duration-200 flex flex-col",onDragOver:Oo,onDragEnter:()=>ao(C.id.toString()),onDragLeave:Ho,onDrop:Ee=>jo(Ee,C.id.toString()),style:{height:T>0?`calc(100vh - ${T+200}px)`:"calc(100vh - 16rem)"},children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,ol.jsx)("div",{children:(0,ol.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:C.name})}),(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsxs)(se,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[M?.length," tasks"]}),(0,ol.jsxs)(se,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[re," pts"]}),(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>{F(!0),gt(C)},className:"h-6 px-2",children:(0,ol.jsx)(Nl.Edit2,{className:"h-3 w-3"})}),(0,ol.jsx)(b,{size:"sm",variant:"ghost",onClick:()=>n(C.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,ol.jsx)(Nl.Trash2,{className:"h-3 w-3"})})]})]}),(0,ol.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:Ee,unassignedTasks:bt}=qt(M);return(0,ol.jsxs)(ol.Fragment,{children:[Object.entries(Ee).map(([ft,_t])=>{let fi=_(ft);if(!fi)return null;let vi=c.has(ft);return(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.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:()=>Kt(ft),children:[(0,ol.jsx)("div",{className:`w-3 h-3 rounded-full ${fi.color}`}),(0,ol.jsx)("span",{className:"font-medium text-muted-foreground",children:fi.name}),(0,ol.jsxs)("span",{className:"text-muted-foreground",children:["(",_t?.length,")"]}),(0,ol.jsx)("div",{className:"ml-auto",children:vi?(0,ol.jsx)(Nl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ol.jsx)(Nl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!vi&&(0,ol.jsx)("div",{className:"space-y-2 ol-2",children:_t?.map(hi=>(0,ol.jsx)(K,{task:hi},hi.id))})]},ft)}),bt?.length>0&&(()=>{let ft=c.has("ol-epic");return(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.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:()=>Kt("ol-epic"),children:[(0,ol.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,ol.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,ol.jsxs)("span",{className:"text-muted-foreground",children:["(",bt?.length,")"]}),(0,ol.jsx)("div",{className:"ml-auto",children:ft?(0,ol.jsx)(Nl.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,ol.jsx)(Nl.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ft&&(0,ol.jsx)("div",{className:"space-y-2 ol-2",children:bt?.map(_t=>(0,ol.jsx)(K,{task:_t},_t.id))})]})})(),M?.length===0&&(0,ol.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},C.id)})]}),(0,ol.jsx)(Yc,{isOpen:h,onClose:()=>y(!1),onAddSprint:O})]})})]})};var ku=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Tu=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})},Ls=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},Fs=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Pu=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Ru=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,tr.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[d,n]=(0,tr.useState)(!1),m=c=>{if(c.preventDefault(),!e.find(v=>v?.id.toString()===i.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let u={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(u),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,tr.useEffect)(()=>{i.colleagueId&&n(!1)},[i.colleagueId]);let s=e.filter(Boolean);return(0,ol.jsx)(Ve,{open:a,onOpenChange:o,children:(0,ol.jsxs)(Ge,{className:"max-w-2xl",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Add New Reminder"})}),(0,ol.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,ol.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"title",children:"Title"}),(0,ol.jsx)(V,{id:"title",value:i.title,onChange:c=>r({...i,title:c.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"description",children:"Description"}),(0,ol.jsx)(je,{id:"description",value:i.description,onChange:c=>r({...i,description:c.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"dueDate",children:"Due Date"}),(0,ol.jsx)(V,{id:"dueDate",type:"date",value:i.dueDate,onChange:c=>r({...i,dueDate:c.target.value}),required:!0})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,ol.jsx)(V,{id:"dueTime",type:"time",value:i.dueTime,onChange:c=>r({...i,dueTime:c.target.value})})]})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{className:`${d?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,ol.jsxs)(nt,{value:i.colleagueId,onValueChange:c=>{r({...i,colleagueId:c})},required:!0,children:[(0,ol.jsx)(Qe,{className:`${d?"text-destructive border-red-500":""}`,children:(0,ol.jsx)(wt,{className:`${d?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(c=>c?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,ol.jsx)(et,{children:s.map(c=>(0,ol.jsx)(we,{value:c.id.toString(),children:c.name},c.id))})]}),d&&(0,ol.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:c=>r({...i,isRecurring:c.target.checked}),className:"rounded border-border"}),(0,ol.jsx)(E,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-4 ol-6",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,ol.jsxs)(nt,{value:i.recurrencePattern,onValueChange:c=>r({...i,recurrencePattern:c}),children:[(0,ol.jsx)(Qe,{children:(0,ol.jsx)(wt,{})}),(0,ol.jsxs)(et,{children:[(0,ol.jsx)(we,{value:"daily",children:"Daily"}),(0,ol.jsx)(we,{value:"weekly",children:"Weekly"}),(0,ol.jsx)(we,{value:"monthly",children:"Monthly"}),(0,ol.jsx)(we,{value:"yearly",children:"Yearly"})]})]})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"recurrenceInterval",children:"Every"}),(0,ol.jsx)(V,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:c=>r({...i,recurrenceInterval:parseInt(c.target.value)})})]})]})]}),(0,ol.jsxs)("div",{className:"flex justify-end space-ol-2",children:[(0,ol.jsx)(b,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,ol.jsx)(b,{type:"submit",children:"Add Reminder"})]})]})]})})},Au=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,d]=(0,tr.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=s=>{s.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},m=t.filter(Boolean);return(0,ol.jsx)(Ve,{open:o,onOpenChange:i,children:(0,ol.jsxs)(Ge,{className:"max-w-2xl",children:[(0,ol.jsx)(We,{children:(0,ol.jsx)(Je,{children:"Edit Reminder"})}),(0,ol.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,ol.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"edit-title",children:"Title"}),(0,ol.jsx)(V,{id:"edit-title",value:r.title,onChange:s=>d({...r,title:s.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"edit-description",children:"Description"}),(0,ol.jsx)(je,{id:"edit-description",value:r.description||"",onChange:s=>d({...r,description:s.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,ol.jsx)(V,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:s=>d({...r,dueDate:s.target.value}),required:!0})]}),(0,ol.jsxs)("div",{children:[(0,ol.jsx)(E,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,ol.jsx)(V,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:s=>d({...r,dueTime:s.target.value})})]})]}),(0,ol.jsx)("div",{className:"space-y-2",children:(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:s=>d({...r,isRecurring:s.target.checked}),className:"rounded border-border"}),(0,ol.jsx)(E,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,ol.jsxs)("div",{className:"flex justify-end space-ol-2",children:[(0,ol.jsx)(b,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,ol.jsx)(b,{type:"submit",children:"Save Changes"})]})]})]})})},Iu=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,tr.useState)(!1);if(!e||!e.id)return null;let d=Ls(new Date(e.dueDate||""),e.dueTime||""),n=Fs(new Date(e.dueDate||"")),m=Pu(new Date(e.dueDate||"")),s=()=>{a(e.id.toString(),{})},c=()=>n?"Today":m?"Tomorrow":ku(new Date(e.dueDate||""));return(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(Au,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,ol.jsx)(W,{children:(0,ol.jsx)(fe,{className:"p-4",children:(0,ol.jsxs)("div",{className:"flex items-start justify-between",children:[(0,ol.jsxs)("div",{className:"flex items-start space-ol-3 flex-1",children:[(0,ol.jsx)("button",{onClick:s,className:"ol-1 text-primary hover:text-primary/80"}),(0,ol.jsxs)("div",{className:"flex-1",children:[(0,ol.jsx)("div",{className:"flex items-center space-ol-2 mb-1",children:(0,ol.jsx)("h3",{children:e.title})}),(0,ol.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-4 text-sm text-muted-foreground",children:[(0,ol.jsxs)("div",{className:"flex items-center space-ol-1",children:[(0,ol.jsx)(Nl.Calendar,{className:"h-4 w-4"}),(0,ol.jsx)("span",{className:d?"text-destructive font-medium":"",children:c()})]}),e.dueTime&&(0,ol.jsxs)("div",{className:"flex items-center space-ol-1",children:[(0,ol.jsx)(Nl.Clock,{className:"h-4 w-4"}),(0,ol.jsx)("span",{children:Tu(e.dueTime)})]}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-1",children:[(0,ol.jsx)(Nl.User,{className:"h-4 w-4"}),(0,ol.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-1",children:[(0,ol.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,ol.jsx)(Nl.Edit2,{className:"h-4 w-4"})}),(0,ol.jsx)(b,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,ol.jsx)(Nl.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Zc=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,d]=(0,tr.useState)(e.filter(Boolean)),[n,m]=(0,tr.useState)(t.filter(Boolean)),[s,c]=(0,tr.useState)("all"),[l,u]=(0,tr.useState)(""),[v,h]=(0,tr.useState)(!1);(0,tr.useEffect)(()=>{d(e.filter(Boolean))},[e]),(0,tr.useEffect)(()=>{m(t.filter(Boolean))},[t]);let y=D=>{if(!D.title){console.error("Invalid reminder data:",D);return}let A={...D,id:Date.now(),createdAt:new Date().toISOString()};d(w=>[...w,A]),a?.(D)},p=(D,A)=>{if(!D){console.error("No reminder ID provided for update");return}d(w=>w.map(B=>B?.id.toString()===D?{...B,...A}:B)),o?.(D,A)},k=D=>{if(!D){console.error("No reminder ID provided for deletion");return}d(A=>A.filter(w=>w?.id.toString()!==D)),i?.(D)},N=r.filter(D=>{if(!D)return!1;if(l){let A=l.toLowerCase();if(!(D.title.toLowerCase().includes(A)||D.description?.toLowerCase().includes(A)))return!1}switch(s){case"pending":case"completed":case"overdue":return Ls(new Date(D.dueDate||""),D.dueTime||"");case"today":return Fs(new Date(D.dueDate||""));default:return!0}}).sort((D,A)=>{if(!D||!A)return 0;let w={high:3,medium:2,low:1},B=0;return B!==0?B:new Date(D.dueDate||"").getTime()-new Date(A.dueDate||"").getTime()}),R={total:r.filter(Boolean).length,overdue:r.filter(D=>D&&Ls(new Date(D.dueDate||""),D.dueTime||"")).length,today:r.filter(D=>D&&Fs(new Date(D.dueDate||""))).length},q=n.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,ol.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,ol.jsx)(vt,{title:"Task Reminders",description:"Manage reminders and stay Nl 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,ol.jsxs)("div",{className:"h-full bg-background",children:[(0,ol.jsx)(Ru,{colleagues:n,onAddReminder:y,open:v,setOpen:h}),(0,ol.jsxs)("div",{className:"p-6",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,ol.jsxs)("div",{children:[(0,ol.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,ol.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,ol.jsxs)(b,{className:"flex items-center space-ol-2",onClick:()=>h(!0),children:[(0,ol.jsx)(Nl.Plus,{className:"h-4 w-4"}),(0,ol.jsx)("span",{children:"Add Reminder"})]})]}),(0,ol.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,ol.jsxs)(W,{className:"p-4",children:[(0,ol.jsx)("div",{className:"text-2xl font-bold text-foreground",children:R.total}),(0,ol.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,ol.jsxs)(W,{className:"p-4",children:[(0,ol.jsx)("div",{className:"text-2xl font-bold text-primary",children:R.overdue}),(0,ol.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,ol.jsxs)(W,{className:"p-4",children:[(0,ol.jsx)("div",{className:"text-2xl font-bold text-success",children:R.today}),(0,ol.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,ol.jsxs)(W,{className:"p-4",children:[(0,ol.jsx)("div",{className:"text-2xl font-bold text-destructive",children:R.overdue}),(0,ol.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,ol.jsxs)(W,{className:"p-4",children:[(0,ol.jsx)("div",{className:"text-2xl font-bold text-warning",children:R.today}),(0,ol.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-4 mb-6",children:[(0,ol.jsx)("div",{className:"flex-1",children:(0,ol.jsx)(V,{placeholder:"Search reminders...",value:l,onChange:D=>u(D.target.value),className:"max-w-El"})}),(0,ol.jsxs)(nt,{value:s,onValueChange:D=>c(D),children:[(0,ol.jsx)(Qe,{className:"w-40",children:(0,ol.jsx)(wt,{})}),(0,ol.jsxs)(et,{children:[(0,ol.jsxs)(we,{value:"all",children:["All (",R.total,")"]}),(0,ol.jsxs)(we,{value:"overdue",children:["Overdue (",R.overdue,")"]}),(0,ol.jsxs)(we,{value:"overdue",children:["Overdue (",R.overdue,")"]}),(0,ol.jsxs)(we,{value:"today",children:["Today (",R.today,")"]})]})]})]}),(0,ol.jsx)("div",{className:"space-y-4",children:N.length===0?(0,ol.jsxs)(W,{className:"p-8 text-center",children:[(0,ol.jsx)("div",{className:"text-muted-foreground",children:l||s!=="all"?"No reminders match your filters":"No reminders yet"}),!l&&s==="all"&&(0,ol.jsx)("p",{className:"text-sm text-muted-foreground/60 ol-2",children:"Create your first reminder to get started"})]}):N.map(D=>D&&(0,ol.jsx)(Iu,{reminder:D,colleagues:n,onUpdateReminder:p,onDeleteReminder:k},D.id))})]})]})]})};var Qc=require("next/navigation");function Os({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:d=[],initialUsers:n=[],initialFiles:m=[],initialView:s="kanban",onAddTask:c,onUpdateTask:l,onDeleteTask:u,onTaskClick:v,onAddEpic:h,onUpdateEpic:y,onDeleteEpic:p,onAddTaskToEpic:k,onAddSprint:S,onUpdateSprint:N,onDeleteSprint:R,onAddProject:q,onUpdateProject:D,onDeleteProject:A,onFileAdd:w,onFileEdit:B,onFileDelete:z,onFileClick:F,onAddReminder:T,onUpdateReminder:Me,onDeleteReminder:P,onViewChange:I,onToggleMobileMenu:_,onTeamClick:Te,onTeamChange:$e,onCopilotClick:ut,handleAddComment:qt}){let[H,Ie]=(0,tr.useState)(t),[Xe,ea]=(0,tr.useState)(a),[Fe,Kt]=(0,tr.useState)(o),[O,gt]=(0,tr.useState)(i),[da,to]=(0,tr.useState)(r),[ho,Oo]=(0,tr.useState)(d),[ao,Ho]=(0,tr.useState)(n),[jo,K]=(0,tr.useState)(m),[C,M]=(0,tr.useState)(!1),[re,Ee]=(0,tr.useState)(!1),[bt,ft]=(0,tr.useState)(null),[_t,fi]=(0,tr.useState)(null),[vi,hi]=(0,tr.useState)(null),[bo,Vs]=(0,tr.useState)(s||"kanban"),[Eu,im]=(0,tr.useState)(!1),rm=(0,Qc.useRouter)();(0,tr.useEffect)(()=>{Ie(t)},[t]),(0,tr.useEffect)(()=>{Kt(o)},[o]),(0,tr.useEffect)(()=>{ea(a)},[a]),(0,tr.useEffect)(()=>{gt(i)},[i]),(0,tr.useEffect)(()=>{K(m)},[m]),(0,tr.useEffect)(()=>{Ho(n)},[n]),(0,tr.useEffect)(()=>{Oo(d)},[d]),(0,tr.useEffect)(()=>{to(r)},[r]),(0,tr.useEffect)(()=>{Vs(s)},[s]);let nm=H.filter(L=>{}),Bu=L=>nm.filter(oe=>oe.status===L),Lu=L=>{let oe={};return Xe.forEach(ge=>{}),oe},Fu=L=>{hi(L)},Ou=L=>{vi&&(Ie(oe=>oe.map(ge=>ge.id===vi.id?{...ge,status:L}:ge)),hi(null))},Ks=L=>{let oe={...L,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Ie(ge=>[...ge,oe]),c?.(oe)},Zi=async(L,oe)=>(Ie(ge=>ge.map(At=>At.id===Number(L)?{...At,...oe}:At)),await l?.(L,oe)),Hu=async(L,oe)=>{Zi(L,oe)},_s=L=>{Ie(oe=>oe.filter(ge=>ge.id!==Number(L))),bt?.id===Number(L)&&ft(null),u?.(L)},ju=async L=>{_s(L)},zu=L=>{let oe={...L,id:Date.now()};gt(ge=>[...ge,oe]),q?.(L)},Uu=(L,oe)=>{gt(ge=>ge.map(At=>At.id===Number(L)?{...At,...oe}:At)),D?.(L,oe)},Vu=L=>{gt(oe=>oe.filter(ge=>ge.id!==Number(L))),A?.(L)},$s=L=>{let oe={...L,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};ea(ge=>[...ge,oe]),h?.({...oe})},sm=()=>{Ee(!0)},lm=(L,oe)=>{ea(ge=>ge.map(At=>At.id===Number(L)?{...At,...oe}:At)),y?.(L,oe)},dm=L=>{ea(oe=>oe.filter(ge=>ge.id!==Number(L))),Ie(oe=>oe.filter(ge=>Ct(ge.epic)!==Number(L))),p?.(L)},cm=L=>{let oe={...L,id:Date.now()};Kt(ge=>[...ge,oe]),S?.(L)},mm=(L,oe)=>{Kt(ge=>ge.map(At=>At.id===Number(L)?{...At,...oe}:At)),N?.(L,oe)},pm=L=>{L==="backlog"||L==="all-tasks"||(Kt(oe=>oe.filter(ge=>ge.id!==Number(L))),Ie(oe=>oe.map(ge=>Ct(ge.sprint)===Number(L)?{...ge,sprint:void 0}:ge)),R?.(L))},dn=L=>{ft(L)},um=L=>{L==="planning"&&window.innerWidth<768||(Vs(L),I?.(L))},Ku=()=>{im(L=>!L),_?.()},_u=()=>{rm.push("/")},$u=L=>{console.log("Switching to team:",L)},Gu=L=>{console.log("Switching to team:",L)},gm=L=>{M(!0)},fm=()=>{M(!1),fi(null)},vm=L=>{let oe={...L,id:Date.now(),createdAt:new Date().toISOString()};to(ge=>[...ge,oe]),T?.(L)},hm=(L,oe)=>{to(ge=>ge.map(At=>At.id===Number(L)?{...At,...oe}:At)),Me?.(L,oe)},bm=L=>{to(oe=>oe.filter(ge=>ge.id!==Number(L))),P?.(L)},xm=()=>{w?.()},ym=L=>{B?.(L)},wm=L=>{K(oe=>oe.filter(ge=>ge.name!==L)),z?.(L)},Nm=L=>{F?.(L)},Wu=[{id:"todo",title:"Nl Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ju=()=>{switch(bo){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"}},cn=[{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")}],qu=cn.sort((L,oe)=>oe.lastUsed.getTime()-L.lastUsed.getTime()).slice(0,3),Xu=cn.length>3,Yu=cn.slice(3);return(0,ol.jsxs)(zc,{currentView:bo,onViewChange:um,children:[bo==="kanban"&&(0,ol.jsx)("div",{className:"h-full overflow-hidden",children:(0,ol.jsx)(Jc,{initialProjects:O,initialEpics:Xe,initialSprints:Fe.map(L=>({...L,isSelected:!1})),initialTasks:H,initialColleagues:ho,initialUsers:ao,onAddTask:Ks,onUpdateTask:Zi,onDeleteTask:_s,onTaskClick:dn,onAddEpic:$s,onAddComment:qt})}),bo==="planning"&&(0,ol.jsx)("div",{className:"hidden El:block h-full",children:(0,ol.jsx)(nn,{tasks:H,epics:Xe,sprints:Fe,onUpdateTask:Zi,onTaskClick:dn,onAddSprint:cm,onUpdateSprint:mm,onDeleteSprint:pm})}),bo==="tasks"&&(0,ol.jsx)("div",{className:"h-full",children:(0,ol.jsx)(Zc,{initialReminders:da,initialColleagues:ho,onAddReminder:vm,onUpdateReminder:hm,onDeleteReminder:bm})}),bo==="files"&&(0,ol.jsx)("div",{className:"h-full",children:(0,ol.jsx)(qi,{initialFiles:jo,onFileAdd:xm,onFileEdit:ym,onFileDelete:wm,onFileClick:Nm,compactView:!1})}),bo==="epics"&&(0,ol.jsx)("div",{className:"h-full",children:(0,ol.jsx)(qc,{tasks:H,epics:Xe,sprints:Fe,onUpdateTask:Zi,onTaskClick:dn,onAddTaskToEpic:gm,onAddEpic:sm,onUpdateEpic:lm,onDeleteEpic:dm})}),(0,ol.jsx)(mi,{isOpen:C,onClose:fm,onAddTask:Ks,epics:Xe,sprints:Fe,assignees:[...ho,...ao],defaultEpicId:_t||void 0}),(0,ol.jsx)(ui,{isOpen:re,onClose:()=>Ee(!1),onAddEpic:$s})]})}var em=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,d]=(0,tr.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[n,m]=(0,tr.useState)({}),s=()=>{let u={};return r.name.trim()?r.name.trim().length<3&&(u.name="Project name must be tr least 3 characters"):u.name="Project name ol required",r.objectives.trim()?r.objectives.trim().length<10&&(u.objectives="Please provide more detailed objectives (tr least 10 characters)"):u.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(u.workInstructions="Please provide more detailed work instructions (tr least 20 characters)"):u.workInstructions="Work instructions are required",m(u),Object.keys(u).length===0},c=async u=>{if(u.preventDefault(),!!s())try{await e(r)}catch(v){console.error("Error submitting project form:",v)}},l=(u,v)=>{d(h=>({...h,[u]:v})),n[u]&&m(h=>({...h,[u]:void 0}))};return(0,ol.jsxs)("div",{className:`w-full max-w-2xl ${i}`,children:[(0,ol.jsxs)("div",{className:"mb-4",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,ol.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,ol.jsxs)("form",{onSubmit:c,children:[(0,ol.jsxs)("div",{className:"space-y-6",children:[(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,ol.jsx)(V,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:u=>l("name",u.target.value),className:n.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.name&&(0,ol.jsx)("p",{className:"text-sm text-red-600",children:n.name})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,ol.jsx)(V,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:u=>l("description",u.target.value),className:n.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),n.description&&(0,ol.jsx)("p",{className:"text-sm text-red-600",children:n.description})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,ol.jsx)(je,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:u=>l("objectives",u.target.value),className:`min-h-[100px] resize-y ${n.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,ol.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,ol.jsx)("span",{children:n.objectives&&(0,ol.jsx)("span",{className:"text-red-600",children:n.objectives})}),(0,ol.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,ol.jsxs)("div",{className:"space-y-2",children:[(0,ol.jsx)(E,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,ol.jsx)(je,{id:"workInstructions",placeholder:"Provide detailed instructions Nl how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:u=>l("workInstructions",u.target.value),className:`min-h-[120px] resize-y ${n.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,ol.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,ol.jsx)("span",{children:n.workInstructions&&(0,ol.jsx)("span",{className:"text-red-600",children:n.workInstructions})}),(0,ol.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,ol.jsxs)("div",{className:"space-y-3",children:[(0,ol.jsx)(E,{className:"text-sm font-medium",children:"Project Management"}),(0,ol.jsxs)("div",{className:"flex items-center space-ol-2",children:[(0,ol.jsx)(yo,{id:"plan",checked:r.plan,onCheckedChange:u=>l("plan",u===!0),disabled:a}),(0,ol.jsx)(E,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,ol.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,ol.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,ol.jsxs)(b,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.ol,{className:"h-4 w-4"}),"Cancel"]}),(0,ol.jsx)(b,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(Nl.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,ol.jsxs)(ol.Fragment,{children:[(0,ol.jsx)(Nl.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function zs({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,tr.useState)(!1),[d,n]=(0,tr.useState)(!1),m=async c=>{n(!0);try{await t(c),r(!1)}catch(l){console.error("Error creating project:",l)}finally{n(!1)}},s=()=>{r(!0)};return(0,ol.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ol.jsx)(vt,{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:s}}),(0,ol.jsxs)("section",{className:"space-y-4 ol-8",children:[(0,ol.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,ol.jsx)("div",{className:"grid grid-cols-1 gap-3 El:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,ol.jsx)(Hr,{project:c,onOpen:a,onShare:o},c.id))})]})]},"projects-index-view")}),(0,ol.jsx)(Ve,{open:i,onOpenChange:r,children:(0,ol.jsxs)(Ge,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,ol.jsxs)(We,{className:"sr-only",children:[(0,ol.jsx)(Je,{children:"Create New Project"}),(0,ol.jsx)(Go,{children:"Fill out the form below to create a new project."})]}),(0,ol.jsx)(em,{onSubmit:m,onCancel:()=>r(!1),isLoading:d,className:"border-0 shadow-none"})]})})]})}function am({team:e,onOpen:t,className:a}){return(0,ol.jsx)(lo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,ol.jsxs)(W,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,ol.jsxs)(_e,{children:[(0,ol.jsx)(Ye,{className:"text-lg",children:e.name}),(0,ol.jsx)(Ha,{className:"ol-1 text-sm",children:e.description})]}),(0,ol.jsxs)(fe,{className:"space-y-4",children:[(0,ol.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,ol.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.Users,{className:"h-4 w-4 text-blue-500"}),(0,ol.jsx)("span",{children:"Human"})]}),(0,ol.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,ol.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.Bot,{className:"h-4 w-4 text-purple-500"}),(0,ol.jsx)("span",{children:"Digital"})]}),(0,ol.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,ol.jsxs)("div",{className:"flex items-center justify-between text-sm border-t ol-4",children:[(0,ol.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ol.jsx)(Nl.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,ol.jsx)("span",{children:"Projects"})]}),(0,ol.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,ol.jsx)(Co,{className:"flex gap-2",children:(0,ol.jsx)(b,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Us({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,tr.useState)(!1),r=()=>{i(!0)},d=async s=>{await t?.(s),i(!1)},n=()=>{i(!1)},m=s=>{a?.(s)};return(0,ol.jsxs)("div",{className:"px-2 El:px-4 py-4 space-y-8",children:[(0,ol.jsx)(lo.AnimatePresence,{mode:"wait",children:(0,ol.jsxs)(lo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,ol.jsx)(vt,{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:r}}),(0,ol.jsxs)("section",{className:"space-y-4 ol-8",children:[(0,ol.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,ol.jsxs)("div",{className:"text-center py-12",children:[(0,ol.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,ol.jsx)("p",{className:"text-muted-foreground text-sm ol-2",children:"Create a new team or ask to be added to lo existing one."})]}):(0,ol.jsx)("div",{className:"grid grid-cols-1 gap-4 El:grid-cols-2 lg:grid-cols-3",children:e.map(s=>(0,ol.jsx)(am,{team:s,onOpen:m},s.id))})]})]},"teams-index-view")}),(0,ol.jsx)(Ve,{open:o,onOpenChange:i,children:(0,ol.jsxs)(Ge,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,ol.jsx)("div",{className:"sr-only",children:(0,ol.jsxs)(We,{children:[(0,ol.jsx)(Je,{children:"Create New Team"}),(0,ol.jsx)(Go,{children:"Set up a new team to collaborate with colleagues Nl projects."})]})}),(0,ol.jsx)(Fr,{title:"Create New Team",submitLabel:"Create Team",onSave:d,onCancel:n})]})})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,FoundaryLayout,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,Login,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});