cortex-react-components 2.23.2 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/{chunk-GZ7FGBTR.mjs → chunk-5EM6P7SU.mjs} +1 -1
  2. package/dist/{chunk-UECG3SCG.mjs → chunk-6DDMDQLX.mjs} +1 -1
  3. package/dist/{chunk-TSFX33PR.mjs → chunk-BGQC6IQK.mjs} +1 -1
  4. package/dist/{chunk-XJKRA2AE.mjs → chunk-CMU5JFUC.mjs} +1 -1
  5. package/dist/chunk-GCIEF545.mjs +4 -0
  6. package/dist/{chunk-LEUI66J6.mjs → chunk-GULRIPMU.mjs} +1 -1
  7. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  8. package/dist/{chunk-LJOWXPWW.mjs → chunk-I2GNNRFH.mjs} +1 -1
  9. package/dist/chunk-ICFBQXVC.mjs +4 -0
  10. package/dist/{chunk-CQAMS7RZ.mjs → chunk-JOG27B7P.mjs} +1 -1
  11. package/dist/chunk-M7KIL6AS.mjs +9 -0
  12. package/dist/{chunk-B7AXSCTN.mjs → chunk-M7ZG6HLI.mjs} +1 -1
  13. package/dist/{chunk-JTMIQ7MK.mjs → chunk-NXAQ6ESJ.mjs} +1 -1
  14. package/dist/{chunk-L5NPH5RX.mjs → chunk-RQLUMNJE.mjs} +1 -1
  15. package/dist/{chunk-GSSW663E.mjs → chunk-SDKKYDWS.mjs} +1 -1
  16. package/dist/{chunk-SCBDVNHG.mjs → chunk-VATGKKXW.mjs} +1 -1
  17. package/dist/chunk-VTFO5GXK.mjs +4 -0
  18. package/dist/{chunk-JPLBPV7J.mjs → chunk-XDW3TPGL.mjs} +1 -1
  19. package/dist/{chunk-CBIULUZQ.mjs → chunk-XKGBG5FX.mjs} +1 -1
  20. package/dist/{chunk-S7MFNEEY.mjs → chunk-YJ7XPZWV.mjs} +1 -1
  21. package/dist/components/Chat/ChatInterface.mjs +1 -1
  22. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  23. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  24. package/dist/components/Chat/demo-tests.mjs +1 -1
  25. package/dist/components/Chat/demo.mjs +1 -1
  26. package/dist/components/Chat/example-usage.mjs +1 -1
  27. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  28. package/dist/components/Chat/index.mjs +1 -1
  29. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  30. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +6 -1
  31. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  32. package/dist/components/DigitalColleagues/Views/index.js +6 -1
  33. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  34. package/dist/components/DigitalColleagues/index.js +6 -1
  35. package/dist/components/DigitalColleagues/index.mjs +1 -1
  36. package/dist/components/Foundary/MainPage.mjs +1 -1
  37. package/dist/components/Foundary/Pages/dashboardpage.js +6 -1
  38. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  39. package/dist/components/Foundary/RichText/index.js +1 -1
  40. package/dist/components/Foundary/RichText/index.mjs +1 -1
  41. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  42. package/dist/components/Foundary/Views/KnowledgeView.js +1 -1
  43. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  44. package/dist/components/Foundary/Views/index.js +6 -1
  45. package/dist/components/Foundary/Views/index.mjs +1 -1
  46. package/dist/components/Foundary/document-edit.js +1 -1
  47. package/dist/components/Foundary/document-edit.mjs +1 -1
  48. package/dist/components/Foundary/document-preview-examples.js +3 -3
  49. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  50. package/dist/components/Foundary/document-preview.js +1 -1
  51. package/dist/components/Foundary/document-preview.mjs +1 -1
  52. package/dist/components/Foundary/file-edit.css +1 -0
  53. package/dist/components/Foundary/file-edit.d.ts +9 -0
  54. package/dist/components/Foundary/file-edit.js +9 -0
  55. package/dist/components/Foundary/file-edit.mjs +2 -0
  56. package/dist/components/Foundary/index.js +6 -1
  57. package/dist/components/Foundary/index.mjs +1 -1
  58. package/dist/components/Foundary/knowledge-browser.js +1 -1
  59. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  60. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  61. package/dist/components/HeaderFooter/index.mjs +1 -1
  62. package/dist/components/Heros/RenderHero.mjs +1 -1
  63. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  64. package/dist/components/Heros/index.mjs +1 -1
  65. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  66. package/dist/components/Layouts/Print.mjs +1 -1
  67. package/dist/components/Layouts/SlideShow.mjs +1 -1
  68. package/dist/components/Layouts/index.mjs +1 -1
  69. package/dist/components/Menus/index.mjs +1 -1
  70. package/dist/components/Other/index.mjs +1 -1
  71. package/dist/components/Payload/index.mjs +1 -1
  72. package/dist/components/Projects/FileView.d.ts +2 -1
  73. package/dist/components/Projects/FileView.js +6 -1
  74. package/dist/components/Projects/FileView.mjs +1 -1
  75. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  76. package/dist/components/Projects/ProjectPage.js +6 -1
  77. package/dist/components/Projects/ProjectPage.mjs +1 -1
  78. package/dist/components/Projects/ProjectView.js +6 -1
  79. package/dist/components/Projects/ProjectView.mjs +1 -1
  80. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  81. package/dist/components/Projects/file-list.d.ts +2 -2
  82. package/dist/components/Projects/file-list.js +6 -1
  83. package/dist/components/Projects/file-list.mjs +1 -1
  84. package/dist/components/Projects/index.mjs +1 -1
  85. package/dist/components/dc-temp/index.js +6 -1
  86. package/dist/components/dc-temp/index.mjs +1 -1
  87. package/dist/components/index.js +25 -20
  88. package/dist/components/index.mjs +1 -1
  89. package/dist/index.js +35 -30
  90. package/dist/index.mjs +1 -1
  91. package/dist/metafile-cjs.json +1 -1
  92. package/dist/metafile-esm.json +1 -1
  93. package/dist/pages/Blog.mjs +1 -1
  94. package/dist/pages/Documentation.mjs +1 -1
  95. package/dist/pages/IndexPage.mjs +1 -1
  96. package/dist/pages/Intranet.mjs +1 -1
  97. package/dist/pages/LandingPage.mjs +1 -1
  98. package/dist/pages/Page.mjs +1 -1
  99. package/dist/pages/Publish.mjs +1 -1
  100. package/dist/pages/Website.mjs +1 -1
  101. package/dist/sections/AboutSection.mjs +1 -1
  102. package/dist/sections/BlogDetail.mjs +1 -1
  103. package/dist/sections/BlogList.mjs +1 -1
  104. package/dist/sections/BlogListSection.mjs +1 -1
  105. package/dist/sections/PageSections.mjs +1 -1
  106. package/dist/sections/PricingSection.mjs +1 -1
  107. package/dist/sections/ServiceSection.mjs +1 -1
  108. package/dist/sections/index.mjs +1 -1
  109. package/package.json +1 -1
  110. package/dist/chunk-JXQRVEQB.mjs +0 -4
  111. package/dist/chunk-NAGBKKTZ.mjs +0 -4
  112. package/dist/chunk-PZFYJ5FS.mjs +0 -4
