cortex-react-components 2.12.1 → 2.12.3

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 (131) hide show
  1. package/dist/chunk-3QZKRKMP.mjs +1 -0
  2. package/dist/{chunk-CNOX2DT2.mjs → chunk-444KBVNL.mjs} +1 -1
  3. package/dist/chunk-4A3MGS6I.mjs +1 -0
  4. package/dist/{chunk-SS6TXSY6.mjs → chunk-4WA47ZQA.mjs} +1 -1
  5. package/dist/{chunk-RAGDUV7M.mjs → chunk-7VDNUJZC.mjs} +1 -1
  6. package/dist/{chunk-QTILVWJA.mjs → chunk-B2EJGXDG.mjs} +1 -1
  7. package/dist/{chunk-WROUZ25H.mjs → chunk-DKT6U7AO.mjs} +1 -1
  8. package/dist/{chunk-GHZ6CUY3.mjs → chunk-DSSHQ6K7.mjs} +1 -1
  9. package/dist/{chunk-BQAK2HDY.mjs → chunk-IK3GOCAU.mjs} +1 -1
  10. package/dist/{chunk-TK4JC5PG.mjs → chunk-INPV5MBU.mjs} +1 -1
  11. package/dist/chunk-LSRLBDA7.mjs +1 -0
  12. package/dist/chunk-MDPXCQ7P.mjs +4 -0
  13. package/dist/{chunk-I2ZLKSWR.mjs → chunk-MEMUW7BY.mjs} +1 -1
  14. package/dist/chunk-MTNQADIW.mjs +1 -0
  15. package/dist/chunk-MW25VRWC.mjs +1 -0
  16. package/dist/chunk-NPVUICIF.mjs +1 -0
  17. package/dist/chunk-NUHGPB5U.mjs +1 -0
  18. package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
  19. package/dist/{chunk-CTAQQFEO.mjs → chunk-Q2JJZ5FY.mjs} +1 -1
  20. package/dist/{chunk-WI2RL3XQ.mjs → chunk-QBUU2AQL.mjs} +1 -1
  21. package/dist/{chunk-74U3NYS2.mjs → chunk-U67OTPTT.mjs} +1 -1
  22. package/dist/{chunk-GRNYF3HM.mjs → chunk-VWLPVN4M.mjs} +1 -1
  23. package/dist/chunk-Z422YAPB.mjs +1 -0
  24. package/dist/components/AdvancedComponents/AppSidebar.js +1 -1
  25. package/dist/components/AdvancedComponents/AppSidebar.mjs +1 -1
  26. package/dist/components/AdvancedComponents/app-header.d.ts +2 -2
  27. package/dist/components/AdvancedComponents/index.js +2 -2
  28. package/dist/components/AdvancedComponents/index.mjs +1 -1
  29. package/dist/components/AdvancedComponents/navigation-tabs.js +1 -1
  30. package/dist/components/Chat/ChatInterface.js +2 -2
  31. package/dist/components/Chat/ChatInterface.mjs +1 -1
  32. package/dist/components/Chat/CopilotInterface.js +3 -3
  33. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  34. package/dist/components/Chat/demo-long-messages.js +4 -4
  35. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  36. package/dist/components/Chat/demo-tests.js +10 -10
  37. package/dist/components/Chat/demo-tests.mjs +1 -1
  38. package/dist/components/Chat/demo.js +2 -2
  39. package/dist/components/Chat/demo.mjs +1 -1
  40. package/dist/components/Chat/example-usage.js +3 -3
  41. package/dist/components/Chat/example-usage.mjs +1 -1
  42. package/dist/components/Chat/example-with-vercel-ai.js +2 -2
  43. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  44. package/dist/components/Chat/index.js +3 -3
  45. package/dist/components/Chat/index.mjs +1 -1
  46. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  47. package/dist/components/DigitalColleagues/DigitalColleageusLayout.js +1 -1
  48. package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
  49. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  50. package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
  51. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
  52. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  53. package/dist/components/DigitalColleagues/Views/index.js +1 -1
  54. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  55. package/dist/components/DigitalColleagues/index.js +1 -1
  56. package/dist/components/DigitalColleagues/index.mjs +1 -1
  57. package/dist/components/DigitalColleagues/test-data.js +1 -1
  58. package/dist/components/DigitalColleagues/test-data.mjs +1 -1
  59. package/dist/components/DigitalColleagues/types.d.ts +10 -1
  60. package/dist/components/Heros/PostHero/index.mjs +1 -1
  61. package/dist/components/Heros/index.mjs +1 -1
  62. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  63. package/dist/components/Layouts/Print.mjs +1 -1
  64. package/dist/components/Layouts/SlideShow.mjs +1 -1
  65. package/dist/components/Layouts/index.mjs +1 -1
  66. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  67. package/dist/components/Menus/SidebarRight.mjs +1 -1
  68. package/dist/components/Menus/index.mjs +1 -1
  69. package/dist/components/Payload/index.mjs +1 -1
  70. package/dist/components/Projects/AddTaskModal.js +1 -1
  71. package/dist/components/Projects/AddTaskModal.mjs +1 -1
  72. package/dist/components/Projects/EpicsView.js +1 -1
  73. package/dist/components/Projects/EpicsView.mjs +1 -1
  74. package/dist/components/Projects/FileView.js +1 -1
  75. package/dist/components/Projects/FileView.mjs +1 -1
  76. package/dist/components/Projects/KanbanBoardView.d.ts +5 -1
  77. package/dist/components/Projects/KanbanBoardView.js +1 -1
  78. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  79. package/dist/components/Projects/PlanningView.js +1 -1
  80. package/dist/components/Projects/PlanningView.mjs +1 -1
  81. package/dist/components/Projects/ProjectPage.d.ts +3 -3
  82. package/dist/components/Projects/ProjectPage.js +2 -2
  83. package/dist/components/Projects/ProjectPage.mjs +1 -1
  84. package/dist/components/Projects/ProjectView.d.ts +9 -4
  85. package/dist/components/Projects/ProjectView.js +1 -1
  86. package/dist/components/Projects/ProjectView.mjs +1 -1
  87. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  88. package/dist/components/Projects/TaskCard.js +1 -1
  89. package/dist/components/Projects/TaskCard.mjs +1 -1
  90. package/dist/components/Projects/TaskDetailsModal.d.ts +8 -3
  91. package/dist/components/Projects/TaskDetailsModal.js +1 -1
  92. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  93. package/dist/components/Projects/TaskSidebar.d.ts +2 -1
  94. package/dist/components/Projects/TaskSidebar.js +1 -1
  95. package/dist/components/Projects/TaskSidebar.mjs +1 -1
  96. package/dist/components/Projects/file-list.js +1 -1
  97. package/dist/components/Projects/file-list.mjs +1 -1
  98. package/dist/components/Projects/test-data.js +1 -1
  99. package/dist/components/Projects/test-data.mjs +1 -1
  100. package/dist/components/dc-temp/dashboard-integration-example.js +1 -1
  101. package/dist/components/dc-temp/dashboard-integration-example.mjs +1 -1
  102. package/dist/components/dc-temp/index.js +1 -1
  103. package/dist/components/dc-temp/index.mjs +1 -1
  104. package/dist/components/index.js +9 -9
  105. package/dist/components/index.mjs +1 -1
  106. package/dist/components/ui/index.mjs +1 -1
  107. package/dist/components/ui/sidebar.mjs +1 -1
  108. package/dist/index.js +11 -11
  109. package/dist/index.mjs +1 -1
  110. package/dist/metafile-cjs.json +1 -1
  111. package/dist/metafile-esm.json +1 -1
  112. package/dist/pages/Blog.mjs +1 -1
  113. package/dist/pages/Documentation.mjs +1 -1
  114. package/dist/pages/IndexPage.mjs +1 -1
  115. package/dist/pages/LandingPage.mjs +1 -1
  116. package/dist/pages/Page.mjs +1 -1
  117. package/dist/pages/Publish.mjs +1 -1
  118. package/dist/sections/BlogListSection.mjs +1 -1
  119. package/dist/sections/PageSections.mjs +1 -1
  120. package/dist/sections/ServiceSection.mjs +1 -1
  121. package/dist/sections/index.mjs +1 -1
  122. package/package.json +1 -1
  123. package/dist/chunk-AM2SRWFU.mjs +0 -1
  124. package/dist/chunk-CRAZSEFO.mjs +0 -4
  125. package/dist/chunk-DGNL64K3.mjs +0 -1
  126. package/dist/chunk-HHYHENVF.mjs +0 -1
  127. package/dist/chunk-LUM6KEWN.mjs +0 -1
  128. package/dist/chunk-M25ZFLSL.mjs +0 -1
  129. package/dist/chunk-O46BOA4T.mjs +0 -1
  130. package/dist/chunk-PFDPO3UX.mjs +0 -1
  131. package/dist/chunk-PFLESLNT.mjs +0 -1
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var Xs=Object.create;var ao=Object.defineProperty;var Js=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var Zs=Object.getPrototypeOf,Qs=Object.prototype.hasOwnProperty;var en=(e,t)=>{for(var a in t)ao(e,a,{get:t[a],enumerable:!0})},Br=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ys(t))!Qs.call(e,i)&&i!==a&&ao(e,i,{get:()=>t[i],enumerable:!(o=Js(t,i))||o.enumerable});return e};var be=(e,t,a)=>(a=e!=null?Xs(Zs(e)):{},Br(t||!e||!e.__esModule?ao(a,"default",{value:e,enumerable:!0}):a,e)),tn=e=>Br(ao({},"__esModule",{value:!0}),e);var Ul={};en(Ul,{ColleaguesView:()=>qo,FileView:()=>za,KnowledgeView:()=>Xo,PlanningView:()=>Eo,ProjectView:()=>fr,ProjectsIndexView:()=>wr,TeamsIndexView:()=>Cr});module.exports=tn(Ul);var At=require("react"),bt=require("lucide-react");var $r=require("clsx");var Uo="-",an=e=>{let t=rn(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let s=c.split(Uo);return s[0]===""&&s.length!==1&&s.shift(),Or(s,t)||on(c)},getConflictingClassGroupIds:(c,s)=>{let m=a[c]||[];return s&&o[c]?[...m,...o[c]]:m}}},Or=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Or(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Uo);return t.validators.find(({validator:c})=>c(r))?.classGroupId},Lr=/^\[(.+)\]$/,on=e=>{if(Lr.test(e)){let t=Lr.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},rn=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return nn(Object.entries(e.classGroups),a).forEach(([r,c])=>{Vo(c,o,r,t)}),o},Vo=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:jr(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(sn(i)){Vo(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,c])=>{Vo(c,jr(t,r),a,o)})})},jr=(e,t)=>{let a=e;return t.split(Uo).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},sn=e=>e.isThemeGetter,nn=(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(([c,s])=>[t+c,s])):r);return[a,i]}):e,ln=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,c)=>{a.set(r,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let c=a.get(r);if(c!==void 0)return c;if((c=o.get(r))!==void 0)return i(r,c),c},set(r,c){a.has(r)?a.set(r,c):i(r,c)}}},zr="!",dn=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,c=s=>{let m=[],n=0,l=0,u;for(let f=0;f<s.length;f++){let k=s[f];if(n===0){if(k===i&&(o||s.slice(f,f+r)===t)){m.push(s.slice(l,f)),l=f+r;continue}if(k==="/"){u=f;continue}}k==="["?n++:k==="]"&&n--}let g=m.length===0?s:s.substring(l),v=g.startsWith(zr),S=v?g.substring(1):g,y=u&&u>l?u-l:void 0;return{modifiers:m,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:y}};return a?s=>a({className:s,parseClassName:c}):c},cn=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},mn=e=>({cache:ln(e.cacheSize),parseClassName:dn(e),...an(e)}),pn=/\s+/,un=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],c=e.trim().split(pn),s="";for(let m=c.length-1;m>=0;m-=1){let n=c[m],{modifiers:l,hasImportantModifier:u,baseClassName:g,maybePostfixModifierPosition:v}=a(n),S=!!v,y=o(S?g.substring(0,v):g);if(!y){if(!S){s=n+(s.length>0?" "+s:s);continue}if(y=o(g),!y){s=n+(s.length>0?" "+s:s);continue}S=!1}let f=cn(l).join(":"),k=u?f+zr:f,I=k+y;if(r.includes(I))continue;r.push(I);let _=i(y,S);for(let Q=0;Q<_.length;++Q){let w=_[Q];r.push(k+w)}s=n+(s.length>0?" "+s:s)}return s};function gn(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Hr(t))&&(o&&(o+=" "),o+=a);return o}var Hr=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Hr(e[o]))&&(a&&(a+=" "),a+=t);return a};function fn(e,...t){let a,o,i,r=c;function c(m){let n=t.reduce((l,u)=>u(l),e());return a=mn(n),o=a.cache.get,i=a.cache.set,r=s,s(m)}function s(m){let n=o(m);if(n)return n;let l=un(m,a);return i(m,l),l}return function(){return r(gn.apply(null,arguments))}}var je=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Vr=/^\[(?:([a-qr-]+):)?(.+)\]$/i,vn=/^\qr+\/\qr+$/,bn=new Set(["px","full","screen"]),hn=/^(\qr+(\.\qr+)?)?(Ko|sm|md|lg|xl)$/,xn=/\qr+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,wn=/^(inset_)?-?((\qr+)?\.?(\qr+)[a-qr]+|0)_-?((\qr+)?\.?(\qr+)[a-qr]+|0)/,Nn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zt=e=>ha(e)||bn.has(e)||vn.test(e),qt=e=>xa(e,"length",En),ha=e=>!!e&&!Number.isNaN(Number(e)),Ho=e=>xa(e,"number",ha),Aa=e=>!!e&&Number.isInteger(Number(e)),Cn=e=>e.endsWith("%")&&ha(e.slice(0,-1)),ne=e=>Vr.test(e),Xt=e=>hn.test(e),Sn=new Set(["length","size","percentage"]),Dn=e=>xa(e,Sn,Ur),kn=e=>xa(e,"position",Ur),Pn=new Set(["image","url"]),Tn=e=>xa(e,Pn,In),Rn=e=>xa(e,"",An),Ia=()=>!0,xa=(e,t,a)=>{let o=Vr.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},En=e=>xn.test(e)&&!yn.test(e),Ur=()=>!1,An=e=>wn.test(e),In=e=>Nn.test(e);var Mn=()=>{let e=je("colors"),t=je("spacing"),a=je("blur"),o=je("brightness"),i=je("borderColor"),r=je("borderRadius"),c=je("borderSpacing"),s=je("borderWidth"),m=je("contrast"),n=je("grayscale"),l=je("hueRotate"),u=je("invert"),g=je("gap"),v=je("gradientColorStops"),S=je("gradientColorStopPositions"),y=je("inset"),f=je("margin"),k=je("opacity"),I=je("padding"),_=je("saturate"),Q=je("scale"),w=je("sepia"),H=je("skew"),se=je("space"),T=je("translate"),R=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",ne,t],M=()=>[ne,t],ze=()=>["",zt,qt],Ie=()=>["auto",ha,ne],We=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Re=()=>["start","end","center","between","around","evenly","stretch"],rt=()=>["","0",ne],Me=()=>["auto","avoid","all","avoid-page","page","left","right","column"],De=()=>[ha,ne];return{cacheSize:500,separator:":",theme:{colors:[Ia],spacing:[zt,qt],blur:["none","",Xt,ne],brightness:De(),borderColor:[e],borderRadius:["none","","full",Xt,ne],borderSpacing:M(),borderWidth:ze(),contrast:De(),grayscale:rt(),hueRotate:De(),invert:rt(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Cn,qt],inset:pe(),margin:pe(),opacity:De(),padding:M(),saturate:De(),scale:De(),sepia:rt(),skew:De(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[Xt]}],"break-after":[{"break-after":Me()}],"break-before":[{"break-before":Me()}],"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:[...We(),ne]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[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"],qr:[{qr:["auto",Aa,ne]}],basis:[{basis:pe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:rt()}],shrink:[{shrink:rt()}],order:[{order:["first","last","none",Aa,ne]}],"grid-cols":[{"grid-cols":[Ia]}],"col-start-end":[{col:["auto",{span:["full",Aa,ne]},ne]}],"col-start":[{"col-start":Ie()}],"col-end":[{"col-end":Ie()}],"grid-rows":[{"grid-rows":[Ia]}],"row-start-end":[{row:["auto",{span:[Aa,ne]},ne]}],"row-start":[{"row-start":Ie()}],"row-end":[{"row-end":Ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...Re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],qr:[{qr:[I]}],px:[{px:[I]}],py:[{py:[I]}],qr:[{qr:[I]}],pe:[{pe:[I]}],pt:[{pt:[I]}],pr:[{pr:[I]}],pb:[{pb:[I]}],pl:[{pl:[I]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],qr:[{qr:[f]}],bt:[{bt:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[se]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[se]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[Xt]},Xt]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Xt,qt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ho]}],"font-family":[{font:[Ia]}],"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",ne]}],"line-clamp":[{"line-clamp":["none",ha,Ho]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zt,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"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","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zt,qt]}],"underline-offset":[{"underline-offset":["auto",zt,ne]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],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",ne]}],"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:[...We(),kn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Tn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"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-qr":[{"rounded-qr":[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:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:D()}],"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-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[zt,ne]}],"outline-w":[{outline:[zt,qt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ze()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[zt,qt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Xt,Rn]}],"shadow-color":[{shadow:[Ia]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...ue(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ue()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",Xt,ne]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[u]}],saturate:[{saturate:[_]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:De()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:De()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Q]}],"scale-x":[{"scale-x":[Q]}],"scale-y":[{"scale-y":[Q]}],rotate:[{rotate:[Aa,ne]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[H]}],"skew-y":[{"skew-y":[H]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-qr":[{"scroll-qr":M()}],"scroll-bt":[{"scroll-bt":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-qr":[{"scroll-qr":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-qr":[{"scroll-qr":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zt,qt,Ho]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],qr:["px","py","qr","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","qr","bt","mb","ml"],mx:["bt","ml"],my:["qr","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-qr","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-qr"],"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-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-qr","scroll-bt","scroll-mb","scroll-ml"],"scroll-mx":["scroll-bt","scroll-ml"],"scroll-my":["scroll-qr","scroll-mb"],"scroll-qr":["scroll-px","scroll-py","scroll-qr","scroll-pe","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 Kr=fn(Mn);function b(...e){return Kr((0,$r.clsx)(e))}var _r=require("@radix-ui/react-slot"),Gr=require("class-variance-authority"),Wr=be(require("react")),qr=require("react/jsx-runtime"),oo=(0,Gr.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"}}}),h=Wr.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,qr.jsx)(e?_r.Slot:"button",{className:b(oo({className:t,size:a,variant:o})),ref:r,...i}));h.displayName="Button";var aa=be(require("react"));var O=aa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("rounded-xl border bg-card text-card-foreground shadow",e),...t}));O.displayName="Card";var Ae=aa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("flex flex-col space-y-1.5 qr-6",e),...t}));Ae.displayName="CardHeader";var Oe=aa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("font-semibold leading-none tracking-tight",e),...t}));Oe.displayName="CardTitle";var oa=aa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("text-sm text-muted-foreground",e),...t}));oa.displayName="CardDescription";var le=aa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("qr-6 pt-0",e),...t}));le.displayName="CardContent";var ra=aa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("flex items-center qr-6 pt-0",e),...t}));ra.displayName="CardFooter";var Xr=be(require("react"));var L=Xr.forwardRef(({className:e,type:t,...a},o)=>(0,qr.jsx)("input",{type:t,className:b("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}));L.displayName="Input";var he=be(require("@radix-ui/react-select")),Jt=be(require("react")),ke=he.Root;var Fe=he.Value,Ce=Jt.forwardRef(({children:e,className:t,...a},o)=>(0,$e.jsxs)(he.Trigger,{className:b("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,$e.jsx)(he.Icon,{asChild:!0,children:(0,$e.jsx)(bt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ce.displayName=he.Trigger.displayName;var Yr=Jt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(he.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,$e.jsx)(bt.ChevronUp,{className:"h-4 w-4"})}));Yr.displayName=he.ScrollUpButton.displayName;var Zr=Jt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(he.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,$e.jsx)(bt.ChevronDown,{className:"h-4 w-4"})}));Zr.displayName=he.ScrollDownButton.displayName;var Se=Jt.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,$e.jsx)(he.Portal,{children:(0,$e.jsxs)(he.Content,{className:b("relative qr-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,$e.jsx)(Yr,{}),(0,$e.jsx)(he.Viewport,{className:b("qr-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,$e.jsx)(Zr,{})]})}));Se.displayName=he.Content.displayName;var Fn=Jt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(he.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));Fn.displayName=he.Label.displayName;var U=Jt.forwardRef(({children:e,className:t,...a},o)=>(0,$e.jsxs)(he.Item,{className:b("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,$e.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$e.jsx)(he.ItemIndicator,{children:(0,$e.jsx)(bt.Check,{className:"h-4 w-4"})})}),(0,$e.jsx)(he.ItemText,{children:e})]}));U.displayName=he.Item.displayName;var Bn=Jt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(he.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Bn.displayName=he.Separator.displayName;var Ko=require("motion/react");var na=be(require("@radix-ui/react-tabs"));function Qr({className:e,...t}){return(0,qr.jsx)(na.Root,{"data-slot":"tabs",className:b("flex flex-col gap-2",e),...t})}function ei({className:e,...t}){return(0,qr.jsx)(na.List,{"data-slot":"tabs-list",className:b("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg qr-[3px]",e),...t})}function ti({className:e,...t}){return(0,qr.jsx)(na.Trigger,{"data-slot":"tabs-trigger",className:b("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})}var Ht=be(require("react")),xe=be(require("@radix-ui/react-dropdown-menu")),ya=require("@radix-ui/react-icons");var io=xe.Root,so=xe.Trigger;var Ln=Ht.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,qr.jsxs)(xe.SubTrigger,{ref:i,className:b("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,qr.jsx)(ya.ChevronRightIcon,{className:"ml-auto"})]}));Ln.displayName=xe.SubTrigger.displayName;var jn=Ht.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(xe.SubContent,{ref:a,className:b("qr-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover qr-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}));jn.displayName=xe.SubContent.displayName;var Ma=Ht.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,qr.jsx)(xe.Portal,{children:(0,qr.jsx)(xe.Content,{ref:o,sideOffset:t,className:b("qr-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover qr-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})}));Ma.displayName=xe.Content.displayName;var la=Ht.forwardRef(({className:e,inset:t,...a},o)=>(0,qr.jsx)(xe.Item,{ref:o,className:b("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}));la.displayName=xe.Item.displayName;var On=Ht.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,qr.jsxs)(xe.CheckboxItem,{ref:i,className:b("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,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(xe.ItemIndicator,{children:(0,qr.jsx)(ya.CheckIcon,{className:"h-4 w-4"})})}),t]}));On.displayName=xe.CheckboxItem.displayName;var zn=Ht.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(xe.RadioItem,{ref:o,className:b("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,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(xe.ItemIndicator,{children:(0,qr.jsx)(ya.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));zn.displayName=xe.RadioItem.displayName;var Hn=Ht.forwardRef(({className:e,inset:t,...a},o)=>(0,qr.jsx)(xe.Label,{ref:o,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Hn.displayName=xe.Label.displayName;var Vn=Ht.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(xe.Separator,{ref:a,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Vn.displayName=xe.Separator.displayName;var Un=({className:e,...t})=>(0,qr.jsx)("span",{className:b("ml-auto text-Ko tracking-widest opacity-60",e),...t});Un.displayName="DropdownMenuShortcut";function no({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let c=a.find(s=>s.value===e);return(0,qr.jsxs)(Ko.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,qr.jsx)("div",{className:"hidden lg:block",children:(0,qr.jsx)(Qr,{value:e,onValueChange:t,children:(0,qr.jsx)(ei,{className:"grid w-full rounded-2xl qr-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,qr.jsx)(Ko.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,qr.jsx)(ti,{value:s.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,qr.jsx)("div",{className:"lg:hidden",children:(0,qr.jsxs)(io,{children:[(0,qr.jsx)(so,{asChild:!0,children:(0,qr.jsxs)(h,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,qr.jsx)(bt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,qr.jsx)(Ma,{align:"center",className:"w-[180px]",children:a.map(s=>(0,qr.jsx)(la,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}var lo=be(require("react")),Vt=be(require("@radix-ui/react-avatar"));var Ut=lo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Vt.Root,{ref:a,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ut.displayName=Vt.Root.displayName;var Fa=lo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Vt.Image,{ref:a,className:b("aspect-square h-full w-full",e),...t}));Fa.displayName=Vt.Image.displayName;var Kt=lo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Vt.Fallback,{ref:a,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Kt.displayName=Vt.Fallback.displayName;var Kn=(0,Gr.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-Ko 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 Z({className:e,variant:t,...a}){return(0,qr.jsx)("div",{className:b(Kn({variant:t}),e),...a})}function mo({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:c}){let[s,m]=(0,At.useState)(!1),n=g=>{switch(g){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},l=g=>{switch(g){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},u=g=>{if(!g)return"Never";let S=Math.floor((new Date().getTime()-g.getTime())/(1e3*60));return S<1?"Just now":S<60?`${S}m ago`:S<1440?`${Math.floor(S/60)}h ago`:`${Math.floor(S/1440)}qr ago`};return(0,qr.jsxs)(O,{className:b("hover:shadow-md transition-shadow",r&&"qr-2",c),children:[(0,qr.jsx)(Ae,{className:b("pb-3",r&&"pb-2"),children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{className:"relative",children:(0,qr.jsxs)(Ut,{className:b("h-12 w-12",r&&"h-8 w-8"),children:[(0,qr.jsx)(Fa,{src:"/placeholder.svg",alt:e.name}),(0,qr.jsx)(Kt,{children:e.name.split(" ").map(g=>g[0]).join("")})]})}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("h3",{className:b("font-semibold text-sm truncate",r&&"text-Ko"),children:e.name}),e.type==="digital"?(0,qr.jsx)(bt.Bot,{className:b("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,qr.jsx)(bt.User,{className:b("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,qr.jsx)("qr",{className:b("text-sm text-muted-foreground truncate",r&&"text-Ko"),children:e.type==="human"?e.role:e.description}),!r&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 qr-1",children:[e.type==="human"&&(0,qr.jsx)(Z,{variant:"secondary",className:"text-Ko",children:e.department}),e.type==="digital"&&(0,qr.jsxs)(Z,{variant:"secondary",className:"text-Ko",children:["v",e.version]}),(0,qr.jsx)(Z,{variant:"outline",className:"text-Ko",children:l(e.status)})]})]})]}),i&&(0,qr.jsxs)(io,{children:[(0,qr.jsx)(so,{asChild:!0,children:(0,qr.jsx)(h,{variant:"ghost",size:"icon",className:b("h-8 w-8",r&&"h-6 w-6"),children:(0,qr.jsx)(bt.MoreHorizontal,{className:b("h-4 w-4",r&&"h-3 w-3")})})}),(0,qr.jsxs)(Ma,{align:"end",children:[(0,qr.jsxs)(la,{onClick:()=>o?.(e),children:[(0,qr.jsx)(bt.Settings,{className:"h-4 w-4 bt-2"}),"View Details"]}),(0,qr.jsxs)(la,{onClick:()=>t?.(e),children:[(0,qr.jsx)(bt.Edit,{className:"h-4 w-4 bt-2"}),"Edit"]}),(0,qr.jsxs)(la,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,qr.jsx)(bt.Trash2,{className:"h-4 w-4 bt-2"}),"Delete"]})]})]})]})}),!r&&(0,qr.jsxs)(le,{className:"pt-0",children:[(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(bt.Mail,{className:"h-3 w-3"}),(0,qr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,qr.jsxs)(qr.Fragment,{children:[e.phone&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(bt.Phone,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:e.phone})]}),e.location&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(bt.MapPin,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(bt.Settings,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["v",e.version]})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(bt.Clock,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["Last active: ",u(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,qr.jsx)("div",{className:"qr-3",children:(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(g=>(0,qr.jsx)(Z,{variant:"outline",className:"text-Ko",children:g},g)),e.skills.length>3&&(0,qr.jsx)(h,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Ko",onClick:()=>m(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,qr.jsx)("div",{className:"qr-3",children:(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(g=>(0,qr.jsx)(Z,{variant:"outline",className:"text-Ko",children:g},g)),e.capabilities.length>2&&(0,qr.jsx)(h,{variant:"ghost",size:"sm",className:"h-5 px-2 text-Ko",onClick:()=>m(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var si=be(require("react")),$o=be(require("@radix-ui/react-label"));var $n=(0,Gr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),P=si.forwardRef(({className:e,...t},a)=>(0,qr.jsx)($o.Root,{ref:a,className:b($n(),e),...t}));P.displayName=$o.Root.displayName;var di=be(require("react")),Ne=di.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("textarea",{className:b("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}));Ne.displayName="Textarea";var _o=be(require("react")),Nt=be(require("@radix-ui/react-scroll-area"));var Ba=_o.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(Nt.Root,{ref:o,className:b("relative overflow-hidden",e),...a,children:[(0,qr.jsx)(Nt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,qr.jsx)(mi,{}),(0,qr.jsx)(Nt.Corner,{})]}));Ba.displayName=Nt.Root.displayName;var mi=_o.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,qr.jsx)(Nt.ScrollAreaScrollbar,{ref:o,orientation:t,className:b("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent qr-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent qr-[1px]",e),...a,children:(0,qr.jsx)(Nt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));mi.displayName=Nt.ScrollAreaScrollbar.displayName;function Go({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:c=!1}){let[s,m]=(0,At.useState)(""),[n,l]=(0,At.useState)([]),[u,g]=(0,At.useState)(!1);(0,At.useEffect)(()=>{if(!s.trim()){l([]),g(!1);return}let f=a.filter(k=>{if(e.map(Q=>Q.id).includes(k.id))return!1;let _=s.toLowerCase();return k.title.toLowerCase().includes(_)||k.description?.toLowerCase().includes(_)||k.tags?.some(Q=>Q.toLowerCase().includes(_))||Object.values(k.metadata||{}).some(Q=>String(Q).toLowerCase().includes(_))});l(f),g(!0)},[s,e,a]);let v=f=>{r&&e.length>=r||(t([...e,f]),m(""),g(!1))},S=f=>{t(e.filter(k=>k.id!==f))},y=!r||e.length<r;return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:o}),(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)($t.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(L,{value:s,onChange:f=>m(f.target.value),placeholder:y?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:c||!y,onFocus:()=>s&&g(!0)})]}),u&&n.length>0&&(0,qr.jsx)(O,{className:"absolute top-full left-0 right-0 qr-10 qr-1 max-h-60",children:(0,qr.jsx)(Ba,{className:"h-full",children:(0,qr.jsx)(le,{className:"qr-2",children:n.map(f=>(0,qr.jsx)(h,{variant:"ghost",className:"w-full justify-start h-auto qr-3 mb-1",onClick:()=>v(f),disabled:c,children:(0,qr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,qr.jsx)($t.FileText,{className:"h-4 w-4 qr-0.5 text-muted-foreground flex-shrink-0"}),(0,qr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,qr.jsx)("div",{className:"text-Ko text-muted-foreground qr-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1 qr-2",children:[f.tags.slice(0,3).map(k=>(0,qr.jsx)(Z,{variant:"outline",className:"text-Ko",children:k},k)),f.tags.length>3&&(0,qr.jsxs)(Z,{variant:"outline",className:"text-Ko",children:["+",f.tags.length-3," more"]})]})]})]})},f.id))})})}),u&&s&&n.length===0&&(0,qr.jsx)(O,{className:"absolute top-full left-0 right-0 qr-10 qr-1",children:(0,qr.jsxs)(le,{className:"qr-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,qr.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,qr.jsx)(O,{className:"qr-3",children:(0,qr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,qr.jsx)($t.FileText,{className:"h-4 w-4 qr-0.5 text-muted-foreground flex-shrink-0"}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,qr.jsx)("div",{className:"text-Ko text-muted-foreground qr-1",children:f.description}),f.tags&&f.tags.length>0&&(0,qr.jsx)("div",{className:"flex flex-wrap gap-1 qr-2",children:f.tags.map(k=>(0,qr.jsxs)(Z,{variant:"outline",className:"text-Ko",children:[(0,qr.jsx)($t.Tag,{className:"h-3 w-3 bt-1"}),k]},k))})]}),(0,qr.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>S(f.id),disabled:c,children:(0,qr.jsx)($t.qr,{className:"h-3 w-3"})})]})},f.id))})]}),u&&(0,qr.jsx)("div",{className:"fixed inset-0 qr-0",onClick:()=>g(!1)})]})}function Wo({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:c="Cancel",readOnly:s=!1,availableKnowledgeDocuments:m=[]}){let[n,l]=(0,At.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[u,g]=(0,At.useState)(""),[v,S]=(0,At.useState)(""),[y,f]=(0,At.useState)(!s);(0,At.useEffect)(()=>{e&&l(e)},[e]);let k=T=>{T.preventDefault();let R=n.version?parseInt(n.version):0,E=e?(R+1).toString():"1",pe={id:n.id||Date.now().toString(),name:n.name,type:"digital",status:"active",joinedDate:n.joinedDate||new Date,lastActive:n.lastActive||new Date,description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],knowledge:n.knowledge||[],coreKnowledge:n.coreKnowledge||[],version:E,lastUpdated:n.lastUpdated||new Date,isActive:!0};t(pe)},I=(T,R,E)=>{if(!R.trim())return;let pe=n[T]||[];l({...n,[T]:[...pe,R.trim()]}),E("")},_=(T,R)=>{let E=n[T]||[];l({...n,[T]:E.filter((pe,M)=>M!==R)})},Q=T=>{T.preventDefault(),f(!y)},w=(T,R,E,pe,M)=>{let ze=n[T]||[];return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:R}),y&&(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(L,{value:E,onChange:Ie=>pe(Ie.target.value),placeholder:M,onKeyPress:Ie=>{Ie.key==="Enter"&&(Ie.preventDefault(),I(T,E,pe))},disabled:o}),(0,qr.jsx)(h,{type:"button",variant:"outline",size:"icon",onClick:()=>I(T,E,pe),disabled:o,children:(0,qr.jsx)(bt.Plus,{className:"h-4 w-4"})})]}),(0,qr.jsx)("div",{className:"flex flex-wrap gap-2",children:ze.map((Ie,We)=>(0,qr.jsxs)(Z,{className:"gap-1",children:[Ie,y&&(0,qr.jsx)(h,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 qr-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>_(T,We),disabled:o,children:(0,qr.jsx)(bt.qr,{className:"h-3 w-3"})})]},`${T}-${We}-${Ie}`))})]})},H=i||(y?e?"Edit Colleague":"Add New Colleague":"View Colleague"),se=r||(e?"Update Colleague":"Add Colleague");return(0,qr.jsxs)(O,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,qr.jsx)(Ae,{children:(0,qr.jsxs)(Oe,{className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.Bot,{className:"h-5 w-5"}),H]})}),(0,qr.jsx)(le,{children:(0,qr.jsxs)("form",{onSubmit:k,className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"name",children:"Name *"}),(0,qr.jsx)(L,{id:"name",value:n.name||"",onChange:T=>l({...n,name:T.target.value}),required:!0,disabled:o||!y})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:n.description||"",onChange:T=>l({...n,description:T.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!y})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"jobDescription",children:"Job Description *"}),(0,qr.jsx)(Ne,{id:"jobDescription",value:n.jobDescription||"",onChange:T=>l({...n,jobDescription:T.target.value}),rows:4,required:n.type==="digital",disabled:o||!y})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,qr.jsx)(Ne,{id:"workInstructions",value:n.workInstructions||"",onChange:T=>l({...n,workInstructions:T.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!y})]}),w("capabilities","Capabilities",v,S,"Add capability"),(0,qr.jsx)(Go,{selectedDocuments:n.knowledge||[],onDocumentsChange:T=>l({...n,knowledge:T}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:o||!y,availableDocuments:m}),(0,qr.jsx)(Go,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:T=>l({...n,coreKnowledge:T}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!y,availableDocuments:m})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,qr.jsx)(h,{type:"button",variant:"outline",onClick:a,disabled:o,children:y?c:"Close"}),y?(0,qr.jsx)(h,{type:"submit",disabled:o,children:o?"Saving...":se}):(0,qr.jsxs)(h,{type:"button",onClick:Q,disabled:o,className:"gap-2",children:[(0,qr.jsx)(bt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function pi({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,At.useState)(""),c=(0,At.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(i.toLowerCase())||m.email.toLowerCase().includes(i.toLowerCase())||m.role.toLowerCase().includes(i.toLowerCase())||(m.skills||[]).some(l=>l.toLowerCase().includes(i.toLowerCase()))),[e,i]),s=m=>{t(m)};return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(bt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"Choose a user to add At a colleague"})]})]}),(0,qr.jsx)(O,{className:"container",children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(bt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(L,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:m=>r(m.target.value),className:"pl-9"})]})})})})}),(0,qr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(m=>(0,qr.jsx)(Ko.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,qr.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-lg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>s(m),children:[(0,qr.jsx)(Ae,{className:"pb-3",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsxs)(Ut,{children:[(0,qr.jsx)(Fa,{src:m.avatar,alt:m.name}),(0,qr.jsx)(Kt,{children:(0,qr.jsx)(bt.User,{className:"h-4 w-4"})})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(Oe,{className:"text-lg",children:m.name}),(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:m.role})]})]}),o===m.id&&(0,qr.jsx)(bt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,qr.jsx)(le,{className:"pt-0",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:"Email"}),(0,qr.jsx)("qr",{className:"text-sm font-medium",children:m.email})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:"Department"}),(0,qr.jsx)(Z,{variant:"secondary",children:m.department})]}),m.location&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:"Location"}),(0,qr.jsx)("qr",{className:"text-sm",children:m.location})]}),m.skills&&m.skills.length>0&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[m.skills.slice(0,3).map(n=>(0,qr.jsx)(Z,{variant:"outline",className:"text-Ko",children:n},n)),m.skills.length>3&&(0,qr.jsxs)(Z,{variant:"outline",className:"text-Ko",children:["+",m.skills.length-3]})]})]})]})})]})},m.id))}),c.length===0&&(0,qr.jsx)(O,{className:"container qr-4",children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(bt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ui({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,At.useState)(""),[c,s]=(0,At.useState)("all"),m=(0,At.useMemo)(()=>e.filter(u=>{let g=u.name.toLowerCase().includes(i.toLowerCase())||u.jobDescription.toLowerCase().includes(i.toLowerCase())||u.capabilities.some(S=>S.toLowerCase().includes(i.toLowerCase()))||u.workInstructions.toLowerCase().includes(i.toLowerCase()),v=c==="all"||u.status===c;return g&&v}),[e,i,c]),n=u=>{let g={...u,id:`${u.id}-clone-${Date.now()}`,name:`${u.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(g)},l=u=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(u);return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(bt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,qr.jsx)(O,{children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(bt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(L,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:u=>r(u.target.value),className:"pl-9"})]})}),(0,qr.jsxs)("select",{value:c,onChange:u=>s(u.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,qr.jsx)("option",{value:"all",children:"All Status"}),(0,qr.jsx)("option",{value:"active",children:"Active"}),(0,qr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,qr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(u=>(0,qr.jsx)(Ko.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,qr.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-lg ${o===u.id?"ring-2 ring-primary":""}`,onClick:()=>n(u),children:[(0,qr.jsx)(Ae,{className:"pb-3",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)(Ut,{children:(0,qr.jsx)(Kt,{className:"bg-blue-100",children:(0,qr.jsx)(bt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,qr.jsxs)("div",{children:[(0,qr.jsxs)(Oe,{className:"text-lg flex items-center gap-2",children:[u.name,(0,qr.jsx)(Z,{variant:u.status==="active"?"default":"secondary",className:"text-Ko",children:u.status})]}),(0,qr.jsxs)("qr",{className:"text-sm text-muted-foreground",children:["v",u.version]})]})]}),(0,qr.jsxs)(h,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:g=>{g.stopPropagation(),n(u)},children:[(0,qr.jsx)(bt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,qr.jsx)(le,{className:"pt-0",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,qr.jsx)("qr",{className:"text-sm line-clamp-2",children:u.jobDescription})]}),u.capabilities&&u.capabilities.length>0&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[u.capabilities.slice(0,3).map(g=>(0,qr.jsx)(Z,{variant:"outline",className:"text-Ko",children:g},g)),u.capabilities.length>3&&(0,qr.jsxs)(Z,{variant:"outline",className:"text-Ko",children:["+",u.capabilities.length-3]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-Ko text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(bt.Calendar,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["Updated ",l(u.lastUpdated)]})]}),u.knowledge&&(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(bt.Users,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:[u.knowledge.length," docs"]})]})]}),u.workInstructions&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,qr.jsx)("qr",{className:"text-Ko line-clamp-2",children:u.workInstructions})]})]})})]})},u.id))}),m.length===0&&(0,qr.jsx)(O,{children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(bt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function gi({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(bt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,qr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,qr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,qr.jsxs)(Ae,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(bt.User,{className:"h-8 w-8 text-blue-600"})}),(0,qr.jsx)(Oe,{className:"text-xl",children:"Add Human Colleague"})]}),(0,qr.jsxs)(le,{className:"text-center",children:[(0,qr.jsx)("qr",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add At team members."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.Users,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Browse existing users"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.User,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,qr.jsx)(h,{className:"qr-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,qr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,qr.jsxs)(Ae,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(bt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,qr.jsx)(Oe,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,qr.jsxs)(le,{className:"text-center",children:[(0,qr.jsx)("qr",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,qr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.Users,{className:"h-4 w-4 text-purple-600"}),(0,qr.jsx)("span",{children:"Create from templates"})]})]}),(0,qr.jsx)(h,{className:"qr-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function fi({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(h,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(bt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,qr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,qr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,qr.jsxs)(Ae,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(bt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,qr.jsx)(Oe,{className:"text-xl",children:"Clone Existing"})]}),(0,qr.jsxs)(le,{className:"text-center",children:[(0,qr.jsx)("qr",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,qr.jsx)(h,{className:"qr-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,qr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,qr.jsxs)(Ae,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(bt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,qr.jsx)(Oe,{className:"text-xl",children:"Create New"})]}),(0,qr.jsxs)(le,{className:"text-center",children:[(0,qr.jsx)("qr",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.Plus,{className:"h-4 w-4 text-green-600"}),(0,qr.jsx)("span",{children:"Custom job description"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(bt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,qr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,qr.jsx)(h,{className:"qr-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function vi(e,t){let[a,o]=(0,At.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,At.useEffect)(()=>{i(a)},[]),[a,i]}var go=require("react-icons/fa");function Qe({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:c,className:s}){let[m,n]=vi(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),l=!i&&!t||m;return(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} qr-8 text-white ${s||""}`,children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,qr.jsx)(Z,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,qr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[l&&o&&(0,qr.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,qr.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 qr-1 text-white transition-colors",onClick:()=>n(!m),style:{lineHeight:0},children:m?(0,qr.jsx)(go.FaChevronDown,{size:22}):(0,qr.jsx)(go.FaChevronUp,{size:22})})]})]}),!l&&(0,qr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("qr",{className:"max-w-[600px] text-white/80",children:t}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,qr.jsx)(h,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,qr.jsx)(h,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),c&&(0,qr.jsx)("div",{className:"hidden lg:block",children:c})]})]})}function qo({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:c,availableUsers:s=[],existingDigitalColleagues:m=[]}){let[n,l]=(0,At.useState)(e||[]),[u,g]=(0,At.useState)(""),[v,S]=(0,At.useState)("all"),[y,f]=(0,At.useState)("all"),[k,I]=(0,At.useState)("all"),[_,Q]=(0,At.useState)(null),[w,H]=(0,At.useState)(null);(0,At.useEffect)(()=>{l(e||[])},[e]);let se=Array.isArray(s)?s:[],T=Array.isArray(m)?m:[],[R,E]=(0,At.useState)("main"),pe=n.filter(x=>{if(!x||!x.name)return!1;let ve=x.name.toLowerCase().includes(u.toLowerCase())||x.type==="human"&&(x.email?.toLowerCase().includes(u.toLowerCase())||x.role?.toLowerCase().includes(u.toLowerCase()))||x.type==="digital"&&x.jobDescription?.toLowerCase().includes(u.toLowerCase()),ie=v==="all"||x.type==="human"&&x.department===v,ft=y==="all"||x.status===y;return ve&&ie&&ft}),M=pe.filter(x=>x.type==="human"),ze=pe.filter(x=>x.type==="digital"),Ie=()=>{E("typeSelection")},We=x=>{x.type==="digital"&&(Q(x),E("form")),console.log("Editing colleague:",x),a?.(x)},D=x=>{x.type==="digital"&&(H(x),E("view"))},ue=x=>{let ve={id:`human-${Date.now()}`,type:"human",name:x.name,email:x.email,role:x.role,department:x.department,phone:x.phone,location:x.location,timezone:x.timezone,skills:x.skills||[],bio:x.bio,status:"active",joinedDate:new Date,lastActive:new Date};l(ie=>[...ie,ve]),t?.(ve),E("main")},Re=x=>{if(!x||!x.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",x);return}l(ve=>[...ve,x]),t?.(x),E("main")},rt=()=>{Q(null),E("form")},Me=x=>{if(!x||!x.id){console.error("Invalid colleague provided to handleSaveColleague:",x);return}_?(l(ve=>ve.map(ie=>ie.id===x.id?x:ie)),a?.(x)):(l(ve=>[...ve,x]),t?.(x)),E("main"),Q(null)},De=()=>{E("main"),Q(null),H(null)},ct=()=>{E("main"),H(null)},yt=()=>{w&&(Q(w),H(null),E("form"))},it=x=>{console.log("handling delete colleague",x),l(ve=>ve.filter(ie=>ie.id!==x)),o?.(x)},wt=()=>{g(""),S("all"),f("all")},q=()=>{let x=[];return T.forEach(ie=>{ie.knowledge&&Array.isArray(ie.knowledge)&&x.push(...ie.knowledge),ie.coreKnowledge&&Array.isArray(ie.coreKnowledge)&&x.push(...ie.coreKnowledge)}),n.forEach(ie=>{ie.type==="digital"&&(ie.knowledge&&Array.isArray(ie.knowledge)&&x.push(...ie.knowledge),ie.coreKnowledge&&Array.isArray(ie.coreKnowledge)&&x.push(...ie.coreKnowledge))}),x.filter((ie,ft,Ot)=>ft===Ot.findIndex(Rt=>Rt.id===ie.id))};return R==="typeSelection"?(0,qr.jsx)(gi,{onSelectHuman:()=>E("userSelection"),onSelectDigital:()=>E("digitalOptions"),onCancel:()=>E("main")}):R==="userSelection"?(0,qr.jsx)(pi,{users:se,onUserSelect:ue,onCancel:()=>E("typeSelection")}):R==="digitalOptions"?(0,qr.jsx)(fi,{onCloneExisting:()=>E("digitalClone"),onCreateNew:rt,onCancel:()=>E("typeSelection")}):R==="digitalClone"?(0,qr.jsx)(ui,{digitalColleagues:T,onColleagueClone:Re,onCancel:()=>E("digitalOptions")}):R==="form"?(0,qr.jsx)(Wo,{colleague:_||void 0,onSave:Me,onCancel:De,availableKnowledgeDocuments:q()}):R==="view"?(0,qr.jsx)(Wo,{colleague:w||void 0,onSave:Me,onCancel:ct,readOnly:!0,availableKnowledgeDocuments:q()}):(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsx)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,qr.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,qr.jsx)(Qe,{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:Ie}}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,qr.jsxs)(O,{children:[(0,qr.jsxs)(Ae,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Oe,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,qr.jsx)(bt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(le,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,qr.jsxs)("qr",{className:"text-Ko text-muted-foreground",children:[n.filter(x=>x.status==="active").length," active"]})]})]}),(0,qr.jsxs)(O,{children:[(0,qr.jsxs)(Ae,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Oe,{className:"text-sm font-medium",children:"Human Members"}),(0,qr.jsx)(bt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(le,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(x=>x.type==="human").length}),(0,qr.jsxs)("qr",{className:"text-Ko text-muted-foreground",children:[n.filter(x=>x.type==="human"&&x.status==="active").length," ","active"]})]})]}),(0,qr.jsxs)(O,{children:[(0,qr.jsxs)(Ae,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Oe,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,qr.jsx)(bt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(le,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(x=>x.type==="digital").length}),(0,qr.jsxs)("qr",{className:"text-Ko text-muted-foreground",children:[n.filter(x=>x.type==="digital"&&x.status==="active").length," ","active"]})]})]})]}),(0,qr.jsx)(O,{children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(bt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(L,{placeholder:"Search colleagues...",value:u,onChange:x=>g(x.target.value),className:"pl-9"})]})}),(0,qr.jsxs)(ke,{value:v,onValueChange:S,children:[(0,qr.jsx)(Ce,{className:"w-full md:w-[180px]",children:(0,qr.jsx)(Fe,{placeholder:"Department"})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"all",children:"All Departments"}),r.map(x=>(0,qr.jsx)(U,{value:x,children:x},x))]})]}),(0,qr.jsxs)(ke,{value:y,onValueChange:f,children:[(0,qr.jsx)(Ce,{className:"w-full md:w-[140px]",children:(0,qr.jsx)(Fe,{placeholder:"Status"})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"all",children:"All Status"}),(0,qr.jsx)(U,{value:"active",children:"Active"}),(0,qr.jsx)(U,{value:"inactive",children:"Inactive"})]})]}),(u||v!=="all"||y!=="all")&&(0,qr.jsxs)(h,{variant:"outline",onClick:wt,className:"gap-2",children:[(0,qr.jsx)(bt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)(no,{activeTab:k,onTabChange:I,tabOptions:[{value:"all",label:`All (${pe.length})`},{value:"human",label:`Human (${M.length})`},{value:"digital",label:`Digital (${ze.length})`}],maxWidth:"400px",gridCols:3}),k==="all"&&(0,qr.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:pe.map(x=>(0,qr.jsx)(mo,{colleague:x,onEdit:We,onDelete:it,onViewDetails:D,compact:i},`${x}-${x.id}`))}),k==="human"&&(0,qr.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:M.map(x=>(0,qr.jsx)(mo,{colleague:x,onEdit:We,onDelete:it,onViewDetails:D,compact:i},x.id))}),k==="digital"&&(0,qr.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:ze.map(x=>(0,qr.jsx)(mo,{colleague:x,onEdit:We,onDelete:it,onViewDetails:D,compact:i},x.id))})]}),pe.length===0&&(0,qr.jsx)(O,{children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(bt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,qr.jsx)("qr",{className:"text-muted-foreground mb-4",children:u||v!=="all"||y!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,qr.jsxs)(h,{onClick:Ie,className:"gap-2",children:[(0,qr.jsx)(bt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function vo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,qr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,qr.jsxs)("div",{className:"bg-muted/50 qr-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,qr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,qr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,qr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,qr.jsx)("div",{className:"divide-y",children:e.map(c=>(0,qr.jsxs)(Ko.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"qr-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(c),children:[(0,qr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,qr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,qr.jsx)("div",{children:(0,qr.jsx)("qr",{className:"font-medium",children:c.name})})]}),(0,qr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:c.filesize}),(0,qr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,qr.jsx)("span",{className:"text-sm md:text-base",children:typeof c.createdAt=="string"?c.createdAt:c.createdAt.toLocaleDateString()}),(0,qr.jsx)("div",{className:"flex gap-1",children:(0,qr.jsx)(h,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(c)},children:(0,qr.jsx)(bt.Trash2,{className:"h-4 w-4"})})})]})]},c.name))})]})}function za({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:c}){let[s,m]=(0,At.useState)(e),[n,l]=(0,At.useState)(""),[u,g]=(0,At.useState)("all"),[v,S]=(0,At.useState)("all");(0,At.useEffect)(()=>{m(e)},[e]);let y=Array.from(new Set(s.map(T=>T.mimeType))),f=s.filter(T=>{let R=T.name.toLowerCase().includes(n.toLowerCase()),E=u==="all"||T.mimeType===u;return R&&E}),k=f.slice(0,10),I=f.filter(Boolean),_=()=>{t?.()},Q=T=>{a?.(T)},w=T=>{console.log("deleting file",T),m(R=>R.filter(E=>E.name!==T.name)),o?.(T.id)},H=T=>{i?.(T)},se=()=>{l(""),g("all")};return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsx)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,qr.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,qr.jsx)(Qe,{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:_},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,qr.jsx)(O,{children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(bt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(L,{placeholder:"Search files...",value:n,onChange:T=>l(T.target.value),className:"pl-9"})]})}),(n||u!=="all")&&(0,qr.jsxs)(h,{variant:"outline",onClick:se,className:"gap-2",children:[(0,qr.jsx)(bt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)(no,{activeTab:v,onTabChange:S,tabOptions:[{value:"all",label:`All Files (${f.length})`},{value:"recent",label:`Recent (${k.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,qr.jsx)(vo,{files:f,onFileClick:H,onFileEdit:Q,onFileDelete:w,showHeader:!r}),v==="recent"&&(0,qr.jsx)(vo,{files:k,onFileClick:H,onFileEdit:Q,onFileDelete:w,showHeader:!r}),v==="shared"&&(0,qr.jsx)(vo,{files:I,onFileClick:H,onFileEdit:Q,onFileDelete:w,showHeader:!r})]}),f.length===0&&(0,qr.jsx)(O,{children:(0,qr.jsx)(le,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(bt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,qr.jsx)("qr",{className:"text-muted-foreground mb-4",children:n||u!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,qr.jsxs)(h,{onClick:_,className:"gap-2",children:[(0,qr.jsx)(bt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function Ni({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:i=[]}){let[r,c]=(0,At.useState)({...e,updatedAt:new Date}),s=()=>{let y=new Set,f=new Set;return i.forEach(k=>{k.menuConfig.groupBy.forEach(I=>y.add(I))}),o.forEach(k=>{k.metadata&&Object.keys(k.metadata).forEach(I=>f.add(I))}),{contextKeys:Array.from(y).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...y,...f])).sort()}},m=y=>{let f=new Set;return o.forEach(k=>{k.metadata?.[y]&&f.add(String(k.metadata[y]))}),Array.from(f).sort()},n=s(),l=()=>{t(r)},u=(y,f)=>{c(k=>({...k,metadata:{...k.metadata,[y]:f}}))},g=(y,f)=>{f==="__custom__"?u(y,""):u(y,f)},v=()=>{let y=`field_${Date.now()}`;u(y,"")},S=y=>{c(f=>{let k={...f.metadata};return delete k[y],{...f,metadata:k}})};return(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,qr.jsxs)("div",{className:"border-b border-border bg-card qr-8",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{className:"flex-shrink-0 qr-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,qr.jsx)(bt.Edit3,{className:"h-6 w-6 text-primary"})}),(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsxs)(h,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,qr.jsx)(bt.qr,{className:"h-4 w-4"}),"Cancel"]}),(0,qr.jsxs)(h,{size:"sm",onClick:l,className:"gap-2",children:[(0,qr.jsx)(bt.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,qr.jsx)(L,{value:r.title,onChange:y=>c(f=>({...f,title:y.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,qr.jsx)(Ne,{value:r.description||"",onChange:y=>c(f=>({...f,description:y.target.value})),placeholder:"Document description...",rows:2})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),n.contextKeys.length>0&&(0,qr.jsxs)("qr",{className:"text-Ko text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,qr.jsxs)(h,{type:"button",variant:"outline",size:"sm",onClick:v,className:"gap-1 h-8",children:[(0,qr.jsx)(bt.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,qr.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([y,f])=>{let k=m(y);return(0,qr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,qr.jsx)(L,{value:y,onChange:I=>{let _=I.target.value,Q=r.metadata?.[y];c(w=>{let H={...w.metadata};return delete H[y],_&&(H[_]=Q||""),{...w,metadata:H}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${y}`}),(0,qr.jsx)("datalist",{id:`metadata-keys-${y}`,children:n.allKeys.map(I=>(0,qr.jsx)("option",{value:I},I))}),(0,qr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),k.length>0?(0,qr.jsxs)(ke,{value:String(f||""),onValueChange:I=>g(y,I),children:[(0,qr.jsx)(Ce,{className:"flex-1 h-8 text-sm",children:(0,qr.jsx)(Fe,{placeholder:"Value"})}),(0,qr.jsxs)(Se,{children:[k.map(I=>(0,qr.jsx)(U,{value:I,children:I},I)),(0,qr.jsx)(U,{value:"__custom__",children:(0,qr.jsx)("span",{className:"text-muted-foreground text-Ko",children:"Custom..."})})]})]}):(0,qr.jsx)(L,{value:String(f||""),onChange:I=>u(y,I.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,qr.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:()=>S(y),className:"h-8 w-8 qr-0 text-muted-foreground hover:text-destructive",children:(0,qr.jsx)(bt.qr,{className:"h-3 w-3"})})]},y)})}):(0,qr.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,qr.jsx)("qr",{className:"text-Ko text-muted-foreground",children:'No metadata \u2022 Click "Add" to create fields'})})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,qr.jsx)(Z,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,qr.jsxs)("div",{className:"qr-8",children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,qr.jsx)(Ne,{value:r.content||"",onChange:y=>c(f=>({...f,content:y.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var ki=e=>(0,qr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),Ci=e=>(0,qr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),_n=e=>(0,qr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,qr.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg qr-4 mb-4",children:(0,qr.jsxs)("qr",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,qr.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,qr.jsx)("pre",{className:"text-sm",children:e})]}),Gn=e=>(0,qr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,qr.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg qr-4 mb-4",children:(0,qr.jsxs)("qr",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,qr.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),ki(e)]});function Pi({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[c,s]=(0,At.useState)(!1),m=v=>{switch(v){case"markdown":case"mdx":return(0,qr.jsx)(bt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,qr.jsx)(bt.File,{className:"h-6 w-6 text-success"});case"text":return(0,qr.jsx)(bt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,qr.jsx)(bt.File,{className:"h-6 w-6 text-muted-foreground"})}},n=v=>{switch(v){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"}},l=(v,S)=>{let y={markdown:ki,mdx:Gn,richtext:_n,text:Ci},f=o?.[S]||y[S];return f?f(v):Ci(v)},u=v=>{s(!1),t?.(v)},g=()=>{s(!1)};return c?(0,qr.jsx)(Ni,{document:e,onSave:u,onCancel:g,availableDocuments:i,knowledgeContexts:r}):(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,qr.jsxs)("div",{className:"border-b border-border bg-card qr-8",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,qr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"flex-shrink-0 qr-3 rounded-xl bg-muted border border-border",children:m(e.format)}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,qr.jsx)("qr",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,qr.jsx)("div",{className:"flex-shrink-0",children:(0,qr.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,qr.jsx)(bt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,qr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(v=>(0,qr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",v]},v))]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,qr.jsxs)("div",{className:"qr-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,qr.jsxs)("div",{className:"mb-6",children:[(0,qr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,qr.jsx)("div",{className:"bg-muted rounded-lg qr-3 border border-border",children:(0,qr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-Ko",children:Object.entries(e.metadata).map(([v,S])=>(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[v.replace(/([qr-Z])/g," $1").trim(),":"]}),(0,qr.jsx)("span",{className:"text-foreground truncate",children:String(S)})]},v))})})]}),(0,qr.jsx)("div",{className:"space-y-4",children:e.content?(0,qr.jsx)("div",{className:"relative",children:(0,qr.jsx)("div",{className:"bg-card border border-border rounded-xl qr-6 overflow-hidden",children:l(e.content,e.format)})}):(0,qr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,qr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,qr.jsx)(bt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,qr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,qr.jsx)("qr",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Ti({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:c=!0}){let[s,m]=(0,At.useState)(o===0),n=a&&Object.keys(a).length>0,l=t.length+(a?Object.values(a).reduce((v,S)=>v+S.documents.length,0):0),u=v=>{switch(v){case"markdown":case"mdx":return(0,qr.jsx)(bt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,qr.jsx)(bt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,qr.jsx)(bt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},g=v=>{let S=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return S[v%S.length]};return(0,qr.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,qr.jsxs)(Ko.motion.div,{className:`group flex items-center gap-3 qr-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>m(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,qr.jsx)("div",{className:`w-1 h-6 rounded-full ${g(o)}`}),(0,qr.jsx)(Ko.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,qr.jsx)(bt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,qr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,qr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,qr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),c&&l>0&&(0,qr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,qr.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-Ko font-medium bg-muted text-muted-foreground rounded-full",children:l})})]})]}),(0,qr.jsx)(Ko.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,qr.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((v,S)=>(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:S*.05,duration:.2},className:`group flex items-center gap-3 qr-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,qr.jsx)("div",{className:"flex-shrink-0",children:u(v.format)}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("qr",{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,qr.jsx)("qr",{className:"text-Ko text-muted-foreground truncate qr-0.5",children:v.description})]}),v.tags&&v.tags.length>0&&(0,qr.jsx)("div",{className:"flex-shrink-0",children:(0,qr.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-Ko 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,S])=>(0,qr.jsx)(Ti,{label:v,documents:S.documents,children:S.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:c},v))]})})]})}function Ri({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:c,editable:s=!0}){let[m,n]=(0,At.useState)(""),[l,u]=(0,At.useState)(null),g=(0,At.useMemo)(()=>m?e.filter(y=>y.title.toLowerCase().includes(m.toLowerCase())||y.description?.toLowerCase().includes(m.toLowerCase())||y.tags?.some(f=>f.toLowerCase().includes(m.toLowerCase()))||Object.values(y.metadata||{}).some(f=>String(f).toLowerCase().includes(m.toLowerCase()))):e,[e,m]),v=(0,At.useMemo)(()=>{let y=(f,k)=>{if(k.length===0)return{};let[I,..._]=k;return f.reduce((w,H)=>{let se=H.metadata?.[I]||"Uncategorized",T=String(se);if(w[T]||(w[T]={documents:[],children:{}}),_.length===0)w[T].documents.push(H);else{let R=y([H],_),E=Object.keys(R)[0];E&&(w[T].children||(w[T].children={}),w[T].children[E]?w[T].children[E].documents.push(...R[E].documents):w[T].children[E]=R[E])}return w},{})};return y(g,t.groupBy)},[g,t.groupBy]),S=y=>{u(y),a?.(y)};return(0,qr.jsxs)("div",{className:`flex h-full ${c||""}`,children:[(0,qr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,qr.jsx)("div",{className:"qr-6 border-b border-border",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,qr.jsx)(bt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,qr.jsx)(L,{placeholder:"Search knowledge base...",value:m,onChange:y=>n(y.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,qr.jsx)(Ba,{className:"h-[calc(100%-100px)]",children:(0,qr.jsxs)("div",{className:"qr-4 space-y-3",children:[Object.entries(v).map(([y,f])=>(0,qr.jsx)(Ti,{label:y,documents:f.documents,children:f.children,level:0,onDocumentClick:S,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},y)),Object.keys(v).length===0&&(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,qr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,qr.jsx)(bt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,qr.jsx)("qr",{className:"text-sm font-medium",children:"No documents found"}),(0,qr.jsx)("qr",{className:"text-Ko qr-1",children:"Try adjusting your search terms"})]})]})})]}),(0,qr.jsx)("div",{className:"flex-1 bg-background",children:l?(0,qr.jsx)(Pi,{document:l,onDocumentUpdate:i,editable:s}):(0,qr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,qr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,qr.jsx)(bt.FileText,{className:"h-10 w-10 text-primary"})}),(0,qr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,qr.jsx)("qr",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Xo({documents:e=[],contexts:t=[],onDocumentClick:a=c=>console.log("Document clicked:",c),onDocumentShare:o=c=>console.log("Share document:",c),onLoadDocumentContent:i,selectedDocumentId:r}){let[c,s]=(0,At.useState)(t[0]);return!t||t.length===0?(0,qr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,qr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,qr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,qr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,qr.jsxs)("div",{className:"qr-6",children:[(0,qr.jsx)("div",{className:"border-b border-border",children:(0,qr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(m=>(0,qr.jsxs)("button",{onClick:()=>s(m),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${c.id===m.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[m.icon,m.label]},m.id))})}),c.description&&(0,qr.jsx)("div",{className:"qr-3 px-1",children:(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:c.description})})]})]}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,qr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,qr.jsx)(Ri,{documents:e,menuConfig:c.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}var me=be(require("react"));var Ai=(e=768)=>{let[t,a]=(0,At.useState)(!1);return(0,At.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var Ii=be(require("react")),Jo=be(require("@radix-ui/react-separator"));var Yo=Ii.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,qr.jsx)(Jo.Root,{ref:i,decorative:a,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Yo.displayName=Jo.Root.displayName;var Ha=be(require("react")),at=be(require("@radix-ui/react-dialog"));var Li=at.Root;var Wn=at.Portal,ji=Ha.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(at.Overlay,{className:b("fixed inset-0 qr-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}));ji.displayName=at.Overlay.displayName;var qn=(0,Gr.cva)("fixed qr-50 gap-4 bg-background qr-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Zo=Ha.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,qr.jsxs)(Wn,{children:[(0,qr.jsx)(ji,{}),(0,qr.jsxs)(at.Content,{ref:i,className:b(qn({side:e}),t),...o,children:[(0,qr.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,qr.jsx)(ya.Cross2Icon,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));Zo.displayName=at.Content.displayName;var Xn=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Xn.displayName="SheetHeader";var Jn=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Jn.displayName="SheetFooter";var Yn=Ha.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(at.Title,{ref:a,className:b("text-lg font-semibold text-foreground",e),...t}));Yn.displayName=at.Title.displayName;var Zn=Ha.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(at.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Zn.displayName=at.Description.displayName;function Qo({className:e,...t}){return(0,qr.jsx)("div",{className:b("animate-pulse rounded-md bg-primary/10",e),...t})}var zi=be(require("react")),Mt=be(require("@radix-ui/react-tooltip"));var Hi=Mt.Provider,Vi=Mt.Root,Ui=Mt.Trigger,tr=zi.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,qr.jsx)(Mt.Portal,{children:(0,qr.jsx)(Mt.Content,{ref:o,sideOffset:t,className:b("qr-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-Ko 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})}));tr.displayName=Mt.Content.displayName;var Qn="sidebar:state",el=60*60*24*7,tl="16rem",al="18rem",ol="3rem",rl="b",_i=me.createContext(null);function xo(){let e=me.useContext(_i);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var ar=me.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...c},s)=>{let m=Ai(),[n,l]=me.useState(!1),[u,g]=me.useState(e),v=t??u,S=me.useCallback(I=>{if(a)return a?.(typeof I=="function"?I(v):I);g(I),document.cookie=`${Qn}=${v}; path=/; max-age=${el}`},[a,v]),y=me.useCallback(()=>m?l(I=>!I):S(I=>!I),[m,S,l]);me.useEffect(()=>{let I=_=>{_.key===rl&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),y())};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[y]);let f=v?"expanded":"collapsed",k=me.useMemo(()=>({state:f,open:v,setOpen:S,isMobile:m,openMobile:n,setOpenMobile:l,toggleSidebar:y}),[f,v,S,m,n,l,y]);return(0,qr.jsx)(_i.Provider,{value:k,children:(0,qr.jsx)(Hi,{delayDuration:0,children:(0,qr.jsx)("div",{style:{"--sidebar-width":tl,"--sidebar-width-icon":ol,...i},className:b("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...c,children:r})})})});ar.displayName="SidebarProvider";var il=me.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},c)=>{let{isMobile:s,state:m,openMobile:n,setOpenMobile:l}=xo();return a==="none"?(0,qr.jsx)("div",{className:b("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:c,...r,children:i}):s?(0,qr.jsx)(Li,{open:n,onOpenChange:l,...r,children:(0,qr.jsx)(Zo,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar qr-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":al},side:e,children:(0,qr.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,qr.jsxs)("div",{ref:c,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,qr.jsx)("div",{className:b("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,qr.jsx)("div",{className:b("duration-200 fixed top-14 bottom-0 qr-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"?"qr-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,qr.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})})]})});il.displayName="Sidebar";var sl=me.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=xo();return(0,qr.jsxs)(h,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:b("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,qr.jsx)($i.PanelLeft,{}),(0,qr.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});sl.displayName="SidebarTrigger";var nl=me.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=xo();return(0,qr.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:b("absolute inset-y-0 qr-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})});nl.displayName="SidebarRail";var ll=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("main",{ref:a,className:b("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-xl md:peer-data-[variant=inset]:shadow",e),...t}));ll.displayName="SidebarInset";var dl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(L,{ref:a,"data-sidebar":"input",className:b("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));dl.displayName="SidebarInput";var cl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"header",className:b("flex flex-col gap-2 qr-2",e),...t}));cl.displayName="SidebarHeader";var ml=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"footer",className:b("flex flex-col gap-2 qr-2",e),...t}));ml.displayName="SidebarFooter";var pl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Yo,{ref:a,"data-sidebar":"separator",className:b("mx-2 w-auto bg-sidebar-border",e),...t}));pl.displayName="SidebarSeparator";var ul=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"content",className:b("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));ul.displayName="SidebarContent";var gl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"group",className:b("relative flex w-full min-w-0 flex-col qr-2",e),...t}));gl.displayName="SidebarGroup";var fl=me.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,qr.jsx)(t?_r.Slot:"div",{ref:o,"data-sidebar":"group-label",className:b("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-Ko 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]:-qr-8 group-data-[collapsible=icon]:opacity-0",e),...a}));fl.displayName="SidebarGroupLabel";var vl=me.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,qr.jsx)(t?_r.Slot:"button",{ref:o,"data-sidebar":"group-action",className:b("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md qr-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}));vl.displayName="SidebarGroupAction";var bl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"group-content",className:b("w-full text-sm",e),...t}));bl.displayName="SidebarGroupContent";var hl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("ul",{ref:a,"data-sidebar":"menu",className:b("flex w-full min-w-0 flex-col gap-1",e),...t}));hl.displayName="SidebarMenu";var xl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("qr",{ref:a,"data-sidebar":"menu-item",className:b("group/menu-item relative",e),...t}));xl.displayName="SidebarMenuItem";var yl=(0,Gr.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md qr-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]:!qr-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-Ko",lg:"h-12 text-sm group-data-[collapsible=icon]:!qr-0"}},defaultVariants:{variant:"default",size:"default"}}),wl=me.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...c},s)=>{let m=e?_r.Slot:"button",{isMobile:n,state:l}=xo(),u=(0,qr.jsx)(m,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:b(yl({variant:a,size:o}),r),...c});return i?(typeof i=="string"&&(i={children:i}),(0,qr.jsxs)(Vi,{children:[(0,qr.jsx)(Ui,{asChild:!0,children:u}),(0,qr.jsx)(tr,{side:"right",align:"center",hidden:l!=="collapsed"||n,...i})]})):u});wl.displayName="SidebarMenuButton";var Nl=me.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,qr.jsx)(t?_r.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:b("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md qr-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}));Nl.displayName="SidebarMenuAction";var Cl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:b("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-Ko 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}));Cl.displayName="SidebarMenuBadge";var Sl=me.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=me.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,qr.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:b("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,qr.jsx)(Qo,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,qr.jsx)(Qo,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});Sl.displayName="SidebarMenuSkeleton";var Dl=me.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:b("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}));Dl.displayName="SidebarMenuSub";var kl=me.forwardRef(({...e},t)=>(0,qr.jsx)("qr",{ref:t,...e}));kl.displayName="SidebarMenuSubItem";var Pl=me.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...i},r)=>(0,qr.jsx)(e?_r.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:b("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-Ko",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...i}));Pl.displayName="SidebarMenuSubButton";var Gi=({projects:e,epics:t,sprints:a,currentView:o,onUpdateProject:i,onDeleteProject:r,onAddProject:c,onUpdateEpic:s,onDeleteEpic:m,onAddEpic:n,onAddSprint:l,onUpdateSprint:u,onDeleteSprint:g,onViewChange:v,mobileMenuOpen:S,onToggleMobileMenu:y})=>{let[f,k]=(0,At.useState)(null),[I,_]=(0,At.useState)(null),[Q,w]=(0,At.useState)(null),[H,se]=(0,At.useState)(null),[T,R]=(0,At.useState)({name:"",description:""}),[E,pe]=(0,At.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[M,ze]=(0,At.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[Ie,We]=(0,At.useState)(!1),[D,ue]=(0,At.useState)(!1),[Re,rt]=(0,At.useState)({name:"",description:""}),[Me,De]=(0,At.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),ct=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],yt=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],it=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],wt=N=>{_(N.id),R({name:N.name,description:N.description||""})},q=()=>{I&&T.name.trim()&&(i(I,{name:T.name.trim(),description:T.description.trim()}),_(null))},x=()=>{_(null),R({name:"",description:""})},ve=()=>{Re.name.trim()&&(c({name:Re.name.trim(),description:Re.description.trim(),isSelected:!1}),rt({name:"",description:""}),We(!1))},ie=N=>{i(N,{isSelected:!0})},ft=N=>{w(N.id),pe({name:N.name,description:N.description||"",color:N.color,confidence:N.confidence,phase:N.phase,startDate:N.startDate.toISOString().split("T")[0],endDate:N.endDate.toISOString().split("T")[0],progress:N.progress})},Ot=()=>{Q&&E.name.trim()&&(s(Q,{name:E.name.trim(),description:E.description.trim(),color:E.color,confidence:E.confidence,phase:E.phase,startDate:new Date(E.startDate),endDate:new Date(E.endDate),progress:E.progress}),w(null))},Rt=()=>{w(null),pe({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},Bo=N=>{se(N.id),ze({name:N.name,description:N.description||"",startDate:N.startDate.toISOString().split("T")[0],endDate:N.endDate.toISOString().split("T")[0],isActive:N.isActive})},Lo=()=>{H&&M.name.trim()&&(u(H,{name:M.name.trim(),description:M.description.trim(),startDate:new Date(M.startDate),endDate:new Date(M.endDate),isActive:M.isActive}),se(null))},Ja=()=>{se(null),ze({name:"",description:"",startDate:"",endDate:"",isActive:!1})},jo=()=>{Me.name.trim()&&(l({name:Me.name.trim(),description:Me.description.trim(),startDate:new Date(Me.startDate),endDate:new Date(Me.endDate),isActive:Me.isActive,isSelected:!1}),De({name:"",description:"",startDate:"",endDate:"",isActive:!1}),ue(!1))},Ya=N=>{u(N,{isSelected:!0})},Za=N=>N.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Ea=N=>{let B=yt.find(we=>we.value===N);return B?{label:B.label,color:B.color}:{label:"Medium",color:"text-warning"}},Qa=N=>{let B=it.find(we=>we.value===N);return B?{label:B.label,color:B.color}:{label:"Phase 1",color:"text-primary"}};return(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsxs)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col qr-50 flex-shrink-0 transition-transform duration-300 group ${S?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[(0,qr.jsxs)("div",{className:"border-b border-sidebar-border",children:[(0,qr.jsxs)("button",{onClick:()=>{v("kanban"),k(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3 qr-50`,title:"Kanban View",children:[(0,qr.jsx)(bt.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-Ko font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,qr.jsxs)("button",{onClick:()=>{v("planning"),k(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,qr.jsx)(bt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-Ko font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]})]}),(0,qr.jsxs)("button",{onClick:()=>k(f==="projects"?null:"projects"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${f==="projects"?"bg-sidebar-accent":"bg-sidebar-primary hover:bg-sidebar-accent"} hover:w-28 hover:justify-start hover:pl-3`,title:"Projects",children:[(0,qr.jsx)(bt.FolderOpen,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-Ko font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Projects"})]}),(0,qr.jsxs)("button",{onClick:()=>{v("epics"),k(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="epics"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,qr.jsx)(bt.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-Ko font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,qr.jsxs)("button",{onClick:()=>k(f==="sprints"?null:"sprints"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${f==="sprints"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Sprints",children:[(0,qr.jsx)(bt.Layers,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-Ko font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Sprints"})]}),(0,qr.jsxs)("button",{onClick:()=>{v("files"),k(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="files"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,qr.jsx)(bt.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-Ko font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,qr.jsxs)("button",{onClick:()=>{v("tasks"),k(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,qr.jsx)(bt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-Ko font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]}),S&&(0,qr.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm qr-20",onClick:y}),f&&(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm qr-40",onClick:()=>k(null)}),(0,qr.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg qr-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,qr.jsxs)("div",{className:"qr-3 md:qr-4 border-b flex items-center justify-between",children:[(0,qr.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[f==="projects"&&"Projects",f==="epics"&&"Manage Epics",f==="sprints"&&"Manage Sprints",f==="files"&&"Files"]}),(0,qr.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>k(null),children:(0,qr.jsx)(bt.qr,{className:"h-4 w-4"})})]}),(0,qr.jsxs)("div",{className:"qr-3 md:qr-4 space-y-4 h-full overflow-y-auto",children:[f==="projects"&&(0,qr.jsx)(O,{className:"qr-3",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,qr.jsxs)(h,{size:"sm",onClick:()=>We(!0),className:"gap-1",children:[(0,qr.jsx)(bt.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),Ie&&(0,qr.jsxs)("div",{className:"border rounded-lg qr-2 space-y-2",children:[(0,qr.jsx)(L,{value:Re.name,onChange:N=>rt(B=>({...B,name:N.target.value})),placeholder:"Project name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:Re.description,onChange:N=>rt(B=>({...B,description:N.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(h,{size:"sm",onClick:ve,className:"text-Ko h-6",children:"Save"}),(0,qr.jsx)(h,{size:"sm",variant:"outline",onClick:()=>We(!1),className:"text-Ko h-6",children:"Cancel"})]})]}),(0,qr.jsx)("div",{className:"space-y-2",children:e.map(N=>(0,qr.jsx)("div",{className:"border rounded qr-2",children:I===N.id?(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(L,{value:T.name,onChange:B=>R(we=>({...we,name:B.target.value})),placeholder:"Project name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:T.description,onChange:B=>R(we=>({...we,description:B.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(h,{size:"sm",onClick:q,className:"text-Ko h-6",children:"Save"}),(0,qr.jsx)(h,{size:"sm",variant:"outline",onClick:x,className:"text-Ko h-6",children:"Cancel"})]})]}):(0,qr.jsxs)("div",{className:`cursor-pointer qr-1 rounded transition-colors ${N.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>ie(N.id),children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)(bt.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,qr.jsx)("span",{className:"font-medium text-Ko",children:N.name})]}),N.description&&(0,qr.jsx)("qr",{className:"text-Ko text-muted-foreground mb-1",children:N.description}),(0,qr.jsxs)("div",{className:"flex gap-1",onClick:B=>B.stopPropagation(),children:[(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>wt(N),className:"h-5 px-1",children:(0,qr.jsx)(bt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>r(N.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,qr.jsx)(bt.Trash2,{className:"h-3 w-3"})})]})]})},N.id))})]})}),f==="epics"&&(0,qr.jsx)(O,{className:"qr-3",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,qr.jsxs)(h,{size:"sm",onClick:n,className:"gap-1",children:[(0,qr.jsx)(bt.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,qr.jsx)("div",{className:"space-y-4",children:t.map(N=>(0,qr.jsx)("div",{className:"border rounded-lg qr-3",children:Q===N.id?(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(L,{value:E.name,onChange:B=>pe(we=>({...we,name:B.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:E.description,onChange:B=>pe(we=>({...we,description:B.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)("label",{className:"text-Ko font-medium",children:"Color"}),(0,qr.jsx)("div",{className:"flex gap-1 flex-wrap",children:ct.map(B=>(0,qr.jsx)("button",{onClick:()=>pe(we=>({...we,color:B})),className:`w-6 h-6 rounded-full ${B} ${E.color===B?"ring-2 ring-ring":""}`},B))})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-Ko font-medium",children:"Confidence"}),(0,qr.jsxs)(ke,{value:E.confidence,onValueChange:B=>pe(we=>({...we,confidence:B})),children:[(0,qr.jsx)(Ce,{className:"h-8 text-Ko",children:(0,qr.jsx)(Fe,{})}),(0,qr.jsx)(Se,{children:yt.map(B=>(0,qr.jsx)(U,{value:B.value,children:(0,qr.jsx)("span",{className:B.color,children:B.label})},B.value))})]})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-Ko font-medium",children:"Phase"}),(0,qr.jsxs)(ke,{value:E.phase.toString(),onValueChange:B=>pe(we=>({...we,phase:parseInt(B)})),children:[(0,qr.jsx)(Ce,{className:"h-8 text-Ko",children:(0,qr.jsx)(Fe,{})}),(0,qr.jsx)(Se,{children:it.map(B=>(0,qr.jsx)(U,{value:B.value.toString(),children:(0,qr.jsx)("span",{className:B.color,children:B.label})},B.value))})]})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-Ko font-medium",children:"Start Date"}),(0,qr.jsx)(L,{type:"date",value:E.startDate,onChange:B=>pe(we=>({...we,startDate:B.target.value})),className:"text-Ko h-8"})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-Ko font-medium",children:"End Date"}),(0,qr.jsx)(L,{type:"date",value:E.endDate,onChange:B=>pe(we=>({...we,endDate:B.target.value})),className:"text-Ko h-8"})]})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-Ko font-medium",children:"Progress (%)"}),(0,qr.jsx)(L,{type:"number",min:"0",max:"100",value:E.progress,onChange:B=>pe(we=>({...we,progress:parseInt(B.target.value)||0})),className:"text-Ko h-8"})]}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(h,{size:"sm",onClick:Ot,className:"text-Ko",children:"Save"}),(0,qr.jsx)(h,{size:"sm",variant:"outline",onClick:Rt,className:"text-Ko",children:"Cancel"})]})]}):(0,qr.jsxs)("div",{className:`cursor-pointer qr-2 rounded transition-colors ${N.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>s(N.id,{isSelected:!N.isSelected}),children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${N.color}`}),(0,qr.jsx)("span",{className:"font-medium text-sm",children:N.name})]}),N.description&&(0,qr.jsx)("qr",{className:"text-Ko text-muted-foreground mb-2",children:N.description}),(0,qr.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-Ko",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,qr.jsx)("span",{className:Ea(N.confidence).color,children:Ea(N.confidence).label})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-Ko",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,qr.jsx)("span",{className:Qa(N.phase).color,children:Qa(N.phase).label})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-Ko",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,qr.jsxs)("span",{className:"text-foreground",children:[Za(N.startDate)," - ",Za(N.endDate)]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-Ko",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,qr.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${N.progress}%`}})}),(0,qr.jsxs)("span",{className:"text-foreground",children:[N.progress,"%"]})]})]})]}),(0,qr.jsxs)("div",{className:"flex gap-1",onClick:B=>B.stopPropagation(),children:[(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>ft(N),className:"h-6 px-2",children:(0,qr.jsx)(bt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>m(N.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,qr.jsx)(bt.Trash2,{className:"h-3 w-3"})})]})]})},N.id))})]})}),f==="sprints"&&(0,qr.jsx)(O,{className:"qr-3",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-medium text-foreground",children:"Sprints (Select One)"}),(0,qr.jsxs)(h,{size:"sm",onClick:()=>ue(!0),className:"gap-1",children:[(0,qr.jsx)(bt.Plus,{className:"h-3 w-3"}),"Add Sprint"]})]}),D&&(0,qr.jsxs)("div",{className:"border rounded-lg qr-2 space-y-2",children:[(0,qr.jsx)(L,{value:Me.name,onChange:N=>De(B=>({...B,name:N.target.value})),placeholder:"Sprint name",className:"text-sm"}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,qr.jsx)(L,{type:"date",value:Me.startDate,onChange:N=>De(B=>({...B,startDate:N.target.value})),className:"text-Ko"}),(0,qr.jsx)(L,{type:"date",value:Me.endDate,onChange:N=>De(B=>({...B,endDate:N.target.value})),className:"text-Ko"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("input",{type:"checkbox",checked:Me.isActive,onChange:N=>De(B=>({...B,isActive:N.target.checked})),className:"w-3 h-3"}),(0,qr.jsx)("span",{className:"text-Ko",children:"Active"})]}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(h,{size:"sm",onClick:jo,className:"text-Ko h-6",children:"Save"}),(0,qr.jsx)(h,{size:"sm",variant:"outline",onClick:()=>ue(!1),className:"text-Ko h-6",children:"Cancel"})]})]}),(0,qr.jsx)("div",{className:"space-y-2",children:a.map(N=>(0,qr.jsx)("div",{className:"border rounded qr-2",children:H===N.id?(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(L,{value:M.name,onChange:B=>ze(we=>({...we,name:B.target.value})),placeholder:"Sprint name",className:"text-sm",disabled:N.id==="backlog"||N.id==="all-tasks"}),N.id!=="backlog"&&N.id!=="all-tasks"&&(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,qr.jsx)(L,{type:"date",value:M.startDate,onChange:B=>ze(we=>({...we,startDate:B.target.value})),className:"text-Ko"}),(0,qr.jsx)(L,{type:"date",value:M.endDate,onChange:B=>ze(we=>({...we,endDate:B.target.value})),className:"text-Ko"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("input",{type:"checkbox",checked:M.isActive,onChange:B=>ze(we=>({...we,isActive:B.target.checked})),className:"w-3 h-3"}),(0,qr.jsx)("span",{className:"text-Ko",children:"Active"})]})]}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(h,{size:"sm",onClick:Lo,className:"text-Ko h-6",children:"Save"}),(0,qr.jsx)(h,{size:"sm",variant:"outline",onClick:Ja,className:"text-Ko h-6",children:"Cancel"})]})]}):(0,qr.jsxs)("div",{className:`cursor-pointer qr-1 rounded transition-colors ${N.isSelected?"bg-brand-green/10 border-brand-green ring-2 ring-brand-green/20":"hover:bg-muted"}`,onClick:()=>Ya(N.id),children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)(bt.Calendar,{className:"h-3 w-3 text-muted-foreground"}),(0,qr.jsx)("span",{className:"font-medium text-Ko",children:N.name}),N.isActive&&(0,qr.jsx)("span",{className:"text-Ko bg-brand-green/20 text-brand-green px-1 py-0.5 rounded",children:"Active"}),(N.id==="backlog"||N.id==="all-tasks")&&(0,qr.jsx)("span",{className:"text-Ko bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"System"})]}),N.id!=="backlog"&&N.id!=="all-tasks"&&(0,qr.jsxs)("qr",{className:"text-Ko text-muted-foreground mb-1",children:[N.startDate.toLocaleDateString()," - ",N.endDate.toLocaleDateString()]}),(0,qr.jsxs)("div",{className:"flex gap-1",onClick:B=>B.stopPropagation(),children:[(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>Bo(N),className:"h-5 px-1",children:(0,qr.jsx)(bt.Edit2,{className:"h-3 w-3"})}),N.id!=="backlog"&&N.id!=="all-tasks"&&(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>g(N.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,qr.jsx)(bt.Trash2,{className:"h-3 w-3"})})]})]})},N.id))})]})})]})]})]})]})},Wi=e=>(0,qr.jsx)(ar,{children:(0,qr.jsxs)("div",{className:"flex w-full",children:[(0,qr.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,qr.jsx)(Gi,{...e})}),(0,qr.jsx)("div",{className:"md:hidden",children:(0,qr.jsx)(Gi,{...e})}),(0,qr.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6",children:(0,qr.jsx)("div",{className:"w-full",children:e.children})})]})});var qi=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1})=>{let c=n=>{n.preventDefault()},s=n=>{n.preventDefault(),i(t)};return(0,qr.jsxs)(O,{className:`qr-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 ${r?"lg:max-w-Ko":""}`,onDragOver:c,onDrop:s,children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,qr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,qr.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,qr.jsx)("div",{className:"space-y-4 min-h-[200px]",children:o})]})};var yo=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=l=>{a(e)},c=()=>{console.log("task clicked",e.title),o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},m=()=>{switch(e.type){case"story":return(0,qr.jsx)(bt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,qr.jsx)(bt.Bug,{className:"h-3 w-3"});case"spike":return(0,qr.jsx)(bt.Zap,{className:"h-3 w-3"});case"task":default:return(0,qr.jsx)(bt.AlertCircle,{className:"h-3 w-3"})}},n=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return i?(0,qr.jsx)(O,{className:"qr-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:c,children:(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-Ko font-medium ${n()}`,children:m()}),(0,qr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.title})]})}):(0,qr.jsxs)(O,{className:"qr-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:c,children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,qr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[m(),(0,qr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-Ko font-medium ${s()}`,children:e.priority}),(0,qr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-Ko font-medium",children:e.points})]})]}),(0,qr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.title}),(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,qr.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(bt.User,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:e.assignee})]})})]})};var Va=be(require("react")),ot=be(require("@radix-ui/react-dialog"));var pt=ot.Root;var Tl=ot.Portal;var Ji=Va.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ot.Overlay,{ref:a,className:b("fixed inset-0 qr-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}));Ji.displayName=ot.Overlay.displayName;var st=Va.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(Tl,{children:[(0,qr.jsx)(Ji,{}),(0,qr.jsxs)(ot.Content,{ref:o,className:b("fixed left-[50%] top-[50%] qr-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background qr-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,qr.jsxs)(ot.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,qr.jsx)(bt.qr,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));st.displayName=ot.Content.displayName;var nt=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});nt.displayName="DialogHeader";var Ua=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Ua.displayName="DialogFooter";var lt=Va.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ot.Title,{ref:a,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));lt.displayName=ot.Title.displayName;var Ka=Va.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ot.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Ka.displayName=ot.Description.displayName;var ga=be(require("react")),Da=be(require("@radix-ui/react-toggle-group"));var Yi=be(require("react")),or=be(require("@radix-ui/react-toggle"));var rr=(0,Gr.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=on]:bg-accent data-[state=on]: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"}}),Rl=Yi.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,qr.jsx)(or.Root,{ref:i,className:b(rr({variant:t,size:a,className:e})),...o}));Rl.displayName=or.Root.displayName;var es=ga.createContext({size:"default",variant:"default"}),fa=ga.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,qr.jsx)(Da.Root,{ref:r,className:b("flex items-center justify-center gap-1",e),...i,children:(0,qr.jsx)(es.Provider,{value:{variant:t,size:a},children:o})}));fa.displayName=Da.Root.displayName;var va=ga.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let c=ga.useContext(es);return(0,qr.jsx)(Da.Item,{ref:r,className:b(rr({variant:c.variant||a,size:c.size||o}),e),...i,children:t})});va.displayName=Da.Item.displayName;var El=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:bt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:bt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:bt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:bt.Zap}],Al=[{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"}],No=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:c})=>{let[s,m]=(0,$a.useState)({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,$a.useEffect)(()=>{e&&c&&m(u=>({...u,epicId:c}))},[e,c]),(0,$a.useEffect)(()=>{e&&m({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:c||"",sprintId:"none",assignee:""})},[e]);let n=u=>{u.preventDefault(),s.title.trim()&&(a({title:s.title.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,points:s.points,epicId:s.epicId,sprintId:s.sprintId==="none"?void 0:s.sprintId,assignee:s.assignee.trim()||"Unassigned"}),m({title:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:c||"",sprintId:"none",assignee:""}),t())},l=(u,g)=>{m(v=>({...v,[u]:g}))};return(0,qr.jsx)(pt,{open:e,onOpenChange:t,children:(0,qr.jsxs)(st,{className:"sm:max-w-md",children:[(0,qr.jsx)(nt,{children:(0,qr.jsx)(lt,{children:"Add New Task"})}),(0,qr.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"title",children:"Task Title"}),(0,qr.jsx)(L,{id:"title",value:s.title,onChange:u=>l("title",u.target.value),placeholder:"Enter task title",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:s.description,onChange:u=>l("description",u.target.value),placeholder:"Enter task description",rows:3})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Type"}),(0,qr.jsx)(fa,{type:"single",value:s.type,onValueChange:u=>u&&l("type",u),children:El.map(u=>{let g=u.icon;return(0,qr.jsxs)(va,{value:u.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,qr.jsx)(g,{className:"h-4 w-4"}),u.label]},u.value)})})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Priority"}),(0,qr.jsx)(fa,{type:"single",value:s.priority,onValueChange:u=>u&&l("priority",u),children:Al.map(u=>(0,qr.jsx)(va,{value:u.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:u.label},u.value))})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"points",children:"Story Points"}),(0,qr.jsx)(L,{id:"points",type:"number",min:"1",max:"100",value:s.points,onChange:u=>l("points",parseInt(u.target.value)||1),placeholder:"Enter story points",required:!0})]}),!c&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"epic",children:"Epic"}),(0,qr.jsxs)(ke,{value:s.epicId,onValueChange:u=>l("epicId",u),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{placeholder:"Select an epic"})}),(0,qr.jsx)(Se,{children:o.map(u=>(0,qr.jsx)(U,{value:u.id,children:(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${u.color}`}),u.name]})},u.id))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,qr.jsxs)(ke,{value:s.sprintId,onValueChange:u=>l("sprintId",u),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{placeholder:"Select a sprint"})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"none",children:"No Sprint"}),i.map(u=>(0,qr.jsx)(U,{value:u.id,children:(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[u.name,u.isActive&&(0,qr.jsx)("span",{className:"text-Ko bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},u.id))]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"sprint",children:"Assignee"}),(0,qr.jsxs)(ke,{value:s.assignee,onValueChange:u=>l("assignee",u),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{placeholder:"Select an Assignee"})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"none",children:"No Assignee"}),r.map(u=>(0,qr.jsx)(U,{value:u.id,children:(0,qr.jsx)("div",{className:"flex items-center gap-2",children:u.name})},u.id))]})]})]}),(0,qr.jsxs)(Ua,{children:[(0,qr.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,qr.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var sr=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:c=!1})=>{let[s,m]=(0,At.useState)(!1),[n,l]=(0,At.useState)(""),u=()=>{c||(m(!0),l(t))},g=async()=>{n!==t&&await i(e,n),m(!1)},v=S=>{S.key==="Enter"&&!o||S.key==="Enter"&&S.ctrlKey&&o?g():S.key==="Escape"&&(m(!1),l(""))};return(0,qr.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,qr.jsx)(P,{children:a}),s?o?(0,qr.jsx)(Ne,{value:n,onChange:S=>l(S.target.value),onBlur:g,onKeyDown:v,autoFocus:!0,rows:4,className:"resize-none"}):(0,qr.jsx)(L,{value:n,onChange:S=>l(S.target.value),onBlur:g,onKeyPress:v,autoFocus:!0,className:"text-lg font-medium"}):(0,qr.jsxs)("div",{onClick:u,className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 qr-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,qr.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!c&&(0,qr.jsx)(bt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var os=({comments:e,onAddComment:t})=>{let[a,o]=(0,At.useState)(""),i=c=>c.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.MessageSquare,{className:"h-5 w-5"}),(0,qr.jsx)(P,{className:"text-lg font-medium",children:"Comments"}),(0,qr.jsx)(Z,{variant:"secondary",children:e.length})]}),(0,qr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(c=>(0,qr.jsxs)("div",{className:"flex gap-3 qr-3 bg-muted/50 rounded-lg",children:[(0,qr.jsx)(Ut,{className:"h-8 w-8 qr-1",children:(0,qr.jsx)(Kt,{className:"text-Ko bg-muted text-muted-foreground",children:i(c.author)})}),(0,qr.jsxs)("div",{className:"flex-1",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)("span",{className:"font-medium text-sm",children:c.author}),(0,qr.jsxs)("span",{className:"text-Ko text-muted-foreground",children:[c.createdAt.toLocaleDateString()," at ",c.createdAt.toLocaleTimeString()]})]}),(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground",children:c.text})]})]},c.id))}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(Ne,{value:a,onChange:c=>o(c.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,qr.jsx)(h,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,qr.jsx)(bt.Send,{className:"h-4 w-4"})})]})]})};var So=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[c,s]=(0,At.useState)(!1),m=o.find(l=>l.value===t);return(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)(P,{className:"text-Ko text-muted-foreground",children:e}),(0,qr.jsxs)(ke,{value:t,onValueChange:a,open:c,onOpenChange:l=>{r||s(l)},disabled:r,children:[(0,qr.jsx)(Ce,{className:"h-auto qr-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,qr.jsxs)(Z,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&s(!c),children:[i&&m?.color&&(0,qr.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} bt-1`}),m?.label||"Select..."]})}),(0,qr.jsx)(Se,{children:o.map(l=>(0,qr.jsx)(U,{value:l.value,children:i&&l.color?(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var is=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:c=!1})=>{let[s,m]=(0,At.useState)(!1),[n,l]=(0,At.useState)(""),u=o.find(f=>f.value===t),g=o.filter(f=>f.label.toLowerCase().includes(n.toLowerCase())),v=f=>{a(f),m(!1),l("")},S=()=>{r&&n.trim()&&!o.find(f=>f.value===n.trim())&&(a(n.trim()),m(!1),l(""))};return(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)(P,{className:"text-Ko text-muted-foreground",children:e}),(0,qr.jsxs)(ke,{value:t,onValueChange:v,open:s,onOpenChange:f=>{c||m(f)},disabled:c,children:[(0,qr.jsx)(Ce,{className:"h-auto qr-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,qr.jsx)(Z,{variant:"secondary",className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!c&&m(!s),children:u?.label||t||"Select..."})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)("div",{className:"qr-2",children:(0,qr.jsx)(L,{placeholder:i,value:n,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&r&&S()},className:"mb-2"})}),g.map(f=>(0,qr.jsx)(U,{value:f.value,children:f.label},f.value)),r&&n.trim()&&!g.find(f=>f.value===n.trim())&&(0,qr.jsxs)(U,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var Il=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:bt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:bt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:bt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:bt.Zap}],Ml=[{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"}],Fl=[{value:"John Doe",label:"John Doe"},{value:"Jane Smith",label:"Jane Smith"},{value:"Bob Wilson",label:"Bob Wilson"},{value:"Alice Johnson",label:"Alice Johnson"},{value:"Carol Brown",label:"Carol Brown"},{value:"David Lee",label:"David Lee"},{value:"Emma Davis",label:"Emma Davis"},{value:"Frank Miller",label:"Frank Miller"},{value:"Grace Taylor",label:"Grace Taylor"},{value:"Unassigned",label:"Unassigned"}],ss=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:c,isUpdating:s=!1,isDeleting:m=!1,deleteState:n="idle"})=>{let l=g=>g.split(" ").map(v=>v[0]).join("").toUpperCase(),u=()=>n==="loading"?(0,$.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Ko gap-1",children:[(0,$.jsx)(bt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,$.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Ko gap-1",children:[(0,$.jsx)(bt.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,$.jsxs)(h,{disabled:!0,variant:"destructive",className:"w-full h-8 text-Ko gap-1",children:[(0,$.jsx)(bt.qr,{className:"h-3 w-3"}),"Delete failed"]}):(0,$.jsxs)(h,{onClick:c,variant:"destructive",className:"w-full h-8 text-Ko gap-1",disabled:s||m,children:[(0,$.jsx)(bt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,$.jsxs)("div",{className:"flex flex-col h-full",children:[(0,$.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(P,{className:"text-Ko text-muted-foreground",children:"Status"}),(0,$.jsx)(So,{label:"",value:e.status,onValueChange:g=>i("status",g),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(P,{className:"text-Ko text-muted-foreground",children:"Type"}),(0,$.jsx)(fa,{type:"single",value:e.type,onValueChange:g=>g&&i("type",g),className:"grid grid-cols-2 gap-1",disabled:s,children:Il.map(g=>{let v=g.icon;return(0,$.jsxs)(va,{value:g.value,className:"flex items-center gap-1 text-Ko h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,$.jsx)(v,{className:"h-3 w-3"}),g.label]},g.value)})})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(P,{className:"text-Ko text-muted-foreground",children:"Priority"}),(0,$.jsx)(fa,{type:"single",value:e.priority,onValueChange:g=>g&&i("priority",g),className:"grid grid-cols-3 gap-1",disabled:s,children:Ml.map(g=>(0,$.jsx)(va,{value:g.value,className:"text-Ko h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:g.label},g.value))})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(P,{className:"text-Ko text-muted-foreground",children:"Story Points"}),(0,$.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:g=>i("points",g.target.value),className:"w-full h-8 px-2 text-Ko border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(P,{className:"text-Ko text-muted-foreground",children:"Epic"}),(0,$.jsx)(So,{label:"",value:e.epicId,onValueChange:g=>i("epicId",g),options:(t||[]).map(g=>({value:g.id,label:g.name,color:g.color})),showColor:!0,disabled:s})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(P,{className:"text-Ko text-muted-foreground",children:"Sprint"}),(0,$.jsx)(So,{label:"",value:e.sprintId||"none",onValueChange:g=>i("sprintId",g==="none"?"":g),options:[{value:"none",label:"No Sprint"},...(a||[]).map(g=>({value:g.id,label:`${g.name}${g.isActive?" (Active)":""}`}))],disabled:s})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(P,{className:"text-Ko text-muted-foreground",children:"Assignee"}),(0,$.jsx)(is,{label:"",value:e.assignee,onValueChange:g=>i("assignee",g),options:Fl,placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,$.jsxs)("div",{className:"qr-auto pt-4 space-y-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(h,{onClick:r,variant:"outline",className:"w-full h-8 text-Ko",disabled:s||m,children:"Close"}),u()]}),(0,$.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,$.jsx)("div",{className:"text-Ko text-muted-foreground font-medium mb-2",children:"Information"}),(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsx)("span",{className:"text-Ko text-muted-foreground",children:"Logged By"}),(0,$.jsxs)("div",{className:"flex items-center gap-1 text-Ko text-muted-foreground",children:[(0,$.jsx)(bt.User,{className:"h-3 w-3"}),(0,$.jsx)("span",{children:"System"})]})]}),(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsx)("span",{className:"text-Ko text-muted-foreground",children:"Created"}),(0,$.jsxs)("div",{className:"flex items-center gap-1 text-Ko text-muted-foreground",children:[(0,$.jsx)(bt.Calendar,{className:"h-3 w-3"}),(0,$.jsx)("span",{children:e.createdAt.toLocaleDateString()})]})]}),(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsx)("span",{className:"text-Ko text-muted-foreground",children:"Last Updated"}),(0,$.jsxs)("div",{className:"flex items-center gap-1 text-Ko text-muted-foreground",children:[(0,$.jsx)(bt.Clock,{className:"h-3 w-3"}),(0,$.jsxs)("span",{children:[o.toLocaleDateString()," at ",o.toLocaleTimeString()]})]})]})]})]})]})};var ns=({isOpen:e,onClose:t,task:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:c})=>{let[s,m]=(0,At.useState)(new Date),[n,l]=(0,At.useState)("idle"),[u,g]=(0,At.useState)("idle"),[v,S]=(0,At.useState)([{id:"1",text:"Initial task created and assigned.",author:"System",createdAt:a.createdAt},{id:"2",text:"Started working on the implementation.",author:a.assignee,createdAt:new Date(a.createdAt.getTime()+864e5)}]),y=async(H,se)=>{if(se!==a[H]){l("loading");try{await r(a.id,{[H]:se}),m(new Date),l("success"),setTimeout(()=>l("idle"),1500)}catch{l("error"),setTimeout(()=>l("idle"),3e3)}}},f=async(H,se)=>{if(se!==a[H]){l("loading");try{await r(a.id,{[H]:se}),m(new Date),l("success"),setTimeout(()=>l("idle"),1500)}catch{l("error"),setTimeout(()=>l("idle"),3e3)}}},k=H=>{let se={id:Date.now().toString(),text:H,author:"Current User",createdAt:new Date};S([...v,se])},I=async()=>{g("loading");try{await c(a.id),g("success"),setTimeout(()=>{t(),g("idle")},1e3)}catch{g("error"),setTimeout(()=>g("idle"),3e3)}},_=n!=="loading"&&u!=="loading",Q=()=>{_&&t()},w=()=>n==="loading"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,qr.jsx)(bt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,qr.jsx)("span",{children:"Updating..."})]}):n==="success"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,qr.jsx)(bt.Check,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Updated successfully"})]}):n==="error"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,qr.jsx)(bt.qr,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Update failed"})]}):null;return(0,qr.jsx)(pt,{open:e,onOpenChange:Q,children:(0,qr.jsxs)(st,{className:"max-w-3xl max-h-[80vh] overflow-y-auto qr-4",children:[(0,qr.jsxs)(nt,{children:[(0,qr.jsx)(lt,{className:"sr-only",children:a.title}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("div",{className:"flex-1",children:w()}),!_&&(0,qr.jsx)("div",{className:"text-Ko text-muted-foreground",children:"Please wait..."})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,qr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,qr.jsx)(sr,{fieldName:"title",value:a.title,label:"",onSave:y,className:"border-b border-border pb-3",disabled:n==="loading"}),(0,qr.jsx)(sr,{fieldName:"description",value:a.description,label:"Description",multiline:!0,onSave:y,disabled:n==="loading"}),(0,qr.jsx)(os,{comments:v,onAddComment:k})]}),(0,qr.jsx)(ss,{task:a,epics:o,sprints:i,lastUpdated:s,onUpdateTask:f,onClose:Q,onDelete:I,isUpdating:n==="loading",isDeleting:u==="loading",deleteState:u})]})]})})};var Do=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,At.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"],c=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=l=>{l.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:new Date(o.startDate),endDate:new Date(o.endDate),progress:o.progress,isSelected:!0}),i({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}),t())},n=(l,u)=>{i(g=>({...g,[l]:u}))};return(0,qr.jsx)(pt,{open:e,onOpenChange:t,children:(0,qr.jsxs)(st,{className:"sm:max-w-md",children:[(0,qr.jsx)(nt,{children:(0,qr.jsx)(lt,{children:"Add New Epic"})}),(0,qr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"name",children:"Epic Name"}),(0,qr.jsx)(L,{id:"name",value:o.name,onChange:l=>n("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:o.description,onChange:l=>n("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Color"}),(0,qr.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(l=>(0,qr.jsx)("button",{type:"button",onClick:()=>n("color",l),className:`w-8 h-8 rounded-full ${l} ${o.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Confidence"}),(0,qr.jsxs)(ke,{value:o.confidence,onValueChange:l=>n("confidence",l),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{})}),(0,qr.jsx)(Se,{children:c.map(l=>(0,qr.jsx)(U,{value:l.value,children:l.label},l.value))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Phase"}),(0,qr.jsxs)(ke,{value:o.phase.toString(),onValueChange:l=>n("phase",parseInt(l)),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{})}),(0,qr.jsx)(Se,{children:s.map(l=>(0,qr.jsx)(U,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Start Date"}),(0,qr.jsx)(L,{type:"date",value:o.startDate,onChange:l=>n("startDate",l.target.value)})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"End Date"}),(0,qr.jsx)(L,{type:"date",value:o.endDate,onChange:l=>n("endDate",l.target.value)})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Progress (%)"}),(0,qr.jsx)(L,{type:"number",min:"0",max:"100",value:o.progress,onChange:l=>n("progress",parseInt(l.target.value)||0)})]}),(0,qr.jsxs)(Ua,{children:[(0,qr.jsx)(h,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,qr.jsx)(h,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var ds=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:c,onUpdateTask:s,onDeleteTask:m,onTaskClick:n,onAddEpic:l})=>{let[u,g]=(0,At.useState)(e),[v,S]=(0,At.useState)(t),[y,f]=(0,At.useState)(a),[k,I]=(0,At.useState)(!1),[_,Q]=(0,At.useState)(!1),[w,H]=(0,At.useState)(null),[se,T]=(0,At.useState)(null),[R,E]=(0,At.useState)(o),[pe,M]=(0,At.useState)(i),ze=v.filter(q=>!0).map(q=>q.id),Ie=y.find(q=>q.isSelected);ze.push("no-epic"),(0,At.useEffect)(()=>{g(e)},[e]),(0,At.useEffect)(()=>{S(t)},[t]),(0,At.useEffect)(()=>{f(a)},[a]);let We=u.filter(q=>{let x=ze.includes(q.epicId)||!q.epicId;return!Ie||Ie.id==="all-tasks"?x:Ie.id==="backlog"?x&&!q.sprintId:x&&q.sprintId===Ie.id}),D=q=>We.filter(x=>x.status===q),ue=q=>{let x={};return v.forEach(ve=>{x[ve.id]=q.filter(ie=>ie.epicId===ve.id)}),x["no-epic"]=q.filter(ve=>!ve.epicId),x},Re=q=>{T(q)},rt=q=>{se&&(g(x=>x.map(ve=>ve.id===se.id?{...ve,status:q}:ve)),s?.(se.id,{status:q}),T(null))},Me=q=>{let x={...q,id:Date.now().toString(),createdAt:new Date};g(ve=>[...ve,x]),c?.(q)},De=async(q,x)=>{g(ve=>ve.map(ie=>ie.id===q?{...ie,...x}:ie)),s&&await s(q,x)},ct=async q=>{g(x=>x.filter(ve=>ve.id!==q)),w?.id===q&&H(null),m&&await m(q)},yt=q=>{let x={...q,id:Date.now().toString(),isSelected:!0};S(ve=>[...ve,x]),l?.(q)},it=q=>{H(q),n?.(q)};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(Qe,{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:()=>I(!0)},secondaryAction:{label:"Add epic",onClick:()=>Q(!0)}}),(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"w-full",children:[(0,qr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}].map(q=>{let x=D(q.status),ve=ue(x);return(0,qr.jsx)(qi,{title:q.title,status:q.status,taskCount:x.length,onDrop:rt,isCompact:q.status==="done",children:ze.map(ie=>{let ft=v.find(Rt=>Rt.id===ie),Ot=ve[ie]||[];return Ot.length===0?null:(0,qr.jsxs)("div",{className:"mb-6",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${ft?.color}`}),(0,qr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:ft?.name||"No Epic"}),(0,qr.jsx)(Z,{variant:"secondary",className:"text-Ko",children:Ot.length})]})," ",(0,qr.jsx)("div",{className:"space-y-3",children:Ot.map(Rt=>(0,qr.jsx)(yo,{task:Rt,epic:ft,onDragStart:Re,onTaskClick:it,isCompact:q.status==="done"},Rt.id))})]},ie)})},q.id)})}),(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(No,{isOpen:k,onClose:()=>I(!1),onAddTask:Me,assignees:[...pe,...R],epics:v,sprints:y}),(0,qr.jsx)(Do,{isOpen:_,onClose:()=>Q(!1),onAddEpic:yt}),w&&(0,qr.jsx)(ns,{isOpen:!!w,onClose:()=>H(null),task:w,epics:v,sprints:y,onUpdateTask:De,onDeleteTask:ct})]})]})})]})};var cs=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:c,onUpdateEpic:s,onDeleteEpic:m})=>{let[n,l]=(0,At.useState)(null),[u,g]=(0,At.useState)(null),[v,S]=(0,At.useState)({}),y=R=>{l(R)},f=R=>{R.preventDefault()},k=(R,E)=>{R.preventDefault(),n&&n.epicId!==E&&(o(n.id,{epicId:E}),l(null))},I=R=>e.filter(E=>E.epicId===R),_=R=>{g(R.id),S({name:R.name,description:R.description,confidence:R.confidence,phase:R.phase,progress:R.progress})},Q=()=>{u&&v.name&&(s(u,v),g(null),S({}))},w=()=>{g(null),S({})},H=R=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&m(R)},se=R=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[R]||`Phase ${R}`,T=R=>{switch(R){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,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(Qe,{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:c}}),(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsx)("div",{className:"w-full",children:(0,qr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(R=>{let E=I(R.id),pe=E.reduce((M,ze)=>M+ze.points,0);return(0,qr.jsxs)(O,{className:`flex flex-col ${u===R.id?"h-auto":"h-[600px]"} bg-card shadow-sm`,onDragOver:f,onDrop:M=>k(M,R.id),children:[(0,qr.jsx)("div",{className:"qr-4 border-b border-border",children:u===R.id?(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)(L,{value:v.name||"",onChange:M=>S({...v,name:M.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,qr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:Q,className:"qr-1 h-8 w-8",children:(0,qr.jsx)(bt.Check,{className:"h-4 w-4"})}),(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:w,className:"qr-1 h-8 w-8",children:(0,qr.jsx)(bt.qr,{className:"h-4 w-4"})})]})]}),(0,qr.jsx)(Ne,{value:v.description||"",onChange:M=>S({...v,description:M.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-Ko text-muted-foreground",children:"Confidence"}),(0,qr.jsxs)(ke,{value:v.confidence||R.confidence,onValueChange:M=>S({...v,confidence:M}),children:[(0,qr.jsx)(Ce,{className:"text-Ko",children:(0,qr.jsx)(Fe,{})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"low",children:"Low"}),(0,qr.jsx)(U,{value:"medium",children:"Medium"}),(0,qr.jsx)(U,{value:"high",children:"High"})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-Ko text-muted-foreground",children:"Phase"}),(0,qr.jsxs)(ke,{value:v.phase?.toString()||R.phase.toString(),onValueChange:M=>S({...v,phase:parseInt(M)}),children:[(0,qr.jsx)(Ce,{className:"text-Ko",children:(0,qr.jsx)(Fe,{})}),(0,qr.jsx)(Se,{children:[1,2,3,4,5,6,7,8,9].map(M=>(0,qr.jsxs)(U,{value:M.toString(),children:["Phase ",M]},M))})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-Ko text-muted-foreground",children:"Progress (%)"}),(0,qr.jsx)(L,{type:"number",min:"0",max:"100",value:v.progress||R.progress,onChange:M=>S({...v,progress:parseInt(M.target.value)||0}),className:"text-Ko"})]})]}):(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,qr.jsx)("div",{className:`w-4 h-4 rounded-full ${R.color}`}),(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:R.name}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>_(R),className:"qr-1 h-8 w-8",children:(0,qr.jsx)(bt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(h,{size:"sm",variant:"ghost",onClick:()=>H(R.id),className:"qr-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,qr.jsx)(bt.Trash2,{className:"h-3 w-3"})})]})]}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,qr.jsxs)(Z,{className:`text-Ko ${T(R.confidence)}`,children:[R.confidence," confidence"]}),(0,qr.jsxs)(Z,{variant:"outline",className:"text-Ko",children:["Phase ",R.phase]}),(0,qr.jsxs)(Z,{variant:"secondary",className:"text-Ko bg-muted text-muted-foreground",children:[E.length," tasks"]}),(0,qr.jsxs)(Z,{variant:"secondary",className:"text-Ko bg-muted text-muted-foreground",children:[pe," pts"]})]}),R.description&&(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground mb-3 select-none",children:R.description}),(0,qr.jsxs)("div",{className:"mb-3",children:[(0,qr.jsxs)("div",{className:"flex justify-between text-Ko text-muted-foreground mb-1",children:[(0,qr.jsx)("span",{className:"select-none",children:"Progress"}),(0,qr.jsxs)("span",{className:"select-none",children:[R.progress,"%"]})]}),(0,qr.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,qr.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${R.progress}%`}})})]}),(0,qr.jsxs)(h,{onClick:()=>r(R.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,qr.jsx)(bt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,qr.jsx)("div",{className:"flex-1 qr-4 overflow-y-auto",children:(0,qr.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded qr-3 transition-colors ${n?"border-primary bg-primary/10":"border-border"}`,children:E.length===0?(0,qr.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,qr.jsx)(bt.Move,{className:"h-8 w-8 mb-2"}),(0,qr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):E.map(M=>(0,qr.jsx)(yo,{task:M,epic:R,onDragStart:y,onTaskClick:i,isCompact:!0},M.id))})})]},R.id)})})})})]})};var ms=require("react-day-picker");function Po({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,qr.jsx)(ms.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:b("qr-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:b(oo({variant:"outline"}),"h-7 w-7 bg-transparent qr-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 qr-2",cell:b("relative qr-0 text-center text-sm focus-within:relative focus-within:qr-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:b(oo({variant:"ghost"}),"h-8 w-8 qr-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})}Po.displayName="Calendar";var us=be(require("react")),jt=be(require("@radix-ui/react-popover"));var dr=jt.Root,cr=jt.Trigger;var To=us.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,qr.jsx)(jt.Portal,{children:(0,qr.jsx)(jt.Content,{ref:i,align:t,sideOffset:a,className:b("qr-50 w-72 rounded-md border bg-popover qr-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})}));To.displayName=jt.Content.displayName;var pr=require("date-fns");var fs=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,At.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate,endDate:o.endDate,isActive:o.isActive,isSelected:!1}),i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},c=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,qr.jsx)(pt,{open:e,onOpenChange:c,children:(0,qr.jsxs)(st,{className:"sm:max-w-md",children:[(0,qr.jsx)(nt,{children:(0,qr.jsx)(lt,{children:"Add New Sprint"})}),(0,qr.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"name",children:"Sprint Name *"}),(0,qr.jsx)(L,{id:"name",value:o.name,onChange:s=>i(m=>({...m,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:o.description,onChange:s=>i(m=>({...m,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"Start Date *"}),(0,qr.jsxs)(dr,{children:[(0,qr.jsx)(cr,{asChild:!0,children:(0,qr.jsxs)(h,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,qr.jsx)(bt.CalendarIcon,{className:"bt-2 h-4 w-4"}),o.startDate?(0,pr.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,qr.jsx)(To,{className:"w-auto qr-0",align:"start",children:(0,qr.jsx)(Po,{mode:"single",selected:o.startDate,onSelect:s=>i(m=>({...m,startDate:s})),initialFocus:!0})})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{children:"End Date *"}),(0,qr.jsxs)(dr,{children:[(0,qr.jsx)(cr,{asChild:!0,children:(0,qr.jsxs)(h,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,qr.jsx)(bt.CalendarIcon,{className:"bt-2 h-4 w-4"}),o.endDate?(0,pr.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,qr.jsx)(To,{className:"w-auto qr-0",align:"start",children:(0,qr.jsx)(Po,{mode:"single",selected:o.endDate,onSelect:s=>i(m=>({...m,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"isActive",checked:o.isActive,onChange:s=>i(m=>({...m,isActive:s.target.checked})),className:"rounded border-gray-300"}),(0,qr.jsx)(P,{htmlFor:"isActive",children:"Set At active sprint"})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,qr.jsx)(h,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),(0,qr.jsx)(h,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Eo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r})=>{let[c,s]=(0,At.useState)(["2"]),[m,n]=(0,At.useState)(null),[l,u]=(0,At.useState)(!1),[g,v]=(0,At.useState)(null),[S,y]=(0,At.useState)(e.filter(D=>!D.sprintId)),[f,k]=(0,At.useState)(e.filter(D=>D.sprintId&&c.includes(D.sprintId))),[I,_]=(0,At.useState)(a.filter(D=>D.id!=="backlog"&&D.id!=="all-tasks").sort((D,ue)=>D.startDate.getTime()-ue.startDate.getTime()));(0,At.useEffect)(()=>{y(e.filter(D=>!D.sprintId)),k(e.filter(D=>D.sprintId&&c.includes(D.sprintId))),_(a.filter(D=>D.id!=="backlog"&&D.id!=="all-tasks").sort((D,ue)=>D.startDate.getTime()-ue.startDate.getTime()))},[e,a,c]);let Q=D=>t.find(ue=>ue.id===D),w=D=>a.find(ue=>ue.id===D),H=D=>{switch(D){case"high":return"bg-destructive/20 text-destructive";case"medium":return"bg-warning/20 text-warning";case"low":return"bg-success/20 text-success";default:return"bg-muted text-muted-foreground"}},se=D=>D.split(" ").map(ue=>ue[0]).join("").toUpperCase(),T=D=>{n(D)},R=D=>{D.preventDefault()},E=D=>{v(D)},pe=()=>{v(null)},M=(D,ue)=>{D.preventDefault(),v(null),m&&(o(m.id,{sprintId:ue==="backlog"?void 0:ue}),n(null))},ze=D=>{D==="backlog"||D==="all-tasks"||s(ue=>ue.includes(D)?ue.filter(Re=>Re!==D):[...ue,D])},Ie=D=>{r(D),u(!1)},We=({task:D,showSprint:ue=!1})=>{let Re=Q(D.epicId),rt=D.sprintId?w(D.sprintId):null,[Me,De]=(0,At.useState)(!1),ct=wt=>{wt.defaultPrevented||Me||i(D)},yt=wt=>{De(!0),T(D)},it=()=>{De(!1)};return(0,qr.jsx)(O,{className:`qr-3 cursor-grab transition-all duration-200 hover:shadow-md bg-card border-border hover:border-border/80 active:cursor-grabbing ${Me?"opacity-50 shadow-lg scale-105":""} ${m?.id===D.id?"ring-2 ring-primary":""}`,draggable:!0,onDragStart:yt,onDragEnd:it,onClick:ct,children:(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1 select-none pointer-events-none",children:D.title}),(0,qr.jsx)(Z,{className:`text-Ko select-none pointer-events-none ${H(D.priority)}`,children:D.priority[0].toUpperCase()})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-Ko pointer-events-none",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[Re&&(0,qr.jsx)("div",{className:`w-2 h-2 rounded-full ${Re.color}`}),(0,qr.jsx)("span",{className:"text-muted-foreground truncate select-none",children:Re?.name})]}),(0,qr.jsx)("span",{className:"text-muted-foreground select-none",children:se(D.assignee)})]}),ue&&rt&&(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-Ko text-muted-foreground pointer-events-none",children:[(0,qr.jsx)(bt.Calendar,{className:"h-3 w-3"}),(0,qr.jsx)("span",{className:"select-none",children:rt.name})]})]})})};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(Qe,{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:()=>u(!0)}}),(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"w-full",children:[(0,qr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:[(0,qr.jsx)("div",{className:"lg:col-span-1",children:(0,qr.jsxs)(O,{className:"qr-4 h-full bg-card shadow-sm",onDragOver:R,onDragEnter:()=>E("backlog"),onDragLeave:pe,onDrop:D=>M(D,"backlog"),children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Backlog"}),(0,qr.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:S.length})]}),(0,qr.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[600px] min-h-[200px] border-2 border-dashed rounded qr-3 transition-colors ${g==="backlog"?"border-primary bg-primary/10":"border-border"}`,children:[S.map(D=>(0,qr.jsx)(We,{task:D},D.id)),S.length===0&&(0,qr.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"})]})]})}),(0,qr.jsx)("div",{className:"lg:col-span-3",children:(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)(O,{className:"qr-4 bg-card shadow-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Select Sprints to View"}),(0,qr.jsxs)(h,{onClick:()=>u(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-2",size:"sm",children:[(0,qr.jsx)(bt.Plus,{className:"h-4 w-4"}),"Add Sprint"]})]}),(0,qr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:I.map(D=>(0,qr.jsxs)(h,{variant:c.includes(D.id)?"default":"outline",size:"sm",onClick:()=>ze(D.id),className:"text-Ko h-8",children:[D.name,D.isActive&&(0,qr.jsx)("span",{className:"ml-1 text-success",children:"\u25CF"})]},D.id))})]}),(0,qr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:c.map(D=>I.find(ue=>ue.id===D)).filter(Boolean).sort((D,ue)=>D.startDate.getTime()-ue.startDate.getTime()).map(D=>{let ue=f.filter(Re=>Re.sprintId===D.id);return(0,qr.jsxs)(O,{className:"qr-4 bg-card shadow-sm",onDragOver:R,onDragEnter:()=>E(D.id),onDragLeave:pe,onDrop:Re=>M(Re,D.id),children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:D.name}),D.isActive&&(0,qr.jsx)("span",{className:"text-Ko text-success font-medium select-none",children:"Active Sprint"})]}),(0,qr.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:ue.length})]}),(0,qr.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[500px] min-h-[200px] border-2 border-dashed rounded qr-3 transition-colors ${g===D.id?"border-primary bg-primary/10":"border-border"}`,children:[ue.map(Re=>(0,qr.jsx)(We,{task:Re},Re.id)),ue.length===0&&(0,qr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})]},D.id)})})," "]})})]}),(0,qr.jsx)(fs,{isOpen:l,onClose:()=>u(!1),onAddSprint:Ie})]})})]})};var Bl=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},Ll=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),jl=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})},ur=(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},gr=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ol=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},zl=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,At.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[c,s]=(0,At.useState)(!1),m=l=>{l.preventDefault();let u=e.find(v=>v?.id.toString()===i.colleagueId.toString());if(!u){console.error("No valid colleague selected"),s(!0);return}s(!1);let g={title:i.title,description:i.description,dueDate:new Date(i.dueDate),dueTime:i.dueTime||void 0,colleague:u,isCompleted:!1,isRecurring:i.isRecurring,recurrencePattern:i.isRecurring?i.recurrencePattern:void 0,recurrenceInterval:i.isRecurring?i.recurrenceInterval:void 0,priority:i.priority,reminderEnabled:i.reminderEnabled,reminderMinutes:i.reminderEnabled?i.reminderMinutes:void 0,tags:i.tags?i.tags.split(",").map(v=>v.trim()):void 0};t(g),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,At.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,qr.jsx)(pt,{open:a,onOpenChange:o,children:(0,qr.jsxs)(st,{className:"max-w-2xl",children:[(0,qr.jsx)(nt,{children:(0,qr.jsx)(lt,{children:"Add New Reminder"})}),(0,qr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,qr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"title",children:"Title"}),(0,qr.jsx)(L,{id:"title",value:i.title,onChange:l=>r({...i,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:i.description,onChange:l=>r({...i,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"dueDate",children:"Due Date"}),(0,qr.jsx)(L,{id:"dueDate",type:"date",value:i.dueDate,onChange:l=>r({...i,dueDate:l.target.value}),required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,qr.jsx)(L,{id:"dueTime",type:"time",value:i.dueTime,onChange:l=>r({...i,dueTime:l.target.value})})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{className:`${c?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,qr.jsxs)(ke,{value:i.colleagueId,onValueChange:l=>{r({...i,colleagueId:l})},required:!0,children:[(0,qr.jsx)(Ce,{className:`${c?"text-destructive border-red-500":""}`,children:(0,qr.jsx)(Fe,{className:`${c?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(l=>l?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,qr.jsx)(Se,{children:n.map(l=>(0,qr.jsx)(U,{value:l.id,children:l.name},l.id))})]}),c&&(0,qr.jsx)("qr",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:l=>r({...i,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(P,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,qr.jsxs)(ke,{value:i.recurrencePattern,onValueChange:l=>r({...i,recurrencePattern:l}),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"daily",children:"Daily"}),(0,qr.jsx)(U,{value:"weekly",children:"Weekly"}),(0,qr.jsx)(U,{value:"monthly",children:"Monthly"}),(0,qr.jsx)(U,{value:"yearly",children:"Yearly"})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"recurrenceInterval",children:"Every"}),(0,qr.jsx)(L,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:l=>r({...i,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,qr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,qr.jsx)(h,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,qr.jsx)(h,{type:"submit",children:"Add Reminder"})]})]})]})})},Hl=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,c]=(0,At.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague?.id||"",priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""}),s=n=>{n.preventDefault();let l=t.find(u=>u?.id===r.colleagueId);if(!l){console.error("No valid colleague selected");return}a(e.id,{title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:l,priority:r.priority,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(u=>u.trim()):void 0}),i()},m=t.filter(Boolean);return(0,qr.jsx)(pt,{open:o,onOpenChange:i,children:(0,qr.jsxs)(st,{className:"max-w-2xl",children:[(0,qr.jsx)(nt,{children:(0,qr.jsx)(lt,{children:"Edit Reminder"})}),(0,qr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-title",children:"Title"}),(0,qr.jsx)(L,{id:"edit-title",value:r.title,onChange:n=>c({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-priority",children:"Priority"}),(0,qr.jsxs)(ke,{value:r.priority,onValueChange:n=>c({...r,priority:n}),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"low",children:"\u{1F7E2} Low"}),(0,qr.jsx)(U,{value:"medium",children:"\u{1F7E1} Medium"}),(0,qr.jsx)(U,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-description",children:"Description"}),(0,qr.jsx)(Ne,{id:"edit-description",value:r.description,onChange:n=>c({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,qr.jsx)(L,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>c({...r,dueDate:n.target.value}),required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,qr.jsx)(L,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>c({...r,dueTime:n.target.value})})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,qr.jsxs)(ke,{value:r.colleagueId,onValueChange:n=>c({...r,colleagueId:n}),required:!0,children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{placeholder:"Select a digital colleague"})}),(0,qr.jsx)(Se,{children:m.map(n=>(0,qr.jsx)(U,{value:n.id,children:n.name},n.id))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:n=>c({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(P,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,qr.jsxs)(ke,{value:r.recurrencePattern,onValueChange:n=>c({...r,recurrencePattern:n}),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"daily",children:"Daily"}),(0,qr.jsx)(U,{value:"weekly",children:"Weekly"}),(0,qr.jsx)(U,{value:"monthly",children:"Monthly"}),(0,qr.jsx)(U,{value:"yearly",children:"Yearly"})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,qr.jsx)(L,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>c({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:n=>c({...r,reminderEnabled:n.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(P,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,qr.jsxs)("div",{className:"pl-6",children:[(0,qr.jsx)(P,{htmlFor:"edit-reminderMinutes",children:"Remind me"}),(0,qr.jsxs)(ke,{value:r.reminderMinutes.toString(),onValueChange:n=>c({...r,reminderMinutes:parseInt(n)}),children:[(0,qr.jsx)(Ce,{children:(0,qr.jsx)(Fe,{})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsx)(U,{value:"5",children:"5 minutes before"}),(0,qr.jsx)(U,{value:"15",children:"15 minutes before"}),(0,qr.jsx)(U,{value:"30",children:"30 minutes before"}),(0,qr.jsx)(U,{value:"60",children:"1 hour before"}),(0,qr.jsx)(U,{value:"1440",children:"1 day before"})]})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(P,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,qr.jsx)(L,{id:"edit-tags",value:r.tags,onChange:n=>c({...r,tags:n.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,qr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,qr.jsx)(h,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,qr.jsx)(h,{type:"submit",children:"Save Changes"})]})]})]})})},Vl=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,At.useState)(!1);if(!e||!e.id)return null;let c=ur(e.dueDate,e.dueTime),s=gr(e.dueDate),m=Ol(e.dueDate),n=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},l=()=>s?"Today":m?"Tomorrow":c&&!e.isCompleted?"Overdue":Ll(e.dueDate);return(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(Hl,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,qr.jsx)(O,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${c&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,qr.jsx)(le,{className:"qr-4",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,qr.jsx)("button",{onClick:n,className:"qr-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,qr.jsx)(bt.CheckCircle,{className:"h-5 w-5"}):(0,qr.jsx)(bt.Circle,{className:"h-5 w-5"})}),(0,qr.jsxs)("div",{className:"flex-1",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,qr.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,qr.jsx)("span",{className:"text-sm",children:Bl(e.priority)}),e.isRecurring&&(0,qr.jsx)(bt.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,qr.jsx)(bt.Bell,{className:"h-4 w-4 text-success"})]}),(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,qr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(bt.Calendar,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:c&&!e.isCompleted?"text-destructive font-medium":"",children:l()})]}),e.dueTime&&(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(bt.Clock,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:jl(e.dueTime)})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(bt.User,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:e.colleague?.name||"Unknown Colleague"})]})]}),e.tags&&e.tags.length>0&&(0,qr.jsx)("div",{className:"flex flex-wrap gap-1 qr-2",children:e.tags.map((u,g)=>(0,qr.jsx)(Z,{variant:"secondary",className:"text-Ko",children:u},g))})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 qr-0",children:(0,qr.jsx)(bt.Edit2,{className:"h-4 w-4"})}),(0,qr.jsx)(h,{variant:"ghost",size:"sm",onClick:()=>o(e.id),className:"h-8 w-8 qr-0 text-destructive hover:text-destructive/80",children:(0,qr.jsx)(bt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},vs=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,c]=(0,At.useState)(e.filter(Boolean)),[s]=(0,At.useState)(t.filter(Boolean)),[m,n]=(0,At.useState)("all"),[l,u]=(0,At.useState)(""),[g,v]=(0,At.useState)(!1),S=w=>{if(!w.title||!w.colleague?.id){console.error("Invalid reminder data:",w);return}let H={...w,id:Date.now().toString(),createdAt:new Date};c(se=>[...se,H]),a?.(w)},y=(w,H)=>{if(!w){console.error("No reminder ID provided for update");return}c(se=>se.map(T=>T?.id===w?{...T,...H}:T)),o?.(w,H)},f=w=>{if(!w){console.error("No reminder ID provided for deletion");return}c(H=>H.filter(se=>se?.id!==w)),i?.(w)},I=r.filter(w=>{if(!w)return!1;if(l){let H=l.toLowerCase();if(!(w.title.toLowerCase().includes(H)||w.description.toLowerCase().includes(H)||w.colleague?.name?.toLowerCase().includes(H)||w.tags?.some(T=>T.toLowerCase().includes(H))))return!1}switch(m){case"pending":return!w.isCompleted;case"completed":return w.isCompleted;case"overdue":return!w.isCompleted&&ur(w.dueDate,w.dueTime);case"today":return gr(new Date(w.dueDate));default:return!0}}).sort((w,H)=>{if(!w||!H)return 0;if(w.isCompleted&&!H.isCompleted)return 1;if(!w.isCompleted&&H.isCompleted)return-1;let se={high:3,medium:2,low:1},T=se[H.priority]-se[w.priority];return T!==0?T:w.dueDate.getTime()-H.dueDate.getTime()}),_={total:r.filter(Boolean).length,pending:r.filter(w=>w&&!w.isCompleted).length,completed:r.filter(w=>w&&w.isCompleted).length,overdue:r.filter(w=>w&&!w.isCompleted&&ur(w.dueDate,w.dueTime)).length,today:r.filter(w=>w&&gr(new Date(w.dueDate))).length},Q=s.find(Boolean)||{id:"1",name:"Default Colleague",status:"active",joinedDate:new Date,lastActive:new Date,type:"digital",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:[],version:"1.0.0",lastUpdated:new Date,isActive:!0};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(Qe,{title:"Task Reminders",description:"Manage reminders and stay on 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:()=>{v(!0)}}}),(0,qr.jsxs)("div",{className:"h-full bg-background",children:[(0,qr.jsx)(zl,{colleagues:s,onAddReminder:S,open:g,setOpen:v}),(0,qr.jsxs)("div",{className:"qr-6",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,qr.jsx)("qr",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,qr.jsxs)(h,{className:"flex items-center space-x-2",onClick:()=>v(!0),children:[(0,qr.jsx)(bt.Plus,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Add Reminder"})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,qr.jsxs)(O,{className:"qr-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:_.total}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,qr.jsxs)(O,{className:"qr-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-primary",children:_.pending}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,qr.jsxs)(O,{className:"qr-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-success",children:_.completed}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,qr.jsxs)(O,{className:"qr-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:_.overdue}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,qr.jsxs)(O,{className:"qr-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-warning",children:_.today}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsx)(L,{placeholder:"Search reminders...",value:l,onChange:w=>u(w.target.value),className:"max-w-md"})}),(0,qr.jsxs)(ke,{value:m,onValueChange:w=>n(w),children:[(0,qr.jsx)(Ce,{className:"w-40",children:(0,qr.jsx)(Fe,{})}),(0,qr.jsxs)(Se,{children:[(0,qr.jsxs)(U,{value:"all",children:["All (",_.total,")"]}),(0,qr.jsxs)(U,{value:"pending",children:["Pending (",_.pending,")"]}),(0,qr.jsxs)(U,{value:"completed",children:["Completed (",_.completed,")"]}),(0,qr.jsxs)(U,{value:"overdue",children:["Overdue (",_.overdue,")"]}),(0,qr.jsxs)(U,{value:"today",children:["Today (",_.today,")"]})]})]})]}),(0,qr.jsx)("div",{className:"space-y-4",children:I.length===0?(0,qr.jsxs)(O,{className:"qr-8 text-center",children:[(0,qr.jsx)("div",{className:"text-muted-foreground",children:l||m!=="all"?"No reminders match your filters":"No reminders yet"}),!l&&m==="all"&&(0,qr.jsx)("qr",{className:"text-sm text-muted-foreground/60 qr-2",children:"Create your first reminder to get started"})]}):I.map(w=>w&&(0,qr.jsx)(Vl,{reminder:w,colleagues:s,onUpdateReminder:y,onDeleteReminder:f},w.id))})]})]})]})};var bs=require("next/navigation");function fr({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:c=[],initialUsers:s=[],initialFiles:m=[],initialView:n="kanban",onAddTask:l,onUpdateTask:u,onDeleteTask:g,onTaskClick:v,onAddEpic:S,onUpdateEpic:y,onDeleteEpic:f,onAddTaskToEpic:k,onAddSprint:I,onUpdateSprint:_,onDeleteSprint:Q,onAddProject:w,onUpdateProject:H,onDeleteProject:se,onFileAdd:T,onFileEdit:R,onFileDelete:E,onFileClick:pe,onAddReminder:M,onUpdateReminder:ze,onDeleteReminder:Ie,onViewChange:We,onToggleMobileMenu:D,onTeamClick:ue,onTeamChange:Re,onCopilotClick:rt}){let[Me,De]=(0,At.useState)(t),[ct,yt]=(0,At.useState)(a),[it,wt]=(0,At.useState)(o),[q,x]=(0,At.useState)(i),[ve,ie]=(0,At.useState)(r),[ft,Ot]=(0,At.useState)(c),[Rt,Bo]=(0,At.useState)(s),[Lo,Ja]=(0,At.useState)(m),[jo,Ya]=(0,At.useState)(!1),[Za,Ea]=(0,At.useState)(!1),[Qa,N]=(0,At.useState)(null),[B,we]=(0,At.useState)(null),[Sr,Dr]=(0,At.useState)(null),[ta,kr]=(0,At.useState)(n||"kanban"),[Rs,Es]=(0,At.useState)(!1),Pr=(0,bs.useRouter)();(0,At.useEffect)(()=>{De(t)},[t]),(0,At.useEffect)(()=>{wt(o)},[o]),(0,At.useEffect)(()=>{yt(a)},[a]),(0,At.useEffect)(()=>{x(i)},[i]),(0,At.useEffect)(()=>{Ja(m)},[m]),(0,At.useEffect)(()=>{Bo(s)},[s]),(0,At.useEffect)(()=>{Ot(c)},[c]),(0,At.useEffect)(()=>{ie(r)},[r]),(0,At.useEffect)(()=>{kr(n)},[n]);let As=ct.filter(C=>C.isSelected).map(C=>C.id),eo=it.find(C=>C.isSelected),Is=Me.filter(C=>{let j=As.includes(C.epicId);return!eo||eo.id==="all-tasks"?j:eo.id==="backlog"?j&&!C.sprintId:j&&C.sprintId===eo.id}),Kl=C=>Is.filter(j=>j.status===C),$l=C=>{let j={};return ct.forEach(te=>{j[te.id]=C.filter(Ee=>Ee.epicId===te.id)}),j},_l=C=>{Dr(C)},Gl=C=>{Sr&&(De(j=>j.map(te=>te.id===Sr.id?{...te,status:C}:te)),Dr(null))},Tr=C=>{let j={...C,id:Date.now().toString(),createdAt:new Date};De(te=>[...te,j]),l?.(j)},to=(C,j)=>{De(te=>te.map(Ee=>Ee.id===C?{...Ee,...j}:Ee)),u?.(C,j)},Wl=async(C,j)=>{to(C,j)},Rr=C=>{De(j=>j.filter(te=>te.id!==C)),Qa?.id===C&&N(null),g?.(C)},ql=async C=>{Rr(C)},Ms=C=>{let j={...C,id:Date.now().toString(),isSelected:!1};x(te=>[...te,j]),w?.(C)},Fs=(C,j)=>{x(te=>te.map(Ee=>Ee.id===C?j.isSelected?(Pr.push(`/project/${C}`),{...Ee,...j}):{...Ee,...j}:j.isSelected&&C!==Ee.id?{...Ee,isSelected:!1}:Ee)),H?.(C,j)},Bs=C=>{x(j=>j.filter(te=>te.id!==C)),se?.(C)},Er=C=>{let j={...C,id:Date.now().toString(),isSelected:!0};yt(te=>[...te,j]),S?.({...j})},Ar=()=>{Ea(!0)},Ir=(C,j)=>{yt(te=>te.map(Ee=>Ee.id===C?{...Ee,...j}:Ee)),y?.(C,j)},Mr=C=>{yt(j=>j.filter(te=>te.id!==C)),De(j=>j.filter(te=>te.epicId!==C)),f?.(C)},Fr=C=>{let j={...C,id:Date.now().toString(),isSelected:!1};wt(te=>[...te,j]),I?.(C)},Ls=(C,j)=>{wt(te=>te.map(Ee=>Ee.id===C?j.isSelected?{...Ee,...j}:{...Ee,...j}:j.isSelected&&C!==Ee.id?{...Ee,isSelected:!1}:Ee)),_?.(C,j)},js=C=>{C==="backlog"||C==="all-tasks"||(wt(j=>j.filter(te=>te.id!==C)),De(j=>j.map(te=>te.sprintId===C?{...te,sprintId:void 0}:te)),Q?.(C))},Oo=C=>{N(C)},Os=C=>{C==="planning"&&window.innerWidth<768||(kr(C),We?.(C))},zs=()=>{Es(C=>!C),D?.()},Xl=()=>{Pr.push("/")},Jl=C=>{console.log("Switching to team:",C)},Yl=C=>{console.log("Switching to team:",C)},Hs=C=>{we(C),Ya(!0)},Vs=()=>{Ya(!1),we(null)},Us=C=>{let j={...C,id:Date.now().toString(),createdAt:new Date};ie(te=>[...te,j]),M?.(C)},Ks=(C,j)=>{ie(te=>te.map(Ee=>Ee.id===C?{...Ee,...j}:Ee)),ze?.(C,j)},$s=C=>{ie(j=>j.filter(te=>te.id!==C)),Ie?.(C)},_s=()=>{T?.()},Gs=C=>{R?.(C)},Ws=C=>{Ja(j=>j.filter(te=>te.name!==C)),E?.(C)},qs=C=>{pe?.(C)},Zl=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ql=()=>{switch(ta){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"}},zo=[{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")}],ed=zo.sort((C,j)=>j.lastUsed.getTime()-C.lastUsed.getTime()).slice(0,3),td=zo.length>3,ad=zo.slice(3);return(0,qr.jsxs)(Wi,{projects:q,epics:ct,sprints:it,currentView:ta,onUpdateProject:Fs,onDeleteProject:Bs,onAddProject:Ms,onUpdateEpic:Ir,onDeleteEpic:Mr,onAddEpic:Ar,onAddSprint:Fr,onUpdateSprint:Ls,onDeleteSprint:js,onViewChange:Os,mobileMenuOpen:Rs,onToggleMobileMenu:zs,children:[ta==="kanban"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(ds,{initialProjects:q,initialEpics:ct,initialSprints:it,initialTasks:Me,initialColleagues:ft,initialUsers:Rt,onAddTask:Tr,onUpdateTask:to,onDeleteTask:Rr,onTaskClick:Oo,onAddEpic:Er})}),ta==="planning"&&(0,qr.jsx)("div",{className:"hidden md:block h-full",children:(0,qr.jsx)(Eo,{tasks:Me,epics:ct,sprints:it,onUpdateTask:to,onTaskClick:Oo,onAddSprint:Fr})}),ta==="tasks"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(vs,{initialReminders:ve,initialColleagues:ft,onAddReminder:Us,onUpdateReminder:Ks,onDeleteReminder:$s})}),ta==="files"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(za,{initialFiles:Lo,onFileAdd:_s,onFileEdit:Gs,onFileDelete:Ws,onFileClick:qs,compactView:!1})}),ta==="epics"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(cs,{tasks:Me,epics:ct,sprints:it,onUpdateTask:to,onTaskClick:Oo,onAddTaskToEpic:Hs,onAddEpic:Ar,onUpdateEpic:Ir,onDeleteEpic:Mr})}),(0,qr.jsx)(No,{isOpen:jo,onClose:Vs,onAddTask:Tr,epics:ct,sprints:it,assignees:[...ft,...Rt],defaultEpicId:B||void 0}),(0,qr.jsx)(Do,{isOpen:Za,onClose:()=>Ea(!1),onAddEpic:Er})]})}var hs=be(require("react")),Ga=be(require("@radix-ui/react-progress"));var br=hs.forwardRef(({className:e,value:t,...a},o)=>(0,qr.jsx)(Ga.Root,{ref:o,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,qr.jsx)(Ga.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));br.displayName=Ga.Root.displayName;function ys({project:e,onOpen:t,onShare:a,className:o}){return(0,qr.jsx)(Ko.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,qr.jsxs)(O,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,qr.jsxs)(Ae,{children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)(Oe,{children:e.name}),(0,qr.jsxs)(Z,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,qr.jsx)(oa,{children:e.description})]}),(0,qr.jsxs)(le,{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsx)("span",{children:"Progress"}),(0,qr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,qr.jsx)(br,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center",children:[(0,qr.jsx)(bt.Users,{className:"bt-1 h-4 w-4"}),e.members," members"]}),(0,qr.jsxs)("div",{className:"flex items-center",children:[(0,qr.jsx)(bt.FileText,{className:"bt-1 h-4 w-4"}),e.files," files"]})]})]}),(0,qr.jsxs)(ra,{className:"flex gap-2",children:[(0,qr.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,qr.jsx)(h,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,qr.jsx)(bt.Share2,{className:"h-4 w-4"})})]})]})})}var Wa=be(require("@radix-ui/react-checkbox")),Ns=be(require("react")),hr=Ns.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Wa.Root,{className:b("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,qr.jsx)(Wa.Indicator,{className:b("flex items-center justify-center text-current"),children:(0,qr.jsx)(bt.Check,{className:"h-4 w-4"})})}));hr.displayName=Wa.Root.displayName;var Cs=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,c]=(0,At.useState)({name:o?.name||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,m]=(0,At.useState)({}),n=()=>{let g={};return r.name.trim()?r.name.trim().length<3&&(g.name="Project name must be at least 3 characters"):g.name="Project name is required",r.objectives.trim()?r.objectives.trim().length<10&&(g.objectives="Please provide more detailed objectives (at least 10 characters)"):g.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(g.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):g.workInstructions="Work instructions are required",m(g),Object.keys(g).length===0},l=async g=>{if(g.preventDefault(),!!n())try{await e(r)}catch(v){console.error("Error submitting project form:",v)}},u=(g,v)=>{c(S=>({...S,[g]:v})),s[g]&&m(S=>({...S,[g]:void 0}))};return(0,qr.jsxs)(O,{className:`w-full max-w-2xl ${i}`,children:[(0,qr.jsxs)(Ae,{children:[(0,qr.jsxs)(Oe,{className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,qr.jsx)(oa,{children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,qr.jsxs)("form",{onSubmit:l,children:[(0,qr.jsxs)(le,{className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,qr.jsx)(L,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:g=>u("name",g.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,qr.jsx)("qr",{className:"text-sm text-red-600",children:s.name})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,qr.jsx)(Ne,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:g=>u("objectives",g.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,qr.jsxs)("div",{className:"flex justify-between text-Ko text-gray-500",children:[(0,qr.jsx)("span",{children:s.objectives&&(0,qr.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,qr.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,qr.jsx)(Ne,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:g=>u("workInstructions",g.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,qr.jsxs)("div",{className:"flex justify-between text-Ko text-gray-500",children:[(0,qr.jsx)("span",{children:s.workInstructions&&(0,qr.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,qr.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(P,{className:"text-sm font-medium",children:"Project Management"}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(hr,{id:"plan",checked:r.plan,onCheckedChange:g=>u("plan",g===!0),disabled:a}),(0,qr.jsx)(P,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,qr.jsx)("qr",{className:"text-Ko text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,qr.jsxs)(ra,{className:"flex justify-end gap-3",children:[t&&(0,qr.jsxs)(h,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.qr,{className:"h-4 w-4"}),"Cancel"]}),(0,qr.jsx)(h,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(bt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(bt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function wr({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,At.useState)(!1),[c,s]=(0,At.useState)(!1),m=async l=>{s(!0);try{await t(l),r(!1)}catch(u){console.error("Error creating project:",u)}finally{s(!1)}},n=()=>{r(!0)};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsx)(Qe,{title:"Project Management",description:"Organise your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,qr.jsxs)("section",{className:"space-y-4 qr-8",children:[(0,qr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,qr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(l=>(0,qr.jsx)(ys,{project:l,onOpen:a,onShare:o},l.name))})]})]},"projects-index-view")}),(0,qr.jsx)(pt,{open:i,onOpenChange:r,children:(0,qr.jsxs)(st,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,qr.jsxs)(nt,{className:"sr-only",children:[(0,qr.jsx)(lt,{children:"Create New Project"}),(0,qr.jsx)(Ka,{children:"Fill out the form below to create a new project."})]}),(0,qr.jsx)(Cs,{onSubmit:m,onCancel:()=>r(!1),isLoading:c,className:"border-0 shadow-none"})]})})]})}function Ds({team:e,onOpen:t,className:a}){return(0,qr.jsx)(Ko.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,qr.jsxs)(O,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,qr.jsxs)(Ae,{children:[(0,qr.jsx)(Oe,{className:"text-lg",children:e.name}),(0,qr.jsx)(oa,{className:"qr-1 text-sm",children:e.description})]}),(0,qr.jsxs)(le,{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.Users,{className:"h-4 w-4 text-blue-500"}),(0,qr.jsx)("span",{children:"Human"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,qr.jsx)("span",{children:"Digital"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,qr.jsx)("span",{children:"Projects"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,qr.jsx)(ra,{className:"flex gap-2",children:(0,qr.jsx)(h,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var ks=be(require("react")),qa=be(require("@radix-ui/react-switch"));var Ra=ks.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(qa.Root,{className:b("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,qr.jsx)(qa.Thumb,{className:b("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")})}));Ra.displayName=qa.Root.displayName;function Ps({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:c="Cancel",readOnly:s=!1}){let[m,n]=(0,At.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[l,u]=(0,At.useState)(!s);(0,At.useEffect)(()=>{e&&n(e)},[e]);let g=f=>{f.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()};t(k)},v=f=>{f.preventDefault(),u(!l)},S=i||(l?e?"Edit Team":"Create New Team":"View Team"),y=r||(e?"Update Team":"Create Team");return(0,qr.jsxs)(O,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,qr.jsx)(Ae,{children:(0,qr.jsxs)(Oe,{className:"flex items-center gap-2",children:[(0,qr.jsx)(bt.Users,{className:"h-5 w-5"}),S]})}),(0,qr.jsx)(le,{children:(0,qr.jsxs)("form",{onSubmit:g,className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"name",children:"Team Name *"}),(0,qr.jsx)(L,{id:"name",value:m.name||"",onChange:f=>n({...m,name:f.target.value}),required:!0,disabled:o||!l,placeholder:"Enter team name..."})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:m.description||"",onChange:f=>n({...m,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!l})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(P,{htmlFor:"systemMsg",children:"Ways of working"}),(0,qr.jsx)(Ne,{id:"systemMsg",value:m.systemMsg||"",onChange:f=>n({...m,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in At much detail At possible. Include processes, tools, systems, styles...",disabled:o||!l})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ra,{id:"useProjects",checked:m.useProjects||!1,onCheckedChange:f=>n({...m,useProjects:f}),disabled:o||!l}),(0,qr.jsx)(P,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ra,{id:"useKnowledge",checked:m.useKnowledge||!1,onCheckedChange:f=>n({...m,useKnowledge:f}),disabled:o||!l}),(0,qr.jsx)(P,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ra,{id:"useFiles",checked:m.useFiles||!1,onCheckedChange:f=>n({...m,useFiles:f}),disabled:o||!l}),(0,qr.jsx)(P,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ra,{id:"useChat",checked:m.useChat||!1,onCheckedChange:f=>n({...m,useChat:f}),disabled:o||!l}),(0,qr.jsx)(P,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,qr.jsx)(h,{type:"button",variant:"outline",onClick:a,disabled:o,children:l?c:"Close"}),l?(0,qr.jsx)(h,{type:"submit",disabled:o||!m.name?.trim(),children:o?"Saving...":y}):(0,qr.jsxs)(h,{type:"button",onClick:v,disabled:o,className:"gap-2",children:[(0,qr.jsx)(bt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Cr({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,At.useState)(!1),r=()=>{i(!0)},c=n=>{t?.(n),i(!1)},s=()=>{i(!1)},m=n=>{a?.(n)};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsx)(Qe,{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,qr.jsxs)("section",{className:"space-y-4 qr-8",children:[(0,qr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,qr.jsxs)("div",{className:"text-center py-12",children:[(0,qr.jsx)("qr",{className:"text-muted-foreground text-lg",children:"You'qr not part of any teams yet."}),(0,qr.jsx)("qr",{className:"text-muted-foreground text-sm qr-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,qr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,qr.jsx)(Ds,{team:n,onOpen:m},n.id))})]})]},"teams-index-view")}),(0,qr.jsx)(pt,{open:o,onOpenChange:i,children:(0,qr.jsxs)(st,{className:"max-w-4xl max-h-[90vh] overflow-y-auto qr-0",children:[(0,qr.jsx)("div",{className:"sr-only",children:(0,qr.jsxs)(nt,{children:[(0,qr.jsx)(lt,{children:"Create New Team"}),(0,qr.jsx)(Ka,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,qr.jsx)(Ps,{title:"Create New Team",submitLabel:"Create Team",onSave:c,onCancel:s})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,PlanningView,ProjectView,ProjectsIndexView,TeamsIndexView});
5
+ "use strict";var Js=Object.create;var ao=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var Zs=Object.getOwnPropertyNames;var Qs=Object.getPrototypeOf,en=Object.prototype.hasOwnProperty;var tn=(e,t)=>{for(var a in t)ao(e,a,{get:t[a],enumerable:!0})},Lr=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zs(t))!en.call(e,i)&&i!==a&&ao(e,i,{get:()=>t[i],enumerable:!(o=Ys(t,i))||o.enumerable});return e};var ve=(e,t,a)=>(a=e!=null?Js(Qs(e)):{},Lr(t||!e||!e.__esModule?ao(a,"default",{value:e,enumerable:!0}):a,e)),an=e=>Lr(ao({},"__esModule",{value:!0}),e);var Ul={};tn(Ul,{ColleaguesView:()=>qo,FileView:()=>Ua,KnowledgeView:()=>Xo,PlanningView:()=>Eo,ProjectView:()=>fr,ProjectsIndexView:()=>wr,TeamsIndexView:()=>Cr});module.exports=an(Ul);var Et=require("react"),ht=require("lucide-react");var _r=require("clsx");var Uo="-",on=e=>{let t=sn(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{let s=d.split(Uo);return s[0]===""&&s.length!==1&&s.shift(),zr(s,t)||rn(d)},getConflictingClassGroupIds:(d,s)=>{let m=a[d]||[];return s&&o[d]?[...m,...o[d]]:m}}},zr=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?zr(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Uo);return t.validators.find(({validator:d})=>d(r))?.classGroupId},jr=/^\[(.+)\]$/,rn=e=>{if(jr.test(e)){let t=jr.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},sn=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return ln(Object.entries(e.classGroups),a).forEach(([r,d])=>{Vo(d,o,r,t)}),o},Vo=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:Or(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(nn(i)){Vo(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,d])=>{Vo(d,Or(t,r),a,o)})})},Or=(e,t)=>{let a=e;return t.split(Uo).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},nn=e=>e.isThemeGetter,ln=(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,s])=>[t+d,s])):r);return[a,i]}):e,dn=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)}}},Hr="!",cn=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,d=s=>{let m=[],n=0,c=0,u;for(let f=0;f<s.length;f++){let E=s[f];if(n===0){if(E===i&&(o||s.slice(f,f+r)===t)){m.push(s.slice(c,f)),c=f+r;continue}if(E==="/"){u=f;continue}}E==="["?n++:E==="]"&&n--}let h=m.length===0?s:s.substring(c),g=h.startsWith(Hr),w=g?h.substring(1):h,y=u&&u>c?u-c:void 0;return{modifiers:m,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:y}};return a?s=>a({className:s,parseClassName:d}):d},mn=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},pn=e=>({cache:dn(e.cacheSize),parseClassName:cn(e),...on(e)}),un=/\s+/,gn=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],d=e.trim().split(un),s="";for(let m=d.length-1;m>=0;m-=1){let n=d[m],{modifiers:c,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:g}=a(n),w=!!g,y=o(w?h.substring(0,g):h);if(!y){if(!w){s=n+(s.length>0?" "+s:s);continue}if(y=o(h),!y){s=n+(s.length>0?" "+s:s);continue}w=!1}let f=mn(c).join(":"),E=u?f+Hr:f,B=E+y;if(r.includes(B))continue;r.push(B);let V=i(y,w);for(let se=0;se<V.length;++se){let N=V[se];r.push(E+N)}s=n+(s.length>0?" "+s:s)}return s};function fn(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Vr(t))&&(o&&(o+=" "),o+=a);return o}var Vr=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Vr(e[o]))&&(a&&(a+=" "),a+=t);return a};function vn(e,...t){let a,o,i,r=d;function d(m){let n=t.reduce((c,u)=>u(c),e());return a=pn(n),o=a.cache.get,i=a.cache.set,r=s,s(m)}function s(m){let n=o(m);if(n)return n;let c=gn(m,a);return i(m,c),c}return function(){return r(fn.apply(null,arguments))}}var Be=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ur=/^\[(?:([a-Xr-]+):)?(.+)\]$/i,bn=/^\d+\/\d+$/,hn=new Set(["px","full","screen"]),xn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nn=/^(inset_)?-?((\d+)?\.?(\d+)[a-Xr]+|0)Xr-?((\d+)?\.?(\d+)[a-Xr]+|0)/,Cn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ht=e=>ya(e)||hn.has(e)||bn.test(e),Xt=e=>wa(e,"length",In),ya=e=>!!e&&!Number.isNaN(Number(e)),Ho=e=>wa(e,"number",ya),Fa=e=>!!e&&Number.isInteger(Number(e)),Sn=e=>e.endsWith("%")&&ya(e.slice(0,-1)),ne=e=>Ur.test(e),Jt=e=>xn.test(e),Dn=new Set(["length","size","percentage"]),kn=e=>wa(e,Dn,Kr),Pn=e=>wa(e,"position",Kr),Tn=new Set(["image","url"]),Rn=e=>wa(e,Tn,Mn),En=e=>wa(e,"",An),Ba=()=>!0,wa=(e,t,a)=>{let o=Ur.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},In=e=>yn.test(e)&&!wn.test(e),Kr=()=>!1,An=e=>Nn.test(e),Mn=e=>Cn.test(e);var Fn=()=>{let e=Be("colors"),t=Be("spacing"),a=Be("blur"),o=Be("brightness"),i=Be("borderColor"),r=Be("borderRadius"),d=Be("borderSpacing"),s=Be("borderWidth"),m=Be("contrast"),n=Be("grayscale"),c=Be("hueRotate"),u=Be("invert"),h=Be("gap"),g=Be("gradientColorStops"),w=Be("gradientColorStopPositions"),y=Be("inset"),f=Be("margin"),E=Be("opacity"),B=Be("padding"),V=Be("saturate"),se=Be("scale"),N=Be("sepia"),U=Be("skew"),fe=Be("space"),T=Be("translate"),P=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",ne,t],I=()=>[ne,t],Ke=()=>["",Ht,Xt],Fe=()=>["auto",ya,ne],ze=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Pe=()=>["start","end","center","between","around","evenly","stretch"],rt=()=>["","0",ne],He=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Te=()=>[ya,ne];return{cacheSize:500,separator:":",theme:{colors:[Ba],spacing:[Ht,Xt],blur:["none","",Jt,ne],brightness:Te(),borderColor:[e],borderRadius:["none","","full",Jt,ne],borderSpacing:I(),borderWidth:Ke(),contrast:Te(),grayscale:rt(),hueRotate:Te(),invert:rt(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Sn,Xt],inset:Q(),margin:Q(),opacity:Te(),padding:I(),saturate:Te(),scale:Te(),sepia:rt(),skew:Te(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ne]}],container:["container"],columns:[{columns:[Jt]}],"break-after":[{"break-after":He()}],"break-before":[{"break-before":He()}],"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:[...ze(),ne]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[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"],Xr:[{Xr:["auto",Fa,ne]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ne]}],grow:[{grow:rt()}],shrink:[{shrink:rt()}],order:[{order:["first","last","none",Fa,ne]}],"grid-cols":[{"grid-cols":[Ba]}],"col-start-end":[{col:["auto",{span:["full",Fa,ne]},ne]}],"col-start":[{"col-start":Fe()}],"col-end":[{"col-end":Fe()}],"grid-rows":[{"grid-rows":[Ba]}],"row-start-end":[{row:["auto",{span:[Fa,ne]},ne]}],"row-start":[{"row-start":Fe()}],"row-end":[{"row-end":Fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ne]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ne]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],Xr:[{Xr:[B]}],px:[{px:[B]}],py:[{py:[B]}],ps:[{ps:[B]}],pe:[{pe:[B]}],pt:[{pt:[B]}],pr:[{pr:[B]}],pb:[{pb:[B]}],pl:[{pl:[B]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],mt:[{mt:[f]}],ht:[{ht:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[fe]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[fe]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ne,t]}],"min-w":[{"min-w":[ne,t,"min","max","fit"]}],"max-w":[{"max-w":[ne,t,"none","full","min","max","fit","prose",{screen:[Jt]},Jt]}],h:[{h:[ne,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ne,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ne,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Jt,Xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ho]}],"font-family":[{font:[Ba]}],"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",ne]}],"line-clamp":[{"line-clamp":["none",ya,Ho]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ht,ne]}],"list-image":[{"list-image":["none",ne]}],"list-style-type":[{list:["none","disc","decimal",ne]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[E]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[E]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ht,Xt]}],"underline-offset":[{"underline-offset":["auto",Ht,ne]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ne]}],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",ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[E]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ze(),Pn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","Xr","tl"]},Rn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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-Xr":[{"rounded-Xr":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-Xr":[{"rounded-Xr":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-Xr":[{"border-Xr":[s]}],"border-opacity":[{"border-opacity":[E]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[E]}],"divide-style":[{divide:k()}],"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-b":[{"border-b":[i]}],"border-color-Xr":[{"border-Xr":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[Ht,ne]}],"outline-w":[{outline:[Ht,Xt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ke()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[E]}],"ring-offset-w":[{"ring-offset":[Ht,Xt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jt,En]}],"shadow-color":[{shadow:[Ba]}],opacity:[{opacity:[E]}],"mix-blend":[{"mix-blend":[...pe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":pe()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",Jt,ne]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[u]}],saturate:[{saturate:[V]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[E]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ne]}],duration:[{duration:Te()}],ease:[{ease:["linear","in","out","in-out",ne]}],delay:[{delay:Te()}],animate:[{animate:["none","spin","ping","pulse","bounce",ne]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[se]}],"scale-x":[{"scale-x":[se]}],"scale-y":[{"scale-y":[se]}],rotate:[{rotate:[Fa,ne]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ne]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ne]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-ht":[{"scroll-ht":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-Xr":[{"scroll-Xr":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",ne]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ht,Xt,Ho]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],Xr:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","ht","mb","ml"],mx:["ht","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-Xr","rounded-ss","rounded-se","rounded-ee","rounded-Xr","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-Xr"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-Xr":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-Xr"],"border-w-x":["border-w-r","border-w-Xr"],"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-Xr"],"border-color-x":["border-color-r","border-color-Xr"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-ht","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ht","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-Xr":["scroll-px","scroll-py","scroll-ps","scroll-pe","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 $r=vn(Fn);function b(...e){return $r((0,_r.clsx)(e))}var Gr=require("@radix-ui/react-slot"),Wr=require("class-variance-authority"),qr=ve(require("react")),Xr=require("react/jsx-runtime"),oo=(0,Wr.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=qr.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,Xr.jsx)(e?Gr.Slot:"button",{className:b(oo({className:t,size:a,variant:o})),ref:r,...i}));x.displayName="Button";var ra=ve(require("react"));var O=ra.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,className:b("rounded-xl border bg-card text-card-foreground shadow",e),...t}));O.displayName="Card";var Ee=ra.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,className:b("flex flex-col space-y-1.5 Xr-6",e),...t}));Ee.displayName="CardHeader";var Le=ra.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,className:b("font-semibold leading-none tracking-tight",e),...t}));Le.displayName="CardTitle";var ia=ra.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,className:b("text-sm text-muted-foreground",e),...t}));ia.displayName="CardDescription";var le=ra.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,className:b("Xr-6 pt-0",e),...t}));le.displayName="CardContent";var sa=ra.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,className:b("flex items-center Xr-6 pt-0",e),...t}));sa.displayName="CardFooter";var Jr=ve(require("react"));var L=Jr.forwardRef(({className:e,type:t,...a},o)=>(0,Xr.jsx)("input",{type:t,className:b("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}));L.displayName="Input";var be=ve(require("@radix-ui/react-select")),Yt=ve(require("react")),Se=be.Root;var Ie=be.Value,Ne=Yt.forwardRef(({children:e,className:t,...a},o)=>(0,$e.jsxs)(be.Trigger,{className:b("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,$e.jsx)(be.Icon,{asChild:!0,children:(0,$e.jsx)(ht.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ne.displayName=be.Trigger.displayName;var Zr=Yt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(be.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,$e.jsx)(ht.ChevronUp,{className:"h-4 w-4"})}));Zr.displayName=be.ScrollUpButton.displayName;var Qr=Yt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(be.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,$e.jsx)(ht.ChevronDown,{className:"h-4 w-4"})}));Qr.displayName=be.ScrollDownButton.displayName;var Ce=Yt.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,$e.jsx)(be.Portal,{children:(0,$e.jsxs)(be.Content,{className:b("relative Xr-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,$e.jsx)(Zr,{}),(0,$e.jsx)(be.Viewport,{className:b("Xr-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,$e.jsx)(Qr,{})]})}));Ce.displayName=be.Content.displayName;var Bn=Yt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(be.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));Bn.displayName=be.Label.displayName;var K=Yt.forwardRef(({children:e,className:t,...a},o)=>(0,$e.jsxs)(be.Item,{className:b("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,$e.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,$e.jsx)(be.ItemIndicator,{children:(0,$e.jsx)(ht.Check,{className:"h-4 w-4"})})}),(0,$e.jsx)(be.ItemText,{children:e})]}));K.displayName=be.Item.displayName;var Ln=Yt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(be.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Ln.displayName=be.Separator.displayName;var Ko=require("motion/react");var da=ve(require("@radix-ui/react-tabs"));function ei({className:e,...t}){return(0,Xr.jsx)(da.Root,{"data-slot":"tabs",className:b("flex flex-col gap-2",e),...t})}function ti({className:e,...t}){return(0,Xr.jsx)(da.List,{"data-slot":"tabs-list",className:b("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg Xr-[3px]",e),...t})}function ai({className:e,...t}){return(0,Xr.jsx)(da.Trigger,{"data-slot":"tabs-trigger",className:b("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})}var Vt=ve(require("react")),he=ve(require("@radix-ui/react-dropdown-menu")),Na=require("@radix-ui/react-icons");var io=he.Root,so=he.Trigger;var jn=Vt.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,Xr.jsxs)(he.SubTrigger,{ref:i,className:b("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,Xr.jsx)(Na.ChevronRightIcon,{className:"ml-auto"})]}));jn.displayName=he.SubTrigger.displayName;var On=Vt.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(he.SubContent,{ref:a,className:b("Xr-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Xr-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}));On.displayName=he.SubContent.displayName;var La=Vt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Xr.jsx)(he.Portal,{children:(0,Xr.jsx)(he.Content,{ref:o,sideOffset:t,className:b("Xr-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover Xr-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})}));La.displayName=he.Content.displayName;var ca=Vt.forwardRef(({className:e,inset:t,...a},o)=>(0,Xr.jsx)(he.Item,{ref:o,className:b("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}));ca.displayName=he.Item.displayName;var zn=Vt.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,Xr.jsxs)(he.CheckboxItem,{ref:i,className:b("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,Xr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Xr.jsx)(he.ItemIndicator,{children:(0,Xr.jsx)(Na.CheckIcon,{className:"h-4 w-4"})})}),t]}));zn.displayName=he.CheckboxItem.displayName;var Hn=Vt.forwardRef(({className:e,children:t,...a},o)=>(0,Xr.jsxs)(he.RadioItem,{ref:o,className:b("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,Xr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Xr.jsx)(he.ItemIndicator,{children:(0,Xr.jsx)(Na.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Hn.displayName=he.RadioItem.displayName;var Vn=Vt.forwardRef(({className:e,inset:t,...a},o)=>(0,Xr.jsx)(he.Label,{ref:o,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Vn.displayName=he.Label.displayName;var Un=Vt.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(he.Separator,{ref:a,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Un.displayName=he.Separator.displayName;var Kn=({className:e,...t})=>(0,Xr.jsx)("span",{className:b("ml-auto text-xs tracking-widest opacity-60",e),...t});Kn.displayName="DropdownMenuShortcut";function no({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let d=a.find(s=>s.value===e);return(0,Xr.jsxs)(Ko.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,Xr.jsx)("div",{className:"hidden lg:block",children:(0,Xr.jsx)(ei,{value:e,onValueChange:t,children:(0,Xr.jsx)(ti,{className:"grid w-full rounded-2xl Xr-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,Xr.jsx)(Ko.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Xr.jsx)(ai,{value:s.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Xr.jsx)("div",{className:"lg:hidden",children:(0,Xr.jsxs)(io,{children:[(0,Xr.jsx)(so,{asChild:!0,children:(0,Xr.jsxs)(x,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[d?.label||"Select",(0,Xr.jsx)(ht.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Xr.jsx)(La,{align:"center",className:"w-[180px]",children:a.map(s=>(0,Xr.jsx)(ca,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}var lo=ve(require("react")),Ut=ve(require("@radix-ui/react-avatar"));var Kt=lo.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(Ut.Root,{ref:a,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Kt.displayName=Ut.Root.displayName;var ja=lo.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(Ut.Image,{ref:a,className:b("aspect-square h-full w-full",e),...t}));ja.displayName=Ut.Image.displayName;var $t=lo.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(Ut.Fallback,{ref:a,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$t.displayName=Ut.Fallback.displayName;var $n=(0,Wr.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 Z({className:e,variant:t,...a}){return(0,Xr.jsx)("div",{className:b($n({variant:t}),e),...a})}function mo({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:d}){let[s,m]=(0,Et.useState)(!1),n=h=>{switch(h){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},c=h=>{switch(h){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},u=h=>{if(!h)return"Never";let w=Math.floor((new Date().getTime()-h.getTime())/(1e3*60));return w<1?"Just now":w<60?`${w}m ago`:w<1440?`${Math.floor(w/60)}h ago`:`${Math.floor(w/1440)}d ago`};return(0,Xr.jsxs)(O,{className:b("hover:shadow-md transition-shadow",r&&"Xr-2",d),children:[(0,Xr.jsx)(Ee,{className:b("pb-3",r&&"pb-2"),children:(0,Xr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Xr.jsx)("div",{className:"relative",children:(0,Xr.jsxs)(Kt,{className:b("h-12 w-12",r&&"h-8 w-8"),children:[(0,Xr.jsx)(ja,{src:"/placeholder.svg",alt:e.name}),(0,Xr.jsx)($t,{children:e.name.split(" ").map(h=>h[0]).join("")})]})}),(0,Xr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)("h3",{className:b("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,Xr.jsx)(ht.Bot,{className:b("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Xr.jsx)(ht.User,{className:b("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Xr.jsx)("Xr",{className:b("text-sm text-muted-foreground truncate",r&&"text-xs"),children:e.type==="human"?e.role:e.description}),!r&&(0,Xr.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[e.type==="human"&&(0,Xr.jsx)(Z,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,Xr.jsxs)(Z,{variant:"secondary",className:"text-xs",children:["v",e.version]}),(0,Xr.jsx)(Z,{variant:"outline",className:"text-xs",children:c(e.status)})]})]})]}),i&&(0,Xr.jsxs)(io,{children:[(0,Xr.jsx)(so,{asChild:!0,children:(0,Xr.jsx)(x,{variant:"ghost",size:"icon",className:b("h-8 w-8",r&&"h-6 w-6"),children:(0,Xr.jsx)(ht.MoreHorizontal,{className:b("h-4 w-4",r&&"h-3 w-3")})})}),(0,Xr.jsxs)(La,{align:"end",children:[(0,Xr.jsxs)(ca,{onClick:()=>o?.(e),children:[(0,Xr.jsx)(ht.Settings,{className:"h-4 w-4 ht-2"}),"View Details"]}),(0,Xr.jsxs)(ca,{onClick:()=>t?.(e),children:[(0,Xr.jsx)(ht.Edit,{className:"h-4 w-4 ht-2"}),"Edit"]}),(0,Xr.jsxs)(ca,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Xr.jsx)(ht.Trash2,{className:"h-4 w-4 ht-2"}),"Delete"]})]})]})]})}),!r&&(0,Xr.jsxs)(le,{className:"pt-0",children:[(0,Xr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Xr.jsx)(ht.Mail,{className:"h-3 w-3"}),(0,Xr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Xr.jsxs)(Xr.Fragment,{children:[e.phone&&(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Xr.jsx)(ht.Phone,{className:"h-3 w-3"}),(0,Xr.jsx)("span",{children:e.phone})]}),e.location&&(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Xr.jsx)(ht.MapPin,{className:"h-3 w-3"}),(0,Xr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Xr.jsx)(ht.Settings,{className:"h-3 w-3"}),(0,Xr.jsxs)("span",{children:["v",e.version]})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Xr.jsx)(ht.Clock,{className:"h-3 w-3"}),(0,Xr.jsxs)("span",{children:["Last active: ",u(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Xr.jsx)("div",{className:"mt-3",children:(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(h=>(0,Xr.jsx)(Z,{variant:"outline",className:"text-xs",children:h},h)),e.skills.length>3&&(0,Xr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>m(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Xr.jsx)("div",{className:"mt-3",children:(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(h=>(0,Xr.jsx)(Z,{variant:"outline",className:"text-xs",children:h},h)),e.capabilities.length>2&&(0,Xr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>m(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var ni=ve(require("react")),$o=ve(require("@radix-ui/react-label"));var _n=(0,Wr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=ni.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)($o.Root,{ref:a,className:b(_n(),e),...t}));R.displayName=$o.Root.displayName;var ci=ve(require("react")),we=ci.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("textarea",{className:b("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}));we.displayName="Textarea";var _o=ve(require("react")),wt=ve(require("@radix-ui/react-scroll-area"));var Oa=_o.forwardRef(({className:e,children:t,...a},o)=>(0,Xr.jsxs)(wt.Root,{ref:o,className:b("relative overflow-hidden",e),...a,children:[(0,Xr.jsx)(wt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Xr.jsx)(pi,{}),(0,Xr.jsx)(wt.Corner,{})]}));Oa.displayName=wt.Root.displayName;var pi=_o.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Xr.jsx)(wt.ScrollAreaScrollbar,{ref:o,orientation:t,className:b("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-Xr border-Xr-transparent Xr-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent Xr-[1px]",e),...a,children:(0,Xr.jsx)(wt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));pi.displayName=wt.ScrollAreaScrollbar.displayName;function Go({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:d=!1}){let[s,m]=(0,Et.useState)(""),[n,c]=(0,Et.useState)([]),[u,h]=(0,Et.useState)(!1);(0,Et.useEffect)(()=>{if(!s.trim()){c([]),h(!1);return}let f=a.filter(E=>{if(e.map(se=>se.id).includes(E.id))return!1;let V=s.toLowerCase();return E.title.toLowerCase().includes(V)||E.description?.toLowerCase().includes(V)||E.tags?.some(se=>se.toLowerCase().includes(V))||Object.values(E.metadata||{}).some(se=>String(se).toLowerCase().includes(V))});c(f),h(!0)},[s,e,a]);let g=f=>{r&&e.length>=r||(t([...e,f]),m(""),h(!1))},w=f=>{t(e.filter(E=>E.id!==f))},y=!r||e.length<r;return(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:o}),(0,Xr.jsxs)("div",{className:"relative",children:[(0,Xr.jsxs)("div",{className:"relative",children:[(0,Xr.jsx)(ht.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Xr.jsx)(L,{value:s,onChange:f=>m(f.target.value),placeholder:y?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:d||!y,onFocus:()=>s&&h(!0)})]}),u&&n.length>0&&(0,Xr.jsx)(O,{className:"absolute top-full left-0 right-0 Xr-10 mt-1 max-h-60",children:(0,Xr.jsx)(Oa,{className:"h-full",children:(0,Xr.jsx)(le,{className:"Xr-2",children:n.map(f=>(0,Xr.jsx)(x,{variant:"ghost",className:"w-full justify-start h-auto Xr-3 mb-1",onClick:()=>g(f),disabled:d,children:(0,Xr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Xr.jsx)(ht.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Xr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Xr.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,Xr.jsx)("div",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[f.tags.slice(0,3).map(E=>(0,Xr.jsx)(Z,{variant:"outline",className:"text-xs",children:E},E)),f.tags.length>3&&(0,Xr.jsxs)(Z,{variant:"outline",className:"text-xs",children:["+",f.tags.length-3," more"]})]})]})]})},f.id))})})}),u&&s&&n.length===0&&(0,Xr.jsx)(O,{className:"absolute top-full left-0 right-0 Xr-10 mt-1",children:(0,Xr.jsxs)(le,{className:"Xr-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Xr.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,Xr.jsx)(O,{className:"Xr-3",children:(0,Xr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Xr.jsx)(ht.FileText,{className:"h-4 w-4 mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Xr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Xr.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,Xr.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:f.description}),f.tags&&f.tags.length>0&&(0,Xr.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:f.tags.map(E=>(0,Xr.jsxs)(Z,{variant:"outline",className:"text-xs",children:[(0,Xr.jsx)(ht.Tag,{className:"h-3 w-3 ht-1"}),E]},E))})]}),(0,Xr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>w(f.id),disabled:d,children:(0,Xr.jsx)(ht.Xr,{className:"h-3 w-3"})})]})},f.id))})]}),u&&(0,Xr.jsx)("div",{className:"fixed inset-0 Xr-0",onClick:()=>h(!1)})]})}function Wo({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:d="Cancel",readOnly:s=!1,availableKnowledgeDocuments:m=[]}){let[n,c]=(0,Et.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[u,h]=(0,Et.useState)(""),[g,w]=(0,Et.useState)(""),[y,f]=(0,Et.useState)(!s);(0,Et.useEffect)(()=>{e&&c(e)},[e]);let E=T=>{T.preventDefault();let P=n.version?parseInt(n.version):0,D=e?(P+1).toString():"1",Q={id:n.id||Date.now().toString(),name:n.name,type:"digital",status:"active",joinedDate:n.joinedDate||new Date,lastActive:n.lastActive||new Date,description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],knowledge:n.knowledge||[],coreKnowledge:n.coreKnowledge||[],version:D,lastUpdated:n.lastUpdated||new Date,isActive:!0};t(Q)},B=(T,P,D)=>{if(!P.trim())return;let Q=n[T]||[];c({...n,[T]:[...Q,P.trim()]}),D("")},V=(T,P)=>{let D=n[T]||[];c({...n,[T]:D.filter((Q,I)=>I!==P)})},se=T=>{T.preventDefault(),f(!y)},N=(T,P,D,Q,I)=>{let Ke=n[T]||[];return(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:P}),y&&(0,Xr.jsxs)("div",{className:"flex gap-2",children:[(0,Xr.jsx)(L,{value:D,onChange:Fe=>Q(Fe.target.value),placeholder:I,onKeyPress:Fe=>{Fe.key==="Enter"&&(Fe.preventDefault(),B(T,D,Q))},disabled:o}),(0,Xr.jsx)(x,{type:"button",variant:"outline",size:"icon",onClick:()=>B(T,D,Q),disabled:o,children:(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4"})})]}),(0,Xr.jsx)("div",{className:"flex flex-wrap gap-2",children:Ke.map((Fe,ze)=>(0,Xr.jsxs)(Z,{className:"gap-1",children:[Fe,y&&(0,Xr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 Xr-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>V(T,ze),disabled:o,children:(0,Xr.jsx)(ht.Xr,{className:"h-3 w-3"})})]},`${T}-${ze}-${Fe}`))})]})},U=i||(y?e?"Edit Colleague":"Add New Colleague":"View Colleague"),fe=r||(e?"Update Colleague":"Add Colleague");return(0,Xr.jsxs)(O,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Xr.jsx)(Ee,{children:(0,Xr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.Bot,{className:"h-5 w-5"}),U]})}),(0,Xr.jsx)(le,{children:(0,Xr.jsxs)("form",{onSubmit:E,className:"space-y-6",children:[(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"name",children:"Name *"}),(0,Xr.jsx)(L,{id:"name",value:n.name||"",onChange:T=>c({...n,name:T.target.value}),required:!0,disabled:o||!y})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,Xr.jsx)(we,{id:"description",value:n.description||"",onChange:T=>c({...n,description:T.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!y})]})]}),(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Xr.jsx)(we,{id:"jobDescription",value:n.jobDescription||"",onChange:T=>c({...n,jobDescription:T.target.value}),rows:4,required:n.type==="digital",disabled:o||!y})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Xr.jsx)(we,{id:"workInstructions",value:n.workInstructions||"",onChange:T=>c({...n,workInstructions:T.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!y})]}),N("capabilities","Capabilities",g,w,"Add capability"),(0,Xr.jsx)(Go,{selectedDocuments:n.knowledge||[],onDocumentsChange:T=>c({...n,knowledge:T}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:o||!y,availableDocuments:m}),(0,Xr.jsx)(Go,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:T=>c({...n,coreKnowledge:T}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!y,availableDocuments:m})]}),(0,Xr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Xr.jsx)(x,{type:"button",variant:"outline",onClick:a,disabled:o,children:y?d:"Close"}),y?(0,Xr.jsx)(x,{type:"submit",disabled:o,children:o?"Saving...":fe}):(0,Xr.jsxs)(x,{type:"button",onClick:se,disabled:o,className:"gap-2",children:[(0,Xr.jsx)(ht.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function ui({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,Et.useState)(""),d=(0,Et.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(i.toLowerCase())||m.email.toLowerCase().includes(i.toLowerCase())||m.role.toLowerCase().includes(i.toLowerCase())||(m.skills||[]).some(c=>c.toLowerCase().includes(i.toLowerCase()))),[e,i]),s=m=>{t(m)};return(0,Xr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Xr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Xr.jsx)(ht.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"Choose a user to add ht a colleague"})]})]}),(0,Xr.jsx)(O,{className:"container",children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsxs)("div",{className:"relative",children:[(0,Xr.jsx)(ht.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Xr.jsx)(L,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:m=>r(m.target.value),className:"pl-9"})]})})})})}),(0,Xr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:d.map(m=>(0,Xr.jsx)(Ko.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Xr.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-lg ${o===m.id?"ring-2 ring-primary":""}`,onClick:()=>s(m),children:[(0,Xr.jsx)(Ee,{className:"pb-3",children:(0,Xr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Xr.jsxs)(Kt,{children:[(0,Xr.jsx)(ja,{src:m.avatar,alt:m.name}),(0,Xr.jsx)($t,{children:(0,Xr.jsx)(ht.User,{className:"h-4 w-4"})})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(Le,{className:"text-lg",children:m.name}),(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:m.role})]})]}),o===m.id&&(0,Xr.jsx)(ht.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Xr.jsx)(le,{className:"pt-0",children:(0,Xr.jsxs)("div",{className:"space-y-3",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Xr.jsx)("Xr",{className:"text-sm font-medium",children:m.email})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Xr.jsx)(Z,{variant:"secondary",children:m.department})]}),m.location&&(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Xr.jsx)("Xr",{className:"text-sm",children:m.location})]}),m.skills&&m.skills.length>0&&(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[m.skills.slice(0,3).map(n=>(0,Xr.jsx)(Z,{variant:"outline",className:"text-xs",children:n},n)),m.skills.length>3&&(0,Xr.jsxs)(Z,{variant:"outline",className:"text-xs",children:["+",m.skills.length-3]})]})]})]})})]})},m.id))}),d.length===0&&(0,Xr.jsx)(O,{className:"container mt-4",children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsxs)("div",{className:"text-center py-8",children:[(0,Xr.jsx)(ht.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Xr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function gi({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,Et.useState)(""),[d,s]=(0,Et.useState)("all"),m=(0,Et.useMemo)(()=>e.filter(u=>{let h=u.name.toLowerCase().includes(i.toLowerCase())||u.jobDescription.toLowerCase().includes(i.toLowerCase())||u.capabilities.some(w=>w.toLowerCase().includes(i.toLowerCase()))||u.workInstructions.toLowerCase().includes(i.toLowerCase()),g=d==="all"||u.status===d;return h&&g}),[e,i,d]),n=u=>{let h={...u,id:`${u.id}-clone-${Date.now()}`,name:`${u.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(h)},c=u=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(u);return(0,Xr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Xr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Xr.jsx)(ht.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,Xr.jsx)(O,{children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsxs)("div",{className:"relative",children:[(0,Xr.jsx)(ht.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Xr.jsx)(L,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:u=>r(u.target.value),className:"pl-9"})]})}),(0,Xr.jsxs)("select",{value:d,onChange:u=>s(u.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Xr.jsx)("option",{value:"all",children:"All Status"}),(0,Xr.jsx)("option",{value:"active",children:"Active"}),(0,Xr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Xr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(u=>(0,Xr.jsx)(Ko.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Xr.jsxs)(O,{className:`cursor-pointer transition-all hover:shadow-lg ${o===u.id?"ring-2 ring-primary":""}`,onClick:()=>n(u),children:[(0,Xr.jsx)(Ee,{className:"pb-3",children:(0,Xr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Xr.jsx)(Kt,{children:(0,Xr.jsx)($t,{className:"bg-blue-100",children:(0,Xr.jsx)(ht.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsxs)(Le,{className:"text-lg flex items-center gap-2",children:[u.name,(0,Xr.jsx)(Z,{variant:u.status==="active"?"default":"secondary",className:"text-xs",children:u.status})]}),(0,Xr.jsxs)("Xr",{className:"text-sm text-muted-foreground",children:["v",u.version]})]})]}),(0,Xr.jsxs)(x,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:h=>{h.stopPropagation(),n(u)},children:[(0,Xr.jsx)(ht.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Xr.jsx)(le,{className:"pt-0",children:(0,Xr.jsxs)("div",{className:"space-y-3",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Xr.jsx)("Xr",{className:"text-sm line-clamp-2",children:u.jobDescription})]}),u.capabilities&&u.capabilities.length>0&&(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[u.capabilities.slice(0,3).map(h=>(0,Xr.jsx)(Z,{variant:"outline",className:"text-xs",children:h},h)),u.capabilities.length>3&&(0,Xr.jsxs)(Z,{variant:"outline",className:"text-xs",children:["+",u.capabilities.length-3]})]})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Xr.jsx)(ht.Calendar,{className:"h-3 w-3"}),(0,Xr.jsxs)("span",{children:["Updated ",c(u.lastUpdated)]})]}),u.knowledge&&(0,Xr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Xr.jsx)(ht.Users,{className:"h-3 w-3"}),(0,Xr.jsxs)("span",{children:[u.knowledge.length," docs"]})]})]}),u.workInstructions&&(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Xr.jsx)("Xr",{className:"text-xs line-clamp-2",children:u.workInstructions})]})]})})]})},u.id))}),m.length===0&&(0,Xr.jsx)(O,{children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsxs)("div",{className:"text-center py-8",children:[(0,Xr.jsx)(ht.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Xr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function fi({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,Xr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Xr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Xr.jsx)(ht.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,Xr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Xr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Xr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Xr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Xr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Xr.jsx)(ht.User,{className:"h-8 w-8 text-blue-600"})}),(0,Xr.jsx)(Le,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Xr.jsxs)(le,{className:"text-center",children:[(0,Xr.jsx)("Xr",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add ht team members."}),(0,Xr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.Users,{className:"h-4 w-4 text-blue-600"}),(0,Xr.jsx)("span",{children:"Browse existing users"})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.User,{className:"h-4 w-4 text-blue-600"}),(0,Xr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Xr.jsx)(x,{className:"mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Xr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Xr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Xr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Xr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Xr.jsx)(ht.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Xr.jsx)(Le,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Xr.jsxs)(le,{className:"text-center",children:[(0,Xr.jsx)("Xr",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,Xr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Xr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.Users,{className:"h-4 w-4 text-purple-600"}),(0,Xr.jsx)("span",{children:"Create from templates"})]})]}),(0,Xr.jsx)(x,{className:"mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function vi({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,Xr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Xr.jsxs)(x,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,Xr.jsx)(ht.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,Xr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Xr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Xr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Xr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Xr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Xr.jsx)(ht.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Xr.jsx)(Le,{className:"text-xl",children:"Clone Existing"})]}),(0,Xr.jsxs)(le,{className:"text-center",children:[(0,Xr.jsx)("Xr",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,Xr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Xr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Xr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Xr.jsx)(x,{className:"mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Xr.jsx)(Ko.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Xr.jsxs)(O,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Xr.jsxs)(Ee,{className:"text-center pb-4",children:[(0,Xr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Xr.jsx)(ht.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Xr.jsx)(Le,{className:"text-xl",children:"Create New"})]}),(0,Xr.jsxs)(le,{className:"text-center",children:[(0,Xr.jsx)("Xr",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Xr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4 text-green-600"}),(0,Xr.jsx)("span",{children:"Custom job description"})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Xr.jsx)(ht.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Xr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Xr.jsx)(x,{className:"mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function bi(e,t){let[a,o]=(0,Et.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,Et.useEffect)(()=>{i(a)},[]),[a,i]}var go=require("react-icons/Xr");function Qe({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:d,className:s}){let[m,n]=bi(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),c=!i&&!t||m;return(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} Xr-8 text-white ${s||""}`,children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Xr.jsx)(Z,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Xr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-3",children:[c&&o&&(0,Xr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,Xr.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 Xr-1 text-white transition-colors",onClick:()=>n(!m),style:{lineHeight:0},children:m?(0,Xr.jsx)(go.FaChevronDown,{size:22}):(0,Xr.jsx)(go.FaChevronUp,{size:22})})]})]}),!c&&(0,Xr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsx)("Xr",{className:"max-w-[600px] text-white/80",children:t}),(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Xr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,Xr.jsx)(x,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),d&&(0,Xr.jsx)("div",{className:"hidden lg:block",children:d})]})]})}function qo({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:d,availableUsers:s=[],existingDigitalColleagues:m=[]}){let[n,c]=(0,Et.useState)(e||[]),[u,h]=(0,Et.useState)(""),[g,w]=(0,Et.useState)("all"),[y,f]=(0,Et.useState)("all"),[E,B]=(0,Et.useState)("all"),[V,se]=(0,Et.useState)(null),[N,U]=(0,Et.useState)(null);(0,Et.useEffect)(()=>{c(e||[])},[e]);let fe=Array.isArray(s)?s:[],T=Array.isArray(m)?m:[],[P,D]=(0,Et.useState)("main"),Q=n.filter(v=>{if(!v||!v.name)return!1;let ee=v.name.toLowerCase().includes(u.toLowerCase())||v.type==="human"&&(v.email?.toLowerCase().includes(u.toLowerCase())||v.role?.toLowerCase().includes(u.toLowerCase()))||v.type==="digital"&&v.jobDescription?.toLowerCase().includes(u.toLowerCase()),q=g==="all"||v.type==="human"&&v.department===g,We=y==="all"||v.status===y;return ee&&q&&We}),I=Q.filter(v=>v.type==="human"),Ke=Q.filter(v=>v.type==="digital"),Fe=()=>{D("typeSelection")},ze=v=>{v.type==="digital"&&(se(v),D("form")),console.log("Editing colleague:",v),a?.(v)},k=v=>{v.type==="digital"&&(U(v),D("view"))},pe=v=>{let ee={id:`human-${Date.now()}`,type:"human",name:v.name,email:v.email,role:v.role,department:v.department,phone:v.phone,location:v.location,timezone:v.timezone,skills:v.skills||[],bio:v.bio,status:"active",joinedDate:new Date,lastActive:new Date};c(q=>[...q,ee]),t?.(ee),D("main")},Pe=v=>{if(!v||!v.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",v);return}c(ee=>[...ee,v]),t?.(v),D("main")},rt=()=>{se(null),D("form")},He=v=>{if(!v||!v.id){console.error("Invalid colleague provided to handleSaveColleague:",v);return}V?(c(ee=>ee.map(q=>q.id===v.id?v:q)),a?.(v)):(c(ee=>[...ee,v]),t?.(v)),D("main"),se(null)},Te=()=>{D("main"),se(null),U(null)},dt=()=>{D("main"),U(null)},ct=()=>{N&&(se(N),U(null),D("form"))},mt=v=>{console.log("handling delete colleague",v),c(ee=>ee.filter(q=>q.id!==v)),o?.(v)},pt=()=>{h(""),w("all"),f("all")},Ft=()=>{let v=[];return T.forEach(q=>{q.knowledge&&Array.isArray(q.knowledge)&&v.push(...q.knowledge),q.coreKnowledge&&Array.isArray(q.coreKnowledge)&&v.push(...q.coreKnowledge)}),n.forEach(q=>{q.type==="digital"&&(q.knowledge&&Array.isArray(q.knowledge)&&v.push(...q.knowledge),q.coreKnowledge&&Array.isArray(q.coreKnowledge)&&v.push(...q.coreKnowledge))}),v.filter((q,We,Tt)=>We===Tt.findIndex(Ot=>Ot.id===q.id))};return P==="typeSelection"?(0,Xr.jsx)(fi,{onSelectHuman:()=>D("userSelection"),onSelectDigital:()=>D("digitalOptions"),onCancel:()=>D("main")}):P==="userSelection"?(0,Xr.jsx)(ui,{users:fe,onUserSelect:pe,onCancel:()=>D("typeSelection")}):P==="digitalOptions"?(0,Xr.jsx)(vi,{onCloneExisting:()=>D("digitalClone"),onCreateNew:rt,onCancel:()=>D("typeSelection")}):P==="digitalClone"?(0,Xr.jsx)(gi,{digitalColleagues:T,onColleagueClone:Pe,onCancel:()=>D("digitalOptions")}):P==="form"?(0,Xr.jsx)(Wo,{colleague:V||void 0,onSave:He,onCancel:Te,availableKnowledgeDocuments:Ft()}):P==="view"?(0,Xr.jsx)(Wo,{colleague:N||void 0,onSave:He,onCancel:dt,readOnly:!0,availableKnowledgeDocuments:Ft()}):(0,Xr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsx)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Xr.jsxs)("div",{className:`space-y-6 ${d||""}`,children:[(0,Xr.jsx)(Qe,{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:Fe}}),(0,Xr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Xr.jsxs)(O,{children:[(0,Xr.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Xr.jsx)(Le,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Xr.jsx)(ht.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Xr.jsxs)(le,{children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,Xr.jsxs)("Xr",{className:"text-xs text-muted-foreground",children:[n.filter(v=>v.status==="active").length," active"]})]})]}),(0,Xr.jsxs)(O,{children:[(0,Xr.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Xr.jsx)(Le,{className:"text-sm font-medium",children:"Human Members"}),(0,Xr.jsx)(ht.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Xr.jsxs)(le,{children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(v=>v.type==="human").length}),(0,Xr.jsxs)("Xr",{className:"text-xs text-muted-foreground",children:[n.filter(v=>v.type==="human"&&v.status==="active").length," ","active"]})]})]}),(0,Xr.jsxs)(O,{children:[(0,Xr.jsxs)(Ee,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Xr.jsx)(Le,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Xr.jsx)(ht.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Xr.jsxs)(le,{children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(v=>v.type==="digital").length}),(0,Xr.jsxs)("Xr",{className:"text-xs text-muted-foreground",children:[n.filter(v=>v.type==="digital"&&v.status==="active").length," ","active"]})]})]})]}),(0,Xr.jsx)(O,{children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsxs)("div",{className:"relative",children:[(0,Xr.jsx)(ht.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Xr.jsx)(L,{placeholder:"Search colleagues...",value:u,onChange:v=>h(v.target.value),className:"pl-9"})]})}),(0,Xr.jsxs)(Se,{value:g,onValueChange:w,children:[(0,Xr.jsx)(Ne,{className:"w-full md:w-[180px]",children:(0,Xr.jsx)(Ie,{placeholder:"Department"})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)(K,{value:"all",children:"All Departments"}),r.map(v=>(0,Xr.jsx)(K,{value:v,children:v},v))]})]}),(0,Xr.jsxs)(Se,{value:y,onValueChange:f,children:[(0,Xr.jsx)(Ne,{className:"w-full md:w-[140px]",children:(0,Xr.jsx)(Ie,{placeholder:"Status"})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)(K,{value:"all",children:"All Status"}),(0,Xr.jsx)(K,{value:"active",children:"Active"}),(0,Xr.jsx)(K,{value:"inactive",children:"Inactive"})]})]}),(u||g!=="all"||y!=="all")&&(0,Xr.jsxs)(x,{variant:"outline",onClick:pt,className:"gap-2",children:[(0,Xr.jsx)(ht.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsx)(no,{activeTab:E,onTabChange:B,tabOptions:[{value:"all",label:`All (${Q.length})`},{value:"human",label:`Human (${I.length})`},{value:"digital",label:`Digital (${Ke.length})`}],maxWidth:"400px",gridCols:3}),E==="all"&&(0,Xr.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:Q.map(v=>(0,Xr.jsx)(mo,{colleague:v,onEdit:ze,onDelete:mt,onViewDetails:k,compact:i},`${v}-${v.id}`))}),E==="human"&&(0,Xr.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:I.map(v=>(0,Xr.jsx)(mo,{colleague:v,onEdit:ze,onDelete:mt,onViewDetails:k,compact:i},v.id))}),E==="digital"&&(0,Xr.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:Ke.map(v=>(0,Xr.jsx)(mo,{colleague:v,onEdit:ze,onDelete:mt,onViewDetails:k,compact:i},v.id))})]}),Q.length===0&&(0,Xr.jsx)(O,{children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsxs)("div",{className:"text-center py-8",children:[(0,Xr.jsx)(ht.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Xr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground mb-4",children:u||g!=="all"||y!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,Xr.jsxs)(x,{onClick:Fe,className:"gap-2",children:[(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function vo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,Xr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,Xr.jsxs)("div",{className:"bg-muted/50 Xr-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Xr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Xr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Xr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Xr.jsx)("div",{className:"divide-y",children:e.map(d=>(0,Xr.jsxs)(Ko.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"Xr-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(d),children:[(0,Xr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Xr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Xr.jsx)("div",{children:(0,Xr.jsx)("Xr",{className:"font-medium",children:d.name})})]}),(0,Xr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:d.filesize}),(0,Xr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Xr.jsx)("span",{className:"text-sm md:text-base",children:typeof d.createdAt=="string"?d.createdAt:new Date(d.createdAt).toLocaleDateString()}),(0,Xr.jsx)("div",{className:"flex gap-1",children:(0,Xr.jsx)(x,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(d)},children:(0,Xr.jsx)(ht.Trash2,{className:"h-4 w-4"})})})]})]},d.name))})]})}function Ua({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:d}){let[s,m]=(0,Et.useState)(e),[n,c]=(0,Et.useState)(""),[u,h]=(0,Et.useState)("all"),[g,w]=(0,Et.useState)("all");(0,Et.useEffect)(()=>{m(e)},[e]);let y=Array.from(new Set(s.map(T=>T.mimeType))),f=s.filter(T=>{let P=T.name.toLowerCase().includes(n.toLowerCase()),D=u==="all"||T.mimeType===u;return P&&D}),E=f.slice(0,10),B=f.filter(Boolean),V=()=>{t?.()},se=T=>{a?.(T)},N=T=>{console.log("deleting file",T),m(P=>P.filter(D=>D.name!==T.name)),o?.(T.id)},U=T=>{i?.(T)},fe=()=>{c(""),h("all")};return(0,Xr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsx)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Xr.jsxs)("div",{className:`space-y-6 ${d||""}`,children:[(0,Xr.jsx)(Qe,{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:V},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Xr.jsx)(O,{children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsxs)("div",{className:"relative",children:[(0,Xr.jsx)(ht.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Xr.jsx)(L,{placeholder:"Search files...",value:n,onChange:T=>c(T.target.value),className:"pl-9"})]})}),(n||u!=="all")&&(0,Xr.jsxs)(x,{variant:"outline",onClick:fe,className:"gap-2",children:[(0,Xr.jsx)(ht.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsx)(no,{activeTab:g,onTabChange:w,tabOptions:[{value:"all",label:`All Files (${f.length})`},{value:"recent",label:`Recent (${E.length})`}],maxWidth:"500px",gridCols:3}),g==="all"&&(0,Xr.jsx)(vo,{files:f,onFileClick:U,onFileEdit:se,onFileDelete:N,showHeader:!r}),g==="recent"&&(0,Xr.jsx)(vo,{files:E,onFileClick:U,onFileEdit:se,onFileDelete:N,showHeader:!r}),g==="shared"&&(0,Xr.jsx)(vo,{files:B,onFileClick:U,onFileEdit:se,onFileDelete:N,showHeader:!r})]}),f.length===0&&(0,Xr.jsx)(O,{children:(0,Xr.jsx)(le,{className:"pt-6",children:(0,Xr.jsxs)("div",{className:"text-center py-8",children:[(0,Xr.jsx)(ht.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Xr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground mb-4",children:n||u!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Xr.jsxs)(x,{onClick:V,className:"gap-2",children:[(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function Ci({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:i=[]}){let[r,d]=(0,Et.useState)({...e,updatedAt:new Date}),s=()=>{let y=new Set,f=new Set;return i.forEach(E=>{E.menuConfig.groupBy.forEach(B=>y.add(B))}),o.forEach(E=>{E.metadata&&Object.keys(E.metadata).forEach(B=>f.add(B))}),{contextKeys:Array.from(y).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...y,...f])).sort()}},m=y=>{let f=new Set;return o.forEach(E=>{E.metadata?.[y]&&f.add(String(E.metadata[y]))}),Array.from(f).sort()},n=s(),c=()=>{t(r)},u=(y,f)=>{d(E=>({...E,metadata:{...E.metadata,[y]:f}}))},h=(y,f)=>{f==="__custom__"?u(y,""):u(y,f)},g=()=>{let y=`field_${Date.now()}`;u(y,"")},w=y=>{d(f=>{let E={...f.metadata};return delete E[y],{...f,metadata:E}})};return(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Xr.jsxs)("div",{className:"border-b border-border bg-card Xr-8",children:[(0,Xr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Xr.jsx)("div",{className:"flex-shrink-0 Xr-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,Xr.jsx)(ht.Edit3,{className:"h-6 w-6 text-primary"})}),(0,Xr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,Xr.jsxs)("div",{className:"flex gap-2",children:[(0,Xr.jsxs)(x,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,Xr.jsx)(ht.Xr,{className:"h-4 w-4"}),"Cancel"]}),(0,Xr.jsxs)(x,{size:"sm",onClick:c,className:"gap-2",children:[(0,Xr.jsx)(ht.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,Xr.jsx)(L,{value:r.title,onChange:y=>d(f=>({...f,title:y.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,Xr.jsx)(we,{value:r.description||"",onChange:y=>d(f=>({...f,description:y.target.value})),placeholder:"Document description...",rows:2})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),n.contextKeys.length>0&&(0,Xr.jsxs)("Xr",{className:"text-xs text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,Xr.jsxs)(x,{type:"button",variant:"outline",size:"sm",onClick:g,className:"gap-1 h-8",children:[(0,Xr.jsx)(ht.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,Xr.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([y,f])=>{let E=m(y);return(0,Xr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,Xr.jsx)(L,{value:y,onChange:B=>{let V=B.target.value,se=r.metadata?.[y];d(N=>{let U={...N.metadata};return delete U[y],V&&(U[V]=se||""),{...N,metadata:U}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${y}`}),(0,Xr.jsx)("datalist",{id:`metadata-keys-${y}`,children:n.allKeys.map(B=>(0,Xr.jsx)("option",{value:B},B))}),(0,Xr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),E.length>0?(0,Xr.jsxs)(Se,{value:String(f||""),onValueChange:B=>h(y,B),children:[(0,Xr.jsx)(Ne,{className:"flex-1 h-8 text-sm",children:(0,Xr.jsx)(Ie,{placeholder:"Value"})}),(0,Xr.jsxs)(Ce,{children:[E.map(B=>(0,Xr.jsx)(K,{value:B,children:B},B)),(0,Xr.jsx)(K,{value:"__custom__",children:(0,Xr.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,Xr.jsx)(L,{value:String(f||""),onChange:B=>u(y,B.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,Xr.jsx)(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>w(y),className:"h-8 w-8 Xr-0 text-muted-foreground hover:text-destructive",children:(0,Xr.jsx)(ht.Xr,{className:"h-3 w-3"})})]},y)})}):(0,Xr.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,Xr.jsx)("Xr",{className:"text-xs text-muted-foreground",children:'No metadata \u2022 Click "Add" to create fields'})})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,Xr.jsx)(Z,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,Xr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Xr.jsxs)("div",{className:"Xr-8",children:[(0,Xr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,Xr.jsx)(we,{value:r.content||"",onChange:y=>d(f=>({...f,content:y.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Pi=e=>(0,Xr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),Si=e=>(0,Xr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Gn=e=>(0,Xr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Xr.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg Xr-4 mb-4",children:(0,Xr.jsxs)("Xr",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Xr.jsx)("strong",{children:"RichText Renderer:"})," This Et a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Xr.jsx)("pre",{className:"text-sm",children:e})]}),Wn=e=>(0,Xr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Xr.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg Xr-4 mb-4",children:(0,Xr.jsxs)("Xr",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Xr.jsx)("strong",{children:"MDX Renderer:"})," This Et a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Pi(e)]});function Ti({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[d,s]=(0,Et.useState)(!1),m=g=>{switch(g){case"markdown":case"mdx":return(0,Xr.jsx)(ht.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Xr.jsx)(ht.File,{className:"h-6 w-6 text-success"});case"text":return(0,Xr.jsx)(ht.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Xr.jsx)(ht.File,{className:"h-6 w-6 text-muted-foreground"})}},n=g=>{switch(g){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"}},c=(g,w)=>{let y={markdown:Pi,mdx:Wn,richtext:Gn,text:Si},f=o?.[w]||y[w];return f?f(g):Si(g)},u=g=>{s(!1),t?.(g)},h=()=>{s(!1)};return d?(0,Xr.jsx)(Ci,{document:e,onSave:u,onCancel:h,availableDocuments:i,knowledgeContexts:r}):(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Xr.jsxs)("div",{className:"border-b border-border bg-card Xr-8",children:[(0,Xr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Xr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Xr.jsx)("div",{className:"flex-shrink-0 Xr-3 rounded-xl bg-muted border border-border",children:m(e.format)}),(0,Xr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Xr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Xr.jsx)("Xr",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,Xr.jsx)("div",{className:"flex-shrink-0",children:(0,Xr.jsxs)(x,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,Xr.jsx)(ht.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Xr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(g=>(0,Xr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",g]},g))]})]}),(0,Xr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Xr.jsxs)("div",{className:"Xr-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Xr.jsxs)("div",{className:"mb-6",children:[(0,Xr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Xr.jsx)("div",{className:"bg-muted rounded-lg Xr-3 border border-border",children:(0,Xr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(e.metadata).map(([g,w])=>(0,Xr.jsxs)("div",{className:"flex gap-1",children:[(0,Xr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[g.replace(/([Xr-Z])/g," $1").trim(),":"]}),(0,Xr.jsx)("span",{className:"text-foreground truncate",children:String(w)})]},g))})})]}),(0,Xr.jsx)("div",{className:"space-y-4",children:e.content?(0,Xr.jsx)("div",{className:"relative",children:(0,Xr.jsx)("div",{className:"bg-card border border-border rounded-xl Xr-6 overflow-hidden",children:c(e.content,e.format)})}):(0,Xr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Xr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Xr.jsx)(ht.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Xr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Ri({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:d=!0}){let[s,m]=(0,Et.useState)(o===0),n=a&&Object.keys(a).length>0,c=t.length+(a?Object.values(a).reduce((g,w)=>g+w.documents.length,0):0),u=g=>{switch(g){case"markdown":case"mdx":return(0,Xr.jsx)(ht.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Xr.jsx)(ht.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Xr.jsx)(ht.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},h=g=>{let w=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return w[g%w.length]};return(0,Xr.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,Xr.jsxs)(Ko.motion.div,{className:`group flex items-center gap-3 Xr-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>m(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Xr.jsx)("div",{className:`w-1 h-6 rounded-full ${h(o)}`}),(0,Xr.jsx)(Ko.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Xr.jsx)(ht.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Xr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Xr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Xr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),d&&c>0&&(0,Xr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Xr.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,Xr.jsx)(Ko.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Xr.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((g,w)=>(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:w*.05,duration:.2},className:`group flex items-center gap-3 Xr-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===g.id?"bg-primary/10 border-Xr-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(g),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Xr.jsx)("div",{className:"flex-shrink-0",children:u(g.format)}),(0,Xr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Xr.jsx)("Xr",{className:`text-sm truncate transition-colors ${r===g.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:g.title}),g.description&&(0,Xr.jsx)("Xr",{className:"text-xs text-muted-foreground truncate mt-0.5",children:g.description})]}),g.tags&&g.tags.length>0&&(0,Xr.jsx)("div",{className:"flex-shrink-0",children:(0,Xr.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:g.tags[0]})})]},g.id)),a&&Object.entries(a).map(([g,w])=>(0,Xr.jsx)(Ri,{label:g,documents:w.documents,children:w.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:d},g))]})})]})}function Ei({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:d,editable:s=!0}){let[m,n]=(0,Et.useState)(""),[c,u]=(0,Et.useState)(null),h=(0,Et.useMemo)(()=>m?e.filter(y=>y.title.toLowerCase().includes(m.toLowerCase())||y.description?.toLowerCase().includes(m.toLowerCase())||y.tags?.some(f=>f.toLowerCase().includes(m.toLowerCase()))||Object.values(y.metadata||{}).some(f=>String(f).toLowerCase().includes(m.toLowerCase()))):e,[e,m]),g=(0,Et.useMemo)(()=>{let y=(f,E)=>{if(E.length===0)return{};let[B,...V]=E;return f.reduce((N,U)=>{let fe=U.metadata?.[B]||"Uncategorized",T=String(fe);if(N[T]||(N[T]={documents:[],children:{}}),V.length===0)N[T].documents.push(U);else{let P=y([U],V),D=Object.keys(P)[0];D&&(N[T].children||(N[T].children={}),N[T].children[D]?N[T].children[D].documents.push(...P[D].documents):N[T].children[D]=P[D])}return N},{})};return y(h,t.groupBy)},[h,t.groupBy]),w=y=>{u(y),a?.(y)};return(0,Xr.jsxs)("div",{className:`flex h-full ${d||""}`,children:[(0,Xr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Xr.jsx)("div",{className:"Xr-6 border-b border-border",children:(0,Xr.jsxs)("div",{className:"relative",children:[(0,Xr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Xr.jsx)(ht.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Xr.jsx)(L,{placeholder:"Search knowledge base...",value:m,onChange:y=>n(y.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,Xr.jsx)(Oa,{className:"h-[calc(100%-100px)]",children:(0,Xr.jsxs)("div",{className:"Xr-4 space-y-3",children:[Object.entries(g).map(([y,f])=>(0,Xr.jsx)(Ri,{label:y,documents:f.documents,children:f.children,level:0,onDocumentClick:w,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},y)),Object.keys(g).length===0&&(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Xr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Xr.jsx)(ht.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Xr.jsx)("Xr",{className:"text-sm font-medium",children:"No documents found"}),(0,Xr.jsx)("Xr",{className:"text-xs mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Xr.jsx)("div",{className:"flex-1 bg-background",children:c?(0,Xr.jsx)(Ti,{document:c,onDocumentUpdate:i,editable:s}):(0,Xr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Xr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Xr.jsx)(ht.FileText,{className:"h-10 w-10 text-primary"})}),(0,Xr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Xo({documents:e=[],contexts:t=[],onDocumentClick:a=d=>console.log("Document clicked:",d),onDocumentShare:o=d=>console.log("Share document:",d),onLoadDocumentContent:i,selectedDocumentId:r}){let[d,s]=(0,Et.useState)(t[0]);return!t||t.length===0?(0,Xr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Xr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Xr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Xr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,Xr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Xr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Xr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Xr.jsxs)("div",{className:"mt-6",children:[(0,Xr.jsx)("div",{className:"border-b border-border",children:(0,Xr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(m=>(0,Xr.jsxs)("button",{onClick:()=>s(m),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${d.id===m.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[m.icon,m.label]},m.id))})}),d.description&&(0,Xr.jsx)("div",{className:"mt-3 px-1",children:(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:d.description})})]})]}),(0,Xr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Xr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Xr.jsx)(Ei,{documents:e,menuConfig:d.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}var me=ve(require("react"));var Ai=(e=768)=>{let[t,a]=(0,Et.useState)(!1);return(0,Et.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var Mi=ve(require("react")),Jo=ve(require("@radix-ui/react-separator"));var Yo=Mi.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,Xr.jsx)(Jo.Root,{ref:i,decorative:a,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Yo.displayName=Jo.Root.displayName;var Ka=ve(require("react")),at=ve(require("@radix-ui/react-dialog"));var ji=at.Root;var qn=at.Portal,Oi=Ka.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(at.Overlay,{className:b("fixed inset-0 Xr-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}));Oi.displayName=at.Overlay.displayName;var Xn=(0,Wr.cva)("fixed Xr-50 gap-4 bg-background Xr-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-Xr data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Zo=Ka.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,Xr.jsxs)(qn,{children:[(0,Xr.jsx)(Oi,{}),(0,Xr.jsxs)(at.Content,{ref:i,className:b(Xn({side:e}),t),...o,children:[(0,Xr.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,Xr.jsx)(Na.Cross2Icon,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));Zo.displayName=at.Content.displayName;var Jn=({className:e,...t})=>(0,Xr.jsx)("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Jn.displayName="SheetHeader";var Yn=({className:e,...t})=>(0,Xr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yn.displayName="SheetFooter";var Zn=Ka.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(at.Title,{ref:a,className:b("text-lg font-semibold text-foreground",e),...t}));Zn.displayName=at.Title.displayName;var Qn=Ka.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(at.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Qn.displayName=at.Description.displayName;function Qo({className:e,...t}){return(0,Xr.jsx)("div",{className:b("animate-pulse rounded-md bg-primary/10",e),...t})}var Hi=ve(require("react")),At=ve(require("@radix-ui/react-tooltip"));var Vi=At.Provider,Ui=At.Root,Ki=At.Trigger,tr=Hi.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Xr.jsx)(At.Portal,{children:(0,Xr.jsx)(At.Content,{ref:o,sideOffset:t,className:b("Xr-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})}));tr.displayName=At.Content.displayName;var el="sidebar:state",tl=60*60*24*7,al="16rem",ol="18rem",rl="3rem",il="b",Gi=me.createContext(null);function xo(){let e=me.useContext(Gi);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var ar=me.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...d},s)=>{let m=Ai(),[n,c]=me.useState(!1),[u,h]=me.useState(e),g=t??u,w=me.useCallback(B=>{if(a)return a?.(typeof B=="function"?B(g):B);h(B),document.cookie=`${el}=${g}; path=/; max-age=${tl}`},[a,g]),y=me.useCallback(()=>m?c(B=>!B):w(B=>!B),[m,w,c]);me.useEffect(()=>{let B=V=>{V.key===il&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),y())};return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[y]);let f=g?"expanded":"collapsed",E=me.useMemo(()=>({state:f,open:g,setOpen:w,isMobile:m,openMobile:n,setOpenMobile:c,toggleSidebar:y}),[f,g,w,m,n,c,y]);return(0,Xr.jsx)(Gi.Provider,{value:E,children:(0,Xr.jsx)(Vi,{delayDuration:0,children:(0,Xr.jsx)("div",{style:{"--sidebar-width":al,"--sidebar-width-icon":rl,...i},className:b("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...d,children:r})})})});ar.displayName="SidebarProvider";var sl=me.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},d)=>{let{isMobile:s,state:m,openMobile:n,setOpenMobile:c}=xo();return a==="none"?(0,Xr.jsx)("div",{className:b("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:d,...r,children:i}):s?(0,Xr.jsx)(ji,{open:n,onOpenChange:c,...r,children:(0,Xr.jsx)(Zo,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar Xr-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ol},side:e,children:(0,Xr.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,Xr.jsxs)("div",{ref:d,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,Xr.jsx)("div",{className:b("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)Xr+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,Xr.jsx)("div",{className:b("duration-200 fixed top-14 bottom-0 Xr-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"?"Xr-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)Xr+_theme(spacing.4)Xr+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-Xr",o),...r,children:(0,Xr.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})})]})});sl.displayName="Sidebar";var nl=me.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=xo();return(0,Xr.jsxs)(x,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:b("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,Xr.jsx)(ht.PanelLeft,{}),(0,Xr.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});nl.displayName="SidebarTrigger";var ll=me.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=xo();return(0,Xr.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:b("absolute inset-y-0 Xr-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]Xr&]:cursor-w-resize [[data-side=right]Xr&]:cursor-e-resize","[[data-side=left][data-state=collapsed]Xr&]:cursor-e-resize [[data-side=right][data-state=collapsed]Xr&]: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]Xr&]:-right-2","[[data-side=right][data-collapsible=offcanvas]Xr&]:-left-2",e),...t})});ll.displayName="SidebarRail";var dl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("main",{ref:a,className:b("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-xl md:peer-data-[variant=inset]:shadow",e),...t}));dl.displayName="SidebarInset";var cl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(L,{ref:a,"data-sidebar":"input",className:b("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));cl.displayName="SidebarInput";var ml=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,"data-sidebar":"header",className:b("flex flex-col gap-2 Xr-2",e),...t}));ml.displayName="SidebarHeader";var pl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,"data-sidebar":"footer",className:b("flex flex-col gap-2 Xr-2",e),...t}));pl.displayName="SidebarFooter";var ul=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(Yo,{ref:a,"data-sidebar":"separator",className:b("mx-2 w-auto bg-sidebar-border",e),...t}));ul.displayName="SidebarSeparator";var gl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,"data-sidebar":"content",className:b("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));gl.displayName="SidebarContent";var fl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,"data-sidebar":"group",className:b("relative flex w-full min-w-0 flex-col Xr-2",e),...t}));fl.displayName="SidebarGroup";var vl=me.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Xr.jsx)(t?Gr.Slot:"div",{ref:o,"data-sidebar":"group-label",className:b("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}));vl.displayName="SidebarGroupLabel";var bl=me.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,Xr.jsx)(t?Gr.Slot:"button",{ref:o,"data-sidebar":"group-action",className:b("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md Xr-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}));bl.displayName="SidebarGroupAction";var hl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,"data-sidebar":"group-content",className:b("w-full text-sm",e),...t}));hl.displayName="SidebarGroupContent";var xl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("ul",{ref:a,"data-sidebar":"menu",className:b("flex w-full min-w-0 flex-col gap-1",e),...t}));xl.displayName="SidebarMenu";var yl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("Wr",{ref:a,"data-sidebar":"menu-item",className:b("group/menu-item relative",e),...t}));yl.displayName="SidebarMenuItem";var wl=(0,$i.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md Xr-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]:!Xr-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]:!Xr-0"}},defaultVariants:{variant:"default",size:"default"}}),Nl=me.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...d},s)=>{let m=e?Gr.Slot:"button",{isMobile:n,state:c}=xo(),u=(0,Xr.jsx)(m,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:b(wl({variant:a,size:o}),r),...d});return i?(typeof i=="string"&&(i={children:i}),(0,Xr.jsxs)(Ui,{children:[(0,Xr.jsx)(Ki,{asChild:!0,children:u}),(0,Xr.jsx)(tr,{side:"right",align:"center",hidden:c!=="collapsed"||n,...i})]})):u});Nl.displayName="SidebarMenuButton";var Cl=me.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,Xr.jsx)(t?Gr.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:b("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md Xr-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}));Cl.displayName="SidebarMenuAction";var Sl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:b("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}));Sl.displayName="SidebarMenuBadge";var Dl=me.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=me.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,Xr.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:b("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,Xr.jsx)(Qo,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,Xr.jsx)(Qo,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});Dl.displayName="SidebarMenuSkeleton";var kl=me.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:b("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-Xr border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));kl.displayName="SidebarMenuSub";var Pl=me.forwardRef(({...e},t)=>(0,Xr.jsx)("Wr",{ref:t,...e}));Pl.displayName="SidebarMenuSubItem";var Tl=me.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...i},r)=>(0,Xr.jsx)(e?Gr.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:b("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}));Tl.displayName="SidebarMenuSubButton";var Wi=({projects:e,epics:t,sprints:a,currentView:o,onUpdateProject:i,onDeleteProject:r,onAddProject:d,onUpdateEpic:s,onDeleteEpic:m,onAddEpic:n,onAddSprint:c,onUpdateSprint:u,onDeleteSprint:h,onViewChange:g,mobileMenuOpen:w,onToggleMobileMenu:y})=>{let[f,E]=(0,Et.useState)(null),[B,V]=(0,Et.useState)(null),[se,N]=(0,Et.useState)(null),[U,fe]=(0,Et.useState)(null),[T,P]=(0,Et.useState)({name:"",description:""}),[D,Q]=(0,Et.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[I,Ke]=(0,Et.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[Fe,ze]=(0,Et.useState)(!1),[k,pe]=(0,Et.useState)(!1),[Pe,rt]=(0,Et.useState)({name:"",description:""}),[He,Te]=(0,Et.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),dt=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],ct=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],mt=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],pt=C=>{V(C.id),P({name:C.name,description:C.description||""})},Ft=()=>{B&&T.name.trim()&&(i(B,{name:T.name.trim(),description:T.description.trim()}),V(null))},v=()=>{V(null),P({name:"",description:""})},ee=()=>{Pe.name.trim()&&(d({name:Pe.name.trim(),description:Pe.description.trim(),isSelected:!1}),rt({name:"",description:""}),ze(!1))},q=C=>{i(C,{isSelected:!0})},We=C=>{N(C.id),Q({name:C.name,description:C.description||"",color:C.color,confidence:C.confidence,phase:C.phase,startDate:C.startDate.toISOString().split("T")[0],endDate:C.endDate.toISOString().split("T")[0],progress:C.progress})},Tt=()=>{se&&D.name.trim()&&(s(se,{name:D.name.trim(),description:D.description.trim(),color:D.color,confidence:D.confidence,phase:D.phase,startDate:new Date(D.startDate),endDate:new Date(D.endDate),progress:D.progress}),N(null))},Ot=()=>{N(null),Q({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},zt=C=>{fe(C.id),Ke({name:C.name,description:C.description||"",startDate:C.startDate.toISOString().split("T")[0],endDate:C.endDate.toISOString().split("T")[0],isActive:C.isActive})},Bo=()=>{U&&I.name.trim()&&(u(U,{name:I.name.trim(),description:I.description.trim(),startDate:new Date(I.startDate),endDate:new Date(I.endDate),isActive:I.isActive}),fe(null))},Lo=()=>{fe(null),Ke({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Za=()=>{He.name.trim()&&(c({name:He.name.trim(),description:He.description.trim(),startDate:new Date(He.startDate),endDate:new Date(He.endDate),isActive:He.isActive,isSelected:!1}),Te({name:"",description:"",startDate:"",endDate:"",isActive:!1}),pe(!1))},jo=C=>{u(C,{isSelected:!0})},Aa=C=>C.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Qa=C=>{let M=ct.find(ye=>ye.value===C);return M?{label:M.label,color:M.color}:{label:"Medium",color:"text-warning"}},Ma=C=>{let M=mt.find(ye=>ye.value===C);return M?{label:M.label,color:M.color}:{label:"Phase 1",color:"text-primary"}};return(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsxs)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col Xr-50 flex-shrink-0 transition-transform duration-300 group ${w?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[(0,Xr.jsxs)("div",{className:"border-b border-sidebar-border",children:[(0,Xr.jsxs)("button",{onClick:()=>{g("kanban"),E(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3 Xr-50`,title:"Kanban View",children:[(0,Xr.jsx)(ht.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,Xr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,Xr.jsxs)("button",{onClick:()=>{g("planning"),E(null)},className:`w-12 h-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,Xr.jsx)(ht.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Xr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]})]}),(0,Xr.jsxs)("button",{onClick:()=>E(f==="projects"?null:"projects"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${f==="projects"?"bg-sidebar-accent":"bg-sidebar-primary hover:bg-sidebar-accent"} hover:w-28 hover:justify-start hover:pl-3`,title:"Projects",children:[(0,Xr.jsx)(ht.FolderOpen,{className:"h-4 w-4 flex-shrink-0"}),(0,Xr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Projects"})]}),(0,Xr.jsxs)("button",{onClick:()=>{g("epics"),E(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="epics"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,Xr.jsx)(ht.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,Xr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,Xr.jsxs)("button",{onClick:()=>E(f==="sprints"?null:"sprints"),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${f==="sprints"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Sprints",children:[(0,Xr.jsx)(ht.Layers,{className:"h-4 w-4 flex-shrink-0"}),(0,Xr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Sprints"})]}),(0,Xr.jsxs)("button",{onClick:()=>{g("files"),E(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="files"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,Xr.jsx)(ht.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,Xr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,Xr.jsxs)("button",{onClick:()=>{g("tasks"),E(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,Xr.jsx)(ht.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,Xr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]}),w&&(0,Xr.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm Xr-20",onClick:y}),f&&(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm Xr-40",onClick:()=>E(null)}),(0,Xr.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg Xr-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,Xr.jsxs)("div",{className:"Xr-3 md:Xr-4 border-b flex items-center justify-between",children:[(0,Xr.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[f==="projects"&&"Projects",f==="epics"&&"Manage Epics",f==="sprints"&&"Manage Sprints",f==="files"&&"Files"]}),(0,Xr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>E(null),children:(0,Xr.jsx)(ht.Xr,{className:"h-4 w-4"})})]}),(0,Xr.jsxs)("div",{className:"Xr-3 md:Xr-4 space-y-4 h-full overflow-y-auto",children:[f==="projects"&&(0,Xr.jsx)(O,{className:"Xr-3",children:(0,Xr.jsxs)("div",{className:"space-y-3",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,Xr.jsxs)(x,{size:"sm",onClick:()=>ze(!0),className:"gap-1",children:[(0,Xr.jsx)(ht.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),Fe&&(0,Xr.jsxs)("div",{className:"border rounded-lg Xr-2 space-y-2",children:[(0,Xr.jsx)(L,{value:Pe.name,onChange:C=>rt(M=>({...M,name:C.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Xr.jsx)(we,{value:Pe.description,onChange:C=>rt(M=>({...M,description:C.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Xr.jsxs)("div",{className:"flex gap-1",children:[(0,Xr.jsx)(x,{size:"sm",onClick:ee,className:"text-xs h-6",children:"Save"}),(0,Xr.jsx)(x,{size:"sm",variant:"outline",onClick:()=>ze(!1),className:"text-xs h-6",children:"Cancel"})]})]}),(0,Xr.jsx)("div",{className:"space-y-2",children:e.map(C=>(0,Xr.jsx)("div",{className:"border rounded Xr-2",children:B===C.id?(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(L,{value:T.name,onChange:M=>P(ye=>({...ye,name:M.target.value})),placeholder:"Project name",className:"text-sm"}),(0,Xr.jsx)(we,{value:T.description,onChange:M=>P(ye=>({...ye,description:M.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,Xr.jsxs)("div",{className:"flex gap-1",children:[(0,Xr.jsx)(x,{size:"sm",onClick:Ft,className:"text-xs h-6",children:"Save"}),(0,Xr.jsx)(x,{size:"sm",variant:"outline",onClick:v,className:"text-xs h-6",children:"Cancel"})]})]}):(0,Xr.jsxs)("div",{className:`cursor-pointer Xr-1 rounded transition-colors ${C.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>q(C.id),children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Xr.jsx)(ht.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,Xr.jsx)("span",{className:"font-medium text-xs",children:C.name})]}),C.description&&(0,Xr.jsx)("Xr",{className:"text-xs text-muted-foreground mb-1",children:C.description}),(0,Xr.jsxs)("div",{className:"flex gap-1",onClick:M=>M.stopPropagation(),children:[(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>pt(C),className:"h-5 px-1",children:(0,Xr.jsx)(ht.Edit2,{className:"h-3 w-3"})}),(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>r(C.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Xr.jsx)(ht.Trash2,{className:"h-3 w-3"})})]})]})},C.id))})]})}),f==="epics"&&(0,Xr.jsx)(O,{className:"Xr-3",children:(0,Xr.jsxs)("div",{className:"space-y-3",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,Xr.jsxs)(x,{size:"sm",onClick:n,className:"gap-1",children:[(0,Xr.jsx)(ht.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,Xr.jsx)("div",{className:"space-y-4",children:t.map(C=>(0,Xr.jsx)("div",{className:"border rounded-lg Xr-3",children:se===C.id?(0,Xr.jsxs)("div",{className:"space-y-3",children:[(0,Xr.jsx)(L,{value:D.name,onChange:M=>Q(ye=>({...ye,name:M.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,Xr.jsx)(we,{value:D.description,onChange:M=>Q(ye=>({...ye,description:M.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)("label",{className:"text-xs font-medium",children:"Color"}),(0,Xr.jsx)("div",{className:"flex gap-1 flex-wrap",children:dt.map(M=>(0,Xr.jsx)("button",{onClick:()=>Q(ye=>({...ye,color:M})),className:`w-6 h-6 rounded-full ${M} ${D.color===M?"ring-2 ring-ring":""}`},M))})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Xr.jsxs)("div",{className:"space-y-1",children:[(0,Xr.jsx)("label",{className:"text-xs font-medium",children:"Confidence"}),(0,Xr.jsxs)(Se,{value:D.confidence,onValueChange:M=>Q(ye=>({...ye,confidence:M})),children:[(0,Xr.jsx)(Ne,{className:"h-8 text-xs",children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsx)(Ce,{children:ct.map(M=>(0,Xr.jsx)(K,{value:M.value,children:(0,Xr.jsx)("span",{className:M.color,children:M.label})},M.value))})]})]}),(0,Xr.jsxs)("div",{className:"space-y-1",children:[(0,Xr.jsx)("label",{className:"text-xs font-medium",children:"Phase"}),(0,Xr.jsxs)(Se,{value:D.phase.toString(),onValueChange:M=>Q(ye=>({...ye,phase:parseInt(M)})),children:[(0,Xr.jsx)(Ne,{className:"h-8 text-xs",children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsx)(Ce,{children:mt.map(M=>(0,Xr.jsx)(K,{value:M.value.toString(),children:(0,Xr.jsx)("span",{className:M.color,children:M.label})},M.value))})]})]})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Xr.jsxs)("div",{className:"space-y-1",children:[(0,Xr.jsx)("label",{className:"text-xs font-medium",children:"Start Date"}),(0,Xr.jsx)(L,{type:"date",value:D.startDate,onChange:M=>Q(ye=>({...ye,startDate:M.target.value})),className:"text-xs h-8"})]}),(0,Xr.jsxs)("div",{className:"space-y-1",children:[(0,Xr.jsx)("label",{className:"text-xs font-medium",children:"End Date"}),(0,Xr.jsx)(L,{type:"date",value:D.endDate,onChange:M=>Q(ye=>({...ye,endDate:M.target.value})),className:"text-xs h-8"})]})]}),(0,Xr.jsxs)("div",{className:"space-y-1",children:[(0,Xr.jsx)("label",{className:"text-xs font-medium",children:"Progress (%)"}),(0,Xr.jsx)(L,{type:"number",min:"0",max:"100",value:D.progress,onChange:M=>Q(ye=>({...ye,progress:parseInt(M.target.value)||0})),className:"text-xs h-8"})]}),(0,Xr.jsxs)("div",{className:"flex gap-2",children:[(0,Xr.jsx)(x,{size:"sm",onClick:Tt,className:"text-xs",children:"Save"}),(0,Xr.jsx)(x,{size:"sm",variant:"outline",onClick:Ot,className:"text-xs",children:"Cancel"})]})]}):(0,Xr.jsxs)("div",{className:`cursor-pointer Xr-2 rounded transition-colors ${C.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>s(C.id,{isSelected:!C.isSelected}),children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Xr.jsx)("div",{className:`w-3 h-3 rounded-full ${C.color}`}),(0,Xr.jsx)("span",{className:"font-medium text-sm",children:C.name})]}),C.description&&(0,Xr.jsx)("Xr",{className:"text-xs text-muted-foreground mb-2",children:C.description}),(0,Xr.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Xr.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,Xr.jsx)("span",{className:Qa(C.confidence).color,children:Qa(C.confidence).label})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Xr.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,Xr.jsx)("span",{className:Ma(C.phase).color,children:Ma(C.phase).label})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Xr.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,Xr.jsxs)("span",{className:"text-foreground",children:[Aa(C.startDate)," - ",Aa(C.endDate)]})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Xr.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,Xr.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${C.progress}%`}})}),(0,Xr.jsxs)("span",{className:"text-foreground",children:[C.progress,"%"]})]})]})]}),(0,Xr.jsxs)("div",{className:"flex gap-1",onClick:M=>M.stopPropagation(),children:[(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>We(C),className:"h-6 px-2",children:(0,Xr.jsx)(ht.Edit2,{className:"h-3 w-3"})}),(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>m(C.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Xr.jsx)(ht.Trash2,{className:"h-3 w-3"})})]})]})},C.id))})]})}),f==="sprints"&&(0,Xr.jsx)(O,{className:"Xr-3",children:(0,Xr.jsxs)("div",{className:"space-y-3",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)("h3",{className:"font-medium text-foreground",children:"Sprints (Select One)"}),(0,Xr.jsxs)(x,{size:"sm",onClick:()=>pe(!0),className:"gap-1",children:[(0,Xr.jsx)(ht.Plus,{className:"h-3 w-3"}),"Add Sprint"]})]}),k&&(0,Xr.jsxs)("div",{className:"border rounded-lg Xr-2 space-y-2",children:[(0,Xr.jsx)(L,{value:He.name,onChange:C=>Te(M=>({...M,name:C.target.value})),placeholder:"Sprint name",className:"text-sm"}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Xr.jsx)(L,{type:"date",value:He.startDate,onChange:C=>Te(M=>({...M,startDate:C.target.value})),className:"text-xs"}),(0,Xr.jsx)(L,{type:"date",value:He.endDate,onChange:C=>Te(M=>({...M,endDate:C.target.value})),className:"text-xs"})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)("input",{type:"checkbox",checked:He.isActive,onChange:C=>Te(M=>({...M,isActive:C.target.checked})),className:"w-3 h-3"}),(0,Xr.jsx)("span",{className:"text-xs",children:"Active"})]}),(0,Xr.jsxs)("div",{className:"flex gap-1",children:[(0,Xr.jsx)(x,{size:"sm",onClick:Za,className:"text-xs h-6",children:"Save"}),(0,Xr.jsx)(x,{size:"sm",variant:"outline",onClick:()=>pe(!1),className:"text-xs h-6",children:"Cancel"})]})]}),(0,Xr.jsx)("div",{className:"space-y-2",children:a.map(C=>(0,Xr.jsx)("div",{className:"border rounded Xr-2",children:U===C.id?(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(L,{value:I.name,onChange:M=>Ke(ye=>({...ye,name:M.target.value})),placeholder:"Sprint name",className:"text-sm",disabled:C.id==="backlog"||C.id==="all-tasks"}),C.id!=="backlog"&&C.id!=="all-tasks"&&(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,Xr.jsx)(L,{type:"date",value:I.startDate,onChange:M=>Ke(ye=>({...ye,startDate:M.target.value})),className:"text-xs"}),(0,Xr.jsx)(L,{type:"date",value:I.endDate,onChange:M=>Ke(ye=>({...ye,endDate:M.target.value})),className:"text-xs"})]}),(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)("input",{type:"checkbox",checked:I.isActive,onChange:M=>Ke(ye=>({...ye,isActive:M.target.checked})),className:"w-3 h-3"}),(0,Xr.jsx)("span",{className:"text-xs",children:"Active"})]})]}),(0,Xr.jsxs)("div",{className:"flex gap-1",children:[(0,Xr.jsx)(x,{size:"sm",onClick:Bo,className:"text-xs h-6",children:"Save"}),(0,Xr.jsx)(x,{size:"sm",variant:"outline",onClick:Lo,className:"text-xs h-6",children:"Cancel"})]})]}):(0,Xr.jsxs)("div",{className:`cursor-pointer Xr-1 rounded transition-colors ${C.isSelected?"bg-brand-green/10 border-brand-green ring-2 ring-brand-green/20":"hover:bg-muted"}`,onClick:()=>jo(C.id),children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Xr.jsx)(ht.Calendar,{className:"h-3 w-3 text-muted-foreground"}),(0,Xr.jsx)("span",{className:"font-medium text-xs",children:C.name}),C.isActive&&(0,Xr.jsx)("span",{className:"text-xs bg-brand-green/20 text-brand-green px-1 py-0.5 rounded",children:"Active"}),(C.id==="backlog"||C.id==="all-tasks")&&(0,Xr.jsx)("span",{className:"text-xs bg-muted text-muted-foreground px-1 py-0.5 rounded",children:"System"})]}),C.id!=="backlog"&&C.id!=="all-tasks"&&(0,Xr.jsxs)("Xr",{className:"text-xs text-muted-foreground mb-1",children:[C.startDate.toLocaleDateString()," - ",C.endDate.toLocaleDateString()]}),(0,Xr.jsxs)("div",{className:"flex gap-1",onClick:M=>M.stopPropagation(),children:[(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>zt(C),className:"h-5 px-1",children:(0,Xr.jsx)(ht.Edit2,{className:"h-3 w-3"})}),C.id!=="backlog"&&C.id!=="all-tasks"&&(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>h(C.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,Xr.jsx)(ht.Trash2,{className:"h-3 w-3"})})]})]})},C.id))})]})})]})]})]})]})},qi=e=>(0,Xr.jsx)(ar,{children:(0,Xr.jsxs)("div",{className:"flex w-full",children:[(0,Xr.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,Xr.jsx)(Wi,{...e})}),(0,Xr.jsx)("div",{className:"md:hidden",children:(0,Xr.jsx)(Wi,{...e})}),(0,Xr.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6",children:(0,Xr.jsx)("div",{className:"w-full",children:e.children})})]})});var Xi=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1})=>{let d=n=>{n.preventDefault()},s=n=>{n.preventDefault(),i(t)};return(0,Xr.jsxs)(O,{className:`Xr-4 bg-card border-Xr-4 ${(()=>{switch(t){case"todo":return"border-Xr-gray-400";case"in-progress":return"border-Xr-blue-500";case"review":return"border-Xr-orange-500";case"done":return"border-Xr-green-500";default:return"border-Xr-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 ${r?"lg:max-w-xs":""}`,onDragOver:d,onDrop:s,children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Xr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Xr.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Xr.jsx)("div",{className:"space-y-4 min-h-[200px]",children:o})]})};var yo=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=c=>{a(e)},d=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},m=()=>{switch(e.type){case"story":return(0,Xr.jsx)(ht.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Xr.jsx)(ht.Bug,{className:"h-3 w-3"});case"spike":return(0,Xr.jsx)(ht.Zap,{className:"h-3 w-3"});case"task":default:return(0,Xr.jsx)(ht.AlertCircle,{className:"h-3 w-3"})}},n=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return i?(0,Xr.jsx)(O,{className:"Xr-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,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${n()}`,children:m()}),(0,Xr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Xr.jsxs)(O,{className:"Xr-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:d,children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Xr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[m(),(0,Xr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Xr.jsxs)("div",{className:"flex gap-1",children:[(0,Xr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,Xr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.points})]})]}),(0,Xr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Xr.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,Xr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Xr.jsx)(ht.User,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{children:e.assignee})]})})]})};var $a=ve(require("react")),ot=ve(require("@radix-ui/react-dialog"));var gt=ot.Root;var Rl=ot.Portal;var Yi=$a.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(ot.Overlay,{ref:a,className:b("fixed inset-0 Xr-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}));Yi.displayName=ot.Overlay.displayName;var it=$a.forwardRef(({className:e,children:t,...a},o)=>(0,Xr.jsxs)(Rl,{children:[(0,Xr.jsx)(Yi,{}),(0,Xr.jsxs)(ot.Content,{ref:o,className:b("fixed left-[50%] top-[50%] Xr-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background Xr-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,Xr.jsxs)(ot.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,Xr.jsx)(ht.Xr,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));it.displayName=ot.Content.displayName;var st=({className:e,...t})=>(0,Xr.jsx)("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});st.displayName="DialogHeader";var _a=({className:e,...t})=>(0,Xr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_a.displayName="DialogFooter";var nt=$a.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(ot.Title,{ref:a,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));nt.displayName=ot.Title.displayName;var Ga=$a.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(ot.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Ga.displayName=ot.Description.displayName;var va=ve(require("react")),Pa=ve(require("@radix-ui/react-toggle-group"));var Zi=ve(require("react")),or=ve(require("@radix-ui/react-toggle"));var rr=(0,Wr.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=on]:bg-accent data-[state=on]: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"}}),El=Zi.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,Xr.jsx)(or.Root,{ref:i,className:b(rr({variant:t,size:a,className:e})),...o}));El.displayName=or.Root.displayName;var ts=va.createContext({size:"default",variant:"default"}),ba=va.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,Xr.jsx)(Pa.Root,{ref:r,className:b("flex items-center justify-center gap-1",e),...i,children:(0,Xr.jsx)(ts.Provider,{value:{variant:t,size:a},children:o})}));ba.displayName=Pa.Root.displayName;var ha=va.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let d=va.useContext(ts);return(0,Xr.jsx)(Pa.Item,{ref:r,className:b(rr({variant:d.variant||a,size:d.size||o}),e),...i,children:t})});ha.displayName=Pa.Item.displayName;var Il=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ht.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:ht.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ht.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ht.Zap}],Al=[{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"}],No=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:d})=>{let[s,m]=(0,Et.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Et.useEffect)(()=>{e&&d&&m(u=>({...u,epicId:d}))},[e,d]),(0,Et.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:d||"",sprintId:"none",assignee:""})},[e]);let n=u=>{u.preventDefault(),s.name.trim()&&(a({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,points:s.points,epicId:s.epicId,sprintId:s.sprintId==="none"?void 0:s.sprintId,assignee:s.assignee.trim()||"Unassigned"}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:d||"",sprintId:"none",assignee:""}),t())},c=(u,h)=>{m(g=>({...g,[u]:h}))};return(0,$.jsx)(gt,{open:e,onOpenChange:t,children:(0,$.jsxs)(it,{className:"sm:max-w-md",children:[(0,$.jsx)(st,{children:(0,$.jsx)(nt,{children:"Add New Task"})}),(0,$.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"name",children:"Task Title"}),(0,$.jsx)(L,{id:"name",value:s.name,onChange:u=>c("name",u.target.value),placeholder:"Enter task title",required:!0})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"description",children:"Description"}),(0,$.jsx)(we,{id:"description",value:s.description,onChange:u=>c("description",u.target.value),placeholder:"Enter task description",rows:3})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"Type"}),(0,$.jsx)(ba,{type:"single",value:s.type,onValueChange:u=>u&&c("type",u),children:Il.map(u=>{let h=u.icon;return(0,$.jsxs)(ha,{value:u.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,$.jsx)(h,{className:"h-4 w-4"}),u.label]},u.value)})})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"Priority"}),(0,$.jsx)(ba,{type:"single",value:s.priority,onValueChange:u=>u&&c("priority",u),children:Al.map(u=>(0,$.jsx)(ha,{value:u.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:u.label},u.value))})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"points",children:"Story Points"}),(0,$.jsx)(L,{id:"points",type:"number",min:"1",max:"100",value:s.points,onChange:u=>c("points",parseInt(u.target.value)||1),placeholder:"Enter story points",required:!0})]}),!d&&(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"epic",children:"Epic"}),(0,$.jsxs)(Se,{value:s.epicId,onValueChange:u=>c("epicId",u),children:[(0,$.jsx)(Ne,{children:(0,$.jsx)(Ie,{placeholder:"Select an epic"})}),(0,$.jsx)(Ce,{children:o.map(u=>(0,$.jsx)(K,{value:u.id,children:(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$.jsx)("div",{className:`w-3 h-3 rounded-full ${u.color}`}),u.name]})},u.id))})]})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,$.jsxs)(Se,{value:s.sprintId,onValueChange:u=>c("sprintId",u),children:[(0,$.jsx)(Ne,{children:(0,$.jsx)(Ie,{placeholder:"Select a sprint"})}),(0,$.jsxs)(Ce,{children:[(0,$.jsx)(K,{value:"none",children:"No Sprint"}),i.map(u=>(0,$.jsx)(K,{value:u.id,children:(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[u.name,u.isActive&&(0,$.jsx)("span",{className:"text-xs bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},u.id))]})]})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"sprint",children:"Assignee"}),(0,$.jsxs)(Se,{value:s.assignee,onValueChange:u=>c("assignee",u),children:[(0,$.jsx)(Ne,{children:(0,$.jsx)(Ie,{placeholder:"Select an Assignee"})}),(0,$.jsxs)(Ce,{children:[(0,$.jsx)(K,{value:"none",children:"No Assignee"}),r.map(u=>(0,$.jsx)(K,{value:u.id,children:(0,$.jsx)("div",{className:"flex items-center gap-2",children:u.name})},u.id))]})]})]}),(0,$.jsxs)(_a,{children:[(0,$.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,$.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var sr=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:d=!1})=>{let[s,m]=(0,Et.useState)(!1),[n,c]=(0,Et.useState)(""),u=()=>{d||(m(!0),c(t))},h=async()=>{n!==t&&await i(e,n),m(!1)},g=w=>{w.key==="Enter"&&!o||w.key==="Enter"&&w.ctrlKey&&o?h():w.key==="Escape"&&(m(!1),c(""))};return(0,Xr.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Xr.jsx)(R,{children:a}),s?o?(0,Xr.jsx)(we,{value:n,onChange:w=>c(w.target.value),onBlur:h,onKeyDown:g,autoFocus:!0,rows:4,className:"resize-none"}):(0,Xr.jsx)(L,{value:n,onChange:w=>c(w.target.value),onBlur:h,onKeyPress:g,autoFocus:!0,className:"text-lg font-medium"}):(0,Xr.jsxs)("div",{onClick:u,className:`${d?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 Xr-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,Xr.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!d&&(0,Xr.jsx)(ht.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var rs=({comments:e,onAddComment:t})=>{let[a,o]=(0,Et.useState)(""),i=d=>d.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.MessageSquare,{className:"h-5 w-5"}),(0,Xr.jsx)(R,{className:"text-lg font-medium",children:"Comments"}),(0,Xr.jsx)(Z,{variant:"secondary",children:e.length})]}),(0,Xr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(d=>(0,Xr.jsxs)("div",{className:"flex gap-3 Xr-3 bg-muted/50 rounded-lg",children:[(0,Xr.jsx)(Kt,{className:"h-8 w-8 mt-1",children:(0,Xr.jsx)($t,{className:"text-xs bg-muted text-muted-foreground",children:i(d.author)})}),(0,Xr.jsxs)("div",{className:"flex-1",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Xr.jsx)("span",{className:"font-medium text-sm",children:d.author}),(0,Xr.jsxs)("span",{className:"text-xs text-muted-foreground",children:[d.createdAt.toLocaleDateString()," at ",d.createdAt.toLocaleTimeString()]})]}),(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground",children:d.text})]})]},d.id))}),(0,Xr.jsxs)("div",{className:"flex gap-2",children:[(0,Xr.jsx)(we,{value:a,onChange:d=>o(d.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Xr.jsx)(x,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Xr.jsx)(ht.Send,{className:"h-4 w-4"})})]})]})};var So=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[d,s]=(0,Et.useState)(!1),m=o.find(c=>c.value===t);return(0,Xr.jsxs)("div",{className:"space-y-1",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,Xr.jsxs)(Se,{value:t,onValueChange:a,open:d,onOpenChange:c=>{r||s(c)},disabled:r,children:[(0,Xr.jsx)(Ne,{className:"h-auto Xr-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Xr.jsxs)(Z,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&s(!d),children:[i&&m?.color&&(0,Xr.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} ht-1`}),m?.label||"Select..."]})}),(0,Xr.jsx)(Ce,{children:o.map(c=>(0,Xr.jsx)(K,{value:c.value,children:i&&c.color?(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.label]}):c.label},c.value))})]})]})};var ss=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:d=!1})=>{let[s,m]=(0,Et.useState)(!1),[n,c]=(0,Et.useState)(""),u=o.find(f=>f.value===t),h=o.filter(f=>f.label.toLowerCase().includes(n.toLowerCase())),g=f=>{a(f),m(!1),c("")},w=()=>{r&&n.trim()&&!o.find(f=>f.value===n.trim())&&(a(n.trim()),m(!1),c(""))};return(0,Xr.jsxs)("div",{className:"space-y-1",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,Xr.jsxs)(Se,{value:t,onValueChange:g,open:s,onOpenChange:f=>{d||m(f)},disabled:d,children:[(0,Xr.jsx)(Ne,{className:"h-auto Xr-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Xr.jsx)(Z,{variant:"secondary",className:`${d?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!d&&m(!s),children:u?.label||t||"Select..."})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)("div",{className:"Xr-2",children:(0,Xr.jsx)(L,{placeholder:i,value:n,onChange:f=>c(f.target.value),onKeyDown:f=>{f.key==="Enter"&&r&&w()},className:"mb-2"})}),h.map(f=>(0,Xr.jsx)(K,{value:f.value,children:f.label},f.value)),r&&n.trim()&&!h.find(f=>f.value===n.trim())&&(0,Xr.jsxs)(K,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var Ml=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ht.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:ht.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ht.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ht.Zap}],Fl=[{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 ns=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:d,isUpdating:s=!1,isDeleting:m=!1,deleteState:n="idle",teamMembers:c})=>{let u=g=>g.split(" ").map(w=>w[0]).join("").toUpperCase(),h=()=>n==="loading"?(0,Xr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Xr.jsx)(ht.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,Xr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Xr.jsx)(ht.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,Xr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Xr.jsx)(ht.Xr,{className:"h-3 w-3"}),"Delete failed"]}):(0,Xr.jsxs)(x,{onClick:d,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||m,children:[(0,Xr.jsx)(ht.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Xr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Xr.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Xr.jsx)(So,{label:"",value:e.status,onValueChange:g=>i("status",g),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Xr.jsx)(ba,{type:"single",value:e.type,onValueChange:g=>g&&i("type",g),className:"grid grid-cols-2 gap-1",disabled:s,children:Ml.map(g=>{let w=g.icon;return(0,Xr.jsxs)(ha,{value:g.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Xr.jsx)(w,{className:"h-3 w-3"}),g.label]},g.value)})})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Xr.jsx)(ba,{type:"single",value:e.priority,onValueChange:g=>g&&i("priority",g),className:"grid grid-cols-3 gap-1",disabled:s,children:Fl.map(g=>(0,Xr.jsx)(ha,{value:g.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:g.label},g.value))})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Xr.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:g=>i("points",g.target.value),className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Xr.jsx)(So,{label:"",value:e.epicId,onValueChange:g=>i("epicId",g),options:(t||[]).map(g=>({value:g.id,label:g?.name,color:g.color})),showColor:!0,disabled:s})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Xr.jsx)(So,{label:"",value:e.sprintId||"none",onValueChange:g=>i("sprintId",g==="none"?"":g),options:[{value:"none",label:"No Sprint"},...(a||[]).map(g=>({value:g.id,label:`${g?.name}${g.isActive?" (Active)":""}`}))],disabled:s})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Xr.jsx)(ss,{label:"",value:e.assignee,onValueChange:g=>i("assignee",g),options:c.map(g=>({value:g.id,label:g?.name})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Xr.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(x,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:s||m,children:"Close"}),h()]}),(0,Xr.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Xr.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Xr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Xr.jsx)(ht.User,{className:"h-3 w-3"}),(0,Xr.jsx)("span",{children:"System"})]})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Xr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Xr.jsx)(ht.Calendar,{className:"h-3 w-3"}),(0,Xr.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Xr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Xr.jsx)(ht.Clock,{className:"h-3 w-3"}),(0,Xr.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var ls=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:d,onAddComment:s,colleagues:m})=>{let[n,c]=(0,Et.useState)(a),[u,h]=(0,Et.useState)(new Date),[g,w]=(0,Et.useState)("idle"),[y,f]=(0,Et.useState)("idle"),[E,B]=(0,Et.useState)([]);(0,Et.useEffect)(()=>{c(a)},[a]);let V=async(D,Q)=>{if(Q!==n[D]){w("loading");try{let I=await r(n.id,{[D]:Q});c(I),h(new Date),w("success"),setTimeout(()=>w("idle"),1500)}catch{w("error"),setTimeout(()=>w("idle"),3e3)}}},se=async(D,Q)=>{if(Q!==n[D]){w("loading");try{let I=await r(n.id,{[D]:Q});c(I),h(new Date),w("success"),setTimeout(()=>w("idle"),1500)}catch{w("error"),setTimeout(()=>w("idle"),3e3)}}},N=async D=>{if(s){w("loading");try{let Q=await s?.({content:D,taskId:n.id});c(Q),h(new Date),w("success"),setTimeout(()=>w("idle"),1500)}catch{w("error"),setTimeout(()=>w("idle"),3e3)}}},U=async()=>{f("loading");try{await d(n.id),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},fe=g!=="loading"&&y!=="loading",T=()=>{fe&&t()},P=()=>g==="loading"?(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Xr.jsx)(ht.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Xr.jsx)("span",{children:"Updating..."})]}):g==="success"?(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Xr.jsx)(ht.Check,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{children:"Updated successfully"})]}):g==="error"?(0,Xr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Xr.jsx)(ht.Xr,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{children:"Update failed"})]}):null;return(0,Xr.jsx)(gt,{open:e,onOpenChange:T,children:(0,Xr.jsxs)(it,{className:"max-w-3xl max-h-[80vh] overflow-y-auto Xr-4",children:[(0,Xr.jsxs)(st,{children:[(0,Xr.jsx)(nt,{className:"sr-only",children:n.name}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)("div",{className:"flex-1",children:P()}),!fe&&(0,Xr.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Xr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Xr.jsx)(sr,{fieldName:"name",value:n.name,label:"",onSave:V,className:"border-b border-border pb-3",disabled:g==="loading"}),(0,Xr.jsx)(sr,{fieldName:"description",value:n.description,label:"Description",multiline:!0,onSave:V,disabled:g==="loading"}),(0,Xr.jsx)(rs,{comments:(n?.comments||[]).map(D=>({author:D.author.value.name,createdAt:new Date(D.timestamp),text:D.content,id:D.id})),onAddComment:N})]}),(0,Xr.jsx)(ns,{task:n,epics:o,sprints:i,lastUpdated:u,onUpdateTask:se,onClose:T,onDelete:U,isUpdating:g==="loading",isDeleting:y==="loading",deleteState:y,teamMembers:m})]})]})})};var Do=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,Et.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"}],s=[{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:new Date(o.startDate),endDate:new Date(o.endDate),progress:o.progress,isSelected:!0}),i({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}),t())},n=(c,u)=>{i(h=>({...h,[c]:u}))};return(0,Xr.jsx)(gt,{open:e,onOpenChange:t,children:(0,Xr.jsxs)(it,{className:"sm:max-w-md",children:[(0,Xr.jsx)(st,{children:(0,Xr.jsx)(nt,{children:"Add New Epic"})}),(0,Xr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"name",children:"Epic Name"}),(0,Xr.jsx)(L,{id:"name",value:o.name,onChange:c=>n("name",c.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,Xr.jsx)(we,{id:"description",value:o.description,onChange:c=>n("description",c.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"Color"}),(0,Xr.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(c=>(0,Xr.jsx)("button",{type:"button",onClick:()=>n("color",c),className:`w-8 h-8 rounded-full ${c} ${o.color===c?"ring-2 ring-gray-400":""}`},c))})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"Confidence"}),(0,Xr.jsxs)(Se,{value:o.confidence,onValueChange:c=>n("confidence",c),children:[(0,Xr.jsx)(Ne,{children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsx)(Ce,{children:d.map(c=>(0,Xr.jsx)(K,{value:c.value,children:c.label},c.value))})]})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"Phase"}),(0,Xr.jsxs)(Se,{value:o.phase.toString(),onValueChange:c=>n("phase",parseInt(c)),children:[(0,Xr.jsx)(Ne,{children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsx)(Ce,{children:s.map(c=>(0,Xr.jsx)(K,{value:c.value.toString(),children:c.label},c.value))})]})]})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"Start Date"}),(0,Xr.jsx)(L,{type:"date",value:o.startDate,onChange:c=>n("startDate",c.target.value)})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"End Date"}),(0,Xr.jsx)(L,{type:"date",value:o.endDate,onChange:c=>n("endDate",c.target.value)})]})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"Progress (%)"}),(0,Xr.jsx)(L,{type:"number",min:"0",max:"100",value:o.progress,onChange:c=>n("progress",parseInt(c.target.value)||0)})]}),(0,Xr.jsxs)(_a,{children:[(0,Xr.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Xr.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var cs=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:d,onUpdateTask:s,onDeleteTask:m,onTaskClick:n,onAddEpic:c,onAddComment:u})=>{let[h,g]=(0,Et.useState)(e),[w,y]=(0,Et.useState)(t),[f,E]=(0,Et.useState)(a),[B,V]=(0,Et.useState)(!1),[se,N]=(0,Et.useState)(!1),[U,fe]=(0,Et.useState)(null),[T,P]=(0,Et.useState)(null),[D,Q]=(0,Et.useState)(o),[I,Ke]=(0,Et.useState)(i),Fe=w.filter(v=>!0).map(v=>v.id),ze=f.find(v=>v.isSelected);Fe.push("no-epic"),(0,Et.useEffect)(()=>{g(e)},[e]),(0,Et.useEffect)(()=>{y(t)},[t]),(0,Et.useEffect)(()=>{E(a)},[a]);let k=h.filter(v=>{let ee=Fe.includes(v.epicId)||!v.epicId;return!ze||ze.id==="all-tasks"?ee:ze.id==="backlog"?ee&&!v.sprintId:ee&&v.sprintId===ze.id}),pe=v=>k.filter(ee=>ee.status===v),Pe=v=>{let ee={};return w.forEach(q=>{ee[q.id]=v.filter(We=>We.epicId===q.id)}),ee["no-epic"]=v.filter(q=>!q.epicId),ee},rt=v=>{P(v)},He=v=>{T&&(g(ee=>ee.map(q=>q.id===T.id?{...q,status:v}:q)),s?.(T.id,{status:v}),P(null))},Te=v=>{let ee={...v,id:Date.now().toString(),createdAt:new Date};g(q=>[...q,ee]),d?.(v)},dt=async(v,ee)=>(g(q=>q.map(We=>We.id===v?{...We,...ee}:We)),s?await s(v,ee):h.find(q=>q.id===v)),ct=async v=>{g(ee=>ee.filter(q=>q.id!==v)),U?.id===v&&fe(null),m&&await m(v)},mt=v=>{let ee={...v,id:Date.now().toString(),isSelected:!0};y(q=>[...q,ee]),c?.(v)},pt=v=>{fe(v),n?.(v)};return(0,Xr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Xr.jsx)(Qe,{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:()=>V(!0)},secondaryAction:{label:"Add epic",onClick:()=>N(!0)}}),(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsxs)("div",{className:"w-full",children:[(0,Xr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}].map(v=>{let ee=pe(v.status),q=Pe(ee);return(0,Xr.jsx)(Xi,{title:v.title,status:v.status,taskCount:ee.length,onDrop:He,isCompact:v.status==="done",children:Fe.map(We=>{let Tt=w.find(zt=>zt.id===We),Ot=q[We]||[];return Ot.length===0?null:(0,Xr.jsxs)("div",{className:"mb-6",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Xr.jsx)("div",{className:`w-3 h-3 rounded-full ${Tt?.color}`}),(0,Xr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Tt?.name||"No Epic"}),(0,Xr.jsx)(Z,{variant:"secondary",className:"text-xs",children:Ot.length})]})," ",(0,Xr.jsx)("div",{className:"space-y-3",children:Ot.map(zt=>(0,Xr.jsx)(yo,{task:zt,epic:Tt,onDragStart:rt,onTaskClick:pt,isCompact:v.status==="done"},zt.id))})]},We)})},v.id)})}),(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(No,{isOpen:B,onClose:()=>V(!1),onAddTask:Te,assignees:[...I,...D],epics:w,sprints:f}),(0,Xr.jsx)(Do,{isOpen:se,onClose:()=>N(!1),onAddEpic:mt}),U&&(0,Xr.jsx)(ls,{isOpen:!!U,onClose:()=>fe(null),initialTask:U,epics:w,sprints:f,onUpdateTask:dt,onDeleteTask:ct,colleagues:[...I,...D],onAddComment:u})]})]})})]})};var ms=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:d,onUpdateEpic:s,onDeleteEpic:m})=>{let[n,c]=(0,Et.useState)(null),[u,h]=(0,Et.useState)(null),[g,w]=(0,Et.useState)({}),y=P=>{c(P)},f=P=>{P.preventDefault()},E=(P,D)=>{P.preventDefault(),n&&n.epicId!==D&&(o(n.id,{epicId:D}),c(null))},B=P=>e.filter(D=>D.epicId===P),V=P=>{h(P.id),w({name:P.name,description:P.description,confidence:P.confidence,phase:P.phase,progress:P.progress})},se=()=>{u&&g.name&&(s(u,g),h(null),w({}))},N=()=>{h(null),w({})},U=P=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&m(P)},fe=P=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[P]||`Phase ${P}`,T=P=>{switch(P){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,Xr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Xr.jsx)(Qe,{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:d}}),(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsx)("div",{className:"w-full",children:(0,Xr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(P=>{let D=B(P.id),Q=D.reduce((I,Ke)=>I+Ke.points,0);return(0,Xr.jsxs)(O,{className:`flex flex-col ${u===P.id?"h-auto":"h-[600px]"} bg-card shadow-sm`,onDragOver:f,onDrop:I=>E(I,P.id),children:[(0,Xr.jsx)("div",{className:"Xr-4 border-b border-border",children:u===P.id?(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)(L,{value:g.name||"",onChange:I=>w({...g,name:I.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Xr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:se,className:"Xr-1 h-8 w-8",children:(0,Xr.jsx)(ht.Check,{className:"h-4 w-4"})}),(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:N,className:"Xr-1 h-8 w-8",children:(0,Xr.jsx)(ht.Xr,{className:"h-4 w-4"})})]})]}),(0,Xr.jsx)(we,{value:g.description||"",onChange:I=>w({...g,description:I.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Xr.jsxs)(Se,{value:g.confidence||P.confidence,onValueChange:I=>w({...g,confidence:I}),children:[(0,Xr.jsx)(Ne,{className:"text-xs",children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)(K,{value:"low",children:"Low"}),(0,Xr.jsx)(K,{value:"medium",children:"Medium"}),(0,Xr.jsx)(K,{value:"high",children:"High"})]})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Xr.jsxs)(Se,{value:g.phase?.toString()||P.phase.toString(),onValueChange:I=>w({...g,phase:parseInt(I)}),children:[(0,Xr.jsx)(Ne,{className:"text-xs",children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsx)(Ce,{children:[1,2,3,4,5,6,7,8,9].map(I=>(0,Xr.jsxs)(K,{value:I.toString(),children:["Phase ",I]},I))})]})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Progress (%)"}),(0,Xr.jsx)(L,{type:"number",min:"0",max:"100",value:g.progress||P.progress,onChange:I=>w({...g,progress:parseInt(I.target.value)||0}),className:"text-xs"})]})]}):(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Xr.jsx)("div",{className:`w-4 h-4 rounded-full ${P.color}`}),(0,Xr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:P.name}),(0,Xr.jsxs)("div",{className:"flex gap-1",children:[(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>V(P),className:"Xr-1 h-8 w-8",children:(0,Xr.jsx)(ht.Edit2,{className:"h-3 w-3"})}),(0,Xr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>U(P.id),className:"Xr-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Xr.jsx)(ht.Trash2,{className:"h-3 w-3"})})]})]}),(0,Xr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Xr.jsxs)(Z,{className:`text-xs ${T(P.confidence)}`,children:[P.confidence," confidence"]}),(0,Xr.jsxs)(Z,{variant:"outline",className:"text-xs",children:["Phase ",P.phase]}),(0,Xr.jsxs)(Z,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[D.length," tasks"]}),(0,Xr.jsxs)(Z,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Q," pts"]})]}),P.description&&(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground mb-3 select-none",children:P.description}),(0,Xr.jsxs)("div",{className:"mb-3",children:[(0,Xr.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:[(0,Xr.jsx)("span",{className:"select-none",children:"Progress"}),(0,Xr.jsxs)("span",{className:"select-none",children:[P.progress,"%"]})]}),(0,Xr.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,Xr.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${P.progress}%`}})})]}),(0,Xr.jsxs)(x,{onClick:()=>r(P.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Xr.jsx)("div",{className:"flex-1 Xr-4 overflow-y-auto",children:(0,Xr.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded Xr-3 transition-colors ${n?"border-primary bg-primary/10":"border-border"}`,children:D.length===0?(0,Xr.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,Xr.jsx)(ht.Move,{className:"h-8 w-8 mb-2"}),(0,Xr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):D.map(I=>(0,Xr.jsx)(yo,{task:I,epic:P,onDragStart:y,onTaskClick:i,isCompact:!0},I.id))})})]},P.id)})})})})]})};var ps=require("react-day-picker");function Po({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Xr.jsx)(ps.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:b("Xr-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:b(oo({variant:"outline"}),"h-7 w-7 bg-transparent Xr-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:b("relative Xr-0 text-center text-sm focus-within:relative focus-within:Xr-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-Xr-md first:[&:has([aria-selected])]:rounded-Xr-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:b(oo({variant:"ghost"}),"h-8 w-8 Xr-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})}Po.displayName="Calendar";var gs=ve(require("react")),jt=ve(require("@radix-ui/react-popover"));var dr=jt.Root,cr=jt.Trigger;var To=gs.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,Xr.jsx)(jt.Portal,{children:(0,Xr.jsx)(jt.Content,{ref:i,align:t,sideOffset:a,className:b("Xr-50 w-72 rounded-md border bg-popover Xr-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})}));To.displayName=jt.Content.displayName;var pr=require("date-fns");var vs=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,Et.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate,endDate:o.endDate,isActive:o.isActive,isSelected:!1}),i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},d=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,Xr.jsx)(gt,{open:e,onOpenChange:d,children:(0,Xr.jsxs)(it,{className:"sm:max-w-md",children:[(0,Xr.jsx)(st,{children:(0,Xr.jsx)(nt,{children:"Add New Sprint"})}),(0,Xr.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"name",children:"Sprint Name *"}),(0,Xr.jsx)(L,{id:"name",value:o.name,onChange:s=>i(m=>({...m,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,Xr.jsx)(we,{id:"description",value:o.description,onChange:s=>i(m=>({...m,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"Start Date *"}),(0,Xr.jsxs)(dr,{children:[(0,Xr.jsx)(cr,{asChild:!0,children:(0,Xr.jsxs)(x,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Xr.jsx)(ht.CalendarIcon,{className:"ht-2 h-4 w-4"}),o.startDate?(0,pr.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Xr.jsx)(To,{className:"w-auto Xr-0",align:"start",children:(0,Xr.jsx)(Po,{mode:"single",selected:o.startDate,onSelect:s=>i(m=>({...m,startDate:s})),initialFocus:!0})})]})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{children:"End Date *"}),(0,Xr.jsxs)(dr,{children:[(0,Xr.jsx)(cr,{asChild:!0,children:(0,Xr.jsxs)(x,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Xr.jsx)(ht.CalendarIcon,{className:"ht-2 h-4 w-4"}),o.endDate?(0,pr.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Xr.jsx)(To,{className:"w-auto Xr-0",align:"start",children:(0,Xr.jsx)(Po,{mode:"single",selected:o.endDate,onSelect:s=>i(m=>({...m,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)("input",{type:"checkbox",id:"isActive",checked:o.isActive,onChange:s=>i(m=>({...m,isActive:s.target.checked})),className:"rounded border-gray-300"}),(0,Xr.jsx)(R,{htmlFor:"isActive",children:"Set ht active sprint"})]}),(0,Xr.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Xr.jsx)(x,{type:"button",variant:"outline",onClick:d,children:"Cancel"}),(0,Xr.jsx)(x,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Eo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r})=>{let[d,s]=(0,Et.useState)(["2"]),[m,n]=(0,Et.useState)(null),[c,u]=(0,Et.useState)(!1),[h,g]=(0,Et.useState)(null),[w,y]=(0,Et.useState)(e.filter(k=>!k.sprintId)),[f,E]=(0,Et.useState)(e.filter(k=>k.sprintId&&d.includes(k.sprintId))),[B,V]=(0,Et.useState)(a.filter(k=>k.id!=="backlog"&&k.id!=="all-tasks").sort((k,pe)=>k.startDate.getTime()-pe.startDate.getTime()));(0,Et.useEffect)(()=>{y(e.filter(k=>!k.sprintId)),E(e.filter(k=>k.sprintId&&d.includes(k.sprintId))),V(a.filter(k=>k.id!=="backlog"&&k.id!=="all-tasks").sort((k,pe)=>k.startDate.getTime()-pe.startDate.getTime()))},[e,a,d]);let se=k=>t.find(pe=>pe.id===k),N=k=>a.find(pe=>pe.id===k),U=k=>{switch(k){case"high":return"bg-destructive/20 text-destructive";case"medium":return"bg-warning/20 text-warning";case"low":return"bg-success/20 text-success";default:return"bg-muted text-muted-foreground"}},fe=k=>k.split(" ").map(pe=>pe[0]).join("").toUpperCase(),T=k=>{n(k)},P=k=>{k.preventDefault()},D=k=>{g(k)},Q=()=>{g(null)},I=(k,pe)=>{k.preventDefault(),g(null),m&&(o(m.id,{sprintId:pe==="backlog"?void 0:pe}),n(null))},Ke=k=>{k==="backlog"||k==="all-tasks"||s(pe=>pe.includes(k)?pe.filter(Pe=>Pe!==k):[...pe,k])},Fe=k=>{r(k),u(!1)},ze=({task:k,showSprint:pe=!1})=>{let Pe=se(k.epicId),rt=k.sprintId?N(k.sprintId):null,[He,Te]=(0,Et.useState)(!1),dt=pt=>{pt.defaultPrevented||He||i(k)},ct=pt=>{Te(!0),T(k)},mt=()=>{Te(!1)};return(0,Xr.jsx)(O,{className:`Xr-3 cursor-grab transition-all duration-200 hover:shadow-md bg-card border-border hover:border-border/80 active:cursor-grabbing ${He?"opacity-50 shadow-lg scale-105":""} ${m?.id===k.id?"ring-2 ring-primary":""}`,draggable:!0,onDragStart:ct,onDragEnd:mt,onClick:dt,children:(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Xr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1 select-none pointer-events-none",children:k.name}),(0,Xr.jsx)(Z,{className:`text-xs select-none pointer-events-none ${U(k.priority)}`,children:k.priority[0].toUpperCase()})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-xs pointer-events-none",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-1",children:[Pe&&(0,Xr.jsx)("div",{className:`w-2 h-2 rounded-full ${Pe.color}`}),(0,Xr.jsx)("span",{className:"text-muted-foreground truncate select-none",children:Pe?.name})]}),(0,Xr.jsx)("span",{className:"text-muted-foreground select-none",children:fe(k.assignee)})]}),pe&&rt&&(0,Xr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground pointer-events-none",children:[(0,Xr.jsx)(ht.Calendar,{className:"h-3 w-3"}),(0,Xr.jsx)("span",{className:"select-none",children:rt.name})]})]})})};return(0,Xr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Xr.jsx)(Qe,{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:()=>u(!0)}}),(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsxs)("div",{className:"w-full",children:[(0,Xr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:[(0,Xr.jsx)("div",{className:"lg:col-span-1",children:(0,Xr.jsxs)(O,{className:"Xr-4 h-full bg-card shadow-sm",onDragOver:P,onDragEnter:()=>D("backlog"),onDragLeave:Q,onDrop:k=>I(k,"backlog"),children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Xr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Backlog"}),(0,Xr.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:w.length})]}),(0,Xr.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[600px] min-h-[200px] border-2 border-dashed rounded Xr-3 transition-colors ${h==="backlog"?"border-primary bg-primary/10":"border-border"}`,children:[w.map(k=>(0,Xr.jsx)(ze,{task:k},k.id)),w.length===0&&(0,Xr.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"})]})]})}),(0,Xr.jsx)("div",{className:"lg:col-span-3",children:(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsxs)(O,{className:"Xr-4 bg-card shadow-sm",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Xr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:"Select Sprints to View"}),(0,Xr.jsxs)(x,{onClick:()=>u(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-2",size:"sm",children:[(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4"}),"Add Sprint"]})]}),(0,Xr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2",children:B.map(k=>(0,Xr.jsxs)(x,{variant:d.includes(k.id)?"default":"outline",size:"sm",onClick:()=>Ke(k.id),className:"text-xs h-8",children:[k.name,k.isActive&&(0,Xr.jsx)("span",{className:"ml-1 text-success",children:"\u25CF"})]},k.id))})]}),(0,Xr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(k=>B.find(pe=>pe.id===k)).filter(Boolean).sort((k,pe)=>k.startDate.getTime()-pe.startDate.getTime()).map(k=>{let pe=f.filter(Pe=>Pe.sprintId===k.id);return(0,Xr.jsxs)(O,{className:"Xr-4 bg-card shadow-sm",onDragOver:P,onDragEnter:()=>D(k.id),onDragLeave:Q,onDrop:Pe=>I(Pe,k.id),children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("h3",{className:"font-semibold text-foreground select-none",children:k.name}),k.isActive&&(0,Xr.jsx)("span",{className:"text-xs text-success font-medium select-none",children:"Active Sprint"})]}),(0,Xr.jsx)(Z,{variant:"secondary",className:"bg-muted text-muted-foreground",children:pe.length})]}),(0,Xr.jsxs)("div",{className:`space-y-3 overflow-y-auto max-h-[500px] min-h-[200px] border-2 border-dashed rounded Xr-3 transition-colors ${h===k.id?"border-primary bg-primary/10":"border-border"}`,children:[pe.map(Pe=>(0,Xr.jsx)(ze,{task:Pe},Pe.id)),pe.length===0&&(0,Xr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})]},k.id)})})," "]})})]}),(0,Xr.jsx)(vs,{isOpen:c,onClose:()=>u(!1),onAddSprint:Fe})]})})]})};var Bl=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},Ll=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),jl=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})},ur=(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},gr=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ol=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},zl=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,Et.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[d,s]=(0,Et.useState)(!1),m=c=>{c.preventDefault();let u=e.find(g=>g?.id.toString()===i.colleagueId.toString());if(!u){console.error("No valid colleague selected"),s(!0);return}s(!1);let h={title:i.title,description:i.description,dueDate:new Date(i.dueDate),dueTime:i.dueTime||void 0,colleague:u,isCompleted:!1,isRecurring:i.isRecurring,recurrencePattern:i.isRecurring?i.recurrencePattern:void 0,recurrenceInterval:i.isRecurring?i.recurrenceInterval:void 0,priority:i.priority,reminderEnabled:i.reminderEnabled,reminderMinutes:i.reminderEnabled?i.reminderMinutes:void 0,tags:i.tags?i.tags.split(",").map(g=>g.trim()):void 0};t(h),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Et.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,Xr.jsx)(gt,{open:a,onOpenChange:o,children:(0,Xr.jsxs)(it,{className:"max-w-2xl",children:[(0,Xr.jsx)(st,{children:(0,Xr.jsx)(nt,{children:"Add New Reminder"})}),(0,Xr.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Xr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"title",children:"Title"}),(0,Xr.jsx)(L,{id:"title",value:i.title,onChange:c=>r({...i,title:c.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,Xr.jsx)(we,{id:"description",value:i.description,onChange:c=>r({...i,description:c.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"dueDate",children:"Due Date"}),(0,Xr.jsx)(L,{id:"dueDate",type:"date",value:i.dueDate,onChange:c=>r({...i,dueDate:c.target.value}),required:!0})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Xr.jsx)(L,{id:"dueTime",type:"time",value:i.dueTime,onChange:c=>r({...i,dueTime:c.target.value})})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{className:`${d?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Xr.jsxs)(Se,{value:i.colleagueId,onValueChange:c=>{r({...i,colleagueId:c})},required:!0,children:[(0,Xr.jsx)(Ne,{className:`${d?"text-destructive border-red-500":""}`,children:(0,Xr.jsx)(Ie,{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,Xr.jsx)(Ce,{children:n.map(c=>(0,Xr.jsx)(K,{value:c.id,children:c.name},c.id))})]}),d&&(0,Xr.jsx)("Xr",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:c=>r({...i,isRecurring:c.target.checked}),className:"rounded border-border"}),(0,Xr.jsx)(R,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Xr.jsxs)(Se,{value:i.recurrencePattern,onValueChange:c=>r({...i,recurrencePattern:c}),children:[(0,Xr.jsx)(Ne,{children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)(K,{value:"daily",children:"Daily"}),(0,Xr.jsx)(K,{value:"weekly",children:"Weekly"}),(0,Xr.jsx)(K,{value:"monthly",children:"Monthly"}),(0,Xr.jsx)(K,{value:"yearly",children:"Yearly"})]})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Xr.jsx)(L,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:c=>r({...i,recurrenceInterval:parseInt(c.target.value)})})]})]})]}),(0,Xr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Xr.jsx)(x,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Xr.jsx)(x,{type:"submit",children:"Add Reminder"})]})]})]})})},Hl=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,d]=(0,Et.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague?.id||"",priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""}),s=n=>{n.preventDefault();let c=t.find(u=>u?.id===r.colleagueId);if(!c){console.error("No valid colleague selected");return}a(e.id,{title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:c,priority:r.priority,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(u=>u.trim()):void 0}),i()},m=t.filter(Boolean);return(0,Xr.jsx)(gt,{open:o,onOpenChange:i,children:(0,Xr.jsxs)(it,{className:"max-w-2xl",children:[(0,Xr.jsx)(st,{children:(0,Xr.jsx)(nt,{children:"Edit Reminder"})}),(0,Xr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-title",children:"Title"}),(0,Xr.jsx)(L,{id:"edit-title",value:r.title,onChange:n=>d({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-priority",children:"Priority"}),(0,Xr.jsxs)(Se,{value:r.priority,onValueChange:n=>d({...r,priority:n}),children:[(0,Xr.jsx)(Ne,{children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)(K,{value:"low",children:"\u{1F7E2} Low"}),(0,Xr.jsx)(K,{value:"medium",children:"\u{1F7E1} Medium"}),(0,Xr.jsx)(K,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-description",children:"Description"}),(0,Xr.jsx)(we,{id:"edit-description",value:r.description,onChange:n=>d({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Xr.jsx)(L,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>d({...r,dueDate:n.target.value}),required:!0})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Xr.jsx)(L,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>d({...r,dueTime:n.target.value})})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,Xr.jsxs)(Se,{value:r.colleagueId,onValueChange:n=>d({...r,colleagueId:n}),required:!0,children:[(0,Xr.jsx)(Ne,{children:(0,Xr.jsx)(Ie,{placeholder:"Select a digital colleague"})}),(0,Xr.jsx)(Ce,{children:m.map(n=>(0,Xr.jsx)(K,{value:n.id,children:n.name},n.id))})]})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:n=>d({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,Xr.jsx)(R,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,Xr.jsxs)(Se,{value:r.recurrencePattern,onValueChange:n=>d({...r,recurrencePattern:n}),children:[(0,Xr.jsx)(Ne,{children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)(K,{value:"daily",children:"Daily"}),(0,Xr.jsx)(K,{value:"weekly",children:"Weekly"}),(0,Xr.jsx)(K,{value:"monthly",children:"Monthly"}),(0,Xr.jsx)(K,{value:"yearly",children:"Yearly"})]})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,Xr.jsx)(L,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>d({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:n=>d({...r,reminderEnabled:n.target.checked}),className:"rounded border-border"}),(0,Xr.jsx)(R,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Xr.jsxs)("div",{className:"pl-6",children:[(0,Xr.jsx)(R,{htmlFor:"edit-reminderMinutes",children:"Remind me"}),(0,Xr.jsxs)(Se,{value:r.reminderMinutes.toString(),onValueChange:n=>d({...r,reminderMinutes:parseInt(n)}),children:[(0,Xr.jsx)(Ne,{children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsx)(K,{value:"5",children:"5 minutes before"}),(0,Xr.jsx)(K,{value:"15",children:"15 minutes before"}),(0,Xr.jsx)(K,{value:"30",children:"30 minutes before"}),(0,Xr.jsx)(K,{value:"60",children:"1 hour before"}),(0,Xr.jsx)(K,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)(R,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,Xr.jsx)(L,{id:"edit-tags",value:r.tags,onChange:n=>d({...r,tags:n.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Xr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Xr.jsx)(x,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,Xr.jsx)(x,{type:"submit",children:"Save Changes"})]})]})]})})},Vl=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,Et.useState)(!1);if(!e||!e.id)return null;let d=ur(e.dueDate,e.dueTime),s=gr(e.dueDate),m=Ol(e.dueDate),n=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},c=()=>s?"Today":m?"Tomorrow":d&&!e.isCompleted?"Overdue":Ll(e.dueDate);return(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(Hl,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,Xr.jsx)(O,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${d&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,Xr.jsx)(le,{className:"Xr-4",children:(0,Xr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Xr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Xr.jsx)("button",{onClick:n,className:"mt-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,Xr.jsx)(ht.CheckCircle,{className:"h-5 w-5"}):(0,Xr.jsx)(ht.Circle,{className:"h-5 w-5"})}),(0,Xr.jsxs)("div",{className:"flex-1",children:[(0,Xr.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,Xr.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,Xr.jsx)("span",{className:"text-sm",children:Bl(e.priority)}),e.isRecurring&&(0,Xr.jsx)(ht.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,Xr.jsx)(ht.Bell,{className:"h-4 w-4 text-success"})]}),(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Xr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Xr.jsx)(ht.Calendar,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{className:d&&!e.isCompleted?"text-destructive font-medium":"",children:c()})]}),e.dueTime&&(0,Xr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Xr.jsx)(ht.Clock,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{children:jl(e.dueTime)})]}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Xr.jsx)(ht.User,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{children:e.colleague?.name||"Unknown Colleague"})]})]}),e.tags&&e.tags.length>0&&(0,Xr.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map((u,h)=>(0,Xr.jsx)(Z,{variant:"secondary",className:"text-xs",children:u},h))})]})]}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Xr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 Xr-0",children:(0,Xr.jsx)(ht.Edit2,{className:"h-4 w-4"})}),(0,Xr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>o(e.id),className:"h-8 w-8 Xr-0 text-destructive hover:text-destructive/80",children:(0,Xr.jsx)(ht.Trash2,{className:"h-4 w-4"})})]})]})})})]})},bs=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,d]=(0,Et.useState)(e.filter(Boolean)),[s]=(0,Et.useState)(t.filter(Boolean)),[m,n]=(0,Et.useState)("all"),[c,u]=(0,Et.useState)(""),[h,g]=(0,Et.useState)(!1),w=N=>{if(!N.title||!N.colleague?.id){console.error("Invalid reminder data:",N);return}let U={...N,id:Date.now().toString(),createdAt:new Date};d(fe=>[...fe,U]),a?.(N)},y=(N,U)=>{if(!N){console.error("No reminder ID provided for update");return}d(fe=>fe.map(T=>T?.id===N?{...T,...U}:T)),o?.(N,U)},f=N=>{if(!N){console.error("No reminder ID provided for deletion");return}d(U=>U.filter(fe=>fe?.id!==N)),i?.(N)},B=r.filter(N=>{if(!N)return!1;if(c){let U=c.toLowerCase();if(!(N.title.toLowerCase().includes(U)||N.description.toLowerCase().includes(U)||N.colleague?.name?.toLowerCase().includes(U)||N.tags?.some(T=>T.toLowerCase().includes(U))))return!1}switch(m){case"pending":return!N.isCompleted;case"completed":return N.isCompleted;case"overdue":return!N.isCompleted&&ur(N.dueDate,N.dueTime);case"today":return gr(new Date(N.dueDate));default:return!0}}).sort((N,U)=>{if(!N||!U)return 0;if(N.isCompleted&&!U.isCompleted)return 1;if(!N.isCompleted&&U.isCompleted)return-1;let fe={high:3,medium:2,low:1},T=fe[U.priority]-fe[N.priority];return T!==0?T:N.dueDate.getTime()-U.dueDate.getTime()}),V={total:r.filter(Boolean).length,pending:r.filter(N=>N&&!N.isCompleted).length,completed:r.filter(N=>N&&N.isCompleted).length,overdue:r.filter(N=>N&&!N.isCompleted&&ur(N.dueDate,N.dueTime)).length,today:r.filter(N=>N&&gr(new Date(N.dueDate))).length},se=s.find(Boolean)||{id:"1",name:"Default Colleague",status:"active",joinedDate:new Date,lastActive:new Date,type:"digital",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:[],version:"1.0.0",lastUpdated:new Date,isActive:!0};return(0,Xr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Xr.jsx)(Qe,{title:"Task Reminders",description:"Manage reminders and stay on 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:()=>{g(!0)}}}),(0,Xr.jsxs)("div",{className:"h-full bg-background",children:[(0,Xr.jsx)(zl,{colleagues:s,onAddReminder:w,open:h,setOpen:g}),(0,Xr.jsxs)("div",{className:"Xr-6",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Xr.jsxs)("div",{children:[(0,Xr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Xr.jsxs)(x,{className:"flex items-center space-x-2",onClick:()=>g(!0),children:[(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4"}),(0,Xr.jsx)("span",{children:"Add Reminder"})]})]}),(0,Xr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Xr.jsxs)(O,{className:"Xr-4",children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:V.total}),(0,Xr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Xr.jsxs)(O,{className:"Xr-4",children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold text-primary",children:V.pending}),(0,Xr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Xr.jsxs)(O,{className:"Xr-4",children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold text-success",children:V.completed}),(0,Xr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Xr.jsxs)(O,{className:"Xr-4",children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:V.overdue}),(0,Xr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Xr.jsxs)(O,{className:"Xr-4",children:[(0,Xr.jsx)("div",{className:"text-2xl font-bold text-warning",children:V.today}),(0,Xr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Xr.jsx)("div",{className:"flex-1",children:(0,Xr.jsx)(L,{placeholder:"Search reminders...",value:c,onChange:N=>u(N.target.value),className:"max-w-md"})}),(0,Xr.jsxs)(Se,{value:m,onValueChange:N=>n(N),children:[(0,Xr.jsx)(Ne,{className:"w-40",children:(0,Xr.jsx)(Ie,{})}),(0,Xr.jsxs)(Ce,{children:[(0,Xr.jsxs)(K,{value:"all",children:["All (",V.total,")"]}),(0,Xr.jsxs)(K,{value:"pending",children:["Pending (",V.pending,")"]}),(0,Xr.jsxs)(K,{value:"completed",children:["Completed (",V.completed,")"]}),(0,Xr.jsxs)(K,{value:"overdue",children:["Overdue (",V.overdue,")"]}),(0,Xr.jsxs)(K,{value:"today",children:["Today (",V.today,")"]})]})]})]}),(0,Xr.jsx)("div",{className:"space-y-4",children:B.length===0?(0,Xr.jsxs)(O,{className:"Xr-8 text-center",children:[(0,Xr.jsx)("div",{className:"text-muted-foreground",children:c||m!=="all"?"No reminders match your filters":"No reminders yet"}),!c&&m==="all"&&(0,Xr.jsx)("Xr",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):B.map(N=>N&&(0,Xr.jsx)(Vl,{reminder:N,colleagues:s,onUpdateReminder:y,onDeleteReminder:f},N.id))})]})]})]})};var hs=require("next/navigation");function fr({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:d=[],initialUsers:s=[],initialFiles:m=[],initialView:n="kanban",onAddTask:c,onUpdateTask:u,onDeleteTask:h,onTaskClick:g,onAddEpic:w,onUpdateEpic:y,onDeleteEpic:f,onAddTaskToEpic:E,onAddSprint:B,onUpdateSprint:V,onDeleteSprint:se,onAddProject:N,onUpdateProject:U,onDeleteProject:fe,onFileAdd:T,onFileEdit:P,onFileDelete:D,onFileClick:Q,onAddReminder:I,onUpdateReminder:Ke,onDeleteReminder:Fe,onViewChange:ze,onToggleMobileMenu:k,onTeamClick:pe,onTeamChange:Pe,onCopilotClick:rt,handleAddComment:He}){let[Te,dt]=(0,Et.useState)(t),[ct,mt]=(0,Et.useState)(a),[pt,Ft]=(0,Et.useState)(o),[v,ee]=(0,Et.useState)(i),[q,We]=(0,Et.useState)(r),[Tt,Ot]=(0,Et.useState)(d),[zt,Bo]=(0,Et.useState)(s),[Lo,Za]=(0,Et.useState)(m),[jo,Aa]=(0,Et.useState)(!1),[Qa,Ma]=(0,Et.useState)(!1),[C,M]=(0,Et.useState)(null),[ye,Sr]=(0,Et.useState)(null),[Dr,kr]=(0,Et.useState)(null),[oa,Pr]=(0,Et.useState)(n||"kanban"),[Es,Is]=(0,Et.useState)(!1),Tr=(0,hs.useRouter)();(0,Et.useEffect)(()=>{dt(t)},[t]),(0,Et.useEffect)(()=>{Ft(o)},[o]),(0,Et.useEffect)(()=>{mt(a)},[a]),(0,Et.useEffect)(()=>{ee(i)},[i]),(0,Et.useEffect)(()=>{Za(m)},[m]),(0,Et.useEffect)(()=>{Bo(s)},[s]),(0,Et.useEffect)(()=>{Ot(d)},[d]),(0,Et.useEffect)(()=>{We(r)},[r]),(0,Et.useEffect)(()=>{Pr(n)},[n]);let As=ct.filter(S=>S.isSelected).map(S=>S.id),eo=pt.find(S=>S.isSelected),Ms=Te.filter(S=>{let j=As.includes(S.epicId);return!eo||eo.id==="all-tasks"?j:eo.id==="backlog"?j&&!S.sprintId:j&&S.sprintId===eo.id}),Kl=S=>Ms.filter(j=>j.status===S),$Xr=S=>{let j={};return ct.forEach(ae=>{j[ae.id]=S.filter(Re=>Re.epicId===ae.id)}),j},_l=S=>{kr(S)},Gl=S=>{Dr&&(dt(j=>j.map(ae=>ae.id===Dr.id?{...ae,status:S}:ae)),kr(null))},Rr=S=>{let j={...S,id:Date.now().toString(),createdAt:new Date};dt(ae=>[...ae,j]),c?.(j)},to=async(S,j)=>(dt(ae=>ae.map(Re=>Re.id===S?{...Re,...j}:Re)),await u?.(S,j)),Wl=async(S,j)=>{to(S,j)},Er=S=>{dt(j=>j.filter(ae=>ae.id!==S)),C?.id===S&&M(null),h?.(S)},ql=async S=>{Er(S)},Fs=S=>{let j={...S,id:Date.now().toString(),isSelected:!1};ee(ae=>[...ae,j]),N?.(S)},Bs=(S,j)=>{ee(ae=>ae.map(Re=>Re.id===S?j.isSelected?(Tr.push(`/project/${S}`),{...Re,...j}):{...Re,...j}:j.isSelected&&S!==Re.id?{...Re,isSelected:!1}:Re)),U?.(S,j)},Ls=S=>{ee(j=>j.filter(ae=>ae.id!==S)),fe?.(S)},Ir=S=>{let j={...S,id:Date.now().toString(),isSelected:!0};mt(ae=>[...ae,j]),w?.({...j})},Ar=()=>{Ma(!0)},Mr=(S,j)=>{mt(ae=>ae.map(Re=>Re.id===S?{...Re,...j}:Re)),y?.(S,j)},Fr=S=>{mt(j=>j.filter(ae=>ae.id!==S)),dt(j=>j.filter(ae=>ae.epicId!==S)),f?.(S)},Br=S=>{let j={...S,id:Date.now().toString(),isSelected:!1};Ft(ae=>[...ae,j]),B?.(S)},js=(S,j)=>{Ft(ae=>ae.map(Re=>Re.id===S?j.isSelected?{...Re,...j}:{...Re,...j}:j.isSelected&&S!==Re.id?{...Re,isSelected:!1}:Re)),V?.(S,j)},Os=S=>{S==="backlog"||S==="all-tasks"||(Ft(j=>j.filter(ae=>ae.id!==S)),dt(j=>j.map(ae=>ae.sprintId===S?{...ae,sprintId:void 0}:ae)),se?.(S))},Oo=S=>{M(S)},zs=S=>{S==="planning"&&window.innerWidth<768||(Pr(S),ze?.(S))},Hs=()=>{Is(S=>!S),k?.()},Xl=()=>{Tr.push("/")},Jl=S=>{console.log("Switching to team:",S)},Yl=S=>{console.log("Switching to team:",S)},Vs=S=>{Sr(S),Aa(!0)},Us=()=>{Aa(!1),Sr(null)},Ks=S=>{let j={...S,id:Date.now().toString(),createdAt:new Date};We(ae=>[...ae,j]),I?.(S)},$s=(S,j)=>{We(ae=>ae.map(Re=>Re.id===S?{...Re,...j}:Re)),Ke?.(S,j)},_s=S=>{We(j=>j.filter(ae=>ae.id!==S)),Fe?.(S)},Gs=()=>{T?.()},Ws=S=>{P?.(S)},qs=S=>{Za(j=>j.filter(ae=>ae.name!==S)),D?.(S)},Xs=S=>{Q?.(S)},Zl=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ql=()=>{switch(oa){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"}},zo=[{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")}],ed=zo.sort((S,j)=>j.lastUsed.getTime()-S.lastUsed.getTime()).slice(0,3),td=zo.length>3,ad=zo.slice(3);return(0,Xr.jsxs)(qi,{projects:v,epics:ct,sprints:pt,currentView:oa,onUpdateProject:Bs,onDeleteProject:Ls,onAddProject:Fs,onUpdateEpic:Mr,onDeleteEpic:Fr,onAddEpic:Ar,onAddSprint:Br,onUpdateSprint:js,onDeleteSprint:Os,onViewChange:zs,mobileMenuOpen:Es,onToggleMobileMenu:Hs,children:[oa==="kanban"&&(0,Xr.jsx)("div",{className:"h-full",children:(0,Xr.jsx)(cs,{initialProjects:v,initialEpics:ct,initialSprints:pt,initialTasks:Te,initialColleagues:Tt,initialUsers:zt,onAddTask:Rr,onUpdateTask:to,onDeleteTask:Er,onTaskClick:Oo,onAddEpic:Ir,onAddComment:He})}),oa==="planning"&&(0,Xr.jsx)("div",{className:"hidden md:block h-full",children:(0,Xr.jsx)(Eo,{tasks:Te,epics:ct,sprints:pt,onUpdateTask:to,onTaskClick:Oo,onAddSprint:Br})}),oa==="tasks"&&(0,Xr.jsx)("div",{className:"h-full",children:(0,Xr.jsx)(bs,{initialReminders:q,initialColleagues:Tt,onAddReminder:Ks,onUpdateReminder:$s,onDeleteReminder:_s})}),oa==="files"&&(0,Xr.jsx)("div",{className:"h-full",children:(0,Xr.jsx)(Ua,{initialFiles:Lo,onFileAdd:Gs,onFileEdit:Ws,onFileDelete:qs,onFileClick:Xs,compactView:!1})}),oa==="epics"&&(0,Xr.jsx)("div",{className:"h-full",children:(0,Xr.jsx)(ms,{tasks:Te,epics:ct,sprints:pt,onUpdateTask:to,onTaskClick:Oo,onAddTaskToEpic:Vs,onAddEpic:Ar,onUpdateEpic:Mr,onDeleteEpic:Fr})}),(0,Xr.jsx)(No,{isOpen:jo,onClose:Us,onAddTask:Rr,epics:ct,sprints:pt,assignees:[...Tt,...zt],defaultEpicId:ye||void 0}),(0,Xr.jsx)(Do,{isOpen:Qa,onClose:()=>Ma(!1),onAddEpic:Ir})]})}var xs=ve(require("react")),qa=ve(require("@radix-ui/react-progress"));var br=xs.forwardRef(({className:e,value:t,...a},o)=>(0,Xr.jsx)(qa.Root,{ref:o,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,Xr.jsx)(qa.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));br.displayName=qa.Root.displayName;function ws({project:e,onOpen:t,onShare:a,className:o}){return(0,Xr.jsx)(Ko.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Xr.jsxs)(O,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Xr.jsxs)(Ee,{children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Xr.jsx)(Le,{children:e.name}),(0,Xr.jsxs)(Z,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Xr.jsx)(ia,{children:e.description})]}),(0,Xr.jsxs)(le,{className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Xr.jsx)("span",{children:"Progress"}),(0,Xr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Xr.jsx)(br,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Xr.jsxs)("div",{className:"flex items-center",children:[(0,Xr.jsx)(ht.Users,{className:"ht-1 h-4 w-4"}),e.members," members"]}),(0,Xr.jsxs)("div",{className:"flex items-center",children:[(0,Xr.jsx)(ht.FileText,{className:"ht-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Xr.jsxs)(sa,{className:"flex gap-2",children:[(0,Xr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Xr.jsx)(x,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,Xr.jsx)(ht.Share2,{className:"h-4 w-4"})})]})]})})}var Xa=ve(require("@radix-ui/react-checkbox")),Cs=ve(require("react")),hr=Cs.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(Xa.Root,{className:b("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,Xr.jsx)(Xa.Indicator,{className:b("flex items-center justify-center text-current"),children:(0,Xr.jsx)(ht.Check,{className:"h-4 w-4"})})}));hr.displayName=Xa.Root.displayName;var Ss=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,d]=(0,Et.useState)({name:o?.name||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,m]=(0,Et.useState)({}),n=()=>{let h={};return r.name.trim()?r.name.trim().length<3&&(h.name="Project name must be at least 3 characters"):h.name="Project name Et required",r.objectives.trim()?r.objectives.trim().length<10&&(h.objectives="Please provide more detailed objectives (at least 10 characters)"):h.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(h.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):h.workInstructions="Work instructions are required",m(h),Object.keys(h).length===0},c=async h=>{if(h.preventDefault(),!!n())try{await e(r)}catch(g){console.error("Error submitting project form:",g)}},u=(h,g)=>{d(w=>({...w,[h]:g})),s[h]&&m(w=>({...w,[h]:void 0}))};return(0,Xr.jsxs)(O,{className:`w-full max-w-2xl ${i}`,children:[(0,Xr.jsxs)(Ee,{children:[(0,Xr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Xr.jsx)(ia,{children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,Xr.jsxs)("form",{onSubmit:c,children:[(0,Xr.jsxs)(le,{className:"space-y-6",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Xr.jsx)(L,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:h=>u("name",h.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,Xr.jsx)("Xr",{className:"text-sm text-red-600",children:s.name})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Xr.jsx)(we,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:h=>u("objectives",h.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,Xr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Xr.jsx)("span",{children:s.objectives&&(0,Xr.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Xr.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Xr.jsx)(we,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:h=>u("workInstructions",h.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,Xr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Xr.jsx)("span",{children:s.workInstructions&&(0,Xr.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Xr.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Xr.jsxs)("div",{className:"space-y-3",children:[(0,Xr.jsx)(R,{className:"text-sm font-medium",children:"Project Management"}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)(hr,{id:"plan",checked:r.plan,onCheckedChange:h=>u("plan",h===!0),disabled:a}),(0,Xr.jsx)(R,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Xr.jsx)("Xr",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,Xr.jsxs)(sa,{className:"flex justify-end gap-3",children:[t&&(0,Xr.jsxs)(x,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.Xr,{className:"h-4 w-4"}),"Cancel"]}),(0,Xr.jsx)(x,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(ht.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Xr.jsxs)(Xr.Fragment,{children:[(0,Xr.jsx)(ht.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function wr({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,Et.useState)(!1),[d,s]=(0,Et.useState)(!1),m=async c=>{s(!0);try{await t(c),r(!1)}catch(u){console.error("Error creating project:",u)}finally{s(!1)}},n=()=>{r(!0)};return(0,Xr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Xr.jsx)(Qe,{title:"Project Management",description:"Organise your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,Xr.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Xr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Xr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(c=>(0,Xr.jsx)(ws,{project:c,onOpen:a,onShare:o},c.name))})]})]},"projects-index-view")}),(0,Xr.jsx)(gt,{open:i,onOpenChange:r,children:(0,Xr.jsxs)(it,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Xr.jsxs)(st,{className:"sr-only",children:[(0,Xr.jsx)(nt,{children:"Create New Project"}),(0,Xr.jsx)(Ga,{children:"Fill out the form below to create a new project."})]}),(0,Xr.jsx)(Ss,{onSubmit:m,onCancel:()=>r(!1),isLoading:d,className:"border-0 shadow-none"})]})})]})}function ks({team:e,onOpen:t,className:a}){return(0,Xr.jsx)(Ko.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Xr.jsxs)(O,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Xr.jsxs)(Ee,{children:[(0,Xr.jsx)(Le,{className:"text-lg",children:e.name}),(0,Xr.jsx)(ia,{className:"mt-1 text-sm",children:e.description})]}),(0,Xr.jsxs)(le,{className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.Users,{className:"h-4 w-4 text-blue-500"}),(0,Xr.jsx)("span",{children:"Human"})]}),(0,Xr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Xr.jsx)("span",{children:"Digital"})]}),(0,Xr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Xr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,Xr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Xr.jsx)("span",{children:"Projects"})]}),(0,Xr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Xr.jsx)(sa,{className:"flex gap-2",children:(0,Xr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var Ps=ve(require("react")),Ja=ve(require("@radix-ui/react-switch"));var Ia=Ps.forwardRef(({className:e,...t},a)=>(0,Xr.jsx)(Ja.Root,{className:b("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,Xr.jsx)(Ja.Thumb,{className:b("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")})}));Ia.displayName=Ja.Root.displayName;function Ts({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:d="Cancel",readOnly:s=!1}){let[m,n]=(0,Et.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[c,u]=(0,Et.useState)(!s);(0,Et.useEffect)(()=>{e&&n(e)},[e]);let h=f=>{f.preventDefault();let E={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()};t(E)},g=f=>{f.preventDefault(),u(!c)},w=i||(c?e?"Edit Team":"Create New Team":"View Team"),y=r||(e?"Update Team":"Create Team");return(0,Xr.jsxs)(O,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Xr.jsx)(Ee,{children:(0,Xr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,Xr.jsx)(ht.Users,{className:"h-5 w-5"}),w]})}),(0,Xr.jsx)(le,{children:(0,Xr.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"name",children:"Team Name *"}),(0,Xr.jsx)(L,{id:"name",value:m.name||"",onChange:f=>n({...m,name:f.target.value}),required:!0,disabled:o||!c,placeholder:"Enter team name..."})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"description",children:"Description"}),(0,Xr.jsx)(we,{id:"description",value:m.description||"",onChange:f=>n({...m,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!c})]}),(0,Xr.jsxs)("div",{className:"space-y-2",children:[(0,Xr.jsx)(R,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Xr.jsx)(we,{id:"systemMsg",value:m.systemMsg||"",onChange:f=>n({...m,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in ht much detail ht possible. Include processes, tools, systems, styles...",disabled:o||!c})]})]}),(0,Xr.jsxs)("div",{className:"space-y-4",children:[(0,Xr.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Xr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)(Ia,{id:"useProjects",checked:m.useProjects||!1,onCheckedChange:f=>n({...m,useProjects:f}),disabled:o||!c}),(0,Xr.jsx)(R,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)(Ia,{id:"useKnowledge",checked:m.useKnowledge||!1,onCheckedChange:f=>n({...m,useKnowledge:f}),disabled:o||!c}),(0,Xr.jsx)(R,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)(Ia,{id:"useFiles",checked:m.useFiles||!1,onCheckedChange:f=>n({...m,useFiles:f}),disabled:o||!c}),(0,Xr.jsx)(R,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Xr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Xr.jsx)(Ia,{id:"useChat",checked:m.useChat||!1,onCheckedChange:f=>n({...m,useChat:f}),disabled:o||!c}),(0,Xr.jsx)(R,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Xr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,Xr.jsx)(x,{type:"button",variant:"outline",onClick:a,disabled:o,children:c?d:"Close"}),c?(0,Xr.jsx)(x,{type:"submit",disabled:o||!m.name?.trim(),children:o?"Saving...":y}):(0,Xr.jsxs)(x,{type:"button",onClick:g,disabled:o,className:"gap-2",children:[(0,Xr.jsx)(ht.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Cr({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,Et.useState)(!1),r=()=>{i(!0)},d=n=>{t?.(n),i(!1)},s=()=>{i(!1)},m=n=>{a?.(n)};return(0,Xr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Xr.jsx)(Ko.AnimatePresence,{mode:"wait",children:(0,Xr.jsxs)(Ko.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Xr.jsx)(Qe,{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,Xr.jsxs)("section",{className:"space-y-4 mt-8",children:[(0,Xr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Xr.jsxs)("div",{className:"text-center py-12",children:[(0,Xr.jsx)("Xr",{className:"text-muted-foreground text-lg",children:"You'Xr not part of any teams yet."}),(0,Xr.jsx)("Xr",{className:"text-muted-foreground text-sm mt-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,Xr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,Xr.jsx)(ks,{team:n,onOpen:m},n.id))})]})]},"teams-index-view")}),(0,Xr.jsx)(gt,{open:o,onOpenChange:i,children:(0,Xr.jsxs)(it,{className:"max-w-4xl max-h-[90vh] overflow-y-auto Xr-0",children:[(0,Xr.jsx)("div",{className:"sr-only",children:(0,Xr.jsxs)(st,{children:[(0,Xr.jsx)(nt,{children:"Create New Team"}),(0,Xr.jsx)(Ga,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,Xr.jsx)(Ts,{title:"Create New Team",submitLabel:"Create Team",onSave:d,onCancel:s})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,PlanningView,ProjectView,ProjectsIndexView,TeamsIndexView});