cortex-react-components 2.24.0 → 2.26.1

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 (138) hide show
  1. package/dist/{chunk-SDKKYDWS.mjs → chunk-24NYAA5I.mjs} +1 -1
  2. package/dist/chunk-2HKAJ4TZ.mjs +4 -0
  3. package/dist/{chunk-LBUC4M6L.mjs → chunk-3GDFYE6T.mjs} +1 -1
  4. package/dist/chunk-3V4WLGEY.mjs +4 -0
  5. package/dist/{chunk-PK3OBSCB.mjs → chunk-436WKDWG.mjs} +1 -1
  6. package/dist/{chunk-WYR2HJ75.mjs → chunk-4HXYNCOU.mjs} +1 -1
  7. package/dist/{chunk-I2GNNRFH.mjs → chunk-6T4OEOJH.mjs} +1 -1
  8. package/dist/chunk-6UDBIRMT.mjs +1 -0
  9. package/dist/{chunk-YKG4FNS4.mjs → chunk-DUEPJ3F4.mjs} +1 -1
  10. package/dist/{chunk-M7ZG6HLI.mjs → chunk-DY2G774J.mjs} +1 -1
  11. package/dist/{chunk-MXCW6SOT.mjs → chunk-EVZSRWUW.mjs} +1 -1
  12. package/dist/{chunk-LJQPLE4S.mjs → chunk-G6ED5Z4J.mjs} +1 -1
  13. package/dist/{chunk-255P6K5W.mjs → chunk-HH3AWPYB.mjs} +1 -1
  14. package/dist/{chunk-GPFPTU7U.mjs → chunk-INBT5E6T.mjs} +1 -1
  15. package/dist/{chunk-5SHZBJ5R.mjs → chunk-IQ3TUH7O.mjs} +1 -1
  16. package/dist/{chunk-N3B3XNV3.mjs → chunk-IUT6JJHY.mjs} +1 -1
  17. package/dist/{chunk-FKU4VQR6.mjs → chunk-KJMXSFJA.mjs} +1 -1
  18. package/dist/{chunk-HKGW6JI2.mjs → chunk-M4NJB4NN.mjs} +1 -1
  19. package/dist/{chunk-NWISIJFD.mjs → chunk-NIRR5B5C.mjs} +1 -1
  20. package/dist/chunk-P5LSKHQC.mjs +9 -0
  21. package/dist/{chunk-JOG27B7P.mjs → chunk-PDAMYUP7.mjs} +1 -1
  22. package/dist/{chunk-ERJXTG6X.mjs → chunk-PLTKMHUH.mjs} +1 -1
  23. package/dist/{chunk-XDW3TPGL.mjs → chunk-PZCH3GAL.mjs} +1 -1
  24. package/dist/{chunk-7GMAMIHM.mjs → chunk-QDAJ7QAD.mjs} +1 -1
  25. package/dist/{chunk-6DDMDQLX.mjs → chunk-RSYHYNWR.mjs} +1 -1
  26. package/dist/{chunk-H3CJOE6S.mjs → chunk-S562PA5P.mjs} +1 -1
  27. package/dist/{chunk-5WVFEIMC.mjs → chunk-V63JJVJX.mjs} +1 -1
  28. package/dist/{chunk-67QPOSVV.mjs → chunk-VKJ7E6OL.mjs} +1 -1
  29. package/dist/{chunk-GCIEF545.mjs → chunk-XDELWNND.mjs} +1 -1
  30. package/dist/{chunk-M7NV6EFH.mjs → chunk-XI5H6WLY.mjs} +1 -1
  31. package/dist/{chunk-IF3425JX.mjs → chunk-XREAMNVX.mjs} +1 -1
  32. package/dist/chunk-YSAWXOPE.mjs +1 -0
  33. package/dist/{chunk-2RQDJ5XT.mjs → chunk-Z3NOT3QB.mjs} +1 -1
  34. package/dist/{chunk-XKGBG5FX.mjs → chunk-ZJZ2UMK2.mjs} +1 -1
  35. package/dist/components/Blocks/Banner.mjs +1 -1
  36. package/dist/components/Blocks/CallToAction.mjs +1 -1
  37. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  38. package/dist/components/Blocks/Content.mjs +1 -1
  39. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  40. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  41. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  42. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  43. package/dist/components/Blocks/index.mjs +1 -1
  44. package/dist/components/Cards/ContentCard.mjs +1 -1
  45. package/dist/components/Cards/FeatureCard.mjs +1 -1
  46. package/dist/components/Cards/index.mjs +1 -1
  47. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  48. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +4 -4
  49. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  50. package/dist/components/DigitalColleagues/Views/index.js +4 -4
  51. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  52. package/dist/components/DigitalColleagues/index.js +4 -4
  53. package/dist/components/DigitalColleagues/index.mjs +1 -1
  54. package/dist/components/Foundary/MainPage.mjs +1 -1
  55. package/dist/components/Foundary/Pages/dashboardpage.js +5 -5
  56. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  57. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  58. package/dist/components/Foundary/Views/index.js +5 -5
  59. package/dist/components/Foundary/Views/index.mjs +1 -1
  60. package/dist/components/Foundary/file-edit.js +3 -3
  61. package/dist/components/Foundary/file-edit.mjs +1 -1
  62. package/dist/components/Foundary/index.js +4 -4
  63. package/dist/components/Foundary/index.mjs +1 -1
  64. package/dist/components/Foundary/types.d.ts +1 -0
  65. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  66. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  67. package/dist/components/HeaderFooter/index.mjs +1 -1
  68. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  69. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  70. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  71. package/dist/components/Heros/RenderHero.mjs +1 -1
  72. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  73. package/dist/components/Heros/index.mjs +1 -1
  74. package/dist/components/Holidays/HolidayTracker.js +1 -1
  75. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  76. package/dist/components/Holidays/RequestLeave.js +1 -1
  77. package/dist/components/Holidays/RequestLeave.mjs +1 -1
  78. package/dist/components/Holidays/index.js +1 -1
  79. package/dist/components/Holidays/index.mjs +1 -1
  80. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  81. package/dist/components/Layouts/Print.mjs +1 -1
  82. package/dist/components/Layouts/SlideShow.mjs +1 -1
  83. package/dist/components/Layouts/index.mjs +1 -1
  84. package/dist/components/Other/index.mjs +1 -1
  85. package/dist/components/Payload/RichText/index.mjs +1 -1
  86. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  87. package/dist/components/Payload/index.mjs +1 -1
  88. package/dist/components/Projects/FileView.js +4 -4
  89. package/dist/components/Projects/FileView.mjs +1 -1
  90. package/dist/components/Projects/KanbanBoardView.d.ts +3 -0
  91. package/dist/components/Projects/KanbanBoardView.js +6 -1
  92. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  93. package/dist/components/Projects/ProjectPage.js +4 -4
  94. package/dist/components/Projects/ProjectPage.mjs +1 -1
  95. package/dist/components/Projects/ProjectView.js +4 -4
  96. package/dist/components/Projects/ProjectView.mjs +1 -1
  97. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  98. package/dist/components/Projects/TaskDetailsModal.d.ts +3 -0
  99. package/dist/components/Projects/TaskDetailsModal.js +6 -1
  100. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  101. package/dist/components/Projects/file-list.d.ts +3 -1
  102. package/dist/components/Projects/file-list.js +4 -4
  103. package/dist/components/Projects/file-list.mjs +1 -1
  104. package/dist/components/Projects/index.js +6 -1
  105. package/dist/components/Projects/index.mjs +1 -1
  106. package/dist/components/dc-temp/index.js +5 -5
  107. package/dist/components/dc-temp/index.mjs +1 -1
  108. package/dist/components/index.js +23 -23
  109. package/dist/components/index.mjs +1 -1
  110. package/dist/globals.css +1 -1
  111. package/dist/index.js +33 -33
  112. package/dist/index.mjs +1 -1
  113. package/dist/metafile-cjs.json +1 -1
  114. package/dist/metafile-esm.json +1 -1
  115. package/dist/pages/Blog.mjs +1 -1
  116. package/dist/pages/Documentation.mjs +1 -1
  117. package/dist/pages/IndexPage.mjs +1 -1
  118. package/dist/pages/Intranet.mjs +1 -1
  119. package/dist/pages/LandingPage.mjs +1 -1
  120. package/dist/pages/Page.mjs +1 -1
  121. package/dist/pages/Publish.mjs +1 -1
  122. package/dist/pages/Website.mjs +1 -1
  123. package/dist/sections/AboutSection.mjs +1 -1
  124. package/dist/sections/BlogDetail.mjs +1 -1
  125. package/dist/sections/BlogList.mjs +1 -1
  126. package/dist/sections/ContactSection.mjs +1 -1
  127. package/dist/sections/PageSections.mjs +1 -1
  128. package/dist/sections/PricingSection.mjs +1 -1
  129. package/dist/sections/ServiceDetail.mjs +1 -1
  130. package/dist/sections/ServiceDetailSection.mjs +1 -1
  131. package/dist/sections/ServiceSection.mjs +1 -1
  132. package/dist/sections/index.mjs +1 -1
  133. package/package.json +1 -1
  134. package/dist/chunk-ICFBQXVC.mjs +0 -4
  135. package/dist/chunk-M7KIL6AS.mjs +0 -9
  136. package/dist/chunk-MAAKU7PN.mjs +0 -4
  137. package/dist/chunk-RQLUMNJE.mjs +0 -1
  138. package/dist/chunk-UM57PWI7.mjs +0 -1
