cortex-react-components 2.13.7 → 2.13.9

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 (127) hide show
  1. package/dist/{chunk-6FHRZHAJ.mjs → chunk-2HWSTGAP.mjs} +1 -1
  2. package/dist/{chunk-XX4GSGRP.mjs → chunk-5NIEZE7A.mjs} +1 -1
  3. package/dist/chunk-7O5XSUX2.mjs +1 -0
  4. package/dist/{chunk-M527EJIX.mjs → chunk-AMVJPDM3.mjs} +1 -1
  5. package/dist/{chunk-KBEXWUKI.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  6. package/dist/chunk-CJDUN6R4.mjs +4 -0
  7. package/dist/{chunk-LAQ3QAUW.mjs → chunk-CLGBBNRB.mjs} +1 -1
  8. package/dist/{chunk-MAZGVZJN.mjs → chunk-DMCFEJ2C.mjs} +1 -1
  9. package/dist/{chunk-3E3GY7S2.mjs → chunk-FDRX3CL2.mjs} +1 -1
  10. package/dist/chunk-G34OMFQI.mjs +4 -0
  11. package/dist/{chunk-4VCL66F7.mjs → chunk-GLBQHEMQ.mjs} +1 -1
  12. package/dist/chunk-GS3P2V76.mjs +4 -0
  13. package/dist/{chunk-LITM3HU3.mjs → chunk-JGX2G2OC.mjs} +1 -1
  14. package/dist/{chunk-O24GFE6Q.mjs → chunk-KZAYLEFB.mjs} +1 -1
  15. package/dist/{chunk-5FWH5YVM.mjs → chunk-LHO4WFYP.mjs} +1 -1
  16. package/dist/{chunk-BDDEMCAH.mjs → chunk-MFCVMJBO.mjs} +1 -1
  17. package/dist/{chunk-LGBD6KGN.mjs → chunk-MIOYUP5Z.mjs} +1 -1
  18. package/dist/{chunk-KVLUT4U2.mjs → chunk-OQCMTGML.mjs} +1 -1
  19. package/dist/{chunk-MX3JKY3V.mjs → chunk-P7S6XFU4.mjs} +1 -1
  20. package/dist/chunk-R5SXUWYU.mjs +4 -0
  21. package/dist/{chunk-EUGA4BNN.mjs → chunk-TO7SVJIU.mjs} +1 -1
  22. package/dist/{chunk-ZGQC6O62.mjs → chunk-UEBQJNVT.mjs} +1 -1
  23. package/dist/{chunk-ZQG4SJ2M.mjs → chunk-ULO56RLR.mjs} +1 -1
  24. package/dist/{chunk-L3BLBPSR.mjs → chunk-WUA65ZZB.mjs} +1 -1
  25. package/dist/chunk-Y7H3EUBR.mjs +4 -0
  26. package/dist/{chunk-O5P35LEY.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  27. package/dist/components/AdvancedComponents/user-selection.d.ts +1 -1
  28. package/dist/components/AdvancedComponents/user-selection.js +1 -1
  29. package/dist/components/AdvancedComponents/user-selection.mjs +1 -1
  30. package/dist/components/Blocks/index.mjs +1 -1
  31. package/dist/components/CRM/CogeBoard.mjs +1 -1
  32. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  33. package/dist/components/CRM/index.mjs +1 -1
  34. package/dist/components/Chat/ChatInterface.mjs +1 -1
  35. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  36. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  37. package/dist/components/Chat/demo-tests.mjs +1 -1
  38. package/dist/components/Chat/demo.mjs +1 -1
  39. package/dist/components/Chat/example-usage.mjs +1 -1
  40. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  41. package/dist/components/Chat/index.mjs +1 -1
  42. package/dist/components/DeliveryLead/DeliveryLeadSubmissionWithList.mjs +1 -1
  43. package/dist/components/DeliveryLead/index.mjs +1 -1
  44. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  45. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  46. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
  47. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  48. package/dist/components/DigitalColleagues/Views/ColleaguesView.d.ts +1 -1
  49. package/dist/components/DigitalColleagues/Views/ColleaguesView.js +1 -1
  50. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  51. package/dist/components/DigitalColleagues/Views/index.js +1 -1
  52. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  53. package/dist/components/DigitalColleagues/colleague-form.d.ts +1 -1
  54. package/dist/components/DigitalColleagues/colleague-form.js +1 -1
  55. package/dist/components/DigitalColleagues/digital-colleague-clone.d.ts +1 -1
  56. package/dist/components/DigitalColleagues/digital-colleague-clone.js +1 -2
  57. package/dist/components/DigitalColleagues/digital-colleague-clone.mjs +1 -1
  58. package/dist/components/DigitalColleagues/index.js +1 -1
  59. package/dist/components/DigitalColleagues/index.mjs +1 -1
  60. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  61. package/dist/components/Foundary/MainPage.mjs +1 -1
  62. package/dist/components/Foundary/Pages/dashboardpage.d.ts +1 -1
  63. package/dist/components/Foundary/Pages/dashboardpage.js +1 -1
  64. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  65. package/dist/components/Foundary/Views/ColleaguesView.d.ts +1 -1
  66. package/dist/components/Foundary/Views/ColleaguesView.js +1 -1
  67. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  68. package/dist/components/Foundary/Views/index.js +1 -1
  69. package/dist/components/Foundary/Views/index.mjs +1 -1
  70. package/dist/components/Foundary/index.js +1 -1
  71. package/dist/components/Foundary/index.mjs +1 -1
  72. package/dist/components/HeaderFooter/Header.mjs +1 -1
  73. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  74. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  75. package/dist/components/HeaderFooter/index.mjs +1 -1
  76. package/dist/components/Heros/PostHero/index.mjs +1 -1
  77. package/dist/components/Heros/RenderHero.mjs +1 -1
  78. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  79. package/dist/components/Heros/index.mjs +1 -1
  80. package/dist/components/Layouts/SlideShow.mjs +1 -1
  81. package/dist/components/Layouts/index.mjs +1 -1
  82. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  83. package/dist/components/Menus/SidebarRight.mjs +1 -1
  84. package/dist/components/Menus/index.mjs +1 -1
  85. package/dist/components/Other/index.mjs +1 -1
  86. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  87. package/dist/components/Projects/ProjectPage.js +1 -1
  88. package/dist/components/Projects/ProjectPage.mjs +1 -1
  89. package/dist/components/Projects/ProjectView.js +1 -1
  90. package/dist/components/Projects/ProjectView.mjs +1 -1
  91. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  92. package/dist/components/Projects/TasksView.js +1 -1
  93. package/dist/components/Projects/TasksView.mjs +1 -1
  94. package/dist/components/Projects/index.js +1 -1
  95. package/dist/components/Projects/index.mjs +1 -1
  96. package/dist/components/dc-temp/index.mjs +1 -1
  97. package/dist/components/index.js +15 -15
  98. package/dist/components/index.mjs +1 -1
  99. package/dist/components/ui/index.mjs +1 -1
  100. package/dist/components/ui/sidebar.mjs +1 -1
  101. package/dist/index.js +19 -19
  102. package/dist/index.mjs +1 -1
  103. package/dist/metafile-cjs.json +1 -1
  104. package/dist/metafile-esm.json +1 -1
  105. package/dist/pages/Blog.mjs +1 -1
  106. package/dist/pages/Documentation.mjs +1 -1
  107. package/dist/pages/IndexPage.mjs +1 -1
  108. package/dist/pages/Intranet.mjs +1 -1
  109. package/dist/pages/LandingPage.mjs +1 -1
  110. package/dist/pages/Page.mjs +1 -1
  111. package/dist/pages/Publish.mjs +1 -1
  112. package/dist/pages/Website.mjs +1 -1
  113. package/dist/sections/AboutSection.mjs +1 -1
  114. package/dist/sections/BlogDetail.mjs +1 -1
  115. package/dist/sections/BlogList.mjs +1 -1
  116. package/dist/sections/BlogListSection.mjs +1 -1
  117. package/dist/sections/PageSections.mjs +1 -1
  118. package/dist/sections/PricingSection.mjs +1 -1
  119. package/dist/sections/ServiceSection.mjs +1 -1
  120. package/dist/sections/index.mjs +1 -1
  121. package/package.json +1 -1
  122. package/dist/chunk-5N4WW7O2.mjs +0 -1
  123. package/dist/chunk-DODFVGFK.mjs +0 -4
  124. package/dist/chunk-RVGPGXLB.mjs +0 -4
  125. package/dist/chunk-USOGZB6R.mjs +0 -4
  126. package/dist/chunk-XADBBCGL.mjs +0 -4
  127. package/dist/chunk-ZB7RDJRP.mjs +0 -4
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";"use client";var xr=Object.create;var ta=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Cr=Object.prototype.hasOwnProperty;var kr=(e,t)=>{for(var a in t)ta(e,a,{get:t[a],enumerable:!0})},$a=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of wr(t))!Cr.call(e,r)&&r!==a&&ta(e,r,{get:()=>t[r],enumerable:!(o=yr(t,r))||o.enumerable});return e};var ge=(e,t,a)=>(a=e!=null?xr(Nr(e)):{},$a(t||!e||!e.__esModule?ta(a,"default",{value:e,enumerable:!0}):a,e)),Sr=e=>$a(ta({},"__esModule",{value:!0}),e);var Fi={};kr(Fi,{default:()=>Qo});module.exports=Sr(Fi);var re=require("react");var ct=require("lucide-react"),dt=require("react/jsx-runtime"),Dr=[{key:"kanban",icon:ct.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:ct.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:ct.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:ct.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:ct.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],ja=({currentView:e,onViewChange:t,children:a})=>(0,dt.jsxs)("div",{className:"flex w-full h-screen",children:[(0,dt.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Dr.map(o=>{let r=o.icon,s=e===o.key;return(0,dt.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${s?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,dt.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,dt.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,dt.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,dt.jsx)("div",{className:"w-full h-full",children:a})})]});var eo=require("class-variance-authority");var Qa=require("clsx");var xa="-",Tr=e=>{let t=Rr(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let n=c.split(xa);return n[0]===""&&n.length!==1&&n.shift(),Ka(n,t)||Pr(c)},getConflictingClassGroupIds:(c,n)=>{let u=a[c]||[];return n&&o[c]?[...u,...o[c]]:u}}},Ka=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Ka(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let s=e.join(xa);return t.validators.find(({validator:c})=>c(s))?.classGroupId},Wa=/^\[(.+)\]$/,Pr=e=>{if(Wa.test(e)){let t=Wa.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Rr=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Ar(Object.entries(e.classGroups),a).forEach(([s,c])=>{ha(c,o,s,t)}),o},ha=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let s=r===""?t:_a(t,r);s.classGroupId=a;return}if(typeof r=="function"){if(Er(r)){ha(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([s,c])=>{ha(c,_a(t,s),a,o)})})},_a=(e,t)=>{let a=e;return t.split(xa).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Er=e=>e.isThemeGetter,Ar=(e,t)=>t?e.map(([a,o])=>{let r=o.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,n])=>[t+c,n])):s);return[a,r]}):e,Mr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(s,c)=>{a.set(s,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(s){let c=a.get(s);if(c!==void 0)return c;if((c=o.get(s))!==void 0)return r(s,c),c},set(s,c){a.has(s)?a.set(s,c):r(s,c)}}},qa="!",Ir=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],s=t.length,c=n=>{let u=[],p=0,d=0,g;for(let b=0;b<n.length;b++){let v=n[b];if(p===0){if(v===r&&(o||n.slice(b,b+s)===t)){u.push(n.slice(d,b)),d=b+s;continue}if(v==="/"){g=b;continue}}v==="["?p++:v==="]"&&p--}let T=u.length===0?n:n.substring(d),N=T.startsWith(qa),y=N?T.substring(1):T,M=g&&g>d?g-d:void 0;return{modifiers:u,hasImportantModifier:N,baseClassName:y,maybePostfixModifierPosition:M}};return a?n=>a({className:n,parseClassName:c}):c},Fr=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},Lr=e=>({cache:Mr(e.cacheSize),parseClassName:Ir(e),...Tr(e)}),Br=/\s+/,Or=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,s=[],c=e.trim().split(Br),n="";for(let u=c.length-1;u>=0;u-=1){let p=c[u],{modifiers:d,hasImportantModifier:g,baseClassName:T,maybePostfixModifierPosition:N}=a(p),y=!!N,M=o(y?T.substring(0,N):T);if(!M){if(!y){n=p+(n.length>0?" "+n:n);continue}if(M=o(T),!M){n=p+(n.length>0?" "+n:n);continue}y=!1}let b=Fr(d).join(":"),v=g?b+qa:b,F=v+M;if(s.includes(F))continue;s.push(F);let q=r(M,y);for(let W=0;W<q.length;++W){let C=q[W];s.push(v+C)}n=p+(n.length>0?" "+n:n)}return n};function zr(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ja(t))&&(o&&(o+=" "),o+=a);return o}var Ja=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ja(e[o]))&&(a&&(a+=" "),a+=t);return a};function Vr(e,...t){let a,o,r,s=c;function c(u){let p=t.reduce((d,g)=>g(d),e());return a=Lr(p),o=a.cache.get,r=a.cache.set,s=n,n(u)}function n(u){let p=o(u);if(p)return p;let d=Or(u,a);return r(u,d),d}return function(){return s(zr.apply(null,arguments))}}var ie=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Xa=/^\[(?:([a-z-]+):)?(.+)\]$/dt,Hr=/^\d+\/\d+$/,Ur=new Set(["px","full","screen"]),Gr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$r=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|dt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|dt|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_r=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mt=e=>Lt(e)||Ur.has(e)||Hr.test(e),vt=e=>Bt(e,"length",ei),Lt=e=>!!e&&!Number.isNaN(Number(e)),ba=e=>Bt(e,"number",Lt),Kt=e=>!!e&&Number.isInteger(Number(e)),Kr=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),O=e=>Xa.test(e),bt=e=>Gr.test(e),qr=new Set(["length","size","percentage"]),Jr=e=>Bt(e,qr,Za),Xr=e=>Bt(e,"position",Za),Zr=new Set(["image","url"]),Yr=e=>Bt(e,Zr,ai),Qr=e=>Bt(e,"",ti),qt=()=>!0,Bt=(e,t,a)=>{let o=Xa.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},ei=e=>$r.test(e)&&!jr.test(e),Za=()=>!1,ti=e=>Wr.test(e),ai=e=>_r.test(e);var oi=()=>{let e=ie("colors"),t=ie("spacing"),a=ie("blur"),o=ie("brightness"),r=ie("borderColor"),s=ie("borderRadius"),c=ie("borderSpacing"),n=ie("borderWidth"),u=ie("contrast"),p=ie("grayscale"),d=ie("hueRotate"),g=ie("invert"),T=ie("gap"),N=ie("gradientColorStops"),y=ie("gradientColorStopPositions"),M=ie("inset"),b=ie("margin"),v=ie("opacity"),F=ie("padding"),q=ie("saturate"),W=ie("scale"),C=ie("sepia"),H=ie("skew"),Q=ie("space"),ae=ie("translate"),U=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",O,t],I=()=>[O,t],nt=()=>["",mt,vt],we=()=>["auto",Lt,O],Qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],be=()=>["solid","dashed","dotted","double","none"],st=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],et=()=>["start","end","center","between","around","evenly","stretch"],ot=()=>["","0",O],tt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],h=()=>[Lt,O];return{cacheSize:500,separator:":",theme:{colors:[qt],spacing:[mt,vt],blur:["none","",bt,O],brightness:h(),borderColor:[e],borderRadius:["none","","full",bt,O],borderSpacing:I(),borderWidth:nt(),contrast:h(),grayscale:ot(),hueRotate:h(),invert:ot(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Kr,vt],inset:le(),margin:le(),opacity:h(),padding:I(),saturate:h(),scale:h(),sepia:ot(),skew:h(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",O]}],container:["container"],columns:[{columns:[bt]}],"break-after":[{"break-after":tt()}],"break-before":[{"break-before":tt()}],"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:[...Qe(),O]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[M]}],"inset-x":[{"inset-x":[M]}],"inset-y":[{"inset-y":[M]}],start:[{start:[M]}],end:[{end:[M]}],top:[{top:[M]}],right:[{right:[M]}],bottom:[{bottom:[M]}],left:[{left:[M]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kt,O]}],basis:[{basis:le()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",O]}],grow:[{grow:ot()}],shrink:[{shrink:ot()}],order:[{order:["first","last","none",Kt,O]}],"grid-cols":[{"grid-cols":[qt]}],"col-start-end":[{col:["auto",{span:["full",Kt,O]},O]}],"col-start":[{"col-start":we()}],"col-end":[{"col-end":we()}],"grid-rows":[{"grid-rows":[qt]}],"row-start-end":[{row:["auto",{span:[Kt,O]},O]}],"row-start":[{"row-start":we()}],"row-end":[{"row-end":we()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",O]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",O]}],gap:[{gap:[T]}],"gap-x":[{"gap-x":[T]}],"gap-y":[{"gap-y":[T]}],"justify-content":[{justify:["normal",...et()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...et(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...et(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],pe:[{pe:[F]}],dt:[{dt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],dt:[{dt:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",O,t]}],"min-w":[{"min-w":[O,t,"min","max","fit"]}],"max-w":[{"max-w":[O,t,"none","full","min","max","fit","prose",{screen:[bt]},bt]}],h:[{h:[O,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[O,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bt,vt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ba]}],"font-family":[{font:[qt]}],"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",O]}],"line-clamp":[{"line-clamp":["none",Lt,ba]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mt,O]}],"list-image":[{"list-image":["none",O]}],"list-style-type":[{list:["none","disc","decimal",O]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","eo-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mt,vt]}],"underline-offset":[{"underline-offset":["auto",mt,O]}],"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",O]}],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",O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Qe(),Xr]}],"bg-repeat":[{bg:["eo-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jr]}],"bg-image":[{bg:["none",{"gradient-dt":["t","tr","r","br","b","bl","dt","tl"]},Yr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-dt-pos":[{dt:[y]}],"gradient-from":[{from:[N]}],"gradient-via":[{via:[N]}],"gradient-dt":[{dt:[N]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-dt":[{"rounded-dt":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-dt":[{"border-dt":[n]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...be(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:be()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-dt":[{"border-dt":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...be()]}],"outline-offset":[{"outline-offset":[mt,O]}],"outline-w":[{outline:[mt,vt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:nt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[mt,vt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bt,Qr]}],"shadow-color":[{shadow:[qt]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...st(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":st()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",bt,O]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[q]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[q]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",O]}],duration:[{duration:h()}],ease:[{ease:["linear","in","out","in-out",O]}],delay:[{delay:h()}],animate:[{animate:["none","spin","ping","pulse","bounce",O]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[W]}],"scale-x":[{"scale-x":[W]}],"scale-y":[{"scale-y":[W]}],rotate:[{rotate:[Kt,O]}],"translate-x":[{"translate-x":[ae]}],"translate-y":[{"translate-y":[ae]}],"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",O]}],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","eo-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",O]}],"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-dt":[{"scroll-dt":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-dt":[{"scroll-dt":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",O]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mt,vt,ba]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","dt","pr","pb","pl"],px:["pr","pl"],py:["dt","pb"],m:["mx","my","ms","dt","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-dt","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"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-dt":["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-dt"],"border-w-x":["border-w-r","border-w-dt"],"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-dt"],"border-color-x":["border-color-r","border-color-dt"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-dt","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-dt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-dt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ya=Vr(oi);function w(...e){return Ya((0,Qa.clsx)(e))}var ri=(0,eo.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 de({className:e,variant:t,...a}){return(0,dt.jsx)("div",{className:w(ri({variant:t}),e),...a})}var Dt=ge(require("react"));var ne=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ne.displayName="Card";var ii=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("flex flex-col space-y-1.5 p-6",e),...t}));ii.displayName="CardHeader";var ni=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("font-semibold leading-none tracking-tight",e),...t}));ni.displayName="CardTitle";var si=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("text-sm text-muted-foreground",e),...t}));si.displayName="CardDescription";var Ot=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("p-6 dt-0",e),...t}));Ot.displayName="CardContent";var li=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("flex items-center p-6 dt-0",e),...t}));li.displayName="CardFooter";var ao=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:s=!1,height:c})=>{let n=d=>{d.preventDefault()},u=d=>{d.preventDefault(),r(t)};return(0,dt.jsxs)(ne,{className:`p-4 bg-card border-dt-4 ${(()=>{switch(t){case"todo":return"border-dt-gray-400";case"in-progress":return"border-dt-blue-500";case"review":return"border-dt-orange-500";case"done":return"border-dt-green-500";default:return"border-dt-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${s?"lg:max-w-xs":""}`,style:{height:c||"calc(100vh - 350px)"},onDragOver:n,onDrop:u,children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,dt.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${s?"text-base":"text-lg"}`,children:e}),(0,dt.jsx)(de,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,dt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Jt=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let s=d=>{a(e)},c=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},u=()=>{switch(e.type){case"story":return(0,dt.jsx)(ct.BookOpen,{className:"h-3 w-3"});case"bug":return(0,dt.jsx)(ct.Bug,{className:"h-3 w-3"});case"spike":return(0,dt.jsx)(ct.Zap,{className:"h-3 w-3"});case"task":default:return(0,dt.jsx)(ct.AlertCircle,{className:"h-3 w-3"})}},p=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return r?(0,dt.jsx)(ne,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:s,onClick:c,children:(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:u()}),(0,dt.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,dt.jsxs)(ne,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:s,onClick:c,children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,dt.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[u(),(0,dt.jsx)("span",{className:"capitalize",children:e.type})]}),(0,dt.jsxs)("div",{className:"flex gap-1",children:[(0,dt.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,dt.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,dt.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,dt.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.User,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:e.assignee?.value?.name})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.Calendar,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Xt=ge(require("react")),Ce=ge(require("@radix-ui/react-dialog"));var We=Ce.Root;var di=Ce.Portal;var ro=Xt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(Ce.Overlay,{ref:a,className:w("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ro.displayName=Ce.Overlay.displayName;var He=Xt.forwardRef(({className:e,children:t,...a},o)=>(0,dt.jsxs)(di,{children:[(0,dt.jsx)(ro,{}),(0,dt.jsxs)(Ce.Content,{ref:o,className:w("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-dt-left-1/2 data-[state=closed]:slide-out-dt-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,dt.jsxs)(Ce.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,dt.jsx)(ct.dt,{className:"h-4 w-4"}),(0,dt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));He.displayName=Ce.Content.displayName;var Ue=({className:e,...t})=>(0,dt.jsx)("div",{className:w("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ue.displayName="DialogHeader";var Zt=({className:e,...t})=>(0,dt.jsx)("div",{className:w("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zt.displayName="DialogFooter";var Ge=Xt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(Ce.Title,{ref:a,className:w("text-lg font-semibold leading-none tracking-tight",e),...t}));Ge.displayName=Ce.Title.displayName;var ci=Xt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(Ce.Description,{ref:a,className:w("text-sm text-muted-foreground",e),...t}));ci.displayName=Ce.Description.displayName;var io=require("@radix-ui/react-slot"),so=ge(require("react")),aa=(0,eo.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"}}}),k=so.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},s)=>(0,dt.jsx)(e?io.Slot:"button",{className:w(aa({className:t,size:a,variant:o})),ref:s,...r}));k.displayName="Button";var co=ge(require("react"));var Y=co.forwardRef(({className:e,type:t,...a},o)=>(0,dt.jsx)("input",{type:t,className:w("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}));Y.displayName="Input";var po=ge(require("react")),Ee=po.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("textarea",{className:w("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));Ee.displayName="Textarea";var z=ge(require("@radix-ui/react-select")),ht=ge(require("react")),Oe=z.Root;var at=z.Value,Ie=ht.forwardRef(({children:e,className:t,...a},o)=>(0,dt.jsxs)(z.Trigger,{className:w("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,dt.jsx)(z.Icon,{asChild:!0,children:(0,dt.jsx)(ct.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ie.displayName=z.Trigger.displayName;var go=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(z.ScrollUpButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,dt.jsx)(ct.ChevronUp,{className:"h-4 w-4"})}));go.displayName=z.ScrollUpButton.displayName;var fo=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(z.ScrollDownButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,dt.jsx)(ct.ChevronDown,{className:"h-4 w-4"})}));fo.displayName=z.ScrollDownButton.displayName;var Fe=ht.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,dt.jsx)(z.Portal,{children:(0,dt.jsxs)(z.Content,{className:w("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:r,...o,children:[(0,dt.jsx)(go,{}),(0,dt.jsx)(z.Viewport,{className:w("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,dt.jsx)(fo,{})]})}));Fe.displayName=z.Content.displayName;var mi=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(z.Label,{className:w("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));mi.displayName=z.Label.displayName;var se=ht.forwardRef(({children:e,className:t,...a},o)=>(0,dt.jsxs)(z.Item,{className:w("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,dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dt.jsx)(z.ItemIndicator,{children:(0,dt.jsx)(ct.Check,{className:"h-4 w-4"})})}),(0,dt.jsx)(z.ItemText,{children:e})]}));se.displayName=z.Item.displayName;var pi=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(z.Separator,{className:w("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));pi.displayName=z.Separator.displayName;var vo=ge(require("react")),ya=ge(require("@radix-ui/react-label"));var ui=(0,eo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=vo.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ya.Root,{ref:a,className:w(ui(),e),...t}));R.displayName=ya.Root.displayName;var Et=ge(require("react")),zt=ge(require("@radix-ui/react-toggle-group"));var xo=ge(require("react")),wa=ge(require("@radix-ui/react-toggle"));var Na=(0,eo.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"}}),gi=xo.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,dt.jsx)(wa.Root,{ref:r,className:w(Na({variant:t,size:a,className:e})),...o}));gi.displayName=wa.Root.displayName;var No=Et.createContext({size:"default",variant:"default"}),At=Et.forwardRef(({className:e,variant:t,size:a,children:o,...r},s)=>(0,dt.jsx)(zt.Root,{ref:s,className:w("flex items-center justify-center gap-1",e),...r,children:(0,dt.jsx)(No.Provider,{value:{variant:t,size:a},children:o})}));At.displayName=zt.Root.displayName;var Mt=Et.forwardRef(({className:e,children:t,variant:a,size:o,...r},s)=>{let c=Et.useContext(No);return(0,dt.jsx)(zt.Item,{ref:s,className:w(Na({variant:c.variant||a,size:c.size||o}),e),...r,children:t})});Mt.displayName=zt.Item.displayName;var fi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ct.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:ct.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ct.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ct.Zap}],vi=[{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"}],Vt=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:s,defaultEpicId:c})=>{let[n,u]=(0,re.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,re.useEffect)(()=>{e&&c&&u(g=>({...g,epic:c}))},[e,c]),(0,re.useEffect)(()=>{e&&u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"none",assignee:""})},[e]);let p=g=>{g.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"",assignee:""}),t())},d=(g,T)=>{u(N=>({...N,[g]:T}))};return(0,dt.jsx)(We,{open:e,onOpenChange:t,children:(0,dt.jsxs)(He,{className:"sm:max-w-md",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New Task"})}),(0,dt.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"name",children:"Task Title"}),(0,dt.jsx)(Y,{id:"name",value:n.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"description",children:"Description"}),(0,dt.jsx)(Ee,{id:"description",value:n.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Type"}),(0,dt.jsx)(At,{type:"single",value:n.type||"",onValueChange:g=>g&&d("type",g),children:fi.map(g=>{let T=g.icon;return(0,dt.jsxs)(Mt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,dt.jsx)(T,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Priority"}),(0,dt.jsx)(At,{type:"single",value:n.priority||"",onValueChange:g=>g&&d("priority",g),children:vi.map(g=>(0,dt.jsx)(Mt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"points",children:"Story Points"}),(0,dt.jsx)(Y,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:g=>d("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!c&&(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"epic",children:"Epic"}),(0,dt.jsxs)(Oe,{value:n.epic,onValueChange:g=>d("epic",g),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{placeholder:"Select an epic"})}),(0,dt.jsx)(Fe,{children:o.map(g=>(0,dt.jsx)(se,{value:g.id.toString(),children:(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,dt.jsxs)(Oe,{value:n.sprint,onValueChange:g=>d("sprint",g),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{placeholder:"Select a sprint"})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)(se,{value:"none",children:"No Sprint"}),r.map(g=>(0,dt.jsx)(se,{value:g.id.toString(),children:(0,dt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"sprint",children:"Assignee"}),(0,dt.jsxs)(Oe,{value:n.assignee,onValueChange:g=>d("assignee",g),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{placeholder:"Select an Assignee"})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)(se,{value:"none",children:"No Assignee"}),s.map(g=>(0,dt.jsx)(se,{value:g.id.toString(),children:(0,dt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,dt.jsxs)(Zt,{children:[(0,dt.jsx)(k,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,dt.jsx)(k,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var ka=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:c=!1})=>{let[n,u]=(0,re.useState)(!1),[p,d]=(0,re.useState)(""),g=()=>{c||(u(!0),d(t))},T=async()=>{p!==t&&await r(e,p),u(!1)},N=y=>{y.key==="Enter"&&!o||y.key==="Enter"&&y.ctrlKey&&o?T():y.key==="Escape"&&(u(!1),d(""))};return(0,dt.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,dt.jsx)(R,{children:a}),n?o?(0,dt.jsx)(Ee,{value:p,onChange:y=>d(y.target.value),onBlur:T,onKeyDown:N,autoFocus:!0,rows:4,className:"resize-none"}):(0,dt.jsx)(Y,{value:p,onChange:y=>d(y.target.value),onBlur:T,onKeyPress:N,autoFocus:!0,className:"text-lg font-medium"}):(0,dt.jsxs)("div",{onClick:g,className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,dt.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click dt edit..."}),!c&&(0,dt.jsx)(ct.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ra=ge(require("react")),ut=ge(require("@radix-ui/react-avatar"));var Sa=ra.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ut.Root,{ref:a,className:w("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Sa.displayName=ut.Root.displayName;var bi=ra.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ut.Image,{ref:a,className:w("aspect-square h-full w-full",e),...t}));bi.displayName=ut.Image.displayName;var Da=ra.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ut.Fallback,{ref:a,className:w("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Da.displayName=ut.Fallback.displayName;var So=({comments:e,onAddComment:t})=>{let[a,o]=(0,re.useState)(""),r=c=>c.split(" ").map(n=>n[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)(ct.MessageSquare,{className:"h-5 w-5"}),(0,dt.jsx)(R,{className:"text-lg font-medium",children:"Comments"}),(0,dt.jsx)(de,{variant:"secondary",children:e.length})]}),(0,dt.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(c=>(0,dt.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,dt.jsx)(Sa,{className:"h-8 w-8 mt-1",children:(0,dt.jsx)(Da,{className:"text-xs bg-muted text-muted-foreground",children:r(c.author)})}),(0,dt.jsxs)("div",{className:"flex-1",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,dt.jsx)("span",{className:"font-medium text-sm",children:c.author}),(0,dt.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.createdAt.toLocaleDateString()," at ",c.createdAt.toLocaleTimeString()]})]}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground",children:c.text})]})]},c.id))}),(0,dt.jsxs)("div",{className:"flex gap-2",children:[(0,dt.jsx)(Ee,{value:a,onChange:c=>o(c.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,dt.jsx)(k,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,dt.jsx)(ct.Send,{className:"h-4 w-4"})})]})]})};var sa=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:s=!1})=>{let[c,n]=(0,re.useState)(!1),u=o.find(d=>d.value===t);return(0,dt.jsxs)("div",{className:"space-y-1",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,dt.jsxs)(Oe,{value:t,onValueChange:a,open:c,onOpenChange:d=>{s||n(d)},disabled:s,children:[(0,dt.jsx)(Ie,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,dt.jsxs)(de,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&n(!c),children:[r&&u?.color&&(0,dt.jsx)("div",{className:`w-2 h-2 rounded-full ${u.color} mr-1`}),u?.label||"Select..."]})}),(0,dt.jsx)(Fe,{children:o.map(d=>(0,dt.jsx)(se,{value:d.value,children:r&&d.color?(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var To=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:s=!1,disabled:c=!1})=>{let[n,u]=(0,re.useState)(!1),[p,d]=(0,re.useState)(""),g=o.find(b=>b.value===t),T=o.filter(b=>b.label.toLowerCase().includes(p.toLowerCase())),N=b=>{a(b),u(!1),d("")},y=()=>{s&&p.trim()&&!o.find(b=>b.value===p.trim())&&(a(p.trim()),u(!1),d(""))};return(0,dt.jsxs)("div",{className:"space-y-1",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,dt.jsxs)(Oe,{value:t,onValueChange:N,open:n,onOpenChange:b=>{c||u(b)},disabled:c,children:[(0,dt.jsx)(Ie,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,dt.jsx)(de,{variant:"secondary",className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!c&&u(!n),children:g?.label||t||"Select..."})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)("div",{className:"p-2",children:(0,dt.jsx)(Y,{placeholder:r,value:p,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&s&&y()},className:"mb-2"})}),T.map(b=>(0,dt.jsx)(se,{value:b.value,children:b.label},b.value)),s&&p.trim()&&!T.find(b=>b.value===p.trim())&&(0,dt.jsxs)(se,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var ve=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var hi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ct.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:ct.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ct.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ct.Zap}],xi=[{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 Po=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:s,onDelete:c,isUpdating:n=!1,isDeleting:u=!1,deleteState:p="idle",teamMembers:d})=>{let[g,T]=(0,re.useState)(e.storyPoints),N=(0,re.useRef)(null),y=(0,re.useCallback)((v,F)=>{N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{r(v,F)},500)},[r]);(0,re.useEffect)(()=>{y("storyPoints",g?.toString()||"1")},[g]);let M=v=>v.split(" ").map(F=>F[0]).join("").toUpperCase(),b=()=>p==="loading"?(0,dt.jsxs)(k,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,dt.jsx)(ct.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,dt.jsxs)(k,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,dt.jsx)(ct.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,dt.jsxs)(k,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,dt.jsx)(ct.dt,{className:"h-3 w-3"}),"Delete failed"]}):(0,dt.jsxs)(k,{onClick:c,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||u,children:[(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,dt.jsxs)("div",{className:"flex flex-col h-full",children:[(0,dt.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Status"}),(0,dt.jsx)(sa,{label:"",value:e.status,onValueChange:v=>r("status",v),options:[{value:"todo",label:"To re"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Type"}),(0,dt.jsx)(At,{type:"single",value:e.type||"",onValueChange:v=>v&&r("type",v),className:"grid grid-cols-2 gap-1",disabled:n,children:hi.map(v=>{let F=v.icon;return(0,dt.jsxs)(Mt,{value:v.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:n,children:[(0,dt.jsx)(F,{className:"h-3 w-3"}),v.label]},v.value)})})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,dt.jsx)(At,{type:"single",value:e.priority||"",onValueChange:v=>v&&r("priority",v),className:"grid grid-cols-3 gap-1",disabled:n,children:xi.map(v=>(0,dt.jsx)(Mt,{value:v.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:v.label},v.value))})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,dt.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:v=>{let F=Number(v.target.value);F<1?T(1):F>100?T(100):T(F)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,dt.jsx)(sa,{label:"",value:ve(e.epic).toString(),onValueChange:v=>r("epicId",v),options:(t||[]).map(v=>({value:v.id.toString(),label:v?.name,color:v.color})),showColor:!0,disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,dt.jsx)(sa,{label:"",value:ve(e.sprint).toString()||"none",onValueChange:v=>r("sprintId",v==="none"?"":v),options:[{value:"none",label:"No Sprint"},...(a||[]).map(v=>({value:v.id.toString(),label:`${v?.name}`}))],disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,dt.jsx)(To,{label:"",value:e.assignee?.value?.name,onValueChange:v=>r("assignee",v),options:d.map(v=>({value:`${typeof v.email=="string"?"users":"digital-colleagues"}:${v.id}`,label:v?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,dt.jsxs)("div",{className:"mt-auto dt-4 space-y-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(k,{onClick:s,variant:"outline",className:"w-full h-8 text-xs",disabled:n||u,children:"Close"}),b()]}),(0,dt.jsxs)("div",{className:"dt-4 border-t border-border space-y-2",children:[(0,dt.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.User,{className:"h-3 w-3"}),(0,dt.jsx)("span",{children:"System"})]})]}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.Calendar,{className:"h-3 w-3"}),(0,dt.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.Clock,{className:"h-3 w-3"}),(0,dt.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Ro=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:s,onDeleteTask:c,onAddComment:n,colleagues:u})=>{let[p,d]=(0,re.useState)(a),[g,T]=(0,re.useState)(new Date),[N,y]=(0,re.useState)("idle"),[M,b]=(0,re.useState)("idle"),[v,F]=(0,re.useState)([]);(0,re.useEffect)(()=>{d(a)},[a]);let q=async(_,le)=>{if(le!==p[_]){y("loading");try{let I=await s(p.id.toString(),{[_]:le});d(I),T(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch(I){console.log("error",I),y("error"),setTimeout(()=>y("idle"),3e3)}}},W=async(_,le)=>{if(le!==p[_]){y("loading");try{let I=await s(p.id.toString(),{[_]:le});d(I),T(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},C=async _=>{if(n){y("loading");try{let le=await n?.({content:_,taskId:p.id.toString()});d(le),T(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},H=async()=>{b("loading");try{await c(p.id.toString()),b("success"),setTimeout(()=>{t(),b("idle")},1e3)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}},Q=N!=="loading"&&M!=="loading",ae=()=>{Q&&t()},U=()=>N==="loading"?(0,dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,dt.jsx)(ct.Loader2,{className:"h-4 w-4 animate-spin"}),(0,dt.jsx)("span",{children:"Updating..."})]}):N==="success"?(0,dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,dt.jsx)(ct.Check,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:"Updated successfully"})]}):N==="error"?(0,dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,dt.jsx)(ct.dt,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:"Update failed"})]}):null;return(0,dt.jsx)(We,{open:e,onOpenChange:ae,children:(0,dt.jsxs)(He,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,dt.jsxs)(Ue,{children:[(0,dt.jsx)(Ge,{className:"sr-only",children:p.name}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("div",{className:"flex-1",children:U()}),!Q&&(0,dt.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,dt.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,dt.jsx)(ka,{fieldName:"name",value:p.name||"",label:"",onSave:q,className:"border-b border-border pb-3",disabled:N==="loading"}),(0,dt.jsx)(ka,{fieldName:"description",value:p.description||"",label:"Description",multiline:!0,onSave:q,disabled:N==="loading"}),(0,dt.jsx)(So,{comments:(p?.comments||[]).map(_=>({author:_.author.value.name||"",createdAt:new Date(_.timestamp),text:_.text,id:_.id||""})),onAddComment:C})]}),(0,dt.jsx)(Po,{task:p,epics:o,sprints:r,lastUpdated:g,onUpdateTask:W,onClose:ae,onDelete:H,isUpdating:N==="loading",isDeleting:M==="loading",deleteState:M,teamMembers:u})]})]})})};var Ut=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,re.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}),s=["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"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],u=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(d,g)=>{r(T=>({...T,[d]:g}))};return(0,dt.jsx)(We,{open:e,onOpenChange:t,children:(0,dt.jsxs)(He,{className:"sm:max-w-md",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New Epic"})}),(0,dt.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"name",children:"Epic Name"}),(0,dt.jsx)(Y,{id:"name",value:o.name,onChange:d=>p("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"description",children:"Description"}),(0,dt.jsx)(Ee,{id:"description",value:o.description,onChange:d=>p("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Color"}),(0,dt.jsx)("div",{className:"flex gap-2 flex-wrap",children:s.map(d=>(0,dt.jsx)("button",{type:"button",onClick:()=>p("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Confidence"}),(0,dt.jsxs)(Oe,{value:o.confidence,onValueChange:d=>p("confidence",d),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{})}),(0,dt.jsx)(Fe,{children:c.map(d=>(0,dt.jsx)(se,{value:d.value,children:d.label},d.value))})]})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Phase"}),(0,dt.jsxs)(Oe,{value:o.phase.toString(),onValueChange:d=>p("phase",parseInt(d)),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{})}),(0,dt.jsx)(Fe,{children:n.map(d=>(0,dt.jsx)(se,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Start Date"}),(0,dt.jsx)(Y,{type:"date",value:o.startDate,onChange:d=>p("startDate",d.target.value)})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"End Date"}),(0,dt.jsx)(Y,{type:"date",value:o.endDate,onChange:d=>p("endDate",d.target.value)})]})]}),(0,dt.jsxs)(Zt,{children:[(0,dt.jsx)(k,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,dt.jsx)(k,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Mo=require("motion/react");function Ao(e,t){let[a,o]=(0,re.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,re.useEffect)(()=>{r(a)},[]),[a,r]}var da=require("react-icons/fa");function rt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:c,className:n}){let[u,p]=Ao(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||u;return(0,dt.jsxs)(Mo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${n||""}`,children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,dt.jsx)(de,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,dt.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,dt.jsx)(k,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,dt.jsx)("button",{"aria-label":u?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!u),style:{lineHeight:0},children:u?(0,dt.jsx)(da.FaChevronDown,{size:22}):(0,dt.jsx)(da.FaChevronUp,{size:22})})]})]}),!d&&(0,dt.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,dt.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,dt.jsx)(k,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,dt.jsx)(k,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),c&&(0,dt.jsx)("div",{className:"hidden lg:block",children:c})]})]})}var Io=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:s=[],onAddTask:c,onUpdateTask:n,onDeleteTask:u,onTaskClick:p,onAddEpic:d,onAddComment:g})=>{let[T,N]=(0,re.useState)(e),[y,M]=(0,re.useState)(t),[b,v]=(0,re.useState)(a),[F,q]=(0,re.useState)(!1),[W,C]=(0,re.useState)(!1),[H,Q]=(0,re.useState)(null),[ae,U]=(0,re.useState)(null),[_,le]=(0,re.useState)(o),[I,nt]=(0,re.useState)(r),[we,Qe]=(0,re.useState)(0),be=(0,re.useRef)(null),st=(0,re.useRef)(null),et=y.filter(A=>!0).map(A=>A.id),ot=b.find(A=>A.isSelected);et.push(0),(0,re.useEffect)(()=>{N(e)},[e]),(0,re.useEffect)(()=>{M(t)},[t]),(0,re.useEffect)(()=>{v(a)},[a]),(0,re.useEffect)(()=>{let A=()=>{if(be.current){let Te=be.current.offsetHeight;Qe(Te)}};A();let Z=new ResizeObserver(A);be.current&&Z.observe(be.current);let te=()=>{setTimeout(A,100)};return window.addEventListener("storage",te),()=>{Z.disconnect(),window.removeEventListener("storage",te)}},[]),(0,re.useEffect)(()=>{let A=setTimeout(()=>{be.current&&Qe(be.current.offsetHeight)},300);return()=>clearTimeout(A)},[F,W]);let tt=T.filter(A=>!0),h=A=>tt.filter(Z=>Z.status===A),K=A=>{let Z={};return y.forEach(te=>{Z[te.id]=A.filter(Te=>ve(Te.epic)===te.id)}),Z["eo-epic"]=A.filter(te=>!ve(te.epic)),Z},pe=A=>{U(A)},_e=A=>{ae&&(N(Z=>Z.map(te=>te.id===ae.id?{...te,status:A}:te)),n?.(ae.id.toString(),{status:A}),U(null))},ee=A=>{let Z={...A,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};N(te=>[...te,Z]),c?.(A)},$e=async(A,Z)=>{if(N(Te=>Te.map(Me=>Me.id===Number(A)?{...Me,...Z}:Me)),n)return await n(A,Z);let te=T.find(Te=>Te.id===Number(A));if(!te)throw new Error("Task not found");return{...te,...Z}},$t=async A=>{N(Z=>Z.filter(te=>te.id!==Number(A))),H?.id===Number(A)&&Q(null),u&&await u(A)},lt=A=>{let Z={...A,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};M(te=>[...te,Z]),d?.(A)},Ft=A=>{Q(A),p?.(A)},ft=[{id:"todo",title:"To re",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],kt=we>0?`calc(100vh - ${we+120}px)`:"calc(100vh - 12rem)";return(0,dt.jsxs)("div",{ref:st,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,dt.jsx)("div",{ref:be,className:"flex-shrink-0",children:(0,dt.jsx)(rt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-dt-r from-purple-600 via-violet-600 dt-indigo-600",primaryAction:{label:"Add task",onClick:()=>q(!0)},secondaryAction:{label:"Add epic",onClick:()=>C(!0)}})}),(0,dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,dt.jsx)("div",{className:"h-full",style:{height:we>0?`calc(100vh - ${we+120}px)`:"calc(100vh - 12rem)"},children:(0,dt.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:ft.map(A=>{let Z=h(A.status),te=K(Z);return(0,dt.jsxs)(ao,{title:A.title,status:A.status,taskCount:Z.length,onDrop:_e,isCompact:A.status==="done",height:kt,children:[te["eo-epic"].map(Te=>(0,dt.jsx)(Jt,{epic:null,task:Te,onDragStart:pe,onTaskClick:Ft,isCompact:A.status==="done"})),et.map(Te=>{let Me=y.find(x=>x.id===Te),m=te[Te]||[];return m.length===0?null:(0,dt.jsxs)("div",{className:"mb-6",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${Me?.color}`}),(0,dt.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Me?.name||"No Epic"}),(0,dt.jsx)(de,{variant:"secondary",className:"text-xs",children:m.length})]})," ",(0,dt.jsx)("div",{className:"space-y-3",children:m.map(x=>(0,dt.jsx)(Jt,{task:x,epic:Me,onDragStart:pe,onTaskClick:Ft,isCompact:A.status==="done"},x.id))})]},Te)})]},A.id)})})})}),(0,dt.jsx)(Vt,{isOpen:F,onClose:()=>q(!1),onAddTask:ee,assignees:[...I,..._],epics:y,sprints:b}),(0,dt.jsx)(Ut,{isOpen:W,onClose:()=>C(!1),onAddEpic:lt}),H&&(0,dt.jsx)(Ro,{isOpen:!!H,onClose:()=>Q(null),initialTask:H,epics:y,sprints:b,onUpdateTask:$e,onDeleteTask:$t,colleagues:[...I,..._],onAddComment:g})]})};var Fo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:s,onAddEpic:c,onUpdateEpic:n,onDeleteEpic:u})=>{let[p,d]=(0,re.useState)(t),[g,T]=(0,re.useState)(null),[N,y]=(0,re.useState)(null),[M,b]=(0,re.useState)({}),[v,F]=(0,re.useState)(0),[q,W]=(0,re.useState)(!1),[C,H]=(0,re.useState)(!1),[Q,ae]=(0,re.useState)(null),U=(0,re.useRef)(null),_=(0,re.useRef)(null);(0,re.useEffect)(()=>{d(t)},[t]),(0,re.useEffect)(()=>{let h=()=>{if(U.current){let _e=U.current.offsetHeight;F(_e)}};h();let K=new ResizeObserver(h);U.current&&K.observe(U.current);let pe=()=>{setTimeout(h,100)};return window.addEventListener("storage",pe),()=>{K.disconnect(),window.removeEventListener("storage",pe)}},[]),(0,re.useEffect)(()=>{let h=setTimeout(()=>{U.current&&F(U.current.offsetHeight)},300);return()=>clearTimeout(h)},[N]);let le=h=>{T(h)},I=h=>{h.preventDefault()},nt=(h,K)=>{h.preventDefault(),g&&ve(g.epic).toString()!==K&&(o(g.id.toString(),{epic:Number(K)}),T(null))},we=h=>e.filter(K=>ve(K.epic).toString()===h),Qe=h=>{y(h.id.toString()),b({name:h.name,description:h.description,confidence:h.confidence,phase:h.phase})},be=async()=>{N&&M.name&&(await n(N.toString(),M),d(h=>h.map(K=>K.id.toString()===N?{...K,...M}:K)),y(null),b({}))},st=()=>{y(null),b({})},et=async h=>{window.confirm("Are you sure you want dt delete this epic? This will also delete all associated tasks.")&&(await u(h),d(K=>K.filter(pe=>pe.id.toString()!==h)))},ot=h=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[h]||`Phase ${h}`,tt=h=>{switch(h){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsxs)("div",{ref:_,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,dt.jsx)("div",{ref:U,className:"flex-shrink-0",children:(0,dt.jsx)(rt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-dt-r from-rose-600 via-pink-600 dt-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>W(!0)}})}),(0,dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,dt.jsx)("div",{className:"h-full overflow-y-auto",style:{height:v>0?`calc(100vh - ${v+120}px)`:"calc(100vh - 12rem)"},children:(0,dt.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:p.map(h=>{let K=we(h.id.toString()),pe=K.reduce((ee,$e)=>ee+($e.storyPoints||0),0),_e=v>0?`calc(100vh - ${v+200}px)`:"calc(100vh - 14rem)";return(0,dt.jsxs)(ne,{className:`flex flex-col ${N===h.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:N===h.id.toString()?"auto":_e,minHeight:"400px"},onDragOver:I,onDrop:ee=>nt(ee,h.id.toString()),children:[(0,dt.jsx)("div",{className:"p-4 border-b border-border",children:N===h.id.toString()?(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)(Y,{value:M.name||"",onChange:ee=>b({...M,name:ee.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,dt.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:be,className:"p-1 h-8 w-8",children:(0,dt.jsx)(ct.Check,{className:"h-4 w-4"})}),(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:st,className:"p-1 h-8 w-8",children:(0,dt.jsx)(ct.dt,{className:"h-4 w-4"})})]})]}),(0,dt.jsx)(Ee,{value:M.description||"",onChange:ee=>b({...M,description:ee.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,dt.jsxs)("select",{value:M.confidence||h.confidence,onChange:ee=>b({...M,confidence:ee.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,dt.jsx)("option",{value:"low",children:"Low"}),(0,dt.jsx)("option",{value:"medium",children:"Medium"}),(0,dt.jsx)("option",{value:"high",children:"High"})]})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,dt.jsx)("select",{value:M.phase?.toString()||h.phase.toString(),onChange:ee=>b({...M,phase:parseInt(ee.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(ee=>(0,dt.jsxs)("option",{value:ee.toString(),children:["Phase ",ee]},ee))})]})]})]}):(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,dt.jsx)("div",{className:`w-4 h-4 rounded-full ${h.color}`}),(0,dt.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:h.name}),(0,dt.jsxs)("div",{className:"flex gap-1",children:[(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>Qe(h),className:"p-1 h-8 w-8",children:(0,dt.jsx)(ct.Edit2,{className:"h-3 w-3"})}),(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>et(h.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"})})]})]}),(0,dt.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,dt.jsxs)(de,{className:`text-xs ${tt(h.confidence)}`,children:[h.confidence," confidence"]}),(0,dt.jsxs)(de,{variant:"outline",className:"text-xs",children:["Phase ",h.phase]}),(0,dt.jsxs)(de,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,dt.jsxs)(de,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[pe," pts"]})]}),h.description&&(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:h.description}),(0,dt.jsxs)(k,{onClick:()=>{H(!0),ae(h)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,dt.jsx)(ct.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,dt.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,dt.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:K.length===0?(0,dt.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,dt.jsx)(ct.Move,{className:"h-8 w-8 mb-2"}),(0,dt.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(ee=>(0,dt.jsx)(Jt,{task:ee,epic:h,onDragStart:le,onTaskClick:r,isCompact:!0},ee.id))})})]},h.id)})})})})]}),(0,dt.jsx)(Ut,{isOpen:q,onClose:()=>W(!1),onAddEpic:c}),(0,dt.jsx)(Vt,{isOpen:C,onClose:()=>H(!1),onAddTask:s,assignees:[],epics:[],defaultEpicId:Q?.id.toString()||"",sprints:a})]})};var Lo=require("react-day-picker");function ca({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,dt.jsx)(Lo.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:w("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center dt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:w(aa({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:w("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-dt-md first:[&:has([aria-selected])]:rounded-dt-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:w(aa({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}ca.displayName="Calendar";var Oo=ge(require("react")),it=ge(require("@radix-ui/react-popover"));var Ra=it.Root,Ea=it.Trigger;var ma=Oo.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,dt.jsx)(it.Portal,{children:(0,dt.jsx)(it.Content,{ref:r,align:t,sideOffset:a,className:w("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));ma.displayName=it.Content.displayName;var Ma=require("date-fns");var Vo=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,re.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),s=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},c=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,$.jsx)(We,{open:e,onOpenChange:c,children:(0,$.jsxs)(He,{className:"sm:max-w-md",children:[(0,$.jsx)(Ue,{children:(0,$.jsx)(Ge,{children:"Add New Sprint"})}),(0,$.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"name",children:"Sprint Name *"}),(0,$.jsx)(Y,{id:"name",value:o.name,onChange:n=>r(u=>({...u,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{htmlFor:"description",children:"Description"}),(0,$.jsx)(Ee,{id:"description",value:o.description,onChange:n=>r(u=>({...u,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,$.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"Start Date *"}),(0,$.jsxs)(Ra,{children:[(0,$.jsx)(Ea,{asChild:!0,children:(0,$.jsxs)(k,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,$.jsx)(ct.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ma.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,$.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(ca,{mode:"single",selected:o.startDate,onSelect:n=>r(u=>({...u,startDate:n})),initialFocus:!0})})]})]}),(0,$.jsxs)("div",{className:"space-y-2",children:[(0,$.jsx)(R,{children:"End Date *"}),(0,$.jsxs)(Ra,{children:[(0,$.jsx)(Ea,{asChild:!0,children:(0,$.jsxs)(k,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,$.jsx)(ct.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ma.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,$.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,$.jsx)(ca,{mode:"single",selected:o.endDate,onSelect:n=>r(u=>({...u,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,$.jsxs)("div",{className:"flex justify-end gap-3 dt-4",children:[(0,$.jsx)(k,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),(0,$.jsx)(k,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Ho=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:s,onUpdateSprint:c,onDeleteSprint:n})=>{let[u,p]=(0,re.useState)([]),[d,g]=(0,re.useState)(new Set),[T,N]=(0,re.useState)(null),[y,M]=(0,re.useState)(!1),[b,v]=(0,re.useState)(null),[F,q]=(0,re.useState)(null),[W,C]=(0,re.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[H,Q]=(0,re.useState)([]),[ae,U]=(0,re.useState)("upcoming"),[_,le]=(0,re.useState)(!1),[I,nt]=(0,re.useState)(0),we=(0,re.useRef)(null),Qe=(0,re.useRef)(null);(0,re.useEffect)(()=>{let m=()=>{we.current&&nt(we.current.offsetHeight)};m();let x=new ResizeObserver(m);return we.current&&x.observe(we.current),()=>x.disconnect()},[]);let be=m=>t.find(x=>x.id===Number(m)),st=m=>a.find(x=>x.id===Number(m)),et=m=>{let x={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return x[m]||x.medium},ot=m=>{if(!m||m?.length===0)return"";let x=m?.trim().split(" ");if(x?.length===1)return x[0];let G=x[0],J=x[x.length-1][0].toUpperCase();return`${G} ${J}`},tt=m=>{let x={},G=[];return m.forEach(J=>{J.epic?(x[ve(J.epic)]||(x[ve(J.epic)]=[]),x[ve(J.epic)].push(J)):G.push(J)}),{tasksByEpic:x,unassignedTasks:G}};(0,re.useEffect)(()=>{Q(a)},[a]);let h=H.filter(m=>{switch(ae){default:return!0}}),K=H.filter(m=>u.includes(m.id.toString())),pe=e.filter(m=>!m.sprint||m.status==="backlog"),_e=pe.reduce((m,x)=>m+(x.storyPoints||0),0),ee=m=>{p(x=>x.includes(m)?x.filter(G=>G!==m):x?.length<3?[...x,m]:x)},$e=m=>{g(x=>{let G=new Set(x);return G.has(m)?G.delete(m):G.add(m),G})},$t=m=>{s(m),M(!1)},lt=m=>{q(m.id.toString()),C({name:m.name,description:m.description||"",startDate:m.startDate?new Date(m.startDate).toISOString().split("T")[0]:m.startDate,endDate:m.endDate?new Date(m.endDate).toISOString().split("T")[0]:m.endDate,isActive:!1})},Ft=()=>{F&&(c(F,{name:W.name,description:W.description,startDate:W.startDate,endDate:W.endDate}),Q(m=>m.map(x=>(x.id===Number(F)&&(x.name=W.name,x.description=W.description,x.startDate=W.startDate,x.endDate=W.endDate),x))),q(null))},ft=()=>{q(null),C({name:"",description:"",startDate:"",endDate:"",isActive:!1})},kt=(m,x)=>{N(x),m.dataTransfer.effectAllowed="move"},A=m=>{m.preventDefault(),m.dataTransfer.dropEffect="move"},Z=m=>{v(m)},te=()=>{v(null)},Te=(m,x)=>{if(m.preventDefault(),v(null),!T)return;(ve(T.sprint)||void 0)!==Number(x)&&o(T.id.toString(),{sprint:Number(x)}),N(null)},Me=({task:m,showSprint:x=!1})=>{let G=m.epic?be(ve(m.epic).toString()):null,J=m.sprint?st(ve(m.sprint).toString()):null;return(0,dt.jsx)(ne,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:Be=>{Be.dataTransfer.effectAllowed="move",Be.dataTransfer.setData("text/plain",m.id.toString()),kt(Be,m)},onClick:Be=>{T===null&&r(m)},style:{userSelect:"none"},children:(0,dt.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,dt.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,dt.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:m.name}),(0,dt.jsx)(de,{className:`text-xs ${et(m.priority||"medium")}`,children:m.priority?.[0]?.toUpperCase()})]}),(0,dt.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-1",children:[G&&(0,dt.jsx)("div",{className:`w-2 h-2 rounded-full ${G.color}`}),(0,dt.jsx)("span",{className:"text-muted-foreground truncate",children:G?.name})]}),(0,dt.jsx)("span",{className:"text-muted-foreground",children:ot(m.assignee?.value?.name)})]}),x&&J&&(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.Calendar,{className:"h-3 w-3"}),(0,dt.jsx)("span",{children:J.name})]})]})})};return(0,dt.jsxs)("div",{ref:Qe,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,dt.jsx)("div",{ref:we,className:"flex-shrink-0",children:(0,dt.jsx)(rt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-dt-r from-orange-600 via-amber-600 dt-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>M(!0)}})}),(0,dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,dt.jsxs)("div",{className:"h-full",style:{height:I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)"},children:[(0,dt.jsxs)("div",{className:"mb-4",children:[(0,dt.jsx)(ne,{className:"p-3 bg-card shadow-sm",children:(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,dt.jsxs)("p",{className:"text-xs text-muted-foreground",children:[u?.length,"/3 selected"]})]}),u?.length>0&&(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,dt.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(m=>(0,dt.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,dt.jsx)("span",{className:"max-w-[80px] truncate",children:m.name}),(0,dt.jsx)("button",{onClick:()=>ee(m.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,dt.jsx)(ct.dt,{className:"h-4 w-4"})})]},m.id))})]})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsxs)(k,{onClick:()=>M(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,dt.jsx)(ct.Plus,{className:"h-3 w-3"}),"Add"]}),(0,dt.jsxs)(k,{onClick:()=>le(!_),variant:"outline",size:"sm",className:"gap-1",children:[(0,dt.jsx)(ct.Calendar,{className:"h-3 w-3"}),_?"Close":"Select"]})]})]})}),_&&(0,dt.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>le(!1)}),(0,dt.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-dt shadow-xl z-10 transition-all duration-300 ease-in-out ${_?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,dt.jsxs)(ne,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,dt.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,dt.jsx)(k,{variant:"ghost",size:"sm",onClick:()=>le(!1),className:"h-8 w-8 p-0",children:(0,dt.jsx)(ct.dt,{className:"h-4 w-4"})})]}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up dt 3 sprints dt view in your planning board"})]}),(0,dt.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,dt.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(m=>(0,dt.jsxs)(k,{variant:ae===m.key?"default":"outline",size:"sm",onClick:()=>U(m.key),className:"text-xs h-8 px-3 flex-1",children:[m.label," (",m.count,")"]},m.key))}),(0,dt.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:h.length>0?h.map(m=>{let x=u.includes(m.id.toString()),G=e.filter(Pe=>ve(Pe.sprint)===m.id).length,J=!x&&u.length<3;return(0,dt.jsx)("div",{className:`p-3 rounded-lg border transition-all ${x?"bg-primary/10 border-primary/30":J?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:F===m.id.toString()?(0,dt.jsxs)("div",{className:"space-y-3",children:[(0,dt.jsx)(Y,{value:W.name,onChange:Pe=>C(Re=>({...Re,name:Pe.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,dt.jsx)(Ee,{value:W.description,onChange:Pe=>C(Re=>({...Re,description:Pe.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,dt.jsxs)("div",{className:"flex gap-2",children:[(0,dt.jsxs)(k,{size:"sm",onClick:()=>Ft(),className:"flex-1",children:[(0,dt.jsx)(ct.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,dt.jsxs)(k,{size:"sm",variant:"outline",onClick:ft,className:"flex-1",children:[(0,dt.jsx)(ct.dt,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,dt.jsxs)("div",{children:[(0,dt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,dt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,dt.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:m.name}),(0,dt.jsx)(de,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,dt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:m.description}),(0,dt.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,dt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.CalendarDays,{className:"h-3 w-3"}),new Date(m.startDate).toLocaleDateString()]}),(0,dt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.User,{className:"h-3 w-3"}),G," tasks"]})]})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>lt(m),className:"h-6 w-6 p-0",children:(0,dt.jsx)(ct.Edit2,{className:"h-3 w-3"})}),(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"})})]})]}),(0,dt.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,dt.jsx)(k,{variant:x?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>ee(m.id.toString()),disabled:!x&&u?.length>=3,children:(0,dt.jsx)("span",{className:"pointer-events-none select-none",children:x?"Deselect":u?.length>=3?"Limit Reached":"Select"})})})]})},m.id)}):(0,dt.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,dt.jsx)(ct.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,dt.jsxs)("p",{className:"text-sm",children:['No sprints found for "',ae,'" filter']}),(0,dt.jsx)(k,{variant:"link",size:"sm",onClick:()=>U("all"),className:"text-xs",children:"Show all sprints"})]})}),u?.length===0&&(0,dt.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,dt.jsxs)("div",{className:"text-center",children:[(0,dt.jsx)(ct.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints dt start planning"}),(0,dt.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up dt 3 sprints dt view alongside your backlog"})]})})]})]})})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,dt.jsx)("div",{className:"lg:col-span-1",children:(0,dt.jsxs)(ne,{className:"p-4 h-full bg-card border-dt-4 border-dt-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:A,onDragEnter:()=>Z("backlog"),onDragLeave:te,onDrop:m=>Te(m,"backlog"),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,dt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsxs)(de,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[pe?.length," tasks"]}),(0,dt.jsxs)(de,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[_e," pts"]})]})]}),(0,dt.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${b==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:m,unassignedTasks:x}=tt(pe);return(0,dt.jsxs)(dt.Fragment,{children:[Object.entries(m).map(([G,J])=>{let Pe=be(G);if(!Pe)return null;let Re=d.has(G);return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>$e(G),children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${Pe.color}`}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:Pe.name}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",J?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:Re?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:J.map(Be=>(0,dt.jsx)(Me,{task:Be},Be.id))})]},G)}),x?.length>0&&(()=>{let G=d.has("eo-epic");return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>$e("eo-epic"),children:[(0,dt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",x?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:G?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!G&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:x?.map(J=>(0,dt.jsx)(Me,{task:J},J.id))})]})})(),pe?.length===0&&(0,dt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here dt move dt backlog"}),pe?.length>0&&Object.keys(m).length===0&&x.length===0&&(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),pe?.map(G=>(0,dt.jsx)(Me,{task:G},G.id))]})]})})()})]})}),K.map(m=>{let x=e.filter(J=>ve(J?.sprint)===m.id),G=x.reduce((J,Pe)=>J+(Pe?.storyPoints||0),0);return(0,dt.jsxs)(ne,{className:"p-4 h-full bg-card border-dt-4 border-dt-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:A,onDragEnter:()=>Z(m.id.toString()),onDragLeave:te,onDrop:J=>Te(J,m.id.toString()),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,dt.jsx)("div",{children:(0,dt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:m.name})}),(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsxs)(de,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[x?.length," tasks"]}),(0,dt.jsxs)(de,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[G," pts"]}),(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>{le(!0),lt(m)},className:"h-6 px-2",children:(0,dt.jsx)(ct.Edit2,{className:"h-3 w-3"})}),(0,dt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"})})]})]}),(0,dt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:J,unassignedTasks:Pe}=tt(x);return(0,dt.jsxs)(dt.Fragment,{children:[Object.entries(J).map(([Re,Be])=>{let jt=be(Re);if(!jt)return null;let Wt=d.has(Re);return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>$e(Re),children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${jt.color}`}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:jt.name}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",Be?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:Wt?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Wt&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:Be?.map(_t=>(0,dt.jsx)(Me,{task:_t},_t.id))})]},Re)}),Pe?.length>0&&(()=>{let Re=d.has("eo-epic");return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>$e("eo-epic"),children:[(0,dt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",Pe?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:Re?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:Pe?.map(Be=>(0,dt.jsx)(Me,{task:Be},Be.id))})]})})(),x?.length===0&&(0,dt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},m.id)})]}),(0,dt.jsx)(Vo,{isOpen:y,onClose:()=>M(!1),onAddSprint:$t})]})})]})};var yi=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),wi=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})},Ia=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,s]=t.split(":");o.setHours(parseInt(r),parseInt(s))}return o<a},Fa=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ni=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Ci=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,s]=(0,re.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[c,n]=(0,re.useState)(!1),u=d=>{if(d.preventDefault(),!e.find(N=>N?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let T={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(T),o(!1),s({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,re.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let p=e.filter(Boolean);return(0,dt.jsx)(We,{open:a,onOpenChange:o,children:(0,dt.jsxs)(He,{className:"max-w-2xl",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New Reminder"})}),(0,dt.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,dt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"title",children:"Title"}),(0,dt.jsx)(Y,{id:"title",value:r.title,onChange:d=>s({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"description",children:"Description"}),(0,dt.jsx)(Ee,{id:"description",value:r.description,onChange:d=>s({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"dueDate",children:"Due Date"}),(0,dt.jsx)(Y,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>s({...r,dueDate:d.target.value}),required:!0})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,dt.jsx)(Y,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>s({...r,dueTime:d.target.value})})]})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{className:`${c?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,dt.jsxs)(Oe,{value:r.colleagueId,onValueChange:d=>{s({...r,colleagueId:d})},required:!0,children:[(0,dt.jsx)(Ie,{className:`${c?"text-destructive border-red-500":""}`,children:(0,dt.jsx)(at,{className:`${c?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,dt.jsx)(Fe,{children:p.map(d=>(0,dt.jsx)(se,{value:d.id.toString(),children:d.name},d.id))})]}),c&&(0,dt.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,dt.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>s({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,dt.jsx)(R,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,dt.jsxs)(Oe,{value:r.recurrencePattern,onValueChange:d=>s({...r,recurrencePattern:d}),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)(se,{value:"daily",children:"Daily"}),(0,dt.jsx)(se,{value:"weekly",children:"Weekly"}),(0,dt.jsx)(se,{value:"monthly",children:"Monthly"}),(0,dt.jsx)(se,{value:"yearly",children:"Yearly"})]})]})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"recurrenceInterval",children:"Every"}),(0,dt.jsx)(Y,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>s({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,dt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,dt.jsx)(k,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,dt.jsx)(k,{type:"submit",children:"Add Reminder"})]})]})]})})},ki=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[s,c]=(0,re.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=p=>{p.preventDefault(),a(e.id.toString(),{title:s.title,description:s.description,dueDate:new Date(s.dueDate||"").toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring}),r()},u=t.filter(Boolean);return(0,dt.jsx)(We,{open:o,onOpenChange:r,children:(0,dt.jsxs)(He,{className:"max-w-2xl",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Edit Reminder"})}),(0,dt.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,dt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-title",children:"Title"}),(0,dt.jsx)(Y,{id:"edit-title",value:s.title,onChange:p=>c({...s,title:p.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-description",children:"Description"}),(0,dt.jsx)(Ee,{id:"edit-description",value:s.description||"",onChange:p=>c({...s,description:p.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,dt.jsx)(Y,{id:"edit-dueDate",type:"date",value:s.dueDate,onChange:p=>c({...s,dueDate:p.target.value}),required:!0})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,dt.jsx)(Y,{id:"edit-dueTime",type:"time",value:s.dueTime,onChange:p=>c({...s,dueTime:p.target.value})})]})]}),(0,dt.jsx)("div",{className:"space-y-2",children:(0,dt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,dt.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:s.isRecurring||!1,onChange:p=>c({...s,isRecurring:p.target.checked}),className:"rounded border-border"}),(0,dt.jsx)(R,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,dt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,dt.jsx)(k,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,dt.jsx)(k,{type:"submit",children:"Save Changes"})]})]})]})})},Si=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,s]=(0,re.useState)(!1);if(!e||!e.id)return null;let c=Ia(new Date(e.dueDate||""),e.dueTime||""),n=Fa(new Date(e.dueDate||"")),u=Ni(new Date(e.dueDate||"")),p=()=>{a(e.id.toString(),{})},d=()=>n?"Today":u?"Tomorrow":yi(new Date(e.dueDate||""));return(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(ki,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>s(!1)}),(0,dt.jsx)(ne,{children:(0,dt.jsx)(Ot,{className:"p-4",children:(0,dt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,dt.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,dt.jsx)("button",{onClick:p,className:"mt-1 text-primary hover:text-primary/80"}),(0,dt.jsxs)("div",{className:"flex-1",children:[(0,dt.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,dt.jsx)("h3",{children:e.title})}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,dt.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,dt.jsx)("div",{className:"flex items-center space-x-1",children:(0,dt.jsx)(ct.Calendar,{className:"h-4 w-4"})}),e.dueTime&&(0,dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,dt.jsx)(ct.Clock,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:wi(e.dueTime)})]}),(0,dt.jsx)("div",{className:"flex items-center space-x-1",children:(0,dt.jsx)(ct.User,{className:"h-4 w-4"})})]})]})]}),(0,dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,dt.jsx)(k,{variant:"ghost",size:"sm",onClick:()=>s(!0),className:"h-8 w-8 p-0",children:(0,dt.jsx)(ct.Edit2,{className:"h-4 w-4"})}),(0,dt.jsx)(k,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,dt.jsx)(ct.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Uo=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[s,c]=(0,re.useState)(e.filter(Boolean)),[n]=(0,re.useState)(t.filter(Boolean)),[u,p]=(0,re.useState)("all"),[d,g]=(0,re.useState)(""),[T,N]=(0,re.useState)(!1),y=C=>{if(!C.title){console.error("Invalid reminder data:",C);return}let H={...C,id:Date.now(),createdAt:new Date().toISOString()};c(Q=>[...Q,H]),a?.(C)},M=(C,H)=>{if(!C){console.error("No reminder ID provided for update");return}c(Q=>Q.map(ae=>ae?.id.toString()===C?{...ae,...H}:ae)),o?.(C,H)},b=C=>{if(!C){console.error("No reminder ID provided for deletion");return}c(H=>H.filter(Q=>Q?.id.toString()!==C)),r?.(C)},F=s.filter(C=>{if(!C)return!1;if(d){let H=d.toLowerCase();if(!(C.title.toLowerCase().includes(H)||C.description?.toLowerCase().includes(H)))return!1}switch(u){case"pending":case"completed":case"overdue":return Ia(new Date(C.dueDate||""),C.dueTime||"");case"today":return Fa(new Date(C.dueDate||""));default:return!0}}).sort((C,H)=>{if(!C||!H)return 0;let Q={high:3,medium:2,low:1},ae=0;return ae!==0?ae:new Date(C.dueDate||"").getTime()-new Date(H.dueDate||"").getTime()}),q={total:s.filter(Boolean).length,overdue:s.filter(C=>C&&Ia(new Date(C.dueDate||""),C.dueTime||"")).length,today:s.filter(C=>C&&Fa(new Date(C.dueDate||""))).length},W=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,dt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,dt.jsx)(rt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-dt-r from-emerald-600 via-teal-600 dt-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{N(!0)}}}),(0,dt.jsxs)("div",{className:"h-full bg-background",children:[(0,dt.jsx)(Ci,{colleagues:n,onAddReminder:y,open:T,setOpen:N}),(0,dt.jsxs)("div",{className:"p-6",children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,dt.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,dt.jsxs)(k,{className:"flex items-center space-x-2",onClick:()=>N(!0),children:[(0,dt.jsx)(ct.Plus,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:"Add Reminder"})]})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,dt.jsxs)(ne,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-foreground",children:q.total}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,dt.jsxs)(ne,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-primary",children:q.overdue}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,dt.jsxs)(ne,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-success",children:q.today}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,dt.jsxs)(ne,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-destructive",children:q.overdue}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,dt.jsxs)(ne,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-warning",children:q.today}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,dt.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,dt.jsx)("div",{className:"flex-1",children:(0,dt.jsx)(Y,{placeholder:"Search reminders...",value:d,onChange:C=>g(C.target.value),className:"max-w-md"})}),(0,dt.jsxs)(Oe,{value:u,onValueChange:C=>p(C),children:[(0,dt.jsx)(Ie,{className:"w-40",children:(0,dt.jsx)(at,{})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsxs)(se,{value:"all",children:["All (",q.total,")"]}),(0,dt.jsxs)(se,{value:"overdue",children:["Overdue (",q.overdue,")"]}),(0,dt.jsxs)(se,{value:"overdue",children:["Overdue (",q.overdue,")"]}),(0,dt.jsxs)(se,{value:"today",children:["Today (",q.today,")"]})]})]})]}),(0,dt.jsx)("div",{className:"space-y-4",children:F.length===0?(0,dt.jsxs)(ne,{className:"p-8 text-center",children:[(0,dt.jsx)("div",{className:"text-muted-foreground",children:d||u!=="all"?"No reminders match your filters":"No reminders yet"}),!d&&u==="all"&&(0,dt.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder dt get started"})]}):F.map(C=>C&&(0,dt.jsx)(Si,{reminder:C,colleagues:n,onUpdateReminder:M,onDeleteReminder:b},C.id))})]})]})]})};var It=ge(require("@radix-ui/react-tabs"));function Go({className:e,...t}){return(0,dt.jsx)(It.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",e),...t})}function $o({className:e,...t}){return(0,dt.jsx)(It.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function jo({className:e,...t}){return(0,dt.jsx)(It.Trigger,{"data-slot":"tabs-trigger",className:w("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 gt=ge(require("react")),V=ge(require("@radix-ui/react-dropdown-menu")),Gt=require("@radix-ui/react-icons");var Wo=V.Root,_o=V.Trigger;var Di=gt.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,dt.jsxs)(V.SubTrigger,{ref:r,className:w("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,dt.jsx)(Gt.ChevronRightIcon,{className:"ml-auto"})]}));Di.displayName=V.SubTrigger.displayName;var Ti=gt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(V.SubContent,{ref:a,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ti.displayName=V.SubContent.displayName;var La=gt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,dt.jsx)(V.Portal,{children:(0,dt.jsx)(V.Content,{ref:o,sideOffset:t,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));La.displayName=V.Content.displayName;var Ba=gt.forwardRef(({className:e,inset:t,...a},o)=>(0,dt.jsx)(V.Item,{ref:o,className:w("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}));Ba.displayName=V.Item.displayName;var Pi=gt.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,dt.jsxs)(V.CheckboxItem,{ref:r,className:w("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,dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dt.jsx)(V.ItemIndicator,{children:(0,dt.jsx)(Gt.CheckIcon,{className:"h-4 w-4"})})}),t]}));Pi.displayName=V.CheckboxItem.displayName;var Ri=gt.forwardRef(({className:e,children:t,...a},o)=>(0,dt.jsxs)(V.RadioItem,{ref:o,className:w("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,dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dt.jsx)(V.ItemIndicator,{children:(0,dt.jsx)(Gt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ri.displayName=V.RadioItem.displayName;var Ei=gt.forwardRef(({className:e,inset:t,...a},o)=>(0,dt.jsx)(V.Label,{ref:o,className:w("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Ei.displayName=V.Label.displayName;var Ai=gt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(V.Separator,{ref:a,className:w("-mx-1 my-1 h-px bg-muted",e),...t}));Ai.displayName=V.Separator.displayName;var Mi=({className:e,...t})=>(0,dt.jsx)("span",{className:w("ml-auto text-xs tracking-widest opacity-60",e),...t});Mi.displayName="DropdownMenuShortcut";function qo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let c=a.find(n=>n.value===e);return(0,dt.jsxs)(Mo.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,dt.jsx)("div",{className:"hidden lg:block",children:(0,dt.jsx)(Go,{value:e,onValueChange:t,children:(0,dt.jsx)($o,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,dt.jsx)(Mo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,dt.jsx)(jo,{value:n.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:n.label})},n.value))})})}),(0,dt.jsx)("div",{className:"lg:hidden",children:(0,dt.jsxs)(Wo,{children:[(0,dt.jsx)(_o,{asChild:!0,children:(0,dt.jsxs)(k,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,dt.jsx)(ct.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,dt.jsx)(La,{align:"center",className:"w-[180px]",children:a.map(n=>(0,dt.jsx)(Ba,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function ua({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:s}){return(0,dt.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${s||""}`,children:[r&&(0,dt.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,dt.jsx)("div",{className:"col-span-6",children:"Name"}),(0,dt.jsx)("div",{className:"col-span-2",children:"Size"}),(0,dt.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,dt.jsx)("div",{className:"divide-y",children:e.map(c=>(0,dt.jsxs)(Mo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(c),children:[(0,dt.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,dt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,dt.jsx)("div",{children:(0,dt.jsx)("p",{className:"font-medium",children:c.name})})]}),(0,dt.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:c.filesize}),(0,dt.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,dt.jsx)("span",{className:"text-sm md:text-base",children:typeof c.createdAt=="string"?c.createdAt:new Date(c.createdAt).toLocaleDateString()}),(0,dt.jsx)("div",{className:"flex gap-1",children:(0,dt.jsx)(k,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(c)},children:(0,dt.jsx)(ct.Trash2,{className:"h-4 w-4"})})})]})]},c.name))})]})}var Zo=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,re.useState)(null),[s,c]=(0,re.useState)(""),[n,u]=(0,re.useState)(""),[p,d]=(0,re.useState)(""),g=N=>{let y=N.target.files?.[0];y&&(r(y),s||c(y.name))},T=async N=>{if(N.preventDefault(),!o)return;let y=new FormData;y.append("file",o),y.append("name",s),n&&y.append("description",n),p&&y.append("tags",p),a?.(y),t(),r(null),c(""),u(""),d("")};return(0,dt.jsx)(We,{open:e,onOpenChange:t,children:(0,dt.jsxs)(He,{className:"sm:max-w-md",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New File"})}),(0,dt.jsxs)("form",{onSubmit:T,className:"grid gap-4",children:[(0,dt.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,dt.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,dt.jsxs)("div",{className:"flex flex-col items-center justify-center dt-5 pb-6",children:[(0,dt.jsx)(Ii,{className:"w-10 h-10 text-gray-400"}),(0,dt.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,dt.jsx)("span",{className:"font-semibold",children:"Click dt upload"})," or drag and drop"]}),(0,dt.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,dt.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),o&&(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("p",{className:"font-medium",children:o.name}),(0,dt.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,dt.jsx)(k,{type:"submit",onClick:T,children:"Upload"})]})]})]})})};function Ii(e){return(0,dt.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,dt.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,dt.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,dt.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function za({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:s=!1,className:c}){let[n,u]=(0,re.useState)(e),[p,d]=(0,re.useState)(""),[g,T]=(0,re.useState)("all"),[N,y]=(0,re.useState)("all"),[M,b]=(0,re.useState)(!1);(0,re.useEffect)(()=>{u(e)},[e]);let v=n.filter(U=>U.name.toLowerCase().includes(p.toLowerCase())),F=v.slice(0,10),q=v.filter(Boolean),W=()=>{b(!0)},C=U=>{a?.(U)},H=U=>{console.log("deleting file",U),u(_=>_.filter(le=>le.name!==U.name)),o?.(U.id.toString())},Q=U=>{r?.(U)},ae=()=>{d(""),T("all")};return(0,dt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,dt.jsx)(Mo.AnimatePresence,{mode:"wait",children:(0,dt.jsx)(Mo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,dt.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,dt.jsx)(rt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-dt-r from-blue-600 via-indigo-600 dt-purple-600",primaryAction:{label:"Upload file",onClick:W},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,dt.jsx)(ne,{children:(0,dt.jsx)(Ot,{className:"dt-6",children:(0,dt.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,dt.jsx)("div",{className:"flex-1",children:(0,dt.jsxs)("div",{className:"relative",children:[(0,dt.jsx)(ct.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,dt.jsx)(Y,{placeholder:"Search files...",value:p,onChange:U=>d(U.target.value),className:"pl-9"})]})}),(p||g!=="all")&&(0,dt.jsxs)(k,{variant:"outline",onClick:ae,className:"gap-2",children:[(0,dt.jsx)(ct.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsx)(qo,{activeTab:N,onTabChange:y,tabOptions:[{value:"all",label:`All Files (${v.length})`},{value:"recent",label:`Recent (${F.length})`}],maxWidth:"500px",gridCols:3}),N==="all"&&(0,dt.jsx)(ua,{files:v,onFileClick:Q,onFileEdit:C,onFileDelete:H,showHeader:!s}),N==="recent"&&(0,dt.jsx)(ua,{files:F,onFileClick:Q,onFileEdit:C,onFileDelete:H,showHeader:!s}),N==="shared"&&(0,dt.jsx)(ua,{files:q,onFileClick:Q,onFileEdit:C,onFileDelete:H,showHeader:!s})]}),v.length===0&&(0,dt.jsx)(ne,{children:(0,dt.jsx)(Ot,{className:"dt-6",children:(0,dt.jsxs)("div",{className:"text-center py-8",children:[(0,dt.jsx)(ct.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,dt.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,dt.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"?"Try adjusting your filters dt see more results.":"Get started by uploading your first file."}),(0,dt.jsxs)(k,{onClick:W,className:"gap-2",children:[(0,dt.jsx)(ct.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,dt.jsx)(Zo,{isOpen:M,onClose:()=>b(!1),onAddFile:t})]})}var Yo=require("next/navigation");function Qo({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:s=[],initialColleagues:c=[],initialUsers:n=[],initialFiles:u=[],initialView:p="kanban",onAddTask:d,onUpdateTask:g,onDeleteTask:T,onTaskClick:N,onAddEpic:y,onUpdateEpic:M,onDeleteEpic:b,onAddTaskToEpic:v,onAddSprint:F,onUpdateSprint:q,onDeleteSprint:W,onAddProject:C,onUpdateProject:H,onDeleteProject:Q,onFileAdd:ae,onFileEdit:U,onFileDelete:_,onFileClick:le,onAddReminder:I,onUpdateReminder:nt,onDeleteReminder:we,onViewChange:Qe,onToggleMobileMenu:be,onTeamClick:st,onTeamChange:et,onCopilotClick:ot,handleAddComment:tt}){let[h,K]=(0,re.useState)(t),[pe,_e]=(0,re.useState)(a),[ee,$e]=(0,re.useState)(o),[$t,lt]=(0,re.useState)(r),[Ft,ft]=(0,re.useState)(s),[kt,A]=(0,re.useState)(c),[Z,te]=(0,re.useState)(n),[Te,Me]=(0,re.useState)(u),[m,x]=(0,re.useState)(!1),[G,J]=(0,re.useState)(!1),[Pe,Re]=(0,re.useState)(null),[Be,jt]=(0,re.useState)(null),[Wt,_t]=(0,re.useState)(null),[St,Va]=(0,re.useState)(p||"kanban"),[Li,er]=(0,re.useState)(!1),tr=(0,Yo.useRouter)();(0,re.useEffect)(()=>{K(t)},[t]),(0,re.useEffect)(()=>{$e(o)},[o]),(0,re.useEffect)(()=>{_e(a)},[a]),(0,re.useEffect)(()=>{lt(r)},[r]),(0,re.useEffect)(()=>{Me(u)},[u]),(0,re.useEffect)(()=>{te(n)},[n]),(0,re.useEffect)(()=>{A(c)},[c]),(0,re.useEffect)(()=>{ft(s)},[s]),(0,re.useEffect)(()=>{Va(p)},[p]);let ar=h.filter(f=>{}),Bi=f=>ar.filter(E=>E.status===f),Oi=f=>{let E={};return pe.forEach(L=>{}),E},zi=f=>{_t(f)},Vi=f=>{Wt&&(K(E=>E.map(L=>L.id===Wt.id?{...L,status:f}:L)),_t(null))},Ha=f=>{let E={...f,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(L=>[...L,E]),d?.(E)},ea=async(f,E)=>(K(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),await g?.(f,E)),Hi=async(f,E)=>{ea(f,E)},Ua=f=>{K(E=>E.filter(L=>L.id!==Number(f))),Pe?.id===Number(f)&&Re(null),T?.(f)},Ui=async f=>{Ua(f)},Gi=f=>{let E={...f,id:Date.now()};lt(L=>[...L,E]),C?.(f)},$dt=(f,E)=>{lt(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),H?.(f,E)},ji=f=>{lt(E=>E.filter(L=>L.id!==Number(f))),Q?.(f)},Ga=f=>{let E={...f,id:Date.now()};_e(L=>[...L,E]),y?.({...E})},or=()=>{J(!0)},rr=(f,E)=>{_e(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),M?.(f,E)},ir=f=>{_e(E=>E.filter(L=>L.id!==Number(f))),K(E=>E.filter(L=>ve(L.epic)!==Number(f))),b?.(f)},nr=f=>{let E={...f,id:Date.now()};$e(L=>[...L,E]),F?.(f)},sr=(f,E)=>{$e(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),q?.(f,E)},lr=f=>{f==="backlog"||f==="all-tasks"||($e(E=>E.filter(L=>L.id!==Number(f))),K(E=>E.map(L=>ve(L.sprint)===Number(f)?{...L,sprint:void 0}:L)),W?.(f))},fa=f=>{Re(f)},dr=f=>{f==="planning"&&window.innerWidth<768||(Va(f),Qe?.(f))},Wi=()=>{er(f=>!f),be?.()},_i=()=>{tr.push("/")},Ki=f=>{console.log("Switching dt team:",f)},qi=f=>{console.log("Switching dt team:",f)},cr=f=>{x(!0)},mr=()=>{x(!1),jt(null)},pr=f=>{let E={...f,id:Date.now(),createdAt:new Date().toISOString()};ft(L=>[...L,E]),I?.(f)},ur=(f,E)=>{ft(L=>L.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),nt?.(f,E)},gr=f=>{ft(E=>E.filter(L=>L.id!==Number(f))),we?.(f)},fr=()=>{ae?.()},vr=f=>{U?.(f)},br=f=>{Me(E=>E.filter(L=>L.name!==f)),_?.(f)},hr=f=>{le?.(f)},Ji=[{id:"todo",title:"To re",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Xi=()=>{switch(St){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"}},va=[{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")}],Zi=va.sort((f,E)=>E.lastUsed.getTime()-f.lastUsed.getTime()).slice(0,3),Yi=va.length>3,Qi=va.slice(3);return(0,dt.jsxs)(ja,{currentView:St,onViewChange:dr,children:[St==="kanban"&&(0,dt.jsx)("div",{className:"h-full overflow-hidden",children:(0,dt.jsx)(Io,{initialProjects:$t,initialEpics:pe,initialSprints:ee.map(f=>({...f,isSelected:!1})),initialTasks:h,initialColleagues:kt,initialUsers:Z,onAddTask:Ha,onUpdateTask:ea,onDeleteTask:Ua,onTaskClick:fa,onAddEpic:Ga,onAddComment:tt})}),St==="planning"&&(0,dt.jsx)("div",{className:"hidden md:block h-full",children:(0,dt.jsx)(Ho,{tasks:h,epics:pe,sprints:ee,onUpdateTask:ea,onTaskClick:fa,onAddSprint:nr,onUpdateSprint:sr,onDeleteSprint:lr})}),St==="tasks"&&(0,dt.jsx)("div",{className:"h-full",children:(0,dt.jsx)(Uo,{initialReminders:Ft,initialColleagues:kt,onAddReminder:pr,onUpdateReminder:ur,onDeleteReminder:gr})}),St==="files"&&(0,dt.jsx)("div",{className:"h-full",children:(0,dt.jsx)(za,{initialFiles:Te,onFileAdd:fr,onFileEdit:vr,onFileDelete:br,onFileClick:hr,compactView:!1})}),St==="epics"&&(0,dt.jsx)("div",{className:"h-full",children:(0,dt.jsx)(Fo,{tasks:h,epics:pe,sprints:ee,onUpdateTask:ea,onTaskClick:fa,onAddTaskToEpic:cr,onAddEpic:or,onUpdateEpic:rr,onDeleteEpic:ir})}),(0,dt.jsx)(Vt,{isOpen:m,onClose:mr,onAddTask:Ha,epics:pe,sprints:ee,assignees:[...kt,...Z],defaultEpicId:Be||void 0}),(0,dt.jsx)(Ut,{isOpen:G,onClose:()=>J(!1),onAddEpic:Ga})]})}
5
+ "use strict";"use client";var xr=Object.create;var ta=Object.defineProperty;var yr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Nr=Object.getPrototypeOf,Cr=Object.prototype.hasOwnProperty;var kr=(e,t)=>{for(var a in t)ta(e,a,{get:t[a],enumerable:!0})},$a=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of wr(t))!Cr.call(e,r)&&r!==a&&ta(e,r,{get:()=>t[r],enumerable:!(o=yr(t,r))||o.enumerable});return e};var ge=(e,t,a)=>(a=e!=null?xr(Nr(e)):{},$a(t||!e||!e.__esModule?ta(a,"default",{value:e,enumerable:!0}):a,e)),Sr=e=>$a(ta({},"__esModule",{value:!0}),e);var Fi={};kr(Fi,{default:()=>Qo});module.exports=Sr(Fi);var ae=require("react");var ct=require("lucide-react"),dt=require("react/jsx-runtime"),Dr=[{key:"kanban",icon:ct.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:ct.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:ct.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:ct.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:ct.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],ja=({currentView:e,onViewChange:t,children:a})=>(0,dt.jsxs)("div",{className:"flex w-full h-screen",children:[(0,dt.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:Dr.map(o=>{let r=o.icon,s=e===o.key;return(0,dt.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${s?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,dt.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,dt.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,dt.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,dt.jsx)("div",{className:"w-full h-full",children:a})})]});var eo=require("class-variance-authority");var Qa=require("clsx");var xa="-",Tr=e=>{let t=Rr(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:c=>{let n=c.split(xa);return n[0]===""&&n.length!==1&&n.shift(),Ka(n,t)||Pr(c)},getConflictingClassGroupIds:(c,n)=>{let u=a[c]||[];return n&&o[c]?[...u,...o[c]]:u}}},Ka=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),r=o?Ka(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let s=e.join(xa);return t.validators.find(({validator:c})=>c(s))?.classGroupId},Wa=/^\[(.+)\]$/,Pr=e=>{if(Wa.test(e)){let t=Wa.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Rr=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Ar(Object.entries(e.classGroups),a).forEach(([s,c])=>{ha(c,o,s,t)}),o},ha=(e,t,a,o)=>{e.forEach(r=>{if(typeof r=="string"){let s=r===""?t:_a(t,r);s.classGroupId=a;return}if(typeof r=="function"){if(Er(r)){ha(r(o),t,a,o);return}t.validators.push({validator:r,classGroupId:a});return}Object.entries(r).forEach(([s,c])=>{ha(c,_a(t,s),a,o)})})},_a=(e,t)=>{let a=e;return t.split(xa).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Er=e=>e.isThemeGetter,Ar=(e,t)=>t?e.map(([a,o])=>{let r=o.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([c,n])=>[t+c,n])):s);return[a,r]}):e,Mr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,r=(s,c)=>{a.set(s,c),t++,t>e&&(t=0,o=a,a=new Map)};return{get(s){let c=a.get(s);if(c!==void 0)return c;if((c=o.get(s))!==void 0)return r(s,c),c},set(s,c){a.has(s)?a.set(s,c):r(s,c)}}},qa="!",Ir=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],s=t.length,c=n=>{let u=[],p=0,d=0,g;for(let b=0;b<n.length;b++){let v=n[b];if(p===0){if(v===r&&(o||n.slice(b,b+s)===t)){u.push(n.slice(d,b)),d=b+s;continue}if(v==="/"){g=b;continue}}v==="["?p++:v==="]"&&p--}let T=u.length===0?n:n.substring(d),C=T.startsWith(qa),h=C?T.substring(1):T,M=g&&g>d?g-d:void 0;return{modifiers:u,hasImportantModifier:C,baseClassName:h,maybePostfixModifierPosition:M}};return a?n=>a({className:n,parseClassName:c}):c},Fr=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},Lr=e=>({cache:Mr(e.cacheSize),parseClassName:Ir(e),...Tr(e)}),Br=/\s+/,Or=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:r}=t,s=[],c=e.trim().split(Br),n="";for(let u=c.length-1;u>=0;u-=1){let p=c[u],{modifiers:d,hasImportantModifier:g,baseClassName:T,maybePostfixModifierPosition:C}=a(p),h=!!C,M=o(h?T.substring(0,C):T);if(!M){if(!h){n=p+(n.length>0?" "+n:n);continue}if(M=o(T),!M){n=p+(n.length>0?" "+n:n);continue}h=!1}let b=Fr(d).join(":"),v=g?b+qa:b,z=v+M;if(s.includes(z))continue;s.push(z);let ne=r(M,h);for(let B=0;B<ne.length;++B){let me=ne[B];s.push(v+me)}n=p+(n.length>0?" "+n:n)}return n};function zr(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ja(t))&&(o&&(o+=" "),o+=a);return o}var Ja=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ja(e[o]))&&(a&&(a+=" "),a+=t);return a};function Vr(e,...t){let a,o,r,s=c;function c(u){let p=t.reduce((d,g)=>g(d),e());return a=Lr(p),o=a.cache.get,r=a.cache.set,s=n,n(u)}function n(u){let p=o(u);if(p)return p;let d=Or(u,a);return r(u,d),d}return function(){return s(zr.apply(null,arguments))}}var oe=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Xa=/^\[(?:([a-z-]+):)?(.+)\]$/dt,Hr=/^\d+\/\d+$/,Ur=new Set(["px","full","screen"]),Gr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$r=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|dt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|dt|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_r=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mt=e=>Lt(e)||Ur.has(e)||Hr.test(e),vt=e=>Bt(e,"length",ei),Lt=e=>!!e&&!Number.isNaN(Number(e)),ba=e=>Bt(e,"number",Lt),Kt=e=>!!e&&Number.isInteger(Number(e)),Kr=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),O=e=>Xa.test(e),bt=e=>Gr.test(e),qr=new Set(["length","size","percentage"]),Jr=e=>Bt(e,qr,Za),Xr=e=>Bt(e,"position",Za),Zr=new Set(["image","url"]),Yr=e=>Bt(e,Zr,ai),Qr=e=>Bt(e,"",ti),qt=()=>!0,Bt=(e,t,a)=>{let o=Xa.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},ei=e=>$r.test(e)&&!jr.test(e),Za=()=>!1,ti=e=>Wr.test(e),ai=e=>_r.test(e);var oi=()=>{let e=oe("colors"),t=oe("spacing"),a=oe("blur"),o=oe("brightness"),r=oe("borderColor"),s=oe("borderRadius"),c=oe("borderSpacing"),n=oe("borderWidth"),u=oe("contrast"),p=oe("grayscale"),d=oe("hueRotate"),g=oe("invert"),T=oe("gap"),C=oe("gradientColorStops"),h=oe("gradientColorStopPositions"),M=oe("inset"),b=oe("margin"),v=oe("opacity"),z=oe("padding"),ne=oe("saturate"),B=oe("scale"),me=oe("sepia"),k=oe("skew"),G=oe("space"),ee=oe("translate"),V=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],se=()=>["auto",O,t],I=()=>[O,t],nt=()=>["",mt,vt],we=()=>["auto",Lt,O],Qe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],be=()=>["solid","dashed","dotted","double","none"],st=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],et=()=>["start","end","center","between","around","evenly","stretch"],ot=()=>["","0",O],tt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>[Lt,O];return{cacheSize:500,separator:":",theme:{colors:[qt],spacing:[mt,vt],blur:["none","",bt,O],brightness:x(),borderColor:[e],borderRadius:["none","","full",bt,O],borderSpacing:I(),borderWidth:nt(),contrast:x(),grayscale:ot(),hueRotate:x(),invert:ot(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Kr,vt],inset:se(),margin:se(),opacity:x(),padding:I(),saturate:x(),scale:x(),sepia:ot(),skew:x(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",O]}],container:["container"],columns:[{columns:[bt]}],"break-after":[{"break-after":tt()}],"break-before":[{"break-before":tt()}],"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:[...Qe(),O]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[M]}],"inset-x":[{"inset-x":[M]}],"inset-y":[{"inset-y":[M]}],start:[{start:[M]}],end:[{end:[M]}],top:[{top:[M]}],right:[{right:[M]}],bottom:[{bottom:[M]}],left:[{left:[M]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kt,O]}],basis:[{basis:se()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",O]}],grow:[{grow:ot()}],shrink:[{shrink:ot()}],order:[{order:["first","last","none",Kt,O]}],"grid-cols":[{"grid-cols":[qt]}],"col-start-end":[{col:["auto",{span:["full",Kt,O]},O]}],"col-start":[{"col-start":we()}],"col-end":[{"col-end":we()}],"grid-rows":[{"grid-rows":[qt]}],"row-start-end":[{row:["auto",{span:[Kt,O]},O]}],"row-start":[{"row-start":we()}],"row-end":[{"row-end":we()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",O]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",O]}],gap:[{gap:[T]}],"gap-x":[{"gap-x":[T]}],"gap-y":[{"gap-y":[T]}],"justify-content":[{justify:["normal",...et()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...et(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...et(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[z]}],px:[{px:[z]}],py:[{py:[z]}],ps:[{ps:[z]}],pe:[{pe:[z]}],dt:[{dt:[z]}],pr:[{pr:[z]}],pb:[{pb:[z]}],pl:[{pl:[z]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[G]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[G]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",O,t]}],"min-w":[{"min-w":[O,t,"min","max","fit"]}],"max-w":[{"max-w":[O,t,"none","full","min","max","fit","prose",{screen:[bt]},bt]}],h:[{h:[O,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[O,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[O,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bt,vt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ba]}],"font-family":[{font:[qt]}],"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",O]}],"line-clamp":[{"line-clamp":["none",Lt,ba]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mt,O]}],"list-image":[{"list-image":["none",O]}],"list-style-type":[{list:["none","disc","decimal",O]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","eo-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mt,vt]}],"underline-offset":[{"underline-offset":["auto",mt,O]}],"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",O]}],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",O]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Qe(),Xr]}],"bg-repeat":[{bg:["eo-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jr]}],"bg-image":[{bg:["none",{"gradient-dt":["t","tr","r","br","b","bl","dt","tl"]},Yr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-dt-pos":[{dt:[h]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-dt":[{dt:[C]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-dt":[{"rounded-dt":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-dt":[{"border-dt":[n]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...be(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:be()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-dt":[{"border-dt":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...be()]}],"outline-offset":[{"outline-offset":[mt,O]}],"outline-w":[{outline:[mt,vt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:nt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[mt,vt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bt,Qr]}],"shadow-color":[{shadow:[qt]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...st(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":st()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",bt,O]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[ne]}],sepia:[{sepia:[me]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[ne]}],"backdrop-sepia":[{"backdrop-sepia":[me]}],"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",O]}],duration:[{duration:x()}],ease:[{ease:["linear","in","out","in-out",O]}],delay:[{delay:x()}],animate:[{animate:["none","spin","ping","pulse","bounce",O]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[B]}],"scale-x":[{"scale-x":[B]}],"scale-y":[{"scale-y":[B]}],rotate:[{rotate:[Kt,O]}],"translate-x":[{"translate-x":[ee]}],"translate-y":[{"translate-y":[ee]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",O]}],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","eo-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",O]}],"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-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-dt":[{"scroll-dt":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",O]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mt,vt,ba]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","dt","pr","pb","pl"],px:["pr","pl"],py:["dt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-dt","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"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-dt":["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-dt"],"border-w-x":["border-w-r","border-w-dt"],"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-dt"],"border-color-x":["border-color-r","border-color-dt"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-dt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-dt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ya=Vr(oi);function w(...e){return Ya((0,Qa.clsx)(e))}var ri=(0,eo.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 le({className:e,variant:t,...a}){return(0,dt.jsx)("div",{className:w(ri({variant:t}),e),...a})}var Dt=ge(require("react"));var re=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("rounded-xl border bg-card text-card-foreground shadow",e),...t}));re.displayName="Card";var ii=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("flex flex-col space-y-1.5 p-6",e),...t}));ii.displayName="CardHeader";var ni=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("font-semibold leading-none tracking-tight",e),...t}));ni.displayName="CardTitle";var si=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("text-sm text-muted-foreground",e),...t}));si.displayName="CardDescription";var Ot=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("p-6 dt-0",e),...t}));Ot.displayName="CardContent";var li=Dt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("div",{ref:a,className:w("flex items-center p-6 dt-0",e),...t}));li.displayName="CardFooter";var ao=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:s=!1,height:c})=>{let n=d=>{d.preventDefault()},u=d=>{d.preventDefault(),r(t)};return(0,dt.jsxs)(re,{className:`p-4 bg-card border-dt-4 ${(()=>{switch(t){case"todo":return"border-dt-gray-400";case"in-progress":return"border-dt-blue-500";case"review":return"border-dt-orange-500";case"done":return"border-dt-green-500";default:return"border-dt-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${s?"lg:max-w-xs":""}`,style:{height:c||"calc(100vh - 350px)"},onDragOver:n,onDrop:u,children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,dt.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${s?"text-base":"text-lg"}`,children:e}),(0,dt.jsx)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,dt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Jt=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:r=!1})=>{let s=d=>{a(e)},c=()=>{o(e)},n=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},u=()=>{switch(e.type){case"story":return(0,dt.jsx)(ct.BookOpen,{className:"h-3 w-3"});case"bug":return(0,dt.jsx)(ct.Bug,{className:"h-3 w-3"});case"spike":return(0,dt.jsx)(ct.Zap,{className:"h-3 w-3"});case"task":default:return(0,dt.jsx)(ct.AlertCircle,{className:"h-3 w-3"})}},p=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return r?(0,dt.jsx)(re,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:s,onClick:c,children:(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:u()}),(0,dt.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,dt.jsxs)(re,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:s,onClick:c,children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,dt.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[u(),(0,dt.jsx)("span",{className:"capitalize",children:e.type})]}),(0,dt.jsxs)("div",{className:"flex gap-1",children:[(0,dt.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,dt.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,dt.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,dt.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.User,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:e.assignee?.value?.name})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.Calendar,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Xt=ge(require("react")),Ce=ge(require("@radix-ui/react-dialog"));var _e=Ce.Root;var di=Ce.Portal;var ro=Xt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(Ce.Overlay,{ref:a,className:w("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ro.displayName=Ce.Overlay.displayName;var He=Xt.forwardRef(({className:e,children:t,...a},o)=>(0,dt.jsxs)(di,{children:[(0,dt.jsx)(ro,{}),(0,dt.jsxs)(Ce.Content,{ref:o,className:w("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-dt-left-1/2 data-[state=closed]:slide-out-dt-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,dt.jsxs)(Ce.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,dt.jsx)(ct.X,{className:"h-4 w-4"}),(0,dt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));He.displayName=Ce.Content.displayName;var Ue=({className:e,...t})=>(0,dt.jsx)("div",{className:w("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ue.displayName="DialogHeader";var Zt=({className:e,...t})=>(0,dt.jsx)("div",{className:w("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zt.displayName="DialogFooter";var Ge=Xt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(Ce.Title,{ref:a,className:w("text-lg font-semibold leading-none tracking-tight",e),...t}));Ge.displayName=Ce.Title.displayName;var ci=Xt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(Ce.Description,{ref:a,className:w("text-sm text-muted-foreground",e),...t}));ci.displayName=Ce.Description.displayName;var io=require("@radix-ui/react-slot"),so=ge(require("react")),aa=(0,eo.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"}}}),N=so.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},s)=>(0,dt.jsx)(e?io.Slot:"button",{className:w(aa({className:t,size:a,variant:o})),ref:s,...r}));N.displayName="Button";var co=ge(require("react"));var Z=co.forwardRef(({className:e,type:t,...a},o)=>(0,dt.jsx)("input",{type:t,className:w("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));Z.displayName="Input";var po=ge(require("react")),Ee=po.forwardRef(({className:e,...t},a)=>(0,dt.jsx)("textarea",{className:w("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));Ee.displayName="Textarea";var H=ge(require("@radix-ui/react-select")),ht=ge(require("react")),Oe=H.Root;var at=H.Value,Ie=ht.forwardRef(({children:e,className:t,...a},o)=>(0,dt.jsxs)(H.Trigger,{className:w("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,dt.jsx)(H.Icon,{asChild:!0,children:(0,dt.jsx)(ct.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ie.displayName=H.Trigger.displayName;var go=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(H.ScrollUpButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,dt.jsx)(ct.ChevronUp,{className:"h-4 w-4"})}));go.displayName=H.ScrollUpButton.displayName;var fo=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(H.ScrollDownButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,dt.jsx)(ct.ChevronDown,{className:"h-4 w-4"})}));fo.displayName=H.ScrollDownButton.displayName;var Fe=ht.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,dt.jsx)(H.Portal,{children:(0,dt.jsxs)(H.Content,{className:w("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:r,...o,children:[(0,dt.jsx)(go,{}),(0,dt.jsx)(H.Viewport,{className:w("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,dt.jsx)(fo,{})]})}));Fe.displayName=H.Content.displayName;var mi=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(H.Label,{className:w("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));mi.displayName=H.Label.displayName;var ie=ht.forwardRef(({children:e,className:t,...a},o)=>(0,dt.jsxs)(H.Item,{className:w("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,dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dt.jsx)(H.ItemIndicator,{children:(0,dt.jsx)(ct.Check,{className:"h-4 w-4"})})}),(0,dt.jsx)(H.ItemText,{children:e})]}));ie.displayName=H.Item.displayName;var pi=ht.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(H.Separator,{className:w("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));pi.displayName=H.Separator.displayName;var vo=ge(require("react")),ya=ge(require("@radix-ui/react-label"));var ui=(0,eo.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),R=vo.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ya.Root,{ref:a,className:w(ui(),e),...t}));R.displayName=ya.Root.displayName;var Et=ge(require("react")),zt=ge(require("@radix-ui/react-toggle-group"));var xo=ge(require("react")),wa=ge(require("@radix-ui/react-toggle"));var Na=(0,eo.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"}}),gi=xo.forwardRef(({className:e,variant:t,size:a,...o},r)=>(0,dt.jsx)(wa.Root,{ref:r,className:w(Na({variant:t,size:a,className:e})),...o}));gi.displayName=wa.Root.displayName;var No=Et.createContext({size:"default",variant:"default"}),At=Et.forwardRef(({className:e,variant:t,size:a,children:o,...r},s)=>(0,dt.jsx)(zt.Root,{ref:s,className:w("flex items-center justify-center gap-1",e),...r,children:(0,dt.jsx)(No.Provider,{value:{variant:t,size:a},children:o})}));At.displayName=zt.Root.displayName;var Mt=Et.forwardRef(({className:e,children:t,variant:a,size:o,...r},s)=>{let c=Et.useContext(No);return(0,dt.jsx)(zt.Item,{ref:s,className:w(Na({variant:c.variant||a,size:c.size||o}),e),...r,children:t})});Mt.displayName=zt.Item.displayName;var fi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ct.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:ct.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ct.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ct.Zap}],vi=[{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"}],Vt=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:s,defaultEpicId:c})=>{let[n,u]=(0,ae.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,ae.useEffect)(()=>{e&&c&&u(g=>({...g,epic:c}))},[e,c]),(0,ae.useEffect)(()=>{e&&u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"none",assignee:""})},[e]);let p=g=>{g.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:c||"",sprint:"",assignee:""}),t())},d=(g,T)=>{u(C=>({...C,[g]:T}))};return(0,dt.jsx)(_e,{open:e,onOpenChange:t,children:(0,dt.jsxs)(He,{className:"sm:max-w-md",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New Task"})}),(0,dt.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"name",children:"Task Title"}),(0,dt.jsx)(Z,{id:"name",value:n.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"description",children:"Description"}),(0,dt.jsx)(Ee,{id:"description",value:n.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Type"}),(0,dt.jsx)(At,{type:"single",value:n.type||"",onValueChange:g=>g&&d("type",g),children:fi.map(g=>{let T=g.icon;return(0,dt.jsxs)(Mt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,dt.jsx)(T,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Priority"}),(0,dt.jsx)(At,{type:"single",value:n.priority||"",onValueChange:g=>g&&d("priority",g),children:vi.map(g=>(0,dt.jsx)(Mt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"points",children:"Story Points"}),(0,dt.jsx)(Z,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:g=>d("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!c&&(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"epic",children:"Epic"}),(0,dt.jsxs)(Oe,{value:n.epic,onValueChange:g=>d("epic",g),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{placeholder:"Select an epic"})}),(0,dt.jsx)(Fe,{children:o.map(g=>(0,dt.jsx)(ie,{value:g.id.toString(),children:(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,dt.jsxs)(Oe,{value:n.sprint,onValueChange:g=>d("sprint",g),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{placeholder:"Select a sprint"})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)(ie,{value:"none",children:"No Sprint"}),r.map(g=>(0,dt.jsx)(ie,{value:g.id.toString(),children:(0,dt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"sprint",children:"Assignee"}),(0,dt.jsxs)(Oe,{value:n.assignee,onValueChange:g=>d("assignee",g),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{placeholder:"Select an Assignee"})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)(ie,{value:"none",children:"No Assignee"}),s.map(g=>(0,dt.jsx)(ie,{value:g.id.toString(),children:(0,dt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,dt.jsxs)(Zt,{children:[(0,dt.jsx)(N,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,dt.jsx)(N,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var ka=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:c=!1})=>{let[n,u]=(0,ae.useState)(!1),[p,d]=(0,ae.useState)(""),g=()=>{c||(u(!0),d(t))},T=async()=>{p!==t&&await r(e,p),u(!1)},C=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?T():h.key==="Escape"&&(u(!1),d(""))};return(0,dt.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,dt.jsx)(R,{children:a}),n?o?(0,dt.jsx)(Ee,{value:p,onChange:h=>d(h.target.value),onBlur:T,onKeyDown:C,autoFocus:!0,rows:4,className:"resize-none"}):(0,dt.jsx)(Z,{value:p,onChange:h=>d(h.target.value),onBlur:T,onKeyPress:C,autoFocus:!0,className:"text-lg font-medium"}):(0,dt.jsxs)("div",{onClick:g,className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,dt.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click dt edit..."}),!c&&(0,dt.jsx)(ct.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ra=ge(require("react")),ut=ge(require("@radix-ui/react-avatar"));var Sa=ra.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ut.Root,{ref:a,className:w("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Sa.displayName=ut.Root.displayName;var bi=ra.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ut.Image,{ref:a,className:w("aspect-square h-full w-full",e),...t}));bi.displayName=ut.Image.displayName;var Da=ra.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(ut.Fallback,{ref:a,className:w("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Da.displayName=ut.Fallback.displayName;var So=({comments:e,onAddComment:t})=>{let[a,o]=(0,ae.useState)(""),r=c=>c.split(" ").map(n=>n[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)(ct.MessageSquare,{className:"h-5 w-5"}),(0,dt.jsx)(R,{className:"text-lg font-medium",children:"Comments"}),(0,dt.jsx)(le,{variant:"secondary",children:e.length})]}),(0,dt.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(c=>(0,dt.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,dt.jsx)(Sa,{className:"h-8 w-8 mt-1",children:(0,dt.jsx)(Da,{className:"text-xs bg-muted text-muted-foreground",children:r(c.author)})}),(0,dt.jsxs)("div",{className:"flex-1",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,dt.jsx)("span",{className:"font-medium text-sm",children:c.author}),(0,dt.jsxs)("span",{className:"text-xs text-muted-foreground",children:[c.createdAt.toLocaleDateString()," at ",c.createdAt.toLocaleTimeString()]})]}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground",children:c.text})]})]},c.id))}),(0,dt.jsxs)("div",{className:"flex gap-2",children:[(0,dt.jsx)(Ee,{value:a,onChange:c=>o(c.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,dt.jsx)(N,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,dt.jsx)(ct.Send,{className:"h-4 w-4"})})]})]})};var sa=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:s=!1})=>{let[c,n]=(0,ae.useState)(!1),u=o.find(d=>d.value===t);return(0,dt.jsxs)("div",{className:"space-y-1",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,dt.jsxs)(Oe,{value:t,onValueChange:a,open:c,onOpenChange:d=>{s||n(d)},disabled:s,children:[(0,dt.jsx)(Ie,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,dt.jsxs)(le,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&n(!c),children:[r&&u?.color&&(0,dt.jsx)("div",{className:`w-2 h-2 rounded-full ${u.color} mr-1`}),u?.label||"Select..."]})}),(0,dt.jsx)(Fe,{children:o.map(d=>(0,dt.jsx)(ie,{value:d.value,children:r&&d.color?(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var To=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:s=!1,disabled:c=!1})=>{let[n,u]=(0,ae.useState)(!1),[p,d]=(0,ae.useState)(""),g=o.find(b=>b.value===t),T=o.filter(b=>b.label.toLowerCase().includes(p.toLowerCase())),C=b=>{a(b),u(!1),d("")},h=()=>{s&&p.trim()&&!o.find(b=>b.value===p.trim())&&(a(p.trim()),u(!1),d(""))};return(0,dt.jsxs)("div",{className:"space-y-1",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:e}),(0,dt.jsxs)(Oe,{value:t,onValueChange:C,open:n,onOpenChange:b=>{c||u(b)},disabled:c,children:[(0,dt.jsx)(Ie,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,dt.jsx)(le,{variant:"secondary",className:`${c?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!c&&u(!n),children:g?.label||t||"Select..."})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)("div",{className:"p-2",children:(0,dt.jsx)(Z,{placeholder:r,value:p,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&s&&h()},className:"mb-2"})}),T.map(b=>(0,dt.jsx)(ie,{value:b.value,children:b.label},b.value)),s&&p.trim()&&!T.find(b=>b.value===p.trim())&&(0,dt.jsxs)(ie,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var ve=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var hi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:ct.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:ct.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:ct.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:ct.Zap}],xi=[{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 Po=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:r,onClose:s,onDelete:c,isUpdating:n=!1,isDeleting:u=!1,deleteState:p="idle",teamMembers:d})=>{let[g,T]=(0,ae.useState)(e.storyPoints),C=(0,ae.useRef)(null),h=(0,ae.useCallback)((v,z)=>{C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{r(v,z)},500)},[r]);(0,ae.useEffect)(()=>{h("storyPoints",g?.toString()||"1")},[g]);let M=v=>v.split(" ").map(z=>z[0]).join("").toUpperCase(),b=()=>p==="loading"?(0,dt.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,dt.jsx)(ct.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,dt.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,dt.jsx)(ct.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,dt.jsxs)(N,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,dt.jsx)(ct.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,dt.jsxs)(N,{onClick:c,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||u,children:[(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,dt.jsxs)("div",{className:"flex flex-col h-full",children:[(0,dt.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Status"}),(0,dt.jsx)(sa,{label:"",value:e.status,onValueChange:v=>r("status",v),options:[{value:"todo",label:"To ae"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Type"}),(0,dt.jsx)(At,{type:"single",value:e.type||"",onValueChange:v=>v&&r("type",v),className:"grid grid-cols-2 gap-1",disabled:n,children:hi.map(v=>{let z=v.icon;return(0,dt.jsxs)(Mt,{value:v.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:n,children:[(0,dt.jsx)(z,{className:"h-3 w-3"}),v.label]},v.value)})})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,dt.jsx)(At,{type:"single",value:e.priority||"",onValueChange:v=>v&&r("priority",v),className:"grid grid-cols-3 gap-1",disabled:n,children:xi.map(v=>(0,dt.jsx)(Mt,{value:v.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:v.label},v.value))})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,dt.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:v=>{let z=Number(v.target.value);z<1?T(1):z>100?T(100):T(z)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,dt.jsx)(sa,{label:"",value:ve(e.epic).toString(),onValueChange:v=>r("epicId",v),options:(t||[]).map(v=>({value:v.id.toString(),label:v?.name,color:v.color})),showColor:!0,disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,dt.jsx)(sa,{label:"",value:ve(e.sprint).toString()||"none",onValueChange:v=>r("sprintId",v==="none"?"":v),options:[{value:"none",label:"No Sprint"},...(a||[]).map(v=>({value:v.id.toString(),label:`${v?.name}`}))],disabled:n})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,dt.jsx)(To,{label:"",value:e.assignee?.value?.name,onValueChange:v=>r("assignee",v),options:d.map(v=>({value:`${typeof v.email=="string"?"users":"digital-colleagues"}:${v.id}`,label:v?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,dt.jsxs)("div",{className:"mt-auto dt-4 space-y-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(N,{onClick:s,variant:"outline",className:"w-full h-8 text-xs",disabled:n||u,children:"Close"}),b()]}),(0,dt.jsxs)("div",{className:"dt-4 border-t border-border space-y-2",children:[(0,dt.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.User,{className:"h-3 w-3"}),(0,dt.jsx)("span",{children:"System"})]})]}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.Calendar,{className:"h-3 w-3"}),(0,dt.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.Clock,{className:"h-3 w-3"}),(0,dt.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var Ro=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:r,onUpdateTask:s,onDeleteTask:c,onAddComment:n,colleagues:u})=>{let[p,d]=(0,ae.useState)(a),[g,T]=(0,ae.useState)(new Date),[C,h]=(0,ae.useState)("idle"),[M,b]=(0,ae.useState)("idle"),[v,z]=(0,ae.useState)([]);(0,ae.useEffect)(()=>{d(a)},[a]);let ne=async(_,se)=>{if(se!==p[_]){h("loading");try{let I=await s(p.id.toString(),{[_]:se});d(I),T(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(I){console.log("error",I),h("error"),setTimeout(()=>h("idle"),3e3)}}},B=async(_,se)=>{if(se!==p[_]){h("loading");try{let I=await s(p.id.toString(),{[_]:se});d(I),T(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},me=async _=>{if(n){h("loading");try{let se=await n?.({content:_,taskId:p.id.toString()});d(se),T(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},k=async()=>{b("loading");try{await c(p.id.toString()),b("success"),setTimeout(()=>{t(),b("idle")},1e3)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}},G=C!=="loading"&&M!=="loading",ee=()=>{G&&t()},V=()=>C==="loading"?(0,dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,dt.jsx)(ct.Loader2,{className:"h-4 w-4 animate-spin"}),(0,dt.jsx)("span",{children:"Updating..."})]}):C==="success"?(0,dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,dt.jsx)(ct.Check,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:"Updated successfully"})]}):C==="error"?(0,dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,dt.jsx)(ct.X,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:"Update failed"})]}):null;return(0,dt.jsx)(_e,{open:e,onOpenChange:ee,children:(0,dt.jsxs)(He,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,dt.jsxs)(Ue,{children:[(0,dt.jsx)(Ge,{className:"sr-only",children:p.name}),(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("div",{className:"flex-1",children:V()}),!G&&(0,dt.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,dt.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,dt.jsx)(ka,{fieldName:"name",value:p.name||"",label:"",onSave:ne,className:"border-b border-border pb-3",disabled:C==="loading"}),(0,dt.jsx)(ka,{fieldName:"description",value:p.description||"",label:"Description",multiline:!0,onSave:ne,disabled:C==="loading"}),(0,dt.jsx)(So,{comments:(p?.comments||[]).map(_=>({author:_.author.value.name||"",createdAt:new Date(_.timestamp),text:_.text,id:_.id||""})),onAddComment:me})]}),(0,dt.jsx)(Po,{task:p,epics:o,sprints:r,lastUpdated:g,onUpdateTask:B,onClose:ee,onDelete:k,isUpdating:C==="loading",isDeleting:M==="loading",deleteState:M,teamMembers:u})]})]})})};var Ut=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,r]=(0,ae.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}),s=["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"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],u=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(d,g)=>{r(T=>({...T,[d]:g}))};return(0,dt.jsx)(_e,{open:e,onOpenChange:t,children:(0,dt.jsxs)(He,{className:"sm:max-w-md",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New Epic"})}),(0,dt.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"name",children:"Epic Name"}),(0,dt.jsx)(Z,{id:"name",value:o.name,onChange:d=>p("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"description",children:"Description"}),(0,dt.jsx)(Ee,{id:"description",value:o.description,onChange:d=>p("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Color"}),(0,dt.jsx)("div",{className:"flex gap-2 flex-wrap",children:s.map(d=>(0,dt.jsx)("button",{type:"button",onClick:()=>p("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Confidence"}),(0,dt.jsxs)(Oe,{value:o.confidence,onValueChange:d=>p("confidence",d),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{})}),(0,dt.jsx)(Fe,{children:c.map(d=>(0,dt.jsx)(ie,{value:d.value,children:d.label},d.value))})]})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Phase"}),(0,dt.jsxs)(Oe,{value:o.phase.toString(),onValueChange:d=>p("phase",parseInt(d)),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{})}),(0,dt.jsx)(Fe,{children:n.map(d=>(0,dt.jsx)(ie,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Start Date"}),(0,dt.jsx)(Z,{type:"date",value:o.startDate,onChange:d=>p("startDate",d.target.value)})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"End Date"}),(0,dt.jsx)(Z,{type:"date",value:o.endDate,onChange:d=>p("endDate",d.target.value)})]})]}),(0,dt.jsxs)(Zt,{children:[(0,dt.jsx)(N,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,dt.jsx)(N,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Mo=require("motion/react");function Ao(e,t){let[a,o]=(0,ae.useState)(()=>{if(typeof window>"u")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch{return t}}),r=s=>{try{o(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch{}};return(0,ae.useEffect)(()=>{r(a)},[]),[a,r]}var da=require("react-icons/fa");function rt({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:c,className:n}){let[u,p]=Ao(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||u;return(0,dt.jsxs)(Mo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${s} p-8 text-white ${n||""}`,children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,dt.jsx)(le,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,dt.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,dt.jsx)(N,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,dt.jsx)("button",{"aria-label":u?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!u),style:{lineHeight:0},children:u?(0,dt.jsx)(da.FaChevronDown,{size:22}):(0,dt.jsx)(da.FaChevronUp,{size:22})})]})]}),!d&&(0,dt.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,dt.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,dt.jsx)(N,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,dt.jsx)(N,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),c&&(0,dt.jsx)("div",{className:"hidden lg:block",children:c})]})]})}var Io=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:s=[],onAddTask:c,onUpdateTask:n,onDeleteTask:u,onTaskClick:p,onAddEpic:d,onAddComment:g})=>{let[T,C]=(0,ae.useState)(e),[h,M]=(0,ae.useState)(t),[b,v]=(0,ae.useState)(a),[z,ne]=(0,ae.useState)(!1),[B,me]=(0,ae.useState)(!1),[k,G]=(0,ae.useState)(null),[ee,V]=(0,ae.useState)(null),[_,se]=(0,ae.useState)(o),[I,nt]=(0,ae.useState)(r),[we,Qe]=(0,ae.useState)(0),be=(0,ae.useRef)(null),st=(0,ae.useRef)(null),et=h.filter(A=>!0).map(A=>A.id),ot=b.find(A=>A.isSelected);et.push(0),(0,ae.useEffect)(()=>{C(e)},[e]),(0,ae.useEffect)(()=>{M(t)},[t]),(0,ae.useEffect)(()=>{v(a)},[a]),(0,ae.useEffect)(()=>{let A=()=>{if(be.current){let Te=be.current.offsetHeight;Qe(Te)}};A();let X=new ResizeObserver(A);be.current&&X.observe(be.current);let Q=()=>{setTimeout(A,100)};return window.addEventListener("storage",Q),()=>{X.disconnect(),window.removeEventListener("storage",Q)}},[]),(0,ae.useEffect)(()=>{let A=setTimeout(()=>{be.current&&Qe(be.current.offsetHeight)},300);return()=>clearTimeout(A)},[z,B]);let tt=T.filter(A=>!0),x=A=>tt.filter(X=>X.status===A),K=A=>{let X={};return h.forEach(Q=>{X[Q.id]=A.filter(Te=>ve(Te.epic)===Q.id)}),X["eo-epic"]=A.filter(Q=>!ve(Q.epic)),X},pe=A=>{V(A)},Ke=A=>{ee&&(C(X=>X.map(Q=>Q.id===ee.id?{...Q,status:A}:Q)),n?.(ee.id.toString(),{status:A}),V(null))},Y=A=>{let X={...A,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};C(Q=>[...Q,X]),c?.(A)},je=async(A,X)=>{if(C(Te=>Te.map(Me=>Me.id===Number(A)?{...Me,...X}:Me)),n)return await n(A,X);let Q=T.find(Te=>Te.id===Number(A));if(!Q)throw new Error("Task not found");return{...Q,...X}},$t=async A=>{C(X=>X.filter(Q=>Q.id!==Number(A))),k?.id===Number(A)&&G(null),u&&await u(A)},lt=A=>{let X={...A,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};M(Q=>[...Q,X]),d?.(A)},Ft=A=>{G(A),p?.(A)},ft=[{id:"todo",title:"To ae",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],kt=we>0?`calc(100vh - ${we+120}px)`:"calc(100vh - 12rem)";return(0,dt.jsxs)("div",{ref:st,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,dt.jsx)("div",{ref:be,className:"flex-shrink-0",children:(0,dt.jsx)(rt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-dt-r from-purple-600 via-violet-600 dt-indigo-600",primaryAction:{label:"Add task",onClick:()=>ne(!0)},secondaryAction:{label:"Add epic",onClick:()=>me(!0)}})}),(0,dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,dt.jsx)("div",{className:"h-full",style:{height:we>0?`calc(100vh - ${we+120}px)`:"calc(100vh - 12rem)"},children:(0,dt.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:ft.map(A=>{let X=x(A.status),Q=K(X);return(0,dt.jsxs)(ao,{title:A.title,status:A.status,taskCount:X.length,onDrop:Ke,isCompact:A.status==="done",height:kt,children:[Q["eo-epic"].map(Te=>(0,dt.jsx)(Jt,{epic:null,task:Te,onDragStart:pe,onTaskClick:Ft,isCompact:A.status==="done"})),et.map(Te=>{let Me=h.find(y=>y.id===Te),m=Q[Te]||[];return m.length===0?null:(0,dt.jsxs)("div",{className:"mb-6",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${Me?.color}`}),(0,dt.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Me?.name||"No Epic"}),(0,dt.jsx)(le,{variant:"secondary",className:"text-xs",children:m.length})]})," ",(0,dt.jsx)("div",{className:"space-y-3",children:m.map(y=>(0,dt.jsx)(Jt,{task:y,epic:Me,onDragStart:pe,onTaskClick:Ft,isCompact:A.status==="done"},y.id))})]},Te)})]},A.id)})})})}),(0,dt.jsx)(Vt,{isOpen:z,onClose:()=>ne(!1),onAddTask:Y,assignees:[...I,..._],epics:h,sprints:b}),(0,dt.jsx)(Ut,{isOpen:B,onClose:()=>me(!1),onAddEpic:lt}),k&&(0,dt.jsx)(Ro,{isOpen:!!k,onClose:()=>G(null),initialTask:k,epics:h,sprints:b,onUpdateTask:je,onDeleteTask:$t,colleagues:[...I,..._],onAddComment:g})]})};var Fo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:s,onAddEpic:c,onUpdateEpic:n,onDeleteEpic:u})=>{let[p,d]=(0,ae.useState)(t),[g,T]=(0,ae.useState)(null),[C,h]=(0,ae.useState)(null),[M,b]=(0,ae.useState)({}),[v,z]=(0,ae.useState)(0),[ne,B]=(0,ae.useState)(!1),[me,k]=(0,ae.useState)(!1),[G,ee]=(0,ae.useState)(null),V=(0,ae.useRef)(null),_=(0,ae.useRef)(null);(0,ae.useEffect)(()=>{d(t)},[t]),(0,ae.useEffect)(()=>{let x=()=>{if(V.current){let Ke=V.current.offsetHeight;z(Ke)}};x();let K=new ResizeObserver(x);V.current&&K.observe(V.current);let pe=()=>{setTimeout(x,100)};return window.addEventListener("storage",pe),()=>{K.disconnect(),window.removeEventListener("storage",pe)}},[]),(0,ae.useEffect)(()=>{let x=setTimeout(()=>{V.current&&z(V.current.offsetHeight)},300);return()=>clearTimeout(x)},[C]);let se=x=>{T(x)},I=x=>{x.preventDefault()},nt=(x,K)=>{x.preventDefault(),g&&ve(g.epic).toString()!==K&&(o(g.id.toString(),{epic:Number(K)}),T(null))},we=x=>e.filter(K=>ve(K.epic).toString()===x),Qe=x=>{h(x.id.toString()),b({name:x.name,description:x.description,confidence:x.confidence,phase:x.phase})},be=async()=>{C&&M.name&&(await n(C.toString(),M),d(x=>x.map(K=>K.id.toString()===C?{...K,...M}:K)),h(null),b({}))},st=()=>{h(null),b({})},et=async x=>{window.confirm("Are you sure you want dt delete this epic? This will also delete all associated tasks.")&&(await u(x),d(K=>K.filter(pe=>pe.id.toString()!==x)))},ot=x=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[x]||`Phase ${x}`,tt=x=>{switch(x){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,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsxs)("div",{ref:_,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,dt.jsx)("div",{ref:V,className:"flex-shrink-0",children:(0,dt.jsx)(rt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-dt-r from-rose-600 via-pink-600 dt-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>B(!0)}})}),(0,dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,dt.jsx)("div",{className:"h-full overflow-y-auto",style:{height:v>0?`calc(100vh - ${v+120}px)`:"calc(100vh - 12rem)"},children:(0,dt.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:p.map(x=>{let K=we(x.id.toString()),pe=K.reduce((Y,je)=>Y+(je.storyPoints||0),0),Ke=v>0?`calc(100vh - ${v+200}px)`:"calc(100vh - 14rem)";return(0,dt.jsxs)(re,{className:`flex flex-col ${C===x.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:C===x.id.toString()?"auto":Ke,minHeight:"400px"},onDragOver:I,onDrop:Y=>nt(Y,x.id.toString()),children:[(0,dt.jsx)("div",{className:"p-4 border-b border-border",children:C===x.id.toString()?(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)(Z,{value:M.name||"",onChange:Y=>b({...M,name:Y.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,dt.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:be,className:"p-1 h-8 w-8",children:(0,dt.jsx)(ct.Check,{className:"h-4 w-4"})}),(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:st,className:"p-1 h-8 w-8",children:(0,dt.jsx)(ct.X,{className:"h-4 w-4"})})]})]}),(0,dt.jsx)(Ee,{value:M.description||"",onChange:Y=>b({...M,description:Y.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,dt.jsxs)("select",{value:M.confidence||x.confidence,onChange:Y=>b({...M,confidence:Y.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,dt.jsx)("option",{value:"low",children:"Low"}),(0,dt.jsx)("option",{value:"medium",children:"Medium"}),(0,dt.jsx)("option",{value:"high",children:"High"})]})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,dt.jsx)("select",{value:M.phase?.toString()||x.phase.toString(),onChange:Y=>b({...M,phase:parseInt(Y.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Y=>(0,dt.jsxs)("option",{value:Y.toString(),children:["Phase ",Y]},Y))})]})]})]}):(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,dt.jsx)("div",{className:`w-4 h-4 rounded-full ${x.color}`}),(0,dt.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:x.name}),(0,dt.jsxs)("div",{className:"flex gap-1",children:[(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>Qe(x),className:"p-1 h-8 w-8",children:(0,dt.jsx)(ct.Edit2,{className:"h-3 w-3"})}),(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>et(x.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"})})]})]}),(0,dt.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,dt.jsxs)(le,{className:`text-xs ${tt(x.confidence)}`,children:[x.confidence," confidence"]}),(0,dt.jsxs)(le,{variant:"outline",className:"text-xs",children:["Phase ",x.phase]}),(0,dt.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,dt.jsxs)(le,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[pe," pts"]})]}),x.description&&(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:x.description}),(0,dt.jsxs)(N,{onClick:()=>{k(!0),ee(x)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,dt.jsx)(ct.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,dt.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,dt.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:K.length===0?(0,dt.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,dt.jsx)(ct.Move,{className:"h-8 w-8 mb-2"}),(0,dt.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(Y=>(0,dt.jsx)(Jt,{task:Y,epic:x,onDragStart:se,onTaskClick:r,isCompact:!0},Y.id))})})]},x.id)})})})})]}),(0,dt.jsx)(Ut,{isOpen:ne,onClose:()=>B(!1),onAddEpic:c}),(0,dt.jsx)(Vt,{isOpen:me,onClose:()=>k(!1),onAddTask:s,assignees:[],epics:[],defaultEpicId:G?.id.toString()||"",sprints:a})]})};var Lo=require("react-day-picker");function ca({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,dt.jsx)(Lo.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:w("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center dt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:w(aa({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:w("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-dt-md first:[&:has([aria-selected])]:rounded-dt-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:w(aa({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}ca.displayName="Calendar";var Oo=ge(require("react")),it=ge(require("@radix-ui/react-popover"));var Ra=it.Root,Ea=it.Trigger;var ma=Oo.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,dt.jsx)(it.Portal,{children:(0,dt.jsx)(it.Content,{ref:r,align:t,sideOffset:a,className:w("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));ma.displayName=it.Content.displayName;var Ma=require("date-fns");var Vo=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,r]=(0,ae.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),s=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},c=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,dt.jsx)(_e,{open:e,onOpenChange:c,children:(0,dt.jsxs)(He,{className:"sm:max-w-md",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New Sprint"})}),(0,dt.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"name",children:"Sprint Name *"}),(0,dt.jsx)(Z,{id:"name",value:o.name,onChange:n=>r(u=>({...u,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{htmlFor:"description",children:"Description"}),(0,dt.jsx)(Ee,{id:"description",value:o.description,onChange:n=>r(u=>({...u,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"Start Date *"}),(0,dt.jsxs)(Ra,{children:[(0,dt.jsx)(Ea,{asChild:!0,children:(0,dt.jsxs)(N,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,dt.jsx)(ct.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ma.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,dt.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,dt.jsx)(ca,{mode:"single",selected:o.startDate,onSelect:n=>r(u=>({...u,startDate:n})),initialFocus:!0})})]})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)(R,{children:"End Date *"}),(0,dt.jsxs)(Ra,{children:[(0,dt.jsx)(Ea,{asChild:!0,children:(0,dt.jsxs)(N,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,dt.jsx)(ct.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ma.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,dt.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,dt.jsx)(ca,{mode:"single",selected:o.endDate,onSelect:n=>r(u=>({...u,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,dt.jsxs)("div",{className:"flex justify-end gap-3 dt-4",children:[(0,dt.jsx)(N,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),(0,dt.jsx)(N,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Ho=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:s,onUpdateSprint:c,onDeleteSprint:n})=>{let[u,p]=(0,ae.useState)([]),[d,g]=(0,ae.useState)(new Set),[T,C]=(0,ae.useState)(null),[h,M]=(0,ae.useState)(!1),[b,v]=(0,ae.useState)(null),[z,ne]=(0,ae.useState)(null),[B,me]=(0,ae.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[k,G]=(0,ae.useState)([]),[ee,V]=(0,ae.useState)("upcoming"),[_,se]=(0,ae.useState)(!1),[I,nt]=(0,ae.useState)(0),we=(0,ae.useRef)(null),Qe=(0,ae.useRef)(null);(0,ae.useEffect)(()=>{let m=()=>{we.current&&nt(we.current.offsetHeight)};m();let y=new ResizeObserver(m);return we.current&&y.observe(we.current),()=>y.disconnect()},[]);let be=m=>t.find(y=>y.id===Number(m)),st=m=>a.find(y=>y.id===Number(m)),et=m=>{let y={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return y[m]||y.medium},ot=m=>{if(!m||m?.length===0)return"";let y=m?.trim().split(" ");if(y?.length===1)return y[0];let $=y[0],q=y[y.length-1][0].toUpperCase();return`${$} ${q}`},tt=m=>{let y={},$=[];return m.forEach(q=>{q.epic?(y[ve(q.epic)]||(y[ve(q.epic)]=[]),y[ve(q.epic)].push(q)):$.push(q)}),{tasksByEpic:y,unassignedTasks:$}};(0,ae.useEffect)(()=>{G(a)},[a]);let x=k.filter(m=>{switch(ee){default:return!0}}),K=k.filter(m=>u.includes(m.id.toString())),pe=e.filter(m=>!m.sprint||m.status==="backlog"),Ke=pe.reduce((m,y)=>m+(y.storyPoints||0),0),Y=m=>{p(y=>y.includes(m)?y.filter($=>$!==m):y?.length<3?[...y,m]:y)},je=m=>{g(y=>{let $=new Set(y);return $.has(m)?$.delete(m):$.add(m),$})},$t=m=>{s(m),M(!1)},lt=m=>{ne(m.id.toString()),me({name:m.name,description:m.description||"",startDate:m.startDate?new Date(m.startDate).toISOString().split("T")[0]:m.startDate,endDate:m.endDate?new Date(m.endDate).toISOString().split("T")[0]:m.endDate,isActive:!1})},Ft=()=>{z&&(c(z,{name:B.name,description:B.description,startDate:B.startDate,endDate:B.endDate}),G(m=>m.map(y=>(y.id===Number(z)&&(y.name=B.name,y.description=B.description,y.startDate=B.startDate,y.endDate=B.endDate),y))),ne(null))},ft=()=>{ne(null),me({name:"",description:"",startDate:"",endDate:"",isActive:!1})},kt=(m,y)=>{C(y),m.dataTransfer.effectAllowed="move"},A=m=>{m.preventDefault(),m.dataTransfer.dropEffect="move"},X=m=>{v(m)},Q=()=>{v(null)},Te=(m,y)=>{if(m.preventDefault(),v(null),!T)return;(ve(T.sprint)||void 0)!==Number(y)&&o(T.id.toString(),{sprint:Number(y)}),C(null)},Me=({task:m,showSprint:y=!1})=>{let $=m.epic?be(ve(m.epic).toString()):null,q=m.sprint?st(ve(m.sprint).toString()):null;return(0,dt.jsx)(re,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:Be=>{Be.dataTransfer.effectAllowed="move",Be.dataTransfer.setData("text/plain",m.id.toString()),kt(Be,m)},onClick:Be=>{T===null&&r(m)},style:{userSelect:"none"},children:(0,dt.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,dt.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,dt.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:m.name}),(0,dt.jsx)(le,{className:`text-xs ${et(m.priority||"medium")}`,children:m.priority?.[0]?.toUpperCase()})]}),(0,dt.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-1",children:[$&&(0,dt.jsx)("div",{className:`w-2 h-2 rounded-full ${$.color}`}),(0,dt.jsx)("span",{className:"text-muted-foreground truncate",children:$?.name})]}),(0,dt.jsx)("span",{className:"text-muted-foreground",children:ot(m.assignee?.value?.name)})]}),y&&q&&(0,dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,dt.jsx)(ct.Calendar,{className:"h-3 w-3"}),(0,dt.jsx)("span",{children:q.name})]})]})})};return(0,dt.jsxs)("div",{ref:Qe,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,dt.jsx)("div",{ref:we,className:"flex-shrink-0",children:(0,dt.jsx)(rt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-dt-r from-orange-600 via-amber-600 dt-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>M(!0)}})}),(0,dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,dt.jsxs)("div",{className:"h-full",style:{height:I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)"},children:[(0,dt.jsxs)("div",{className:"mb-4",children:[(0,dt.jsx)(re,{className:"p-3 bg-card shadow-sm",children:(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,dt.jsxs)("p",{className:"text-xs text-muted-foreground",children:[u?.length,"/3 selected"]})]}),u?.length>0&&(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,dt.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(m=>(0,dt.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,dt.jsx)("span",{className:"max-w-[80px] truncate",children:m.name}),(0,dt.jsx)("button",{onClick:()=>Y(m.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,dt.jsx)(ct.X,{className:"h-4 w-4"})})]},m.id))})]})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsxs)(N,{onClick:()=>M(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,dt.jsx)(ct.Plus,{className:"h-3 w-3"}),"Add"]}),(0,dt.jsxs)(N,{onClick:()=>se(!_),variant:"outline",size:"sm",className:"gap-1",children:[(0,dt.jsx)(ct.Calendar,{className:"h-3 w-3"}),_?"Close":"Select"]})]})]})}),_&&(0,dt.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>se(!1)}),(0,dt.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-dt shadow-xl z-10 transition-all duration-300 ease-in-out ${_?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,dt.jsxs)(re,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,dt.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,dt.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>se(!1),className:"h-8 w-8 p-0",children:(0,dt.jsx)(ct.X,{className:"h-4 w-4"})})]}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up dt 3 sprints dt view in your planning board"})]}),(0,dt.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,dt.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(m=>(0,dt.jsxs)(N,{variant:ee===m.key?"default":"outline",size:"sm",onClick:()=>V(m.key),className:"text-xs h-8 px-3 flex-1",children:[m.label," (",m.count,")"]},m.key))}),(0,dt.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:x.length>0?x.map(m=>{let y=u.includes(m.id.toString()),$=e.filter(Pe=>ve(Pe.sprint)===m.id).length,q=!y&&u.length<3;return(0,dt.jsx)("div",{className:`p-3 rounded-lg border transition-all ${y?"bg-primary/10 border-primary/30":q?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:z===m.id.toString()?(0,dt.jsxs)("div",{className:"space-y-3",children:[(0,dt.jsx)(Z,{value:B.name,onChange:Pe=>me(Re=>({...Re,name:Pe.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,dt.jsx)(Ee,{value:B.description,onChange:Pe=>me(Re=>({...Re,description:Pe.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,dt.jsxs)("div",{className:"flex gap-2",children:[(0,dt.jsxs)(N,{size:"sm",onClick:()=>Ft(),className:"flex-1",children:[(0,dt.jsx)(ct.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,dt.jsxs)(N,{size:"sm",variant:"outline",onClick:ft,className:"flex-1",children:[(0,dt.jsx)(ct.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,dt.jsxs)("div",{children:[(0,dt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,dt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,dt.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:m.name}),(0,dt.jsx)(le,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,dt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:m.description}),(0,dt.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,dt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.CalendarDays,{className:"h-3 w-3"}),new Date(m.startDate).toLocaleDateString()]}),(0,dt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,dt.jsx)(ct.User,{className:"h-3 w-3"}),$," tasks"]})]})]}),(0,dt.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>lt(m),className:"h-6 w-6 p-0",children:(0,dt.jsx)(ct.Edit2,{className:"h-3 w-3"})}),(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"})})]})]}),(0,dt.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,dt.jsx)(N,{variant:y?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Y(m.id.toString()),disabled:!y&&u?.length>=3,children:(0,dt.jsx)("span",{className:"pointer-events-none select-none",children:y?"Deselect":u?.length>=3?"Limit Reached":"Select"})})})]})},m.id)}):(0,dt.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,dt.jsx)(ct.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,dt.jsxs)("p",{className:"text-sm",children:['No sprints found for "',ee,'" filter']}),(0,dt.jsx)(N,{variant:"link",size:"sm",onClick:()=>V("all"),className:"text-xs",children:"Show all sprints"})]})}),u?.length===0&&(0,dt.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,dt.jsxs)("div",{className:"text-center",children:[(0,dt.jsx)(ct.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints dt start planning"}),(0,dt.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up dt 3 sprints dt view alongside your backlog"})]})})]})]})})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,dt.jsx)("div",{className:"lg:col-span-1",children:(0,dt.jsxs)(re,{className:"p-4 h-full bg-card border-dt-4 border-dt-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:A,onDragEnter:()=>X("backlog"),onDragLeave:Q,onDrop:m=>Te(m,"backlog"),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,dt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsxs)(le,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[pe?.length," tasks"]}),(0,dt.jsxs)(le,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Ke," pts"]})]})]}),(0,dt.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${b==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:m,unassignedTasks:y}=tt(pe);return(0,dt.jsxs)(dt.Fragment,{children:[Object.entries(m).map(([$,q])=>{let Pe=be($);if(!Pe)return null;let Re=d.has($);return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je($),children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${Pe.color}`}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:Pe.name}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",q?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:Re?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:q.map(Be=>(0,dt.jsx)(Me,{task:Be},Be.id))})]},$)}),y?.length>0&&(()=>{let $=d.has("eo-epic");return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je("eo-epic"),children:[(0,dt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",y?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:$?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!$&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:y?.map(q=>(0,dt.jsx)(Me,{task:q},q.id))})]})})(),pe?.length===0&&(0,dt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here dt move dt backlog"}),pe?.length>0&&Object.keys(m).length===0&&y.length===0&&(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),pe?.map($=>(0,dt.jsx)(Me,{task:$},$.id))]})]})})()})]})}),K.map(m=>{let y=e.filter(q=>ve(q?.sprint)===m.id),$=y.reduce((q,Pe)=>q+(Pe?.storyPoints||0),0);return(0,dt.jsxs)(re,{className:"p-4 h-full bg-card border-dt-4 border-dt-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:A,onDragEnter:()=>X(m.id.toString()),onDragLeave:Q,onDrop:q=>Te(q,m.id.toString()),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,dt.jsx)("div",{children:(0,dt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:m.name})}),(0,dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,dt.jsxs)(le,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[y?.length," tasks"]}),(0,dt.jsxs)(le,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[$," pts"]}),(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>{se(!0),lt(m)},className:"h-6 px-2",children:(0,dt.jsx)(ct.Edit2,{className:"h-3 w-3"})}),(0,dt.jsx)(N,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,dt.jsx)(ct.Trash2,{className:"h-3 w-3"})})]})]}),(0,dt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:q,unassignedTasks:Pe}=tt(y);return(0,dt.jsxs)(dt.Fragment,{children:[Object.entries(q).map(([Re,Be])=>{let jt=be(Re);if(!jt)return null;let Wt=d.has(Re);return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je(Re),children:[(0,dt.jsx)("div",{className:`w-3 h-3 rounded-full ${jt.color}`}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:jt.name}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",Be?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:Wt?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Wt&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:Be?.map(_t=>(0,dt.jsx)(Me,{task:_t},_t.id))})]},Re)}),Pe?.length>0&&(()=>{let Re=d.has("eo-epic");return(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je("eo-epic"),children:[(0,dt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,dt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,dt.jsxs)("span",{className:"text-muted-foreground",children:["(",Pe?.length,")"]}),(0,dt.jsx)("div",{className:"ml-auto",children:Re?(0,dt.jsx)(ct.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,dt.jsx)(ct.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Re&&(0,dt.jsx)("div",{className:"space-y-2 pl-2",children:Pe?.map(Be=>(0,dt.jsx)(Me,{task:Be},Be.id))})]})})(),y?.length===0&&(0,dt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},m.id)})]}),(0,dt.jsx)(Vo,{isOpen:h,onClose:()=>M(!1),onAddSprint:$t})]})})]})};var yi=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),wi=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})},Ia=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[r,s]=t.split(":");o.setHours(parseInt(r),parseInt(s))}return o<a},Fa=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ni=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Ci=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[r,s]=(0,$e.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[c,n]=(0,$e.useState)(!1),u=d=>{if(d.preventDefault(),!e.find(C=>C?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let T={title:r.title,description:r.description,dueDate:new Date(r.dueDate).toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring,assignedColleague:Number(r.colleagueId),project:1,updatedAt:new Date().toISOString()};t(T),o(!1),s({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,$e.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let p=e.filter(Boolean);return(0,dt.jsx)(_e,{open:a,onOpenChange:o,children:(0,dt.jsxs)(He,{className:"max-w-2xl",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New Reminder"})}),(0,dt.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,dt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"title",children:"Title"}),(0,dt.jsx)(Z,{id:"title",value:r.title,onChange:d=>s({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"description",children:"Description"}),(0,dt.jsx)(Ee,{id:"description",value:r.description,onChange:d=>s({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"dueDate",children:"Due Date"}),(0,dt.jsx)(Z,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>s({...r,dueDate:d.target.value}),required:!0})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,dt.jsx)(Z,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>s({...r,dueTime:d.target.value})})]})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{className:`${c?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,dt.jsxs)(Oe,{value:r.colleagueId,onValueChange:d=>{s({...r,colleagueId:d})},required:!0,children:[(0,dt.jsx)(Ie,{className:`${c?"text-destructive border-red-500":""}`,children:(0,dt.jsx)(at,{className:`${c?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,dt.jsx)(Fe,{children:p.map(d=>(0,dt.jsx)(ie,{value:d.id.toString(),children:d.name},d.id))})]}),c&&(0,dt.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,dt.jsxs)("div",{className:"space-y-2",children:[(0,dt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,dt.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>s({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,dt.jsx)(R,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,dt.jsxs)(Oe,{value:r.recurrencePattern,onValueChange:d=>s({...r,recurrencePattern:d}),children:[(0,dt.jsx)(Ie,{children:(0,dt.jsx)(at,{})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsx)(ie,{value:"daily",children:"Daily"}),(0,dt.jsx)(ie,{value:"weekly",children:"Weekly"}),(0,dt.jsx)(ie,{value:"monthly",children:"Monthly"}),(0,dt.jsx)(ie,{value:"yearly",children:"Yearly"})]})]})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"recurrenceInterval",children:"Every"}),(0,dt.jsx)(Z,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>s({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,dt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,dt.jsx)(N,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,dt.jsx)(N,{type:"submit",children:"Add Reminder"})]})]})]})})},ki=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[s,c]=(0,$e.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=p=>{p.preventDefault(),a(e.id.toString(),{title:s.title,description:s.description,dueDate:new Date(s.dueDate||"").toISOString(),dueTime:s.dueTime||void 0,isRecurring:s.isRecurring}),r()},u=t.filter(Boolean);return(0,dt.jsx)(_e,{open:o,onOpenChange:r,children:(0,dt.jsxs)(He,{className:"max-w-2xl",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Edit Reminder"})}),(0,dt.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,dt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-title",children:"Title"}),(0,dt.jsx)(Z,{id:"edit-title",value:s.title,onChange:p=>c({...s,title:p.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-description",children:"Description"}),(0,dt.jsx)(Ee,{id:"edit-description",value:s.description||"",onChange:p=>c({...s,description:p.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,dt.jsx)(Z,{id:"edit-dueDate",type:"date",value:s.dueDate,onChange:p=>c({...s,dueDate:p.target.value}),required:!0})]}),(0,dt.jsxs)("div",{children:[(0,dt.jsx)(R,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,dt.jsx)(Z,{id:"edit-dueTime",type:"time",value:s.dueTime,onChange:p=>c({...s,dueTime:p.target.value})})]})]}),(0,dt.jsx)("div",{className:"space-y-2",children:(0,dt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,dt.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:s.isRecurring||!1,onChange:p=>c({...s,isRecurring:p.target.checked}),className:"rounded border-border"}),(0,dt.jsx)(R,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,dt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,dt.jsx)(N,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,dt.jsx)(N,{type:"submit",children:"Save Changes"})]})]})]})})},Si=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,s]=(0,$e.useState)(!1);if(!e||!e.id)return null;let c=Ia(new Date(e.dueDate||""),e.dueTime||""),n=Fa(new Date(e.dueDate||"")),u=Ni(new Date(e.dueDate||"")),p=()=>{a(e.id.toString(),{})},d=()=>n?"Today":u?"Tomorrow":yi(new Date(e.dueDate||""));return(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(ki,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>s(!1)}),(0,dt.jsx)(re,{children:(0,dt.jsx)(Ot,{className:"p-4",children:(0,dt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,dt.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,dt.jsx)("button",{onClick:p,className:"mt-1 text-primary hover:text-primary/80"}),(0,dt.jsxs)("div",{className:"flex-1",children:[(0,dt.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,dt.jsx)("h3",{children:e.title})}),(0,dt.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,dt.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,dt.jsx)(ct.Calendar,{className:"h-4 w-4"}),(0,dt.jsx)("span",{className:c?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,dt.jsx)(ct.Clock,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:wi(e.dueTime)})]}),(0,dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,dt.jsx)(ct.User,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,dt.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>s(!0),className:"h-8 w-8 p-0",children:(0,dt.jsx)(ct.Edit2,{className:"h-4 w-4"})}),(0,dt.jsx)(N,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,dt.jsx)(ct.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Uo=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[s,c]=(0,$e.useState)(e.filter(Boolean)),[n,u]=(0,$e.useState)(t.filter(Boolean)),[p,d]=(0,$e.useState)("all"),[g,T]=(0,$e.useState)(""),[C,h]=(0,$e.useState)(!1);(0,$e.useEffect)(()=>{c(e.filter(Boolean))},[e]),(0,$e.useEffect)(()=>{u(t.filter(Boolean))},[t]);let M=k=>{if(!k.title){console.error("Invalid reminder data:",k);return}let G={...k,id:Date.now(),createdAt:new Date().toISOString()};c(ee=>[...ee,G]),a?.(k)},b=(k,G)=>{if(!k){console.error("No reminder ID provided for update");return}c(ee=>ee.map(V=>V?.id.toString()===k?{...V,...G}:V)),o?.(k,G)},v=k=>{if(!k){console.error("No reminder ID provided for deletion");return}c(G=>G.filter(ee=>ee?.id.toString()!==k)),r?.(k)},ne=s.filter(k=>{if(!k)return!1;if(g){let G=g.toLowerCase();if(!(k.title.toLowerCase().includes(G)||k.description?.toLowerCase().includes(G)))return!1}switch(p){case"pending":case"completed":case"overdue":return Ia(new Date(k.dueDate||""),k.dueTime||"");case"today":return Fa(new Date(k.dueDate||""));default:return!0}}).sort((k,G)=>{if(!k||!G)return 0;let ee={high:3,medium:2,low:1},V=0;return V!==0?V:new Date(k.dueDate||"").getTime()-new Date(G.dueDate||"").getTime()}),B={total:s.filter(Boolean).length,overdue:s.filter(k=>k&&Ia(new Date(k.dueDate||""),k.dueTime||"")).length,today:s.filter(k=>k&&Fa(new Date(k.dueDate||""))).length},me=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,dt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,dt.jsx)(rt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-dt-r from-emerald-600 via-teal-600 dt-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,dt.jsxs)("div",{className:"h-full bg-background",children:[(0,dt.jsx)(Ci,{colleagues:n,onAddReminder:M,open:C,setOpen:h}),(0,dt.jsxs)("div",{className:"p-6",children:[(0,dt.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,dt.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,dt.jsxs)(N,{className:"flex items-center space-x-2",onClick:()=>h(!0),children:[(0,dt.jsx)(ct.Plus,{className:"h-4 w-4"}),(0,dt.jsx)("span",{children:"Add Reminder"})]})]}),(0,dt.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,dt.jsxs)(re,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-foreground",children:B.total}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,dt.jsxs)(re,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-primary",children:B.overdue}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,dt.jsxs)(re,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-success",children:B.today}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,dt.jsxs)(re,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-destructive",children:B.overdue}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,dt.jsxs)(re,{className:"p-4",children:[(0,dt.jsx)("div",{className:"text-2xl font-bold text-warning",children:B.today}),(0,dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,dt.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,dt.jsx)("div",{className:"flex-1",children:(0,dt.jsx)(Z,{placeholder:"Search reminders...",value:g,onChange:k=>T(k.target.value),className:"max-w-md"})}),(0,dt.jsxs)(Oe,{value:p,onValueChange:k=>d(k),children:[(0,dt.jsx)(Ie,{className:"w-40",children:(0,dt.jsx)(at,{})}),(0,dt.jsxs)(Fe,{children:[(0,dt.jsxs)(ie,{value:"all",children:["All (",B.total,")"]}),(0,dt.jsxs)(ie,{value:"overdue",children:["Overdue (",B.overdue,")"]}),(0,dt.jsxs)(ie,{value:"overdue",children:["Overdue (",B.overdue,")"]}),(0,dt.jsxs)(ie,{value:"today",children:["Today (",B.today,")"]})]})]})]}),(0,dt.jsx)("div",{className:"space-y-4",children:ne.length===0?(0,dt.jsxs)(re,{className:"p-8 text-center",children:[(0,dt.jsx)("div",{className:"text-muted-foreground",children:g||p!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&p==="all"&&(0,dt.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder dt get started"})]}):ne.map(k=>k&&(0,dt.jsx)(Si,{reminder:k,colleagues:n,onUpdateReminder:b,onDeleteReminder:v},k.id))})]})]})]})};var It=ge(require("@radix-ui/react-tabs"));function Go({className:e,...t}){return(0,dt.jsx)(It.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",e),...t})}function $o({className:e,...t}){return(0,dt.jsx)(It.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function jo({className:e,...t}){return(0,dt.jsx)(It.Trigger,{"data-slot":"tabs-trigger",className:w("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 gt=ge(require("react")),U=ge(require("@radix-ui/react-dropdown-menu")),Gt=require("@radix-ui/react-icons");var Wo=U.Root,_o=U.Trigger;var Di=gt.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,dt.jsxs)(U.SubTrigger,{ref:r,className:w("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,dt.jsx)(Gt.ChevronRightIcon,{className:"ml-auto"})]}));Di.displayName=U.SubTrigger.displayName;var Ti=gt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(U.SubContent,{ref:a,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Ti.displayName=U.SubContent.displayName;var La=gt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,dt.jsx)(U.Portal,{children:(0,dt.jsx)(U.Content,{ref:o,sideOffset:t,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));La.displayName=U.Content.displayName;var Ba=gt.forwardRef(({className:e,inset:t,...a},o)=>(0,dt.jsx)(U.Item,{ref:o,className:w("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}));Ba.displayName=U.Item.displayName;var Pi=gt.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,dt.jsxs)(U.CheckboxItem,{ref:r,className:w("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,dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dt.jsx)(U.ItemIndicator,{children:(0,dt.jsx)(Gt.CheckIcon,{className:"h-4 w-4"})})}),t]}));Pi.displayName=U.CheckboxItem.displayName;var Ri=gt.forwardRef(({className:e,children:t,...a},o)=>(0,dt.jsxs)(U.RadioItem,{ref:o,className:w("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,dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,dt.jsx)(U.ItemIndicator,{children:(0,dt.jsx)(Gt.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ri.displayName=U.RadioItem.displayName;var Ei=gt.forwardRef(({className:e,inset:t,...a},o)=>(0,dt.jsx)(U.Label,{ref:o,className:w("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Ei.displayName=U.Label.displayName;var Ai=gt.forwardRef(({className:e,...t},a)=>(0,dt.jsx)(U.Separator,{ref:a,className:w("-mx-1 my-1 h-px bg-muted",e),...t}));Ai.displayName=U.Separator.displayName;var Mi=({className:e,...t})=>(0,dt.jsx)("span",{className:w("ml-auto text-xs tracking-widest opacity-60",e),...t});Mi.displayName="DropdownMenuShortcut";function qo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:r="700px",gridCols:s=6}){let c=a.find(n=>n.value===e);return(0,dt.jsxs)(Mo.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,dt.jsx)("div",{className:"hidden lg:block",children:(0,dt.jsx)(Go,{value:e,onValueChange:t,children:(0,dt.jsx)($o,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(s,a.length)}, minmax(0, 1fr))`},children:a.map(n=>(0,dt.jsx)(Mo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,dt.jsx)(jo,{value:n.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:n.label})},n.value))})})}),(0,dt.jsx)("div",{className:"lg:hidden",children:(0,dt.jsxs)(Wo,{children:[(0,dt.jsx)(_o,{asChild:!0,children:(0,dt.jsxs)(N,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[c?.label||"Select",(0,dt.jsx)(ct.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,dt.jsx)(La,{align:"center",className:"w-[180px]",children:a.map(n=>(0,dt.jsx)(Ba,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function ua({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:s}){return(0,dt.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${s||""}`,children:[r&&(0,dt.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,dt.jsx)("div",{className:"col-span-6",children:"Name"}),(0,dt.jsx)("div",{className:"col-span-2",children:"Size"}),(0,dt.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,dt.jsx)("div",{className:"divide-y",children:e.map(c=>(0,dt.jsxs)(Mo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(c),children:[(0,dt.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,dt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,dt.jsx)("div",{children:(0,dt.jsx)("p",{className:"font-medium",children:c.name})})]}),(0,dt.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:c.filesize}),(0,dt.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,dt.jsx)("span",{className:"text-sm md:text-base",children:typeof c.createdAt=="string"?c.createdAt:new Date(c.createdAt).toLocaleDateString()}),(0,dt.jsx)("div",{className:"flex gap-1",children:(0,dt.jsx)(N,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(c)},children:(0,dt.jsx)(ct.Trash2,{className:"h-4 w-4"})})})]})]},c.name))})]})}var Zo=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,ae.useState)(null),[s,c]=(0,ae.useState)(""),[n,u]=(0,ae.useState)(""),[p,d]=(0,ae.useState)(""),g=C=>{let h=C.target.files?.[0];h&&(r(h),s||c(h.name))},T=async C=>{if(C.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",s),n&&h.append("description",n),p&&h.append("tags",p),a?.(h),t(),r(null),c(""),u(""),d("")};return(0,dt.jsx)(_e,{open:e,onOpenChange:t,children:(0,dt.jsxs)(He,{className:"sm:max-w-md",children:[(0,dt.jsx)(Ue,{children:(0,dt.jsx)(Ge,{children:"Add New File"})}),(0,dt.jsxs)("form",{onSubmit:T,className:"grid gap-4",children:[(0,dt.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,dt.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,dt.jsxs)("div",{className:"flex flex-col items-center justify-center dt-5 pb-6",children:[(0,dt.jsx)(Ii,{className:"w-10 h-10 text-gray-400"}),(0,dt.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,dt.jsx)("span",{className:"font-semibold",children:"Click dt upload"})," or drag and drop"]}),(0,dt.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,dt.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),o&&(0,dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,dt.jsxs)("div",{children:[(0,dt.jsx)("p",{className:"font-medium",children:o.name}),(0,dt.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,dt.jsx)(N,{type:"submit",onClick:T,children:"Upload"})]})]})]})})};function Ii(e){return(0,dt.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,dt.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,dt.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,dt.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function za({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:r,compactView:s=!1,className:c}){let[n,u]=(0,ae.useState)(e),[p,d]=(0,ae.useState)(""),[g,T]=(0,ae.useState)("all"),[C,h]=(0,ae.useState)("all"),[M,b]=(0,ae.useState)(!1);(0,ae.useEffect)(()=>{u(e)},[e]);let v=n.filter(V=>V.name.toLowerCase().includes(p.toLowerCase())),z=v.slice(0,10),ne=v.filter(Boolean),B=()=>{b(!0)},me=V=>{a?.(V)},k=V=>{console.log("deleting file",V),u(_=>_.filter(se=>se.name!==V.name)),o?.(V.id.toString())},G=V=>{r?.(V)},ee=()=>{d(""),T("all")};return(0,dt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,dt.jsx)(Mo.AnimatePresence,{mode:"wait",children:(0,dt.jsx)(Mo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,dt.jsxs)("div",{className:`space-y-6 ${c||""}`,children:[(0,dt.jsx)(rt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-dt-r from-blue-600 via-indigo-600 dt-purple-600",primaryAction:{label:"Upload file",onClick:B},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,dt.jsx)(re,{children:(0,dt.jsx)(Ot,{className:"dt-6",children:(0,dt.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,dt.jsx)("div",{className:"flex-1",children:(0,dt.jsxs)("div",{className:"relative",children:[(0,dt.jsx)(ct.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,dt.jsx)(Z,{placeholder:"Search files...",value:p,onChange:V=>d(V.target.value),className:"pl-9"})]})}),(p||g!=="all")&&(0,dt.jsxs)(N,{variant:"outline",onClick:ee,className:"gap-2",children:[(0,dt.jsx)(ct.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,dt.jsxs)("div",{className:"space-y-4",children:[(0,dt.jsx)(qo,{activeTab:C,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${v.length})`},{value:"recent",label:`Recent (${z.length})`}],maxWidth:"500px",gridCols:3}),C==="all"&&(0,dt.jsx)(ua,{files:v,onFileClick:G,onFileEdit:me,onFileDelete:k,showHeader:!s}),C==="recent"&&(0,dt.jsx)(ua,{files:z,onFileClick:G,onFileEdit:me,onFileDelete:k,showHeader:!s}),C==="shared"&&(0,dt.jsx)(ua,{files:ne,onFileClick:G,onFileEdit:me,onFileDelete:k,showHeader:!s})]}),v.length===0&&(0,dt.jsx)(re,{children:(0,dt.jsx)(Ot,{className:"dt-6",children:(0,dt.jsxs)("div",{className:"text-center py-8",children:[(0,dt.jsx)(ct.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,dt.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,dt.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"?"Try adjusting your filters dt see more results.":"Get started by uploading your first file."}),(0,dt.jsxs)(N,{onClick:B,className:"gap-2",children:[(0,dt.jsx)(ct.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,dt.jsx)(Zo,{isOpen:M,onClose:()=>b(!1),onAddFile:t})]})}var Yo=require("next/navigation");function Qo({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:s=[],initialColleagues:c=[],initialUsers:n=[],initialFiles:u=[],initialView:p="kanban",onAddTask:d,onUpdateTask:g,onDeleteTask:T,onTaskClick:C,onAddEpic:h,onUpdateEpic:M,onDeleteEpic:b,onAddTaskToEpic:v,onAddSprint:z,onUpdateSprint:ne,onDeleteSprint:B,onAddProject:me,onUpdateProject:k,onDeleteProject:G,onFileAdd:ee,onFileEdit:V,onFileDelete:_,onFileClick:se,onAddReminder:I,onUpdateReminder:nt,onDeleteReminder:we,onViewChange:Qe,onToggleMobileMenu:be,onTeamClick:st,onTeamChange:et,onCopilotClick:ot,handleAddComment:tt}){let[x,K]=(0,ae.useState)(t),[pe,Ke]=(0,ae.useState)(a),[Y,je]=(0,ae.useState)(o),[$t,lt]=(0,ae.useState)(r),[Ft,ft]=(0,ae.useState)(s),[kt,A]=(0,ae.useState)(c),[X,Q]=(0,ae.useState)(n),[Te,Me]=(0,ae.useState)(u),[m,y]=(0,ae.useState)(!1),[$,q]=(0,ae.useState)(!1),[Pe,Re]=(0,ae.useState)(null),[Be,jt]=(0,ae.useState)(null),[Wt,_t]=(0,ae.useState)(null),[St,Va]=(0,ae.useState)(p||"kanban"),[Li,er]=(0,ae.useState)(!1),tr=(0,Yo.useRouter)();(0,ae.useEffect)(()=>{K(t)},[t]),(0,ae.useEffect)(()=>{je(o)},[o]),(0,ae.useEffect)(()=>{Ke(a)},[a]),(0,ae.useEffect)(()=>{lt(r)},[r]),(0,ae.useEffect)(()=>{Me(u)},[u]),(0,ae.useEffect)(()=>{Q(n)},[n]),(0,ae.useEffect)(()=>{A(c)},[c]),(0,ae.useEffect)(()=>{ft(s)},[s]),(0,ae.useEffect)(()=>{Va(p)},[p]);let ar=x.filter(f=>{}),Bi=f=>ar.filter(E=>E.status===f),Oi=f=>{let E={};return pe.forEach(F=>{}),E},zi=f=>{_t(f)},Vi=f=>{Wt&&(K(E=>E.map(F=>F.id===Wt.id?{...F,status:f}:F)),_t(null))},Ha=f=>{let E={...f,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K(F=>[...F,E]),d?.(E)},ea=async(f,E)=>(K(F=>F.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),await g?.(f,E)),Hi=async(f,E)=>{ea(f,E)},Ua=f=>{K(E=>E.filter(F=>F.id!==Number(f))),Pe?.id===Number(f)&&Re(null),T?.(f)},Ui=async f=>{Ua(f)},Gi=f=>{let E={...f,id:Date.now()};lt(F=>[...F,E]),me?.(f)},$dt=(f,E)=>{lt(F=>F.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),k?.(f,E)},ji=f=>{lt(E=>E.filter(F=>F.id!==Number(f))),G?.(f)},Ga=f=>{let E={...f,id:Date.now()};Ke(F=>[...F,E]),h?.({...E})},or=()=>{q(!0)},rr=(f,E)=>{Ke(F=>F.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),M?.(f,E)},ir=f=>{Ke(E=>E.filter(F=>F.id!==Number(f))),K(E=>E.filter(F=>ve(F.epic)!==Number(f))),b?.(f)},nr=f=>{let E={...f,id:Date.now()};je(F=>[...F,E]),z?.(f)},sr=(f,E)=>{je(F=>F.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),ne?.(f,E)},lr=f=>{f==="backlog"||f==="all-tasks"||(je(E=>E.filter(F=>F.id!==Number(f))),K(E=>E.map(F=>ve(F.sprint)===Number(f)?{...F,sprint:void 0}:F)),B?.(f))},fa=f=>{Re(f)},dr=f=>{f==="planning"&&window.innerWidth<768||(Va(f),Qe?.(f))},Wi=()=>{er(f=>!f),be?.()},_i=()=>{tr.push("/")},Ki=f=>{console.log("Switching dt team:",f)},qi=f=>{console.log("Switching dt team:",f)},cr=f=>{y(!0)},mr=()=>{y(!1),jt(null)},pr=f=>{let E={...f,id:Date.now(),createdAt:new Date().toISOString()};ft(F=>[...F,E]),I?.(f)},ur=(f,E)=>{ft(F=>F.map(Ne=>Ne.id===Number(f)?{...Ne,...E}:Ne)),nt?.(f,E)},gr=f=>{ft(E=>E.filter(F=>F.id!==Number(f))),we?.(f)},fr=()=>{ee?.()},vr=f=>{V?.(f)},br=f=>{Me(E=>E.filter(F=>F.name!==f)),_?.(f)},hr=f=>{se?.(f)},Ji=[{id:"todo",title:"To ae",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Xi=()=>{switch(St){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"}},va=[{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")}],Zi=va.sort((f,E)=>E.lastUsed.getTime()-f.lastUsed.getTime()).slice(0,3),Yi=va.length>3,Qi=va.slice(3);return(0,dt.jsxs)(ja,{currentView:St,onViewChange:dr,children:[St==="kanban"&&(0,dt.jsx)("div",{className:"h-full overflow-hidden",children:(0,dt.jsx)(Io,{initialProjects:$t,initialEpics:pe,initialSprints:Y.map(f=>({...f,isSelected:!1})),initialTasks:x,initialColleagues:kt,initialUsers:X,onAddTask:Ha,onUpdateTask:ea,onDeleteTask:Ua,onTaskClick:fa,onAddEpic:Ga,onAddComment:tt})}),St==="planning"&&(0,dt.jsx)("div",{className:"hidden md:block h-full",children:(0,dt.jsx)(Ho,{tasks:x,epics:pe,sprints:Y,onUpdateTask:ea,onTaskClick:fa,onAddSprint:nr,onUpdateSprint:sr,onDeleteSprint:lr})}),St==="tasks"&&(0,dt.jsx)("div",{className:"h-full",children:(0,dt.jsx)(Uo,{initialReminders:Ft,initialColleagues:kt,onAddReminder:pr,onUpdateReminder:ur,onDeleteReminder:gr})}),St==="files"&&(0,dt.jsx)("div",{className:"h-full",children:(0,dt.jsx)(za,{initialFiles:Te,onFileAdd:fr,onFileEdit:vr,onFileDelete:br,onFileClick:hr,compactView:!1})}),St==="epics"&&(0,dt.jsx)("div",{className:"h-full",children:(0,dt.jsx)(Fo,{tasks:x,epics:pe,sprints:Y,onUpdateTask:ea,onTaskClick:fa,onAddTaskToEpic:cr,onAddEpic:or,onUpdateEpic:rr,onDeleteEpic:ir})}),(0,dt.jsx)(Vt,{isOpen:m,onClose:mr,onAddTask:Ha,epics:pe,sprints:Y,assignees:[...kt,...X],defaultEpicId:Be||void 0}),(0,dt.jsx)(Ut,{isOpen:$,onClose:()=>q(!1),onAddEpic:Ga})]})}