@libxai/board 0.11.0 → 0.11.2
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.
- package/dist/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
'use strict';var client=require('react-dom/client'),core=require('@libxai/core'),
|
|
2
|
-
`)}async function
|
|
3
|
-
`)?`"${e.replace(/"/g,'""')}"`:e}async function qs(e,t,r,a){switch(t){case "json":return
|
|
4
|
-
`);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let r=Zs(t[0]),a=[],n=new Map,o=[];for(let i=1;i<t.length;i++)try{let l=Zs(t[i]||"");if(l.length>r.length){o.push(`Line ${i+1}: Too many columns`);continue}if(r.length-l.length>3){o.push(`Line ${i+1}: Column count mismatch (expected ${r.length}, got ${l.length})`);continue}for(;l.length<r.length;)l.push("");let s={};r.forEach((p,x)=>{s[p]=l[x]||"";});let u=s.Column||"Unnamed";n.has(u)||n.set(u,{id:`col-${n.size+1}`,title:u,position:n.size+1,cardIds:[]});let d=n.get(u),f={id:s["Card ID"]||`card-${i}`,title:s.Title||"Untitled",description:s.Description?s.Description:void 0,columnId:d.id,position:d.cardIds.length+1,priority:s.Priority||void 0,labels:s.Labels?s.Labels.split(";").filter(Boolean):void 0,assignedUserIds:s["Assigned Users"]?s["Assigned Users"].split(";").filter(Boolean):void 0,startDate:s["Start Date"]?s["Start Date"]:void 0,endDate:s["End Date"]?s["End Date"]:void 0,createdAt:s["Created At"]?s["Created At"]:void 0,updatedAt:s["Updated At"]?s["Updated At"]:void 0};a.push(f),d.cardIds.push(f.id);}catch(l){o.push(`Line ${i+1}: ${l instanceof Error?l.message:"Unknown error"}`);}return a.length===0?{success:!1,errors:["No valid cards found in CSV",...o]}:{success:!0,cardsImported:a.length,columnsImported:n.size,errors:o.length>0?o:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function Zs(e){let t=[],r="",a=false;for(let n=0;n<e.length;n++){let o=e[n],i=e[n+1];o==='"'&&a&&i==='"'?(r+='"',n++):o==='"'?a=!a:o===","&&!a?(t.push(r),r=""):r+=o;}return t.push(r),t}function Js(e,t){switch(t){case "json":return fd(e);case "csv":return gd(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function Qs(e){return new Promise((t,r)=>{let a=new FileReader;a.onload=n=>{n.target?.result?t(n.target.result):r(new Error("Failed to read file"));},a.onerror=()=>r(new Error("Failed to read file")),a.readAsText(e);})}function Pe({children:e,container:t}){let[r,a]=xe.useState(false);if(xe.useEffect(()=>(a(true),()=>a(false)),[]),!r)return null;let n=t||(typeof document<"u"?document.body:null);return n?Gi.createPortal(e,n):null}var ri={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},yd="#BDC3C7",xd=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]});function ai({priority:e,onChange:t,className:r}){let[a,n]=xe.useState(false),[o,i]=xe.useState({top:0,left:0}),l=xe.useRef(null),c=xe.useRef(null);xe.useEffect(()=>{if(a&&c.current){let f=c.current.getBoundingClientRect();i({top:f.bottom+window.scrollY+8,left:f.left+window.scrollX});}},[a]),xe.useEffect(()=>{let f=p=>{l.current&&!l.current.contains(p.target)&&!c.current?.contains(p.target)&&n(false);};if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a]),xe.useEffect(()=>{let f=p=>{p.key==="Escape"&&n(false);};if(a)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]);let s=f=>{t(f),n(false);},u=e?ri[e]:null,d=u?.color||yd;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:c,onClick:()=>n(!a),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:e?`${d}10`:"transparent",boxShadow:e?`0 0 0 2px ${d}30 inset`:"none"},title:u?.label||"Set priority",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:d,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:d,fillOpacity:e?"0.6":"0.4"})})}),a&&jsxRuntime.jsx(Pe,{children:jsxRuntime.jsxs("div",{ref:l,className:"priority-selector-menu",style:{position:"absolute",top:`${o.top}px`,left:`${o.left}px`,zIndex:99999,minWidth:"160px",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Priority"})}),jsxRuntime.jsxs("div",{className:"py-1",children:[Object.entries(ri).map(([f,p])=>jsxRuntime.jsxs("button",{onClick:()=>s(f),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98] priority-option",style:{color:p.color,background:"transparent"},onMouseEnter:x=>{x.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:x=>{x.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(xd,{color:p.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:p.label}),e===f&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},f)),jsxRuntime.jsx("div",{className:"mt-0.5 pt-0.5 border-t",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsxs("button",{onClick:()=>s(void 0),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98]",style:{color:"var(--modal-v2-text-primary, #e5e5e5)",background:"transparent"},onMouseEnter:f=>{f.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:f=>{f.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var kd=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function Xa({startDate:e,endDate:t,onChange:r,className:a}){let[n,o]=xe.useState(false),[i,l]=xe.useState({top:0,left:0}),c=xe.useRef(null),s=xe.useRef(null);xe.useEffect(()=>{if(n&&s.current){let y=s.current.getBoundingClientRect();l({top:y.bottom+window.scrollY+8,left:y.left+window.scrollX});}},[n]),xe.useEffect(()=>{let y=g=>{c.current&&!c.current.contains(g.target)&&!s.current?.contains(g.target)&&o(false);};if(n)return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]),xe.useEffect(()=>{let y=g=>{g.key==="Escape"&&o(false);};if(n)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]);let u=y=>{let g=new Date,h=w=>{let b=w.getFullYear(),T=String(w.getMonth()+1).padStart(2,"0"),C=String(w.getDate()).padStart(2,"0");return `${b}-${T}-${C}`},v=h(g),m=new Date(g);m.setDate(m.getDate()+y);let k=h(m);r(v,k),o(false);},d=()=>{if(!e||!t)return "Set date";let y=m=>{if(m instanceof Date)return m;if(typeof m!="string"||!m.match(/^\d{4}-\d{2}-\d{2}$/))return null;let k=m.split("-").map(Number);if(k.length!==3||k.some(C=>isNaN(C)))return null;let w=k[0],b=k[1],T=k[2];return w===void 0||b===void 0||T===void 0?null:new Date(w,b-1,T)},g=y(e),h=y(t);if(!g||!h||isNaN(g.getTime())||isNaN(h.getTime()))return "Set date";let v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${v[g.getMonth()]} ${g.getDate()} \u2013 ${v[h.getMonth()]} ${h.getDate()}`},f=e&&t,x=(()=>{if(!t)return false;let y=typeof t=="string"?new Date(t):t,g=new Date;return g.setHours(0,0,0,0),y<g})();return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsxs("button",{ref:s,onClick:()=>o(!n),className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${x?"asakaa-date-overdue":"asakaa-date"}`,title:f?`${d()}`:"Set date range",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:d()})]}),n&&jsxRuntime.jsx(Pe,{children:jsxRuntime.jsxs("div",{ref:c,className:"date-picker-menu absolute rounded-xl shadow-2xl border min-w-[320px]",style:{top:`${i.top}px`,left:`${i.left}px`,background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:kd.map(y=>jsxRuntime.jsx("button",{onClick:()=>u(y.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95 border",style:{color:"var(--modal-v2-text-primary, #60a5fa)",borderColor:"var(--modal-v2-border, rgba(96, 165, 250, 0.3))",background:"var(--modal-v2-bg-secondary, rgba(96, 165, 250, 0.08))"},onMouseEnter:g=>{g.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(96, 165, 250, 0.15))";},onMouseLeave:g=>{g.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(96, 165, 250, 0.08))";},children:y.label},y.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:y=>r(y.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:y=>r(e,y.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{r(void 0,void 0),o(false);},className:"mt-4 w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear Dates"})]})]})})]})}function Za({assignedUsers:e=[],availableUsers:t,onChange:r,className:a,maxVisibleAvatars:n=3}){let[o,i]=xe.useState(false),[l,c]=xe.useState(""),[s,u]=xe.useState({top:0,left:0}),d=xe.useRef(null),f=xe.useRef(null);xe.useEffect(()=>{if(o&&f.current){let h=f.current.getBoundingClientRect();u({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[o]),xe.useEffect(()=>{let h=v=>{d.current&&!d.current.contains(v.target)&&!f.current?.contains(v.target)&&(i(false),c(""));};if(o)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o]),xe.useEffect(()=>{let h=v=>{v.key==="Escape"&&(i(false),c(""));};if(o)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[o]);let p=h=>{let v=e.some(m=>m.id===h.id);r(v?e.filter(m=>m.id!==h.id):[...e,h]);},x=t.filter(h=>h.name.toLowerCase().includes(l.toLowerCase())),y=e.slice(0,n),g=e.length-n;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:f,onClick:()=>i(!o),className:"flex items-center gap-1 p-0.5 rounded transition-all hover:bg-white/10 hover:scale-105 active:scale-95",title:e.length>0?`${e.length} assigned`:"Assign users",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[y.map(h=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:h.name,children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"asakaa-avatar-img"}):h.initials},h.id)),g>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",g]})]}):jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center transition-all",style:{background:"rgba(96, 165, 250, 0.15)",border:"1.5px solid rgba(96, 165, 250, 0.4)",color:"#60a5fa"},children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),o&&jsxRuntime.jsx(Pe,{children:jsxRuntime.jsxs("div",{ref:d,className:"user-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${s.top}px`,left:`${s.left}px`,background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Assign Users"})}),jsxRuntime.jsx("div",{className:"px-3 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("input",{type:"text",value:l,onChange:h=>c(h.target.value),placeholder:"Search users...",className:"w-full px-3 py-2.5 rounded-lg text-sm border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[300px] overflow-y-auto",children:x.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-sm text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.6))"},children:"No users found"}):x.map(h=>{let v=e.some(m=>m.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>p(h),className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm transition-all active:scale-98",style:{background:"transparent"},onMouseEnter:m=>{m.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:m=>{m.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:h.color,color:"#fff"},children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"w-full h-full rounded-full object-cover"}):h.initials}),jsxRuntime.jsx("span",{className:"font-semibold flex-1 text-left",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),v&&jsxRuntime.jsx("span",{className:"text-lg",style:{color:"#3b82f6"},children:"\u2713"})]},h.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-3 border-t border-white/10",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),i(false);},className:"w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear All"})})]})})]})}function li({currentCardId:e,dependencies:t=[],availableTasks:r,onChange:a,className:n}){let[o,i]=xe.useState(false),[l,c]=xe.useState(""),[s,u]=xe.useState(t.length>0),[d,f]=xe.useState({top:0,left:0}),p=xe.useRef(null),x=xe.useRef(null);xe.useEffect(()=>{if(o&&x.current){let m=x.current.getBoundingClientRect();f({top:m.bottom+window.scrollY+8,left:m.left+window.scrollX});}},[o]),xe.useEffect(()=>{let m=k=>{p.current&&!p.current.contains(k.target)&&!x.current?.contains(k.target)&&(i(false),c(""));};if(o)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]),xe.useEffect(()=>{let m=k=>{k.key==="Escape"&&(i(false),c(""));};if(o)return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[o]);let y=m=>{if(t.includes(m)){let w=t.filter(b=>b!==m);a(w),w.length===0&&u(false);}else a([...t,m]),u(true);},g=()=>{let m=!s;u(m),m||a([]);},h=r.filter(m=>m.id!==e).filter(m=>m.title.toLowerCase().includes(l.toLowerCase())||m.id.toLowerCase().includes(l.toLowerCase())),v=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${n||""}`,children:[jsxRuntime.jsxs("button",{ref:x,onClick:()=>i(!o),className:"flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5",title:t.length>0?`${t.length} dependencies`:"Add dependencies",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:v,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:v},children:t.length})]}),o&&jsxRuntime.jsx(Pe,{children:jsxRuntime.jsxs("div",{ref:p,className:"dependencies-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${d.top}px`,left:`${d.left}px`,background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Task Dependencies"})}),jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",onClick:g,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:s?"#3b82f6":"transparent",borderColor:s?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:s&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.8))"},children:"Has dependencies"})]})}),s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("input",{type:"text",value:l,onChange:m=>c(m.target.value),placeholder:"Search by name or ID...",className:"w-full px-3 py-2 rounded-md text-xs border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[280px] overflow-y-auto",children:h.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-xs text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:"No tasks found"}):h.map(m=>{let k=t.includes(m.id);return jsxRuntime.jsxs("button",{onClick:()=>y(m.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:w=>{w.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:w=>{w.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0 mt-0.5 transition-all",style:{background:k?"#3b82f6":"transparent",borderColor:k?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:k&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:"font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.9))"},children:m.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:m.id})]})]},m.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),u(false),i(false);},className:"w-full px-3 py-2 rounded-md text-xs font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#E74C3C"},children:"Clear All Dependencies"})})]})})]})}var sr=xe.memo(({card:e,render:t,onClick:r,isSelected:a,disableDrag:n,className:o,onUpdate:i,availableUsers:l=[],allCards:c=[]})=>{let{attributes:s,listeners:u,setNodeRef:d,transform:f,transition:p,isDragging:x}=sortable.useSortable({id:e.id,disabled:n,data:{type:"card",card:e}}),y={transform:Ka.Transform.toString(f),transition:p};if(t)return jsxRuntime.jsx("div",{ref:d,style:y,...s,...u,onClick:()=>r?.(e),children:t(e)});let g=l.filter(h=>e.assignedUserIds?.includes(h.id));return jsxRuntime.jsxs("div",{ref:d,style:y,className:te("asakaa-card",x&&"asakaa-card-dragging",a&&"ring-2 ring-asakaa-accent-blue",o),...s,...u,onClick:h=>{h.target.closest(".priority-selector, .date-picker, .user-selector, .dependencies-selector")||r?.(e);},children:[e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-cover mb-3",children:jsxRuntime.jsx("img",{src:e.coverImage,alt:`Cover for ${e.title}`,className:"w-full h-32 object-cover rounded-md",loading:"lazy",onError:h=>{h.currentTarget.style.display="none";}})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"asakaa-card-description mb-3",children:e.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3 pt-1",children:[jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(ai,{priority:e.priority,onChange:h=>i?.(e.id,{priority:h})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(Xa,{startDate:e.startDate?typeof e.startDate=="string"?e.startDate:e.startDate.toISOString().split("T")[0]:void 0,endDate:e.endDate?typeof e.endDate=="string"?e.endDate:e.endDate.toISOString().split("T")[0]:void 0,onChange:(h,v)=>i?.(e.id,{startDate:h,endDate:v})})}),l.length>0&&jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(Za,{assignedUsers:g,availableUsers:l,onChange:h=>i?.(e.id,{assignedUserIds:h.map(v=>v.id)})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(li,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(h=>typeof h=="string"?h:h.taskId):[],availableTasks:c,onChange:h=>i?.(e.id,{dependencies:h})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(h=>jsxRuntime.jsx("span",{className:"asakaa-label",children:h},h))})]})},(e,t)=>e.card.id===t.card.id&&e.card.title===t.card.title&&e.card.description===t.card.description&&e.card.position===t.card.position&&e.card.columnId===t.card.columnId&&e.card.priority===t.card.priority&&e.card.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies));sr.displayName="Card";function Qa(){return typeof window<"u"}function gr(e){return oo(e)?(e.nodeName||"").toLowerCase():"#document"}function xt(e){var t;return (e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _t(e){var t;return (t=(oo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oo(e){return Qa()?e instanceof Node||e instanceof xt(e).Node:false}function ut(e){return Qa()?e instanceof Element||e instanceof xt(e).Element:false}function Bt(e){return Qa()?e instanceof HTMLElement||e instanceof xt(e).HTMLElement:false}function no(e){return !Qa()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof xt(e).ShadowRoot}var Sd=new Set(["inline","contents"]);function ea(e){let{overflow:t,overflowX:r,overflowY:a,display:n}=Tt(e);return /auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!Sd.has(n)}var Nd=new Set(["table","td","th"]);function di(e){return Nd.has(gr(e))}var Dd=[":popover-open",":modal"];function ha(e){return Dd.some(t=>{try{return e.matches(t)}catch{return false}})}var Ed=["transform","translate","scale","rotate","perspective"],Rd=["transform","translate","scale","rotate","perspective","filter"],Pd=["paint","layout","strict","content"];function en(e){let t=va(),r=ut(e)?Tt(e):e;return Ed.some(a=>r[a]?r[a]!=="none":false)||(r.containerType?r.containerType!=="normal":false)||!t&&(r.backdropFilter?r.backdropFilter!=="none":false)||!t&&(r.filter?r.filter!=="none":false)||Rd.some(a=>(r.willChange||"").includes(a))||Pd.some(a=>(r.contain||"").includes(a))}function ui(e){let t=er(e);for(;Bt(t)&&!hr(t);){if(en(t))return t;if(ha(t))return null;t=er(t);}return null}function va(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}var Id=new Set(["html","body","#document"]);function hr(e){return Id.has(gr(e))}function Tt(e){return xt(e).getComputedStyle(e)}function ba(e){return ut(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function er(e){if(gr(e)==="html")return e;let t=e.assignedSlot||e.parentNode||no(e)&&e.host||_t(e);return no(t)?t.host:t}function pi(e){let t=er(e);return hr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bt(t)&&ea(t)?t:pi(t)}function ir(e,t,r){var a;t===void 0&&(t=[]),r===void 0&&(r=true);let n=pi(e),o=n===((a=e.ownerDocument)==null?void 0:a.body),i=xt(n);if(o){let l=tn(i);return t.concat(i,i.visualViewport||[],ea(n)?n:[],l&&r?ir(l):[])}return t.concat(n,ir(n,[],r))}function tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var tr=Math.min,kt=Math.max,xa=Math.round,ka=Math.floor,$t=e=>({x:e,y:e}),Md={left:"right",right:"left",bottom:"top",top:"bottom"},Ad={start:"end",end:"start"};function an(e,t,r){return kt(e,tr(t,r))}function Ar(e,t){return typeof e=="function"?e(t):e}function lr(e){return e.split("-")[0]}function Lr(e){return e.split("-")[1]}function so(e){return e==="x"?"y":"x"}function nn(e){return e==="y"?"height":"width"}var Ld=new Set(["top","bottom"]);function rr(e){return Ld.has(lr(e))?"y":"x"}function on(e){return so(rr(e))}function gi(e,t,r){r===void 0&&(r=false);let a=Lr(e),n=on(e),o=nn(n),i=n==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ya(i)),[i,ya(i)]}function hi(e){let t=ya(e);return [rn(e),t,rn(t)]}function rn(e){return e.replace(/start|end/g,t=>Ad[t])}var mi=["left","right"],fi=["right","left"],Fd=["top","bottom"],Bd=["bottom","top"];function Od(e,t,r){switch(e){case "top":case "bottom":return r?t?fi:mi:t?mi:fi;case "left":case "right":return t?Fd:Bd;default:return []}}function vi(e,t,r,a){let n=Lr(e),o=Od(lr(e),r==="start",a);return n&&(o=o.map(i=>i+"-"+n),t&&(o=o.concat(o.map(rn)))),o}function ya(e){return e.replace(/left|right|bottom|top/g,t=>Md[t])}function zd(e){return {top:0,right:0,bottom:0,left:0,...e}}function io(e){return typeof e!="number"?zd(e):{top:e,right:e,bottom:e,left:e}}function Fr(e){let{x:t,y:r,width:a,height:n}=e;return {width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}var Ud=typeof document<"u",Gd=function(){},Ca=Ud?xe.useLayoutEffect:Gd,_d={...xe__namespace};var $d=_d.useInsertionEffect,Wd=$d||(e=>e());function bi(e){let t=xe__namespace.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Wd(()=>{t.current=e;}),xe__namespace.useCallback(function(){for(var r=arguments.length,a=new Array(r),n=0;n<r;n++)a[n]=arguments[n];return t.current==null?void 0:t.current(...a)},[])}function yi(e,t,r){let{reference:a,floating:n}=e,o=rr(t),i=on(t),l=nn(i),c=lr(t),s=o==="y",u=a.x+a.width/2-n.width/2,d=a.y+a.height/2-n.height/2,f=a[l]/2-n[l]/2,p;switch(c){case "top":p={x:u,y:a.y-n.height};break;case "bottom":p={x:u,y:a.y+a.height};break;case "right":p={x:a.x+a.width,y:d};break;case "left":p={x:a.x-n.width,y:d};break;default:p={x:a.x,y:a.y};}switch(Lr(t)){case "start":p[i]-=f*(r&&s?-1:1);break;case "end":p[i]+=f*(r&&s?-1:1);break}return p}var xi=async(e,t,r)=>{let{placement:a="bottom",strategy:n="absolute",middleware:o=[],platform:i}=r,l=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t)),s=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=yi(s,a,c),f=a,p={},x=0;for(let y=0;y<l.length;y++){let{name:g,fn:h}=l[y],{x:v,y:m,data:k,reset:w}=await h({x:u,y:d,initialPlacement:a,placement:f,strategy:n,middlewareData:p,rects:s,platform:i,elements:{reference:e,floating:t}});u=v??u,d=m??d,p={...p,[g]:{...p[g],...k}},w&&x<=50&&(x++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(s=w.rects===true?await i.getElementRects({reference:e,floating:t,strategy:n}):w.rects),{x:u,y:d}=yi(s,f,c)),y=-1);}return {x:u,y:d,placement:f,strategy:n,middlewareData:p}};async function sn(e,t){var r;t===void 0&&(t={});let{x:a,y:n,platform:o,rects:i,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=false,padding:p=0}=Ar(t,e),x=io(p),g=l[f?d==="floating"?"reference":"floating":d],h=Fr(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(g)))==null||r?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:u,strategy:c})),v=d==="floating"?{x:a,y:n,width:i.floating.width,height:i.floating.height}:i.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Fr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:m,strategy:c}):v);return {top:(h.top-w.top+x.top)/k.y,bottom:(w.bottom-h.bottom+x.bottom)/k.y,left:(h.left-w.left+x.left)/k.x,right:(w.right-h.right+x.right)/k.x}}var ki=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:a,placement:n,rects:o,platform:i,elements:l,middlewareData:c}=t,{element:s,padding:u=0}=Ar(e,t)||{};if(s==null)return {};let d=io(u),f={x:r,y:a},p=on(n),x=nn(p),y=await i.getDimensions(s),g=p==="y",h=g?"top":"left",v=g?"bottom":"right",m=g?"clientHeight":"clientWidth",k=o.reference[x]+o.reference[p]-f[p]-o.floating[x],w=f[p]-o.reference[p],b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s)),T=b?b[m]:0;(!T||!await(i.isElement==null?void 0:i.isElement(b)))&&(T=l.floating[m]||o.floating[x]);let C=k/2-w/2,N=T/2-y[x]/2-1,D=tr(d[h],N),E=tr(d[v],N),I=D,R=T-y[x]-E,F=T/2-y[x]/2+C,O=an(I,F,R),U=!c.arrow&&Lr(n)!=null&&F!==O&&o.reference[x]/2-(F<I?D:E)-y[x]/2<0,J=U?F<I?F-I:F-R:0;return {[p]:f[p]+J,data:{[p]:O,centerOffset:F-O-J,...U&&{alignmentOffset:J}},reset:U}}});var wi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,a;let{placement:n,middlewareData:o,rects:i,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:u=true,crossAxis:d=true,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=true,...g}=Ar(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return {};let h=lr(n),v=rr(l),m=lr(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(s.floating)),w=f||(m||!y?[ya(l)]:hi(l)),b=x!=="none";!f&&b&&w.push(...vi(l,y,x,k));let T=[l,...w],C=await sn(t,g),N=[],D=((a=o.flip)==null?void 0:a.overflows)||[];if(u&&N.push(C[h]),d){let F=gi(n,i,k);N.push(C[F[0]],C[F[1]]);}if(D=[...D,{placement:n,overflows:N}],!N.every(F=>F<=0)){var E,I;let F=(((E=o.flip)==null?void 0:E.index)||0)+1,O=T[F];if(O&&(!(d==="alignment"?v!==rr(O):false)||D.every(j=>rr(j.placement)===v?j.overflows[0]>0:true)))return {data:{index:F,overflows:D},reset:{placement:O}};let U=(I=D.filter(J=>J.overflows[0]<=0).sort((J,j)=>J.overflows[1]-j.overflows[1])[0])==null?void 0:I.placement;if(!U)switch(p){case "bestFit":{var R;let J=(R=D.filter(j=>{if(b){let ae=rr(j.placement);return ae===v||ae==="y"}return true}).map(j=>[j.placement,j.overflows.filter(ae=>ae>0).reduce((ae,Ie)=>ae+Ie,0)]).sort((j,ae)=>j[1]-ae[1])[0])==null?void 0:R[0];J&&(U=J);break}case "initialPlacement":U=l;break}if(n!==U)return {reset:{placement:U}}}return {}}}};var Vd=new Set(["left","top"]);async function Kd(e,t){let{placement:r,platform:a,elements:n}=e,o=await(a.isRTL==null?void 0:a.isRTL(n.floating)),i=lr(r),l=Lr(r),c=rr(r)==="y",s=Vd.has(i)?-1:1,u=o&&c?-1:1,d=Ar(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),c?{x:p*u,y:f*s}:{x:f*s,y:p*u}}var Ci=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,a;let{x:n,y:o,placement:i,middlewareData:l}=t,c=await Kd(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:n+c.x,y:o+c.y,data:{...c,placement:i}}}}},Ti=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:a,placement:n}=t,{mainAxis:o=true,crossAxis:i=false,limiter:l={fn:g=>{let{x:h,y:v}=g;return {x:h,y:v}}},...c}=Ar(e,t),s={x:r,y:a},u=await sn(t,c),d=rr(lr(n)),f=so(d),p=s[f],x=s[d];if(o){let g=f==="y"?"top":"left",h=f==="y"?"bottom":"right",v=p+u[g],m=p-u[h];p=an(v,p,m);}if(i){let g=d==="y"?"top":"left",h=d==="y"?"bottom":"right",v=x+u[g],m=x-u[h];x=an(v,x,m);}let y=l.fn({...t,[f]:p,[d]:x});return {...y,data:{x:y.x-r,y:y.y-a,enabled:{[f]:o,[d]:i}}}}}};var Si=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,a;let{placement:n,rects:o,platform:i,elements:l}=t,{apply:c=()=>{},...s}=Ar(e,t),u=await sn(t,s),d=lr(n),f=Lr(n),p=rr(n)==="y",{width:x,height:y}=o.floating,g,h;d==="top"||d==="bottom"?(g=d,h=f===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(h=d,g=f==="end"?"top":"bottom");let v=y-u.top-u.bottom,m=x-u.left-u.right,k=tr(y-u[g],v),w=tr(x-u[h],m),b=!t.middlewareData.shift,T=k,C=w;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(C=m),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(T=v),b&&!f){let D=kt(u.left,0),E=kt(u.right,0),I=kt(u.top,0),R=kt(u.bottom,0);p?C=x-2*(D!==0||E!==0?D+E:kt(u.left,u.right)):T=y-2*(I!==0||R!==0?I+R:kt(u.top,u.bottom));}await c({...t,availableWidth:C,availableHeight:T});let N=await i.getDimensions(l.floating);return x!==N.width||y!==N.height?{reset:{rects:true}}:{}}}};function Ri(e){let t=Tt(e),r=parseFloat(t.width)||0,a=parseFloat(t.height)||0,n=Bt(e),o=n?e.offsetWidth:r,i=n?e.offsetHeight:a,l=xa(r)!==o||xa(a)!==i;return l&&(r=o,a=i),{width:r,height:a,$:l}}function co(e){return ut(e)?e:e.contextElement}function ta(e){let t=co(e);if(!Bt(t))return $t(1);let r=t.getBoundingClientRect(),{width:a,height:n,$:o}=Ri(t),i=(o?xa(r.width):r.width)/a,l=(o?xa(r.height):r.height)/n;return (!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var jd=$t(0);function Pi(e){let t=xt(e);return !va()||!t.visualViewport?jd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Yd(e,t,r){return t===void 0&&(t=false),!r||t&&r!==xt(e)?false:t}function Br(e,t,r,a){t===void 0&&(t=false),r===void 0&&(r=false);let n=e.getBoundingClientRect(),o=co(e),i=$t(1);t&&(a?ut(a)&&(i=ta(a)):i=ta(e));let l=Yd(o,r,a)?Pi(o):$t(0),c=(n.left+l.x)/i.x,s=(n.top+l.y)/i.y,u=n.width/i.x,d=n.height/i.y;if(o){let f=xt(o),p=a&&ut(a)?xt(a):a,x=f,y=tn(x);for(;y&&a&&p!==x;){let g=ta(y),h=y.getBoundingClientRect(),v=Tt(y),m=h.left+(y.clientLeft+parseFloat(v.paddingLeft))*g.x,k=h.top+(y.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,s*=g.y,u*=g.x,d*=g.y,c+=m,s+=k,x=xt(y),y=tn(x);}}return Fr({width:u,height:d,x:c,y:s})}function ln(e,t){let r=ba(e).scrollLeft;return t?t.left+r:Br(_t(e)).left+r}function Ii(e,t){let r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-ln(e,r),n=r.top+t.scrollTop;return {x:a,y:n}}function qd(e){let{elements:t,rect:r,offsetParent:a,strategy:n}=e,o=n==="fixed",i=_t(a),l=t?ha(t.floating):false;if(a===i||l&&o)return r;let c={scrollLeft:0,scrollTop:0},s=$t(1),u=$t(0),d=Bt(a);if((d||!d&&!o)&&((gr(a)!=="body"||ea(i))&&(c=ba(a)),Bt(a))){let p=Br(a);s=ta(a),u.x=p.x+a.clientLeft,u.y=p.y+a.clientTop;}let f=i&&!d&&!o?Ii(i,c):$t(0);return {width:r.width*s.x,height:r.height*s.y,x:r.x*s.x-c.scrollLeft*s.x+u.x+f.x,y:r.y*s.y-c.scrollTop*s.y+u.y+f.y}}function Xd(e){return Array.from(e.getClientRects())}function Zd(e){let t=_t(e),r=ba(e),a=e.ownerDocument.body,n=kt(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),o=kt(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight),i=-r.scrollLeft+ln(e),l=-r.scrollTop;return Tt(a).direction==="rtl"&&(i+=kt(t.clientWidth,a.clientWidth)-n),{width:n,height:o,x:i,y:l}}var Ni=25;function Jd(e,t){let r=xt(e),a=_t(e),n=r.visualViewport,o=a.clientWidth,i=a.clientHeight,l=0,c=0;if(n){o=n.width,i=n.height;let u=va();(!u||u&&t==="fixed")&&(l=n.offsetLeft,c=n.offsetTop);}let s=ln(a);if(s<=0){let u=a.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,x=Math.abs(a.clientWidth-d.clientWidth-p);x<=Ni&&(o-=x);}else s<=Ni&&(o+=s);return {width:o,height:i,x:l,y:c}}var Qd=new Set(["absolute","fixed"]);function eu(e,t){let r=Br(e,true,t==="fixed"),a=r.top+e.clientTop,n=r.left+e.clientLeft,o=Bt(e)?ta(e):$t(1),i=e.clientWidth*o.x,l=e.clientHeight*o.y,c=n*o.x,s=a*o.y;return {width:i,height:l,x:c,y:s}}function Di(e,t,r){let a;if(t==="viewport")a=Jd(e,r);else if(t==="document")a=Zd(_t(e));else if(ut(t))a=eu(t,r);else {let n=Pi(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height};}return Fr(a)}function Mi(e,t){let r=er(e);return r===t||!ut(r)||hr(r)?false:Tt(r).position==="fixed"||Mi(r,t)}function tu(e,t){let r=t.get(e);if(r)return r;let a=ir(e,[],false).filter(l=>ut(l)&&gr(l)!=="body"),n=null,o=Tt(e).position==="fixed",i=o?er(e):e;for(;ut(i)&&!hr(i);){let l=Tt(i),c=en(i);!c&&l.position==="fixed"&&(n=null),(o?!c&&!n:!c&&l.position==="static"&&!!n&&Qd.has(n.position)||ea(i)&&!c&&Mi(e,i))?a=a.filter(u=>u!==i):n=l,i=er(i);}return t.set(e,a),a}function ru(e){let{element:t,boundary:r,rootBoundary:a,strategy:n}=e,i=[...r==="clippingAncestors"?ha(t)?[]:tu(t,this._c):[].concat(r),a],l=i[0],c=i.reduce((s,u)=>{let d=Di(t,u,n);return s.top=kt(d.top,s.top),s.right=tr(d.right,s.right),s.bottom=tr(d.bottom,s.bottom),s.left=kt(d.left,s.left),s},Di(t,l,n));return {width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function au(e){let{width:t,height:r}=Ri(e);return {width:t,height:r}}function nu(e,t,r){let a=Bt(t),n=_t(t),o=r==="fixed",i=Br(e,true,o,t),l={scrollLeft:0,scrollTop:0},c=$t(0);function s(){c.x=ln(n);}if(a||!a&&!o)if((gr(t)!=="body"||ea(n))&&(l=ba(t)),a){let p=Br(t,true,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop;}else n&&s();o&&!a&&n&&s();let u=n&&!a&&!o?Ii(n,l):$t(0),d=i.left+l.scrollLeft-c.x-u.x,f=i.top+l.scrollTop-c.y-u.y;return {x:d,y:f,width:i.width,height:i.height}}function lo(e){return Tt(e).position==="static"}function Ei(e,t){if(!Bt(e)||Tt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return _t(e)===r&&(r=r.ownerDocument.body),r}function Ai(e,t){let r=xt(e);if(ha(e))return r;if(!Bt(e)){let n=er(e);for(;n&&!hr(n);){if(ut(n)&&!lo(n))return n;n=er(n);}return r}let a=Ei(e,t);for(;a&&di(a)&&lo(a);)a=Ei(a,t);return a&&hr(a)&&lo(a)&&!en(a)?r:a||ui(e)||r}var ou=async function(e){let t=this.getOffsetParent||Ai,r=this.getDimensions,a=await r(e.floating);return {reference:nu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function su(e){return Tt(e).direction==="rtl"}var uo={convertOffsetParentRelativeRectToViewportRelativeRect:qd,getDocumentElement:_t,getClippingRect:ru,getOffsetParent:Ai,getElementRects:ou,getClientRects:Xd,getDimensions:au,getScale:ta,isElement:ut,isRTL:su};function Li(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function iu(e,t){let r=null,a,n=_t(e);function o(){var l;clearTimeout(a),(l=r)==null||l.disconnect(),r=null;}function i(l,c){l===void 0&&(l=false),c===void 0&&(c=1),o();let s=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=s;if(l||t(),!f||!p)return;let x=ka(d),y=ka(n.clientWidth-(u+f)),g=ka(n.clientHeight-(d+p)),h=ka(u),m={rootMargin:-x+"px "+-y+"px "+-g+"px "+-h+"px",threshold:kt(0,tr(1,c))||1},k=true;function w(b){let T=b[0].intersectionRatio;if(T!==c){if(!k)return i();T?i(false,T):a=setTimeout(()=>{i(false,1e-7);},1e3);}T===1&&!Li(s,e.getBoundingClientRect())&&i(),k=false;}try{r=new IntersectionObserver(w,{...m,root:n.ownerDocument});}catch{r=new IntersectionObserver(w,m);}r.observe(e);}return i(true),o}function cn(e,t,r,a){a===void 0&&(a={});let{ancestorScroll:n=true,ancestorResize:o=true,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=false}=a,s=co(e),u=n||o?[...s?ir(s):[],...ir(t)]:[];u.forEach(h=>{n&&h.addEventListener("scroll",r,{passive:true}),o&&h.addEventListener("resize",r);});let d=s&&l?iu(s,r):null,f=-1,p=null;i&&(p=new ResizeObserver(h=>{let[v]=h;v&&v.target===s&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var m;(m=p)==null||m.observe(t);})),r();}),s&&!c&&p.observe(s),p.observe(t));let x,y=c?Br(e):null;c&&g();function g(){let h=Br(e);y&&!Li(y,h)&&r(),y=h,x=requestAnimationFrame(g);}return r(),()=>{var h;u.forEach(v=>{n&&v.removeEventListener("scroll",r),o&&v.removeEventListener("resize",r);}),d?.(),(h=p)==null||h.disconnect(),p=null,c&&cancelAnimationFrame(x);}}var Fi=Ci;var Bi=Ti,Oi=wi,zi=Si;var po=ki;var dn=(e,t,r)=>{let a=new Map,n={platform:uo,...r},o={...n.platform,_c:a};return xi(e,t,{...n,platform:o})};var cu=typeof document<"u",du=function(){},un=cu?xe.useLayoutEffect:du;function pn(e,t){if(e===t)return true;if(typeof e!=typeof t)return false;if(typeof e=="function"&&e.toString()===t.toString())return true;let r,a,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return false;for(a=r;a--!==0;)if(!pn(e[a],t[a]))return false;return true}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return false;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(t,n[a]))return false;for(a=r;a--!==0;){let o=n[a];if(!(o==="_owner"&&e.$$typeof)&&!pn(e[o],t[o]))return false}return true}return e!==e&&t!==t}function _i(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hi(e,t){let r=_i(e);return Math.round(t*r)/r}function mo(e){let t=xe__namespace.useRef(e);return un(()=>{t.current=e;}),t}function $i(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:n,elements:{reference:o,floating:i}={},transform:l=true,whileElementsMounted:c,open:s}=e,[u,d]=xe__namespace.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:false}),[f,p]=xe__namespace.useState(a);pn(f,a)||p(a);let[x,y]=xe__namespace.useState(null),[g,h]=xe__namespace.useState(null),v=xe__namespace.useCallback(j=>{j!==b.current&&(b.current=j,y(j));},[]),m=xe__namespace.useCallback(j=>{j!==T.current&&(T.current=j,h(j));},[]),k=o||x,w=i||g,b=xe__namespace.useRef(null),T=xe__namespace.useRef(null),C=xe__namespace.useRef(u),N=c!=null,D=mo(c),E=mo(n),I=mo(s),R=xe__namespace.useCallback(()=>{if(!b.current||!T.current)return;let j={placement:t,strategy:r,middleware:f};E.current&&(j.platform=E.current),dn(b.current,T.current,j).then(ae=>{let Ie={...ae,isPositioned:I.current!==false};F.current&&!pn(C.current,Ie)&&(C.current=Ie,Gi__namespace.flushSync(()=>{d(Ie);}));});},[f,t,r,E,I]);un(()=>{s===false&&C.current.isPositioned&&(C.current.isPositioned=false,d(j=>({...j,isPositioned:false})));},[s]);let F=xe__namespace.useRef(false);un(()=>(F.current=true,()=>{F.current=false;}),[]),un(()=>{if(k&&(b.current=k),w&&(T.current=w),k&&w){if(D.current)return D.current(k,w,R);R();}},[k,w,R,D,N]);let O=xe__namespace.useMemo(()=>({reference:b,floating:T,setReference:v,setFloating:m}),[v,m]),U=xe__namespace.useMemo(()=>({reference:k,floating:w}),[k,w]),J=xe__namespace.useMemo(()=>{let j={position:r,left:0,top:0};if(!U.floating)return j;let ae=Hi(U.floating,u.x),Ie=Hi(U.floating,u.y);return l?{...j,transform:"translate("+ae+"px, "+Ie+"px)",..._i(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ae,top:Ie}},[r,l,U.floating,u.x,u.y]);return xe__namespace.useMemo(()=>({...u,update:R,refs:O,elements:U,floatingStyles:J}),[u,R,O,U,J])}var uu=e=>{function t(r){return {}.hasOwnProperty.call(r,"current")}return {name:"arrow",options:e,fn(r){let{element:a,padding:n}=typeof e=="function"?e(r):e;return a&&t(a)?a.current!=null?po({element:a.current,padding:n}).fn(r):{}:a?po({element:a,padding:n}).fn(r):{}}}},mn=(e,t)=>({...Fi(e),options:[e,t]}),fo=(e,t)=>({...Bi(e),options:[e,t]});var go=(e,t)=>({...Oi(e),options:[e,t]}),ho=(e,t)=>({...zi(e),options:[e,t]});var vo=(e,t)=>({...uu(e),options:[e,t]});var yu={...xe__namespace},Wi=false,xu=0,Vi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+xu++;function ku(){let[e,t]=xe__namespace.useState(()=>Wi?Vi():void 0);return Ca(()=>{e==null&&t(Vi());},[]),xe__namespace.useEffect(()=>{Wi=true;},[]),e}var wu=yu.useId,ji=wu||ku,Ta;process.env.NODE_ENV!=="production"&&(Ta=new Set);function Cu(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];let n="Floating UI: "+r.join(" ");if(!((e=Ta)!=null&&e.has(n))){var o;(o=Ta)==null||o.add(n),console.warn(n);}}function Tu(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];let n="Floating UI: "+r.join(" ");if(!((e=Ta)!=null&&e.has(n))){var o;(o=Ta)==null||o.add(n),console.error(n);}}var Yi=xe__namespace.forwardRef(function(t,r){let{context:{placement:a,elements:{floating:n},middlewareData:{arrow:o,shift:i}},width:l=14,height:c=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:p,style:{transform:x,...y}={},...g}=t;process.env.NODE_ENV!=="production"&&(r||Cu("The `ref` prop is required for `FloatingArrow`."));let h=ji(),[v,m]=xe__namespace.useState(false);if(Ca(()=>{if(!n)return;Tt(n).direction==="rtl"&&m(true);},[n]),!n)return null;let[k,w]=a.split("-"),b=k==="top"||k==="bottom",T=d;(b&&i!=null&&i.x||!b&&i!=null&&i.y)&&(T=null);let C=u*2,N=C/2,D=l/2*(s/-8+1),E=c/2*s/4,I=!!p,R=T&&w==="end"?"bottom":"top",F=T&&w==="end"?"right":"left";T&&v&&(F=w==="end"?"left":"right");let O=o?.x!=null?T||o.x:"",U=o?.y!=null?T||o.y:"",J=p||"M0,0"+(" H"+l)+(" L"+(l-D)+","+(c-E))+(" Q"+l/2+","+c+" "+D+","+(c-E))+" Z",j={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[k];return jsxRuntime.jsxs("svg",{...g,"aria-hidden":true,ref:r,width:I?l:l+C,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[F]:O,[R]:U,[k]:b||I?"100%":"calc(100% - "+C/2+"px)",transform:[j,x].filter(ae=>!!ae).join(" "),...y},children:[C>0&&jsxRuntime.jsx("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:C+(p?0:1),d:J}),jsxRuntime.jsx("path",{stroke:C&&!p?g.fill:"none",d:J}),jsxRuntime.jsx("clipPath",{id:h,children:jsxRuntime.jsx("rect",{x:-N,y:N*(I?-1:1),width:l+C,height:l})})]})});function Su(){let e=new Map;return {emit(t,r){var a;(a=e.get(t))==null||a.forEach(n=>n(r));},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r);},off(t,r){var a;(a=e.get(t))==null||a.delete(r);}}}var Nu=xe__namespace.createContext(null),Du=xe__namespace.createContext(null),Eu=()=>{var e;return ((e=xe__namespace.useContext(Nu))==null?void 0:e.id)||null},Ru=()=>xe__namespace.useContext(Du);function Pu(e){let{open:t=false,onOpenChange:r,elements:a}=e,n=ji(),o=xe__namespace.useRef({}),[i]=xe__namespace.useState(()=>Su()),l=Eu()!=null;if(process.env.NODE_ENV!=="production"){let p=a.reference;p&&!ut(p)&&Tu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.");}let[c,s]=xe__namespace.useState(a.reference),u=bi((p,x,y)=>{o.current.openEvent=p?x:void 0,i.emit("openchange",{open:p,event:x,reason:y,nested:l}),r?.(p,x,y);}),d=xe__namespace.useMemo(()=>({setPositionReference:s}),[]),f=xe__namespace.useMemo(()=>({reference:c||a.reference||null,floating:a.floating||null,domReference:a.reference}),[c,a.reference,a.floating]);return xe__namespace.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:f,events:i,floatingId:n,refs:d}),[t,u,f,i,n,d])}function qi(e){e===void 0&&(e={});let{nodeId:t}=e,r=Pu({...e,elements:{reference:null,floating:null,...e.elements}}),a=e.rootContext||r,n=a.elements,[o,i]=xe__namespace.useState(null),[l,c]=xe__namespace.useState(null),u=n?.domReference||o,d=xe__namespace.useRef(null),f=Ru();Ca(()=>{u&&(d.current=u);},[u]);let p=$i({...e,elements:{...n,...l&&{reference:l}}}),x=xe__namespace.useCallback(m=>{let k=ut(m)?{getBoundingClientRect:()=>m.getBoundingClientRect(),getClientRects:()=>m.getClientRects(),contextElement:m}:m;c(k),p.refs.setReference(k);},[p.refs]),y=xe__namespace.useCallback(m=>{(ut(m)||m===null)&&(d.current=m,i(m)),(ut(p.refs.reference.current)||p.refs.reference.current===null||m!==null&&!ut(m))&&p.refs.setReference(m);},[p.refs]),g=xe__namespace.useMemo(()=>({...p.refs,setReference:y,setPositionReference:x,domReference:d}),[p.refs,y,x]),h=xe__namespace.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),v=xe__namespace.useMemo(()=>({...p,...a,refs:g,elements:h,nodeId:t}),[p,g,h,t,a]);return Ca(()=>{a.dataRef.current.floatingContext=v;let m=f?.nodesRef.current.find(k=>k.id===t);m&&(m.context=v);}),xe__namespace.useMemo(()=>({...p,context:v,refs:g,elements:h}),[p,g,h,v])}function Xi(e,t,r=true){xe.useEffect(()=>{if(!r)return;let a=o=>{(Array.isArray(e)?e:[e]).some(c=>{let s=c.current;if(!s)return false;let u=o.target;return s===u||s.contains(u)})||t(o);},n=setTimeout(()=>{document.addEventListener("mousedown",a),document.addEventListener("touchstart",a);},0);return ()=>{clearTimeout(n),document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a);}},[e,t,r]);}function Ji({itemCount:e,onSelect:t,onEscape:r,enabled:a=true,loop:n=true,containerRef:o}){let[i,l]=xe.useState(-1);xe.useEffect(()=>{if(!a||i===-1||!o?.current)return;let d=o.current.querySelector(`[data-index="${i}"]`);d&&d.scrollIntoView({block:"nearest",behavior:"smooth"});},[i,a,o]);let c=xe.useCallback(u=>{if(a)switch(u.key){case "ArrowDown":u.preventDefault(),l(d=>d===-1?0:d===e-1?n?0:d:d+1);break;case "ArrowUp":u.preventDefault(),l(d=>d===-1?e-1:d===0?n?e-1:d:d-1);break;case "Enter":case " ":u.preventDefault(),i!==-1&&t&&t(i);break;case "Escape":u.preventDefault(),r&&r();break;case "Home":u.preventDefault(),l(0);break;case "End":u.preventDefault(),l(e-1);break;}},[a,i,e,n,t,r]),s=xe.useCallback(u=>({"data-active":u===i,"data-index":u,role:"option",tabIndex:-1}),[i]);return {activeIndex:i,setActiveIndex:l,handleKeyDown:c,getItemProps:s}}function cr({trigger:e,children:t,isOpen:r,onOpenChange:a,placement:n="bottom-start",offsetDistance:o=8,maxHeight:i=320,minWidth:l="trigger",maxWidth:c,showArrow:s=false,className:u="",triggerClassName:d="",disableClickOutside:f=false,disableKeyboardNav:p=false,itemCount:x=0,onSelectItem:y,onOpen:g,onClose:h,animationDuration:v=200,zIndex:m=1e3}){let[k,w]=xe.useState(false),b=r!==void 0?r:k,T=xe.useCallback(Te=>{let M=b;r===void 0&&w(Te),a?.(Te),Te&&!M?g?.():!Te&&M&&h?.();},[r,a,g,h,b]),C=xe.useCallback(()=>{T(!b);},[b,T]),N=xe.useCallback(()=>{T(false);},[T]),D=xe.useRef(null),E=xe.useRef(null),I=xe.useRef(null),{refs:R,floatingStyles:F,context:O}=qi({open:b,onOpenChange:T,placement:n,middleware:[mn(o),go({padding:8}),fo({padding:8}),ho({apply({rects:Te,elements:M}){Object.assign(M.floating.style,{minWidth:l==="trigger"?`${Te.reference.width}px`:l?`${l}px`:void 0,maxWidth:c?`${c}px`:void 0,maxHeight:`${i}px`});},padding:8}),s?vo({element:I}):null].filter(Boolean),whileElementsMounted:cn});Xi([D,E],N,b&&!f);let{activeIndex:U,setActiveIndex:J,handleKeyDown:j}=Ji({itemCount:x,onSelect:y,onEscape:N,enabled:b&&!p,loop:true,containerRef:E}),ae=()=>typeof e=="function"?e({isOpen:b,toggle:C}):e,Ie=()=>typeof t=="function"?t({activeIndex:U,setActiveIndex:J,close:N}):t,re={transition:`opacity ${v}ms ease-in-out, transform ${v}ms ease-in-out`,opacity:b?1:0,transform:b?"scale(1)":"scale(0.95)",pointerEvents:b?"auto":"none"};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{ref:D,className:`dropdown-trigger ${d}`,onClick:C,children:ae()}),jsxRuntime.jsx(Pe,{children:jsxRuntime.jsxs("div",{ref:R.setFloating,style:{...F,zIndex:m,...re},className:`dropdown-content ${u}`,role:"menu","aria-orientation":"vertical",onKeyDown:j,children:[jsxRuntime.jsx("div",{ref:E,className:"dropdown-inner",children:Ie()}),s&&jsxRuntime.jsx(Yi,{ref:I,context:O,className:"dropdown-arrow"})]})})]})}var el={URGENT:{label:"Urgent",color:"#E74C3C",darkColor:"#ff6b6b"},HIGH:{label:"High",color:"#E67E22",darkColor:"#ffa94d"},MEDIUM:{label:"Normal",color:"#F1C40F",darkColor:"#ffd43b"},LOW:{label:"Low",color:"#2ECC71",darkColor:"#51cf66"}},Bu="#BDC3C7",Ou="#868e96",zu=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]}),tl=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--asakaa-color-interactive-primary, #1976d2)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function xo({priority:e,onChange:t,className:r}){let a=e?el[e]:null,n=document.documentElement.getAttribute("data-theme")==="dark",o=a?n?a.darkColor:a.color:n?Ou:Bu,i=c=>{t(c);},l=Object.entries(el);return jsxRuntime.jsx(cr,{trigger:({isOpen:c})=>jsxRuntime.jsx("button",{className:`flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95 ${r||""}`,style:{background:e?`${o}10`:"transparent",boxShadow:e?`0 0 0 2px ${o}30 inset`:"none",transform:c?"scale(1.1)":"scale(1)"},title:a?.label||"Set priority","aria-label":"Select priority","aria-expanded":c,"aria-haspopup":"menu",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:o,fillOpacity:e?"0.6":"0.4"})})}),placement:"bottom-start",minWidth:180,maxHeight:280,itemCount:l.length+1,onSelectItem:c=>{let s=l[c];i(s?s[0]:void 0);},children:({activeIndex:c,close:s})=>jsxRuntime.jsxs("div",{className:"priority-dropdown",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",children:"Priority"}),jsxRuntime.jsxs("div",{className:"dropdown-section",children:[l.map(([u,d],f)=>{let p=n?d.darkColor:d.color,x=c===f,y=e===u;return jsxRuntime.jsxs("button",{onClick:()=>{i(u),s();},className:"dropdown-item","data-active":x,"data-index":f,role:"option","aria-selected":y,style:{color:x?p:"inherit",fontWeight:y?600:400},children:[jsxRuntime.jsx(zu,{color:p}),jsxRuntime.jsx("span",{children:d.label}),y&&jsxRuntime.jsx(tl,{})]},u)}),jsxRuntime.jsx("div",{style:{borderTop:"1px solid var(--asakaa-color-border-default, #e0e0e0)",marginTop:"4px",paddingTop:"4px"},children:jsxRuntime.jsxs("button",{onClick:()=>{i(void 0),s();},className:"dropdown-item","data-active":c===l.length,"data-index":l.length,role:"option","aria-selected":!e,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"var(--asakaa-color-text-tertiary, #9e9e9e)",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{children:"Clear"}),!e&&jsxRuntime.jsx(tl,{})]})})]})]})})}var al=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function ko({startDate:e,endDate:t,onChange:r,className:a}){let[n,o]=xe.useState(e||""),[i,l]=xe.useState(t||""),c=(x,y)=>{let g=new Date,h=new Date(g);h.setDate(h.getDate()+x);let v=g.toISOString().split("T")[0]||"",m=h.toISOString().split("T")[0]||"";o(v),l(m),r(v,m),y();},s=x=>{r(n||void 0,i||void 0),x();},u=()=>{if(!e||!t)return "Set date";let x=v=>{if(v instanceof Date)return v;if(typeof v!="string"||!v.match(/^\d{4}-\d{2}-\d{2}$/))return null;let m=v.split("-").map(Number);if(m.length!==3||m.some(T=>isNaN(T)))return null;let k=m[0],w=m[1],b=m[2];return k===void 0||w===void 0||b===void 0?null:new Date(k,w-1,b)},y=x(e),g=x(t);if(!y||!g||isNaN(y.getTime())||isNaN(g.getTime()))return "Set date";let h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${h[y.getMonth()]} ${y.getDate()} \u2013 ${h[g.getMonth()]} ${g.getDate()}`},d=e&&t,p=(()=>{if(!t)return false;let x=typeof t=="string"?new Date(t):t,y=new Date;return y.setHours(0,0,0,0),x<y})();return jsxRuntime.jsx(cr,{trigger:({isOpen:x})=>jsxRuntime.jsxs("button",{className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${p?"asakaa-date-overdue":"asakaa-date"} ${a||""}`,style:{transform:x?"scale(1.05)":"scale(1)"},title:d?`${u()}`:"Set date range","aria-label":"Select date range","aria-expanded":x,"aria-haspopup":"menu",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:u()})]}),placement:"bottom-start",minWidth:320,maxHeight:480,itemCount:al.length,onOpen:()=>{o(e||""),l(t||"");},children:({activeIndex:x,close:y})=>jsxRuntime.jsxs("div",{className:"date-range-picker-dropdown",children:[jsxRuntime.jsxs("div",{className:"dropdown-button-wrapper",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",style:{marginBottom:"12px"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"dropdown-quick-grid",children:al.map((g,h)=>jsxRuntime.jsx("button",{onClick:()=>c(g.days,y),className:"dropdown-quick-button","data-active":x===h,"data-index":h,role:"option",children:g.label},g.label))})]}),jsxRuntime.jsxs("div",{className:"dropdown-button-wrapper",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",style:{marginBottom:"12px"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"dropdown-form-actions",children:[jsxRuntime.jsxs("div",{className:"dropdown-form-group",children:[jsxRuntime.jsx("label",{className:"dropdown-label",children:"Start Date"}),jsxRuntime.jsx("input",{type:"date",value:n,onChange:g=>o(g.target.value),className:"dropdown-input"})]}),jsxRuntime.jsxs("div",{className:"dropdown-form-group",children:[jsxRuntime.jsx("label",{className:"dropdown-label",children:"End Date"}),jsxRuntime.jsx("input",{type:"date",value:i,onChange:g=>l(g.target.value),className:"dropdown-input"})]}),jsxRuntime.jsx("button",{onClick:()=>s(y),className:"dropdown-primary-button",children:"Apply"}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{o(""),l(""),r(void 0,void 0),y();},className:"dropdown-danger-button",children:"Clear Dates"})]})]})]})})}function wo({assignedUsers:e=[],availableUsers:t,onChange:r,className:a,maxVisibleAvatars:n=3}){let[o,i]=xe.useState(""),l=d=>{let f=e.some(p=>p.id===d.id);r(f?e.filter(p=>p.id!==d.id):[...e,d]);},c=t.filter(d=>d.name.toLowerCase().includes(o.toLowerCase())),s=e.slice(0,n),u=e.length-n;return jsxRuntime.jsx(cr,{trigger:({isOpen:d})=>jsxRuntime.jsx("button",{className:`dropdown-avatar-trigger ${a||""}`,style:{transform:d?"scale(1.05)":"scale(1)"},title:e.length>0?`${e.length} assigned`:"Assign users","aria-label":"Assign users","aria-expanded":d,"aria-haspopup":"menu",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[s.map(f=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:f.name,style:{backgroundColor:f.color,color:"#fff"},children:f.avatar?jsxRuntime.jsx("img",{src:f.avatar,alt:f.name,className:"asakaa-avatar-img"}):f.initials},f.id)),u>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar dropdown-avatar-overflow",children:["+",u]})]}):jsxRuntime.jsx("div",{className:"dropdown-avatar-empty-trigger",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),placement:"bottom-start",minWidth:300,maxHeight:350,itemCount:c.length,onSelectItem:d=>{let f=c[d];f&&l(f);},onClose:()=>i(""),children:({activeIndex:d,close:f})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",children:"Assign Users"}),jsxRuntime.jsx("div",{className:"dropdown-search-wrapper",children:jsxRuntime.jsx("input",{type:"text",value:o,onChange:p=>i(p.target.value),placeholder:"Search users...",className:"dropdown-search-input",autoFocus:true})}),jsxRuntime.jsx("div",{className:"dropdown-list",children:c.length===0?jsxRuntime.jsx("div",{className:"dropdown-empty",children:"No users found"}):c.map((p,x)=>{let y=e.some(g=>g.id===p.id);return jsxRuntime.jsxs("button",{onClick:()=>{l(p);},className:"dropdown-item","data-active":d===x,"data-index":x,role:"option","aria-selected":y,children:[jsxRuntime.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"11px",fontWeight:700,flexShrink:0,backgroundColor:p.color,color:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},children:p.avatar?jsxRuntime.jsx("img",{src:p.avatar,alt:p.name,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):p.initials}),jsxRuntime.jsx("span",{style:{flex:1,fontWeight:600},children:p.name}),y&&jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M4 9L7.5 12.5L14 6",stroke:"var(--asakaa-color-interactive-primary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},p.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"dropdown-button-wrapper",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),f();},className:"dropdown-danger-button",children:"Clear All"})})]})})}function Co({currentCardId:e,dependencies:t=[],availableTasks:r,onChange:a,className:n}){let[o,i]=xe.useState(""),[l,c]=xe.useState(t.length>0),s=p=>{if(t.includes(p)){let y=t.filter(g=>g!==p);a(y),y.length===0&&c(false);}else a([...t,p]),c(true);},u=()=>{let p=!l;c(p),p||a([]);},d=r.filter(p=>p.id!==e).filter(p=>p.title.toLowerCase().includes(o.toLowerCase())||p.id.toLowerCase().includes(o.toLowerCase())),f=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsx(cr,{trigger:({isOpen:p})=>jsxRuntime.jsxs("button",{className:`flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5 ${n||""}`,style:{transform:p?"scale(1.05)":"scale(1)"},title:t.length>0?`${t.length} dependencies`:"Add dependencies","aria-label":"Select dependencies","aria-expanded":p,"aria-haspopup":"menu",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:f,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:f},children:t.length})]}),placement:"bottom-start",minWidth:300,maxHeight:350,itemCount:l?d.length:0,onSelectItem:p=>{let x=d[p];x&&s(x.id);},onClose:()=>i(""),onOpen:()=>c(t.length>0),children:({activeIndex:p,close:x})=>jsxRuntime.jsxs("div",{className:"dependencies-dropdown",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",children:"Task Dependencies"}),jsxRuntime.jsx("div",{className:"dropdown-button-wrapper",style:{borderBottom:"1px solid var(--asakaa-color-border-subtle)"},children:jsxRuntime.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:u,children:[jsxRuntime.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s",border:l?"2px solid var(--asakaa-color-interactive-primary)":"2px solid var(--asakaa-color-border-default)",background:l?"var(--asakaa-color-interactive-primary)":"transparent"},children:l&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--asakaa-color-text-primary)"},children:"Has dependencies"})]})}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"dropdown-search-wrapper",children:jsxRuntime.jsx("input",{type:"text",value:o,onChange:y=>i(y.target.value),placeholder:"Search by name or ID...",className:"dropdown-search-input",autoFocus:true})}),jsxRuntime.jsx("div",{className:"dropdown-list",children:d.length===0?jsxRuntime.jsx("div",{className:"dropdown-empty",children:"No tasks found"}):d.map((y,g)=>{let h=t.includes(y.id);return jsxRuntime.jsxs("button",{onClick:()=>s(y.id),className:"dropdown-item","data-active":p===g,"data-index":g,role:"option","aria-selected":h,children:[jsxRuntime.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px",transition:"all 0.15s",border:h?"2px solid var(--asakaa-color-interactive-primary)":"2px solid var(--asakaa-color-border-default)",background:h?"var(--asakaa-color-interactive-primary)":"transparent"},children:h&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{style:{flex:1,textAlign:"left"},children:[jsxRuntime.jsx("div",{style:{fontWeight:600,color:"var(--asakaa-color-text-primary)"},children:y.title}),jsxRuntime.jsx("div",{style:{fontSize:"11px",marginTop:"2px",color:"var(--asakaa-color-text-secondary)"},children:y.id})]})]},y.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"dropdown-button-wrapper",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),c(false),x();},className:"dropdown-danger-button",children:"Clear All Dependencies"})})]})})}function ol({columnTitle:e,onRename:t,className:r}){let[a,n]=xe.useState(false),[o,i]=xe.useState(false),[l,c]=xe.useState(e),[s,u]=xe.useState({top:0,left:0}),d=xe.useRef(null),f=xe.useRef(null),p=xe.useRef(null);xe.useEffect(()=>{if(a&&f.current){let h=f.current.getBoundingClientRect();u({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[a]),xe.useEffect(()=>{let h=v=>{d.current&&!d.current.contains(v.target)&&!f.current?.contains(v.target)&&(n(false),i(false));};if(a)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[a]),xe.useEffect(()=>{let h=v=>{v.key==="Escape"&&(n(false),i(false),c(e));};if(a)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[a,e]),xe.useEffect(()=>{o&&p.current&&(p.current.focus(),p.current.select());},[o]);let x=()=>{i(true),c(e);},y=()=>{let h=l.trim();h&&h!==e&&t(h),i(false),n(false),c(e);},g=h=>{h.key==="Enter"?y():h.key==="Escape"&&(i(false),c(e));};return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:f,onClick:()=>n(!a),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),a&&jsxRuntime.jsx(Pe,{children:jsxRuntime.jsx("div",{ref:d,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${s.top}px`,left:`${s.left}px`,background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:o?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:p,type:"text",value:l,onChange:h=>c(h.target.value),onKeyDown:g,onBlur:y,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:x,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]})})})})]})}var aa=xe.memo(({column:e,cards:t,renderColumn:r,renderCard:a,renderHeader:n,renderEmptyState:o,onCardClick:i,onCardUpdate:l,availableUsers:c,allCards:s,enableVirtualization:u,cardHeight:d=120,isCollapsed:f,onToggleCollapse:p,onColumnRename:x,className:y})=>{let{setNodeRef:g,isOver:h}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),v=xe.useRef(null),m=u??Vs(t.length),k=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>v.current,estimateSize:()=>d,enabled:m});if(r)return jsxRuntime.jsx("div",{ref:g,className:y,children:r(e,t)});let b=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let N=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:N}:N>=80?{state:"warning",percentage:N}:N>=60?{state:"approaching",percentage:N}:{state:"ok",percentage:N}})(),T=b.state==="exceeded",C=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:g,className:te("asakaa-column",h&&"ring-2 ring-asakaa-accent-blue",T&&"ring-2 ring-asakaa-accent-red",y),children:[n?n(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:te(C()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&b.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${b.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[b.state==="exceeded"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#EF4444",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 5L11 11M11 5L5 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),b.state==="warning"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M8 1L15 14H1L8 1Z",fill:"#F59E0B",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),b.state==="approaching"&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8 1L10 7H14L10 10L12 16L8 12L4 16L6 10L2 7H6L8 1Z",fill:"#FB923C",opacity:"0.9"})}),b.state==="ok"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#10B981",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]}),x&&jsxRuntime.jsx(ol,{columnTitle:e.title,onRename:N=>x(e.id,N)}),p&&jsxRuntime.jsx("button",{onClick:p,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":f?"Expand column":"Collapse column",children:f?"\u25B6":"\u25BC"})]})]}),!f&&jsxRuntime.jsx("div",{ref:v,className:"asakaa-column-cards",style:{maxHeight:m?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(N=>N.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?o?o(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):m?jsxRuntime.jsx("div",{style:{height:`${k.getTotalSize()}px`,position:"relative"},children:k.getVirtualItems().map(N=>{let D=t[N.index];return D?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:jsxRuntime.jsx(sr,{card:D,render:a,onClick:i,onUpdate:l,availableUsers:c,allCards:s})},D.id):null})}):t.map(N=>jsxRuntime.jsx(sr,{card:N,render:a,onClick:i,onUpdate:l,availableUsers:c,allCards:s},N.id))})})]})});aa.displayName="Column";function So({title:e,onSave:t,className:r}){let[a,n]=xe.useState(false),[o,i]=xe.useState(e),l=xe.useRef(null);xe.useEffect(()=>{a&&l.current&&(l.current.focus(),l.current.select());},[a]);let c=()=>{let u=o.trim();u&&u!==e?t(u):i(e),n(false);},s=u=>{u.key==="Enter"?c():u.key==="Escape"&&(i(e),n(false));};return a?jsxRuntime.jsx("input",{ref:l,type:"text",value:o,onChange:u=>i(u.target.value),onBlur:c,onKeyDown:s,className:te("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",r),maxLength:50}):jsxRuntime.jsx("h2",{className:te("asakaa-column-title cursor-pointer",r),onClick:()=>n(true),title:"Click to edit",children:e})}function Do(){let[e,t]=xe.useState(()=>core.dragStore.getState());xe.useEffect(()=>core.dragStore.subscribe(n=>{t(n);}),[]);let r=xe.useCallback(a=>{core.dragStore.setState(a);},[]);return [e,r]}function yr({board:e,callbacks:t,onCardClick:r,renderProps:a,config:n,availableUsers:o=[],className:i,style:l,isLoading:c,error:s,children:u}){let[d,f]=Do(),p=xe.useCallback((w,b)=>{t.onCardUpdate?.(w,b);},[t]),x=xe.useCallback((w,b)=>{t.onColumnUpdate?.(w,{title:b});},[t]),y=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),g=xe.useMemo(()=>{let w=new Map;return e.columns.forEach(b=>{let T=b.cardIds.map(C=>e.cards.find(N=>N.id===C)).filter(C=>C!==void 0).sort((C,N)=>C.position-N.position);w.set(b.id,T);}),w},[e.cards,e.columns]),h=xe.useCallback(w=>{let{active:b}=w,T=e.cards.find(C=>C.id===b.id);T&&f({isDragging:true,draggedCardId:T.id,sourceColumnId:T.columnId,targetColumnId:T.columnId});},[e.cards,f]),v=xe.useCallback(w=>{let{active:b,over:T}=w;if(!T||!e.cards.find(D=>D.id===b.id))return;let N=null;T.data.current?.type==="column"?N=T.id:T.data.current?.type==="card"&&(N=e.cards.find(E=>E.id===T.id)?.columnId||null),N&&N!==d.targetColumnId&&f({...d,targetColumnId:N});},[e.cards,d,f]),m=xe.useCallback(async w=>{let{active:b,over:T}=w;if(f({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!T)return;let C=e.cards.find(I=>I.id===b.id);if(!C)return;let N,D;if(T.data.current?.type==="column"){N=T.id;let I=g.get(N)||[];D=qn(I,0);}else {let I=e.cards.find(O=>O.id===T.id);if(!I)return;N=I.columnId;let R=g.get(N)||[],F=R.findIndex(O=>O.id===T.id);D=qn(R,F);}let E=e.columns.find(I=>I.id===N);if(E&&E.wipLimit&&E.wipLimitType==="hard"){let I=g.get(N)||[];if(C.columnId!==N&&I.length>=E.wipLimit){t.onWipLimitExceeded?.(E,C);return}}(C.columnId!==N||C.position!==D)&&await t.onCardMove?.(C.id,N,D);},[e.cards,e.columns,g,t,f]),k=xe.useCallback(w=>{r?.(w);},[r]);return c?jsxRuntime.jsx("div",{className:te("asakaa-board",i),style:l,children:jsxRuntime.jsx(sp,{columnCount:3})}):s?jsxRuntime.jsx("div",{className:te("asakaa-board",i),style:l,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof s=="string"?s:s.message})]})})}):jsxRuntime.jsxs(core$1.DndContext,{sensors:y,collisionDetection:core$1.closestCorners,onDragStart:h,onDragOver:v,onDragEnd:m,children:[jsxRuntime.jsxs("div",{className:te("asakaa-board",i),style:l,children:[e.columns.sort((w,b)=>w.position-b.position).map(w=>{let b=g.get(w.id)||[];return jsxRuntime.jsx(aa,{column:w,cards:b,renderCard:a?.renderCard,renderColumn:a?.renderColumn,renderHeader:a?.renderColumnHeader,renderEmptyState:a?.renderEmptyState,onCardClick:k,onCardUpdate:p,onColumnRename:x,availableUsers:o,allCards:e.cards,enableVirtualization:n?.enableVirtualization,cardHeight:n?.cardHeight},w.id)}),u]}),jsxRuntime.jsx(core$1.DragOverlay,{children:d.draggedCardId?jsxRuntime.jsx(sr,{card:e.cards.find(w=>w.id===d.draggedCardId),render:a?.renderCardOverlay||a?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]})}function sp({columnCount:e}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,r)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},r))})}var Ea=class extends core.BaseViewAdapter{constructor(r={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=r,this.options={animations:r.viewOptions?.animations??true,virtualScrolling:r.viewOptions?.virtualScrolling??false,theme:r.viewOptions?.theme??"dark",readonly:r.viewOptions?.readonly??false};}mount(r,a){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=r,this.data=a,this.root=client.createRoot(r),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(r){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=r,this.render(),this.emit("view:updated",{viewId:this.id,data:r});}configure(r){this.options={...this.options,...r},this.isMounted()&&this.render();}async export(r){if(!this.data)throw new Error("No data to export");switch(r){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${r}`)}}render(){if(!this.root||!this.data)return;let r={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsxRuntime.jsx(yr,{board:r,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let r=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(a=>{let n=this.data.columns.find(o=>o.id===a.columnId);r.push([a.id,a.title,n?.title||"",a.description||"",a.labels?.join(", ")||"",a.assignedUserIds?.join(", ")||a.assigneeId||"",a.dueDate?.toString()||"",a.position.toString()]);}),r.map(a=>a.map(n=>`"${n}"`).join(",")).join(`
|
|
5
|
-
`)}async exportToPDF(){throw new Error("PDF export not yet implemented in ViewAdapter")}async exportToPNG(){if(!this.container)throw new Error("View not mounted");let a=await(await import('html2canvas')).default(this.container,{backgroundColor:this.options.theme==="dark"?"#1a1a1a":"#ffffff",scale:2});return new Promise((n,o)=>{a.toBlob(i=>{i?n(i):o(new Error("Failed to create PNG blob"));},"image/png");})}};function cl(e={}){return new Ea(e)}var oa=class extends xe.Component{constructor(r){super(r);this.resetError=()=>{this.setState({hasError:false,error:null,errorInfo:null});};this.state={hasError:false,error:null,errorInfo:null};}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,a){let{onError:n,componentName:o}=this.props;if(process.env.NODE_ENV==="development"&&(console.error(`Error in ${o||"Component"}:`,r),console.error("Error Info:",a)),this.setState({errorInfo:a}),n)try{n(r,a);}catch(i){console.error("Error in error handler:",i);}}render(){let{hasError:r,error:a}=this.state,{children:n,fallback:o,componentName:i}=this.props;return r&&a?o?o(a,this.resetError):jsxRuntime.jsx("div",{className:"p-6 rounded-lg border",style:{background:"linear-gradient(135deg, #2d1b1b 0%, #1a1a1a 100%)",borderColor:"rgba(239, 68, 68, 0.3)"},children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#EF4444",strokeWidth:"2"}),jsxRuntime.jsx("path",{d:"M12 8V12",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"#EF4444"})]}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold text-red-400 mb-1",children:i?`Error in ${i}`:"Something went wrong"}),jsxRuntime.jsx("p",{className:"text-sm text-white/70 mb-3",children:a.message||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&jsxRuntime.jsxs("details",{className:"mb-3",children:[jsxRuntime.jsx("summary",{className:"text-xs text-white/50 cursor-pointer hover:text-white/70 mb-2",children:"Error Details (Development Only)"}),jsxRuntime.jsx("pre",{className:"text-xs text-white/60 bg-black/30 p-3 rounded overflow-auto max-h-48",children:a.stack})]}),jsxRuntime.jsx("button",{onClick:this.resetError,className:"px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#EF4444"},children:"Try Again"})]})]})}):n}};function Eo(e,t){let r=a=>jsxRuntime.jsx(oa,{...t,children:jsxRuntime.jsx(e,{...a})});return r.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,r}function Po({board:e,onCreateCard:t,onNavigateToCard:r,onSearch:a,onChangePriority:n,onAssignUser:o,onGeneratePlan:i,onPredictRisks:l,onOpenAIUsage:c,shortcut:s="k",className:u=""}){let[d,f]=xe.useState(false),[p,x]=xe.useState(""),[y,g]=xe.useState("home"),[h,v]=xe.useState(""),[m,k]=xe.useState("");xe.useEffect(()=>{let C=N=>{(N.metaKey||N.ctrlKey)&&N.key===s&&(N.preventDefault(),f(D=>!D)),N.key==="Escape"&&(f(false),g("home"),x(""));};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[s]),xe.useEffect(()=>{d||(g("home"),x(""),v(""),k(""));},[d]);let w=xe.useCallback(()=>{f(false);},[]),b=xe.useCallback(C=>{let[N,D]=C.split(":");switch(N){case "create-card":g("create-card");break;case "create-card-in":v(D||"");break;case "navigate":D?(r?.(D),w()):g("navigate");break;case "search":a?.(p),w();break;case "priority":g("priority");break;case "set-priority":m&&D&&(n?.(m,D),w());break;case "assign":g("assign");break;case "assign-user":m&&D&&(o?.(m,D),w());break;case "ai":g("ai");break;case "ai-generate-plan":i?.(),w();break;case "ai-predict-risks":l?.(),w();break;case "ai-usage":c?.(),w();break;case "back":g("home");break;}},[p,m,t,r,a,n,o,i,l,c,w]),T=xe.useCallback(()=>{h&&p.trim()&&(t?.(h,p.trim()),w());},[h,p,t,w]);return d?jsxRuntime.jsx(Pe,{children:jsxRuntime.jsx("div",{className:"command-palette-overlay",onClick:w,children:jsxRuntime.jsx("div",{className:`command-palette ${u}`,onClick:C=>C.stopPropagation(),children:jsxRuntime.jsxs(cmdk.Command,{value:p,onValueChange:x,label:"Command Menu",children:[jsxRuntime.jsxs("div",{className:"command-palette-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx(cmdk.Command.Input,{placeholder:y==="create-card"&&h?"Type card title and press Enter...":y==="create-card"?"Select a column first...":"Type a command or search...",className:"command-palette-input",onKeyDown:C=>{C.key==="Enter"&&y==="create-card"&&h&&T();}}),jsxRuntime.jsxs("div",{className:"command-palette-shortcut",children:[jsxRuntime.jsx("kbd",{children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsxRuntime.jsx("kbd",{children:"K"})]})]}),jsxRuntime.jsxs(cmdk.Command.List,{className:"command-palette-list",children:[jsxRuntime.jsx(cmdk.Command.Empty,{className:"command-palette-empty",children:"No results found."}),y==="home"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Group,{heading:"Actions",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"create-card",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntime.jsx("path",{d:"M12 8v8m-4-4h8"})]}),jsxRuntime.jsx("span",{children:"Create Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"C"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"navigate",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 16 16 12 12 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),jsxRuntime.jsx("span",{children:"Navigate to Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"G"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"search",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx("span",{children:"Search Cards"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"/"})]})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"AI Commands"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Cards",className:"command-palette-group",children:e.cards.slice(0,5).map(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:C.title}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(N=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:N},N))})]},C.id))})]}),y==="create-card"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Select Column",className:"command-palette-group",children:e.columns.map(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`create-card-in:${C.id}`,onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"18",rx:"1"})}),jsxRuntime.jsx("span",{children:C.title}),jsxRuntime.jsxs("div",{className:"command-palette-item-count",children:[C.cardIds.length," cards"]})]},C.id))})]}),y==="navigate"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"All Cards",className:"command-palette-group",children:e.cards.map(C=>{let N=e.columns.find(D=>D.id===C.columnId);return jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:b,className:"command-palette-item",keywords:[C.title,C.description||"",...C.labels||[]],children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsxs("div",{className:"command-palette-item-content",children:[jsxRuntime.jsx("div",{children:C.title}),jsxRuntime.jsx("div",{className:"command-palette-item-meta",children:N?.title})]}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(D=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:D},D))})]},C.id)})})]}),y==="ai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsxs(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-generate-plan",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"Generate Project Plan"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-predict-risks",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsxRuntime.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsxRuntime.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsxRuntime.jsx("span",{children:"Predict Risks"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-usage",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),jsxRuntime.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"})]}),jsxRuntime.jsx("span",{children:"AI Usage & Costs"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})]})]})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer",children:[jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"\u2191"}),jsxRuntime.jsx("kbd",{children:"\u2193"}),jsxRuntime.jsx("span",{children:"Navigate"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Enter"}),jsxRuntime.jsx("span",{children:"Select"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Esc"}),jsxRuntime.jsx("span",{children:"Close"})]})]})]})})})}):null}function mp(e){if(e===0)return "0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],a=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,a)*100)/100+" "+r[a]}function fp(e){return e.startsWith("image/")?"\u{1F5BC}\uFE0F":e.startsWith("video/")?"\u{1F3A5}":e.startsWith("audio/")?"\u{1F3B5}":e.includes("pdf")?"\u{1F4C4}":e.includes("word")||e.includes("document")?"\u{1F4DD}":e.includes("sheet")||e.includes("excel")?"\u{1F4CA}":e.includes("presentation")||e.includes("powerpoint")?"\u{1F4FD}\uFE0F":e.includes("zip")||e.includes("rar")||e.includes("compressed")?"\u{1F5DC}\uFE0F":e.includes("text")?"\u{1F4C3}":"\u{1F4CE}"}function gp(e){return e.startsWith("image/")}function Pa({attachments:e=[],onUpload:t,onDelete:r,maxSizeMB:a=10,allowedTypes:n,maxFiles:o=10}){let[i,l]=xe.useState(false),[c,s]=xe.useState(false),[u,d]=xe.useState(null),f=xe.useRef(null),p=xe.useCallback(b=>{let T=[],C=[];return e.length+b.length>o?(C.push(`Maximum ${o} files allowed`),{valid:T,errors:C}):(b.forEach(N=>{if(N.size/1048576>a){C.push(`${N.name} is too large (max ${a}MB)`);return}if(n&&!n.some(E=>N.type.match(E))){C.push(`${N.name} has invalid file type`);return}T.push(N);}),{valid:T,errors:C})},[e.length,o,a,n]),x=xe.useCallback(async b=>{let{valid:T,errors:C}=p(b);if(C.length>0){d(C.join(", ")),setTimeout(()=>d(null),5e3);return}if(T.length!==0){s(true),d(null);try{await t?.(T);}catch(N){d(N instanceof Error?N.message:"Upload failed"),setTimeout(()=>d(null),5e3);}finally{s(false);}}},[p,t]),y=xe.useCallback(b=>{b.preventDefault(),b.stopPropagation(),l(true);},[]),g=xe.useCallback(b=>{b.preventDefault(),b.stopPropagation(),l(false);},[]),h=xe.useCallback(b=>{b.preventDefault(),b.stopPropagation();},[]),v=xe.useCallback(b=>{b.preventDefault(),b.stopPropagation(),l(false);let T=Array.from(b.dataTransfer.files);x(T);},[x]),m=xe.useCallback(b=>{let T=b.target.files?Array.from(b.target.files):[];x(T),f.current&&(f.current.value="");},[x]),k=xe.useCallback(()=>{f.current?.click();},[]),w=xe.useCallback(b=>{confirm("Are you sure you want to delete this attachment?")&&r?.(b);},[r]);return jsxRuntime.jsxs("div",{className:"attachment-uploader",children:[jsxRuntime.jsxs("div",{className:`attachment-dropzone ${i?"dragging":""} ${c?"uploading":""}`,onDragEnter:y,onDragLeave:g,onDragOver:h,onDrop:v,onClick:k,children:[jsxRuntime.jsx("input",{ref:f,type:"file",multiple:true,onChange:m,style:{display:"none"},accept:n?.join(",")}),jsxRuntime.jsx("div",{className:"attachment-dropzone-content",children:c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"attachment-spinner"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"attachment-dropzone-icon",children:[jsxRuntime.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M17 8L12 3L7 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12 3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:i?"Drop files here":"Drag & drop files here"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-subtext",children:"or click to browse"}),jsxRuntime.jsxs("p",{className:"attachment-dropzone-info",children:["Max ",a,"MB \u2022 ",e.length,"/",o," files"]})]})})]}),u&&jsxRuntime.jsxs("div",{className:"attachment-error",children:[jsxRuntime.jsx("span",{className:"attachment-error-icon",children:"\u26A0\uFE0F"}),jsxRuntime.jsx("span",{className:"attachment-error-text",children:u})]}),e.length>0&&jsxRuntime.jsx("div",{className:"attachment-list",children:e.map(b=>jsxRuntime.jsxs("div",{className:"attachment-item",children:[jsxRuntime.jsx("div",{className:"attachment-preview",children:gp(b.type)&&b.url?jsxRuntime.jsx("img",{src:b.thumbnailUrl||b.url,alt:b.name,className:"attachment-thumbnail"}):jsxRuntime.jsx("div",{className:"attachment-icon",children:fp(b.type)})}),jsxRuntime.jsxs("div",{className:"attachment-info",children:[jsxRuntime.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"attachment-name",title:b.name,children:b.name}),jsxRuntime.jsxs("div",{className:"attachment-meta",children:[jsxRuntime.jsx("span",{className:"attachment-size",children:mp(b.size)}),jsxRuntime.jsx("span",{className:"attachment-separator",children:"\u2022"}),jsxRuntime.jsx("span",{className:"attachment-date",children:new Date(b.uploadedAt).toLocaleDateString()})]})]}),jsxRuntime.jsx("button",{onClick:()=>w(b.id),className:"attachment-delete",title:"Delete attachment",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},b.id))})]})}function Mo({card:e,isOpen:t,onClose:r,onUpdate:a,onDelete:n,availableUsers:o=[],comments:i=[],activities:l=[],aiInsights:c=[],attachments:s=[],onAddComment:u,onDeleteComment:d,onUploadAttachments:f,onDeleteAttachment:p,onSuggestAssignee:x,onGenerateSubtasks:y,onEstimateEffort:g,currentUserId:h="user-1"}){let[v,m]=xe.useState("details"),[k,w]=xe.useState(false),[b,T]=xe.useState({}),[C,N]=xe.useState(""),[D,E]=xe.useState(false),[I,R]=xe.useState({});if(!t||!e)return null;let F=xe.useCallback(()=>{w(false),T({}),m("details"),N(""),R({}),r();},[r]),O=xe.useCallback(()=>{a&&Object.keys(b).length>0&&(a(e.id,b),T({}),w(false));},[e.id,b,a]),U=xe.useCallback(()=>{n&&window.confirm("Are you sure you want to delete this card?")&&(n(e.id),F());},[e.id,n,F]),J=xe.useCallback(()=>{u&&C.trim()&&(u(e.id,C.trim()),N(""));},[e.id,C,u]),j=xe.useCallback(async()=>{if(x){E(true);try{let M=await x(e);R(Q=>({...Q,assignees:M}));}catch(M){console.error("Failed to suggest assignee:",M);}finally{E(false);}}},[e,x]),ae=xe.useCallback(async()=>{if(y){E(true);try{let M=await y(e);R(Q=>({...Q,subtasks:M}));}catch(M){console.error("Failed to generate subtasks:",M);}finally{E(false);}}},[e,y]),Ie=xe.useCallback(async()=>{if(g){E(true);try{let M=await g(e);R(Q=>({...Q,effort:M}));}catch(M){console.error("Failed to estimate effort:",M);}finally{E(false);}}},[e,g]),re={...e,...b},Te=o.filter(M=>re.assignedUserIds?.includes(M.id));return jsxRuntime.jsx(Pe,{children:jsxRuntime.jsx("div",{className:"card-detail-overlay",onClick:F,children:jsxRuntime.jsxs("div",{className:"card-detail-modal",onClick:M=>M.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"card-detail-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-header-left",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:re.priority==="URGENT"?"#EF4444":re.priority==="HIGH"?"#F59E0B":re.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),k?jsxRuntime.jsx("input",{type:"text",value:b.title??re.title,onChange:M=>T({...b,title:M.target.value}),className:"card-detail-title-input",placeholder:"Card title"}):jsxRuntime.jsx("h2",{className:"card-detail-title",children:re.title})]}),jsxRuntime.jsxs("div",{className:"card-detail-header-actions",children:[k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:O,className:"card-detail-btn card-detail-btn-primary",children:"Save"}),jsxRuntime.jsx("button",{onClick:()=>{w(false),T({});},className:"card-detail-btn",children:"Cancel"})]}):jsxRuntime.jsxs("button",{onClick:()=>w(true),className:"card-detail-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]}),jsxRuntime.jsxs("button",{onClick:U,className:"card-detail-btn card-detail-btn-danger",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]}),"Delete"]}),jsxRuntime.jsx("button",{onClick:F,className:"card-detail-btn-close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-tabs",children:[jsxRuntime.jsxs("button",{onClick:()=>m("details"),className:`card-detail-tab ${v==="details"?"active":""}`,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Details"]}),jsxRuntime.jsxs("button",{onClick:()=>m("comments"),className:`card-detail-tab ${v==="comments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),"Comments",i.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:i.length})]}),jsxRuntime.jsxs("button",{onClick:()=>m("activity"),className:`card-detail-tab ${v==="activity"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Activity",l.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:l.length})]}),jsxRuntime.jsxs("button",{onClick:()=>m("attachments"),className:`card-detail-tab ${v==="attachments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),"Attachments",s.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:s.length})]}),jsxRuntime.jsxs("button",{onClick:()=>m("ai"),className:`card-detail-tab ${v==="ai"?"active":""}`,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),"AI Insights",jsxRuntime.jsx("span",{className:"card-detail-tab-badge card-detail-tab-badge-ai",children:"AI"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-content",children:[v==="details"&&jsxRuntime.jsxs("div",{className:"card-detail-details",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Description"}),k?jsxRuntime.jsx("textarea",{value:b.description??re.description??"",onChange:M=>T({...b,description:M.target.value}),className:"card-detail-textarea",placeholder:"Add a description...",rows:4}):jsxRuntime.jsx("p",{className:"card-detail-text",children:re.description||"No description"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Assigned To"}),k?jsxRuntime.jsx("select",{multiple:true,value:b.assignedUserIds??re.assignedUserIds??[],onChange:M=>{let Q=Array.from(M.target.selectedOptions,Ae=>Ae.value);T({...b,assignedUserIds:Q});},className:"card-detail-textarea",style:{height:"120px",padding:"8px 12px"},children:o.map(M=>jsxRuntime.jsx("option",{value:M.id,children:M.name},M.id))}):jsxRuntime.jsx("div",{className:"card-detail-users",children:Te.length>0?Te.map(M=>jsxRuntime.jsxs("div",{className:"card-detail-user",children:[jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:M.color},children:M.initials}),jsxRuntime.jsx("span",{children:M.name})]},M.id)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"Unassigned"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Priority"}),k?jsxRuntime.jsxs("select",{value:b.priority??re.priority??"",onChange:M=>T({...b,priority:M.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},children:[jsxRuntime.jsx("option",{value:"",children:"None"}),jsxRuntime.jsx("option",{value:"LOW",children:"LOW"}),jsxRuntime.jsx("option",{value:"MEDIUM",children:"MEDIUM"}),jsxRuntime.jsx("option",{value:"HIGH",children:"HIGH"}),jsxRuntime.jsx("option",{value:"URGENT",children:"URGENT"})]}):jsxRuntime.jsxs("div",{className:"card-detail-priority",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:re.priority==="URGENT"?"#EF4444":re.priority==="HIGH"?"#F59E0B":re.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:re.priority||"None"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Labels"}),jsxRuntime.jsx("div",{className:"card-detail-labels",children:re.labels&&re.labels.length>0?re.labels.map(M=>jsxRuntime.jsx("span",{className:"card-detail-label-tag",children:M},M)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No labels"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section-row",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Start Date"}),k?jsxRuntime.jsx("input",{type:"date",value:b.startDate?new Date(b.startDate).toISOString().split("T")[0]:re.startDate?new Date(re.startDate).toISOString().split("T")[0]:"",onChange:M=>T({...b,startDate:M.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:re.startDate?new Date(re.startDate).toLocaleDateString():"Not set"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"End Date"}),k?jsxRuntime.jsx("input",{type:"date",value:b.endDate?new Date(b.endDate).toISOString().split("T")[0]:re.endDate?new Date(re.endDate).toISOString().split("T")[0]:"",onChange:M=>T({...b,endDate:M.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:re.endDate?new Date(re.endDate).toLocaleDateString():"Not set"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Estimated Hours"}),k?jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",value:b.estimatedTime??re.estimatedTime??"",onChange:M=>T({...b,estimatedTime:M.target.value?parseFloat(M.target.value):void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},placeholder:"Enter hours"}):jsxRuntime.jsx("span",{className:"card-detail-text",children:re.estimatedTime||"Not estimated"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Dependencies"}),jsxRuntime.jsx("div",{className:"card-detail-dependencies",children:re.dependencies&&re.dependencies.length>0?re.dependencies.map(M=>{let Q=typeof M=="string"?M:M.taskId;return jsxRuntime.jsxs("span",{className:"card-detail-dependency",children:["Card #",Q.slice(-4)]},Q)}):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No dependencies"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Created"}),jsxRuntime.jsx("span",{className:"card-detail-text",children:re.createdAt?new Date(re.createdAt).toLocaleString():"Unknown"})]})]}),v==="comments"&&jsxRuntime.jsxs("div",{className:"card-detail-comments",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-form",children:[jsxRuntime.jsx("textarea",{value:C,onChange:M=>N(M.target.value),className:"card-detail-comment-textarea",placeholder:"Write a comment...",rows:3}),jsxRuntime.jsx("button",{onClick:J,disabled:!C.trim(),className:"card-detail-btn card-detail-btn-primary",children:"Add Comment"})]}),jsxRuntime.jsx("div",{className:"card-detail-comments-list",children:i.length>0?i.map(M=>{let Q=o.find(Ae=>Ae.id===M.authorId);return jsxRuntime.jsxs("div",{className:"card-detail-comment",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-author",children:[Q&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:Q.color},children:Q.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-comment-author-name",children:Q?.name||"Unknown"}),jsxRuntime.jsx("div",{className:"card-detail-comment-time",children:new Date(M.createdAt).toLocaleString()})]})]}),d&&jsxRuntime.jsx("button",{onClick:()=>d(M.id),className:"card-detail-comment-delete",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]}),jsxRuntime.jsx("p",{className:"card-detail-comment-content",children:M.content})]},M.id)}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("p",{children:"No comments yet"}),jsxRuntime.jsx("span",{children:"Be the first to comment"})]})})]}),v==="activity"&&jsxRuntime.jsx("div",{className:"card-detail-activity",children:l.length>0?jsxRuntime.jsx("div",{className:"card-detail-activity-list",children:l.map(M=>{let Q=o.find(Ae=>Ae.id===M.userId);return jsxRuntime.jsxs("div",{className:"card-detail-activity-item",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-icon",children:[M.type.includes("CREATED")&&"\u2795",M.type.includes("UPDATED")&&"\u270F\uFE0F",M.type.includes("MOVED")&&"\u27A1\uFE0F",M.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",M.type.includes("COMMENT")&&"\u{1F4AC}",M.type.includes("ASSIGNED")&&"\u{1F464}",M.type.includes("PRIORITY")&&"\u{1F3AF}",M.type.includes("LABEL")&&"\u{1F3F7}\uFE0F",M.type.includes("ATTACHMENT")&&"\u{1F4CE}"]}),jsxRuntime.jsxs("div",{className:"card-detail-activity-content",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-text",children:[jsxRuntime.jsx("strong",{children:Q?.name||"Unknown"})," ",M.type.replace(/_/g," ").toLowerCase(),M.newValue&&jsxRuntime.jsxs("span",{className:"card-detail-activity-value",children:[" ","to ",jsxRuntime.jsx("strong",{children:M.newValue})]})]}),jsxRuntime.jsx("div",{className:"card-detail-activity-time",children:new Date(M.timestamp).toLocaleString()})]})]},M.id)})}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})}),v==="attachments"&&jsxRuntime.jsx("div",{className:"card-detail-attachments",children:jsxRuntime.jsx(Pa,{cardId:e.id,attachments:s,onUpload:f?M=>f(e.id,M):void 0,onDelete:p,currentUserId:h,maxSizeMB:10,maxFiles:20})}),v==="ai"&&jsxRuntime.jsxs("div",{className:"card-detail-ai",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-actions",children:[jsxRuntime.jsx("h3",{className:"card-detail-ai-heading",children:"AI-Powered Suggestions"}),jsxRuntime.jsxs("button",{onClick:j,disabled:D||!x,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Suggest Best Assignee"]}),jsxRuntime.jsxs("button",{onClick:ae,disabled:D||!y,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),jsxRuntime.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),jsxRuntime.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),jsxRuntime.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),"Generate Subtasks"]}),jsxRuntime.jsxs("button",{onClick:Ie,disabled:D||!g,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Estimate Effort"]})]}),I.assignees&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Assignee Suggestions"}),I.assignees.map((M,Q)=>{let Ae=o.find(et=>et.id===M.userId);return jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion",children:[Ae&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:Ae.color},children:Ae.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-name",children:Ae?.name}),jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-reason",children:M.reasoning}),jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion-confidence",children:["Confidence: ",(M.confidence*100).toFixed(0),"%"]})]})]},Q)})]}),I.subtasks&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Suggested Subtasks"}),I.subtasks.map((M,Q)=>jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask",children:[jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-title",children:M.title}),M.description&&jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-desc",children:M.description}),M.estimatedTime&&jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask-time",children:["Est: ",M.estimatedTime,"h"]})]},Q))]}),I.effort&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Effort Estimate"}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-hours",children:[I.effort.hours," hours"]}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-confidence",children:["Confidence: ",(I.effort.confidence*100).toFixed(0),"%"]})]})]}),c.length>0&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insights",children:[jsxRuntime.jsx("h4",{children:"AI Insights"}),c.map(M=>jsxRuntime.jsxs("div",{className:`card-detail-ai-insight card-detail-ai-insight-${M.severity.toLowerCase()}`,children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-header",children:[jsxRuntime.jsx("span",{className:"card-detail-ai-insight-title",children:M.title}),jsxRuntime.jsx("span",{className:"card-detail-ai-insight-severity",children:M.severity})]}),jsxRuntime.jsx("p",{className:"card-detail-ai-insight-desc",children:M.description}),M.suggestedAction&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-action",children:["\u{1F4A1} ",M.suggestedAction]})]},M.id))]}),!I.assignees&&!I.subtasks&&!I.effort&&c.length===0&&jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("p",{children:"AI Suggestions"}),jsxRuntime.jsx("span",{children:"Click a button above to get AI-powered insights"})]})]})]})]})})})}var xp=["LOW","MEDIUM","HIGH","URGENT"],kp=["todo","in-progress","review","done"];function Lo({card:e,isOpen:t,onClose:r,onUpdate:a,onDelete:n,availableUsers:o=[],comments:i=[],activities:l=[],onAddComment:c,onDeleteComment:s,currentUser:u,onAIGenerateDescription:d,onAICreateSubtasks:f,onAIFindSimilar:p,availableColumns:x=[],availableLabels:y=[]}){let[g,h]=xe.useState(e),[v,m]=xe.useState(false),[k,w]=xe.useState([]),[b,T]=xe.useState(false),[C,N]=xe.useState(""),[D,E]=xe.useState(""),[I,R]=xe.useState("all"),[F,O]=xe.useState(false),[U,J]=xe.useState(false),[j,ae]=xe.useState(false),[Ie,re]=xe.useState(false),[Te,M]=xe.useState(false),[Q,Ae]=xe.useState(false),et=xe.useRef(null),Jt=xe.useRef(null),K=xe.useRef(null),ne=xe.useRef(null),Rt=xe.useRef(null),Lt=xe.useRef(null),Ut=xe.useRef(null),Gt=xe.useRef(null);xe.useEffect(()=>{e&&!g?h({...e}):e&&g&&e.id!==g.id&&h({...e});},[e,g]),xe.useEffect(()=>{let S=G=>{let ue=G.target;ne.current&&!ne.current.contains(ue)&&O(false),Rt.current&&!Rt.current.contains(ue)&&J(false),Lt.current&&!Lt.current.contains(ue)&&ae(false),Ut.current&&!Ut.current.contains(ue)&&re(false);};if(F||U||j||Ie)return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[F,U,j,Ie]),xe.useEffect(()=>{if(!t)return;let S=G=>{let ue=G.target,ke=ue.tagName==="INPUT"||ue.tagName==="TEXTAREA"||ue.isContentEditable;if(G.key==="Escape"){G.preventDefault(),F||U||j||Ie||Te||Q?(O(false),J(false),ae(false),re(false),M(false),Ae(false)):ke||r();return}if(ke&&G.key!=="Escape")return;let Se=G.metaKey||G.ctrlKey;switch(G.key.toLowerCase()){case "s":G.preventDefault(),O(true);break;case "a":G.preventDefault(),ae(true);break;case "p":G.preventDefault(),J(true);break;case "l":G.preventDefault(),re(true);break;case "d":Se||(G.preventDefault(),M(true),setTimeout(()=>Gt.current?.focus(),0));break;case "e":Se||(G.preventDefault(),Ae(true));break;case "i":G.preventDefault(),m(true),setTimeout(()=>Jt.current?.focus(),0);break;case "t":G.preventDefault(),T(true);break;case "c":G.preventDefault(),K.current?.focus();break}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[t,r,F,U,j,Ie,Te,Q]);let _=xe.useCallback(S=>{let G=S.currentTarget.textContent?.trim()||"";if(g&&G!==g.title){let ue={...g,title:G};h(ue),a?.(g.id,{title:G});}},[g,a]),H=xe.useCallback(S=>{S.key==="Enter"&&(S.preventDefault(),S.currentTarget.blur()),S.key==="Escape"&&(S.preventDefault(),S.currentTarget.textContent=g?.title||"",S.currentTarget.blur());},[g]),Le=xe.useCallback(()=>{g&&e&&g.description!==e.description&&a?.(g.id,{description:g.description}),m(false);},[g,e,a]),He=xe.useCallback(S=>{if(g){let G={...g,columnId:S};h(G),a?.(g.id,{columnId:S}),O(false);}},[g,a]),Fe=xe.useCallback(S=>{if(g){let G={...g,priority:S};h(G),a?.(g.id,{priority:S}),J(false);}},[g,a]),Ct=xe.useCallback(S=>{if(g){let G=g.assignedUserIds||[],ue=G.includes(S)?G.filter(Se=>Se!==S):[...G,S],ke={...g,assignedUserIds:ue};h(ke),a?.(g.id,{assignedUserIds:ue});}},[g,a]),ie=xe.useCallback(S=>{if(g){let G=g.labels||[],ue=G.includes(S)?G.filter(Se=>Se!==S):[...G,S],ke={...g,labels:ue};h(ke),a?.(g.id,{labels:ue});}},[g,a]),ct=xe.useCallback(S=>{if(g){let G=S.target.value,ue={...g,endDate:G};h(ue),a?.(g.id,{endDate:G}),M(false);}},[g,a]),Re=xe.useCallback(S=>{if(g){let G={...g,estimatedTime:parseFloat(S)||0};h(G),a?.(g.id,{estimatedTime:parseFloat(S)||0});}},[g,a]),Qt=xe.useCallback(()=>{if(C.trim()){let S={id:`subtask-${Date.now()}`,title:C.trim(),completed:false};w([...k,S]),N(""),T(false);}},[C,k]),Nr=xe.useCallback(S=>{w(k.map(G=>G.id===S?{...G,completed:!G.completed}:G));},[k]),me=xe.useCallback(S=>{w(k.filter(G=>G.id!==S));},[k]),ge=xe.useCallback(()=>{D.trim()&&g&&c&&(c(g.id,D.trim()),E(""));},[D,g,c]),Yr=xe.useCallback(S=>{(S.metaKey||S.ctrlKey)&&S.key==="Enter"&&(S.preventDefault(),ge());},[ge]),Dr=S=>jsxRuntime.jsx(vp__default.default,{remarkPlugins:[bp__default.default],rehypePlugins:[yp__default.default],components:{a:({node:G,...ue})=>jsxRuntime.jsx("a",{...ue,target:"_blank",rel:"noopener noreferrer"})},children:S}),qr=l.filter(S=>I==="comments"?S.type.includes("COMMENT"):I==="history"?!S.type.includes("COMMENT"):true);if(!t||!e)return null;let z=g||e,he=o.filter(S=>z.assignedUserIds?.includes(S.id)),de=k.filter(S=>S.completed).length;return jsxRuntime.jsx(Pe,{children:jsxRuntime.jsx("div",{className:"modal-v2-backdrop",onClick:r,style:{position:"fixed",inset:"0",zIndex:9999,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsxs("div",{className:"modal-v2-container",onClick:S=>S.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[jsxRuntime.jsxs("header",{className:"modal-v2-header",children:[jsxRuntime.jsx("h1",{id:"modal-title",ref:et,className:"modal-v2-title",contentEditable:true,suppressContentEditableWarning:true,onBlur:_,onKeyDown:H,children:z.title}),jsxRuntime.jsxs("p",{className:"modal-v2-ai-prompt",children:[jsxRuntime.jsx("span",{className:"modal-v2-ai-icon",children:"\u2728"}),"Ask AI to write a description, create subtasks, or find similar tasks"]}),jsxRuntime.jsx("button",{className:"modal-v2-close",onClick:r,"aria-label":"Close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),z.coverImage&&jsxRuntime.jsx("div",{className:"modal-v2-cover",children:jsxRuntime.jsx("img",{src:z.coverImage,alt:`Cover for ${z.title}`,className:"w-full max-h-96 object-cover",onError:S=>{S.currentTarget.style.display="none";}})}),jsxRuntime.jsxs("section",{className:"modal-v2-metadata",children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:ne,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>O(!F),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 6v6l4 2"})]}),jsxRuntime.jsx("span",{children:"Status"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"S"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:z.columnId||"No status"})]}),F&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:(x.length>0?x:kp.map(S=>({id:S,title:S}))).map(S=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item ${z.columnId===S.id?"active":""}`,onClick:()=>He(S.id),children:S.title},S.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Lt,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>ae(!j),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsx("span",{children:"Assignees"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"A"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:he.length>0?jsxRuntime.jsx("div",{className:"modal-v2-avatars",children:he.map(S=>jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:S.color},title:S.name,children:S.initials},S.id))}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),j&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:o.map(S=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${z.assignedUserIds?.includes(S.id)?"active":""}`,onClick:()=>Ct(S.id),children:[jsxRuntime.jsx("div",{className:"modal-v2-avatar-small",style:{background:S.color},children:S.initials}),S.name,z.assignedUserIds?.includes(S.id)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},S.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Rt,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>J(!U),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsxRuntime.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsxRuntime.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsxRuntime.jsx("span",{children:"Priority"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"P"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:z.priority||"None"})]}),U&&jsxRuntime.jsxs("div",{className:"modal-v2-popover",children:[xp.map(S=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item priority-${S.toLowerCase()} ${z.priority===S?"active":""}`,onClick:()=>Fe(S),children:S},S)),jsxRuntime.jsx("button",{className:"modal-v2-popover-item",onClick:()=>Fe(""),children:"None"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Ut,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>re(!Ie),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsx("span",{children:"Labels"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"L"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:z.labels&&z.labels.length>0?jsxRuntime.jsx("span",{children:z.labels.join(", ")}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),Ie&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:(y.length>0?y:["Bug","Feature","Enhancement","Documentation"]).map(S=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${z.labels?.includes(S)?"active":""}`,onClick:()=>ie(S),children:[S,z.labels?.includes(S)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},S))})]}),jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>{M(!Te),setTimeout(()=>Gt.current?.showPicker?.(),0);},children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),jsxRuntime.jsx("span",{children:"Due Date"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"D"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:z.endDate?new Date(z.endDate).toLocaleDateString():"Not set"}),jsxRuntime.jsx("input",{ref:Gt,type:"date",value:typeof z.endDate=="string"?z.endDate.split("T")[0]:z.endDate?(()=>{let S=new Date(z.endDate),G=S.getUTCFullYear(),ue=String(S.getUTCMonth()+1).padStart(2,"0"),ke=String(S.getUTCDate()).padStart(2,"0");return `${G}-${ue}-${ke}`})():"",onChange:ct,style:{position:"absolute",opacity:0,pointerEvents:"none"}})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>Ae(!Q),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 6 12 12 16 14"})]}),jsxRuntime.jsx("span",{children:"Estimated Time"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"E"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:z.estimatedTime?`${z.estimatedTime}h`:"Not set"})]}),Q&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",placeholder:"Hours",value:z.estimatedTime||"",onChange:S=>Re(S.target.value),className:"modal-v2-time-input",autoFocus:true,onBlur:()=>Ae(false)})})]})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),jsxRuntime.jsx("h2",{children:"Description"}),jsxRuntime.jsxs("button",{className:"modal-v2-ai-button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),"AI Assist"]})]}),v?jsxRuntime.jsx("textarea",{className:"modal-v2-textarea",value:z.description||"",onChange:S=>{if(g){let G={...g,description:S.target.value};h(G);}},onBlur:Le,placeholder:"Add a detailed description...",autoFocus:true}):jsxRuntime.jsx("div",{className:"modal-v2-content",onClick:()=>m(true),children:z.description?jsxRuntime.jsx("div",{className:"modal-v2-markdown",children:Dr(z.description)}):jsxRuntime.jsxs("p",{className:"modal-v2-placeholder",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Add description..."]})})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M9 11l3 3L22 4"}),jsxRuntime.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),jsxRuntime.jsx("h2",{children:"Subtasks"}),k.length>0&&jsxRuntime.jsxs("span",{className:"modal-v2-count",children:[de,"/",k.length]}),jsxRuntime.jsxs("button",{className:"modal-v2-add-button",onClick:()=>T(true),children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add"]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-subtasks",children:[k.map(S=>jsxRuntime.jsxs("div",{className:`modal-v2-subtask ${S.completed?"completed":""}`,children:[jsxRuntime.jsx("button",{className:"modal-v2-subtask-checkbox",onClick:()=>Nr(S.id),children:S.completed?jsxRuntime.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M9 12l2 2 4-4",stroke:"white",strokeWidth:"2",fill:"none"})]}):jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"})})}),jsxRuntime.jsx("span",{className:"modal-v2-subtask-title",children:S.title}),jsxRuntime.jsx("button",{className:"modal-v2-subtask-delete",onClick:()=>me(S.id),children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]},S.id)),b&&jsxRuntime.jsx("div",{className:"modal-v2-subtask-input-row",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Subtask title...",value:C,onChange:S=>N(S.target.value),onKeyDown:S=>{S.key==="Enter"&&Qt(),S.key==="Escape"&&(T(false),N(""));},onBlur:Qt,autoFocus:true,className:"modal-v2-subtask-input"})})]})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("h2",{children:"Activity"}),jsxRuntime.jsxs("div",{className:"modal-v2-filters",children:[jsxRuntime.jsx("button",{className:`modal-v2-filter ${I==="all"?"active":""}`,onClick:()=>R("all"),children:"All"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${I==="comments"?"active":""}`,onClick:()=>R("comments"),children:"Comments"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${I==="history"?"active":""}`,onClick:()=>R("history"),children:"History"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-input",children:[u&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:u.color},children:u.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-wrapper",children:[jsxRuntime.jsx("textarea",{ref:K,className:"modal-v2-comment-textarea",placeholder:"Write a comment...",value:D,onChange:S=>E(S.target.value),onKeyDown:Yr,rows:1}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-toolbar",children:[jsxRuntime.jsxs("div",{className:"modal-v2-toolbar-left",children:[jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Attach file",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Mention user",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntime.jsx("path",{d:"M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94"})]})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Add emoji",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),jsxRuntime.jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),jsxRuntime.jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})})]}),jsxRuntime.jsx("button",{className:"modal-v2-send-button",onClick:ge,disabled:!D.trim(),children:"Send"})]})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-timeline",children:[qr.map(S=>{let G=o.find(ke=>ke.id===S.userId);if(S.type.includes("COMMENT")){let ke=i.find(Se=>Se.id===S.metadata?.commentId);return ke?jsxRuntime.jsxs("div",{className:"modal-v2-activity-item comment-item",children:[G&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:G.color},children:G.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-activity-header",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:G?.name||"Unknown"}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(S.timestamp).toLocaleString()})]}),jsxRuntime.jsx("div",{className:"modal-v2-comment-body",children:ke.content})]})]},S.id):null}return jsxRuntime.jsxs("div",{className:"modal-v2-activity-item history-item",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-icon",children:[S.type.includes("CREATED")&&"\u2795",S.type.includes("UPDATED")&&"\u270F\uFE0F",S.type.includes("MOVED")&&"\u27A1\uFE0F",S.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",S.type.includes("ASSIGNED")&&"\u{1F464}",S.type.includes("PRIORITY")&&"\u{1F3AF}",S.type.includes("LABEL")&&"\u{1F3F7}\uFE0F"]}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-text",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:G?.name||"Unknown"})," ",S.type.replace(/_/g," ").toLowerCase(),S.newValue&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" to ",jsxRuntime.jsx("strong",{children:S.newValue})]})]}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(S.timestamp).toLocaleString()})]})]},S.id)}),qr.length===0&&jsxRuntime.jsxs("div",{className:"modal-v2-empty",children:[jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})]})]})]})})})}function Pp({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.period}),t.map((r,a)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:r.color},children:[r.name,": ",jsxRuntime.jsx("strong",{children:r.value})," cards"]},a))]})}function Bo({data:e,title:t="Team Velocity",height:r=300,showAverage:a=true,showPlanned:n=true}){let o=e.map(i=>({...i,average:i.average??e.reduce((l,c)=>l+c.completed,0)/e.length}));return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:r,children:jsxRuntime.jsxs(recharts.LineChart,{data:o,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"period",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Pp,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"completed",stroke:"#10B981",strokeWidth:3,name:"Completed",dot:{fill:"#10B981",r:5},activeDot:{r:7}}),n&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"planned",stroke:"#3B82F6",strokeWidth:2,strokeDasharray:"5 5",name:"Planned",dot:{fill:"#3B82F6",r:4}}),a&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"average",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"3 3",name:"Average",dot:false})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Completed"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.reduce((i,l)=>i+l.completed,0)})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Average Velocity"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:(e.reduce((i,l)=>i+l.completed,0)/e.length).toFixed(1)})]}),n&&e.some(i=>i.planned)&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Planned"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:e.reduce((i,l)=>i+(l.planned||0),0)})]})]})]})}function Hp({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.day}),t.map((r,a)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:r.color},children:[r.name,": ",jsxRuntime.jsx("strong",{children:r.value})," tasks"]},a))]})}function Oo({data:e,title:t="Sprint Burndown",height:r=300,totalTasks:a,useArea:n=false}){let o=a??(e[0]?.ideal||e[0]?.remaining||0),i=e[e.length-1]?.remaining||0,l=e[e.length-1]?.ideal||0,c=o>0?(o-i)/o*100:0,s=i<=l;return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:r,children:jsxRuntime.jsxs(n?recharts.AreaChart:recharts.LineChart,{data:e,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"day",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Hp,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"ideal",stroke:"#F59E0B",fill:"rgba(245, 158, 11, 0.2)",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal"}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"remaining",stroke:s?"#10B981":"#EF4444",fill:s?"rgba(16, 185, 129, 0.2)":"rgba(239, 68, 68, 0.2)",strokeWidth:3,name:"Remaining"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Line,{type:"linear",dataKey:"ideal",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal",dot:{fill:"#F59E0B",r:4}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"remaining",stroke:s?"#10B981":"#EF4444",strokeWidth:3,name:"Remaining",dot:{fill:s?"#10B981":"#EF4444",r:5},activeDot:{r:7}})]})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Progress"}),jsxRuntime.jsxs("span",{className:"chart-stat-value",style:{color:c>=50?"#10B981":"#F59E0B"},children:[c.toFixed(0),"%"]})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Remaining"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:s?"#10B981":"#EF4444"},children:i})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Status"}),jsxRuntime.jsx("span",{className:"chart-stat-badge",style:{background:s?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:s?"#10B981":"#EF4444"},children:s?"\u2713 On Track":"\u26A0 Behind"})]})]})]})}var Yp={URGENT:"#EF4444",HIGH:"#F59E0B",MEDIUM:"#3B82F6",LOW:"#10B981"},bl=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"];function qp({cx:e,cy:t,midAngle:r,innerRadius:a,outerRadius:n,percent:o}){let i=a+(n-a)*.5,l=e+i*Math.cos(-r*(Math.PI/180)),c=t+i*Math.sin(-r*(Math.PI/180));return o<.05?null:jsxRuntime.jsx("text",{x:l,y:c,fill:"white",textAnchor:l>e?"start":"end",dominantBaseline:"central",style:{fontSize:"12px",fontWeight:600},children:`${(o*100).toFixed(0)}%`})}function yl({active:e,payload:t}){if(!e||!t||!t.length)return null;let r=t[0].payload,a=t[0].payload.totalValue||0,n=a>0?(r.value/a*100).toFixed(1):"0";return jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:r.name}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:r.color||t[0].color},children:["Count: ",jsxRuntime.jsx("strong",{children:r.value})]}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:"rgba(255, 255, 255, 0.7)"},children:["Percentage: ",jsxRuntime.jsxs("strong",{children:[n,"%"]})]})]})}function zo({data:e,title:t="Distribution",type:r="pie",height:a=300,showPercentages:n=true}){let o=e.reduce((c,s)=>c+s.value,0),i=e.map(c=>({...c,totalValue:o,color:c.color||Yp[c.name]||bl[e.indexOf(c)%bl.length]})),l=i.map(c=>c.color);return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:a,children:r==="pie"?jsxRuntime.jsxs(recharts.PieChart,{children:[jsxRuntime.jsx(recharts.Pie,{data:i,cx:"50%",cy:"50%",labelLine:false,label:n?qp:false,outerRadius:a*.35,fill:"#8884d8",dataKey:"value",children:i.map((c,s)=>jsxRuntime.jsx(recharts.Cell,{fill:l[s]},`cell-${s}`))}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(yl,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"},formatter:(c,s)=>{let u=s.payload,d=o>0?(u.value/o*100).toFixed(0):"0";return `${c} (${u.value} - ${d}%)`}})]}):jsxRuntime.jsxs(recharts.BarChart,{data:i,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"name",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(yl,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Bar,{dataKey:"value",name:"Count",radius:[8,8,0,0],children:i.map((c,s)=>jsxRuntime.jsx(recharts.Cell,{fill:l[s]},`cell-${s}`))})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Cards"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:o})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Categories"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.length})]}),e.length>0&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Largest Category"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:e.reduce((c,s)=>s.value>c.value?s:c).name})]})]})]})}var wn=xe.memo(({selectedCards:e,availableUsers:t=[],onClearSelection:r,callbacks:a,columns:n=[],availableLabels:o=[]})=>{let[i,l]=xe.useState(false),[c,s]=xe.useState(false),[u,d]=xe.useState(false),[f,p]=xe.useState(false);if(e.length===0)return null;let x=e.map(k=>k.id),y=k=>{a.onBulkUpdate?.(x,{priority:k}),l(false);},g=k=>{a.onBulkMove?.(x,k),s(false),r();},h=k=>{a.onBulkUpdate?.(x,{assignedUserIds:k}),d(false);},v=k=>{let w=new Set;e.forEach(T=>{T.labels?.forEach(C=>w.add(C));});let b=Array.from(new Set([...w,...k]));a.onBulkUpdate?.(x,{labels:b}),p(false);},m=()=>{confirm(`Delete ${e.length} card(s)? This cannot be undone.`)&&(a.onBulkDelete?.(x),r());};return jsxRuntime.jsx("div",{className:"asakaa-bulk-toolbar",children:jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-content",children:[jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-count",children:[e.length," card",e.length!==1?"s":""," selected"]}),jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-actions",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>l(!i),title:"Update priority",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Priority"})}),i&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:["LOW","MEDIUM","HIGH","URGENT"].map(k=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>y(k),children:[jsxRuntime.jsx("span",{className:te("asakaa-priority-dot",k==="LOW"&&"bg-asakaa-priority-low",k==="MEDIUM"&&"bg-asakaa-priority-medium",k==="HIGH"&&"bg-asakaa-priority-high",k==="URGENT"&&"bg-asakaa-priority-urgent")}),k]},k))})]}),n.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>s(!c),title:"Move to column",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Move"})}),c&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:n.map(k=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>g(k.id),children:k.title},k.id))})]}),t.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>d(!u),title:"Assign users",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Assign"})}),u&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:t.map(k=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>h([k.id]),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:k.color},children:k.initials}),k.name]},k.id))})]}),o.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>p(!f),title:"Add labels",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Labels"})}),f&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:o.map(k=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>v([k]),children:k},k))})]}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button asakaa-bulk-toolbar-button-danger",onClick:m,title:"Delete selected cards",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Delete"})}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:r,title:"Clear selection",children:jsxRuntime.jsx("span",{className:"text-sm",children:"\u2715"})})]})]})})});wn.displayName="BulkOperationsToolbar";function em(e,t,r){if(t==="none")return [];let a=new Map;return e.forEach(n=>{let o,i,l,c,s;switch(t){case "assignee":let u=n.assignedUserIds||(n.assigneeId?[n.assigneeId]:[]);u.length>0?u.forEach(p=>{let x=r?.find(y=>y.id===p);i=`assignee-${p}`,l=x?.name||`User ${p}`,c=x?.color,s=x?.avatar,a.has(i)||a.set(i,{id:i,title:l,groupValue:p,cardIds:[],color:c,icon:s}),a.get(i).cardIds.push(n.id);}):(i="assignee-unassigned",l="Unassigned",c="#6b7280",s="\u{1F464}",a.has(i)||a.set(i,{id:i,title:l,groupValue:null,cardIds:[],color:c,icon:s}),a.get(i).cardIds.push(n.id));break;case "priority":o=n.priority||"NONE",i=`priority-${o}`;let f={URGENT:{title:"\u{1F534} Urgent",color:"#ef4444"},HIGH:{title:"\u{1F7E0} High",color:"#f97316"},MEDIUM:{title:"\u{1F7E1} Medium",color:"#eab308"},LOW:{title:"\u{1F7E2} Low",color:"#22c55e"},NONE:{title:"\u26AA No Priority",color:"#6b7280"}}[o];l=f.title,c=f.color,a.has(i)||a.set(i,{id:i,title:l,groupValue:o,cardIds:[],color:c}),a.get(i).cardIds.push(n.id);break;case "label":n.labels&&n.labels.length>0?n.labels.forEach(p=>{i=`label-${p}`,l=p,c="#6b7280",a.has(i)||a.set(i,{id:i,title:l,groupValue:p,cardIds:[],color:c}),a.get(i).cardIds.push(n.id);}):(i="label-none",l="No Labels",c="#6b7280",a.has(i)||a.set(i,{id:i,title:l,groupValue:null,cardIds:[],color:c}),a.get(i).cardIds.push(n.id));break}}),Array.from(a.values()).sort((n,o)=>n.title.localeCompare(o.title))}function Ho({board:e,swimlaneConfig:t,availableUsers:r,callbacks:a,className:n}){let[o,i]=xe.useState(new Set),l=xe.useMemo(()=>em(e.cards,t.groupBy,r),[e.cards,t.groupBy,r]),c=xe.useCallback(s=>{i(u=>{let d=new Set(u);return d.has(s)?d.delete(s):d.add(s),d});},[]);return t.groupBy==="none"||l.length===0?jsxRuntime.jsx(yr,{board:e,callbacks:a,availableUsers:r,className:n}):jsxRuntime.jsxs("div",{className:te("asakaa-swimlane-view",n),children:[l.map(s=>{let u=o.has(s.id),d=e.cards.filter(p=>s.cardIds.includes(p.id)),f={...e,cards:d};return jsxRuntime.jsxs("div",{className:"asakaa-swimlane mb-6 rounded-lg border border-white/10 overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"asakaa-swimlane-header px-4 py-3 bg-white/5 backdrop-blur-sm flex items-center justify-between cursor-pointer hover:bg-white/10 transition-colors",onClick:()=>t.collapsible&&c(s.id),style:{borderLeft:s.color?`4px solid ${s.color}`:void 0},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[s.icon&&jsxRuntime.jsx("span",{className:"text-2xl leading-none",children:s.icon}),jsxRuntime.jsx("h3",{className:"text-lg font-semibold",style:{color:s.color},children:s.title}),jsxRuntime.jsxs("span",{className:"text-sm text-white/50 font-medium",children:["(",s.cardIds.length," ",s.cardIds.length===1?"card":"cards",")"]})]}),t.collapsible&&jsxRuntime.jsx("button",{className:"text-white/50 hover:text-white transition-colors","aria-label":u?"Expand lane":"Collapse lane",children:u?"\u25B6":"\u25BC"})]}),!u&&jsxRuntime.jsx("div",{className:"asakaa-swimlane-content p-4",children:jsxRuntime.jsx(yr,{board:f,callbacks:a,availableUsers:r})})]},s.id)}),l.length===0&&jsxRuntime.jsxs("div",{className:"text-center py-12 text-white/50",children:[jsxRuntime.jsx("p",{className:"text-lg",children:"No cards to display"}),jsxRuntime.jsx("p",{className:"text-sm mt-2",children:"Cards will appear here when they match the grouping criteria"})]})]})}var Uo=[{value:"none",label:"No Grouping",icon:"\u{1F4CB}",description:"Standard Kanban board view"},{value:"assignee",label:"By Assignee",icon:"\u{1F465}",description:"Group cards by assigned user"},{value:"priority",label:"By Priority",icon:"\u{1F3AF}",description:"Group cards by priority level"},{value:"label",label:"By Label",icon:"\u{1F3F7}\uFE0F",description:"Group cards by label/tag"}];function Go({value:e,onChange:t,className:r}){let[a,n]=xe.useState(false),o=xe.useRef(null),i=xe.useRef(null),l=Uo.find(s=>s.value===e)||Uo[0];xe.useEffect(()=>{function s(u){o.current&&!o.current.contains(u.target)&&i.current&&!i.current.contains(u.target)&&n(false);}if(a)return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[a]);let c=s=>{t(s),n(false);};return jsxRuntime.jsxs("div",{className:te("relative inline-block",r),children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>n(!a),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-white/10 hover:bg-white/15 border border-white/20 transition-all text-sm font-medium text-white/90",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:l.icon}),jsxRuntime.jsx("span",{children:l.label}),jsxRuntime.jsx("svg",{className:te("w-4 h-4 transition-transform",a&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxRuntime.jsxs("div",{ref:o,className:"absolute top-full left-0 mt-2 min-w-[280px] rounded-lg bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl border border-white/20 shadow-2xl z-50 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b border-white/10",children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-white/70 uppercase tracking-wider",children:"Group By"})}),jsxRuntime.jsx("div",{className:"py-1",children:Uo.map(s=>jsxRuntime.jsxs("button",{onClick:()=>c(s.value),className:te("w-full px-3 py-2 flex items-start gap-3 text-left transition-all hover:bg-white/10",e===s.value&&"bg-white/5"),children:[jsxRuntime.jsx("span",{className:"text-xl leading-none mt-0.5",children:s.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"font-semibold text-sm text-white",children:s.label}),e===s.value&&jsxRuntime.jsx("span",{className:"text-blue-400 text-xs",children:"\u2713"})]}),jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-0.5",children:s.description})]})]},s.value))})]})]})}var Ia=[{keys:"ArrowUp",action:"navigate_up",description:"Navigate to card above"},{keys:"ArrowDown",action:"navigate_down",description:"Navigate to card below"},{keys:"ArrowLeft",action:"navigate_left",description:"Navigate to previous column"},{keys:"ArrowRight",action:"navigate_right",description:"Navigate to next column"},{keys:"Enter",action:"open_card",description:"Open selected card"},{keys:"Escape",action:"close_modal",description:"Close modal or dialog"},{keys:"Delete",action:"delete_card",description:"Delete selected card",modifiers:{shift:true}},{keys:"n",action:"new_card",description:"Create new card",modifiers:{ctrl:true}},{keys:"k",action:"search",description:"Open search/command palette",modifiers:{ctrl:true}},{keys:"s",action:"save",description:"Save changes",modifiers:{ctrl:true}},{keys:"z",action:"undo",description:"Undo last action",modifiers:{ctrl:true}},{keys:"y",action:"redo",description:"Redo last undone action",modifiers:{ctrl:true}},{keys:"a",action:"select_all",description:"Select all cards",modifiers:{ctrl:true}},{keys:"Escape",action:"deselect_all",description:"Deselect all cards"},{keys:"?",action:"show_shortcuts",description:"Show keyboard shortcuts help",modifiers:{shift:true}}];function am(e,t){if(!(Array.isArray(t.keys)?t.keys:[t.keys]).some(s=>e.key===s||e.code===s))return false;let n=t.modifiers||{},o=n.ctrl?e.ctrlKey||e.metaKey:!e.ctrlKey&&!e.metaKey,i=n.shift?e.shiftKey:!e.shiftKey,l=n.alt?e.altKey:!e.altKey,c=n.meta?e.metaKey:true;return o&&i&&l&&c}function Tl(e={}){let{shortcuts:t=Ia,enabled:r=true,preventDefault:a=true}=e,n=xe.useRef(t),o=xe.useRef(r);xe.useEffect(()=>{n.current=t,o.current=r;},[t,r]);let i=xe.useCallback(c=>{n.current=[...n.current,c];},[]),l=xe.useCallback(c=>{n.current=n.current.filter(s=>s.action!==c);},[]);return xe.useEffect(()=>{function c(s){if(!o.current)return;let u=s.target;if(!((u.tagName==="INPUT"||u.tagName==="TEXTAREA"||u.isContentEditable)&&s.key!=="Escape"&&!s.ctrlKey&&!s.metaKey)){for(let d of n.current)if(am(s,d)){a&&s.preventDefault();let f=new CustomEvent("keyboard-action",{detail:d.action,bubbles:true,cancelable:true});window.dispatchEvent(f);break}}}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a]),{registerShortcut:i,unregisterShortcut:l,isEnabled:r}}function om(e){return {ArrowUp:"\u2191",ArrowDown:"\u2193",ArrowLeft:"\u2190",ArrowRight:"\u2192",Enter:"\u21B5",Escape:"Esc",Delete:"Del"," ":"Space"}[e]||e.toUpperCase()}function sm(e){let t=[],r=typeof navigator<"u"&&navigator.platform.includes("Mac");return e.modifiers?.ctrl&&t.push(r?"\u2318":"Ctrl"),e.modifiers?.shift&&t.push("Shift"),e.modifiers?.alt&&t.push(r?"\u2325":"Alt"),e.modifiers?.meta&&t.push("\u2318"),t.join(" + ")}function im(e){let t=Array.isArray(e.keys)?e.keys[0]:e.keys,r=sm(e),a=t?om(t):"";return r?`${r} + ${a}`:a}function lm(e){let t={Navigation:[],Actions:[],Editing:[],Selection:[]};return e.forEach(r=>{r.action.includes("navigate")?t.Navigation?.push(r):r.action.includes("select")?t.Selection?.push(r):["undo","redo","save"].includes(r.action)?t.Editing?.push(r):t.Actions?.push(r);}),t}function _o({shortcuts:e=Ia,isOpen:t,onClose:r,className:a}){let[n,o]=xe.useState(false);if(xe.useEffect(()=>{o(true);},[]),xe.useEffect(()=>{function l(c){c.key==="Escape"&&t&&r();}if(t)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,r]),!n||!t)return null;let i=lm(e);return jsxRuntime.jsxs("div",{className:te("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-3xl w-full mx-4 max-h-[80vh] overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u2328\uFE0F"}),"Keyboard Shortcuts"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Speed up your workflow with these shortcuts"})]}),jsxRuntime.jsx("button",{onClick:r,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-6 py-6 overflow-y-auto max-h-[calc(80vh-120px)]",children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:Object.entries(i).map(([l,c])=>c.length===0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-semibold text-white/90 mb-4 flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"w-1 h-5 bg-blue-500 rounded-full"}),l]}),jsxRuntime.jsx("div",{className:"space-y-3",children:c.map(s=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-lg bg-white/5 hover:bg-white/10 transition-colors",children:[jsxRuntime.jsx("span",{className:"text-sm text-white/80",children:s.description}),jsxRuntime.jsx("kbd",{className:"px-3 py-1.5 bg-gradient-to-br from-gray-700 to-gray-800 border border-white/20 rounded-md text-xs font-mono text-white/90 shadow-lg whitespace-nowrap",children:im(s)})]},s.action))})]},l))})}),jsxRuntime.jsx("div",{className:"px-6 py-4 border-t border-white/10 bg-white/5",children:jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center",children:["Press ",jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 bg-white/10 rounded text-white/70",children:"?"})," to toggle this help panel"]})})]})]})}var $o=[{id:"bug-report",name:"Bug Report",description:"Report a bug or issue",icon:"\u{1F41B}",category:"Development",template:{title:"[BUG] ",description:`**Steps to reproduce:**
|
|
1
|
+
'use strict';var client=require('react-dom/client'),core=require('@libxai/core'),ke=require('react'),core$1=require('@dnd-kit/core'),sortable=require('@dnd-kit/sortable'),reactVirtual=require('@tanstack/react-virtual'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jspdf=require('jspdf'),ud=require('html2canvas'),Gi=require('react-dom'),jsxRuntime=require('react/jsx-runtime'),cmdk=require('cmdk'),bp=require('react-markdown'),yp=require('remark-gfm'),xp=require('rehype-sanitize'),recharts=require('recharts'),lucideReact=require('lucide-react'),framerMotion=require('framer-motion');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var ke__namespace=/*#__PURE__*/_interopNamespace(ke);var ud__default=/*#__PURE__*/_interopDefault(ud);var Gi__namespace=/*#__PURE__*/_interopNamespace(Gi);var bp__default=/*#__PURE__*/_interopDefault(bp);var yp__default=/*#__PURE__*/_interopDefault(yp);var xp__default=/*#__PURE__*/_interopDefault(xp);var Wa=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Va=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:r}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:r}=e;return "scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return [Va.Translate.toString(e),Va.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:a}=e;return t+" "+r+"ms "+a}}});function ee(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function Ka(e,t){return e===null&&t===null?1e3:e===null&&t!==null?t/2:e!==null&&t===null?e+1e3:e!==null&&t!==null?(e+t)/2:1e3}function sd(e){return Array.from({length:e},(t,r)=>(r+1)*1e3)}function qn(e,t){return e.length===0?1e3:t===0?Ka(null,e[0].position):t>=e.length?Ka(e[e.length-1].position,null):Ka(e[t-1].position,e[t].position)}function Vs(e,t=100){return e>t}var id=e=>{if(e.message.includes("network")||e.message.includes("fetch"))return true;if("status"in e){let t=e.status;return t>=500||t===429}return false};function ld(e,t,r,a){let n=t*Math.pow(r,e-1),o=n*.2*Math.random();return Math.min(n+o,a)}async function ja(e,t={}){let{maxAttempts:r=3,initialDelay:a=1e3,backoffMultiplier:n=2,maxDelay:o=1e4,shouldRetry:i=id,onRetry:l}=t,c,s=0;for(let u=1;u<=r;u++){s=u;try{return {data:await e(),attempts:s,success:!0}}catch(d){if(c=d,u===r||!i(c,u))return {error:c,attempts:s,success:false};let p=ld(u,a,n,o);if(l)try{l(c,u,p);}catch(x){console.error("Error in retry callback:",x);}await new Promise(x=>setTimeout(x,p));}}return {error:c||new Error("Unknown error"),attempts:s,success:false}}function cd(e,t=3){let r;for(let a=1;a<=t;a++)try{return {data:e(),success:!0}}catch(n){if(r=n,a===t)return {error:r,success:false}}return {error:r||new Error("Unknown error"),success:false}}function dd(e,t={}){return async(...r)=>ja(()=>e(...r),t)}var Xn=class{constructor(t=5,r=6e4){this.threshold=t;this.resetTimeout=r;this.failures=0;this.lastFailureTime=0;this.isOpen=false;}async execute(t){if(this.isOpen)if(Date.now()-this.lastFailureTime>=this.resetTimeout)this.reset();else throw new Error("Circuit breaker is open - too many failures");try{let r=await t();return this.onSuccess(),r}catch(r){throw this.onFailure(),r}}onSuccess(){this.failures=0,this.isOpen=false;}onFailure(){this.failures++,this.lastFailureTime=Date.now(),this.failures>=this.threshold&&(this.isOpen=true);}reset(){this.failures=0,this.isOpen=false;}getStatus(){return {failures:this.failures,isOpen:this.isOpen}}};var Ks=(o=>(o[o.DEBUG=0]="DEBUG",o[o.INFO=1]="INFO",o[o.WARN=2]="WARN",o[o.ERROR=3]="ERROR",o[o.NONE=4]="NONE",o))(Ks||{}),Pr=class Pr{constructor(t={}){this.defaultLogHandler=t=>{let{timestamp:r,level:a,message:n,component:o,...i}=t,l=`[${r}] [${a}] [${o}]`,c=Object.keys(i).length>0;switch(a){case "DEBUG":console.debug(l,n,c?i:"");break;case "INFO":console.info(l,n,c?i:"");break;case "WARN":console.warn(l,n,c?i:"");break;case "ERROR":console.error(l,n,c?i:""),t.error?.stack&&console.error(t.error.stack);break}};let r=process.env.NODE_ENV==="development";this.options={minLevel:t.minLevel??(r?0:1),enabled:t.enabled??true,onLog:t.onLog??this.defaultLogHandler,enableTiming:t.enableTiming??true,componentName:t.componentName??"ASAKAA",...Pr.globalOptions};}static configure(t){Pr.globalOptions={...Pr.globalOptions,...t};}child(t){return new Pr({...this.options,componentName:`${this.options.componentName}:${t}`})}debug(t,r){this.log(0,t,r);}info(t,r){this.log(1,t,r);}warn(t,r){this.log(2,t,r);}error(t,r,a){this.log(3,t,{...a,error:r?{message:r.message,stack:r.stack,name:r.name}:void 0});}startTimer(t){return this.options.enableTiming?new Ya((r,a)=>{this.log(0,`${t} completed`,{...a,action:t,duration:r});},true):new Ya(()=>{},false)}log(t,r,a){if(!this.options.enabled||t<this.options.minLevel)return;let n={timestamp:new Date().toISOString(),level:Ks[t],message:r,component:this.options.componentName,...a};this.options.onLog(n);}};Pr.globalOptions={};var Zn=Pr,Ya=class{constructor(t,r){this.onEnd=t;this.enabled=r;this.startTime=r?performance.now():0;}end(t){if(!this.enabled)return 0;let r=Math.round(performance.now()-this.startTime);return this.onEnd(r,t),r}elapsed(){return this.enabled?Math.round(performance.now()-this.startTime):0}},js=new Zn;function pd(e,t){let r={board:{id:e.id,title:e.title,metadata:e.metadata,exportedAt:new Date().toISOString()},columns:e.columns,cards:e.cards,options:t};return JSON.stringify(r,null,2)}function md(e,t){let r=["Card ID","Title","Description","Column","Priority","Labels","Assigned Users","Start Date","End Date","Created At","Updated At"],a=e.cards.map(o=>{let i=e.columns.find(l=>l.id===o.columnId);return [o.id,Jn(o.title),Jn(o.description||""),Jn(i?.title||""),o.priority||"",(o.labels||[]).join(";"),(o.assignedUserIds||[]).join(";"),o.startDate||"",o.endDate||"",o.createdAt||"",o.updatedAt||""]});return [r.join(","),...a.map(o=>o.join(","))].join(`
|
|
2
|
+
`)}async function fd(e,t,r){let a=t;if(!a){let i=document.querySelector(".asakaa-board");i&&(a=i.parentElement||i);}if(a)try{let i=await ud__default.default(a,{backgroundColor:"#0a0a0a",scale:1.5,logging:!1,useCORS:!0,allowTaint:!0,windowWidth:a.scrollWidth,windowHeight:a.scrollHeight}),l=i.toDataURL("image/png"),c=297,s=210,u=i.width/i.height,d=c-20,f=d/u;f>s-20&&(f=s-20,d=f*u);let p=new jspdf.jsPDF({orientation:"landscape",unit:"mm",format:"a4"});p.setFontSize(16),p.setTextColor(255,255,255),p.setFillColor(10,10,10),p.rect(0,0,c,15,"F"),p.text(e.title||"Kanban Board",10,10);let x=(c-d)/2;return p.addImage(l,"PNG",x,20,d,f),p}catch(i){console.error("Error capturing board:",i);}let n=new jspdf.jsPDF,o=20;return n.setFontSize(20),n.text(e.title||"Kanban Board",20,o),o+=10,n.setFontSize(10),n.setTextColor(128,128,128),n.text(`Exported on ${new Date().toLocaleString()}`,20,o),o+=15,n.setTextColor(0,0,0),e.columns.forEach(i=>{let l=e.cards.filter(c=>c.columnId===i.id);o>250&&(n.addPage(),o=20),n.setFontSize(16),n.setFont("helvetica","bold"),n.text(i.title,20,o),o+=8,l.length===0?(n.setFontSize(10),n.setFont("helvetica","italic"),n.setTextColor(128,128,128),n.text("No cards in this column",20,o),n.setTextColor(0,0,0),o+=10):l.forEach(c=>{if(o>260&&(n.addPage(),o=20),n.setFontSize(12),n.setFont("helvetica","bold"),n.text(c.title,25,o),o+=6,c.description){n.setFontSize(9),n.setFont("helvetica","normal");let u=n.splitTextToSize(c.description,160);n.text(u,25,o),o+=u.length*5;}let s=[];if(c.priority&&s.push(`Priority: ${c.priority}`),c.labels&&c.labels.length>0&&s.push(`Labels: ${c.labels.join(", ")}`),c.assignedUserIds&&c.assignedUserIds.length>0&&s.push(`Assigned: ${c.assignedUserIds.length} user(s)`),c.startDate||c.endDate){let u=[];c.startDate&&u.push(`Start: ${c.startDate}`),c.endDate&&u.push(`End: ${c.endDate}`),s.push(u.join(" \u2192 "));}s.length>0&&(n.setFontSize(8),n.setTextColor(100,100,100),n.text(s.join(" \u2022 "),25,o),n.setTextColor(0,0,0),o+=5),o+=5;}),o+=5;}),n}function Jn(e){return e.includes(",")||e.includes('"')||e.includes(`
|
|
3
|
+
`)?`"${e.replace(/"/g,'""')}"`:e}async function qs(e,t,r,a){switch(t){case "json":return pd(e,a);case "csv":return md(e);case "pdf":return await fd(e,r);default:throw new Error(`Unsupported export format: ${t}`)}}function Xs(e,t,r){let a=`board-export-${new Date().getTime()}`;if(t==="pdf"&&typeof e=="object"&&e!==null&&"save"in e){let u=`${a}.pdf`;e.save(u);return}if(typeof e!="string")throw new Error("Invalid content type for non-PDF export");let o=`${a}.${{json:"json",csv:"csv",pdf:"pdf"}[t]}`,i={json:"application/json",csv:"text/csv",pdf:"application/pdf"},l=new Blob([e],{type:i[t]}),c=URL.createObjectURL(l),s=document.createElement("a");s.href=c,s.download=o,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(c);}function gd(e){try{let t=JSON.parse(e);if(!t.board||!t.columns||!t.cards)return {success:!1,errors:["Invalid JSON format: missing required fields (board, columns, cards)"]};let r={id:t.board.id,title:t.board.title,columns:t.columns,cards:t.cards,metadata:t.board.metadata};return {success:!0,cardsImported:r.cards.length,columnsImported:r.columns.length}}catch(t){return {success:false,errors:[`Failed to parse JSON: ${t instanceof Error?t.message:"Unknown error"}`]}}}function hd(e){try{let t=e.trim().split(`
|
|
4
|
+
`);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let r=Zs(t[0]),a=[],n=new Map,o=[];for(let i=1;i<t.length;i++)try{let l=Zs(t[i]||"");if(l.length>r.length){o.push(`Line ${i+1}: Too many columns`);continue}if(r.length-l.length>3){o.push(`Line ${i+1}: Column count mismatch (expected ${r.length}, got ${l.length})`);continue}for(;l.length<r.length;)l.push("");let s={};r.forEach((p,x)=>{s[p]=l[x]||"";});let u=s.Column||"Unnamed";n.has(u)||n.set(u,{id:`col-${n.size+1}`,title:u,position:n.size+1,cardIds:[]});let d=n.get(u),f={id:s["Card ID"]||`card-${i}`,title:s.Title||"Untitled",description:s.Description?s.Description:void 0,columnId:d.id,position:d.cardIds.length+1,priority:s.Priority||void 0,labels:s.Labels?s.Labels.split(";").filter(Boolean):void 0,assignedUserIds:s["Assigned Users"]?s["Assigned Users"].split(";").filter(Boolean):void 0,startDate:s["Start Date"]?s["Start Date"]:void 0,endDate:s["End Date"]?s["End Date"]:void 0,createdAt:s["Created At"]?s["Created At"]:void 0,updatedAt:s["Updated At"]?s["Updated At"]:void 0};a.push(f),d.cardIds.push(f.id);}catch(l){o.push(`Line ${i+1}: ${l instanceof Error?l.message:"Unknown error"}`);}return a.length===0?{success:!1,errors:["No valid cards found in CSV",...o]}:{success:!0,cardsImported:a.length,columnsImported:n.size,errors:o.length>0?o:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function Zs(e){let t=[],r="",a=false;for(let n=0;n<e.length;n++){let o=e[n],i=e[n+1];o==='"'&&a&&i==='"'?(r+='"',n++):o==='"'?a=!a:o===","&&!a?(t.push(r),r=""):r+=o;}return t.push(r),t}function Js(e,t){switch(t){case "json":return gd(e);case "csv":return hd(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function Qs(e){return new Promise((t,r)=>{let a=new FileReader;a.onload=n=>{n.target?.result?t(n.target.result):r(new Error("Failed to read file"));},a.onerror=()=>r(new Error("Failed to read file")),a.readAsText(e);})}function Ie({children:e,container:t}){let[r,a]=ke.useState(false);if(ke.useEffect(()=>(a(true),()=>a(false)),[]),!r)return null;let n=t||(typeof document<"u"?document.body:null);return n?Gi.createPortal(e,n):null}var ri={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},xd="#BDC3C7",kd=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]});function ai({priority:e,onChange:t,className:r}){let[a,n]=ke.useState(false),[o,i]=ke.useState({top:0,left:0}),l=ke.useRef(null),c=ke.useRef(null);ke.useEffect(()=>{if(a&&c.current){let f=c.current.getBoundingClientRect();i({top:f.bottom+window.scrollY+8,left:f.left+window.scrollX});}},[a]),ke.useEffect(()=>{let f=p=>{l.current&&!l.current.contains(p.target)&&!c.current?.contains(p.target)&&n(false);};if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a]),ke.useEffect(()=>{let f=p=>{p.key==="Escape"&&n(false);};if(a)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]);let s=f=>{t(f),n(false);},u=e?ri[e]:null,d=u?.color||xd;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:c,onClick:()=>n(!a),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:e?`${d}10`:"transparent",boxShadow:e?`0 0 0 2px ${d}30 inset`:"none"},title:u?.label||"Set priority",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:d,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:d,fillOpacity:e?"0.6":"0.4"})})}),a&&jsxRuntime.jsx(Ie,{children:jsxRuntime.jsxs("div",{ref:l,className:"priority-selector-menu",style:{position:"absolute",top:`${o.top}px`,left:`${o.left}px`,zIndex:99999,minWidth:"160px",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Priority"})}),jsxRuntime.jsxs("div",{className:"py-1",children:[Object.entries(ri).map(([f,p])=>jsxRuntime.jsxs("button",{onClick:()=>s(f),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98] priority-option",style:{color:p.color,background:"transparent"},onMouseEnter:x=>{x.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:x=>{x.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(kd,{color:p.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:p.label}),e===f&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},f)),jsxRuntime.jsx("div",{className:"mt-0.5 pt-0.5 border-t",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsxs("button",{onClick:()=>s(void 0),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98]",style:{color:"var(--modal-v2-text-primary, #e5e5e5)",background:"transparent"},onMouseEnter:f=>{f.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:f=>{f.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var wd=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function qa({startDate:e,endDate:t,onChange:r,className:a}){let[n,o]=ke.useState(false),[i,l]=ke.useState({top:0,left:0}),c=ke.useRef(null),s=ke.useRef(null);ke.useEffect(()=>{if(n&&s.current){let y=s.current.getBoundingClientRect();l({top:y.bottom+window.scrollY+8,left:y.left+window.scrollX});}},[n]),ke.useEffect(()=>{let y=g=>{c.current&&!c.current.contains(g.target)&&!s.current?.contains(g.target)&&o(false);};if(n)return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]),ke.useEffect(()=>{let y=g=>{g.key==="Escape"&&o(false);};if(n)return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]);let u=y=>{let g=new Date,h=w=>{let b=w.getFullYear(),C=String(w.getMonth()+1).padStart(2,"0"),T=String(w.getDate()).padStart(2,"0");return `${b}-${C}-${T}`},v=h(g),m=new Date(g);m.setDate(m.getDate()+y);let k=h(m);r(v,k),o(false);},d=()=>{if(!e||!t)return "Set date";let y=m=>{if(m instanceof Date)return m;if(typeof m!="string"||!m.match(/^\d{4}-\d{2}-\d{2}$/))return null;let k=m.split("-").map(Number);if(k.length!==3||k.some(T=>isNaN(T)))return null;let w=k[0],b=k[1],C=k[2];return w===void 0||b===void 0||C===void 0?null:new Date(w,b-1,C)},g=y(e),h=y(t);if(!g||!h||isNaN(g.getTime())||isNaN(h.getTime()))return "Set date";let v=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${v[g.getMonth()]} ${g.getDate()} \u2013 ${v[h.getMonth()]} ${h.getDate()}`},f=e&&t,x=(()=>{if(!t)return false;let y=typeof t=="string"?new Date(t):t,g=new Date;return g.setHours(0,0,0,0),y<g})();return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsxs("button",{ref:s,onClick:()=>o(!n),className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${x?"asakaa-date-overdue":"asakaa-date"}`,title:f?`${d()}`:"Set date range",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:d()})]}),n&&jsxRuntime.jsx(Ie,{children:jsxRuntime.jsxs("div",{ref:c,className:"date-picker-menu absolute rounded-xl shadow-2xl border min-w-[320px]",style:{top:`${i.top}px`,left:`${i.left}px`,background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:wd.map(y=>jsxRuntime.jsx("button",{onClick:()=>u(y.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95 border",style:{color:"var(--modal-v2-text-primary, #60a5fa)",borderColor:"var(--modal-v2-border, rgba(96, 165, 250, 0.3))",background:"var(--modal-v2-bg-secondary, rgba(96, 165, 250, 0.08))"},onMouseEnter:g=>{g.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(96, 165, 250, 0.15))";},onMouseLeave:g=>{g.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(96, 165, 250, 0.08))";},children:y.label},y.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:y=>r(y.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:y=>r(e,y.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{r(void 0,void 0),o(false);},className:"mt-4 w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear Dates"})]})]})})]})}function Xa({assignedUsers:e=[],availableUsers:t,onChange:r,className:a,maxVisibleAvatars:n=3}){let[o,i]=ke.useState(false),[l,c]=ke.useState(""),[s,u]=ke.useState({top:0,left:0}),d=ke.useRef(null),f=ke.useRef(null);ke.useEffect(()=>{if(o&&f.current){let h=f.current.getBoundingClientRect();u({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[o]),ke.useEffect(()=>{let h=v=>{d.current&&!d.current.contains(v.target)&&!f.current?.contains(v.target)&&(i(false),c(""));};if(o)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o]),ke.useEffect(()=>{let h=v=>{v.key==="Escape"&&(i(false),c(""));};if(o)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[o]);let p=h=>{let v=e.some(m=>m.id===h.id);r(v?e.filter(m=>m.id!==h.id):[...e,h]);},x=t.filter(h=>h.name.toLowerCase().includes(l.toLowerCase())),y=e.slice(0,n),g=e.length-n;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:f,onClick:()=>i(!o),className:"flex items-center gap-1 p-0.5 rounded transition-all hover:bg-white/10 hover:scale-105 active:scale-95",title:e.length>0?`${e.length} assigned`:"Assign users",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[y.map(h=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:h.name,children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"asakaa-avatar-img"}):h.initials},h.id)),g>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",g]})]}):jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center transition-all",style:{background:"rgba(96, 165, 250, 0.15)",border:"1.5px solid rgba(96, 165, 250, 0.4)",color:"#60a5fa"},children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),o&&jsxRuntime.jsx(Ie,{children:jsxRuntime.jsxs("div",{ref:d,className:"user-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${s.top}px`,left:`${s.left}px`,background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Assign Users"})}),jsxRuntime.jsx("div",{className:"px-3 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("input",{type:"text",value:l,onChange:h=>c(h.target.value),placeholder:"Search users...",className:"w-full px-3 py-2.5 rounded-lg text-sm border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[300px] overflow-y-auto",children:x.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-sm text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.6))"},children:"No users found"}):x.map(h=>{let v=e.some(m=>m.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>p(h),className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm transition-all active:scale-98",style:{background:"transparent"},onMouseEnter:m=>{m.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:m=>{m.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:h.color,color:"#fff"},children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"w-full h-full rounded-full object-cover"}):h.initials}),jsxRuntime.jsx("span",{className:"font-semibold flex-1 text-left",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),v&&jsxRuntime.jsx("span",{className:"text-lg",style:{color:"#3b82f6"},children:"\u2713"})]},h.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-3 border-t border-white/10",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),i(false);},className:"w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear All"})})]})})]})}function li({currentCardId:e,dependencies:t=[],availableTasks:r,onChange:a,className:n}){let[o,i]=ke.useState(false),[l,c]=ke.useState(""),[s,u]=ke.useState(t.length>0),[d,f]=ke.useState({top:0,left:0}),p=ke.useRef(null),x=ke.useRef(null);ke.useEffect(()=>{if(o&&x.current){let m=x.current.getBoundingClientRect();f({top:m.bottom+window.scrollY+8,left:m.left+window.scrollX});}},[o]),ke.useEffect(()=>{let m=k=>{p.current&&!p.current.contains(k.target)&&!x.current?.contains(k.target)&&(i(false),c(""));};if(o)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]),ke.useEffect(()=>{let m=k=>{k.key==="Escape"&&(i(false),c(""));};if(o)return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[o]);let y=m=>{if(t.includes(m)){let w=t.filter(b=>b!==m);a(w),w.length===0&&u(false);}else a([...t,m]),u(true);},g=()=>{let m=!s;u(m),m||a([]);},h=r.filter(m=>m.id!==e).filter(m=>m.title.toLowerCase().includes(l.toLowerCase())||m.id.toLowerCase().includes(l.toLowerCase())),v=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${n||""}`,children:[jsxRuntime.jsxs("button",{ref:x,onClick:()=>i(!o),className:"flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5",title:t.length>0?`${t.length} dependencies`:"Add dependencies",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:v,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:v},children:t.length})]}),o&&jsxRuntime.jsx(Ie,{children:jsxRuntime.jsxs("div",{ref:p,className:"dependencies-selector-menu absolute rounded-xl shadow-2xl border min-w-[300px]",style:{top:`${d.top}px`,left:`${d.left}px`,background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Task Dependencies"})}),jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",onClick:g,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:s?"#3b82f6":"transparent",borderColor:s?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:s&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.8))"},children:"Has dependencies"})]})}),s&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("input",{type:"text",value:l,onChange:m=>c(m.target.value),placeholder:"Search by name or ID...",className:"w-full px-3 py-2 rounded-md text-xs border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[280px] overflow-y-auto",children:h.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-xs text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:"No tasks found"}):h.map(m=>{let k=t.includes(m.id);return jsxRuntime.jsxs("button",{onClick:()=>y(m.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:w=>{w.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:w=>{w.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0 mt-0.5 transition-all",style:{background:k?"#3b82f6":"transparent",borderColor:k?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:k&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:"font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.9))"},children:m.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:m.id})]})]},m.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),u(false),i(false);},className:"w-full px-3 py-2 rounded-md text-xs font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#E74C3C"},children:"Clear All Dependencies"})})]})})]})}var sr=ke.memo(({card:e,render:t,onClick:r,isSelected:a,disableDrag:n,className:o,onUpdate:i,availableUsers:l=[],allCards:c=[]})=>{let{attributes:s,listeners:u,setNodeRef:d,transform:f,transition:p,isDragging:x}=sortable.useSortable({id:e.id,disabled:n,data:{type:"card",card:e}}),y={transform:Va.Transform.toString(f),transition:p};if(t)return jsxRuntime.jsx("div",{ref:d,style:y,...s,...u,onClick:()=>r?.(e),children:t(e)});let g=l.filter(h=>e.assignedUserIds?.includes(h.id));return jsxRuntime.jsxs("div",{ref:d,style:y,className:ee("asakaa-card",x&&"asakaa-card-dragging",a&&"ring-2 ring-asakaa-accent-blue",o),...s,...u,onClick:h=>{h.target.closest(".priority-selector, .date-picker, .user-selector, .dependencies-selector")||r?.(e);},children:[e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-cover mb-3",children:jsxRuntime.jsx("img",{src:e.coverImage,alt:`Cover for ${e.title}`,className:"w-full h-32 object-cover rounded-md",loading:"lazy",onError:h=>{h.currentTarget.style.display="none";}})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"asakaa-card-description mb-3",children:e.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3 pt-1",children:[jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(ai,{priority:e.priority,onChange:h=>i?.(e.id,{priority:h})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(qa,{startDate:e.startDate?typeof e.startDate=="string"?e.startDate:e.startDate.toISOString().split("T")[0]:void 0,endDate:e.endDate?typeof e.endDate=="string"?e.endDate:e.endDate.toISOString().split("T")[0]:void 0,onChange:(h,v)=>i?.(e.id,{startDate:h,endDate:v})})}),l.length>0&&jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(Xa,{assignedUsers:g,availableUsers:l,onChange:h=>i?.(e.id,{assignedUserIds:h.map(v=>v.id)})})}),jsxRuntime.jsx("div",{onClick:h=>h.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(li,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(h=>typeof h=="string"?h:h.taskId):[],availableTasks:c,onChange:h=>i?.(e.id,{dependencies:h})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(h=>jsxRuntime.jsx("span",{className:"asakaa-label",children:h},h))})]})},(e,t)=>e.card.id===t.card.id&&e.card.title===t.card.title&&e.card.description===t.card.description&&e.card.position===t.card.position&&e.card.columnId===t.card.columnId&&e.card.priority===t.card.priority&&e.card.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies));sr.displayName="Card";function Ja(){return typeof window<"u"}function gr(e){return oo(e)?(e.nodeName||"").toLowerCase():"#document"}function wt(e){var t;return (e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wt(e){var t;return (t=(oo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oo(e){return Ja()?e instanceof Node||e instanceof wt(e).Node:false}function mt(e){return Ja()?e instanceof Element||e instanceof wt(e).Element:false}function Ot(e){return Ja()?e instanceof HTMLElement||e instanceof wt(e).HTMLElement:false}function no(e){return !Ja()||typeof ShadowRoot>"u"?false:e instanceof ShadowRoot||e instanceof wt(e).ShadowRoot}var Nd=new Set(["inline","contents"]);function ta(e){let{overflow:t,overflowX:r,overflowY:a,display:n}=St(e);return /auto|scroll|overlay|hidden|clip/.test(t+a+r)&&!Nd.has(n)}var Dd=new Set(["table","td","th"]);function di(e){return Dd.has(gr(e))}var Ed=[":popover-open",":modal"];function ha(e){return Ed.some(t=>{try{return e.matches(t)}catch{return false}})}var Rd=["transform","translate","scale","rotate","perspective"],Pd=["transform","translate","scale","rotate","perspective","filter"],Id=["paint","layout","strict","content"];function Qa(e){let t=va(),r=mt(e)?St(e):e;return Rd.some(a=>r[a]?r[a]!=="none":false)||(r.containerType?r.containerType!=="normal":false)||!t&&(r.backdropFilter?r.backdropFilter!=="none":false)||!t&&(r.filter?r.filter!=="none":false)||Pd.some(a=>(r.willChange||"").includes(a))||Id.some(a=>(r.contain||"").includes(a))}function ui(e){let t=er(e);for(;Ot(t)&&!hr(t);){if(Qa(t))return t;if(ha(t))return null;t=er(t);}return null}function va(){return typeof CSS>"u"||!CSS.supports?false:CSS.supports("-webkit-backdrop-filter","none")}var Md=new Set(["html","body","#document"]);function hr(e){return Md.has(gr(e))}function St(e){return wt(e).getComputedStyle(e)}function ba(e){return mt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function er(e){if(gr(e)==="html")return e;let t=e.assignedSlot||e.parentNode||no(e)&&e.host||Wt(e);return no(t)?t.host:t}function pi(e){let t=er(e);return hr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ot(t)&&ta(t)?t:pi(t)}function ir(e,t,r){var a;t===void 0&&(t=[]),r===void 0&&(r=true);let n=pi(e),o=n===((a=e.ownerDocument)==null?void 0:a.body),i=wt(n);if(o){let l=en(i);return t.concat(i,i.visualViewport||[],ta(n)?n:[],l&&r?ir(l):[])}return t.concat(n,ir(n,[],r))}function en(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var tr=Math.min,Ct=Math.max,xa=Math.round,ka=Math.floor,Vt=e=>({x:e,y:e}),Ad={left:"right",right:"left",bottom:"top",top:"bottom"},Ld={start:"end",end:"start"};function rn(e,t,r){return Ct(e,tr(t,r))}function Ar(e,t){return typeof e=="function"?e(t):e}function lr(e){return e.split("-")[0]}function Lr(e){return e.split("-")[1]}function so(e){return e==="x"?"y":"x"}function an(e){return e==="y"?"height":"width"}var Fd=new Set(["top","bottom"]);function rr(e){return Fd.has(lr(e))?"y":"x"}function nn(e){return so(rr(e))}function gi(e,t,r){r===void 0&&(r=false);let a=Lr(e),n=nn(e),o=an(n),i=n==="x"?a===(r?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ya(i)),[i,ya(i)]}function hi(e){let t=ya(e);return [tn(e),t,tn(t)]}function tn(e){return e.replace(/start|end/g,t=>Ld[t])}var mi=["left","right"],fi=["right","left"],Bd=["top","bottom"],Od=["bottom","top"];function zd(e,t,r){switch(e){case "top":case "bottom":return r?t?fi:mi:t?mi:fi;case "left":case "right":return t?Bd:Od;default:return []}}function vi(e,t,r,a){let n=Lr(e),o=zd(lr(e),r==="start",a);return n&&(o=o.map(i=>i+"-"+n),t&&(o=o.concat(o.map(tn)))),o}function ya(e){return e.replace(/left|right|bottom|top/g,t=>Ad[t])}function Hd(e){return {top:0,right:0,bottom:0,left:0,...e}}function io(e){return typeof e!="number"?Hd(e):{top:e,right:e,bottom:e,left:e}}function Fr(e){let{x:t,y:r,width:a,height:n}=e;return {width:a,height:n,top:r,left:t,right:t+a,bottom:r+n,x:t,y:r}}var Gd=typeof document<"u",_d=function(){},Ca=Gd?ke.useLayoutEffect:_d,$d={...ke__namespace};var Wd=$d.useInsertionEffect,Vd=Wd||(e=>e());function bi(e){let t=ke__namespace.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Vd(()=>{t.current=e;}),ke__namespace.useCallback(function(){for(var r=arguments.length,a=new Array(r),n=0;n<r;n++)a[n]=arguments[n];return t.current==null?void 0:t.current(...a)},[])}function yi(e,t,r){let{reference:a,floating:n}=e,o=rr(t),i=nn(t),l=an(i),c=lr(t),s=o==="y",u=a.x+a.width/2-n.width/2,d=a.y+a.height/2-n.height/2,f=a[l]/2-n[l]/2,p;switch(c){case "top":p={x:u,y:a.y-n.height};break;case "bottom":p={x:u,y:a.y+a.height};break;case "right":p={x:a.x+a.width,y:d};break;case "left":p={x:a.x-n.width,y:d};break;default:p={x:a.x,y:a.y};}switch(Lr(t)){case "start":p[i]-=f*(r&&s?-1:1);break;case "end":p[i]+=f*(r&&s?-1:1);break}return p}var xi=async(e,t,r)=>{let{placement:a="bottom",strategy:n="absolute",middleware:o=[],platform:i}=r,l=o.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t)),s=await i.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=yi(s,a,c),f=a,p={},x=0;for(let y=0;y<l.length;y++){let{name:g,fn:h}=l[y],{x:v,y:m,data:k,reset:w}=await h({x:u,y:d,initialPlacement:a,placement:f,strategy:n,middlewareData:p,rects:s,platform:i,elements:{reference:e,floating:t}});u=v??u,d=m??d,p={...p,[g]:{...p[g],...k}},w&&x<=50&&(x++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(s=w.rects===true?await i.getElementRects({reference:e,floating:t,strategy:n}):w.rects),{x:u,y:d}=yi(s,f,c)),y=-1);}return {x:u,y:d,placement:f,strategy:n,middlewareData:p}};async function on(e,t){var r;t===void 0&&(t={});let{x:a,y:n,platform:o,rects:i,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=false,padding:p=0}=Ar(t,e),x=io(p),g=l[f?d==="floating"?"reference":"floating":d],h=Fr(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(g)))==null||r?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:u,strategy:c})),v=d==="floating"?{x:a,y:n,width:i.floating.width,height:i.floating.height}:i.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Fr(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:m,strategy:c}):v);return {top:(h.top-w.top+x.top)/k.y,bottom:(w.bottom-h.bottom+x.bottom)/k.y,left:(h.left-w.left+x.left)/k.x,right:(w.right-h.right+x.right)/k.x}}var ki=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:a,placement:n,rects:o,platform:i,elements:l,middlewareData:c}=t,{element:s,padding:u=0}=Ar(e,t)||{};if(s==null)return {};let d=io(u),f={x:r,y:a},p=nn(n),x=an(p),y=await i.getDimensions(s),g=p==="y",h=g?"top":"left",v=g?"bottom":"right",m=g?"clientHeight":"clientWidth",k=o.reference[x]+o.reference[p]-f[p]-o.floating[x],w=f[p]-o.reference[p],b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s)),C=b?b[m]:0;(!C||!await(i.isElement==null?void 0:i.isElement(b)))&&(C=l.floating[m]||o.floating[x]);let T=k/2-w/2,D=C/2-y[x]/2-1,N=tr(d[h],D),P=tr(d[v],D),I=N,E=C-y[x]-P,A=C/2-y[x]/2+T,z=rn(I,A,E),U=!c.arrow&&Lr(n)!=null&&A!==z&&o.reference[x]/2-(A<I?N:P)-y[x]/2<0,J=U?A<I?A-I:A-E:0;return {[p]:f[p]+J,data:{[p]:z,centerOffset:A-z-J,...U&&{alignmentOffset:J}},reset:U}}});var wi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,a;let{placement:n,middlewareData:o,rects:i,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:u=true,crossAxis:d=true,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=true,...g}=Ar(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return {};let h=lr(n),v=rr(l),m=lr(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(s.floating)),w=f||(m||!y?[ya(l)]:hi(l)),b=x!=="none";!f&&b&&w.push(...vi(l,y,x,k));let C=[l,...w],T=await on(t,g),D=[],N=((a=o.flip)==null?void 0:a.overflows)||[];if(u&&D.push(T[h]),d){let A=gi(n,i,k);D.push(T[A[0]],T[A[1]]);}if(N=[...N,{placement:n,overflows:D}],!D.every(A=>A<=0)){var P,I;let A=(((P=o.flip)==null?void 0:P.index)||0)+1,z=C[A];if(z&&(!(d==="alignment"?v!==rr(z):false)||N.every(X=>rr(X.placement)===v?X.overflows[0]>0:true)))return {data:{index:A,overflows:N},reset:{placement:z}};let U=(I=N.filter(J=>J.overflows[0]<=0).sort((J,X)=>J.overflows[1]-X.overflows[1])[0])==null?void 0:I.placement;if(!U)switch(p){case "bestFit":{var E;let J=(E=N.filter(X=>{if(b){let ae=rr(X.placement);return ae===v||ae==="y"}return true}).map(X=>[X.placement,X.overflows.filter(ae=>ae>0).reduce((ae,Ee)=>ae+Ee,0)]).sort((X,ae)=>X[1]-ae[1])[0])==null?void 0:E[0];J&&(U=J);break}case "initialPlacement":U=l;break}if(n!==U)return {reset:{placement:U}}}return {}}}};var Kd=new Set(["left","top"]);async function jd(e,t){let{placement:r,platform:a,elements:n}=e,o=await(a.isRTL==null?void 0:a.isRTL(n.floating)),i=lr(r),l=Lr(r),c=rr(r)==="y",s=Kd.has(i)?-1:1,u=o&&c?-1:1,d=Ar(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof x=="number"&&(p=l==="end"?x*-1:x),c?{x:p*u,y:f*s}:{x:f*s,y:p*u}}var Ci=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,a;let{x:n,y:o,placement:i,middlewareData:l}=t,c=await jd(t,e);return i===((r=l.offset)==null?void 0:r.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:n+c.x,y:o+c.y,data:{...c,placement:i}}}}},Ti=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:a,placement:n}=t,{mainAxis:o=true,crossAxis:i=false,limiter:l={fn:g=>{let{x:h,y:v}=g;return {x:h,y:v}}},...c}=Ar(e,t),s={x:r,y:a},u=await on(t,c),d=rr(lr(n)),f=so(d),p=s[f],x=s[d];if(o){let g=f==="y"?"top":"left",h=f==="y"?"bottom":"right",v=p+u[g],m=p-u[h];p=rn(v,p,m);}if(i){let g=d==="y"?"top":"left",h=d==="y"?"bottom":"right",v=x+u[g],m=x-u[h];x=rn(v,x,m);}let y=l.fn({...t,[f]:p,[d]:x});return {...y,data:{x:y.x-r,y:y.y-a,enabled:{[f]:o,[d]:i}}}}}};var Si=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,a;let{placement:n,rects:o,platform:i,elements:l}=t,{apply:c=()=>{},...s}=Ar(e,t),u=await on(t,s),d=lr(n),f=Lr(n),p=rr(n)==="y",{width:x,height:y}=o.floating,g,h;d==="top"||d==="bottom"?(g=d,h=f===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(h=d,g=f==="end"?"top":"bottom");let v=y-u.top-u.bottom,m=x-u.left-u.right,k=tr(y-u[g],v),w=tr(x-u[h],m),b=!t.middlewareData.shift,C=k,T=w;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(T=m),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(C=v),b&&!f){let N=Ct(u.left,0),P=Ct(u.right,0),I=Ct(u.top,0),E=Ct(u.bottom,0);p?T=x-2*(N!==0||P!==0?N+P:Ct(u.left,u.right)):C=y-2*(I!==0||E!==0?I+E:Ct(u.top,u.bottom));}await c({...t,availableWidth:T,availableHeight:C});let D=await i.getDimensions(l.floating);return x!==D.width||y!==D.height?{reset:{rects:true}}:{}}}};function Ri(e){let t=St(e),r=parseFloat(t.width)||0,a=parseFloat(t.height)||0,n=Ot(e),o=n?e.offsetWidth:r,i=n?e.offsetHeight:a,l=xa(r)!==o||xa(a)!==i;return l&&(r=o,a=i),{width:r,height:a,$:l}}function co(e){return mt(e)?e:e.contextElement}function ra(e){let t=co(e);if(!Ot(t))return Vt(1);let r=t.getBoundingClientRect(),{width:a,height:n,$:o}=Ri(t),i=(o?xa(r.width):r.width)/a,l=(o?xa(r.height):r.height)/n;return (!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}var Yd=Vt(0);function Pi(e){let t=wt(e);return !va()||!t.visualViewport?Yd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qd(e,t,r){return t===void 0&&(t=false),!r||t&&r!==wt(e)?false:t}function Br(e,t,r,a){t===void 0&&(t=false),r===void 0&&(r=false);let n=e.getBoundingClientRect(),o=co(e),i=Vt(1);t&&(a?mt(a)&&(i=ra(a)):i=ra(e));let l=qd(o,r,a)?Pi(o):Vt(0),c=(n.left+l.x)/i.x,s=(n.top+l.y)/i.y,u=n.width/i.x,d=n.height/i.y;if(o){let f=wt(o),p=a&&mt(a)?wt(a):a,x=f,y=en(x);for(;y&&a&&p!==x;){let g=ra(y),h=y.getBoundingClientRect(),v=St(y),m=h.left+(y.clientLeft+parseFloat(v.paddingLeft))*g.x,k=h.top+(y.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,s*=g.y,u*=g.x,d*=g.y,c+=m,s+=k,x=wt(y),y=en(x);}}return Fr({width:u,height:d,x:c,y:s})}function sn(e,t){let r=ba(e).scrollLeft;return t?t.left+r:Br(Wt(e)).left+r}function Ii(e,t){let r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-sn(e,r),n=r.top+t.scrollTop;return {x:a,y:n}}function Xd(e){let{elements:t,rect:r,offsetParent:a,strategy:n}=e,o=n==="fixed",i=Wt(a),l=t?ha(t.floating):false;if(a===i||l&&o)return r;let c={scrollLeft:0,scrollTop:0},s=Vt(1),u=Vt(0),d=Ot(a);if((d||!d&&!o)&&((gr(a)!=="body"||ta(i))&&(c=ba(a)),Ot(a))){let p=Br(a);s=ra(a),u.x=p.x+a.clientLeft,u.y=p.y+a.clientTop;}let f=i&&!d&&!o?Ii(i,c):Vt(0);return {width:r.width*s.x,height:r.height*s.y,x:r.x*s.x-c.scrollLeft*s.x+u.x+f.x,y:r.y*s.y-c.scrollTop*s.y+u.y+f.y}}function Zd(e){return Array.from(e.getClientRects())}function Jd(e){let t=Wt(e),r=ba(e),a=e.ownerDocument.body,n=Ct(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),o=Ct(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight),i=-r.scrollLeft+sn(e),l=-r.scrollTop;return St(a).direction==="rtl"&&(i+=Ct(t.clientWidth,a.clientWidth)-n),{width:n,height:o,x:i,y:l}}var Ni=25;function Qd(e,t){let r=wt(e),a=Wt(e),n=r.visualViewport,o=a.clientWidth,i=a.clientHeight,l=0,c=0;if(n){o=n.width,i=n.height;let u=va();(!u||u&&t==="fixed")&&(l=n.offsetLeft,c=n.offsetTop);}let s=sn(a);if(s<=0){let u=a.ownerDocument,d=u.body,f=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,x=Math.abs(a.clientWidth-d.clientWidth-p);x<=Ni&&(o-=x);}else s<=Ni&&(o+=s);return {width:o,height:i,x:l,y:c}}var eu=new Set(["absolute","fixed"]);function tu(e,t){let r=Br(e,true,t==="fixed"),a=r.top+e.clientTop,n=r.left+e.clientLeft,o=Ot(e)?ra(e):Vt(1),i=e.clientWidth*o.x,l=e.clientHeight*o.y,c=n*o.x,s=a*o.y;return {width:i,height:l,x:c,y:s}}function Di(e,t,r){let a;if(t==="viewport")a=Qd(e,r);else if(t==="document")a=Jd(Wt(e));else if(mt(t))a=tu(t,r);else {let n=Pi(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height};}return Fr(a)}function Mi(e,t){let r=er(e);return r===t||!mt(r)||hr(r)?false:St(r).position==="fixed"||Mi(r,t)}function ru(e,t){let r=t.get(e);if(r)return r;let a=ir(e,[],false).filter(l=>mt(l)&&gr(l)!=="body"),n=null,o=St(e).position==="fixed",i=o?er(e):e;for(;mt(i)&&!hr(i);){let l=St(i),c=Qa(i);!c&&l.position==="fixed"&&(n=null),(o?!c&&!n:!c&&l.position==="static"&&!!n&&eu.has(n.position)||ta(i)&&!c&&Mi(e,i))?a=a.filter(u=>u!==i):n=l,i=er(i);}return t.set(e,a),a}function au(e){let{element:t,boundary:r,rootBoundary:a,strategy:n}=e,i=[...r==="clippingAncestors"?ha(t)?[]:ru(t,this._c):[].concat(r),a],l=i[0],c=i.reduce((s,u)=>{let d=Di(t,u,n);return s.top=Ct(d.top,s.top),s.right=tr(d.right,s.right),s.bottom=tr(d.bottom,s.bottom),s.left=Ct(d.left,s.left),s},Di(t,l,n));return {width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function nu(e){let{width:t,height:r}=Ri(e);return {width:t,height:r}}function ou(e,t,r){let a=Ot(t),n=Wt(t),o=r==="fixed",i=Br(e,true,o,t),l={scrollLeft:0,scrollTop:0},c=Vt(0);function s(){c.x=sn(n);}if(a||!a&&!o)if((gr(t)!=="body"||ta(n))&&(l=ba(t)),a){let p=Br(t,true,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop;}else n&&s();o&&!a&&n&&s();let u=n&&!a&&!o?Ii(n,l):Vt(0),d=i.left+l.scrollLeft-c.x-u.x,f=i.top+l.scrollTop-c.y-u.y;return {x:d,y:f,width:i.width,height:i.height}}function lo(e){return St(e).position==="static"}function Ei(e,t){if(!Ot(e)||St(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Wt(e)===r&&(r=r.ownerDocument.body),r}function Ai(e,t){let r=wt(e);if(ha(e))return r;if(!Ot(e)){let n=er(e);for(;n&&!hr(n);){if(mt(n)&&!lo(n))return n;n=er(n);}return r}let a=Ei(e,t);for(;a&&di(a)&&lo(a);)a=Ei(a,t);return a&&hr(a)&&lo(a)&&!Qa(a)?r:a||ui(e)||r}var su=async function(e){let t=this.getOffsetParent||Ai,r=this.getDimensions,a=await r(e.floating);return {reference:ou(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function iu(e){return St(e).direction==="rtl"}var uo={convertOffsetParentRelativeRectToViewportRelativeRect:Xd,getDocumentElement:Wt,getClippingRect:au,getOffsetParent:Ai,getElementRects:su,getClientRects:Zd,getDimensions:nu,getScale:ra,isElement:mt,isRTL:iu};function Li(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lu(e,t){let r=null,a,n=Wt(e);function o(){var l;clearTimeout(a),(l=r)==null||l.disconnect(),r=null;}function i(l,c){l===void 0&&(l=false),c===void 0&&(c=1),o();let s=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=s;if(l||t(),!f||!p)return;let x=ka(d),y=ka(n.clientWidth-(u+f)),g=ka(n.clientHeight-(d+p)),h=ka(u),m={rootMargin:-x+"px "+-y+"px "+-g+"px "+-h+"px",threshold:Ct(0,tr(1,c))||1},k=true;function w(b){let C=b[0].intersectionRatio;if(C!==c){if(!k)return i();C?i(false,C):a=setTimeout(()=>{i(false,1e-7);},1e3);}C===1&&!Li(s,e.getBoundingClientRect())&&i(),k=false;}try{r=new IntersectionObserver(w,{...m,root:n.ownerDocument});}catch{r=new IntersectionObserver(w,m);}r.observe(e);}return i(true),o}function ln(e,t,r,a){a===void 0&&(a={});let{ancestorScroll:n=true,ancestorResize:o=true,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=false}=a,s=co(e),u=n||o?[...s?ir(s):[],...ir(t)]:[];u.forEach(h=>{n&&h.addEventListener("scroll",r,{passive:true}),o&&h.addEventListener("resize",r);});let d=s&&l?lu(s,r):null,f=-1,p=null;i&&(p=new ResizeObserver(h=>{let[v]=h;v&&v.target===s&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var m;(m=p)==null||m.observe(t);})),r();}),s&&!c&&p.observe(s),p.observe(t));let x,y=c?Br(e):null;c&&g();function g(){let h=Br(e);y&&!Li(y,h)&&r(),y=h,x=requestAnimationFrame(g);}return r(),()=>{var h;u.forEach(v=>{n&&v.removeEventListener("scroll",r),o&&v.removeEventListener("resize",r);}),d?.(),(h=p)==null||h.disconnect(),p=null,c&&cancelAnimationFrame(x);}}var Fi=Ci;var Bi=Ti,Oi=wi,zi=Si;var po=ki;var cn=(e,t,r)=>{let a=new Map,n={platform:uo,...r},o={...n.platform,_c:a};return xi(e,t,{...n,platform:o})};var du=typeof document<"u",uu=function(){},dn=du?ke.useLayoutEffect:uu;function un(e,t){if(e===t)return true;if(typeof e!=typeof t)return false;if(typeof e=="function"&&e.toString()===t.toString())return true;let r,a,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return false;for(a=r;a--!==0;)if(!un(e[a],t[a]))return false;return true}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return false;for(a=r;a--!==0;)if(!{}.hasOwnProperty.call(t,n[a]))return false;for(a=r;a--!==0;){let o=n[a];if(!(o==="_owner"&&e.$$typeof)&&!un(e[o],t[o]))return false}return true}return e!==e&&t!==t}function _i(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hi(e,t){let r=_i(e);return Math.round(t*r)/r}function mo(e){let t=ke__namespace.useRef(e);return dn(()=>{t.current=e;}),t}function $i(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:a=[],platform:n,elements:{reference:o,floating:i}={},transform:l=true,whileElementsMounted:c,open:s}=e,[u,d]=ke__namespace.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:false}),[f,p]=ke__namespace.useState(a);un(f,a)||p(a);let[x,y]=ke__namespace.useState(null),[g,h]=ke__namespace.useState(null),v=ke__namespace.useCallback(X=>{X!==b.current&&(b.current=X,y(X));},[]),m=ke__namespace.useCallback(X=>{X!==C.current&&(C.current=X,h(X));},[]),k=o||x,w=i||g,b=ke__namespace.useRef(null),C=ke__namespace.useRef(null),T=ke__namespace.useRef(u),D=c!=null,N=mo(c),P=mo(n),I=mo(s),E=ke__namespace.useCallback(()=>{if(!b.current||!C.current)return;let X={placement:t,strategy:r,middleware:f};P.current&&(X.platform=P.current),cn(b.current,C.current,X).then(ae=>{let Ee={...ae,isPositioned:I.current!==false};A.current&&!un(T.current,Ee)&&(T.current=Ee,Gi__namespace.flushSync(()=>{d(Ee);}));});},[f,t,r,P,I]);dn(()=>{s===false&&T.current.isPositioned&&(T.current.isPositioned=false,d(X=>({...X,isPositioned:false})));},[s]);let A=ke__namespace.useRef(false);dn(()=>(A.current=true,()=>{A.current=false;}),[]),dn(()=>{if(k&&(b.current=k),w&&(C.current=w),k&&w){if(N.current)return N.current(k,w,E);E();}},[k,w,E,N,D]);let z=ke__namespace.useMemo(()=>({reference:b,floating:C,setReference:v,setFloating:m}),[v,m]),U=ke__namespace.useMemo(()=>({reference:k,floating:w}),[k,w]),J=ke__namespace.useMemo(()=>{let X={position:r,left:0,top:0};if(!U.floating)return X;let ae=Hi(U.floating,u.x),Ee=Hi(U.floating,u.y);return l?{...X,transform:"translate("+ae+"px, "+Ee+"px)",..._i(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ae,top:Ee}},[r,l,U.floating,u.x,u.y]);return ke__namespace.useMemo(()=>({...u,update:E,refs:z,elements:U,floatingStyles:J}),[u,E,z,U,J])}var pu=e=>{function t(r){return {}.hasOwnProperty.call(r,"current")}return {name:"arrow",options:e,fn(r){let{element:a,padding:n}=typeof e=="function"?e(r):e;return a&&t(a)?a.current!=null?po({element:a.current,padding:n}).fn(r):{}:a?po({element:a,padding:n}).fn(r):{}}}},pn=(e,t)=>({...Fi(e),options:[e,t]}),fo=(e,t)=>({...Bi(e),options:[e,t]});var go=(e,t)=>({...Oi(e),options:[e,t]}),ho=(e,t)=>({...zi(e),options:[e,t]});var vo=(e,t)=>({...pu(e),options:[e,t]});var xu={...ke__namespace},Wi=false,ku=0,Vi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ku++;function wu(){let[e,t]=ke__namespace.useState(()=>Wi?Vi():void 0);return Ca(()=>{e==null&&t(Vi());},[]),ke__namespace.useEffect(()=>{Wi=true;},[]),e}var Cu=xu.useId,ji=Cu||wu,Ta;process.env.NODE_ENV!=="production"&&(Ta=new Set);function Tu(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];let n="Floating UI: "+r.join(" ");if(!((e=Ta)!=null&&e.has(n))){var o;(o=Ta)==null||o.add(n),console.warn(n);}}function Su(){for(var e,t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];let n="Floating UI: "+r.join(" ");if(!((e=Ta)!=null&&e.has(n))){var o;(o=Ta)==null||o.add(n),console.error(n);}}var Yi=ke__namespace.forwardRef(function(t,r){let{context:{placement:a,elements:{floating:n},middlewareData:{arrow:o,shift:i}},width:l=14,height:c=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:p,style:{transform:x,...y}={},...g}=t;process.env.NODE_ENV!=="production"&&(r||Tu("The `ref` prop is required for `FloatingArrow`."));let h=ji(),[v,m]=ke__namespace.useState(false);if(Ca(()=>{if(!n)return;St(n).direction==="rtl"&&m(true);},[n]),!n)return null;let[k,w]=a.split("-"),b=k==="top"||k==="bottom",C=d;(b&&i!=null&&i.x||!b&&i!=null&&i.y)&&(C=null);let T=u*2,D=T/2,N=l/2*(s/-8+1),P=c/2*s/4,I=!!p,E=C&&w==="end"?"bottom":"top",A=C&&w==="end"?"right":"left";C&&v&&(A=w==="end"?"left":"right");let z=o?.x!=null?C||o.x:"",U=o?.y!=null?C||o.y:"",J=p||"M0,0"+(" H"+l)+(" L"+(l-N)+","+(c-P))+(" Q"+l/2+","+c+" "+N+","+(c-P))+" Z",X={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[k];return jsxRuntime.jsxs("svg",{...g,"aria-hidden":true,ref:r,width:I?l:l+T,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[A]:z,[E]:U,[k]:b||I?"100%":"calc(100% - "+T/2+"px)",transform:[X,x].filter(ae=>!!ae).join(" "),...y},children:[T>0&&jsxRuntime.jsx("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:T+(p?0:1),d:J}),jsxRuntime.jsx("path",{stroke:T&&!p?g.fill:"none",d:J}),jsxRuntime.jsx("clipPath",{id:h,children:jsxRuntime.jsx("rect",{x:-D,y:D*(I?-1:1),width:l+T,height:l})})]})});function Nu(){let e=new Map;return {emit(t,r){var a;(a=e.get(t))==null||a.forEach(n=>n(r));},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r);},off(t,r){var a;(a=e.get(t))==null||a.delete(r);}}}var Du=ke__namespace.createContext(null),Eu=ke__namespace.createContext(null),Ru=()=>{var e;return ((e=ke__namespace.useContext(Du))==null?void 0:e.id)||null},Pu=()=>ke__namespace.useContext(Eu);function Iu(e){let{open:t=false,onOpenChange:r,elements:a}=e,n=ji(),o=ke__namespace.useRef({}),[i]=ke__namespace.useState(()=>Nu()),l=Ru()!=null;if(process.env.NODE_ENV!=="production"){let p=a.reference;p&&!mt(p)&&Su("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.");}let[c,s]=ke__namespace.useState(a.reference),u=bi((p,x,y)=>{o.current.openEvent=p?x:void 0,i.emit("openchange",{open:p,event:x,reason:y,nested:l}),r?.(p,x,y);}),d=ke__namespace.useMemo(()=>({setPositionReference:s}),[]),f=ke__namespace.useMemo(()=>({reference:c||a.reference||null,floating:a.floating||null,domReference:a.reference}),[c,a.reference,a.floating]);return ke__namespace.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:f,events:i,floatingId:n,refs:d}),[t,u,f,i,n,d])}function qi(e){e===void 0&&(e={});let{nodeId:t}=e,r=Iu({...e,elements:{reference:null,floating:null,...e.elements}}),a=e.rootContext||r,n=a.elements,[o,i]=ke__namespace.useState(null),[l,c]=ke__namespace.useState(null),u=n?.domReference||o,d=ke__namespace.useRef(null),f=Pu();Ca(()=>{u&&(d.current=u);},[u]);let p=$i({...e,elements:{...n,...l&&{reference:l}}}),x=ke__namespace.useCallback(m=>{let k=mt(m)?{getBoundingClientRect:()=>m.getBoundingClientRect(),getClientRects:()=>m.getClientRects(),contextElement:m}:m;c(k),p.refs.setReference(k);},[p.refs]),y=ke__namespace.useCallback(m=>{(mt(m)||m===null)&&(d.current=m,i(m)),(mt(p.refs.reference.current)||p.refs.reference.current===null||m!==null&&!mt(m))&&p.refs.setReference(m);},[p.refs]),g=ke__namespace.useMemo(()=>({...p.refs,setReference:y,setPositionReference:x,domReference:d}),[p.refs,y,x]),h=ke__namespace.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),v=ke__namespace.useMemo(()=>({...p,...a,refs:g,elements:h,nodeId:t}),[p,g,h,t,a]);return Ca(()=>{a.dataRef.current.floatingContext=v;let m=f?.nodesRef.current.find(k=>k.id===t);m&&(m.context=v);}),ke__namespace.useMemo(()=>({...p,context:v,refs:g,elements:h}),[p,g,h,v])}function Xi(e,t,r=true){ke.useEffect(()=>{if(!r)return;let a=o=>{(Array.isArray(e)?e:[e]).some(c=>{let s=c.current;if(!s)return false;let u=o.target;return s===u||s.contains(u)})||t(o);},n=setTimeout(()=>{document.addEventListener("mousedown",a),document.addEventListener("touchstart",a);},0);return ()=>{clearTimeout(n),document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a);}},[e,t,r]);}function Ji({itemCount:e,onSelect:t,onEscape:r,enabled:a=true,loop:n=true,containerRef:o}){let[i,l]=ke.useState(-1);ke.useEffect(()=>{if(!a||i===-1||!o?.current)return;let d=o.current.querySelector(`[data-index="${i}"]`);d&&d.scrollIntoView({block:"nearest",behavior:"smooth"});},[i,a,o]);let c=ke.useCallback(u=>{if(a)switch(u.key){case "ArrowDown":u.preventDefault(),l(d=>d===-1?0:d===e-1?n?0:d:d+1);break;case "ArrowUp":u.preventDefault(),l(d=>d===-1?e-1:d===0?n?e-1:d:d-1);break;case "Enter":case " ":u.preventDefault(),i!==-1&&t&&t(i);break;case "Escape":u.preventDefault(),r&&r();break;case "Home":u.preventDefault(),l(0);break;case "End":u.preventDefault(),l(e-1);break;}},[a,i,e,n,t,r]),s=ke.useCallback(u=>({"data-active":u===i,"data-index":u,role:"option",tabIndex:-1}),[i]);return {activeIndex:i,setActiveIndex:l,handleKeyDown:c,getItemProps:s}}function cr({trigger:e,children:t,isOpen:r,onOpenChange:a,placement:n="bottom-start",offsetDistance:o=8,maxHeight:i=320,minWidth:l="trigger",maxWidth:c,showArrow:s=false,className:u="",triggerClassName:d="",disableClickOutside:f=false,disableKeyboardNav:p=false,itemCount:x=0,onSelectItem:y,onOpen:g,onClose:h,animationDuration:v=200,zIndex:m=1e3}){let[k,w]=ke.useState(false),b=r!==void 0?r:k,C=ke.useCallback(Se=>{let B=b;r===void 0&&w(Se),a?.(Se),Se&&!B?g?.():!Se&&B&&h?.();},[r,a,g,h,b]),T=ke.useCallback(()=>{C(!b);},[b,C]),D=ke.useCallback(()=>{C(false);},[C]),N=ke.useRef(null),P=ke.useRef(null),I=ke.useRef(null),{refs:E,floatingStyles:A,context:z}=qi({open:b,onOpenChange:C,placement:n,middleware:[pn(o),go({padding:8}),fo({padding:8}),ho({apply({rects:Se,elements:B}){Object.assign(B.floating.style,{minWidth:l==="trigger"?`${Se.reference.width}px`:l?`${l}px`:void 0,maxWidth:c?`${c}px`:void 0,maxHeight:`${i}px`});},padding:8}),s?vo({element:I}):null].filter(Boolean),whileElementsMounted:ln});Xi([N,P],D,b&&!f);let{activeIndex:U,setActiveIndex:J,handleKeyDown:X}=Ji({itemCount:x,onSelect:y,onEscape:D,enabled:b&&!p,loop:true,containerRef:P}),ae=()=>typeof e=="function"?e({isOpen:b,toggle:T}):e,Ee=()=>typeof t=="function"?t({activeIndex:U,setActiveIndex:J,close:D}):t,te={transition:`opacity ${v}ms ease-in-out, transform ${v}ms ease-in-out`,opacity:b?1:0,transform:b?"scale(1)":"scale(0.95)",pointerEvents:b?"auto":"none"};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{ref:N,className:`dropdown-trigger ${d}`,onClick:T,children:ae()}),jsxRuntime.jsx(Ie,{children:jsxRuntime.jsxs("div",{ref:E.setFloating,style:{...A,zIndex:m,...te},className:`dropdown-content ${u}`,role:"menu","aria-orientation":"vertical",onKeyDown:X,children:[jsxRuntime.jsx("div",{ref:P,className:"dropdown-inner",children:Ee()}),s&&jsxRuntime.jsx(Yi,{ref:I,context:z,className:"dropdown-arrow"})]})})]})}var el={URGENT:{label:"Urgent",color:"#E74C3C",darkColor:"#ff6b6b"},HIGH:{label:"High",color:"#E67E22",darkColor:"#ffa94d"},MEDIUM:{label:"Normal",color:"#F1C40F",darkColor:"#ffd43b"},LOW:{label:"Low",color:"#2ECC71",darkColor:"#51cf66"}},Ou="#BDC3C7",zu="#868e96",Hu=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]}),tl=()=>jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"var(--asakaa-color-interactive-primary, #1976d2)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});function xo({priority:e,onChange:t,className:r}){let a=e?el[e]:null,n=document.documentElement.getAttribute("data-theme")==="dark",o=a?n?a.darkColor:a.color:n?zu:Ou,i=c=>{t(c);},l=Object.entries(el);return jsxRuntime.jsx(cr,{trigger:({isOpen:c})=>jsxRuntime.jsx("button",{className:`flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95 ${r||""}`,style:{background:e?`${o}10`:"transparent",boxShadow:e?`0 0 0 2px ${o}30 inset`:"none",transform:c?"scale(1.1)":"scale(1)"},title:a?.label||"Set priority","aria-label":"Select priority","aria-expanded":c,"aria-haspopup":"menu",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:o,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:o,fillOpacity:e?"0.6":"0.4"})})}),placement:"bottom-start",minWidth:180,maxHeight:280,itemCount:l.length+1,onSelectItem:c=>{let s=l[c];i(s?s[0]:void 0);},children:({activeIndex:c,close:s})=>jsxRuntime.jsxs("div",{className:"priority-dropdown",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",children:"Priority"}),jsxRuntime.jsxs("div",{className:"dropdown-section",children:[l.map(([u,d],f)=>{let p=n?d.darkColor:d.color,x=c===f,y=e===u;return jsxRuntime.jsxs("button",{onClick:()=>{i(u),s();},className:"dropdown-item","data-active":x,"data-index":f,role:"option","aria-selected":y,style:{color:x?p:"inherit",fontWeight:y?600:400},children:[jsxRuntime.jsx(Hu,{color:p}),jsxRuntime.jsx("span",{children:d.label}),y&&jsxRuntime.jsx(tl,{})]},u)}),jsxRuntime.jsx("div",{style:{borderTop:"1px solid var(--asakaa-color-border-default, #e0e0e0)",marginTop:"4px",paddingTop:"4px"},children:jsxRuntime.jsxs("button",{onClick:()=>{i(void 0),s();},className:"dropdown-item","data-active":c===l.length,"data-index":l.length,role:"option","aria-selected":!e,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"var(--asakaa-color-text-tertiary, #9e9e9e)",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{children:"Clear"}),!e&&jsxRuntime.jsx(tl,{})]})})]})]})})}var al=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function ko({startDate:e,endDate:t,onChange:r,className:a}){let[n,o]=ke.useState(e||""),[i,l]=ke.useState(t||""),c=(x,y)=>{let g=new Date,h=new Date(g);h.setDate(h.getDate()+x);let v=g.toISOString().split("T")[0]||"",m=h.toISOString().split("T")[0]||"";o(v),l(m),r(v,m),y();},s=x=>{r(n||void 0,i||void 0),x();},u=()=>{if(!e||!t)return "Set date";let x=v=>{if(v instanceof Date)return v;if(typeof v!="string"||!v.match(/^\d{4}-\d{2}-\d{2}$/))return null;let m=v.split("-").map(Number);if(m.length!==3||m.some(C=>isNaN(C)))return null;let k=m[0],w=m[1],b=m[2];return k===void 0||w===void 0||b===void 0?null:new Date(k,w-1,b)},y=x(e),g=x(t);if(!y||!g||isNaN(y.getTime())||isNaN(g.getTime()))return "Set date";let h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${h[y.getMonth()]} ${y.getDate()} \u2013 ${h[g.getMonth()]} ${g.getDate()}`},d=e&&t,p=(()=>{if(!t)return false;let x=typeof t=="string"?new Date(t):t,y=new Date;return y.setHours(0,0,0,0),x<y})();return jsxRuntime.jsx(cr,{trigger:({isOpen:x})=>jsxRuntime.jsxs("button",{className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${p?"asakaa-date-overdue":"asakaa-date"} ${a||""}`,style:{transform:x?"scale(1.05)":"scale(1)"},title:d?`${u()}`:"Set date range","aria-label":"Select date range","aria-expanded":x,"aria-haspopup":"menu",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:u()})]}),placement:"bottom-start",minWidth:320,maxHeight:480,itemCount:al.length,onOpen:()=>{o(e||""),l(t||"");},children:({activeIndex:x,close:y})=>jsxRuntime.jsxs("div",{className:"date-range-picker-dropdown",children:[jsxRuntime.jsxs("div",{className:"dropdown-button-wrapper",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",style:{marginBottom:"12px"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"dropdown-quick-grid",children:al.map((g,h)=>jsxRuntime.jsx("button",{onClick:()=>c(g.days,y),className:"dropdown-quick-button","data-active":x===h,"data-index":h,role:"option",children:g.label},g.label))})]}),jsxRuntime.jsxs("div",{className:"dropdown-button-wrapper",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",style:{marginBottom:"12px"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"dropdown-form-actions",children:[jsxRuntime.jsxs("div",{className:"dropdown-form-group",children:[jsxRuntime.jsx("label",{className:"dropdown-label",children:"Start Date"}),jsxRuntime.jsx("input",{type:"date",value:n,onChange:g=>o(g.target.value),className:"dropdown-input"})]}),jsxRuntime.jsxs("div",{className:"dropdown-form-group",children:[jsxRuntime.jsx("label",{className:"dropdown-label",children:"End Date"}),jsxRuntime.jsx("input",{type:"date",value:i,onChange:g=>l(g.target.value),className:"dropdown-input"})]}),jsxRuntime.jsx("button",{onClick:()=>s(y),className:"dropdown-primary-button",children:"Apply"}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{o(""),l(""),r(void 0,void 0),y();},className:"dropdown-danger-button",children:"Clear Dates"})]})]})]})})}function wo({assignedUsers:e=[],availableUsers:t,onChange:r,className:a,maxVisibleAvatars:n=3}){let[o,i]=ke.useState(""),l=d=>{let f=e.some(p=>p.id===d.id);r(f?e.filter(p=>p.id!==d.id):[...e,d]);},c=t.filter(d=>d.name.toLowerCase().includes(o.toLowerCase())),s=e.slice(0,n),u=e.length-n;return jsxRuntime.jsx(cr,{trigger:({isOpen:d})=>jsxRuntime.jsx("button",{className:`dropdown-avatar-trigger ${a||""}`,style:{transform:d?"scale(1.05)":"scale(1)"},title:e.length>0?`${e.length} assigned`:"Assign users","aria-label":"Assign users","aria-expanded":d,"aria-haspopup":"menu",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[s.map(f=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:f.name,style:{backgroundColor:f.color,color:"#fff"},children:f.avatar?jsxRuntime.jsx("img",{src:f.avatar,alt:f.name,className:"asakaa-avatar-img"}):f.initials},f.id)),u>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar dropdown-avatar-overflow",children:["+",u]})]}):jsxRuntime.jsx("div",{className:"dropdown-avatar-empty-trigger",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),placement:"bottom-start",minWidth:300,maxHeight:350,itemCount:c.length,onSelectItem:d=>{let f=c[d];f&&l(f);},onClose:()=>i(""),children:({activeIndex:d,close:f})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",children:"Assign Users"}),jsxRuntime.jsx("div",{className:"dropdown-search-wrapper",children:jsxRuntime.jsx("input",{type:"text",value:o,onChange:p=>i(p.target.value),placeholder:"Search users...",className:"dropdown-search-input",autoFocus:true})}),jsxRuntime.jsx("div",{className:"dropdown-list",children:c.length===0?jsxRuntime.jsx("div",{className:"dropdown-empty",children:"No users found"}):c.map((p,x)=>{let y=e.some(g=>g.id===p.id);return jsxRuntime.jsxs("button",{onClick:()=>{l(p);},className:"dropdown-item","data-active":d===x,"data-index":x,role:"option","aria-selected":y,children:[jsxRuntime.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"11px",fontWeight:700,flexShrink:0,backgroundColor:p.color,color:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},children:p.avatar?jsxRuntime.jsx("img",{src:p.avatar,alt:p.name,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):p.initials}),jsxRuntime.jsx("span",{style:{flex:1,fontWeight:600},children:p.name}),y&&jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M4 9L7.5 12.5L14 6",stroke:"var(--asakaa-color-interactive-primary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},p.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"dropdown-button-wrapper",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),f();},className:"dropdown-danger-button",children:"Clear All"})})]})})}function Co({currentCardId:e,dependencies:t=[],availableTasks:r,onChange:a,className:n}){let[o,i]=ke.useState(""),[l,c]=ke.useState(t.length>0),s=p=>{if(t.includes(p)){let y=t.filter(g=>g!==p);a(y),y.length===0&&c(false);}else a([...t,p]),c(true);},u=()=>{let p=!l;c(p),p||a([]);},d=r.filter(p=>p.id!==e).filter(p=>p.title.toLowerCase().includes(o.toLowerCase())||p.id.toLowerCase().includes(o.toLowerCase())),f=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsx(cr,{trigger:({isOpen:p})=>jsxRuntime.jsxs("button",{className:`flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5 ${n||""}`,style:{transform:p?"scale(1.05)":"scale(1)"},title:t.length>0?`${t.length} dependencies`:"Add dependencies","aria-label":"Select dependencies","aria-expanded":p,"aria-haspopup":"menu",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:f,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:f},children:t.length})]}),placement:"bottom-start",minWidth:300,maxHeight:350,itemCount:l?d.length:0,onSelectItem:p=>{let x=d[p];x&&s(x.id);},onClose:()=>i(""),onOpen:()=>c(t.length>0),children:({activeIndex:p,close:x})=>jsxRuntime.jsxs("div",{className:"dependencies-dropdown",children:[jsxRuntime.jsx("div",{className:"dropdown-section-header",children:"Task Dependencies"}),jsxRuntime.jsx("div",{className:"dropdown-button-wrapper",style:{borderBottom:"1px solid var(--asakaa-color-border-subtle)"},children:jsxRuntime.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:u,children:[jsxRuntime.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s",border:l?"2px solid var(--asakaa-color-interactive-primary)":"2px solid var(--asakaa-color-border-default)",background:l?"var(--asakaa-color-interactive-primary)":"transparent"},children:l&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--asakaa-color-text-primary)"},children:"Has dependencies"})]})}),l&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"dropdown-search-wrapper",children:jsxRuntime.jsx("input",{type:"text",value:o,onChange:y=>i(y.target.value),placeholder:"Search by name or ID...",className:"dropdown-search-input",autoFocus:true})}),jsxRuntime.jsx("div",{className:"dropdown-list",children:d.length===0?jsxRuntime.jsx("div",{className:"dropdown-empty",children:"No tasks found"}):d.map((y,g)=>{let h=t.includes(y.id);return jsxRuntime.jsxs("button",{onClick:()=>s(y.id),className:"dropdown-item","data-active":p===g,"data-index":g,role:"option","aria-selected":h,children:[jsxRuntime.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px",transition:"all 0.15s",border:h?"2px solid var(--asakaa-color-interactive-primary)":"2px solid var(--asakaa-color-border-default)",background:h?"var(--asakaa-color-interactive-primary)":"transparent"},children:h&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{style:{flex:1,textAlign:"left"},children:[jsxRuntime.jsx("div",{style:{fontWeight:600,color:"var(--asakaa-color-text-primary)"},children:y.title}),jsxRuntime.jsx("div",{style:{fontSize:"11px",marginTop:"2px",color:"var(--asakaa-color-text-secondary)"},children:y.id})]})]},y.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"dropdown-button-wrapper",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),c(false),x();},className:"dropdown-danger-button",children:"Clear All Dependencies"})})]})})}function ol({columnTitle:e,onRename:t,className:r}){let[a,n]=ke.useState(false),[o,i]=ke.useState(false),[l,c]=ke.useState(e),[s,u]=ke.useState({top:0,left:0}),d=ke.useRef(null),f=ke.useRef(null),p=ke.useRef(null);ke.useEffect(()=>{if(a&&f.current){let h=f.current.getBoundingClientRect();u({top:h.bottom+window.scrollY+8,left:h.left+window.scrollX});}},[a]),ke.useEffect(()=>{let h=v=>{d.current&&!d.current.contains(v.target)&&!f.current?.contains(v.target)&&(n(false),i(false));};if(a)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[a]),ke.useEffect(()=>{let h=v=>{v.key==="Escape"&&(n(false),i(false),c(e));};if(a)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[a,e]),ke.useEffect(()=>{o&&p.current&&(p.current.focus(),p.current.select());},[o]);let x=()=>{i(true),c(e);},y=()=>{let h=l.trim();h&&h!==e&&t(h),i(false),n(false),c(e);},g=h=>{h.key==="Enter"?y():h.key==="Escape"&&(i(false),c(e));};return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:f,onClick:()=>n(!a),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),a&&jsxRuntime.jsx(Ie,{children:jsxRuntime.jsx("div",{ref:d,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${s.top}px`,left:`${s.left}px`,background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:o?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:p,type:"text",value:l,onChange:h=>c(h.target.value),onKeyDown:g,onBlur:y,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:x,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]})})})})]})}var na=ke.memo(({column:e,cards:t,renderColumn:r,renderCard:a,renderHeader:n,renderEmptyState:o,onCardClick:i,onCardUpdate:l,availableUsers:c,allCards:s,enableVirtualization:u,cardHeight:d=120,isCollapsed:f,onToggleCollapse:p,onColumnRename:x,className:y})=>{let{setNodeRef:g,isOver:h}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),v=ke.useRef(null),m=u??Vs(t.length),k=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>v.current,estimateSize:()=>d,enabled:m});if(r)return jsxRuntime.jsx("div",{ref:g,className:y,children:r(e,t)});let b=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let D=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:D}:D>=80?{state:"warning",percentage:D}:D>=60?{state:"approaching",percentage:D}:{state:"ok",percentage:D}})(),C=b.state==="exceeded",T=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:g,className:ee("asakaa-column",h&&"ring-2 ring-asakaa-accent-blue",C&&"ring-2 ring-asakaa-accent-red",y),children:[n?n(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:ee(T()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&b.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${b.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[b.state==="exceeded"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#EF4444",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 5L11 11M11 5L5 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),b.state==="warning"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M8 1L15 14H1L8 1Z",fill:"#F59E0B",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),b.state==="approaching"&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8 1L10 7H14L10 10L12 16L8 12L4 16L6 10L2 7H6L8 1Z",fill:"#FB923C",opacity:"0.9"})}),b.state==="ok"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#10B981",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]}),x&&jsxRuntime.jsx(ol,{columnTitle:e.title,onRename:D=>x(e.id,D)}),p&&jsxRuntime.jsx("button",{onClick:p,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":f?"Expand column":"Collapse column",children:f?"\u25B6":"\u25BC"})]})]}),!f&&jsxRuntime.jsx("div",{ref:v,className:"asakaa-column-cards",style:{maxHeight:m?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(D=>D.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?o?o(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):m?jsxRuntime.jsx("div",{style:{height:`${k.getTotalSize()}px`,position:"relative"},children:k.getVirtualItems().map(D=>{let N=t[D.index];return N?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${D.start}px)`},children:jsxRuntime.jsx(sr,{card:N,render:a,onClick:i,onUpdate:l,availableUsers:c,allCards:s})},N.id):null})}):t.map(D=>jsxRuntime.jsx(sr,{card:D,render:a,onClick:i,onUpdate:l,availableUsers:c,allCards:s},D.id))})})]})});na.displayName="Column";function So({title:e,onSave:t,className:r}){let[a,n]=ke.useState(false),[o,i]=ke.useState(e),l=ke.useRef(null);ke.useEffect(()=>{a&&l.current&&(l.current.focus(),l.current.select());},[a]);let c=()=>{let u=o.trim();u&&u!==e?t(u):i(e),n(false);},s=u=>{u.key==="Enter"?c():u.key==="Escape"&&(i(e),n(false));};return a?jsxRuntime.jsx("input",{ref:l,type:"text",value:o,onChange:u=>i(u.target.value),onBlur:c,onKeyDown:s,className:ee("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",r),maxLength:50}):jsxRuntime.jsx("h2",{className:ee("asakaa-column-title cursor-pointer",r),onClick:()=>n(true),title:"Click to edit",children:e})}function Do(){let[e,t]=ke.useState(()=>core.dragStore.getState());ke.useEffect(()=>core.dragStore.subscribe(n=>{t(n);}),[]);let r=ke.useCallback(a=>{core.dragStore.setState(a);},[]);return [e,r]}function yr({board:e,callbacks:t,onCardClick:r,renderProps:a,config:n,availableUsers:o=[],className:i,style:l,isLoading:c,error:s,children:u}){let[d,f]=Do(),p=ke.useCallback((w,b)=>{t.onCardUpdate?.(w,b);},[t]),x=ke.useCallback((w,b)=>{t.onColumnUpdate?.(w,{title:b});},[t]),y=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),g=ke.useMemo(()=>{let w=new Map;return e.columns.forEach(b=>{let C=b.cardIds.map(T=>e.cards.find(D=>D.id===T)).filter(T=>T!==void 0).sort((T,D)=>T.position-D.position);w.set(b.id,C);}),w},[e.cards,e.columns]),h=ke.useCallback(w=>{let{active:b}=w,C=e.cards.find(T=>T.id===b.id);C&&f({isDragging:true,draggedCardId:C.id,sourceColumnId:C.columnId,targetColumnId:C.columnId});},[e.cards,f]),v=ke.useCallback(w=>{let{active:b,over:C}=w;if(!C||!e.cards.find(N=>N.id===b.id))return;let D=null;C.data.current?.type==="column"?D=C.id:C.data.current?.type==="card"&&(D=e.cards.find(P=>P.id===C.id)?.columnId||null),D&&D!==d.targetColumnId&&f({...d,targetColumnId:D});},[e.cards,d,f]),m=ke.useCallback(async w=>{let{active:b,over:C}=w;if(f({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!C)return;let T=e.cards.find(I=>I.id===b.id);if(!T)return;let D,N;if(C.data.current?.type==="column"){D=C.id;let I=g.get(D)||[];N=qn(I,0);}else {let I=e.cards.find(z=>z.id===C.id);if(!I)return;D=I.columnId;let E=g.get(D)||[],A=E.findIndex(z=>z.id===C.id);N=qn(E,A);}let P=e.columns.find(I=>I.id===D);if(P&&P.wipLimit&&P.wipLimitType==="hard"){let I=g.get(D)||[];if(T.columnId!==D&&I.length>=P.wipLimit){t.onWipLimitExceeded?.(P,T);return}}(T.columnId!==D||T.position!==N)&&await t.onCardMove?.(T.id,D,N);},[e.cards,e.columns,g,t,f]),k=ke.useCallback(w=>{r?.(w);},[r]);return c?jsxRuntime.jsx("div",{className:ee("asakaa-board",i),style:l,children:jsxRuntime.jsx(ip,{columnCount:3})}):s?jsxRuntime.jsx("div",{className:ee("asakaa-board",i),style:l,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof s=="string"?s:s.message})]})})}):jsxRuntime.jsxs(core$1.DndContext,{sensors:y,collisionDetection:core$1.closestCorners,onDragStart:h,onDragOver:v,onDragEnd:m,children:[jsxRuntime.jsxs("div",{className:ee("asakaa-board",i),style:l,children:[e.columns.sort((w,b)=>w.position-b.position).map(w=>{let b=g.get(w.id)||[];return jsxRuntime.jsx(na,{column:w,cards:b,renderCard:a?.renderCard,renderColumn:a?.renderColumn,renderHeader:a?.renderColumnHeader,renderEmptyState:a?.renderEmptyState,onCardClick:k,onCardUpdate:p,onColumnRename:x,availableUsers:o,allCards:e.cards,enableVirtualization:n?.enableVirtualization,cardHeight:n?.cardHeight},w.id)}),u]}),jsxRuntime.jsx(core$1.DragOverlay,{children:d.draggedCardId?jsxRuntime.jsx(sr,{card:e.cards.find(w=>w.id===d.draggedCardId),render:a?.renderCardOverlay||a?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]})}function ip({columnCount:e}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,r)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},r))})}var Ea=class extends core.BaseViewAdapter{constructor(r={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=r,this.options={animations:r.viewOptions?.animations??true,virtualScrolling:r.viewOptions?.virtualScrolling??false,theme:r.viewOptions?.theme??"dark",readonly:r.viewOptions?.readonly??false};}mount(r,a){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=r,this.data=a,this.root=client.createRoot(r),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(r){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=r,this.render(),this.emit("view:updated",{viewId:this.id,data:r});}configure(r){this.options={...this.options,...r},this.isMounted()&&this.render();}async export(r){if(!this.data)throw new Error("No data to export");switch(r){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${r}`)}}render(){if(!this.root||!this.data)return;let r={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsxRuntime.jsx(yr,{board:r,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let r=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(a=>{let n=this.data.columns.find(o=>o.id===a.columnId);r.push([a.id,a.title,n?.title||"",a.description||"",a.labels?.join(", ")||"",a.assignedUserIds?.join(", ")||a.assigneeId||"",a.dueDate?.toString()||"",a.position.toString()]);}),r.map(a=>a.map(n=>`"${n}"`).join(",")).join(`
|
|
5
|
+
`)}async exportToPDF(){throw new Error("PDF export not yet implemented in ViewAdapter")}async exportToPNG(){if(!this.container)throw new Error("View not mounted");let a=await(await import('html2canvas')).default(this.container,{backgroundColor:this.options.theme==="dark"?"#1a1a1a":"#ffffff",scale:2});return new Promise((n,o)=>{a.toBlob(i=>{i?n(i):o(new Error("Failed to create PNG blob"));},"image/png");})}};function cl(e={}){return new Ea(e)}var sa=class extends ke.Component{constructor(r){super(r);this.resetError=()=>{this.setState({hasError:false,error:null,errorInfo:null});};this.state={hasError:false,error:null,errorInfo:null};}static getDerivedStateFromError(r){return {hasError:true,error:r}}componentDidCatch(r,a){let{onError:n,componentName:o}=this.props;if(process.env.NODE_ENV==="development"&&(console.error(`Error in ${o||"Component"}:`,r),console.error("Error Info:",a)),this.setState({errorInfo:a}),n)try{n(r,a);}catch(i){console.error("Error in error handler:",i);}}render(){let{hasError:r,error:a}=this.state,{children:n,fallback:o,componentName:i}=this.props;return r&&a?o?o(a,this.resetError):jsxRuntime.jsx("div",{className:"p-6 rounded-lg border",style:{background:"linear-gradient(135deg, #2d1b1b 0%, #1a1a1a 100%)",borderColor:"rgba(239, 68, 68, 0.3)"},children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#EF4444",strokeWidth:"2"}),jsxRuntime.jsx("path",{d:"M12 8V12",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"#EF4444"})]}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold text-red-400 mb-1",children:i?`Error in ${i}`:"Something went wrong"}),jsxRuntime.jsx("p",{className:"text-sm text-white/70 mb-3",children:a.message||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&jsxRuntime.jsxs("details",{className:"mb-3",children:[jsxRuntime.jsx("summary",{className:"text-xs text-white/50 cursor-pointer hover:text-white/70 mb-2",children:"Error Details (Development Only)"}),jsxRuntime.jsx("pre",{className:"text-xs text-white/60 bg-black/30 p-3 rounded overflow-auto max-h-48",children:a.stack})]}),jsxRuntime.jsx("button",{onClick:this.resetError,className:"px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#EF4444"},children:"Try Again"})]})]})}):n}};function Eo(e,t){let r=a=>jsxRuntime.jsx(sa,{...t,children:jsxRuntime.jsx(e,{...a})});return r.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,r}function Po({board:e,onCreateCard:t,onNavigateToCard:r,onSearch:a,onChangePriority:n,onAssignUser:o,onGeneratePlan:i,onPredictRisks:l,onOpenAIUsage:c,shortcut:s="k",className:u=""}){let[d,f]=ke.useState(false),[p,x]=ke.useState(""),[y,g]=ke.useState("home"),[h,v]=ke.useState(""),[m,k]=ke.useState("");ke.useEffect(()=>{let T=D=>{(D.metaKey||D.ctrlKey)&&D.key===s&&(D.preventDefault(),f(N=>!N)),D.key==="Escape"&&(f(false),g("home"),x(""));};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[s]),ke.useEffect(()=>{d||(g("home"),x(""),v(""),k(""));},[d]);let w=ke.useCallback(()=>{f(false);},[]),b=ke.useCallback(T=>{let[D,N]=T.split(":");switch(D){case "create-card":g("create-card");break;case "create-card-in":v(N||"");break;case "navigate":N?(r?.(N),w()):g("navigate");break;case "search":a?.(p),w();break;case "priority":g("priority");break;case "set-priority":m&&N&&(n?.(m,N),w());break;case "assign":g("assign");break;case "assign-user":m&&N&&(o?.(m,N),w());break;case "ai":g("ai");break;case "ai-generate-plan":i?.(),w();break;case "ai-predict-risks":l?.(),w();break;case "ai-usage":c?.(),w();break;case "back":g("home");break;}},[p,m,t,r,a,n,o,i,l,c,w]),C=ke.useCallback(()=>{h&&p.trim()&&(t?.(h,p.trim()),w());},[h,p,t,w]);return d?jsxRuntime.jsx(Ie,{children:jsxRuntime.jsx("div",{className:"command-palette-overlay",onClick:w,children:jsxRuntime.jsx("div",{className:`command-palette ${u}`,onClick:T=>T.stopPropagation(),children:jsxRuntime.jsxs(cmdk.Command,{value:p,onValueChange:x,label:"Command Menu",children:[jsxRuntime.jsxs("div",{className:"command-palette-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx(cmdk.Command.Input,{placeholder:y==="create-card"&&h?"Type card title and press Enter...":y==="create-card"?"Select a column first...":"Type a command or search...",className:"command-palette-input",onKeyDown:T=>{T.key==="Enter"&&y==="create-card"&&h&&C();}}),jsxRuntime.jsxs("div",{className:"command-palette-shortcut",children:[jsxRuntime.jsx("kbd",{children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsxRuntime.jsx("kbd",{children:"K"})]})]}),jsxRuntime.jsxs(cmdk.Command.List,{className:"command-palette-list",children:[jsxRuntime.jsx(cmdk.Command.Empty,{className:"command-palette-empty",children:"No results found."}),y==="home"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Group,{heading:"Actions",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"create-card",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntime.jsx("path",{d:"M12 8v8m-4-4h8"})]}),jsxRuntime.jsx("span",{children:"Create Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"C"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"navigate",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 16 16 12 12 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),jsxRuntime.jsx("span",{children:"Navigate to Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"G"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"search",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx("span",{children:"Search Cards"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"/"})]})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"AI Commands"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Cards",className:"command-palette-group",children:e.cards.slice(0,5).map(T=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${T.id}`,onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:T.priority==="URGENT"?"#EF4444":T.priority==="HIGH"?"#F59E0B":T.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:T.title}),T.labels&&T.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:T.labels.slice(0,2).map(D=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:D},D))})]},T.id))})]}),y==="create-card"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Select Column",className:"command-palette-group",children:e.columns.map(T=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`create-card-in:${T.id}`,onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"18",rx:"1"})}),jsxRuntime.jsx("span",{children:T.title}),jsxRuntime.jsxs("div",{className:"command-palette-item-count",children:[T.cardIds.length," cards"]})]},T.id))})]}),y==="navigate"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"All Cards",className:"command-palette-group",children:e.cards.map(T=>{let D=e.columns.find(N=>N.id===T.columnId);return jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${T.id}`,onSelect:b,className:"command-palette-item",keywords:[T.title,T.description||"",...T.labels||[]],children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:T.priority==="URGENT"?"#EF4444":T.priority==="HIGH"?"#F59E0B":T.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsxs("div",{className:"command-palette-item-content",children:[jsxRuntime.jsx("div",{children:T.title}),jsxRuntime.jsx("div",{className:"command-palette-item-meta",children:D?.title})]}),T.labels&&T.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:T.labels.slice(0,2).map(N=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:N},N))})]},T.id)})})]}),y==="ai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:b,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsxs(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-generate-plan",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"Generate Project Plan"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-predict-risks",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsxRuntime.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsxRuntime.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsxRuntime.jsx("span",{children:"Predict Risks"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-usage",onSelect:b,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),jsxRuntime.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"})]}),jsxRuntime.jsx("span",{children:"AI Usage & Costs"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})]})]})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer",children:[jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"\u2191"}),jsxRuntime.jsx("kbd",{children:"\u2193"}),jsxRuntime.jsx("span",{children:"Navigate"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Enter"}),jsxRuntime.jsx("span",{children:"Select"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Esc"}),jsxRuntime.jsx("span",{children:"Close"})]})]})]})})})}):null}function fp(e){if(e===0)return "0 Bytes";let t=1024,r=["Bytes","KB","MB","GB"],a=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,a)*100)/100+" "+r[a]}function gp(e){return e.startsWith("image/")?"\u{1F5BC}\uFE0F":e.startsWith("video/")?"\u{1F3A5}":e.startsWith("audio/")?"\u{1F3B5}":e.includes("pdf")?"\u{1F4C4}":e.includes("word")||e.includes("document")?"\u{1F4DD}":e.includes("sheet")||e.includes("excel")?"\u{1F4CA}":e.includes("presentation")||e.includes("powerpoint")?"\u{1F4FD}\uFE0F":e.includes("zip")||e.includes("rar")||e.includes("compressed")?"\u{1F5DC}\uFE0F":e.includes("text")?"\u{1F4C3}":"\u{1F4CE}"}function hp(e){return e.startsWith("image/")}function Pa({attachments:e=[],onUpload:t,onDelete:r,maxSizeMB:a=10,allowedTypes:n,maxFiles:o=10}){let[i,l]=ke.useState(false),[c,s]=ke.useState(false),[u,d]=ke.useState(null),f=ke.useRef(null),p=ke.useCallback(b=>{let C=[],T=[];return e.length+b.length>o?(T.push(`Maximum ${o} files allowed`),{valid:C,errors:T}):(b.forEach(D=>{if(D.size/1048576>a){T.push(`${D.name} is too large (max ${a}MB)`);return}if(n&&!n.some(P=>D.type.match(P))){T.push(`${D.name} has invalid file type`);return}C.push(D);}),{valid:C,errors:T})},[e.length,o,a,n]),x=ke.useCallback(async b=>{let{valid:C,errors:T}=p(b);if(T.length>0){d(T.join(", ")),setTimeout(()=>d(null),5e3);return}if(C.length!==0){s(true),d(null);try{await t?.(C);}catch(D){d(D instanceof Error?D.message:"Upload failed"),setTimeout(()=>d(null),5e3);}finally{s(false);}}},[p,t]),y=ke.useCallback(b=>{b.preventDefault(),b.stopPropagation(),l(true);},[]),g=ke.useCallback(b=>{b.preventDefault(),b.stopPropagation(),l(false);},[]),h=ke.useCallback(b=>{b.preventDefault(),b.stopPropagation();},[]),v=ke.useCallback(b=>{b.preventDefault(),b.stopPropagation(),l(false);let C=Array.from(b.dataTransfer.files);x(C);},[x]),m=ke.useCallback(b=>{let C=b.target.files?Array.from(b.target.files):[];x(C),f.current&&(f.current.value="");},[x]),k=ke.useCallback(()=>{f.current?.click();},[]),w=ke.useCallback(b=>{confirm("Are you sure you want to delete this attachment?")&&r?.(b);},[r]);return jsxRuntime.jsxs("div",{className:"attachment-uploader",children:[jsxRuntime.jsxs("div",{className:`attachment-dropzone ${i?"dragging":""} ${c?"uploading":""}`,onDragEnter:y,onDragLeave:g,onDragOver:h,onDrop:v,onClick:k,children:[jsxRuntime.jsx("input",{ref:f,type:"file",multiple:true,onChange:m,style:{display:"none"},accept:n?.join(",")}),jsxRuntime.jsx("div",{className:"attachment-dropzone-content",children:c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"attachment-spinner"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"attachment-dropzone-icon",children:[jsxRuntime.jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M17 8L12 3L7 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M12 3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntime.jsx("p",{className:"attachment-dropzone-text",children:i?"Drop files here":"Drag & drop files here"}),jsxRuntime.jsx("p",{className:"attachment-dropzone-subtext",children:"or click to browse"}),jsxRuntime.jsxs("p",{className:"attachment-dropzone-info",children:["Max ",a,"MB \u2022 ",e.length,"/",o," files"]})]})})]}),u&&jsxRuntime.jsxs("div",{className:"attachment-error",children:[jsxRuntime.jsx("span",{className:"attachment-error-icon",children:"\u26A0\uFE0F"}),jsxRuntime.jsx("span",{className:"attachment-error-text",children:u})]}),e.length>0&&jsxRuntime.jsx("div",{className:"attachment-list",children:e.map(b=>jsxRuntime.jsxs("div",{className:"attachment-item",children:[jsxRuntime.jsx("div",{className:"attachment-preview",children:hp(b.type)&&b.url?jsxRuntime.jsx("img",{src:b.thumbnailUrl||b.url,alt:b.name,className:"attachment-thumbnail"}):jsxRuntime.jsx("div",{className:"attachment-icon",children:gp(b.type)})}),jsxRuntime.jsxs("div",{className:"attachment-info",children:[jsxRuntime.jsx("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"attachment-name",title:b.name,children:b.name}),jsxRuntime.jsxs("div",{className:"attachment-meta",children:[jsxRuntime.jsx("span",{className:"attachment-size",children:fp(b.size)}),jsxRuntime.jsx("span",{className:"attachment-separator",children:"\u2022"}),jsxRuntime.jsx("span",{className:"attachment-date",children:new Date(b.uploadedAt).toLocaleDateString()})]})]}),jsxRuntime.jsx("button",{onClick:()=>w(b.id),className:"attachment-delete",title:"Delete attachment",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},b.id))})]})}function Mo({card:e,isOpen:t,onClose:r,onUpdate:a,onDelete:n,availableUsers:o=[],comments:i=[],activities:l=[],aiInsights:c=[],attachments:s=[],onAddComment:u,onDeleteComment:d,onUploadAttachments:f,onDeleteAttachment:p,onSuggestAssignee:x,onGenerateSubtasks:y,onEstimateEffort:g,currentUserId:h="user-1"}){let[v,m]=ke.useState("details"),[k,w]=ke.useState(false),[b,C]=ke.useState({}),[T,D]=ke.useState(""),[N,P]=ke.useState(false),[I,E]=ke.useState({});if(!t||!e)return null;let A=ke.useCallback(()=>{w(false),C({}),m("details"),D(""),E({}),r();},[r]),z=ke.useCallback(()=>{a&&Object.keys(b).length>0&&(a(e.id,b),C({}),w(false));},[e.id,b,a]),U=ke.useCallback(()=>{n&&window.confirm("Are you sure you want to delete this card?")&&(n(e.id),A());},[e.id,n,A]),J=ke.useCallback(()=>{u&&T.trim()&&(u(e.id,T.trim()),D(""));},[e.id,T,u]),X=ke.useCallback(async()=>{if(x){P(true);try{let B=await x(e);E(j=>({...j,assignees:B}));}catch(B){console.error("Failed to suggest assignee:",B);}finally{P(false);}}},[e,x]),ae=ke.useCallback(async()=>{if(y){P(true);try{let B=await y(e);E(j=>({...j,subtasks:B}));}catch(B){console.error("Failed to generate subtasks:",B);}finally{P(false);}}},[e,y]),Ee=ke.useCallback(async()=>{if(g){P(true);try{let B=await g(e);E(j=>({...j,effort:B}));}catch(B){console.error("Failed to estimate effort:",B);}finally{P(false);}}},[e,g]),te={...e,...b},Se=o.filter(B=>te.assignedUserIds?.includes(B.id));return jsxRuntime.jsx(Ie,{children:jsxRuntime.jsx("div",{className:"card-detail-overlay",onClick:A,children:jsxRuntime.jsxs("div",{className:"card-detail-modal",onClick:B=>B.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"card-detail-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-header-left",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:te.priority==="URGENT"?"#EF4444":te.priority==="HIGH"?"#F59E0B":te.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),k?jsxRuntime.jsx("input",{type:"text",value:b.title??te.title,onChange:B=>C({...b,title:B.target.value}),className:"card-detail-title-input",placeholder:"Card title"}):jsxRuntime.jsx("h2",{className:"card-detail-title",children:te.title})]}),jsxRuntime.jsxs("div",{className:"card-detail-header-actions",children:[k?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{onClick:z,className:"card-detail-btn card-detail-btn-primary",children:"Save"}),jsxRuntime.jsx("button",{onClick:()=>{w(false),C({});},className:"card-detail-btn",children:"Cancel"})]}):jsxRuntime.jsxs("button",{onClick:()=>w(true),className:"card-detail-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]}),jsxRuntime.jsxs("button",{onClick:U,className:"card-detail-btn card-detail-btn-danger",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]}),"Delete"]}),jsxRuntime.jsx("button",{onClick:A,className:"card-detail-btn-close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-tabs",children:[jsxRuntime.jsxs("button",{onClick:()=>m("details"),className:`card-detail-tab ${v==="details"?"active":""}`,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Details"]}),jsxRuntime.jsxs("button",{onClick:()=>m("comments"),className:`card-detail-tab ${v==="comments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),"Comments",i.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:i.length})]}),jsxRuntime.jsxs("button",{onClick:()=>m("activity"),className:`card-detail-tab ${v==="activity"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Activity",l.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:l.length})]}),jsxRuntime.jsxs("button",{onClick:()=>m("attachments"),className:`card-detail-tab ${v==="attachments"?"active":""}`,children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),"Attachments",s.length>0&&jsxRuntime.jsx("span",{className:"card-detail-tab-badge",children:s.length})]}),jsxRuntime.jsxs("button",{onClick:()=>m("ai"),className:`card-detail-tab ${v==="ai"?"active":""}`,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),"AI Insights",jsxRuntime.jsx("span",{className:"card-detail-tab-badge card-detail-tab-badge-ai",children:"AI"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-content",children:[v==="details"&&jsxRuntime.jsxs("div",{className:"card-detail-details",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Description"}),k?jsxRuntime.jsx("textarea",{value:b.description??te.description??"",onChange:B=>C({...b,description:B.target.value}),className:"card-detail-textarea",placeholder:"Add a description...",rows:4}):jsxRuntime.jsx("p",{className:"card-detail-text",children:te.description||"No description"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Assigned To"}),k?jsxRuntime.jsx("select",{multiple:true,value:b.assignedUserIds??te.assignedUserIds??[],onChange:B=>{let j=Array.from(B.target.selectedOptions,Le=>Le.value);C({...b,assignedUserIds:j});},className:"card-detail-textarea",style:{height:"120px",padding:"8px 12px"},children:o.map(B=>jsxRuntime.jsx("option",{value:B.id,children:B.name},B.id))}):jsxRuntime.jsx("div",{className:"card-detail-users",children:Se.length>0?Se.map(B=>jsxRuntime.jsxs("div",{className:"card-detail-user",children:[jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:B.color},children:B.initials}),jsxRuntime.jsx("span",{children:B.name})]},B.id)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"Unassigned"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Priority"}),k?jsxRuntime.jsxs("select",{value:b.priority??te.priority??"",onChange:B=>C({...b,priority:B.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},children:[jsxRuntime.jsx("option",{value:"",children:"None"}),jsxRuntime.jsx("option",{value:"LOW",children:"LOW"}),jsxRuntime.jsx("option",{value:"MEDIUM",children:"MEDIUM"}),jsxRuntime.jsx("option",{value:"HIGH",children:"HIGH"}),jsxRuntime.jsx("option",{value:"URGENT",children:"URGENT"})]}):jsxRuntime.jsxs("div",{className:"card-detail-priority",children:[jsxRuntime.jsx("div",{className:"card-detail-priority-dot",style:{background:te.priority==="URGENT"?"#EF4444":te.priority==="HIGH"?"#F59E0B":te.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:te.priority||"None"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Labels"}),jsxRuntime.jsx("div",{className:"card-detail-labels",children:te.labels&&te.labels.length>0?te.labels.map(B=>jsxRuntime.jsx("span",{className:"card-detail-label-tag",children:B},B)):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No labels"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section-row",children:[jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Start Date"}),k?jsxRuntime.jsx("input",{type:"date",value:b.startDate?new Date(b.startDate).toISOString().split("T")[0]:te.startDate?new Date(te.startDate).toISOString().split("T")[0]:"",onChange:B=>C({...b,startDate:B.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:te.startDate?new Date(te.startDate).toLocaleDateString():"Not set"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"End Date"}),k?jsxRuntime.jsx("input",{type:"date",value:b.endDate?new Date(b.endDate).toISOString().split("T")[0]:te.endDate?new Date(te.endDate).toISOString().split("T")[0]:"",onChange:B=>C({...b,endDate:B.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsxRuntime.jsx("span",{className:"card-detail-text",children:te.endDate?new Date(te.endDate).toLocaleDateString():"Not set"})]})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Estimated Hours"}),k?jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",value:b.estimatedTime??te.estimatedTime??"",onChange:B=>C({...b,estimatedTime:B.target.value?parseFloat(B.target.value):void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},placeholder:"Enter hours"}):jsxRuntime.jsx("span",{className:"card-detail-text",children:te.estimatedTime||"Not estimated"})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Dependencies"}),jsxRuntime.jsx("div",{className:"card-detail-dependencies",children:te.dependencies&&te.dependencies.length>0?te.dependencies.map(B=>{let j=typeof B=="string"?B:B.taskId;return jsxRuntime.jsxs("span",{className:"card-detail-dependency",children:["Card #",j.slice(-4)]},j)}):jsxRuntime.jsx("span",{className:"card-detail-empty",children:"No dependencies"})})]}),jsxRuntime.jsxs("div",{className:"card-detail-section",children:[jsxRuntime.jsx("label",{className:"card-detail-label",children:"Created"}),jsxRuntime.jsx("span",{className:"card-detail-text",children:te.createdAt?new Date(te.createdAt).toLocaleString():"Unknown"})]})]}),v==="comments"&&jsxRuntime.jsxs("div",{className:"card-detail-comments",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-form",children:[jsxRuntime.jsx("textarea",{value:T,onChange:B=>D(B.target.value),className:"card-detail-comment-textarea",placeholder:"Write a comment...",rows:3}),jsxRuntime.jsx("button",{onClick:J,disabled:!T.trim(),className:"card-detail-btn card-detail-btn-primary",children:"Add Comment"})]}),jsxRuntime.jsx("div",{className:"card-detail-comments-list",children:i.length>0?i.map(B=>{let j=o.find(Le=>Le.id===B.authorId);return jsxRuntime.jsxs("div",{className:"card-detail-comment",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-header",children:[jsxRuntime.jsxs("div",{className:"card-detail-comment-author",children:[j&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:j.color},children:j.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-comment-author-name",children:j?.name||"Unknown"}),jsxRuntime.jsx("div",{className:"card-detail-comment-time",children:new Date(B.createdAt).toLocaleString()})]})]}),d&&jsxRuntime.jsx("button",{onClick:()=>d(B.id),className:"card-detail-comment-delete",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]}),jsxRuntime.jsx("p",{className:"card-detail-comment-content",children:B.content})]},B.id)}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("p",{children:"No comments yet"}),jsxRuntime.jsx("span",{children:"Be the first to comment"})]})})]}),v==="activity"&&jsxRuntime.jsx("div",{className:"card-detail-activity",children:l.length>0?jsxRuntime.jsx("div",{className:"card-detail-activity-list",children:l.map(B=>{let j=o.find(Le=>Le.id===B.userId);return jsxRuntime.jsxs("div",{className:"card-detail-activity-item",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-icon",children:[B.type.includes("CREATED")&&"\u2795",B.type.includes("UPDATED")&&"\u270F\uFE0F",B.type.includes("MOVED")&&"\u27A1\uFE0F",B.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",B.type.includes("COMMENT")&&"\u{1F4AC}",B.type.includes("ASSIGNED")&&"\u{1F464}",B.type.includes("PRIORITY")&&"\u{1F3AF}",B.type.includes("LABEL")&&"\u{1F3F7}\uFE0F",B.type.includes("ATTACHMENT")&&"\u{1F4CE}"]}),jsxRuntime.jsxs("div",{className:"card-detail-activity-content",children:[jsxRuntime.jsxs("div",{className:"card-detail-activity-text",children:[jsxRuntime.jsx("strong",{children:j?.name||"Unknown"})," ",B.type.replace(/_/g," ").toLowerCase(),B.newValue&&jsxRuntime.jsxs("span",{className:"card-detail-activity-value",children:[" ","to ",jsxRuntime.jsx("strong",{children:B.newValue})]})]}),jsxRuntime.jsx("div",{className:"card-detail-activity-time",children:new Date(B.timestamp).toLocaleString()})]})]},B.id)})}):jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntime.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})}),v==="attachments"&&jsxRuntime.jsx("div",{className:"card-detail-attachments",children:jsxRuntime.jsx(Pa,{cardId:e.id,attachments:s,onUpload:f?B=>f(e.id,B):void 0,onDelete:p,currentUserId:h,maxSizeMB:10,maxFiles:20})}),v==="ai"&&jsxRuntime.jsxs("div",{className:"card-detail-ai",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-actions",children:[jsxRuntime.jsx("h3",{className:"card-detail-ai-heading",children:"AI-Powered Suggestions"}),jsxRuntime.jsxs("button",{onClick:X,disabled:N||!x,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Suggest Best Assignee"]}),jsxRuntime.jsxs("button",{onClick:ae,disabled:N||!y,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),jsxRuntime.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),jsxRuntime.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),jsxRuntime.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),"Generate Subtasks"]}),jsxRuntime.jsxs("button",{onClick:Ee,disabled:N||!g,className:"card-detail-ai-btn",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 6 12 12 16 14"})]}),"Estimate Effort"]})]}),I.assignees&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Assignee Suggestions"}),I.assignees.map((B,j)=>{let Le=o.find(tt=>tt.id===B.userId);return jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion",children:[Le&&jsxRuntime.jsx("div",{className:"card-detail-user-avatar",style:{background:Le.color},children:Le.initials}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-name",children:Le?.name}),jsxRuntime.jsx("div",{className:"card-detail-ai-suggestion-reason",children:B.reasoning}),jsxRuntime.jsxs("div",{className:"card-detail-ai-suggestion-confidence",children:["Confidence: ",(B.confidence*100).toFixed(0),"%"]})]})]},j)})]}),I.subtasks&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Suggested Subtasks"}),I.subtasks.map((B,j)=>jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask",children:[jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-title",children:B.title}),B.description&&jsxRuntime.jsx("div",{className:"card-detail-ai-subtask-desc",children:B.description}),B.estimatedTime&&jsxRuntime.jsxs("div",{className:"card-detail-ai-subtask-time",children:["Est: ",B.estimatedTime,"h"]})]},j))]}),I.effort&&jsxRuntime.jsxs("div",{className:"card-detail-ai-results",children:[jsxRuntime.jsx("h4",{children:"Effort Estimate"}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort",children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-hours",children:[I.effort.hours," hours"]}),jsxRuntime.jsxs("div",{className:"card-detail-ai-effort-confidence",children:["Confidence: ",(I.effort.confidence*100).toFixed(0),"%"]})]})]}),c.length>0&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insights",children:[jsxRuntime.jsx("h4",{children:"AI Insights"}),c.map(B=>jsxRuntime.jsxs("div",{className:`card-detail-ai-insight card-detail-ai-insight-${B.severity.toLowerCase()}`,children:[jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-header",children:[jsxRuntime.jsx("span",{className:"card-detail-ai-insight-title",children:B.title}),jsxRuntime.jsx("span",{className:"card-detail-ai-insight-severity",children:B.severity})]}),jsxRuntime.jsx("p",{className:"card-detail-ai-insight-desc",children:B.description}),B.suggestedAction&&jsxRuntime.jsxs("div",{className:"card-detail-ai-insight-action",children:["\u{1F4A1} ",B.suggestedAction]})]},B.id))]}),!I.assignees&&!I.subtasks&&!I.effort&&c.length===0&&jsxRuntime.jsxs("div",{className:"card-detail-empty-state",children:[jsxRuntime.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("p",{children:"AI Suggestions"}),jsxRuntime.jsx("span",{children:"Click a button above to get AI-powered insights"})]})]})]})]})})})}var kp=["LOW","MEDIUM","HIGH","URGENT"],wp=["todo","in-progress","review","done"];function Lo({card:e,isOpen:t,onClose:r,onUpdate:a,onDelete:n,availableUsers:o=[],comments:i=[],activities:l=[],onAddComment:c,onDeleteComment:s,currentUser:u,onAIGenerateDescription:d,onAICreateSubtasks:f,onAIFindSimilar:p,availableColumns:x=[],availableLabels:y=[]}){let[g,h]=ke.useState(e),[v,m]=ke.useState(false),[k,w]=ke.useState([]),[b,C]=ke.useState(false),[T,D]=ke.useState(""),[N,P]=ke.useState(""),[I,E]=ke.useState("all"),[A,z]=ke.useState(false),[U,J]=ke.useState(false),[X,ae]=ke.useState(false),[Ee,te]=ke.useState(false),[Se,B]=ke.useState(false),[j,Le]=ke.useState(false),tt=ke.useRef(null),Lt=ke.useRef(null),xe=ke.useRef(null),re=ke.useRef(null),ie=ke.useRef(null),Ft=ke.useRef(null),Gt=ke.useRef(null),_t=ke.useRef(null);ke.useEffect(()=>{e&&!g?h({...e}):e&&g&&e.id!==g.id&&h({...e});},[e,g]),ke.useEffect(()=>{let S=G=>{let pe=G.target;re.current&&!re.current.contains(pe)&&z(false),ie.current&&!ie.current.contains(pe)&&J(false),Ft.current&&!Ft.current.contains(pe)&&ae(false),Gt.current&&!Gt.current.contains(pe)&&te(false);};if(A||U||X||Ee)return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[A,U,X,Ee]),ke.useEffect(()=>{if(!t)return;let S=G=>{let pe=G.target,we=pe.tagName==="INPUT"||pe.tagName==="TEXTAREA"||pe.isContentEditable;if(G.key==="Escape"){G.preventDefault(),A||U||X||Ee||Se||j?(z(false),J(false),ae(false),te(false),B(false),Le(false)):we||r();return}if(we&&G.key!=="Escape")return;let Ne=G.metaKey||G.ctrlKey;switch(G.key.toLowerCase()){case "s":G.preventDefault(),z(true);break;case "a":G.preventDefault(),ae(true);break;case "p":G.preventDefault(),J(true);break;case "l":G.preventDefault(),te(true);break;case "d":Ne||(G.preventDefault(),B(true),setTimeout(()=>_t.current?.focus(),0));break;case "e":Ne||(G.preventDefault(),Le(true));break;case "i":G.preventDefault(),m(true),setTimeout(()=>Lt.current?.focus(),0);break;case "t":G.preventDefault(),C(true);break;case "c":G.preventDefault(),xe.current?.focus();break}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[t,r,A,U,X,Ee,Se,j]);let _=ke.useCallback(S=>{let G=S.currentTarget.textContent?.trim()||"";if(g&&G!==g.title){let pe={...g,title:G};h(pe),a?.(g.id,{title:G});}},[g,a]),H=ke.useCallback(S=>{S.key==="Enter"&&(S.preventDefault(),S.currentTarget.blur()),S.key==="Escape"&&(S.preventDefault(),S.currentTarget.textContent=g?.title||"",S.currentTarget.blur());},[g]),Me=ke.useCallback(()=>{g&&e&&g.description!==e.description&&a?.(g.id,{description:g.description}),m(false);},[g,e,a]),He=ke.useCallback(S=>{if(g){let G={...g,columnId:S};h(G),a?.(g.id,{columnId:S}),z(false);}},[g,a]),Fe=ke.useCallback(S=>{if(g){let G={...g,priority:S};h(G),a?.(g.id,{priority:S}),J(false);}},[g,a]),$t=ke.useCallback(S=>{if(g){let G=g.assignedUserIds||[],pe=G.includes(S)?G.filter(Ne=>Ne!==S):[...G,S],we={...g,assignedUserIds:pe};h(we),a?.(g.id,{assignedUserIds:pe});}},[g,a]),se=ke.useCallback(S=>{if(g){let G=g.labels||[],pe=G.includes(S)?G.filter(Ne=>Ne!==S):[...G,S],we={...g,labels:pe};h(we),a?.(g.id,{labels:pe});}},[g,a]),it=ke.useCallback(S=>{if(g){let G=S.target.value,pe={...g,endDate:G};h(pe),a?.(g.id,{endDate:G}),B(false);}},[g,a]),Ye=ke.useCallback(S=>{if(g){let G={...g,estimatedTime:parseFloat(S)||0};h(G),a?.(g.id,{estimatedTime:parseFloat(S)||0});}},[g,a]),ut=ke.useCallback(()=>{if(T.trim()){let S={id:`subtask-${Date.now()}`,title:T.trim(),completed:false};w([...k,S]),D(""),C(false);}},[T,k]),Nr=ke.useCallback(S=>{w(k.map(G=>G.id===S?{...G,completed:!G.completed}:G));},[k]),he=ke.useCallback(S=>{w(k.filter(G=>G.id!==S));},[k]),de=ke.useCallback(()=>{N.trim()&&g&&c&&(c(g.id,N.trim()),P(""));},[N,g,c]),Yr=ke.useCallback(S=>{(S.metaKey||S.ctrlKey)&&S.key==="Enter"&&(S.preventDefault(),de());},[de]),qr=S=>jsxRuntime.jsx(bp__default.default,{remarkPlugins:[yp__default.default],rehypePlugins:[xp__default.default],components:{a:({node:G,...pe})=>jsxRuntime.jsx("a",{...pe,target:"_blank",rel:"noopener noreferrer"})},children:S}),Dr=l.filter(S=>I==="comments"?S.type.includes("COMMENT"):I==="history"?!S.type.includes("COMMENT"):true);if(!t||!e)return null;let O=g||e,ge=o.filter(S=>O.assignedUserIds?.includes(S.id)),ue=k.filter(S=>S.completed).length;return jsxRuntime.jsx(Ie,{children:jsxRuntime.jsx("div",{className:"modal-v2-backdrop",onClick:r,style:{position:"fixed",inset:"0",zIndex:9999,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsxs("div",{className:"modal-v2-container",onClick:S=>S.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[jsxRuntime.jsxs("header",{className:"modal-v2-header",children:[jsxRuntime.jsx("h1",{id:"modal-title",ref:tt,className:"modal-v2-title",contentEditable:true,suppressContentEditableWarning:true,onBlur:_,onKeyDown:H,children:O.title}),jsxRuntime.jsxs("p",{className:"modal-v2-ai-prompt",children:[jsxRuntime.jsx("span",{className:"modal-v2-ai-icon",children:"\u2728"}),"Ask AI to write a description, create subtasks, or find similar tasks"]}),jsxRuntime.jsx("button",{className:"modal-v2-close",onClick:r,"aria-label":"Close",children:jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),O.coverImage&&jsxRuntime.jsx("div",{className:"modal-v2-cover",children:jsxRuntime.jsx("img",{src:O.coverImage,alt:`Cover for ${O.title}`,className:"w-full max-h-96 object-cover",onError:S=>{S.currentTarget.style.display="none";}})}),jsxRuntime.jsxs("section",{className:"modal-v2-metadata",children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:re,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>z(!A),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M12 6v6l4 2"})]}),jsxRuntime.jsx("span",{children:"Status"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"S"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:O.columnId||"No status"})]}),A&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:(x.length>0?x:wp.map(S=>({id:S,title:S}))).map(S=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item ${O.columnId===S.id?"active":""}`,onClick:()=>He(S.id),children:S.title},S.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Ft,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>ae(!X),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsx("span",{children:"Assignees"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"A"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:ge.length>0?jsxRuntime.jsx("div",{className:"modal-v2-avatars",children:ge.map(S=>jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:S.color},title:S.name,children:S.initials},S.id))}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),X&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:o.map(S=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${O.assignedUserIds?.includes(S.id)?"active":""}`,onClick:()=>$t(S.id),children:[jsxRuntime.jsx("div",{className:"modal-v2-avatar-small",style:{background:S.color},children:S.initials}),S.name,O.assignedUserIds?.includes(S.id)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},S.id))})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:ie,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>J(!U),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsxRuntime.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsxRuntime.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsxRuntime.jsx("span",{children:"Priority"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"P"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:O.priority||"None"})]}),U&&jsxRuntime.jsxs("div",{className:"modal-v2-popover",children:[kp.map(S=>jsxRuntime.jsx("button",{className:`modal-v2-popover-item priority-${S.toLowerCase()} ${O.priority===S?"active":""}`,onClick:()=>Fe(S),children:S},S)),jsxRuntime.jsx("button",{className:"modal-v2-popover-item",onClick:()=>Fe(""),children:"None"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",ref:Gt,children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>te(!Ee),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsx("span",{children:"Labels"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"L"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:O.labels&&O.labels.length>0?jsxRuntime.jsx("span",{children:O.labels.join(", ")}):jsxRuntime.jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),Ee&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:(y.length>0?y:["Bug","Feature","Enhancement","Documentation"]).map(S=>jsxRuntime.jsxs("button",{className:`modal-v2-popover-item ${O.labels?.includes(S)?"active":""}`,onClick:()=>se(S),children:[S,O.labels?.includes(S)&&jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},S))})]}),jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>{B(!Se),setTimeout(()=>_t.current?.showPicker?.(),0);},children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),jsxRuntime.jsx("span",{children:"Due Date"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"D"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:O.endDate?new Date(O.endDate).toLocaleDateString():"Not set"}),jsxRuntime.jsx("input",{ref:_t,type:"date",value:typeof O.endDate=="string"?O.endDate.split("T")[0]:O.endDate?(()=>{let S=new Date(O.endDate),G=S.getUTCFullYear(),pe=String(S.getUTCMonth()+1).padStart(2,"0"),we=String(S.getUTCDate()).padStart(2,"0");return `${G}-${pe}-${we}`})():"",onChange:it,style:{position:"absolute",opacity:0,pointerEvents:"none"}})]}),jsxRuntime.jsxs("div",{className:"modal-v2-field-wrapper",children:[jsxRuntime.jsxs("button",{className:"modal-v2-field",onClick:()=>Le(!j),children:[jsxRuntime.jsxs("div",{className:"modal-v2-field-label",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 6 12 12 16 14"})]}),jsxRuntime.jsx("span",{children:"Estimated Time"}),jsxRuntime.jsx("kbd",{className:"modal-v2-shortcut",children:"E"})]}),jsxRuntime.jsx("div",{className:"modal-v2-field-value",children:O.estimatedTime?`${O.estimatedTime}h`:"Not set"})]}),j&&jsxRuntime.jsx("div",{className:"modal-v2-popover",children:jsxRuntime.jsx("input",{type:"number",min:"0",step:"0.5",placeholder:"Hours",value:O.estimatedTime||"",onChange:S=>Ye(S.target.value),className:"modal-v2-time-input",autoFocus:true,onBlur:()=>Le(false)})})]})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),jsxRuntime.jsx("h2",{children:"Description"}),jsxRuntime.jsxs("button",{className:"modal-v2-ai-button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),"AI Assist"]})]}),v?jsxRuntime.jsx("textarea",{className:"modal-v2-textarea",value:O.description||"",onChange:S=>{if(g){let G={...g,description:S.target.value};h(G);}},onBlur:Me,placeholder:"Add a detailed description...",autoFocus:true}):jsxRuntime.jsx("div",{className:"modal-v2-content",onClick:()=>m(true),children:O.description?jsxRuntime.jsx("div",{className:"modal-v2-markdown",children:qr(O.description)}):jsxRuntime.jsxs("p",{className:"modal-v2-placeholder",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsxRuntime.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Add description..."]})})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M9 11l3 3L22 4"}),jsxRuntime.jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),jsxRuntime.jsx("h2",{children:"Subtasks"}),k.length>0&&jsxRuntime.jsxs("span",{className:"modal-v2-count",children:[ue,"/",k.length]}),jsxRuntime.jsxs("button",{className:"modal-v2-add-button",onClick:()=>C(true),children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add"]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-subtasks",children:[k.map(S=>jsxRuntime.jsxs("div",{className:`modal-v2-subtask ${S.completed?"completed":""}`,children:[jsxRuntime.jsx("button",{className:"modal-v2-subtask-checkbox",onClick:()=>Nr(S.id),children:S.completed?jsxRuntime.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M9 12l2 2 4-4",stroke:"white",strokeWidth:"2",fill:"none"})]}):jsxRuntime.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"})})}),jsxRuntime.jsx("span",{className:"modal-v2-subtask-title",children:S.title}),jsxRuntime.jsx("button",{className:"modal-v2-subtask-delete",onClick:()=>he(S.id),children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]},S.id)),b&&jsxRuntime.jsx("div",{className:"modal-v2-subtask-input-row",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Subtask title...",value:T,onChange:S=>D(S.target.value),onKeyDown:S=>{S.key==="Enter"&&ut(),S.key==="Escape"&&(C(false),D(""));},onBlur:ut,autoFocus:true,className:"modal-v2-subtask-input"})})]})]}),jsxRuntime.jsxs("section",{className:"modal-v2-section",children:[jsxRuntime.jsxs("div",{className:"modal-v2-section-header",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsxRuntime.jsx("h2",{children:"Activity"}),jsxRuntime.jsxs("div",{className:"modal-v2-filters",children:[jsxRuntime.jsx("button",{className:`modal-v2-filter ${I==="all"?"active":""}`,onClick:()=>E("all"),children:"All"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${I==="comments"?"active":""}`,onClick:()=>E("comments"),children:"Comments"}),jsxRuntime.jsx("button",{className:`modal-v2-filter ${I==="history"?"active":""}`,onClick:()=>E("history"),children:"History"})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-input",children:[u&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:u.color},children:u.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-wrapper",children:[jsxRuntime.jsx("textarea",{ref:xe,className:"modal-v2-comment-textarea",placeholder:"Write a comment...",value:N,onChange:S=>P(S.target.value),onKeyDown:Yr,rows:1}),jsxRuntime.jsxs("div",{className:"modal-v2-comment-toolbar",children:[jsxRuntime.jsxs("div",{className:"modal-v2-toolbar-left",children:[jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Attach file",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Mention user",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"4"}),jsxRuntime.jsx("path",{d:"M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94"})]})}),jsxRuntime.jsx("button",{className:"modal-v2-toolbar-button",title:"Add emoji",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),jsxRuntime.jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),jsxRuntime.jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})})]}),jsxRuntime.jsx("button",{className:"modal-v2-send-button",onClick:de,disabled:!N.trim(),children:"Send"})]})]})]}),jsxRuntime.jsxs("div",{className:"modal-v2-timeline",children:[Dr.map(S=>{let G=o.find(we=>we.id===S.userId);if(S.type.includes("COMMENT")){let we=i.find(Ne=>Ne.id===S.metadata?.commentId);return we?jsxRuntime.jsxs("div",{className:"modal-v2-activity-item comment-item",children:[G&&jsxRuntime.jsx("div",{className:"modal-v2-avatar",style:{background:G.color},children:G.initials}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-activity-header",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:G?.name||"Unknown"}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(S.timestamp).toLocaleString()})]}),jsxRuntime.jsx("div",{className:"modal-v2-comment-body",children:we.content})]})]},S.id):null}return jsxRuntime.jsxs("div",{className:"modal-v2-activity-item history-item",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-icon",children:[S.type.includes("CREATED")&&"\u2795",S.type.includes("UPDATED")&&"\u270F\uFE0F",S.type.includes("MOVED")&&"\u27A1\uFE0F",S.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",S.type.includes("ASSIGNED")&&"\u{1F464}",S.type.includes("PRIORITY")&&"\u{1F3AF}",S.type.includes("LABEL")&&"\u{1F3F7}\uFE0F"]}),jsxRuntime.jsxs("div",{className:"modal-v2-activity-content",children:[jsxRuntime.jsxs("div",{className:"modal-v2-history-text",children:[jsxRuntime.jsx("span",{className:"modal-v2-activity-user",children:G?.name||"Unknown"})," ",S.type.replace(/_/g," ").toLowerCase(),S.newValue&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" to ",jsxRuntime.jsx("strong",{children:S.newValue})]})]}),jsxRuntime.jsx("span",{className:"modal-v2-activity-time",children:new Date(S.timestamp).toLocaleString()})]})]},S.id)}),Dr.length===0&&jsxRuntime.jsxs("div",{className:"modal-v2-empty",children:[jsxRuntime.jsx("p",{children:"No activity yet"}),jsxRuntime.jsx("span",{children:"Activity will appear here"})]})]})]})]})})})}function Ip({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.period}),t.map((r,a)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:r.color},children:[r.name,": ",jsxRuntime.jsx("strong",{children:r.value})," cards"]},a))]})}function Bo({data:e,title:t="Team Velocity",height:r=300,showAverage:a=true,showPlanned:n=true}){let o=e.map(i=>({...i,average:i.average??e.reduce((l,c)=>l+c.completed,0)/e.length}));return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:r,children:jsxRuntime.jsxs(recharts.LineChart,{data:o,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"period",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Ip,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"completed",stroke:"#10B981",strokeWidth:3,name:"Completed",dot:{fill:"#10B981",r:5},activeDot:{r:7}}),n&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"planned",stroke:"#3B82F6",strokeWidth:2,strokeDasharray:"5 5",name:"Planned",dot:{fill:"#3B82F6",r:4}}),a&&jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"average",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"3 3",name:"Average",dot:false})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Completed"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.reduce((i,l)=>i+l.completed,0)})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Average Velocity"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:(e.reduce((i,l)=>i+l.completed,0)/e.length).toFixed(1)})]}),n&&e.some(i=>i.planned)&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Planned"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:e.reduce((i,l)=>i+(l.planned||0),0)})]})]})]})}function Up({active:e,payload:t}){return !e||!t||!t.length?null:jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:t[0].payload.day}),t.map((r,a)=>jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:r.color},children:[r.name,": ",jsxRuntime.jsx("strong",{children:r.value})," tasks"]},a))]})}function Oo({data:e,title:t="Sprint Burndown",height:r=300,totalTasks:a,useArea:n=false}){let o=a??(e[0]?.ideal||e[0]?.remaining||0),i=e[e.length-1]?.remaining||0,l=e[e.length-1]?.ideal||0,c=o>0?(o-i)/o*100:0,s=i<=l;return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:r,children:jsxRuntime.jsxs(n?recharts.AreaChart:recharts.LineChart,{data:e,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"day",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(Up,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),n?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"ideal",stroke:"#F59E0B",fill:"rgba(245, 158, 11, 0.2)",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal"}),jsxRuntime.jsx(recharts.Area,{type:"monotone",dataKey:"remaining",stroke:s?"#10B981":"#EF4444",fill:s?"rgba(16, 185, 129, 0.2)":"rgba(239, 68, 68, 0.2)",strokeWidth:3,name:"Remaining"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(recharts.Line,{type:"linear",dataKey:"ideal",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal",dot:{fill:"#F59E0B",r:4}}),jsxRuntime.jsx(recharts.Line,{type:"monotone",dataKey:"remaining",stroke:s?"#10B981":"#EF4444",strokeWidth:3,name:"Remaining",dot:{fill:s?"#10B981":"#EF4444",r:5},activeDot:{r:7}})]})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Progress"}),jsxRuntime.jsxs("span",{className:"chart-stat-value",style:{color:c>=50?"#10B981":"#F59E0B"},children:[c.toFixed(0),"%"]})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Remaining"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:s?"#10B981":"#EF4444"},children:i})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Status"}),jsxRuntime.jsx("span",{className:"chart-stat-badge",style:{background:s?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:s?"#10B981":"#EF4444"},children:s?"\u2713 On Track":"\u26A0 Behind"})]})]})]})}var qp={URGENT:"#EF4444",HIGH:"#F59E0B",MEDIUM:"#3B82F6",LOW:"#10B981"},bl=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"];function Xp({cx:e,cy:t,midAngle:r,innerRadius:a,outerRadius:n,percent:o}){let i=a+(n-a)*.5,l=e+i*Math.cos(-r*(Math.PI/180)),c=t+i*Math.sin(-r*(Math.PI/180));return o<.05?null:jsxRuntime.jsx("text",{x:l,y:c,fill:"white",textAnchor:l>e?"start":"end",dominantBaseline:"central",style:{fontSize:"12px",fontWeight:600},children:`${(o*100).toFixed(0)}%`})}function yl({active:e,payload:t}){if(!e||!t||!t.length)return null;let r=t[0].payload,a=t[0].payload.totalValue||0,n=a>0?(r.value/a*100).toFixed(1):"0";return jsxRuntime.jsxs("div",{className:"chart-tooltip",children:[jsxRuntime.jsx("p",{className:"chart-tooltip-label",children:r.name}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:r.color||t[0].color},children:["Count: ",jsxRuntime.jsx("strong",{children:r.value})]}),jsxRuntime.jsxs("p",{className:"chart-tooltip-value",style:{color:"rgba(255, 255, 255, 0.7)"},children:["Percentage: ",jsxRuntime.jsxs("strong",{children:[n,"%"]})]})]})}function zo({data:e,title:t="Distribution",type:r="pie",height:a=300,showPercentages:n=true}){let o=e.reduce((c,s)=>c+s.value,0),i=e.map(c=>({...c,totalValue:o,color:c.color||qp[c.name]||bl[e.indexOf(c)%bl.length]})),l=i.map(c=>c.color);return jsxRuntime.jsxs("div",{className:"chart-container",children:[t&&jsxRuntime.jsx("h3",{className:"chart-title",children:t}),jsxRuntime.jsx(recharts.ResponsiveContainer,{width:"100%",height:a,children:r==="pie"?jsxRuntime.jsxs(recharts.PieChart,{children:[jsxRuntime.jsx(recharts.Pie,{data:i,cx:"50%",cy:"50%",labelLine:false,label:n?Xp:false,outerRadius:a*.35,fill:"#8884d8",dataKey:"value",children:i.map((c,s)=>jsxRuntime.jsx(recharts.Cell,{fill:l[s]},`cell-${s}`))}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(yl,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"},formatter:(c,s)=>{let u=s.payload,d=o>0?(u.value/o*100).toFixed(0):"0";return `${c} (${u.value} - ${d}%)`}})]}):jsxRuntime.jsxs(recharts.BarChart,{data:i,margin:{top:5,right:30,left:20,bottom:5},children:[jsxRuntime.jsx(recharts.CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"name",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsxRuntime.jsx(recharts.Tooltip,{content:jsxRuntime.jsx(yl,{})}),jsxRuntime.jsx(recharts.Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsxRuntime.jsx(recharts.Bar,{dataKey:"value",name:"Count",radius:[8,8,0,0],children:i.map((c,s)=>jsxRuntime.jsx(recharts.Cell,{fill:l[s]},`cell-${s}`))})]})}),jsxRuntime.jsxs("div",{className:"chart-stats",children:[jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Total Cards"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:o})]}),jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Categories"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.length})]}),e.length>0&&jsxRuntime.jsxs("div",{className:"chart-stat",children:[jsxRuntime.jsx("span",{className:"chart-stat-label",children:"Largest Category"}),jsxRuntime.jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:e.reduce((c,s)=>s.value>c.value?s:c).name})]})]})]})}var kn=ke.memo(({selectedCards:e,availableUsers:t=[],onClearSelection:r,callbacks:a,columns:n=[],availableLabels:o=[]})=>{let[i,l]=ke.useState(false),[c,s]=ke.useState(false),[u,d]=ke.useState(false),[f,p]=ke.useState(false);if(e.length===0)return null;let x=e.map(k=>k.id),y=k=>{a.onBulkUpdate?.(x,{priority:k}),l(false);},g=k=>{a.onBulkMove?.(x,k),s(false),r();},h=k=>{a.onBulkUpdate?.(x,{assignedUserIds:k}),d(false);},v=k=>{let w=new Set;e.forEach(C=>{C.labels?.forEach(T=>w.add(T));});let b=Array.from(new Set([...w,...k]));a.onBulkUpdate?.(x,{labels:b}),p(false);},m=()=>{confirm(`Delete ${e.length} card(s)? This cannot be undone.`)&&(a.onBulkDelete?.(x),r());};return jsxRuntime.jsx("div",{className:"asakaa-bulk-toolbar",children:jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-content",children:[jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-count",children:[e.length," card",e.length!==1?"s":""," selected"]}),jsxRuntime.jsxs("div",{className:"asakaa-bulk-toolbar-actions",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>l(!i),title:"Update priority",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Priority"})}),i&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:["LOW","MEDIUM","HIGH","URGENT"].map(k=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>y(k),children:[jsxRuntime.jsx("span",{className:ee("asakaa-priority-dot",k==="LOW"&&"bg-asakaa-priority-low",k==="MEDIUM"&&"bg-asakaa-priority-medium",k==="HIGH"&&"bg-asakaa-priority-high",k==="URGENT"&&"bg-asakaa-priority-urgent")}),k]},k))})]}),n.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>s(!c),title:"Move to column",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Move"})}),c&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:n.map(k=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>g(k.id),children:k.title},k.id))})]}),t.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>d(!u),title:"Assign users",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Assign"})}),u&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:t.map(k=>jsxRuntime.jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>h([k.id]),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:k.color},children:k.initials}),k.name]},k.id))})]}),o.length>0&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>p(!f),title:"Add labels",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Labels"})}),f&&jsxRuntime.jsx("div",{className:"asakaa-bulk-menu",children:o.map(k=>jsxRuntime.jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>v([k]),children:k},k))})]}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button asakaa-bulk-toolbar-button-danger",onClick:m,title:"Delete selected cards",children:jsxRuntime.jsx("span",{className:"text-sm",children:"Delete"})}),jsxRuntime.jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:r,title:"Clear selection",children:jsxRuntime.jsx("span",{className:"text-sm",children:"\u2715"})})]})]})})});kn.displayName="BulkOperationsToolbar";function tm(e,t,r){if(t==="none")return [];let a=new Map;return e.forEach(n=>{let o,i,l,c,s;switch(t){case "assignee":let u=n.assignedUserIds||(n.assigneeId?[n.assigneeId]:[]);u.length>0?u.forEach(p=>{let x=r?.find(y=>y.id===p);i=`assignee-${p}`,l=x?.name||`User ${p}`,c=x?.color,s=x?.avatar,a.has(i)||a.set(i,{id:i,title:l,groupValue:p,cardIds:[],color:c,icon:s}),a.get(i).cardIds.push(n.id);}):(i="assignee-unassigned",l="Unassigned",c="#6b7280",s="\u{1F464}",a.has(i)||a.set(i,{id:i,title:l,groupValue:null,cardIds:[],color:c,icon:s}),a.get(i).cardIds.push(n.id));break;case "priority":o=n.priority||"NONE",i=`priority-${o}`;let f={URGENT:{title:"\u{1F534} Urgent",color:"#ef4444"},HIGH:{title:"\u{1F7E0} High",color:"#f97316"},MEDIUM:{title:"\u{1F7E1} Medium",color:"#eab308"},LOW:{title:"\u{1F7E2} Low",color:"#22c55e"},NONE:{title:"\u26AA No Priority",color:"#6b7280"}}[o];l=f.title,c=f.color,a.has(i)||a.set(i,{id:i,title:l,groupValue:o,cardIds:[],color:c}),a.get(i).cardIds.push(n.id);break;case "label":n.labels&&n.labels.length>0?n.labels.forEach(p=>{i=`label-${p}`,l=p,c="#6b7280",a.has(i)||a.set(i,{id:i,title:l,groupValue:p,cardIds:[],color:c}),a.get(i).cardIds.push(n.id);}):(i="label-none",l="No Labels",c="#6b7280",a.has(i)||a.set(i,{id:i,title:l,groupValue:null,cardIds:[],color:c}),a.get(i).cardIds.push(n.id));break}}),Array.from(a.values()).sort((n,o)=>n.title.localeCompare(o.title))}function Ho({board:e,swimlaneConfig:t,availableUsers:r,callbacks:a,className:n}){let[o,i]=ke.useState(new Set),l=ke.useMemo(()=>tm(e.cards,t.groupBy,r),[e.cards,t.groupBy,r]),c=ke.useCallback(s=>{i(u=>{let d=new Set(u);return d.has(s)?d.delete(s):d.add(s),d});},[]);return t.groupBy==="none"||l.length===0?jsxRuntime.jsx(yr,{board:e,callbacks:a,availableUsers:r,className:n}):jsxRuntime.jsxs("div",{className:ee("asakaa-swimlane-view",n),children:[l.map(s=>{let u=o.has(s.id),d=e.cards.filter(p=>s.cardIds.includes(p.id)),f={...e,cards:d};return jsxRuntime.jsxs("div",{className:"asakaa-swimlane mb-6 rounded-lg border border-white/10 overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"asakaa-swimlane-header px-4 py-3 bg-white/5 backdrop-blur-sm flex items-center justify-between cursor-pointer hover:bg-white/10 transition-colors",onClick:()=>t.collapsible&&c(s.id),style:{borderLeft:s.color?`4px solid ${s.color}`:void 0},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[s.icon&&jsxRuntime.jsx("span",{className:"text-2xl leading-none",children:s.icon}),jsxRuntime.jsx("h3",{className:"text-lg font-semibold",style:{color:s.color},children:s.title}),jsxRuntime.jsxs("span",{className:"text-sm text-white/50 font-medium",children:["(",s.cardIds.length," ",s.cardIds.length===1?"card":"cards",")"]})]}),t.collapsible&&jsxRuntime.jsx("button",{className:"text-white/50 hover:text-white transition-colors","aria-label":u?"Expand lane":"Collapse lane",children:u?"\u25B6":"\u25BC"})]}),!u&&jsxRuntime.jsx("div",{className:"asakaa-swimlane-content p-4",children:jsxRuntime.jsx(yr,{board:f,callbacks:a,availableUsers:r})})]},s.id)}),l.length===0&&jsxRuntime.jsxs("div",{className:"text-center py-12 text-white/50",children:[jsxRuntime.jsx("p",{className:"text-lg",children:"No cards to display"}),jsxRuntime.jsx("p",{className:"text-sm mt-2",children:"Cards will appear here when they match the grouping criteria"})]})]})}var Uo=[{value:"none",label:"No Grouping",icon:"\u{1F4CB}",description:"Standard Kanban board view"},{value:"assignee",label:"By Assignee",icon:"\u{1F465}",description:"Group cards by assigned user"},{value:"priority",label:"By Priority",icon:"\u{1F3AF}",description:"Group cards by priority level"},{value:"label",label:"By Label",icon:"\u{1F3F7}\uFE0F",description:"Group cards by label/tag"}];function Go({value:e,onChange:t,className:r}){let[a,n]=ke.useState(false),o=ke.useRef(null),i=ke.useRef(null),l=Uo.find(s=>s.value===e)||Uo[0];ke.useEffect(()=>{function s(u){o.current&&!o.current.contains(u.target)&&i.current&&!i.current.contains(u.target)&&n(false);}if(a)return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[a]);let c=s=>{t(s),n(false);};return jsxRuntime.jsxs("div",{className:ee("relative inline-block",r),children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>n(!a),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-white/10 hover:bg-white/15 border border-white/20 transition-all text-sm font-medium text-white/90",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:l.icon}),jsxRuntime.jsx("span",{children:l.label}),jsxRuntime.jsx("svg",{className:ee("w-4 h-4 transition-transform",a&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxRuntime.jsxs("div",{ref:o,className:"absolute top-full left-0 mt-2 min-w-[280px] rounded-lg bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl border border-white/20 shadow-2xl z-50 overflow-hidden",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b border-white/10",children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold text-white/70 uppercase tracking-wider",children:"Group By"})}),jsxRuntime.jsx("div",{className:"py-1",children:Uo.map(s=>jsxRuntime.jsxs("button",{onClick:()=>c(s.value),className:ee("w-full px-3 py-2 flex items-start gap-3 text-left transition-all hover:bg-white/10",e===s.value&&"bg-white/5"),children:[jsxRuntime.jsx("span",{className:"text-xl leading-none mt-0.5",children:s.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"font-semibold text-sm text-white",children:s.label}),e===s.value&&jsxRuntime.jsx("span",{className:"text-blue-400 text-xs",children:"\u2713"})]}),jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-0.5",children:s.description})]})]},s.value))})]})]})}var Ia=[{keys:"ArrowUp",action:"navigate_up",description:"Navigate to card above"},{keys:"ArrowDown",action:"navigate_down",description:"Navigate to card below"},{keys:"ArrowLeft",action:"navigate_left",description:"Navigate to previous column"},{keys:"ArrowRight",action:"navigate_right",description:"Navigate to next column"},{keys:"Enter",action:"open_card",description:"Open selected card"},{keys:"Escape",action:"close_modal",description:"Close modal or dialog"},{keys:"Delete",action:"delete_card",description:"Delete selected card",modifiers:{shift:true}},{keys:"n",action:"new_card",description:"Create new card",modifiers:{ctrl:true}},{keys:"k",action:"search",description:"Open search/command palette",modifiers:{ctrl:true}},{keys:"s",action:"save",description:"Save changes",modifiers:{ctrl:true}},{keys:"z",action:"undo",description:"Undo last action",modifiers:{ctrl:true}},{keys:"y",action:"redo",description:"Redo last undone action",modifiers:{ctrl:true}},{keys:"a",action:"select_all",description:"Select all cards",modifiers:{ctrl:true}},{keys:"Escape",action:"deselect_all",description:"Deselect all cards"},{keys:"?",action:"show_shortcuts",description:"Show keyboard shortcuts help",modifiers:{shift:true}}];function nm(e,t){if(!(Array.isArray(t.keys)?t.keys:[t.keys]).some(s=>e.key===s||e.code===s))return false;let n=t.modifiers||{},o=n.ctrl?e.ctrlKey||e.metaKey:!e.ctrlKey&&!e.metaKey,i=n.shift?e.shiftKey:!e.shiftKey,l=n.alt?e.altKey:!e.altKey,c=n.meta?e.metaKey:true;return o&&i&&l&&c}function Tl(e={}){let{shortcuts:t=Ia,enabled:r=true,preventDefault:a=true}=e,n=ke.useRef(t),o=ke.useRef(r);ke.useEffect(()=>{n.current=t,o.current=r;},[t,r]);let i=ke.useCallback(c=>{n.current=[...n.current,c];},[]),l=ke.useCallback(c=>{n.current=n.current.filter(s=>s.action!==c);},[]);return ke.useEffect(()=>{function c(s){if(!o.current)return;let u=s.target;if(!((u.tagName==="INPUT"||u.tagName==="TEXTAREA"||u.isContentEditable)&&s.key!=="Escape"&&!s.ctrlKey&&!s.metaKey)){for(let d of n.current)if(nm(s,d)){a&&s.preventDefault();let f=new CustomEvent("keyboard-action",{detail:d.action,bubbles:true,cancelable:true});window.dispatchEvent(f);break}}}return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a]),{registerShortcut:i,unregisterShortcut:l,isEnabled:r}}function sm(e){return {ArrowUp:"\u2191",ArrowDown:"\u2193",ArrowLeft:"\u2190",ArrowRight:"\u2192",Enter:"\u21B5",Escape:"Esc",Delete:"Del"," ":"Space"}[e]||e.toUpperCase()}function im(e){let t=[],r=typeof navigator<"u"&&navigator.platform.includes("Mac");return e.modifiers?.ctrl&&t.push(r?"\u2318":"Ctrl"),e.modifiers?.shift&&t.push("Shift"),e.modifiers?.alt&&t.push(r?"\u2325":"Alt"),e.modifiers?.meta&&t.push("\u2318"),t.join(" + ")}function lm(e){let t=Array.isArray(e.keys)?e.keys[0]:e.keys,r=im(e),a=t?sm(t):"";return r?`${r} + ${a}`:a}function cm(e){let t={Navigation:[],Actions:[],Editing:[],Selection:[]};return e.forEach(r=>{r.action.includes("navigate")?t.Navigation?.push(r):r.action.includes("select")?t.Selection?.push(r):["undo","redo","save"].includes(r.action)?t.Editing?.push(r):t.Actions?.push(r);}),t}function _o({shortcuts:e=Ia,isOpen:t,onClose:r,className:a}){let[n,o]=ke.useState(false);if(ke.useEffect(()=>{o(true);},[]),ke.useEffect(()=>{function l(c){c.key==="Escape"&&t&&r();}if(t)return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,r]),!n||!t)return null;let i=cm(e);return jsxRuntime.jsxs("div",{className:ee("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-3xl w-full mx-4 max-h-[80vh] overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u2328\uFE0F"}),"Keyboard Shortcuts"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Speed up your workflow with these shortcuts"})]}),jsxRuntime.jsx("button",{onClick:r,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"px-6 py-6 overflow-y-auto max-h-[calc(80vh-120px)]",children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:Object.entries(i).map(([l,c])=>c.length===0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-semibold text-white/90 mb-4 flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"w-1 h-5 bg-blue-500 rounded-full"}),l]}),jsxRuntime.jsx("div",{className:"space-y-3",children:c.map(s=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-lg bg-white/5 hover:bg-white/10 transition-colors",children:[jsxRuntime.jsx("span",{className:"text-sm text-white/80",children:s.description}),jsxRuntime.jsx("kbd",{className:"px-3 py-1.5 bg-gradient-to-br from-gray-700 to-gray-800 border border-white/20 rounded-md text-xs font-mono text-white/90 shadow-lg whitespace-nowrap",children:lm(s)})]},s.action))})]},l))})}),jsxRuntime.jsx("div",{className:"px-6 py-4 border-t border-white/10 bg-white/5",children:jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center",children:["Press ",jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 bg-white/10 rounded text-white/70",children:"?"})," to toggle this help panel"]})})]})]})}var $o=[{id:"bug-report",name:"Bug Report",description:"Report a bug or issue",icon:"\u{1F41B}",category:"Development",template:{title:"[BUG] ",description:`**Steps to reproduce:**
|
|
6
6
|
1.
|
|
7
7
|
|
|
8
8
|
**Expected behavior:**
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
1.
|
|
43
43
|
|
|
44
44
|
**Action items:**
|
|
45
|
-
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function Wo({templates:e,onSelectTemplate:t,className:r}){let[a,n]=xe.useState(false),o=xe.useRef(null),i=xe.useRef(null);xe.useEffect(()=>{function s(u){o.current&&!o.current.contains(u.target)&&i.current&&!i.current.contains(u.target)&&n(false);}if(a)return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[a]);let l=s=>{t(s),n(false);},c=e.reduce((s,u)=>{let d=u.category||"Other";return s[d]||(s[d]=[]),s[d].push(u),s},{});return jsxRuntime.jsxs("div",{className:te("relative inline-block",r),children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>n(!a),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",s.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",s.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:te("w-4 h-4 transition-transform",a&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxRuntime.jsxs("div",{ref:o,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(c).map(([s,u])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:s})}),jsxRuntime.jsx("div",{children:u.map(d=>jsxRuntime.jsxs("button",{onClick:()=>l(d),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:d.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:d.name}),d.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:d.description})]})]},d.id))})]},s)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function Ko({board:e,isOpen:t,onClose:r,onImport:a,boardElementRef:n,className:o}){let[i,l]=xe.useState("export"),[c,s]=xe.useState("json"),[u,d]=xe.useState(null),f=xe.useRef(null);if(!t)return null;let p=async()=>{let y=n?.current||void 0,g=await qs(e,c,y);Xs(g,c);},x=async y=>{let g=y.target.files?.[0];if(g){try{let h=await Qs(g),v=g.name.endsWith(".json")?"json":"csv",m=Js(h,v);d(m),m.success&&a&&a(m,h);}catch(h){d({success:false,errors:[`Failed to read file: ${h instanceof Error?h.message:"Unknown error"}`]});}f.current&&(f.current.value="");}};return jsxRuntime.jsxs("div",{className:te("fixed inset-0 z-[9999] flex items-center justify-center",o),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:r,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>l("export"),className:te("flex-1 px-6 py-4 font-semibold transition-colors",i==="export"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>l("import"),className:te("flex-1 px-6 py-4 font-semibold transition-colors",i==="import"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[i==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(y=>jsxRuntime.jsxs("button",{onClick:()=>s(y),className:te("p-4 rounded-lg border-2 transition-all text-center",c===y?"border-blue-500 bg-blue-500/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[y==="json"&&"\u{1F4C4}",y==="csv"&&"\u{1F4CA}",y==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:y})]},y))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:p,className:"w-full py-3 px-4 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 text-white font-semibold rounded-lg transition-all shadow-lg shadow-blue-500/20",children:"Export Board"})]}),i==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:f,type:"file",accept:".json,.csv",onChange:x,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>f.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),u&&jsxRuntime.jsxs("div",{className:te("p-4 rounded-lg",u.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:te("font-semibold mb-2",u.success?"text-green-400":"text-red-400"),children:u.success?"\u2713 Import Successful":"\u2717 Import Failed"}),u.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",u.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",u.columnsImported]})]}),u.errors&&u.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:u.errors.map((y,g)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",y]},g))})]})]})]})]})]})}var mm=["URGENT","HIGH","MEDIUM","LOW"],fm=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],gm=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function jo({filters:e,sort:t,onFiltersChange:r,onSortChange:a,onReset:n,onFilterMyTasks:o,onFilterOverdue:i,onFilterHighPriority:l,availableUsers:c=[],availableLabels:s=[],availableColumns:u=[],showQuickFilters:d=true,compact:f=false,groupBy:p="none",onGroupByChange:x}){let[y,g]=xe.useState(true),h=xe.useCallback(b=>{r({search:b.target.value});},[r]),v=xe.useCallback(b=>{r({dateFilter:b.target.value});},[r]),m=xe.useCallback(b=>{a({by:b.target.value});},[a]),k=xe.useCallback(()=>{a({order:t.order==="asc"?"desc":"asc"});},[t.order,a]),w=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${f?"filter-bar--compact":""} ${y?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>g(!y),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:y?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:b=>{b.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:b=>{b.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:y?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),w&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!y&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[d&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),o&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),i&&jsxRuntime.jsx("button",{onClick:i,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),l&&jsxRuntime.jsx("button",{onClick:l,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:h,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:v,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:b=>{let T=b.target.value;r({priorities:T==="all"?[]:[T]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),mm.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]})}),c.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:b=>{let T=b.target.value;r({assignees:T==="all"?[]:[T]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),c.map(b=>jsxRuntime.jsx("option",{value:b.id,children:b.name},b.id))]})}),s.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:b=>{let T=b.target.value;r({labels:T==="all"?[]:[T]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),s.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:m,className:"filter-bar__select filter-bar__select--sm",children:fm.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:k,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),x&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:p,onChange:b=>x(b.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:gm.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))})}),w&&jsxRuntime.jsx("button",{onClick:n,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Yo({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:r,className:a,viewMode:n="kanban",onExportGanttPDF:o,onExportGanttExcel:i,onExportGanttPNG:l,onExportGanttCSV:c}){let[s,u]=xe.useState(false),d=xe.useRef(null);xe.useEffect(()=>{let p=x=>{d.current&&!d.current.contains(x.target)&&u(false);};return s&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p);}},[s]);let f=p=>{p(),u(false);};return jsxRuntime.jsxs("div",{className:te("relative",a),ref:d,children:[jsxRuntime.jsxs("button",{onClick:()=>u(!s),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",p.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",p.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":s,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),s&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[n==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>f(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await i?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await l?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>f(()=>c?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>f(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>f(r),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var qo={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Xo={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#2563EB",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Zo={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Hr={dark:qo,light:Xo,neutral:Zo},Tn="dark";var Sn=xe.createContext(void 0),Sm="asakaa-theme";function Dl({children:e,defaultTheme:t=Tn,storageKey:r=Sm}){let[a,n]=xe.useState(()=>{if(typeof window<"u"){let l=localStorage.getItem(r);if(l&&(l==="dark"||l==="light"||l==="neutral"))return l}return t}),o=xe.useCallback(l=>{n(l),typeof window<"u"&&localStorage.setItem(r,l);},[r]);xe.useEffect(()=>{if(typeof window>"u")return;let l=document.documentElement,c=Hr[a];Object.entries(c.colors).forEach(([u,d])=>{d&&l.style.setProperty(`--theme-${Nm(u)}`,d);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([u,d])=>{let f=c.colors[u];f&&l.style.setProperty(d,f);}),l.setAttribute("data-theme",a),l.classList.remove("theme-dark","theme-light","theme-neutral"),l.classList.add(`theme-${a}`);},[a]);let i={theme:a,setTheme:o,themes:Hr};return jsxRuntime.jsx(Sn.Provider,{value:i,children:e})}function ca(){let e=xe.useContext(Sn);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function Nm(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Jo({isOpen:e,onClose:t,className:r}){let{theme:a,setTheme:n}=ca();return e?jsxRuntime.jsxs("div",{className:te("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(Hr).map(([o,i])=>jsxRuntime.jsxs("button",{onClick:()=>{n(o),t();},className:te("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",a===o?"border-blue-500 bg-blue-500/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:a===o?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:i.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:i.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[o==="dark"&&"Default dark theme with Linear-inspired colors",o==="light"&&"Clean light theme with high contrast",o==="neutral"&&"Monochrome zen theme"]})]}),a===o&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},o))})]})]}):null}var fe={dark:{bgPrimary:"#1A1D21",bgSecondary:"#23272E",bgGrid:"#1E2228",bgWeekend:"rgba(139, 92, 246, 0.03)",border:"#2D3139",borderLight:"#26292F",textPrimary:"#F5F5F7",textSecondary:"#B4B9C5",textTertiary:"#7C8394",accent:"#8B5CF6",accentHover:"#9D72F8",accentLight:"rgba(139, 92, 246, 0.12)",taskBarPrimary:"#8B5CF6",taskBarProgress:"#7C3AED",taskBarHandle:"#FFFFFF",dependency:"rgba(180, 185, 197, 0.25)",dependencyHover:"rgba(180, 185, 197, 0.45)",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.12)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.1)",statusTodo:"#7C8394",statusInProgress:"#8B5CF6",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.05)",focusRing:"#8B5CF6"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F9FAFB",bgGrid:"#FCFCFD",bgWeekend:"rgba(37, 99, 235, 0.03)",border:"#E5E7EB",borderLight:"#F0F1F3",textPrimary:"#111827",textSecondary:"#4B5563",textTertiary:"#9CA3AF",accent:"#2563EB",accentHover:"#1D4ED8",accentLight:"rgba(37, 99, 235, 0.08)",taskBarPrimary:"#2563EB",taskBarProgress:"#1E40AF",taskBarHandle:"#FFFFFF",dependency:"rgba(75, 85, 99, 0.2)",dependencyHover:"rgba(75, 85, 99, 0.4)",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#2563EB",todayLight:"rgba(37, 99, 235, 0.08)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#9CA3AF",statusInProgress:"#2563EB",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.03)",focusRing:"#2563EB"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#FEFEFE",bgWeekend:"rgba(41, 37, 36, 0.025)",border:"#E7E5E4",borderLight:"#F0EFEE",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.06)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"rgba(87, 83, 78, 0.2)",dependencyHover:"rgba(87, 83, 78, 0.35)",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.04)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.06)",statusTodo:"#A8A29E",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.025)",focusRing:"#292524"}};function El(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return fe[e]||fe.dark;let t=document.documentElement,r=getComputedStyle(t),a=(o,i)=>r.getPropertyValue(o).trim()||i;return {bgPrimary:a("--theme-bg-primary",fe[e].bgPrimary),bgSecondary:a("--theme-bg-secondary",fe[e].bgSecondary),bgGrid:a("--theme-bg-card",fe[e].bgGrid),bgWeekend:a("--theme-bg-hover",fe[e].bgWeekend),border:a("--theme-border-primary",fe[e].border),borderLight:a("--theme-border-subtle",fe[e].borderLight),textPrimary:a("--theme-text-primary",fe[e].textPrimary),textSecondary:a("--theme-text-secondary",fe[e].textSecondary),textTertiary:a("--theme-text-tertiary",fe[e].textTertiary),accent:a("--theme-accent-primary",fe[e].accent),accentHover:a("--theme-accent-hover",fe[e].accentHover),accentLight:a("--theme-accent-primary",fe[e].accentLight),taskBarPrimary:a("--theme-accent-primary",fe[e].taskBarPrimary),taskBarProgress:a("--theme-accent-hover",fe[e].taskBarProgress),taskBarHandle:a("--theme-text-inverse",fe[e].taskBarHandle||"#FFFFFF"),dependency:a("--theme-border-secondary",fe[e].dependency),dependencyHover:a("--theme-border-secondary",fe[e].dependencyHover),criticalPath:a("--theme-error",fe[e].criticalPath),criticalPathLight:a("--theme-error",fe[e].criticalPathLight),today:e==="light"?a("--theme-accent-primary",fe[e].today):e==="neutral"?a("--theme-text-primary",fe[e].today):a("--theme-error",fe[e].today),todayLight:e==="light"?a("--theme-accent-primary",fe[e].todayLight):e==="neutral"?a("--theme-text-primary",fe[e].todayLight):a("--theme-error",fe[e].todayLight),milestone:a("--theme-warning",fe[e].milestone),milestoneLight:a("--theme-warning",fe[e].milestoneLight),statusTodo:a("--theme-text-tertiary",fe[e].statusTodo),statusInProgress:a("--theme-accent-primary",fe[e].statusInProgress),statusCompleted:a("--theme-success",fe[e].statusCompleted),hoverBg:a("--theme-bg-hover",fe[e].hoverBg),focusRing:a("--theme-accent-primary",fe[e].focusRing)}}function ts({options:e,value:t,onChange:r,theme:a}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`},children:e.map(n=>{let o=t===n.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>r(n.value),className:"relative px-3 py-1.5 rounded-md text-xs transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:o?a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500,zIndex:o?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[o&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"activeSegment",className:"absolute inset-0 rounded-md",style:{backgroundColor:a.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),n.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:n.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:n.label})]},n.value)})})}function Dn({theme:e,timeScale:t,onTimeScaleChange:r,zoom:a,onZoomChange:n,currentTheme:o,onThemeChange:i,rowDensity:l,onRowDensityChange:c,showThemeSelector:s=true}){let u=[{value:"day",label:"Day",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3.5 h-3.5"})},{value:"week",label:"Week",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3.5 h-3.5"})},{value:"month",label:"Month",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3.5 h-3.5"})}],d=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}],f=[{value:"compact",label:"Compact",icon:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-3.5 h-3.5"})},{value:"comfortable",label:"Comfortable",icon:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-3.5 h-3.5"})},{value:"spacious",label:"Spacious",icon:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-3.5 h-3.5"})}];return jsxRuntime.jsxs("div",{className:"h-14 px-6 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"View"}),jsxRuntime.jsx(ts,{options:u,value:t,onChange:p=>r(p),theme:e})]}),jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Zoom"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.max(.5,a-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.borderLight}`},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5",style:{color:e.textSecondary}})}),jsxRuntime.jsxs("div",{className:"px-3 py-1 rounded-md text-xs tabular-nums min-w-[50px] text-center",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.borderLight}`,color:e.textPrimary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[Math.round(a*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.min(2,a+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.borderLight}`},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5",style:{color:e.textSecondary}})})]})]}),jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Density"}),jsxRuntime.jsx(ts,{options:f,value:l,onChange:p=>c(p),theme:e})]})]}),s&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Theme"}),jsxRuntime.jsx(ts,{options:d,value:o,onChange:p=>i(p),theme:e})]})]})}function En({columns:e,onToggleColumn:t,theme:r}){let[a,n]=xe.useState(false),[o,i]=xe.useState({x:0,y:0}),l=xe.useRef(null),c=xe.useRef(null);xe.useEffect(()=>{if(!a)return;let u=d=>{l.current&&!l.current.contains(d.target)&&n(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);let s=e.filter(u=>u.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:c,onClick:()=>{if(!a&&c.current){let u=c.current.getBoundingClientRect();i({x:u.left,y:u.bottom+4});}n(!a);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`,color:r.textSecondary},whileHover:{backgroundColor:r.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:a&&jsxRuntime.jsx(Pe,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:l,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${o.x}px`,top:`${o.y}px`,backgroundColor:r.bgSecondary,border:`1px solid ${r.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),s.map(u=>jsxRuntime.jsxs("button",{onClick:()=>{t(u.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:r.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.hoverBg;},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:u.label}),u.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:r.accent}})]},u.id))]})})})})]})}function ua({isOpen:e,x:t,y:r,items:a,onClose:n,theme:o}){let i=xe.useRef(null);return xe.useEffect(()=>{if(!e)return;let l=s=>{i.current&&!i.current.contains(s.target)&&n();},c=s=>{s.key==="Escape"&&n();};return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c);}},[e,n]),e?jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:i,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg shadow-xl",style:{left:`${t}px`,top:`${r}px`,backgroundColor:o.bgSecondary,border:`1px solid ${o.border}`},children:jsxRuntime.jsx("div",{className:"py-1",children:a.map(l=>jsxRuntime.jsxs("div",{children:[l.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:o.borderLight}}),jsxRuntime.jsxs("button",{onClick:()=>{l.disabled||(l.onClick(),n());},disabled:l.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:l.disabled?o.textTertiary:o.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:l.disabled?"not-allowed":"pointer",opacity:l.disabled?.5:1},onMouseEnter:c=>{l.disabled||(c.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="transparent";},children:[l.icon&&jsxRuntime.jsx("span",{style:{color:o.textSecondary},children:l.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:l.label}),l.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:o.textTertiary}})]})]},l.id))})})}):null}var Et={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"})};function Al({tasks:e,selectedTaskIds:t,onTaskSelect:r,onTaskCreate:a,onTaskDelete:n,onTaskDuplicate:o,onTaskMove:i,onTaskIndent:l,onTaskOutdent:c,onTaskRename:s,onTaskToggleExpand:u,onOpenTaskModal:d,enableKeyboard:f=true}){let p=xe.useRef(false),x=xe.useCallback(m=>{p.current=m;},[]),y=xe.useCallback(m=>{let k=[],w=b=>{for(let T of b)k.push(T),T.subtasks&&T.subtasks.length>0&&T.isExpanded&&w(T.subtasks);};return w(m),k},[]),g=xe.useCallback(()=>{let m=y(e);for(let k of m)if(t.has(k.id))return k;return null},[e,t,y]),h=xe.useCallback((m,k)=>{let w=y(e);if(w.length===0)return;let b=g();if(!b){r(w[0].id,false);return}let T=w.findIndex(D=>D.id===b.id);if(T===-1)return;let C=m==="up"?T-1:T+1;if(C<0||C>=w.length)return;let N=w[C];r(N.id,k);},[e,g,y,r]),v=xe.useCallback(m=>{if(!f)return;let k=m.target;if(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable||p.current){m.key==="Escape"&&(k.blur(),p.current=false);return}let T=navigator.platform.toUpperCase().indexOf("MAC")>=0?m.metaKey:m.ctrlKey,C=Array.from(t),N=g();if(m.key==="ArrowUp"){m.preventDefault(),h("up",m.shiftKey);return}if(m.key==="ArrowDown"){m.preventDefault(),h("down",m.shiftKey);return}if(N&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){N.subtasks&&N.subtasks.length>0&&(m.preventDefault(),(m.key==="ArrowRight"&&!N.isExpanded||m.key==="ArrowLeft"&&N.isExpanded)&&u(N.id));return}if(m.altKey&&(m.key==="ArrowUp"||m.key==="ArrowDown")){C.length>0&&(m.preventDefault(),i(C,m.key==="ArrowUp"?"up":"down"));return}if(m.key==="Tab"&&!m.shiftKey){C.length>0&&(m.preventDefault(),l(C));return}if(m.key==="Tab"&&m.shiftKey){C.length>0&&(m.preventDefault(),c(C));return}if(m.key==="Enter"&&!m.shiftKey&&!T){N&&(m.preventDefault(),a(N.id,"below"));return}if(m.key==="Enter"&&m.shiftKey&&!T){N&&(m.preventDefault(),a(N.id,"above"));return}if(m.key==="Enter"&&T){N&&(m.preventDefault(),d(N.id));return}if(m.key==="F2"){N&&(m.preventDefault(),s(N.id));return}if(m.key==="Delete"||m.key==="Backspace"&&T){C.length>0&&(m.preventDefault(),n(C));return}if(m.key==="d"&&T&&!m.shiftKey){C.length>0&&(m.preventDefault(),o(C));return}},[f,t,g,h,a,n,o,i,l,c,s,u,d]);return xe.useEffect(()=>{if(f)return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v);}},[f,v]),{setIsEditing:x}}function Fl(){let[e,t]=xe.useState(new Set),[r,a]=xe.useState(null),n=xe.useCallback(d=>{t(new Set([d])),a(d);},[]),o=xe.useCallback(d=>{t(f=>{let p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p}),a(d);},[]),i=xe.useCallback((d,f)=>{if(!r){n(d);return}let p=f.indexOf(r),x=f.indexOf(d);if(p===-1||x===-1){n(d);return}let y=Math.min(p,x),g=Math.max(p,x),h=f.slice(y,g+1);t(new Set(h)),a(d);},[r,n]),l=xe.useCallback((d,f,p,x)=>{x?i(d,f):p?o(d):n(d);},[n,o,i]),c=xe.useCallback((d,f)=>{f?t(p=>{let x=new Set(p);return x.add(d),x}):n(d);},[n]),s=xe.useCallback(()=>{t(new Set),a(null);},[]),u=xe.useCallback(d=>e.has(d),[e]);return {selectedTaskIds:e,selectTask:n,toggleTaskSelection:o,selectTaskRange:i,handleTaskClick:l,handleKeyboardSelection:c,clearSelection:s,isTaskSelected:u}}function pa(e){let t=[],r=(a,n,o=0)=>{for(let i=0;i<a.length;i++){let l={...a[i],parentId:n,level:o,position:i};t.push(l),l.subtasks&&l.subtasks.length>0&&l.isExpanded&&r(l.subtasks,l.id,o+1);}};return r(e),t}function as(e,t){for(let r of e)if(r.subtasks){if(r.subtasks.some(n=>n.id===t))return r;let a=as(r.subtasks,t);if(a)return a}return null}function ns(e,t){if(t.length===0)return e;let r=pa(e),a=t[0],n=r.findIndex(d=>d.id===a);if(n<=0)return e;let o=r[n-1],i=(d,f)=>{let p=[];return {tasks:d.filter(y=>{if(f.has(y.id))return p.push(y),false;if(y.subtasks){let g=i(y.subtasks,f);y.subtasks=g.tasks,p.push(...g.removed);}return true}),removed:p}},l=(d,f,p)=>d.map(x=>x.id===f?{...x,subtasks:[...x.subtasks||[],...p],isExpanded:true}:x.subtasks?{...x,subtasks:l(x.subtasks,f,p)}:x),c=new Set(t),{tasks:s,removed:u}=i(e,c);return l(s,o.id,u)}function os(e,t){if(t.length===0)return e;let r=[...e];for(let a of t){let n=as(r,a);if(!n)continue;let o=as(r,n.id),i=(s,u,d)=>{for(let f=0;f<s.length;f++){let p=s[f];if(p.id===u&&p.subtasks){let x=p.subtasks.findIndex(y=>y.id===d);if(x!==-1){let[y]=p.subtasks.splice(x,1);return y}}if(p.subtasks){let x=i(p.subtasks,u,d);if(x)return x}}return null},l=(s,u,d)=>{let f=s.findIndex(p=>p.id===u);if(f!==-1)return s.splice(f+1,0,d),s;for(let p of s)p.subtasks&&l(p.subtasks,u,d);return s},c=i(r,n.id,a);c&&(o&&o.subtasks?l(o.subtasks,n.id,c):l(r,n.id,c));}return r}function ss(e,t,r){if(t.length===0)return e;let a=[...e],n=t[0],o=(i,l,c)=>{let s=i.findIndex(d=>d.id===l);if(s===-1){for(let d of i)if(d.subtasks&&o(d.subtasks,l,c))return true;return false}let u=c==="up"?s-1:s+1;return u<0||u>=i.length?false:([i[s],i[u]]=[i[u],i[s]],true)};return o(a,n,r),a}function is(e,t){let r=new Set(t),a=n=>n.filter(o=>!r.has(o.id)).map(o=>o.subtasks?{...o,subtasks:a(o.subtasks)}:o);return a(e)}function ls(e,t){let r=[...e];for(let a of t){let n=i=>{let l=i.findIndex(u=>u.id===a);if(l===-1){for(let u of i)if(u.subtasks&&n(u.subtasks))return true;return false}let c=i[l],s={...c,id:`${c.id}-copy-${Date.now()}`,name:`${c.name} (Copy)`,subtasks:c.subtasks?o(c.subtasks):void 0};return i.splice(l+1,0,s),true},o=i=>i.map(l=>({...l,id:`${l.id}-copy-${Date.now()}`,subtasks:l.subtasks?o(l.subtasks):void 0}));n(r);}return r}function Bl(e,t,r){let a=[...e],n=new Date,o=new Date(n);o.setDate(o.getDate()+7);let i={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:n,endDate:o,color:"#6366F1"},l=c=>{let s=c.findIndex(d=>d.id===t);if(s===-1){for(let d of c)if(d.subtasks&&l(d.subtasks))return true;return false}let u=r==="above"?s:s+1;return c.splice(u,0,i),true};return l(a),{tasks:a,newTask:i}}function cs(e,t,r){return e.map(a=>a.id===t?{...a,name:r}:a.subtasks?{...a,subtasks:cs(a.subtasks,t,r)}:a)}function ds(e,t){return e.map(r=>r.id===t?{...r,isExpanded:!r.isExpanded}:r.subtasks?{...r,subtasks:ds(r.subtasks,t)}:r)}function us(e,t){let r=new Date,a=new Date(r);a.setDate(a.getDate()+7);let n=c=>{for(let s of c){if(s.id===t)return s;if(s.subtasks){let u=n(s.subtasks);if(u)return u}}return null},o=n(e),i={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:r,endDate:a,color:o?.color||"#6366F1"},l=c=>c.map(s=>{if(s.id===t){let u=s.subtasks||[];return {...s,subtasks:[...u,i],isExpanded:true}}return s.subtasks?{...s,subtasks:l(s.subtasks)}:s});return {tasks:l(e),newTask:i}}var Hl={todo:{label:"To Do",color:"#94a3b8",icon:"circle"},"in-progress":{label:"In Progress",color:"#60a5fa",icon:"circle-dot"},completed:{label:"Completed",color:"#34d399",icon:"check-circle"}},Ul=({icon:e,color:t})=>e==="circle"?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"})}):e==="circle-dot"?jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3",fill:t})]}):jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:t,fillOpacity:"0.2"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});function Gl({status:e="todo",onChange:t,className:r}){let[a,n]=xe.useState(false),[o,i]=xe.useState({top:0,left:0}),l=xe.useRef(null),c=xe.useRef(null);xe.useEffect(()=>{if(a&&c.current){let f=c.current.getBoundingClientRect();i({top:f.bottom+window.scrollY+8,left:f.left+window.scrollX});}},[a]),xe.useEffect(()=>{let f=p=>{l.current&&!l.current.contains(p.target)&&!c.current?.contains(p.target)&&n(false);};if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a]),xe.useEffect(()=>{let f=p=>{p.key==="Escape"&&n(false);};if(a)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]);let s=f=>{t(f),n(false);},u=Hl[e],d=u.color;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:c,onClick:()=>n(!a),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:`${d}10`,boxShadow:`0 0 0 2px ${d}30 inset`},title:u.label,children:jsxRuntime.jsx(Ul,{icon:u.icon,color:d})}),a&&jsxRuntime.jsx(Pe,{children:jsxRuntime.jsxs("div",{ref:l,className:"status-selector-menu",style:{position:"absolute",top:`${o.top}px`,left:`${o.left}px`,zIndex:99999,minWidth:"180px",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Status"})}),jsxRuntime.jsx("div",{className:"py-1",children:Object.entries(Hl).map(([f,p])=>jsxRuntime.jsxs("button",{onClick:()=>s(f),className:"w-full px-3 py-2 flex items-center gap-2.5 text-sm font-medium transition-all active:scale-[0.98] status-option",style:{color:p.color,background:"transparent"},onMouseEnter:x=>{x.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:x=>{x.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(Ul,{icon:p.icon,color:p.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:p.label}),e===f&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},f))})]})})]})}function Rn({tasks:e,theme:t,rowHeight:r,availableUsers:a=[],templates:n,onTaskClick:o,onTaskDblClick:i,onTaskContextMenu:l,onTaskToggle:c,scrollTop:s,columns:u,onToggleColumn:d,onTaskUpdate:f,onTaskIndent:p,onTaskOutdent:x,onTaskMove:y,onMultiTaskDelete:g,onTaskDuplicate:h,onTaskCreate:v,onTaskRename:m,onCreateSubtask:k,onOpenTaskModal:w}){let[b,T]=xe.useState(null),[C,N]=xe.useState(false),[D,E]=xe.useState(null),[I,R]=xe.useState(""),F=xe.useRef(null),O=xe.useRef(null),[U,J]=xe.useState({isOpen:false,x:0,y:0,type:"header"});xe.useEffect(()=>{function _(H){F.current&&!F.current.contains(H.target)&&N(false);}if(C)return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[C]),xe.useEffect(()=>{D&&O.current&&(O.current.focus(),O.current.select());},[D]);let{selectedTaskIds:j,handleTaskClick:ae,isTaskSelected:Ie}=Fl(),{setIsEditing:re}=Al({tasks:e,selectedTaskIds:j,onTaskSelect:(_,H)=>{let He=pa(e).map(Fe=>Fe.id);ae(_,He,H||false,false);},onTaskCreate:v||(()=>{}),onTaskDelete:g||(()=>{}),onTaskDuplicate:h||(()=>{}),onTaskMove:y||(()=>{}),onTaskIndent:p||(()=>{}),onTaskOutdent:x||(()=>{}),onTaskRename:_=>{let H=pa(e).find(Le=>Le.id===_);H&&et(H);},onTaskToggleExpand:c||(()=>{}),onOpenTaskModal:_=>{let H=pa(e).find(Le=>Le.id===_);H&&w&&w(H);},enableKeyboard:true}),Te=(_,H=0)=>{let Le=[];for(let He of _)Le.push({task:He,level:H}),He.subtasks&&He.subtasks.length>0&&He.isExpanded&&Le.push(...Te(He.subtasks,H+1));return Le},M=Te(e),Q=48,Ae=_=>!_.startDate||!_.endDate?"-":`${Math.ceil((_.endDate.getTime()-_.startDate.getTime())/(1e3*60*60*24))}d`,et=_=>{E(_.id),R(_.name),re(true);},Jt=_=>{I.trim()&&I!==e.find(H=>H.id===_)?.name&&m?.(_,I.trim()),E(null),R(""),re(false);},K=()=>{E(null),R(""),re(false);},ne=(_,H)=>{H.stopPropagation(),k?.(_.id);},Rt=(_,H,Le)=>{switch(_.id){case "name":let He=D===H.id,Fe=b===H.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${Le*24}px`},children:[H.subtasks&&H.subtasks.length>0&&jsxRuntime.jsx("button",{onClick:ie=>{ie.stopPropagation(),c?.(H.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:H.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}),jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 border",style:{backgroundColor:H.color||"#6366F1",opacity:H.parentId?.6:1,borderColor:H.isMilestone?t.accent:"transparent",borderWidth:H.isMilestone?"2px":"0px"},title:H.isMilestone?"Milestone":H.parentId?"Subtask":"Task"}),He?jsxRuntime.jsx("input",{ref:O,type:"text",value:I,onChange:ie=>R(ie.target.value),onKeyDown:ie=>{ie.key==="Enter"?Jt(H.id):ie.key==="Escape"&&K();},onBlur:()=>Jt(H.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:ie=>ie.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate flex-1",style:{color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:Le===0?"14px":Le===1?"13px":"12px",fontWeight:H.isMilestone?600:H.subtasks&&H.subtasks.length>0?500:400,opacity:Le===0?1:Le===1?.95:.88},children:H.name}),Fe&&!He&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:ie=>ie.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:ie=>ne(H,ie),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:ie=>{ie.stopPropagation(),et(H);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":return jsxRuntime.jsx("div",{onClick:ie=>ie.stopPropagation(),children:jsxRuntime.jsx(Xa,{startDate:H.startDate?typeof H.startDate=="string"?H.startDate:H.startDate.toISOString().split("T")[0]:void 0,endDate:H.endDate?typeof H.endDate=="string"?H.endDate:H.endDate.toISOString().split("T")[0]:void 0,onChange:(ie,ct)=>{f?.(H.id,{startDate:ie?new Date(ie):void 0,endDate:ct?new Date(ct):void 0});}})});case "duration":return jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:Ae(H)});case "assignees":let Ct=a.filter(ie=>H.assignees?.some(ct=>ct.name===ie.name||ct.initials===ie.initials));return jsxRuntime.jsx("div",{onClick:ie=>ie.stopPropagation(),children:jsxRuntime.jsx(Za,{assignedUsers:Ct,availableUsers:a,onChange:ie=>{let ct=ie.map(Re=>({name:Re.name,initials:Re.initials,color:Re.color}));f?.(H.id,{assignees:ct.length>0?ct:void 0});}})});case "status":return jsxRuntime.jsx("div",{onClick:ie=>ie.stopPropagation(),children:jsxRuntime.jsx(Gl,{status:H.status||"todo",onChange:ie=>{f?.(H.id,{status:ie,progress:ie==="completed"?100:H.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${H.progress}%`,backgroundColor:H.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[H.progress,"%"]})]});default:return null}},Lt=_=>[{id:"hide",label:"Hide Column",icon:Et.Hide,onClick:()=>d(_),disabled:_==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:Et.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:Et.SortDesc,onClick:()=>{}}],Ut=_=>[{id:"edit",label:"Edit Task",icon:Et.Edit,onClick:()=>{}},{id:"addSubtask",label:"Add Subtask",icon:Et.Add,onClick:()=>{}},{id:"addDependency",label:"Add Dependency",icon:Et.Link,onClick:()=>{}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markComplete",label:_.status==="completed"?"Mark Incomplete":"Mark Complete",icon:Et.Progress,onClick:()=>{let H=_.status==="completed"?"in-progress":"completed",Le=_.status==="completed"?_.progress:100;f?.(_.id,{status:H,progress:Le});}},{id:"setInProgress",label:"Set In Progress",icon:Et.Progress,onClick:()=>{f?.(_.id,{status:"in-progress"});},disabled:_.status==="in-progress"},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"delete",label:"Delete Task",icon:Et.Delete,onClick:()=>{window.confirm(`Delete task "${_.name}"?`)&&g?.([_.id]);}}],Gt=u.filter(_=>_.visible);return jsxRuntime.jsxs("div",{className:"h-full overflow-auto",style:{backgroundColor:t.bgPrimary,borderRight:`1px solid ${t.border}`},children:[jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center border-b",style:{backgroundColor:t.bgGrid,borderColor:t.border,height:`${Q}px`},children:[Gt.map(_=>jsxRuntime.jsx("div",{className:"flex items-center px-4 border-r cursor-pointer hover:bg-opacity-50 transition-colors relative",style:{width:`${_.width}px`,borderColor:t.borderLight,height:"100%"},onContextMenu:H=>{H.preventDefault(),J({isOpen:true,x:H.clientX,y:H.clientY,type:"header",columnId:_.id});},onMouseEnter:H=>{H.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:H=>{H.currentTarget.style.backgroundColor="transparent";},children:jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:_.label})},_.id)),jsxRuntime.jsxs("div",{className:"px-3 flex items-center gap-2 h-full",children:[jsxRuntime.jsx(En,{columns:u,onToggleColumn:d,theme:t}),jsxRuntime.jsxs("button",{onClick:()=>N(!C),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors relative group",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:[jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"}),C&&jsxRuntime.jsxs("div",{ref:F,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:_=>_.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>N(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]})]}),M.map(({task:_,level:H},Le)=>{let He=Ie(_.id);return jsxRuntime.jsx(framerMotion.motion.div,{className:"flex items-center border-b cursor-pointer group",style:{height:`${r}px`,borderTop:`1px solid ${He?t.accent:t.borderLight}`,borderRight:`1px solid ${He?t.accent:t.borderLight}`,borderBottom:`1px solid ${He?t.accent:t.borderLight}`,borderLeft:He?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:He?t.accentLight:Le%2===0?t.bgPrimary:t.bgGrid},onMouseEnter:()=>T(_.id),onMouseLeave:()=>T(null),onClick:Fe=>{let ie=pa(e).map(Qt=>Qt.id),Re=navigator.platform.toUpperCase().indexOf("MAC")>=0?Fe.metaKey:Fe.ctrlKey;ae(_.id,ie,Re,Fe.shiftKey),o?.(_);},onDoubleClick:Fe=>{Fe.stopPropagation(),i?.(_);},onContextMenu:Fe=>{Fe.preventDefault(),J({isOpen:true,x:Fe.clientX,y:Fe.clientY,type:"task",task:_}),l?.(_,Fe);},whileHover:{backgroundColor:He?t.accentLight:t.hoverBg},children:Gt.map(Fe=>jsxRuntime.jsx("div",{className:"px-4 border-r flex items-center",style:{width:`${Fe.width}px`,borderColor:b===_.id?t.border:t.borderLight,height:"100%"},children:Rt(Fe,_,Fe.id==="name"?H:0)},`${_.id}-${Fe.id}`))},_.id)}),jsxRuntime.jsx(ua,{isOpen:U.isOpen,x:U.x,y:U.y,items:U.type==="header"&&U.columnId?Lt(U.columnId):U.type==="task"&&U.task?Ut(U.task):[],onClose:()=>J({...U,isOpen:false}),theme:t})]})}function Wl(e,t){let[r,a]=xe.useState("none"),[n,o]=xe.useState(0),[i,l]=xe.useState(e),[c,s]=xe.useState(t),[u,d]=xe.useState(null),[f,p]=xe.useState(null),[x,y]=xe.useState(null),[g,h]=xe.useState(null),[v,m]=xe.useState(0),[k,w]=xe.useState(0),[b,T]=xe.useState(null),[C,N]=xe.useState(false);return {dragMode:r,setDragMode:a,dragOffset:n,setDragOffset:o,ghostX:i,setGhostX:l,ghostWidth:c,setGhostWidth:s,connectionLine:u,setConnectionLine:d,hoveredTaskId:f,setHoveredTaskId:p,activeZone:x,setActiveZone:y,draggedSegmentIndex:g,setDraggedSegmentIndex:h,draggedSegmentStartX:v,setDraggedSegmentStartX:m,segmentDragOffsetX:k,setSegmentDragOffsetX:w,hoveredSegmentIndex:b,setHoveredSegmentIndex:T,isHovered:C,setIsHovered:N,isDragging:r!=="none",isResizing:r==="resize-start"||r==="resize-end",isConnecting:r==="connect",resetDragState:(F,O)=>{a("none"),d(null),p(null),l(F),s(O),w(0),h(null),m(0);}}}function Pn({task:e,x:t,y:r,width:a,theme:n,dayWidth:o,startDate:i,templates:l,onClick:c,onDoubleClick:s,onContextMenu:u,onDateChange:d,onDependencyCreate:f,allTaskPositions:p=[]}){let x=Wl(t,a),y=xe.useRef(null),{dragMode:g,setDragMode:h,dragOffset:v,setDragOffset:m,ghostX:k,setGhostX:w,ghostWidth:b,setGhostWidth:T,connectionLine:C,setConnectionLine:N,hoveredTaskId:D,setHoveredTaskId:E,activeZone:I,setActiveZone:R,draggedSegmentIndex:F,setDraggedSegmentIndex:O,draggedSegmentStartX:U,setDraggedSegmentStartX:J,segmentDragOffsetX:j,setSegmentDragOffsetX:ae,hoveredSegmentIndex:Ie,setHoveredSegmentIndex:re,isHovered:Te,setIsHovered:M,isDragging:Q,isResizing:Ae,isConnecting:et,resetDragState:Jt}=x,K=32,ne=8,Rt=e.endDate&&e.endDate<new Date&&e.progress<100,Lt=e.isCriticalPath,Ut=n.name==="neutral"||n.today==="#1C1917",_=(z=>z>=80?20:z>=60?15:z>=50?12:10)(a),H=a<50,Le=a<40,He=z=>z.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Fe=()=>{let z=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${z} day${z!==1?"s":""}`},Ct=z=>Math.round(z/o)*o,ie=z=>{let he=Math.round(z/o),de=new Date(i);return de.setDate(de.getDate()+he),de},ct=(z,he)=>{for(let de of p){if(de.id===e.id)continue;let S=5;if(z>=de.x-S&&z<=de.x+de.width+S&&he>=de.y-S&&he<=de.y+de.height+S)return de.id}return null},Re=xe.useCallback((z,he,de)=>{z.preventDefault(),z.stopPropagation();let S=y.current?.ownerSVGElement;if(!S)return;let G=S.createSVGPoint();G.x=z.clientX,G.y=z.clientY;let ue=G.matrixTransform(S.getScreenCTM()?.inverse()),ke=de!==void 0?de:t,Se=he;if(!Se){let Pt=ue.x-ke;z.shiftKey?(Se="connect",N({x:t+a,y:r+K/2})):z.ctrlKey||z.metaKey?Se="move":z.altKey?Se=Pt<a/2?"resize-start":"resize-end":Le?Pt<a/2?Se="move":Se="resize-end":H?Pt<=_/2?Se="resize-start":Pt>=a-_/2?Se="resize-end":Se="move":Pt<=_?Se="resize-start":Pt>=a-_?Se="resize-end":Se="move";}h(Se),M(false),R(null),Se==="move"?m(ue.x-ke):Se==="connect"?N({x:t+a,y:r+K/2}):m(0),w(ke),T(a);},[t,a,r,K]),Qt=xe.useCallback(z=>{if(g==="none")return;let he=y.current?.ownerSVGElement;if(!he)return;let de=he.createSVGPoint();de.x=z.clientX,de.y=z.clientY;let S=de.matrixTransform(he.getScreenCTM()?.inverse());if(g==="connect"){N({x:S.x,y:S.y});let G=ct(S.x,S.y);E(G);}else if(g==="move"){let G=S.x-v,ue=Ct(G);if(w(ue),T(a),e.segments&&e.segments.length>0&&F!==null){let ke=ue-U;ae(ke);}}else if(g==="resize-start"){let G=S.x,ue=Ct(G),ke=t+a-ue;ke>=o&&(w(ue),T(ke));}else if(g==="resize-end"){let G=S.x,ke=Ct(G)-t;ke>=o&&T(ke);}},[g,t,a,o,v,e,Ct,F,U,ct,E,N,w,T,ae]),Nr=xe.useCallback(()=>{if(g!=="none"){if(g==="connect")D&&f&&f(e,D),N(null),E(null);else {let z=e.endDate.getTime()-e.startDate.getTime(),he,de,S=true;if(g==="move"){if(he=ie(k),de=new Date(he.getTime()+z),e.segments&&e.segments.length>0&&F!==null){let G=Math.round(j/o),ue=e.segments.map((Ft,Wa)=>{if(Wa===F){let Xr=new Date(Ft.startDate),ga=new Date(Ft.endDate);return Xr.setDate(Xr.getDate()+G),ga.setDate(ga.getDate()+G),{startDate:Xr,endDate:ga}}return Ft}),ke=ue.flatMap(Ft=>[Ft.startDate,Ft.endDate]),Se=new Date(Math.min(...ke.map(Ft=>Ft.getTime()))),Pt=new Date(Math.max(...ke.map(Ft=>Ft.getTime())));d?.({...e,segments:ue},Se,Pt),Jt(t,a);return}}else g==="resize-start"?(he=ie(k),de=e.endDate,he>=de&&(console.warn("Invalid date range: start date must be before end date"),S=false)):g==="resize-end"?(he=e.startDate,de=ie(k+b),de<=he&&(console.warn("Invalid date range: end date must be after start date"),S=false)):S=false;S&&he&&de&&(de.getTime()-he.getTime()<864e5?console.warn("Invalid date range: task must be at least 1 day long"):d?.(e,he,de));}Jt(t,a);}},[g,k,b,e,d,D,f,t,a,o,ie,j,F,Jt]);xe.useEffect(()=>{if(g==="none")return;let z=de=>{Qt(de);},he=()=>{Nr();};return window.addEventListener("mousemove",z),window.addEventListener("mouseup",he),()=>{window.removeEventListener("mousemove",z),window.removeEventListener("mouseup",he);}},[g,Qt,Nr]);let me=Q&&!et?k:t,ge=Q&&!et?b:a,Yr=l.taskTooltip(e),Dr=typeof Yr=="string"?Yr:"",qr=l.taskClass(e);return jsxRuntime.jsxs("g",{ref:y,onMouseEnter:()=>!Q&&M(true),onMouseLeave:()=>{Q||(M(false),R(null));},onClick:()=>!Q&&c?.(e),onDoubleClick:z=>{Q||(z.stopPropagation(),s?.(e));},onContextMenu:z=>{z.preventDefault(),u?.(e,z);},children:[Dr&&jsxRuntime.jsx("title",{dangerouslySetInnerHTML:{__html:Dr}}),Te&&!Q&&!H&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:r,width:_,height:K,fill:I==="resize-start"?n.accent:"transparent",opacity:I==="resize-start"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>R("resize-start"),onMouseDown:z=>Re(z,"resize-start")}),jsxRuntime.jsx("rect",{x:t+_,y:r,width:a-_*2,height:K,fill:I==="move"?n.accent:"transparent",opacity:I==="move"?.1:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>R("move"),onMouseDown:z=>Re(z,"move")}),jsxRuntime.jsx("rect",{x:t+a-_,y:r,width:_,height:K,fill:I==="resize-end"?n.accent:"transparent",opacity:I==="resize-end"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>R("resize-end"),onMouseDown:z=>Re(z,"resize-end")})]}),Te&&!Q&&Le&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:r,width:a/2,height:K,fill:I==="move"?n.accent:"transparent",opacity:I==="move"?.2:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>R("move"),onMouseDown:z=>Re(z,"move")}),jsxRuntime.jsx("rect",{x:t+a/2,y:r,width:a/2,height:K,fill:I==="resize-end"?n.accent:"transparent",opacity:I==="resize-end"?.2:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>R("resize-end"),onMouseDown:z=>Re(z,"resize-end")}),Te&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+a/2,y1:r+4,x2:t+a/2,y2:r+K-4,stroke:n.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),Q&&!et&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:k,y:r,width:b,height:K,rx:ne,fill:e.isCriticalPath?"#DC2626":n.taskBarPrimary,opacity:.3,stroke:e.isCriticalPath?"#EF4444":n.accent,strokeWidth:2,strokeDasharray:"4 4",initial:{opacity:0},animate:{opacity:.5},transition:{duration:.15},style:{pointerEvents:"none"}}),!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:me,y:r,width:ge,height:K,rx:ne,fill:e.isCriticalPath?"#DC2626":e.color?e.color:n.taskBarPrimary,"data-task-class":qr,initial:{opacity:0,scale:.95},animate:{opacity:Q&&!et?.15:e.parentId?.6:Te?.9:.8,scale:Te&&!Q?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:z=>Re(z),style:{cursor:Q?et?"crosshair":Ae?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),!e.segments&&jsxRuntime.jsx("rect",{x:me,y:r,width:ge*(e.progress/100),height:K,rx:ne,fill:n.taskBarProgress,opacity:1,style:{pointerEvents:"none"}}),e.segments&&e.segments.map((z,he)=>{let de=(z.startDate.getTime()-i.getTime())/864e5*o,G=(z.endDate.getTime()-i.getTime())/(1e3*60*60*24)*o-de+o,ue=Q&&g==="move"&&F===he,ke=Ie===he,Se=ue?de+j:de;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!Q&&re(he),onMouseLeave:()=>!Q&&re(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:Se,y:r,width:G,height:K,rx:ne,fill:e.isCriticalPath?"#DC2626":e.color?e.color:n.taskBarPrimary,initial:{opacity:0,scale:.95},animate:{opacity:ue||e.parentId?.6:ke?.9:.8,scale:ke&&!Q?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Pt=>{Pt.stopPropagation(),O(he),J(de),Re(Pt,void 0,de);},style:{cursor:Q?et?"crosshair":Ae?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:Se,y:r,width:G*(e.progress/100),height:K,rx:ne,fill:n.taskBarProgress,opacity:1,style:{pointerEvents:"none"}})]},`segment-${he}`)}),Ut&&(Rt||Lt)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Lt&&!Rt&&jsxRuntime.jsx("rect",{x:me,y:r,width:ge,height:K,rx:ne,fill:"none",stroke:n.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),Rt&&jsxRuntime.jsx("rect",{x:me,y:r,width:ge,height:K,rx:ne,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),ge>60&&!e.segments&&(()=>{let z=l.taskLabel(e),he=typeof z=="string"?z:e.name,de=he.length>Math.floor(ge/8)?`${he.substring(0,Math.floor(ge/8))}...`:he;return jsxRuntime.jsx("text",{x:me+12,y:r+K/2,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"13",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:de})})(),ge>100&&e.progress>0&&e.progress<100&&!Q&&!e.segments&&jsxRuntime.jsxs("text",{x:me+ge-12,y:r+K/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}),e.status&&ge>80&&!Q&&!e.segments&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:me+ge-8,cy:r+8,r:4,fill:n.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:me+ge-8,cy:r+8,r:4,fill:n.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(Te||Ae)&&!et&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{style:{pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{x:H?me-15:me-10,y:r-5,width:H?25:20,height:K+10,fill:"transparent",onMouseDown:z=>Re(z,"resize-start"),style:{cursor:"ew-resize"}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H?me-8:me-3,y:r+6,width:H?8:6,height:H?K-12:K-16,rx:3,fill:g==="resize-start"?n.accent:n.taskBarHandle,stroke:n.taskBarPrimary,strokeWidth:1.5,initial:{opacity:0,scale:0},animate:{opacity:1,scale:g==="resize-start"?1.2:1},transition:{duration:.2,type:"spring",stiffness:400,damping:25},style:{pointerEvents:"none"}})]}),jsxRuntime.jsxs("g",{style:{pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{x:me+ge-10,y:r-5,width:H?25:20,height:K+10,fill:"transparent",onMouseDown:z=>Re(z,"resize-end"),style:{cursor:"ew-resize"}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H?me+ge:me+ge-3,y:r+6,width:H?8:6,height:H?K-12:K-16,rx:3,fill:g==="resize-end"?n.accent:n.taskBarHandle,stroke:n.taskBarPrimary,strokeWidth:1.5,initial:{opacity:0,scale:0},animate:{opacity:1,scale:g==="resize-end"?1.2:1},transition:{duration:.2,type:"spring",stiffness:400,damping:25},style:{pointerEvents:"none"}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Te&&!Q&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{style:{pointerEvents:"all"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+a+8,cy:r+K/2,r:6,fill:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{duration:.2,type:"spring",stiffness:400,damping:25},onMouseDown:z=>{z.stopPropagation(),Re(z,"connect");},style:{cursor:"crosshair"}}),jsxRuntime.jsx("text",{x:t+a+20,y:r+K/2,dominantBaseline:"middle",fill:n.textTertiary,fontSize:"10",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:"Link"})]})}),et&&C&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:t+a,y1:r+K/2,x2:C.x,y2:C.y,stroke:D?n.statusCompleted:n.accent,strokeWidth:D?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:D?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:C.x,cy:C.y,r:D?8:6,fill:D?n.statusCompleted:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),D&&jsxRuntime.jsx(framerMotion.motion.text,{x:C.x+15,y:C.y,dominantBaseline:"middle",fill:n.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:C.x+10},animate:{opacity:1,x:C.x+15},transition:{duration:.2},children:"Connect"})]}),(Te||Q)&&!et&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:me-2,y:r-2,width:ge+4,height:K+4,rx:ne+2,fill:"none",stroke:Q?n.accent:n.taskBarPrimary,strokeWidth:2,opacity:Q?.6:.4,initial:{opacity:0},animate:{opacity:Q?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),Ae&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:k,y1:0,x2:k,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:k+b,y1:0,x2:k+b,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Te&&!Q&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:me+ge/2-120,y:r-95,width:240,height:82,rx:8,fill:n.bgSecondary,stroke:n.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("path",{d:`M ${me+ge/2-6} ${r-13} L ${me+ge/2} ${r-3} L ${me+ge/2+6} ${r-13}`,fill:n.bgSecondary,stroke:n.border,strokeWidth:1}),jsxRuntime.jsx("text",{x:me+ge/2,y:r-73,textAnchor:"middle",fill:n.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:me+ge/2-110,y:r-55,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:me+ge/2-70,y:r-55,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:He(e.startDate)}),jsxRuntime.jsx("text",{x:me+ge/2-110,y:r-40,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:me+ge/2-70,y:r-40,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:He(e.endDate)}),jsxRuntime.jsx("text",{x:me+ge/2+10,y:r-55,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:me+ge/2+65,y:r-55,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Fe()}),jsxRuntime.jsx("text",{x:me+ge/2+10,y:r-40,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:me+ge/2+65,y:r-40,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:me+ge/2-110,y:r-25,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:me+ge/2-50,y:r-25,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(z=>z.name).join(", ").substring(0,30),e.assignees.map(z=>z.name).join(", ").length>30?"...":""]})]}),jsxRuntime.jsx("text",{x:me+ge/2,y:r-18,textAnchor:"middle",fill:n.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:Le?"Left: move \u2022 Right: resize":H?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})]})}function Mn({x1:e,y1:t,x2:r,y2:a,theme:n,onDelete:o}){let[i,l]=xe.useState(false),c=r-e,s=a-t,u=e+c/2,d=`M ${e} ${t} C ${u} ${t}, ${u} ${a}, ${r} ${a}`,f=6,p=Math.atan2(s,c),x=r-f*Math.cos(p-Math.PI/6),y=a-f*Math.sin(p-Math.PI/6),g=r-f*Math.cos(p+Math.PI/6),h=a-f*Math.sin(p+Math.PI/6),v=n.dependency;return jsxRuntime.jsxs("g",{onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),children:[jsxRuntime.jsx("path",{d,fill:"none",stroke:"transparent",strokeWidth:20,strokeLinecap:"round",style:{cursor:"pointer"}}),jsxRuntime.jsx(framerMotion.motion.path,{d,fill:"none",stroke:v,strokeWidth:2,strokeLinecap:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:i?1:.6,strokeWidth:i?2.5:2},transition:{pathLength:{duration:.5,ease:"easeInOut"},opacity:{duration:.2},strokeWidth:{duration:.2}}}),jsxRuntime.jsx(framerMotion.motion.path,{d:`M ${r} ${a} L ${x} ${y} M ${r} ${a} L ${g} ${h}`,fill:"none",stroke:v,strokeWidth:2,strokeLinecap:"round",initial:{opacity:0,scale:.8},animate:{opacity:i?1:.6,scale:i?1.1:1,strokeWidth:i?2.5:2},transition:{duration:.2}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:r,cy:a,r:3,fill:v,initial:{scale:0},animate:{scale:i?1.33:1},transition:{scale:{delay:.3,duration:.2}}}),i&&o&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},transition:{duration:.2},onClick:m=>{m.stopPropagation(),o();},style:{cursor:"pointer"},children:[jsxRuntime.jsx("circle",{cx:u,cy:(t+a)/2,r:10,fill:n.bgSecondary,stroke:n.error||"#ef4444",strokeWidth:2}),jsxRuntime.jsx("line",{x1:u-4,y1:(t+a)/2-4,x2:u+4,y2:(t+a)/2+4,stroke:n.error||"#ef4444",strokeWidth:2,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:u+4,y1:(t+a)/2-4,x2:u-4,y2:(t+a)/2+4,stroke:n.error||"#ef4444",strokeWidth:2,strokeLinecap:"round"})]})]})}function Ln({task:e,x:t,y:r,theme:a,onClick:n}){let[o,i]=xe.useState(false),l=16,c=s=>s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return jsxRuntime.jsxs("g",{onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),onClick:()=>n?.(e),style:{cursor:"pointer"},children:[e.isCriticalPath&&jsxRuntime.jsx(framerMotion.motion.circle,{cx:t,cy:r+16,r:l+4,fill:a.criticalPathLight,initial:{scale:0},animate:{scale:o?1.2:1},transition:{duration:.3}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:t-l/2,y:r+16-l/2,width:l,height:l,fill:e.isCriticalPath?a.criticalPath:a.milestone,stroke:a.bgGrid,strokeWidth:2,transform:`rotate(45 ${t} ${r+16})`,initial:{scale:0,rotate:0},animate:{scale:o?1.15:1,rotate:45},transition:{duration:.3,type:"spring",stiffness:300,damping:20}}),o&&jsxRuntime.jsx(framerMotion.motion.rect,{x:t-(l+4)/2,y:r+16-(l+4)/2,width:l+4,height:l+4,fill:"none",stroke:e.isCriticalPath?a.criticalPath:a.milestone,strokeWidth:2,opacity:.5,transform:`rotate(45 ${t} ${r+16})`,initial:{scale:.8,opacity:0},animate:{scale:1,opacity:.5},transition:{duration:.2}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:o&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},children:[jsxRuntime.jsx("rect",{x:t-80,y:r-50,width:160,height:44,rx:8,fill:a.bgSecondary,stroke:a.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("path",{d:`M ${t-6} ${r-6} L ${t} ${r+4} L ${t+6} ${r-6}`,fill:a.bgSecondary,stroke:a.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:t-70,y:r-38,width:8,height:8,fill:e.isCriticalPath?a.criticalPath:a.milestone,transform:`rotate(45 ${t-66} ${r-34})`}),jsxRuntime.jsx("text",{x:t-55,y:r-32,fill:a.textPrimary,fontSize:"12",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>18?`${e.name.substring(0,18)}...`:e.name}),jsxRuntime.jsx("text",{x:t-55,y:r-18,fill:a.textTertiary,fontSize:"10",fontFamily:"Inter, sans-serif",children:c(e.startDate)}),e.isCriticalPath&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:t+10,y:r-40,width:60,height:16,rx:4,fill:a.criticalPathLight}),jsxRuntime.jsx("text",{x:t+40,y:r-30,textAnchor:"middle",fill:a.criticalPath,fontSize:"9",fontWeight:"700",fontFamily:"Inter, sans-serif",letterSpacing:"0.5",children:"CRITICAL"})]})]})})]})}function Bn({tasks:e,theme:t,rowHeight:r,timeScale:a,startDate:n,endDate:o,zoom:i,templates:l,onTaskClick:c,onTaskDblClick:s,onTaskContextMenu:u,onTaskDateChange:d,onDependencyCreate:f,onDependencyDelete:p}){let y=Math.ceil((o.getTime()-n.getTime())/864e5),g=a==="day"?60:a==="week"?20:8,h=y*g*i,v=E=>{let I=new Date(Date.UTC(E.getFullYear(),E.getMonth(),E.getDate())),R=I.getUTCDay()||7;I.setUTCDate(I.getUTCDate()+4-R);let F=new Date(Date.UTC(I.getUTCFullYear(),0,1));return Math.ceil(((I.getTime()-F.getTime())/864e5+1)/7)},m=E=>{let I=E.getDay();return I===0||I===6},k=xe.useCallback(E=>{let I=Math.round(E/(g*i)),R=new Date(n);return R.setDate(R.getDate()+I),R},[n,g,i]),w=xe.useCallback((E,I)=>{if(I.startDate&&I.endDate)return;let R=E.currentTarget.ownerSVGElement;if(!R)return;let F=R.createSVGPoint();F.x=E.clientX,F.y=E.clientY;let O=F.matrixTransform(R.getScreenCTM()?.inverse()),U=k(O.x),J=new Date(U);J.setDate(J.getDate()+1),d?.(I,U,J);},[k,d]),b=xe.useMemo(()=>{console.log("\u{1F525} Timeline: Calculating parent dates for",e.length,"tasks");let E=O=>O.map(U=>{if(U.subtasks&&U.subtasks.length>0){let J=E(U.subtasks),j=J.filter(ae=>ae.startDate&&ae.endDate);if(j.length>0){let ae=j.map(M=>M.startDate.getTime()),Ie=j.map(M=>M.endDate.getTime()),re=new Date(Math.min(...ae)),Te=new Date(Math.max(...Ie));return console.log("\u2705 Parent task dates calculated:",{taskName:U.name,earliestStart:re.toISOString(),latestEnd:Te.toISOString(),subtasksCount:j.length}),{...U,subtasks:J,startDate:re,endDate:Te}}return {...U,subtasks:J}}return U}),I=(O,U=[])=>{for(let J of O)U.push(J),J.subtasks&&J.subtasks.length>0&&(J.isExpanded===void 0||J.isExpanded)&&I(J.subtasks,U);return U},R=E(e);console.log("\u{1F50D} Tasks BEFORE flattening:",R.map(O=>({name:O.name,hasSubtasks:!!(O.subtasks&&O.subtasks.length>0),subtasksCount:O.subtasks?.length||0,isExpanded:O.isExpanded,hasStartDate:!!O.startDate,hasEndDate:!!O.endDate})));let F=I(R);return console.log("\u{1F4CB} Flattened tasks:",F.map(O=>({name:O.name,hasStartDate:!!O.startDate,hasEndDate:!!O.endDate,startDate:O.startDate?.toISOString(),endDate:O.endDate?.toISOString()}))),F},[e]),T=xe.useCallback(E=>{if(!E.startDate||!E.endDate)return {x:0,width:0};let I=E.startDate.getTime(),R=E.endDate.getTime(),F=n.getTime(),O=(I-F)/(1e3*60*60*24),U=(R-I)/(1e3*60*60*24),J=O*g*i,j=Math.max(g*i,40),ae=Math.max(U*g*i,j);return {x:J,width:ae}},[n,g,i]),C=xe.useMemo(()=>b.filter(E=>E.startDate&&E.endDate).map(E=>{let{x:I,width:R}=T(E),O=48+b.findIndex(U=>U.id===E.id)*r+12;return {id:E.id,x:I,y:O,width:R,height:32}}),[b,T]),N=xe.useMemo(()=>{let E=[],I=new Date(n);for(;I<=o;){let O=(I.getTime()-n.getTime())/864e5*g*i;if(a==="day")E.push({date:new Date(I),label:I.toLocaleDateString("en-US",{day:"numeric",month:"short"}),x:O}),I.setDate(I.getDate()+1);else if(a==="week"){let U=v(I);E.push({date:new Date(I),label:`Week ${U}`,x:O}),I.setDate(I.getDate()+7);}else E.push({date:new Date(I),label:I.toLocaleDateString("en-US",{month:"short",year:"numeric"}),x:O}),I.setMonth(I.getMonth()+1);}return E},[n,o,a,g,i]),D=xe.useMemo(()=>(new Date().getTime()-n.getTime())/(1e3*60*60*24)*g*i,[n,g,i]);return jsxRuntime.jsx("div",{className:"flex-1 overflow-auto","data-gantt-chart":true,style:{backgroundColor:t.bgPrimary},children:jsxRuntime.jsxs("svg",{width:Math.max(h,1e3),height:Math.max(b.length*r+48,600),children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx("filter",{id:"shadow",children:jsxRuntime.jsx("feDropShadow",{dx:"0",dy:"1",stdDeviation:"2",floodOpacity:"0.1"})}),jsxRuntime.jsx("pattern",{id:"diagonal-stripes",width:"8",height:"8",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:jsxRuntime.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"8",stroke:t.border,strokeWidth:"2"})})]}),jsxRuntime.jsx("rect",{x:0,y:0,width:Math.max(h,1e3),height:Math.max(b.length*r+48,600),fill:t.bgPrimary}),jsxRuntime.jsx("rect",{x:0,y:0,width:h,height:48,fill:t.bgGrid}),N.map((E,I)=>{let R=N[I+1]?.x||h,F=m(E.date);return jsxRuntime.jsxs("g",{children:[F&&jsxRuntime.jsx("rect",{x:E.x,y:48,width:R-E.x,height:b.length*r,fill:t.bgWeekend,opacity:1}),jsxRuntime.jsx("line",{x1:E.x,y1:48,x2:E.x,y2:b.length*r+48,stroke:t.border,strokeWidth:1,opacity:.1}),jsxRuntime.jsx("text",{x:E.x+8,y:48/2,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",dominantBaseline:"middle",children:E.label})]},I)}),D>=0&&D<=h&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:D,y1:48,x2:D,y2:b.length*r+48,stroke:t.today,strokeWidth:2,opacity:1}),jsxRuntime.jsx("circle",{cx:D,cy:38,r:6,fill:t.today,opacity:1})]}),b.map((E,I)=>{let R=E.startDate&&E.endDate;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:0,y:48+I*r,width:h,height:r,fill:I%2===0?"transparent":t.bgSecondary,opacity:1,style:{pointerEvents:"none"}},`row-${E.id}`),!R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:0,y:48+I*r,width:h,height:r,fill:"transparent",style:{cursor:"pointer",pointerEvents:"all"},onClick:F=>w(F,E),onMouseEnter:F=>{F.currentTarget.setAttribute("fill",t.accentLight),F.currentTarget.setAttribute("opacity","0.5");},onMouseLeave:F=>{F.currentTarget.setAttribute("fill","transparent"),F.currentTarget.setAttribute("opacity","1");}},`clickable-${E.id}`),jsxRuntime.jsx("text",{x:D>0?D:100,y:48+I*r+r/2,fill:t.textTertiary,fontSize:"12",fontFamily:"Inter, sans-serif",fontStyle:"italic",dominantBaseline:"middle",opacity:.4,style:{pointerEvents:"none",userSelect:"none"},children:"Click to set dates..."},`placeholder-${E.id}`)]})]},`row-group-${E.id}`)}),b.map((E,I)=>!E.dependencies||E.dependencies.length===0||!E.startDate||!E.endDate?null:E.dependencies.map(R=>{let F=b.find(j=>j.id===R);if(!F||!F.startDate||!F.endDate)return null;let O=b.findIndex(j=>j.id===R),U=T(F),J=T(E);return jsxRuntime.jsx(Mn,{x1:U.x+U.width,y1:48+O*r+r/2,x2:J.x,y2:48+I*r+r/2,theme:t,onDelete:()=>p?.(E.id,R)},`dep-${R}-${E.id}`)})),b.map((E,I)=>{if(!E.startDate||!E.endDate)return null;let{x:R,width:F}=T(E),O=48+I*r+12,U=E.subtasks&&E.subtasks.length>0&&!E.isMilestone;return E.isMilestone?jsxRuntime.jsx(Ln,{task:E,x:R+F/2,y:O+16,theme:t,onClick:c},E.id):U?(console.log("\u{1F3A8} Rendering container task:",E.name,"at",{x:R,y:O,width:F}),jsxRuntime.jsxs("g",{onClick:()=>c?.(E),style:{cursor:"pointer"},children:[jsxRuntime.jsx("rect",{x:R,y:O,width:F,height:32,fill:t.primary,opacity:.25,rx:6}),jsxRuntime.jsx("line",{x1:R,y1:O,x2:R+F,y2:O,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:R,y1:O,x2:R,y2:O+32,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:R+F,y1:O,x2:R+F,y2:O+32,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:R,y1:O+32,x2:R+F,y2:O+32,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),F>60&&jsxRuntime.jsx("text",{x:R+12,y:O+16,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"13",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:E.name})]},E.id)):jsxRuntime.jsx(Pn,{task:E,x:R,y:O,width:F,theme:t,dayWidth:g*i,startDate:n,templates:l,onClick:c,onDoubleClick:s,onContextMenu:u,onDateChange:d,onDependencyCreate:f,allTaskPositions:C},E.id)})]})})}var Yl=[{name:"Azul",value:"#6366F1",light:"#818CF8"},{name:"P\xFArpura",value:"#A855F7",light:"#C084FC"},{name:"Rosa",value:"#EC4899",light:"#F472B6"},{name:"Rojo",value:"#EF4444",light:"#F87171"},{name:"Naranja",value:"#F59E0B",light:"#FBBF24"},{name:"Amarillo",value:"#EAB308",light:"#FACC15"},{name:"Lima",value:"#84CC16",light:"#A3E635"},{name:"Verde",value:"#10B981",light:"#34D399"},{name:"Esmeralda",value:"#059669",light:"#10B981"},{name:"Cyan",value:"#06B6D4",light:"#22D3EE"},{name:"Azul Cielo",value:"#0EA5E9",light:"#38BDF8"},{name:"\xCDndigo",value:"#4F46E5",light:"#6366F1"},{name:"Violeta",value:"#8B5CF6",light:"#A78BFA"},{name:"Fucsia",value:"#D946EF",light:"#E879F9"},{name:"Gris",value:"#6B7280",light:"#9CA3AF"},{name:"Piedra",value:"#78716C",light:"#A8A29E"}];function ql({value:e="#6366F1",onChange:t,disabled:r=false}){return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:Yl.map(a=>{let n=e===a.value;return jsxRuntime.jsx(framerMotion.motion.button,{type:"button",onClick:()=>!r&&t(a.value),className:"relative rounded-full transition-all focus:outline-none focus:ring-2 focus:ring-offset-2",style:{width:"32px",height:"32px",backgroundColor:a.value,boxShadow:n?`0 0 0 2px #FFFFFF, 0 0 0 4px ${a.value}`:"0 1px 3px rgba(0, 0, 0, 0.12)",opacity:r?.5:1,cursor:r?"not-allowed":"pointer"},whileHover:r?{}:{scale:1.1},whileTap:r?{}:{scale:.95},title:a.name,disabled:r,children:n&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{scale:0},animate:{scale:1},className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-white drop-shadow-md",strokeWidth:3})})},a.value)})}),e&&jsxRuntime.jsx("div",{className:"text-xs text-center font-medium",style:{color:e},children:Yl.find(a=>a.value===e)?.name||"Personalizado"})]})}function On({isOpen:e,onClose:t,task:r,availableTasks:a=[],availableUsers:n=[],onSubmit:o,isLoading:i=false,mode:l=r?"edit":"create",theme:c="dark"}){let s=fe[c]||fe.dark,u={backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`,color:s.textPrimary},d={color:s.textSecondary},[f,p]=xe.useState({name:"",progress:0,status:"todo",isMilestone:false,color:"#6366F1",assignees:[],dependencies:[]}),[x,y]=xe.useState({});xe.useEffect(()=>{p(r?{name:r.name,startDate:r.startDate,endDate:r.endDate,progress:r.progress,status:r.status||"todo",isMilestone:r.isMilestone||false,color:r.color||"#6366F1",assignees:r.assignees||[],dependencies:r.dependencies||[]}:{name:"",progress:0,status:"todo",isMilestone:false,color:"#6366F1",assignees:[],dependencies:[]});},[r,e]);let g=()=>{let m={};return f.name.trim()||(m.name="El nombre es requerido"),f.startDate&&f.endDate&&f.startDate>f.endDate&&(m.endDate="La fecha de fin debe ser posterior a la de inicio"),y(m),Object.keys(m).length===0},h=async m=>{if(m.preventDefault(),!!g())try{await o(f),t();}catch(k){console.error("Error submitting task:",k);}},v=(m,k)=>{p(w=>{let b={...w,[m]:k};if(m==="progress"){let T=typeof k=="number"?k:parseInt(k,10);T===100&&w.status!=="completed"?b.status="completed":T>0&&T<100&&w.status==="todo"?b.status="in-progress":T===0&&w.status==="in-progress"&&(b.status="todo");}return b}),x[m]&&y(w=>{let b={...w};return delete b[m],b});};return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 z-50",onClick:t}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2,ease:[.4,0,.2,1]},className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-xl shadow-2xl pointer-events-auto overflow-hidden",style:{backgroundColor:s.bgPrimary,border:`1px solid ${s.border}`},onClick:m=>m.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 py-4",style:{borderBottom:`1px solid ${s.border}`},children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold",style:{color:s.textPrimary},children:l==="create"?"Crear Nueva Tarea":"Editar Tarea"}),jsxRuntime.jsx("button",{onClick:t,className:"p-2 rounded-lg transition-colors",style:{color:s.textSecondary},onMouseEnter:m=>m.currentTarget.style.backgroundColor=s.hoverBg,onMouseLeave:m=>m.currentTarget.style.backgroundColor="transparent",disabled:i,children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsxs("form",{onSubmit:h,className:"p-6 space-y-6 max-h-[calc(100vh-200px)] overflow-y-auto",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-2",style:d,children:"Nombre de la Tarea *"}),jsxRuntime.jsx("input",{type:"text",value:f.name,onChange:m=>v("name",m.target.value),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,onFocus:m=>m.currentTarget.style.borderColor=s.accent,onBlur:m=>m.currentTarget.style.borderColor=s.borderLight,placeholder:"Ej: Dise\xF1ar mockups de la aplicaci\xF3n",disabled:i}),x.name&&jsxRuntime.jsxs("p",{className:"mt-1 text-sm text-red-400 flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-4 h-4"}),x.name]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),"Fecha de Inicio"]}),jsxRuntime.jsx("input",{type:"date",value:f.startDate?f.startDate.toISOString().split("T")[0]:"",onChange:m=>v("startDate",m.target.value?new Date(m.target.value):void 0),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,disabled:i||f.isMilestone})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),"Fecha de Fin"]}),jsxRuntime.jsx("input",{type:"date",value:f.endDate?f.endDate.toISOString().split("T")[0]:"",onChange:m=>v("endDate",m.target.value?new Date(m.target.value):void 0),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,disabled:i||f.isMilestone}),x.endDate&&jsxRuntime.jsxs("p",{className:"mt-1 text-sm text-red-400 flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-4 h-4"}),x.endDate]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),"Estado"]}),jsxRuntime.jsxs("select",{value:f.status,onChange:m=>v("status",m.target.value),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,disabled:i,children:[jsxRuntime.jsx("option",{value:"todo",children:"Por Hacer"}),jsxRuntime.jsx("option",{value:"in-progress",children:"En Progreso"}),jsxRuntime.jsx("option",{value:"completed",children:"Completada"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-3 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Palette,{className:"w-4 h-4"}),"Color de la Tarea"]}),jsxRuntime.jsx(ql,{value:f.color,onChange:m=>v("color",m),disabled:i}),jsxRuntime.jsx("p",{className:"text-xs mt-2",style:{color:s.textTertiary},children:r?.parentId?"Esta subtarea hereda el color de su tarea padre":r?.subtasks&&r.subtasks.length>0?"Las subtareas heredar\xE1n este color con menor opacidad":"Elige un color para organizar visualmente tus tareas"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center justify-between",style:d,children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),"Progreso"]}),jsxRuntime.jsxs("span",{className:"font-semibold px-2 py-0.5 rounded text-sm",style:{color:f.progress<30?"#EF4444":f.progress<70?"#F59E0B":"#10B981",backgroundColor:f.progress<30?"rgba(239, 68, 68, 0.1)":f.progress<70?"rgba(245, 158, 11, 0.1)":"rgba(16, 185, 129, 0.1)"},children:[f.progress,"%"]})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:f.progress,onChange:m=>v("progress",parseInt(m.target.value)),className:"w-full h-2 rounded-lg appearance-none cursor-pointer",style:{backgroundColor:s.bgSecondary,accentColor:f.progress<30?"#EF4444":f.progress<70?"#F59E0B":"#10B981"},disabled:i}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 h-2 rounded-lg pointer-events-none transition-all duration-300",style:{width:`${f.progress}%`,backgroundColor:f.progress<30?"rgba(239, 68, 68, 0.3)":f.progress<70?"rgba(245, 158, 11, 0.3)":"rgba(16, 185, 129, 0.3)"}})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mt-3 gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",style:{color:s.textTertiary},children:"Accesos r\xE1pidos:"}),jsxRuntime.jsx("div",{className:"flex gap-1.5",children:[0,25,50,75,100].map(m=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>v("progress",m),disabled:i,className:"px-3 py-1 text-xs font-medium rounded-md transition-all duration-200 hover:scale-105 active:scale-95",style:{backgroundColor:f.progress===m?m<30?"#EF4444":m<70?"#F59E0B":"#10B981":s.bgSecondary,color:f.progress===m?"#FFFFFF":s.textSecondary,border:`1px solid ${f.progress===m?m<30?"#EF4444":m<70?"#F59E0B":"#10B981":s.borderLight}`},children:[m,"%"]},m))})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mt-2",style:{color:s.textTertiary},children:[jsxRuntime.jsx("span",{children:"0%"}),jsxRuntime.jsx("span",{children:"25%"}),jsxRuntime.jsx("span",{children:"50%"}),jsxRuntime.jsx("span",{children:"75%"}),jsxRuntime.jsx("span",{children:"100%"})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-lg",style:{backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`},children:[jsxRuntime.jsx("input",{type:"checkbox",id:"isMilestone",checked:f.isMilestone,onChange:m=>v("isMilestone",m.target.checked),className:"w-4 h-4 rounded focus:ring-2",style:{accentColor:s.accent},disabled:i}),jsxRuntime.jsxs("label",{htmlFor:"isMilestone",className:"flex items-center gap-2 text-sm cursor-pointer",style:{color:s.textPrimary},children:[jsxRuntime.jsx(lucideReact.Milestone,{className:"w-4 h-4 text-yellow-500"}),"Marcar como Hito (Milestone)"]})]}),n.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),"Asignar a"]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto p-3 rounded-lg",style:{backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`},children:n.map(m=>jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer p-2 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=s.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:f.assignees?.some(k=>k.name===m.name),onChange:k=>{let w=k.target.checked?[...f.assignees||[],{name:m.name,avatar:m.avatar,initials:m.name.split(" ").map(b=>b[0]).join("").toUpperCase().slice(0,2),color:s.accent}]:(f.assignees||[]).filter(b=>b.name!==m.name);v("assignees",w);},className:"w-4 h-4 rounded",style:{accentColor:s.accent},disabled:i}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs text-white font-semibold",style:{backgroundColor:s.accent},children:m.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:s.textPrimary},children:m.name})]})]},m.id))})]}),a.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),"Dependencias"]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto p-3 rounded-lg",style:{backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`},children:a.filter(m=>m.id!==r?.id).map(m=>jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer p-2 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=s.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:f.dependencies?.includes(m.id),onChange:k=>{let w=k.target.checked?[...f.dependencies||[],m.id]:(f.dependencies||[]).filter(b=>b!==m.id);v("dependencies",w);},className:"w-4 h-4 rounded",style:{accentColor:s.accent},disabled:i}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:s.textPrimary},children:m.name})]},m.id))})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4",style:{borderTop:`1px solid ${s.border}`,backgroundColor:s.bgPrimary},children:[jsxRuntime.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm font-medium rounded-lg transition-colors",style:{color:s.textSecondary},onMouseEnter:m=>{m.currentTarget.style.color=s.textPrimary,m.currentTarget.style.backgroundColor=s.hoverBg;},onMouseLeave:m=>{m.currentTarget.style.color=s.textSecondary,m.currentTarget.style.backgroundColor="transparent";},disabled:i,children:"Cancelar"}),jsxRuntime.jsx("button",{onClick:h,disabled:i,className:"px-4 py-2 text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",style:{backgroundColor:s.accent,color:"#FFFFFF"},onMouseEnter:m=>!i&&(m.currentTarget.style.backgroundColor=s.accentHover),onMouseLeave:m=>!i&&(m.currentTarget.style.backgroundColor=s.accent),children:i?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Guardando..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),l==="create"?"Crear Tarea":"Guardar Cambios"]})})]})]})})]})})}function tc(e,t=50){let[r,a]=xe.useState({past:[],present:e,future:[]}),n=xe.useRef(false),o=xe.useCallback((s,u=true)=>{a(d=>{let f=typeof s=="function"?s(d.present):s;if(n.current)return {...d,present:f};if(!u)return {...d,present:f};let p=[...d.past,d.present];return p.length>t&&p.shift(),{past:p,present:f,future:[]}});},[t]),i=xe.useCallback(()=>{a(s=>{if(s.past.length===0)return s;let u=s.past[s.past.length-1],d=s.past.slice(0,s.past.length-1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:d,present:u,future:[s.present,...s.future]}});},[]),l=xe.useCallback(()=>{a(s=>{if(s.future.length===0)return s;let u=s.future[0],d=s.future.slice(1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:[...s.past,s.present],present:u,future:d}});},[]),c=xe.useCallback(()=>{a(s=>({past:[],present:s.present,future:[]}));},[]);return {state:r.present,setState:o,undo:i,redo:l,canUndo:r.past.length>0,canRedo:r.future.length>0,clearHistory:c}}function rc({undo:e,redo:t,canUndo:r,canRedo:a,enabled:n=true}){xe.useEffect(()=>{if(!n)return;let o=i=>{let l=navigator.platform.toUpperCase().indexOf("MAC")>=0,c=l?i.metaKey:i.ctrlKey;if(c&&i.key==="z"&&!i.shiftKey&&r){i.preventDefault(),e();return}if(a){if(!l&&c&&i.key==="y"){i.preventDefault(),t();return}if(l&&c&&i.shiftKey&&i.key==="z"){i.preventDefault(),t();return}}};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o);}},[e,t,r,a,n]);}var X={calculateEndDate:(e,t)=>{let r=new Date(e);return r.setDate(r.getDate()+t),r},calculateDuration:(e,t)=>{let r=t.getTime()-e.getTime();return Math.ceil(r/(1e3*60*60*24))},calculateWorkingDays:(e,t)=>{let r=0,a=new Date(e);for(;a<=t;){let n=a.getDay();n!==0&&n!==6&&r++,a.setDate(a.getDate()+1);}return r},addWorkingDays:(e,t)=>{let r=new Date(e),a=0;for(;a<t;){r.setDate(r.getDate()+1);let n=r.getDay();n!==0&&n!==6&&a++;}return r},isWeekend:e=>{let t=e.getDay();return t===0||t===6},validateDependencies:(e,t,r)=>{let a=new Map,n=s=>{s.forEach(u=>{u.dependencies&&a.set(u.id,u.dependencies),u.subtasks&&n(u.subtasks);});};n(e);let o=a.get(r)||[];a.set(r,[...o,t]);let i=new Set,l=new Set,c=s=>{if(!i.has(s)){i.add(s),l.add(s);let u=a.get(s)||[];for(let d of u){if(!i.has(d)&&c(d))return true;if(l.has(d))return true}}return l.delete(s),false};return c(r)},flattenTasks:e=>{let t=[],r=a=>{a.forEach(n=>{t.push(n),n.subtasks&&n.subtasks.length>0&&r(n.subtasks);});};return r(e),t},findTaskById:(e,t)=>{for(let r of e){if(r.id===t)return r;if(r.subtasks){let a=X.findTaskById(r.subtasks,t);if(a)return a}}},getParentTasks:(e,t)=>{let r=[],a=X.findTaskById(e,t);if(!a||!a.parentId)return r;let n=a.parentId;for(;n;){let o=X.findTaskById(e,n);if(o)r.unshift(o),n=o.parentId;else break}return r},exportToJSON:e=>JSON.stringify(e,null,2),importFromJSON:e=>{try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Error("Invalid JSON: expected an array of tasks");return t.forEach((r,a)=>{if(!r.id||!r.name)throw new Error(`Invalid task at index ${a}: missing required fields (id, name)`)}),t}catch(t){throw new Error(`Failed to import tasks: ${t instanceof Error?t.message:"Unknown error"}`)}},exportToCSV:e=>{let t=X.flattenTasks(e),a=[["ID","Name","Start Date","End Date","Progress","Status","Dependencies"].join(",")];return t.forEach(n=>{let o=[n.id,`"${n.name.replace(/"/g,'""')}"`,n.startDate?n.startDate.toISOString().split("T")[0]:"",n.endDate?n.endDate.toISOString().split("T")[0]:"",n.progress.toString(),n.status||"",n.dependencies?.join(";")||""];a.push(o.join(","));}),a.join(`
|
|
46
|
-
`)},formatDate:e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${t}-${r}-${a}`},parseDate:e=>new Date(e),getTaskDateRange:e=>!e.startDate||!e.endDate?null:{start:e.startDate,end:e.endDate},getEarliestStartDate:e=>{let r=X.flattenTasks(e).filter(a=>a.startDate);return r.length===0?null:new Date(Math.min(...r.map(a=>a.startDate.getTime())))},getLatestEndDate:e=>{let r=X.flattenTasks(e).filter(a=>a.endDate);return r.length===0?null:new Date(Math.max(...r.map(a=>a.endDate.getTime())))},tasksOverlap:(e,t)=>!e.startDate||!e.endDate||!t.startDate||!t.endDate?false:e.startDate<=t.endDate&&t.startDate<=e.endDate,getDependentTasks:(e,t)=>X.flattenTasks(e).filter(a=>a.dependencies&&a.dependencies.includes(t)),getDependencyTasks:(e,t)=>{let r=X.findTaskById(e,t);return !r||!r.dependencies?[]:X.flattenTasks(e).filter(n=>r.dependencies.includes(n.id))},filterByStatus:(e,t)=>X.flattenTasks(e).filter(r=>r.status===t),filterByDateRange:(e,t,r)=>X.flattenTasks(e).filter(a=>!a.startDate||!a.endDate?false:a.startDate<=r&&a.endDate>=t),sortByStartDate:(e,t=true)=>[...e].sort((r,a)=>{if(!r.startDate||!a.startDate)return 0;let n=r.startDate.getTime()-a.startDate.getTime();return t?n:-n}),sortByEndDate:(e,t=true)=>[...e].sort((r,a)=>{if(!r.endDate||!a.endDate)return 0;let n=r.endDate.getTime()-a.endDate.getTime();return t?n:-n}),sortByProgress:(e,t=true)=>[...e].sort((r,a)=>{let n=r.progress-a.progress;return t?n:-n}),calculateTotalProgress:e=>{let t=X.flattenTasks(e);if(t.length===0)return 0;let r=t.reduce((a,n)=>a+n.progress,0);return Math.round(r/t.length)},getTaskByPath:(e,t)=>{let r=e,a;for(let n=0;n<t.length;n++){let o=t[n];if(!r||o===void 0||o>=r.length||(a=r[o],!a))return;n<t.length-1&&(r=a.subtasks||[]);}return a},cloneTask:(e,t)=>({...e,id:t||`${e.id}-copy`,subtasks:e.subtasks?.map(r=>X.cloneTask(r))}),exportToPDF:async(e,t="gantt-chart.pdf")=>{try{if(console.log("[PDF Export] Starting export..."),console.log("[PDF Export] Tasks count:",e?.length||0),!e||e.length===0){console.warn("[PDF Export] No tasks provided"),alert("No tasks available to export to PDF");return}let{jsPDF:r}=await import('jspdf'),{default:a}=await import('jspdf-autotable');console.log("[PDF Export] Modules loaded");let n=new r,o=X.flattenTasks(e);if(console.log("[PDF Export] Flattened tasks count:",o.length),o.length===0){console.warn("[PDF Export] No tasks after flattening"),alert("No tasks found to export");return}n.setFontSize(16),n.text("Gantt Chart - Task List",14,20);let i=[["Task Name","Start Date","End Date","Duration","Progress","Status"]],l=o.map(c=>{let s=c.startDate&&c.endDate?X.calculateDuration(c.startDate,c.endDate):0;return [c.name,c.startDate?X.formatDate(c.startDate):"N/A",c.endDate?X.formatDate(c.endDate):"N/A",s>0?`${s} days`:"N/A",`${c.progress}%`,c.status||"N/A"]});console.log("[PDF Export] Generating table with autoTable function..."),a(n,{head:i,body:l,startY:30,styles:{fontSize:9,cellPadding:3},headStyles:{fillColor:[66,139,202],textColor:255,fontStyle:"bold"},alternateRowStyles:{fillColor:[245,245,245]},columnStyles:{0:{cellWidth:60},1:{cellWidth:30},2:{cellWidth:30},3:{cellWidth:25},4:{cellWidth:20},5:{cellWidth:25}}}),console.log("[PDF Export] Table generated successfully"),console.log("[PDF Export] Saving PDF:",t),n.save(t),console.log("[PDF Export] PDF saved successfully");}catch(r){throw console.error("Error exporting to PDF:",r),r}},exportToExcel:async(e,t="gantt-chart.xlsx")=>{let r=await import('xlsx'),n=X.flattenTasks(e).map(c=>{let s=c.startDate&&c.endDate?X.calculateDuration(c.startDate,c.endDate):0;return {"Task ID":c.id,"Task Name":c.name,"Start Date":c.startDate?X.formatDate(c.startDate):"","End Date":c.endDate?X.formatDate(c.endDate):"","Duration (days)":s>0?s:"","Progress (%)":c.progress,Status:c.status||"",Assignees:c.assignees?.map(u=>u.name).join(", ")||"",Dependencies:c.dependencies?.join(", ")||"","Is Milestone":c.isMilestone?"Yes":"No","Parent ID":c.parentId||"",Level:c.level||0}}),o=r.utils.json_to_sheet(n),i=[{wch:15},{wch:40},{wch:12},{wch:12},{wch:15},{wch:12},{wch:15},{wch:30},{wch:20},{wch:12},{wch:15},{wch:8}];o["!cols"]=i;let l=r.utils.book_new();r.utils.book_append_sheet(l,o,"Gantt Tasks"),r.writeFile(l,t);},calculateCriticalPath:e=>{let t=X.flattenTasks(e),r=t.filter(s=>s.startDate&&s.endDate);if(r.length===0)return [];let a=new Map,n=s=>{if(a.has(s.id))return;let u=s.startDate&&s.endDate?X.calculateDuration(s.startDate,s.endDate):0,d=0;if(s.dependencies&&s.dependencies.length>0)for(let p of s.dependencies){let x=t.find(y=>y.id===p);if(x){n(x);let y=a.get(p)?.ef||0;d=Math.max(d,y);}}let f=d+u;a.set(s.id,{es:d,ef:f});};r.forEach(n);let o=Math.max(...Array.from(a.values()).map(s=>s.ef)),i=new Map,l=s=>{if(i.has(s.id))return;let u=s.startDate&&s.endDate?X.calculateDuration(s.startDate,s.endDate):0,d=t.filter(x=>x.dependencies&&x.dependencies.includes(s.id)),f=o;if(d.length>0)for(let x of d){l(x);let y=i.get(x.id)?.ls||0;f=Math.min(f,y);}let p=f-u;i.set(s.id,{ls:p,lf:f});};r.forEach(l);let c=[];for(let s of r){let u=a.get(s.id),d=i.get(s.id);if(u&&d){let f=d.ls-u.es;Math.abs(f)<.01&&c.push(s.id);}}return c},calculateSlack:(e,t)=>{let r=X.findTaskById(e,t);if(!r||!r.startDate||!r.endDate)return null;if(X.calculateCriticalPath(e).includes(t))return 0;let n=X.getDependentTasks(e,t);if(n.length===0){let l=X.getLatestEndDate(e);if(!l)return null;let c=X.calculateDuration(r.endDate,l);return Math.max(0,c)}let o=n.filter(l=>l.startDate).map(l=>l.startDate.getTime()).sort((l,c)=>l-c)[0];if(!o)return null;let i=X.calculateDuration(r.endDate,new Date(o));return Math.max(0,i)},isOnCriticalPath:(e,t)=>X.calculateCriticalPath(e).includes(t),autoScheduleDependents:(e,t)=>{let r=X.findTaskById(e,t);if(!r||!r.endDate)return e;let a=X.getDependentTasks(e,t);if(a.length===0)return e;let n=[...e];for(let o of a){if(!o.startDate||!o.endDate)continue;let i=X.calculateDuration(o.startDate,o.endDate),l=new Date(r.endDate);l.setDate(l.getDate()+1);let c=X.calculateEndDate(l,i),s=u=>u.map(d=>d.id===o.id?{...d,startDate:l,endDate:c}:d.subtasks?{...d,subtasks:s(d.subtasks)}:d);n=s(n),n=X.autoScheduleDependents(n,o.id);}return n},splitTask:(e,t,r,a=3)=>{let n=X.findTaskById(e,t);if(!n||!n.startDate||!n.endDate)return e;if(r<=n.startDate||r>=n.endDate)return console.warn("Split date must be between task start and end dates"),e;let o=new Date(r);o.setDate(o.getDate()-1);let i=new Date(r);i.setDate(i.getDate()+a);let l=new Date(n.endDate);l.setDate(l.getDate()+a);let c=[{startDate:new Date(n.startDate),endDate:o},{startDate:i,endDate:l}],s=u=>u.map(d=>d.id===n.id?{...d,endDate:l,segments:c}:d.subtasks?{...d,subtasks:s(d.subtasks)}:d);return s(e)}};var If={taskTooltip:e=>{let t=[`<strong>${e.name}</strong>`];if(e.startDate&&e.endDate){t.push(`${X.formatDate(e.startDate)} - ${X.formatDate(e.endDate)}`);let r=X.calculateDuration(e.startDate,e.endDate);t.push(`Duration: ${r} days`);}if(e.progress!==void 0&&t.push(`Progress: ${e.progress}%`),e.status&&t.push(`Status: ${e.status}`),e.assignees&&e.assignees.length>0){let r=e.assignees.map(a=>a.name).join(", ");t.push(`Assigned: ${r}`);}return e.dependencies&&e.dependencies.length>0&&t.push(`Dependencies: ${e.dependencies.length}`),t.join("<br/>")},taskLabel:e=>e.name,gridCell:(e,t,r)=>r,taskClass:e=>{let t=[];return e.isCriticalPath&&t.push("critical-path"),e.status==="completed"?t.push("completed"):e.status==="in-progress"?t.push("in-progress"):e.status==="todo"&&t.push("todo"),e.isMilestone&&t.push("milestone"),t.join(" ")},milestoneContent:e=>`\u25C6 ${e.name}`,dateFormat:e=>X.formatDate(e),durationFormat:e=>e===1?"1 day":`${e} days`,progressFormat:e=>`${e}%`};function ac(e){return {...If,...e}}var Of=e=>{switch(e){case "compact":return 40;case "comfortable":return 48;case "spacious":return 56;default:return 48}},oc=xe.forwardRef(function({tasks:t,config:r={},onTasksChange:a},n){let{theme:o,timeScale:i="week",rowDensity:l="comfortable",showThemeSelector:c=true,availableUsers:s=[],templates:u,onThemeChange:d,onTaskClick:f,onTaskDblClick:p,onTaskContextMenu:x,onTaskUpdate:y,onProgressChange:g,onDependencyCreate:h,onDependencyDelete:v,onBeforeTaskAdd:m,onAfterTaskAdd:k,onBeforeTaskUpdate:w,onAfterTaskUpdate:b}=r,C=xe.useContext(Sn)?.theme,[N,D]=xe.useState(C||o||"dark"),[E,I]=xe.useState(i),[R,F]=xe.useState(l),[O,U]=xe.useState(1),[J,j]=xe.useState(0),[ae,Ie]=xe.useState(false),[re,Te]=xe.useState(null),[M,Q]=xe.useState({isOpen:false,x:0,y:0,task:null}),[Ae,et]=xe.useState(null);xe.useEffect(()=>{C&&C!==N&&D(C);},[C]);let Jt=xe.useCallback(P=>{D(P),d?.(P);},[d]),{state:K,setState:ne,undo:Rt,redo:Lt,canUndo:Ut,canRedo:Gt,clearHistory:_}=tc(t,50);xe.useEffect(()=>{console.log("\u{1F4E5} GanttBoard: Parent tasks prop changed, syncing to localTasks",t.length),ne(t);},[t,ne]),xe.useEffect(()=>{a&&a(K);},[K,a]);let[H,Le]=xe.useState([{id:"name",label:"TASK NAME",width:240,visible:true,sortable:true},{id:"startDate",label:"Start Date",width:110,visible:false,sortable:true},{id:"endDate",label:"End Date",width:110,visible:false,sortable:true},{id:"duration",label:"Duration",width:80,visible:false,sortable:true},{id:"assignees",label:"Assignees",width:120,visible:false,sortable:false},{id:"status",label:"Status",width:80,visible:false,sortable:true},{id:"progress",label:"% Complete",width:120,visible:false,sortable:true}]),He=xe.useMemo(()=>H.filter(P=>P.visible).reduce((P,B)=>P+B.width,0)+60,[H]),Fe=re||He,Ct=xe.useRef(null),ie=xe.useRef(null),ct=xe.useRef(null),Re=xe.useMemo(()=>El(N),[N]),Qt=xe.useMemo(()=>ac(u),[u]),Nr=xe.useMemo(()=>{let P=X.calculateCriticalPath(K),B=V=>V.map(q=>({...q,isCriticalPath:P.includes(q.id),subtasks:q.subtasks?B(q.subtasks):void 0}));return B(K)},[K]),me=Of(R);rc({undo:Rt,redo:Lt,canUndo:Ut,canRedo:Gt,enabled:true}),xe.useImperativeHandle(n,()=>({getTask:P=>X.findTaskById(K,P),addTask:(P,B)=>{ne(V=>{if(!B)return [...V,{...P,level:0}];let q=Z=>Z.map(oe=>oe.id===B?{...oe,subtasks:[...oe.subtasks||[],{...P,parentId:B,level:(oe.level||0)+1}],isExpanded:true}:oe.subtasks?{...oe,subtasks:q(oe.subtasks)}:oe);return q(V)});},updateTask:(P,B)=>{ne(V=>{let q=Z=>Z.map(oe=>oe.id===P?{...oe,...B}:oe.subtasks?{...oe,subtasks:q(oe.subtasks)}:oe);return q(V)});},deleteTask:P=>{ne(B=>{let V=q=>q.filter(Z=>Z.id===P?false:(Z.subtasks&&(Z.subtasks=V(Z.subtasks)),true));return V(B)});},deleteTasks:P=>{ne(B=>is(B,P));},duplicateTask:P=>{ne(B=>ls(B,[P]));},splitTask:(P,B,V=3)=>{ne(q=>X.splitTask(q,P,B,V));},calculateEndDate:X.calculateEndDate,calculateDuration:X.calculateDuration,validateDependency:(P,B)=>!X.validateDependencies(K,P,B),getAllTasks:()=>X.flattenTasks(K),getTasksByStatus:P=>X.flattenTasks(K).filter(B=>B.status===P),getTasksByParent:P=>P?X.findTaskById(K,P)?.subtasks||[]:K.filter(V=>!V.parentId),getCriticalPath:()=>X.flattenTasks(K).filter(P=>P.isCriticalPath),indentTask:P=>{ne(B=>ns(B,[P]));},outdentTask:P=>{ne(B=>os(B,[P]));},moveTask:(P,B)=>{ne(V=>ss(V,[P],B));},createSubtask:async P=>{let{tasks:B,newTask:V}=us(K,P);if(m){let q=m({...V,parentId:P});if((q instanceof Promise?await q:q)===false)return}ne(B),k&&k({...V,parentId:P});},scrollToTask:P=>{let V=X.flattenTasks(K).findIndex(q=>q.id===P);if(V!==-1&&Ct.current){let q=V*me;Ct.current.scrollTo({top:q,behavior:"smooth"}),ie.current&&ie.current.scrollTo({top:q,behavior:"smooth"});}},highlightTask:(P,B=2e3)=>{console.log(`Highlighting task ${P} for ${B}ms`);},expandTask:P=>{ne(B=>{let V=q=>q.map(Z=>Z.id===P?{...Z,isExpanded:true}:Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z);return V(B)});},collapseTask:P=>{ne(B=>{let V=q=>q.map(Z=>Z.id===P?{...Z,isExpanded:false}:Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z);return V(B)});},expandAll:()=>{ne(P=>{let B=V=>V.map(q=>({...q,isExpanded:true,subtasks:q.subtasks?B(q.subtasks):void 0}));return B(P)});},collapseAll:()=>{ne(P=>{let B=V=>V.map(q=>({...q,isExpanded:false,subtasks:q.subtasks?B(q.subtasks):void 0}));return B(P)});},undo:Rt,redo:Lt,canUndo:()=>Ut,canRedo:()=>Gt,clearHistory:_,exportToPNG:async()=>{if(!ct.current)throw new Error("Gantt container not found");let P=await dd__default.default(ct.current,{backgroundColor:Re.bgPrimary,scale:2});return new Promise((B,V)=>{P.toBlob(q=>{q?B(q):V(new Error("Failed to create blob from canvas"));},"image/png");})},exportToPDF:async P=>{await X.exportToPDF(K,P);},exportToExcel:async P=>{await X.exportToExcel(K,P);},exportToJSON:()=>X.exportToJSON(K),exportToCSV:()=>X.exportToCSV(K),importFromJSON:P=>{let B=X.importFromJSON(P);ne(B);},getTasks:()=>K,refresh:()=>{ne(P=>[...P]);},clearAll:()=>{ne([]);}}),[K,Rt,Lt,Ut,Gt,_,Re,me]);let ge=xe.useCallback(P=>{Le(B=>B.map(V=>V.id===P?{...V,visible:!V.visible}:V));},[]),Yr=xe.useCallback(P=>{ne(B=>ds(B,P)),r.onTaskToggleExpand?.(P);},[r]),Dr=xe.useCallback((P,B)=>{if(w&&w(P,B)===false)return;let q=X.findTaskById(K,P)?.progress,Z=ft=>ft.map($e=>$e.id===P?{...$e,...B}:$e.subtasks?{...$e,subtasks:Z($e.subtasks)}:$e);ne(Z(K));let oe=X.findTaskById(Z(K),P);oe&&(y?.(oe),b?.(oe),B.progress!==void 0&&q!==void 0&&B.progress!==q&&g?.(P,q,B.progress));},[K,y,w,b,g]),qr=xe.useCallback(P=>{P.length!==0&&(ne(B=>ns(B,P)),r.onTaskIndent?.(P[0]));},[r]),z=xe.useCallback(P=>{P.length!==0&&(ne(B=>os(B,P)),r.onTaskOutdent?.(P[0]));},[r]),he=xe.useCallback((P,B)=>{P.length!==0&&(ne(V=>ss(V,P,B)),r.onTaskMove?.(P[0],B));},[r]),de=xe.useCallback(P=>{console.log("\u{1F4E6} GanttBoard handleMultiTaskDelete called:",P),r.onMultiTaskDelete?r.onMultiTaskDelete(P):(ne(B=>is(B,P)),P.forEach(B=>r.onTaskDelete?.(B)));},[r]),S=xe.useCallback(P=>{ne(B=>ls(B,P)),P.forEach(B=>r.onTaskDuplicate?.(B));},[r]),G=xe.useCallback((P,B)=>{ne(V=>{let{tasks:q,newTask:Z}=Bl(V,P,B);return m&&m(Z)===false?V:(r.onTaskCreate?.(Z.parentId,Z.position||0),k?.(Z),q)});},[r,m,k]),ue=xe.useCallback((P,B)=>{ne(V=>cs(V,P,B)),r.onTaskRename?.(P,B);},[r]),ke=xe.useCallback(P=>{ne(B=>{let{tasks:V}=us(B,P);return r.onTaskCreate?.(P,0),V});},[r]),Se=xe.useCallback((P,B,V)=>{let q=ft=>ft.map($e=>$e.id===P.id?{...$e,startDate:B,endDate:V,...P.segments&&{segments:P.segments}}:$e.subtasks?{...$e,subtasks:q($e.subtasks)}:$e),Z=q(K);Z=X.autoScheduleDependents(Z,P.id),ne(Z);let oe={...P,startDate:B,endDate:V};y?.(oe);},[K,y]),Pt=xe.useCallback((P,B)=>{x?.(P,B),Q({isOpen:true,x:B.clientX,y:B.clientY,task:P});},[x]),Ft=xe.useCallback((P,B)=>{let V=X.splitTask(K,P.id,B);ne(V),Q({isOpen:false,x:0,y:0,task:null});},[K]),Wa=xe.useCallback(P=>{p?.(P),et(P);},[p]),Xr=xe.useCallback((P,B,V)=>{let q=new Map,Z=Er=>{Er.forEach(Rr=>{Rr.dependencies&&q.set(Rr.id,Rr.dependencies),Rr.subtasks&&Z(Rr.subtasks);});};Z(V);let oe=q.get(B)||[];q.set(B,[...oe,P]);let ft=new Set,$e=new Set,Zr=Er=>{if(!ft.has(Er)){ft.add(Er),$e.add(Er);let Rr=q.get(Er)||[];for(let Yn of Rr){if(!ft.has(Yn)&&Zr(Yn))return true;if($e.has(Yn))return true}}return $e.delete(Er),false};return Zr(B)},[]),ga=xe.useCallback((P,B)=>{if(Xr(P.id,B,K)){console.warn("Cannot create dependency: would create a circular dependency"),alert(`Cannot create this dependency: it would create a circular dependency chain.
|
|
45
|
+
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function Wo({templates:e,onSelectTemplate:t,className:r}){let[a,n]=ke.useState(false),o=ke.useRef(null),i=ke.useRef(null);ke.useEffect(()=>{function s(u){o.current&&!o.current.contains(u.target)&&i.current&&!i.current.contains(u.target)&&n(false);}if(a)return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[a]);let l=s=>{t(s),n(false);},c=e.reduce((s,u)=>{let d=u.category||"Other";return s[d]||(s[d]=[]),s[d].push(u),s},{});return jsxRuntime.jsxs("div",{className:ee("relative inline-block",r),children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>n(!a),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:s=>{s.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",s.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:s=>{s.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",s.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:ee("w-4 h-4 transition-transform",a&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxRuntime.jsxs("div",{ref:o,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(c).map(([s,u])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:s})}),jsxRuntime.jsx("div",{children:u.map(d=>jsxRuntime.jsxs("button",{onClick:()=>l(d),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:d.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:d.name}),d.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:d.description})]})]},d.id))})]},s)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function Ko({board:e,isOpen:t,onClose:r,onImport:a,boardElementRef:n,className:o}){let[i,l]=ke.useState("export"),[c,s]=ke.useState("json"),[u,d]=ke.useState(null),f=ke.useRef(null);if(!t)return null;let p=async()=>{let y=n?.current||void 0,g=await qs(e,c,y);Xs(g,c);},x=async y=>{let g=y.target.files?.[0];if(g){try{let h=await Qs(g),v=g.name.endsWith(".json")?"json":"csv",m=Js(h,v);d(m),m.success&&a&&a(m,h);}catch(h){d({success:false,errors:[`Failed to read file: ${h instanceof Error?h.message:"Unknown error"}`]});}f.current&&(f.current.value="");}};return jsxRuntime.jsxs("div",{className:ee("fixed inset-0 z-[9999] flex items-center justify-center",o),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:r,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>l("export"),className:ee("flex-1 px-6 py-4 font-semibold transition-colors",i==="export"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>l("import"),className:ee("flex-1 px-6 py-4 font-semibold transition-colors",i==="import"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[i==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(y=>jsxRuntime.jsxs("button",{onClick:()=>s(y),className:ee("p-4 rounded-lg border-2 transition-all text-center",c===y?"border-blue-500 bg-blue-500/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[y==="json"&&"\u{1F4C4}",y==="csv"&&"\u{1F4CA}",y==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:y})]},y))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:p,className:"w-full py-3 px-4 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 text-white font-semibold rounded-lg transition-all shadow-lg shadow-blue-500/20",children:"Export Board"})]}),i==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:f,type:"file",accept:".json,.csv",onChange:x,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>f.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),u&&jsxRuntime.jsxs("div",{className:ee("p-4 rounded-lg",u.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:ee("font-semibold mb-2",u.success?"text-green-400":"text-red-400"),children:u.success?"\u2713 Import Successful":"\u2717 Import Failed"}),u.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",u.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",u.columnsImported]})]}),u.errors&&u.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:u.errors.map((y,g)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",y]},g))})]})]})]})]})]})}var fm=["URGENT","HIGH","MEDIUM","LOW"],gm=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],hm=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function jo({filters:e,sort:t,onFiltersChange:r,onSortChange:a,onReset:n,onFilterMyTasks:o,onFilterOverdue:i,onFilterHighPriority:l,availableUsers:c=[],availableLabels:s=[],availableColumns:u=[],showQuickFilters:d=true,compact:f=false,groupBy:p="none",onGroupByChange:x}){let[y,g]=ke.useState(true),h=ke.useCallback(b=>{r({search:b.target.value});},[r]),v=ke.useCallback(b=>{r({dateFilter:b.target.value});},[r]),m=ke.useCallback(b=>{a({by:b.target.value});},[a]),k=ke.useCallback(()=>{a({order:t.order==="asc"?"desc":"asc"});},[t.order,a]),w=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${f?"filter-bar--compact":""} ${y?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>g(!y),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:y?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:b=>{b.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:b=>{b.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:y?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),w&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!y&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[d&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),o&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),i&&jsxRuntime.jsx("button",{onClick:i,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),l&&jsxRuntime.jsx("button",{onClick:l,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:h,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:v,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:b=>{let C=b.target.value;r({priorities:C==="all"?[]:[C]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),fm.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]})}),c.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:b=>{let C=b.target.value;r({assignees:C==="all"?[]:[C]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),c.map(b=>jsxRuntime.jsx("option",{value:b.id,children:b.name},b.id))]})}),s.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:b=>{let C=b.target.value;r({labels:C==="all"?[]:[C]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),s.map(b=>jsxRuntime.jsx("option",{value:b,children:b},b))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:m,className:"filter-bar__select filter-bar__select--sm",children:gm.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:k,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),x&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:p,onChange:b=>x(b.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:hm.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))})}),w&&jsxRuntime.jsx("button",{onClick:n,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Yo({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:r,className:a,viewMode:n="kanban",onExportGanttPDF:o,onExportGanttExcel:i,onExportGanttPNG:l,onExportGanttCSV:c}){let[s,u]=ke.useState(false),d=ke.useRef(null);ke.useEffect(()=>{let p=x=>{d.current&&!d.current.contains(x.target)&&u(false);};return s&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p);}},[s]);let f=p=>{p(),u(false);};return jsxRuntime.jsxs("div",{className:ee("relative",a),ref:d,children:[jsxRuntime.jsxs("button",{onClick:()=>u(!s),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",p.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",p.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":s,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),s&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[n==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>f(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await i?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await l?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>f(()=>c?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>f(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>f(r),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var qo={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Xo={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#2563EB",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Zo={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Hr={dark:qo,light:Xo,neutral:Zo},Cn="dark";var Tn=ke.createContext(void 0),Nm="asakaa-theme";function Dl({children:e,defaultTheme:t=Cn,storageKey:r=Nm}){let[a,n]=ke.useState(()=>{if(typeof window<"u"){let l=localStorage.getItem(r);if(l&&(l==="dark"||l==="light"||l==="neutral"))return l}return t}),o=ke.useCallback(l=>{n(l),typeof window<"u"&&localStorage.setItem(r,l);},[r]);ke.useEffect(()=>{if(typeof window>"u")return;let l=document.documentElement,c=Hr[a];Object.entries(c.colors).forEach(([u,d])=>{d&&l.style.setProperty(`--theme-${Dm(u)}`,d);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([u,d])=>{let f=c.colors[u];f&&l.style.setProperty(d,f);}),l.setAttribute("data-theme",a),l.classList.remove("theme-dark","theme-light","theme-neutral"),l.classList.add(`theme-${a}`);},[a]);let i={theme:a,setTheme:o,themes:Hr};return jsxRuntime.jsx(Tn.Provider,{value:i,children:e})}function da(){let e=ke.useContext(Tn);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function Dm(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Jo({isOpen:e,onClose:t,className:r}){let{theme:a,setTheme:n}=da();return e?jsxRuntime.jsxs("div",{className:ee("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(Hr).map(([o,i])=>jsxRuntime.jsxs("button",{onClick:()=>{n(o),t();},className:ee("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",a===o?"border-blue-500 bg-blue-500/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:a===o?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:i.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:i.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[o==="dark"&&"Default dark theme with Linear-inspired colors",o==="light"&&"Clean light theme with high contrast",o==="neutral"&&"Monochrome zen theme"]})]}),a===o&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},o))})]})]}):null}var fe={dark:{bgPrimary:"#1A1D21",bgSecondary:"#23272E",bgGrid:"#1E2228",bgWeekend:"rgba(139, 92, 246, 0.03)",border:"#2D3139",borderLight:"#26292F",textPrimary:"#F5F5F7",textSecondary:"#B4B9C5",textTertiary:"#7C8394",accent:"#8B5CF6",accentHover:"#9D72F8",accentLight:"rgba(139, 92, 246, 0.12)",taskBarPrimary:"#8B5CF6",taskBarProgress:"#7C3AED",taskBarHandle:"#FFFFFF",dependency:"rgba(180, 185, 197, 0.25)",dependencyHover:"rgba(180, 185, 197, 0.45)",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.12)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.1)",statusTodo:"#7C8394",statusInProgress:"#8B5CF6",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.05)",focusRing:"#8B5CF6"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F9FAFB",bgGrid:"#FCFCFD",bgWeekend:"rgba(37, 99, 235, 0.03)",border:"#E5E7EB",borderLight:"#F0F1F3",textPrimary:"#111827",textSecondary:"#4B5563",textTertiary:"#9CA3AF",accent:"#2563EB",accentHover:"#1D4ED8",accentLight:"rgba(37, 99, 235, 0.08)",taskBarPrimary:"#2563EB",taskBarProgress:"#1E40AF",taskBarHandle:"#FFFFFF",dependency:"rgba(75, 85, 99, 0.2)",dependencyHover:"rgba(75, 85, 99, 0.4)",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#2563EB",todayLight:"rgba(37, 99, 235, 0.08)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#9CA3AF",statusInProgress:"#2563EB",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.03)",focusRing:"#2563EB"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#FEFEFE",bgWeekend:"rgba(41, 37, 36, 0.025)",border:"#E7E5E4",borderLight:"#F0EFEE",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.06)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"rgba(87, 83, 78, 0.2)",dependencyHover:"rgba(87, 83, 78, 0.35)",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.04)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.06)",statusTodo:"#A8A29E",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.025)",focusRing:"#292524"}};function El(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return fe[e]||fe.dark;let t=document.documentElement,r=getComputedStyle(t),a=(o,i)=>r.getPropertyValue(o).trim()||i;return {bgPrimary:a("--theme-bg-primary",fe[e].bgPrimary),bgSecondary:a("--theme-bg-secondary",fe[e].bgSecondary),bgGrid:a("--theme-bg-card",fe[e].bgGrid),bgWeekend:a("--theme-bg-hover",fe[e].bgWeekend),border:a("--theme-border-primary",fe[e].border),borderLight:a("--theme-border-subtle",fe[e].borderLight),textPrimary:a("--theme-text-primary",fe[e].textPrimary),textSecondary:a("--theme-text-secondary",fe[e].textSecondary),textTertiary:a("--theme-text-tertiary",fe[e].textTertiary),accent:a("--theme-accent-primary",fe[e].accent),accentHover:a("--theme-accent-hover",fe[e].accentHover),accentLight:a("--theme-accent-primary",fe[e].accentLight),taskBarPrimary:a("--theme-accent-primary",fe[e].taskBarPrimary),taskBarProgress:a("--theme-accent-hover",fe[e].taskBarProgress),taskBarHandle:a("--theme-text-inverse",fe[e].taskBarHandle||"#FFFFFF"),dependency:a("--theme-border-secondary",fe[e].dependency),dependencyHover:a("--theme-border-secondary",fe[e].dependencyHover),criticalPath:a("--theme-error",fe[e].criticalPath),criticalPathLight:a("--theme-error",fe[e].criticalPathLight),today:e==="light"?a("--theme-accent-primary",fe[e].today):e==="neutral"?a("--theme-text-primary",fe[e].today):a("--theme-error",fe[e].today),todayLight:e==="light"?a("--theme-accent-primary",fe[e].todayLight):e==="neutral"?a("--theme-text-primary",fe[e].todayLight):a("--theme-error",fe[e].todayLight),milestone:a("--theme-warning",fe[e].milestone),milestoneLight:a("--theme-warning",fe[e].milestoneLight),statusTodo:a("--theme-text-tertiary",fe[e].statusTodo),statusInProgress:a("--theme-accent-primary",fe[e].statusInProgress),statusCompleted:a("--theme-success",fe[e].statusCompleted),hoverBg:a("--theme-bg-hover",fe[e].hoverBg),focusRing:a("--theme-accent-primary",fe[e].focusRing)}}function ts({options:e,value:t,onChange:r,theme:a}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`},children:e.map(n=>{let o=t===n.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>r(n.value),className:"relative px-3 py-1.5 rounded-md text-xs transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:o?a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500,zIndex:o?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[o&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"activeSegment",className:"absolute inset-0 rounded-md",style:{backgroundColor:a.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),n.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:n.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:o?"#FFFFFF":a.textTertiary},children:n.label})]},n.value)})})}function Nn({theme:e,timeScale:t,onTimeScaleChange:r,zoom:a,onZoomChange:n,currentTheme:o,onThemeChange:i,rowDensity:l,onRowDensityChange:c,showThemeSelector:s=true}){let u=[{value:"day",label:"Day",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3.5 h-3.5"})},{value:"week",label:"Week",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3.5 h-3.5"})},{value:"month",label:"Month",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3.5 h-3.5"})}],d=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}],f=[{value:"compact",label:"Compact",icon:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-3.5 h-3.5"})},{value:"comfortable",label:"Comfortable",icon:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-3.5 h-3.5"})},{value:"spacious",label:"Spacious",icon:jsxRuntime.jsx(lucideReact.AlignJustify,{className:"w-3.5 h-3.5"})}];return jsxRuntime.jsxs("div",{className:"h-14 px-6 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"View"}),jsxRuntime.jsx(ts,{options:u,value:t,onChange:p=>r(p),theme:e})]}),jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Zoom"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.max(.5,a-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.borderLight}`},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5",style:{color:e.textSecondary}})}),jsxRuntime.jsxs("div",{className:"px-3 py-1 rounded-md text-xs tabular-nums min-w-[50px] text-center",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.borderLight}`,color:e.textPrimary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[Math.round(a*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>n(Math.min(2,a+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.borderLight}`},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5",style:{color:e.textSecondary}})})]})]}),jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Density"}),jsxRuntime.jsx(ts,{options:f,value:l,onChange:p=>c(p),theme:e})]})]}),s&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Theme"}),jsxRuntime.jsx(ts,{options:d,value:o,onChange:p=>i(p),theme:e})]})]})}function Dn({columns:e,onToggleColumn:t,theme:r}){let[a,n]=ke.useState(false),[o,i]=ke.useState({x:0,y:0}),l=ke.useRef(null),c=ke.useRef(null);ke.useEffect(()=>{if(!a)return;let u=d=>{l.current&&!l.current.contains(d.target)&&n(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);let s=e.filter(u=>u.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:c,onClick:()=>{if(!a&&c.current){let u=c.current.getBoundingClientRect();i({x:u.left,y:u.bottom+4});}n(!a);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`,color:r.textSecondary},whileHover:{backgroundColor:r.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:a&&jsxRuntime.jsx(Ie,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:l,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${o.x}px`,top:`${o.y}px`,backgroundColor:r.bgSecondary,border:`1px solid ${r.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),s.map(u=>jsxRuntime.jsxs("button",{onClick:()=>{t(u.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:r.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.hoverBg;},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:u.label}),u.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:r.accent}})]},u.id))]})})})})]})}function pa({isOpen:e,x:t,y:r,items:a,onClose:n,theme:o}){let i=ke.useRef(null);return ke.useEffect(()=>{if(!e)return;let l=s=>{i.current&&!i.current.contains(s.target)&&n();},c=s=>{s.key==="Escape"&&n();};return document.addEventListener("mousedown",l),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",c);}},[e,n]),e?jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:i,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg shadow-xl",style:{left:`${t}px`,top:`${r}px`,backgroundColor:o.bgSecondary,border:`1px solid ${o.border}`},children:jsxRuntime.jsx("div",{className:"py-1",children:a.map(l=>jsxRuntime.jsxs("div",{children:[l.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:o.borderLight}}),jsxRuntime.jsxs("button",{onClick:()=>{l.disabled||(l.onClick(),n());},disabled:l.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:l.disabled?o.textTertiary:o.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:l.disabled?"not-allowed":"pointer",opacity:l.disabled?.5:1},onMouseEnter:c=>{l.disabled||(c.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="transparent";},children:[l.icon&&jsxRuntime.jsx("span",{style:{color:o.textSecondary},children:l.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:l.label}),l.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:o.textTertiary}})]})]},l.id))})})}):null}var Rt={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"})};function Al({tasks:e,selectedTaskIds:t,onTaskSelect:r,onTaskCreate:a,onTaskDelete:n,onTaskDuplicate:o,onTaskMove:i,onTaskIndent:l,onTaskOutdent:c,onTaskRename:s,onTaskToggleExpand:u,onOpenTaskModal:d,enableKeyboard:f=true}){let p=ke.useRef(false),x=ke.useCallback(m=>{p.current=m;},[]),y=ke.useCallback(m=>{let k=[],w=b=>{for(let C of b)k.push(C),C.subtasks&&C.subtasks.length>0&&C.isExpanded&&w(C.subtasks);};return w(m),k},[]),g=ke.useCallback(()=>{let m=y(e);for(let k of m)if(t.has(k.id))return k;return null},[e,t,y]),h=ke.useCallback((m,k)=>{let w=y(e);if(w.length===0)return;let b=g();if(!b){r(w[0].id,false);return}let C=w.findIndex(N=>N.id===b.id);if(C===-1)return;let T=m==="up"?C-1:C+1;if(T<0||T>=w.length)return;let D=w[T];r(D.id,k);},[e,g,y,r]),v=ke.useCallback(m=>{if(!f)return;let k=m.target;if(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable||p.current){m.key==="Escape"&&(k.blur(),p.current=false);return}let C=navigator.platform.toUpperCase().indexOf("MAC")>=0?m.metaKey:m.ctrlKey,T=Array.from(t),D=g();if(m.key==="ArrowUp"){m.preventDefault(),h("up",m.shiftKey);return}if(m.key==="ArrowDown"){m.preventDefault(),h("down",m.shiftKey);return}if(D&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){D.subtasks&&D.subtasks.length>0&&(m.preventDefault(),(m.key==="ArrowRight"&&!D.isExpanded||m.key==="ArrowLeft"&&D.isExpanded)&&u(D.id));return}if(m.altKey&&(m.key==="ArrowUp"||m.key==="ArrowDown")){T.length>0&&(m.preventDefault(),i(T,m.key==="ArrowUp"?"up":"down"));return}if(m.key==="Tab"&&!m.shiftKey){T.length>0&&(m.preventDefault(),l(T));return}if(m.key==="Tab"&&m.shiftKey){T.length>0&&(m.preventDefault(),c(T));return}if(m.key==="Enter"&&!m.shiftKey&&!C){D&&(m.preventDefault(),a(D.id,"below"));return}if(m.key==="Enter"&&m.shiftKey&&!C){D&&(m.preventDefault(),a(D.id,"above"));return}if(m.key==="Enter"&&C){D&&(m.preventDefault(),d(D.id));return}if(m.key==="F2"){D&&(m.preventDefault(),s(D.id));return}if(m.key==="Delete"||m.key==="Backspace"&&C){T.length>0&&(m.preventDefault(),n(T));return}if(m.key==="d"&&C&&!m.shiftKey){T.length>0&&(m.preventDefault(),o(T));return}},[f,t,g,h,a,n,o,i,l,c,s,u,d]);return ke.useEffect(()=>{if(f)return window.addEventListener("keydown",v),()=>{window.removeEventListener("keydown",v);}},[f,v]),{setIsEditing:x}}function Fl(){let[e,t]=ke.useState(new Set),[r,a]=ke.useState(null),n=ke.useCallback(d=>{t(new Set([d])),a(d);},[]),o=ke.useCallback(d=>{t(f=>{let p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p}),a(d);},[]),i=ke.useCallback((d,f)=>{if(!r){n(d);return}let p=f.indexOf(r),x=f.indexOf(d);if(p===-1||x===-1){n(d);return}let y=Math.min(p,x),g=Math.max(p,x),h=f.slice(y,g+1);t(new Set(h)),a(d);},[r,n]),l=ke.useCallback((d,f,p,x)=>{x?i(d,f):p?o(d):n(d);},[n,o,i]),c=ke.useCallback((d,f)=>{f?t(p=>{let x=new Set(p);return x.add(d),x}):n(d);},[n]),s=ke.useCallback(()=>{t(new Set),a(null);},[]),u=ke.useCallback(d=>e.has(d),[e]);return {selectedTaskIds:e,selectTask:n,toggleTaskSelection:o,selectTaskRange:i,handleTaskClick:l,handleKeyboardSelection:c,clearSelection:s,isTaskSelected:u}}function ma(e){let t=[],r=(a,n,o=0)=>{for(let i=0;i<a.length;i++){let l={...a[i],parentId:n,level:o,position:i};t.push(l),l.subtasks&&l.subtasks.length>0&&l.isExpanded&&r(l.subtasks,l.id,o+1);}};return r(e),t}function as(e,t){for(let r of e)if(r.subtasks){if(r.subtasks.some(n=>n.id===t))return r;let a=as(r.subtasks,t);if(a)return a}return null}function ns(e,t){if(t.length===0)return e;let r=ma(e),a=t[0],n=r.findIndex(d=>d.id===a);if(n<=0)return e;let o=r[n-1],i=(d,f)=>{let p=[];return {tasks:d.filter(y=>{if(f.has(y.id))return p.push(y),false;if(y.subtasks){let g=i(y.subtasks,f);y.subtasks=g.tasks,p.push(...g.removed);}return true}),removed:p}},l=(d,f,p)=>d.map(x=>x.id===f?{...x,subtasks:[...x.subtasks||[],...p],isExpanded:true}:x.subtasks?{...x,subtasks:l(x.subtasks,f,p)}:x),c=new Set(t),{tasks:s,removed:u}=i(e,c);return l(s,o.id,u)}function os(e,t){if(t.length===0)return e;let r=[...e];for(let a of t){let n=as(r,a);if(!n)continue;let o=as(r,n.id),i=(s,u,d)=>{for(let f=0;f<s.length;f++){let p=s[f];if(p.id===u&&p.subtasks){let x=p.subtasks.findIndex(y=>y.id===d);if(x!==-1){let[y]=p.subtasks.splice(x,1);return y}}if(p.subtasks){let x=i(p.subtasks,u,d);if(x)return x}}return null},l=(s,u,d)=>{let f=s.findIndex(p=>p.id===u);if(f!==-1)return s.splice(f+1,0,d),s;for(let p of s)p.subtasks&&l(p.subtasks,u,d);return s},c=i(r,n.id,a);c&&(o&&o.subtasks?l(o.subtasks,n.id,c):l(r,n.id,c));}return r}function ss(e,t,r){if(t.length===0)return e;let a=[...e],n=t[0],o=(i,l,c)=>{let s=i.findIndex(d=>d.id===l);if(s===-1){for(let d of i)if(d.subtasks&&o(d.subtasks,l,c))return true;return false}let u=c==="up"?s-1:s+1;return u<0||u>=i.length?false:([i[s],i[u]]=[i[u],i[s]],true)};return o(a,n,r),a}function is(e,t){let r=new Set(t),a=n=>n.filter(o=>!r.has(o.id)).map(o=>o.subtasks?{...o,subtasks:a(o.subtasks)}:o);return a(e)}function ls(e,t){let r=[...e];for(let a of t){let n=i=>{let l=i.findIndex(u=>u.id===a);if(l===-1){for(let u of i)if(u.subtasks&&n(u.subtasks))return true;return false}let c=i[l],s={...c,id:`${c.id}-copy-${Date.now()}`,name:`${c.name} (Copy)`,subtasks:c.subtasks?o(c.subtasks):void 0};return i.splice(l+1,0,s),true},o=i=>i.map(l=>({...l,id:`${l.id}-copy-${Date.now()}`,subtasks:l.subtasks?o(l.subtasks):void 0}));n(r);}return r}function Bl(e,t,r){let a=[...e],n=new Date,o=new Date(n);o.setDate(o.getDate()+7);let i={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:n,endDate:o,color:"#6366F1"},l=c=>{let s=c.findIndex(d=>d.id===t);if(s===-1){for(let d of c)if(d.subtasks&&l(d.subtasks))return true;return false}let u=r==="above"?s:s+1;return c.splice(u,0,i),true};return l(a),{tasks:a,newTask:i}}function cs(e,t,r){return e.map(a=>a.id===t?{...a,name:r}:a.subtasks?{...a,subtasks:cs(a.subtasks,t,r)}:a)}function ds(e,t){return e.map(r=>r.id===t?{...r,isExpanded:!r.isExpanded}:r.subtasks?{...r,subtasks:ds(r.subtasks,t)}:r)}function us(e,t){let r=new Date,a=new Date(r);a.setDate(a.getDate()+7);let n=c=>{for(let s of c){if(s.id===t)return s;if(s.subtasks){let u=n(s.subtasks);if(u)return u}}return null},o=n(e),i={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:r,endDate:a,color:o?.color||"#6366F1"},l=c=>c.map(s=>{if(s.id===t){let u=s.subtasks||[];return {...s,subtasks:[...u,i],isExpanded:true}}return s.subtasks?{...s,subtasks:l(s.subtasks)}:s});return {tasks:l(e),newTask:i}}var Hl={todo:{label:"To Do",color:"#94a3b8",icon:"circle"},"in-progress":{label:"In Progress",color:"#60a5fa",icon:"circle-dot"},completed:{label:"Completed",color:"#34d399",icon:"check-circle"}},Ul=({icon:e,color:t})=>e==="circle"?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"})}):e==="circle-dot"?jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3",fill:t})]}):jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:t,fillOpacity:"0.2"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});function Gl({status:e="todo",onChange:t,className:r}){let[a,n]=ke.useState(false),[o,i]=ke.useState({top:0,left:0}),l=ke.useRef(null),c=ke.useRef(null);ke.useEffect(()=>{if(a&&c.current){let f=c.current.getBoundingClientRect();i({top:f.bottom+window.scrollY+8,left:f.left+window.scrollX});}},[a]),ke.useEffect(()=>{let f=p=>{l.current&&!l.current.contains(p.target)&&!c.current?.contains(p.target)&&n(false);};if(a)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a]),ke.useEffect(()=>{let f=p=>{p.key==="Escape"&&n(false);};if(a)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[a]);let s=f=>{t(f),n(false);},u=Hl[e],d=u.color;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:c,onClick:()=>n(!a),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:`${d}10`,boxShadow:`0 0 0 2px ${d}30 inset`},title:u.label,children:jsxRuntime.jsx(Ul,{icon:u.icon,color:d})}),a&&jsxRuntime.jsx(Ie,{children:jsxRuntime.jsxs("div",{ref:l,className:"status-selector-menu",style:{position:"absolute",top:`${o.top}px`,left:`${o.left}px`,zIndex:99999,minWidth:"180px",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Status"})}),jsxRuntime.jsx("div",{className:"py-1",children:Object.entries(Hl).map(([f,p])=>jsxRuntime.jsxs("button",{onClick:()=>s(f),className:"w-full px-3 py-2 flex items-center gap-2.5 text-sm font-medium transition-all active:scale-[0.98] status-option",style:{color:p.color,background:"transparent"},onMouseEnter:x=>{x.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:x=>{x.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(Ul,{icon:p.icon,color:p.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:p.label}),e===f&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},f))})]})})]})}function En({tasks:e,theme:t,rowHeight:r,availableUsers:a=[],templates:n,onTaskClick:o,onTaskDblClick:i,onTaskContextMenu:l,onTaskToggle:c,scrollTop:s,columns:u,onToggleColumn:d,onTaskUpdate:f,onTaskIndent:p,onTaskOutdent:x,onTaskMove:y,onMultiTaskDelete:g,onTaskDuplicate:h,onTaskCreate:v,onTaskRename:m,onCreateSubtask:k,onOpenTaskModal:w}){let[b,C]=ke.useState(null),[T,D]=ke.useState(false),[N,P]=ke.useState(null),[I,E]=ke.useState(""),A=ke.useRef(null),z=ke.useRef(null),[U,J]=ke.useState({isOpen:false,x:0,y:0,type:"header"});ke.useEffect(()=>{function _(H){A.current&&!A.current.contains(H.target)&&D(false);}if(T)return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[T]),ke.useEffect(()=>{N&&z.current&&(z.current.focus(),z.current.select());},[N]);let{selectedTaskIds:X,handleTaskClick:ae,isTaskSelected:Ee}=Fl(),{setIsEditing:te}=Al({tasks:e,selectedTaskIds:X,onTaskSelect:(_,H)=>{let He=ma(e).map(Fe=>Fe.id);ae(_,He,H||false,false);},onTaskCreate:v||(()=>{}),onTaskDelete:g||(()=>{}),onTaskDuplicate:h||(()=>{}),onTaskMove:y||(()=>{}),onTaskIndent:p||(()=>{}),onTaskOutdent:x||(()=>{}),onTaskRename:_=>{let H=ma(e).find(Me=>Me.id===_);H&&tt(H);},onTaskToggleExpand:c||(()=>{}),onOpenTaskModal:_=>{let H=ma(e).find(Me=>Me.id===_);H&&w&&w(H);},enableKeyboard:true}),Se=(_,H=0)=>{let Me=[];for(let He of _)Me.push({task:He,level:H}),He.subtasks&&He.subtasks.length>0&&He.isExpanded&&Me.push(...Se(He.subtasks,H+1));return Me},B=Se(e),j=48,Le=_=>!_.startDate||!_.endDate?"-":`${Math.ceil((_.endDate.getTime()-_.startDate.getTime())/(1e3*60*60*24))}d`,tt=_=>{P(_.id),E(_.name),te(true);},Lt=_=>{I.trim()&&I!==e.find(H=>H.id===_)?.name&&m?.(_,I.trim()),P(null),E(""),te(false);},xe=()=>{P(null),E(""),te(false);},re=(_,H)=>{H.stopPropagation(),k?.(_.id);},ie=(_,H,Me)=>{switch(_.id){case "name":let He=N===H.id,Fe=b===H.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${Me*24}px`},children:[H.subtasks&&H.subtasks.length>0&&jsxRuntime.jsx("button",{onClick:se=>{se.stopPropagation(),c?.(H.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:H.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}),jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full flex-shrink-0 border",style:{backgroundColor:H.color||"#6366F1",opacity:H.parentId?.6:1,borderColor:H.isMilestone?t.accent:"transparent",borderWidth:H.isMilestone?"2px":"0px"},title:H.isMilestone?"Milestone":H.parentId?"Subtask":"Task"}),He?jsxRuntime.jsx("input",{ref:z,type:"text",value:I,onChange:se=>E(se.target.value),onKeyDown:se=>{se.key==="Enter"?Lt(H.id):se.key==="Escape"&&xe();},onBlur:()=>Lt(H.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:se=>se.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"truncate flex-1",style:{color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:Me===0?"14px":Me===1?"13px":"12px",fontWeight:H.isMilestone?600:H.subtasks&&H.subtasks.length>0?500:400,opacity:Me===0?1:Me===1?.95:.88},children:H.name}),Fe&&!He&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:se=>se.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:se=>re(H,se),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:se=>{se.stopPropagation(),tt(H);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":return jsxRuntime.jsx("div",{onClick:se=>se.stopPropagation(),children:jsxRuntime.jsx(qa,{startDate:H.startDate?typeof H.startDate=="string"?H.startDate:H.startDate.toISOString().split("T")[0]:void 0,endDate:H.endDate?typeof H.endDate=="string"?H.endDate:H.endDate.toISOString().split("T")[0]:void 0,onChange:(se,it)=>{f?.(H.id,{startDate:se?new Date(se):void 0,endDate:it?new Date(it):void 0});}})});case "duration":return jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:Le(H)});case "assignees":let $t=a.filter(se=>H.assignees?.some(it=>it.name===se.name||it.initials===se.initials));return jsxRuntime.jsx("div",{onClick:se=>se.stopPropagation(),children:jsxRuntime.jsx(Xa,{assignedUsers:$t,availableUsers:a,onChange:se=>{let it=se.map(Ye=>({name:Ye.name,initials:Ye.initials,color:Ye.color}));f?.(H.id,{assignees:it.length>0?it:void 0});}})});case "status":return jsxRuntime.jsx("div",{onClick:se=>se.stopPropagation(),children:jsxRuntime.jsx(Gl,{status:H.status||"todo",onChange:se=>{f?.(H.id,{status:se,progress:se==="completed"?100:H.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${H.progress}%`,backgroundColor:H.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[H.progress,"%"]})]});default:return null}},Ft=_=>[{id:"hide",label:"Hide Column",icon:Rt.Hide,onClick:()=>d(_),disabled:_==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:Rt.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:Rt.SortDesc,onClick:()=>{}}],Gt=_=>[{id:"edit",label:"Edit Task",icon:Rt.Edit,onClick:()=>{}},{id:"addSubtask",label:"Add Subtask",icon:Rt.Add,onClick:()=>{}},{id:"addDependency",label:"Add Dependency",icon:Rt.Link,onClick:()=>{}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markComplete",label:_.status==="completed"?"Mark Incomplete":"Mark Complete",icon:Rt.Progress,onClick:()=>{let H=_.status==="completed"?"in-progress":"completed",Me=_.status==="completed"?_.progress:100;f?.(_.id,{status:H,progress:Me});}},{id:"setInProgress",label:"Set In Progress",icon:Rt.Progress,onClick:()=>{f?.(_.id,{status:"in-progress"});},disabled:_.status==="in-progress"},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"delete",label:"Delete Task",icon:Rt.Delete,onClick:()=>{window.confirm(`Delete task "${_.name}"?`)&&g?.([_.id]);}}],_t=u.filter(_=>_.visible);return jsxRuntime.jsxs("div",{className:"h-full overflow-auto",style:{backgroundColor:t.bgPrimary,borderRight:`1px solid ${t.border}`},children:[jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center border-b",style:{backgroundColor:t.bgGrid,borderColor:t.border,height:`${j}px`},children:[_t.map(_=>jsxRuntime.jsx("div",{className:"flex items-center px-4 border-r cursor-pointer hover:bg-opacity-50 transition-colors relative",style:{width:`${_.width}px`,borderColor:t.borderLight,height:"100%"},onContextMenu:H=>{H.preventDefault(),J({isOpen:true,x:H.clientX,y:H.clientY,type:"header",columnId:_.id});},onMouseEnter:H=>{H.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:H=>{H.currentTarget.style.backgroundColor="transparent";},children:jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:_.label})},_.id)),jsxRuntime.jsxs("div",{className:"px-3 flex items-center gap-2 h-full",children:[jsxRuntime.jsx(Dn,{columns:u,onToggleColumn:d,theme:t}),jsxRuntime.jsxs("button",{onClick:()=>D(!T),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors relative group",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:[jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"}),T&&jsxRuntime.jsxs("div",{ref:A,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:_=>_.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>D(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]})]}),B.map(({task:_,level:H},Me)=>{let He=Ee(_.id);return jsxRuntime.jsx(framerMotion.motion.div,{className:"flex items-center border-b cursor-pointer group",style:{height:`${r}px`,borderTop:`1px solid ${He?t.accent:t.borderLight}`,borderRight:`1px solid ${He?t.accent:t.borderLight}`,borderBottom:`1px solid ${He?t.accent:t.borderLight}`,borderLeft:He?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:He?t.accentLight:Me%2===0?t.bgPrimary:t.bgGrid},onMouseEnter:()=>C(_.id),onMouseLeave:()=>C(null),onClick:Fe=>{let se=ma(e).map(ut=>ut.id),Ye=navigator.platform.toUpperCase().indexOf("MAC")>=0?Fe.metaKey:Fe.ctrlKey;ae(_.id,se,Ye,Fe.shiftKey),o?.(_);},onDoubleClick:Fe=>{Fe.stopPropagation(),i?.(_);},onContextMenu:Fe=>{Fe.preventDefault(),J({isOpen:true,x:Fe.clientX,y:Fe.clientY,type:"task",task:_}),l?.(_,Fe);},whileHover:{backgroundColor:He?t.accentLight:t.hoverBg},children:_t.map(Fe=>jsxRuntime.jsx("div",{className:"px-4 border-r flex items-center",style:{width:`${Fe.width}px`,borderColor:b===_.id?t.border:t.borderLight,height:"100%"},children:ie(Fe,_,Fe.id==="name"?H:0)},`${_.id}-${Fe.id}`))},_.id)}),jsxRuntime.jsx(pa,{isOpen:U.isOpen,x:U.x,y:U.y,items:U.type==="header"&&U.columnId?Ft(U.columnId):U.type==="task"&&U.task?Gt(U.task):[],onClose:()=>J({...U,isOpen:false}),theme:t})]})}function Wl(e,t){let[r,a]=ke.useState("none"),[n,o]=ke.useState(0),[i,l]=ke.useState(e),[c,s]=ke.useState(t),[u,d]=ke.useState(null),[f,p]=ke.useState(null),[x,y]=ke.useState(null),[g,h]=ke.useState(null),[v,m]=ke.useState(0),[k,w]=ke.useState(0),[b,C]=ke.useState(null),[T,D]=ke.useState(false);return {dragMode:r,setDragMode:a,dragOffset:n,setDragOffset:o,ghostX:i,setGhostX:l,ghostWidth:c,setGhostWidth:s,connectionLine:u,setConnectionLine:d,hoveredTaskId:f,setHoveredTaskId:p,activeZone:x,setActiveZone:y,draggedSegmentIndex:g,setDraggedSegmentIndex:h,draggedSegmentStartX:v,setDraggedSegmentStartX:m,segmentDragOffsetX:k,setSegmentDragOffsetX:w,hoveredSegmentIndex:b,setHoveredSegmentIndex:C,isHovered:T,setIsHovered:D,isDragging:r!=="none",isResizing:r==="resize-start"||r==="resize-end",isConnecting:r==="connect",resetDragState:(A,z)=>{a("none"),d(null),p(null),l(A),s(z),w(0),h(null),m(0);}}}function Rn({task:e,x:t,y:r,width:a,theme:n,dayWidth:o,startDate:i,templates:l,onClick:c,onDoubleClick:s,onContextMenu:u,onDateChange:d,onDependencyCreate:f,allTaskPositions:p=[]}){let x=Wl(t,a),y=ke.useRef(null),{dragMode:g,setDragMode:h,dragOffset:v,setDragOffset:m,ghostX:k,setGhostX:w,ghostWidth:b,setGhostWidth:C,connectionLine:T,setConnectionLine:D,hoveredTaskId:N,setHoveredTaskId:P,activeZone:I,setActiveZone:E,draggedSegmentIndex:A,setDraggedSegmentIndex:z,draggedSegmentStartX:U,setDraggedSegmentStartX:J,segmentDragOffsetX:X,setSegmentDragOffsetX:ae,hoveredSegmentIndex:Ee,setHoveredSegmentIndex:te,isHovered:Se,setIsHovered:B,isDragging:j,isResizing:Le,isConnecting:tt,resetDragState:Lt}=x,xe=32,re=8,ie=e.endDate&&e.endDate<new Date&&e.progress<100,Ft=e.isCriticalPath,Gt=n.name==="neutral"||n.today==="#1C1917",_=(O=>O>=80?20:O>=60?15:O>=50?12:10)(a),H=a<50,Me=a<40,He=O=>O.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Fe=()=>{let O=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${O} day${O!==1?"s":""}`},$t=O=>Math.round(O/o)*o,se=O=>{let ge=Math.round(O/o),ue=new Date(i);return ue.setDate(ue.getDate()+ge),ue},it=(O,ge)=>{for(let ue of p){if(ue.id===e.id)continue;let S=5;if(O>=ue.x-S&&O<=ue.x+ue.width+S&&ge>=ue.y-S&&ge<=ue.y+ue.height+S)return ue.id}return null},Ye=ke.useCallback((O,ge,ue)=>{O.preventDefault(),O.stopPropagation();let S=y.current?.ownerSVGElement;if(!S)return;let G=S.createSVGPoint();G.x=O.clientX,G.y=O.clientY;let pe=G.matrixTransform(S.getScreenCTM()?.inverse()),we=ue!==void 0?ue:t,Ne=ge;if(!Ne){let Pt=pe.x-we;O.shiftKey?(Ne="connect",D({x:t+a,y:r+xe/2})):O.ctrlKey||O.metaKey?Ne="move":O.altKey?Ne=Pt<a/2?"resize-start":"resize-end":Me?Pt<a/2?Ne="move":Ne="resize-end":H?Pt<=_/2?Ne="resize-start":Pt>=a-_/2?Ne="resize-end":Ne="move":Pt<=_?Ne="resize-start":Pt>=a-_?Ne="resize-end":Ne="move";}h(Ne),B(false),E(null),Ne==="move"?m(pe.x-we):Ne==="connect"?D({x:t+a,y:r+xe/2}):m(0),w(we),C(a);},[t,a,r,xe]),ut=ke.useCallback(O=>{if(g==="none")return;let ge=y.current?.ownerSVGElement;if(!ge)return;let ue=ge.createSVGPoint();ue.x=O.clientX,ue.y=O.clientY;let S=ue.matrixTransform(ge.getScreenCTM()?.inverse());if(g==="connect"){D({x:S.x,y:S.y});let G=it(S.x,S.y);P(G);}else if(g==="move"){let G=S.x-v,pe=$t(G);if(w(pe),C(a),e.segments&&e.segments.length>0&&A!==null){let we=pe-U;ae(we);}}else if(g==="resize-start"){let G=S.x,pe=$t(G),we=t+a-pe;we>=o&&(w(pe),C(we));}else if(g==="resize-end"){let G=S.x,we=$t(G)-t;we>=o&&C(we);}},[g,t,a,o,v,e,$t,A,U,it,P,D,w,C,ae]),Nr=ke.useCallback(()=>{if(g!=="none"){if(g==="connect")N&&f&&f(e,N),D(null),P(null);else {let O=e.endDate.getTime()-e.startDate.getTime(),ge,ue,S=true;if(g==="move"){if(ge=se(k),ue=new Date(ge.getTime()+O),e.segments&&e.segments.length>0&&A!==null){let G=Math.round(X/o),pe=e.segments.map((Bt,jn)=>{if(jn===A){let Xr=new Date(Bt.startDate),Zr=new Date(Bt.endDate);return Xr.setDate(Xr.getDate()+G),Zr.setDate(Zr.getDate()+G),{startDate:Xr,endDate:Zr}}return Bt}),we=pe.flatMap(Bt=>[Bt.startDate,Bt.endDate]),Ne=new Date(Math.min(...we.map(Bt=>Bt.getTime()))),Pt=new Date(Math.max(...we.map(Bt=>Bt.getTime())));d?.({...e,segments:pe},Ne,Pt),Lt(t,a);return}}else g==="resize-start"?(ge=se(k),ue=e.endDate,ge>=ue&&(console.warn("Invalid date range: start date must be before end date"),S=false)):g==="resize-end"?(ge=e.startDate,ue=se(k+b),ue<=ge&&(console.warn("Invalid date range: end date must be after start date"),S=false)):S=false;S&&ge&&ue&&(ue.getTime()-ge.getTime()<864e5?console.warn("Invalid date range: task must be at least 1 day long"):d?.(e,ge,ue));}Lt(t,a);}},[g,k,b,e,d,N,f,t,a,o,se,X,A,Lt]);ke.useEffect(()=>{if(g==="none")return;let O=ue=>{ut(ue);},ge=()=>{Nr();};return window.addEventListener("mousemove",O),window.addEventListener("mouseup",ge),()=>{window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",ge);}},[g,ut,Nr]);let he=j&&!tt?k:t,de=j&&!tt?b:a,Yr=l.taskTooltip(e),qr=typeof Yr=="string"?Yr:"",Dr=l.taskClass(e);return jsxRuntime.jsxs("g",{ref:y,onMouseEnter:()=>!j&&B(true),onMouseLeave:()=>{j||(B(false),E(null));},onClick:()=>!j&&c?.(e),onDoubleClick:O=>{j||(O.stopPropagation(),s?.(e));},onContextMenu:O=>{O.preventDefault(),u?.(e,O);},children:[qr&&jsxRuntime.jsx("title",{dangerouslySetInnerHTML:{__html:qr}}),Se&&!j&&!H&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:r,width:_,height:xe,fill:I==="resize-start"?n.accent:"transparent",opacity:I==="resize-start"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>E("resize-start"),onMouseDown:O=>Ye(O,"resize-start")}),jsxRuntime.jsx("rect",{x:t+_,y:r,width:a-_*2,height:xe,fill:I==="move"?n.accent:"transparent",opacity:I==="move"?.1:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>E("move"),onMouseDown:O=>Ye(O,"move")}),jsxRuntime.jsx("rect",{x:t+a-_,y:r,width:_,height:xe,fill:I==="resize-end"?n.accent:"transparent",opacity:I==="resize-end"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>E("resize-end"),onMouseDown:O=>Ye(O,"resize-end")})]}),Se&&!j&&Me&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:r,width:a/2,height:xe,fill:I==="move"?n.accent:"transparent",opacity:I==="move"?.2:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>E("move"),onMouseDown:O=>Ye(O,"move")}),jsxRuntime.jsx("rect",{x:t+a/2,y:r,width:a/2,height:xe,fill:I==="resize-end"?n.accent:"transparent",opacity:I==="resize-end"?.2:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>E("resize-end"),onMouseDown:O=>Ye(O,"resize-end")}),Se&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+a/2,y1:r+4,x2:t+a/2,y2:r+xe-4,stroke:n.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),j&&!tt&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:k,y:r,width:b,height:xe,rx:re,fill:e.isCriticalPath?"#DC2626":n.taskBarPrimary,opacity:.3,stroke:e.isCriticalPath?"#EF4444":n.accent,strokeWidth:2,strokeDasharray:"4 4",initial:{opacity:0},animate:{opacity:.5},transition:{duration:.15},style:{pointerEvents:"none"}}),!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:he,y:r,width:de,height:xe,rx:re,fill:e.isCriticalPath?"#DC2626":e.color?e.color:n.taskBarPrimary,"data-task-class":Dr,initial:{opacity:0,scale:.95},animate:{opacity:j&&!tt?.15:e.parentId?.6:Se?.9:.8,scale:Se&&!j?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:O=>Ye(O),style:{cursor:j?tt?"crosshair":Le?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),!e.segments&&jsxRuntime.jsx("rect",{x:he,y:r,width:de*(e.progress/100),height:xe,rx:re,fill:e.isCriticalPath?"#DC2626":e.color?e.color:n.taskBarProgress,opacity:1,style:{pointerEvents:"none"}}),e.segments&&e.segments.map((O,ge)=>{let ue=(O.startDate.getTime()-i.getTime())/864e5*o,G=(O.endDate.getTime()-i.getTime())/(1e3*60*60*24)*o-ue+o,pe=j&&g==="move"&&A===ge,we=Ee===ge,Ne=pe?ue+X:ue;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!j&&te(ge),onMouseLeave:()=>!j&&te(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:Ne,y:r,width:G,height:xe,rx:re,fill:e.isCriticalPath?"#DC2626":e.color?e.color:n.taskBarPrimary,initial:{opacity:0,scale:.95},animate:{opacity:pe||e.parentId?.6:we?.9:.8,scale:we&&!j?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Pt=>{Pt.stopPropagation(),z(ge),J(ue),Ye(Pt,void 0,ue);},style:{cursor:j?tt?"crosshair":Le?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:Ne,y:r,width:G*(e.progress/100),height:xe,rx:re,fill:e.isCriticalPath?"#DC2626":e.color?e.color:n.taskBarProgress,opacity:1,style:{pointerEvents:"none"}})]},`segment-${ge}`)}),Gt&&(ie||Ft)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[Ft&&!ie&&jsxRuntime.jsx("rect",{x:he,y:r,width:de,height:xe,rx:re,fill:"none",stroke:n.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),ie&&jsxRuntime.jsx("rect",{x:he,y:r,width:de,height:xe,rx:re,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),de>60&&!e.segments&&(()=>{let O=l.taskLabel(e),ge=typeof O=="string"?O:e.name,ue=ge.length>Math.floor(de/8)?`${ge.substring(0,Math.floor(de/8))}...`:ge;return jsxRuntime.jsx("text",{x:he+12,y:r+xe/2,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"13",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:ue})})(),de>100&&e.progress>0&&e.progress<100&&!j&&!e.segments&&jsxRuntime.jsxs("text",{x:he+de-12,y:r+xe/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}),e.status&&de>80&&!j&&!e.segments&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:he+de-8,cy:r+8,r:4,fill:n.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:he+de-8,cy:r+8,r:4,fill:n.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(Se||Le)&&!tt&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{style:{pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{x:H?he-15:he-10,y:r-5,width:H?25:20,height:xe+10,fill:"transparent",onMouseDown:O=>Ye(O,"resize-start"),style:{cursor:"ew-resize"}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H?he-8:he-3,y:r+6,width:H?8:6,height:H?xe-12:xe-16,rx:3,fill:g==="resize-start"?n.accent:n.taskBarHandle,stroke:n.taskBarPrimary,strokeWidth:1.5,initial:{opacity:0,scale:0},animate:{opacity:1,scale:g==="resize-start"?1.2:1},transition:{duration:.2,type:"spring",stiffness:400,damping:25},style:{pointerEvents:"none"}})]}),jsxRuntime.jsxs("g",{style:{pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{x:he+de-10,y:r-5,width:H?25:20,height:xe+10,fill:"transparent",onMouseDown:O=>Ye(O,"resize-end"),style:{cursor:"ew-resize"}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:H?he+de:he+de-3,y:r+6,width:H?8:6,height:H?xe-12:xe-16,rx:3,fill:g==="resize-end"?n.accent:n.taskBarHandle,stroke:n.taskBarPrimary,strokeWidth:1.5,initial:{opacity:0,scale:0},animate:{opacity:1,scale:g==="resize-end"?1.2:1},transition:{duration:.2,type:"spring",stiffness:400,damping:25},style:{pointerEvents:"none"}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Se&&!j&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{style:{pointerEvents:"all"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+a+8,cy:r+xe/2,r:6,fill:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},exit:{scale:0},transition:{duration:.2,type:"spring",stiffness:400,damping:25},onMouseDown:O=>{O.stopPropagation(),Ye(O,"connect");},style:{cursor:"crosshair"}}),jsxRuntime.jsx("text",{x:t+a+20,y:r+xe/2,dominantBaseline:"middle",fill:n.textTertiary,fontSize:"10",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:"Link"})]})}),tt&&T&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:t+a,y1:r+xe/2,x2:T.x,y2:T.y,stroke:N?n.statusCompleted:n.accent,strokeWidth:N?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:N?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:T.x,cy:T.y,r:N?8:6,fill:N?n.statusCompleted:n.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),N&&jsxRuntime.jsx(framerMotion.motion.text,{x:T.x+15,y:T.y,dominantBaseline:"middle",fill:n.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:T.x+10},animate:{opacity:1,x:T.x+15},transition:{duration:.2},children:"Connect"})]}),(Se||j)&&!tt&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:he-2,y:r-2,width:de+4,height:xe+4,rx:re+2,fill:"none",stroke:j?n.accent:n.taskBarPrimary,strokeWidth:2,opacity:j?.6:.4,initial:{opacity:0},animate:{opacity:j?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),Le&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:k,y1:0,x2:k,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:k+b,y1:0,x2:k+b,y2:1e3,stroke:n.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Se&&!j&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:he+de/2-120,y:r-95,width:240,height:82,rx:8,fill:n.bgSecondary,stroke:n.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("path",{d:`M ${he+de/2-6} ${r-13} L ${he+de/2} ${r-3} L ${he+de/2+6} ${r-13}`,fill:n.bgSecondary,stroke:n.border,strokeWidth:1}),jsxRuntime.jsx("text",{x:he+de/2,y:r-73,textAnchor:"middle",fill:n.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:he+de/2-110,y:r-55,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:he+de/2-70,y:r-55,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:He(e.startDate)}),jsxRuntime.jsx("text",{x:he+de/2-110,y:r-40,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:he+de/2-70,y:r-40,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:He(e.endDate)}),jsxRuntime.jsx("text",{x:he+de/2+10,y:r-55,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:he+de/2+65,y:r-55,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Fe()}),jsxRuntime.jsx("text",{x:he+de/2+10,y:r-40,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:he+de/2+65,y:r-40,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:he+de/2-110,y:r-25,fill:n.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:he+de/2-50,y:r-25,fill:n.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(O=>O.name).join(", ").substring(0,30),e.assignees.map(O=>O.name).join(", ").length>30?"...":""]})]}),jsxRuntime.jsx("text",{x:he+de/2,y:r-18,textAnchor:"middle",fill:n.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:Me?"Left: move \u2022 Right: resize":H?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})]})}function In({x1:e,y1:t,x2:r,y2:a,theme:n,onDelete:o}){let[i,l]=ke.useState(false),c=r-e,s=a-t,u=e+c/2,d=`M ${e} ${t} C ${u} ${t}, ${u} ${a}, ${r} ${a}`,f=6,p=Math.atan2(s,c),x=r-f*Math.cos(p-Math.PI/6),y=a-f*Math.sin(p-Math.PI/6),g=r-f*Math.cos(p+Math.PI/6),h=a-f*Math.sin(p+Math.PI/6),v=n.dependency;return jsxRuntime.jsxs("g",{onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),children:[jsxRuntime.jsx("path",{d,fill:"none",stroke:"transparent",strokeWidth:20,strokeLinecap:"round",style:{cursor:"pointer"}}),jsxRuntime.jsx(framerMotion.motion.path,{d,fill:"none",stroke:v,strokeWidth:2,strokeLinecap:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:i?1:.6,strokeWidth:i?2.5:2},transition:{pathLength:{duration:.5,ease:"easeInOut"},opacity:{duration:.2},strokeWidth:{duration:.2}}}),jsxRuntime.jsx(framerMotion.motion.path,{d:`M ${r} ${a} L ${x} ${y} M ${r} ${a} L ${g} ${h}`,fill:"none",stroke:v,strokeWidth:2,strokeLinecap:"round",initial:{opacity:0,scale:.8},animate:{opacity:i?1:.6,scale:i?1.1:1,strokeWidth:i?2.5:2},transition:{duration:.2}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:r,cy:a,r:3,fill:v,initial:{scale:0},animate:{scale:i?1.33:1},transition:{scale:{delay:.3,duration:.2}}}),i&&o&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},transition:{duration:.2},onClick:m=>{m.stopPropagation(),o();},style:{cursor:"pointer"},children:[jsxRuntime.jsx("circle",{cx:u,cy:(t+a)/2,r:10,fill:n.bgSecondary,stroke:n.error||"#ef4444",strokeWidth:2}),jsxRuntime.jsx("line",{x1:u-4,y1:(t+a)/2-4,x2:u+4,y2:(t+a)/2+4,stroke:n.error||"#ef4444",strokeWidth:2,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:u+4,y1:(t+a)/2-4,x2:u-4,y2:(t+a)/2+4,stroke:n.error||"#ef4444",strokeWidth:2,strokeLinecap:"round"})]})]})}function An({task:e,x:t,y:r,theme:a,onClick:n}){let[o,i]=ke.useState(false),l=16,c=s=>s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return jsxRuntime.jsxs("g",{onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),onClick:()=>n?.(e),style:{cursor:"pointer"},children:[e.isCriticalPath&&jsxRuntime.jsx(framerMotion.motion.circle,{cx:t,cy:r+16,r:l+4,fill:a.criticalPathLight,initial:{scale:0},animate:{scale:o?1.2:1},transition:{duration:.3}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:t-l/2,y:r+16-l/2,width:l,height:l,fill:e.isCriticalPath?a.criticalPath:a.milestone,stroke:a.bgGrid,strokeWidth:2,transform:`rotate(45 ${t} ${r+16})`,initial:{scale:0,rotate:0},animate:{scale:o?1.15:1,rotate:45},transition:{duration:.3,type:"spring",stiffness:300,damping:20}}),o&&jsxRuntime.jsx(framerMotion.motion.rect,{x:t-(l+4)/2,y:r+16-(l+4)/2,width:l+4,height:l+4,fill:"none",stroke:e.isCriticalPath?a.criticalPath:a.milestone,strokeWidth:2,opacity:.5,transform:`rotate(45 ${t} ${r+16})`,initial:{scale:.8,opacity:0},animate:{scale:1,opacity:.5},transition:{duration:.2}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:o&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},children:[jsxRuntime.jsx("rect",{x:t-80,y:r-50,width:160,height:44,rx:8,fill:a.bgSecondary,stroke:a.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("path",{d:`M ${t-6} ${r-6} L ${t} ${r+4} L ${t+6} ${r-6}`,fill:a.bgSecondary,stroke:a.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:t-70,y:r-38,width:8,height:8,fill:e.isCriticalPath?a.criticalPath:a.milestone,transform:`rotate(45 ${t-66} ${r-34})`}),jsxRuntime.jsx("text",{x:t-55,y:r-32,fill:a.textPrimary,fontSize:"12",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>18?`${e.name.substring(0,18)}...`:e.name}),jsxRuntime.jsx("text",{x:t-55,y:r-18,fill:a.textTertiary,fontSize:"10",fontFamily:"Inter, sans-serif",children:c(e.startDate)}),e.isCriticalPath&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:t+10,y:r-40,width:60,height:16,rx:4,fill:a.criticalPathLight}),jsxRuntime.jsx("text",{x:t+40,y:r-30,textAnchor:"middle",fill:a.criticalPath,fontSize:"9",fontWeight:"700",fontFamily:"Inter, sans-serif",letterSpacing:"0.5",children:"CRITICAL"})]})]})})]})}function Fn({tasks:e,theme:t,rowHeight:r,timeScale:a,startDate:n,endDate:o,zoom:i,templates:l,onTaskClick:c,onTaskDblClick:s,onTaskContextMenu:u,onTaskDateChange:d,onDependencyCreate:f,onDependencyDelete:p}){let y=Math.ceil((o.getTime()-n.getTime())/864e5),g=a==="day"?60:a==="week"?20:8,h=y*g*i,v=P=>{let I=new Date(Date.UTC(P.getFullYear(),P.getMonth(),P.getDate())),E=I.getUTCDay()||7;I.setUTCDate(I.getUTCDate()+4-E);let A=new Date(Date.UTC(I.getUTCFullYear(),0,1));return Math.ceil(((I.getTime()-A.getTime())/864e5+1)/7)},m=P=>{let I=P.getDay();return I===0||I===6},k=ke.useCallback(P=>{let I=Math.round(P/(g*i)),E=new Date(n);return E.setDate(E.getDate()+I),E},[n,g,i]),w=ke.useCallback((P,I)=>{if(I.startDate&&I.endDate)return;let E=P.currentTarget.ownerSVGElement;if(!E)return;let A=E.createSVGPoint();A.x=P.clientX,A.y=P.clientY;let z=A.matrixTransform(E.getScreenCTM()?.inverse()),U=k(z.x),J=new Date(U);J.setDate(J.getDate()+1),d?.(I,U,J);},[k,d]),b=ke.useMemo(()=>{console.log("\u{1F525} Timeline: Calculating parent dates for",e.length,"tasks");let P=z=>z.map(U=>{if(U.subtasks&&U.subtasks.length>0){let J=P(U.subtasks),X=J.filter(ae=>ae.startDate&&ae.endDate);if(X.length>0){let ae=X.map(B=>B.startDate.getTime()),Ee=X.map(B=>B.endDate.getTime()),te=new Date(Math.min(...ae)),Se=new Date(Math.max(...Ee));return console.log("\u2705 Parent task dates calculated:",{taskName:U.name,earliestStart:te.toISOString(),latestEnd:Se.toISOString(),subtasksCount:X.length}),{...U,subtasks:J,startDate:te,endDate:Se}}return {...U,subtasks:J}}return U}),I=(z,U=[])=>{for(let J of z)U.push(J),J.subtasks&&J.subtasks.length>0&&(J.isExpanded===void 0||J.isExpanded)&&I(J.subtasks,U);return U},E=P(e);console.log("\u{1F50D} Tasks BEFORE flattening:",E.map(z=>({name:z.name,hasSubtasks:!!(z.subtasks&&z.subtasks.length>0),subtasksCount:z.subtasks?.length||0,isExpanded:z.isExpanded,hasStartDate:!!z.startDate,hasEndDate:!!z.endDate})));let A=I(E);return console.log("\u{1F4CB} Flattened tasks:",A.map(z=>({name:z.name,hasStartDate:!!z.startDate,hasEndDate:!!z.endDate,startDate:z.startDate?.toISOString(),endDate:z.endDate?.toISOString()}))),A},[e]),C=ke.useCallback(P=>{if(!P.startDate||!P.endDate)return {x:0,width:0};let I=P.startDate.getTime(),E=P.endDate.getTime(),A=n.getTime(),z=(I-A)/(1e3*60*60*24),U=(E-I)/(1e3*60*60*24),J=z*g*i,X=Math.max(g*i,40),ae=Math.max(U*g*i,X);return {x:J,width:ae}},[n,g,i]),T=ke.useMemo(()=>b.filter(P=>P.startDate&&P.endDate).map(P=>{let{x:I,width:E}=C(P),z=48+b.findIndex(U=>U.id===P.id)*r+12;return {id:P.id,x:I,y:z,width:E,height:32}}),[b,C]),D=ke.useMemo(()=>{let P=[],I=new Date(n);for(;I<=o;){let z=(I.getTime()-n.getTime())/864e5*g*i;if(a==="day")P.push({date:new Date(I),label:I.toLocaleDateString("en-US",{day:"numeric",month:"short"}),x:z}),I.setDate(I.getDate()+1);else if(a==="week"){let U=v(I);P.push({date:new Date(I),label:`Week ${U}`,x:z}),I.setDate(I.getDate()+7);}else P.push({date:new Date(I),label:I.toLocaleDateString("en-US",{month:"short",year:"numeric"}),x:z}),I.setMonth(I.getMonth()+1);}return P},[n,o,a,g,i]),N=ke.useMemo(()=>(new Date().getTime()-n.getTime())/(1e3*60*60*24)*g*i,[n,g,i]);return jsxRuntime.jsx("div",{className:"flex-1 overflow-auto","data-gantt-chart":true,style:{backgroundColor:t.bgPrimary},children:jsxRuntime.jsxs("svg",{width:Math.max(h,1e3),height:Math.max(b.length*r+48,600),children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsx("filter",{id:"shadow",children:jsxRuntime.jsx("feDropShadow",{dx:"0",dy:"1",stdDeviation:"2",floodOpacity:"0.1"})}),jsxRuntime.jsx("pattern",{id:"diagonal-stripes",width:"8",height:"8",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:jsxRuntime.jsx("line",{x1:"0",y1:"0",x2:"0",y2:"8",stroke:t.border,strokeWidth:"2"})})]}),jsxRuntime.jsx("rect",{x:0,y:0,width:Math.max(h,1e3),height:Math.max(b.length*r+48,600),fill:t.bgPrimary}),jsxRuntime.jsx("rect",{x:0,y:0,width:h,height:48,fill:t.bgGrid}),D.map((P,I)=>{let E=D[I+1]?.x||h,A=m(P.date);return jsxRuntime.jsxs("g",{children:[A&&jsxRuntime.jsx("rect",{x:P.x,y:48,width:E-P.x,height:b.length*r,fill:t.bgWeekend,opacity:1}),jsxRuntime.jsx("line",{x1:P.x,y1:48,x2:P.x,y2:b.length*r+48,stroke:t.border,strokeWidth:1,opacity:.1}),jsxRuntime.jsx("text",{x:P.x+8,y:48/2,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",dominantBaseline:"middle",children:P.label})]},I)}),N>=0&&N<=h&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("line",{x1:N,y1:48,x2:N,y2:b.length*r+48,stroke:t.today,strokeWidth:2,opacity:1}),jsxRuntime.jsx("circle",{cx:N,cy:38,r:6,fill:t.today,opacity:1})]}),b.map((P,I)=>{let E=P.startDate&&P.endDate;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:0,y:48+I*r,width:h,height:r,fill:I%2===0?"transparent":t.bgSecondary,opacity:1,style:{pointerEvents:"none"}},`row-${P.id}`),!E&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:0,y:48+I*r,width:h,height:r,fill:"transparent",style:{cursor:"pointer",pointerEvents:"all"},onClick:A=>w(A,P),onMouseEnter:A=>{A.currentTarget.setAttribute("fill",t.accentLight),A.currentTarget.setAttribute("opacity","0.5");},onMouseLeave:A=>{A.currentTarget.setAttribute("fill","transparent"),A.currentTarget.setAttribute("opacity","1");}},`clickable-${P.id}`),jsxRuntime.jsx("text",{x:N>0?N:100,y:48+I*r+r/2,fill:t.textTertiary,fontSize:"12",fontFamily:"Inter, sans-serif",fontStyle:"italic",dominantBaseline:"middle",opacity:.4,style:{pointerEvents:"none",userSelect:"none"},children:"Click to set dates..."},`placeholder-${P.id}`)]})]},`row-group-${P.id}`)}),b.map((P,I)=>!P.dependencies||P.dependencies.length===0||!P.startDate||!P.endDate?null:P.dependencies.map(E=>{let A=b.find(X=>X.id===E);if(!A||!A.startDate||!A.endDate)return null;let z=b.findIndex(X=>X.id===E),U=C(A),J=C(P);return jsxRuntime.jsx(In,{x1:U.x+U.width,y1:48+z*r+r/2,x2:J.x,y2:48+I*r+r/2,theme:t,onDelete:()=>p?.(P.id,E)},`dep-${E}-${P.id}`)})),b.map((P,I)=>{if(!P.startDate||!P.endDate)return null;let{x:E,width:A}=C(P),z=48+I*r+12,U=P.subtasks&&P.subtasks.length>0&&!P.isMilestone;return P.isMilestone?jsxRuntime.jsx(An,{task:P,x:E+A/2,y:z+16,theme:t,onClick:c},P.id):U?(console.log("\u{1F3A8} Rendering container task:",P.name,"at",{x:E,y:z,width:A}),jsxRuntime.jsxs("g",{onClick:()=>c?.(P),style:{cursor:"pointer"},children:[jsxRuntime.jsx("rect",{x:E,y:z,width:A,height:32,fill:t.primary,opacity:.25,rx:6}),jsxRuntime.jsx("line",{x1:E,y1:z,x2:E+A,y2:z,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:E,y1:z,x2:E,y2:z+32,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:E+A,y1:z,x2:E+A,y2:z+32,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:E,y1:z+32,x2:E+A,y2:z+32,stroke:t.primary,strokeWidth:3,opacity:.9,strokeLinecap:"round"}),A>60&&jsxRuntime.jsx("text",{x:E+12,y:z+16,dominantBaseline:"middle",fill:"#FFFFFF",fontSize:"13",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:P.name})]},P.id)):jsxRuntime.jsx(Rn,{task:P,x:E,y:z,width:A,theme:t,dayWidth:g*i,startDate:n,templates:l,onClick:c,onDoubleClick:s,onContextMenu:u,onDateChange:d,onDependencyCreate:f,allTaskPositions:T},P.id)})]})})}var Yl=[{name:"Azul",value:"#6366F1",light:"#818CF8"},{name:"P\xFArpura",value:"#A855F7",light:"#C084FC"},{name:"Rosa",value:"#EC4899",light:"#F472B6"},{name:"Rojo",value:"#EF4444",light:"#F87171"},{name:"Naranja",value:"#F59E0B",light:"#FBBF24"},{name:"Amarillo",value:"#EAB308",light:"#FACC15"},{name:"Lima",value:"#84CC16",light:"#A3E635"},{name:"Verde",value:"#10B981",light:"#34D399"},{name:"Esmeralda",value:"#059669",light:"#10B981"},{name:"Cyan",value:"#06B6D4",light:"#22D3EE"},{name:"Azul Cielo",value:"#0EA5E9",light:"#38BDF8"},{name:"\xCDndigo",value:"#4F46E5",light:"#6366F1"},{name:"Violeta",value:"#8B5CF6",light:"#A78BFA"},{name:"Fucsia",value:"#D946EF",light:"#E879F9"},{name:"Gris",value:"#6B7280",light:"#9CA3AF"},{name:"Piedra",value:"#78716C",light:"#A8A29E"}];function ql({value:e="#6366F1",onChange:t,disabled:r=false}){return jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:Yl.map(a=>{let n=e===a.value;return jsxRuntime.jsx(framerMotion.motion.button,{type:"button",onClick:()=>!r&&t(a.value),className:"relative rounded-full transition-all focus:outline-none focus:ring-2 focus:ring-offset-2",style:{width:"32px",height:"32px",backgroundColor:a.value,boxShadow:n?`0 0 0 2px #FFFFFF, 0 0 0 4px ${a.value}`:"0 1px 3px rgba(0, 0, 0, 0.12)",opacity:r?.5:1,cursor:r?"not-allowed":"pointer"},whileHover:r?{}:{scale:1.1},whileTap:r?{}:{scale:.95},title:a.name,disabled:r,children:n&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{scale:0},animate:{scale:1},className:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-white drop-shadow-md",strokeWidth:3})})},a.value)})}),e&&jsxRuntime.jsx("div",{className:"text-xs text-center font-medium",style:{color:e},children:Yl.find(a=>a.value===e)?.name||"Personalizado"})]})}function Bn({isOpen:e,onClose:t,task:r,availableTasks:a=[],availableUsers:n=[],onSubmit:o,isLoading:i=false,mode:l=r?"edit":"create",theme:c="dark"}){let s=fe[c]||fe.dark,u={backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`,color:s.textPrimary},d={color:s.textSecondary},[f,p]=ke.useState({name:"",progress:0,status:"todo",isMilestone:false,color:"#6366F1",assignees:[],dependencies:[]}),[x,y]=ke.useState({});ke.useEffect(()=>{p(r?{name:r.name,startDate:r.startDate,endDate:r.endDate,progress:r.progress,status:r.status||"todo",isMilestone:r.isMilestone||false,color:r.color||"#6366F1",assignees:r.assignees||[],dependencies:r.dependencies||[]}:{name:"",progress:0,status:"todo",isMilestone:false,color:"#6366F1",assignees:[],dependencies:[]});},[r,e]);let g=()=>{let m={};return f.name.trim()||(m.name="El nombre es requerido"),f.startDate&&f.endDate&&f.startDate>f.endDate&&(m.endDate="La fecha de fin debe ser posterior a la de inicio"),y(m),Object.keys(m).length===0},h=async m=>{if(m.preventDefault(),!!g())try{await o(f),t();}catch(k){console.error("Error submitting task:",k);}},v=(m,k)=>{p(w=>{let b={...w,[m]:k};if(m==="progress"){let C=typeof k=="number"?k:parseInt(k,10);C===100&&w.status!=="completed"?b.status="completed":C>0&&C<100&&w.status==="todo"?b.status="in-progress":C===0&&w.status==="in-progress"&&(b.status="todo");}return b}),x[m]&&y(w=>{let b={...w};return delete b[m],b});};return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 z-50",onClick:t}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2,ease:[.4,0,.2,1]},className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-xl shadow-2xl pointer-events-auto overflow-hidden",style:{backgroundColor:s.bgPrimary,border:`1px solid ${s.border}`},onClick:m=>m.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 py-4",style:{borderBottom:`1px solid ${s.border}`},children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold",style:{color:s.textPrimary},children:l==="create"?"Crear Nueva Tarea":"Editar Tarea"}),jsxRuntime.jsx("button",{onClick:t,className:"p-2 rounded-lg transition-colors",style:{color:s.textSecondary},onMouseEnter:m=>m.currentTarget.style.backgroundColor=s.hoverBg,onMouseLeave:m=>m.currentTarget.style.backgroundColor="transparent",disabled:i,children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsxs("form",{onSubmit:h,className:"p-6 space-y-6 max-h-[calc(100vh-200px)] overflow-y-auto",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-2",style:d,children:"Nombre de la Tarea *"}),jsxRuntime.jsx("input",{type:"text",value:f.name,onChange:m=>v("name",m.target.value),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,onFocus:m=>m.currentTarget.style.borderColor=s.accent,onBlur:m=>m.currentTarget.style.borderColor=s.borderLight,placeholder:"Ej: Dise\xF1ar mockups de la aplicaci\xF3n",disabled:i}),x.name&&jsxRuntime.jsxs("p",{className:"mt-1 text-sm text-red-400 flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-4 h-4"}),x.name]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),"Fecha de Inicio"]}),jsxRuntime.jsx("input",{type:"date",value:f.startDate?f.startDate.toISOString().split("T")[0]:"",onChange:m=>v("startDate",m.target.value?new Date(m.target.value):void 0),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,disabled:i||f.isMilestone})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),"Fecha de Fin"]}),jsxRuntime.jsx("input",{type:"date",value:f.endDate?f.endDate.toISOString().split("T")[0]:"",onChange:m=>v("endDate",m.target.value?new Date(m.target.value):void 0),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,disabled:i||f.isMilestone}),x.endDate&&jsxRuntime.jsxs("p",{className:"mt-1 text-sm text-red-400 flex items-center gap-1",children:[jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-4 h-4"}),x.endDate]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),"Estado"]}),jsxRuntime.jsxs("select",{value:f.status,onChange:m=>v("status",m.target.value),className:"w-full px-4 py-2.5 rounded-lg focus:outline-none focus:ring-2 focus:border-transparent",style:u,disabled:i,children:[jsxRuntime.jsx("option",{value:"todo",children:"Por Hacer"}),jsxRuntime.jsx("option",{value:"in-progress",children:"En Progreso"}),jsxRuntime.jsx("option",{value:"completed",children:"Completada"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-3 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Palette,{className:"w-4 h-4"}),"Color de la Tarea"]}),jsxRuntime.jsx(ql,{value:f.color,onChange:m=>v("color",m),disabled:i}),jsxRuntime.jsx("p",{className:"text-xs mt-2",style:{color:s.textTertiary},children:r?.parentId?"Esta subtarea hereda el color de su tarea padre":r?.subtasks&&r.subtasks.length>0?"Las subtareas heredar\xE1n este color con menor opacidad":"Elige un color para organizar visualmente tus tareas"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center justify-between",style:d,children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),"Progreso"]}),jsxRuntime.jsxs("span",{className:"font-semibold px-2 py-0.5 rounded text-sm",style:{color:f.progress<30?"#EF4444":f.progress<70?"#F59E0B":"#10B981",backgroundColor:f.progress<30?"rgba(239, 68, 68, 0.1)":f.progress<70?"rgba(245, 158, 11, 0.1)":"rgba(16, 185, 129, 0.1)"},children:[f.progress,"%"]})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:f.progress,onChange:m=>v("progress",parseInt(m.target.value)),className:"w-full h-2 rounded-lg appearance-none cursor-pointer",style:{backgroundColor:s.bgSecondary,accentColor:f.progress<30?"#EF4444":f.progress<70?"#F59E0B":"#10B981"},disabled:i}),jsxRuntime.jsx("div",{className:"absolute top-0 left-0 h-2 rounded-lg pointer-events-none transition-all duration-300",style:{width:`${f.progress}%`,backgroundColor:f.progress<30?"rgba(239, 68, 68, 0.3)":f.progress<70?"rgba(245, 158, 11, 0.3)":"rgba(16, 185, 129, 0.3)"}})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mt-3 gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs",style:{color:s.textTertiary},children:"Accesos r\xE1pidos:"}),jsxRuntime.jsx("div",{className:"flex gap-1.5",children:[0,25,50,75,100].map(m=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>v("progress",m),disabled:i,className:"px-3 py-1 text-xs font-medium rounded-md transition-all duration-200 hover:scale-105 active:scale-95",style:{backgroundColor:f.progress===m?m<30?"#EF4444":m<70?"#F59E0B":"#10B981":s.bgSecondary,color:f.progress===m?"#FFFFFF":s.textSecondary,border:`1px solid ${f.progress===m?m<30?"#EF4444":m<70?"#F59E0B":"#10B981":s.borderLight}`},children:[m,"%"]},m))})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mt-2",style:{color:s.textTertiary},children:[jsxRuntime.jsx("span",{children:"0%"}),jsxRuntime.jsx("span",{children:"25%"}),jsxRuntime.jsx("span",{children:"50%"}),jsxRuntime.jsx("span",{children:"75%"}),jsxRuntime.jsx("span",{children:"100%"})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-lg",style:{backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`},children:[jsxRuntime.jsx("input",{type:"checkbox",id:"isMilestone",checked:f.isMilestone,onChange:m=>v("isMilestone",m.target.checked),className:"w-4 h-4 rounded focus:ring-2",style:{accentColor:s.accent},disabled:i}),jsxRuntime.jsxs("label",{htmlFor:"isMilestone",className:"flex items-center gap-2 text-sm cursor-pointer",style:{color:s.textPrimary},children:[jsxRuntime.jsx(lucideReact.Milestone,{className:"w-4 h-4 text-yellow-500"}),"Marcar como Hito (Milestone)"]})]}),n.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),"Asignar a"]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto p-3 rounded-lg",style:{backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`},children:n.map(m=>jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer p-2 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=s.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:f.assignees?.some(k=>k.name===m.name),onChange:k=>{let w=k.target.checked?[...f.assignees||[],{name:m.name,avatar:m.avatar,initials:m.name.split(" ").map(b=>b[0]).join("").toUpperCase().slice(0,2),color:s.accent}]:(f.assignees||[]).filter(b=>b.name!==m.name);v("assignees",w);},className:"w-4 h-4 rounded",style:{accentColor:s.accent},disabled:i}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs text-white font-semibold",style:{backgroundColor:s.accent},children:m.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:s.textPrimary},children:m.name})]})]},m.id))})]}),a.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-2 flex items-center gap-2",style:d,children:[jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),"Dependencias"]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-32 overflow-y-auto p-3 rounded-lg",style:{backgroundColor:s.bgSecondary,border:`1px solid ${s.borderLight}`},children:a.filter(m=>m.id!==r?.id).map(m=>jsxRuntime.jsxs("label",{className:"flex items-center gap-3 cursor-pointer p-2 rounded",onMouseEnter:k=>k.currentTarget.style.backgroundColor=s.hoverBg,onMouseLeave:k=>k.currentTarget.style.backgroundColor="transparent",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:f.dependencies?.includes(m.id),onChange:k=>{let w=k.target.checked?[...f.dependencies||[],m.id]:(f.dependencies||[]).filter(b=>b!==m.id);v("dependencies",w);},className:"w-4 h-4 rounded",style:{accentColor:s.accent},disabled:i}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:s.textPrimary},children:m.name})]},m.id))})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4",style:{borderTop:`1px solid ${s.border}`,backgroundColor:s.bgPrimary},children:[jsxRuntime.jsx("button",{type:"button",onClick:t,className:"px-4 py-2 text-sm font-medium rounded-lg transition-colors",style:{color:s.textSecondary},onMouseEnter:m=>{m.currentTarget.style.color=s.textPrimary,m.currentTarget.style.backgroundColor=s.hoverBg;},onMouseLeave:m=>{m.currentTarget.style.color=s.textSecondary,m.currentTarget.style.backgroundColor="transparent";},disabled:i,children:"Cancelar"}),jsxRuntime.jsx("button",{onClick:h,disabled:i,className:"px-4 py-2 text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",style:{backgroundColor:s.accent,color:"#FFFFFF"},onMouseEnter:m=>!i&&(m.currentTarget.style.backgroundColor=s.accentHover),onMouseLeave:m=>!i&&(m.currentTarget.style.backgroundColor=s.accent),children:i?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Guardando..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),l==="create"?"Crear Tarea":"Guardar Cambios"]})})]})]})})]})})}function tc(e,t=50){let[r,a]=ke.useState({past:[],present:e,future:[]}),n=ke.useRef(false),o=ke.useCallback((s,u=true)=>{a(d=>{let f=typeof s=="function"?s(d.present):s;if(n.current)return {...d,present:f};if(!u)return {...d,present:f};let p=[...d.past,d.present];return p.length>t&&p.shift(),{past:p,present:f,future:[]}});},[t]),i=ke.useCallback(()=>{a(s=>{if(s.past.length===0)return s;let u=s.past[s.past.length-1],d=s.past.slice(0,s.past.length-1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:d,present:u,future:[s.present,...s.future]}});},[]),l=ke.useCallback(()=>{a(s=>{if(s.future.length===0)return s;let u=s.future[0],d=s.future.slice(1);return n.current=true,setTimeout(()=>{n.current=false;},0),{past:[...s.past,s.present],present:u,future:d}});},[]),c=ke.useCallback(()=>{a(s=>({past:[],present:s.present,future:[]}));},[]);return {state:r.present,setState:o,undo:i,redo:l,canUndo:r.past.length>0,canRedo:r.future.length>0,clearHistory:c}}function rc({undo:e,redo:t,canUndo:r,canRedo:a,enabled:n=true}){ke.useEffect(()=>{if(!n)return;let o=i=>{let l=navigator.platform.toUpperCase().indexOf("MAC")>=0,c=l?i.metaKey:i.ctrlKey;if(c&&i.key==="z"&&!i.shiftKey&&r){i.preventDefault(),e();return}if(a){if(!l&&c&&i.key==="y"){i.preventDefault(),t();return}if(l&&c&&i.shiftKey&&i.key==="z"){i.preventDefault(),t();return}}};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o);}},[e,t,r,a,n]);}var q={calculateEndDate:(e,t)=>{let r=new Date(e);return r.setDate(r.getDate()+t),r},calculateDuration:(e,t)=>{let r=t.getTime()-e.getTime();return Math.ceil(r/(1e3*60*60*24))},calculateWorkingDays:(e,t)=>{let r=0,a=new Date(e);for(;a<=t;){let n=a.getDay();n!==0&&n!==6&&r++,a.setDate(a.getDate()+1);}return r},addWorkingDays:(e,t)=>{let r=new Date(e),a=0;for(;a<t;){r.setDate(r.getDate()+1);let n=r.getDay();n!==0&&n!==6&&a++;}return r},isWeekend:e=>{let t=e.getDay();return t===0||t===6},validateDependencies:(e,t,r)=>{let a=new Map,n=s=>{s.forEach(u=>{u.dependencies&&a.set(u.id,u.dependencies),u.subtasks&&n(u.subtasks);});};n(e);let o=a.get(r)||[];a.set(r,[...o,t]);let i=new Set,l=new Set,c=s=>{if(!i.has(s)){i.add(s),l.add(s);let u=a.get(s)||[];for(let d of u){if(!i.has(d)&&c(d))return true;if(l.has(d))return true}}return l.delete(s),false};return c(r)},flattenTasks:e=>{let t=[],r=a=>{a.forEach(n=>{t.push(n),n.subtasks&&n.subtasks.length>0&&r(n.subtasks);});};return r(e),t},findTaskById:(e,t)=>{for(let r of e){if(r.id===t)return r;if(r.subtasks){let a=q.findTaskById(r.subtasks,t);if(a)return a}}},getParentTasks:(e,t)=>{let r=[],a=q.findTaskById(e,t);if(!a||!a.parentId)return r;let n=a.parentId;for(;n;){let o=q.findTaskById(e,n);if(o)r.unshift(o),n=o.parentId;else break}return r},exportToJSON:e=>JSON.stringify(e,null,2),importFromJSON:e=>{try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Error("Invalid JSON: expected an array of tasks");return t.forEach((r,a)=>{if(!r.id||!r.name)throw new Error(`Invalid task at index ${a}: missing required fields (id, name)`)}),t}catch(t){throw new Error(`Failed to import tasks: ${t instanceof Error?t.message:"Unknown error"}`)}},exportToCSV:e=>{let t=q.flattenTasks(e),a=[["ID","Name","Start Date","End Date","Progress","Status","Dependencies"].join(",")];return t.forEach(n=>{let o=[n.id,`"${n.name.replace(/"/g,'""')}"`,n.startDate?n.startDate.toISOString().split("T")[0]:"",n.endDate?n.endDate.toISOString().split("T")[0]:"",n.progress.toString(),n.status||"",n.dependencies?.join(";")||""];a.push(o.join(","));}),a.join(`
|
|
46
|
+
`)},formatDate:e=>{let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return `${t}-${r}-${a}`},parseDate:e=>new Date(e),getTaskDateRange:e=>!e.startDate||!e.endDate?null:{start:e.startDate,end:e.endDate},getEarliestStartDate:e=>{let r=q.flattenTasks(e).filter(a=>a.startDate);return r.length===0?null:new Date(Math.min(...r.map(a=>a.startDate.getTime())))},getLatestEndDate:e=>{let r=q.flattenTasks(e).filter(a=>a.endDate);return r.length===0?null:new Date(Math.max(...r.map(a=>a.endDate.getTime())))},tasksOverlap:(e,t)=>!e.startDate||!e.endDate||!t.startDate||!t.endDate?false:e.startDate<=t.endDate&&t.startDate<=e.endDate,getDependentTasks:(e,t)=>q.flattenTasks(e).filter(a=>a.dependencies&&a.dependencies.includes(t)),getDependencyTasks:(e,t)=>{let r=q.findTaskById(e,t);return !r||!r.dependencies?[]:q.flattenTasks(e).filter(n=>r.dependencies.includes(n.id))},filterByStatus:(e,t)=>q.flattenTasks(e).filter(r=>r.status===t),filterByDateRange:(e,t,r)=>q.flattenTasks(e).filter(a=>!a.startDate||!a.endDate?false:a.startDate<=r&&a.endDate>=t),sortByStartDate:(e,t=true)=>[...e].sort((r,a)=>{if(!r.startDate||!a.startDate)return 0;let n=r.startDate.getTime()-a.startDate.getTime();return t?n:-n}),sortByEndDate:(e,t=true)=>[...e].sort((r,a)=>{if(!r.endDate||!a.endDate)return 0;let n=r.endDate.getTime()-a.endDate.getTime();return t?n:-n}),sortByProgress:(e,t=true)=>[...e].sort((r,a)=>{let n=r.progress-a.progress;return t?n:-n}),calculateTotalProgress:e=>{let t=q.flattenTasks(e);if(t.length===0)return 0;let r=t.reduce((a,n)=>a+n.progress,0);return Math.round(r/t.length)},getTaskByPath:(e,t)=>{let r=e,a;for(let n=0;n<t.length;n++){let o=t[n];if(!r||o===void 0||o>=r.length||(a=r[o],!a))return;n<t.length-1&&(r=a.subtasks||[]);}return a},cloneTask:(e,t)=>({...e,id:t||`${e.id}-copy`,subtasks:e.subtasks?.map(r=>q.cloneTask(r))}),exportToPDF:async(e,t="gantt-chart.pdf")=>{try{if(console.log("[PDF Export] Starting export..."),console.log("[PDF Export] Tasks count:",e?.length||0),!e||e.length===0){console.warn("[PDF Export] No tasks provided"),alert("No tasks available to export to PDF");return}let{jsPDF:r}=await import('jspdf'),{default:a}=await import('jspdf-autotable');console.log("[PDF Export] Modules loaded");let n=new r,o=q.flattenTasks(e);if(console.log("[PDF Export] Flattened tasks count:",o.length),o.length===0){console.warn("[PDF Export] No tasks after flattening"),alert("No tasks found to export");return}n.setFontSize(16),n.text("Gantt Chart - Task List",14,20);let i=[["Task Name","Start Date","End Date","Duration","Progress","Status"]],l=o.map(c=>{let s=c.startDate&&c.endDate?q.calculateDuration(c.startDate,c.endDate):0;return [c.name,c.startDate?q.formatDate(c.startDate):"N/A",c.endDate?q.formatDate(c.endDate):"N/A",s>0?`${s} days`:"N/A",`${c.progress}%`,c.status||"N/A"]});console.log("[PDF Export] Generating table with autoTable function..."),a(n,{head:i,body:l,startY:30,styles:{fontSize:9,cellPadding:3},headStyles:{fillColor:[66,139,202],textColor:255,fontStyle:"bold"},alternateRowStyles:{fillColor:[245,245,245]},columnStyles:{0:{cellWidth:60},1:{cellWidth:30},2:{cellWidth:30},3:{cellWidth:25},4:{cellWidth:20},5:{cellWidth:25}}}),console.log("[PDF Export] Table generated successfully"),console.log("[PDF Export] Saving PDF:",t),n.save(t),console.log("[PDF Export] PDF saved successfully");}catch(r){throw console.error("Error exporting to PDF:",r),r}},exportToExcel:async(e,t="gantt-chart.xlsx")=>{let r=await import('xlsx'),n=q.flattenTasks(e).map(c=>{let s=c.startDate&&c.endDate?q.calculateDuration(c.startDate,c.endDate):0;return {"Task ID":c.id,"Task Name":c.name,"Start Date":c.startDate?q.formatDate(c.startDate):"","End Date":c.endDate?q.formatDate(c.endDate):"","Duration (days)":s>0?s:"","Progress (%)":c.progress,Status:c.status||"",Assignees:c.assignees?.map(u=>u.name).join(", ")||"",Dependencies:c.dependencies?.join(", ")||"","Is Milestone":c.isMilestone?"Yes":"No","Parent ID":c.parentId||"",Level:c.level||0}}),o=r.utils.json_to_sheet(n),i=[{wch:15},{wch:40},{wch:12},{wch:12},{wch:15},{wch:12},{wch:15},{wch:30},{wch:20},{wch:12},{wch:15},{wch:8}];o["!cols"]=i;let l=r.utils.book_new();r.utils.book_append_sheet(l,o,"Gantt Tasks"),r.writeFile(l,t);},calculateCriticalPath:e=>{let t=q.flattenTasks(e),r=t.filter(s=>s.startDate&&s.endDate);if(r.length===0)return [];let a=new Map,n=s=>{if(a.has(s.id))return;let u=s.startDate&&s.endDate?q.calculateDuration(s.startDate,s.endDate):0,d=0;if(s.dependencies&&s.dependencies.length>0)for(let p of s.dependencies){let x=t.find(y=>y.id===p);if(x){n(x);let y=a.get(p)?.ef||0;d=Math.max(d,y);}}let f=d+u;a.set(s.id,{es:d,ef:f});};r.forEach(n);let o=Math.max(...Array.from(a.values()).map(s=>s.ef)),i=new Map,l=s=>{if(i.has(s.id))return;let u=s.startDate&&s.endDate?q.calculateDuration(s.startDate,s.endDate):0,d=t.filter(x=>x.dependencies&&x.dependencies.includes(s.id)),f=o;if(d.length>0)for(let x of d){l(x);let y=i.get(x.id)?.ls||0;f=Math.min(f,y);}let p=f-u;i.set(s.id,{ls:p,lf:f});};r.forEach(l);let c=[];for(let s of r){let u=a.get(s.id),d=i.get(s.id);if(u&&d){let f=d.ls-u.es;Math.abs(f)<.01&&c.push(s.id);}}return c},calculateSlack:(e,t)=>{let r=q.findTaskById(e,t);if(!r||!r.startDate||!r.endDate)return null;if(q.calculateCriticalPath(e).includes(t))return 0;let n=q.getDependentTasks(e,t);if(n.length===0){let l=q.getLatestEndDate(e);if(!l)return null;let c=q.calculateDuration(r.endDate,l);return Math.max(0,c)}let o=n.filter(l=>l.startDate).map(l=>l.startDate.getTime()).sort((l,c)=>l-c)[0];if(!o)return null;let i=q.calculateDuration(r.endDate,new Date(o));return Math.max(0,i)},isOnCriticalPath:(e,t)=>q.calculateCriticalPath(e).includes(t),autoScheduleDependents:(e,t)=>{let r=q.findTaskById(e,t);if(!r||!r.endDate)return e;let a=q.getDependentTasks(e,t);if(a.length===0)return e;let n=[...e];for(let o of a){if(!o.startDate||!o.endDate)continue;let i=q.calculateDuration(o.startDate,o.endDate),l=new Date(r.endDate);l.setDate(l.getDate()+1);let c=q.calculateEndDate(l,i),s=u=>u.map(d=>d.id===o.id?{...d,startDate:l,endDate:c}:d.subtasks?{...d,subtasks:s(d.subtasks)}:d);n=s(n),n=q.autoScheduleDependents(n,o.id);}return n},splitTask:(e,t,r,a=3)=>{let n=q.findTaskById(e,t);if(!n||!n.startDate||!n.endDate)return e;if(r<=n.startDate||r>=n.endDate)return console.warn("Split date must be between task start and end dates"),e;let o=new Date(r);o.setDate(o.getDate()-1);let i=new Date(r);i.setDate(i.getDate()+a);let l=new Date(n.endDate);l.setDate(l.getDate()+a);let c=[{startDate:new Date(n.startDate),endDate:o},{startDate:i,endDate:l}],s=u=>u.map(d=>d.id===n.id?{...d,endDate:l,segments:c}:d.subtasks?{...d,subtasks:s(d.subtasks)}:d);return s(e)}};var Mf={taskTooltip:e=>{let t=[`<strong>${e.name}</strong>`];if(e.startDate&&e.endDate){t.push(`${q.formatDate(e.startDate)} - ${q.formatDate(e.endDate)}`);let r=q.calculateDuration(e.startDate,e.endDate);t.push(`Duration: ${r} days`);}if(e.progress!==void 0&&t.push(`Progress: ${e.progress}%`),e.status&&t.push(`Status: ${e.status}`),e.assignees&&e.assignees.length>0){let r=e.assignees.map(a=>a.name).join(", ");t.push(`Assigned: ${r}`);}return e.dependencies&&e.dependencies.length>0&&t.push(`Dependencies: ${e.dependencies.length}`),t.join("<br/>")},taskLabel:e=>e.name,gridCell:(e,t,r)=>r,taskClass:e=>{let t=[];return e.isCriticalPath&&t.push("critical-path"),e.status==="completed"?t.push("completed"):e.status==="in-progress"?t.push("in-progress"):e.status==="todo"&&t.push("todo"),e.isMilestone&&t.push("milestone"),t.join(" ")},milestoneContent:e=>`\u25C6 ${e.name}`,dateFormat:e=>q.formatDate(e),durationFormat:e=>e===1?"1 day":`${e} days`,progressFormat:e=>`${e}%`};function ac(e){return {...Mf,...e}}var zf=e=>{switch(e){case "compact":return 40;case "comfortable":return 48;case "spacious":return 56;default:return 48}},oc=ke.forwardRef(function({tasks:t,config:r={},onTasksChange:a},n){let{theme:o,timeScale:i="week",rowDensity:l="comfortable",showThemeSelector:c=true,availableUsers:s=[],templates:u,enableAutoCriticalPath:d=true,onThemeChange:f,onTaskClick:p,onTaskDblClick:x,onTaskContextMenu:y,onTaskUpdate:g,onProgressChange:h,onDependencyCreate:v,onDependencyDelete:m,onBeforeTaskAdd:k,onAfterTaskAdd:w,onBeforeTaskUpdate:b,onAfterTaskUpdate:C}=r,D=ke.useContext(Tn)?.theme,[N,P]=ke.useState(D||o||"dark"),[I,E]=ke.useState(i),[A,z]=ke.useState(l),[U,J]=ke.useState(1),[X,ae]=ke.useState(0),[Ee,te]=ke.useState(false),[Se,B]=ke.useState(null),[j,Le]=ke.useState({isOpen:false,x:0,y:0,task:null}),[tt,Lt]=ke.useState(null);ke.useEffect(()=>{D&&D!==N&&P(D);},[D]);let xe=ke.useCallback(R=>{P(R),f?.(R);},[f]),{state:re,setState:ie,undo:Ft,redo:Gt,canUndo:_t,canRedo:_,clearHistory:H}=tc(t,50);ke.useEffect(()=>{console.log("\u{1F4E5} GanttBoard: Parent tasks prop changed, syncing to localTasks",t.length),ie(t);},[t,ie]),ke.useEffect(()=>{a&&a(re);},[re,a]);let[Me,He]=ke.useState([{id:"name",label:"TASK NAME",width:240,visible:true,sortable:true},{id:"startDate",label:"Start Date",width:110,visible:false,sortable:true},{id:"endDate",label:"End Date",width:110,visible:false,sortable:true},{id:"duration",label:"Duration",width:80,visible:false,sortable:true},{id:"assignees",label:"Assignees",width:120,visible:false,sortable:false},{id:"status",label:"Status",width:80,visible:false,sortable:true},{id:"progress",label:"% Complete",width:120,visible:false,sortable:true}]),Fe=ke.useMemo(()=>Me.filter(R=>R.visible).reduce((R,F)=>R+F.width,0)+60,[Me]),$t=Se||Fe,se=ke.useRef(null),it=ke.useRef(null),Ye=ke.useRef(null),ut=ke.useMemo(()=>El(N),[N]),Nr=ke.useMemo(()=>ac(u),[u]),he=ke.useMemo(()=>{if(!d)return re;let R=q.calculateCriticalPath(re),F=V=>V.map(Y=>({...Y,isCriticalPath:R.includes(Y.id),subtasks:Y.subtasks?F(Y.subtasks):void 0}));return F(re)},[re,d]),de=zf(A);rc({undo:Ft,redo:Gt,canUndo:_t,canRedo:_,enabled:true}),ke.useImperativeHandle(n,()=>({getTask:R=>q.findTaskById(re,R),addTask:(R,F)=>{ie(V=>{if(!F)return [...V,{...R,level:0}];let Y=Z=>Z.map(ne=>ne.id===F?{...ne,subtasks:[...ne.subtasks||[],{...R,parentId:F,level:(ne.level||0)+1}],isExpanded:true}:ne.subtasks?{...ne,subtasks:Y(ne.subtasks)}:ne);return Y(V)});},updateTask:(R,F)=>{ie(V=>{let Y=Z=>Z.map(ne=>ne.id===R?{...ne,...F}:ne.subtasks?{...ne,subtasks:Y(ne.subtasks)}:ne);return Y(V)});},deleteTask:R=>{ie(F=>{let V=Y=>Y.filter(Z=>Z.id===R?false:(Z.subtasks&&(Z.subtasks=V(Z.subtasks)),true));return V(F)});},deleteTasks:R=>{ie(F=>is(F,R));},duplicateTask:R=>{ie(F=>ls(F,[R]));},splitTask:(R,F,V=3)=>{ie(Y=>q.splitTask(Y,R,F,V));},calculateEndDate:q.calculateEndDate,calculateDuration:q.calculateDuration,validateDependency:(R,F)=>!q.validateDependencies(re,R,F),getAllTasks:()=>q.flattenTasks(re),getTasksByStatus:R=>q.flattenTasks(re).filter(F=>F.status===R),getTasksByParent:R=>R?q.findTaskById(re,R)?.subtasks||[]:re.filter(V=>!V.parentId),getCriticalPath:()=>q.flattenTasks(re).filter(R=>R.isCriticalPath),indentTask:R=>{ie(F=>ns(F,[R]));},outdentTask:R=>{ie(F=>os(F,[R]));},moveTask:(R,F)=>{ie(V=>ss(V,[R],F));},createSubtask:async R=>{let{tasks:F,newTask:V}=us(re,R);if(k){let Y=k({...V,parentId:R});if((Y instanceof Promise?await Y:Y)===false)return}ie(F),w&&w({...V,parentId:R});},scrollToTask:R=>{let V=q.flattenTasks(re).findIndex(Y=>Y.id===R);if(V!==-1&&se.current){let Y=V*de;se.current.scrollTo({top:Y,behavior:"smooth"}),it.current&&it.current.scrollTo({top:Y,behavior:"smooth"});}},highlightTask:(R,F=2e3)=>{console.log(`Highlighting task ${R} for ${F}ms`);},expandTask:R=>{ie(F=>{let V=Y=>Y.map(Z=>Z.id===R?{...Z,isExpanded:true}:Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z);return V(F)});},collapseTask:R=>{ie(F=>{let V=Y=>Y.map(Z=>Z.id===R?{...Z,isExpanded:false}:Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z);return V(F)});},expandAll:()=>{ie(R=>{let F=V=>V.map(Y=>({...Y,isExpanded:true,subtasks:Y.subtasks?F(Y.subtasks):void 0}));return F(R)});},collapseAll:()=>{ie(R=>{let F=V=>V.map(Y=>({...Y,isExpanded:false,subtasks:Y.subtasks?F(Y.subtasks):void 0}));return F(R)});},undo:Ft,redo:Gt,canUndo:()=>_t,canRedo:()=>_,clearHistory:H,exportToPNG:async()=>{if(!Ye.current)throw new Error("Gantt container not found");let R=await ud__default.default(Ye.current,{backgroundColor:ut.bgPrimary,scale:2});return new Promise((F,V)=>{R.toBlob(Y=>{Y?F(Y):V(new Error("Failed to create blob from canvas"));},"image/png");})},exportToPDF:async R=>{await q.exportToPDF(re,R);},exportToExcel:async R=>{await q.exportToExcel(re,R);},exportToJSON:()=>q.exportToJSON(re),exportToCSV:()=>q.exportToCSV(re),importFromJSON:R=>{let F=q.importFromJSON(R);ie(F);},getTasks:()=>re,refresh:()=>{ie(R=>[...R]);},clearAll:()=>{ie([]);}}),[re,Ft,Gt,_t,_,H,ut,de]);let Yr=ke.useCallback(R=>{He(F=>F.map(V=>V.id===R?{...V,visible:!V.visible}:V));},[]),qr=ke.useCallback(R=>{ie(F=>ds(F,R)),r.onTaskToggleExpand?.(R);},[r]),Dr=ke.useCallback((R,F)=>{if(b&&b(R,F)===false)return;let Y=q.findTaskById(re,R)?.progress,Z=ht=>ht.map($e=>$e.id===R?{...$e,...F}:$e.subtasks?{...$e,subtasks:Z($e.subtasks)}:$e);ie(Z(re));let ne=q.findTaskById(Z(re),R);ne&&(g?.(ne),C?.(ne),F.progress!==void 0&&Y!==void 0&&F.progress!==Y&&h?.(R,Y,F.progress));},[re,g,b,C,h]),O=ke.useCallback(R=>{R.length!==0&&(ie(F=>ns(F,R)),r.onTaskIndent?.(R[0]));},[r]),ge=ke.useCallback(R=>{R.length!==0&&(ie(F=>os(F,R)),r.onTaskOutdent?.(R[0]));},[r]),ue=ke.useCallback((R,F)=>{R.length!==0&&(ie(V=>ss(V,R,F)),r.onTaskMove?.(R[0],F));},[r]),S=ke.useCallback(R=>{console.log("\u{1F4E6} GanttBoard handleMultiTaskDelete called:",R),r.onMultiTaskDelete?r.onMultiTaskDelete(R):(ie(F=>is(F,R)),R.forEach(F=>r.onTaskDelete?.(F)));},[r]),G=ke.useCallback(R=>{ie(F=>ls(F,R)),R.forEach(F=>r.onTaskDuplicate?.(F));},[r]),pe=ke.useCallback((R,F)=>{ie(V=>{let{tasks:Y,newTask:Z}=Bl(V,R,F);return k&&k(Z)===false?V:(r.onTaskCreate?.(Z.parentId,Z.position||0),w?.(Z),Y)});},[r,k,w]),we=ke.useCallback((R,F)=>{ie(V=>cs(V,R,F)),r.onTaskRename?.(R,F);},[r]),Ne=ke.useCallback(R=>{ie(F=>{let{tasks:V}=us(F,R);return r.onTaskCreate?.(R,0),V});},[r]),Pt=ke.useCallback((R,F,V)=>{let Y=ht=>ht.map($e=>$e.id===R.id?{...$e,startDate:F,endDate:V,...R.segments&&{segments:R.segments}}:$e.subtasks?{...$e,subtasks:Y($e.subtasks)}:$e),Z=Y(re);Z=q.autoScheduleDependents(Z,R.id),ie(Z);let ne={...R,startDate:F,endDate:V};g?.(ne);},[re,g]),Bt=ke.useCallback((R,F)=>{y?.(R,F),Le({isOpen:true,x:F.clientX,y:F.clientY,task:R});},[y]),jn=ke.useCallback((R,F)=>{let V=q.splitTask(re,R.id,F);ie(V),Le({isOpen:false,x:0,y:0,task:null});},[re]),Xr=ke.useCallback(R=>{x?.(R),Lt(R);},[x]),Zr=ke.useCallback((R,F,V)=>{let Y=new Map,Z=Er=>{Er.forEach(Rr=>{Rr.dependencies&&Y.set(Rr.id,Rr.dependencies),Rr.subtasks&&Z(Rr.subtasks);});};Z(V);let ne=Y.get(F)||[];Y.set(F,[...ne,R]);let ht=new Set,$e=new Set,Jr=Er=>{if(!ht.has(Er)){ht.add(Er),$e.add(Er);let Rr=Y.get(Er)||[];for(let Yn of Rr){if(!ht.has(Yn)&&Jr(Yn))return true;if($e.has(Yn))return true}}return $e.delete(Er),false};return Jr(F)},[]),Qc=ke.useCallback((R,F)=>{if(Zr(R.id,F,re)){console.warn("Cannot create dependency: would create a circular dependency"),alert(`Cannot create this dependency: it would create a circular dependency chain.
|
|
47
47
|
|
|
48
|
-
Task dependencies must flow in one direction only.`);return}let V=q=>q.map(Z=>{if(Z.id===B){let oe=Z.dependencies||[];if(!oe.includes(P.id))return {...Z,dependencies:[...oe,P.id]}}return Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z});ne(V(K)),h?.(P.id,B);},[K,h,Xr]),Qc=xe.useCallback((P,B)=>{let V=q=>q.map(Z=>{if(Z.id===P&&Z.dependencies){let oe=Z.dependencies.filter(ft=>ft!==B);return {...Z,dependencies:oe}}return Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z});ne(V(K)),v?.(P,B);},[K,v]),{startDate:ed,endDate:td}=xe.useMemo(()=>{let P=K.filter(oe=>oe.startDate&&oe.endDate);if(P.length===0){let oe=new Date,ft=new Date(oe);ft.setDate(ft.getDate()-30);let $e=new Date(oe);return $e.setDate($e.getDate()+60),{startDate:ft,endDate:$e}}let B=P.flatMap(oe=>[oe.startDate,oe.endDate]).filter(oe=>oe!==void 0),V=new Date(Math.min(...B.map(oe=>oe.getTime()))),q=new Date(Math.max(...B.map(oe=>oe.getTime()))),Z=E==="day"?7:E==="week"?14:30;return V.setDate(V.getDate()-Z),q.setDate(q.getDate()+Z),{startDate:V,endDate:q}},[K,E]),rd=P=>{P.preventDefault(),Ie(true);};return xe.useEffect(()=>{let P=Ct.current,B=ie.current;if(!P||!B)return;let V=r.disableScrollSync||false,q=()=>{if(V){j(P.scrollTop);return}B.scrollTop!==P.scrollTop&&(B.scrollTop=P.scrollTop),j(P.scrollTop);},Z=()=>{if(V){j(B.scrollTop);return}P.scrollTop!==B.scrollTop&&(P.scrollTop=B.scrollTop),j(B.scrollTop);},oe=$e=>{if(ae){let Zr=$e.clientX;Zr>300&&Zr<window.innerWidth-400&&Te(Zr);}},ft=()=>{Ie(false);};return P.addEventListener("scroll",q),B.addEventListener("scroll",Z),document.addEventListener("mousemove",oe),document.addEventListener("mouseup",ft),()=>{P.removeEventListener("scroll",q),B.removeEventListener("scroll",Z),document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",ft);}},[ae,r.disableScrollSync]),jsxRuntime.jsxs("div",{ref:ct,className:"flex flex-col h-screen overflow-hidden",style:{backgroundColor:Re.bgPrimary,fontFamily:"Inter, sans-serif",...r.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:[jsxRuntime.jsx(Dn,{theme:Re,timeScale:E,onTimeScaleChange:I,zoom:O,onZoomChange:U,currentTheme:N,onThemeChange:Jt,rowDensity:R,onRowDensityChange:F,showThemeSelector:c}),jsxRuntime.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[jsxRuntime.jsx("div",{ref:Ct,style:{width:Fe,...r.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:jsxRuntime.jsx(Rn,{tasks:Nr,theme:Re,rowHeight:me,availableUsers:s,templates:Qt,onTaskClick:f,onTaskDblClick:Wa,onTaskContextMenu:x,onTaskToggle:Yr,scrollTop:J,columns:H,onToggleColumn:ge,onTaskUpdate:Dr,onTaskIndent:qr,onTaskOutdent:z,onTaskMove:he,onMultiTaskDelete:de,onTaskDuplicate:S,onTaskCreate:G,onTaskRename:ue,onCreateSubtask:ke,onOpenTaskModal:f?P=>f(P):void 0})}),jsxRuntime.jsx("div",{className:"relative flex-shrink-0 cursor-col-resize group",style:{width:8,backgroundColor:ae?Re.accent:Re.border,transition:"background-color 0.2s"},onMouseDown:rd,children:jsxRuntime.jsx(framerMotion.motion.div,{className:"absolute inset-y-0 left-1/2 -translate-x-1/2",style:{width:2,backgroundColor:Re.accent},initial:{opacity:0},animate:{opacity:ae?1:0},whileHover:{opacity:1}})}),jsxRuntime.jsx("div",{ref:ie,className:"flex-1 overflow-hidden",style:{...r.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:jsxRuntime.jsx(Bn,{tasks:Nr,theme:Re,rowHeight:me,timeScale:E,startDate:ed,endDate:td,zoom:O,templates:Qt,onTaskClick:f,onTaskDblClick:Wa,onTaskContextMenu:Pt,onTaskDateChange:Se,onDependencyCreate:ga,onDependencyDelete:Qc})})]}),M.task&&jsxRuntime.jsx(ua,{isOpen:M.isOpen,x:M.x,y:M.y,theme:Re,onClose:()=>Q({isOpen:false,x:0,y:0,task:null}),items:[{id:"split",label:"Split Task",icon:Et.Split,onClick:()=>{if(!M.task?.startDate||!M.task?.endDate){console.warn("Cannot split task without dates");return}let P=M.task.startDate.getTime(),B=M.task.endDate.getTime(),V=P+(B-P)/2,q=new Date(V);Ft(M.task,q);},disabled:!M.task?.startDate||!M.task?.endDate}]}),Ae&&jsxRuntime.jsx(On,{isOpen:true,onClose:()=>et(null),task:Ae,onSubmit:P=>{Dr(Ae.id,P),et(null);},mode:"edit",theme:N})]})});function zf(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function Hf(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return "TODO"}}function Un(e,t=[],r=[]){let a=e.assignedUserIds?.map(u=>{let d=r.find(f=>f.id===u);return d?{name:d.name,initials:d.initials,color:d.color}:null}).filter(u=>u!==null),n=t.filter(u=>u.metadata?.parentCardId===e.id).map(u=>Un(u,t,r)),o;e.dependencies&&(typeof e.dependencies[0]=="string"?o=e.dependencies:o=e.dependencies.filter(u=>u.type==="finish-to-start").map(u=>u.taskId));let i=u=>{if(u)return typeof u=="string"?new Date(u):u},l=i(e.startDate),c=i(e.endDate),s=e.metadata?.isMilestone===true||l&&c&&Math.abs(c.getTime()-l.getTime())<=864e5;return {id:e.id,name:e.title,startDate:l,endDate:c,progress:e.progress||0,status:zf(e.metadata?.status),assignees:a?.length?a:void 0,dependencies:o?.length?o:void 0,subtasks:n?.length?n:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:s,isCriticalPath:e.metadata?.isCriticalPath===true}}function sc(e,t=[]){let r;return e.assignees&&e.assignees.length>0&&(r=e.assignees.map(a=>t.find(o=>o.name===a.name||o.initials===a.initials)?.id).filter(a=>a!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:r?.length?r:void 0,metadata:{status:Hf(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function ic(e,t=[]){return e.filter(a=>!a.metadata?.parentCardId).map(a=>Un(a,e,t))}function Gf({stack:e,cards:t,renderCard:r,onCardClick:a,onToggleExpand:n,onUnstack:o,onDeleteStack:i,className:l}){let[c,s]=xe.useState(false),u=xe.useMemo(()=>t.filter(p=>e.cardIds.includes(p.id)),[t,e.cardIds]),d=xe.useMemo(()=>{let p=u.length,x=new Set(u.flatMap(h=>h.assignedUserIds||[])).size,y=u.map(h=>h.priority).filter(Boolean),g=new Set(u.flatMap(h=>h.labels||[])).size;return {totalCards:p,uniqueAssignees:x,priorities:y,labels:g}},[u]),f=()=>{n?.(e.id);};return jsxRuntime.jsxs("div",{className:te("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:f,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:te("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:d.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),c&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:p=>{p.stopPropagation(),i?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[d.uniqueAssignees," assignees"]})]}),d.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[d.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:u.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:u.map(p=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[r?jsxRuntime.jsx("div",{onClick:()=>a?.(p),children:r(p)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>a?.(p),children:[jsxRuntime.jsx("h4",{children:p.title}),p.description&&jsxRuntime.jsxs("p",{children:[p.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:x=>{x.stopPropagation(),o?.(e.id,p.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},p.id))})})]})}var cc={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Oa(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function za(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function dc(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function uc({events:e,filter:t,onFilterChange:r,onClearFilter:a,onEventClick:n,selectedEventId:o,config:i,className:l}){let c=xe.useMemo(()=>({...cc,...i}),[i]),[s,u]=xe.useState(new Set),d=xe.useRef(null),f=xe.useMemo(()=>{if(!c.groupByDay)return [{date:null,events:e}];let v=new Map;return e.forEach(m=>{let k=m.timestamp.toISOString().split("T")[0],w=v.get(k);w?w.push(m):v.set(k,[m]);}),Array.from(v.entries()).sort((m,k)=>k[0].localeCompare(m[0])).map(([m,k])=>({date:new Date(m),events:k.sort((w,b)=>b.timestamp.getTime()-w.timestamp.getTime())}))},[e,c.groupByDay]),{uniqueUsers:p,uniqueTypes:x}=xe.useMemo(()=>{let v=new Set,m=new Set;return e.forEach(k=>{v.add(k.userId),m.add(k.type);}),{uniqueUsers:Array.from(v),uniqueTypes:Array.from(m)}},[e]),y=v=>{u(m=>{let k=new Set(m);return k.has(v)?k.delete(v):k.add(v),k});},g=v=>{let k=new Date().getTime()-v.getTime(),w=Math.floor(k/6e4),b=Math.floor(k/36e5),T=Math.floor(k/864e5);return w<1?"just now":w<60?`${w}m ago`:b<24?`${b}h ago`:T<7?`${T}d ago`:v.toLocaleDateString()},h=xe.useMemo(()=>{let v=0;return t.types&&t.types.length>0&&v++,t.users&&t.users.length>0&&v++,t.dateRange&&v++,t.searchTerm&&v++,v},[t]);return xe.useEffect(()=>{if(o&&d.current){let v=d.current.querySelector(`[data-event-id="${o}"]`);v&&v.scrollIntoView({behavior:"smooth",block:"center"});}},[o]),e.length===0?jsxRuntime.jsxs("div",{className:te("history-timeline-empty",l),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:te("history-timeline",c.compact&&"compact",l),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:v=>{let m=v.target.value;r({...t,types:m?[m]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),x.map(v=>jsxRuntime.jsxs("option",{value:v,children:[za(v)," ",v.replace("_"," ")]},v))]}),p.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:v=>{let m=v.target.value;r({...t,users:m?[m]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),p.map(v=>jsxRuntime.jsx("option",{value:v,children:v},v))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:v=>r({...t,searchTerm:v.target.value})})]}),h>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:a,children:["Clear filters (",h,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:d,children:f.map(v=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[c.groupByDay&&v.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:v.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[v.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:v.events.map((m,k)=>{let w=s.has(m.id),b=o===m.id,T=dc(m.type);return jsxRuntime.jsxs("div",{"data-event-id":m.id,className:te("history-timeline-event",w&&"expanded",b&&"selected"),onClick:()=>n?.(m),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:T},children:c.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:za(m.type)})}),k<v.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:T}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[c.showAvatars&&m.userAvatar&&jsxRuntime.jsx("img",{src:m.userAvatar,alt:m.userName||m.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:m.userName||m.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Oa(m)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:c.useRelativeTime?g(m.timestamp):m.timestamp.toLocaleString()})]}),Object.keys(m.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:C=>{C.stopPropagation(),y(m.id);},children:[w?"\u25BC":"\u25B6"," Show changes"]}),w&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(m.changes).map(([C,N])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[C,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(N.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(N.to)})]})]},C)),m.metadata&&Object.keys(m.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(m.metadata).map(([C,N])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[C,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(N)})]},C))]})]})]})]},m.id)})})]},v.date?.toISOString()||"all"))})]})}function mc({replayState:e,events:t,onStartReplay:r,onStopReplay:a,onTogglePlayback:n,onPrevious:o,onNext:i,onGoToEvent:l,onSpeedChange:c,className:s}){let u=[.5,1,1.5,2,3],d=xe.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),f=xe.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:te("history-replay-empty",s),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:te("history-replay",s),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:d&&za(d.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:d&&Oa(d)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:d&&d.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:p=>l(parseInt(p.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${f}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((p,x)=>jsxRuntime.jsx("div",{className:te("history-replay-progress-marker",x===e.currentIndex&&"active"),style:{left:`${x/(e.totalEvents-1)*100}%`},onClick:()=>l(x),title:Oa(p)},p.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:o,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:n,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:i,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:u.map(p=>jsxRuntime.jsxs("button",{className:te("history-replay-speed-btn",e.speed===p&&"active"),onClick:()=>c(p),children:[p,"x"]},p))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:a,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:d&&d.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(p=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:p},p))})]})]})]})]}):jsxRuntime.jsxs("div",{className:te("history-replay-start",s),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:r,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function bs(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function ys(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function fc(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function gc(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function jf(e,t,r,a,n,o=100){let i=e.map(c=>({...c,x:c.x??r/2+Math.random()*100-50,y:c.y??a/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(i.map(c=>[c.id,c]));for(let c=0;c<o;c++){let s=1-c/o;i.forEach(u=>{let d=r/2,f=a/2;u.vx+=(d-u.x)*n.centerForce*s,u.vy+=(f-u.y)*n.centerForce*s,i.forEach(p=>{if(u.id===p.id)return;let x=u.x-p.x,y=u.y-p.y,g=Math.sqrt(x*x+y*y)||1,h=n.chargeStrength*s/(g*g);u.vx+=x/g*h,u.vy+=y/g*h;});}),t.forEach(u=>{let d=l.get(typeof u.source=="string"?u.source:u.source.id),f=l.get(typeof u.target=="string"?u.target:u.target.id);if(!d||!f)return;let p=f.x-d.x,x=f.y-d.y,y=Math.sqrt(p*p+x*x)||1,g=(y-n.linkDistance)/y*n.forceStrength*s;d.vx+=p*g,d.vy+=x*g,f.vx-=p*g,f.vy-=x*g;}),i.forEach(u=>{u.fx!==null&&u.fx!==void 0?(u.x=u.fx,u.vx=0):u.x+=u.vx,u.fy!==null&&u.fy!==void 0?(u.y=u.fy,u.vy=0):u.y+=u.vy,u.x=Math.max(n.nodeSize,Math.min(r-n.nodeSize,u.x)),u.y=Math.max(n.nodeSize,Math.min(a-n.nodeSize,u.y)),u.vx*=.9,u.vy*=.9;});}return i}function hc({nodes:e,edges:t,config:r,filter:a,onFilterChange:n,criticalPath:o,stats:i,onInteraction:l,className:c}){let s=xe.useRef(null),[u,d]=xe.useState([]),[f,p]=xe.useState(null),[x,y]=xe.useState(null),[g,h]=xe.useState(null),[v,m]=xe.useState(1),[k,w]=xe.useState({x:0,y:0});xe.useEffect(()=>{if(e.length===0)return;let R=jf(e,t,r.width,r.height,r,150);d(R);},[e,t,r]);let b=xe.useCallback((R,F)=>{r.enableDragging&&(F.stopPropagation(),p(R));},[r.enableDragging]),T=xe.useCallback(R=>{if(!f||!s.current)return;let O=s.current.getBoundingClientRect(),U=(R.clientX-O.left-k.x)/v,J=(R.clientY-O.top-k.y)/v;d(j=>j.map(ae=>ae.id===f?{...ae,x:U,y:J,fx:U,fy:J}:ae));},[f,v,k]),C=xe.useCallback(()=>{p(null);},[]),N=xe.useCallback((R,F)=>{F.stopPropagation(),l?.({type:"node-click",node:R,position:{x:F.clientX,y:F.clientY}});},[l]),D=xe.useCallback((R,F)=>{F.stopPropagation(),l?.({type:"edge-click",edge:R,position:{x:F.clientX,y:F.clientY}});},[l]),E=xe.useCallback(R=>{let F=u.find(O=>O.id===R);return F?{x:F.x,y:F.y}:{x:0,y:0}},[u]),I=xe.useCallback(R=>{if(R.onCriticalPath)return "#ef4444";switch(r.colorScheme){case "status":return R.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let F=R.card.priority;return F==="URGENT"?"#ef4444":F==="HIGH"?"#f59e0b":F==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return R.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[r.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:te("relationships-graph-empty",c),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:te("relationships-graph",c),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:i.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:i.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),o&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:o.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),r.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>m(R=>Math.min(R+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(v*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>m(R=>Math.max(R-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{m(1),w({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(R=>R.type))).map(R=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:bs(R)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[fc(R)," ",ys(R)]})]},R))}),jsxRuntime.jsxs("svg",{ref:s,className:"relationships-graph-canvas",width:r.width,height:r.height,onMouseMove:T,onMouseUp:C,onMouseLeave:C,children:[jsxRuntime.jsxs("g",{transform:`translate(${k.x}, ${k.y}) scale(${v})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(R=>{let F=E(typeof R.source=="string"?R.source:R.source.id),O=E(typeof R.target=="string"?R.target:R.target.id),U=gc(R.type),J=g===R.id,j=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:te("relationships-graph-edge",J&&"hovered",j&&"critical"),onMouseEnter:()=>h(R.id),onMouseLeave:()=>h(null),onClick:ae=>D(R,ae),children:[jsxRuntime.jsx("line",{x1:F.x,y1:F.y,x2:O.x,y2:O.y,stroke:bs(R.type),strokeWidth:j?r.edgeWidth*2:r.edgeWidth,strokeOpacity:J?1:.6,markerEnd:U?"url(#arrowhead)":void 0}),r.showEdgeLabels&&J&&jsxRuntime.jsx("text",{x:(F.x+O.x)/2,y:(F.y+O.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:ys(R.type)})]},R.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:u.map(R=>{let F=x===R.id,O=R.onCriticalPath;return jsxRuntime.jsxs("g",{className:te("relationships-graph-node",F&&"hovered",O&&"critical"),transform:`translate(${R.x}, ${R.y})`,onMouseDown:U=>b(R.id,U),onMouseEnter:()=>y(R.id),onMouseLeave:()=>y(null),onClick:U=>N(R,U),children:[jsxRuntime.jsx("circle",{r:O?r.nodeSize*1.2:r.nodeSize,fill:I(R),stroke:O?"#fbbf24":"#ffffff",strokeWidth:O?3:2,opacity:F?1:.9}),r.showLabels&&jsxRuntime.jsx("text",{y:r.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:R.card.title.length>20?R.card.title.substring(0,20)+"...":R.card.title})]},R.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function yc({isOpen:e,onClose:t,onPlanGenerated:r,onGeneratePlan:a,isLoading:n}){let[o,i]=xe.useState(""),[l,c]=xe.useState(false),[s,u]=xe.useState(null),[d,f]=xe.useState(null),p=xe.useRef(null),x=l||n;xe.useEffect(()=>{e&&p.current&&p.current.focus();},[e]),xe.useEffect(()=>{let v=m=>{m.key==="Escape"&&!x&&y();};if(e)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,x]);let y=()=>{x||(i(""),u(null),f(null),t());},g=async()=>{if(!(!o.trim()||x)){c(true),u(null),f(null);try{let v=await a(o.trim());f(v);}catch(v){u(v instanceof Error?v.message:"Failed to generate plan");}finally{c(false);}}},h=()=>{d&&(r(d),y());};return e?jsxRuntime.jsxs(Pe,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:y}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:v=>v.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:y,disabled:x,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:d?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),d.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:d.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",d.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:d.columns.map((v,m)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:v.title},m))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",d.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[d.cards.slice(0,10).map((v,m)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:v.title}),v.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:v.description})]}),v.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${v.priority==="URGENT"?"bg-red-500/20 text-red-400":v.priority==="HIGH"?"bg-orange-500/20 text-orange-400":v.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:v.priority})]})},m)),d.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",d.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:p,value:o,onChange:v=>i(v.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:x}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),s&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:s}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((v,m)=>jsxRuntime.jsx("button",{onClick:()=>i(v),disabled:x,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:v},m))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:x&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:y,disabled:x,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),d?jsxRuntime.jsx("button",{onClick:h,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:g,disabled:!o.trim()||x,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:x?"Generating...":"Generate Plan"})]})]})]})})]}):null}var xs={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var qf={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Xf={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Zf(e,t,r){let a=xs[e];if(!a)throw new Error(`Unknown model: ${e}`);let n=t/1e3*a.costPer1kInput,o=r/1e3*a.costPer1kOutput;return n+o}function Ha(e){return `$${e.toFixed(4)}`}var ks=class{constructor(){this.operations=[];this.listeners=[];}record(t){let r=Zf(t.model,t.inputTokens,t.outputTokens),a={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:r};return this.operations.push(a),this.listeners.forEach(n=>n(a)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),a}getStats(t){let r=this.operations;t&&(r=r.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let a=r.length,n=r.reduce((d,f)=>d+f.cost,0),o=r.reduce((d,f)=>d+f.inputTokens,0),i=r.reduce((d,f)=>d+f.outputTokens,0),l=r.filter(d=>d.success),c=r.reduce((d,f)=>d+f.duration,0),s={},u={};return r.forEach(d=>{s[d.feature]=(s[d.feature]||0)+1,u[d.feature]=(u[d.feature]||0)+d.cost;}),{totalOperations:a,totalCost:n,totalInputTokens:o,totalOutputTokens:i,operationsByFeature:s,costsByFeature:u,averageDuration:a>0?c/a:0,successRate:a>0?l.length/a:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,r="month"){let n={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][r],o=new Date,i=new Date;r==="month"?i.setMonth(o.getMonth()-1):i.setDate(o.getDate()-1);let l=this.operations.filter(u=>u.timestamp>=i).length,c=Math.max(0,n-l),s=l/n*100;return {used:l,limit:n,remaining:c,percentUsed:s,isExceeded:l>=n}}subscribe(t){return this.listeners.push(t),()=>{let r=this.listeners.indexOf(t);r>-1&&this.listeners.splice(r,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},Wr=new ks;function wc({isOpen:e,onClose:t,planTier:r="hobby"}){let[a,n]=xe.useState(Wr.getStats()),[o,i]=xe.useState(Wr.checkLimit(r));if(xe.useEffect(()=>{if(!e)return;let c=setInterval(()=>{n(Wr.getStats()),i(Wr.checkLimit(r));},1e3);return ()=>clearInterval(c)},[e,r]),xe.useEffect(()=>{let c=s=>{s.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]),!e)return null;let l=Wr.getRecentOperations(5);return jsxRuntime.jsxs(Pe,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",r.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[o.used," / ",o.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,o.percentUsed)}%`,background:o.percentUsed>90?"#EF4444":o.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[o.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Ha(a.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:a.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(a.totalInputTokens+a.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[a.totalInputTokens.toLocaleString()," in /"," ",a.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(a.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",a.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(a.operationsByFeature).map(([c,s])=>{let u=a.costsByFeature[c]||0,d=a.totalOperations>0?s/a.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:c.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[s," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ha(u)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${d}%`}})})]},c)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),l.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:l.map(c=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:c.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(c.timestamp).toLocaleTimeString()," \u2022"," ",c.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[c.inputTokens+c.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ha(c.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${c.success?"bg-green-400":"bg-red-400"}`})]})]},c.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function Sc({isOpen:e,onClose:t,onTasksGenerated:r,onGenerateTasks:a,isLoading:n,projectName:o}){let[i,l]=xe.useState(""),[c,s]=xe.useState(""),[u,d]=xe.useState(""),[f,p]=xe.useState(false),[x,y]=xe.useState(null),[g,h]=xe.useState(null),[v,m]=xe.useState(null),k=xe.useRef(null),w=f||n;xe.useEffect(()=>{e&&k.current&&k.current.focus();},[e]),xe.useEffect(()=>{let D=E=>{E.key==="Escape"&&!w&&b();};if(e)return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[e,w]);let b=()=>{w||(l(""),s(""),d(""),y(null),h(null),m(null),t());},T=async()=>{if(!(!i.trim()||w)){p(true),y(null),h(null),m(null);try{let D=await a({prompt:i.trim(),projectName:o||"Mi Proyecto",startDate:c||void 0,endDate:u||void 0});h(D.tasks.tasks),m({from_cache:D.from_cache,tokens_used:D.tokens_used,mock_mode:D.mock_mode,similarity:D.similarity,tokens_saved:D.tokens_saved});}catch(D){y(D instanceof Error?D.message:"Failed to generate tasks");}finally{p(false);}}},C=()=>{g&&(r(g),b());};if(!e)return null;let N=v?.similarity?((v.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Pe,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:b}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:D=>D.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:b,disabled:w,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:g?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[v?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),v?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",N,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[v?.tokens_used||0," tokens"]}),v?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[v.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[g.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:g.map((D,E)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",E+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:D.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),D.start," \u2192 ",D.end]}),jsxRuntime.jsxs("span",{children:[D.duration," days"]}),D.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",D.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${D.priority==="high"?"bg-red-500/20 text-red-400":D.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:D.priority})]})},D.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:k,value:i,onChange:D=>l(D.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:w}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:c,onChange:D=>s(D.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:u,onChange:D=>d(D.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]})]}),x&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:x}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((D,E)=>jsxRuntime.jsx("button",{onClick:()=>l(D),disabled:w,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:D},E))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:w&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:b,disabled:w,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),g?jsxRuntime.jsx("button",{onClick:C,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:T,disabled:!i.trim()||w,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:w?"Generating...":"Generate Tasks"})]})]})]})})]})}function $n({initialBoard:e,onPersist:t}){let[r,a]=xe.useState(e),n=xe.useCallback(g=>{t&&Ya(()=>Promise.resolve(t(g)),{maxAttempts:3,initialDelay:1e3,onRetry:(h,v,m)=>{console.warn(`Retry attempt ${v} after ${m}ms: ${h.message}`);}}).then(h=>{h.success||console.error(`Failed to persist board after ${h.attempts} attempts:`,h.error);});},[t]),o=xe.useCallback(async(g,h,v)=>{a(m=>{let k=m.cards.find(D=>D.id===g);if(!k)return m;let w=k.columnId,b={...k,columnId:h,position:v},T=m.cards.map(D=>D.id===g?b:D),C=m.columns.map(D=>{if(D.id===w)return {...D,cardIds:D.cardIds.filter(E=>E!==g)};if(D.id===h){let E=T.filter(I=>I.columnId===h).sort((I,R)=>I.position-R.position);return {...D,cardIds:E.map(I=>I.id)}}return D}),N={...m,cards:T,columns:C};return n(N),N});},[n]),i=xe.useCallback(async(g,h)=>{a(v=>{let m=v.cards.map(w=>w.id===g?{...w,...h}:w),k={...v,cards:m};return n(k),k});},[n]),l=xe.useCallback(async g=>{let h=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;a(v=>{let m={...g,id:h},k=v.columns.map(b=>b.id===g.columnId?{...b,cardIds:[...b.cardIds,h]}:b),w={...v,cards:[...v.cards,m],columns:k};return n(w),w});},[n]),c=xe.useCallback(async g=>{a(h=>{let v=h.cards.find(b=>b.id===g);if(!v)return h;let m=h.cards.filter(b=>b.id!==g),k=h.columns.map(b=>b.id===v.columnId?{...b,cardIds:b.cardIds.filter(T=>T!==g)}:b),w={...h,cards:m,columns:k};return n(w),w});},[n]),s=xe.useCallback(async g=>{let h=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;a(v=>{let m={...g,id:h,cardIds:[]},k={...v,columns:[...v.columns,m]};return n(k),k});},[n]),u=xe.useCallback(async(g,h)=>{a(v=>{let m=v.columns.map(w=>w.id===g?{...w,...h}:w),k={...v,columns:m};return n(k),k});},[n]),d=xe.useCallback(async g=>{a(h=>{let v=h.cards.filter(w=>w.columnId!==g),m=h.columns.filter(w=>w.id!==g),k={...h,cards:v,columns:m};return n(k),k});},[n]),f=xe.useCallback(g=>{let h=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(g),h},[l]),p=xe.useCallback(g=>{let h=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return s(g),h},[s]),x=xe.useCallback(()=>{a(g=>{let h={...g,cards:[],columns:[]};return n(h),h});},[n]);return {board:r,callbacks:{onCardMove:o,onCardUpdate:i,onCardCreate:l,onCardDelete:c,onColumnCreate:s,onColumnUpdate:u,onColumnDelete:d},setBoard:a,helpers:{addCard:f,addColumn:p,deleteCard:c,deleteColumn:d,clearBoard:x}}}function Dc({initialData:e,availableUsers:t=[],onSave:r}){let{board:a,callbacks:n,helpers:o}=$n({initialBoard:e,onPersist:r}),i=xe.useMemo(()=>({addCard:(c,s,u={})=>{o.addCard({title:s,columnId:c,position:a.cards.filter(d=>d.columnId===c).length,...u});},addColumn:(c,s)=>{let u=a.columns.length>0?Math.max(...a.columns.map(d=>d.position)):0;o.addColumn({title:c,position:s??u+1e3});},reset:o.clearBoard}),[a.cards,a.columns,o]);return {props:xe.useMemo(()=>({board:a,callbacks:n,availableUsers:t}),[a,n,t]),board:a,callbacks:n,utils:i}}var Ua={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},Rc={by:"none",order:"asc"};function Pc({initialFilters:e={},initialSort:t={},currentUserId:r}={}){let[a,n]=xe.useState({...Ua,...e}),[o,i]=xe.useState({...Rc,...t}),l=xe.useCallback(y=>{n(g=>({...g,...y}));},[]),c=xe.useCallback(y=>{i(g=>({...g,...y}));},[]),s=xe.useCallback(()=>{n(Ua),i(Rc);},[]),u=xe.useCallback(()=>{r&&n({...Ua,assignees:[r]});},[r]),d=xe.useCallback(()=>{n({...Ua,dateFilter:"overdue"});},[]),f=xe.useCallback(()=>{n({...Ua,priorities:["HIGH","URGENT"]});},[]),p=xe.useMemo(()=>a.dateFilter!=="all"||a.priorities.length>0||a.assignees.length>0||a.labels.length>0||a.columns.length>0||a.search!==""||o.by!=="none",[a,o]),x=xe.useCallback(y=>{let g=[...y];if(a.search){let h=a.search.toLowerCase();g=g.filter(v=>v.title.toLowerCase().includes(h)||v.description?.toLowerCase().includes(h));}if(a.dateFilter!=="all"){let h=new Date,v=h.getFullYear(),m=String(h.getMonth()+1).padStart(2,"0"),k=String(h.getDate()).padStart(2,"0"),w=`${v}-${m}-${k}`;g=g.filter(b=>{if(!b.endDate&&!b.dueDate)return false;let T=b.endDate||b.dueDate;if(!T)return false;let C;if(typeof T=="string")C=T.split("T")[0]||T;else {let N=T.getUTCFullYear(),D=String(T.getUTCMonth()+1).padStart(2,"0"),E=String(T.getUTCDate()).padStart(2,"0");C=`${N}-${D}-${E}`;}switch(a.dateFilter){case "overdue":return C<w;case "today":return C===w;case "this-week":let N=new Date(w+"T00:00:00"),D=new Date(C+"T00:00:00"),E=new Date(N);return E.setDate(E.getDate()+7),D>=N&&D<=E;case "custom":if(a.dateRange){let I=typeof T=="string"?new Date(T):T;return I>=a.dateRange.start&&I<=a.dateRange.end}return true;default:return true}});}return a.priorities.length>0&&(g=g.filter(h=>h.priority&&a.priorities.includes(h.priority))),a.assignees.length>0&&(g=g.filter(h=>(h.assignedUserIds||(h.assigneeId?[h.assigneeId]:[])).some(m=>a.assignees.includes(m)))),a.labels.length>0&&(g=g.filter(h=>h.labels&&h.labels.some(v=>a.labels.includes(v)))),a.columns.length>0&&(g=g.filter(h=>a.columns.includes(h.columnId))),o.by!=="none"&&g.sort((h,v)=>{let m=0;switch(o.by){case "created":let k=h.createdAt?new Date(h.createdAt).getTime():0,w=v.createdAt?new Date(v.createdAt).getTime():0;m=k-w;break;case "priority":let b={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},T=b[h.priority||"LOW"],C=b[v.priority||"LOW"];m=T-C;break;case "dueDate":let N=h.endDate||h.dueDate,D=v.endDate||v.dueDate;if(!N)return 1;if(!D)return -1;let E=typeof N=="string"?new Date(N).getTime():N.getTime(),I=typeof D=="string"?new Date(D).getTime():D.getTime();m=E-I;break;case "title":m=h.title.localeCompare(v.title);break;case "estimate":let R=h.estimatedTime||0,F=v.estimatedTime||0;m=R-F;break;default:m=0;}return o.order==="asc"?m:-m}),g},[a,o]);return {filters:a,sort:o,setFilters:l,setSort:c,resetFilters:s,filterMyTasks:u,filterOverdue:d,filterHighPriority:f,applyFilters:x,hasActiveFilters:p}}var Mc,Ac;if(typeof window<"u")try{let e=Va("ai");Mc=e.generateObject,Ac=e.generateText;}catch{}function Lc(e={}){let[t,r]=xe.useState(false),[a,n]=xe.useState(null),o=!!(Mc&&Ac&&e.apiKey),i=xe.useCallback(async d=>{if(!o)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');r(true),n(null);try{return console.log("Generating plan for:",d),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${d}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(f){let p=f instanceof Error?f:new Error("Failed to generate plan");throw n(p),p}finally{r(false);}},[o]),l=xe.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(f){let p=f instanceof Error?f:new Error("Failed to suggest assignee");throw n(p),p}finally{r(false);}},[o]),c=xe.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(f){let p=f instanceof Error?f:new Error("Failed to predict risks");throw n(p),p}finally{r(false);}},[o]),s=xe.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Generating subtasks for:",d.title),[{title:`Subtask 1 for: ${d.title}`,position:d.position+.1,columnId:d.columnId},{title:`Subtask 2 for: ${d.title}`,position:d.position+.2,columnId:d.columnId}]}catch(f){let p=f instanceof Error?f:new Error("Failed to generate subtasks");throw n(p),p}finally{r(false);}},[o]),u=xe.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(f){let p=f instanceof Error?f:new Error("Failed to estimate effort");throw n(p),p}finally{r(false);}},[o]);return {onGeneratePlan:i,onSuggestAssignee:l,onPredictRisks:c,onGenerateSubtasks:s,onEstimateEffort:u,isAvailable:o,isLoading:t,error:a}}function Cs(){let[e,t]=xe.useState(()=>core.selectionStore.getState());xe.useEffect(()=>core.selectionStore.subscribe(n=>{t(n);}),[]);let r=xe.useCallback(a=>{core.selectionStore.setState(a);},[]);return [e,r]}function Fc(e){let{cards:t}=e,[r,a]=Cs(),n=xe.useCallback(d=>r.selectedCardIds.includes(d),[r.selectedCardIds]),o=xe.useCallback((d,f)=>{if(!f){a({selectedCardIds:[d],lastSelectedCardId:d});return}let p=f.ctrlKey||f.metaKey,x=f.shiftKey;if(p)r.selectedCardIds.includes(d)?a({selectedCardIds:r.selectedCardIds.filter(y=>y!==d),lastSelectedCardId:r.lastSelectedCardId}):a({selectedCardIds:[...r.selectedCardIds,d],lastSelectedCardId:d});else if(x&&r.lastSelectedCardId){let y=t.find(h=>h.id===d),g=t.find(h=>h.id===r.lastSelectedCardId);if(y&&g&&y.columnId===g.columnId){let h=t.filter(C=>C.columnId===y.columnId).sort((C,N)=>C.position-N.position),v=h.findIndex(C=>C.id===r.lastSelectedCardId),m=h.findIndex(C=>C.id===d),[k,w]=v<m?[v,m]:[m,v],b=h.slice(k,w+1).map(C=>C.id),T=Array.from(new Set([...r.selectedCardIds,...b]));a({selectedCardIds:T,lastSelectedCardId:d});}else a({selectedCardIds:[d],lastSelectedCardId:d});}else a({selectedCardIds:[d],lastSelectedCardId:d});},[t,r,a]),i=xe.useCallback(d=>{a({selectedCardIds:r.selectedCardIds.filter(f=>f!==d),lastSelectedCardId:r.lastSelectedCardId});},[r,a]),l=xe.useCallback(()=>{a({selectedCardIds:[],lastSelectedCardId:null});},[a]),c=xe.useCallback(()=>{a({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,a]),s=xe.useCallback(d=>{r.selectedCardIds.includes(d)?i(d):a({selectedCardIds:[...r.selectedCardIds,d],lastSelectedCardId:d});},[r,i,a]),u=xe.useCallback(()=>t.filter(d=>r.selectedCardIds.includes(d.id)),[t,r.selectedCardIds]);return {selectedCardIds:r.selectedCardIds,lastSelectedCardId:r.lastSelectedCardId,isCardSelected:n,selectCard:o,deselectCard:i,clearSelection:l,selectAll:c,toggleCard:s,getSelectedCards:u}}var Bc={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Oc(e){let{cards:t,config:r,aiService:a}=e,n=xe.useMemo(()=>({...Bc,...r}),[r]),[o,i]=xe.useState([]),l=xe.useCallback((y,g,h,v,m)=>{if(g.length<n.minCardsPerStack){console.warn(`Cannot create stack: minimum ${n.minCardsPerStack} cards required`);return}let k={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:y,cardIds:g,columnId:h,strategy:v,color:m,isExpanded:true,position:o.filter(w=>w.columnId===h).length,createdAt:new Date};i(w=>[...w,k]);},[n.minCardsPerStack,o]),c=xe.useCallback(y=>{i(g=>g.filter(h=>h.id!==y));},[]),s=xe.useCallback(y=>{i(g=>g.map(h=>h.id===y?{...h,isExpanded:!h.isExpanded}:h));},[]),u=xe.useCallback((y,g)=>{i(h=>h.map(v=>v.id===y&&!v.cardIds.includes(g)?{...v,cardIds:[...v.cardIds,g]}:v));},[]),d=xe.useCallback((y,g)=>{i(h=>h.map(v=>{if(v.id===y){let m=v.cardIds.filter(k=>k!==g);return m.length<n.minCardsPerStack?null:{...v,cardIds:m}}return v}).filter(v=>v!==null));},[n.minCardsPerStack]),f=xe.useCallback(y=>o.filter(g=>g.columnId===y).sort((g,h)=>g.position-h.position),[o]),p=xe.useCallback(async y=>{let g=t.filter(w=>w.columnId===y);if(g.length<n.minCardsPerStack*2)return [];let h=[],v=new Map;g.forEach(w=>{w.labels&&w.labels.length>0&&w.labels.forEach(b=>{v.has(b)||v.set(b,[]),v.get(b).push(w);});}),v.forEach((w,b)=>{w.length>=n.minCardsPerStack&&h.push({stack:{title:`\u{1F4CC} ${b}`,cardIds:w.map(T=>T.id),columnId:y,strategy:"labels",color:"#3b82f6"},reason:`${w.length} cards with label "${b}"`,confidence:.85});});let m=new Map;g.forEach(w=>{w.assignedUserIds&&w.assignedUserIds.length>0&&w.assignedUserIds.forEach(b=>{m.has(b)||m.set(b,[]),m.get(b).push(w);});}),m.forEach((w,b)=>{w.length>=n.minCardsPerStack&&h.push({stack:{title:`\u{1F464} Assigned to user-${b.slice(-4)}`,cardIds:w.map(T=>T.id),columnId:y,strategy:"assignee",color:"#8b5cf6"},reason:`${w.length} cards assigned to the same user`,confidence:.8});});let k=new Map;if(g.forEach(w=>{w.priority&&(k.has(w.priority)||k.set(w.priority,[]),k.get(w.priority).push(w));}),k.forEach((w,b)=>{if(w.length>=n.minCardsPerStack){let T={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[b.toLowerCase()]||"\u26AA";h.push({stack:{title:`${T} ${b} Priority`,cardIds:w.map(C=>C.id),columnId:y,strategy:"priority",color:b==="high"||b==="urgent"?"#ef4444":"#10b981"},reason:`${w.length} cards with ${b} priority`,confidence:.75});}}),a&&n.enableAutoStacking)for(let w of g){let T=(await a.findSimilar(w,g)).filter(C=>C.similarity>=n.autoStackConfidenceThreshold);if(T.length>=n.minCardsPerStack-1){let C=[w.id,...T.map(D=>D.card.id)],N=T.reduce((D,E)=>D+E.similarity,0)/T.length;h.push({stack:{title:`\u2728 Similar to "${w.title.substring(0,30)}${w.title.length>30?"...":""}"`,cardIds:C,columnId:y,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${T.length+1} similar tasks`,confidence:N});}}return h.filter(w=>w.confidence>=n.autoStackConfidenceThreshold).sort((w,b)=>b.confidence-w.confidence).slice(0,5)},[t,n,a]),x=xe.useCallback(y=>{l(y.stack.title,y.stack.cardIds,y.stack.columnId,y.stack.strategy,y.stack.color);},[l]);return xe.useEffect(()=>{n.enableAutoStacking&&o.length===0&&new Set(t.map(g=>g.columnId)).forEach(async g=>{let h=await p(g),v=h[0];h.length>0&&v&&v.confidence>=.9&&x(v);});},[]),{stacks:o,createStack:l,deleteStack:c,toggleStack:s,addToStack:u,removeFromStack:d,getStacksForColumn:f,getSuggestions:p,applySuggestion:x,config:n}}var zc=xe.createContext(null);function Hc({children:e,initialData:t,onStateChange:r}){let a=xe.useRef();if(!a.current){let o=new Map,i=new Map;t?.columns?.forEach(c=>{let{Column:s}=Va("@libxai/core");o.set(c.id,new s(c));}),t?.cards?.forEach(c=>{let{Card:s}=Va("@libxai/core");i.set(c.id,new s(c));});let l=null;if(t?.board){let{Board:c}=Va("@libxai/core");l=new c(t.board);}a.current=new core.BoardStore({board:l,columns:o,cards:i});}let n=a.current;return xe.useEffect(()=>{if(r)return n.subscribeAll(o=>{r(n.getState());})},[n,r]),jsxRuntime.jsx(zc.Provider,{value:{store:n},children:e})}function Wn(){let e=xe.useContext(zc);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function _a(){let e=Wn(),[t,r]=xe.useState(e.getBoard()),[a,n]=xe.useState(e.getAllColumns()),[o,i]=xe.useState(e.getAllCards());xe.useEffect(()=>e.subscribeAll(()=>{r(e.getBoard()),n(e.getAllColumns()),i(e.getAllCards());}),[e]);let l=xe.useCallback(v=>{e.updateBoard(v);},[e]),c=xe.useCallback(v=>{e.addColumn(v);},[e]),s=xe.useCallback((v,m)=>{e.updateColumn(v,m);},[e]),u=xe.useCallback(v=>{e.deleteColumn(v);},[e]),d=xe.useCallback(v=>e.getColumn(v),[e]),f=xe.useCallback(v=>{e.addCard(v);},[e]),p=xe.useCallback((v,m)=>{e.updateCard(v,m);},[e]),x=xe.useCallback(v=>{e.deleteCard(v);},[e]),y=xe.useCallback((v,m,k)=>{e.moveCard(v,m,k);},[e]),g=xe.useCallback(v=>e.getCard(v),[e]),h=xe.useCallback(v=>e.getCardsByColumn(v),[e]);return {board:t,columns:a,cards:o,updateBoard:l,addColumn:c,updateColumn:s,deleteColumn:u,getColumn:d,addCard:f,updateCard:p,deleteCard:x,moveCard:y,getCard:g,getCardsByColumn:h}}function Gc(e){let{cards:t}=_a();return xe.useMemo(()=>e?t.filter(r=>{if(e.searchQuery){let a=e.searchQuery.toLowerCase(),n=r.title.toLowerCase().includes(a),o=r.description?.toLowerCase().includes(a);if(!n&&!o)return false}return !(e.priorities&&e.priorities.length>0&&(!r.priority||!e.priorities.includes(r.priority))||e.statuses&&e.statuses.length>0&&(!r.status||!e.statuses.includes(r.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(n=>r.isAssignedTo(n))||e.labels&&e.labels.length>0&&!e.labels.some(n=>r.hasLabel(n))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(r.columnId)||e.isOverdue!==void 0&&e.isOverdue!==r.isOverdue())}):t,[t,e])}function _c(e="position",t="asc"){let{cards:r}=_a();return xe.useMemo(()=>[...r].sort((n,o)=>{let i=0;switch(e){case "title":i=n.title.localeCompare(o.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},c=n.priority?l[n.priority]:0,s=o.priority?l[o.priority]:0;i=c-s;break}case "createdAt":i=n.createdAt.getTime()-o.createdAt.getTime();break;case "updatedAt":i=n.updatedAt.getTime()-o.updatedAt.getTime();break;case "position":i=n.position-o.position;break}return t==="asc"?i:-i}),[r,e,t])}var Vn=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=js.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let r of t.dependencies)if(!this.plugins.has(r))throw new Error(`Plugin ${t.id} depends on ${r} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(r=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,r,{plugin:t.id});});}unregister(t){let r=this.plugins.get(t);if(!r){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}r.onDestroy&&Promise.resolve(r.onDestroy()).catch(a=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,a);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${r.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,r){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);r?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,r){return this.config.get(t)?.[r]}setConfig(t,r,a){this.config.has(t)||this.config.set(t,{});let n=this.config.get(t);n[r]=a,this.pluginLogger.debug(`Plugin config set: ${t}.${r}`,{value:a});}async executeHook(t,r,a){let n=a;for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let i=o[t];if(typeof i=="function")try{let l=await Promise.resolve(i.apply(o,r));l!==void 0&&(n=l,r[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,l,{plugin:o.id,hook:t});}}return n}async executeHookParallel(t,r){let a=[];for(let n of this.plugins.values()){if(!this.enabled.has(n.id))continue;let o=n[t];typeof o=="function"&&a.push(Promise.resolve(o.apply(n,r)).catch(i=>{this.pluginLogger.error(`Plugin hook failed: ${n.id}.${t}`,i,{plugin:n.id,hook:t});}));}await Promise.all(a);}},fg=new Vn;function Wc({items:e,height:t,estimateSize:r,renderItem:a,className:n="",overscan:o=5,horizontal:i=false,gap:l=0,getItemKey:c}){let s=xe.useRef(null),u=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>s.current,estimateSize:()=>r,overscan:o,horizontal:i,gap:l}),d=u.getVirtualItems(),f={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},p=i?{width:`${u.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${u.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:s,style:f,className:n,children:jsxRuntime.jsx("div",{style:p,children:d.map(x=>{let y=e[x.index];if(!y)return null;let g=c?c(y,x.index):x.index,h={position:"absolute",top:i?0:x.start,left:i?x.start:0,width:i?x.size:"100%",height:i?"100%":x.size};return jsxRuntime.jsx("div",{style:h,"data-index":x.index,children:a(y,x.index)},g)})})})}function Vc(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function jc({items:e,height:t,width:r="100%",estimateColumnWidth:a,renderColumn:n,className:o="",overscan:i=3,gap:l=16,getItemKey:c,horizontal:s=true}){let u=xe.useRef(null),d=reactVirtual.useVirtualizer({horizontal:s,count:e.length,getScrollElement:()=>u.current,estimateSize:()=>a,overscan:i,gap:l}),f=d.getVirtualItems(),p={height:typeof t=="number"?`${t}px`:t,width:typeof r=="number"?`${r}px`:r,overflow:"auto",position:"relative"},x={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:u,style:p,className:o,children:jsxRuntime.jsx("div",{style:x,children:f.map(y=>{let g=e[y.index];if(!g)return null;let h=c?c(g,y.index):y.index,v={position:"absolute",top:0,left:y.start,width:y.size,height:"100%"};return jsxRuntime.jsx("div",{style:v,"data-index":y.index,children:n(g,y.index)},h)})})})}function Yc(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function qc(e,t=10){return e>t}var Ds={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Es={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Rs={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Ps={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Is={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Ms={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},As={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Ls={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Fs={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Bs={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Os={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},zs={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},Kn={spacing:Ds,borderRadius:Es,fontSize:Rs,fontWeight:Ps,lineHeight:Is,zIndex:Ms,duration:As,easing:Ls,shadows:Fs,opacity:Bs,kanban:Os,gantt:zs};function Xc(e,t,r){return e[t]??r}function Hs(e,t="",r={}){for(let[a,n]of Object.entries(e)){let o=t?`${t}-${a}`:a;typeof n=="object"&&n!==null&&!Array.isArray(n)?Hs(n,o,r):(typeof n=="string"||typeof n=="number")&&(r[o]=n);}return r}function vg(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Us(e="asakaa"){let t=Hs(Kn),r=[];for(let[a,n]of Object.entries(t)){let o=`--${e}-${a}`,i=vg(n);r.push(` ${o}: ${i};`);}return `:root {
|
|
48
|
+
Task dependencies must flow in one direction only.`);return}let V=Y=>Y.map(Z=>{if(Z.id===F){let ne=Z.dependencies||[];if(!ne.includes(R.id))return {...Z,dependencies:[...ne,R.id]}}return Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z});ie(V(re)),v?.(R.id,F);},[re,v,Zr]),ed=ke.useCallback((R,F)=>{let V=Y=>Y.map(Z=>{if(Z.id===R&&Z.dependencies){let ne=Z.dependencies.filter(ht=>ht!==F);return {...Z,dependencies:ne}}return Z.subtasks?{...Z,subtasks:V(Z.subtasks)}:Z});ie(V(re)),m?.(R,F);},[re,m]),{startDate:td,endDate:rd}=ke.useMemo(()=>{let R=re.filter(ne=>ne.startDate&&ne.endDate);if(R.length===0){let ne=new Date,ht=new Date(ne);ht.setDate(ht.getDate()-30);let $e=new Date(ne);return $e.setDate($e.getDate()+60),{startDate:ht,endDate:$e}}let F=R.flatMap(ne=>[ne.startDate,ne.endDate]).filter(ne=>ne!==void 0),V=new Date(Math.min(...F.map(ne=>ne.getTime()))),Y=new Date(Math.max(...F.map(ne=>ne.getTime()))),Z=I==="day"?7:I==="week"?14:30;return V.setDate(V.getDate()-Z),Y.setDate(Y.getDate()+Z),{startDate:V,endDate:Y}},[re,I]),ad=R=>{R.preventDefault(),te(true);};return ke.useEffect(()=>{let R=se.current,F=it.current;if(!R||!F)return;let V=r.disableScrollSync||false,Y=()=>{if(V){ae(R.scrollTop);return}F.scrollTop!==R.scrollTop&&(F.scrollTop=R.scrollTop),ae(R.scrollTop);},Z=()=>{if(V){ae(F.scrollTop);return}R.scrollTop!==F.scrollTop&&(R.scrollTop=F.scrollTop),ae(F.scrollTop);},ne=$e=>{if(Ee){let Jr=$e.clientX;Jr>300&&Jr<window.innerWidth-400&&B(Jr);}},ht=()=>{te(false);};return R.addEventListener("scroll",Y),F.addEventListener("scroll",Z),document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ht),()=>{R.removeEventListener("scroll",Y),F.removeEventListener("scroll",Z),document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ht);}},[Ee,r.disableScrollSync]),jsxRuntime.jsxs("div",{ref:Ye,className:"flex flex-col h-screen overflow-hidden",style:{backgroundColor:ut.bgPrimary,fontFamily:"Inter, sans-serif",...r.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:[jsxRuntime.jsx(Nn,{theme:ut,timeScale:I,onTimeScaleChange:E,zoom:U,onZoomChange:J,currentTheme:N,onThemeChange:xe,rowDensity:A,onRowDensityChange:z,showThemeSelector:c}),jsxRuntime.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[jsxRuntime.jsx("div",{ref:se,style:{width:$t,...r.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:jsxRuntime.jsx(En,{tasks:he,theme:ut,rowHeight:de,availableUsers:s,templates:Nr,onTaskClick:p,onTaskDblClick:Xr,onTaskContextMenu:y,onTaskToggle:qr,scrollTop:X,columns:Me,onToggleColumn:Yr,onTaskUpdate:Dr,onTaskIndent:O,onTaskOutdent:ge,onTaskMove:ue,onMultiTaskDelete:S,onTaskDuplicate:G,onTaskCreate:pe,onTaskRename:we,onCreateSubtask:Ne,onOpenTaskModal:p?R=>p(R):void 0})}),jsxRuntime.jsx("div",{className:"relative flex-shrink-0 cursor-col-resize group",style:{width:8,backgroundColor:Ee?ut.accent:ut.border,transition:"background-color 0.2s"},onMouseDown:ad,children:jsxRuntime.jsx(framerMotion.motion.div,{className:"absolute inset-y-0 left-1/2 -translate-x-1/2",style:{width:2,backgroundColor:ut.accent},initial:{opacity:0},animate:{opacity:Ee?1:0},whileHover:{opacity:1}})}),jsxRuntime.jsx("div",{ref:it,className:"flex-1 overflow-hidden",style:{...r.disableScrollSync&&{scrollBehavior:"auto",overflowAnchor:"none"}},children:jsxRuntime.jsx(Fn,{tasks:he,theme:ut,rowHeight:de,timeScale:I,startDate:td,endDate:rd,zoom:U,templates:Nr,onTaskClick:p,onTaskDblClick:Xr,onTaskContextMenu:Bt,onTaskDateChange:Pt,onDependencyCreate:Qc,onDependencyDelete:ed})})]}),j.task&&jsxRuntime.jsx(pa,{isOpen:j.isOpen,x:j.x,y:j.y,theme:ut,onClose:()=>Le({isOpen:false,x:0,y:0,task:null}),items:[{id:"split",label:"Split Task",icon:Rt.Split,onClick:()=>{if(!j.task?.startDate||!j.task?.endDate){console.warn("Cannot split task without dates");return}let R=j.task.startDate.getTime(),F=j.task.endDate.getTime(),V=R+(F-R)/2,Y=new Date(V);jn(j.task,Y);},disabled:!j.task?.startDate||!j.task?.endDate}]}),tt&&jsxRuntime.jsx(Bn,{isOpen:true,onClose:()=>Lt(null),task:tt,onSubmit:R=>{Dr(tt.id,R),Lt(null);},mode:"edit",theme:N})]})});function Hf(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function Uf(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return "TODO"}}function Hn(e,t=[],r=[]){let a=e.assignedUserIds?.map(u=>{let d=r.find(f=>f.id===u);return d?{name:d.name,initials:d.initials,color:d.color}:null}).filter(u=>u!==null),n=t.filter(u=>u.metadata?.parentCardId===e.id).map(u=>Hn(u,t,r)),o;e.dependencies&&(typeof e.dependencies[0]=="string"?o=e.dependencies:o=e.dependencies.filter(u=>u.type==="finish-to-start").map(u=>u.taskId));let i=u=>{if(u)return typeof u=="string"?new Date(u):u},l=i(e.startDate),c=i(e.endDate),s=e.metadata?.isMilestone===true||l&&c&&Math.abs(c.getTime()-l.getTime())<=864e5;return {id:e.id,name:e.title,startDate:l,endDate:c,progress:e.progress||0,status:Hf(e.metadata?.status),assignees:a?.length?a:void 0,dependencies:o?.length?o:void 0,subtasks:n?.length?n:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:s,isCriticalPath:e.metadata?.isCriticalPath===true}}function sc(e,t=[]){let r;return e.assignees&&e.assignees.length>0&&(r=e.assignees.map(a=>t.find(o=>o.name===a.name||o.initials===a.initials)?.id).filter(a=>a!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:r?.length?r:void 0,metadata:{status:Uf(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function ic(e,t=[]){return e.filter(a=>!a.metadata?.parentCardId).map(a=>Hn(a,e,t))}function _f({stack:e,cards:t,renderCard:r,onCardClick:a,onToggleExpand:n,onUnstack:o,onDeleteStack:i,className:l}){let[c,s]=ke.useState(false),u=ke.useMemo(()=>t.filter(p=>e.cardIds.includes(p.id)),[t,e.cardIds]),d=ke.useMemo(()=>{let p=u.length,x=new Set(u.flatMap(h=>h.assignedUserIds||[])).size,y=u.map(h=>h.priority).filter(Boolean),g=new Set(u.flatMap(h=>h.labels||[])).size;return {totalCards:p,uniqueAssignees:x,priorities:y,labels:g}},[u]),f=()=>{n?.(e.id);};return jsxRuntime.jsxs("div",{className:ee("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>s(true),onMouseLeave:()=>s(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:f,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ee("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:d.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),c&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:p=>{p.stopPropagation(),i?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[d.uniqueAssignees," assignees"]})]}),d.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[d.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:u.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:u.map(p=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[r?jsxRuntime.jsx("div",{onClick:()=>a?.(p),children:r(p)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>a?.(p),children:[jsxRuntime.jsx("h4",{children:p.title}),p.description&&jsxRuntime.jsxs("p",{children:[p.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:x=>{x.stopPropagation(),o?.(e.id,p.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},p.id))})})]})}var cc={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Oa(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function za(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function dc(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function uc({events:e,filter:t,onFilterChange:r,onClearFilter:a,onEventClick:n,selectedEventId:o,config:i,className:l}){let c=ke.useMemo(()=>({...cc,...i}),[i]),[s,u]=ke.useState(new Set),d=ke.useRef(null),f=ke.useMemo(()=>{if(!c.groupByDay)return [{date:null,events:e}];let v=new Map;return e.forEach(m=>{let k=m.timestamp.toISOString().split("T")[0],w=v.get(k);w?w.push(m):v.set(k,[m]);}),Array.from(v.entries()).sort((m,k)=>k[0].localeCompare(m[0])).map(([m,k])=>({date:new Date(m),events:k.sort((w,b)=>b.timestamp.getTime()-w.timestamp.getTime())}))},[e,c.groupByDay]),{uniqueUsers:p,uniqueTypes:x}=ke.useMemo(()=>{let v=new Set,m=new Set;return e.forEach(k=>{v.add(k.userId),m.add(k.type);}),{uniqueUsers:Array.from(v),uniqueTypes:Array.from(m)}},[e]),y=v=>{u(m=>{let k=new Set(m);return k.has(v)?k.delete(v):k.add(v),k});},g=v=>{let k=new Date().getTime()-v.getTime(),w=Math.floor(k/6e4),b=Math.floor(k/36e5),C=Math.floor(k/864e5);return w<1?"just now":w<60?`${w}m ago`:b<24?`${b}h ago`:C<7?`${C}d ago`:v.toLocaleDateString()},h=ke.useMemo(()=>{let v=0;return t.types&&t.types.length>0&&v++,t.users&&t.users.length>0&&v++,t.dateRange&&v++,t.searchTerm&&v++,v},[t]);return ke.useEffect(()=>{if(o&&d.current){let v=d.current.querySelector(`[data-event-id="${o}"]`);v&&v.scrollIntoView({behavior:"smooth",block:"center"});}},[o]),e.length===0?jsxRuntime.jsxs("div",{className:ee("history-timeline-empty",l),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:ee("history-timeline",c.compact&&"compact",l),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:v=>{let m=v.target.value;r({...t,types:m?[m]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),x.map(v=>jsxRuntime.jsxs("option",{value:v,children:[za(v)," ",v.replace("_"," ")]},v))]}),p.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:v=>{let m=v.target.value;r({...t,users:m?[m]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),p.map(v=>jsxRuntime.jsx("option",{value:v,children:v},v))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:v=>r({...t,searchTerm:v.target.value})})]}),h>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:a,children:["Clear filters (",h,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:d,children:f.map(v=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[c.groupByDay&&v.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:v.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[v.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:v.events.map((m,k)=>{let w=s.has(m.id),b=o===m.id,C=dc(m.type);return jsxRuntime.jsxs("div",{"data-event-id":m.id,className:ee("history-timeline-event",w&&"expanded",b&&"selected"),onClick:()=>n?.(m),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:C},children:c.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:za(m.type)})}),k<v.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:C}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[c.showAvatars&&m.userAvatar&&jsxRuntime.jsx("img",{src:m.userAvatar,alt:m.userName||m.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:m.userName||m.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:Oa(m)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:c.useRelativeTime?g(m.timestamp):m.timestamp.toLocaleString()})]}),Object.keys(m.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:T=>{T.stopPropagation(),y(m.id);},children:[w?"\u25BC":"\u25B6"," Show changes"]}),w&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(m.changes).map(([T,D])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[T,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(D.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(D.to)})]})]},T)),m.metadata&&Object.keys(m.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(m.metadata).map(([T,D])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[T,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(D)})]},T))]})]})]})]},m.id)})})]},v.date?.toISOString()||"all"))})]})}function mc({replayState:e,events:t,onStartReplay:r,onStopReplay:a,onTogglePlayback:n,onPrevious:o,onNext:i,onGoToEvent:l,onSpeedChange:c,className:s}){let u=[.5,1,1.5,2,3],d=ke.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),f=ke.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:ee("history-replay-empty",s),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:ee("history-replay",s),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:d&&za(d.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:d&&Oa(d)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:d&&d.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:p=>l(parseInt(p.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${f}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((p,x)=>jsxRuntime.jsx("div",{className:ee("history-replay-progress-marker",x===e.currentIndex&&"active"),style:{left:`${x/(e.totalEvents-1)*100}%`},onClick:()=>l(x),title:Oa(p)},p.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:o,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:n,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:i,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:u.map(p=>jsxRuntime.jsxs("button",{className:ee("history-replay-speed-btn",e.speed===p&&"active"),onClick:()=>c(p),children:[p,"x"]},p))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:a,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:d&&d.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(p=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:p},p))})]})]})]})]}):jsxRuntime.jsxs("div",{className:ee("history-replay-start",s),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:r,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function bs(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function ys(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function fc(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function gc(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Yf(e,t,r,a,n,o=100){let i=e.map(c=>({...c,x:c.x??r/2+Math.random()*100-50,y:c.y??a/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(i.map(c=>[c.id,c]));for(let c=0;c<o;c++){let s=1-c/o;i.forEach(u=>{let d=r/2,f=a/2;u.vx+=(d-u.x)*n.centerForce*s,u.vy+=(f-u.y)*n.centerForce*s,i.forEach(p=>{if(u.id===p.id)return;let x=u.x-p.x,y=u.y-p.y,g=Math.sqrt(x*x+y*y)||1,h=n.chargeStrength*s/(g*g);u.vx+=x/g*h,u.vy+=y/g*h;});}),t.forEach(u=>{let d=l.get(typeof u.source=="string"?u.source:u.source.id),f=l.get(typeof u.target=="string"?u.target:u.target.id);if(!d||!f)return;let p=f.x-d.x,x=f.y-d.y,y=Math.sqrt(p*p+x*x)||1,g=(y-n.linkDistance)/y*n.forceStrength*s;d.vx+=p*g,d.vy+=x*g,f.vx-=p*g,f.vy-=x*g;}),i.forEach(u=>{u.fx!==null&&u.fx!==void 0?(u.x=u.fx,u.vx=0):u.x+=u.vx,u.fy!==null&&u.fy!==void 0?(u.y=u.fy,u.vy=0):u.y+=u.vy,u.x=Math.max(n.nodeSize,Math.min(r-n.nodeSize,u.x)),u.y=Math.max(n.nodeSize,Math.min(a-n.nodeSize,u.y)),u.vx*=.9,u.vy*=.9;});}return i}function hc({nodes:e,edges:t,config:r,filter:a,onFilterChange:n,criticalPath:o,stats:i,onInteraction:l,className:c}){let s=ke.useRef(null),[u,d]=ke.useState([]),[f,p]=ke.useState(null),[x,y]=ke.useState(null),[g,h]=ke.useState(null),[v,m]=ke.useState(1),[k,w]=ke.useState({x:0,y:0});ke.useEffect(()=>{if(e.length===0)return;let E=Yf(e,t,r.width,r.height,r,150);d(E);},[e,t,r]);let b=ke.useCallback((E,A)=>{r.enableDragging&&(A.stopPropagation(),p(E));},[r.enableDragging]),C=ke.useCallback(E=>{if(!f||!s.current)return;let z=s.current.getBoundingClientRect(),U=(E.clientX-z.left-k.x)/v,J=(E.clientY-z.top-k.y)/v;d(X=>X.map(ae=>ae.id===f?{...ae,x:U,y:J,fx:U,fy:J}:ae));},[f,v,k]),T=ke.useCallback(()=>{p(null);},[]),D=ke.useCallback((E,A)=>{A.stopPropagation(),l?.({type:"node-click",node:E,position:{x:A.clientX,y:A.clientY}});},[l]),N=ke.useCallback((E,A)=>{A.stopPropagation(),l?.({type:"edge-click",edge:E,position:{x:A.clientX,y:A.clientY}});},[l]),P=ke.useCallback(E=>{let A=u.find(z=>z.id===E);return A?{x:A.x,y:A.y}:{x:0,y:0}},[u]),I=ke.useCallback(E=>{if(E.onCriticalPath)return "#ef4444";switch(r.colorScheme){case "status":return E.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let A=E.card.priority;return A==="URGENT"?"#ef4444":A==="HIGH"?"#f59e0b":A==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return E.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[r.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:ee("relationships-graph-empty",c),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:ee("relationships-graph",c),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:i.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:i.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),o&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:o.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),r.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>m(E=>Math.min(E+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(v*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>m(E=>Math.max(E-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{m(1),w({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(E=>E.type))).map(E=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:bs(E)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[fc(E)," ",ys(E)]})]},E))}),jsxRuntime.jsxs("svg",{ref:s,className:"relationships-graph-canvas",width:r.width,height:r.height,onMouseMove:C,onMouseUp:T,onMouseLeave:T,children:[jsxRuntime.jsxs("g",{transform:`translate(${k.x}, ${k.y}) scale(${v})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(E=>{let A=P(typeof E.source=="string"?E.source:E.source.id),z=P(typeof E.target=="string"?E.target:E.target.id),U=gc(E.type),J=g===E.id,X=E.onCriticalPath;return jsxRuntime.jsxs("g",{className:ee("relationships-graph-edge",J&&"hovered",X&&"critical"),onMouseEnter:()=>h(E.id),onMouseLeave:()=>h(null),onClick:ae=>N(E,ae),children:[jsxRuntime.jsx("line",{x1:A.x,y1:A.y,x2:z.x,y2:z.y,stroke:bs(E.type),strokeWidth:X?r.edgeWidth*2:r.edgeWidth,strokeOpacity:J?1:.6,markerEnd:U?"url(#arrowhead)":void 0}),r.showEdgeLabels&&J&&jsxRuntime.jsx("text",{x:(A.x+z.x)/2,y:(A.y+z.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:ys(E.type)})]},E.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:u.map(E=>{let A=x===E.id,z=E.onCriticalPath;return jsxRuntime.jsxs("g",{className:ee("relationships-graph-node",A&&"hovered",z&&"critical"),transform:`translate(${E.x}, ${E.y})`,onMouseDown:U=>b(E.id,U),onMouseEnter:()=>y(E.id),onMouseLeave:()=>y(null),onClick:U=>D(E,U),children:[jsxRuntime.jsx("circle",{r:z?r.nodeSize*1.2:r.nodeSize,fill:I(E),stroke:z?"#fbbf24":"#ffffff",strokeWidth:z?3:2,opacity:A?1:.9}),r.showLabels&&jsxRuntime.jsx("text",{y:r.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:E.card.title.length>20?E.card.title.substring(0,20)+"...":E.card.title})]},E.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function yc({isOpen:e,onClose:t,onPlanGenerated:r,onGeneratePlan:a,isLoading:n}){let[o,i]=ke.useState(""),[l,c]=ke.useState(false),[s,u]=ke.useState(null),[d,f]=ke.useState(null),p=ke.useRef(null),x=l||n;ke.useEffect(()=>{e&&p.current&&p.current.focus();},[e]),ke.useEffect(()=>{let v=m=>{m.key==="Escape"&&!x&&y();};if(e)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[e,x]);let y=()=>{x||(i(""),u(null),f(null),t());},g=async()=>{if(!(!o.trim()||x)){c(true),u(null),f(null);try{let v=await a(o.trim());f(v);}catch(v){u(v instanceof Error?v.message:"Failed to generate plan");}finally{c(false);}}},h=()=>{d&&(r(d),y());};return e?jsxRuntime.jsxs(Ie,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:y}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:v=>v.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:y,disabled:x,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:d?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),d.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:d.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",d.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:d.columns.map((v,m)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:v.title},m))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",d.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[d.cards.slice(0,10).map((v,m)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:v.title}),v.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:v.description})]}),v.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${v.priority==="URGENT"?"bg-red-500/20 text-red-400":v.priority==="HIGH"?"bg-orange-500/20 text-orange-400":v.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:v.priority})]})},m)),d.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",d.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:p,value:o,onChange:v=>i(v.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:x}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),s&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:s}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((v,m)=>jsxRuntime.jsx("button",{onClick:()=>i(v),disabled:x,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:v},m))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:x&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:y,disabled:x,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),d?jsxRuntime.jsx("button",{onClick:h,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:g,disabled:!o.trim()||x,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:x?"Generating...":"Generate Plan"})]})]})]})})]}):null}var xs={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Xf={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Zf={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Jf(e,t,r){let a=xs[e];if(!a)throw new Error(`Unknown model: ${e}`);let n=t/1e3*a.costPer1kInput,o=r/1e3*a.costPer1kOutput;return n+o}function Ha(e){return `$${e.toFixed(4)}`}var ks=class{constructor(){this.operations=[];this.listeners=[];}record(t){let r=Jf(t.model,t.inputTokens,t.outputTokens),a={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:r};return this.operations.push(a),this.listeners.forEach(n=>n(a)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),a}getStats(t){let r=this.operations;t&&(r=r.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let a=r.length,n=r.reduce((d,f)=>d+f.cost,0),o=r.reduce((d,f)=>d+f.inputTokens,0),i=r.reduce((d,f)=>d+f.outputTokens,0),l=r.filter(d=>d.success),c=r.reduce((d,f)=>d+f.duration,0),s={},u={};return r.forEach(d=>{s[d.feature]=(s[d.feature]||0)+1,u[d.feature]=(u[d.feature]||0)+d.cost;}),{totalOperations:a,totalCost:n,totalInputTokens:o,totalOutputTokens:i,operationsByFeature:s,costsByFeature:u,averageDuration:a>0?c/a:0,successRate:a>0?l.length/a:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,r="month"){let n={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][r],o=new Date,i=new Date;r==="month"?i.setMonth(o.getMonth()-1):i.setDate(o.getDate()-1);let l=this.operations.filter(u=>u.timestamp>=i).length,c=Math.max(0,n-l),s=l/n*100;return {used:l,limit:n,remaining:c,percentUsed:s,isExceeded:l>=n}}subscribe(t){return this.listeners.push(t),()=>{let r=this.listeners.indexOf(t);r>-1&&this.listeners.splice(r,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},Wr=new ks;function wc({isOpen:e,onClose:t,planTier:r="hobby"}){let[a,n]=ke.useState(Wr.getStats()),[o,i]=ke.useState(Wr.checkLimit(r));if(ke.useEffect(()=>{if(!e)return;let c=setInterval(()=>{n(Wr.getStats()),i(Wr.checkLimit(r));},1e3);return ()=>clearInterval(c)},[e,r]),ke.useEffect(()=>{let c=s=>{s.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]),!e)return null;let l=Wr.getRecentOperations(5);return jsxRuntime.jsxs(Ie,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:c=>c.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",r.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[o.used," / ",o.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,o.percentUsed)}%`,background:o.percentUsed>90?"#EF4444":o.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[o.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Ha(a.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:a.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(a.totalInputTokens+a.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[a.totalInputTokens.toLocaleString()," in /"," ",a.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(a.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",a.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(a.operationsByFeature).map(([c,s])=>{let u=a.costsByFeature[c]||0,d=a.totalOperations>0?s/a.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:c.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[s," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ha(u)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${d}%`}})})]},c)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),l.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:l.map(c=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:c.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(c.timestamp).toLocaleTimeString()," \u2022"," ",c.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[c.inputTokens+c.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Ha(c.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${c.success?"bg-green-400":"bg-red-400"}`})]})]},c.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function Sc({isOpen:e,onClose:t,onTasksGenerated:r,onGenerateTasks:a,isLoading:n,projectName:o}){let[i,l]=ke.useState(""),[c,s]=ke.useState(""),[u,d]=ke.useState(""),[f,p]=ke.useState(false),[x,y]=ke.useState(null),[g,h]=ke.useState(null),[v,m]=ke.useState(null),k=ke.useRef(null),w=f||n;ke.useEffect(()=>{e&&k.current&&k.current.focus();},[e]),ke.useEffect(()=>{let N=P=>{P.key==="Escape"&&!w&&b();};if(e)return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[e,w]);let b=()=>{w||(l(""),s(""),d(""),y(null),h(null),m(null),t());},C=async()=>{if(!(!i.trim()||w)){p(true),y(null),h(null),m(null);try{let N=await a({prompt:i.trim(),projectName:o||"Mi Proyecto",startDate:c||void 0,endDate:u||void 0});h(N.tasks.tasks),m({from_cache:N.from_cache,tokens_used:N.tokens_used,mock_mode:N.mock_mode,similarity:N.similarity,tokens_saved:N.tokens_saved});}catch(N){y(N instanceof Error?N.message:"Failed to generate tasks");}finally{p(false);}}},T=()=>{g&&(r(g),b());};if(!e)return null;let D=v?.similarity?((v.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(Ie,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:b}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:N=>N.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:b,disabled:w,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:g?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[v?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),v?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",D,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[v?.tokens_used||0," tokens"]}),v?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[v.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[g.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:g.map((N,P)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",P+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:N.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),N.start," \u2192 ",N.end]}),jsxRuntime.jsxs("span",{children:[N.duration," days"]}),N.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",N.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${N.priority==="high"?"bg-red-500/20 text-red-400":N.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:N.priority})]})},N.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:k,value:i,onChange:N=>l(N.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:w}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:c,onChange:N=>s(N.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:u,onChange:N=>d(N.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:w})]})]}),x&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:x}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((N,P)=>jsxRuntime.jsx("button",{onClick:()=>l(N),disabled:w,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:N},P))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:w&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:b,disabled:w,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),g?jsxRuntime.jsx("button",{onClick:T,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:C,disabled:!i.trim()||w,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:w?"Generating...":"Generate Tasks"})]})]})]})})]})}function _n({initialBoard:e,onPersist:t}){let[r,a]=ke.useState(e),n=ke.useCallback(g=>{t&&ja(()=>Promise.resolve(t(g)),{maxAttempts:3,initialDelay:1e3,onRetry:(h,v,m)=>{console.warn(`Retry attempt ${v} after ${m}ms: ${h.message}`);}}).then(h=>{h.success||console.error(`Failed to persist board after ${h.attempts} attempts:`,h.error);});},[t]),o=ke.useCallback(async(g,h,v)=>{a(m=>{let k=m.cards.find(N=>N.id===g);if(!k)return m;let w=k.columnId,b={...k,columnId:h,position:v},C=m.cards.map(N=>N.id===g?b:N),T=m.columns.map(N=>{if(N.id===w)return {...N,cardIds:N.cardIds.filter(P=>P!==g)};if(N.id===h){let P=C.filter(I=>I.columnId===h).sort((I,E)=>I.position-E.position);return {...N,cardIds:P.map(I=>I.id)}}return N}),D={...m,cards:C,columns:T};return n(D),D});},[n]),i=ke.useCallback(async(g,h)=>{a(v=>{let m=v.cards.map(w=>w.id===g?{...w,...h}:w),k={...v,cards:m};return n(k),k});},[n]),l=ke.useCallback(async g=>{let h=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;a(v=>{let m={...g,id:h},k=v.columns.map(b=>b.id===g.columnId?{...b,cardIds:[...b.cardIds,h]}:b),w={...v,cards:[...v.cards,m],columns:k};return n(w),w});},[n]),c=ke.useCallback(async g=>{a(h=>{let v=h.cards.find(b=>b.id===g);if(!v)return h;let m=h.cards.filter(b=>b.id!==g),k=h.columns.map(b=>b.id===v.columnId?{...b,cardIds:b.cardIds.filter(C=>C!==g)}:b),w={...h,cards:m,columns:k};return n(w),w});},[n]),s=ke.useCallback(async g=>{let h=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;a(v=>{let m={...g,id:h,cardIds:[]},k={...v,columns:[...v.columns,m]};return n(k),k});},[n]),u=ke.useCallback(async(g,h)=>{a(v=>{let m=v.columns.map(w=>w.id===g?{...w,...h}:w),k={...v,columns:m};return n(k),k});},[n]),d=ke.useCallback(async g=>{a(h=>{let v=h.cards.filter(w=>w.columnId!==g),m=h.columns.filter(w=>w.id!==g),k={...h,cards:v,columns:m};return n(k),k});},[n]),f=ke.useCallback(g=>{let h=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(g),h},[l]),p=ke.useCallback(g=>{let h=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return s(g),h},[s]),x=ke.useCallback(()=>{a(g=>{let h={...g,cards:[],columns:[]};return n(h),h});},[n]);return {board:r,callbacks:{onCardMove:o,onCardUpdate:i,onCardCreate:l,onCardDelete:c,onColumnCreate:s,onColumnUpdate:u,onColumnDelete:d},setBoard:a,helpers:{addCard:f,addColumn:p,deleteCard:c,deleteColumn:d,clearBoard:x}}}function Dc({initialData:e,availableUsers:t=[],onSave:r}){let{board:a,callbacks:n,helpers:o}=_n({initialBoard:e,onPersist:r}),i=ke.useMemo(()=>({addCard:(c,s,u={})=>{o.addCard({title:s,columnId:c,position:a.cards.filter(d=>d.columnId===c).length,...u});},addColumn:(c,s)=>{let u=a.columns.length>0?Math.max(...a.columns.map(d=>d.position)):0;o.addColumn({title:c,position:s??u+1e3});},reset:o.clearBoard}),[a.cards,a.columns,o]);return {props:ke.useMemo(()=>({board:a,callbacks:n,availableUsers:t}),[a,n,t]),board:a,callbacks:n,utils:i}}var Ua={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},Rc={by:"none",order:"asc"};function Pc({initialFilters:e={},initialSort:t={},currentUserId:r}={}){let[a,n]=ke.useState({...Ua,...e}),[o,i]=ke.useState({...Rc,...t}),l=ke.useCallback(y=>{n(g=>({...g,...y}));},[]),c=ke.useCallback(y=>{i(g=>({...g,...y}));},[]),s=ke.useCallback(()=>{n(Ua),i(Rc);},[]),u=ke.useCallback(()=>{r&&n({...Ua,assignees:[r]});},[r]),d=ke.useCallback(()=>{n({...Ua,dateFilter:"overdue"});},[]),f=ke.useCallback(()=>{n({...Ua,priorities:["HIGH","URGENT"]});},[]),p=ke.useMemo(()=>a.dateFilter!=="all"||a.priorities.length>0||a.assignees.length>0||a.labels.length>0||a.columns.length>0||a.search!==""||o.by!=="none",[a,o]),x=ke.useCallback(y=>{let g=[...y];if(a.search){let h=a.search.toLowerCase();g=g.filter(v=>v.title.toLowerCase().includes(h)||v.description?.toLowerCase().includes(h));}if(a.dateFilter!=="all"){let h=new Date,v=h.getFullYear(),m=String(h.getMonth()+1).padStart(2,"0"),k=String(h.getDate()).padStart(2,"0"),w=`${v}-${m}-${k}`;g=g.filter(b=>{if(!b.endDate&&!b.dueDate)return false;let C=b.endDate||b.dueDate;if(!C)return false;let T;if(typeof C=="string")T=C.split("T")[0]||C;else {let D=C.getUTCFullYear(),N=String(C.getUTCMonth()+1).padStart(2,"0"),P=String(C.getUTCDate()).padStart(2,"0");T=`${D}-${N}-${P}`;}switch(a.dateFilter){case "overdue":return T<w;case "today":return T===w;case "this-week":let D=new Date(w+"T00:00:00"),N=new Date(T+"T00:00:00"),P=new Date(D);return P.setDate(P.getDate()+7),N>=D&&N<=P;case "custom":if(a.dateRange){let I=typeof C=="string"?new Date(C):C;return I>=a.dateRange.start&&I<=a.dateRange.end}return true;default:return true}});}return a.priorities.length>0&&(g=g.filter(h=>h.priority&&a.priorities.includes(h.priority))),a.assignees.length>0&&(g=g.filter(h=>(h.assignedUserIds||(h.assigneeId?[h.assigneeId]:[])).some(m=>a.assignees.includes(m)))),a.labels.length>0&&(g=g.filter(h=>h.labels&&h.labels.some(v=>a.labels.includes(v)))),a.columns.length>0&&(g=g.filter(h=>a.columns.includes(h.columnId))),o.by!=="none"&&g.sort((h,v)=>{let m=0;switch(o.by){case "created":let k=h.createdAt?new Date(h.createdAt).getTime():0,w=v.createdAt?new Date(v.createdAt).getTime():0;m=k-w;break;case "priority":let b={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},C=b[h.priority||"LOW"],T=b[v.priority||"LOW"];m=C-T;break;case "dueDate":let D=h.endDate||h.dueDate,N=v.endDate||v.dueDate;if(!D)return 1;if(!N)return -1;let P=typeof D=="string"?new Date(D).getTime():D.getTime(),I=typeof N=="string"?new Date(N).getTime():N.getTime();m=P-I;break;case "title":m=h.title.localeCompare(v.title);break;case "estimate":let E=h.estimatedTime||0,A=v.estimatedTime||0;m=E-A;break;default:m=0;}return o.order==="asc"?m:-m}),g},[a,o]);return {filters:a,sort:o,setFilters:l,setSort:c,resetFilters:s,filterMyTasks:u,filterOverdue:d,filterHighPriority:f,applyFilters:x,hasActiveFilters:p}}var Mc,Ac;if(typeof window<"u")try{let e=Wa("ai");Mc=e.generateObject,Ac=e.generateText;}catch{}function Lc(e={}){let[t,r]=ke.useState(false),[a,n]=ke.useState(null),o=!!(Mc&&Ac&&e.apiKey),i=ke.useCallback(async d=>{if(!o)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');r(true),n(null);try{return console.log("Generating plan for:",d),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${d}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(f){let p=f instanceof Error?f:new Error("Failed to generate plan");throw n(p),p}finally{r(false);}},[o]),l=ke.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(f){let p=f instanceof Error?f:new Error("Failed to suggest assignee");throw n(p),p}finally{r(false);}},[o]),c=ke.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(f){let p=f instanceof Error?f:new Error("Failed to predict risks");throw n(p),p}finally{r(false);}},[o]),s=ke.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Generating subtasks for:",d.title),[{title:`Subtask 1 for: ${d.title}`,position:d.position+.1,columnId:d.columnId},{title:`Subtask 2 for: ${d.title}`,position:d.position+.2,columnId:d.columnId}]}catch(f){let p=f instanceof Error?f:new Error("Failed to generate subtasks");throw n(p),p}finally{r(false);}},[o]),u=ke.useCallback(async d=>{if(!o)throw new Error("AI features not available");r(true),n(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(f){let p=f instanceof Error?f:new Error("Failed to estimate effort");throw n(p),p}finally{r(false);}},[o]);return {onGeneratePlan:i,onSuggestAssignee:l,onPredictRisks:c,onGenerateSubtasks:s,onEstimateEffort:u,isAvailable:o,isLoading:t,error:a}}function Cs(){let[e,t]=ke.useState(()=>core.selectionStore.getState());ke.useEffect(()=>core.selectionStore.subscribe(n=>{t(n);}),[]);let r=ke.useCallback(a=>{core.selectionStore.setState(a);},[]);return [e,r]}function Fc(e){let{cards:t}=e,[r,a]=Cs(),n=ke.useCallback(d=>r.selectedCardIds.includes(d),[r.selectedCardIds]),o=ke.useCallback((d,f)=>{if(!f){a({selectedCardIds:[d],lastSelectedCardId:d});return}let p=f.ctrlKey||f.metaKey,x=f.shiftKey;if(p)r.selectedCardIds.includes(d)?a({selectedCardIds:r.selectedCardIds.filter(y=>y!==d),lastSelectedCardId:r.lastSelectedCardId}):a({selectedCardIds:[...r.selectedCardIds,d],lastSelectedCardId:d});else if(x&&r.lastSelectedCardId){let y=t.find(h=>h.id===d),g=t.find(h=>h.id===r.lastSelectedCardId);if(y&&g&&y.columnId===g.columnId){let h=t.filter(T=>T.columnId===y.columnId).sort((T,D)=>T.position-D.position),v=h.findIndex(T=>T.id===r.lastSelectedCardId),m=h.findIndex(T=>T.id===d),[k,w]=v<m?[v,m]:[m,v],b=h.slice(k,w+1).map(T=>T.id),C=Array.from(new Set([...r.selectedCardIds,...b]));a({selectedCardIds:C,lastSelectedCardId:d});}else a({selectedCardIds:[d],lastSelectedCardId:d});}else a({selectedCardIds:[d],lastSelectedCardId:d});},[t,r,a]),i=ke.useCallback(d=>{a({selectedCardIds:r.selectedCardIds.filter(f=>f!==d),lastSelectedCardId:r.lastSelectedCardId});},[r,a]),l=ke.useCallback(()=>{a({selectedCardIds:[],lastSelectedCardId:null});},[a]),c=ke.useCallback(()=>{a({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,a]),s=ke.useCallback(d=>{r.selectedCardIds.includes(d)?i(d):a({selectedCardIds:[...r.selectedCardIds,d],lastSelectedCardId:d});},[r,i,a]),u=ke.useCallback(()=>t.filter(d=>r.selectedCardIds.includes(d.id)),[t,r.selectedCardIds]);return {selectedCardIds:r.selectedCardIds,lastSelectedCardId:r.lastSelectedCardId,isCardSelected:n,selectCard:o,deselectCard:i,clearSelection:l,selectAll:c,toggleCard:s,getSelectedCards:u}}var Bc={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Oc(e){let{cards:t,config:r,aiService:a}=e,n=ke.useMemo(()=>({...Bc,...r}),[r]),[o,i]=ke.useState([]),l=ke.useCallback((y,g,h,v,m)=>{if(g.length<n.minCardsPerStack){console.warn(`Cannot create stack: minimum ${n.minCardsPerStack} cards required`);return}let k={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:y,cardIds:g,columnId:h,strategy:v,color:m,isExpanded:true,position:o.filter(w=>w.columnId===h).length,createdAt:new Date};i(w=>[...w,k]);},[n.minCardsPerStack,o]),c=ke.useCallback(y=>{i(g=>g.filter(h=>h.id!==y));},[]),s=ke.useCallback(y=>{i(g=>g.map(h=>h.id===y?{...h,isExpanded:!h.isExpanded}:h));},[]),u=ke.useCallback((y,g)=>{i(h=>h.map(v=>v.id===y&&!v.cardIds.includes(g)?{...v,cardIds:[...v.cardIds,g]}:v));},[]),d=ke.useCallback((y,g)=>{i(h=>h.map(v=>{if(v.id===y){let m=v.cardIds.filter(k=>k!==g);return m.length<n.minCardsPerStack?null:{...v,cardIds:m}}return v}).filter(v=>v!==null));},[n.minCardsPerStack]),f=ke.useCallback(y=>o.filter(g=>g.columnId===y).sort((g,h)=>g.position-h.position),[o]),p=ke.useCallback(async y=>{let g=t.filter(w=>w.columnId===y);if(g.length<n.minCardsPerStack*2)return [];let h=[],v=new Map;g.forEach(w=>{w.labels&&w.labels.length>0&&w.labels.forEach(b=>{v.has(b)||v.set(b,[]),v.get(b).push(w);});}),v.forEach((w,b)=>{w.length>=n.minCardsPerStack&&h.push({stack:{title:`\u{1F4CC} ${b}`,cardIds:w.map(C=>C.id),columnId:y,strategy:"labels",color:"#3b82f6"},reason:`${w.length} cards with label "${b}"`,confidence:.85});});let m=new Map;g.forEach(w=>{w.assignedUserIds&&w.assignedUserIds.length>0&&w.assignedUserIds.forEach(b=>{m.has(b)||m.set(b,[]),m.get(b).push(w);});}),m.forEach((w,b)=>{w.length>=n.minCardsPerStack&&h.push({stack:{title:`\u{1F464} Assigned to user-${b.slice(-4)}`,cardIds:w.map(C=>C.id),columnId:y,strategy:"assignee",color:"#8b5cf6"},reason:`${w.length} cards assigned to the same user`,confidence:.8});});let k=new Map;if(g.forEach(w=>{w.priority&&(k.has(w.priority)||k.set(w.priority,[]),k.get(w.priority).push(w));}),k.forEach((w,b)=>{if(w.length>=n.minCardsPerStack){let C={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[b.toLowerCase()]||"\u26AA";h.push({stack:{title:`${C} ${b} Priority`,cardIds:w.map(T=>T.id),columnId:y,strategy:"priority",color:b==="high"||b==="urgent"?"#ef4444":"#10b981"},reason:`${w.length} cards with ${b} priority`,confidence:.75});}}),a&&n.enableAutoStacking)for(let w of g){let C=(await a.findSimilar(w,g)).filter(T=>T.similarity>=n.autoStackConfidenceThreshold);if(C.length>=n.minCardsPerStack-1){let T=[w.id,...C.map(N=>N.card.id)],D=C.reduce((N,P)=>N+P.similarity,0)/C.length;h.push({stack:{title:`\u2728 Similar to "${w.title.substring(0,30)}${w.title.length>30?"...":""}"`,cardIds:T,columnId:y,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${C.length+1} similar tasks`,confidence:D});}}return h.filter(w=>w.confidence>=n.autoStackConfidenceThreshold).sort((w,b)=>b.confidence-w.confidence).slice(0,5)},[t,n,a]),x=ke.useCallback(y=>{l(y.stack.title,y.stack.cardIds,y.stack.columnId,y.stack.strategy,y.stack.color);},[l]);return ke.useEffect(()=>{n.enableAutoStacking&&o.length===0&&new Set(t.map(g=>g.columnId)).forEach(async g=>{let h=await p(g),v=h[0];h.length>0&&v&&v.confidence>=.9&&x(v);});},[]),{stacks:o,createStack:l,deleteStack:c,toggleStack:s,addToStack:u,removeFromStack:d,getStacksForColumn:f,getSuggestions:p,applySuggestion:x,config:n}}var zc=ke.createContext(null);function Hc({children:e,initialData:t,onStateChange:r}){let a=ke.useRef();if(!a.current){let o=new Map,i=new Map;t?.columns?.forEach(c=>{let{Column:s}=Wa("@libxai/core");o.set(c.id,new s(c));}),t?.cards?.forEach(c=>{let{Card:s}=Wa("@libxai/core");i.set(c.id,new s(c));});let l=null;if(t?.board){let{Board:c}=Wa("@libxai/core");l=new c(t.board);}a.current=new core.BoardStore({board:l,columns:o,cards:i});}let n=a.current;return ke.useEffect(()=>{if(r)return n.subscribeAll(o=>{r(n.getState());})},[n,r]),jsxRuntime.jsx(zc.Provider,{value:{store:n},children:e})}function $n(){let e=ke.useContext(zc);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function _a(){let e=$n(),[t,r]=ke.useState(e.getBoard()),[a,n]=ke.useState(e.getAllColumns()),[o,i]=ke.useState(e.getAllCards());ke.useEffect(()=>e.subscribeAll(()=>{r(e.getBoard()),n(e.getAllColumns()),i(e.getAllCards());}),[e]);let l=ke.useCallback(v=>{e.updateBoard(v);},[e]),c=ke.useCallback(v=>{e.addColumn(v);},[e]),s=ke.useCallback((v,m)=>{e.updateColumn(v,m);},[e]),u=ke.useCallback(v=>{e.deleteColumn(v);},[e]),d=ke.useCallback(v=>e.getColumn(v),[e]),f=ke.useCallback(v=>{e.addCard(v);},[e]),p=ke.useCallback((v,m)=>{e.updateCard(v,m);},[e]),x=ke.useCallback(v=>{e.deleteCard(v);},[e]),y=ke.useCallback((v,m,k)=>{e.moveCard(v,m,k);},[e]),g=ke.useCallback(v=>e.getCard(v),[e]),h=ke.useCallback(v=>e.getCardsByColumn(v),[e]);return {board:t,columns:a,cards:o,updateBoard:l,addColumn:c,updateColumn:s,deleteColumn:u,getColumn:d,addCard:f,updateCard:p,deleteCard:x,moveCard:y,getCard:g,getCardsByColumn:h}}function Gc(e){let{cards:t}=_a();return ke.useMemo(()=>e?t.filter(r=>{if(e.searchQuery){let a=e.searchQuery.toLowerCase(),n=r.title.toLowerCase().includes(a),o=r.description?.toLowerCase().includes(a);if(!n&&!o)return false}return !(e.priorities&&e.priorities.length>0&&(!r.priority||!e.priorities.includes(r.priority))||e.statuses&&e.statuses.length>0&&(!r.status||!e.statuses.includes(r.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(n=>r.isAssignedTo(n))||e.labels&&e.labels.length>0&&!e.labels.some(n=>r.hasLabel(n))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(r.columnId)||e.isOverdue!==void 0&&e.isOverdue!==r.isOverdue())}):t,[t,e])}function _c(e="position",t="asc"){let{cards:r}=_a();return ke.useMemo(()=>[...r].sort((n,o)=>{let i=0;switch(e){case "title":i=n.title.localeCompare(o.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},c=n.priority?l[n.priority]:0,s=o.priority?l[o.priority]:0;i=c-s;break}case "createdAt":i=n.createdAt.getTime()-o.createdAt.getTime();break;case "updatedAt":i=n.updatedAt.getTime()-o.updatedAt.getTime();break;case "position":i=n.position-o.position;break}return t==="asc"?i:-i}),[r,e,t])}var Wn=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=js.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let r of t.dependencies)if(!this.plugins.has(r))throw new Error(`Plugin ${t.id} depends on ${r} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(r=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,r,{plugin:t.id});});}unregister(t){let r=this.plugins.get(t);if(!r){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}r.onDestroy&&Promise.resolve(r.onDestroy()).catch(a=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,a);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${r.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,r){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);r?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,r){return this.config.get(t)?.[r]}setConfig(t,r,a){this.config.has(t)||this.config.set(t,{});let n=this.config.get(t);n[r]=a,this.pluginLogger.debug(`Plugin config set: ${t}.${r}`,{value:a});}async executeHook(t,r,a){let n=a;for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let i=o[t];if(typeof i=="function")try{let l=await Promise.resolve(i.apply(o,r));l!==void 0&&(n=l,r[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,l,{plugin:o.id,hook:t});}}return n}async executeHookParallel(t,r){let a=[];for(let n of this.plugins.values()){if(!this.enabled.has(n.id))continue;let o=n[t];typeof o=="function"&&a.push(Promise.resolve(o.apply(n,r)).catch(i=>{this.pluginLogger.error(`Plugin hook failed: ${n.id}.${t}`,i,{plugin:n.id,hook:t});}));}await Promise.all(a);}},gg=new Wn;function Wc({items:e,height:t,estimateSize:r,renderItem:a,className:n="",overscan:o=5,horizontal:i=false,gap:l=0,getItemKey:c}){let s=ke.useRef(null),u=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>s.current,estimateSize:()=>r,overscan:o,horizontal:i,gap:l}),d=u.getVirtualItems(),f={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},p=i?{width:`${u.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${u.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:s,style:f,className:n,children:jsxRuntime.jsx("div",{style:p,children:d.map(x=>{let y=e[x.index];if(!y)return null;let g=c?c(y,x.index):x.index,h={position:"absolute",top:i?0:x.start,left:i?x.start:0,width:i?x.size:"100%",height:i?"100%":x.size};return jsxRuntime.jsx("div",{style:h,"data-index":x.index,children:a(y,x.index)},g)})})})}function Vc(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function jc({items:e,height:t,width:r="100%",estimateColumnWidth:a,renderColumn:n,className:o="",overscan:i=3,gap:l=16,getItemKey:c,horizontal:s=true}){let u=ke.useRef(null),d=reactVirtual.useVirtualizer({horizontal:s,count:e.length,getScrollElement:()=>u.current,estimateSize:()=>a,overscan:i,gap:l}),f=d.getVirtualItems(),p={height:typeof t=="number"?`${t}px`:t,width:typeof r=="number"?`${r}px`:r,overflow:"auto",position:"relative"},x={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:u,style:p,className:o,children:jsxRuntime.jsx("div",{style:x,children:f.map(y=>{let g=e[y.index];if(!g)return null;let h=c?c(g,y.index):y.index,v={position:"absolute",top:0,left:y.start,width:y.size,height:"100%"};return jsxRuntime.jsx("div",{style:v,"data-index":y.index,children:n(g,y.index)},h)})})})}function Yc(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function qc(e,t=10){return e>t}var Ds={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Es={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Rs={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Ps={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Is={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Ms={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},As={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Ls={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Fs={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Bs={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Os={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},zs={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},Vn={spacing:Ds,borderRadius:Es,fontSize:Rs,fontWeight:Ps,lineHeight:Is,zIndex:Ms,duration:As,easing:Ls,shadows:Fs,opacity:Bs,kanban:Os,gantt:zs};function Xc(e,t,r){return e[t]??r}function Hs(e,t="",r={}){for(let[a,n]of Object.entries(e)){let o=t?`${t}-${a}`:a;typeof n=="object"&&n!==null&&!Array.isArray(n)?Hs(n,o,r):(typeof n=="string"||typeof n=="number")&&(r[o]=n);}return r}function bg(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Us(e="asakaa"){let t=Hs(Vn),r=[];for(let[a,n]of Object.entries(t)){let o=`--${e}-${a}`,i=bg(n);r.push(` ${o}: ${i};`);}return `:root {
|
|
49
49
|
${r.join(`
|
|
50
50
|
`)}
|
|
51
51
|
}`}function $a(e,t="asakaa"){let r=[],a=Hs(e);for(let[n,o]of Object.entries(a)){let i=`--${t}-color-${n}`;r.push(` ${i}: ${o};`);}return `:root {
|
|
52
52
|
${r.join(`
|
|
53
53
|
`)}
|
|
54
|
-
}`}var
|
|
54
|
+
}`}var Kn={background:{primary:"#1a1a1a",secondary:"#2a2a2a",tertiary:"#3a3a3a",card:"#2d2d2d",hover:"#353535",active:"#404040"},text:{primary:"#ffffff",secondary:"#b0b0b0",tertiary:"#808080",disabled:"#606060",inverse:"#1a1a1a"},border:{default:"#404040",hover:"#505050",focus:"#0ea5e9",active:"#0284c7"},status:{success:"#22c55e",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},priority:{low:"#6b7280",medium:"#3b82f6",high:"#f59e0b",urgent:"#ef4444"},interactive:{primary:"#0ea5e9",primaryHover:"#0284c7",primaryActive:"#0369a1",secondary:"#6b7280",secondaryHover:"#4b5563",secondaryActive:"#374151"},gantt:{gridLine:"#404040",todayLine:"#0ea5e9",taskBackground:"#3b82f6",taskBorder:"#2563eb",criticalPath:"#ef4444",milestone:"#8b5cf6",dependency:"#6b7280",weekend:"#2a2a2a"}},Gs={background:{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",card:"#ffffff",hover:"#f3f4f6",active:"#e5e7eb"},text:{primary:"#111827",secondary:"#6b7280",tertiary:"#9ca3af",disabled:"#d1d5db",inverse:"#ffffff"},border:{default:"#e5e7eb",hover:"#d1d5db",focus:"#0ea5e9",active:"#0284c7"},status:{success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#2563eb"},priority:{low:"#9ca3af",medium:"#3b82f6",high:"#f59e0b",urgent:"#ef4444"},interactive:{primary:"#0ea5e9",primaryHover:"#0284c7",primaryActive:"#0369a1",secondary:"#6b7280",secondaryHover:"#4b5563",secondaryActive:"#374151"},gantt:{gridLine:"#e5e7eb",todayLine:"#0ea5e9",taskBackground:"#3b82f6",taskBorder:"#2563eb",criticalPath:"#ef4444",milestone:"#8b5cf6",dependency:"#6b7280",weekend:"#f9fafb"}},_s={background:{primary:"#18181b",secondary:"#27272a",tertiary:"#3f3f46",card:"#27272a",hover:"#3f3f46",active:"#52525b"},text:{primary:"#fafafa",secondary:"#a1a1aa",tertiary:"#71717a",disabled:"#52525b",inverse:"#18181b"},border:{default:"#3f3f46",hover:"#52525b",focus:"#0ea5e9",active:"#0284c7"},status:{success:"#22c55e",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},priority:{low:"#71717a",medium:"#3b82f6",high:"#f59e0b",urgent:"#ef4444"},interactive:{primary:"#0ea5e9",primaryHover:"#0284c7",primaryActive:"#0369a1",secondary:"#71717a",secondaryHover:"#52525b",secondaryActive:"#3f3f46"},gantt:{gridLine:"#3f3f46",todayLine:"#0ea5e9",taskBackground:"#3b82f6",taskBorder:"#2563eb",criticalPath:"#ef4444",milestone:"#8b5cf6",dependency:"#71717a",weekend:"#27272a"}};function $s(e=Kn,t="asakaa"){let r=Us(t),a=$a(e,t);return `${r}
|
|
55
55
|
|
|
56
56
|
${a}`}function Zc(){return `/**
|
|
57
57
|
* ASAKAA Design Tokens
|
|
@@ -59,7 +59,7 @@ ${a}`}function Zc(){return `/**
|
|
|
59
59
|
* Do not edit this file directly
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
|
-
${$s(
|
|
62
|
+
${$s(Kn)}
|
|
63
63
|
|
|
64
64
|
/* Light theme */
|
|
65
65
|
[data-theme="light"] {
|
|
@@ -74,6 +74,6 @@ ${$a(_s,"asakaa").split(`
|
|
|
74
74
|
`).slice(1,-1).join(`
|
|
75
75
|
`)}
|
|
76
76
|
}
|
|
77
|
-
`}var
|
|
78
|
-
Object.defineProperty(exports,"BoardModel",{enumerable:true,get:function(){return core.Board}});Object.defineProperty(exports,"BoardStore",{enumerable:true,get:function(){return core.BoardStore}});Object.defineProperty(exports,"CardModel",{enumerable:true,get:function(){return core.Card}});Object.defineProperty(exports,"ColumnModel",{enumerable:true,get:function(){return core.Column}});Object.defineProperty(exports,"DependencyEngine",{enumerable:true,get:function(){return core.DependencyEngine}});Object.defineProperty(exports,"Store",{enumerable:true,get:function(){return core.Store}});exports.AIUsageDashboard=wc;exports.AI_FEATURES=
|
|
77
|
+
`}var yg=({theme:e})=>{switch(e){case "dark":return jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M13.5 8.5C13.5 11.2614 11.2614 13.5 8.5 13.5C5.73858 13.5 3.5 11.2614 3.5 8.5C3.5 5.73858 5.73858 3.5 8.5 3.5C8.66667 3.5 8.83074 3.50926 8.99199 3.52734C8.10635 4.35233 7.5 5.53318 7.5 6.85C7.5 9.33579 9.49421 11.33 11.98 11.33C12.5933 11.33 13.1751 11.2075 13.7069 10.9844C13.5698 11.8951 13.2042 12.7349 12.6674 13.4367",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});case "light":return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M8 1V2M8 14V15M15 8H14M2 8H1M12.5 12.5L11.8 11.8M4.2 4.2L3.5 3.5M12.5 3.5L11.8 4.2M4.2 11.8L3.5 12.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]});case "neutral":return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 8L8 8L8 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}};function Jc({showLabels:e=true,compact:t=false,className:r=""}){let{theme:a,setTheme:n,themes:o}=da();return jsxRuntime.jsx("div",{className:`theme-switcher ${t?"theme-switcher--compact":""} ${r}`,children:Object.entries(o).map(([i,l])=>{let c=i,s=c===a;return jsxRuntime.jsxs("button",{onClick:()=>n(c),className:`theme-switcher__button ${s?"theme-switcher__button--active":""}`,"aria-label":`Switch to ${l.displayName} theme`,"aria-pressed":s,title:l.displayName,children:[jsxRuntime.jsx("span",{className:"theme-switcher__icon","aria-hidden":"true",children:jsxRuntime.jsx(yg,{theme:c})}),e&&!t&&jsxRuntime.jsx("span",{className:"theme-switcher__label",children:l.displayName})]},c)})})}
|
|
78
|
+
Object.defineProperty(exports,"BoardModel",{enumerable:true,get:function(){return core.Board}});Object.defineProperty(exports,"BoardStore",{enumerable:true,get:function(){return core.BoardStore}});Object.defineProperty(exports,"CardModel",{enumerable:true,get:function(){return core.Card}});Object.defineProperty(exports,"ColumnModel",{enumerable:true,get:function(){return core.Column}});Object.defineProperty(exports,"DependencyEngine",{enumerable:true,get:function(){return core.DependencyEngine}});Object.defineProperty(exports,"Store",{enumerable:true,get:function(){return core.Store}});exports.AIUsageDashboard=wc;exports.AI_FEATURES=Zf;exports.AI_MODELS=xs;exports.AttachmentUploader=Pa;exports.BoardProvider=Hc;exports.BulkOperationsToolbar=kn;exports.BurnDownChart=Oo;exports.Card=sr;exports.CardDetailModal=Mo;exports.CardDetailModalV2=Lo;exports.CardHistoryReplay=mc;exports.CardHistoryTimeline=uc;exports.CardRelationshipsGraph=hc;exports.CardStack=_f;exports.CardTemplateSelector=Wo;exports.CircuitBreaker=Xn;exports.Column=na;exports.ColumnManager=Dn;exports.CommandPalette=Po;exports.ConfigMenu=Yo;exports.ContextMenu=pa;exports.DEFAULT_SHORTCUTS=Ia;exports.DEFAULT_TEMPLATES=$o;exports.DateRangePicker=ko;exports.DependenciesSelector=Co;exports.DependencyLine=In;exports.DistributionCharts=zo;exports.EditableColumnTitle=So;exports.ErrorBoundary=sa;exports.ExportImportModal=Ko;exports.FilterBar=jo;exports.GanttBoard=oc;exports.GanttMilestone=An;exports.GanttToolbar=Nn;exports.GenerateGanttTasksDialog=Sc;exports.GeneratePlanModal=yc;exports.GroupBySelector=Go;exports.KanbanBoard=yr;exports.KanbanViewAdapter=Ea;exports.KeyboardShortcutsHelp=_o;exports.MenuIcons=Rt;exports.PluginManager=Wn;exports.PrioritySelector=xo;exports.RATE_LIMITS=Xf;exports.SwimlaneBoardView=Ho;exports.TaskBar=Rn;exports.TaskFormModal=Bn;exports.TaskGrid=En;exports.ThemeModal=Jo;exports.ThemeProvider=Dl;exports.ThemeSwitcher=Jc;exports.Timeline=Fn;exports.UserAssignmentSelector=wo;exports.VelocityChart=Bo;exports.VirtualGrid=jc;exports.VirtualList=Wc;exports.aiUsageTracker=Wr;exports.borderRadius=Es;exports.calculatePosition=Ka;exports.cardToGanttTask=Hn;exports.cardsToGanttTasks=ic;exports.cn=ee;exports.createKanbanView=cl;exports.createRetryWrapper=dd;exports.darkTheme=qo;exports.darkTokenTheme=Kn;exports.defaultTheme=Cn;exports.designTokens=Vn;exports.duration=As;exports.easing=Ls;exports.exportTokensToCSS=Zc;exports.fontSize=Rs;exports.fontWeight=Ps;exports.formatCost=Ha;exports.ganttTaskToCardUpdate=sc;exports.ganttThemes=fe;exports.ganttTokens=zs;exports.ganttUtils=q;exports.generateCSSVariables=Us;exports.generateCompleteCSS=$s;exports.generateInitialPositions=sd;exports.generateThemeVariables=$a;exports.getToken=Xc;exports.kanbanTokens=Os;exports.lightTheme=Xo;exports.lightTokenTheme=Gs;exports.lineHeight=Is;exports.neutralTheme=Zo;exports.neutralTokenTheme=_s;exports.opacity=Bs;exports.pluginManager=gg;exports.retrySyncOperation=cd;exports.retryWithBackoff=ja;exports.shadows=Fs;exports.shouldVirtualizeGrid=qc;exports.spacing=Ds;exports.themes=Hr;exports.useAI=Lc;exports.useBoard=Dc;exports.useBoardCore=_a;exports.useBoardStore=$n;exports.useCardStacking=Oc;exports.useDragState=Do;exports.useFilteredCards=Gc;exports.useFilters=Pc;exports.useKanbanState=_n;exports.useKeyboardShortcuts=Tl;exports.useMultiSelect=Fc;exports.useSelectionState=Cs;exports.useSortedCards=_c;exports.useTheme=da;exports.useVirtualGrid=Yc;exports.useVirtualList=Vc;exports.withErrorBoundary=Eo;exports.zIndex=Ms;//# sourceMappingURL=index.cjs.map
|
|
79
79
|
//# sourceMappingURL=index.cjs.map
|