@@ -2,4 +2,9 @@
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 Sr=(e,t)=>{for(var a in t)ta(e,a,{get:t[a],enumerable:!0})},Ga=(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)):{},Ga(t||!e||!e.__esModule?ta(a,"default",{value:e,enumerable:!0}):a,e)),kr=e=>Ga(ta({},"__esModule",{value:!0}),e);var Li={};Sr(Li,{default:()=>Qo});module.exports=kr(Li);var ae=require("react");var lt=require("lucide-react"),st=require("react/jsx-runtime"),Dr=[{key:"kanban",icon:lt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:lt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:lt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:lt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:lt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],ja=({currentView:e,onViewChange:t,children:a})=>(0,st.jsxs)("div",{className:"flex w-full h-screen",children:[(0,st.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,st.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,st.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,st.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,st.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,st.jsx)("div",{className:"w-full h-full",children:a})})]});var ee=ge(require("react"));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:m=>{let n=m.split(xa);return n[0]===""&&n.length!==1&&n.shift(),Ka(n,t)||Pr(m)},getConflictingClassGroupIds:(m,n)=>{let u=a[m]||[];return n&&o[m]?[...u,...o[m]]: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:m})=>m(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,m])=>{ha(m,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,m])=>{ha(m,_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(([m,n])=>[t+m,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,m)=>{a.set(s,m),t++,t>e&&(t=0,o=a,a=new Map)};return{get(s){let m=a.get(s);if(m!==void 0)return m;if((m=o.get(s))!==void 0)return r(s,m),m},set(s,m){a.has(s)?a.set(s,m):r(s,m)}}},qa="!",Ir=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,r=t[0],s=t.length,m=n=>{let u=[],p=0,c=0,g;for(let x=0;x<n.length;x++){let U=n[x];if(p===0){if(U===r&&(o||n.slice(x,x+s)===t)){u.push(n.slice(c,x)),c=x+s;continue}if(U==="/"){g=x;continue}}U==="["?p++:U==="]"&&p--}let E=u.length===0?n:n.substring(c),k=E.startsWith(qa),b=k?E.substring(1):E,I=g&&g>c?g-c:void 0;return{modifiers:u,hasImportantModifier:k,baseClassName:b,maybePostfixModifierPosition:I}};return a?n=>a({className:n,parseClassName:m}):m},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=[],m=e.trim().split(Br),n="";for(let u=m.length-1;u>=0;u-=1){let p=m[u],{modifiers:c,hasImportantModifier:g,baseClassName:E,maybePostfixModifierPosition:k}=a(p),b=!!k,I=o(b?E.substring(0,k):E);if(!I){if(!b){n=p+(n.length>0?" "+n:n);continue}if(I=o(E),!I){n=p+(n.length>0?" "+n:n);continue}b=!1}let x=Fr(c).join(":"),U=g?x+qa:x,J=U+I;if(s.includes(J))continue;s.push(J);let y=r(I,b);for(let F=0;F<y.length;++F){let pe=y[F];s.push(U+pe)}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 Hr(e,...t){let a,o,r,s=m;function m(u){let p=t.reduce((c,g)=>g(c),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 c=Or(u,a);return r(u,c),c}return function(){return s(zr.apply(null,arguments))}}var oe=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Xa=/^\[(?:([a-z-]+):)?(.+)\]$/st,Vr=/^\d+\/\d+$/,Ur=new Set(["px","full","screen"]),$r=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|ae|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|st|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)st-?((\d+)?\.?(\d+)[a-z]+|0)/,_r=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dt=e=>Lt(e)||Ur.has(e)||Vr.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)),z=e=>Xa.test(e),bt=e=>$r.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=>Gr.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"),m=oe("borderSpacing"),n=oe("borderWidth"),u=oe("contrast"),p=oe("grayscale"),c=oe("hueRotate"),g=oe("invert"),E=oe("gap"),k=oe("gradientColorStops"),b=oe("gradientColorStopPositions"),I=oe("inset"),x=oe("margin"),U=oe("opacity"),J=oe("padding"),y=oe("saturate"),F=oe("scale"),pe=oe("sepia"),C=oe("skew"),$=oe("space"),Y=oe("translate"),j=()=>["auto","contain","none"],we=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",z,t],D=()=>[z,t],Ne=()=>["",dt,vt],ce=()=>["auto",Lt,z],Ye=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],he=()=>["solid","dashed","dotted","double","none"],it=()=>["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"],je=()=>["","0",z],We=()=>["auto","avoid","all","avoid-page","page","left","right","column"],h=()=>[Lt,z];return{cacheSize:500,separator:":",theme:{colors:[qt],spacing:[dt,vt],blur:["none","",bt,z],brightness:h(),borderColor:[e],borderRadius:["none","","full",bt,z],borderSpacing:D(),borderWidth:Ne(),contrast:h(),grayscale:je(),hueRotate:h(),invert:je(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[Kr,vt],inset:q(),margin:q(),opacity:h(),padding:D(),saturate:h(),scale:h(),sepia:je(),skew:h(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",z]}],container:["container"],columns:[{columns:[bt]}],"break-after":[{"break-after":We()}],"break-before":[{"break-before":We()}],"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:[...Ye(),z]}],overflow:[{overflow:we()}],"overflow-x":[{"overflow-x":we()}],"overflow-y":[{"overflow-y":we()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[I]}],"inset-x":[{"inset-x":[I]}],"inset-y":[{"inset-y":[I]}],start:[{start:[I]}],end:[{end:[I]}],top:[{top:[I]}],right:[{right:[I]}],bottom:[{bottom:[I]}],left:[{left:[I]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Kt,z]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",z]}],grow:[{grow:je()}],shrink:[{shrink:je()}],order:[{order:["first","last","none",Kt,z]}],"grid-cols":[{"grid-cols":[qt]}],"col-start-end":[{col:["auto",{span:["full",Kt,z]},z]}],"col-start":[{"col-start":ce()}],"col-end":[{"col-end":ce()}],"grid-rows":[{"grid-rows":[qt]}],"row-start-end":[{row:["auto",{span:[Kt,z]},z]}],"row-start":[{"row-start":ce()}],"row-end":[{"row-end":ce()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",z]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",z]}],gap:[{gap:[E]}],"gap-x":[{"gap-x":[E]}],"gap-y":[{"gap-y":[E]}],"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:[J]}],px:[{px:[J]}],py:[{py:[J]}],ps:[{ps:[J]}],pe:[{pe:[J]}],ae:[{ae:[J]}],pr:[{pr:[J]}],pb:[{pb:[J]}],pl:[{pl:[J]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",z,t]}],"min-w":[{"min-w":[z,t,"min","max","fit"]}],"max-w":[{"max-w":[z,t,"none","full","min","max","fit","prose",{screen:[bt]},bt]}],h:[{h:[z,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[z,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[z,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",z]}],"line-clamp":[{"line-clamp":["none",Lt,ba]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",dt,z]}],"list-image":[{"list-image":["none",z]}],"list-style-type":[{list:["none","disc","decimal",z]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[U]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[U]}],"text-decoration":["underline","overline","line-through","eo-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",dt,vt]}],"underline-offset":[{"underline-offset":["auto",dt,z]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",z]}],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",z]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[U]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ye(),Xr]}],"bg-repeat":[{bg:["eo-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jr]}],"bg-image":[{bg:["none",{"gradient-st":["t","tr","r","br","b","bl","st","tl"]},Yr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-st-pos":[{st:[b]}],"gradient-from":[{from:[k]}],"gradient-via":[{via:[k]}],"gradient-st":[{st:[k]}],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-st":[{"rounded-st":[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-st":[{"border-st":[n]}],"border-opacity":[{"border-opacity":[U]}],"border-style":[{border:[...he(),"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":[U]}],"divide-style":[{divide:he()}],"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-st":[{"border-st":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...he()]}],"outline-offset":[{"outline-offset":[dt,z]}],"outline-w":[{outline:[dt,vt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[U]}],"ring-offset-w":[{"ring-offset":[dt,vt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bt,Qr]}],"shadow-color":[{shadow:[qt]}],opacity:[{opacity:[U]}],"mix-blend":[{"mix-blend":[...it(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":it()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",bt,z]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[g]}],saturate:[{saturate:[y]}],sepia:[{sepia:[pe]}],"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":[c]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[U]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",z]}],duration:[{duration:h()}],ease:[{ease:["linear","in","out","in-out",z]}],delay:[{delay:h()}],animate:[{animate:["none","spin","ping","pulse","bounce",z]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[F]}],"scale-x":[{"scale-x":[F]}],"scale-y":[{"scale-y":[F]}],rotate:[{rotate:[Kt,z]}],"translate-x":[{"translate-x":[Y]}],"translate-y":[{"translate-y":[Y]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",z]}],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",z]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-ae":[{"scroll-ae":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",z]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[dt,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","ae","pr","pb","pl"],px:["pr","pl"],py:["ae","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-st","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-st":["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-st"],"border-w-x":["border-w-r","border-w-st"],"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-st"],"border-color-x":["border-color-r","border-color-st"],"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-ae","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-ae","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ya=Hr(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 se({className:e,variant:t,...a}){return(0,st.jsx)("div",{className:w(ri({variant:t}),e),...a})}var Ct=ge(require("react"));var re=Ct.forwardRef(({className:e,...t},a)=>(0,st.jsx)("div",{ref:a,className:w("rounded-xl border bg-card text-card-foreground shadow",e),...t}));re.displayName="Card";var ii=Ct.forwardRef(({className:e,...t},a)=>(0,st.jsx)("div",{ref:a,className:w("flex flex-col space-y-1.5 p-6",e),...t}));ii.displayName="CardHeader";var ni=Ct.forwardRef(({className:e,...t},a)=>(0,st.jsx)("div",{ref:a,className:w("font-semibold leading-none tracking-tight",e),...t}));ni.displayName="CardTitle";var si=Ct.forwardRef(({className:e,...t},a)=>(0,st.jsx)("div",{ref:a,className:w("text-sm text-muted-foreground",e),...t}));si.displayName="CardDescription";var Ot=Ct.forwardRef(({className:e,...t},a)=>(0,st.jsx)("div",{ref:a,className:w("p-6 ae-0",e),...t}));Ot.displayName="CardContent";var li=Ct.forwardRef(({className:e,...t},a)=>(0,st.jsx)("div",{ref:a,className:w("flex items-center p-6 ae-0",e),...t}));li.displayName="CardFooter";var ao=({title:e,status:t,taskCount:a,children:o,onDrop:r,isCompact:s=!1,height:m})=>{let n=c=>{c.preventDefault()},u=c=>{c.preventDefault(),r(t)};return(0,st.jsxs)(re,{className:`p-4 bg-card border-st-4 ${(()=>{switch(t){case"todo":return"border-st-gray-400";case"in-progress":return"border-st-blue-500";case"review":return"border-st-orange-500";case"done":return"border-st-green-500";default:return"border-st-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${s?"lg:max-w-xs":""}`,style:{height:m||"calc(100vh - 350px)"},onDragOver:n,onDrop:u,children:[(0,st.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,st.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${s?"text-base":"text-lg"}`,children:e}),(0,st.jsx)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,st.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=c=>{a(e)},m=()=>{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,st.jsx)(lt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,st.jsx)(lt.Bug,{className:"h-3 w-3"});case"spike":return(0,st.jsx)(lt.Zap,{className:"h-3 w-3"});case"task":default:return(0,st.jsx)(lt.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,st.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:m,children:(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:u()}),(0,st.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,st.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:m,children:[(0,st.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,st.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[u(),(0,st.jsx)("span",{className:"capitalize",children:e.type})]}),(0,st.jsxs)("div",{className:"flex gap-1",children:[(0,st.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,st.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,st.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,st.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,st.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,st.jsxs)("div",{className:"flex items-center gap-1",children:[(0,st.jsx)(lt.User,{className:"h-4 w-4"}),(0,st.jsx)("span",{children:e.assignee?.value?.name})]}),(0,st.jsxs)("div",{className:"flex items-center gap-1",children:[(0,st.jsx)(lt.Calendar,{className:"h-4 w-4"}),(0,st.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var Xt=ge(require("react")),Se=ge(require("@radix-ui/react-dialog"));var Ge=Se.Root;var di=Se.Portal;var ro=Xt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(Se.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=Se.Overlay.displayName;var Oe=Xt.forwardRef(({className:e,children:t,...a},o)=>(0,$e.jsxs)(di,{children:[(0,$e.jsx)(ro,{}),(0,$e.jsxs)(Se.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-st-left-1/2 data-[state=closed]:slide-out-st-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,$e.jsxs)(Se.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,$e.jsx)(lt.st,{className:"h-4 w-4"}),(0,$e.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Oe.displayName=Se.Content.displayName;var ze=({className:e,...t})=>(0,$e.jsx)("div",{className:w("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ze.displayName="DialogHeader";var Zt=({className:e,...t})=>(0,$e.jsx)("div",{className:w("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Zt.displayName="DialogFooter";var He=Xt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(Se.Title,{ref:a,className:w("text-lg font-semibold leading-none tracking-tight",e),...t}));He.displayName=Se.Title.displayName;var ci=Xt.forwardRef(({className:e,...t},a)=>(0,$e.jsx)(Se.Description,{ref:a,className:w("text-sm text-muted-foreground",e),...t}));ci.displayName=Se.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"}}}),S=so.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...r},s)=>(0,st.jsx)(e?io.Slot:"button",{className:w(aa({className:t,size:a,variant:o})),ref:s,...r}));S.displayName="Button";var co=ge(require("react"));var Z=co.forwardRef(({className:e,type:t,...a},o)=>(0,st.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")),Pe=po.forwardRef(({className:e,...t},a)=>(0,st.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}));Pe.displayName="Textarea";var H=ge(require("@radix-ui/react-select")),ht=ge(require("react")),Fe=H.Root;var Qe=H.Value,Ee=ht.forwardRef(({children:e,className:t,...a},o)=>(0,st.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,st.jsx)(H.Icon,{asChild:!0,children:(0,st.jsx)(lt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ee.displayName=H.Trigger.displayName;var go=ht.forwardRef(({className:e,...t},a)=>(0,st.jsx)(H.ScrollUpButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,st.jsx)(lt.ChevronUp,{className:"h-4 w-4"})}));go.displayName=H.ScrollUpButton.displayName;var fo=ht.forwardRef(({className:e,...t},a)=>(0,st.jsx)(H.ScrollDownButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,st.jsx)(lt.ChevronDown,{className:"h-4 w-4"})}));fo.displayName=H.ScrollDownButton.displayName;var Ae=ht.forwardRef(({children:e,className:t,position:a="popper",...o},r)=>(0,st.jsx)(H.Portal,{children:(0,st.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,st.jsx)(go,{}),(0,st.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,st.jsx)(fo,{})]})}));Ae.displayName=H.Content.displayName;var mi=ht.forwardRef(({className:e,...t},a)=>(0,st.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,st.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,st.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,st.jsx)(H.ItemIndicator,{children:(0,st.jsx)(lt.Check,{className:"h-4 w-4"})})}),(0,st.jsx)(H.ItemText,{children:e})]}));ie.displayName=H.Item.displayName;var pi=ht.forwardRef(({className:e,...t},a)=>(0,st.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"),A=vo.forwardRef(({className:e,...t},a)=>(0,st.jsx)(ya.Root,{ref:a,className:w(ui(),e),...t}));A.displayName=ya.Root.displayName;var Tt=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,st.jsx)(wa.Root,{ref:r,className:w(Na({variant:t,size:a,className:e})),...o}));gi.displayName=wa.Root.displayName;var No=Tt.createContext({size:"default",variant:"default"}),Pt=Tt.forwardRef(({className:e,variant:t,size:a,children:o,...r},s)=>(0,st.jsx)(zt.Root,{ref:s,className:w("flex items-center justify-center gap-1",e),...r,children:(0,st.jsx)(No.Provider,{value:{variant:t,size:a},children:o})}));Pt.displayName=zt.Root.displayName;var Rt=Tt.forwardRef(({className:e,children:t,variant:a,size:o,...r},s)=>{let m=Tt.useContext(No);return(0,st.jsx)(zt.Item,{ref:s,className:w(Na({variant:m.variant||a,size:m.size||o}),e),...r,children:t})});Rt.displayName=zt.Item.displayName;var fi=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:lt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:lt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:lt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:lt.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"}],Ht=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:r,assignees:s,defaultEpicId:m})=>{let[n,u]=(0,ae.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,ae.useEffect)(()=>{e&&m&&u(g=>({...g,epic:m}))},[e,m]),(0,ae.useEffect)(()=>{e&&u({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:m||"",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:m||"",sprint:"",assignee:""}),t())},c=(g,E)=>{u(k=>({...k,[g]:E}))};return(0,st.jsx)(Ge,{open:e,onOpenChange:t,children:(0,st.jsxs)(Oe,{className:"sm:max-w-md",children:[(0,st.jsx)(ze,{children:(0,st.jsx)(He,{children:"Add New Task"})}),(0,st.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"name",children:"Task Title"}),(0,st.jsx)(Z,{id:"name",value:n.name,onChange:g=>c("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"description",children:"Description"}),(0,st.jsx)(Pe,{id:"description",value:n.description,onChange:g=>c("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"Type"}),(0,st.jsx)(Pt,{type:"single",value:n.type||"",onValueChange:g=>g&&c("type",g),children:fi.map(g=>{let E=g.icon;return(0,st.jsxs)(Rt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,st.jsx)(E,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"Priority"}),(0,st.jsx)(Pt,{type:"single",value:n.priority||"",onValueChange:g=>g&&c("priority",g),children:vi.map(g=>(0,st.jsx)(Rt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"points",children:"Story Points"}),(0,st.jsx)(Z,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:g=>c("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!m&&(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"epic",children:"Epic"}),(0,st.jsxs)(Fe,{value:n.epic,onValueChange:g=>c("epic",g),children:[(0,st.jsx)(Ee,{children:(0,st.jsx)(Qe,{placeholder:"Select an epic"})}),(0,st.jsx)(Ae,{children:o.map(g=>(0,st.jsx)(ie,{value:g.id.toString(),children:(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,st.jsxs)(Fe,{value:n.sprint,onValueChange:g=>c("sprint",g),children:[(0,st.jsx)(Ee,{children:(0,st.jsx)(Qe,{placeholder:"Select a sprint"})}),(0,st.jsxs)(Ae,{children:[(0,st.jsx)(ie,{value:"none",children:"No Sprint"}),r.map(g=>(0,st.jsx)(ie,{value:g.id.toString(),children:(0,st.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"sprint",children:"Assignee"}),(0,st.jsxs)(Fe,{value:n.assignee,onValueChange:g=>c("assignee",g),children:[(0,st.jsx)(Ee,{children:(0,st.jsx)(Qe,{placeholder:"Select an Assignee"})}),(0,st.jsxs)(Ae,{children:[(0,st.jsx)(ie,{value:"none",children:"No Assignee"}),s.map(g=>(0,st.jsx)(ie,{value:g.id.toString(),children:(0,st.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,st.jsxs)(Zt,{children:[(0,st.jsx)(S,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,st.jsx)(S,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Sa=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:r,className:s="",disabled:m=!1})=>{let[n,u]=(0,ae.useState)(!1),[p,c]=(0,ae.useState)(""),g=()=>{m||(u(!0),c(t))},E=async()=>{p!==t&&await r(e,p),u(!1)},k=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?E():b.key==="Escape"&&(u(!1),c(""))};return(0,st.jsxs)("div",{className:`space-y-2 ${s}`,children:[(0,st.jsx)(A,{children:a}),n?o?(0,st.jsx)(Pe,{value:p,onChange:b=>c(b.target.value),onBlur:E,onKeyDown:k,autoFocus:!0,rows:4,className:"resize-none"}):(0,st.jsx)(Z,{value:p,onChange:b=>c(b.target.value),onBlur:E,onKeyPress:k,autoFocus:!0,className:"text-lg font-medium"}):(0,st.jsxs)("div",{onClick:g,className:`${m?"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,st.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click st edit..."}),!m&&(0,st.jsx)(lt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var ra=ge(require("react")),mt=ge(require("@radix-ui/react-avatar"));var ka=ra.forwardRef(({className:e,...t},a)=>(0,st.jsx)(mt.Root,{ref:a,className:w("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ka.displayName=mt.Root.displayName;var bi=ra.forwardRef(({className:e,...t},a)=>(0,st.jsx)(mt.Image,{ref:a,className:w("aspect-square h-full w-full",e),...t}));bi.displayName=mt.Image.displayName;var Da=ra.forwardRef(({className:e,...t},a)=>(0,st.jsx)(mt.Fallback,{ref:a,className:w("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Da.displayName=mt.Fallback.displayName;var ko=({comments:e,onAddComment:t})=>{let[a,o]=(0,ae.useState)(""),r=m=>m.split(" ").map(n=>n[0]).join("").toUpperCase(),s=()=>{a.trim()&&(t(a),o(""))};return(0,st.jsxs)("div",{className:"space-y-4",children:[(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsx)(lt.MessageSquare,{className:"h-5 w-5"}),(0,st.jsx)(A,{className:"text-lg font-medium",children:"Comments"}),(0,st.jsx)(se,{variant:"secondary",children:e.length})]}),(0,st.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(m=>(0,st.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,st.jsx)(ka,{className:"h-8 w-8 mt-1",children:(0,st.jsx)(Da,{className:"text-xs bg-muted text-muted-foreground",children:r(m.author)})}),(0,st.jsxs)("div",{className:"flex-1",children:[(0,st.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,st.jsx)("span",{className:"font-medium text-sm",children:m.author}),(0,st.jsxs)("span",{className:"text-xs text-muted-foreground",children:[m.createdAt.toLocaleDateString()," at ",m.createdAt.toLocaleTimeString()]})]}),(0,st.jsx)("p",{className:"text-sm text-muted-foreground",children:m.text})]})]},m.id))}),(0,st.jsxs)("div",{className:"flex gap-2",children:[(0,st.jsx)(Pe,{value:a,onChange:m=>o(m.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,st.jsx)(S,{onClick:s,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,st.jsx)(lt.Send,{className:"h-4 w-4"})})]})]})};var sa=({label:e,value:t,onValueChange:a,options:o,showColor:r=!1,disabled:s=!1})=>{let[m,n]=(0,ae.useState)(!1),u=o.find(c=>c.value===t);return(0,st.jsxs)("div",{className:"space-y-1",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:e}),(0,st.jsxs)(Fe,{value:t,onValueChange:a,open:m,onOpenChange:c=>{s||n(c)},disabled:s,children:[(0,st.jsx)(Ee,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,st.jsxs)(se,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&n(!m),children:[r&&u?.color&&(0,st.jsx)("div",{className:`w-2 h-2 rounded-full ${u.color} mr-1`}),u?.label||"Select..."]})}),(0,st.jsx)(Ae,{children:o.map(c=>(0,st.jsx)(ie,{value:c.value,children:r&&c.color?(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsx)("div",{className:`w-3 h-3 rounded-full ${c.color}`}),c.label]}):c.label},c.value))})]})]})};var To=({label:e,value:t,onValueChange:a,options:o,placeholder:r="Search...",allowCustomValue:s=!1,disabled:m=!1})=>{let[n,u]=(0,ae.useState)(!1),[p,c]=(0,ae.useState)(""),g=o.find(x=>x.value===t),E=o.filter(x=>x.label.toLowerCase().includes(p.toLowerCase())),k=x=>{a(x),u(!1),c("")},b=()=>{s&&p.trim()&&!o.find(x=>x.value===p.trim())&&(a(p.trim()),u(!1),c(""))};return(0,st.jsxs)("div",{className:"space-y-1",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:e}),(0,st.jsxs)(Fe,{value:t,onValueChange:k,open:n,onOpenChange:x=>{m||u(x)},disabled:m,children:[(0,st.jsx)(Ee,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,st.jsx)(se,{variant:"secondary",className:`${m?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!m&&u(!n),children:g?.label||t||"Select..."})}),(0,st.jsxs)(Ae,{children:[(0,st.jsx)("div",{className:"p-2",children:(0,st.jsx)(Z,{placeholder:r,value:p,onChange:x=>c(x.target.value),onKeyDown:x=>{x.key==="Enter"&&s&&b()},className:"mb-2"})}),E.map(x=>(0,st.jsx)(ie,{value:x.value,children:x.label},x.value)),s&&p.trim()&&!E.find(x=>x.value===p.trim())&&(0,st.jsxs)(ie,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var be=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:lt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:lt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:lt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:lt.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:m,isUpdating:n=!1,isDeleting:u=!1,deleteState:p="idle",teamMembers:c})=>{let[g,E]=(0,ae.useState)(e.storyPoints),k=(0,ae.useRef)(null),[b,I]=(0,ae.useState)(c);(0,ae.useEffect)(()=>{I(c)},[c]);let x=(0,ae.useCallback)((y,F)=>{k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{r(y,F)},500)},[r]);(0,ae.useEffect)(()=>{x("storyPoints",g?.toString()||"1")},[g]);let U=y=>y.split(" ").map(F=>F[0]).join("").toUpperCase(),J=()=>p==="loading"?(0,st.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,st.jsx)(lt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,st.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,st.jsx)(lt.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,st.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,st.jsx)(lt.st,{className:"h-3 w-3"}),"Delete failed"]}):(0,st.jsxs)(S,{onClick:m,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||u,children:[(0,st.jsx)(lt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,st.jsxs)("div",{className:"flex flex-col h-full",children:[(0,st.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:"Status"}),(0,st.jsx)(sa,{label:"",value:e.status,onValueChange:y=>r("status",y),options:[{value:"todo",label:"To ae"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:"Type"}),(0,st.jsx)(Pt,{type:"single",value:e.type||"",onValueChange:y=>y&&r("type",y),className:"grid grid-cols-2 gap-1",disabled:n,children:hi.map(y=>{let F=y.icon;return(0,st.jsxs)(Rt,{value:y.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,st.jsx)(F,{className:"h-3 w-3"}),y.label]},y.value)})})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,st.jsx)(Pt,{type:"single",value:e.priority||"",onValueChange:y=>y&&r("priority",y),className:"grid grid-cols-3 gap-1",disabled:n,children:xi.map(y=>(0,st.jsx)(Rt,{value:y.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:y.label},y.value))})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,st.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:y=>{let F=Number(y.target.value);F<1?E(1):F>100?E(100):E(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,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,st.jsx)(sa,{label:"",value:be(e.epic).toString(),onValueChange:y=>r("epic",y),options:(t||[]).map(y=>({value:y.id.toString(),label:y?.name,color:y.color})),showColor:!0,disabled:n})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,st.jsx)(sa,{label:"",value:be(e.sprint).toString()||"none",onValueChange:y=>r("sprint",y==="none"?"":y),options:[{value:"none",label:"No Sprint"},...(a||[]).map(y=>({value:y.id.toString(),label:`${y?.name}`}))],disabled:n})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,st.jsx)(To,{label:"",value:e.assignee?.value?.name,onValueChange:y=>r("assignee",y),options:b.map(y=>({value:`${typeof y.email=="string"?"users":"digital-colleagues"}:${y.id}`,label:y?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,st.jsxs)("div",{className:"mt-auto ae-4 space-y-4",children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(S,{onClick:s,variant:"outline",className:"w-full h-8 text-xs",disabled:n||u,children:"Close"}),J()]}),(0,st.jsxs)("div",{className:"ae-4 border-t border-border space-y-2",children:[(0,st.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,st.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,st.jsx)(lt.User,{className:"h-3 w-3"}),(0,st.jsx)("span",{children:"System"})]})]}),(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,st.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,st.jsx)(lt.Calendar,{className:"h-3 w-3"}),(0,st.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,st.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,st.jsx)(lt.Clock,{className:"h-3 w-3"}),(0,st.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:m,onAddComment:n,colleagues:u})=>{let[p,c]=(0,ae.useState)(a),[g,E]=(0,ae.useState)(new Date),[k,b]=(0,ae.useState)("idle"),[I,x]=(0,ae.useState)("idle"),[U,J]=(0,ae.useState)([]),[y,F]=(0,ae.useState)(u);(0,ae.useEffect)(()=>{c(a)},[a]);let pe=async(D,Ne)=>{if(Ne!==p[D]){b("loading");try{await s(p.id.toString(),{[D]:Ne}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(ce){console.log("error",ce),b("error"),setTimeout(()=>b("idle"),3e3)}}},C=async(D,Ne)=>{if(Ne!==p[D]){b("loading");try{await s(p.id.toString(),{[D]:Ne}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(ce){console.log("error",ce),b("error"),setTimeout(()=>b("idle"),3e3)}}},$=async D=>{if(n){b("loading");try{await n?.({content:D,taskId:p.id.toString()}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},Y=async()=>{x("loading");try{await m(p.id.toString()),x("success"),setTimeout(()=>{t(),x("idle")},1e3)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}},j=k!=="loading"&&I!=="loading",we=()=>{j&&t()},q=()=>k==="loading"?(0,st.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,st.jsx)(lt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,st.jsx)("span",{children:"Updating..."})]}):k==="success"?(0,st.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,st.jsx)(lt.Check,{className:"h-4 w-4"}),(0,st.jsx)("span",{children:"Updated successfully"})]}):k==="error"?(0,st.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,st.jsx)(lt.st,{className:"h-4 w-4"}),(0,st.jsx)("span",{children:"Update failed"})]}):null;return(0,st.jsx)(Ge,{open:e,onOpenChange:we,children:(0,st.jsxs)(Oe,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,st.jsxs)(ze,{children:[(0,st.jsx)(He,{className:"sr-only",children:p?.name}),(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsx)("div",{className:"flex-1",children:q()}),!j&&(0,st.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,st.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,st.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,st.jsx)(Sa,{fieldName:"name",value:p.name||"",label:"",onSave:pe,className:"border-b border-border pb-3",disabled:k==="loading"}),(0,st.jsx)(Sa,{fieldName:"description",value:p.description||"",label:"Description",multiline:!0,onSave:pe,disabled:k==="loading"}),(0,st.jsx)(ko,{comments:(p?.comments||[]).map(D=>({author:D.author.value.name||"",createdAt:new Date(D.timestamp),text:D.text,id:D.id||""})),onAddComment:$})]}),(0,st.jsx)(Po,{task:p,epics:o,sprints:r,lastUpdated:g,onUpdateTask:C,onClose:we,onDelete:Y,isUpdating:k==="loading",isDeleting:I==="loading",deleteState:I,teamMembers:y})]})]})})};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("st")[0],endDate:new Date().toISOString().split("st")[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"],m=[{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=c=>{c.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(c,g)=>{r(E=>({...E,[c]:g}))};return(0,st.jsx)(Ge,{open:e,onOpenChange:t,children:(0,st.jsxs)(Oe,{className:"sm:max-w-md",children:[(0,st.jsx)(ze,{children:(0,st.jsx)(He,{children:"Add New Epic"})}),(0,st.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"name",children:"Epic Name"}),(0,st.jsx)(Z,{id:"name",value:o.name,onChange:c=>p("name",c.target.value),placeholder:"Enter epic name",required:!0})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"description",children:"Description"}),(0,st.jsx)(Pe,{id:"description",value:o.description,onChange:c=>p("description",c.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"Color"}),(0,st.jsx)("div",{className:"flex gap-2 flex-wrap",children:s.map(c=>(0,st.jsx)("button",{type:"button",onClick:()=>p("color",c),className:`w-8 h-8 rounded-full ${c} ${o.color===c?"ring-2 ring-gray-400":""}`},c))})]}),(0,st.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"Confidence"}),(0,st.jsxs)(Fe,{value:o.confidence,onValueChange:c=>p("confidence",c),children:[(0,st.jsx)(Ee,{children:(0,st.jsx)(Qe,{})}),(0,st.jsx)(Ae,{children:m.map(c=>(0,st.jsx)(ie,{value:c.value,children:c.label},c.value))})]})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"Phase"}),(0,st.jsxs)(Fe,{value:o.phase.toString(),onValueChange:c=>p("phase",parseInt(c)),children:[(0,st.jsx)(Ee,{children:(0,st.jsx)(Qe,{})}),(0,st.jsx)(Ae,{children:n.map(c=>(0,st.jsx)(ie,{value:c.value.toString(),children:c.label},c.value))})]})]})]}),(0,st.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"Start Date"}),(0,st.jsx)(Z,{type:"date",value:o.startDate,onChange:c=>p("startDate",c.target.value)})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"End Date"}),(0,st.jsx)(Z,{type:"date",value:o.endDate,onChange:c=>p("endDate",c.target.value)})]})]}),(0,st.jsxs)(Zt,{children:[(0,st.jsx)(S,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,st.jsx)(S,{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 at({title:e,description:t,badge:a,primaryAction:o,secondaryAction:r,gradient:s,children:m,className:n}){let[u,p]=Ao(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),c=!r&&!t||u;return(0,st.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,st.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,st.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,st.jsx)(se,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,st.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,st.jsxs)("div",{className:"flex items-center gap-3",children:[c&&o&&(0,st.jsx)(S,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(r||t)&&(0,st.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,st.jsx)(da.FaChevronDown,{size:22}):(0,st.jsx)(da.FaChevronUp,{size:22})})]})]}),!c&&(0,st.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,st.jsxs)("div",{className:"space-y-4",children:[(0,st.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,st.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,st.jsx)(S,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),r&&(0,st.jsx)(S,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),m&&(0,st.jsx)("div",{className:"hidden lg:block",children:m})]})]})}var Io=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:r=[],initialProjects:s=[],onAddTask:m,onUpdateTask:n,onDeleteTask:u,onTaskClick:p,onAddEpic:c,onAddComment:g})=>{let[E,k]=(0,ee.useState)([]),[b,I]=(0,ee.useState)([]),[x,U]=(0,ee.useState)([]),[J,y]=(0,ee.useState)(!1),[F,pe]=(0,ee.useState)(!1),[C,$]=(0,ee.useState)(null),[Y,j]=(0,ee.useState)(null),[we,q]=(0,ee.useState)([]),[D,Ne]=(0,ee.useState)([]),[ce,Ye]=(0,ee.useState)(0),he=(0,ee.useRef)(null),it=(0,ee.useRef)(null),et=ee.default.useMemo(()=>[...b.map(N=>N.id),0],[b]),je=(0,ee.useRef)(""),We=(0,ee.useRef)(""),h=(0,ee.useRef)(""),W=(0,ee.useRef)(""),ne=N=>N.map(d=>`${d.id}-${new Date(d.createdAt).getTime()}-${new Date(d.updatedAt).getTime()}`).join("-");(0,ee.useEffect)(()=>{let N=ne(e);N!==je.current&&(k(e),C&&$(e.find(d=>d.id===C.id)||null),je.current=N)},[e]),(0,ee.useEffect)(()=>{let N=ne(t);N!==We.current&&(I(t),We.current=N)},[t]),(0,ee.useEffect)(()=>{let N=ne(a);N!==h.current&&(U(a),h.current=N)},[a]),(0,ee.useEffect)(()=>{let N=ne(r.map(d=>({id:d.id,updatedAt:d.updatedAt,createdAt:d.createdAt})));N!==W.current&&(Ne(r),W.current=N)},[r]),(0,ee.useEffect)(()=>{let N=()=>{if(he.current){let L=he.current.offsetHeight;Ye(L)}};N();let d=new ResizeObserver(N);he.current&&d.observe(he.current);let f=()=>{setTimeout(N,100)};return window.addEventListener("storage",f),()=>{d.disconnect(),window.removeEventListener("storage",f)}},[]),(0,ee.useEffect)(()=>{let N=setTimeout(()=>{he.current&&Ye(he.current.offsetHeight)},300);return()=>clearTimeout(N)},[J,F]);let _e=E.filter(N=>!0),Q=N=>_e.filter(d=>d.status===N),Ue=N=>{let d={};return b.forEach(f=>{d[f.id]=N.filter(L=>be(L.epic)===f.id)}),d["eo-epic"]=N.filter(f=>!be(f.epic)),d},At=N=>{j(N)},nt=N=>{Y&&(k(d=>d.map(f=>f.id===Y.id?{...f,status:N}:f)),n?.(Y.id.toString(),{status:N}),j(null))},Gt=N=>{let d={...N,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};k(f=>[...f,d]),m?.(N)},gt=async(N,d)=>{k(f=>f.map(L=>L.id===Number(N)?{...L,...d}:L)),n&&await n(N,d),C?.id===Number(N)&&$(f=>({...f,...d}))},wt=async N=>{k(d=>d.filter(f=>f.id!==Number(N))),C?.id===Number(N)&&$(null),u&&await u(N)},Mt=N=>{let d={...N,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};I(f=>[...f,d]),c?.(N)},ft=N=>{$(N),p?.(N)},It=[{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"}],Ft=ce>0?`calc(100vh - ${ce+120}px)`:"calc(100vh - 12rem)";return(0,st.jsxs)("div",{ref:it,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,st.jsx)("div",{ref:he,className:"flex-shrink-0",children:(0,st.jsx)(at,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-st-r from-purple-600 via-violet-600 st-indigo-600",primaryAction:{label:"Add task",onClick:()=>y(!0)},secondaryAction:{label:"Add epic",onClick:()=>pe(!0)}})}),(0,st.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,st.jsx)("div",{className:"h-full",style:{height:ce>0?`calc(100vh - ${ce+120}px)`:"calc(100vh - 12rem)"},children:(0,st.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:It.map(N=>{let d=Q(N.status),f=Ue(d);return(0,st.jsxs)(ao,{title:N.title,status:N.status,taskCount:d.length,onDrop:nt,isCompact:N.status==="done",height:Ft,children:[f["eo-epic"].map(L=>(0,st.jsx)(Jt,{epic:null,task:L,onDragStart:At,onTaskClick:ft,isCompact:N.status==="done"},L.id)),et.map(L=>{let G=b.find(me=>me.id===L),ue=f[L]||[];return ue.length===0?null:(0,st.jsxs)("div",{className:"mb-6",children:[(0,st.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,st.jsx)("div",{className:`w-3 h-3 rounded-full ${G?.color}`}),(0,st.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:G?.name||"No Epic"}),(0,st.jsx)(se,{variant:"secondary",className:"text-xs",children:ue.length})]})," ",(0,st.jsx)("div",{className:"space-y-3",children:ue.map(me=>(0,st.jsx)(Jt,{task:me,epic:G,onDragStart:At,onTaskClick:ft,isCompact:N.status==="done"},me.id))})]},L)})]},N.id)})})})}),(0,st.jsx)(Ht,{isOpen:J,onClose:()=>y(!1),onAddTask:Gt,assignees:[...D,...we],epics:b,sprints:x}),(0,st.jsx)(Ut,{isOpen:F,onClose:()=>pe(!1),onAddEpic:Mt}),C&&(0,st.jsx)(Ro,{isOpen:!!C,onClose:()=>$(null),initialTask:C,epics:b,sprints:x,onUpdateTask:gt,onDeleteTask:wt,colleagues:D,onAddComment:g})]})};var Fo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddTaskToEpic:s,onAddEpic:m,onUpdateEpic:n,onDeleteEpic:u})=>{let[p,c]=(0,ae.useState)(t),[g,E]=(0,ae.useState)(null),[k,b]=(0,ae.useState)(null),[I,x]=(0,ae.useState)({}),[U,J]=(0,ae.useState)(0),[y,F]=(0,ae.useState)(!1),[pe,C]=(0,ae.useState)(!1),[$,Y]=(0,ae.useState)(null),j=(0,ae.useRef)(null),we=(0,ae.useRef)(null);(0,ae.useEffect)(()=>{c(t)},[t]),(0,ae.useEffect)(()=>{let h=()=>{if(j.current){let _e=j.current.offsetHeight;J(_e)}};h();let W=new ResizeObserver(h);j.current&&W.observe(j.current);let ne=()=>{setTimeout(h,100)};return window.addEventListener("storage",ne),()=>{W.disconnect(),window.removeEventListener("storage",ne)}},[]),(0,ae.useEffect)(()=>{let h=setTimeout(()=>{j.current&&J(j.current.offsetHeight)},300);return()=>clearTimeout(h)},[k]);let q=h=>{E(h)},D=h=>{h.preventDefault()},Ne=(h,W)=>{h.preventDefault(),g&&be(g.epic).toString()!==W&&(o(g.id.toString(),{epic:Number(W)}),E(null))},ce=h=>e.filter(W=>be(W.epic).toString()===h),Ye=h=>{b(h.id.toString()),x({name:h.name,description:h.description,confidence:h.confidence,phase:h.phase})},he=async()=>{k&&I.name&&(await n(k.toString(),I),c(h=>h.map(W=>W.id.toString()===k?{...W,...I}:W)),b(null),x({}))},it=()=>{b(null),x({})},et=async h=>{window.confirm("Are you sure you want st delete this epic? This will also delete all associated tasks.")&&(await u(h),c(W=>W.filter(ne=>ne.id.toString()!==h)))},je=h=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[h]||`Phase ${h}`,We=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,st.jsxs)(st.Fragment,{children:[(0,st.jsxs)("div",{ref:we,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,st.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,st.jsx)(at,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-st-r from-rose-600 via-pink-600 st-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,st.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,st.jsx)("div",{className:"h-full overflow-y-auto",style:{height:U>0?`calc(100vh - ${U+120}px)`:"calc(100vh - 12rem)"},children:(0,st.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 W=ce(h.id.toString()),ne=W.reduce((Q,Ue)=>Q+(Ue.storyPoints||0),0),_e=U>0?`calc(100vh - ${U+200}px)`:"calc(100vh - 14rem)";return(0,st.jsxs)(re,{className:`flex flex-col ${k===h.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:k===h.id.toString()?"auto":_e,minHeight:"400px"},onDragOver:D,onDrop:Q=>Ne(Q,h.id.toString()),children:[(0,st.jsx)("div",{className:"p-4 border-b border-border",children:k===h.id.toString()?(0,st.jsxs)("div",{className:"space-y-4",children:[(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsx)(Z,{value:I.name||"",onChange:Q=>x({...I,name:Q.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,st.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,st.jsx)(S,{size:"sm",variant:"ghost",onClick:he,className:"p-1 h-8 w-8",children:(0,st.jsx)(lt.Check,{className:"h-4 w-4"})}),(0,st.jsx)(S,{size:"sm",variant:"ghost",onClick:it,className:"p-1 h-8 w-8",children:(0,st.jsx)(lt.st,{className:"h-4 w-4"})})]})]}),(0,st.jsx)(Pe,{value:I.description||"",onChange:Q=>x({...I,description:Q.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,st.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,st.jsxs)("div",{children:[(0,st.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,st.jsxs)("select",{value:I.confidence||h.confidence,onChange:Q=>x({...I,confidence:Q.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,st.jsx)("option",{value:"low",children:"Low"}),(0,st.jsx)("option",{value:"medium",children:"Medium"}),(0,st.jsx)("option",{value:"high",children:"High"})]})]}),(0,st.jsxs)("div",{children:[(0,st.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,st.jsx)("select",{value:I.phase?.toString()||h.phase.toString(),onChange:Q=>x({...I,phase:parseInt(Q.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(Q=>(0,st.jsxs)("option",{value:Q.toString(),children:["Phase ",Q]},Q))})]})]})]}):(0,st.jsxs)(st.Fragment,{children:[(0,st.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,st.jsx)("div",{className:`w-4 h-4 rounded-full ${h.color}`}),(0,st.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:h.name}),(0,st.jsxs)("div",{className:"flex gap-1",children:[(0,st.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>Ye(h),className:"p-1 h-8 w-8",children:(0,st.jsx)(lt.Edit2,{className:"h-3 w-3"})}),(0,st.jsx)(S,{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,st.jsx)(lt.Trash2,{className:"h-3 w-3"})})]})]}),(0,st.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,st.jsxs)(se,{className:`text-xs ${We(h.confidence)}`,children:[h.confidence," confidence"]}),(0,st.jsxs)(se,{variant:"outline",className:"text-xs",children:["Phase ",h.phase]}),(0,st.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[W.length," tasks"]}),(0,st.jsxs)(se,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[ne," pts"]})]}),h.description&&(0,st.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:h.description}),(0,st.jsxs)(S,{onClick:()=>{C(!0),Y(h)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,st.jsx)(lt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,st.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,st.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:W.length===0?(0,st.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,st.jsx)(lt.Move,{className:"h-8 w-8 mb-2"}),(0,st.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):W.map(Q=>(0,st.jsx)(Jt,{task:Q,epic:h,onDragStart:q,onTaskClick:r,isCompact:!0},Q.id))})})]},h.id)})})})})]}),(0,st.jsx)(Ut,{isOpen:y,onClose:()=>F(!1),onAddEpic:m}),(0,st.jsx)(Ht,{isOpen:pe,onClose:()=>C(!1),onAddTask:s,assignees:[],epics:[],defaultEpicId:$?.id.toString()||"",sprints:a})]})};var Lo=require("react-day-picker");function ca({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,st.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 ae-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-st-md first:[&:has([aria-selected])]:rounded-st-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")),ot=ge(require("@radix-ui/react-popover"));var Ra=ot.Root,Ea=ot.Trigger;var ma=Oo.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},r)=>(0,st.jsx)(ot.Portal,{children:(0,st.jsx)(ot.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=ot.Content.displayName;var Ma=require("date-fns");var Ho=({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())},m=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,st.jsx)(Ge,{open:e,onOpenChange:m,children:(0,st.jsxs)(Oe,{className:"sm:max-w-md",children:[(0,st.jsx)(ze,{children:(0,st.jsx)(He,{children:"Add New Sprint"})}),(0,st.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"name",children:"Sprint Name *"}),(0,st.jsx)(Z,{id:"name",value:o.name,onChange:n=>r(u=>({...u,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{htmlFor:"description",children:"Description"}),(0,st.jsx)(Pe,{id:"description",value:o.description,onChange:n=>r(u=>({...u,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,st.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"Start Date *"}),(0,st.jsxs)(Ra,{children:[(0,st.jsx)(Ea,{asChild:!0,children:(0,st.jsxs)(S,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,st.jsx)(lt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Ma.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,st.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,st.jsx)(ca,{mode:"single",selected:o.startDate,onSelect:n=>r(u=>({...u,startDate:n})),initialFocus:!0})})]})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)(A,{children:"End Date *"}),(0,st.jsxs)(Ra,{children:[(0,st.jsx)(Ea,{asChild:!0,children:(0,st.jsxs)(S,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,st.jsx)(lt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Ma.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,st.jsx)(ma,{className:"w-auto p-0",align:"start",children:(0,st.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,st.jsxs)("div",{className:"flex justify-end gap-3 ae-4",children:[(0,st.jsx)(S,{type:"button",variant:"outline",onClick:m,children:"Cancel"}),(0,st.jsx)(S,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Vo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:r,onAddSprint:s,onUpdateSprint:m,onDeleteSprint:n})=>{let[u,p]=(0,ae.useState)([]),[c,g]=(0,ae.useState)(new Set),[E,k]=(0,ae.useState)(null),[b,I]=(0,ae.useState)(!1),[x,U]=(0,ae.useState)(null),[J,y]=(0,ae.useState)(null),[F,pe]=(0,ae.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[C,$]=(0,ae.useState)([]),[Y,j]=(0,ae.useState)("upcoming"),[we,q]=(0,ae.useState)(!1),[D,Ne]=(0,ae.useState)(0),ce=(0,ae.useRef)(null),Ye=(0,ae.useRef)(null);(0,ae.useEffect)(()=>{let d=()=>{ce.current&&Ne(ce.current.offsetHeight)};d();let f=new ResizeObserver(d);return ce.current&&f.observe(ce.current),()=>f.disconnect()},[]);let he=d=>t.find(f=>f.id===Number(d)),it=d=>a.find(f=>f.id===Number(d)),et=d=>{let f={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 f[d]||f.medium},je=d=>{if(!d||d?.length===0)return"";let f=d?.trim().split(" ");if(f?.length===1)return f[0];let L=f[0],G=f[f.length-1][0].toUpperCase();return`${L} ${G}`},We=d=>{let f={},L=[];return d.forEach(G=>{G.epic?(f[be(G.epic)]||(f[be(G.epic)]=[]),f[be(G.epic)].push(G)):L.push(G)}),{tasksByEpic:f,unassignedTasks:L}};(0,ae.useEffect)(()=>{$(a)},[a]);let h=C.filter(d=>{switch(Y){default:return!0}}),W=C.filter(d=>u.includes(d.id.toString())),ne=e.filter(d=>!d.sprint||d.status==="backlog"),_e=ne.reduce((d,f)=>d+(f.storyPoints||0),0),Q=d=>{p(f=>f.includes(d)?f.filter(L=>L!==d):f?.length<3?[...f,d]:f)},Ue=d=>{g(f=>{let L=new Set(f);return L.has(d)?L.delete(d):L.add(d),L})},At=d=>{s(d),I(!1)},nt=d=>{y(d.id.toString()),pe({name:d.name,description:d.description||"",startDate:d.startDate?new Date(d.startDate).toISOString().split("st")[0]:d.startDate,endDate:d.endDate?new Date(d.endDate).toISOString().split("st")[0]:d.endDate,isActive:!1})},Gt=()=>{J&&(m(J,{name:F.name,description:F.description,startDate:F.startDate,endDate:F.endDate}),$(d=>d.map(f=>(f.id===Number(J)&&(f.name=F.name,f.description=F.description,f.startDate=F.startDate,f.endDate=F.endDate),f))),y(null))},gt=()=>{y(null),pe({name:"",description:"",startDate:"",endDate:"",isActive:!1})},wt=(d,f)=>{k(f),d.dataTransfer.effectAllowed="move"},Mt=d=>{d.preventDefault(),d.dataTransfer.dropEffect="move"},ft=d=>{U(d)},It=()=>{U(null)},Ft=(d,f)=>{if(d.preventDefault(),U(null),!E)return;(be(E.sprint)||void 0)!==Number(f)&&o(E.id.toString(),{sprint:Number(f)}),k(null)},N=({task:d,showSprint:f=!1})=>{let L=d.epic?he(be(d.epic).toString()):null,G=d.sprint?it(be(d.sprint).toString()):null;return(0,st.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:Ie=>{Ie.dataTransfer.effectAllowed="move",Ie.dataTransfer.setData("text/plain",d.id.toString()),wt(Ie,d)},onClick:Ie=>{E===null&&r(d)},style:{userSelect:"none"},children:(0,st.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,st.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,st.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:d.name}),(0,st.jsx)(se,{className:`text-xs ${et(d.priority||"medium")}`,children:d.priority?.[0]?.toUpperCase()})]}),(0,st.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,st.jsxs)("div",{className:"flex items-center gap-1",children:[L&&(0,st.jsx)("div",{className:`w-2 h-2 rounded-full ${L.color}`}),(0,st.jsx)("span",{className:"text-muted-foreground truncate",children:L?.name})]}),(0,st.jsx)("span",{className:"text-muted-foreground",children:je(d.assignee?.value?.name)})]}),f&&G&&(0,st.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,st.jsx)(lt.Calendar,{className:"h-3 w-3"}),(0,st.jsx)("span",{children:G.name})]})]})})};return(0,st.jsxs)("div",{ref:Ye,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,st.jsx)("div",{ref:ce,className:"flex-shrink-0",children:(0,st.jsx)(at,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-st-r from-orange-600 via-amber-600 st-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>I(!0)}})}),(0,st.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,st.jsxs)("div",{className:"h-full",style:{height:D>0?`calc(100vh - ${D+120}px)`:"calc(100vh - 12rem)"},children:[(0,st.jsxs)("div",{className:"mb-4",children:[(0,st.jsx)(re,{className:"p-3 bg-card shadow-sm",children:(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsxs)("div",{className:"flex items-center gap-3",children:[(0,st.jsxs)("div",{children:[(0,st.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,st.jsxs)("p",{className:"text-xs text-muted-foreground",children:[u?.length,"/3 selected"]})]}),u?.length>0&&(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,st.jsx)("div",{className:"flex flex-wrap gap-1",children:W.map(d=>(0,st.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,st.jsx)("span",{className:"max-w-[80px] truncate",children:d.name}),(0,st.jsx)("button",{onClick:()=>Q(d.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,st.jsx)(lt.st,{className:"h-4 w-4"})})]},d.id))})]})]}),(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsxs)(S,{onClick:()=>I(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,st.jsx)(lt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,st.jsxs)(S,{onClick:()=>q(!we),variant:"outline",size:"sm",className:"gap-1",children:[(0,st.jsx)(lt.Calendar,{className:"h-3 w-3"}),we?"Close":"Select"]})]})]})}),we&&(0,st.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>q(!1)}),(0,st.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-st shadow-xl z-10 transition-all duration-300 ease-in-out ${we?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,st.jsxs)(re,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,st.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,st.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>q(!1),className:"h-8 w-8 p-0",children:(0,st.jsx)(lt.st,{className:"h-4 w-4"})})]}),(0,st.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up st 3 sprints st view in your planning board"})]}),(0,st.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,st.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(d=>(0,st.jsxs)(S,{variant:Y===d.key?"default":"outline",size:"sm",onClick:()=>j(d.key),className:"text-xs h-8 px-3 flex-1",children:[d.label," (",d.count,")"]},d.key))}),(0,st.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:h.length>0?h.map(d=>{let f=u.includes(d.id.toString()),L=e.filter(ue=>be(ue.sprint)===d.id).length,G=!f&&u.length<3;return(0,st.jsx)("div",{className:`p-3 rounded-lg border transition-all ${f?"bg-primary/10 border-primary/30":G?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:J===d.id.toString()?(0,st.jsxs)("div",{className:"space-y-3",children:[(0,st.jsx)(Z,{value:F.name,onChange:ue=>pe(me=>({...me,name:ue.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,st.jsx)(Pe,{value:F.description,onChange:ue=>pe(me=>({...me,description:ue.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,st.jsxs)("div",{className:"flex gap-2",children:[(0,st.jsxs)(S,{size:"sm",onClick:()=>Gt(),className:"flex-1",children:[(0,st.jsx)(lt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,st.jsxs)(S,{size:"sm",variant:"outline",onClick:gt,className:"flex-1",children:[(0,st.jsx)(lt.st,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,st.jsxs)("div",{children:[(0,st.jsxs)("div",{className:"flex items-start justify-between",children:[(0,st.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,st.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,st.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:d.name}),(0,st.jsx)(se,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,st.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:d.description}),(0,st.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,st.jsxs)("span",{className:"flex items-center gap-1",children:[(0,st.jsx)(lt.CalendarDays,{className:"h-3 w-3"}),new Date(d.startDate).toLocaleDateString()]}),(0,st.jsxs)("span",{className:"flex items-center gap-1",children:[(0,st.jsx)(lt.User,{className:"h-3 w-3"}),L," tasks"]})]})]}),(0,st.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,st.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>nt(d),className:"h-6 w-6 p-0",children:(0,st.jsx)(lt.Edit2,{className:"h-3 w-3"})}),(0,st.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>n(d.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,st.jsx)(lt.Trash2,{className:"h-3 w-3"})})]})]}),(0,st.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,st.jsx)(S,{variant:f?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Q(d.id.toString()),disabled:!f&&u?.length>=3,children:(0,st.jsx)("span",{className:"pointer-events-none select-none",children:f?"Deselect":u?.length>=3?"Limit Reached":"Select"})})})]})},d.id)}):(0,st.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,st.jsx)(lt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,st.jsxs)("p",{className:"text-sm",children:['No sprints found for "',Y,'" filter']}),(0,st.jsx)(S,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-xs",children:"Show all sprints"})]})}),u?.length===0&&(0,st.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,st.jsxs)("div",{className:"text-center",children:[(0,st.jsx)(lt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,st.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints st start planning"}),(0,st.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up st 3 sprints st view alongside your backlog"})]})})]})]})})]}),(0,st.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,st.jsx)("div",{className:"lg:col-span-1",children:(0,st.jsxs)(re,{className:"p-4 h-full bg-card border-st-4 border-st-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Mt,onDragEnter:()=>ft("backlog"),onDragLeave:It,onDrop:d=>Ft(d,"backlog"),style:{height:D>0?`calc(100vh - ${D+200}px)`:"calc(100vh - 16rem)"},children:[(0,st.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,st.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsxs)(se,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[ne?.length," tasks"]}),(0,st.jsxs)(se,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[_e," pts"]})]})]}),(0,st.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${x==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:d,unassignedTasks:f}=We(ne);return(0,st.jsxs)(st.Fragment,{children:[Object.entries(d).map(([L,G])=>{let ue=he(L);if(!ue)return null;let me=c.has(L);return(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.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:()=>Ue(L),children:[(0,st.jsx)("div",{className:`w-3 h-3 rounded-full ${ue.color}`}),(0,st.jsx)("span",{className:"font-medium text-muted-foreground",children:ue.name}),(0,st.jsxs)("span",{className:"text-muted-foreground",children:["(",G?.length,")"]}),(0,st.jsx)("div",{className:"ml-auto",children:me?(0,st.jsx)(lt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,st.jsx)(lt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!me&&(0,st.jsx)("div",{className:"space-y-2 pl-2",children:G.map(Ie=>(0,st.jsx)(N,{task:Ie},Ie.id))})]},L)}),f?.length>0&&(()=>{let L=c.has("eo-epic");return(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.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:()=>Ue("eo-epic"),children:[(0,st.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,st.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,st.jsxs)("span",{className:"text-muted-foreground",children:["(",f?.length,")"]}),(0,st.jsx)("div",{className:"ml-auto",children:L?(0,st.jsx)(lt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,st.jsx)(lt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!L&&(0,st.jsx)("div",{className:"space-y-2 pl-2",children:f?.map(G=>(0,st.jsx)(N,{task:G},G.id))})]})})(),ne?.length===0&&(0,st.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here st move st backlog"}),ne?.length>0&&Object.keys(d).length===0&&f.length===0&&(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),ne?.map(L=>(0,st.jsx)(N,{task:L},L.id))]})]})})()})]})}),W.map(d=>{let f=e.filter(G=>be(G?.sprint)===d.id),L=f.reduce((G,ue)=>G+(ue?.storyPoints||0),0);return(0,st.jsxs)(re,{className:"p-4 h-full bg-card border-st-4 border-st-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Mt,onDragEnter:()=>ft(d.id.toString()),onDragLeave:It,onDrop:G=>Ft(G,d.id.toString()),style:{height:D>0?`calc(100vh - ${D+200}px)`:"calc(100vh - 16rem)"},children:[(0,st.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,st.jsx)("div",{children:(0,st.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:d.name})}),(0,st.jsxs)("div",{className:"flex items-center gap-2",children:[(0,st.jsxs)(se,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[f?.length," tasks"]}),(0,st.jsxs)(se,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[L," pts"]}),(0,st.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>{q(!0),nt(d)},className:"h-6 px-2",children:(0,st.jsx)(lt.Edit2,{className:"h-3 w-3"})}),(0,st.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>n(d.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,st.jsx)(lt.Trash2,{className:"h-3 w-3"})})]})]}),(0,st.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:G,unassignedTasks:ue}=We(f);return(0,st.jsxs)(st.Fragment,{children:[Object.entries(G).map(([me,Ie])=>{let jt=he(me);if(!jt)return null;let Wt=c.has(me);return(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.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:()=>Ue(me),children:[(0,st.jsx)("div",{className:`w-3 h-3 rounded-full ${jt.color}`}),(0,st.jsx)("span",{className:"font-medium text-muted-foreground",children:jt.name}),(0,st.jsxs)("span",{className:"text-muted-foreground",children:["(",Ie?.length,")"]}),(0,st.jsx)("div",{className:"ml-auto",children:Wt?(0,st.jsx)(lt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,st.jsx)(lt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Wt&&(0,st.jsx)("div",{className:"space-y-2 pl-2",children:Ie?.map(_t=>(0,st.jsx)(N,{task:_t},_t.id))})]},me)}),ue?.length>0&&(()=>{let me=c.has("eo-epic");return(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.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:()=>Ue("eo-epic"),children:[(0,st.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,st.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,st.jsxs)("span",{className:"text-muted-foreground",children:["(",ue?.length,")"]}),(0,st.jsx)("div",{className:"ml-auto",children:me?(0,st.jsx)(lt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,st.jsx)(lt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!me&&(0,st.jsx)("div",{className:"space-y-2 pl-2",children:ue?.map(Ie=>(0,st.jsx)(N,{task:Ie},Ie.id))})]})})(),f?.length===0&&(0,st.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},d.id)})]}),(0,st.jsx)(Ho,{isOpen:b,onClose:()=>I(!1),onAddSprint:At})]})})]})};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,ae.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[m,n]=(0,ae.useState)(!1),u=c=>{if(c.preventDefault(),!e.find(k=>k?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let E={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(E),o(!1),s({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,ae.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let p=e.filter(Boolean);return(0,st.jsx)(Ge,{open:a,onOpenChange:o,children:(0,st.jsxs)(Oe,{className:"max-w-2xl",children:[(0,st.jsx)(ze,{children:(0,st.jsx)(He,{children:"Add New Reminder"})}),(0,st.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,st.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"title",children:"Title"}),(0,st.jsx)(Z,{id:"title",value:r.title,onChange:c=>s({...r,title:c.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"description",children:"Description"}),(0,st.jsx)(Pe,{id:"description",value:r.description,onChange:c=>s({...r,description:c.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,st.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"dueDate",children:"Due Date"}),(0,st.jsx)(Z,{id:"dueDate",type:"date",value:r.dueDate,onChange:c=>s({...r,dueDate:c.target.value}),required:!0})]}),(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,st.jsx)(Z,{id:"dueTime",type:"time",value:r.dueTime,onChange:c=>s({...r,dueTime:c.target.value})})]})]}),(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{className:`${m?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,st.jsxs)(Fe,{value:r.colleagueId,onValueChange:c=>{s({...r,colleagueId:c})},required:!0,children:[(0,st.jsx)(Ee,{className:`${m?"text-destructive border-red-500":""}`,children:(0,st.jsx)(Qe,{className:`${m?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(c=>c?.id.toString()===r.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,st.jsx)(Ae,{children:p.map(c=>(0,st.jsx)(ie,{value:c.id.toString(),children:c.name},c.id))})]}),m&&(0,st.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,st.jsxs)("div",{className:"space-y-2",children:[(0,st.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,st.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:c=>s({...r,isRecurring:c.target.checked}),className:"rounded border-border"}),(0,st.jsx)(A,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,st.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,st.jsxs)(Fe,{value:r.recurrencePattern,onValueChange:c=>s({...r,recurrencePattern:c}),children:[(0,st.jsx)(Ee,{children:(0,st.jsx)(Qe,{})}),(0,st.jsxs)(Ae,{children:[(0,st.jsx)(ie,{value:"daily",children:"Daily"}),(0,st.jsx)(ie,{value:"weekly",children:"Weekly"}),(0,st.jsx)(ie,{value:"monthly",children:"Monthly"}),(0,st.jsx)(ie,{value:"yearly",children:"Yearly"})]})]})]}),(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"recurrenceInterval",children:"Every"}),(0,st.jsx)(Z,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:c=>s({...r,recurrenceInterval:parseInt(c.target.value)})})]})]})]}),(0,st.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,st.jsx)(S,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,st.jsx)(S,{type:"submit",children:"Add Reminder"})]})]})]})})},Si=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:r})=>{let[s,m]=(0,ae.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("st")[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,st.jsx)(Ge,{open:o,onOpenChange:r,children:(0,st.jsxs)(Oe,{className:"max-w-2xl",children:[(0,st.jsx)(ze,{children:(0,st.jsx)(He,{children:"Edit Reminder"})}),(0,st.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,st.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"edit-title",children:"Title"}),(0,st.jsx)(Z,{id:"edit-title",value:s.title,onChange:p=>m({...s,title:p.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"edit-description",children:"Description"}),(0,st.jsx)(Pe,{id:"edit-description",value:s.description||"",onChange:p=>m({...s,description:p.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,st.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,st.jsx)(Z,{id:"edit-dueDate",type:"date",value:s.dueDate,onChange:p=>m({...s,dueDate:p.target.value}),required:!0})]}),(0,st.jsxs)("div",{children:[(0,st.jsx)(A,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,st.jsx)(Z,{id:"edit-dueTime",type:"time",value:s.dueTime,onChange:p=>m({...s,dueTime:p.target.value})})]})]}),(0,st.jsx)("div",{className:"space-y-2",children:(0,st.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,st.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:s.isRecurring||!1,onChange:p=>m({...s,isRecurring:p.target.checked}),className:"rounded border-border"}),(0,st.jsx)(A,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,st.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,st.jsx)(S,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,st.jsx)(S,{type:"submit",children:"Save Changes"})]})]})]})})},ki=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[r,s]=(0,ae.useState)(!1);if(!e||!e.id)return null;let m=Ia(new Date(e.dueDate||""),e.dueTime||""),n=Fa(new Date(e.dueDate||"")),u=Ni(new Date(e.dueDate||"")),p=()=>{a(e.id.toString(),{})},c=()=>n?"Today":u?"Tomorrow":yi(new Date(e.dueDate||""));return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)(Si,{reminder:e,colleagues:t,onUpdateReminder:a,open:r,onClose:()=>s(!1)}),(0,st.jsx)(re,{children:(0,st.jsx)(Ot,{className:"p-4",children:(0,st.jsxs)("div",{className:"flex items-start justify-between",children:[(0,st.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,st.jsx)("button",{onClick:p,className:"mt-1 text-primary hover:text-primary/80"}),(0,st.jsxs)("div",{className:"flex-1",children:[(0,st.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,st.jsx)("h3",{children:e.title})}),(0,st.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,st.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,st.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,st.jsx)(lt.Calendar,{className:"h-4 w-4"}),(0,st.jsx)("span",{className:m?"text-destructive font-medium":"",children:c()})]}),e.dueTime&&(0,st.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,st.jsx)(lt.Clock,{className:"h-4 w-4"}),(0,st.jsx)("span",{children:wi(e.dueTime)})]}),(0,st.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,st.jsx)(lt.User,{className:"h-4 w-4"}),(0,st.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,st.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,st.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>s(!0),className:"h-8 w-8 p-0",children:(0,st.jsx)(lt.Edit2,{className:"h-4 w-4"})}),(0,st.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,st.jsx)(lt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Uo=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:r})=>{let[s,m]=(0,ae.useState)(e.filter(Boolean)),[n,u]=(0,ae.useState)(t.filter(Boolean)),[p,c]=(0,ae.useState)("all"),[g,E]=(0,ae.useState)(""),[k,b]=(0,ae.useState)(!1);(0,ae.useEffect)(()=>{m(e.filter(Boolean))},[e]),(0,ae.useEffect)(()=>{u(t.filter(Boolean))},[t]);let I=C=>{if(!C.title){console.error("Invalid reminder data:",C);return}let $={...C,id:Date.now(),createdAt:new Date().toISOString()};m(Y=>[...Y,$]),a?.(C)},x=(C,$)=>{if(!C){console.error("No reminder ID provided for update");return}m(Y=>Y.map(j=>j?.id.toString()===C?{...j,...$}:j)),o?.(C,$)},U=C=>{if(!C){console.error("No reminder ID provided for deletion");return}m($=>$.filter(Y=>Y?.id.toString()!==C)),r?.(C)},y=s.filter(C=>{if(!C)return!1;if(g){let $=g.toLowerCase();if(!(C.title.toLowerCase().includes($)||C.description?.toLowerCase().includes($)))return!1}switch(p){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,$)=>{if(!C||!$)return 0;let Y={high:3,medium:2,low:1},j=0;return j!==0?j:new Date(C.dueDate||"").getTime()-new Date($.dueDate||"").getTime()}),F={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},pe=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,st.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,st.jsx)(at,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-st-r from-emerald-600 via-teal-600 st-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{b(!0)}}}),(0,st.jsxs)("div",{className:"h-full bg-background",children:[(0,st.jsx)(Ci,{colleagues:n,onAddReminder:I,open:k,setOpen:b}),(0,st.jsxs)("div",{className:"p-6",children:[(0,st.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,st.jsxs)("div",{children:[(0,st.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,st.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,st.jsxs)(S,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,st.jsx)(lt.Plus,{className:"h-4 w-4"}),(0,st.jsx)("span",{children:"Add Reminder"})]})]}),(0,st.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,st.jsxs)(re,{className:"p-4",children:[(0,st.jsx)("div",{className:"text-2xl font-bold text-foreground",children:F.total}),(0,st.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,st.jsxs)(re,{className:"p-4",children:[(0,st.jsx)("div",{className:"text-2xl font-bold text-primary",children:F.overdue}),(0,st.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,st.jsxs)(re,{className:"p-4",children:[(0,st.jsx)("div",{className:"text-2xl font-bold text-success",children:F.today}),(0,st.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,st.jsxs)(re,{className:"p-4",children:[(0,st.jsx)("div",{className:"text-2xl font-bold text-destructive",children:F.overdue}),(0,st.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,st.jsxs)(re,{className:"p-4",children:[(0,st.jsx)("div",{className:"text-2xl font-bold text-warning",children:F.today}),(0,st.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,st.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,st.jsx)("div",{className:"flex-1",children:(0,st.jsx)(Z,{placeholder:"Search reminders...",value:g,onChange:C=>E(C.target.value),className:"max-w-md"})}),(0,st.jsxs)(Fe,{value:p,onValueChange:C=>c(C),children:[(0,st.jsx)(Ee,{className:"w-40",children:(0,st.jsx)(Qe,{})}),(0,st.jsxs)(Ae,{children:[(0,st.jsxs)(ie,{value:"all",children:["All (",F.total,")"]}),(0,st.jsxs)(ie,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,st.jsxs)(ie,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,st.jsxs)(ie,{value:"today",children:["Today (",F.today,")"]})]})]})]}),(0,st.jsx)("div",{className:"space-y-4",children:y.length===0?(0,st.jsxs)(re,{className:"p-8 text-center",children:[(0,st.jsx)("div",{className:"text-muted-foreground",children:g||p!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&p==="all"&&(0,st.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder st get started"})]}):y.map(C=>C&&(0,st.jsx)(ki,{reminder:C,colleagues:n,onUpdateReminder:x,onDeleteReminder:U},C.id))})]})]})]})};var Et=ge(require("@radix-ui/react-tabs"));function $o({className:e,...t}){return(0,st.jsx)(Et.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",e),...t})}function Go({className:e,...t}){return(0,st.jsx)(Et.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,st.jsx)(Et.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 ut=ge(require("react")),V=ge(require("@radix-ui/react-dropdown-menu")),$t=require("@radix-ui/react-icons");var Wo=V.Root,_o=V.Trigger;var Di=ut.forwardRef(({className:e,inset:t,children:a,...o},r)=>(0,st.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,st.jsx)($t.ChevronRightIcon,{className:"ml-auto"})]}));Di.displayName=V.SubTrigger.displayName;var Ti=ut.forwardRef(({className:e,...t},a)=>(0,st.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=ut.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,st.jsx)(V.Portal,{children:(0,st.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=ut.forwardRef(({className:e,inset:t,...a},o)=>(0,st.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=ut.forwardRef(({className:e,children:t,checked:a,...o},r)=>(0,st.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,st.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,st.jsx)(V.ItemIndicator,{children:(0,st.jsx)($t.CheckIcon,{className:"h-4 w-4"})})}),t]}));Pi.displayName=V.CheckboxItem.displayName;var Ri=ut.forwardRef(({className:e,children:t,...a},o)=>(0,st.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,st.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,st.jsx)(V.ItemIndicator,{children:(0,st.jsx)($t.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Ri.displayName=V.RadioItem.displayName;var Ei=ut.forwardRef(({className:e,inset:t,...a},o)=>(0,st.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=ut.forwardRef(({className:e,...t},a)=>(0,st.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,st.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 m=a.find(n=>n.value===e);return(0,st.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,st.jsx)("div",{className:"hidden lg:block",children:(0,st.jsx)($o,{value:e,onValueChange:t,children:(0,st.jsx)(Go,{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,st.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,st.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,st.jsx)("div",{className:"lg:hidden",children:(0,st.jsxs)(Wo,{children:[(0,st.jsx)(_o,{asChild:!0,children:(0,st.jsxs)(S,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[m?.label||"Select",(0,st.jsx)(lt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,st.jsx)(La,{align:"center",className:"w-[180px]",children:a.map(n=>(0,st.jsx)(Ba,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}var Ii=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function ua({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:r=!0,className:s}){return(0,st.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${s||""}`,children:[r&&(0,st.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,st.jsx)("div",{className:"col-span-6",children:"Name"}),(0,st.jsx)("div",{className:"col-span-2",children:"Size"}),(0,st.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,st.jsx)("div",{className:"divide-y",children:e.map(m=>(0,st.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?.(m),children:[(0,st.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,st.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,st.jsx)("div",{children:(0,st.jsx)("p",{className:"font-medium",children:m.name})})]}),(0,st.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:Ii(m.filesize)}),(0,st.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,st.jsx)("span",{className:"text-sm md:text-base",children:new Date(m.createdAt).toLocaleDateString()}),(0,st.jsx)("div",{className:"flex gap-1",children:(0,st.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:n=>{n.stopPropagation(),o?.(m)},children:(0,st.jsx)(lt.Trash2,{className:"h-4 w-4"})})})]})]},m.name))})]})}var Zo=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,r]=(0,ae.useState)(null),[s,m]=(0,ae.useState)(""),[n,u]=(0,ae.useState)(""),[p,c]=(0,ae.useState)(""),g=k=>{let b=k.target.files?.[0];b&&(r(b),s||m(b.name))},E=async k=>{if(k.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",s),n&&b.append("description",n),p&&b.append("tags",p),a?.(b),t(),r(null),m(""),u(""),c("")};return(0,st.jsx)(Ge,{open:e,onOpenChange:t,children:(0,st.jsxs)(Oe,{className:"sm:max-w-md",children:[(0,st.jsx)(ze,{children:(0,st.jsx)(He,{children:"Add New File"})}),(0,st.jsxs)("form",{onSubmit:E,className:"grid gap-4",children:[(0,st.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,st.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,st.jsxs)("div",{className:"flex flex-col items-center justify-center ae-5 pb-6",children:[(0,st.jsx)(Fi,{className:"w-10 h-10 text-gray-400"}),(0,st.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,st.jsx)("span",{className:"font-semibold",children:"Click st upload"})," or drag and drop"]}),(0,st.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,st.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),o&&(0,st.jsxs)("div",{className:"flex items-center justify-between",children:[(0,st.jsxs)("div",{children:[(0,st.jsx)("p",{className:"font-medium",children:o.name}),(0,st.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,st.jsx)(S,{type:"submit",onClick:E,children:"Upload"})]})]})]})})};function Fi(e){return(0,st.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,st.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,st.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,st.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:m}){let[n,u]=(0,ae.useState)(e),[p,c]=(0,ae.useState)(""),[g,E]=(0,ae.useState)("all"),[k,b]=(0,ae.useState)("all"),[I,x]=(0,ae.useState)(!1),U=(0,ae.useRef)(""),J=q=>q.map(D=>`${D.id}-${new Date(D.createdAt).getTime()}-${new Date(D.updatedAt).getTime()}`).join("-");(0,ae.useEffect)(()=>{let q=J(e);q!==U.current&&(u(e),U.current=q)},[e]);let y=n.filter(q=>q.name.toLowerCase().includes(p.toLowerCase())),F=y.slice(0,10),pe=y.filter(Boolean),C=()=>{x(!0)},$=q=>{a?.(q)},Y=q=>{console.log("deleting file",q),u(D=>D.filter(Ne=>Ne.name!==q.name)),o?.(q.id.toString())},j=q=>{r?.(q)},we=()=>{c(""),E("all")};return(0,st.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,st.jsx)(Mo.AnimatePresence,{mode:"wait",children:(0,st.jsx)(Mo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,st.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,st.jsx)(at,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-st-r from-blue-600 via-indigo-600 st-purple-600",primaryAction:{label:"Upload file",onClick:C},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,st.jsx)(re,{children:(0,st.jsx)(Ot,{className:"ae-6",children:(0,st.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,st.jsx)("div",{className:"flex-1",children:(0,st.jsxs)("div",{className:"relative",children:[(0,st.jsx)(lt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,st.jsx)(Z,{placeholder:"Search files...",value:p,onChange:q=>c(q.target.value),className:"pl-9"})]})}),(p||g!=="all")&&(0,st.jsxs)(S,{variant:"outline",onClick:we,className:"gap-2",children:[(0,st.jsx)(lt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,st.jsxs)("div",{className:"space-y-4",children:[(0,st.jsx)(qo,{activeTab:k,onTabChange:b,tabOptions:[{value:"all",label:`All Files (${y.length})`},{value:"recent",label:`Recent (${F.length})`}],maxWidth:"500px",gridCols:3}),k==="all"&&(0,st.jsx)(ua,{files:y,onFileClick:j,onFileEdit:$,onFileDelete:Y,showHeader:!s}),k==="recent"&&(0,st.jsx)(ua,{files:F,onFileClick:j,onFileEdit:$,onFileDelete:Y,showHeader:!s}),k==="shared"&&(0,st.jsx)(ua,{files:pe,onFileClick:j,onFileEdit:$,onFileDelete:Y,showHeader:!s})]}),y.length===0&&(0,st.jsx)(re,{children:(0,st.jsx)(Ot,{className:"ae-6",children:(0,st.jsxs)("div",{className:"text-center py-8",children:[(0,st.jsx)(lt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,st.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,st.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"?"Try adjusting your filters st see more results.":"Get started by uploading your first file."}),(0,st.jsxs)(S,{onClick:C,className:"gap-2",children:[(0,st.jsx)(lt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,st.jsx)(Zo,{isOpen:I,onClose:()=>x(!1),onAddFile:t})]})}var Yo=require("next/navigation");function Qo({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:r=[],initialReminders:s=[],initialColleagues:m=[],initialUsers:n=[],initialFiles:u=[],initialView:p="kanban",onAddTask:c,onUpdateTask:g,onDeleteTask:E,onTaskClick:k,onAddEpic:b,onUpdateEpic:I,onDeleteEpic:x,onAddTaskToEpic:U,onAddSprint:J,onUpdateSprint:y,onDeleteSprint:F,onAddProject:pe,onUpdateProject:C,onDeleteProject:$,onFileAdd:Y,onFileEdit:j,onFileDelete:we,onFileClick:q,onAddReminder:D,onUpdateReminder:Ne,onDeleteReminder:ce,onViewChange:Ye,onToggleMobileMenu:he,onTeamClick:it,onTeamChange:et,onCopilotClick:je,handleAddComment:We}){let[h,W]=(0,ae.useState)(t),[ne,_e]=(0,ae.useState)(a),[Q,Ue]=(0,ae.useState)(o),[At,nt]=(0,ae.useState)(r),[Gt,gt]=(0,ae.useState)(s),[wt,Mt]=(0,ae.useState)(m),[ft,It]=(0,ae.useState)(n),[Ft,N]=(0,ae.useState)(u),[d,f]=(0,ae.useState)(!1),[L,G]=(0,ae.useState)(!1),[ue,me]=(0,ae.useState)(null),[Ie,jt]=(0,ae.useState)(null),[Wt,_t]=(0,ae.useState)(null),[Nt,Ha]=(0,ae.useState)(p||"kanban"),[Bi,er]=(0,ae.useState)(!1),tr=(0,Yo.useRouter)();(0,ae.useEffect)(()=>{W(t)},[t]),(0,ae.useEffect)(()=>{Ue(o)},[o]),(0,ae.useEffect)(()=>{_e(a)},[a]),(0,ae.useEffect)(()=>{nt(r)},[r]),(0,ae.useEffect)(()=>{N(u)},[u]),(0,ae.useEffect)(()=>{It(n)},[n]),(0,ae.useEffect)(()=>{Mt(m)},[m]),(0,ae.useEffect)(()=>{gt(s)},[s]),(0,ae.useEffect)(()=>{Ha(p)},[p]);let ar=h.filter(v=>{}),Oi=v=>ar.filter(M=>M.status===v),zi=v=>{let M={};return ne.forEach(B=>{}),M},Hi=v=>{_t(v)},Vi=v=>{Wt&&(W(M=>M.map(B=>B.id===Wt.id?{...B,status:v}:B)),_t(null))},Va=v=>{let M={...v,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};W(B=>[...B,M]),c?.(M)},ea=async(v,M)=>(W(B=>B.map(Ce=>Ce.id===Number(v)?{...Ce,...M}:Ce)),await g?.(v,M)),Ui=async(v,M)=>{ea(v,M)},Ua=v=>{W(M=>M.filter(B=>B.id!==Number(v))),ue?.id===Number(v)&&me(null),E?.(v)},$st=async v=>{Ua(v)},Gi=v=>{let M={...v,id:Date.now()};nt(B=>[...B,M]),pe?.(v)},ji=(v,M)=>{nt(B=>B.map(Ce=>Ce.id===Number(v)?{...Ce,...M}:Ce)),C?.(v,M)},Wi=v=>{nt(M=>M.filter(B=>B.id!==Number(v))),$?.(v)},$a=v=>{let M={...v,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};_e(B=>[...B,M]),b?.({...M})},or=()=>{G(!0)},rr=(v,M)=>{_e(B=>B.map(Ce=>Ce.id===Number(v)?{...Ce,...M}:Ce)),I?.(v,M)},ir=v=>{_e(M=>M.filter(B=>B.id!==Number(v))),W(M=>M.filter(B=>be(B.epic)!==Number(v))),x?.(v)},nr=v=>{let M={...v,id:Date.now()};Ue(B=>[...B,M]),J?.(v)},sr=(v,M)=>{Ue(B=>B.map(Ce=>Ce.id===Number(v)?{...Ce,...M}:Ce)),y?.(v,M)},lr=v=>{v==="backlog"||v==="all-tasks"||(Ue(M=>M.filter(B=>B.id!==Number(v))),W(M=>M.map(B=>be(B.sprint)===Number(v)?{...B,sprint:void 0}:B)),F?.(v))},fa=v=>{me(v)},dr=v=>{v==="planning"&&window.innerWidth<768||(Ha(v),Ye?.(v))},_i=()=>{er(v=>!v),he?.()},Ki=()=>{tr.push("/")},qi=v=>{console.log("Switching st team:",v)},Ji=v=>{console.log("Switching st team:",v)},cr=v=>{f(!0)},mr=()=>{f(!1),jt(null)},pr=v=>{let M={...v,id:Date.now(),createdAt:new Date().toISOString()};gt(B=>[...B,M]),D?.(v)},ur=(v,M)=>{gt(B=>B.map(Ce=>Ce.id===Number(v)?{...Ce,...M}:Ce)),Ne?.(v,M)},gr=v=>{gt(M=>M.filter(B=>B.id!==Number(v))),ce?.(v)},fr=()=>{Y?.()},vr=v=>{j?.(v)},br=v=>{N(M=>M.filter(B=>B.name!==v)),we?.(v)},hr=v=>{q?.(v)},Xi=[{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"}],Zi=()=>{switch(Nt){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")}],Yi=va.sort((v,M)=>M.lastUsed.getTime()-v.lastUsed.getTime()).slice(0,3),Qi=va.length>3,en=va.slice(3);return(0,st.jsxs)(ja,{currentView:Nt,onViewChange:dr,children:[Nt==="kanban"&&(0,st.jsx)("div",{className:"h-full overflow-hidden",children:(0,st.jsx)(Io,{initialProjects:At,initialEpics:ne,initialSprints:Q.map(v=>({...v,isSelected:!1})),initialTasks:h,initialColleagues:wt,initialUsers:ft,onAddTask:Va,onUpdateTask:ea,onDeleteTask:Ua,onTaskClick:fa,onAddEpic:$a,onAddComment:We})}),Nt==="planning"&&(0,st.jsx)("div",{className:"hidden md:block h-full",children:(0,st.jsx)(Vo,{tasks:h,epics:ne,sprints:Q,onUpdateTask:ea,onTaskClick:fa,onAddSprint:nr,onUpdateSprint:sr,onDeleteSprint:lr})}),Nt==="tasks"&&(0,st.jsx)("div",{className:"h-full",children:(0,st.jsx)(Uo,{initialReminders:Gt,initialColleagues:wt,onAddReminder:pr,onUpdateReminder:ur,onDeleteReminder:gr})}),Nt==="files"&&(0,st.jsx)("div",{className:"h-full",children:(0,st.jsx)(za,{initialFiles:Ft,onFileAdd:fr,onFileEdit:vr,onFileDelete:br,onFileClick:hr,compactView:!1})}),Nt==="epics"&&(0,st.jsx)("div",{className:"h-full",children:(0,st.jsx)(Fo,{tasks:h,epics:ne,sprints:Q,onUpdateTask:ea,onTaskClick:fa,onAddTaskToEpic:cr,onAddEpic:or,onUpdateEpic:rr,onDeleteEpic:ir})}),(0,st.jsx)(Ht,{isOpen:d,onClose:mr,onAddTask:Va,epics:ne,sprints:Q,assignees:[...wt,...ft],defaultEpicId:Ie||void 0}),(0,st.jsx)(Ut,{isOpen:L,onClose:()=>G(!1),onAddEpic:$a})]})}
5
+ "use strict";"use client";var qi=Object.create;var Ao=Object.defineProperty;var Xi=Object.getOwnPropertyDescriptor;var Yi=Object.getOwnPropertyNames;var Qi=Object.getPrototypeOf,en=Object.prototype.hasOwnProperty;var tn=(e,t)=>{for(var o in t)Ao(e,o,{get:t[o],enumerable:!0})},Ba=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Yi(t))!en.call(e,r)&&r!==o&&Ao(e,r,{get:()=>t[r],enumerable:!(a=Xi(t,r))||a.enumerable});return e};var ce=(e,t,o)=>(o=e!=null?qi(Qi(e)):{},Ba(t||!e||!e.__esModule?Ao(o,"default",{value:e,enumerable:!0}):o,e)),on=e=>Ba(Ao({},"__esModule",{value:!0}),e);var As={};tn(As,{default:()=>Ei});module.exports=on(As);var pe=require("react");var wt=require("lucide-react"),yt=require("react/jsx-runtime"),an=[{key:"kanban",icon:wt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:wt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:wt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:wt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:wt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Va=({currentView:e,onViewChange:t,children:o})=>(0,yt.jsxs)("div",{className:"flex w-full h-screen",children:[(0,yt.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:an.map(a=>{let r=a.icon,i=e===a.key;return(0,yt.jsxs)("button",{onClick:()=>t(a.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${i?a.color:`${a.color}/75 hover:${a.color}`} ${a.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:a.title,children:[(0,yt.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,yt.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:a.label})]},a.key)})}),(0,yt.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,yt.jsx)("div",{className:"w-full h-full",children:o})})]});var le=ce(require("react"));var Ja=require("class-variance-authority");var Za=require("clsx");var ra="-",rn=e=>{let t=sn(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{let n=s.split(ra);return n[0]===""&&n.length!==1&&n.shift(),$a(n,t)||nn(s)},getConflictingClassGroupIds:(s,n)=>{let p=o[s]||[];return n&&a[s]?[...p,...a[s]]:p}}},$a=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?$a(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(ra);return t.validators.find(({validator:s})=>s(i))?.classGroupId},Ua=/^\[(.+)\]$/,nn=e=>{if(Ua.test(e)){let t=Ua.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},sn=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return dn(Object.entries(e.classGroups),o).forEach(([i,s])=>{aa(s,a,i,t)}),a},aa=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:za(t,r);i.classGroupId=o;return}if(typeof r=="function"){if(ln(r)){aa(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([i,s])=>{aa(s,za(t,i),o,a)})})},za=(e,t)=>{let o=e;return t.split(ra).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},ln=e=>e.isThemeGetter,dn=(e,t)=>t?e.map(([o,a])=>{let r=a.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,n])=>[t+s,n])):i);return[o,r]}):e,cn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,r=(i,s)=>{o.set(i,s),t++,t>e&&(t=0,a=o,o=new Map)};return{get(i){let s=o.get(i);if(s!==void 0)return s;if((s=a.get(i))!==void 0)return r(i,s),s},set(i,s){o.has(i)?o.set(i,s):r(i,s)}}},_a="!",mn=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,r=t[0],i=t.length,s=n=>{let p=[],u=0,d=0,g;for(let f=0;f<n.length;f++){let H=n[f];if(u===0){if(H===r&&(a||n.slice(f,f+i)===t)){p.push(n.slice(d,f)),d=f+i;continue}if(H==="/"){g=f;continue}}H==="["?u++:H==="]"&&u--}let h=p.length===0?n:n.substring(d),x=h.startsWith(_a),v=x?h.substring(1):h,T=g&&g>d?g-d:void 0;return{modifiers:p,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:T}};return o?n=>o({className:n,parseClassName:s}):s},pn=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},un=e=>({cache:cn(e.cacheSize),parseClassName:mn(e),...rn(e)}),gn=/\s+/,fn=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(gn),n="";for(let p=s.length-1;p>=0;p-=1){let u=s[p],{modifiers:d,hasImportantModifier:g,baseClassName:h,maybePostfixModifierPosition:x}=o(u),v=!!x,T=a(v?h.substring(0,x):h);if(!T){if(!v){n=u+(n.length>0?" "+n:n);continue}if(T=a(h),!T){n=u+(n.length>0?" "+n:n);continue}v=!1}let f=pn(d).join(":"),H=g?f+_a:f,V=H+T;if(i.includes(V))continue;i.push(V);let C=r(T,v);for(let w=0;w<C.length;++w){let X=C[w];i.push(H+X)}n=u+(n.length>0?" "+n:n)}return n};function vn(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Ga(t))&&(a&&(a+=" "),a+=o);return a}var Ga=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Ga(e[a]))&&(o&&(o+=" "),o+=t);return o};function hn(e,...t){let o,a,r,i=s;function s(p){let u=t.reduce((d,g)=>g(d),e());return o=un(u),a=o.cache.get,r=o.cache.set,i=n,n(p)}function n(p){let u=a(p);if(u)return u;let d=fn(p,o);return r(p,d),d}return function(){return i(vn.apply(null,arguments))}}var ue=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},ja=/^\[(?:([a-yt-]+):)?(.+)\]$/i,bn=/^\d+\/\d+$/,xn=new Set(["px","full","screen"]),yn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Cn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nn=/^(inset_)?-?((\d+)?\.?(\d+)[a-yt]+|0)_-?((\d+)?\.?(\d+)[a-yt]+|0)/,Tn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ct=e=>Qt(e)||xn.has(e)||bn.test(e),Et=e=>eo(e,"length",An),Qt=e=>!!e&&!Number.isNaN(Number(e)),oa=e=>eo(e,"number",Qt),fo=e=>!!e&&Number.isInteger(Number(e)),Sn=e=>e.endsWith("%")&&Qt(e.slice(0,-1)),$=e=>ja.test(e),Mt=e=>yn.test(e),Dn=new Set(["length","size","percentage"]),kn=e=>eo(e,Dn,Wa),Pn=e=>eo(e,"position",Wa),Rn=new Set(["image","url"]),En=e=>eo(e,Rn,Ln),Mn=e=>eo(e,"",In),vo=()=>!0,eo=(e,t,o)=>{let a=ja.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},An=e=>wn.test(e)&&!Cn.test(e),Wa=()=>!1,In=e=>Nn.test(e),Ln=e=>Tn.test(e);var Fn=()=>{let e=ue("colors"),t=ue("spacing"),o=ue("blur"),a=ue("brightness"),r=ue("borderColor"),i=ue("borderRadius"),s=ue("borderSpacing"),n=ue("borderWidth"),p=ue("contrast"),u=ue("grayscale"),d=ue("hueRotate"),g=ue("invert"),h=ue("gap"),x=ue("gradientColorStops"),v=ue("gradientColorStopPositions"),T=ue("inset"),f=ue("margin"),H=ue("opacity"),V=ue("padding"),C=ue("saturate"),w=ue("scale"),X=ue("sepia"),P=ue("skew"),j=ue("space"),J=ue("translate"),W=()=>["auto","contain","none"],Ce=()=>["auto","hidden","clip","visible","scroll"],De=()=>["auto",$,t],S=()=>[$,t],ae=()=>["",Ct,Et],se=()=>["auto",Qt,$],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],de=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$e=()=>["start","end","center","between","around","evenly","stretch"],ke=()=>["","0",$],it=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[Qt,$];return{cacheSize:500,separator:":",theme:{colors:[vo],spacing:[Ct,Et],blur:["none","",Mt,$],brightness:D(),borderColor:[e],borderRadius:["none","","full",Mt,$],borderSpacing:S(),borderWidth:ae(),contrast:D(),grayscale:ke(),hueRotate:D(),invert:ke(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[Sn,Et],inset:De(),margin:De(),opacity:D(),padding:S(),saturate:D(),scale:D(),sepia:ke(),skew:D(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",$]}],container:["container"],columns:[{columns:[Mt]}],"break-after":[{"break-after":it()}],"break-before":[{"break-before":it()}],"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:[...E(),$]}],overflow:[{overflow:Ce()}],"overflow-x":[{"overflow-x":Ce()}],"overflow-y":[{"overflow-y":Ce()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[T]}],"inset-x":[{"inset-x":[T]}],"inset-y":[{"inset-y":[T]}],start:[{start:[T]}],end:[{end:[T]}],top:[{top:[T]}],right:[{right:[T]}],bottom:[{bottom:[T]}],left:[{left:[T]}],visibility:["visible","invisible","collapse"],yt:[{yt:["auto",fo,$]}],basis:[{basis:De()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$]}],grow:[{grow:ke()}],shrink:[{shrink:ke()}],order:[{order:["first","last","none",fo,$]}],"grid-cols":[{"grid-cols":[vo]}],"col-start-end":[{col:["auto",{span:["full",fo,$]},$]}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":[vo]}],"row-start-end":[{row:["auto",{span:[fo,$]},$]}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...$e()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$e(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$e(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[V]}],px:[{px:[V]}],py:[{py:[V]}],ps:[{ps:[V]}],pe:[{pe:[V]}],pt:[{pt:[V]}],pr:[{pr:[V]}],pb:[{pb:[V]}],pl:[{pl:[V]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],yt:[{yt:[f]}],wt:[{wt:[f]}],yt:[{yt:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$,t]}],"min-w":[{"min-w":[$,t,"min","max","fit"]}],"max-w":[{"max-w":[$,t,"none","full","min","max","fit","prose",{screen:[Mt]},Mt]}],h:[{h:[$,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Mt,Et]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",oa]}],"font-family":[{font:[vo]}],"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",$]}],"line-clamp":[{"line-clamp":["none",Qt,oa]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ct,$]}],"list-image":[{"list-image":["none",$]}],"list-style-type":[{list:["none","disc","decimal",$]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[H]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ct,Et]}],"underline-offset":[{"underline-offset":["auto",Ct,$]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$]}],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",$]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[H]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),Pn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","yt","tl"]},En]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-yt":[{"rounded-yt":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-wt":[{"rounded-wt":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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-yt":[{"border-yt":[n]}],"border-opacity":[{"border-opacity":[H]}],"border-style":[{border:[...G(),"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":[H]}],"divide-style":[{divide:G()}],"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-yt":[{"border-yt":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Ct,$]}],"outline-w":[{outline:[Ct,Et]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[H]}],"ring-offset-w":[{"ring-offset":[Ct,Et]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Mt,Mn]}],"shadow-color":[{shadow:[vo]}],opacity:[{opacity:[H]}],"mix-blend":[{"mix-blend":[...de(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":de()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",Mt,$]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[C]}],sepia:[{sepia:[X]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[H]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",$]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",$]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[fo,$]}],"translate-x":[{"translate-x":[J]}],"translate-y":[{"translate-y":[J]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","yt-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-yt":[{"scroll-yt":S()}],"scroll-wt":[{"scroll-wt":S()}],"scroll-yt":[{"scroll-yt":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ct,Et,oa]}],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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","yt","wt","yt","mb","ml"],mx:["yt","ml"],my:["wt","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-yt","rounded-ss","rounded-se","rounded-wt","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-wt"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-yt":["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-yt"],"border-w-x":["border-w-r","border-w-yt"],"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-yt"],"border-color-x":["border-color-r","border-color-yt"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-yt","scroll-wt","scroll-yt","scroll-mb","scroll-ml"],"scroll-mx":["scroll-yt","scroll-ml"],"scroll-my":["scroll-wt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ka=hn(Fn);function N(...e){return Ka((0,Za.clsx)(e))}var On=(0,Ja.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 he({className:e,variant:t,...o}){return(0,yt.jsx)("div",{className:N(On({variant:t}),e),...o})}var Bt=ce(require("react"));var ge=Bt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)("div",{ref:o,className:N("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ge.displayName="Card";var Hn=Bt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)("div",{ref:o,className:N("flex flex-col space-y-1.5 p-6",e),...t}));Hn.displayName="CardHeader";var Bn=Bt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)("div",{ref:o,className:N("font-semibold leading-none tracking-tight",e),...t}));Bn.displayName="CardTitle";var Vn=Bt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)("div",{ref:o,className:N("text-sm text-muted-foreground",e),...t}));Vn.displayName="CardDescription";var to=Bt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)("div",{ref:o,className:N("p-6 pt-0",e),...t}));to.displayName="CardContent";var Un=Bt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)("div",{ref:o,className:N("flex items-center p-6 pt-0",e),...t}));Un.displayName="CardFooter";var Xa=({title:e,status:t,taskCount:o,children:a,onDrop:r,isCompact:i=!1,height:s})=>{let n=d=>{d.preventDefault()},p=d=>{d.preventDefault(),r(t)};return(0,yt.jsxs)(ge,{className:`p-4 bg-card border-yt-4 ${(()=>{switch(t){case"todo":return"border-yt-gray-400";case"in-progress":return"border-yt-blue-500";case"review":return"border-yt-orange-500";case"done":return"border-yt-green-500";default:return"border-yt-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-xs":""}`,style:{height:s||"calc(100vh - 350px)"},onDragOver:n,onDrop:p,children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,yt.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,yt.jsx)(he,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,yt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:a})]})};var ho=({task:e,epic:t,onDragStart:o,onTaskClick:a,isCompact:r=!1})=>{let i=d=>{o(e)},s=()=>{a(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"}},p=()=>{switch(e.type){case"story":return(0,yt.jsx)(wt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,yt.jsx)(wt.Bug,{className:"h-3 w-3"});case"spike":return(0,yt.jsx)(wt.Zap,{className:"h-3 w-3"});case"task":default:return(0,yt.jsx)(wt.AlertCircle,{className:"h-3 w-3"})}},u=()=>{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,yt.jsx)(ge,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:i,onClick:s,children:(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${u()}`,children:p()}),(0,yt.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,yt.jsxs)(ge,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:i,onClick:s,children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,yt.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${u()}`,children:[p(),(0,yt.jsx)("span",{className:"capitalize",children:e.type})]}),(0,yt.jsxs)("div",{className:"flex gap-1",children:[(0,yt.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,yt.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,yt.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,yt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,yt.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,yt.jsx)(wt.User,{className:"h-4 w-4"}),(0,yt.jsx)("span",{children:e.assignee?.value?.name})]}),(0,yt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,yt.jsx)(wt.Calendar,{className:"h-4 w-4"}),(0,yt.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var bo=ce(require("react")),Fe=ce(require("@radix-ui/react-dialog"));var ze=Fe.Root;var ia=Fe.Portal;var Io=bo.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Fe.Overlay,{ref:o,className:N("fixed inset-0 yt-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}));Io.displayName=Fe.Overlay.displayName;var _e=bo.forwardRef(({className:e,children:t,...o},a)=>(0,yt.jsxs)(ia,{children:[(0,yt.jsx)(Io,{}),(0,yt.jsxs)(Fe.Content,{ref:a,className:N("fixed left-[50%] top-[50%] yt-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,yt.jsxs)(Fe.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,yt.jsx)(wt.X,{className:"h-4 w-4"}),(0,yt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));_e.displayName=Fe.Content.displayName;var Ge=({className:e,...t})=>(0,yt.jsx)("div",{className:N("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ge.displayName="DialogHeader";var xo=({className:e,...t})=>(0,yt.jsx)("div",{className:N("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xo.displayName="DialogFooter";var je=bo.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Fe.Title,{ref:o,className:N("text-lg font-semibold leading-none tracking-tight",e),...t}));je.displayName=Fe.Title.displayName;var zn=bo.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Fe.Description,{ref:o,className:N("text-sm text-muted-foreground",e),...t}));zn.displayName=Fe.Description.displayName;var Qa=require("@radix-ui/react-slot"),tr=ce(require("react")),yo=(0,Ja.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=tr.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...r},i)=>(0,yt.jsx)(e?Qa.Slot:"button",{className:N(yo({className:t,size:o,variant:a})),ref:i,...r}));k.displayName="Button";var ar=ce(require("react"));var te=ar.forwardRef(({className:e,type:t,...o},a)=>(0,yt.jsx)("input",{type:t,className:N("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:a,...o}));te.displayName="Input";var ir=ce(require("react")),Ee=ir.forwardRef(({className:e,...t},o)=>(0,yt.jsx)("textarea",{className:N("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:o,...t}));Ee.displayName="Textarea";var K=ce(require("@radix-ui/react-select")),At=ce(require("react")),qe=K.Root;var pt=K.Value,We=At.forwardRef(({children:e,className:t,...o},a)=>(0,yt.jsxs)(K.Trigger,{className:N("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:a,...o,children:[e,(0,yt.jsx)(K.Icon,{asChild:!0,children:(0,yt.jsx)(wt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));We.displayName=K.Trigger.displayName;var sr=At.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(K.ScrollUpButton,{className:N("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,yt.jsx)(wt.ChevronUp,{className:"h-4 w-4"})}));sr.displayName=K.ScrollUpButton.displayName;var lr=At.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(K.ScrollDownButton,{className:N("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,yt.jsx)(wt.ChevronDown,{className:"h-4 w-4"})}));lr.displayName=K.ScrollDownButton.displayName;var Ke=At.forwardRef(({children:e,className:t,position:o="popper",...a},r)=>(0,yt.jsx)(K.Portal,{children:(0,yt.jsxs)(K.Content,{className:N("relative yt-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",o==="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:o,ref:r,...a,children:[(0,yt.jsx)(sr,{}),(0,yt.jsx)(K.Viewport,{className:N("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,yt.jsx)(lr,{})]})}));Ke.displayName=K.Content.displayName;var $n=At.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(K.Label,{className:N("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));$n.displayName=K.Label.displayName;var fe=At.forwardRef(({children:e,className:t,...o},a)=>(0,yt.jsxs)(K.Item,{className:N("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:a,...o,children:[(0,yt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,yt.jsx)(K.ItemIndicator,{children:(0,yt.jsx)(wt.Check,{className:"h-4 w-4"})})}),(0,yt.jsx)(K.ItemText,{children:e})]}));fe.displayName=K.Item.displayName;var _n=At.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(K.Separator,{className:N("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));_n.displayName=K.Separator.displayName;var dr=ce(require("react")),na=ce(require("@radix-ui/react-label"));var Gn=(0,Ja.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),F=dr.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(na.Root,{ref:o,className:N(Gn(),e),...t}));F.displayName=na.Root.displayName;var $t=ce(require("react")),oo=ce(require("@radix-ui/react-toggle-group"));var pr=ce(require("react")),sa=ce(require("@radix-ui/react-toggle"));var la=(0,Ja.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"}}),jn=pr.forwardRef(({className:e,variant:t,size:o,...a},r)=>(0,yt.jsx)(sa.Root,{ref:r,className:N(la({variant:t,size:o,className:e})),...a}));jn.displayName=sa.Root.displayName;var fr=$t.createContext({size:"default",variant:"default"}),_t=$t.forwardRef(({className:e,variant:t,size:o,children:a,...r},i)=>(0,yt.jsx)(oo.Root,{ref:i,className:N("flex items-center justify-center gap-1",e),...r,children:(0,yt.jsx)(fr.Provider,{value:{variant:t,size:o},children:a})}));_t.displayName=oo.Root.displayName;var Gt=$t.forwardRef(({className:e,children:t,variant:o,size:a,...r},i)=>{let s=$t.useContext(fr);return(0,yt.jsx)(oo.Item,{ref:i,className:N(la({variant:s.variant||o,size:s.size||a}),e),...r,children:t})});Gt.displayName=oo.Item.displayName;var Wn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:wt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:wt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:wt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:wt.Zap}],Kn=[{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"}],ao=({isOpen:e,onClose:t,onAddTask:o,epics:a,sprints:r,assignees:i,defaultEpicId:s})=>{let[n,p]=(0,pe.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,pe.useEffect)(()=>{e&&s&&p(g=>({...g,epic:s}))},[e,s]),(0,pe.useEffect)(()=>{e&&p({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"none",assignee:""})},[e]);let u=g=>{g.preventDefault(),n.name.trim()&&(o({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}),p({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"",assignee:""}),t())},d=(g,h)=>{p(x=>({...x,[g]:h}))};return(0,yt.jsx)(ze,{open:e,onOpenChange:t,children:(0,yt.jsxs)(_e,{className:"sm:max-w-md",children:[(0,yt.jsx)(Ge,{children:(0,yt.jsx)(je,{children:"Add New Task"})}),(0,yt.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"name",children:"Task Title"}),(0,yt.jsx)(te,{id:"name",value:n.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"description",children:"Description"}),(0,yt.jsx)(Ee,{id:"description",value:n.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"Type"}),(0,yt.jsx)(_t,{type:"single",value:n.type||"",onValueChange:g=>g&&d("type",g),children:Wn.map(g=>{let h=g.icon;return(0,yt.jsxs)(Gt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,yt.jsx)(h,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"Priority"}),(0,yt.jsx)(_t,{type:"single",value:n.priority||"",onValueChange:g=>g&&d("priority",g),children:Kn.map(g=>(0,yt.jsx)(Gt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"points",children:"Story Points"}),(0,yt.jsx)(te,{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})]}),!s&&(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"epic",children:"Epic"}),(0,yt.jsxs)(qe,{value:n.epic,onValueChange:g=>d("epic",g),children:[(0,yt.jsx)(We,{children:(0,yt.jsx)(pt,{placeholder:"Select an epic"})}),(0,yt.jsx)(Ke,{children:a.map(g=>(0,yt.jsx)(fe,{value:g.id.toString(),children:(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,yt.jsxs)(qe,{value:n.sprint,onValueChange:g=>d("sprint",g),children:[(0,yt.jsx)(We,{children:(0,yt.jsx)(pt,{placeholder:"Select a sprint"})}),(0,yt.jsxs)(Ke,{children:[(0,yt.jsx)(fe,{value:"none",children:"No Sprint"}),r.map(g=>(0,yt.jsx)(fe,{value:g.id.toString(),children:(0,yt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"sprint",children:"Assignee"}),(0,yt.jsxs)(qe,{value:n.assignee,onValueChange:g=>d("assignee",g),children:[(0,yt.jsx)(We,{children:(0,yt.jsx)(pt,{placeholder:"Select an Assignee"})}),(0,yt.jsxs)(Ke,{children:[(0,yt.jsx)(fe,{value:"none",children:"No Assignee"}),i.map(g=>(0,yt.jsx)(fe,{value:g.id.toString(),children:(0,yt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,yt.jsxs)(xo,{children:[(0,yt.jsx)(k,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,yt.jsx)(k,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Co=({fieldName:e,value:t,label:o,multiline:a=!1,onSave:r,className:i="",disabled:s=!1})=>{let[n,p]=(0,pe.useState)(!1),[u,d]=(0,pe.useState)(""),g=()=>{s||(p(!0),d(t))},h=async()=>{u!==t&&await r(e,u),p(!1)},x=v=>{v.key==="Enter"&&!a||v.key==="Enter"&&v.ctrlKey&&a?h():v.key==="Escape"&&(p(!1),d(""))};return(0,yt.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,yt.jsx)(F,{children:o}),n?a?(0,yt.jsx)(Ee,{value:u,onChange:v=>d(v.target.value),onBlur:h,onKeyDown:x,autoFocus:!0,rows:4,className:"resize-none"}):(0,yt.jsx)(te,{value:u,onChange:v=>d(v.target.value),onBlur:h,onKeyPress:x,autoFocus:!0,className:"text-lg font-medium"}):(0,yt.jsxs)("div",{onClick:g,className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${a?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,yt.jsx)("span",{className:a?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!s&&(0,yt.jsx)(wt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Fo=ce(require("react")),Tt=ce(require("@radix-ui/react-avatar"));var ca=Fo.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Tt.Root,{ref:o,className:N("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ca.displayName=Tt.Root.displayName;var Zn=Fo.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Tt.Image,{ref:o,className:N("aspect-square h-full w-full",e),...t}));Zn.displayName=Tt.Image.displayName;var ma=Fo.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Tt.Fallback,{ref:o,className:N("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ma.displayName=Tt.Fallback.displayName;var br=({comments:e,onAddComment:t})=>{let[o,a]=(0,pe.useState)(""),r=s=>s.split(" ").map(n=>n[0]).join("").toUpperCase(),i=()=>{o.trim()&&(t(o),a(""))};return(0,yt.jsxs)("div",{className:"space-y-4",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsx)(wt.MessageSquare,{className:"h-5 w-5"}),(0,yt.jsx)(F,{className:"text-lg font-medium",children:"Comments"}),(0,yt.jsx)(he,{variant:"secondary",children:e.length})]}),(0,yt.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(s=>(0,yt.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,yt.jsx)(ca,{className:"h-8 w-8 wt-1",children:(0,yt.jsx)(ma,{className:"text-xs bg-muted text-muted-foreground",children:r(s.author)})}),(0,yt.jsxs)("div",{className:"flex-1",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,yt.jsx)("span",{className:"font-medium text-sm",children:s.author}),(0,yt.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.createdAt.toLocaleDateString()," yt ",s.createdAt.toLocaleTimeString()]})]}),(0,yt.jsx)("p",{className:"text-sm text-muted-foreground",children:s.text})]})]},s.id))}),(0,yt.jsxs)("div",{className:"flex gap-2",children:[(0,yt.jsx)(Ee,{value:o,onChange:s=>a(s.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,yt.jsx)(k,{onClick:i,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,yt.jsx)(wt.Send,{className:"h-4 w-4"})})]})]})};var Bo=({label:e,value:t,onValueChange:o,options:a,showColor:r=!1,disabled:i=!1})=>{let[s,n]=(0,pe.useState)(!1),p=a.find(d=>d.value===t);return(0,yt.jsxs)("div",{className:"space-y-1",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:e}),(0,yt.jsxs)(qe,{value:t,onValueChange:o,open:s,onOpenChange:d=>{i||n(d)},disabled:i,children:[(0,yt.jsx)(We,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,yt.jsxs)(he,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&n(!s),children:[r&&p?.color&&(0,yt.jsx)("div",{className:`w-2 h-2 rounded-full ${p.color} yt-1`}),p?.label||"Select..."]})}),(0,yt.jsx)(Ke,{children:a.map(d=>(0,yt.jsx)(fe,{value:d.value,children:r&&d.color?(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var yr=({label:e,value:t,onValueChange:o,options:a,placeholder:r="Search...",allowCustomValue:i=!1,disabled:s=!1})=>{let[n,p]=(0,pe.useState)(!1),[u,d]=(0,pe.useState)(""),g=a.find(f=>f.value===t),h=a.filter(f=>f.label.toLowerCase().includes(u.toLowerCase())),x=f=>{o(f),p(!1),d("")},v=()=>{i&&u.trim()&&!a.find(f=>f.value===u.trim())&&(o(u.trim()),p(!1),d(""))};return(0,yt.jsxs)("div",{className:"space-y-1",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:e}),(0,yt.jsxs)(qe,{value:t,onValueChange:x,open:n,onOpenChange:f=>{s||p(f)},disabled:s,children:[(0,yt.jsx)(We,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,yt.jsx)(he,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&p(!n),children:g?.label||t||"Select..."})}),(0,yt.jsxs)(Ke,{children:[(0,yt.jsx)("div",{className:"p-2",children:(0,yt.jsx)(te,{placeholder:r,value:u,onChange:f=>d(f.target.value),onKeyDown:f=>{f.key==="Enter"&&i&&v()},className:"mb-2"})}),h.map(f=>(0,yt.jsx)(fe,{value:f.value,children:f.label},f.value)),i&&u.trim()&&!h.find(f=>f.value===u.trim())&&(0,yt.jsxs)(fe,{value:u.trim(),children:['Add "',u.trim(),'"']})]})]})]})};var Re=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Jn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:wt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:wt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:wt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:wt.Zap}],qn=[{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 wr=({task:e,epics:t,sprints:o,lastUpdated:a,onUpdateTask:r,onClose:i,onDelete:s,isUpdating:n=!1,isDeleting:p=!1,deleteState:u="idle",teamMembers:d})=>{let[g,h]=(0,pe.useState)(e.storyPoints),x=(0,pe.useRef)(null),[v,T]=(0,pe.useState)(d);(0,pe.useEffect)(()=>{T(d)},[d]);let f=(0,pe.useCallback)((C,w)=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{r(C,w)},500)},[r]);(0,pe.useEffect)(()=>{f("storyPoints",g?.toString()||"1")},[g]);let H=C=>C.split(" ").map(w=>w[0]).join("").toUpperCase(),V=()=>u==="loading"?(0,yt.jsxs)(k,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,yt.jsx)(wt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):u==="success"?(0,yt.jsxs)(k,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,yt.jsx)(wt.Check,{className:"h-3 w-3"}),"Deleted"]}):u==="error"?(0,yt.jsxs)(k,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,yt.jsx)(wt.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,yt.jsxs)(k,{onClick:s,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||p,children:[(0,yt.jsx)(wt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,yt.jsxs)("div",{className:"flex flex-col h-full",children:[(0,yt.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:"Status"}),(0,yt.jsx)(Bo,{label:"",value:e.status,onValueChange:C=>r("status",C),options:[{value:"todo",label:"To yt"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:"Type"}),(0,yt.jsx)(_t,{type:"single",value:e.type||"",onValueChange:C=>C&&r("type",C),className:"grid grid-cols-2 gap-1",disabled:n,children:Jn.map(C=>{let w=C.icon;return(0,yt.jsxs)(Gt,{value:C.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,yt.jsx)(w,{className:"h-3 w-3"}),C.label]},C.value)})})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,yt.jsx)(_t,{type:"single",value:e.priority||"",onValueChange:C=>C&&r("priority",C),className:"grid grid-cols-3 gap-1",disabled:n,children:qn.map(C=>(0,yt.jsx)(Gt,{value:C.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:C.label},C.value))})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,yt.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:C=>{let w=Number(C.target.value);w<1?h(1):w>100?h(100):h(w)},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,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,yt.jsx)(Bo,{label:"",value:Re(e.epic).toString(),onValueChange:C=>r("epic",C),options:(t||[]).map(C=>({value:C.id.toString(),label:C?.name,color:C.color})),showColor:!0,disabled:n})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,yt.jsx)(Bo,{label:"",value:Re(e.sprint).toString()||"none",onValueChange:C=>r("sprint",C==="none"?"":C),options:[{value:"none",label:"No Sprint"},...(o||[]).map(C=>({value:C.id.toString(),label:`${C?.name}`}))],disabled:n})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,yt.jsx)(yr,{label:"",value:e.assignee?.value?.name,onValueChange:C=>r("assignee",C),options:v.map(C=>({value:`${typeof C.email=="string"?"users":"digital-colleagues"}:${C.id}`,label:C?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,yt.jsxs)("div",{className:"wt-auto pt-4 space-y-4",children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(k,{onClick:i,variant:"outline",className:"w-full h-8 text-xs",disabled:n||p,children:"Close"}),V()]}),(0,yt.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,yt.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,yt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,yt.jsx)(wt.User,{className:"h-3 w-3"}),(0,yt.jsx)("span",{children:"System"})]})]}),(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,yt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,yt.jsx)(wt.Calendar,{className:"h-3 w-3"}),(0,yt.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,yt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,yt.jsx)(wt.Clock,{className:"h-3 w-3"}),(0,yt.jsxs)("span",{children:[new Date(a).toLocaleDateString()," yt"," ",new Date(a).toLocaleTimeString()]})]})]})]})]})]})};var Cr=({isOpen:e,onClose:t,initialTask:o,epics:a,sprints:r,onUpdateTask:i,onDeleteTask:s,onAddComment:n,colleagues:p})=>{let[u,d]=(0,pe.useState)(o),[g,h]=(0,pe.useState)(new Date),[x,v]=(0,pe.useState)("idle"),[T,f]=(0,pe.useState)("idle"),[H,V]=(0,pe.useState)([]),[C,w]=(0,pe.useState)(p);(0,pe.useEffect)(()=>{d(o)},[o]);let X=async(S,ae)=>{if(ae!==u[S]){v("loading");try{await i(u.id.toString(),{[S]:ae}),h(new Date),v("success"),setTimeout(()=>v("idle"),1500)}catch(se){console.log("error",se),v("error"),setTimeout(()=>v("idle"),3e3)}}},P=async(S,ae)=>{if(ae!==u[S]){v("loading");try{await i(u.id.toString(),{[S]:ae}),h(new Date),v("success"),setTimeout(()=>v("idle"),1500)}catch(se){console.log("error",se),v("error"),setTimeout(()=>v("idle"),3e3)}}},j=async S=>{if(n){v("loading");try{await n?.({content:S,taskId:u.id.toString()}),h(new Date),v("success"),setTimeout(()=>v("idle"),1500)}catch{v("error"),setTimeout(()=>v("idle"),3e3)}}},J=async()=>{f("loading");try{await s(u.id.toString()),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},W=x!=="loading"&&T!=="loading",Ce=()=>{W&&t()},De=()=>x==="loading"?(0,yt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,yt.jsx)(wt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,yt.jsx)("span",{children:"Updating..."})]}):x==="success"?(0,yt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,yt.jsx)(wt.Check,{className:"h-4 w-4"}),(0,yt.jsx)("span",{children:"Updated successfully"})]}):x==="error"?(0,yt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,yt.jsx)(wt.X,{className:"h-4 w-4"}),(0,yt.jsx)("span",{children:"Update failed"})]}):null;return(0,yt.jsx)(ze,{open:e,onOpenChange:Ce,children:(0,yt.jsxs)(_e,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,yt.jsxs)(Ge,{children:[(0,yt.jsx)(je,{className:"sr-only",children:u?.name}),(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsx)("div",{className:"flex-1",children:De()}),!W&&(0,yt.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,yt.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,yt.jsx)(Co,{fieldName:"name",value:u.name||"",label:"",onSave:X,className:"border-b border-border pb-3",disabled:x==="loading"}),(0,yt.jsx)(Co,{fieldName:"description",value:u.description||"",label:"Description",multiline:!0,onSave:X,disabled:x==="loading"}),(0,yt.jsx)(br,{comments:(u?.comments||[]).map(S=>({author:S.author.value.name||"",createdAt:new Date(S.timestamp),text:S.text,id:S.id||""})),onAddComment:j})]}),(0,yt.jsx)(wr,{task:u,epics:a,sprints:r,lastUpdated:g,onUpdateTask:P,onClose:Ce,onDelete:J,isUpdating:x==="loading",isDeleting:T==="loading",deleteState:T,teamMembers:C})]})]})})};var io=({isOpen:e,onClose:t,onAddEpic:o})=>{let[a,r]=(0,pe.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),i=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],s=[{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"}],p=d=>{d.preventDefault(),a.name.trim()&&(o({name:a.name.trim(),description:a.description.trim(),color:a.color,confidence:a.confidence,phase:a.phase,startDate:a.startDate,endDate:a.endDate}),r({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},u=(d,g)=>{r(h=>({...h,[d]:g}))};return(0,yt.jsx)(ze,{open:e,onOpenChange:t,children:(0,yt.jsxs)(_e,{className:"sm:max-w-md",children:[(0,yt.jsx)(Ge,{children:(0,yt.jsx)(je,{children:"Add New Epic"})}),(0,yt.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"name",children:"Epic Name"}),(0,yt.jsx)(te,{id:"name",value:a.name,onChange:d=>u("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"description",children:"Description"}),(0,yt.jsx)(Ee,{id:"description",value:a.description,onChange:d=>u("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"Color"}),(0,yt.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,yt.jsx)("button",{type:"button",onClick:()=>u("color",d),className:`w-8 h-8 rounded-full ${d} ${a.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"Confidence"}),(0,yt.jsxs)(qe,{value:a.confidence,onValueChange:d=>u("confidence",d),children:[(0,yt.jsx)(We,{children:(0,yt.jsx)(pt,{})}),(0,yt.jsx)(Ke,{children:s.map(d=>(0,yt.jsx)(fe,{value:d.value,children:d.label},d.value))})]})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"Phase"}),(0,yt.jsxs)(qe,{value:a.phase.toString(),onValueChange:d=>u("phase",parseInt(d)),children:[(0,yt.jsx)(We,{children:(0,yt.jsx)(pt,{})}),(0,yt.jsx)(Ke,{children:n.map(d=>(0,yt.jsx)(fe,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"Start Date"}),(0,yt.jsx)(te,{type:"date",value:a.startDate,onChange:d=>u("startDate",d.target.value)})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"End Date"}),(0,yt.jsx)(te,{type:"date",value:a.endDate,onChange:d=>u("endDate",d.target.value)})]})]}),(0,yt.jsxs)(xo,{children:[(0,yt.jsx)(k,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,yt.jsx)(k,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Sr=require("motion/react");function Tr(e,t){let[o,a]=(0,pe.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch{return t}}),r=i=>{try{a(i),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(i))}catch{}};return(0,pe.useEffect)(()=>{r(o)},[]),[o,r]}var Uo=require("react-icons/fa");function vt({title:e,description:t,badge:o,primaryAction:a,secondaryAction:r,gradient:i,children:s,className:n}){let[p,u]=Tr(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||p;return(0,yt.jsxs)(Sr.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${i} p-8 text-white ${n||""}`,children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,yt.jsx)(he,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,yt.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,yt.jsxs)("div",{className:"flex items-center gap-3",children:[d&&a&&(0,yt.jsx)(k,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),(r||t)&&(0,yt.jsx)("button",{"aria-label":p?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>u(!p),style:{lineHeight:0},children:p?(0,yt.jsx)(Uo.FaChevronDown,{size:22}):(0,yt.jsx)(Uo.FaChevronUp,{size:22})})]})]}),!d&&(0,yt.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,yt.jsxs)("div",{className:"space-y-4",children:[(0,yt.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,yt.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a&&(0,yt.jsx)(k,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),r&&(0,yt.jsx)(k,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),s&&(0,yt.jsx)("div",{className:"hidden lg:block",children:s})]})]})}var Dr=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:a=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:s,onUpdateTask:n,onDeleteTask:p,onTaskClick:u,onAddEpic:d,onAddComment:g})=>{let[h,x]=(0,le.useState)([]),[v,T]=(0,le.useState)([]),[f,H]=(0,le.useState)([]),[V,C]=(0,le.useState)(!1),[w,X]=(0,le.useState)(!1),[P,j]=(0,le.useState)(null),[J,W]=(0,le.useState)(null),[Ce,De]=(0,le.useState)([]),[S,ae]=(0,le.useState)([]),[se,E]=(0,le.useState)(0),G=(0,le.useRef)(null),de=(0,le.useRef)(null),$e=le.default.useMemo(()=>[...v.map(R=>R.id),0],[v]),ke=(0,le.useRef)(""),it=(0,le.useRef)(""),D=(0,le.useRef)(""),Y=(0,le.useRef)(""),ve=R=>R.map(m=>`${m.id}-${new Date(m.createdAt).getTime()}-${new Date(m.updatedAt).getTime()}`).join("-");(0,le.useEffect)(()=>{let R=ve(e);R!==ke.current&&(x(e),P&&j(e.find(m=>m.id===P.id)||null),ke.current=R)},[e]),(0,le.useEffect)(()=>{let R=ve(t);R!==it.current&&(T(t),it.current=R)},[t]),(0,le.useEffect)(()=>{let R=ve(o);R!==D.current&&(H(o),D.current=R)},[o]),(0,le.useEffect)(()=>{let R=ve(r.map(m=>({id:m.id,updatedAt:m.updatedAt,createdAt:m.createdAt})));R!==Y.current&&(ae(r),Y.current=R)},[r]),(0,le.useEffect)(()=>{let R=()=>{if(G.current){let B=G.current.offsetHeight;E(B)}};R();let m=new ResizeObserver(R);G.current&&m.observe(G.current);let b=()=>{setTimeout(R,100)};return window.addEventListener("storage",b),()=>{m.disconnect(),window.removeEventListener("storage",b)}},[]),(0,le.useEffect)(()=>{let R=setTimeout(()=>{G.current&&E(G.current.offsetHeight)},300);return()=>clearTimeout(R)},[V,w]);let nt=h.filter(R=>!0),ie=R=>nt.filter(m=>m.status===R),tt=R=>{let m={};return v.forEach(b=>{m[b.id]=R.filter(B=>Re(B.epic)===b.id)}),m["no-epic"]=R.filter(b=>!Re(b.epic)),m},Jt=R=>{W(R)},xt=R=>{J&&(x(m=>m.map(b=>b.id===J.id?{...b,status:R}:b)),n?.(J.id.toString(),{status:R}),W(null))},mo=R=>{let m={...R,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};x(b=>[...b,m]),s?.(R)},Pt=async(R,m)=>{x(b=>b.map(B=>B.id===Number(R)?{...B,...m}:B)),n&&await n(R,m),P?.id===Number(R)&&j(b=>({...b,...m}))},Ot=async R=>{x(m=>m.filter(b=>b.id!==Number(R))),P?.id===Number(R)&&j(null),p&&await p(R)},qt=R=>{let m={...R,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};T(b=>[...b,m]),d?.(R)},Rt=R=>{j(R),u?.(R)},Xt=[{id:"todo",title:"To yt",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Yt=se>0?`calc(100vh - ${se+120}px)`:"calc(100vh - 12rem)";return(0,yt.jsxs)("div",{ref:de,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,yt.jsx)("div",{ref:G,className:"flex-shrink-0",children:(0,yt.jsx)(vt,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>C(!0)},secondaryAction:{label:"Add epic",onClick:()=>X(!0)}})}),(0,yt.jsx)("div",{className:"flex-1 min-h-0 wt-8",children:(0,yt.jsx)("div",{className:"h-full",style:{height:se>0?`calc(100vh - ${se+120}px)`:"calc(100vh - 12rem)"},children:(0,yt.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Xt.map(R=>{let m=ie(R.status),b=tt(m);return(0,yt.jsxs)(Xa,{title:R.title,status:R.status,taskCount:m.length,onDrop:xt,isCompact:R.status==="done",height:Yt,children:[b["no-epic"].map(B=>(0,yt.jsx)(ho,{epic:null,task:B,onDragStart:Jt,onTaskClick:Rt,isCompact:R.status==="done"},B.id)),$e.map(B=>{let q=v.find(Ne=>Ne.id===B),Te=b[B]||[];return Te.length===0?null:(0,yt.jsxs)("div",{className:"mb-6",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,yt.jsx)("div",{className:`w-3 h-3 rounded-full ${q?.color}`}),(0,yt.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:q?.name||"No Epic"}),(0,yt.jsx)(he,{variant:"secondary",className:"text-xs",children:Te.length})]})," ",(0,yt.jsx)("div",{className:"space-y-3",children:Te.map(Ne=>(0,yt.jsx)(ho,{task:Ne,epic:q,onDragStart:Jt,onTaskClick:Rt,isCompact:R.status==="done"},Ne.id))})]},B)})]},R.id)})})})}),(0,yt.jsx)(ao,{isOpen:V,onClose:()=>C(!1),onAddTask:mo,assignees:[...S,...Ce],epics:v,sprints:f}),(0,yt.jsx)(io,{isOpen:w,onClose:()=>X(!1),onAddEpic:qt}),P&&(0,yt.jsx)(Cr,{isOpen:!!P,onClose:()=>j(null),initialTask:P,epics:v,sprints:f,onUpdateTask:Pt,onDeleteTask:Ot,colleagues:S,onAddComment:g})]})};var kr=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:s,onUpdateEpic:n,onDeleteEpic:p})=>{let[u,d]=(0,pe.useState)(t),[g,h]=(0,pe.useState)(null),[x,v]=(0,pe.useState)(null),[T,f]=(0,pe.useState)({}),[H,V]=(0,pe.useState)(0),[C,w]=(0,pe.useState)(!1),[X,P]=(0,pe.useState)(!1),[j,J]=(0,pe.useState)(null),W=(0,pe.useRef)(null),Ce=(0,pe.useRef)(null);(0,pe.useEffect)(()=>{d(t)},[t]),(0,pe.useEffect)(()=>{let D=()=>{if(W.current){let nt=W.current.offsetHeight;V(nt)}};D();let Y=new ResizeObserver(D);W.current&&Y.observe(W.current);let ve=()=>{setTimeout(D,100)};return window.addEventListener("storage",ve),()=>{Y.disconnect(),window.removeEventListener("storage",ve)}},[]),(0,pe.useEffect)(()=>{let D=setTimeout(()=>{W.current&&V(W.current.offsetHeight)},300);return()=>clearTimeout(D)},[x]);let De=D=>{h(D)},S=D=>{D.preventDefault()},ae=(D,Y)=>{D.preventDefault(),g&&Re(g.epic).toString()!==Y&&(a(g.id.toString(),{epic:Number(Y)}),h(null))},se=D=>e.filter(Y=>Re(Y.epic).toString()===D),E=D=>{v(D.id.toString()),f({name:D.name,description:D.description,confidence:D.confidence,phase:D.phase})},G=async()=>{x&&T.name&&(await n(x.toString(),T),d(D=>D.map(Y=>Y.id.toString()===x?{...Y,...T}:Y)),v(null),f({}))},de=()=>{v(null),f({})},$e=async D=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await p(D),d(Y=>Y.filter(ve=>ve.id.toString()!==D)))},ke=D=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[D]||`Phase ${D}`,it=D=>{switch(D){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,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsxs)("div",{ref:Ce,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,yt.jsx)("div",{ref:W,className:"flex-shrink-0",children:(0,yt.jsx)(vt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>w(!0)}})}),(0,yt.jsx)("div",{className:"flex-1 min-h-0 wt-8",children:(0,yt.jsx)("div",{className:"h-full overflow-y-auto",style:{height:H>0?`calc(100vh - ${H+120}px)`:"calc(100vh - 12rem)"},children:(0,yt.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:u.map(D=>{let Y=se(D.id.toString()),ve=Y.reduce((ie,tt)=>ie+(tt.storyPoints||0),0),nt=H>0?`calc(100vh - ${H+200}px)`:"calc(100vh - 14rem)";return(0,yt.jsxs)(ge,{className:`flex flex-col ${x===D.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:x===D.id.toString()?"auto":nt,minHeight:"400px"},onDragOver:S,onDrop:ie=>ae(ie,D.id.toString()),children:[(0,yt.jsx)("div",{className:"p-4 border-b border-border",children:x===D.id.toString()?(0,yt.jsxs)("div",{className:"space-y-4",children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsx)(te,{value:T.name||"",onChange:ie=>f({...T,name:ie.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,yt.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,yt.jsx)(k,{size:"sm",variant:"ghost",onClick:G,className:"p-1 h-8 w-8",children:(0,yt.jsx)(wt.Check,{className:"h-4 w-4"})}),(0,yt.jsx)(k,{size:"sm",variant:"ghost",onClick:de,className:"p-1 h-8 w-8",children:(0,yt.jsx)(wt.X,{className:"h-4 w-4"})})]})]}),(0,yt.jsx)(Ee,{value:T.description||"",onChange:ie=>f({...T,description:ie.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,yt.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,yt.jsxs)("div",{children:[(0,yt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,yt.jsxs)("select",{value:T.confidence||D.confidence,onChange:ie=>f({...T,confidence:ie.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,yt.jsx)("option",{value:"low",children:"Low"}),(0,yt.jsx)("option",{value:"medium",children:"Medium"}),(0,yt.jsx)("option",{value:"high",children:"High"})]})]}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,yt.jsx)("select",{value:T.phase?.toString()||D.phase.toString(),onChange:ie=>f({...T,phase:parseInt(ie.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(ie=>(0,yt.jsxs)("option",{value:ie.toString(),children:["Phase ",ie]},ie))})]})]})]}):(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,yt.jsx)("div",{className:`w-4 h-4 rounded-full ${D.color}`}),(0,yt.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:D.name}),(0,yt.jsxs)("div",{className:"flex gap-1",children:[(0,yt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>E(D),className:"p-1 h-8 w-8",children:(0,yt.jsx)(wt.Edit2,{className:"h-3 w-3"})}),(0,yt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>$e(D.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,yt.jsx)(wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,yt.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,yt.jsxs)(he,{className:`text-xs ${it(D.confidence)}`,children:[D.confidence," confidence"]}),(0,yt.jsxs)(he,{variant:"outline",className:"text-xs",children:["Phase ",D.phase]}),(0,yt.jsxs)(he,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[Y.length," tasks"]}),(0,yt.jsxs)(he,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[ve," pts"]})]}),D.description&&(0,yt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:D.description}),(0,yt.jsxs)(k,{onClick:()=>{P(!0),J(D)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,yt.jsx)(wt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,yt.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,yt.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:Y.length===0?(0,yt.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,yt.jsx)(wt.Move,{className:"h-8 w-8 mb-2"}),(0,yt.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):Y.map(ie=>(0,yt.jsx)(ho,{task:ie,epic:D,onDragStart:De,onTaskClick:r,isCompact:!0},ie.id))})})]},D.id)})})})})]}),(0,yt.jsx)(io,{isOpen:C,onClose:()=>w(!1),onAddEpic:s}),(0,yt.jsx)(ao,{isOpen:X,onClose:()=>P(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:j?.id.toString()||"",sprints:o})]})};var Pr=require("react-day-picker");function zo({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,yt.jsx)(Pr.DayPicker,{showOutsideDays:o,weekStartsOn:1,className:N("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:N(yo({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 wt-2",cell:N("relative p-0 text-center text-sm focus-within:relative focus-within:yt-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-yt-md first:[&:has([aria-selected])]:rounded-yt-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:N(yo({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},...a})}zo.displayName="Calendar";var Er=ce(require("react")),ht=ce(require("@radix-ui/react-popover"));var ga=ht.Root,fa=ht.Trigger;var $o=Er.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},r)=>(0,yt.jsx)(ht.Portal,{children:(0,yt.jsx)(ht.Content,{ref:r,align:t,sideOffset:o,className:N("yt-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),...a})}));$o.displayName=ht.Content.displayName;var ha=require("date-fns");var Ar=({isOpen:e,onClose:t,onAddSprint:o})=>{let[a,r]=(0,pe.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),i=n=>{n.preventDefault(),!(!a.name||!a.startDate||!a.endDate)&&(o({name:a.name,description:a.description,startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),r({name:"",description:"",startDate:void 0,endDate:void 0}),t())},s=()=>{r({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,yt.jsx)(ze,{open:e,onOpenChange:s,children:(0,yt.jsxs)(_e,{className:"sm:max-w-md",children:[(0,yt.jsx)(Ge,{children:(0,yt.jsx)(je,{children:"Add New Sprint"})}),(0,yt.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"name",children:"Sprint Name *"}),(0,yt.jsx)(te,{id:"name",value:a.name,onChange:n=>r(p=>({...p,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{htmlFor:"description",children:"Description"}),(0,yt.jsx)(Ee,{id:"description",value:a.description,onChange:n=>r(p=>({...p,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"Start Date *"}),(0,yt.jsxs)(ga,{children:[(0,yt.jsx)(fa,{asChild:!0,children:(0,yt.jsxs)(k,{variant:"outline",className:N("w-full justify-start text-left font-normal",!a.startDate&&"text-muted-foreground"),children:[(0,yt.jsx)(wt.CalendarIcon,{className:"yt-2 h-4 w-4"}),a.startDate?(0,ha.format)(a.startDate,"PPP"):"Pick a date"]})}),(0,yt.jsx)($o,{className:"w-auto p-0",align:"start",children:(0,yt.jsx)(zo,{mode:"single",selected:a.startDate,onSelect:n=>r(p=>({...p,startDate:n})),initialFocus:!0})})]})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)(F,{children:"End Date *"}),(0,yt.jsxs)(ga,{children:[(0,yt.jsx)(fa,{asChild:!0,children:(0,yt.jsxs)(k,{variant:"outline",className:N("w-full justify-start text-left font-normal",!a.endDate&&"text-muted-foreground"),children:[(0,yt.jsx)(wt.CalendarIcon,{className:"yt-2 h-4 w-4"}),a.endDate?(0,ha.format)(a.endDate,"PPP"):"Pick a date"]})}),(0,yt.jsx)($o,{className:"w-auto p-0",align:"start",children:(0,yt.jsx)(zo,{mode:"single",selected:a.endDate,onSelect:n=>r(p=>({...p,endDate:n})),initialFocus:!0,disabled:n=>a.startDate?n<a.startDate:!1})})]})]})]}),(0,yt.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,yt.jsx)(k,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,yt.jsx)(k,{type:"submit",disabled:!a.name||!a.startDate||!a.endDate,children:"Add Sprint"})]})]})]})})};var Ir=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddSprint:i,onUpdateSprint:s,onDeleteSprint:n})=>{let[p,u]=(0,pe.useState)([]),[d,g]=(0,pe.useState)(new Set),[h,x]=(0,pe.useState)(null),[v,T]=(0,pe.useState)(!1),[f,H]=(0,pe.useState)(null),[V,C]=(0,pe.useState)(null),[w,X]=(0,pe.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[P,j]=(0,pe.useState)([]),[J,W]=(0,pe.useState)("upcoming"),[Ce,De]=(0,pe.useState)(!1),[S,ae]=(0,pe.useState)(0),se=(0,pe.useRef)(null),E=(0,pe.useRef)(null);(0,pe.useEffect)(()=>{let m=()=>{se.current&&ae(se.current.offsetHeight)};m();let b=new ResizeObserver(m);return se.current&&b.observe(se.current),()=>b.disconnect()},[]);let G=m=>t.find(b=>b.id===Number(m)),de=m=>o.find(b=>b.id===Number(m)),$e=m=>{let b={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 b[m]||b.medium},ke=m=>{if(!m||m?.length===0)return"";let b=m?.trim().split(" ");if(b?.length===1)return b[0];let B=b[0],q=b[b.length-1][0].toUpperCase();return`${B} ${q}`},it=m=>{let b={},B=[];return m.forEach(q=>{q.epic?(b[Re(q.epic)]||(b[Re(q.epic)]=[]),b[Re(q.epic)].push(q)):B.push(q)}),{tasksByEpic:b,unassignedTasks:B}};(0,pe.useEffect)(()=>{j(o)},[o]);let D=P.filter(m=>{switch(J){default:return!0}}),Y=P.filter(m=>p.includes(m.id.toString())),ve=e.filter(m=>!m.sprint||m.status==="backlog"),nt=ve.reduce((m,b)=>m+(b.storyPoints||0),0),ie=m=>{u(b=>b.includes(m)?b.filter(B=>B!==m):b?.length<3?[...b,m]:b)},tt=m=>{g(b=>{let B=new Set(b);return B.has(m)?B.delete(m):B.add(m),B})},Jt=m=>{i(m),T(!1)},xt=m=>{C(m.id.toString()),X({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})},mo=()=>{V&&(s(V,{name:w.name,description:w.description,startDate:w.startDate,endDate:w.endDate}),j(m=>m.map(b=>(b.id===Number(V)&&(b.name=w.name,b.description=w.description,b.startDate=w.startDate,b.endDate=w.endDate),b))),C(null))},Pt=()=>{C(null),X({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Ot=(m,b)=>{x(b),m.dataTransfer.effectAllowed="move"},qt=m=>{m.preventDefault(),m.dataTransfer.dropEffect="move"},Rt=m=>{H(m)},Xt=()=>{H(null)},Yt=(m,b)=>{if(m.preventDefault(),H(null),!h)return;(Re(h.sprint)||void 0)!==Number(b)&&a(h.id.toString(),{sprint:Number(b)}),x(null)},R=({task:m,showSprint:b=!1})=>{let B=m.epic?G(Re(m.epic).toString()):null,q=m.sprint?de(Re(m.sprint).toString()):null;return(0,yt.jsx)(ge,{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:Je=>{Je.dataTransfer.effectAllowed="move",Je.dataTransfer.setData("text/plain",m.id.toString()),Ot(Je,m)},onClick:Je=>{h===null&&r(m)},style:{userSelect:"none"},children:(0,yt.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,yt.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,yt.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:m.name}),(0,yt.jsx)(he,{className:`text-xs ${$e(m.priority||"medium")}`,children:m.priority?.[0]?.toUpperCase()})]}),(0,yt.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-1",children:[B&&(0,yt.jsx)("div",{className:`w-2 h-2 rounded-full ${B.color}`}),(0,yt.jsx)("span",{className:"text-muted-foreground truncate",children:B?.name})]}),(0,yt.jsx)("span",{className:"text-muted-foreground",children:ke(m.assignee?.value?.name)})]}),b&&q&&(0,yt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,yt.jsx)(wt.Calendar,{className:"h-3 w-3"}),(0,yt.jsx)("span",{children:q.name})]})]})})};return(0,yt.jsxs)("div",{ref:E,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,yt.jsx)("div",{ref:se,className:"flex-shrink-0",children:(0,yt.jsx)(vt,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>T(!0)}})}),(0,yt.jsx)("div",{className:"flex-1 min-h-0 wt-8",children:(0,yt.jsxs)("div",{className:"h-full",style:{height:S>0?`calc(100vh - ${S+120}px)`:"calc(100vh - 12rem)"},children:[(0,yt.jsxs)("div",{className:"mb-4",children:[(0,yt.jsx)(ge,{className:"p-3 bg-card shadow-sm",children:(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,yt.jsxs)("div",{children:[(0,yt.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,yt.jsxs)("p",{className:"text-xs text-muted-foreground",children:[p?.length,"/3 selected"]})]}),p?.length>0&&(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,yt.jsx)("div",{className:"flex flex-wrap gap-1",children:Y.map(m=>(0,yt.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,yt.jsx)("span",{className:"max-w-[80px] truncate",children:m.name}),(0,yt.jsx)("button",{onClick:()=>ie(m.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,yt.jsx)(wt.X,{className:"h-4 w-4"})})]},m.id))})]})]}),(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsxs)(k,{onClick:()=>T(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,yt.jsx)(wt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,yt.jsxs)(k,{onClick:()=>De(!Ce),variant:"outline",size:"sm",className:"gap-1",children:[(0,yt.jsx)(wt.Calendar,{className:"h-3 w-3"}),Ce?"Close":"Select"]})]})]})}),Ce&&(0,yt.jsx)("div",{className:"fixed inset-0 bg-black/20 yt-[5]",onClick:()=>De(!1)}),(0,yt.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-yt shadow-xl yt-10 transition-all duration-300 ease-in-out ${Ce?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,yt.jsxs)(ge,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,yt.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,yt.jsx)(k,{variant:"ghost",size:"sm",onClick:()=>De(!1),className:"h-8 w-8 p-0",children:(0,yt.jsx)(wt.X,{className:"h-4 w-4"})})]}),(0,yt.jsx)("p",{className:"text-sm text-muted-foreground wt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,yt.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,yt.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:o.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(m=>(0,yt.jsxs)(k,{variant:J===m.key?"default":"outline",size:"sm",onClick:()=>W(m.key),className:"text-xs h-8 px-3 flex-1",children:[m.label," (",m.count,")"]},m.key))}),(0,yt.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:D.length>0?D.map(m=>{let b=p.includes(m.id.toString()),B=e.filter(Te=>Re(Te.sprint)===m.id).length,q=!b&&p.length<3;return(0,yt.jsx)("div",{className:`p-3 rounded-lg border transition-all ${b?"bg-primary/10 border-primary/30":q?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:V===m.id.toString()?(0,yt.jsxs)("div",{className:"space-y-3",children:[(0,yt.jsx)(te,{value:w.name,onChange:Te=>X(Ne=>({...Ne,name:Te.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,yt.jsx)(Ee,{value:w.description,onChange:Te=>X(Ne=>({...Ne,description:Te.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,yt.jsxs)("div",{className:"flex gap-2",children:[(0,yt.jsxs)(k,{size:"sm",onClick:()=>mo(),className:"flex-1",children:[(0,yt.jsx)(wt.Check,{className:"h-3 w-3 yt-1"}),"Save"]}),(0,yt.jsxs)(k,{size:"sm",variant:"outline",onClick:Pt,className:"flex-1",children:[(0,yt.jsx)(wt.X,{className:"h-3 w-3 yt-1"}),"Cancel"]})]})]}):(0,yt.jsxs)("div",{children:[(0,yt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,yt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,yt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,yt.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:m.name}),(0,yt.jsx)(he,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,yt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:m.description}),(0,yt.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,yt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,yt.jsx)(wt.CalendarDays,{className:"h-3 w-3"}),new Date(m.startDate).toLocaleDateString()]}),(0,yt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,yt.jsx)(wt.User,{className:"h-3 w-3"}),B," tasks"]})]})]}),(0,yt.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,yt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>xt(m),className:"h-6 w-6 p-0",children:(0,yt.jsx)(wt.Edit2,{className:"h-3 w-3"})}),(0,yt.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,yt.jsx)(wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,yt.jsx)("div",{className:"flex items-center justify-between wt-2",children:(0,yt.jsx)(k,{variant:b?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>ie(m.id.toString()),disabled:!b&&p?.length>=3,children:(0,yt.jsx)("span",{className:"pointer-events-none select-none",children:b?"Deselect":p?.length>=3?"Limit Reached":"Select"})})})]})},m.id)}):(0,yt.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,yt.jsx)(wt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,yt.jsxs)("p",{className:"text-sm",children:['No sprints found for "',J,'" filter']}),(0,yt.jsx)(k,{variant:"link",size:"sm",onClick:()=>W("all"),className:"text-xs",children:"Show all sprints"})]})}),p?.length===0&&(0,yt.jsx)("div",{className:"wt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,yt.jsxs)("div",{className:"text-center",children:[(0,yt.jsx)(wt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,yt.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,yt.jsx)("p",{className:"text-xs text-muted-foreground wt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,yt.jsx)("div",{className:"lg:col-span-1",children:(0,yt.jsxs)(ge,{className:"p-4 h-full bg-card border-yt-4 border-yt-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:qt,onDragEnter:()=>Rt("backlog"),onDragLeave:Xt,onDrop:m=>Yt(m,"backlog"),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,yt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsxs)(he,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[ve?.length," tasks"]}),(0,yt.jsxs)(he,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[nt," pts"]})]})]}),(0,yt.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${f==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:m,unassignedTasks:b}=it(ve);return(0,yt.jsxs)(yt.Fragment,{children:[Object.entries(m).map(([B,q])=>{let Te=G(B);if(!Te)return null;let Ne=d.has(B);return(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.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:()=>tt(B),children:[(0,yt.jsx)("div",{className:`w-3 h-3 rounded-full ${Te.color}`}),(0,yt.jsx)("span",{className:"font-medium text-muted-foreground",children:Te.name}),(0,yt.jsxs)("span",{className:"text-muted-foreground",children:["(",q?.length,")"]}),(0,yt.jsx)("div",{className:"ml-auto",children:Ne?(0,yt.jsx)(wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,yt.jsx)(wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ne&&(0,yt.jsx)("div",{className:"space-y-2 pl-2",children:q.map(Je=>(0,yt.jsx)(R,{task:Je},Je.id))})]},B)}),b?.length>0&&(()=>{let B=d.has("no-epic");return(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.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:()=>tt("no-epic"),children:[(0,yt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,yt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,yt.jsxs)("span",{className:"text-muted-foreground",children:["(",b?.length,")"]}),(0,yt.jsx)("div",{className:"ml-auto",children:B?(0,yt.jsx)(wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,yt.jsx)(wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!B&&(0,yt.jsx)("div",{className:"space-y-2 pl-2",children:b?.map(q=>(0,yt.jsx)(R,{task:q},q.id))})]})})(),ve?.length===0&&(0,yt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),ve?.length>0&&Object.keys(m).length===0&&b.length===0&&(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),ve?.map(B=>(0,yt.jsx)(R,{task:B},B.id))]})]})})()})]})}),Y.map(m=>{let b=e.filter(q=>Re(q?.sprint)===m.id),B=b.reduce((q,Te)=>q+(Te?.storyPoints||0),0);return(0,yt.jsxs)(ge,{className:"p-4 h-full bg-card border-yt-4 border-yt-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:qt,onDragEnter:()=>Rt(m.id.toString()),onDragLeave:Xt,onDrop:q=>Yt(q,m.id.toString()),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,yt.jsx)("div",{children:(0,yt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:m.name})}),(0,yt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,yt.jsxs)(he,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[b?.length," tasks"]}),(0,yt.jsxs)(he,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[B," pts"]}),(0,yt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>{De(!0),xt(m)},className:"h-6 px-2",children:(0,yt.jsx)(wt.Edit2,{className:"h-3 w-3"})}),(0,yt.jsx)(k,{size:"sm",variant:"ghost",onClick:()=>n(m.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,yt.jsx)(wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,yt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:q,unassignedTasks:Te}=it(b);return(0,yt.jsxs)(yt.Fragment,{children:[Object.entries(q).map(([Ne,Je])=>{let po=G(Ne);if(!po)return null;let uo=d.has(Ne);return(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.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:()=>tt(Ne),children:[(0,yt.jsx)("div",{className:`w-3 h-3 rounded-full ${po.color}`}),(0,yt.jsx)("span",{className:"font-medium text-muted-foreground",children:po.name}),(0,yt.jsxs)("span",{className:"text-muted-foreground",children:["(",Je?.length,")"]}),(0,yt.jsx)("div",{className:"ml-auto",children:uo?(0,yt.jsx)(wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,yt.jsx)(wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!uo&&(0,yt.jsx)("div",{className:"space-y-2 pl-2",children:Je?.map(go=>(0,yt.jsx)(R,{task:go},go.id))})]},Ne)}),Te?.length>0&&(()=>{let Ne=d.has("no-epic");return(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.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:()=>tt("no-epic"),children:[(0,yt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,yt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,yt.jsxs)("span",{className:"text-muted-foreground",children:["(",Te?.length,")"]}),(0,yt.jsx)("div",{className:"ml-auto",children:Ne?(0,yt.jsx)(wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,yt.jsx)(wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ne&&(0,yt.jsx)("div",{className:"space-y-2 pl-2",children:Te?.map(Je=>(0,yt.jsx)(R,{task:Je},Je.id))})]})})(),b?.length===0&&(0,yt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},m.id)})]}),(0,yt.jsx)(Ar,{isOpen:v,onClose:()=>T(!1),onAddSprint:Jt})]})})]})};var Xn=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Yn=e=>{let[t,o]=e.split(":"),a=new Date;return a.setHours(parseInt(t),parseInt(o)),a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},ba=(e,t)=>{let o=new Date,a=new Date(e);if(t){let[r,i]=t.split(":");a.setHours(parseInt(r),parseInt(i))}return a<o},xa=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Qn=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},es=({colleagues:e,onAddReminder:t,open:o,setOpen:a})=>{let[r,i]=(0,pe.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[s,n]=(0,pe.useState)(!1),p=d=>{if(d.preventDefault(),!e.find(x=>x?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let h={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(h),a(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,pe.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let u=e.filter(Boolean);return(0,yt.jsx)(ze,{open:o,onOpenChange:a,children:(0,yt.jsxs)(_e,{className:"max-w-2xl",children:[(0,yt.jsx)(Ge,{children:(0,yt.jsx)(je,{children:"Add New Reminder"})}),(0,yt.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,yt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"title",children:"Title"}),(0,yt.jsx)(te,{id:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"description",children:"Description"}),(0,yt.jsx)(Ee,{id:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"dueDate",children:"Due Date"}),(0,yt.jsx)(te,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,yt.jsx)(te,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{className:`${s?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,yt.jsxs)(qe,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,yt.jsx)(We,{className:`${s?"text-destructive border-red-500":""}`,children:(0,yt.jsx)(pt,{className:`${s?"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,yt.jsx)(Ke,{children:u.map(d=>(0,yt.jsx)(fe,{value:d.id.toString(),children:d.name},d.id))})]}),s&&(0,yt.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,yt.jsxs)("div",{className:"space-y-2",children:[(0,yt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,yt.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,yt.jsx)(F,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,yt.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,yt.jsxs)(qe,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,yt.jsx)(We,{children:(0,yt.jsx)(pt,{})}),(0,yt.jsxs)(Ke,{children:[(0,yt.jsx)(fe,{value:"daily",children:"Daily"}),(0,yt.jsx)(fe,{value:"weekly",children:"Weekly"}),(0,yt.jsx)(fe,{value:"monthly",children:"Monthly"}),(0,yt.jsx)(fe,{value:"yearly",children:"Yearly"})]})]})]}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"recurrenceInterval",children:"Every"}),(0,yt.jsx)(te,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,yt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,yt.jsx)(k,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,yt.jsx)(k,{type:"submit",children:"Add Reminder"})]})]})]})})},ts=({reminder:e,colleagues:t,onUpdateReminder:o,open:a,onClose:r})=>{let[i,s]=(0,pe.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=u=>{u.preventDefault(),o(e.id.toString(),{title:i.title,description:i.description,dueDate:new Date(i.dueDate||"").toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring}),r()},p=t.filter(Boolean);return(0,yt.jsx)(ze,{open:a,onOpenChange:r,children:(0,yt.jsxs)(_e,{className:"max-w-2xl",children:[(0,yt.jsx)(Ge,{children:(0,yt.jsx)(je,{children:"Edit Reminder"})}),(0,yt.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,yt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"edit-title",children:"Title"}),(0,yt.jsx)(te,{id:"edit-title",value:i.title,onChange:u=>s({...i,title:u.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"edit-description",children:"Description"}),(0,yt.jsx)(Ee,{id:"edit-description",value:i.description||"",onChange:u=>s({...i,description:u.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,yt.jsx)(te,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:u=>s({...i,dueDate:u.target.value}),required:!0})]}),(0,yt.jsxs)("div",{children:[(0,yt.jsx)(F,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,yt.jsx)(te,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:u=>s({...i,dueTime:u.target.value})})]})]}),(0,yt.jsx)("div",{className:"space-y-2",children:(0,yt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,yt.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:u=>s({...i,isRecurring:u.target.checked}),className:"rounded border-border"}),(0,yt.jsx)(F,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,yt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,yt.jsx)(k,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,yt.jsx)(k,{type:"submit",children:"Save Changes"})]})]})]})})},os=({reminder:e,colleagues:t,onUpdateReminder:o,onDeleteReminder:a})=>{let[r,i]=(0,pe.useState)(!1);if(!e||!e.id)return null;let s=ba(new Date(e.dueDate||""),e.dueTime||""),n=xa(new Date(e.dueDate||"")),p=Qn(new Date(e.dueDate||"")),u=()=>{o(e.id.toString(),{})},d=()=>n?"Today":p?"Tomorrow":Xn(new Date(e.dueDate||""));return(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(ts,{reminder:e,colleagues:t,onUpdateReminder:o,open:r,onClose:()=>i(!1)}),(0,yt.jsx)(ge,{children:(0,yt.jsx)(to,{className:"p-4",children:(0,yt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,yt.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,yt.jsx)("button",{onClick:u,className:"wt-1 text-primary hover:text-primary/80"}),(0,yt.jsxs)("div",{className:"flex-1",children:[(0,yt.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,yt.jsx)("h3",{children:e.title})}),(0,yt.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,yt.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,yt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,yt.jsx)(wt.Calendar,{className:"h-4 w-4"}),(0,yt.jsx)("span",{className:s?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,yt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,yt.jsx)(wt.Clock,{className:"h-4 w-4"}),(0,yt.jsx)("span",{children:Yn(e.dueTime)})]}),(0,yt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,yt.jsx)(wt.User,{className:"h-4 w-4"}),(0,yt.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,yt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,yt.jsx)(k,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,yt.jsx)(wt.Edit2,{className:"h-4 w-4"})}),(0,yt.jsx)(k,{variant:"ghost",size:"sm",onClick:()=>a(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,yt.jsx)(wt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Lr=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:o,onUpdateReminder:a,onDeleteReminder:r})=>{let[i,s]=(0,pe.useState)(e.filter(Boolean)),[n,p]=(0,pe.useState)(t.filter(Boolean)),[u,d]=(0,pe.useState)("all"),[g,h]=(0,pe.useState)(""),[x,v]=(0,pe.useState)(!1);(0,pe.useEffect)(()=>{s(e.filter(Boolean))},[e]),(0,pe.useEffect)(()=>{p(t.filter(Boolean))},[t]);let T=P=>{if(!P.title){console.error("Invalid reminder data:",P);return}let j={...P,id:Date.now(),createdAt:new Date().toISOString()};s(J=>[...J,j]),o?.(P)},f=(P,j)=>{if(!P){console.error("No reminder ID provided for update");return}s(J=>J.map(W=>W?.id.toString()===P?{...W,...j}:W)),a?.(P,j)},H=P=>{if(!P){console.error("No reminder ID provided for deletion");return}s(j=>j.filter(J=>J?.id.toString()!==P)),r?.(P)},C=i.filter(P=>{if(!P)return!1;if(g){let j=g.toLowerCase();if(!(P.title.toLowerCase().includes(j)||P.description?.toLowerCase().includes(j)))return!1}switch(u){case"pending":case"completed":case"overdue":return ba(new Date(P.dueDate||""),P.dueTime||"");case"today":return xa(new Date(P.dueDate||""));default:return!0}}).sort((P,j)=>{if(!P||!j)return 0;let J={high:3,medium:2,low:1},W=0;return W!==0?W:new Date(P.dueDate||"").getTime()-new Date(j.dueDate||"").getTime()}),w={total:i.filter(Boolean).length,overdue:i.filter(P=>P&&ba(new Date(P.dueDate||""),P.dueTime||"")).length,today:i.filter(P=>P&&xa(new Date(P.dueDate||""))).length},X=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,yt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,yt.jsx)(vt,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{v(!0)}}}),(0,yt.jsxs)("div",{className:"h-full bg-background",children:[(0,yt.jsx)(es,{colleagues:n,onAddReminder:T,open:x,setOpen:v}),(0,yt.jsxs)("div",{className:"p-6",children:[(0,yt.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,yt.jsxs)("div",{children:[(0,yt.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,yt.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,yt.jsxs)(k,{className:"flex items-center space-x-2",onClick:()=>v(!0),children:[(0,yt.jsx)(wt.Plus,{className:"h-4 w-4"}),(0,yt.jsx)("span",{children:"Add Reminder"})]})]}),(0,yt.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,yt.jsxs)(ge,{className:"p-4",children:[(0,yt.jsx)("div",{className:"text-2xl font-bold text-foreground",children:w.total}),(0,yt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,yt.jsxs)(ge,{className:"p-4",children:[(0,yt.jsx)("div",{className:"text-2xl font-bold text-primary",children:w.overdue}),(0,yt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,yt.jsxs)(ge,{className:"p-4",children:[(0,yt.jsx)("div",{className:"text-2xl font-bold text-success",children:w.today}),(0,yt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,yt.jsxs)(ge,{className:"p-4",children:[(0,yt.jsx)("div",{className:"text-2xl font-bold text-destructive",children:w.overdue}),(0,yt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,yt.jsxs)(ge,{className:"p-4",children:[(0,yt.jsx)("div",{className:"text-2xl font-bold text-warning",children:w.today}),(0,yt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,yt.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,yt.jsx)("div",{className:"flex-1",children:(0,yt.jsx)(te,{placeholder:"Search reminders...",value:g,onChange:P=>h(P.target.value),className:"max-w-md"})}),(0,yt.jsxs)(qe,{value:u,onValueChange:P=>d(P),children:[(0,yt.jsx)(We,{className:"w-40",children:(0,yt.jsx)(pt,{})}),(0,yt.jsxs)(Ke,{children:[(0,yt.jsxs)(fe,{value:"all",children:["All (",w.total,")"]}),(0,yt.jsxs)(fe,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,yt.jsxs)(fe,{value:"overdue",children:["Overdue (",w.overdue,")"]}),(0,yt.jsxs)(fe,{value:"today",children:["Today (",w.today,")"]})]})]})]}),(0,yt.jsx)("div",{className:"space-y-4",children:C.length===0?(0,yt.jsxs)(ge,{className:"p-8 text-center",children:[(0,yt.jsx)("div",{className:"text-muted-foreground",children:g||u!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&u==="all"&&(0,yt.jsx)("p",{className:"text-sm text-muted-foreground/60 wt-2",children:"Create your first reminder to get started"})]}):C.map(P=>P&&(0,yt.jsx)(os,{reminder:P,colleagues:n,onUpdateReminder:f,onDeleteReminder:H},P.id))})]})]})]})};var jt=ce(require("@radix-ui/react-tabs"));function Fr({className:e,...t}){return(0,yt.jsx)(jt.Root,{"data-slot":"tabs",className:N("flex flex-col gap-2",e),...t})}function Or({className:e,...t}){return(0,yt.jsx)(jt.List,{"data-slot":"tabs-list",className:N("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Hr({className:e,...t}){return(0,yt.jsx)(jt.Trigger,{"data-slot":"tabs-trigger",className:N("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 Dt=ce(require("react")),Z=ce(require("@radix-ui/react-dropdown-menu")),no=require("@radix-ui/react-icons");var so=Z.Root,lo=Z.Trigger;var as=Dt.forwardRef(({className:e,inset:t,children:o,...a},r)=>(0,yt.jsxs)(Z.SubTrigger,{ref:r,className:N("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),...a,children:[o,(0,yt.jsx)(no.ChevronRightIcon,{className:"ml-auto"})]}));as.displayName=Z.SubTrigger.displayName;var rs=Dt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Z.SubContent,{ref:o,className:N("yt-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}));rs.displayName=Z.SubContent.displayName;var Wt=Dt.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,yt.jsx)(Z.Portal,{children:(0,yt.jsx)(Z.Content,{ref:a,sideOffset:t,className:N("yt-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),...o})}));Wt.displayName=Z.Content.displayName;var Kt=Dt.forwardRef(({className:e,inset:t,...o},a)=>(0,yt.jsx)(Z.Item,{ref:a,className:N("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),...o}));Kt.displayName=Z.Item.displayName;var is=Dt.forwardRef(({className:e,children:t,checked:o,...a},r)=>(0,yt.jsxs)(Z.CheckboxItem,{ref:r,className:N("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:o,...a,children:[(0,yt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,yt.jsx)(Z.ItemIndicator,{children:(0,yt.jsx)(no.CheckIcon,{className:"h-4 w-4"})})}),t]}));is.displayName=Z.CheckboxItem.displayName;var ns=Dt.forwardRef(({className:e,children:t,...o},a)=>(0,yt.jsxs)(Z.RadioItem,{ref:a,className:N("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),...o,children:[(0,yt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,yt.jsx)(Z.ItemIndicator,{children:(0,yt.jsx)(no.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));ns.displayName=Z.RadioItem.displayName;var ss=Dt.forwardRef(({className:e,inset:t,...o},a)=>(0,yt.jsx)(Z.Label,{ref:a,className:N("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));ss.displayName=Z.Label.displayName;var ls=Dt.forwardRef(({className:e,...t},o)=>(0,yt.jsx)(Z.Separator,{ref:o,className:N("-mx-1 my-1 h-px bg-muted",e),...t}));ls.displayName=Z.Separator.displayName;var ds=({className:e,...t})=>(0,yt.jsx)("span",{className:N("ml-auto text-xs tracking-widest opacity-60",e),...t});ds.displayName="DropdownMenuShortcut";function Vr({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:r="700px",gridCols:i=6}){let s=o.find(n=>n.value===e);return(0,yt.jsxs)(Sr.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,yt.jsx)("div",{className:"hidden lg:block",children:(0,yt.jsx)(Fr,{value:e,onValueChange:t,children:(0,yt.jsx)(Or,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(i,o.length)}, minmax(0, 1fr))`},children:o.map(n=>(0,yt.jsx)(Sr.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,yt.jsx)(Hr,{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,yt.jsx)("div",{className:"lg:hidden",children:(0,yt.jsxs)(so,{children:[(0,yt.jsx)(lo,{asChild:!0,children:(0,yt.jsxs)(k,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[s?.label||"Select",(0,yt.jsx)(wt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,yt.jsx)(Wt,{align:"center",className:"w-[180px]",children:o.map(n=>(0,yt.jsx)(Kt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}var Di=ce(require("@radix-ui/react-dialog"));var pi=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),ui=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),gi=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),fi=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),vi=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),hi=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),bi=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Jo=require("@payloadcms/richtext-lexical/lexical/list"),xi=require("@payloadcms/richtext-lexical/lexical/rich-text"),yi=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var ci=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),ko=require("@payloadcms/richtext-lexical/lexical/utils"),_=require("@payloadcms/richtext-lexical/lexical"),Ma=require("@payloadcms/richtext-lexical/lexical/selection");var qr=require("@radix-ui/react-dialog"),Ko=require("@payloadcms/richtext-lexical/client");var Ca=ce(require("bson-objectid"));var zr=require("@payloadcms/ui");var Ur=ce(require("react")),ut=ce(require("@radix-ui/react-tooltip"));var Go=ut.Provider,jo=ut.Root,Wo=ut.Trigger,No=Ur.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,yt.jsx)(ut.Portal,{children:(0,yt.jsx)(ut.Content,{ref:a,sideOffset:t,className:N("yt-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));No.displayName=ut.Content.displayName;var cs=e=>{let{data:{relationTo:t,value:o},nodeKey:a}=e,[r]=(0,$r.useLexicalComposerContext)(),[i,s]=(0,pe.useState)(""),[n,p]=(0,pe.useState)(""),[u,d]=(0,pe.useState)(""),g=async f=>{console.log("fetchMedia",f)};(0,pe.useEffect)(()=>{typeof o=="string"?o.length===24?g(o):(s(o||""),d(T(v())),p(x()||"")):typeof o=="object"&&(s(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),d(T(o.filesize)),p(o.mimeType?.split("/")[1]||""))},[]);let h=(0,pe.useCallback)(()=>{r.update(()=>{(0,_.$getNodeByKey)(a)?.remove()})},[r,a]),x=()=>{let f=e.data.value;return typeof f=="string"?f.split(";base64")[0]?.split("image/")[1]:""},v=()=>{let f=e.data.value;if(typeof f=="string"){let H=f.split(",")[1]?.length||0;return 4*Math.ceil(H/3)*.5624896334383812/1e3}return 0};function T(f){if(f>=1e6){let V=f/1e6;return`${V>=10?Math.round(V).toString():V.toFixed(1)} MB`}return`${Math.floor(f/1e3)} KB`}return(0,yt.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,yt.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,yt.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,yt.jsx)("div",{className:"flex-1",children:e.data.value?(0,yt.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":o,"data-lexical-upload-relation-to":t,src:i}):(0,yt.jsx)(zr.File,{})}),(0,yt.jsx)(Go,{children:(0,yt.jsxs)(jo,{children:[(0,yt.jsxs)(Wo,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,yt.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,yt.jsx)("button",{onClick:f=>{f.preventDefault(),h()},className:"flex-1 flex justify-center items-center",children:(0,yt.jsx)(wt.X,{width:24,height:24,strokeWidth:1})})]}),(0,yt.jsx)(No,{children:(0,yt.jsx)("span",{children:"Remove image"})})]})})]}),(0,yt.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,yt.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,yt.jsx)("span",{children:u})]})]})})},jr=cs;function ms(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let o=e.getAttribute("data-lexical-upload-id");if(o)return{node:co({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var To=class extends Ko.UploadNode{static importDOM(){return{img:()=>({conversion:ms,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Ca.default().toHexString(),t.version=3);let o={id:t.id??new Ca.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},a=co(o);return a.setFormat?.(t.format),a}decorate(){return(0,yt.jsx)(jr,{data:this.__data,nodeKey:this.getKey()})}};function co(e){return new To({data:e})}var ps=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",us=e=>ps?(e||window).getSelection():null,Tm=(0,_.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),Na=(0,_.createCommand)("INSERT_UPLOAD_COMMAND");function Xr({activeEditor:e,onClose:t,isOpen:o=!1}){let a=(0,pe.useRef)(!1),[r,i]=(0,pe.useState)(!0),[s,n]=(0,pe.useState)(""),[p,u]=(0,pe.useState)(""),[d,g]=(0,pe.useState)(!1),[h,x]=(0,pe.useState)("left"),v=s==="",T=w=>{g(w.target.checked)},f=w=>{x(w.target.value)},H=w=>{let X=new FileReader;X.onload=function(){return typeof X.result=="string"&&n(X.result),""},w!==null&&w[0]&&X.readAsDataURL(w[0])};(0,pe.useEffect)(()=>{a.current=!1;let w=X=>{a.current=X.altKey};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[e]),(0,pe.useEffect)(()=>{r||t()},[r]),(0,pe.useEffect)(()=>{i(o)},[o]);let V=({editor:w,relationTo:X,replaceNodeKey:P,value:j})=>{if(P)w.update(()=>{let J=(0,_.$getNodeByKey)(P);J&&J.replace(co({id:"",fields:{},relationTo:"media",value:j}))});else{let J=w.dispatchCommand(Na,{fields:null,relationTo:"media",value:j})}},C=()=>{V({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:p,src:s,showCaption:d,position:h}.src}),i(!1),t()};return(0,yt.jsx)(ze,{open:r,onOpenChange:w=>i(w),children:(0,yt.jsxs)(_e,{children:[(0,yt.jsxs)(Ge,{children:[(0,yt.jsx)(je,{children:"Upload Image"}),(0,yt.jsx)(qr.DialogDescription,{children:"Description"})]}),(0,yt.jsxs)("div",{className:"",children:[(0,yt.jsx)("div",{style:{marginBottom:"1em"},children:(0,yt.jsx)(te,{type:"file",onChange:w=>H(w.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,yt.jsx)("div",{style:{marginBottom:"1em"},children:(0,yt.jsx)(te,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:w=>u(w.currentTarget.value),value:p,"data-test-id":"image-modal-alt-text-input"})}),(0,yt.jsx)(k,{"data-test-id":"image-modal-file-upload-btn",disabled:v,onClick:()=>C(),children:"Confirm"})]})]})})}function Ta({captionsEnabled:e}){let[t]=(0,ci.useLexicalComposerContext)();return(0,pe.useEffect)(()=>{if(!t.hasNodes([Ko.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,ko.mergeRegister)(t.registerCommand(_.DRAGSTART_COMMAND,o=>gs(o),_.COMMAND_PRIORITY_HIGH),t.registerCommand(_.DRAGOVER_COMMAND,o=>fs(o),_.COMMAND_PRIORITY_LOW),t.registerCommand(_.DROP_COMMAND,o=>vs(o,t),_.COMMAND_PRIORITY_HIGH))},[e,t]),null}function gs(e){if(!Sa())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","_"),!0):!1}function fs(e){return Sa()?(Yr(e)||e.preventDefault(),!0):!1}function vs(e,t){let o=Sa();if(!o)return!1;if(e.preventDefault(),Yr(e)){let a=hs(e);o.remove();let r=(0,_.$createRangeSelection)();a!=null&&r.applyDOMRange(a),(0,_.$setSelection)(r)}return!0}function Sa(){let e=(0,_.$getSelection)();if(!(0,_.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,Ko.$isUploadNode)(o)?o:null}function Yr(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function hs(e){let t,o=e.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,r=us(a);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&r!==null)r.collapse(e.rangeParent,e.rangeOffset||0),t=r.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var bs=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),Qr=bs;var xs=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),ei=xs;var ys=()=>(0,yt.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,yt.jsx)("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,yt.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),ti=ys;var ws=()=>(0,yt.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,yt.jsx)("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,yt.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),oi=ws;var Cs=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),ai=Cs;var Ns=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),ri=Ns;var ii=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),ni=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),si=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),li=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),di=()=>(0,yt.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,yt.jsx)("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var Ea=1;function Ts(){return(0,yt.jsx)("span",{className:"border border-[#222222]"})}function Aa(){let[e]=(0,ci.useLexicalComposerContext)(),t=(0,pe.useRef)(null),[o,a]=(0,pe.useState)(!1),[r,i]=(0,pe.useState)(!1),[s,n]=(0,pe.useState)(!1),[p,u]=(0,pe.useState)(!1),[d,g]=(0,pe.useState)(!1),[h,x]=(0,pe.useState)(!1),[v,T]=(0,pe.useState)(!1),[f,H]=(0,pe.useState)(!1),[V,C]=(0,pe.useState)(!1),[w,X]=(0,pe.useState)("left"),[P,j]=(0,pe.useState)("p"),J=E=>{e.update(()=>{let G=(0,_.$getSelection)();(0,_.$isRangeSelection)(G)&&(E==="p"?(0,Ma.$setBlocksType)(G,()=>(0,_.$createParagraphNode)()):(0,Ma.$setBlocksType)(G,()=>(0,xi.$createHeadingNode)(E)))})},W=(0,pe.useCallback)(()=>{let E=(0,_.$getSelection)();if((0,_.$isRangeSelection)(E)){n(E.hasFormat("bold")),u(E.hasFormat("italic")),g(E.hasFormat("underline")),x(E.hasFormat("strikethrough")),T(E.hasFormat("subscript")),H(E.hasFormat("superscript"));let G=E.anchor.getNode(),de=G;for(;de&&!(0,_.$isParagraphNode)(de)&&de!==(0,_.$getRoot)();){let ke=de.getParent();ke&&(de=ke)}if(de){let ke=de.getFormatType();X(ke||"left")}let $e=G.getTopLevelElement()?.__tag;j($e||"p")}},[]);(0,pe.useEffect)(()=>(0,ko.mergeRegister)(e.registerUpdateListener(({editorState:E})=>{E.read(()=>{W()})}),e.registerCommand(_.SELECTION_CHANGE_COMMAND,(E,G)=>(W(),!1),Ea),e.registerCommand(_.CAN_UNDO_COMMAND,E=>(a(E),!1),Ea),e.registerCommand(_.CAN_REDO_COMMAND,E=>(i(E),!1),Ea),(0,ko.mergeRegister)(e.registerCommand(Na,E=>(e.update(()=>{let G=(0,_.$getSelection)()||(0,_.$getPreviousSelection)();if((0,_.$isRangeSelection)(G)){let de=co({id:E.id,fields:E.fields,relationTo:E.relationTo,value:E.value}),{focus:$e}=G,ke=$e.getNode();(0,ko.$insertNodeToNearestRoot)(de),(0,_.$isParagraphNode)(ke)&&!ke.__first&&ke.remove()}}),!0),_.COMMAND_PRIORITY_EDITOR))),[e,W]);let Ce=[[{label:"Undo",icon:(0,yt.jsx)(wt.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,yt.jsx)(wt.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,yt.jsx)(Qr,{}),onClick:()=>{e.dispatchCommand(_.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:s},{label:"Italic",icon:(0,yt.jsx)(ei,{}),onClick:()=>{e.dispatchCommand(_.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:p},{label:"Underline",icon:(0,yt.jsx)(ti,{}),onClick:()=>{e.dispatchCommand(_.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,yt.jsx)(oi,{}),onClick:()=>{e.dispatchCommand(_.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:h},{label:"Subscript",icon:(0,yt.jsx)(ai,{}),onClick:()=>{e.dispatchCommand(_.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:v},{label:"Superscript",icon:(0,yt.jsx)(ri,{}),onClick:()=>{e.dispatchCommand(_.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:f}]],De=[{label:"Left Align",direction:"left",icon:(0,yt.jsx)(wt.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,yt.jsx)(wt.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,yt.jsx)(wt.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,yt.jsx)(wt.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(_.FORMAT_ELEMENT_COMMAND,"justify")}}],ae=[{label:"Normal Text",value:"p",icon:(0,yt.jsx)(ii,{}),onClick:()=>J("p")},{label:"Heading 1",value:"h1",icon:(0,yt.jsx)(ni,{}),onClick:()=>J("h1")},{label:"Heading 2",value:"h2",icon:(0,yt.jsx)(si,{}),onClick:()=>J("h2")},{label:"Heading 3",value:"h3",icon:(0,yt.jsx)(li,{}),onClick:()=>J("h3")},{label:"Heading 4",value:"h4",icon:(0,yt.jsx)(di,{}),onClick:()=>J("h4")},...[{label:"Unordered List",value:"ul",icon:(0,yt.jsx)(wt.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Jo.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,yt.jsx)(wt.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Jo.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],se=[{label:"Insert Image",icon:(0,yt.jsx)(wt.ImageUp,{width:15,height:15}),onClick:()=>{C(!0)},disabled:!1}];return(0,yt.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black yt-50",children:(0,yt.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[Ce.map((E,G)=>(0,yt.jsxs)(pe.Fragment,{children:[(0,yt.jsx)("div",{className:"flex items-center gap-2",children:E.map((de,$e)=>(0,yt.jsx)("div",{role:"button","aria-disabled":de.disabled||!1,onClick:de.onClick,className:N("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",de.active&&"bg-[#3c3c3c]"),"aria-label":de.label,children:(0,yt.jsx)(Go,{children:(0,yt.jsxs)(jo,{children:[(0,yt.jsx)(Wo,{className:"text-[#b5b5b5]",children:de.icon}),(0,yt.jsx)(No,{children:(0,yt.jsx)("p",{children:de.label})})]})})},$e))}),(0,yt.jsx)(Ts,{})]},`toolbar-option-${E.length}-${G}`)),(0,yt.jsxs)(so,{children:[(0,yt.jsxs)(lo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[De.find(E=>E.direction===w)?.icon,De.find(E=>E.direction===w)?.label,(0,yt.jsx)(wt.ChevronDown,{width:15,height:15})]}),(0,yt.jsx)(Wt,{className:"bg-black hover:bg-black",children:De.map((E,G)=>(0,yt.jsxs)(Kt,{onClick:E.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,yt.jsx)("span",{children:E.icon}),(0,yt.jsx)("span",{children:E.label})]},`${E.label}-${G}`))})]}),(0,yt.jsxs)(so,{children:[(0,yt.jsxs)(lo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[ae.find(E=>E.value===P)?.icon,ae.find(E=>E.value===P)?.label,(0,yt.jsx)(wt.ChevronDown,{width:15,height:15})]}),(0,yt.jsx)(Wt,{className:"bg-black hover:bg-black",children:ae.map((E,G)=>(0,yt.jsxs)(Kt,{onClick:E.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,yt.jsx)("span",{children:E.icon}),(0,yt.jsx)("span",{children:E.label})]},`heading-option-${E.label}-${G}`))})]}),(0,yt.jsxs)(so,{children:[(0,yt.jsxs)(lo,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,yt.jsx)(wt.Plus,{width:15,height:15}),(0,yt.jsx)(wt.ChevronDown,{width:15,height:15})]}),(0,yt.jsx)(Wt,{className:"bg-black hover:bg-black",children:se.map((E,G)=>(0,yt.jsxs)(Kt,{onClick:E.onClick,disabled:E.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,yt.jsx)("span",{children:E.icon}),(0,yt.jsx)("span",{children:E.label})]},G))})]}),V&&(0,yt.jsx)(Xr,{activeEditor:e,onClose:()=>{C(!1)},isOpen:V})]})})}var Ss=({setValue:e,value:t,name:o,editable:a=!0})=>{let[r]=(0,ci.useLexicalComposerContext)(),i=(0,pe.useRef)(null),s=n=>{n.read(()=>{let p=n.toJSON();JSON.stringify(p)!==JSON.stringify(i.current)&&(i.current=p,e?.(()=>p))})};return(0,pe.useEffect)(()=>{r.setEditable(a)},[a,r]),(0,pe.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(i.current)&&r.update(()=>{try{let n=r.parseEditorState(t);r.setEditorState(n),i.current=t}catch(n){console.error("Error parsing editor state:",n)}},{discrete:!0})},[t,r]),(0,yt.jsx)("div",{className:"w-full",children:(0,yt.jsxs)("div",{className:" ",children:[a&&(0,yt.jsx)(Aa,{}),(0,yt.jsxs)("div",{className:"px-4 my-4 border-yt border-[#222222]",children:[(0,yt.jsx)(hi.RichTextPlugin,{contentEditable:(0,yt.jsx)(gi.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:fi.LexicalErrorBoundary}),a&&(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(vi.HistoryPlugin,{}),(0,yt.jsx)(pi.AutoFocusPlugin,{}),(0,yt.jsx)(bi.ListPlugin,{}),(0,yt.jsx)(yi.OnChangePlugin,{onChange:s}),(0,yt.jsx)(Ta,{})]})]})]})})},Ds=({setValue:e,value:t,name:o,editable:a=!0})=>(0,yt.jsx)(ui.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Jo.ListNode,Jo.ListItemNode,xi.HeadingNode,To],onError(i){throw console.error("Lexical error:",i),i},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,yt.jsx)(Ss,{value:t,setValue:e,name:o,editable:a})}),Ci=Ds;var Ro=e=>"mimeType"in e&&"url"in e&&!("format"in e),ks=e=>{if(!e?.root?.children)return"";let t=[],o=r=>{if(!r)return"";switch(r.type){case"heading":{let i=r.tag?parseInt(r.tag.replace("h","")):1,s=a(r.children||[]);return"#".repeat(i)+" "+s}case"paragraph":return a(r.children||[]);case"list":{let i=[],s=r.listType==="number"?"1.":"-";return r.children?.forEach((n,p)=>{if(n.type==="listitem"){let u=a(n.children||[]),d=r.listType==="number"?`${p+1}.`:s;i.push(`${d} ${u}`)}}),i.join(`
6
+ `)}case"listitem":return a(r.children||[]);case"text":{let i=r.text||"";if(r.format){let s=(r.format&1)!==0,n=(r.format&2)!==0,p=(r.format&4)!==0,u=(r.format&8)!==0;(r.format&16)!==0?i=`\`${i}\``:(s&&(i=`**${i}**`),n&&(i=`*${i}*`),p&&(i=`~~${i}~~`),u&&(i=`<u>${i}</u>`))}return i}default:return r.children?a(r.children):""}},a=r=>r.map(i=>{if(i.type==="text"){let s=i.text||"";if(i.format){let n=(i.format&1)!==0,p=(i.format&2)!==0,u=(i.format&4)!==0,d=(i.format&8)!==0;(i.format&16)!==0?s=`\`${s}\``:(n&&(s=`**${s}**`),p&&(s=`*${s}*`),u&&(s=`~~${s}~~`),d&&(s=`<u>${s}</u>`))}return s}else{if(i.type==="paragraph")return a(i.children||[]);if(i.type==="listitem")return a(i.children||[]);if(i.type==="linebreak")return`
7
+ `}return o(i)}).filter(Boolean).join("");return e.root.children.forEach(r=>{let i=o(r);i&&t.push(i)}),t.join(`
8
+
9
+ `)},Zt=e=>{let t=[],o=0;for(;o<e.length;){let r=e.slice(o).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(r&&r[0]){let h=r[1]||"",x=h?Zt(h):[];x.length>0?(x.forEach(v=>{v.type==="text"&&(v.format=(v.format||0)|8)}),t.push(...x)):h===""&&t.push({type:"text",text:"",format:8}),o+=r[0].length;continue}if(e.slice(o).startsWith("</u>")){o+=4;continue}let i=e.slice(o).match(/^(`+)([^`]+)\1/);if(i){let h=i[2];h&&t.push({type:"text",text:h,format:16}),o+=i[0].length;continue}let s=e.slice(o).match(/^(~~)(.+?)\1/);if(s){let h=s[2],x=Zt(h);x.forEach(v=>{v.type==="text"&&(v.format=(v.format||0)|4)}),t.push(...x),o+=s[0].length;continue}let n=e.slice(o).match(/^(\*\*|__)(.+?)\1/);if(n){let h=n[2],x=Zt(h);x.forEach(v=>{v.type==="text"&&(v.format=(v.format||0)|1)}),t.push(...x),o+=n[0].length;continue}let p=e.slice(o).match(/^(\*|_)([^*_\n]+?)\1(?!\*|_)/);if(p&&p[0].length>2){let h=p[2],x=Zt(h);x.forEach(v=>{v.type==="text"&&(v.format=(v.format||0)|2)}),t.push(...x),o+=p[0].length;continue}let u=e.length,d=[{pattern:/<u>/i,offset:0},{pattern:/\*\*/,offset:0},{pattern:/__/,offset:0},{pattern:/~~/,offset:0},{pattern:/`+/,offset:0},{pattern:/\*[^*\n]/,offset:0},{pattern:/_[^_\n]/,offset:0}];for(let{pattern:h}of d){let x=e.slice(o+1).search(h);x!==-1&&x+1<u-o&&(u=o+x+1)}let g=e.slice(o,u);g&&t.push({type:"text",text:g,format:0}),o=u}let a=[];for(let r of t)a.length>0&&a[a.length-1].type==="text"&&a[a.length-1].format===r.format?a[a.length-1].text+=r.text:a.push(r);return a.length>0?a:[{type:"text",text:"",format:0}]},Ps=e=>{let t=e.split(`
10
+ `),o=[],a=[],r=[],i=()=>{if(a.length>0){let n=a.join(" "),p=Zt(n);o.push({type:"paragraph",children:p.length>0?p:[{type:"text",text:"",format:0}]}),a=[]}},s=()=>{r.length>0&&(o.push({type:"list",listType:"bullet",children:r}),r=[])};for(let n of t){let p=n.trim();if(!p){i(),s();continue}let u=p.match(/^(#{1,6})\s+(.+)$/);if(u){i(),s();let g=u[1].length,h=u[2],x=Zt(h);o.push({type:"heading",tag:`h${g}`,children:x.length>0?x:[{type:"text",text:"",format:0}]});continue}let d=p.match(/^[-*+]\s+(.+)$/);if(d){i();let g=d[1],h=Zt(g);r.push({type:"listitem",children:[{type:"paragraph",children:h.length>0?h:[{type:"text",text:"",format:0}]}]});continue}r.length>0&&s(),a.push(p)}return i(),s(),o.length===0&&o.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:o,direction:"ltr",format:"",indent:0,version:1}}},Rs=async e=>{let t="",o,a="text";if(e.url)try{let r=e.url;!r.startsWith("http://")&&!r.startsWith("https://")&&!r.startsWith("/")&&(r="/"+r),console.log("Fetching file content from URL:",r);let i=await fetch(r);i.ok?(t=await i.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed to fetch file content:",i.status,i.statusText)}catch(r){throw console.error("Failed to fetch file content:",r),r}else console.warn("No URL provided for file:",e.name);return e.mimeType==="text/markdown"?(a="richText",console.log("Converting markdown to Lexical, content length:",t.length),o=Ps(t),console.log("Converted Lexical JSON:",JSON.stringify(o,null,2))):e.mimeType?.startsWith("text/")&&(a="text"),{id:e.id.toString(),title:e.name,description:void 0,content:a==="richText"?void 0:t,richTextContent:a==="richText"?o:void 0,format:a,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function Ti({document:e,onCancel:t,onSave:o,onFileUpdate:a}){let[r,i]=(0,pe.useState)(Ro(e)),[s,n]=(0,pe.useState)(Ro(e)?{id:e.id.toString(),title:e.name,description:void 0,content:"",format:"text",metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}:{...e,updatedAt:new Date}),[p,u]=(0,pe.useState)(Ro(e)?void 0:s.richTextContent),[d,g]=(0,pe.useState)(!1),h=(0,pe.useRef)(Ro(e)?e:null);(0,pe.useEffect)(()=>{Ro(e)?(i(!0),Rs(e).then(f=>{console.log("Loaded content:",f),n(f),u(f.richTextContent),i(!1)}).catch(f=>{console.error("Failed to convert file:",f),i(!1)})):(n({...e,updatedAt:new Date}),u(e.richTextContent))},[e]);let x=f=>{switch(f){case"markdown":case"mdx":return(0,yt.jsx)(wt.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,yt.jsx)(wt.File,{className:"h-6 w-6 text-success"});case"text":return(0,yt.jsx)(wt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,yt.jsx)(wt.File,{className:"h-6 w-6 text-muted-foreground"})}},v=f=>{switch(f){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richText":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},T=async()=>{g(!0);try{let f,H;if(h.current&&h.current.mimeType==="text/markdown"){let C=p?ks(p):"";f={...s,format:"markdown",content:C,richTextContent:void 0},H=C}else f={...s,richTextContent:p},H=s.content||"";let V=h.current?h.current.id.toString():s.id;await Promise.resolve(o()),a?.(V,H)}finally{g(!1)}};return(0,yt.jsxs)(Sr.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,yt.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,yt.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,yt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,yt.jsx)("div",{className:"flex-1 min-w-0",children:(0,yt.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,yt.jsx)("div",{className:"flex-1 min-w-0",children:(0,yt.jsx)(Co,{fieldName:"title",value:s.title,label:"",onSave:(f,H)=>n(V=>({...V,title:H})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,yt.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${v(s.format)} flex-shrink-0 wt-1`,children:s.format.toUpperCase()})]})})}),(0,yt.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,yt.jsxs)(k,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,yt.jsx)(wt.X,{className:"h-4 w-4"}),"Close"]}),(0,yt.jsxs)(k,{size:"sm",onClick:T,className:"gap-2",disabled:d,children:[d?(0,yt.jsx)(wt.Loader2,{className:"h-4 w-4 animate-spin"}):(0,yt.jsx)(wt.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,yt.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,yt.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:r?(0,yt.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,yt.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,yt.jsx)(wt.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,yt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,yt.jsx)(yt.Fragment,{children:s.format==="richText"?(0,yt.jsx)(Ci,{setValue:u,value:p,name:"richTextContent"},`richtext-${s.id}-${r?"loading":"loaded"}`):(0,yt.jsx)(Ee,{value:s.content||"",onChange:f=>n(H=>({...H,content:f.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var Es=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Yo({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:a,showHeader:r=!0,className:i}){let[s,n]=(0,pe.useState)(!1),[p,u]=(0,pe.useState)(!1),[d,g]=(0,pe.useState)(null),h=()=>{n(!1),g(null)},x=()=>{u(!0),setTimeout(()=>{u(!1),n(!1),g(null)},500)},v=T=>{g(T),n(!0)};return(0,yt.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${i||""}`,children:[r&&(0,yt.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,yt.jsx)("div",{className:"col-span-6",children:"Name"}),(0,yt.jsx)("div",{className:"col-span-2",children:"Size"}),(0,yt.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,yt.jsx)("div",{className:"divide-y",children:e.map(T=>(0,yt.jsxs)(Sr.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?.(T),children:[(0,yt.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,yt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,yt.jsx)("div",{children:(0,yt.jsx)("p",{className:"font-medium",children:T.name})})]}),(0,yt.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:Es(T.filesize)}),(0,yt.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,yt.jsx)("span",{className:"text-sm md:text-base",children:new Date(T.createdAt).toLocaleDateString()}),(0,yt.jsxs)("div",{className:"flex gap-1",children:[T.mimeType==="text/markdown"&&(0,yt.jsx)(k,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:f=>{f.stopPropagation(),v(T)},children:(0,yt.jsx)(wt.Edit,{className:"h-4 w-4"})}),(0,yt.jsx)(k,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:f=>{f.stopPropagation(),o?.(T)},children:(0,yt.jsx)(wt.Trash2,{className:"h-4 w-4"})})]})]})]},T.name))}),(0,yt.jsx)(ze,{open:s,onOpenChange:T=>!T&&h(),children:(0,yt.jsxs)(ia,{children:[(0,yt.jsx)(Io,{}),(0,yt.jsxs)(Di.Content,{className:N("fixed inset-0 yt-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[p&&(0,yt.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center yt-50",children:(0,yt.jsx)(wt.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),d&&(0,yt.jsx)(Ti,{document:d,onSave:x,onFileUpdate:a,onCancel:h})]})]})})]})}var Pi=({isOpen:e,onClose:t,onAddFile:o})=>{let[a,r]=(0,pe.useState)(null),[i,s]=(0,pe.useState)(""),[n,p]=(0,pe.useState)(""),[u,d]=(0,pe.useState)(""),g=x=>{let v=x.target.files?.[0];v&&(r(v),i||s(v.name))},h=async x=>{if(x.preventDefault(),!a)return;let v=new FormData;v.append("file",a),v.append("name",i),n&&v.append("description",n),u&&v.append("tags",u),o?.(v),t(),r(null),s(""),p(""),d("")};return(0,yt.jsx)(ze,{open:e,onOpenChange:t,children:(0,yt.jsxs)(_e,{className:"sm:max-w-md",children:[(0,yt.jsx)(Ge,{children:(0,yt.jsx)(je,{children:"Add New File"})}),(0,yt.jsxs)("form",{onSubmit:h,className:"grid gap-4",children:[(0,yt.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,yt.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,yt.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,yt.jsx)(Ms,{className:"w-10 h-10 text-gray-400"}),(0,yt.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,yt.jsx)("span",{className:"font-semibold",children:"Click to upload"})," yt drag and drop"]}),(0,yt.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG yt GIF (MAX. 800x400px)"})]}),(0,yt.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),a&&(0,yt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,yt.jsxs)("div",{children:[(0,yt.jsx)("p",{className:"font-medium",children:a.name}),(0,yt.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((a.size||0)/1024).toFixed(2)," KB"]})]}),(0,yt.jsx)(k,{type:"submit",onClick:h,children:"Upload"})]})]})]})})};function Ms(e){return(0,yt.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,yt.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,yt.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,yt.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function Ia({initialFiles:e=[],onFileAdd:t,onFileEdit:o,onFileDelete:a,onFileClick:r,onFileUpdate:i,compactView:s=!1,className:n}){let[p,u]=(0,pe.useState)(e),[d,g]=(0,pe.useState)(""),[h,x]=(0,pe.useState)("all"),[v,T]=(0,pe.useState)("all"),[f,H]=(0,pe.useState)(!1),V=(0,pe.useRef)(""),C=S=>S.map(ae=>`${ae.id}-${new Date(ae.createdAt).getTime()}-${new Date(ae.updatedAt).getTime()}`).join("-");(0,pe.useEffect)(()=>{let S=C(e.map(ae=>({...ae,updatedAt:new Date().toISOString()})));S!==V.current&&(u(e),V.current=S)},[e]);let w=p.filter(S=>S.name.toLowerCase().includes(d.toLowerCase())),X=w.slice(0,10),P=w.filter(Boolean),j=()=>{H(!0)},J=S=>{o?.(S)},W=S=>{console.log("deleting file",S),u(ae=>ae.filter(se=>se.name!==S.name)),a?.(S.id.toString())},Ce=S=>{r?.(S)},De=()=>{g(""),x("all")};return(0,yt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,yt.jsx)(Sr.AnimatePresence,{mode:"wait",children:(0,yt.jsx)(Sr.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,yt.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,yt.jsx)(vt,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:j},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,yt.jsx)(ge,{children:(0,yt.jsx)(to,{className:"pt-6",children:(0,yt.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,yt.jsx)("div",{className:"flex-1",children:(0,yt.jsxs)("div",{className:"relative",children:[(0,yt.jsx)(wt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,yt.jsx)(te,{placeholder:"Search files...",value:d,onChange:S=>g(S.target.value),className:"pl-9"})]})}),(d||h!=="all")&&(0,yt.jsxs)(k,{variant:"outline",onClick:De,className:"gap-2",children:[(0,yt.jsx)(wt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,yt.jsxs)("div",{className:"space-y-4",children:[(0,yt.jsx)(Vr,{activeTab:v,onTabChange:T,tabOptions:[{value:"all",label:`All Files (${w.length})`},{value:"recent",label:`Recent (${X.length})`}],maxWidth:"500px",gridCols:3}),v==="all"&&(0,yt.jsx)(Yo,{files:w,onFileClick:Ce,onFileUpdate:i,onFileDelete:W,showHeader:!s}),v==="recent"&&(0,yt.jsx)(Yo,{files:X,onFileClick:Ce,onFileUpdate:i,onFileDelete:W,showHeader:!s}),v==="shared"&&(0,yt.jsx)(Yo,{files:P,onFileClick:Ce,onFileUpdate:i,onFileDelete:W,showHeader:!s})]}),w.length===0&&(0,yt.jsx)(ge,{children:(0,yt.jsx)(to,{className:"pt-6",children:(0,yt.jsxs)("div",{className:"text-center py-8",children:[(0,yt.jsx)(wt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,yt.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,yt.jsx)("p",{className:"text-muted-foreground mb-4",children:d||h!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,yt.jsxs)(k,{onClick:j,className:"gap-2",children:[(0,yt.jsx)(wt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,yt.jsx)(Pi,{isOpen:f,onClose:()=>H(!1),onAddFile:t})]})}var Ri=require("next/navigation");function Ei({title:e="",initialTasks:t=[],initialEpics:o=[],initialSprints:a=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:s=[],initialUsers:n=[],initialFiles:p=[],initialView:u="kanban",onAddTask:d,onUpdateTask:g,onDeleteTask:h,onTaskClick:x,onAddEpic:v,onUpdateEpic:T,onDeleteEpic:f,onAddTaskToEpic:H,onAddSprint:V,onUpdateSprint:C,onDeleteSprint:w,onAddProject:X,onUpdateProject:P,onDeleteProject:j,onFileAdd:J,onFileEdit:W,onFileDelete:Ce,onFileClick:De,onAddReminder:S,onUpdateReminder:ae,onDeleteReminder:se,onViewChange:E,onToggleMobileMenu:G,onTeamClick:de,onTeamChange:$e,onCopilotClick:ke,handleAddComment:it}){let[D,Y]=(0,pe.useState)(t),[ve,nt]=(0,pe.useState)(o),[ie,tt]=(0,pe.useState)(a),[Jt,xt]=(0,pe.useState)(r),[mo,Pt]=(0,pe.useState)(i),[Ot,qt]=(0,pe.useState)(s),[Rt,Xt]=(0,pe.useState)(n),[Yt,R]=(0,pe.useState)(p),[m,b]=(0,pe.useState)(!1),[B,q]=(0,pe.useState)(!1),[Te,Ne]=(0,pe.useState)(null),[Je,po]=(0,pe.useState)(null),[uo,go]=(0,pe.useState)(null),[Ht,La]=(0,pe.useState)(u||"kanban"),[Is,Mi]=(0,pe.useState)(!1),Ai=(0,Ri.useRouter)();(0,pe.useEffect)(()=>{Y(t)},[t]),(0,pe.useEffect)(()=>{tt(a)},[a]),(0,pe.useEffect)(()=>{nt(o)},[o]),(0,pe.useEffect)(()=>{xt(r)},[r]),(0,pe.useEffect)(()=>{R(p)},[p]),(0,pe.useEffect)(()=>{Xt(n)},[n]),(0,pe.useEffect)(()=>{qt(s)},[s]),(0,pe.useEffect)(()=>{Pt(i)},[i]),(0,pe.useEffect)(()=>{La(u)},[u]);let Ii=D.filter(y=>{}),Ls=y=>Ii.filter(O=>O.status===y),Fs=y=>{let O={};return ve.forEach(U=>{}),O},Os=y=>{go(y)},Hs=y=>{uo&&(Y(O=>O.map(U=>U.id===uo.id?{...U,status:y}:U)),go(null))},Fa=y=>{let O={...y,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Y(U=>[...U,O]),d?.(O)},Mo=async(y,O)=>(Y(U=>U.map(Le=>Le.id===Number(y)?{...Le,...O}:Le)),await g?.(y,O)),Bs=async(y,O)=>{Mo(y,O)},Oa=y=>{Y(O=>O.filter(U=>U.id!==Number(y))),Te?.id===Number(y)&&Ne(null),h?.(y)},Vs=async y=>{Oa(y)},Us=y=>{let O={...y,id:Date.now()};xt(U=>[...U,O]),X?.(y)},zs=(y,O)=>{xt(U=>U.map(Le=>Le.id===Number(y)?{...Le,...O}:Le)),P?.(y,O)},$s=y=>{xt(O=>O.filter(U=>U.id!==Number(y))),j?.(y)},Ha=y=>{let O={...y,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};nt(U=>[...U,O]),v?.({...O})},Li=()=>{q(!0)},Fi=(y,O)=>{nt(U=>U.map(Le=>Le.id===Number(y)?{...Le,...O}:Le)),T?.(y,O)},Oi=y=>{nt(O=>O.filter(U=>U.id!==Number(y))),Y(O=>O.filter(U=>Re(U.epic)!==Number(y))),f?.(y)},Hi=y=>{let O={...y,id:Date.now()};tt(U=>[...U,O]),V?.(y)},Bi=(y,O)=>{tt(U=>U.map(Le=>Le.id===Number(y)?{...Le,...O}:Le)),C?.(y,O)},Vi=y=>{y==="backlog"||y==="all-tasks"||(tt(O=>O.filter(U=>U.id!==Number(y))),Y(O=>O.map(U=>Re(U.sprint)===Number(y)?{...U,sprint:void 0}:U)),w?.(y))},ea=y=>{Ne(y)},Ui=y=>{y==="planning"&&window.innerWidth<768||(La(y),E?.(y))},_s=()=>{Mi(y=>!y),G?.()},Gs=()=>{Ai.push("/")},js=y=>{console.log("Switching to team:",y)},Ws=y=>{console.log("Switching to team:",y)},zi=y=>{b(!0)},$i=()=>{b(!1),po(null)},_i=y=>{let O={...y,id:Date.now(),createdAt:new Date().toISOString()};Pt(U=>[...U,O]),S?.(y)},Gi=(y,O)=>{Pt(U=>U.map(Le=>Le.id===Number(y)?{...Le,...O}:Le)),ae?.(y,O)},ji=y=>{Pt(O=>O.filter(U=>U.id!==Number(y))),se?.(y)},Wi=()=>{J?.()},Ki=y=>{W?.(y)},Zi=y=>{R(O=>O.filter(U=>U.name!==y)),Ce?.(y)},Ji=y=>{De?.(y)},Ks=[{id:"todo",title:"To yt",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Zs=()=>{switch(Ht){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"}},ta=[{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")}],Js=ta.sort((y,O)=>O.lastUsed.getTime()-y.lastUsed.getTime()).slice(0,3),qs=ta.length>3,Xs=ta.slice(3);return(0,yt.jsxs)(Va,{currentView:Ht,onViewChange:Ui,children:[Ht==="kanban"&&(0,yt.jsx)("div",{className:"h-full overflow-hidden",children:(0,yt.jsx)(Dr,{initialProjects:Jt,initialEpics:ve,initialSprints:ie.map(y=>({...y,isSelected:!1})),initialTasks:D,initialColleagues:Ot,initialUsers:Rt,onAddTask:Fa,onUpdateTask:Mo,onDeleteTask:Oa,onTaskClick:ea,onAddEpic:Ha,onAddComment:it})}),Ht==="planning"&&(0,yt.jsx)("div",{className:"hidden md:block h-full",children:(0,yt.jsx)(Ir,{tasks:D,epics:ve,sprints:ie,onUpdateTask:Mo,onTaskClick:ea,onAddSprint:Hi,onUpdateSprint:Bi,onDeleteSprint:Vi})}),Ht==="tasks"&&(0,yt.jsx)("div",{className:"h-full",children:(0,yt.jsx)(Lr,{initialReminders:mo,initialColleagues:Ot,onAddReminder:_i,onUpdateReminder:Gi,onDeleteReminder:ji})}),Ht==="files"&&(0,yt.jsx)("div",{className:"h-full",children:(0,yt.jsx)(Ia,{initialFiles:Yt,onFileAdd:Wi,onFileEdit:Ki,onFileDelete:Zi,onFileClick:Ji,compactView:!1})}),Ht==="epics"&&(0,yt.jsx)("div",{className:"h-full",children:(0,yt.jsx)(kr,{tasks:D,epics:ve,sprints:ie,onUpdateTask:Mo,onTaskClick:ea,onAddTaskToEpic:zi,onAddEpic:Li,onUpdateEpic:Fi,onDeleteEpic:Oi})}),(0,yt.jsx)(ao,{isOpen:m,onClose:$i,onAddTask:Fa,epics:ve,sprints:ie,assignees:[...Ot,...Rt],defaultEpicId:Je||void 0}),(0,yt.jsx)(io,{isOpen:B,onClose:()=>q(!1),onAddEpic:Ha})]})}