@@ -2,9 +2,9 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
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`
5
+ "use strict";"use client";var Xi=Object.create;var Fo=Object.defineProperty;var Yi=Object.getOwnPropertyDescriptor;var Qi=Object.getOwnPropertyNames;var en=Object.getPrototypeOf,tn=Object.prototype.hasOwnProperty;var on=(e,t)=>{for(var o in t)Fo(e,o,{get:t[o],enumerable:!0})},Ua=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Qi(t))!tn.call(e,r)&&r!==o&&Fo(e,r,{get:()=>t[r],enumerable:!(a=Yi(t,r))||a.enumerable});return e};var ue=(e,t,o)=>(o=e!=null?Xi(en(e)):{},Ua(t||!e||!e.__esModule?Fo(o,"default",{value:e,enumerable:!0}):o,e)),an=e=>Ua(Fo({},"__esModule",{value:!0}),e);var As={};on(As,{default:()=>Mi});module.exports=an(As);var fe=require("react");var St=require("lucide-react"),Dt=require("react/jsx-runtime"),rn=[{key:"kanban",icon:St.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:St.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:St.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:St.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:St.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],za=({currentView:e,onViewChange:t,children:o})=>(0,Dt.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Dt.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:rn.map(a=>{let r=a.icon,i=e===a.key;return(0,Dt.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,Dt.jsx)(r,{className:"h-4 w-4 flex-shrink-0"}),(0,Dt.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:a.label})]},a.key)})}),(0,Dt.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Dt.jsx)("div",{className:"w-full h-full",children:o})})]});var pe=ue(require("react"));var Xa=require("class-variance-authority");var qa=require("clsx");var ia="-",nn=e=>{let t=ln(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{let n=s.split(ia);return n[0]===""&&n.length!==1&&n.shift(),Ga(n,t)||sn(s)},getConflictingClassGroupIds:(s,n)=>{let m=o[s]||[];return n&&a[s]?[...m,...a[s]]:m}}},Ga=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?Ga(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(ia);return t.validators.find(({validator:s})=>s(i))?.classGroupId},$a=/^\[(.+)\]$/,sn=e=>{if($a.test(e)){let t=$a.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},ln=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return cn(Object.entries(e.classGroups),o).forEach(([i,s])=>{ra(s,a,i,t)}),a},ra=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:_a(t,r);i.classGroupId=o;return}if(typeof r=="function"){if(dn(r)){ra(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([i,s])=>{ra(s,_a(t,i),o,a)})})},_a=(e,t)=>{let o=e;return t.split(ia).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},dn=e=>e.isThemeGetter,cn=(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,mn=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)}}},ja="!",pn=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,r=t[0],i=t.length,s=n=>{let m=[],u=0,d=0,g;for(let p=0;p<n.length;p++){let b=n[p];if(u===0){if(b===r&&(a||n.slice(p,p+i)===t)){m.push(n.slice(d,p)),d=p+i;continue}if(b==="/"){g=p;continue}}b==="["?u++:b==="]"&&u--}let v=m.length===0?n:n.substring(d),T=v.startsWith(ja),y=T?v.substring(1):v,E=g&&g>d?g-d:void 0;return{modifiers:m,hasImportantModifier:T,baseClassName:y,maybePostfixModifierPosition:E}};return o?n=>o({className:n,parseClassName:s}):s},un=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},gn=e=>({cache:mn(e.cacheSize),parseClassName:pn(e),...nn(e)}),fn=/\s+/,vn=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(fn),n="";for(let m=s.length-1;m>=0;m-=1){let u=s[m],{modifiers:d,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:T}=o(u),y=!!T,E=a(y?v.substring(0,T):v);if(!E){if(!y){n=u+(n.length>0?" "+n:n);continue}if(E=a(v),!E){n=u+(n.length>0?" "+n:n);continue}y=!1}let p=un(d).join(":"),b=g?p+ja:p,z=b+E;if(i.includes(z))continue;i.push(z);let N=r(E,y);for(let C=0;C<N.length;++C){let Y=N[C];i.push(b+Y)}n=u+(n.length>0?" "+n:n)}return n};function hn(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Wa(t))&&(a&&(a+=" "),a+=o);return a}var Wa=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Wa(e[a]))&&(o&&(o+=" "),o+=t);return o};function bn(e,...t){let o,a,r,i=s;function s(m){let u=t.reduce((d,g)=>g(d),e());return o=gn(u),a=o.cache.get,r=o.cache.set,i=n,n(m)}function n(m){let u=a(m);if(u)return u;let d=vn(m,o);return r(m,d),d}return function(){return i(hn.apply(null,arguments))}}var he=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ka=/^\[(?:([a-z-]+):)?(.+)\]$/i,xn=/^\d+\/\d+$/,yn=new Set(["px","full","screen"]),wn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Nn=/\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))\(.+\)$/,Tn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)Dt-?((\d+)?\.?(\d+)[a-z]+|0)/,Dn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kt=e=>to(e)||yn.has(e)||xn.test(e),At=e=>oo(e,"length",In),to=e=>!!e&&!Number.isNaN(Number(e)),aa=e=>oo(e,"number",to),ho=e=>!!e&&Number.isInteger(Number(e)),Sn=e=>e.endsWith("%")&&to(e.slice(0,-1)),G=e=>Ka.test(e),It=e=>wn.test(e),kn=new Set(["length","size","percentage"]),Pn=e=>oo(e,kn,Za),Rn=e=>oo(e,"position",Za),En=new Set(["image","url"]),Mn=e=>oo(e,En,Ln),An=e=>oo(e,"",Fn),bo=()=>!0,oo=(e,t,o)=>{let a=Ka.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},In=e=>Nn.test(e)&&!Cn.test(e),Za=()=>!1,Fn=e=>Tn.test(e),Ln=e=>Dn.test(e);var On=()=>{let e=he("colors"),t=he("spacing"),o=he("blur"),a=he("brightness"),r=he("borderColor"),i=he("borderRadius"),s=he("borderSpacing"),n=he("borderWidth"),m=he("contrast"),u=he("grayscale"),d=he("hueRotate"),g=he("invert"),v=he("gap"),T=he("gradientColorStops"),y=he("gradientColorStopPositions"),E=he("inset"),p=he("margin"),b=he("opacity"),z=he("padding"),N=he("saturate"),C=he("scale"),Y=he("sepia"),M=he("skew"),Q=he("space"),ee=he("translate"),j=()=>["auto","contain","none"],me=()=>["auto","hidden","clip","visible","scroll"],ye=()=>["auto",G,t],I=()=>[G,t],ve=()=>["",kt,At],ke=()=>["auto",to,G],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>["start","end","center","between","around","evenly","stretch"],ce=()=>["","0",G],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>[to,G];return{cacheSize:500,separator:":",theme:{colors:[bo],spacing:[kt,At],blur:["none","",It,G],brightness:w(),borderColor:[e],borderRadius:["none","","full",It,G],borderSpacing:I(),borderWidth:ve(),contrast:w(),grayscale:ce(),hueRotate:w(),invert:ce(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Sn,At],inset:ye(),margin:ye(),opacity:w(),padding:I(),saturate:w(),scale:w(),sepia:ce(),skew:w(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",G]}],container:["container"],columns:[{columns:[It]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"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:[...R(),G]}],overflow:[{overflow:me()}],"overflow-x":[{"overflow-x":me()}],"overflow-y":[{"overflow-y":me()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ho,G]}],basis:[{basis:ye()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",G]}],grow:[{grow:ce()}],shrink:[{shrink:ce()}],order:[{order:["first","last","none",ho,G]}],"grid-cols":[{"grid-cols":[bo]}],"col-start-end":[{col:["auto",{span:["full",ho,G]},G]}],"col-start":[{"col-start":ke()}],"col-end":[{"col-end":ke()}],"grid-rows":[{"grid-rows":[bo]}],"row-start-end":[{row:["auto",{span:[ho,G]},G]}],"row-start":[{"row-start":ke()}],"row-end":[{"row-end":ke()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","Xa",G]}],"auto-rows":[{"auto-rows":["auto","min","max","Xa",G]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...Ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ee(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[z]}],px:[{px:[z]}],py:[{py:[z]}],ps:[{ps:[z]}],pe:[{pe:[z]}],pt:[{pt:[z]}],Xa:[{Xa:[z]}],pb:[{pb:[z]}],pl:[{pl:[z]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",G,t]}],"min-w":[{"min-w":[G,t,"min","max","fit"]}],"max-w":[{"max-w":[G,t,"none","full","min","max","fit","prose",{screen:[It]},It]}],h:[{h:[G,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[G,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[G,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[G,t,"auto","min","max","fit"]}],"font-size":[{text:["base",It,At]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",aa]}],"font-family":[{font:[bo]}],"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",G]}],"line-clamp":[{"line-clamp":["none",to,aa]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",kt,G]}],"list-image":[{"list-image":["none",G]}],"list-style-type":[{list:["none","disc","decimal",G]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",kt,At]}],"underline-offset":[{"underline-offset":["auto",kt,G]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G]}],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",G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),Rn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Pn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","St","b","bl","Dt","tl"]},Mn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[T]}],"gradient-via":[{via:[T]}],"gradient-to":[{to:[T]}],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-Dt":[{"rounded-Dt":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-Dt":[{"rounded-Dt":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-St":[{"rounded-St":[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-Dt":[{"border-Dt":[n]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...J(),"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":[b]}],"divide-style":[{divide:J()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-Dt":[{"border-Dt":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[kt,G]}],"outline-w":[{outline:[kt,At]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[kt,At]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",It,An]}],"shadow-color":[{shadow:[bo]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...ie(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ie()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",It,G]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[g]}],saturate:[{saturate:[N]}],sepia:[{sepia:[Y]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[Y]}],"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",G]}],duration:[{duration:w()}],ease:[{ease:["linear","in","out","in-out",G]}],delay:[{delay:w()}],animate:[{animate:["none","spin","ping","pulse","bounce",G]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[ho,G]}],"translate-x":[{"translate-x":[ee]}],"translate-y":[{"translate-y":[ee]}],"skew-x":[{"skew-x":[M]}],"skew-y":[{"skew-y":[M]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",G]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","Dt-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-Xa":[{"scroll-Xa":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[kt,At,aa]}],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","Xa","pb","pl"],px:["Xa","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-Dt","rounded-ss","rounded-Dt","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-St","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Dt","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-St"],"rounded-b":["rounded-St","rounded-bl"],"rounded-Dt":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-Dt"],"border-w-x":["border-w-r","border-w-Dt"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-Dt"],"border-color-x":["border-color-r","border-color-Dt"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-Xa","scroll-pb","scroll-pl"],"scroll-px":["scroll-Xa","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 Ja=bn(On);function D(...e){return Ja((0,qa.clsx)(e))}var Hn=(0,Xa.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 we({className:e,variant:t,...o}){return(0,Dt.jsx)("div",{className:D(Hn({variant:t}),e),...o})}var zt=ue(require("react"));var be=zt.forwardRef(({className:e,...t},o)=>(0,$t.jsx)("div",{ref:o,className:D("rounded-xl border bg-card text-card-foreground shadow",e),...t}));be.displayName="Card";var Bn=zt.forwardRef(({className:e,...t},o)=>(0,$t.jsx)("div",{ref:o,className:D("flex flex-col space-y-1.5 p-6",e),...t}));Bn.displayName="CardHeader";var Vn=zt.forwardRef(({className:e,...t},o)=>(0,$t.jsx)("div",{ref:o,className:D("font-semibold leading-none tracking-tight",e),...t}));Vn.displayName="CardTitle";var Un=zt.forwardRef(({className:e,...t},o)=>(0,$t.jsx)("div",{ref:o,className:D("text-sm text-muted-foreground",e),...t}));Un.displayName="CardDescription";var ao=zt.forwardRef(({className:e,...t},o)=>(0,$t.jsx)("div",{ref:o,className:D("p-6 pt-0",e),...t}));ao.displayName="CardContent";var zn=zt.forwardRef(({className:e,...t},o)=>(0,$t.jsx)("div",{ref:o,className:D("flex items-center p-6 pt-0",e),...t}));zn.displayName="CardFooter";var Qa=({title:e,status:t,taskCount:o,children:a,onDrop:r,isCompact:i=!1,height:s})=>{let n=d=>{d.preventDefault()},m=d=>{d.preventDefault(),r(t)};return(0,Dt.jsxs)(be,{className:`p-4 bg-card border-Dt-4 ${(()=>{switch(t){case"todo":return"border-Dt-gray-400";case"in-progress":return"border-Dt-blue-500";case"review":return"border-Dt-orange-500";case"done":return"border-Dt-green-500";default:return"border-Dt-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${i?"lg:max-w-xs":""}`,style:{height:s||"calc(100vh - 350px)"},onDragOver:n,onDrop:m,children:[(0,Dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Dt.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${i?"text-base":"text-lg"}`,children:e}),(0,Dt.jsx)(we,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,Dt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:a})]})};var xo=({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"}},m=()=>{switch(e.type){case"story":return(0,Dt.jsx)(St.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Dt.jsx)(St.Bug,{className:"h-3 w-3"});case"spike":return(0,Dt.jsx)(St.Zap,{className:"h-3 w-3"});case"task":default:return(0,Dt.jsx)(St.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,Dt.jsx)(be,{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,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${u()}`,children:m()}),(0,Dt.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Dt.jsxs)(be,{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,Dt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Dt.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${u()}`,children:[m(),(0,Dt.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Dt.jsxs)("div",{className:"flex gap-1",children:[(0,Dt.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,Dt.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,Dt.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Dt.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Dt.jsx)(St.User,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Dt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Dt.jsx)(St.Calendar,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var yo=ue(require("react")),He=ue(require("@radix-Ra/react-dialog"));var Ge=He.Root;var na=He.Portal;var Lo=yo.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(He.Overlay,{ref:o,className:D("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}));Lo.displayName=He.Overlay.displayName;var We=yo.forwardRef(({className:e,children:t,...o},a)=>(0,Dt.jsxs)(na,{children:[(0,Dt.jsx)(Lo,{}),(0,Dt.jsxs)(He.Content,{ref:a,className:D("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Dt.jsxs)(He.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,Dt.jsx)(St.X,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));We.displayName=He.Content.displayName;var Ke=({className:e,...t})=>(0,Dt.jsx)("div",{className:D("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ke.displayName="DialogHeader";var wo=({className:e,...t})=>(0,Dt.jsx)("div",{className:D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});wo.displayName="DialogFooter";var ze=yo.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(He.Title,{ref:o,className:D("text-lg font-semibold leading-none tracking-tight",e),...t}));ze.displayName=He.Title.displayName;var $n=yo.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(He.Description,{ref:o,className:D("text-sm text-muted-foreground",e),...t}));$n.displayName=He.Description.displayName;var tr=require("@radix-Ra/react-slot"),ar=ue(require("react")),No=(0,Xa.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=ar.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...r},i)=>(0,Dt.jsx)(e?tr.Slot:"button",{className:D(No({className:t,size:o,variant:a})),ref:i,...r}));S.displayName="Button";var ir=ue(require("react"));var ne=ir.forwardRef(({className:e,type:t,...o},a)=>(0,Dt.jsx)("input",{type:t,className:D("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}));ne.displayName="Input";var sr=ue(require("react")),Me=sr.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)("textarea",{className:D("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}));Me.displayName="Textarea";var q=ue(require("@radix-Ra/react-select")),Ft=ue(require("react")),Xe=q.Root;var pt=q.Value,Ze=Ft.forwardRef(({children:e,className:t,...o},a)=>(0,Dt.jsxs)(q.Trigger,{className:D("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,Dt.jsx)(q.Icon,{asChild:!0,children:(0,Dt.jsx)(St.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ze.displayName=q.Trigger.displayName;var dr=Ft.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(q.ScrollUpButton,{className:D("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Dt.jsx)(St.ChevronUp,{className:"h-4 w-4"})}));dr.displayName=q.ScrollUpButton.displayName;var cr=Ft.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(q.ScrollDownButton,{className:D("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Dt.jsx)(St.ChevronDown,{className:"h-4 w-4"})}));cr.displayName=q.ScrollDownButton.displayName;var Je=Ft.forwardRef(({children:e,className:t,position:o="popper",...a},r)=>(0,Dt.jsx)(q.Portal,{children:(0,Dt.jsxs)(q.Content,{className:D("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",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,Dt.jsx)(dr,{}),(0,Dt.jsx)(q.Viewport,{className:D("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Dt.jsx)(cr,{})]})}));Je.displayName=q.Content.displayName;var _n=Ft.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(q.Label,{className:D("py-1.5 pl-8 Xa-2 text-sm font-semibold",e),ref:o,...t}));_n.displayName=q.Label.displayName;var xe=Ft.forwardRef(({children:e,className:t,...o},a)=>(0,Dt.jsxs)(q.Item,{className:D("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Xa-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,Dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Dt.jsx)(q.ItemIndicator,{children:(0,Dt.jsx)(St.Check,{className:"h-4 w-4"})})}),(0,Dt.jsx)(q.ItemText,{children:e})]}));xe.displayName=q.Item.displayName;var Gn=Ft.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(q.Separator,{className:D("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Gn.displayName=q.Separator.displayName;var mr=ue(require("react")),sa=ue(require("@radix-Ra/react-label"));var jn=(0,Xa.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),H=mr.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(sa.Root,{ref:o,className:D(jn(),e),...t}));H.displayName=sa.Root.displayName;var jt=ue(require("react")),ro=ue(require("@radix-Ra/react-toggle-group"));var gr=ue(require("react")),la=ue(require("@radix-Ra/react-toggle"));var da=(0,Xa.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"}}),Wn=gr.forwardRef(({className:e,variant:t,size:o,...a},r)=>(0,Dt.jsx)(la.Root,{ref:r,className:D(da({variant:t,size:o,className:e})),...a}));Wn.displayName=la.Root.displayName;var hr=jt.createContext({size:"default",variant:"default"}),Wt=jt.forwardRef(({className:e,variant:t,size:o,children:a,...r},i)=>(0,Dt.jsx)(ro.Root,{ref:i,className:D("flex items-center justify-center gap-1",e),...r,children:(0,Dt.jsx)(hr.Provider,{value:{variant:t,size:o},children:a})}));Wt.displayName=ro.Root.displayName;var Kt=jt.forwardRef(({className:e,children:t,variant:o,size:a,...r},i)=>{let s=jt.useContext(hr);return(0,Dt.jsx)(ro.Item,{ref:i,className:D(da({variant:s.variant||o,size:s.size||a}),e),...r,children:t})});Kt.displayName=ro.Item.displayName;var Kn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:St.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:St.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:St.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:St.Zap}],Zn=[{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"}],io=({isOpen:e,onClose:t,onAddTask:o,epics:a,sprints:r,assignees:i,defaultEpicId:s})=>{let[n,m]=(0,fe.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,fe.useEffect)(()=>{e&&s&&m(g=>({...g,epic:s}))},[e,s]),(0,fe.useEffect)(()=>{e&&m({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}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"",assignee:""}),t())},d=(g,v)=>{m(T=>({...T,[g]:v}))};return(0,Dt.jsx)(Ge,{open:e,onOpenChange:t,children:(0,Dt.jsxs)(We,{className:"sm:max-w-md",children:[(0,Dt.jsx)(Ke,{children:(0,Dt.jsx)(ze,{children:"Add New Task"})}),(0,Dt.jsxs)("form",{onSubmit:u,className:"space-y-4",children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"name",children:"Task Title"}),(0,Dt.jsx)(ne,{id:"name",value:n.name,onChange:g=>d("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Dt.jsx)(Me,{id:"description",value:n.description,onChange:g=>d("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"Type"}),(0,Dt.jsx)(Wt,{type:"single",value:n.type||"",onValueChange:g=>g&&d("type",g),children:Kn.map(g=>{let v=g.icon;return(0,Dt.jsxs)(Kt,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Dt.jsx)(v,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"Priority"}),(0,Dt.jsx)(Wt,{type:"single",value:n.priority||"",onValueChange:g=>g&&d("priority",g),children:Zn.map(g=>(0,Dt.jsx)(Kt,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"points",children:"Story Points"}),(0,Dt.jsx)(ne,{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,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"epic",children:"Epic"}),(0,Dt.jsxs)(Xe,{value:n.epic,onValueChange:g=>d("epic",g),children:[(0,Dt.jsx)(Ze,{children:(0,Dt.jsx)(pt,{placeholder:"Select an epic"})}),(0,Dt.jsx)(Je,{children:a.map(g=>(0,Dt.jsx)(xe,{value:g.id.toString(),children:(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Dt.jsxs)(Xe,{value:n.sprint,onValueChange:g=>d("sprint",g),children:[(0,Dt.jsx)(Ze,{children:(0,Dt.jsx)(pt,{placeholder:"Select a sprint"})}),(0,Dt.jsxs)(Je,{children:[(0,Dt.jsx)(xe,{value:"none",children:"No Sprint"}),r.map(g=>(0,Dt.jsx)(xe,{value:g.id.toString(),children:(0,Dt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"sprint",children:"Assignee"}),(0,Dt.jsxs)(Xe,{value:n.assignee,onValueChange:g=>d("assignee",g),children:[(0,Dt.jsx)(Ze,{children:(0,Dt.jsx)(pt,{placeholder:"Select an Assignee"})}),(0,Dt.jsxs)(Je,{children:[(0,Dt.jsx)(xe,{value:"none",children:"No Assignee"}),i.map(g=>(0,Dt.jsx)(xe,{value:g.id.toString(),children:(0,Dt.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Dt.jsxs)(wo,{children:[(0,Dt.jsx)(S,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Dt.jsx)(S,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var To=({fieldName:e,value:t,label:o,multiline:a=!1,onSave:r,className:i="",disabled:s=!1})=>{let[n,m]=(0,fe.useState)(!1),[u,d]=(0,fe.useState)(""),g=()=>{s||(m(!0),d(t))},v=async()=>{u!==t&&await r(e,u),m(!1)},T=y=>{y.key==="Enter"&&!a||y.key==="Enter"&&y.ctrlKey&&a?v():y.key==="Escape"&&(m(!1),d(""))};return(0,Dt.jsxs)("div",{className:`space-y-2 ${i}`,children:[(0,Dt.jsx)(H,{children:o}),n?a?(0,Dt.jsx)(Me,{value:u,onChange:y=>d(y.target.value),onBlur:v,onKeyDown:T,autoFocus:!0,rows:4,className:"resize-none"}):(0,Dt.jsx)(ne,{value:u,onChange:y=>d(y.target.value),onBlur:v,onKeyPress:T,autoFocus:!0,className:"text-lg font-medium"}):(0,Dt.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,Dt.jsx)("span",{className:a?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!s&&(0,Dt.jsx)(St.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Ho=ue(require("react")),Rt=ue(require("@radix-Ra/react-avatar"));var ma=Ho.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(Rt.Root,{ref:o,className:D("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ma.displayName=Rt.Root.displayName;var Jn=Ho.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(Rt.Image,{ref:o,className:D("aspect-square h-full w-full",e),...t}));Jn.displayName=Rt.Image.displayName;var pa=Ho.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(Rt.Fallback,{ref:o,className:D("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));pa.displayName=Rt.Fallback.displayName;var yr=({comments:e,onAddComment:t})=>{let[o,a]=(0,fe.useState)(""),r=s=>s.split(" ").map(n=>n[0]).join("").toUpperCase(),i=()=>{o.trim()&&(t(o),a(""))};return(0,Dt.jsxs)("div",{className:"space-y-4",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)(St.MessageSquare,{className:"h-5 w-5"}),(0,Dt.jsx)(H,{className:"text-lg font-medium",children:"Comments"}),(0,Dt.jsx)(we,{variant:"secondary",children:e.length})]}),(0,Dt.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(s=>(0,Dt.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Dt.jsx)(ma,{className:"h-8 w-8 mt-1",children:(0,Dt.jsx)(pa,{className:"text-xs bg-muted text-muted-foreground",children:r(s.author)})}),(0,Dt.jsxs)("div",{className:"flex-1",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Dt.jsx)("span",{className:"font-medium text-sm",children:s.author}),(0,Dt.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.createdAt.toLocaleDateString()," Dt ",s.createdAt.toLocaleTimeString()]})]}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground",children:s.text})]})]},s.id))}),(0,Dt.jsxs)("div",{className:"flex gap-2",children:[(0,Dt.jsx)(Me,{value:o,onChange:s=>a(s.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Dt.jsx)(S,{onClick:i,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,Dt.jsx)(St.Send,{className:"h-4 w-4"})})]})]})};var Uo=({label:e,value:t,onValueChange:o,options:a,showColor:r=!1,disabled:i=!1})=>{let[s,n]=(0,fe.useState)(!1),m=a.find(d=>d.value===t);return(0,Dt.jsxs)("div",{className:"space-y-1",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:e}),(0,Dt.jsxs)(Xe,{value:t,onValueChange:o,open:s,onOpenChange:d=>{i||n(d)},disabled:i,children:[(0,Dt.jsx)(Ze,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Dt.jsxs)(we,{variant:"secondary",className:`${i?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!i&&n(!s),children:[r&&m?.color&&(0,Dt.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} mr-1`}),m?.label||"Select..."]})}),(0,Dt.jsx)(Je,{children:a.map(d=>(0,Dt.jsx)(xe,{value:d.value,children:r&&d.color?(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var Nr=({label:e,value:t,onValueChange:o,options:a,placeholder:r="Search...",allowCustomValue:i=!1,disabled:s=!1})=>{let[n,m]=(0,fe.useState)(!1),[u,d]=(0,fe.useState)(""),g=a.find(p=>p.value===t),v=a.filter(p=>p.label.toLowerCase().includes(u.toLowerCase())),T=p=>{o(p),m(!1),d("")},y=()=>{i&&u.trim()&&!a.find(p=>p.value===u.trim())&&(o(u.trim()),m(!1),d(""))};return(0,Dt.jsxs)("div",{className:"space-y-1",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:e}),(0,Dt.jsxs)(Xe,{value:t,onValueChange:T,open:n,onOpenChange:p=>{s||m(p)},disabled:s,children:[(0,Dt.jsx)(Ze,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Dt.jsx)(we,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&m(!n),children:g?.label||t||"Select..."})}),(0,Dt.jsxs)(Je,{children:[(0,Dt.jsx)("div",{className:"p-2",children:(0,Dt.jsx)(ne,{placeholder:r,value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&i&&y()},className:"mb-2"})}),v.map(p=>(0,Dt.jsx)(xe,{value:p.value,children:p.label},p.value)),i&&u.trim()&&!v.find(p=>p.value===u.trim())&&(0,Dt.jsxs)(xe,{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 qn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:St.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:St.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:St.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:St.Zap}],Xn=[{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 Cr=({task:e,epics:t,sprints:o,lastUpdated:a,onUpdateTask:r,onClose:i,onDelete:s,isUpdating:n=!1,isDeleting:m=!1,deleteState:u="idle",teamMembers:d})=>{let[g,v]=(0,fe.useState)(e.storyPoints),T=(0,fe.useRef)(null),[y,E]=(0,fe.useState)(d);(0,fe.useEffect)(()=>{E(d)},[d]);let p=(0,fe.useCallback)((N,C)=>{T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{r(N,C)},500)},[r]);(0,fe.useEffect)(()=>{p("storyPoints",g?.toString()||"1")},[g]);let b=N=>N.split(" ").map(C=>C[0]).join("").toUpperCase(),z=()=>u==="loading"?(0,Dt.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Dt.jsx)(St.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):u==="success"?(0,Dt.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Dt.jsx)(St.Check,{className:"h-3 w-3"}),"Deleted"]}):u==="error"?(0,Dt.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Dt.jsx)(St.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Dt.jsxs)(S,{onClick:s,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||m,children:[(0,Dt.jsx)(St.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Dt.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Dt.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Dt.jsx)(Uo,{label:"",value:e.status,onValueChange:N=>r("status",N),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Dt.jsx)(Wt,{type:"single",value:e.type||"",onValueChange:N=>N&&r("type",N),className:"grid grid-cols-2 gap-1",disabled:n,children:qn.map(N=>{let C=N.icon;return(0,Dt.jsxs)(Kt,{value:N.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:[(0,Dt.jsx)(C,{className:"h-3 w-3"}),N.label]},N.value)})})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Dt.jsx)(Wt,{type:"single",value:e.priority||"",onValueChange:N=>N&&r("priority",N),className:"grid grid-cols-3 gap-1",disabled:n,children:Xn.map(N=>(0,Dt.jsx)(Kt,{value:N.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:N.label},N.value))})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Dt.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:N=>{let C=Number(N.target.value);C<1?v(1):C>100?v(100):v(C)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Dt.jsx)(Uo,{label:"",value:Re(e.epic).toString(),onValueChange:N=>r("epic",N),options:(t||[]).map(N=>({value:N.id.toString(),label:N?.name,color:N.color})),showColor:!0,disabled:n})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Dt.jsx)(Uo,{label:"",value:Re(e.sprint).toString()||"none",onValueChange:N=>r("sprint",N==="none"?"":N),options:[{value:"none",label:"No Sprint"},...(o||[]).map(N=>({value:N.id.toString(),label:`${N?.name}`}))],disabled:n})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Dt.jsx)(Nr,{label:"",value:e.assignee?.value?.name,onValueChange:N=>r("assignee",N),options:y.map(N=>({value:`${typeof N.email=="string"?"users":"digital-colleagues"}:${N.id}`,label:N?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,Dt.jsxs)("div",{className:"mt-auto pt-4 space-y-4",children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(S,{onClick:i,variant:"outline",className:"w-full h-8 text-xs",disabled:n||m,children:"Close"}),z()]}),(0,Dt.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Dt.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Dt.jsx)(St.User,{className:"h-3 w-3"}),(0,Dt.jsx)("span",{children:"System"})]})]}),(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Dt.jsx)(St.Calendar,{className:"h-3 w-3"}),(0,Dt.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Dt.jsx)(St.Clock,{className:"h-3 w-3"}),(0,Dt.jsxs)("span",{children:[new Date(a).toLocaleDateString()," Dt"," ",new Date(a).toLocaleTimeString()]})]})]})]})]})]})};var Ra=require("motion/react");var vi=ue(require("@radix-Ra/react-dialog"));var qr=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),Xr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),Yr=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),Qr=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),ei=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),ti=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),oi=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),Wo=require("@payloadcms/richtext-lexical/lexical/list"),ai=require("@payloadcms/richtext-lexical/lexical/rich-text"),ri=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Zr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Ro=require("@payloadcms/richtext-lexical/lexical/utils"),W=require("@payloadcms/richtext-lexical/lexical"),Ta=require("@payloadcms/richtext-lexical/lexical/selection");var Fr=require("@radix-Ra/react-dialog"),Go=require("@payloadcms/richtext-lexical/client");var fa=ue(require("bson-objectid"));var Dr=require("@payloadcms/Ra");var Tr=ue(require("react")),ut=ue(require("@radix-Ra/react-tooltip"));var zo=ut.Provider,$o=ut.Root,_o=ut.Trigger,Do=Tr.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Dt.jsx)(ut.Portal,{children:(0,Dt.jsx)(ut.Content,{ref:a,sideOffset:t,className:D("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Do.displayName=ut.Content.displayName;var Yn=e=>{let{data:{relationTo:t,value:o},nodeKey:a}=e,[r]=(0,Zr.useLexicalComposerContext)(),[i,s]=(0,fe.useState)(""),[n,m]=(0,fe.useState)(""),[u,d]=(0,fe.useState)(""),g=async p=>{console.log("fetchMedia",p)};(0,fe.useEffect)(()=>{typeof o=="string"?o.length===24?g(o):(s(o||""),d(E(y())),m(T()||"")):typeof o=="object"&&(s(`${process.env.NEXT_PUBLIC_API_URL}${o.url}`||""),d(E(o.filesize)),m(o.mimeType?.split("/")[1]||""))},[]);let v=(0,fe.useCallback)(()=>{r.update(()=>{(0,W.$getNodeByKey)(a)?.remove()})},[r,a]),T=()=>{let p=e.data.value;return typeof p=="string"?p.split(";base64")[0]?.split("image/")[1]:""},y=()=>{let p=e.data.value;if(typeof p=="string"){let b=p.split(",")[1]?.length||0;return 4*Math.ceil(b/3)*.5624896334383812/1e3}return 0};function E(p){if(p>=1e6){let z=p/1e6;return`${z>=10?Math.round(z).toString():z.toFixed(1)} MB`}return`${Math.floor(p/1e3)} KB`}return(0,Dt.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Dt.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Dt.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Dt.jsx)("div",{className:"flex-1",children:e.data.value?(0,Dt.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,Dt.jsx)(Dr.File,{})}),(0,Dt.jsx)(zo,{children:(0,Dt.jsxs)($o,{children:[(0,Dt.jsxs)(_o,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Dt.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Dt.jsx)("button",{onClick:p=>{p.preventDefault(),v()},className:"flex-1 flex justify-center items-center",children:(0,Dt.jsx)(St.X,{width:24,height:24,strokeWidth:1})})]}),(0,Dt.jsx)(Do,{children:(0,Dt.jsx)("span",{children:"Remove image"})})]})})]}),(0,Dt.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Dt.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,Dt.jsx)("span",{children:u})]})]})})},Rr=Yn;function Qn(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:no({fields:{},relationTo:"media",value:o})}}return e.src.startsWith("file:///"),null}var So=class extends Go.UploadNode{static importDOM(){return{img:()=>({conversion:Qn,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new fa.default().toHexString(),t.version=3);let o={id:t.id??new fa.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},a=no(o);return a.setFormat?.(t.format),a}decorate(){return(0,Dt.jsx)(Rr,{data:this.__data,nodeKey:this.getKey()})}};function no(e){return new So({data:e})}var es=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ts=e=>es?(e||window).getSelection():null,Ud=(0,W.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),va=(0,W.createCommand)("INSERT_UPLOAD_COMMAND");function Lr({activeEditor:e,onClose:t,isOpen:o=!1}){let a=(0,fe.useRef)(!1),[r,i]=(0,fe.useState)(!0),[s,n]=(0,fe.useState)(""),[m,u]=(0,fe.useState)(""),[d,g]=(0,fe.useState)(!1),[v,T]=(0,fe.useState)("left"),y=s==="",E=C=>{g(C.target.checked)},p=C=>{T(C.target.value)},b=C=>{let Y=new FileReader;Y.onload=function(){return typeof Y.result=="string"&&n(Y.result),""},C!==null&&C[0]&&Y.readAsDataURL(C[0])};(0,fe.useEffect)(()=>{a.current=!1;let C=Y=>{a.current=Y.altKey};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}},[e]),(0,fe.useEffect)(()=>{r||t()},[r]),(0,fe.useEffect)(()=>{i(o)},[o]);let z=({editor:C,relationTo:Y,replaceNodeKey:M,value:Q})=>{if(M)C.update(()=>{let ee=(0,W.$getNodeByKey)(M);ee&&ee.replace(no({id:"",fields:{},relationTo:"media",value:Q}))});else{let ee=C.dispatchCommand(va,{fields:null,relationTo:"media",value:Q})}},N=()=>{z({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:s,showCaption:d,position:v}.src}),i(!1),t()};return(0,Dt.jsx)(Ge,{open:r,onOpenChange:C=>i(C),children:(0,Dt.jsxs)(We,{children:[(0,Dt.jsxs)(Ke,{children:[(0,Dt.jsx)(ze,{children:"Upload Image"}),(0,Dt.jsx)(Fr.DialogDescription,{children:"Description"})]}),(0,Dt.jsxs)("div",{className:"",children:[(0,Dt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Dt.jsx)(ne,{type:"file",onChange:C=>b(C.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Dt.jsx)("div",{style:{marginBottom:"1em"},children:(0,Dt.jsx)(ne,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:C=>u(C.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,Dt.jsx)(S,{"data-test-id":"image-modal-file-upload-btn",disabled:y,onClick:()=>N(),children:"Confirm"})]})]})})}function ha({captionsEnabled:e}){let[t]=(0,Zr.useLexicalComposerContext)();return(0,fe.useEffect)(()=>{if(!t.hasNodes([Go.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Ro.mergeRegister)(t.registerCommand(W.DRAGSTART_COMMAND,o=>os(o),W.COMMAND_PRIORITY_HIGH),t.registerCommand(W.DRAGOVER_COMMAND,o=>as(o),W.COMMAND_PRIORITY_LOW),t.registerCommand(W.DROP_COMMAND,o=>rs(o,t),W.COMMAND_PRIORITY_HIGH))},[e,t]),null}function os(e){if(!ba())return!1;let o=e.dataTransfer;return o?(o.setData("text/plain","Dt"),!0):!1}function as(e){return ba()?(Or(e)||e.preventDefault(),!0):!1}function rs(e,t){let o=ba();if(!o)return!1;if(e.preventDefault(),Or(e)){let a=is(e);o.remove();let r=(0,W.$createRangeSelection)();a!=null&&r.applyDOMRange(a),(0,W.$setSelection)(r)}return!0}function ba(){let e=(0,W.$getSelection)();if(!(0,W.$isNodeSelection)(e))return null;let o=e.getNodes()[0];return(0,Go.$isUploadNode)(o)?o:null}function Or(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 is(e){let t,o=e.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,r=ts(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 ns=()=>(0,Dt.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,Dt.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"})}),Hr=ns;var ss=()=>(0,Dt.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,Dt.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"})}),Br=ss;var ls=()=>(0,Dt.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,Dt.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,Dt.jsx)("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),Vr=ls;var ds=()=>(0,Dt.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,Dt.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,Dt.jsx)("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),Ur=ds;var cs=()=>(0,Dt.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,Dt.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"})}),zr=cs;var ms=()=>(0,Dt.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,Dt.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"})}),$r=ms;var _r=()=>(0,Dt.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,Dt.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"})}),Gr=()=>(0,Dt.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,Dt.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"})}),jr=()=>(0,Dt.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,Dt.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"})}),Wr=()=>(0,Dt.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,Dt.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"})}),Kr=()=>(0,Dt.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,Dt.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 Et=ue(require("react")),X=ue(require("@radix-Ra/react-dropdown-menu")),so=require("@radix-Ra/react-icons");var lo=X.Root,co=X.Trigger;var ps=Et.forwardRef(({className:e,inset:t,children:o,...a},r)=>(0,Dt.jsxs)(X.SubTrigger,{ref:r,className:D("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,Dt.jsx)(so.ChevronRightIcon,{className:"ml-auto"})]}));ps.displayName=X.SubTrigger.displayName;var us=Et.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(X.SubContent,{ref:o,className:D("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}));us.displayName=X.SubContent.displayName;var Zt=Et.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Dt.jsx)(X.Portal,{children:(0,Dt.jsx)(X.Content,{ref:a,sideOffset:t,className:D("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),...o})}));Zt.displayName=X.Content.displayName;var Jt=Et.forwardRef(({className:e,inset:t,...o},a)=>(0,Dt.jsx)(X.Item,{ref:a,className:D("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}));Jt.displayName=X.Item.displayName;var gs=Et.forwardRef(({className:e,children:t,checked:o,...a},r)=>(0,Dt.jsxs)(X.CheckboxItem,{ref:r,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Xa-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,Dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Dt.jsx)(X.ItemIndicator,{children:(0,Dt.jsx)(so.CheckIcon,{className:"h-4 w-4"})})}),t]}));gs.displayName=X.CheckboxItem.displayName;var fs=Et.forwardRef(({className:e,children:t,...o},a)=>(0,Dt.jsxs)(X.RadioItem,{ref:a,className:D("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Xa-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,Dt.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Dt.jsx)(X.ItemIndicator,{children:(0,Dt.jsx)(so.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));fs.displayName=X.RadioItem.displayName;var vs=Et.forwardRef(({className:e,inset:t,...o},a)=>(0,Dt.jsx)(X.Label,{ref:a,className:D("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));vs.displayName=X.Label.displayName;var hs=Et.forwardRef(({className:e,...t},o)=>(0,Dt.jsx)(X.Separator,{ref:o,className:D("-mx-1 my-1 h-px bg-muted",e),...t}));hs.displayName=X.Separator.displayName;var bs=({className:e,...t})=>(0,Dt.jsx)("span",{className:D("ml-auto text-xs tracking-widest opacity-60",e),...t});bs.displayName="DropdownMenuShortcut";var Ca=1;function xs(){return(0,Dt.jsx)("span",{className:"border border-[#222222]"})}function Da(){let[e]=(0,Zr.useLexicalComposerContext)(),t=(0,fe.useRef)(null),[o,a]=(0,fe.useState)(!1),[r,i]=(0,fe.useState)(!1),[s,n]=(0,fe.useState)(!1),[m,u]=(0,fe.useState)(!1),[d,g]=(0,fe.useState)(!1),[v,T]=(0,fe.useState)(!1),[y,E]=(0,fe.useState)(!1),[p,b]=(0,fe.useState)(!1),[z,N]=(0,fe.useState)(!1),[C,Y]=(0,fe.useState)("left"),[M,Q]=(0,fe.useState)("p"),ee=R=>{e.update(()=>{let J=(0,W.$getSelection)();(0,W.$isRangeSelection)(J)&&(R==="p"?(0,Ta.$setBlocksType)(J,()=>(0,W.$createParagraphNode)()):(0,Ta.$setBlocksType)(J,()=>(0,ai.$createHeadingNode)(R)))})},j=(0,fe.useCallback)(()=>{let R=(0,W.$getSelection)();if((0,W.$isRangeSelection)(R)){n(R.hasFormat("bold")),u(R.hasFormat("italic")),g(R.hasFormat("underline")),T(R.hasFormat("strikethrough")),E(R.hasFormat("subscript")),b(R.hasFormat("superscript"));let J=R.anchor.getNode(),ie=J;for(;ie&&!(0,W.$isParagraphNode)(ie)&&ie!==(0,W.$getRoot)();){let ce=ie.getParent();ce&&(ie=ce)}if(ie){let ce=ie.getFormatType();Y(ce||"left")}let Ee=J.getTopLevelElement()?.__tag;Q(Ee||"p")}},[]);(0,fe.useEffect)(()=>(0,Ro.mergeRegister)(e.registerUpdateListener(({editorState:R})=>{R.read(()=>{j()})}),e.registerCommand(W.SELECTION_CHANGE_COMMAND,(R,J)=>(j(),!1),Ca),e.registerCommand(W.CAN_UNDO_COMMAND,R=>(a(R),!1),Ca),e.registerCommand(W.CAN_REDO_COMMAND,R=>(i(R),!1),Ca),(0,Ro.mergeRegister)(e.registerCommand(va,R=>(e.update(()=>{let J=(0,W.$getSelection)()||(0,W.$getPreviousSelection)();if((0,W.$isRangeSelection)(J)){let ie=no({id:R.id,fields:R.fields,relationTo:R.relationTo,value:R.value}),{focus:Ee}=J,ce=Ee.getNode();(0,Ro.$insertNodeToNearestRoot)(ie),(0,W.$isParagraphNode)(ce)&&!ce.__first&&ce.remove()}}),!0),W.COMMAND_PRIORITY_EDITOR))),[e,j]);let me=[[{label:"Undo",icon:(0,Dt.jsx)(St.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(W.UNDO_COMMAND,void 0)},disabled:!o},{label:"Redo",icon:(0,Dt.jsx)(St.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(W.UNDO_COMMAND,void 0)},disabled:!r}],[{label:"Bold",icon:(0,Dt.jsx)(Hr,{}),onClick:()=>{e.dispatchCommand(W.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:s},{label:"Italic",icon:(0,Dt.jsx)(Br,{}),onClick:()=>{e.dispatchCommand(W.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,Dt.jsx)(Vr,{}),onClick:()=>{e.dispatchCommand(W.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:d},{label:"Strikethrough",icon:(0,Dt.jsx)(Ur,{}),onClick:()=>{e.dispatchCommand(W.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:v},{label:"Subscript",icon:(0,Dt.jsx)(zr,{}),onClick:()=>{e.dispatchCommand(W.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:y},{label:"Superscript",icon:(0,Dt.jsx)($r,{}),onClick:()=>{e.dispatchCommand(W.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:p}]],ye=[{label:"Left Align",direction:"left",icon:(0,Dt.jsx)(St.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(W.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Dt.jsx)(St.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(W.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Dt.jsx)(St.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(W.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Dt.jsx)(St.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(W.FORMAT_ELEMENT_COMMAND,"justify")}}],ve=[{label:"Normal Text",value:"p",icon:(0,Dt.jsx)(_r,{}),onClick:()=>ee("p")},{label:"Heading 1",value:"h1",icon:(0,Dt.jsx)(Gr,{}),onClick:()=>ee("h1")},{label:"Heading 2",value:"h2",icon:(0,Dt.jsx)(jr,{}),onClick:()=>ee("h2")},{label:"Heading 3",value:"h3",icon:(0,Dt.jsx)(Wr,{}),onClick:()=>ee("h3")},{label:"Heading 4",value:"h4",icon:(0,Dt.jsx)(Kr,{}),onClick:()=>ee("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Dt.jsx)(St.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Wo.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Dt.jsx)(St.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Wo.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],ke=[{label:"Insert Image",icon:(0,Dt.jsx)(St.ImageUp,{width:15,height:15}),onClick:()=>{N(!0)},disabled:!1}];return(0,Dt.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,Dt.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[me.map((R,J)=>(0,Dt.jsxs)(fe.Fragment,{children:[(0,Dt.jsx)("div",{className:"flex items-center gap-2",children:R.map((ie,Ee)=>(0,Dt.jsx)("div",{role:"button","aria-disabled":ie.disabled||!1,onClick:ie.onClick,className:D("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]",ie.active&&"bg-[#3c3c3c]"),"aria-label":ie.label,children:(0,Dt.jsx)(zo,{children:(0,Dt.jsxs)($o,{children:[(0,Dt.jsx)(_o,{className:"text-[#b5b5b5]",children:ie.icon}),(0,Dt.jsx)(Do,{children:(0,Dt.jsx)("p",{children:ie.label})})]})})},Ee))}),(0,Dt.jsx)(xs,{})]},`toolbar-option-${R.length}-${J}`)),(0,Dt.jsxs)(lo,{children:[(0,Dt.jsxs)(co,{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:[ye.find(R=>R.direction===C)?.icon,ye.find(R=>R.direction===C)?.label,(0,Dt.jsx)(St.ChevronDown,{width:15,height:15})]}),(0,Dt.jsx)(Zt,{className:"bg-black hover:bg-black",children:ye.map((R,J)=>(0,Dt.jsxs)(Jt,{onClick:R.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,Dt.jsx)("span",{children:R.icon}),(0,Dt.jsx)("span",{children:R.label})]},`${R.label}-${J}`))})]}),(0,Dt.jsxs)(lo,{children:[(0,Dt.jsxs)(co,{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:[ve.find(R=>R.value===M)?.icon,ve.find(R=>R.value===M)?.label,(0,Dt.jsx)(St.ChevronDown,{width:15,height:15})]}),(0,Dt.jsx)(Zt,{className:"bg-black hover:bg-black",children:ve.map((R,J)=>(0,Dt.jsxs)(Jt,{onClick:R.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,Dt.jsx)("span",{children:R.icon}),(0,Dt.jsx)("span",{children:R.label})]},`heading-option-${R.label}-${J}`))})]}),(0,Dt.jsxs)(lo,{children:[(0,Dt.jsxs)(co,{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,Dt.jsx)(St.Plus,{width:15,height:15}),(0,Dt.jsx)(St.ChevronDown,{width:15,height:15})]}),(0,Dt.jsx)(Zt,{className:"bg-black hover:bg-black",children:ke.map((R,J)=>(0,Dt.jsxs)(Jt,{onClick:R.onClick,disabled:R.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,Dt.jsx)("span",{children:R.icon}),(0,Dt.jsx)("span",{children:R.label})]},J))})]}),z&&(0,Dt.jsx)(Lr,{activeEditor:e,onClose:()=>{N(!1)},isOpen:z})]})})}var ys=({setValue:e,value:t,name:o,editable:a=!0})=>{let[r]=(0,Zr.useLexicalComposerContext)(),i=(0,fe.useRef)(null),s=n=>{n.read(()=>{let m=n.toJSON();JSON.stringify(m)!==JSON.stringify(i.current)&&(i.current=m,e?.(()=>m))})};return(0,fe.useEffect)(()=>{r.setEditable(a)},[a,r]),(0,fe.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,$e.jsx)("div",{className:"w-full",children:(0,$e.jsxs)("div",{className:" ",children:[a&&(0,$e.jsx)(Da,{}),(0,$e.jsxs)("div",{className:"px-4 my-4 border-Dt border-[#222222]",children:[(0,$e.jsx)(ti.RichTextPlugin,{contentEditable:(0,$e.jsx)(Yr.ContentEditable,{name:o,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:Qr.LexicalErrorBoundary}),a&&(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(ei.HistoryPlugin,{}),(0,$e.jsx)(qr.AutoFocusPlugin,{}),(0,$e.jsx)(oi.ListPlugin,{}),(0,$e.jsx)(ri.OnChangePlugin,{onChange:s}),(0,$e.jsx)(ha,{})]})]})]})})},ws=({setValue:e,value:t,name:o,editable:a=!0})=>(0,$e.jsx)(Xr.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[Wo.ListNode,Wo.ListItemNode,ai.HeadingNode,So],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,$e.jsx)(ys,{value:t,setValue:e,name:o,editable:a})}),ni=ws;var si=ue(require("react")),ht=ue(require("@radix-Ra/react-popover"));var ka=ht.Root,Pa=ht.Trigger;var Ko=si.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},r)=>(0,Dt.jsx)(ht.Portal,{children:(0,Dt.jsx)(ht.Content,{ref:r,align:t,sideOffset:o,className:D("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),...a})}));Ko.displayName=ht.Content.displayName;var li=require("react-day-picker");function Zo({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,Dt.jsx)(li.DayPicker,{showOutsideDays:o,weekStartsOn:1,className:D("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:D(No({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:D("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",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-Dt-md first:[&:has([aria-selected])]:rounded-Dt-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:D(No({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 qt=ue(require("@radix-Ra/react-tabs"));function ci({className:e,...t}){return(0,Dt.jsx)(qt.Root,{"data-slot":"tabs",className:D("flex flex-col gap-2",e),...t})}function mi({className:e,...t}){return(0,Dt.jsx)(qt.List,{"data-slot":"tabs-list",className:D("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function pi({className:e,...t}){return(0,Dt.jsx)(qt.Trigger,{"data-slot":"tabs-trigger",className:D("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 Mo=e=>"mimeType"in e&&"url"in e&&!("format"in e),Ns=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,m)=>{if(n.type==="listitem"){let u=a(n.children||[]),d=r.listType==="number"?`${m+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,m=(r.format&4)!==0,u=(r.format&8)!==0;(r.format&16)!==0?i=`\`${i}\``:(s&&(i=`**${i}**`),n&&(i=`*${i}*`),m&&(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,m=(i.format&2)!==0,u=(i.format&4)!==0,d=(i.format&8)!==0;(i.format&16)!==0?s=`\`${s}\``:(n&&(s=`**${s}**`),m&&(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
7
  `}return o(i)}).filter(Boolean).join("");return e.root.children.forEach(r=>{let i=o(r);i&&t.push(i)}),t.join(`
8
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})]})}
9
+ `)},Xt=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 v=r[1]||"",T=v?Xt(v):[];T.length>0?(T.forEach(y=>{y.type==="text"&&(y.format=(y.format||0)|8)}),t.push(...T)):v===""&&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 v=i[2];v&&t.push({type:"text",text:v,format:16}),o+=i[0].length;continue}let s=e.slice(o).match(/^(~~)(.+?)\1/);if(s){let v=s[2],T=Xt(v);T.forEach(y=>{y.type==="text"&&(y.format=(y.format||0)|4)}),t.push(...T),o+=s[0].length;continue}let n=e.slice(o).match(/^(\*\*|__)(.+?)\1/);if(n){let v=n[2],T=Xt(v);T.forEach(y=>{y.type==="text"&&(y.format=(y.format||0)|1)}),t.push(...T),o+=n[0].length;continue}let m=e.slice(o).match(/^(\*|Dt)([^*Dt\n]+?)\1(?!\*|Dt)/);if(m&&m[0].length>2){let v=m[2],T=Xt(v);T.forEach(y=>{y.type==="text"&&(y.format=(y.format||0)|2)}),t.push(...T),o+=m[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:/Dt[^Dt\n]/,offset:0}];for(let{pattern:v}of d){let T=e.slice(o+1).search(v);T!==-1&&T+1<u-o&&(u=o+T+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}]},Cs=e=>{let t=e.split(`
10
+ `),o=[],a=[],r=[],i=()=>{if(a.length>0){let n=a.join(" "),m=Xt(n);o.push({type:"paragraph",children:m.length>0?m:[{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 m=n.trim();if(!m){i(),s();continue}let u=m.match(/^(#{1,6})\s+(.+)$/);if(u){i(),s();let g=u[1].length,v=u[2],T=Xt(v);o.push({type:"heading",tag:`h${g}`,children:T.length>0?T:[{type:"text",text:"",format:0}]});continue}let d=m.match(/^[-*+]\s+(.+)$/);if(d){i();let g=d[1],v=Xt(g);r.push({type:"listitem",children:[{type:"paragraph",children:v.length>0?v:[{type:"text",text:"",format:0}]}]});continue}r.length>0&&s(),a.push(m)}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}}},Ts=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);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){console.error("Failed to fetch file content:",r)}else console.warn("No URL provided for file:",e.name);return e.mimeType==="text/markdown"?(a="richText",o=Cs(t)):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 gi({document:e,onCancel:t,onSave:o,onFileUpdate:a}){let[r,i]=(0,fe.useState)(Mo(e)),[s,n]=(0,fe.useState)(Mo(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}),[m,u]=(0,fe.useState)(Mo(e)?void 0:s.richTextContent),[d,g]=(0,fe.useState)(!1),v=(0,fe.useRef)(Mo(e)?e:null);(0,fe.useEffect)(()=>{Mo(e)?(i(!0),Ts(e).then(p=>{n(p),u(p.richTextContent),i(!1)}).catch(p=>{p instanceof Error&&p.name!=="AbortError"&&(console.error("Failed to convert file:",p),i(!1))})):(n({...e,updatedAt:new Date}),u(e.richTextContent))},[e]);let T=p=>{switch(p){case"markdown":case"mdx":return(0,Dt.jsx)(St.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Dt.jsx)(St.File,{className:"h-6 w-6 text-success"});case"text":return(0,Dt.jsx)(St.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Dt.jsx)(St.File,{className:"h-6 w-6 text-muted-foreground"})}},y=p=>{switch(p){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"}},E=async()=>{g(!0);try{let p,b;if(v.current&&v.current.mimeType==="text/markdown"){let N=m?Ns(m):"";p={...s,format:"markdown",content:N,richTextContent:void 0},b=N}else p={...s,richTextContent:m},b=s.content||"";let z=v.current?v.current.id.toString():s.id;await Promise.resolve(o()),a?.(z,b)}finally{g(!1)}};return(0,Dt.jsxs)(Ra.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Dt.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,Dt.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Dt.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Dt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Dt.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Dt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Dt.jsx)(To,{fieldName:"title",value:s.title,label:"",onSave:(p,b)=>n(z=>({...z,title:b})),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,Dt.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${y(s.format)} flex-shrink-0 mt-1`,children:s.format.toUpperCase()})]})})}),(0,Dt.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Dt.jsxs)(S,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Dt.jsx)(St.X,{className:"h-4 w-4"}),"Close"]}),(0,Dt.jsxs)(S,{size:"sm",onClick:E,className:"gap-2",disabled:d,children:[d?(0,Dt.jsx)(St.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Dt.jsx)(St.Save,{className:"h-4 w-4"}),d?"Saving...":"Save"]})]})]})}),(0,Dt.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Dt.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:r?(0,Dt.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,Dt.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,Dt.jsx)(St.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,Dt.jsx)(Dt.Fragment,{children:s.format==="richText"?(0,Dt.jsx)(ni,{setValue:u,value:m,name:"richTextContent"},`richtext-${s.id}-${r?"loading":"loaded"}`):(0,Dt.jsx)(Me,{value:s.content||"",onChange:p=>n(b=>({...b,content:p.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var fi=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 po({files:e,onFileClick:t,onFileDelete:o,onFileUpdate:a,showHeader:r=!0,className:i,viewMode:s="list"}){let[n,m]=(0,fe.useState)(!1),[u,d]=(0,fe.useState)(!1),[g,v]=(0,fe.useState)(null),T=()=>{m(!1),v(null)},y=()=>{d(!0),setTimeout(()=>{d(!1),m(!1),v(null)},500)},E=p=>{v(p),m(!0)};return(0,Dt.jsxs)("div",{className:D("rounded-3xl border overflow-hidden",i),children:[(0,Dt.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[r&&s==="list"&&(0,Dt.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,Dt.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Dt.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Dt.jsx)("div",{className:"col-span-2",children:"Modified"})]}),s==="card"&&(0,Dt.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),s==="list"&&(0,Dt.jsx)("div",{className:"divide-y",children:e.map(p=>(0,Dt.jsxs)(Ra.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?.(p),children:[(0,Dt.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Dt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Dt.jsx)("div",{children:(0,Dt.jsx)("p",{className:"font-medium",children:p.name})})]}),(0,Dt.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:fi(p.filesize)}),(0,Dt.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Dt.jsx)("span",{className:"text-sm md:text-base",children:new Date(p.createdAt).toLocaleDateString()}),(0,Dt.jsxs)("div",{className:"flex gap-1",children:[p.mimeType==="text/markdown"&&(0,Dt.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:b=>{b.stopPropagation(),E(p)},children:(0,Dt.jsx)(St.Edit,{className:"h-4 w-4"})}),(0,Dt.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:b=>{b.stopPropagation(),o?.(p)},children:(0,Dt.jsx)(St.Trash2,{className:"h-4 w-4"})})]})]})]},p.name))}),s==="card"&&(0,Dt.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(p=>(0,Dt.jsx)(Ra.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(p),children:(0,Dt.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Dt.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Dt.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,Dt.jsx)("div",{className:"min-w-0 flex-1",children:(0,Dt.jsx)("p",{className:"font-medium truncate",children:p.name})})]}),(0,Dt.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)("span",{className:"font-medium",children:"Size:"}),(0,Dt.jsx)("span",{children:fi(p.filesize)})]}),(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,Dt.jsx)("span",{children:new Date(p.createdAt).toLocaleDateString()})]})]})]}),(0,Dt.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[p.mimeType==="text/markdown"&&(0,Dt.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:b=>{b.stopPropagation(),E(p)},title:"Edit",children:(0,Dt.jsx)(St.Edit,{className:"h-4 w-4"})}),(0,Dt.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:b=>{b.stopPropagation(),o?.(p)},title:"Delete",children:(0,Dt.jsx)(St.Trash2,{className:"h-4 w-4"})})]})]})},p.name))}),(0,Dt.jsx)(Ge,{open:n,onOpenChange:p=>!p&&T(),children:(0,Dt.jsxs)(na,{children:[(0,Dt.jsx)(Lo,{}),(0,Dt.jsxs)(vi.Content,{className:D("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[(0,Dt.jsx)(ze,{className:"sr-only",children:g?`Edit ${g.name}`:"Edit File"}),u&&(0,Dt.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,Dt.jsx)(St.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),g&&(0,Dt.jsx)(gi,{document:g,onSave:y,onFileUpdate:a,onCancel:T})]})]})})]})}var Xo=({isOpen:e,onClose:t,onAddFile:o})=>{let[a,r]=(0,fe.useState)(null),[i,s]=(0,fe.useState)(""),[n,m]=(0,fe.useState)(""),[u,d]=(0,fe.useState)(""),g=T=>{let y=T.target.files?.[0];y&&(r(y),i||s(y.name))},v=async T=>{if(T.preventDefault(),!a)return;let y=new FormData;y.append("file",a),y.append("name",i),n&&y.append("description",n),u&&y.append("tags",u),o?.(y),t(),r(null),s(""),m(""),d("")};return(0,Dt.jsx)(Ge,{open:e,onOpenChange:t,children:(0,Dt.jsxs)(We,{className:"sm:max-w-md",children:[(0,Dt.jsx)(Ke,{children:(0,Dt.jsx)(ze,{children:"Add New File"})}),(0,Dt.jsxs)("form",{onSubmit:v,className:"grid gap-4",children:[(0,Dt.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Dt.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,Dt.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Dt.jsx)(Ds,{className:"w-10 h-10 text-gray-400"}),(0,Dt.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Dt.jsx)("span",{className:"font-semibold",children:"Click to upload"})," Xa drag and drop"]}),(0,Dt.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG Xa GIF (MAX. 800x400px)"})]}),(0,Dt.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),a&&(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)("p",{className:"font-medium",children:a.name}),(0,Dt.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((a.size||0)/1024).toFixed(2)," KB"]})]}),(0,Dt.jsx)(S,{type:"submit",onClick:v,children:"Upload"})]})]})]})})};function Ds(e){return(0,Dt.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Dt.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Dt.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Dt.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var bi=({isOpen:e,onClose:t,initialTask:o,epics:a,sprints:r,onUpdateTask:i,onDeleteTask:s,onAddComment:n,colleagues:m,onUploadFile:u,onDeleteFile:d,onFileUpdate:g})=>{let[v,T]=(0,fe.useState)(o),[y,E]=(0,fe.useState)(new Date),[p,b]=(0,fe.useState)("idle"),[z,N]=(0,fe.useState)("idle"),[C,Y]=(0,fe.useState)(!1),[M,Q]=(0,fe.useState)([]),[ee,j]=(0,fe.useState)(m);(0,fe.useEffect)(()=>{T(o)},[o]);let me=async(te,w)=>{if(w!==v[te]){b("loading");try{await i(v.id.toString(),{[te]:w}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(K){console.log("error",K),b("error"),setTimeout(()=>b("idle"),3e3)}}},ye=async(te,w)=>{if(w!==v[te]){b("loading");try{await i(v.id.toString(),{[te]:w}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(K){console.log("error",K),b("error"),setTimeout(()=>b("idle"),3e3)}}},I=async te=>{if(n){b("loading");try{await n?.({content:te,taskId:v.id.toString()}),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch{b("error"),setTimeout(()=>b("idle"),3e3)}}},ve=async()=>{N("loading");try{await s(v.id.toString()),N("success"),setTimeout(()=>{t(),N("idle")},1e3)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}},ke=async te=>{if(u){b("loading");try{await u(v.id.toString(),te),E(new Date),b("success"),Y(!1),setTimeout(()=>b("idle"),1500)}catch(w){console.error("Error uploading file:",w),b("error"),setTimeout(()=>b("idle"),3e3)}}},R=async te=>{if(d){b("loading");try{await d(v.id.toString(),te.id.toString()),E(new Date),b("success"),setTimeout(()=>b("idle"),1500)}catch(w){console.error("Error deleting file:",w),b("error"),setTimeout(()=>b("idle"),3e3)}}},J=(v.files||[]).map(te=>typeof te=="number"?null:te).filter(te=>te!==null),ie=p!=="loading"&&z!=="loading",Ee=()=>{ie&&t()},ce=()=>p==="loading"?(0,Dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Dt.jsx)(St.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Dt.jsx)("span",{children:"Updating..."})]}):p==="success"?(0,Dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Dt.jsx)(St.Check,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{children:"Updated successfully"})]}):p==="error"?(0,Dt.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Dt.jsx)(St.X,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{children:"Update failed"})]}):null;return(0,Dt.jsxs)(Ge,{open:e,onOpenChange:Ee,children:[(0,Dt.jsxs)(We,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Dt.jsxs)(Ke,{children:[(0,Dt.jsx)(ze,{className:"sr-only",children:v?.name}),(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsx)("div",{className:"flex-1",children:ce()}),!ie&&(0,Dt.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Dt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Dt.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Dt.jsx)(To,{fieldName:"name",value:v.name||"",label:"",onSave:me,className:"border-b border-border pb-3",disabled:p==="loading"}),(0,Dt.jsx)(To,{fieldName:"description",value:v.description||"",label:"Description",multiline:!0,onSave:me,disabled:p==="loading"}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)(St.File,{className:"h-4 w-4 text-muted-foreground"}),(0,Dt.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),u&&(0,Dt.jsxs)(S,{variant:"outline",size:"sm",onClick:()=>Y(!0),disabled:p==="loading",className:"gap-2",children:[(0,Dt.jsx)(St.Upload,{className:"h-4 w-4"}),"Upload"]})]}),J.length>0?(0,Dt.jsx)(po,{files:J,onFileDelete:d?R:void 0,onFileUpdate:g,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,Dt.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,Dt.jsx)(yr,{comments:(v?.comments||[]).map(te=>({author:te.author?.value.name||"",createdAt:new Date(te.timestamp),text:te.text,id:te.id||""})),onAddComment:I})]}),(0,Dt.jsx)(Cr,{task:v,epics:a,sprints:r,lastUpdated:y,onUpdateTask:ye,onClose:Ee,onDelete:ve,isUpdating:p==="loading",isDeleting:z==="loading",deleteState:z,teamMembers:ee})]})]}),u&&(0,Dt.jsx)(Xo,{isOpen:C,onClose:()=>Y(!1),onAddFile:ke})]})};var uo=({isOpen:e,onClose:t,onAddEpic:o})=>{let[a,r]=(0,fe.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"}],m=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(v=>({...v,[d]:g}))};return(0,Dt.jsx)(Ge,{open:e,onOpenChange:t,children:(0,Dt.jsxs)(We,{className:"sm:max-w-md",children:[(0,Dt.jsx)(Ke,{children:(0,Dt.jsx)(ze,{children:"Add New Epic"})}),(0,Dt.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"name",children:"Epic Name"}),(0,Dt.jsx)(ne,{id:"name",value:a.name,onChange:d=>u("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Dt.jsx)(Me,{id:"description",value:a.description,onChange:d=>u("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"Color"}),(0,Dt.jsx)("div",{className:"flex gap-2 flex-wrap",children:i.map(d=>(0,Dt.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,Dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"Confidence"}),(0,Dt.jsxs)(Xe,{value:a.confidence,onValueChange:d=>u("confidence",d),children:[(0,Dt.jsx)(Ze,{children:(0,Dt.jsx)(pt,{})}),(0,Dt.jsx)(Je,{children:s.map(d=>(0,Dt.jsx)(xe,{value:d.value,children:d.label},d.value))})]})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"Phase"}),(0,Dt.jsxs)(Xe,{value:a.phase.toString(),onValueChange:d=>u("phase",parseInt(d)),children:[(0,Dt.jsx)(Ze,{children:(0,Dt.jsx)(pt,{})}),(0,Dt.jsx)(Je,{children:n.map(d=>(0,Dt.jsx)(xe,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"Start Date"}),(0,Dt.jsx)(ne,{type:"date",value:a.startDate,onChange:d=>u("startDate",d.target.value)})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"End Date"}),(0,Dt.jsx)(ne,{type:"date",value:a.endDate,onChange:d=>u("endDate",d.target.value)})]})]}),(0,Dt.jsxs)(wo,{children:[(0,Dt.jsx)(S,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Dt.jsx)(S,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};function yi(e,t){let[o,a]=(0,fe.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,fe.useEffect)(()=>{r(o)},[]),[o,r]}var Qo=require("react-icons/fa");function yt({title:e,description:t,badge:o,primaryAction:a,secondaryAction:r,gradient:i,children:s,className:n}){let[m,u]=yi(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!r&&!t),d=!r&&!t||m;return(0,Dt.jsxs)(Ra.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,Dt.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,Dt.jsx)(we,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,Dt.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Dt.jsxs)("div",{className:"flex items-center gap-3",children:[d&&a&&(0,Dt.jsx)(S,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),(r||t)&&(0,Dt.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>u(!m),style:{lineHeight:0},children:m?(0,Dt.jsx)(Qo.FaChevronDown,{size:22}):(0,Dt.jsx)(Qo.FaChevronUp,{size:22})})]})]}),!d&&(0,Dt.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Dt.jsxs)("div",{className:"space-y-4",children:[(0,Dt.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Dt.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a&&(0,Dt.jsx)(S,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),r&&(0,Dt.jsx)(S,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:r.onClick,children:r.label})]})]}),s&&(0,Dt.jsx)("div",{className:"hidden lg:block",children:s})]})]})}var Ni=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:a=[],initialColleagues:r=[],initialProjects:i=[],onAddTask:s,onUpdateTask:n,onDeleteTask:m,onTaskClick:u,onAddEpic:d,onAddComment:g,onUploadFile:v,onDeleteFile:T,onFileUpdate:y})=>{let[E,p]=(0,pe.useState)([]),[b,z]=(0,pe.useState)([]),[N,C]=(0,pe.useState)([]),[Y,M]=(0,pe.useState)(!1),[Q,ee]=(0,pe.useState)(!1),[j,me]=(0,pe.useState)(null),[ye,I]=(0,pe.useState)(null),[ve,ke]=(0,pe.useState)([]),[R,J]=(0,pe.useState)([]),[ie,Ee]=(0,pe.useState)(0),ce=(0,pe.useRef)(null),te=(0,pe.useRef)(null),w=pe.default.useMemo(()=>[...b.map(h=>h.id),0],[b]),K=(0,pe.useRef)(""),De=(0,pe.useRef)(""),ot=(0,pe.useRef)(""),de=(0,pe.useRef)(""),je=(h,P)=>h.map(V=>`${V.id}-${new Date(V.createdAt).getTime()}-${new Date(V.updatedAt).getTime()}`).join("-")+(P?`-${P}`:"");(0,pe.useEffect)(()=>{let h=e.map(V=>V.files?.filter(Z=>typeof Z=="object").map(Z=>new Date(Z.updatedAt).getTime())).flat(),P=je(e,h.join("-"));P!==K.current&&(p(e),j&&me(e.find(V=>V.id===j.id)||null),K.current=P)},[e]),(0,pe.useEffect)(()=>{let h=je(t);h!==De.current&&(z(t),De.current=h)},[t]),(0,pe.useEffect)(()=>{let h=je(o);h!==ot.current&&(C(o),ot.current=h)},[o]),(0,pe.useEffect)(()=>{let h=je(r.map(P=>({id:P.id,updatedAt:P.updatedAt,createdAt:P.createdAt})));h!==de.current&&(J(r),de.current=h)},[r]),(0,pe.useEffect)(()=>{let h=()=>{if(ce.current){let Z=ce.current.offsetHeight;Ee(Z)}};h();let P=new ResizeObserver(h);ce.current&&P.observe(ce.current);let V=()=>{setTimeout(h,100)};return window.addEventListener("storage",V),()=>{P.disconnect(),window.removeEventListener("storage",V)}},[]),(0,pe.useEffect)(()=>{let h=setTimeout(()=>{ce.current&&Ee(ce.current.offsetHeight)},300);return()=>clearTimeout(h)},[Y,Q]);let go=E.filter(h=>!0),Nt=h=>go.filter(P=>P.status===h),fo=h=>{let P={};return b.forEach(V=>{P[V.id]=h.filter(Z=>Re(Z.epic)===V.id)}),P["no-epic"]=h.filter(V=>!Re(V.epic)),P},Ct=h=>{I(h)},Bt=h=>{ye&&(p(P=>P.map(V=>V.id===ye.id?{...V,status:h}:V)),n?.(ye.id.toString(),{status:h}),I(null))},Yt=h=>{let P={...h,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};p(V=>[...V,P]),s?.(h)},Vt=async(h,P)=>{p(V=>V.map(Z=>Z.id===Number(h)?{...Z,...P}:Z)),n&&await n(h,P),j?.id===Number(h)&&me(V=>({...V,...P}))},Qt=async h=>{p(P=>P.filter(V=>V.id!==Number(h))),j?.id===Number(h)&&me(null),m&&await m(h)},eo=h=>{let P={...h,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};z(V=>[...V,P]),d?.(h)},mt=h=>{me(h),u?.(h)},f=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],k=ie>0?`calc(100vh - ${ie+120}px)`:"calc(100vh - 12rem)";return(0,Dt.jsxs)("div",{ref:te,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Dt.jsx)("div",{ref:ce,className:"flex-shrink-0",children:(0,Dt.jsx)(yt,{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:()=>M(!0)},secondaryAction:{label:"Add epic",onClick:()=>ee(!0)}})}),(0,Dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Dt.jsx)("div",{className:"h-full",style:{height:ie>0?`calc(100vh - ${ie+120}px)`:"calc(100vh - 12rem)"},children:(0,Dt.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:f.map(h=>{let P=Nt(h.status),V=fo(P);return(0,Dt.jsxs)(Qa,{title:h.title,status:h.status,taskCount:P.length,onDrop:Bt,isCompact:h.status==="done",height:k,children:[V["no-epic"].map(Z=>(0,Dt.jsx)(xo,{epic:null,task:Z,onDragStart:Ct,onTaskClick:mt,isCompact:h.status==="done"},Z.id)),w.map(Z=>{let Le=b.find(ft=>ft.id===Z),Tt=V[Z]||[];return Tt.length===0?null:(0,Dt.jsxs)("div",{className:"mb-6",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Dt.jsx)("div",{className:`w-3 h-3 rounded-full ${Le?.color}`}),(0,Dt.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Le?.name||"No Epic"}),(0,Dt.jsx)(we,{variant:"secondary",className:"text-xs",children:Tt.length})]})," ",(0,Dt.jsx)("div",{className:"space-y-3",children:Tt.map(ft=>(0,Dt.jsx)(xo,{task:ft,epic:Le,onDragStart:Ct,onTaskClick:mt,isCompact:h.status==="done"},ft.id))})]},Z)})]},h.id)})})})}),(0,Dt.jsx)(io,{isOpen:Y,onClose:()=>M(!1),onAddTask:Yt,assignees:[...R,...ve],epics:b,sprints:N}),(0,Dt.jsx)(uo,{isOpen:Q,onClose:()=>ee(!1),onAddEpic:eo}),j&&(0,Dt.jsx)(bi,{isOpen:!!j,onClose:()=>me(null),initialTask:j,epics:b,sprints:N,onUpdateTask:Vt,onDeleteTask:Qt,colleagues:R,onUploadFile:v,onDeleteFile:T,onFileUpdate:y,onAddComment:g})]})};var Ci=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddTaskToEpic:i,onAddEpic:s,onUpdateEpic:n,onDeleteEpic:m})=>{let[u,d]=(0,fe.useState)(t),[g,v]=(0,fe.useState)(null),[T,y]=(0,fe.useState)(null),[E,p]=(0,fe.useState)({}),[b,z]=(0,fe.useState)(0),[N,C]=(0,fe.useState)(!1),[Y,M]=(0,fe.useState)(!1),[Q,ee]=(0,fe.useState)(null),j=(0,fe.useRef)(null),me=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{d(t)},[t]),(0,fe.useEffect)(()=>{let w=()=>{if(j.current){let ot=j.current.offsetHeight;z(ot)}};w();let K=new ResizeObserver(w);j.current&&K.observe(j.current);let De=()=>{setTimeout(w,100)};return window.addEventListener("storage",De),()=>{K.disconnect(),window.removeEventListener("storage",De)}},[]),(0,fe.useEffect)(()=>{let w=setTimeout(()=>{j.current&&z(j.current.offsetHeight)},300);return()=>clearTimeout(w)},[T]);let ye=w=>{v(w)},I=w=>{w.preventDefault()},ve=(w,K)=>{w.preventDefault(),g&&Re(g.epic).toString()!==K&&(a(g.id.toString(),{epic:Number(K)}),v(null))},ke=w=>e.filter(K=>Re(K.epic).toString()===w),R=w=>{y(w.id.toString()),p({name:w.name,description:w.description,confidence:w.confidence,phase:w.phase})},J=async()=>{T&&E.name&&(await n(T.toString(),E),d(w=>w.map(K=>K.id.toString()===T?{...K,...E}:K)),y(null),p({}))},ie=()=>{y(null),p({})},Ee=async w=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await m(w),d(K=>K.filter(De=>De.id.toString()!==w)))},ce=w=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[w]||`Phase ${w}`,te=w=>{switch(w){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsxs)("div",{ref:me,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Dt.jsx)("div",{ref:j,className:"flex-shrink-0",children:(0,Dt.jsx)(yt,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>C(!0)}})}),(0,Dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Dt.jsx)("div",{className:"h-full overflow-y-auto",style:{height:b>0?`calc(100vh - ${b+120}px)`:"calc(100vh - 12rem)"},children:(0,Dt.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:u.map(w=>{let K=ke(w.id.toString()),De=K.reduce((de,je)=>de+(je.storyPoints||0),0),ot=b>0?`calc(100vh - ${b+200}px)`:"calc(100vh - 14rem)";return(0,Dt.jsxs)(be,{className:`flex flex-col ${T===w.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:T===w.id.toString()?"auto":ot,minHeight:"400px"},onDragOver:I,onDrop:de=>ve(de,w.id.toString()),children:[(0,Dt.jsx)("div",{className:"p-4 border-b border-border",children:T===w.id.toString()?(0,Dt.jsxs)("div",{className:"space-y-4",children:[(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsx)(ne,{value:E.name||"",onChange:de=>p({...E,name:de.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Dt.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:J,className:"p-1 h-8 w-8",children:(0,Dt.jsx)(St.Check,{className:"h-4 w-4"})}),(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:ie,className:"p-1 h-8 w-8",children:(0,Dt.jsx)(St.X,{className:"h-4 w-4"})})]})]}),(0,Dt.jsx)(Me,{value:E.description||"",onChange:de=>p({...E,description:de.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Dt.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Dt.jsxs)("select",{value:E.confidence||w.confidence,onChange:de=>p({...E,confidence:de.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Dt.jsx)("option",{value:"low",children:"Low"}),(0,Dt.jsx)("option",{value:"medium",children:"Medium"}),(0,Dt.jsx)("option",{value:"high",children:"High"})]})]}),(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Dt.jsx)("select",{value:E.phase?.toString()||w.phase.toString(),onChange:de=>p({...E,phase:parseInt(de.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(de=>(0,Dt.jsxs)("option",{value:de.toString(),children:["Phase ",de]},de))})]})]})]}):(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Dt.jsx)("div",{className:`w-4 h-4 rounded-full ${w.color}`}),(0,Dt.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:w.name}),(0,Dt.jsxs)("div",{className:"flex gap-1",children:[(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>R(w),className:"p-1 h-8 w-8",children:(0,Dt.jsx)(St.Edit2,{className:"h-3 w-3"})}),(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>Ee(w.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Dt.jsx)(St.Trash2,{className:"h-3 w-3"})})]})]}),(0,Dt.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Dt.jsxs)(we,{className:`text-xs ${te(w.confidence)}`,children:[w.confidence," confidence"]}),(0,Dt.jsxs)(we,{variant:"outline",className:"text-xs",children:["Phase ",w.phase]}),(0,Dt.jsxs)(we,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[K.length," tasks"]}),(0,Dt.jsxs)(we,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[De," pts"]})]}),w.description&&(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:w.description}),(0,Dt.jsxs)(S,{onClick:()=>{M(!0),ee(w)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Dt.jsx)(St.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Dt.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Dt.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:K.length===0?(0,Dt.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,Dt.jsx)(St.Move,{className:"h-8 w-8 mb-2"}),(0,Dt.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):K.map(de=>(0,Dt.jsx)(xo,{task:de,epic:w,onDragStart:ye,onTaskClick:r,isCompact:!0},de.id))})})]},w.id)})})})})]}),(0,Dt.jsx)(uo,{isOpen:N,onClose:()=>C(!1),onAddEpic:s}),(0,Dt.jsx)(io,{isOpen:Y,onClose:()=>M(!1),onAddTask:i,assignees:[],epics:[],defaultEpicId:Q?.id.toString()||"",sprints:o})]})};var Ma=require("date-fns");var Di=({isOpen:e,onClose:t,onAddSprint:o})=>{let[a,r]=(0,fe.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,Dt.jsx)(Ge,{open:e,onOpenChange:s,children:(0,Dt.jsxs)(We,{className:"sm:max-w-md",children:[(0,Dt.jsx)(Ke,{children:(0,Dt.jsx)(ze,{children:"Add New Sprint"})}),(0,Dt.jsxs)("form",{onSubmit:i,className:"space-y-4",children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"name",children:"Sprint Name *"}),(0,Dt.jsx)(ne,{id:"name",value:a.name,onChange:n=>r(m=>({...m,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Dt.jsx)(Me,{id:"description",value:a.description,onChange:n=>r(m=>({...m,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"Start Date *"}),(0,Dt.jsxs)(ka,{children:[(0,Dt.jsx)(Pa,{asChild:!0,children:(0,Dt.jsxs)(S,{variant:"outline",className:D("w-full justify-start text-left font-normal",!a.startDate&&"text-muted-foreground"),children:[(0,Dt.jsx)(St.CalendarIcon,{className:"mr-2 h-4 w-4"}),a.startDate?(0,Ma.format)(a.startDate,"PPP"):"Pick a date"]})}),(0,Dt.jsx)(Ko,{className:"w-auto p-0",align:"start",children:(0,Dt.jsx)(Zo,{mode:"single",selected:a.startDate,onSelect:n=>r(m=>({...m,startDate:n})),initialFocus:!0})})]})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)(H,{children:"End Date *"}),(0,Dt.jsxs)(ka,{children:[(0,Dt.jsx)(Pa,{asChild:!0,children:(0,Dt.jsxs)(S,{variant:"outline",className:D("w-full justify-start text-left font-normal",!a.endDate&&"text-muted-foreground"),children:[(0,Dt.jsx)(St.CalendarIcon,{className:"mr-2 h-4 w-4"}),a.endDate?(0,Ma.format)(a.endDate,"PPP"):"Pick a date"]})}),(0,Dt.jsx)(Ko,{className:"w-auto p-0",align:"start",children:(0,Dt.jsx)(Zo,{mode:"single",selected:a.endDate,onSelect:n=>r(m=>({...m,endDate:n})),initialFocus:!0,disabled:n=>a.startDate?n<a.startDate:!1})})]})]})]}),(0,Dt.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Dt.jsx)(S,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,Dt.jsx)(S,{type:"submit",disabled:!a.name||!a.startDate||!a.endDate,children:"Add Sprint"})]})]})]})})};var Si=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:r,onAddSprint:i,onUpdateSprint:s,onDeleteSprint:n})=>{let[m,u]=(0,fe.useState)([]),[d,g]=(0,fe.useState)(new Set),[v,T]=(0,fe.useState)(null),[y,E]=(0,fe.useState)(!1),[p,b]=(0,fe.useState)(null),[z,N]=(0,fe.useState)(null),[C,Y]=(0,fe.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[M,Q]=(0,fe.useState)([]),[ee,j]=(0,fe.useState)("upcoming"),[me,ye]=(0,fe.useState)(!1),[I,ve]=(0,fe.useState)(0),ke=(0,fe.useRef)(null),R=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{let f=()=>{ke.current&&ve(ke.current.offsetHeight)};f();let k=new ResizeObserver(f);return ke.current&&k.observe(ke.current),()=>k.disconnect()},[]);let J=f=>t.find(k=>k.id===Number(f)),ie=f=>o.find(k=>k.id===Number(f)),Ee=f=>{let k={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 k[f]||k.medium},ce=f=>{if(!f||f?.length===0)return"";let k=f?.trim().split(" ");if(k?.length===1)return k[0];let h=k[0],P=k[k.length-1][0].toUpperCase();return`${h} ${P}`},te=f=>{let k={},h=[];return f.forEach(P=>{P.epic?(k[Re(P.epic)]||(k[Re(P.epic)]=[]),k[Re(P.epic)].push(P)):h.push(P)}),{tasksByEpic:k,unassignedTasks:h}};(0,fe.useEffect)(()=>{Q(o)},[o]);let w=M.filter(f=>{switch(ee){default:return!0}}),K=M.filter(f=>m.includes(f.id.toString())),De=e.filter(f=>!f.sprint||f.status==="backlog"),ot=De.reduce((f,k)=>f+(k.storyPoints||0),0),de=f=>{u(k=>k.includes(f)?k.filter(h=>h!==f):k?.length<3?[...k,f]:k)},je=f=>{g(k=>{let h=new Set(k);return h.has(f)?h.delete(f):h.add(f),h})},go=f=>{i(f),E(!1)},Nt=f=>{N(f.id.toString()),Y({name:f.name,description:f.description||"",startDate:f.startDate?new Date(f.startDate).toISOString().split("T")[0]:f.startDate,endDate:f.endDate?new Date(f.endDate).toISOString().split("T")[0]:f.endDate,isActive:!1})},fo=()=>{z&&(s(z,{name:C.name,description:C.description,startDate:C.startDate,endDate:C.endDate}),Q(f=>f.map(k=>(k.id===Number(z)&&(k.name=C.name,k.description=C.description,k.startDate=C.startDate,k.endDate=C.endDate),k))),N(null))},Ct=()=>{N(null),Y({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Bt=(f,k)=>{T(k),f.dataTransfer.effectAllowed="move"},Yt=f=>{f.preventDefault(),f.dataTransfer.dropEffect="move"},Vt=f=>{b(f)},Qt=()=>{b(null)},eo=(f,k)=>{if(f.preventDefault(),b(null),!v)return;(Re(v.sprint)||void 0)!==Number(k)&&a(v.id.toString(),{sprint:Number(k)}),T(null)},mt=({task:f,showSprint:k=!1})=>{let h=f.epic?J(Re(f.epic).toString()):null,P=f.sprint?ie(Re(f.sprint).toString()):null;return(0,Dt.jsx)(be,{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:Le=>{Le.dataTransfer.effectAllowed="move",Le.dataTransfer.setData("text/plain",f.id.toString()),Bt(Le,f)},onClick:Le=>{v===null&&r(f)},style:{userSelect:"none"},children:(0,Dt.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Dt.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Dt.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:f.name}),(0,Dt.jsx)(we,{className:`text-xs ${Ee(f.priority||"medium")}`,children:f.priority?.[0]?.toUpperCase()})]}),(0,Dt.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-1",children:[h&&(0,Dt.jsx)("div",{className:`w-2 h-2 rounded-full ${h.color}`}),(0,Dt.jsx)("span",{className:"text-muted-foreground truncate",children:h?.name})]}),(0,Dt.jsx)("span",{className:"text-muted-foreground",children:ce(f.assignee?.value?.name)})]}),k&&P&&(0,Dt.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Dt.jsx)(St.Calendar,{className:"h-3 w-3"}),(0,Dt.jsx)("span",{children:P.name})]})]})})};return(0,Dt.jsxs)("div",{ref:R,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Dt.jsx)("div",{ref:ke,className:"flex-shrink-0",children:(0,Dt.jsx)(yt,{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:()=>E(!0)}})}),(0,Dt.jsx)("div",{className:"flex-1 min-h-0 mt-8",children:(0,Dt.jsxs)("div",{className:"h-full",style:{height:I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)"},children:[(0,Dt.jsxs)("div",{className:"mb-4",children:[(0,Dt.jsx)(be,{className:"p-3 bg-card shadow-sm",children:(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Dt.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Dt.jsx)("div",{className:"flex flex-wrap gap-1",children:K.map(f=>(0,Dt.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Dt.jsx)("span",{className:"max-w-[80px] truncate",children:f.name}),(0,Dt.jsx)("button",{onClick:()=>de(f.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Dt.jsx)(St.X,{className:"h-4 w-4"})})]},f.id))})]})]}),(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsxs)(S,{onClick:()=>E(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Dt.jsx)(St.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Dt.jsxs)(S,{onClick:()=>ye(!me),variant:"outline",size:"sm",className:"gap-1",children:[(0,Dt.jsx)(St.Calendar,{className:"h-3 w-3"}),me?"Close":"Select"]})]})]})}),me&&(0,Dt.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>ye(!1)}),(0,Dt.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-Dt shadow-xl z-10 transition-all duration-300 ease-in-out ${me?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Dt.jsxs)(be,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Dt.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Dt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Dt.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Dt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>ye(!1),className:"h-8 w-8 p-0",children:(0,Dt.jsx)(St.X,{className:"h-4 w-4"})})]}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Dt.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Dt.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:o.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(f=>(0,Dt.jsxs)(S,{variant:ee===f.key?"default":"outline",size:"sm",onClick:()=>j(f.key),className:"text-xs h-8 px-3 flex-1",children:[f.label," (",f.count,")"]},f.key))}),(0,Dt.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:w.length>0?w.map(f=>{let k=m.includes(f.id.toString()),h=e.filter(V=>Re(V.sprint)===f.id).length,P=!k&&m.length<3;return(0,Dt.jsx)("div",{className:`p-3 rounded-lg border transition-all ${k?"bg-primary/10 border-primary/30":P?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:z===f.id.toString()?(0,Dt.jsxs)("div",{className:"space-y-3",children:[(0,Dt.jsx)(ne,{value:C.name,onChange:V=>Y(Z=>({...Z,name:V.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Dt.jsx)(Me,{value:C.description,onChange:V=>Y(Z=>({...Z,description:V.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Dt.jsxs)("div",{className:"flex gap-2",children:[(0,Dt.jsxs)(S,{size:"sm",onClick:()=>fo(),className:"flex-1",children:[(0,Dt.jsx)(St.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Dt.jsxs)(S,{size:"sm",variant:"outline",onClick:Ct,className:"flex-1",children:[(0,Dt.jsx)(St.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Dt.jsxs)("div",{children:[(0,Dt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Dt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Dt.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:f.name}),(0,Dt.jsx)(we,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Dt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:f.description}),(0,Dt.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Dt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Dt.jsx)(St.CalendarDays,{className:"h-3 w-3"}),new Date(f.startDate).toLocaleDateString()]}),(0,Dt.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Dt.jsx)(St.User,{className:"h-3 w-3"}),h," tasks"]})]})]}),(0,Dt.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>Nt(f),className:"h-6 w-6 p-0",children:(0,Dt.jsx)(St.Edit2,{className:"h-3 w-3"})}),(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>n(f.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Dt.jsx)(St.Trash2,{className:"h-3 w-3"})})]})]}),(0,Dt.jsx)("div",{className:"flex items-center justify-between mt-2",children:(0,Dt.jsx)(S,{variant:k?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>de(f.id.toString()),disabled:!k&&m?.length>=3,children:(0,Dt.jsx)("span",{className:"pointer-events-none select-none",children:k?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},f.id)}):(0,Dt.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Dt.jsx)(St.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Dt.jsxs)("p",{className:"text-sm",children:['No sprints found for "',ee,'" filter']}),(0,Dt.jsx)(S,{variant:"link",size:"sm",onClick:()=>j("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,Dt.jsx)("div",{className:"mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Dt.jsxs)("div",{className:"text-center",children:[(0,Dt.jsx)(St.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Dt.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Dt.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Dt.jsx)("div",{className:"lg:col-span-1",children:(0,Dt.jsxs)(be,{className:"p-4 h-full bg-card border-Dt-4 border-Dt-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Yt,onDragEnter:()=>Vt("backlog"),onDragLeave:Qt,onDrop:f=>eo(f,"backlog"),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,Dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Dt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsxs)(we,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[De?.length," tasks"]}),(0,Dt.jsxs)(we,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[ot," pts"]})]})]}),(0,Dt.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:f,unassignedTasks:k}=te(De);return(0,Dt.jsxs)(Dt.Fragment,{children:[Object.entries(f).map(([h,P])=>{let V=J(h);if(!V)return null;let Z=d.has(h);return(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je(h),children:[(0,Dt.jsx)("div",{className:`w-3 h-3 rounded-full ${V.color}`}),(0,Dt.jsx)("span",{className:"font-medium text-muted-foreground",children:V.name}),(0,Dt.jsxs)("span",{className:"text-muted-foreground",children:["(",P?.length,")"]}),(0,Dt.jsx)("div",{className:"ml-auto",children:Z?(0,Dt.jsx)(St.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Dt.jsx)(St.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Z&&(0,Dt.jsx)("div",{className:"space-y-2 pl-2",children:P.map(Le=>(0,Dt.jsx)(mt,{task:Le},Le.id))})]},h)}),k?.length>0&&(()=>{let h=d.has("no-epic");return(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je("no-epic"),children:[(0,Dt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Dt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Dt.jsxs)("span",{className:"text-muted-foreground",children:["(",k?.length,")"]}),(0,Dt.jsx)("div",{className:"ml-auto",children:h?(0,Dt.jsx)(St.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Dt.jsx)(St.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!h&&(0,Dt.jsx)("div",{className:"space-y-2 pl-2",children:k?.map(P=>(0,Dt.jsx)(mt,{task:P},P.id))})]})})(),De?.length===0&&(0,Dt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),De?.length>0&&Object.keys(f).length===0&&k.length===0&&(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),De?.map(h=>(0,Dt.jsx)(mt,{task:h},h.id))]})]})})()})]})}),K.map(f=>{let k=e.filter(P=>Re(P?.sprint)===f.id),h=k.reduce((P,V)=>P+(V?.storyPoints||0),0);return(0,Dt.jsxs)(be,{className:"p-4 h-full bg-card border-Dt-4 border-Dt-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Yt,onDragEnter:()=>Vt(f.id.toString()),onDragLeave:Qt,onDrop:P=>eo(P,f.id.toString()),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,Dt.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Dt.jsx)("div",{children:(0,Dt.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:f.name})}),(0,Dt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Dt.jsxs)(we,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[k?.length," tasks"]}),(0,Dt.jsxs)(we,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[h," pts"]}),(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>{ye(!0),Nt(f)},className:"h-6 px-2",children:(0,Dt.jsx)(St.Edit2,{className:"h-3 w-3"})}),(0,Dt.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>n(f.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Dt.jsx)(St.Trash2,{className:"h-3 w-3"})})]})]}),(0,Dt.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:P,unassignedTasks:V}=te(k);return(0,Dt.jsxs)(Dt.Fragment,{children:[Object.entries(P).map(([Z,Le])=>{let Tt=J(Z);if(!Tt)return null;let ft=d.has(Z);return(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je(Z),children:[(0,Dt.jsx)("div",{className:`w-3 h-3 rounded-full ${Tt.color}`}),(0,Dt.jsx)("span",{className:"font-medium text-muted-foreground",children:Tt.name}),(0,Dt.jsxs)("span",{className:"text-muted-foreground",children:["(",Le?.length,")"]}),(0,Dt.jsx)("div",{className:"ml-auto",children:ft?(0,Dt.jsx)(St.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Dt.jsx)(St.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ft&&(0,Dt.jsx)("div",{className:"space-y-2 pl-2",children:Le?.map(vo=>(0,Dt.jsx)(mt,{task:vo},vo.id))})]},Z)}),V?.length>0&&(()=>{let Z=d.has("no-epic");return(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>je("no-epic"),children:[(0,Dt.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Dt.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Dt.jsxs)("span",{className:"text-muted-foreground",children:["(",V?.length,")"]}),(0,Dt.jsx)("div",{className:"ml-auto",children:Z?(0,Dt.jsx)(St.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Dt.jsx)(St.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Z&&(0,Dt.jsx)("div",{className:"space-y-2 pl-2",children:V?.map(Le=>(0,Dt.jsx)(mt,{task:Le},Le.id))})]})})(),k?.length===0&&(0,Dt.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},f.id)})]}),(0,Dt.jsx)(Di,{isOpen:y,onClose:()=>E(!1),onAddSprint:go})]})})]})};var Ss=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),ks=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})},Aa=(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},Ia=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ps=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Rs=({colleagues:e,onAddReminder:t,open:o,setOpen:a})=>{let[r,i]=(0,fe.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[s,n]=(0,fe.useState)(!1),m=d=>{if(d.preventDefault(),!e.find(T=>T?.id.toString()===r.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let v={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(v),a(!1),i({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,fe.useEffect)(()=>{r.colleagueId&&n(!1)},[r.colleagueId]);let u=e.filter(Boolean);return(0,Dt.jsx)(Ge,{open:o,onOpenChange:a,children:(0,Dt.jsxs)(We,{className:"max-w-2xl",children:[(0,Dt.jsx)(Ke,{children:(0,Dt.jsx)(ze,{children:"Add New Reminder"})}),(0,Dt.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Dt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"title",children:"Title"}),(0,Dt.jsx)(ne,{id:"title",value:r.title,onChange:d=>i({...r,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"description",children:"Description"}),(0,Dt.jsx)(Me,{id:"description",value:r.description,onChange:d=>i({...r,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"dueDate",children:"Due Date"}),(0,Dt.jsx)(ne,{id:"dueDate",type:"date",value:r.dueDate,onChange:d=>i({...r,dueDate:d.target.value}),required:!0})]}),(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Dt.jsx)(ne,{id:"dueTime",type:"time",value:r.dueTime,onChange:d=>i({...r,dueTime:d.target.value})})]})]}),(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{className:`${s?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Dt.jsxs)(Xe,{value:r.colleagueId,onValueChange:d=>{i({...r,colleagueId:d})},required:!0,children:[(0,Dt.jsx)(Ze,{className:`${s?"text-destructive border-red-500":""}`,children:(0,Dt.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,Dt.jsx)(Je,{children:u.map(d=>(0,Dt.jsx)(xe,{value:d.id.toString(),children:d.name},d.id))})]}),s&&(0,Dt.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Dt.jsxs)("div",{className:"space-y-2",children:[(0,Dt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Dt.jsx)("input",{type:"checkbox",id:"isRecurring",checked:r.isRecurring,onChange:d=>i({...r,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Dt.jsx)(H,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Dt.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Dt.jsxs)(Xe,{value:r.recurrencePattern,onValueChange:d=>i({...r,recurrencePattern:d}),children:[(0,Dt.jsx)(Ze,{children:(0,Dt.jsx)(pt,{})}),(0,Dt.jsxs)(Je,{children:[(0,Dt.jsx)(xe,{value:"daily",children:"Daily"}),(0,Dt.jsx)(xe,{value:"weekly",children:"Weekly"}),(0,Dt.jsx)(xe,{value:"monthly",children:"Monthly"}),(0,Dt.jsx)(xe,{value:"yearly",children:"Yearly"})]})]})]}),(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Dt.jsx)(ne,{id:"recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:d=>i({...r,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Dt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Dt.jsx)(S,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,Dt.jsx)(S,{type:"submit",children:"Add Reminder"})]})]})]})})},Es=({reminder:e,colleagues:t,onUpdateReminder:o,open:a,onClose:r})=>{let[i,s]=(0,fe.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()},m=t.filter(Boolean);return(0,Dt.jsx)(Ge,{open:a,onOpenChange:r,children:(0,Dt.jsxs)(We,{className:"max-w-2xl",children:[(0,Dt.jsx)(Ke,{children:(0,Dt.jsx)(ze,{children:"Edit Reminder"})}),(0,Dt.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Dt.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"edit-title",children:"Title"}),(0,Dt.jsx)(ne,{id:"edit-title",value:i.title,onChange:u=>s({...i,title:u.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"edit-description",children:"Description"}),(0,Dt.jsx)(Me,{id:"edit-description",value:i.description||"",onChange:u=>s({...i,description:u.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Dt.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Dt.jsx)(ne,{id:"edit-dueDate",type:"date",value:i.dueDate,onChange:u=>s({...i,dueDate:u.target.value}),required:!0})]}),(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(H,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Dt.jsx)(ne,{id:"edit-dueTime",type:"time",value:i.dueTime,onChange:u=>s({...i,dueTime:u.target.value})})]})]}),(0,Dt.jsx)("div",{className:"space-y-2",children:(0,Dt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Dt.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:i.isRecurring||!1,onChange:u=>s({...i,isRecurring:u.target.checked}),className:"rounded border-border"}),(0,Dt.jsx)(H,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Dt.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Dt.jsx)(S,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),(0,Dt.jsx)(S,{type:"submit",children:"Save Changes"})]})]})]})})},Ms=({reminder:e,colleagues:t,onUpdateReminder:o,onDeleteReminder:a})=>{let[r,i]=(0,fe.useState)(!1);if(!e||!e.id)return null;let s=Aa(new Date(e.dueDate||""),e.dueTime||""),n=Ia(new Date(e.dueDate||"")),m=Ps(new Date(e.dueDate||"")),u=()=>{o(e.id.toString(),{})},d=()=>n?"Today":m?"Tomorrow":Ss(new Date(e.dueDate||""));return(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(Es,{reminder:e,colleagues:t,onUpdateReminder:o,open:r,onClose:()=>i(!1)}),(0,Dt.jsx)(be,{children:(0,Dt.jsx)(ao,{className:"p-4",children:(0,Dt.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Dt.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Dt.jsx)("button",{onClick:u,className:"mt-1 text-primary hover:text-primary/80"}),(0,Dt.jsxs)("div",{className:"flex-1",children:[(0,Dt.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Dt.jsx)("h3",{children:e.title})}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Dt.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Dt.jsx)(St.Calendar,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{className:s?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Dt.jsx)(St.Clock,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{children:ks(e.dueTime)})]}),(0,Dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Dt.jsx)(St.User,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Dt.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Dt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>i(!0),className:"h-8 w-8 p-0",children:(0,Dt.jsx)(St.Edit2,{className:"h-4 w-4"})}),(0,Dt.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>a(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Dt.jsx)(St.Trash2,{className:"h-4 w-4"})})]})]})})})]})},ki=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:o,onUpdateReminder:a,onDeleteReminder:r})=>{let[i,s]=(0,fe.useState)(e.filter(Boolean)),[n,m]=(0,fe.useState)(t.filter(Boolean)),[u,d]=(0,fe.useState)("all"),[g,v]=(0,fe.useState)(""),[T,y]=(0,fe.useState)(!1);(0,fe.useEffect)(()=>{s(e.filter(Boolean))},[e]),(0,fe.useEffect)(()=>{m(t.filter(Boolean))},[t]);let E=M=>{if(!M.title){console.error("Invalid reminder data:",M);return}let Q={...M,id:Date.now(),createdAt:new Date().toISOString()};s(ee=>[...ee,Q]),o?.(M)},p=(M,Q)=>{if(!M){console.error("No reminder ID provided for update");return}s(ee=>ee.map(j=>j?.id.toString()===M?{...j,...Q}:j)),a?.(M,Q)},b=M=>{if(!M){console.error("No reminder ID provided for deletion");return}s(Q=>Q.filter(ee=>ee?.id.toString()!==M)),r?.(M)},N=i.filter(M=>{if(!M)return!1;if(g){let Q=g.toLowerCase();if(!(M.title.toLowerCase().includes(Q)||M.description?.toLowerCase().includes(Q)))return!1}switch(u){case"pending":case"completed":case"overdue":return Aa(new Date(M.dueDate||""),M.dueTime||"");case"today":return Ia(new Date(M.dueDate||""));default:return!0}}).sort((M,Q)=>{if(!M||!Q)return 0;let ee={high:3,medium:2,low:1},j=0;return j!==0?j:new Date(M.dueDate||"").getTime()-new Date(Q.dueDate||"").getTime()}),C={total:i.filter(Boolean).length,overdue:i.filter(M=>M&&Aa(new Date(M.dueDate||""),M.dueTime||"")).length,today:i.filter(M=>M&&Ia(new Date(M.dueDate||""))).length},Y=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Dt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Dt.jsx)(yt,{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:()=>{y(!0)}}}),(0,Dt.jsxs)("div",{className:"h-full bg-background",children:[(0,Dt.jsx)(Rs,{colleagues:n,onAddReminder:E,open:T,setOpen:y}),(0,Dt.jsxs)("div",{className:"p-6",children:[(0,Dt.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Dt.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Dt.jsxs)(S,{className:"flex items-center space-x-2",onClick:()=>y(!0),children:[(0,Dt.jsx)(St.Plus,{className:"h-4 w-4"}),(0,Dt.jsx)("span",{children:"Add Reminder"})]})]}),(0,Dt.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Dt.jsxs)(be,{className:"p-4",children:[(0,Dt.jsx)("div",{className:"text-2xl font-bold text-foreground",children:C.total}),(0,Dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Dt.jsxs)(be,{className:"p-4",children:[(0,Dt.jsx)("div",{className:"text-2xl font-bold text-primary",children:C.overdue}),(0,Dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Dt.jsxs)(be,{className:"p-4",children:[(0,Dt.jsx)("div",{className:"text-2xl font-bold text-success",children:C.today}),(0,Dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Dt.jsxs)(be,{className:"p-4",children:[(0,Dt.jsx)("div",{className:"text-2xl font-bold text-destructive",children:C.overdue}),(0,Dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Dt.jsxs)(be,{className:"p-4",children:[(0,Dt.jsx)("div",{className:"text-2xl font-bold text-warning",children:C.today}),(0,Dt.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Dt.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Dt.jsx)("div",{className:"flex-1",children:(0,Dt.jsx)(ne,{placeholder:"Search reminders...",value:g,onChange:M=>v(M.target.value),className:"max-w-md"})}),(0,Dt.jsxs)(Xe,{value:u,onValueChange:M=>d(M),children:[(0,Dt.jsx)(Ze,{className:"w-40",children:(0,Dt.jsx)(pt,{})}),(0,Dt.jsxs)(Je,{children:[(0,Dt.jsxs)(xe,{value:"all",children:["All (",C.total,")"]}),(0,Dt.jsxs)(xe,{value:"overdue",children:["Overdue (",C.overdue,")"]}),(0,Dt.jsxs)(xe,{value:"overdue",children:["Overdue (",C.overdue,")"]}),(0,Dt.jsxs)(xe,{value:"today",children:["Today (",C.today,")"]})]})]})]}),(0,Dt.jsx)("div",{className:"space-y-4",children:N.length===0?(0,Dt.jsxs)(be,{className:"p-8 text-center",children:[(0,Dt.jsx)("div",{className:"text-muted-foreground",children:g||u!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&u==="all"&&(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground/60 mt-2",children:"Create your first reminder to get started"})]}):N.map(M=>M&&(0,Dt.jsx)(Ms,{reminder:M,colleagues:n,onUpdateReminder:p,onDeleteReminder:b},M.id))})]})]})]})};function Ri({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:r="700px",gridCols:i=6}){let s=o.find(n=>n.value===e);return(0,Dt.jsxs)(Ra.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,Dt.jsx)("div",{className:"hidden lg:block",children:(0,Dt.jsx)(ci,{value:e,onValueChange:t,children:(0,Dt.jsx)(mi,{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,Dt.jsx)(Ra.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Dt.jsx)(pi,{value:n.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:n.label})},n.value))})})}),(0,Dt.jsx)("div",{className:"lg:hidden",children:(0,Dt.jsxs)(lo,{children:[(0,Dt.jsx)(co,{asChild:!0,children:(0,Dt.jsxs)(S,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[s?.label||"Select",(0,Dt.jsx)(St.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Dt.jsx)(Zt,{align:"center",className:"w-[180px]",children:o.map(n=>(0,Dt.jsx)(Jt,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function La({initialFiles:e=[],onFileAdd:t,onFileEdit:o,onFileDelete:a,onFileClick:r,onFileUpdate:i,compactView:s=!1,className:n}){let[m,u]=(0,fe.useState)(e),[d,g]=(0,fe.useState)(""),[v,T]=(0,fe.useState)("all"),[y,E]=(0,fe.useState)("all"),[p,b]=(0,fe.useState)(!1),z=(0,fe.useRef)(""),N=I=>I.map(ve=>`${ve.id}-${new Date(ve.createdAt).getTime()}-${new Date(ve.updatedAt).getTime()}`).join("-");(0,fe.useEffect)(()=>{let I=N(e.map(ve=>({...ve,updatedAt:new Date().toISOString()})));I!==z.current&&(u(e),z.current=I)},[e]);let C=m.filter(I=>I.name.toLowerCase().includes(d.toLowerCase())),Y=C.slice(0,10),M=C.filter(Boolean),Q=()=>{b(!0)},ee=I=>{o?.(I)},j=I=>{console.log("deleting file",I),u(ve=>ve.filter(ke=>ke.name!==I.name)),a?.(I.id.toString())},me=I=>{r?.(I)},ye=()=>{g(""),T("all")};return(0,Dt.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Dt.jsx)(Ra.AnimatePresence,{mode:"wait",children:(0,Dt.jsx)(Ra.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Dt.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Dt.jsx)(yt,{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:Q},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Dt.jsx)(be,{children:(0,Dt.jsx)(ao,{className:"pt-6",children:(0,Dt.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Dt.jsx)("div",{className:"flex-1",children:(0,Dt.jsxs)("div",{className:"relative",children:[(0,Dt.jsx)(St.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Dt.jsx)(ne,{placeholder:"Search files...",value:d,onChange:I=>g(I.target.value),className:"pl-9"})]})}),(d||v!=="all")&&(0,Dt.jsxs)(S,{variant:"outline",onClick:ye,className:"gap-2",children:[(0,Dt.jsx)(St.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Dt.jsxs)("div",{className:"space-y-4",children:[(0,Dt.jsx)(Ri,{activeTab:y,onTabChange:E,tabOptions:[{value:"all",label:`All Files (${C.length})`},{value:"recent",label:`Recent (${Y.length})`}],maxWidth:"500px",gridCols:3}),y==="all"&&(0,Dt.jsx)(po,{files:C,onFileClick:me,onFileUpdate:i,onFileDelete:j,showHeader:!s}),y==="recent"&&(0,Dt.jsx)(po,{files:Y,onFileClick:me,onFileUpdate:i,onFileDelete:j,showHeader:!s}),y==="shared"&&(0,Dt.jsx)(po,{files:M,onFileClick:me,onFileUpdate:i,onFileDelete:j,showHeader:!s})]}),C.length===0&&(0,Dt.jsx)(be,{children:(0,Dt.jsx)(ao,{className:"pt-6",children:(0,Dt.jsxs)("div",{className:"text-center py-8",children:[(0,Dt.jsx)(St.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Dt.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Dt.jsx)("p",{className:"text-muted-foreground mb-4",children:d||v!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Dt.jsxs)(S,{onClick:Q,className:"gap-2",children:[(0,Dt.jsx)(St.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Dt.jsx)(Xo,{isOpen:p,onClose:()=>b(!1),onAddFile:t})]})}var Ei=require("next/navigation");function Mi({title:e="",initialTasks:t=[],initialEpics:o=[],initialSprints:a=[],initialProjects:r=[],initialReminders:i=[],initialColleagues:s=[],initialUsers:n=[],initialFiles:m=[],initialView:u="kanban",onAddTask:d,onUpdateTask:g,onDeleteTask:v,onTaskClick:T,onAddEpic:y,onUpdateEpic:E,onDeleteEpic:p,onAddTaskToEpic:b,onAddSprint:z,onUpdateSprint:N,onDeleteSprint:C,onAddProject:Y,onUpdateProject:M,onDeleteProject:Q,onFileAdd:ee,onFileEdit:j,onFileDelete:me,onFileClick:ye,onAddReminder:I,onUpdateReminder:ve,onDeleteReminder:ke,onViewChange:R,onToggleMobileMenu:J,onTeamClick:ie,onTeamChange:Ee,onCopilotClick:ce,handleAddComment:te}){let[w,K]=(0,fe.useState)(t),[De,ot]=(0,fe.useState)(o),[de,je]=(0,fe.useState)(a),[go,Nt]=(0,fe.useState)(r),[fo,Ct]=(0,fe.useState)(i),[Bt,Yt]=(0,fe.useState)(s),[Vt,Qt]=(0,fe.useState)(n),[eo,mt]=(0,fe.useState)(m),[f,k]=(0,fe.useState)(!1),[h,P]=(0,fe.useState)(!1),[V,Z]=(0,fe.useState)(null),[Le,Tt]=(0,fe.useState)(null),[ft,vo]=(0,fe.useState)(null),[Ut,Oa]=(0,fe.useState)(u||"kanban"),[Is,Ai]=(0,fe.useState)(!1),Ii=(0,Ei.useRouter)();(0,fe.useEffect)(()=>{K(t)},[t]),(0,fe.useEffect)(()=>{je(a)},[a]),(0,fe.useEffect)(()=>{ot(o)},[o]),(0,fe.useEffect)(()=>{Nt(r)},[r]),(0,fe.useEffect)(()=>{mt(m)},[m]),(0,fe.useEffect)(()=>{Qt(n)},[n]),(0,fe.useEffect)(()=>{Yt(s)},[s]),(0,fe.useEffect)(()=>{Ct(i)},[i]),(0,fe.useEffect)(()=>{Oa(u)},[u]);let Fi=w.filter(x=>{}),Fs=x=>Fi.filter(B=>B.status===x),Ls=x=>{let B={};return De.forEach($=>{}),B},Os=x=>{vo(x)},Hs=x=>{ft&&(K(B=>B.map($=>$.id===ft.id?{...$,status:x}:$)),vo(null))},Ha=x=>{let B={...x,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};K($=>[...$,B]),d?.(B)},Io=async(x,B)=>(K($=>$.map(Oe=>Oe.id===Number(x)?{...Oe,...B}:Oe)),await g?.(x,B)),Bs=async(x,B)=>{Io(x,B)},Ba=x=>{K(B=>B.filter($=>$.id!==Number(x))),V?.id===Number(x)&&Z(null),v?.(x)},Vs=async x=>{Ba(x)},Us=x=>{let B={...x,id:Date.now()};Nt($=>[...$,B]),Y?.(x)},zs=(x,B)=>{Nt($=>$.map(Oe=>Oe.id===Number(x)?{...Oe,...B}:Oe)),M?.(x,B)},$s=x=>{Nt(B=>B.filter($=>$.id!==Number(x))),Q?.(x)},Va=x=>{let B={...x,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};ot($=>[...$,B]),y?.({...B})},Li=()=>{P(!0)},Oi=(x,B)=>{ot($=>$.map(Oe=>Oe.id===Number(x)?{...Oe,...B}:Oe)),E?.(x,B)},Hi=x=>{ot(B=>B.filter($=>$.id!==Number(x))),K(B=>B.filter($=>Re($.epic)!==Number(x))),p?.(x)},Bi=x=>{let B={...x,id:Date.now()};je($=>[...$,B]),z?.(x)},Vi=(x,B)=>{je($=>$.map(Oe=>Oe.id===Number(x)?{...Oe,...B}:Oe)),N?.(x,B)},Ui=x=>{x==="backlog"||x==="all-tasks"||(je(B=>B.filter($=>$.id!==Number(x))),K(B=>B.map($=>Re($.sprint)===Number(x)?{...$,sprint:void 0}:$)),C?.(x))},ta=x=>{Z(x)},zi=x=>{x==="planning"&&window.innerWidth<768||(Oa(x),R?.(x))},_s=()=>{Ai(x=>!x),J?.()},Gs=()=>{Ii.push("/")},js=x=>{console.log("Switching to team:",x)},Ws=x=>{console.log("Switching to team:",x)},$i=x=>{k(!0)},_i=()=>{k(!1),Tt(null)},Gi=x=>{let B={...x,id:Date.now(),createdAt:new Date().toISOString()};Ct($=>[...$,B]),I?.(x)},ji=(x,B)=>{Ct($=>$.map(Oe=>Oe.id===Number(x)?{...Oe,...B}:Oe)),ve?.(x,B)},Wi=x=>{Ct(B=>B.filter($=>$.id!==Number(x))),ke?.(x)},Ki=()=>{ee?.()},Zi=x=>{j?.(x)},Ji=x=>{mt(B=>B.filter($=>$.name!==x)),me?.(x)},qi=x=>{ye?.(x)},Ks=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Zs=()=>{switch(Ut){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"}},oa=[{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=oa.sort((x,B)=>B.lastUsed.getTime()-x.lastUsed.getTime()).slice(0,3),qs=oa.length>3,Xs=oa.slice(3);return(0,Dt.jsxs)(za,{currentView:Ut,onViewChange:zi,children:[Ut==="kanban"&&(0,Dt.jsx)("div",{className:"h-full overflow-hidden",children:(0,Dt.jsx)(Ni,{initialProjects:go,initialEpics:De,initialSprints:de.map(x=>({...x,isSelected:!1})),initialTasks:w,initialColleagues:Bt,initialUsers:Vt,onAddTask:Ha,onUpdateTask:Io,onDeleteTask:Ba,onTaskClick:ta,onAddEpic:Va,onAddComment:te})}),Ut==="planning"&&(0,Dt.jsx)("div",{className:"hidden md:block h-full",children:(0,Dt.jsx)(Si,{tasks:w,epics:De,sprints:de,onUpdateTask:Io,onTaskClick:ta,onAddSprint:Bi,onUpdateSprint:Vi,onDeleteSprint:Ui})}),Ut==="tasks"&&(0,Dt.jsx)("div",{className:"h-full",children:(0,Dt.jsx)(ki,{initialReminders:fo,initialColleagues:Bt,onAddReminder:Gi,onUpdateReminder:ji,onDeleteReminder:Wi})}),Ut==="files"&&(0,Dt.jsx)("div",{className:"h-full",children:(0,Dt.jsx)(La,{initialFiles:eo,onFileAdd:Ki,onFileEdit:Zi,onFileDelete:Ji,onFileClick:qi,compactView:!1})}),Ut==="epics"&&(0,Dt.jsx)("div",{className:"h-full",children:(0,Dt.jsx)(Ci,{tasks:w,epics:De,sprints:de,onUpdateTask:Io,onTaskClick:ta,onAddTaskToEpic:$i,onAddEpic:Li,onUpdateEpic:Oi,onDeleteEpic:Hi})}),(0,Dt.jsx)(io,{isOpen:f,onClose:_i,onAddTask:Ha,epics:De,sprints:de,assignees:[...Bt,...Vt],defaultEpicId:Le||void 0}),(0,Dt.jsx)(uo,{isOpen:h,onClose:()=>P(!1),onAddEpic:Va})]})}