@libxai/board 1.4.7 → 1.4.8

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 CHANGED
@@ -400,7 +400,7 @@ If ambiguous, ask for clarification in the message field.`;function eu(e){return
400
400
  ${tu(e).map(r=>{let o=r.startDate?r.startDate.toISOString().split("T")[0]:"no date",s=r.endDate?r.endDate.toISOString().split("T")[0]:"no date",n=r.dependencies?.length?`deps: [${r.dependencies.join(", ")}]`:"";return `- ${r.id}: "${r.name}" (${o} to ${s}, ${r.progress}%, ${r.status||"todo"}) ${n}`}).join(`
401
401
  `)}
402
402
 
403
- Today's date: ${new Date().toISOString().split("T")[0]}`}function tu(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Br(e,t){let a=tu(e),r=t.toLowerCase().trim(),o=a.find(l=>l.name.toLowerCase()===r);if(o)return o;let s=a.find(l=>l.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(l=>{let m=l.name.toLowerCase();return n.every(i=>m.includes(i))})}function Nl(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let g=new Date(r);return g.setDate(g.getDate()+1),g}if(a==="yesterday"||a==="ayer"){let g=new Date(r);return g.setDate(g.getDate()-1),g}if(a==="next week"||a==="la pr\xF3xima semana"){let g=new Date(r);return g.setDate(g.getDate()+7),g}let o=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(o){let f={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[o[1].toLowerCase()];if(f!==void 0){let x=new Date(r),T=x.getDay(),p=f-T;return p<=0&&(p+=7),x.setDate(x.getDate()+p),x}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let g=parseInt(s[1],10),f=s[2].toLowerCase(),x=new Date(r);return f==="day"||f==="d\xEDa"||f==="dias"?x.setDate(x.getDate()+g):f==="week"||f==="semana"||f==="semanas"?x.setDate(x.getDate()+g*7):(f==="month"||f==="mes"||f==="meses")&&x.setMonth(x.getMonth()+g),x}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let l=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(l&&l[1]&&l[2]&&l[3]){let g=parseInt(l[1],10),f=parseInt(l[2],10)-1,x=parseInt(l[3],10);return new Date(x,f,g)}let m={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let g=parseInt(i[1],10),f=m[i[2].toLowerCase()],x=i[3]?parseInt(i[3],10):r.getFullYear();if(f!==void 0)return new Date(x,f,g)}let c={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},d=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(d&&d[1]&&d[2]){let g=c[d[1].toLowerCase()],f=parseInt(d[2],10),x=d[3]?parseInt(d[3],10):r.getFullYear();if(g!==void 0)return new Date(x,g,f)}return null}function Dl(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),o=a[2].toLowerCase();if(o==="day"||o==="d\xEDa"||o==="dias")return r;if(o==="week"||o==="semana"||o==="semanas")return r*7;if(o==="month"||o==="mes"||o==="meses")return r*30}return null}function Sl(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function au(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function ru(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let i=r[1].trim(),c=r[2].trim(),d=Br(t,i),g=Nl(c);if(!d)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!g)return {type:"move_task",taskId:d.id,taskName:d.name,message:`Could not parse the date "${c}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let f=d.startDate&&d.endDate?Math.round((d.endDate.getTime()-d.startDate.getTime())/(1e3*60*60*24)):1,x=new Date(g);return x.setDate(x.getDate()+f),{type:"move_task",taskId:d.id,taskName:d.name,updates:{startDate:g,endDate:x},message:`Moved "${d.name}" to ${g.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),c=o[2].trim(),d=Br(t,i),g=Dl(c);if(!d)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!g||!d.endDate)return {type:"resize_task",taskId:d.id,taskName:d.name,message:`Could not parse the duration "${c}".`,success:false,error:"Invalid duration"};let f=new Date(d.endDate);return f.setDate(f.getDate()+g),{type:"resize_task",taskId:d.id,taskName:d.name,updates:{endDate:f},message:`Extended "${d.name}" by ${g} days. New end date: ${f.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let i=s[1].trim(),c=s[2].trim(),d=Br(t,i),g=Sl(c);return d?g===null?{type:"set_progress",taskId:d.id,taskName:d.name,message:`Could not parse the progress value "${c}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:d.id,taskName:d.name,updates:{progress:g},message:`Set "${d.name}" progress to ${g}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let n=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(n&&n[1]&&n[2]){let i=n[1].trim(),c=n[2].trim(),d=Br(t,i);return d?{type:"rename_task",taskId:d.id,taskName:d.name,updates:{name:c},message:`Renamed "${d.name}" to "${c}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let l=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(l&&l[1]&&l[2]){let i=l[1].trim(),c=l[2].trim(),d=Br(t,i),g=Br(t,c);return d?g?{type:"link_tasks",taskId:g.id,taskName:g.name,dependencyFrom:d.id,dependencyTo:g.id,message:`Linked "${d.name}" \u2192 "${g.name}".`,success:true}:{type:"link_tasks",taskName:c,message:`Could not find a task named "${c}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let m=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(m&&m[1]){let i=m[1].trim(),c=Br(t,i);return c?{type:"delete_task",taskId:c.id,taskName:c.name,message:`Deleted "${c.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function ou(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function jy(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 Ky(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function Ms(e,t=[],a=[]){let r=e.assignedUserIds?.map(c=>{let d=a.find(g=>g.id===c);return d?{name:d.name,initials:d.initials,color:d.color}:null}).filter(c=>c!==null),o=t.filter(c=>c.metadata?.parentCardId===e.id).map(c=>Ms(c,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(c=>c.type==="finish-to-start").map(c=>c.taskId));let n=c=>{if(c)return typeof c=="string"?new Date(c):c},l=n(e.startDate),m=n(e.endDate),i=e.metadata?.isMilestone===true||l&&m&&Math.abs(m.getTime()-l.getTime())<=864e5;return {id:e.id,name:e.title,startDate:l,endDate:m,progress:e.progress||0,status:jy(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:o?.length?o:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function nu(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:Ky(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function su(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>Ms(r,e,t))}var El={columns:{name:"Task Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",tags:"Tags"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},Pl={columns:{name:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Tiempo",tags:"Etiquetas"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},Fs={en:El,es:Pl};function Ml(e){return Fs[e]||Fs.en}function As(e,t){let a=Ml(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var Fl=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-blue-500"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-green-500"}];function iu(e){let t=e?.toLowerCase()||"todo";return t==="inprogress"||t==="in-progress"||t==="in_progress"?"in-progress":t==="completed"||t==="done"||t==="complete"?"completed":"todo"}function lu({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let f=x=>{l.current&&!l.current.contains(x.target)&&n(false);};return s&&document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[s]);let m=iu(e),i=Fl[0],c=Fl.find(f=>f.value===m)??i,d=c.icon,g=f=>{switch(iu(f)){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-[#94A3B8]":"text-gray-500"),children:g(e)})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-[#94A3B8]":"text-gray-500"),children:g(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:Fl.map(f=>{let x=f.icon;return jsxRuntime.jsxs("button",{onClick:T=>{T.stopPropagation(),t(f.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",m===f.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(x,{className:u("w-4 h-4",f.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:g(f.value)})]},f.value)})})]})}var Al=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-red-500",bg:"bg-red-500"},{value:"high",label:{en:"High",es:"Alta"},color:"text-orange-500",bg:"bg-orange-500"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-yellow-500",bg:"bg-yellow-500"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-blue-500",bg:"bg-blue-500"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function cu({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let c=d=>{l.current&&!l.current.contains(d.target)&&n(false);};return s&&document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[s]);let m=Al.find(c=>c.value===e)??Al[4],i=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:m.label[i]})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:c=>{c.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:m.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:Al.map(c=>jsxRuntime.jsxs("button",{onClick:d=>{d.stopPropagation(),t(c.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===c.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:u("w-2 h-2 rounded-full",c.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:c.label[i]})]},c.value))})]})}function Bs(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Rs(e){let t=["bg-blue-500","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-teal-500"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-blue-500"}function uv(e,t){if(!e)return null;let a=Math.round(e.assignedHoursThisWeek/e.weeklyCapacity*100);switch(e.level){case "light":return {color:t?"text-green-400 bg-green-500/20":"text-green-600 bg-green-100",icon:null,label:`${a}%`,tooltip:`${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`};case "moderate":return {color:t?"text-yellow-400 bg-yellow-500/20":"text-yellow-600 bg-yellow-100",icon:lucideReact.Clock,label:`${a}%`,tooltip:`${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`};case "heavy":return {color:t?"text-orange-400 bg-orange-500/20":"text-orange-600 bg-orange-100",icon:lucideReact.Clock,label:`${a}%`,tooltip:`${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`};case "overloaded":return {color:t?"text-red-400 bg-red-500/20":"text-red-600 bg-red-100",icon:lucideReact.AlertTriangle,label:`${a}%`,tooltip:`SOBRECARGADO: ${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`}}}function pu({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false,showWorkloadIndicators:n=true}){let[l,m]=react.useState(false),[i,c]=react.useState(""),d=react.useRef(null);react.useEffect(()=>{let p=y=>{d.current&&!d.current.contains(y.target)&&(m(false),c(""));};return l&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]);let g=t.filter(p=>p.name.toLowerCase().includes(i.toLowerCase())||p.email?.toLowerCase().includes(i.toLowerCase())),f=n?[...g].sort((p,y)=>{let h={light:0,moderate:1,heavy:2,overloaded:3},b=p.workload?.level??"light",k=y.workload?.level??"light";return h[b]-h[k]}):g,x=p=>e.some(y=>y.name===p),T=p=>{if(a)if(x(p.name))a(e.filter(y=>y.name!==p.name));else {let y={name:p.name,initials:Bs(p.name),color:p.color||Rs(p.name).replace("bg-","").replace("-500",""),avatar:p.avatarUrl};a([...e,y]);}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((p,y)=>jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0F1117]":"border-white",!p.avatar&&Rs(p.name)),style:p.color&&!p.avatar?{backgroundColor:p.color}:void 0,title:p.name,children:p.avatar?jsxRuntime.jsx("img",{src:p.avatar,alt:p.name,className:"w-full h-full rounded-full object-cover"}):p.initials||Bs(p.name)},`${p.name}-${y}`)),e.length>3&&jsxRuntime.jsxs("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#374151] border-[#0F1117] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsx("button",{onClick:p=>{p.stopPropagation(),m(!l);},className:u("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:u("w-4 h-4",r?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3 h-3",r?"text-[#6B7280]":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((p,y)=>jsxRuntime.jsx("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0F1117]":"border-white",!p.avatar&&Rs(p.name)),style:p.color&&!p.avatar?{backgroundColor:p.color}:void 0,children:p.avatar?jsxRuntime.jsx("img",{src:p.avatar,alt:p.name,className:"w-full h-full rounded-full object-cover"}):p.initials||Bs(p.name)},`${p.name}-${y}`)),e.length>2&&jsxRuntime.jsxs("span",{className:u("text-xs ml-1",r?"text-[#9CA3AF]":"text-gray-500"),children:["+",e.length-2]})]})}),l&&jsxRuntime.jsxs("div",{className:u("absolute z-50 top-full left-0 mt-1 rounded-lg shadow-lg border w-72",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[n&&jsxRuntime.jsxs("div",{className:u("px-3 py-2 text-xs border-b flex items-center gap-3",r?"text-[#9CA3AF] border-white/10":"text-gray-500 border-gray-200"),children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),o==="es"?"Ligera":"Light"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),o==="es"?"Moderada":"Moderate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),o==="es"?"Alta":"Heavy"]})]}),jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:jsxRuntime.jsx("input",{type:"text",value:i,onChange:p=>c(p.target.value),placeholder:o==="es"?"Buscar usuario...":"Search user...",className:u("w-full px-3 py-1.5 text-sm rounded border outline-none",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),onClick:p=>p.stopPropagation()})}),jsxRuntime.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:f.length===0?jsxRuntime.jsx("p",{className:u("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"No se encontraron usuarios":"No users found"}):f.map(p=>{let y=uv(p.workload,r);return jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),T(p);},className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",p.workload?.level==="overloaded"&&(r?"bg-red-500/5":"bg-red-50")),title:y?.tooltip,children:[jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white",!p.avatarUrl&&Rs(p.name)),children:p.avatarUrl?jsxRuntime.jsx("img",{src:p.avatarUrl,alt:p.name,className:"w-full h-full rounded-full object-cover"}):Bs(p.name)}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:r?"text-white":"text-gray-900",children:p.name}),p.email&&jsxRuntime.jsx("div",{className:u("text-xs",r?"text-[#6B7280]":"text-gray-400"),children:p.email})]}),n&&y&&jsxRuntime.jsxs("div",{className:u("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",y.color),children:[y.icon&&jsxRuntime.jsx(y.icon,{className:"w-3 h-3"}),y.label]}),x(p.name)&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},p.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"p-2 border-t flex flex-wrap gap-1",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:e.map((p,y)=>jsxRuntime.jsxs("span",{className:u("inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full",r?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:[p.name,jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),a(e.filter(b=>b.name!==p.name));},className:"hover:text-red-500",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},`${p.name}-${y}`))})]})]})}function hu({startDate:e,endDate:t,onChange:a,singleDateMode:r=false,singleDateField:o="end",isDark:s,locale:n,disabled:l=false,placeholder:m}){let[i,c]=react.useState(false),[d,g]=react.useState(o),[f,x]=react.useState(()=>{let E=o==="start"?e:t;if(E){let w=E instanceof Date?E:new Date(E);return new Date(w.getFullYear(),w.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),T=react.useRef(null),p=e?e instanceof Date?e:new Date(e):null,y=t?t instanceof Date?t:new Date(t):null;react.useEffect(()=>{let E=w=>{T.current&&!T.current.contains(w.target)&&c(false);};return i&&document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[i]),react.useEffect(()=>{i&&g(r?o:"start");},[i,r,o]);let h=E=>E?E.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):m||"-",b=react.useCallback(()=>{let E=f.getFullYear(),w=f.getMonth(),R=new Date(E,w,1),C=new Date(E,w+1,0).getDate(),W=R.getDay(),H=[],te=new Date(E,w,0).getDate();for(let ne=W-1;ne>=0;ne--)H.push({date:new Date(E,w-1,te-ne),isCurrentMonth:false});for(let ne=1;ne<=C;ne++)H.push({date:new Date(E,w,ne),isCurrentMonth:true});let oe=42-H.length;for(let ne=1;ne<=oe;ne++)H.push({date:new Date(E,w+1,ne),isCurrentMonth:false});return H},[f]),k=E=>{if(r)o==="start"?a(E,y||void 0):a(p||void 0,E),c(false);else if(d==="start"){let w=y&&E>y?E:y;a(E,w||void 0),g("end");}else {let w=p&&E<p?E:p;a(w||void 0,E),c(false);}},D=()=>{let E=new Date,w=new Date(E);w.setDate(E.getDate()+1);let R=new Date(E);R.setDate(E.getDate()+((6-E.getDay()+7)%7||7));let I=new Date(E);I.setDate(E.getDate()+((1-E.getDay()+7)%7||7));let C=new Date(E);C.setDate(E.getDate()+(6-E.getDay()+7)%7+7);let W=new Date(E);W.setDate(E.getDate()+14);let H=new Date(E);return H.setDate(E.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:E,display:E.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:w,display:w.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:R,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:I,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:C,display:C.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:W,display:W.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:H,display:H.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}]};if(l){let E=r&&o==="start"?p:y;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-[#94A3B8]":"text-gray-500"),children:h(E)})]})}let N=r&&o==="start"?p:y;return jsxRuntime.jsxs("div",{ref:T,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:E=>{E.stopPropagation(),c(!i);let w=o==="start"?p:y;w&&x(new Date(w.getFullYear(),w.getMonth(),1));},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",s?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-[#94A3B8]":"text-gray-500"),children:h(N)})]}),i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>c(false)}),jsxRuntime.jsxs("div",{className:u("absolute z-50 top-full left-0 mt-1 rounded-xl shadow-2xl overflow-hidden flex",s?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:E=>E.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:u("w-44 py-2 border-r",s?"border-white/10":"border-gray-200"),children:[D().map((E,w)=>jsxRuntime.jsxs("button",{className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>k(E.date),children:[jsxRuntime.jsx("span",{children:E.label}),jsxRuntime.jsx("span",{className:u("text-xs",s?"text-[#6B7280]":"text-gray-400"),children:E.display})]},w)),jsxRuntime.jsx("div",{className:u("border-t mt-2 pt-2",s?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{r?o==="start"?a(void 0,y||void 0):a(p||void 0,void 0):a(void 0,void 0),c(false);},className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="es"?"Quitar fecha":"Clear date"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[!r&&jsxRuntime.jsx("div",{className:u("text-xs mb-3 px-2 py-1 rounded",s?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:d==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:u("font-medium",s?"text-white":"text-gray-900"),children:f.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>x(new Date),className:u("p-1 rounded text-sm transition-colors",s?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>x(new Date(f.getFullYear(),f.getMonth()-1)),className:u("p-1 rounded",s?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:()=>x(new Date(f.getFullYear(),f.getMonth()+1)),className:u("p-1 rounded",s?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(E=>jsxRuntime.jsx("div",{className:u("w-8 h-8 flex items-center justify-center text-xs",s?"text-[#6B7280]":"text-gray-400"),children:E},E))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:b().map((E,w)=>{let R=E.date.toDateString()===new Date().toDateString(),I=p?.toDateString()===E.date.toDateString(),C=y?.toDateString()===E.date.toDateString(),W=I||C,H=!r&&p&&y&&E.date>=p&&E.date<=y;return jsxRuntime.jsx("button",{onClick:()=>k(new Date(E.date)),className:u("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!E.isCurrentMonth&&(s?"text-[#4B5563]":"text-gray-300"),E.isCurrentMonth&&(s?"text-white":"text-gray-900"),R&&"ring-2 ring-[#3B82F6]",I&&"bg-[#3B82F6] text-white",C&&!I&&"bg-[#7C3AED] text-white",H&&!W&&(s?"bg-[#7C3AED]/20":"bg-purple-100"),!W&&(s?"hover:bg-white/10":"hover:bg-gray-100")),children:E.date.getDate()},w)})})]})]})]})]})}function Os({value:e,onChange:t,isDark:a,locale:r,disabled:o=false,dateField:s="end",startDate:n,endDate:l}){let m=e?e instanceof Date?e:new Date(e):null;return jsxRuntime.jsx(hu,{startDate:s==="start"?m:n||null,endDate:s==="end"?m:l||null,onChange:(g,f)=>{t&&t(s==="start"?g:f);},singleDateMode:true,singleDateField:s,isDark:a,locale:r,disabled:o||!t,placeholder:"-"})}function Xo(e=600){let[t,a]=react.useState(false),r=react.useRef(null),o=react.useCallback(()=>{r.current&&clearTimeout(r.current),a(true),r.current=setTimeout(()=>{a(false);},e);},[e]);return react.useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),{isFlashing:t,triggerFlash:o}}function $s(e,t={}){let{enabled:a=true,duration:r=400,steps:o=8}=t,[s,n]=react.useState(e),[l,m]=react.useState(false),i=react.useRef(e),c=react.useRef([]);return react.useEffect(()=>{if(c.current.forEach(clearTimeout),c.current=[],!a||e===i.current||e===void 0){n(e),i.current=e;return}let d=i.current??0,g=e,f=g-d,x=r/o;m(true);for(let T=1;T<=o;T++){let p=setTimeout(()=>{let y=T/o,h=1-Math.pow(1-y,3),b=Math.round(d+f*h);n(b),T===o&&(m(false),n(g));},x*T);c.current.push(p);}return i.current=e,()=>{c.current.forEach(clearTimeout),c.current=[];}},[e,a,r,o]),{displayValue:s,isAnimating:l}}function bu(e,t={}){let{delay:a=1500,onCancel:r}=t,[o,s]=react.useState(null),[n,l]=react.useState(0),m=react.useRef(null),i=react.useRef(null),c=react.useCallback(f=>{m.current&&clearTimeout(m.current),i.current&&clearInterval(i.current),s(f),l(0);let x=Date.now();i.current=setInterval(()=>{let T=Date.now()-x,p=Math.min(T/a*100,100);l(p);},16),m.current=setTimeout(()=>{i.current&&clearInterval(i.current),e?.(f),s(null),l(0);},a);},[a,e]),d=react.useCallback(()=>{m.current&&clearTimeout(m.current),i.current&&clearInterval(i.current),s(null),l(0),r?.();},[r]);return react.useEffect(()=>()=>{m.current&&clearTimeout(m.current),i.current&&clearInterval(i.current);},[]),{pendingValue:o,isPending:o!==null,progress:n,startChange:c,cancelChange:d}}function xu({value:e=0,onChange:t,isDark:a,disabled:r=false,enableSlotMachine:o=true,enableSaveFlash:s=true}){let{isFlashing:n,triggerFlash:l}=Xo(),{displayValue:m,isAnimating:i}=$s(e,{enabled:o,duration:300,steps:6}),c=g=>{if(r||!t)return;g.stopPropagation();let f=g.currentTarget.getBoundingClientRect(),x=g.clientX-f.left,T=Math.round(x/f.width*100),p=Math.max(0,Math.min(100,T));p!==e&&(t(p),s&&l());},d=m??e;return jsxRuntime.jsxs("div",{className:u("flex items-center gap-2 w-full rounded px-1 py-0.5 transition-all duration-300",n&&(a?"bg-green-500/30":"bg-green-500/20")),children:[jsxRuntime.jsx("div",{onClick:c,className:u("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/10":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:u("h-full rounded-full transition-all",d===100?"bg-green-500":"bg-[#3B82F6]",i&&"transition-none"),style:{width:`${d}%`}})}),jsxRuntime.jsxs("span",{className:u("text-xs w-8 text-right tabular-nums transition-all",a?"text-[#9CA3AF]":"text-gray-500",i&&"font-medium scale-105"),children:[d,"%"]})]})}function Cu({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[l,m]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{m(e);},[e]);let c=()=>{l!==e&&t?.(l),n(false);},d=g=>{g.key==="Enter"?c():g.key==="Escape"&&(m(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:u("text-sm truncate",a?"text-[#94A3B8]":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:l,onChange:g=>m(g.target.value),onBlur:c,onKeyDown:d,onClick:g=>g.stopPropagation(),className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:g=>{g.stopPropagation(),n(true);},className:u("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-[#6B7280]":"text-gray-400")),children:e||r})}function Du({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false,enableSlotMachine:l=true,enableSaveFlash:m=true}){let[i,c]=react.useState(false),[d,g]=react.useState(e?.toString()||""),f=react.useRef(null),{isFlashing:x,triggerFlash:T}=Xo(),{displayValue:p,isAnimating:y}=$s(e,{enabled:l&&!i});react.useEffect(()=>{i&&f.current&&(f.current.focus(),f.current.select());},[i]),react.useEffect(()=>{g(e?.toString()||"");},[e]);let h=()=>{let k=parseFloat(d);if(!isNaN(k)){let D=k;o!==void 0&&(D=Math.max(o,D)),s!==void 0&&(D=Math.min(s,D)),D!==e&&(t?.(D),m&&T());}c(false);},b=k=>{k.key==="Enter"?h():k.key==="Escape"&&(g(e?.toString()||""),c(false));};return n||!t?jsxRuntime.jsx("span",{className:u("text-sm transition-all",a?"text-[#94A3B8]":"text-gray-500",y&&"font-medium"),children:p!==void 0?p:r}):i?jsxRuntime.jsx("input",{ref:f,type:"number",value:d,onChange:k=>g(k.target.value),onBlur:h,onKeyDown:b,onClick:k=>k.stopPropagation(),min:o,max:s,className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),c(true);},className:u("text-sm text-left w-full px-2 py-1 rounded transition-all duration-300",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",p===void 0&&(a?"text-[#6B7280]":"text-gray-400"),x&&(a?"bg-green-500/30":"bg-green-500/20"),y&&"font-medium scale-105"),children:p!==void 0?p:r})}function Su({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,l]=react.useState(false),m=react.useRef(null);return react.useEffect(()=>{let i=c=>{m.current&&!m.current.contains(c.target)&&l(false);};return n&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s||!a?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-[#94A3B8]":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),l(!n);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:u("text-sm flex-1 text-left truncate",r?"text-[#94A3B8]":"text-gray-500",!e&&(r?"text-[#6B7280]":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3 flex-shrink-0",r?"text-[#6B7280]":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:u("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:c=>{c.stopPropagation(),a(i),l(false);},className:u("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",e===i&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#3B82F6]"})]},i))})]})}function Pu({value:e=false,onChange:t,isDark:a,disabled:r=false,enableDelayedConfirm:o=true,confirmDelay:s=1500}){let{pendingValue:n,isPending:l,progress:m,startChange:i,cancelChange:c}=bu(t,{delay:s}),d=f=>{f.stopPropagation(),!r&&t&&(o?l?c():i(!e):t(!e));},g=l?n:e;return jsxRuntime.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[jsxRuntime.jsxs("button",{onClick:d,disabled:r||!t,className:u("relative w-5 h-5 rounded border-2 flex items-center justify-center transition-all",g?"bg-[#3B82F6] border-[#3B82F6]":a?"border-[#4B5563] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed",l&&"ring-2 ring-offset-1",l&&g&&"ring-green-500/50",l&&!g&&"ring-red-500/50",l&&(a?"ring-offset-[#0F1117]":"ring-offset-white")),children:[l&&jsxRuntime.jsx("svg",{className:"absolute inset-0 w-full h-full -rotate-90",viewBox:"0 0 20 20",children:jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:g?"#22C55E":"#EF4444",strokeWidth:"2",strokeDasharray:`${m/100*50.26} 50.26`,className:"transition-all duration-100"})}),l?jsxRuntime.jsx(lucideReact.Loader2,{className:"w-3 h-3 text-white animate-spin"}):g?jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"}):null]}),l&&jsxRuntime.jsx("button",{onClick:f=>{f.stopPropagation(),c();},className:u("w-4 h-4 rounded-full flex items-center justify-center transition-colors",a?"bg-red-500/20 hover:bg-red-500/40 text-red-400":"bg-red-100 hover:bg-red-200 text-red-500"),title:"Cancelar",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function Au({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:u("text-sm",t?"text-[#6B7280]":"text-gray-400"),children:"-"});let r=e.slice(0,a),o=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-xs rounded-full",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.1)":"#F3F4F6",color:s.color||(t?"#9CA3AF":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:u("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function Av(e,t="en"){if(e==null||e===0||!e||Number(e)===0)return "-";let a=Math.floor(e/60),r=e%60;return a===0?`${r}m`:r===0?`${a}h`:`${a}h ${r}m`}function Lv(e){let t=e.trim().toLowerCase();if(!t||t==="-")return null;let a=t.match(/^(\d+):(\d+)$/);if(a){let l=parseInt(a[1],10),m=parseInt(a[2],10);return l*60+m}let r=t.match(/^(\d+\.?\d*)\s*h\s*(\d+)?\s*(m|min)?$/);if(r){let l=parseFloat(r[1]),m=r[2]?parseInt(r[2],10):0;return Math.round(l*60)+m}let o=t.match(/^(\d+\.?\d*)\s*h$/);if(o)return Math.round(parseFloat(o[1])*60);let s=t.match(/^(\d+)\s*(m|min)?$/);if(s)return parseInt(s[1],10);let n=parseFloat(t);return isNaN(n)?null:Math.round(n)}function ko({value:e,onChange:t,isDark:a,locale:r="en",placeholder:o,disabled:s=false,enableSaveFlash:n=true}){let [l,m]=react.useState(false),[i,c]=react.useState(""),d=react.useRef(null),{isFlashing:g,triggerFlash:f}=Xo(),T=Av(e,r);react.useEffect(()=>{l&&d.current&&(d.current.focus(),d.current.select());},[l]),react.useEffect(()=>{if(e){let h=Math.floor(e/60),b=e%60;h>0&&b>0?c(`${h}h ${b}m`):h>0?c(`${h}h`):c(`${b}m`);}else c("");},[e,l]);let p=()=>{let h=Lv(i);h!==e&&(t?.(h),n&&f()),m(false);},y=h=>{h.key==="Enter"?p():h.key==="Escape"&&m(false);};return s||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[e!=null&&e>0&&jsxRuntime.jsx(lucideReact.Clock,{className:u("w-3.5 h-3.5 flex-shrink-0",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-[#94A3B8]":"text-gray-500",(!e||e===0)&&(a?"text-[#6B7280]":"text-gray-400")),children:T})]}):l?jsxRuntime.jsx("input",{ref:d,type:"text",value:i,onChange:h=>c(h.target.value),onBlur:p,onKeyDown:y,onClick:h=>h.stopPropagation(),placeholder:"1h 30m",className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white placeholder:text-[#6B7280]":"bg-white border-[#3B82F6] text-gray-900 placeholder:text-gray-400")}):jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),m(true);},className:u("flex items-center gap-1 text-sm text-left w-full px-1.5 py-1 rounded transition-all duration-300 overflow-hidden",a?"hover:bg-white/10":"hover:bg-gray-100",e!=null&&e>0?a?"text-[#94A3B8]":"text-gray-600":a?"text-[#6B7280]":"text-gray-400",g&&(a?"bg-green-500/30":"bg-green-500/20")),children:[e!=null&&e>0&&jsxRuntime.jsx(lucideReact.Clock,{className:u("w-3 h-3 flex-shrink-0",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:"truncate",children:T})]})}function Kv(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function qv(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Uu({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:l,onColumnHide:m,onColumnSort:i,availableUsers:c=[]}){let d=react.useRef(null),g=r==="es"?$u.es:$u.en;if(react.useEffect(()=>{let y=b=>{d.current&&!d.current.contains(b.target)&&t();},h=b=>{b.key==="Escape"&&t();};return document.addEventListener("mousedown",y),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",h);}},[t]),!e.isOpen)return null;let f=()=>{if(!e.task)return [];let y=[];return o&&y.push({id:"edit",label:g.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),y.push({id:"sep1",label:"",icon:null,separator:true}),l&&(y.push({id:"status",label:g.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:g.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{l({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:g.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-blue-500"}),onClick:()=>{l({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:g.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{l({...e.task,status:"completed",progress:100}),t();}}]}),y.push({id:"priority",label:g.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:g.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{l({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:g.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{l({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:g.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{l({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:g.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),onClick:()=>{l({...e.task,priority:"low"}),t();}}]}),c.length>0&&y.push({id:"assign",label:g.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:c.slice(0,5).map(h=>({id:`assign-${h.id}`,label:h.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-blue-500",children:h.name.charAt(0).toUpperCase()}),onClick:()=>{let b=e.task.assignees||[],D=b.some(N=>N.name===h.name)?b.filter(N=>N.name!==h.name):[...b,{name:h.name,initials:Kv(h.name),color:h.color||qv(h.name),avatar:h.avatarUrl}];l({...e.task,assignees:D}),t();}}))})),y.push({id:"sep2",label:"",icon:null,separator:true}),s&&y.push({id:"duplicate",label:g.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),n&&y.push({id:"delete",label:g.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),y},x=()=>{if(!e.columnId)return [];let y=[];return i&&(y.push({id:"sort-asc",label:g.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),y.push({id:"sort-desc",label:g.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),m&&e.columnId!=="name"&&(y.push({id:"sep-hide",label:"",icon:null,separator:true}),y.push({id:"hide",label:g.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{m(e.columnId),t();}})),y},T=e.type==="task"?f():x(),p={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:d,style:p,className:u("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:T.map(y=>y.separator?jsxRuntime.jsx("div",{className:u("my-1 h-px",a?"bg-white/10":"bg-gray-200")},y.id):y.submenu?jsxRuntime.jsx(Yv,{item:y,isDark:a},y.id):jsxRuntime.jsxs("button",{onClick:y.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",y.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:u(y.danger?"text-red-500":a?"text-[#9CA3AF]":"text-gray-400"),children:y.icon}),y.label]},y.id))})}function Yv({item:e,isDark:t}){let[a,r]=react.useState(false),o=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{o.current&&clearTimeout(o.current),r(true);},onMouseLeave:()=>{o.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",t?"text-[#6B7280]":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:u("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:e.submenu.map(l=>jsxRuntime.jsxs("button",{onClick:l.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:l.icon}),l.label]},l.id))})]})}var $u={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna"}};var Ku={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),estimatedTime:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),quotedTime:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),elapsedTime:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),effortMinutes:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),timeLoggedMinutes:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),soldEffortMinutes:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},cx=["name","status","priority","assignees","startDate","endDate","progress","tags","effortMinutes","timeLoggedMinutes","soldEffortMinutes"];function Yu({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:l}){let[m,i]=react.useState(""),[c,d]=react.useState(null),g=react.useRef(null),f=l==="es"?qu.es:qu.en;if(react.useLayoutEffect(()=>{if(!e||!g.current)return;let b=()=>{if(!g.current)return;let k=g.current.getBoundingClientRect(),N=window.innerHeight-k.top-20;d(Math.max(300,N));};return requestAnimationFrame(b),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[e]),react.useEffect(()=>{if(!e)return;let b=setTimeout(()=>{let k=N=>{g.current&&!g.current.contains(N.target)&&t();},D=N=>{N.key==="Escape"&&t();};document.addEventListener("mousedown",k),document.addEventListener("keydown",D),g._cleanup=()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",D);};},100);return ()=>{clearTimeout(b),g._cleanup&&g._cleanup();}},[e,t]),!e)return null;let x=b=>f.columns[b]||b,T=b=>{if(b==="name")return;let k=a.map(D=>D.id===b?{...D,visible:!D.visible}:D);o(k);},p=(b,k)=>{let D=a.find(E=>E.type===b&&(!k||E.customFieldId===k));if(D){T(D.id);return}let N={id:k||b,type:b,label:k?r.find(E=>E.id===k)?.name||b:x(b),width:120,visible:true,sortable:true,resizable:true,customFieldId:k};o([...a,N]);},y=cx.filter(b=>x(b).toLowerCase().includes(m.toLowerCase())),h=r.filter(b=>b.name.toLowerCase().includes(m.toLowerCase()));return jsxRuntime.jsxs("div",{ref:g,style:c?{maxHeight:`${c}px`}:void 0,className:u("absolute right-0 top-full mt-1 w-72 rounded-lg shadow-xl border z-50 flex flex-col",n?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex items-center justify-between px-4 py-3 border-b",n?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:u("font-medium",n?"text-white":"text-gray-900"),children:f.title}),jsxRuntime.jsx("button",{onClick:t,className:u("p-1 rounded",n?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:u("w-4 h-4",n?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",n?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:m,onChange:b=>i(b.target.value),placeholder:f.searchPlaceholder,className:u("w-full pl-9 pr-3 py-2 text-sm rounded-lg border outline-none",n?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"overflow-y-auto flex-1 min-h-0",children:[jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:u("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:f.standardFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:y.map(b=>{let k=a.find(E=>E.type===b&&!E.customFieldId),D=k?.visible??false,N=b==="name";return jsxRuntime.jsxs("button",{onClick:()=>{N||(k?T(k.id):p(b));},disabled:N,className:u("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100",N&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:u("w-5 h-5 rounded border flex items-center justify-center",D?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:D&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Ku[b]}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:x(b)})]},b)})})]}),h.length>0&&jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:u("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:f.customFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:h.map(b=>{let D=a.find(N=>N.customFieldId===b.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>p(b.type,b.id),className:u("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:u("w-5 h-5 rounded border flex items-center justify-center",D?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:D&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Ku[b.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:b.name})]},b.id)})})]})]})]})}var qu={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",columns:{name:"Name",status:"Status",priority:"Priority",assignees:"Assignees",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",effortMinutes:"Estimated",timeLoggedMinutes:"Time Logged",soldEffortMinutes:"Quoted",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",assignees:"Asignados",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Tiempo",effortMinutes:"Estimado",timeLoggedMinutes:"Tiempo Registrado",soldEffortMinutes:"Ofertado",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var vx=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function Zu({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[l,m]=react.useState("text"),[i,c]=react.useState([""]),d=o==="es"?Ju.es:Ju.en;react.useEffect(()=>{e&&(n(""),m("text"),c([""]));},[e]),react.useEffect(()=>{let p=y=>{y.key==="Escape"&&t();};return e&&document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,t]);let g=()=>{if(!s.trim())return;let p={name:s.trim(),type:l};l==="dropdown"&&(p.options=i.filter(y=>y.trim())),a(p),t();},f=()=>{c([...i,""]);},x=(p,y)=>{let h=[...i];h[p]=y,c(h);},T=p=>{i.length>1&&c(i.filter((y,h)=>h!==p));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:u("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex items-center justify-between px-6 py-4 border-b",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:u("text-lg font-semibold",r?"text-white":"text-gray-900"),children:d.title}),jsxRuntime.jsx("button",{onClick:t,className:u("p-1 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:u("w-5 h-5",r?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:p=>n(p.target.value),placeholder:d.fieldNamePlaceholder,className:u("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:vx.map(p=>jsxRuntime.jsxs("button",{onClick:()=>m(p.type),className:u("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",l===p.type?"border-[#3B82F6] bg-[#3B82F6]/10":r?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:l===p.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-400",children:p.icon}),jsxRuntime.jsx("span",{className:u("text-xs",l===p.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-500"),children:d.types[p.type]})]},p.type))})]}),l==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((p,y)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:p,onChange:h=>x(y,h.target.value),placeholder:`${d.option} ${y+1}`,className:u("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>T(y),className:u("p-2 rounded-lg transition-colors",r?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},y)),jsxRuntime.jsxs("button",{onClick:f,className:u("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#3B82F6] hover:bg-white/10":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:u("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-[#9CA3AF] hover:bg-white/10":"text-gray-600 hover:bg-gray-100"),children:d.cancel}),jsxRuntime.jsx("button",{onClick:g,disabled:!s.trim(),className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#3B82F6] text-white hover:bg-[#2563EB]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:d.create})]})]})]}):null}var Ju={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var tp={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function ap({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:o,locale:s}){let[n,l]=react.useState(false),m=react.useRef(null),i=react.useRef(0),c=s==="es"?tp.es:tp.en;react.useEffect(()=>{if(!n)return;let f=T=>{Date.now()-i.current<100||m.current&&!m.current.contains(T.target)&&l(false);},x=T=>{T.key==="Escape"&&l(false);};return document.addEventListener("mousedown",f),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",x);}},[n]);let d=[{value:"all",label:c.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}),color:"text-[#3B82F6]"},{value:"completed",label:c.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:c.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"todo",label:c.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],g=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),n||(i.current=Date.now()),l(x=>!x);},className:u("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors border",o?"border-white/10 hover:bg-white/10 text-white":"border-gray-200 hover:bg-gray-100 text-gray-700",g&&(o?"bg-[#3B82F6]/20 border-[#3B82F6]/50 text-[#3B82F6]":"bg-blue-50 border-blue-200 text-blue-600"),n&&(o?"bg-white/10":"bg-gray-100")),children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),c.filters,g&&jsxRuntime.jsx("span",{className:u("w-2 h-2 rounded-full",o?"bg-[#3B82F6]":"bg-blue-500")})]}),n&&jsxRuntime.jsxs("div",{className:u("absolute left-0 top-full mt-2 w-72 rounded-lg shadow-xl border z-50",o?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("px-4 py-3 border-b",o?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("span",{className:u("text-xs font-medium uppercase tracking-wider",o?"text-[#6B7280]":"text-gray-400"),children:c.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:d.map(f=>{let x=e===f.value&&!t,T=()=>f.value==="all"?x?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}):jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-400"}):f.icon;return jsxRuntime.jsxs("button",{onClick:()=>{a(f.value),r(false),l(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",x&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:u(x?f.color:"text-gray-400","flex-shrink-0"),children:T()}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:f.label}),x&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#3B82F6]":"text-blue-500")})]},f.value)})}),jsxRuntime.jsx("div",{className:u("my-2 mx-4 h-px",o?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{let f=!t;r(f),f&&a("all"),l(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",t&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:u("w-4 h-4 flex-shrink-0",t?o?"text-[#3B82F6]":"text-blue-500":o?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:c.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#3B82F6]":"text-blue-500")})]})})]})]})}var Lx=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function sp(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...sp(r.subtasks,t+1));return a}function ip({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:l=[],customFields:m=[]}){let{theme:i="dark",locale:c="en",customTranslations:d,showSearch:g=true,showHierarchy:f=true,tableColumns:x,allowColumnCustomization:T=true,allowColumnResize:p=true,enableContextMenu:y=true,showCreateTaskButton:h=false,onCreateTask:b,persistFilter:k=false}=t,D=As(c,d),N=i==="dark",E=react.useCallback(()=>{if(!k||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let O=localStorage.getItem(k);if(O){let ae=JSON.parse(O);return {statusFilter:ae.statusFilter||"all",hideCompleted:ae.hideCompleted||!1}}}catch(O){console.error("Error loading persisted filter:",O);}return {statusFilter:"all",hideCompleted:false}},[k]),[w,R]=react.useState("startDate"),[I,C]=react.useState("asc"),[W,H]=react.useState(""),[v,te]=react.useState(()=>E().statusFilter),[oe,ne]=react.useState(()=>E().hideCompleted),[A,ke]=react.useState(x||Lx),[Ie,L]=react.useState(false),[U,S]=react.useState(false),[K,J]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[ie,ue]=react.useState(null),[ye,Oe]=react.useState(0),[ee,Je]=react.useState(0),Me=react.useRef(null);react.useEffect(()=>{x&&ke(x);},[x]),react.useEffect(()=>{if(!(!k||typeof window>"u"))try{localStorage.setItem(k,JSON.stringify({statusFilter:v,hideCompleted:oe}));}catch(O){console.error("Error persisting filter state:",O);}},[k,v,oe]);let rt=react.useMemo(()=>{let O=new Set;function ae(Le){for(let je of Le)je.subtasks?.length&&(je.isExpanded!==false&&O.add(je.id),ae(je.subtasks));}return ae(e),O},[e]),ut=react.useMemo(()=>A.filter(O=>O.visible),[A]),It=react.useCallback(O=>{a.onTaskToggleExpand?.(O);},[a]),Xe=react.useCallback(O=>{w===O?C(ae=>ae==="asc"?"desc":"asc"):(R(O),C("asc")),a.onSortChange?.({column:O,direction:I==="asc"?"desc":"asc"});},[w,I,a]),pt=react.useCallback(O=>{ke(O),a.onColumnsChange?.(O);},[a]),ce=react.useCallback(O=>{let ae=A.map(Le=>Le.id===O?{...Le,visible:false}:Le);pt(ae);},[A,pt]),Ge=react.useCallback((O,ae)=>{R(O),C(ae);},[]),Be=react.useCallback((O,ae,Le)=>{y&&(O.preventDefault(),J({isOpen:true,x:O.clientX,y:O.clientY,type:ae?"task":"header",task:ae,columnId:Le}));},[y]),B=react.useCallback(()=>{J(O=>({...O,isOpen:false}));},[]),X=react.useCallback((O,ae)=>{if(!p)return;O.preventDefault(),O.stopPropagation();let Le=A.find(je=>je.id===ae);Le&&(ue(ae),Oe(O.clientX),Je(Le.width));},[A,p]);react.useEffect(()=>{if(!ie)return;let O=Le=>{let je=Le.clientX-ye,Ye=Math.max(50,ee+je),j=A.map(z=>z.id===ie?{...z,width:Ye}:z);ke(j);},ae=()=>{ie&&a.onColumnsChange?.(A),ue(null);};return document.addEventListener("mousemove",O),document.addEventListener("mouseup",ae),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",ae);}},[ie,ye,ee,A,a]);let fe=react.useCallback(async O=>{if(a.onCreateCustomField){let ae={...O,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ae);}S(false);},[a]),Ae=react.useCallback(O=>O.progress===100||O.status==="completed"?"completed":O.progress&&O.progress>0||O.status==="in-progress"?"in-progress":"todo",[]),Ue=react.useMemo(()=>{let O=sp(e);if(W.trim()){let ae=W.toLowerCase();O=O.filter(Le=>Le.name.toLowerCase().includes(ae));}return v!=="all"&&(O=O.filter(ae=>Ae(ae)===v)),oe&&(O=O.filter(ae=>Ae(ae)!=="completed")),O.sort((ae,Le)=>{let je,Ye;switch(w){case "name":je=ae.name.toLowerCase(),Ye=Le.name.toLowerCase();break;case "startDate":je=ae.startDate?.getTime()||0,Ye=Le.startDate?.getTime()||0;break;case "endDate":je=ae.endDate?.getTime()||0,Ye=Le.endDate?.getTime()||0;break;case "progress":je=ae.progress||0,Ye=Le.progress||0;break;case "status":je=ae.status||"todo",Ye=Le.status||"todo";break;case "priority":let j={urgent:0,high:1,medium:2,low:3,none:4};je=j[ae.priority]??4,Ye=j[Le.priority]??4;break;default:return 0}return je<Ye?I==="asc"?-1:1:je>Ye?I==="asc"?1:-1:0}),O},[e,W,v,oe,w,I,Ae]),nt=react.useCallback((O,ae)=>{let Le=j=>{a.onTaskUpdate?.({...O,...j});},je=j=>j?O.customFields?.find(De=>De.fieldId===j)?.value:void 0,Ye=(j,z)=>{if(!j)return;let bt=[...O.customFields||[]],le=bt.findIndex(He=>He.fieldId===j);le>=0?bt[le]={fieldId:j,value:z}:bt.push({fieldId:j,value:z}),Le({customFields:bt});};switch(ae.type){case "name":return null;case "status":return jsxRuntime.jsx(lu,{value:O.status||(O.progress===100?"completed":O.progress&&O.progress>0?"in-progress":"todo"),onChange:z=>{Le({status:z,progress:z==="completed"?100:z==="in-progress"?50:0});},isDark:N,locale:c,translations:D.status});case "priority":return jsxRuntime.jsx(cu,{value:O.priority,onChange:z=>Le({priority:z}),isDark:N,locale:c});case "assignees":return jsxRuntime.jsx(pu,{value:O.assignees||[],availableUsers:l,onChange:z=>Le({assignees:z}),isDark:N,locale:c});case "startDate":return jsxRuntime.jsx(Os,{value:O.startDate,onChange:z=>Le({startDate:z}),isDark:N,locale:c,dateField:"start",startDate:O.startDate,endDate:O.endDate});case "endDate":return jsxRuntime.jsx(Os,{value:O.endDate,onChange:z=>Le({endDate:z}),isDark:N,locale:c,dateField:"end",startDate:O.startDate,endDate:O.endDate});case "progress":return jsxRuntime.jsx(xu,{value:O.progress||0,onChange:z=>{let De=z===100?"completed":z>0?"in-progress":"todo";Le({progress:z,status:De});},isDark:N});case "tags":return jsxRuntime.jsx(Au,{value:O.tags||[],isDark:N});case "text":return jsxRuntime.jsx(Cu,{value:je(ae.customFieldId)||"",onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "number":return jsxRuntime.jsx(Du,{value:je(ae.customFieldId)||0,onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "date":let j=je(ae.customFieldId);return jsxRuntime.jsx(Os,{value:j?new Date(j):void 0,onChange:z=>Ye(ae.customFieldId,z),isDark:N,locale:c});case "dropdown":return jsxRuntime.jsx(Su,{value:je(ae.customFieldId)||"",options:ae.options||[],onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "checkbox":return jsxRuntime.jsx(Pu,{value:je(ae.customFieldId)||false,onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "estimatedTime":return jsxRuntime.jsx(ko,{value:O.estimatedTime,onChange:z=>Le({estimatedTime:z}),isDark:N,locale:c});case "quotedTime":return jsxRuntime.jsx(ko,{value:O.quotedTime,onChange:z=>Le({quotedTime:z}),isDark:N,locale:c});case "elapsedTime":return jsxRuntime.jsx(ko,{value:O.elapsedTime,onChange:z=>Le({elapsedTime:z}),isDark:N,locale:c});case "effortMinutes":return jsxRuntime.jsx(ko,{value:O.effortMinutes,onChange:z=>Le({effortMinutes:z}),isDark:N,locale:c});case "timeLoggedMinutes":return jsxRuntime.jsx(ko,{value:O.timeLoggedMinutes,onChange:a.onLogTime?z=>{a.onLogTime?.(O,z);}:void 0,isDark:N,locale:c,placeholder:c==="es"?"Agregar":"Add"});case "soldEffortMinutes":return jsxRuntime.jsx(ko,{value:O.soldEffortMinutes,onChange:z=>Le({soldEffortMinutes:z}),isDark:N,locale:c});default:return jsxRuntime.jsx("span",{className:u("text-sm",N?"text-[#94A3B8]":"text-gray-500"),children:"-"})}},[a,N,c,l,D]),Pt=react.useCallback(O=>{let Le={name:D.columns.name,status:D.columns.status,priority:D.columns.priority,assignees:D.columns.assignees,startDate:D.columns.startDate,endDate:D.columns.endDate,progress:D.columns.progress,tags:D.columns.tags||(c==="es"?"Etiquetas":"Tags"),estimatedTime:D.columns.estimatedTime||(c==="es"?"Estimado":"Estimated"),quotedTime:D.columns.quotedTime||(c==="es"?"Ofertado":"Quoted"),elapsedTime:D.columns.elapsedTime||(c==="es"?"Tiempo":"Time Spent"),effortMinutes:D.columns.effortMinutes||(c==="es"?"Estimado":"Estimated"),timeLoggedMinutes:D.columns.timeLoggedMinutes||(c==="es"?"Tiempo":"Time Logged"),soldEffortMinutes:D.columns.soldEffortMinutes||(c==="es"?"Ofertado":"Quoted")}[O.type]||O.label;return typeof Le=="string"?Le:String(Le||O.type)},[D,c]),ze=react.useMemo(()=>ut.reduce((O,ae)=>O+ae.width,0)+(T?48:0),[ut,T]);return r?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",N?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:[D.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",N?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",N?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",N?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",N?"text-white":"text-gray-900"),children:D.empty.noTasks}),jsxRuntime.jsx("p",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:D.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:Me,className:u("flex-1 flex flex-col w-full h-full overflow-hidden",N?"bg-[#0F1117]":"bg-white",ie&&"select-none",s),style:n,children:[jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",N?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx(ap,{value:v,hideCompleted:oe,onChange:te,onHideCompletedChange:ne,isDark:N,locale:c}),jsxRuntime.jsxs("div",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:[Ue.length," ",D.pagination.tasks]}),g&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",N?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:W,onChange:O=>H(O.target.value),placeholder:D.toolbar.searchPlaceholder,className:u("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",N?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsx("div",{className:"flex-1"}),h&&b&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:b,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:D.toolbar.newTask})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsxs("div",{style:{minWidth:ze},children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 flex items-center border-b text-xs font-medium uppercase tracking-wider sticky top-0 z-10",N?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[ut.map(O=>jsxRuntime.jsxs("div",{className:u("relative flex items-center gap-2 px-4 py-3",N?"text-[#9CA3AF]":"text-gray-500"),style:{width:O.width,minWidth:O.minWidth},onContextMenu:ae=>Be(ae,void 0,O.id),children:[O.sortable?jsxRuntime.jsxs("button",{onClick:()=>Xe(O.id),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[Pt(O),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:u("w-3 h-3",w===O.id&&"text-[#3B82F6]")})]}):jsxRuntime.jsx("span",{children:Pt(O)}),p&&O.resizable&&jsxRuntime.jsx("div",{className:u("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#3B82F6]",ie===O.id&&"bg-[#3B82F6]"),onMouseDown:ae=>X(ae,O.id)})]},O.id)),T&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-3",children:[jsxRuntime.jsx("button",{onClick:O=>{O.stopPropagation(),L(ae=>!ae);},className:u("p-1.5 rounded-lg transition-colors",N?"hover:bg-white/10 text-[#9CA3AF] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",Ie&&(N?"bg-white/10":"bg-gray-200")),title:c==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(Yu,{isOpen:Ie,onClose:()=>L(false),columns:A,customFields:m,onColumnsChange:pt,onCreateCustomField:()=>{L(false),S(true);},isDark:N,locale:c})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"popLayout",children:Ue.map((O,ae)=>{let Le=rt.has(O.id),je=Math.min(ae*.01,.2);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:je},className:u("flex items-center border-b transition-colors",N?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),onClick:()=>a.onTaskClick?.(O),onDoubleClick:()=>a.onTaskDoubleClick?.(O),onContextMenu:Ye=>Be(Ye,O),children:[ut.map(Ye=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[52px]",style:{width:Ye.width,minWidth:Ye.minWidth},children:Ye.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[f&&O.level>0&&jsxRuntime.jsx("div",{style:{width:`${O.level*24}px`},className:"flex-shrink-0"}),f&&O.hasChildren&&jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),It(O.id);},className:u("p-0.5 rounded flex-shrink-0",N?"hover:bg-white/10":"hover:bg-gray-200"),children:Le?jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-4 h-4",N?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",N?"text-[#9CA3AF]":"text-gray-400")})}),f&&!O.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsx("span",{className:u("truncate font-medium",N?"text-white":"text-gray-900",O.progress===100&&(N?"line-through text-[#6B7280]":"line-through text-gray-400")),children:O.name})]}):nt(O,Ye)},Ye.id)),T&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},O.id)})}),Ue.length===0&&W&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:u("w-12 h-12 mx-auto mb-4",N?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:u(N?"text-[#9CA3AF]":"text-gray-600"),children:D.empty.noResults})]})})]})}),jsxRuntime.jsx(Uu,{state:K,onClose:B,isDark:N,locale:c,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:ce,onColumnSort:Ge,availableUsers:l}),jsxRuntime.jsx(Zu,{isOpen:U,onClose:()=>S(false),onSave:fe,isDark:N,locale:c})]})}var lp=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"assignees",type:"assignees",label:"Assignees",width:150,visible:false,sortable:false,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Time Logged",width:100,visible:false,sortable:true,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true}],dp=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"}],cp=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var Wl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgSelected:"#1f6feb20",bgAlternate:"#0d111780",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff",checkboxBg:"#21262d",checkboxChecked:"#58a6ff"},Gl={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da"},Vl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1"},Hs={dark:Wl,light:Gl,neutral:Vl};function mp(e){return Hs[e]||Hs.dark}var _l={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},jl={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},Ws={en:_l,es:jl};function Dn(e){return Ws[e]||Ws.en}function Gs(e,t){let a=Dn(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function up(e){let t=Dn(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function pp(e,t=0,a=true){let r=Dn(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function yp(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function ql(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function vp({task:e}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-green-500 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-blue-500 flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-3 h-3 text-gray-400 flex-shrink-0"})}function kp({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:l,availableTags:m=[],onCreateTag:i,attachmentsByTask:c,comments:d,onAddComment:g,currentUser:f,mentionableUsers:x,onUploadCommentAttachments:T,onTaskOpen:p,enableTimeTracking:y,timeTrackingSummary:h,timeEntries:b,timerState:k,onLogTime:D,onUpdateEstimate:N,onStartTimer:E,onStopTimer:w,onDiscardTimer:R}){let{theme:I="dark",locale:C="en",customTranslations:W}=t,H=Gs(C,W),v=I==="dark",[te,oe]=react.useState(r||new Date),[ne,A]=react.useState(null),[ke,Ie]=react.useState(null),[L,U]=react.useState({}),S=4,K=3,[J,ie]=react.useState(null),[ue,ye]=react.useState(""),[Oe,ee]=react.useState(void 0),[Je,Me]=react.useState(null),[rt,ut]=react.useState(false),[It,Xe]=react.useState(false),[pt,ce]=react.useState(null),[Ge,Be]=react.useState(false),[B,X]=react.useState(new Date),fe=react.useCallback(()=>{oe(new Date(te.getFullYear(),te.getMonth()-1,1));},[te]),Ae=react.useCallback(()=>{oe(new Date(te.getFullYear(),te.getMonth()+1,1));},[te]),Ue=react.useCallback(()=>{oe(new Date);},[]),nt=react.useMemo(()=>{let O=te.getFullYear(),ae=te.getMonth(),Le=new Date(O,ae,1),je=new Date(O,ae+1,0),Ye=Le.getDay(),j=je.getDate(),z=yp(e),De=new Date;De.setHours(0,0,0,0);let bt=[],le=Ye,He=new Date(O,ae,0).getDate();for(let Re=le-1;Re>=0;Re--){let de=new Date(O,ae-1,He-Re);bt.push({date:de,isCurrentMonth:false,isToday:false,isWeekend:de.getDay()===0||de.getDay()===6,events:z.filter(Ve=>ql(de,Ve)).map(Ve=>({id:Ve.id,title:Ve.name,start:Ve.startDate,end:Ve.endDate,task:Ve}))});}for(let Re=1;Re<=j;Re++){let de=new Date(O,ae,Re),Ve=de.getTime()===De.getTime();bt.push({date:de,isCurrentMonth:true,isToday:Ve,isWeekend:de.getDay()===0||de.getDay()===6,events:z.filter(G=>ql(de,G)).map(G=>({id:G.id,title:G.name,start:G.startDate,end:G.endDate,task:G}))});}let Se=42-bt.length;for(let Re=1;Re<=Se;Re++){let de=new Date(O,ae+1,Re);bt.push({date:de,isCurrentMonth:false,isToday:false,isWeekend:de.getDay()===0||de.getDay()===6,events:z.filter(Ve=>ql(de,Ve)).map(Ve=>({id:Ve.id,title:Ve.name,start:Ve.startDate,end:Ve.endDate,task:Ve}))});}return bt},[te,e]),Pt=C==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ze=te.toLocaleDateString(C==="es"?"es-ES":"en-US",{month:"long",year:"numeric"});return o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",v?"bg-[#0F1117]":"bg-white",n),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:u("text-sm",v?"text-[#9CA3AF]":"text-gray-600"),children:[H.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",v?"bg-[#0F1117]":"bg-white",n),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",v?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",v?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",v?"bg-[#0F1117]":"bg-white",n),style:l,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",v?"text-white":"text-gray-900"),children:H.labels.noEvents}),jsxRuntime.jsx("p",{className:u("text-sm",v?"text-[#9CA3AF]":"text-gray-600"),children:H.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:u("flex-1 flex flex-col w-full h-full overflow-auto",v?"bg-[#0F1117]":"bg-white",n),style:l,children:[jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",v?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("h2",{className:u("text-xl font-semibold capitalize",v?"text-white":"text-gray-900"),children:ze}),jsxRuntime.jsx("button",{onClick:Ue,className:u("px-3 py-1.5 text-sm rounded-lg transition-colors",v?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:H.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:fe,className:u("p-2 rounded-lg transition-colors",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:u("w-5 h-5",v?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:Ae,className:u("p-2 rounded-lg transition-colors",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-5 h-5",v?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 min-h-0",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:Pt.map(O=>jsxRuntime.jsx("div",{className:u("py-2 text-center text-xs font-medium uppercase",v?"text-[#9CA3AF]":"text-gray-500"),children:O},O))}),jsxRuntime.jsx("div",{className:u("grid grid-cols-7 auto-rows-min gap-px rounded-lg",v?"bg-[#2D2D2D]":"bg-gray-300"),children:nt.map((O,ae)=>{let Le=O.date.getDay()===0||O.date.getDay()===6;return jsxRuntime.jsxs("div",{className:u("min-h-[120px] p-2 transition-colors flex flex-col relative group",v?Le?"bg-[#1C1F26]":O.isCurrentMonth?"bg-[#13161B]":"bg-[#0D0F13]":Le?"bg-gray-100":O.isCurrentMonth?"bg-white":"bg-gray-50",O.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let je=L[ae]||S,Ye=O.events.slice(0,je),j=O.events.length-je;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Ye.map(z=>jsxRuntime.jsx("div",{className:"relative group",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{A(z.task),a.onEventClick?.(z),p?.(z.task.id);},whileHover:{scale:1.02},className:u("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",z.task.progress===100?v?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":v?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(vp,{task:z.task}),jsxRuntime.jsx("span",{className:"truncate",children:z.title})]})},z.id)),j>0&&jsxRuntime.jsxs("button",{onClick:z=>{z.stopPropagation(),U(De=>({...De,[ae]:je+K}));},className:u("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",v?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",j," ",C==="es"?"M\xC1S":"MORE"]}),je>S&&O.events.length>S&&jsxRuntime.jsx("button",{onClick:z=>{z.stopPropagation(),U(De=>({...De,[ae]:S}));},className:u("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",v?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:C==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1",children:[(()=>{let je=ae>=28,Ye=ae%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),J===ae?ie(null):(ie(ae),ye(""),ee(void 0),Me(null),ce(null),ut(false),Xe(false),Be(false),X(O.date));},className:u("w-5 h-5 rounded flex items-center justify-center transition-all",J===ae?"opacity-100 bg-[#7C3AED] text-white":"opacity-0 group-hover:opacity-100",v?"hover:bg-[#7C3AED] text-[#6B7280] hover:text-white":"hover:bg-[#7C3AED] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3.5 h-3.5 transition-transform",J===ae&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:J===ae&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{ie(null),ye(""),ee(void 0),Me(null),ce(null),ut(false),Xe(false),Be(false);}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:je?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:je?-5:5,scale:.95},transition:{duration:.12},className:u("absolute w-[320px] rounded-lg shadow-2xl z-50",je?"bottom-full mb-1":"top-full mt-1",Ye?"right-0":"left-0",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>{j.stopPropagation(),ut(false),Xe(false),Be(false);},children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{type:"text",value:ue,onChange:j=>ye(j.target.value),placeholder:C==="es"?'Escribe el nombre de la tarea o "/" para los comandos':'Type task name or "/" for commands',className:u("w-full bg-transparent text-sm outline-none placeholder:opacity-40",v?"text-white":"text-gray-900"),autoFocus:true,onKeyDown:j=>{if(j.key==="Enter"&&ue.trim()){let z=t.availableUsers?.find(bt=>bt.id===Je),De=pt||O.date;a.onTaskCreate?.({name:ue.trim(),startDate:De,endDate:De,priority:Oe,assignees:z?[z]:void 0}),ye(""),ee(void 0),Me(null),ce(null),ie(null);}j.key==="Escape"&&(ie(null),ye(""),ee(void 0),Me(null),ce(null));}})}),jsxRuntime.jsxs("div",{className:u("px-2.5 py-2 flex items-center justify-between border-t",v?"border-white/10":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),ut(!rt),Xe(false);},className:u("p-1 rounded transition-colors",Oe?Oe==="urgent"||Oe==="high"?"text-red-400 bg-red-500/20":Oe==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":v?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:rt&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:u("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>j.stopPropagation(),children:[{id:"urgent",label:C==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:C==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:C==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:C==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:C==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(j=>jsxRuntime.jsxs("button",{onClick:()=>{ee(j.id),ut(false);},className:u("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",v?"hover:bg-white/5":"hover:bg-gray-50",Oe===j.id&&(v?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:u("w-2 h-2 rounded-full",j.color)}),jsxRuntime.jsx("span",{className:v?"text-white":"text-gray-900",children:j.label})]},j.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:j=>{j.stopPropagation(),Be(!Ge),ut(false),Xe(false),X(pt||O.date);},className:u("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors",pt?"bg-[#7C3AED]/20 text-[#7C3AED]":v?"bg-white/5 text-[#9CA3AF] hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),(pt||O.date).toLocaleDateString(C==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ge&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:u("absolute left-0 bottom-full mb-1 z-[60] rounded-xl shadow-2xl overflow-hidden flex",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>j.stopPropagation(),children:[jsxRuntime.jsx("div",{className:u("w-40 py-2 border-r",v?"border-white/10":"border-gray-200"),children:(()=>{let j=new Date,z=new Date(j);z.setDate(j.getDate()+1);let De=new Date(j);De.setDate(j.getDate()+((6-j.getDay()+7)%7||7));let bt=new Date(j);bt.setDate(j.getDate()+((1-j.getDay()+7)%7||7));let le=new Date(j);le.setDate(j.getDate()+14);let He=new Date(j);return He.setDate(j.getDate()+28),[{label:C==="es"?"Hoy":"Today",date:j,display:j.toLocaleDateString(C==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:C==="es"?"Ma\xF1ana":"Tomorrow",date:z,display:z.toLocaleDateString(C==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:C==="es"?"Este fin de semana":"This weekend",date:De,display:C==="es"?"s\xE1b.":"sat."},{label:C==="es"?"Pr\xF3xima semana":"Next week",date:bt,display:C==="es"?"lun.":"mon."},{label:C==="es"?"2 semanas":"2 weeks",date:le,display:le.toLocaleDateString(C==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:C==="es"?"4 semanas":"4 weeks",date:He,display:He.toLocaleDateString(C==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Re,de)=>jsxRuntime.jsxs("button",{className:u("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",v?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{ce(Re.date),Be(false);},children:[jsxRuntime.jsx("span",{children:Re.label}),jsxRuntime.jsx("span",{className:u("text-[10px]",v?"text-[#6B7280]":"text-gray-400"),children:Re.display})]},de))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:u("text-xs font-medium",v?"text-white":"text-gray-900"),children:B.toLocaleDateString(C==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>X(new Date),className:u("px-1.5 py-0.5 rounded text-[10px] transition-colors",v?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:C==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>X(new Date(B.getFullYear(),B.getMonth()-1)),className:u("p-0.5 rounded",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:()=>X(new Date(B.getFullYear(),B.getMonth()+1)),className:u("p-0.5 rounded",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(C==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(j=>jsxRuntime.jsx("div",{className:u("w-6 h-6 flex items-center justify-center text-[10px]",v?"text-[#6B7280]":"text-gray-400"),children:j},j))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let j=B.getFullYear(),z=B.getMonth(),De=new Date(j,z,1).getDay(),bt=new Date(j,z+1,0).getDate(),le=new Date(j,z,0).getDate(),He=new Date,Se=[];for(let de=De-1;de>=0;de--)Se.push({dayNum:le-de,isCurrentMonth:false,date:new Date(j,z-1,le-de)});for(let de=1;de<=bt;de++)Se.push({dayNum:de,isCurrentMonth:true,date:new Date(j,z,de)});let Re=42-Se.length;for(let de=1;de<=Re;de++)Se.push({dayNum:de,isCurrentMonth:false,date:new Date(j,z+1,de)});return Se.map((de,Ve)=>{let G=de.date.toDateString()===He.toDateString(),Y=(pt||O.date).toDateString()===de.date.toDateString();return jsxRuntime.jsx("button",{className:u("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",!de.isCurrentMonth&&(v?"text-[#4B5563]":"text-gray-300"),de.isCurrentMonth&&(v?"text-white":"text-gray-900"),G&&"ring-1 ring-[#3B82F6]",Y&&"bg-[#7C3AED] text-white",!Y&&(v?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{ce(de.date),Be(false);},children:de.dayNum},Ve)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),Xe(!It),ut(false);},className:u("p-1 rounded transition-colors",Je?"text-[#7C3AED] bg-[#7C3AED]/20":v?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:Je?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-medium",style:{backgroundColor:t.availableUsers?.find(j=>j.id===Je)?.color||"#7C3AED"},children:t.availableUsers?.find(j=>j.id===Je)?.initials||t.availableUsers?.find(j=>j.id===Je)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:It&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:u("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>j.stopPropagation(),children:[jsxRuntime.jsxs("button",{onClick:()=>{Me(null),Xe(false);},className:u("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",v?"hover:bg-white/5":"hover:bg-gray-50",!Je&&(v?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:u("w-5 h-5 rounded-full flex items-center justify-center",v?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:v?"text-[#9CA3AF]":"text-gray-500",children:C==="es"?"Sin asignar":"Unassigned"})]}),t.availableUsers?.map(j=>jsxRuntime.jsxs("button",{onClick:()=>{Me(j.id),Xe(false);},className:u("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",v?"hover:bg-white/5":"hover:bg-gray-50",Je===j.id&&(v?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-medium",style:{backgroundColor:j.color||"#7C3AED"},children:j.initials||j.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:v?"text-white":"text-gray-900",children:j.name})]},j.id)),(!t.availableUsers||t.availableUsers.length===0)&&jsxRuntime.jsx("div",{className:u("px-3 py-2 text-xs",v?"text-[#6B7280]":"text-gray-400"),children:C==="es"?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>{if(ue.trim()){let j=t.availableUsers?.find(De=>De.id===Je),z=pt||O.date;a.onTaskCreate?.({name:ue.trim(),startDate:z,endDate:z,priority:Oe,assignees:j?[j]:void 0}),ye(""),ee(void 0),Me(null),ce(null),ie(null);}},disabled:!ue.trim(),className:u("px-2.5 py-1 rounded text-xs font-medium transition-colors",ue.trim()?"bg-[#7C3AED] hover:bg-[#6D28D9] text-white":v?"bg-white/5 text-[#4B5563]":"bg-gray-100 text-gray-400"),children:C==="es"?"Guardar":"Save"})]})]})]})})]})})(),jsxRuntime.jsx("span",{className:u("text-sm font-medium",O.isToday?"text-[#3B82F6]":O.isCurrentMonth?v?"text-white":"text-gray-900":v?"text-[#6B7280]":"text-gray-400"),children:O.date.getDate()})]})]},ae)})})]})}),jsxRuntime.jsx(Mr,{task:ne,isOpen:!!ne,onClose:()=>A(null),onTaskUpdate:O=>{a.onTaskUpdate?.(O),A(O);},theme:I==="dark"?"dark":"light",locale:C,availableUsers:t.availableUsers?.map(O=>({id:O.id,name:O.name,avatar:O.avatar,initials:O.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:m,onCreateTag:i,attachments:ne?c?.get(ne.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:yp(e).filter(O=>O.id!==ne?.id),comments:d?.filter(O=>O.taskId===ne?.id).map(O=>({...O,createdAt:O.createdAt instanceof Date?O.createdAt:new Date(O.createdAt),updatedAt:O.updatedAt instanceof Date?O.updatedAt:O.updatedAt?new Date(O.updatedAt):void 0})),onAddComment:g,currentUser:f,mentionableUsers:x,onUploadCommentAttachments:T,enableTimeTracking:y,timeTrackingSummary:h,timeEntries:b,isTimerRunning:k?.isRunning,timerElapsedSeconds:k?.elapsedSeconds,onTimeLog:D,onEstimateUpdate:N,onTimerStart:E,onTimerStop:w,onTimerDiscard:R}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ke&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Ie(null),className:"fixed inset-0 bg-black/30 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:u("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",v?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:u("px-4 py-3 border-b flex items-center justify-between",v?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:u("font-medium",v?"text-white":"text-gray-900"),children:ke.date.toLocaleDateString(C==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>Ie(null),className:u("p-1 rounded",v?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-2",children:ke.events.map(O=>jsxRuntime.jsxs("button",{onClick:()=>{Ie(null),A(O.task),p?.(O.task.id);},className:u("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",v?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(vp,{task:O.task}),jsxRuntime.jsx("span",{className:u("text-sm truncate flex-1",v?"text-white":"text-gray-900"),children:O.title}),O.task.priority==="high"||O.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},O.id))})]})]})})]})}var Yl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgToday:"#1f6feb20",bgWeekend:"#161b2280",bgOtherMonth:"#0d111750",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",textToday:"#58a6ff",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff"},Xl={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da"},Jl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1"},Vs={dark:Yl,light:Xl,neutral:Jl};function wp(e){return Vs[e]||Vs.dark}function Gx({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:l}){let[m,i]=react.useState(false),c=react.useMemo(()=>t.filter(f=>e.cardIds.includes(f.id)),[t,e.cardIds]),d=react.useMemo(()=>{let f=c.length,x=new Set(c.flatMap(y=>y.assignedUserIds||[])).size,T=c.map(y=>y.priority).filter(Boolean),p=new Set(c.flatMap(y=>y.labels||[])).size;return {totalCards:f,uniqueAssignees:x,priorities:T,labels:p}},[c]),g=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:u("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:g,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:u("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"]})]}),m&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:f=>{f.stopPropagation(),n?.(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:c.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:c.map(f=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(f),children:a(f)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(f),children:[jsxRuntime.jsx("h4",{children:f.title}),f.description&&jsxRuntime.jsxs("p",{children:[f.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:x=>{x.stopPropagation(),s?.(e.id,f.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"})]})})]},f.id))})})]})}var Tp={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function En(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 Pn(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 Np(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 Dp({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:l}){let m=react.useMemo(()=>({...Tp,...n}),[n]),[i,c]=react.useState(new Set),d=react.useRef(null),g=react.useMemo(()=>{if(!m.groupByDay)return [{date:null,events:e}];let h=new Map;return e.forEach(b=>{let k=b.timestamp.toISOString().split("T")[0],D=h.get(k);D?D.push(b):h.set(k,[b]);}),Array.from(h.entries()).sort((b,k)=>k[0].localeCompare(b[0])).map(([b,k])=>({date:new Date(b),events:k.sort((D,N)=>N.timestamp.getTime()-D.timestamp.getTime())}))},[e,m.groupByDay]),{uniqueUsers:f,uniqueTypes:x}=react.useMemo(()=>{let h=new Set,b=new Set;return e.forEach(k=>{h.add(k.userId),b.add(k.type);}),{uniqueUsers:Array.from(h),uniqueTypes:Array.from(b)}},[e]),T=h=>{c(b=>{let k=new Set(b);return k.has(h)?k.delete(h):k.add(h),k});},p=h=>{let k=new Date().getTime()-h.getTime(),D=Math.floor(k/6e4),N=Math.floor(k/36e5),E=Math.floor(k/864e5);return D<1?"just now":D<60?`${D}m ago`:N<24?`${N}h ago`:E<7?`${E}d ago`:h.toLocaleDateString()},y=react.useMemo(()=>{let h=0;return t.types&&t.types.length>0&&h++,t.users&&t.users.length>0&&h++,t.dateRange&&h++,t.searchTerm&&h++,h},[t]);return react.useEffect(()=>{if(s&&d.current){let h=d.current.querySelector(`[data-event-id="${s}"]`);h&&h.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:u("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:u("history-timeline",m.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:h=>{let b=h.target.value;a({...t,types:b?[b]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),x.map(h=>jsxRuntime.jsxs("option",{value:h,children:[Pn(h)," ",h.replace("_"," ")]},h))]}),f.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:h=>{let b=h.target.value;a({...t,users:b?[b]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),f.map(h=>jsxRuntime.jsx("option",{value:h,children:h},h))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:h=>a({...t,searchTerm:h.target.value})})]}),y>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",y,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:d,children:g.map(h=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[m.groupByDay&&h.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:h.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[h.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:h.events.map((b,k)=>{let D=i.has(b.id),N=s===b.id,E=Np(b.type);return jsxRuntime.jsxs("div",{"data-event-id":b.id,className:u("history-timeline-event",D&&"expanded",N&&"selected"),onClick:()=>o?.(b),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:E},children:m.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:Pn(b.type)})}),k<h.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:E}})]}),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:[m.showAvatars&&b.userAvatar&&jsxRuntime.jsx("img",{src:b.userAvatar,alt:b.userName||b.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:b.userName||b.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:En(b)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:m.useRelativeTime?p(b.timestamp):b.timestamp.toLocaleString()})]}),Object.keys(b.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:w=>{w.stopPropagation(),T(b.id);},children:[D?"\u25BC":"\u25B6"," Show changes"]}),D&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(b.changes).map(([w,R])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[w,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(R.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(R.to)})]})]},w)),b.metadata&&Object.keys(b.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(b.metadata).map(([w,R])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[w,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(R)})]},w))]})]})]})]},b.id)})})]},h.date?.toISOString()||"all"))})]})}function Ep({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:l,onSpeedChange:m,className:i}){let c=[.5,1,1.5,2,3],d=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),g=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:u("history-replay-empty",i),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:u("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:d&&Pn(d.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:d&&En(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:f=>l(parseInt(f.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${g}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((f,x)=>jsxRuntime.jsx("div",{className:u("history-replay-progress-marker",x===e.currentIndex&&"active"),style:{left:`${x/(e.totalEvents-1)*100}%`},onClick:()=>l(x),title:En(f)},f.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,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:o,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:n,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:c.map(f=>jsxRuntime.jsxs("button",{className:u("history-replay-speed-btn",e.speed===f&&"active"),onClick:()=>m(f),children:[f,"x"]},f))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,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(f=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:f},f))})]})]})]})]}):jsxRuntime.jsxs("div",{className:u("history-replay-start",i),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,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 Zl(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 Ql(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 Pp(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 Mp(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Yx(e,t,a,r,o,s=100){let n=e.map(m=>({...m,x:m.x??a/2+Math.random()*100-50,y:m.y??r/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(n.map(m=>[m.id,m]));for(let m=0;m<s;m++){let i=1-m/s;n.forEach(c=>{let d=a/2,g=r/2;c.vx+=(d-c.x)*o.centerForce*i,c.vy+=(g-c.y)*o.centerForce*i,n.forEach(f=>{if(c.id===f.id)return;let x=c.x-f.x,T=c.y-f.y,p=Math.sqrt(x*x+T*T)||1,y=o.chargeStrength*i/(p*p);c.vx+=x/p*y,c.vy+=T/p*y;});}),t.forEach(c=>{let d=l.get(typeof c.source=="string"?c.source:c.source.id),g=l.get(typeof c.target=="string"?c.target:c.target.id);if(!d||!g)return;let f=g.x-d.x,x=g.y-d.y,T=Math.sqrt(f*f+x*x)||1,p=(T-o.linkDistance)/T*o.forceStrength*i;d.vx+=f*p,d.vy+=x*p,g.vx-=f*p,g.vy-=x*p;}),n.forEach(c=>{c.fx!==null&&c.fx!==void 0?(c.x=c.fx,c.vx=0):c.x+=c.vx,c.fy!==null&&c.fy!==void 0?(c.y=c.fy,c.vy=0):c.y+=c.vy,c.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,c.x)),c.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,c.y)),c.vx*=.9,c.vy*=.9;});}return n}function Fp({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:l,className:m}){let i=react.useRef(null),[c,d]=react.useState([]),[g,f]=react.useState(null),[x,T]=react.useState(null),[p,y]=react.useState(null),[h,b]=react.useState(1),[k,D]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let H=Yx(e,t,a.width,a.height,a,150);d(H);},[e,t,a]);let N=react.useCallback((H,v)=>{a.enableDragging&&(v.stopPropagation(),f(H));},[a.enableDragging]),E=react.useCallback(H=>{if(!g||!i.current)return;let te=i.current.getBoundingClientRect(),oe=(H.clientX-te.left-k.x)/h,ne=(H.clientY-te.top-k.y)/h;d(A=>A.map(ke=>ke.id===g?{...ke,x:oe,y:ne,fx:oe,fy:ne}:ke));},[g,h,k]),w=react.useCallback(()=>{f(null);},[]),R=react.useCallback((H,v)=>{v.stopPropagation(),l?.({type:"node-click",node:H,position:{x:v.clientX,y:v.clientY}});},[l]),I=react.useCallback((H,v)=>{v.stopPropagation(),l?.({type:"edge-click",edge:H,position:{x:v.clientX,y:v.clientY}});},[l]),C=react.useCallback(H=>{let v=c.find(te=>te.id===H);return v?{x:v.x,y:v.y}:{x:0,y:0}},[c]),W=react.useCallback(H=>{if(H.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return H.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let v=H.card.priority;return v==="URGENT"?"#ef4444":v==="HIGH"?"#f59e0b":v==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return H.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:u("relationships-graph-empty",m),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:u("relationships-graph",m),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:n.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:n.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>b(H=>Math.min(H+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(h*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>b(H=>Math.max(H-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{b(1),D({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(H=>H.type))).map(H=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Zl(H)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Pp(H)," ",Ql(H)]})]},H))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:E,onMouseUp:w,onMouseLeave:w,children:[jsxRuntime.jsxs("g",{transform:`translate(${k.x}, ${k.y}) scale(${h})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(H=>{let v=C(typeof H.source=="string"?H.source:H.source.id),te=C(typeof H.target=="string"?H.target:H.target.id),oe=Mp(H.type),ne=p===H.id,A=H.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-edge",ne&&"hovered",A&&"critical"),onMouseEnter:()=>y(H.id),onMouseLeave:()=>y(null),onClick:ke=>I(H,ke),children:[jsxRuntime.jsx("line",{x1:v.x,y1:v.y,x2:te.x,y2:te.y,stroke:Zl(H.type),strokeWidth:A?a.edgeWidth*2:a.edgeWidth,strokeOpacity:ne?1:.6,markerEnd:oe?"url(#arrowhead)":void 0}),a.showEdgeLabels&&ne&&jsxRuntime.jsx("text",{x:(v.x+te.x)/2,y:(v.y+te.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Ql(H.type)})]},H.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:c.map(H=>{let v=x===H.id,te=H.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-node",v&&"hovered",te&&"critical"),transform:`translate(${H.x}, ${H.y})`,onMouseDown:oe=>N(H.id,oe),onMouseEnter:()=>T(H.id),onMouseLeave:()=>T(null),onClick:oe=>R(H,oe),children:[jsxRuntime.jsx("circle",{r:te?a.nodeSize*1.2:a.nodeSize,fill:W(H),stroke:te?"#fbbf24":"#ffffff",strokeWidth:te?3:2,opacity:v?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:H.card.title.length>20?H.card.title.substring(0,20)+"...":H.card.title})]},H.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 Ip({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[l,m]=react.useState(false),[i,c]=react.useState(null),[d,g]=react.useState(null),f=react.useRef(null),x=l||o;react.useEffect(()=>{e&&f.current&&f.current.focus();},[e]),react.useEffect(()=>{let h=b=>{b.key==="Escape"&&!x&&T();};if(e)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,x]);let T=()=>{x||(n(""),c(null),g(null),t());},p=async()=>{if(!(!s.trim()||x)){m(true),c(null),g(null);try{let h=await r(s.trim());g(h);}catch(h){c(h instanceof Error?h.message:"Failed to generate plan");}finally{m(false);}}},y=()=>{d&&(a(d),T());};return e?jsxRuntime.jsxs(yt,{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-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:h=>h.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:T,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((h,b)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:h.title},b))})]}),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((h,b)=>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:h.title}),h.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:h.description})]}),h.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${h.priority==="URGENT"?"bg-red-500/20 text-red-400":h.priority==="HIGH"?"bg-orange-500/20 text-orange-400":h.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:h.priority})]})},b)),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:f,value:s,onChange:h=>n(h.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."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),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((h,b)=>jsxRuntime.jsx("button",{onClick:()=>n(h),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:h},b))})]})]})}),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:T,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:y,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:p,disabled:!s.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 ed={"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 Jx={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Zx={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 Qx(e,t,a){let r=ed[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Mn(e){return `$${e.toFixed(4)}`}var td=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Qx(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let r=a.length,o=a.reduce((d,g)=>d+g.cost,0),s=a.reduce((d,g)=>d+g.inputTokens,0),n=a.reduce((d,g)=>d+g.outputTokens,0),l=a.filter(d=>d.success),m=a.reduce((d,g)=>d+g.duration,0),i={},c={};return a.forEach(d=>{i[d.feature]=(i[d.feature]||0)+1,c[d.feature]=(c[d.feature]||0)+d.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:c,averageDuration:r>0?m/r:0,successRate:r>0?l.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let l=this.operations.filter(c=>c.timestamp>=n).length,m=Math.max(0,o-l),i=l/o*100;return {used:l,limit:o,remaining:m,percentUsed:i,isExceeded:l>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},To=new td;function Op({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(To.getStats()),[s,n]=react.useState(To.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let m=setInterval(()=>{o(To.getStats()),n(To.checkLimit(a));},1e3);return ()=>clearInterval(m)},[e,a]),react.useEffect(()=>{let m=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),!e)return null;let l=To.getRecentOperations(5);return jsxRuntime.jsxs(yt,{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:m=>m.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 (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.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,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.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:Mn(r.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:r.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:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.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:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.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(r.operationsByFeature).map(([m,i])=>{let c=r.costsByFeature[m]||0,d=r.totalOperations>0?i/r.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:m.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:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Mn(c)})]})]}),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}%`}})})]},m)})})]}),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(m=>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:m.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(m.timestamp).toLocaleTimeString()," \u2022"," ",m.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[m.inputTokens+m.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Mn(m.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${m.success?"bg-green-400":"bg-red-400"}`})]})]},m.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 Up({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,l]=react.useState(""),[m,i]=react.useState(""),[c,d]=react.useState(""),[g,f]=react.useState(false),[x,T]=react.useState(null),[p,y]=react.useState(null),[h,b]=react.useState(null),k=react.useRef(null),D=g||o;react.useEffect(()=>{e&&k.current&&k.current.focus();},[e]),react.useEffect(()=>{let I=C=>{C.key==="Escape"&&!D&&N();};if(e)return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,D]);let N=()=>{D||(l(""),i(""),d(""),T(null),y(null),b(null),t());},E=async()=>{if(!(!n.trim()||D)){f(true),T(null),y(null),b(null);try{let I=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:m||void 0,endDate:c||void 0});y(I.tasks.tasks),b({from_cache:I.from_cache,tokens_used:I.tokens_used,mock_mode:I.mock_mode,similarity:I.similarity,tokens_saved:I.tokens_saved});}catch(I){T(I instanceof Error?I.message:"Failed to generate tasks");}finally{f(false);}}},w=()=>{p&&(a(p),N());};if(!e)return null;let R=h?.similarity?((h.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(yt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:N}),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:I=>I.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:N,disabled:D,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:p?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:[h?.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"}),h?.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 (",R,"% 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:[h?.tokens_used||0," tokens"]}),h?.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:[h.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:[p.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:p.map((I,C)=>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:["#",C+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:I.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"})]}),I.start," \u2192 ",I.end]}),jsxRuntime.jsxs("span",{children:[I.duration," days"]}),I.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",I.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${I.priority==="high"?"bg-red-500/20 text-red-400":I.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:I.priority})]})},I.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:n,onChange:I=>l(I.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:D}),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:m,onChange:I=>i(I.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:D})]}),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:c,onChange:I=>d(I.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:D})]})]}),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((I,C)=>jsxRuntime.jsx("button",{onClick:()=>l(I),disabled:D,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:I},C))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:D&&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:N,disabled:D,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"}),p?jsxRuntime.jsx("button",{onClick:w,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:E,disabled:!n.trim()||D,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:D?"Generating...":"Generate Tasks"})]})]})]})})]})}function Ks({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(p=>{t&&Un(()=>Promise.resolve(t(p)),{maxAttempts:3,initialDelay:1e3,onRetry:(y,h,b)=>{console.warn(`Retry attempt ${h} after ${b}ms: ${y.message}`);}}).then(y=>{y.success||console.error(`Failed to persist board after ${y.attempts} attempts:`,y.error);});},[t]),s=react.useCallback(async(p,y,h)=>{r(b=>{let k=b.cards.find(I=>I.id===p);if(!k)return b;let D=k.columnId,N={...k,columnId:y,position:h},E=b.cards.map(I=>I.id===p?N:I),w=b.columns.map(I=>{if(I.id===D)return {...I,cardIds:I.cardIds.filter(C=>C!==p)};if(I.id===y){let C=E.filter(W=>W.columnId===y).sort((W,H)=>W.position-H.position);return {...I,cardIds:C.map(W=>W.id)}}return I}),R={...b,cards:E,columns:w};return o(R),R});},[o]),n=react.useCallback(async(p,y)=>{r(h=>{let b=h.cards.map(D=>D.id===p?{...D,...y}:D),k={...h,cards:b};return o(k),k});},[o]),l=react.useCallback(async p=>{let y=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let b={...p,id:y},k=h.columns.map(N=>N.id===p.columnId?{...N,cardIds:[...N.cardIds,y]}:N),D={...h,cards:[...h.cards,b],columns:k};return o(D),D});},[o]),m=react.useCallback(async p=>{r(y=>{let h=y.cards.find(N=>N.id===p);if(!h)return y;let b=y.cards.filter(N=>N.id!==p),k=y.columns.map(N=>N.id===h.columnId?{...N,cardIds:N.cardIds.filter(E=>E!==p)}:N),D={...y,cards:b,columns:k};return o(D),D});},[o]),i=react.useCallback(async p=>{let y=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let b={...p,id:y,cardIds:[]},k={...h,columns:[...h.columns,b]};return o(k),k});},[o]),c=react.useCallback(async(p,y)=>{r(h=>{let b=h.columns.map(D=>D.id===p?{...D,...y}:D),k={...h,columns:b};return o(k),k});},[o]),d=react.useCallback(async p=>{r(y=>{let h=y.cards.filter(D=>D.columnId!==p),b=y.columns.filter(D=>D.id!==p),k={...y,cards:h,columns:b};return o(k),k});},[o]),g=react.useCallback(p=>{let y=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(p),y},[l]),f=react.useCallback(p=>{let y=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(p),y},[i]),x=react.useCallback(()=>{r(p=>{let y={...p,cards:[],columns:[]};return o(y),y});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:l,onCardDelete:m,onColumnCreate:i,onColumnUpdate:c,onColumnDelete:d},setBoard:r,helpers:{addCard:g,addColumn:f,deleteCard:m,deleteColumn:d,clearBoard:x}}}function Wp({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=Ks({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(m,i,c={})=>{s.addCard({title:i,columnId:m,position:r.cards.filter(d=>d.columnId===m).length,...c});},addColumn:(m,i)=>{let c=r.columns.length>0?Math.max(...r.columns.map(d=>d.position)):0;s.addColumn({title:m,position:i??c+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var Fn={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},Vp={by:"none",order:"asc"};function _p({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...Fn,...e}),[s,n]=react.useState({...Vp,...t}),l=react.useCallback(T=>{o(p=>({...p,...T}));},[]),m=react.useCallback(T=>{n(p=>({...p,...T}));},[]),i=react.useCallback(()=>{o(Fn),n(Vp);},[]),c=react.useCallback(()=>{a&&o({...Fn,assignees:[a]});},[a]),d=react.useCallback(()=>{o({...Fn,dateFilter:"overdue"});},[]),g=react.useCallback(()=>{o({...Fn,priorities:["HIGH","URGENT"]});},[]),f=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),x=react.useCallback(T=>{let p=[...T];if(r.search){let y=r.search.toLowerCase();p=p.filter(h=>h.title.toLowerCase().includes(y)||h.description?.toLowerCase().includes(y));}if(r.dateFilter!=="all"){let y=new Date,h=y.getFullYear(),b=String(y.getMonth()+1).padStart(2,"0"),k=String(y.getDate()).padStart(2,"0"),D=`${h}-${b}-${k}`;p=p.filter(N=>{if(!N.endDate&&!N.dueDate)return false;let E=N.endDate||N.dueDate;if(!E)return false;let w;if(typeof E=="string")w=E.split("T")[0]||E;else {let R=E.getUTCFullYear(),I=String(E.getUTCMonth()+1).padStart(2,"0"),C=String(E.getUTCDate()).padStart(2,"0");w=`${R}-${I}-${C}`;}switch(r.dateFilter){case "overdue":return w<D;case "today":return w===D;case "this-week":let R=new Date(D+"T00:00:00"),I=new Date(w+"T00:00:00"),C=new Date(R);return C.setDate(C.getDate()+7),I>=R&&I<=C;case "custom":if(r.dateRange){let W=typeof E=="string"?new Date(E):E;return W>=r.dateRange.start&&W<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(p=p.filter(y=>y.priority&&r.priorities.includes(y.priority))),r.assignees.length>0&&(p=p.filter(y=>(y.assignedUserIds||(y.assigneeId?[y.assigneeId]:[])).some(b=>r.assignees.includes(b)))),r.labels.length>0&&(p=p.filter(y=>y.labels&&y.labels.some(h=>r.labels.includes(h)))),r.columns.length>0&&(p=p.filter(y=>r.columns.includes(y.columnId))),s.by!=="none"&&p.sort((y,h)=>{let b=0;switch(s.by){case "created":let k=y.createdAt?new Date(y.createdAt).getTime():0,D=h.createdAt?new Date(h.createdAt).getTime():0;b=k-D;break;case "priority":let N={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},E=N[y.priority||"LOW"],w=N[h.priority||"LOW"];b=E-w;break;case "dueDate":let R=y.endDate||y.dueDate,I=h.endDate||h.dueDate;if(!R)return 1;if(!I)return -1;let C=typeof R=="string"?new Date(R).getTime():R.getTime(),W=typeof I=="string"?new Date(I).getTime():I.getTime();b=C-W;break;case "title":b=y.title.localeCompare(h.title);break;case "estimate":let H=y.estimatedTime||0,v=h.estimatedTime||0;b=H-v;break;default:b=0;}return s.order==="asc"?b:-b}),p},[r,s]);return {filters:r,sort:s,setFilters:l,setSort:m,resetFilters:i,filterMyTasks:c,filterOverdue:d,filterHighPriority:g,applyFilters:x,hasActiveFilters:f}}var Kp,qp;if(typeof window<"u")try{let e=On("ai");Kp=e.generateObject,qp=e.generateText;}catch{}function Yp(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Kp&&qp&&e.apiKey),n=react.useCallback(async d=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(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(g){let f=g instanceof Error?g:new Error("Failed to generate plan");throw o(f),f}finally{a(false);}},[s]),l=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(g){let f=g instanceof Error?g:new Error("Failed to suggest assignee");throw o(f),f}finally{a(false);}},[s]),m=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(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(g){let f=g instanceof Error?g:new Error("Failed to predict risks");throw o(f),f}finally{a(false);}},[s]),i=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(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(g){let f=g instanceof Error?g:new Error("Failed to generate subtasks");throw o(f),f}finally{a(false);}},[s]),c=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(g){let f=g instanceof Error?g:new Error("Failed to estimate effort");throw o(f),f}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:l,onPredictRisks:m,onGenerateSubtasks:i,onEstimateEffort:c,isAvailable:s,isLoading:t,error:r}}function rd(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function Xp(e){let{cards:t}=e,[a,r]=rd(),o=react.useCallback(d=>a.selectedCardIds.includes(d),[a.selectedCardIds]),s=react.useCallback((d,g)=>{if(!g){r({selectedCardIds:[d],lastSelectedCardId:d});return}let f=g.ctrlKey||g.metaKey,x=g.shiftKey;if(f)a.selectedCardIds.includes(d)?r({selectedCardIds:a.selectedCardIds.filter(T=>T!==d),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});else if(x&&a.lastSelectedCardId){let T=t.find(y=>y.id===d),p=t.find(y=>y.id===a.lastSelectedCardId);if(T&&p&&T.columnId===p.columnId){let y=t.filter(w=>w.columnId===T.columnId).sort((w,R)=>w.position-R.position),h=y.findIndex(w=>w.id===a.lastSelectedCardId),b=y.findIndex(w=>w.id===d),[k,D]=h<b?[h,b]:[b,h],N=y.slice(k,D+1).map(w=>w.id),E=Array.from(new Set([...a.selectedCardIds,...N]));r({selectedCardIds:E,lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});},[t,a,r]),n=react.useCallback(d=>{r({selectedCardIds:a.selectedCardIds.filter(g=>g!==d),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),l=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),m=react.useCallback(()=>{r({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(d=>{a.selectedCardIds.includes(d)?n(d):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});},[a,n,r]),c=react.useCallback(()=>t.filter(d=>a.selectedCardIds.includes(d.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:l,selectAll:m,toggleCard:i,getSelectedCards:c}}var Jp={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Zp(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...Jp,...a}),[a]),[s,n]=react.useState([]),l=react.useCallback((T,p,y,h,b)=>{if(p.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let k={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:T,cardIds:p,columnId:y,strategy:h,color:b,isExpanded:true,position:s.filter(D=>D.columnId===y).length,createdAt:new Date};n(D=>[...D,k]);},[o.minCardsPerStack,s]),m=react.useCallback(T=>{n(p=>p.filter(y=>y.id!==T));},[]),i=react.useCallback(T=>{n(p=>p.map(y=>y.id===T?{...y,isExpanded:!y.isExpanded}:y));},[]),c=react.useCallback((T,p)=>{n(y=>y.map(h=>h.id===T&&!h.cardIds.includes(p)?{...h,cardIds:[...h.cardIds,p]}:h));},[]),d=react.useCallback((T,p)=>{n(y=>y.map(h=>{if(h.id===T){let b=h.cardIds.filter(k=>k!==p);return b.length<o.minCardsPerStack?null:{...h,cardIds:b}}return h}).filter(h=>h!==null));},[o.minCardsPerStack]),g=react.useCallback(T=>s.filter(p=>p.columnId===T).sort((p,y)=>p.position-y.position),[s]),f=react.useCallback(async T=>{let p=t.filter(D=>D.columnId===T);if(p.length<o.minCardsPerStack*2)return [];let y=[],h=new Map;p.forEach(D=>{D.labels&&D.labels.length>0&&D.labels.forEach(N=>{h.has(N)||h.set(N,[]),h.get(N).push(D);});}),h.forEach((D,N)=>{D.length>=o.minCardsPerStack&&y.push({stack:{title:`\u{1F4CC} ${N}`,cardIds:D.map(E=>E.id),columnId:T,strategy:"labels",color:"#3b82f6"},reason:`${D.length} cards with label "${N}"`,confidence:.85});});let b=new Map;p.forEach(D=>{D.assignedUserIds&&D.assignedUserIds.length>0&&D.assignedUserIds.forEach(N=>{b.has(N)||b.set(N,[]),b.get(N).push(D);});}),b.forEach((D,N)=>{D.length>=o.minCardsPerStack&&y.push({stack:{title:`\u{1F464} Assigned to user-${N.slice(-4)}`,cardIds:D.map(E=>E.id),columnId:T,strategy:"assignee",color:"#8b5cf6"},reason:`${D.length} cards assigned to the same user`,confidence:.8});});let k=new Map;if(p.forEach(D=>{D.priority&&(k.has(D.priority)||k.set(D.priority,[]),k.get(D.priority).push(D));}),k.forEach((D,N)=>{if(D.length>=o.minCardsPerStack){let E={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[N.toLowerCase()]||"\u26AA";y.push({stack:{title:`${E} ${N} Priority`,cardIds:D.map(w=>w.id),columnId:T,strategy:"priority",color:N==="high"||N==="urgent"?"#ef4444":"#10b981"},reason:`${D.length} cards with ${N} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let D of p){let E=(await r.findSimilar(D,p)).filter(w=>w.similarity>=o.autoStackConfidenceThreshold);if(E.length>=o.minCardsPerStack-1){let w=[D.id,...E.map(I=>I.card.id)],R=E.reduce((I,C)=>I+C.similarity,0)/E.length;y.push({stack:{title:`\u2728 Similar to "${D.title.substring(0,30)}${D.title.length>30?"...":""}"`,cardIds:w,columnId:T,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${E.length+1} similar tasks`,confidence:R});}}return y.filter(D=>D.confidence>=o.autoStackConfidenceThreshold).sort((D,N)=>N.confidence-D.confidence).slice(0,5)},[t,o,r]),x=react.useCallback(T=>{l(T.stack.title,T.stack.cardIds,T.stack.columnId,T.stack.strategy,T.stack.color);},[l]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(p=>p.columnId)).forEach(async p=>{let y=await f(p),h=y[0];y.length>0&&h&&h.confidence>=.9&&x(h);});},[]),{stacks:s,createStack:l,deleteStack:m,toggleStack:i,addToStack:c,removeFromStack:d,getStacksForColumn:g,getSuggestions:f,applySuggestion:x,config:o}}var Qp=react.createContext(null);function eg({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(m=>{let{Column:i}=On("@libxai/core");s.set(m.id,new i(m));}),t?.cards?.forEach(m=>{let{Card:i}=On("@libxai/core");n.set(m.id,new i(m));});let l=null;if(t?.board){let{Board:m}=On("@libxai/core");l=new m(t.board);}r.current=new core.BoardStore({board:l,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(Qp.Provider,{value:{store:o},children:e})}function qs(){let e=react.useContext(Qp);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Ln(){let e=qs(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,n]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let l=react.useCallback(h=>{e.updateBoard(h);},[e]),m=react.useCallback(h=>{e.addColumn(h);},[e]),i=react.useCallback((h,b)=>{e.updateColumn(h,b);},[e]),c=react.useCallback(h=>{e.deleteColumn(h);},[e]),d=react.useCallback(h=>e.getColumn(h),[e]),g=react.useCallback(h=>{e.addCard(h);},[e]),f=react.useCallback((h,b)=>{e.updateCard(h,b);},[e]),x=react.useCallback(h=>{e.deleteCard(h);},[e]),T=react.useCallback((h,b,k)=>{e.moveCard(h,b,k);},[e]),p=react.useCallback(h=>e.getCard(h),[e]),y=react.useCallback(h=>e.getCardsByColumn(h),[e]);return {board:t,columns:r,cards:s,updateBoard:l,addColumn:m,updateColumn:i,deleteColumn:c,getColumn:d,addCard:g,updateCard:f,deleteCard:x,moveCard:T,getCard:p,getCardsByColumn:y}}function ag(e){let{cards:t}=Ln();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function rg(e="position",t="asc"){let{cards:a}=Ln();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},m=o.priority?l[o.priority]:0,i=s.priority?l[s.priority]:0;n=m-i;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var Ys=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=Rd.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 a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} 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(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(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,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let l=await Promise.resolve(n.apply(s,a));l!==void 0&&(o=l,a[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,l,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},h2=new Ys;function ng({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:l=0,getItemKey:m}){let i=react.useRef(null),c=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:l}),d=c.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},f=n?{width:`${c.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${c.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:g,className:o,children:jsxRuntime.jsx("div",{style:f,children:d.map(x=>{let T=e[x.index];if(!T)return null;let p=m?m(T,x.index):x.index,y={position:"absolute",top:n?0:x.start,left:n?x.start:0,width:n?x.size:"100%",height:n?"100%":x.size};return jsxRuntime.jsx("div",{style:y,"data-index":x.index,children:r(T,x.index)},p)})})})}function sg(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 lg({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:l=16,getItemKey:m,horizontal:i=true}){let c=react.useRef(null),d=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>c.current,estimateSize:()=>r,overscan:n,gap:l}),g=d.getVirtualItems(),f={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},x={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:c,style:f,className:s,children:jsxRuntime.jsx("div",{style:x,children:g.map(T=>{let p=e[T.index];if(!p)return null;let y=m?m(p,T.index):T.index,h={position:"absolute",top:0,left:T.start,width:T.size,height:"100%"};return jsxRuntime.jsx("div",{style:h,"data-index":T.index,children:o(p,T.index)},y)})})})}function dg(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 cg(e,t=10){return e>t}var id={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},ld={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},dd={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},cd={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},md={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},ud={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},pd={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},gd={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)"},fd={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)"},hd={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},bd={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}},yd={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}},Xs={spacing:id,borderRadius:ld,fontSize:dd,fontWeight:cd,lineHeight:md,zIndex:ud,duration:pd,easing:gd,shadows:fd,opacity:hd,kanban:bd,gantt:yd};function mg(e,t,a){return e[t]??a}function vd(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?vd(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function v2(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function xd(e="asakaa"){let t=vd(Xs),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=v2(o);a.push(` ${s}: ${n};`);}return `:root {
403
+ Today's date: ${new Date().toISOString().split("T")[0]}`}function tu(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Br(e,t){let a=tu(e),r=t.toLowerCase().trim(),o=a.find(l=>l.name.toLowerCase()===r);if(o)return o;let s=a.find(l=>l.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(l=>{let m=l.name.toLowerCase();return n.every(i=>m.includes(i))})}function Nl(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let g=new Date(r);return g.setDate(g.getDate()+1),g}if(a==="yesterday"||a==="ayer"){let g=new Date(r);return g.setDate(g.getDate()-1),g}if(a==="next week"||a==="la pr\xF3xima semana"){let g=new Date(r);return g.setDate(g.getDate()+7),g}let o=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(o){let f={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[o[1].toLowerCase()];if(f!==void 0){let x=new Date(r),T=x.getDay(),p=f-T;return p<=0&&(p+=7),x.setDate(x.getDate()+p),x}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let g=parseInt(s[1],10),f=s[2].toLowerCase(),x=new Date(r);return f==="day"||f==="d\xEDa"||f==="dias"?x.setDate(x.getDate()+g):f==="week"||f==="semana"||f==="semanas"?x.setDate(x.getDate()+g*7):(f==="month"||f==="mes"||f==="meses")&&x.setMonth(x.getMonth()+g),x}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let l=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(l&&l[1]&&l[2]&&l[3]){let g=parseInt(l[1],10),f=parseInt(l[2],10)-1,x=parseInt(l[3],10);return new Date(x,f,g)}let m={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let g=parseInt(i[1],10),f=m[i[2].toLowerCase()],x=i[3]?parseInt(i[3],10):r.getFullYear();if(f!==void 0)return new Date(x,f,g)}let c={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},d=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(d&&d[1]&&d[2]){let g=c[d[1].toLowerCase()],f=parseInt(d[2],10),x=d[3]?parseInt(d[3],10):r.getFullYear();if(g!==void 0)return new Date(x,g,f)}return null}function Dl(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),o=a[2].toLowerCase();if(o==="day"||o==="d\xEDa"||o==="dias")return r;if(o==="week"||o==="semana"||o==="semanas")return r*7;if(o==="month"||o==="mes"||o==="meses")return r*30}return null}function Sl(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function au(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function ru(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let i=r[1].trim(),c=r[2].trim(),d=Br(t,i),g=Nl(c);if(!d)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!g)return {type:"move_task",taskId:d.id,taskName:d.name,message:`Could not parse the date "${c}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let f=d.startDate&&d.endDate?Math.round((d.endDate.getTime()-d.startDate.getTime())/(1e3*60*60*24)):1,x=new Date(g);return x.setDate(x.getDate()+f),{type:"move_task",taskId:d.id,taskName:d.name,updates:{startDate:g,endDate:x},message:`Moved "${d.name}" to ${g.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),c=o[2].trim(),d=Br(t,i),g=Dl(c);if(!d)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!g||!d.endDate)return {type:"resize_task",taskId:d.id,taskName:d.name,message:`Could not parse the duration "${c}".`,success:false,error:"Invalid duration"};let f=new Date(d.endDate);return f.setDate(f.getDate()+g),{type:"resize_task",taskId:d.id,taskName:d.name,updates:{endDate:f},message:`Extended "${d.name}" by ${g} days. New end date: ${f.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let i=s[1].trim(),c=s[2].trim(),d=Br(t,i),g=Sl(c);return d?g===null?{type:"set_progress",taskId:d.id,taskName:d.name,message:`Could not parse the progress value "${c}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:d.id,taskName:d.name,updates:{progress:g},message:`Set "${d.name}" progress to ${g}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let n=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(n&&n[1]&&n[2]){let i=n[1].trim(),c=n[2].trim(),d=Br(t,i);return d?{type:"rename_task",taskId:d.id,taskName:d.name,updates:{name:c},message:`Renamed "${d.name}" to "${c}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let l=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(l&&l[1]&&l[2]){let i=l[1].trim(),c=l[2].trim(),d=Br(t,i),g=Br(t,c);return d?g?{type:"link_tasks",taskId:g.id,taskName:g.name,dependencyFrom:d.id,dependencyTo:g.id,message:`Linked "${d.name}" \u2192 "${g.name}".`,success:true}:{type:"link_tasks",taskName:c,message:`Could not find a task named "${c}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let m=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(m&&m[1]){let i=m[1].trim(),c=Br(t,i);return c?{type:"delete_task",taskId:c.id,taskName:c.name,message:`Deleted "${c.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function ou(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function jy(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 Ky(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function Ms(e,t=[],a=[]){let r=e.assignedUserIds?.map(c=>{let d=a.find(g=>g.id===c);return d?{name:d.name,initials:d.initials,color:d.color}:null}).filter(c=>c!==null),o=t.filter(c=>c.metadata?.parentCardId===e.id).map(c=>Ms(c,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(c=>c.type==="finish-to-start").map(c=>c.taskId));let n=c=>{if(c)return typeof c=="string"?new Date(c):c},l=n(e.startDate),m=n(e.endDate),i=e.metadata?.isMilestone===true||l&&m&&Math.abs(m.getTime()-l.getTime())<=864e5;return {id:e.id,name:e.title,startDate:l,endDate:m,progress:e.progress||0,status:jy(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:o?.length?o:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function nu(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:Ky(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function su(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>Ms(r,e,t))}var El={columns:{name:"Task Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",tags:"Tags"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},Pl={columns:{name:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Tiempo",tags:"Etiquetas"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},Fs={en:El,es:Pl};function Ml(e){return Fs[e]||Fs.en}function As(e,t){let a=Ml(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var Fl=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-blue-500"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-green-500"}];function iu(e){let t=e?.toLowerCase()||"todo";return t==="inprogress"||t==="in-progress"||t==="in_progress"?"in-progress":t==="completed"||t==="done"||t==="complete"?"completed":"todo"}function lu({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let f=x=>{l.current&&!l.current.contains(x.target)&&n(false);};return s&&document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[s]);let m=iu(e),i=Fl[0],c=Fl.find(f=>f.value===m)??i,d=c.icon,g=f=>{switch(iu(f)){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-[#94A3B8]":"text-gray-500"),children:g(e)})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(d,{className:u("w-4 h-4 flex-shrink-0",c.color)}),jsxRuntime.jsx("span",{className:u("text-sm whitespace-nowrap",a?"text-[#94A3B8]":"text-gray-500"),children:g(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:Fl.map(f=>{let x=f.icon;return jsxRuntime.jsxs("button",{onClick:T=>{T.stopPropagation(),t(f.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",m===f.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(x,{className:u("w-4 h-4",f.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:g(f.value)})]},f.value)})})]})}var Al=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-red-500",bg:"bg-red-500"},{value:"high",label:{en:"High",es:"Alta"},color:"text-orange-500",bg:"bg-orange-500"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-yellow-500",bg:"bg-yellow-500"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-blue-500",bg:"bg-blue-500"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function cu({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let c=d=>{l.current&&!l.current.contains(d.target)&&n(false);};return s&&document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[s]);let m=Al.find(c=>c.value===e)??Al[4],i=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:m.label[i]})]}):jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:c=>{c.stopPropagation(),n(!s);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:u("w-4 h-4",m.color)}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:m.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:Al.map(c=>jsxRuntime.jsxs("button",{onClick:d=>{d.stopPropagation(),t(c.value),n(false);},className:u("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===c.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:u("w-2 h-2 rounded-full",c.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:c.label[i]})]},c.value))})]})}function Bs(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Rs(e){let t=["bg-blue-500","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-teal-500"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-blue-500"}function uv(e,t){if(!e)return null;let a=Math.round(e.assignedHoursThisWeek/e.weeklyCapacity*100);switch(e.level){case "light":return {color:t?"text-green-400 bg-green-500/20":"text-green-600 bg-green-100",icon:null,label:`${a}%`,tooltip:`${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`};case "moderate":return {color:t?"text-yellow-400 bg-yellow-500/20":"text-yellow-600 bg-yellow-100",icon:lucideReact.Clock,label:`${a}%`,tooltip:`${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`};case "heavy":return {color:t?"text-orange-400 bg-orange-500/20":"text-orange-600 bg-orange-100",icon:lucideReact.Clock,label:`${a}%`,tooltip:`${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`};case "overloaded":return {color:t?"text-red-400 bg-red-500/20":"text-red-600 bg-red-100",icon:lucideReact.AlertTriangle,label:`${a}%`,tooltip:`SOBRECARGADO: ${e.assignedHoursThisWeek}h / ${e.weeklyCapacity}h - ${e.activeTasks} tareas`}}}function pu({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false,showWorkloadIndicators:n=true}){let[l,m]=react.useState(false),[i,c]=react.useState(""),d=react.useRef(null);react.useEffect(()=>{let p=y=>{d.current&&!d.current.contains(y.target)&&(m(false),c(""));};return l&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]);let g=t.filter(p=>p.name.toLowerCase().includes(i.toLowerCase())||p.email?.toLowerCase().includes(i.toLowerCase())),f=n?[...g].sort((p,y)=>{let h={light:0,moderate:1,heavy:2,overloaded:3},b=p.workload?.level??"light",k=y.workload?.level??"light";return h[b]-h[k]}):g,x=p=>e.some(y=>y.name===p),T=p=>{if(a)if(x(p.name))a(e.filter(y=>y.name!==p.name));else {let y={name:p.name,initials:Bs(p.name),color:p.color||Rs(p.name).replace("bg-","").replace("-500",""),avatar:p.avatarUrl};a([...e,y]);}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((p,y)=>jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0F1117]":"border-white",!p.avatar&&Rs(p.name)),style:p.color&&!p.avatar?{backgroundColor:p.color}:void 0,title:p.name,children:p.avatar?jsxRuntime.jsx("img",{src:p.avatar,alt:p.name,className:"w-full h-full rounded-full object-cover"}):p.initials||Bs(p.name)},`${p.name}-${y}`)),e.length>3&&jsxRuntime.jsxs("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#374151] border-[#0F1117] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:d,className:"relative",children:[jsxRuntime.jsx("button",{onClick:p=>{p.stopPropagation(),m(!l);},className:u("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:u("w-4 h-4",r?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3 h-3",r?"text-[#6B7280]":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((p,y)=>jsxRuntime.jsx("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0F1117]":"border-white",!p.avatar&&Rs(p.name)),style:p.color&&!p.avatar?{backgroundColor:p.color}:void 0,children:p.avatar?jsxRuntime.jsx("img",{src:p.avatar,alt:p.name,className:"w-full h-full rounded-full object-cover"}):p.initials||Bs(p.name)},`${p.name}-${y}`)),e.length>2&&jsxRuntime.jsxs("span",{className:u("text-xs ml-1",r?"text-[#9CA3AF]":"text-gray-500"),children:["+",e.length-2]})]})}),l&&jsxRuntime.jsxs("div",{className:u("absolute z-50 top-full left-0 mt-1 rounded-lg shadow-lg border w-72",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[n&&jsxRuntime.jsxs("div",{className:u("px-3 py-2 text-xs border-b flex items-center gap-3",r?"text-[#9CA3AF] border-white/10":"text-gray-500 border-gray-200"),children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-green-500"}),o==="es"?"Ligera":"Light"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-yellow-500"}),o==="es"?"Moderada":"Moderate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500"}),o==="es"?"Alta":"Heavy"]})]}),jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:jsxRuntime.jsx("input",{type:"text",value:i,onChange:p=>c(p.target.value),placeholder:o==="es"?"Buscar usuario...":"Search user...",className:u("w-full px-3 py-1.5 text-sm rounded border outline-none",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),onClick:p=>p.stopPropagation()})}),jsxRuntime.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:f.length===0?jsxRuntime.jsx("p",{className:u("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"No se encontraron usuarios":"No users found"}):f.map(p=>{let y=uv(p.workload,r);return jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),T(p);},className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",p.workload?.level==="overloaded"&&(r?"bg-red-500/5":"bg-red-50")),title:y?.tooltip,children:[jsxRuntime.jsx("div",{className:u("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white",!p.avatarUrl&&Rs(p.name)),children:p.avatarUrl?jsxRuntime.jsx("img",{src:p.avatarUrl,alt:p.name,className:"w-full h-full rounded-full object-cover"}):Bs(p.name)}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:r?"text-white":"text-gray-900",children:p.name}),p.email&&jsxRuntime.jsx("div",{className:u("text-xs",r?"text-[#6B7280]":"text-gray-400"),children:p.email})]}),n&&y&&jsxRuntime.jsxs("div",{className:u("flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",y.color),children:[y.icon&&jsxRuntime.jsx(y.icon,{className:"w-3 h-3"}),y.label]}),x(p.name)&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},p.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"p-2 border-t flex flex-wrap gap-1",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:e.map((p,y)=>jsxRuntime.jsxs("span",{className:u("inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full",r?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:[p.name,jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),a(e.filter(b=>b.name!==p.name));},className:"hover:text-red-500",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},`${p.name}-${y}`))})]})]})}function hu({startDate:e,endDate:t,onChange:a,singleDateMode:r=false,singleDateField:o="end",isDark:s,locale:n,disabled:l=false,placeholder:m}){let[i,c]=react.useState(false),[d,g]=react.useState(o),[f,x]=react.useState(()=>{let E=o==="start"?e:t;if(E){let w=E instanceof Date?E:new Date(E);return new Date(w.getFullYear(),w.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),T=react.useRef(null),p=e?e instanceof Date?e:new Date(e):null,y=t?t instanceof Date?t:new Date(t):null;react.useEffect(()=>{let E=w=>{T.current&&!T.current.contains(w.target)&&c(false);};return i&&document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[i]),react.useEffect(()=>{i&&g(r?o:"start");},[i,r,o]);let h=E=>E?E.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):m||"-",b=react.useCallback(()=>{let E=f.getFullYear(),w=f.getMonth(),R=new Date(E,w,1),C=new Date(E,w+1,0).getDate(),W=R.getDay(),H=[],te=new Date(E,w,0).getDate();for(let ne=W-1;ne>=0;ne--)H.push({date:new Date(E,w-1,te-ne),isCurrentMonth:false});for(let ne=1;ne<=C;ne++)H.push({date:new Date(E,w,ne),isCurrentMonth:true});let oe=42-H.length;for(let ne=1;ne<=oe;ne++)H.push({date:new Date(E,w+1,ne),isCurrentMonth:false});return H},[f]),k=E=>{if(r)o==="start"?a(E,y||void 0):a(p||void 0,E),c(false);else if(d==="start"){let w=y&&E>y?E:y;a(E,w||void 0),g("end");}else {let w=p&&E<p?E:p;a(w||void 0,E),c(false);}},D=()=>{let E=new Date,w=new Date(E);w.setDate(E.getDate()+1);let R=new Date(E);R.setDate(E.getDate()+((6-E.getDay()+7)%7||7));let I=new Date(E);I.setDate(E.getDate()+((1-E.getDay()+7)%7||7));let C=new Date(E);C.setDate(E.getDate()+(6-E.getDay()+7)%7+7);let W=new Date(E);W.setDate(E.getDate()+14);let H=new Date(E);return H.setDate(E.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:E,display:E.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:w,display:w.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:R,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:I,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:C,display:C.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:W,display:W.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:H,display:H.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}]};if(l){let E=r&&o==="start"?p:y;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-[#94A3B8]":"text-gray-500"),children:h(E)})]})}let N=r&&o==="start"?p:y;return jsxRuntime.jsxs("div",{ref:T,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:E=>{E.stopPropagation(),c(!i);let w=o==="start"?p:y;w&&x(new Date(w.getFullYear(),w.getMonth(),1));},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors",s?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:u("w-4 h-4",s?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",s?"text-[#94A3B8]":"text-gray-500"),children:h(N)})]}),i&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>c(false)}),jsxRuntime.jsxs("div",{className:u("absolute z-50 top-full left-0 mt-1 rounded-xl shadow-2xl overflow-hidden flex",s?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:E=>E.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:u("w-44 py-2 border-r",s?"border-white/10":"border-gray-200"),children:[D().map((E,w)=>jsxRuntime.jsxs("button",{className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>k(E.date),children:[jsxRuntime.jsx("span",{children:E.label}),jsxRuntime.jsx("span",{className:u("text-xs",s?"text-[#6B7280]":"text-gray-400"),children:E.display})]},w)),jsxRuntime.jsx("div",{className:u("border-t mt-2 pt-2",s?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{r?o==="start"?a(void 0,y||void 0):a(p||void 0,void 0):a(void 0,void 0),c(false);},className:u("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",s?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="es"?"Quitar fecha":"Clear date"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[!r&&jsxRuntime.jsx("div",{className:u("text-xs mb-3 px-2 py-1 rounded",s?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:d==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:u("font-medium",s?"text-white":"text-gray-900"),children:f.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>x(new Date),className:u("p-1 rounded text-sm transition-colors",s?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>x(new Date(f.getFullYear(),f.getMonth()-1)),className:u("p-1 rounded",s?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:()=>x(new Date(f.getFullYear(),f.getMonth()+1)),className:u("p-1 rounded",s?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",s?"text-white":"text-gray-600")})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(E=>jsxRuntime.jsx("div",{className:u("w-8 h-8 flex items-center justify-center text-xs",s?"text-[#6B7280]":"text-gray-400"),children:E},E))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:b().map((E,w)=>{let R=E.date.toDateString()===new Date().toDateString(),I=p?.toDateString()===E.date.toDateString(),C=y?.toDateString()===E.date.toDateString(),W=I||C,H=!r&&p&&y&&E.date>=p&&E.date<=y;return jsxRuntime.jsx("button",{onClick:()=>k(new Date(E.date)),className:u("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!E.isCurrentMonth&&(s?"text-[#4B5563]":"text-gray-300"),E.isCurrentMonth&&(s?"text-white":"text-gray-900"),R&&"ring-2 ring-[#3B82F6]",I&&"bg-[#3B82F6] text-white",C&&!I&&"bg-[#7C3AED] text-white",H&&!W&&(s?"bg-[#7C3AED]/20":"bg-purple-100"),!W&&(s?"hover:bg-white/10":"hover:bg-gray-100")),children:E.date.getDate()},w)})})]})]})]})]})}function Os({value:e,onChange:t,isDark:a,locale:r,disabled:o=false,dateField:s="end",startDate:n,endDate:l}){let m=e?e instanceof Date?e:new Date(e):null;return jsxRuntime.jsx(hu,{startDate:s==="start"?m:n||null,endDate:s==="end"?m:l||null,onChange:(g,f)=>{t&&t(s==="start"?g:f);},singleDateMode:true,singleDateField:s,isDark:a,locale:r,disabled:o||!t,placeholder:"-"})}function Xo(e=600){let[t,a]=react.useState(false),r=react.useRef(null),o=react.useCallback(()=>{r.current&&clearTimeout(r.current),a(true),r.current=setTimeout(()=>{a(false);},e);},[e]);return react.useEffect(()=>()=>{r.current&&clearTimeout(r.current);},[]),{isFlashing:t,triggerFlash:o}}function $s(e,t={}){let{enabled:a=true,duration:r=400,steps:o=8}=t,[s,n]=react.useState(e),[l,m]=react.useState(false),i=react.useRef(e),c=react.useRef([]);return react.useEffect(()=>{if(c.current.forEach(clearTimeout),c.current=[],!a||e===i.current||e===void 0){n(e),i.current=e;return}let d=i.current??0,g=e,f=g-d,x=r/o;m(true);for(let T=1;T<=o;T++){let p=setTimeout(()=>{let y=T/o,h=1-Math.pow(1-y,3),b=Math.round(d+f*h);n(b),T===o&&(m(false),n(g));},x*T);c.current.push(p);}return i.current=e,()=>{c.current.forEach(clearTimeout),c.current=[];}},[e,a,r,o]),{displayValue:s,isAnimating:l}}function bu(e,t={}){let{delay:a=1500,onCancel:r}=t,[o,s]=react.useState(null),[n,l]=react.useState(0),m=react.useRef(null),i=react.useRef(null),c=react.useCallback(f=>{m.current&&clearTimeout(m.current),i.current&&clearInterval(i.current),s(f),l(0);let x=Date.now();i.current=setInterval(()=>{let T=Date.now()-x,p=Math.min(T/a*100,100);l(p);},16),m.current=setTimeout(()=>{i.current&&clearInterval(i.current),e?.(f),s(null),l(0);},a);},[a,e]),d=react.useCallback(()=>{m.current&&clearTimeout(m.current),i.current&&clearInterval(i.current),s(null),l(0),r?.();},[r]);return react.useEffect(()=>()=>{m.current&&clearTimeout(m.current),i.current&&clearInterval(i.current);},[]),{pendingValue:o,isPending:o!==null,progress:n,startChange:c,cancelChange:d}}function xu({value:e=0,onChange:t,isDark:a,disabled:r=false,enableSlotMachine:o=true,enableSaveFlash:s=true}){let{isFlashing:n,triggerFlash:l}=Xo(),{displayValue:m,isAnimating:i}=$s(e,{enabled:o,duration:300,steps:6}),c=g=>{if(r||!t)return;g.stopPropagation();let f=g.currentTarget.getBoundingClientRect(),x=g.clientX-f.left,T=Math.round(x/f.width*100),p=Math.max(0,Math.min(100,T));p!==e&&(t(p),s&&l());},d=m??e;return jsxRuntime.jsxs("div",{className:u("flex items-center gap-2 w-full rounded px-1 py-0.5 transition-all duration-300",n&&(a?"bg-green-500/30":"bg-green-500/20")),children:[jsxRuntime.jsx("div",{onClick:c,className:u("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/10":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:u("h-full rounded-full transition-all",d===100?"bg-green-500":"bg-[#3B82F6]",i&&"transition-none"),style:{width:`${d}%`}})}),jsxRuntime.jsxs("span",{className:u("text-xs w-8 text-right tabular-nums transition-all",a?"text-[#9CA3AF]":"text-gray-500",i&&"font-medium scale-105"),children:[d,"%"]})]})}function Cu({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[l,m]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{m(e);},[e]);let c=()=>{l!==e&&t?.(l),n(false);},d=g=>{g.key==="Enter"?c():g.key==="Escape"&&(m(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:u("text-sm truncate",a?"text-[#94A3B8]":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:l,onChange:g=>m(g.target.value),onBlur:c,onKeyDown:d,onClick:g=>g.stopPropagation(),className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:g=>{g.stopPropagation(),n(true);},className:u("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-[#6B7280]":"text-gray-400")),children:e||r})}function Du({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false,enableSlotMachine:l=true,enableSaveFlash:m=true}){let[i,c]=react.useState(false),[d,g]=react.useState(e?.toString()||""),f=react.useRef(null),{isFlashing:x,triggerFlash:T}=Xo(),{displayValue:p,isAnimating:y}=$s(e,{enabled:l&&!i});react.useEffect(()=>{i&&f.current&&(f.current.focus(),f.current.select());},[i]),react.useEffect(()=>{g(e?.toString()||"");},[e]);let h=()=>{let k=parseFloat(d);if(!isNaN(k)){let D=k;o!==void 0&&(D=Math.max(o,D)),s!==void 0&&(D=Math.min(s,D)),D!==e&&(t?.(D),m&&T());}c(false);},b=k=>{k.key==="Enter"?h():k.key==="Escape"&&(g(e?.toString()||""),c(false));};return n||!t?jsxRuntime.jsx("span",{className:u("text-sm transition-all",a?"text-[#94A3B8]":"text-gray-500",y&&"font-medium"),children:p!==void 0?p:r}):i?jsxRuntime.jsx("input",{ref:f,type:"number",value:d,onChange:k=>g(k.target.value),onBlur:h,onKeyDown:b,onClick:k=>k.stopPropagation(),min:o,max:s,className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),c(true);},className:u("text-sm text-left w-full px-2 py-1 rounded transition-all duration-300",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",p===void 0&&(a?"text-[#6B7280]":"text-gray-400"),x&&(a?"bg-green-500/30":"bg-green-500/20"),y&&"font-medium scale-105"),children:p!==void 0?p:r})}function Su({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,l]=react.useState(false),m=react.useRef(null);return react.useEffect(()=>{let i=c=>{m.current&&!m.current.contains(c.target)&&l(false);};return n&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s||!a?jsxRuntime.jsx("span",{className:u("text-sm",r?"text-[#94A3B8]":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),l(!n);},className:u("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:u("text-sm flex-1 text-left truncate",r?"text-[#94A3B8]":"text-gray-500",!e&&(r?"text-[#6B7280]":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-3 h-3 flex-shrink-0",r?"text-[#6B7280]":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:u("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:u("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:c=>{c.stopPropagation(),a(i),l(false);},className:u("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",e===i&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#3B82F6]"})]},i))})]})}function Pu({value:e=false,onChange:t,isDark:a,disabled:r=false,enableDelayedConfirm:o=true,confirmDelay:s=1500}){let{pendingValue:n,isPending:l,progress:m,startChange:i,cancelChange:c}=bu(t,{delay:s}),d=f=>{f.stopPropagation(),!r&&t&&(o?l?c():i(!e):t(!e));},g=l?n:e;return jsxRuntime.jsxs("div",{className:"relative inline-flex items-center gap-1",children:[jsxRuntime.jsxs("button",{onClick:d,disabled:r||!t,className:u("relative w-5 h-5 rounded border-2 flex items-center justify-center transition-all",g?"bg-[#3B82F6] border-[#3B82F6]":a?"border-[#4B5563] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed",l&&"ring-2 ring-offset-1",l&&g&&"ring-green-500/50",l&&!g&&"ring-red-500/50",l&&(a?"ring-offset-[#0F1117]":"ring-offset-white")),children:[l&&jsxRuntime.jsx("svg",{className:"absolute inset-0 w-full h-full -rotate-90",viewBox:"0 0 20 20",children:jsxRuntime.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:g?"#22C55E":"#EF4444",strokeWidth:"2",strokeDasharray:`${m/100*50.26} 50.26`,className:"transition-all duration-100"})}),l?jsxRuntime.jsx(lucideReact.Loader2,{className:"w-3 h-3 text-white animate-spin"}):g?jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"}):null]}),l&&jsxRuntime.jsx("button",{onClick:f=>{f.stopPropagation(),c();},className:u("w-4 h-4 rounded-full flex items-center justify-center transition-colors",a?"bg-red-500/20 hover:bg-red-500/40 text-red-400":"bg-red-100 hover:bg-red-200 text-red-500"),title:"Cancelar",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function Au({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:u("text-sm",t?"text-[#6B7280]":"text-gray-400"),children:"-"});let r=e.slice(0,a),o=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-xs rounded-full",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.1)":"#F3F4F6",color:s.color||(t?"#9CA3AF":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:u("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function Av(e,t="en"){if(e==null||e===0||!e||Number(e)===0)return "-";let a=Math.floor(e/60),r=e%60;return a===0?`${r}m`:r===0?`${a}h`:`${a}h ${r}m`}function Lv(e){let t=e.trim().toLowerCase();if(!t||t==="-")return null;let a=t.match(/^(\d+):(\d+)$/);if(a){let l=parseInt(a[1],10),m=parseInt(a[2],10);return l*60+m}let r=t.match(/^(\d+\.?\d*)\s*h\s*(\d+)?\s*(m|min)?$/);if(r){let l=parseFloat(r[1]),m=r[2]?parseInt(r[2],10):0;return Math.round(l*60)+m}let o=t.match(/^(\d+\.?\d*)\s*h$/);if(o)return Math.round(parseFloat(o[1])*60);let s=t.match(/^(\d+)\s*(m|min)?$/);if(s)return parseInt(s[1],10);let n=parseFloat(t);return isNaN(n)?null:Math.round(n)}function ko({value:e,onChange:t,isDark:a,locale:r="en",placeholder:o,disabled:s=false,enableSaveFlash:n=true}){let [l,m]=react.useState(false),[i,c]=react.useState(""),d=react.useRef(null),{isFlashing:g,triggerFlash:f}=Xo(),T=Av(e,r);react.useEffect(()=>{l&&d.current&&(d.current.focus(),d.current.select());},[l]),react.useEffect(()=>{if(e){let h=Math.floor(e/60),b=e%60;h>0&&b>0?c(`${h}h ${b}m`):h>0?c(`${h}h`):c(`${b}m`);}else c("");},[e,l]);let p=()=>{let h=Lv(i);h!==e&&(t?.(h),n&&f()),m(false);},y=h=>{h.key==="Enter"?p():h.key==="Escape"&&m(false);};return s||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5",children:[e!=null&&e>0&&jsxRuntime.jsx(lucideReact.Clock,{className:u("w-3.5 h-3.5 flex-shrink-0",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("text-sm",a?"text-[#94A3B8]":"text-gray-500",(!e||e===0)&&(a?"text-[#6B7280]":"text-gray-400")),children:T})]}):l?jsxRuntime.jsx("input",{ref:d,type:"text",value:i,onChange:h=>c(h.target.value),onBlur:p,onKeyDown:y,onClick:h=>h.stopPropagation(),placeholder:"1h 30m",className:u("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white placeholder:text-[#6B7280]":"bg-white border-[#3B82F6] text-gray-900 placeholder:text-gray-400")}):jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),m(true);},className:u("flex items-center gap-1 text-sm text-left w-full px-1.5 py-1 rounded transition-all duration-300 overflow-hidden",a?"hover:bg-white/10":"hover:bg-gray-100",e!=null&&e>0?a?"text-[#94A3B8]":"text-gray-600":a?"text-[#6B7280]":"text-gray-400",g&&(a?"bg-green-500/30":"bg-green-500/20")),children:[e!=null&&e>0&&jsxRuntime.jsx(lucideReact.Clock,{className:u("w-3 h-3 flex-shrink-0",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:"truncate",children:T})]})}function Kv(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function qv(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Uu({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:l,onColumnHide:m,onColumnSort:i,availableUsers:c=[]}){let d=react.useRef(null),g=r==="es"?$u.es:$u.en;if(react.useEffect(()=>{let y=b=>{d.current&&!d.current.contains(b.target)&&t();},h=b=>{b.key==="Escape"&&t();};return document.addEventListener("mousedown",y),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",h);}},[t]),!e.isOpen)return null;let f=()=>{if(!e.task)return [];let y=[];return o&&y.push({id:"edit",label:g.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),y.push({id:"sep1",label:"",icon:null,separator:true}),l&&(y.push({id:"status",label:g.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:g.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{l({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:g.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-blue-500"}),onClick:()=>{l({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:g.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{l({...e.task,status:"completed",progress:100}),t();}}]}),y.push({id:"priority",label:g.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:g.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{l({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:g.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{l({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:g.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{l({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:g.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),onClick:()=>{l({...e.task,priority:"low"}),t();}}]}),c.length>0&&y.push({id:"assign",label:g.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:c.slice(0,5).map(h=>({id:`assign-${h.id}`,label:h.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-blue-500",children:h.name.charAt(0).toUpperCase()}),onClick:()=>{let b=e.task.assignees||[],D=b.some(N=>N.name===h.name)?b.filter(N=>N.name!==h.name):[...b,{name:h.name,initials:Kv(h.name),color:h.color||qv(h.name),avatar:h.avatarUrl}];l({...e.task,assignees:D}),t();}}))})),y.push({id:"sep2",label:"",icon:null,separator:true}),s&&y.push({id:"duplicate",label:g.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),n&&y.push({id:"delete",label:g.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),y},x=()=>{if(!e.columnId)return [];let y=[];return i&&(y.push({id:"sort-asc",label:g.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),y.push({id:"sort-desc",label:g.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),m&&e.columnId!=="name"&&(y.push({id:"sep-hide",label:"",icon:null,separator:true}),y.push({id:"hide",label:g.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{m(e.columnId),t();}})),y},T=e.type==="task"?f():x(),p={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:d,style:p,className:u("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:T.map(y=>y.separator?jsxRuntime.jsx("div",{className:u("my-1 h-px",a?"bg-white/10":"bg-gray-200")},y.id):y.submenu?jsxRuntime.jsx(Yv,{item:y,isDark:a},y.id):jsxRuntime.jsxs("button",{onClick:y.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",y.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:u(y.danger?"text-red-500":a?"text-[#9CA3AF]":"text-gray-400"),children:y.icon}),y.label]},y.id))})}function Yv({item:e,isDark:t}){let[a,r]=react.useState(false),o=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{o.current&&clearTimeout(o.current),r(true);},onMouseLeave:()=>{o.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",t?"text-[#6B7280]":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:u("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:e.submenu.map(l=>jsxRuntime.jsxs("button",{onClick:l.onClick,className:u("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:l.icon}),l.label]},l.id))})]})}var $u={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna"}};var Ku={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),estimatedTime:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),quotedTime:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),elapsedTime:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),effortMinutes:jsxRuntime.jsx(lucideReact.Clock,{className:"w-4 h-4"}),timeLoggedMinutes:jsxRuntime.jsx(lucideReact.Timer,{className:"w-4 h-4"}),soldEffortMinutes:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},cx=["name","status","priority","assignees","startDate","endDate","progress","tags","effortMinutes","timeLoggedMinutes","soldEffortMinutes"];function Yu({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:l}){let[m,i]=react.useState(""),[c,d]=react.useState(null),g=react.useRef(null),f=l==="es"?qu.es:qu.en;if(react.useLayoutEffect(()=>{if(!e||!g.current)return;let b=()=>{if(!g.current)return;let k=g.current.getBoundingClientRect(),N=window.innerHeight-k.top-20;d(Math.max(300,N));};return requestAnimationFrame(b),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[e]),react.useEffect(()=>{if(!e)return;let b=setTimeout(()=>{let k=N=>{g.current&&!g.current.contains(N.target)&&t();},D=N=>{N.key==="Escape"&&t();};document.addEventListener("mousedown",k),document.addEventListener("keydown",D),g._cleanup=()=>{document.removeEventListener("mousedown",k),document.removeEventListener("keydown",D);};},100);return ()=>{clearTimeout(b),g._cleanup&&g._cleanup();}},[e,t]),!e)return null;let x=b=>f.columns[b]||b,T=b=>{if(b==="name")return;let k=a.map(D=>D.id===b?{...D,visible:!D.visible}:D);o(k);},p=(b,k)=>{let D=a.find(E=>E.type===b&&(!k||E.customFieldId===k));if(D){T(D.id);return}let N={id:k||b,type:b,label:k?r.find(E=>E.id===k)?.name||b:x(b),width:120,visible:true,sortable:true,resizable:true,customFieldId:k};o([...a,N]);},y=cx.filter(b=>x(b).toLowerCase().includes(m.toLowerCase())),h=r.filter(b=>b.name.toLowerCase().includes(m.toLowerCase()));return jsxRuntime.jsxs("div",{ref:g,style:c?{maxHeight:`${c}px`}:void 0,className:u("absolute right-0 top-full mt-1 w-72 rounded-lg shadow-xl border z-50 flex flex-col",n?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex items-center justify-between px-4 py-3 border-b",n?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:u("font-medium",n?"text-white":"text-gray-900"),children:f.title}),jsxRuntime.jsx("button",{onClick:t,className:u("p-1 rounded",n?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:u("w-4 h-4",n?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",n?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:m,onChange:b=>i(b.target.value),placeholder:f.searchPlaceholder,className:u("w-full pl-9 pr-3 py-2 text-sm rounded-lg border outline-none",n?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"overflow-y-auto flex-1 min-h-0 overscroll-contain",onWheel:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:u("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:f.standardFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:y.map(b=>{let k=a.find(E=>E.type===b&&!E.customFieldId),D=k?.visible??false,N=b==="name";return jsxRuntime.jsxs("button",{onClick:()=>{N||(k?T(k.id):p(b));},disabled:N,className:u("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100",N&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:u("w-5 h-5 rounded border flex items-center justify-center",D?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:D&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Ku[b]}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:x(b)})]},b)})})]}),h.length>0&&jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:u("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:f.customFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:h.map(b=>{let D=a.find(N=>N.customFieldId===b.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>p(b.type,b.id),className:u("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:u("w-5 h-5 rounded border flex items-center justify-center",D?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:D&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Ku[b.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:b.name})]},b.id)})})]})]})]})}var qu={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",columns:{name:"Name",status:"Status",priority:"Priority",assignees:"Assignees",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",estimatedTime:"Estimated",quotedTime:"Quoted",elapsedTime:"Time Spent",effortMinutes:"Estimated",timeLoggedMinutes:"Time Logged",soldEffortMinutes:"Quoted",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",assignees:"Asignados",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",estimatedTime:"Estimado",quotedTime:"Ofertado",elapsedTime:"Tiempo",effortMinutes:"Estimado",timeLoggedMinutes:"Tiempo Registrado",soldEffortMinutes:"Ofertado",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var vx=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function Zu({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[l,m]=react.useState("text"),[i,c]=react.useState([""]),d=o==="es"?Ju.es:Ju.en;react.useEffect(()=>{e&&(n(""),m("text"),c([""]));},[e]),react.useEffect(()=>{let p=y=>{y.key==="Escape"&&t();};return e&&document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[e,t]);let g=()=>{if(!s.trim())return;let p={name:s.trim(),type:l};l==="dropdown"&&(p.options=i.filter(y=>y.trim())),a(p),t();},f=()=>{c([...i,""]);},x=(p,y)=>{let h=[...i];h[p]=y,c(h);},T=p=>{i.length>1&&c(i.filter((y,h)=>h!==p));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:u("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:u("flex items-center justify-between px-6 py-4 border-b",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:u("text-lg font-semibold",r?"text-white":"text-gray-900"),children:d.title}),jsxRuntime.jsx("button",{onClick:t,className:u("p-1 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:u("w-5 h-5",r?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:p=>n(p.target.value),placeholder:d.fieldNamePlaceholder,className:u("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:vx.map(p=>jsxRuntime.jsxs("button",{onClick:()=>m(p.type),className:u("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",l===p.type?"border-[#3B82F6] bg-[#3B82F6]/10":r?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:l===p.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-400",children:p.icon}),jsxRuntime.jsx("span",{className:u("text-xs",l===p.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-500"),children:d.types[p.type]})]},p.type))})]}),l==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:u("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:d.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((p,y)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:p,onChange:h=>x(y,h.target.value),placeholder:`${d.option} ${y+1}`,className:u("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>T(y),className:u("p-2 rounded-lg transition-colors",r?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},y)),jsxRuntime.jsxs("button",{onClick:f,className:u("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#3B82F6] hover:bg-white/10":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),d.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:u("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-[#9CA3AF] hover:bg-white/10":"text-gray-600 hover:bg-gray-100"),children:d.cancel}),jsxRuntime.jsx("button",{onClick:g,disabled:!s.trim(),className:u("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#3B82F6] text-white hover:bg-[#2563EB]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:d.create})]})]})]}):null}var Ju={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var tp={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function ap({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:o,locale:s}){let[n,l]=react.useState(false),m=react.useRef(null),i=react.useRef(0),c=s==="es"?tp.es:tp.en;react.useEffect(()=>{if(!n)return;let f=T=>{Date.now()-i.current<100||m.current&&!m.current.contains(T.target)&&l(false);},x=T=>{T.key==="Escape"&&l(false);};return document.addEventListener("mousedown",f),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",x);}},[n]);let d=[{value:"all",label:c.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}),color:"text-[#3B82F6]"},{value:"completed",label:c.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:c.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"todo",label:c.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],g=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:m,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),n||(i.current=Date.now()),l(x=>!x);},className:u("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors border",o?"border-white/10 hover:bg-white/10 text-white":"border-gray-200 hover:bg-gray-100 text-gray-700",g&&(o?"bg-[#3B82F6]/20 border-[#3B82F6]/50 text-[#3B82F6]":"bg-blue-50 border-blue-200 text-blue-600"),n&&(o?"bg-white/10":"bg-gray-100")),children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),c.filters,g&&jsxRuntime.jsx("span",{className:u("w-2 h-2 rounded-full",o?"bg-[#3B82F6]":"bg-blue-500")})]}),n&&jsxRuntime.jsxs("div",{className:u("absolute left-0 top-full mt-2 w-72 rounded-lg shadow-xl border z-50",o?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:u("px-4 py-3 border-b",o?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("span",{className:u("text-xs font-medium uppercase tracking-wider",o?"text-[#6B7280]":"text-gray-400"),children:c.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:d.map(f=>{let x=e===f.value&&!t,T=()=>f.value==="all"?x?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}):jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-400"}):f.icon;return jsxRuntime.jsxs("button",{onClick:()=>{a(f.value),r(false),l(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",x&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:u(x?f.color:"text-gray-400","flex-shrink-0"),children:T()}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:f.label}),x&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#3B82F6]":"text-blue-500")})]},f.value)})}),jsxRuntime.jsx("div",{className:u("my-2 mx-4 h-px",o?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{let f=!t;r(f),f&&a("all"),l(false);},className:u("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",t&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:u("w-4 h-4 flex-shrink-0",t?o?"text-[#3B82F6]":"text-blue-500":o?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:u("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:c.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:u("w-4 h-4 flex-shrink-0",o?"text-[#3B82F6]":"text-blue-500")})]})})]})]})}var Lx=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function sp(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...sp(r.subtasks,t+1));return a}function ip({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:l=[],customFields:m=[]}){let{theme:i="dark",locale:c="en",customTranslations:d,showSearch:g=true,showHierarchy:f=true,tableColumns:x,allowColumnCustomization:T=true,allowColumnResize:p=true,enableContextMenu:y=true,showCreateTaskButton:h=false,onCreateTask:b,persistFilter:k=false}=t,D=As(c,d),N=i==="dark",E=react.useCallback(()=>{if(!k||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let O=localStorage.getItem(k);if(O){let ae=JSON.parse(O);return {statusFilter:ae.statusFilter||"all",hideCompleted:ae.hideCompleted||!1}}}catch(O){console.error("Error loading persisted filter:",O);}return {statusFilter:"all",hideCompleted:false}},[k]),[w,R]=react.useState("startDate"),[I,C]=react.useState("asc"),[W,H]=react.useState(""),[v,te]=react.useState(()=>E().statusFilter),[oe,ne]=react.useState(()=>E().hideCompleted),[A,ke]=react.useState(x||Lx),[Ie,L]=react.useState(false),[U,S]=react.useState(false),[K,J]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[ie,ue]=react.useState(null),[ye,Oe]=react.useState(0),[ee,Je]=react.useState(0),Me=react.useRef(null);react.useEffect(()=>{x&&ke(x);},[x]),react.useEffect(()=>{if(!(!k||typeof window>"u"))try{localStorage.setItem(k,JSON.stringify({statusFilter:v,hideCompleted:oe}));}catch(O){console.error("Error persisting filter state:",O);}},[k,v,oe]);let rt=react.useMemo(()=>{let O=new Set;function ae(Le){for(let je of Le)je.subtasks?.length&&(je.isExpanded!==false&&O.add(je.id),ae(je.subtasks));}return ae(e),O},[e]),ut=react.useMemo(()=>A.filter(O=>O.visible),[A]),It=react.useCallback(O=>{a.onTaskToggleExpand?.(O);},[a]),Xe=react.useCallback(O=>{w===O?C(ae=>ae==="asc"?"desc":"asc"):(R(O),C("asc")),a.onSortChange?.({column:O,direction:I==="asc"?"desc":"asc"});},[w,I,a]),pt=react.useCallback(O=>{ke(O),a.onColumnsChange?.(O);},[a]),ce=react.useCallback(O=>{let ae=A.map(Le=>Le.id===O?{...Le,visible:false}:Le);pt(ae);},[A,pt]),Ge=react.useCallback((O,ae)=>{R(O),C(ae);},[]),Be=react.useCallback((O,ae,Le)=>{y&&(O.preventDefault(),J({isOpen:true,x:O.clientX,y:O.clientY,type:ae?"task":"header",task:ae,columnId:Le}));},[y]),B=react.useCallback(()=>{J(O=>({...O,isOpen:false}));},[]),X=react.useCallback((O,ae)=>{if(!p)return;O.preventDefault(),O.stopPropagation();let Le=A.find(je=>je.id===ae);Le&&(ue(ae),Oe(O.clientX),Je(Le.width));},[A,p]);react.useEffect(()=>{if(!ie)return;let O=Le=>{let je=Le.clientX-ye,Ye=Math.max(50,ee+je),j=A.map(z=>z.id===ie?{...z,width:Ye}:z);ke(j);},ae=()=>{ie&&a.onColumnsChange?.(A),ue(null);};return document.addEventListener("mousemove",O),document.addEventListener("mouseup",ae),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",ae);}},[ie,ye,ee,A,a]);let fe=react.useCallback(async O=>{if(a.onCreateCustomField){let ae={...O,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ae);}S(false);},[a]),Ae=react.useCallback(O=>O.progress===100||O.status==="completed"?"completed":O.progress&&O.progress>0||O.status==="in-progress"?"in-progress":"todo",[]),Ue=react.useMemo(()=>{let O=sp(e);if(W.trim()){let ae=W.toLowerCase();O=O.filter(Le=>Le.name.toLowerCase().includes(ae));}return v!=="all"&&(O=O.filter(ae=>Ae(ae)===v)),oe&&(O=O.filter(ae=>Ae(ae)!=="completed")),O.sort((ae,Le)=>{let je,Ye;switch(w){case "name":je=ae.name.toLowerCase(),Ye=Le.name.toLowerCase();break;case "startDate":je=ae.startDate?.getTime()||0,Ye=Le.startDate?.getTime()||0;break;case "endDate":je=ae.endDate?.getTime()||0,Ye=Le.endDate?.getTime()||0;break;case "progress":je=ae.progress||0,Ye=Le.progress||0;break;case "status":je=ae.status||"todo",Ye=Le.status||"todo";break;case "priority":let j={urgent:0,high:1,medium:2,low:3,none:4};je=j[ae.priority]??4,Ye=j[Le.priority]??4;break;default:return 0}return je<Ye?I==="asc"?-1:1:je>Ye?I==="asc"?1:-1:0}),O},[e,W,v,oe,w,I,Ae]),nt=react.useCallback((O,ae)=>{let Le=j=>{a.onTaskUpdate?.({...O,...j});},je=j=>j?O.customFields?.find(De=>De.fieldId===j)?.value:void 0,Ye=(j,z)=>{if(!j)return;let bt=[...O.customFields||[]],le=bt.findIndex(He=>He.fieldId===j);le>=0?bt[le]={fieldId:j,value:z}:bt.push({fieldId:j,value:z}),Le({customFields:bt});};switch(ae.type){case "name":return null;case "status":return jsxRuntime.jsx(lu,{value:O.status||(O.progress===100?"completed":O.progress&&O.progress>0?"in-progress":"todo"),onChange:z=>{Le({status:z,progress:z==="completed"?100:z==="in-progress"?50:0});},isDark:N,locale:c,translations:D.status});case "priority":return jsxRuntime.jsx(cu,{value:O.priority,onChange:z=>Le({priority:z}),isDark:N,locale:c});case "assignees":return jsxRuntime.jsx(pu,{value:O.assignees||[],availableUsers:l,onChange:z=>Le({assignees:z}),isDark:N,locale:c});case "startDate":return jsxRuntime.jsx(Os,{value:O.startDate,onChange:z=>Le({startDate:z}),isDark:N,locale:c,dateField:"start",startDate:O.startDate,endDate:O.endDate});case "endDate":return jsxRuntime.jsx(Os,{value:O.endDate,onChange:z=>Le({endDate:z}),isDark:N,locale:c,dateField:"end",startDate:O.startDate,endDate:O.endDate});case "progress":return jsxRuntime.jsx(xu,{value:O.progress||0,onChange:z=>{let De=z===100?"completed":z>0?"in-progress":"todo";Le({progress:z,status:De});},isDark:N});case "tags":return jsxRuntime.jsx(Au,{value:O.tags||[],isDark:N});case "text":return jsxRuntime.jsx(Cu,{value:je(ae.customFieldId)||"",onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "number":return jsxRuntime.jsx(Du,{value:je(ae.customFieldId)||0,onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "date":let j=je(ae.customFieldId);return jsxRuntime.jsx(Os,{value:j?new Date(j):void 0,onChange:z=>Ye(ae.customFieldId,z),isDark:N,locale:c});case "dropdown":return jsxRuntime.jsx(Su,{value:je(ae.customFieldId)||"",options:ae.options||[],onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "checkbox":return jsxRuntime.jsx(Pu,{value:je(ae.customFieldId)||false,onChange:z=>Ye(ae.customFieldId,z),isDark:N});case "estimatedTime":return jsxRuntime.jsx(ko,{value:O.estimatedTime,onChange:z=>Le({estimatedTime:z}),isDark:N,locale:c});case "quotedTime":return jsxRuntime.jsx(ko,{value:O.quotedTime,onChange:z=>Le({quotedTime:z}),isDark:N,locale:c});case "elapsedTime":return jsxRuntime.jsx(ko,{value:O.elapsedTime,onChange:z=>Le({elapsedTime:z}),isDark:N,locale:c});case "effortMinutes":return jsxRuntime.jsx(ko,{value:O.effortMinutes,onChange:z=>Le({effortMinutes:z}),isDark:N,locale:c});case "timeLoggedMinutes":return jsxRuntime.jsx(ko,{value:O.timeLoggedMinutes,onChange:a.onLogTime?z=>{a.onLogTime?.(O,z);}:void 0,isDark:N,locale:c,placeholder:c==="es"?"Agregar":"Add"});case "soldEffortMinutes":return jsxRuntime.jsx(ko,{value:O.soldEffortMinutes,onChange:z=>Le({soldEffortMinutes:z}),isDark:N,locale:c});default:return jsxRuntime.jsx("span",{className:u("text-sm",N?"text-[#94A3B8]":"text-gray-500"),children:"-"})}},[a,N,c,l,D]),Pt=react.useCallback(O=>{let Le={name:D.columns.name,status:D.columns.status,priority:D.columns.priority,assignees:D.columns.assignees,startDate:D.columns.startDate,endDate:D.columns.endDate,progress:D.columns.progress,tags:D.columns.tags||(c==="es"?"Etiquetas":"Tags"),estimatedTime:D.columns.estimatedTime||(c==="es"?"Estimado":"Estimated"),quotedTime:D.columns.quotedTime||(c==="es"?"Ofertado":"Quoted"),elapsedTime:D.columns.elapsedTime||(c==="es"?"Tiempo":"Time Spent"),effortMinutes:D.columns.effortMinutes||(c==="es"?"Estimado":"Estimated"),timeLoggedMinutes:D.columns.timeLoggedMinutes||(c==="es"?"Tiempo":"Time Logged"),soldEffortMinutes:D.columns.soldEffortMinutes||(c==="es"?"Ofertado":"Quoted")}[O.type]||O.label;return typeof Le=="string"?Le:String(Le||O.type)},[D,c]),ze=react.useMemo(()=>ut.reduce((O,ae)=>O+ae.width,0)+(T?48:0),[ut,T]);return r?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",N?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:[D.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",N?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",N?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",N?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",N?"text-white":"text-gray-900"),children:D.empty.noTasks}),jsxRuntime.jsx("p",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:D.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:Me,className:u("flex-1 flex flex-col w-full h-full overflow-hidden",N?"bg-[#0F1117]":"bg-white",ie&&"select-none",s),style:n,children:[jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",N?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx(ap,{value:v,hideCompleted:oe,onChange:te,onHideCompletedChange:ne,isDark:N,locale:c}),jsxRuntime.jsxs("div",{className:u("text-sm",N?"text-[#9CA3AF]":"text-gray-600"),children:[Ue.length," ",D.pagination.tasks]}),g&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",N?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:W,onChange:O=>H(O.target.value),placeholder:D.toolbar.searchPlaceholder,className:u("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",N?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsx("div",{className:"flex-1"}),h&&b&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:b,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:D.toolbar.newTask})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsxs("div",{style:{minWidth:ze},children:[jsxRuntime.jsxs("div",{className:u("flex-shrink-0 flex items-center border-b text-xs font-medium uppercase tracking-wider sticky top-0 z-10",N?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[ut.map(O=>jsxRuntime.jsxs("div",{className:u("relative flex items-center gap-2 px-4 py-3",N?"text-[#9CA3AF]":"text-gray-500"),style:{width:O.width,minWidth:O.minWidth},onContextMenu:ae=>Be(ae,void 0,O.id),children:[O.sortable?jsxRuntime.jsxs("button",{onClick:()=>Xe(O.id),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[Pt(O),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:u("w-3 h-3",w===O.id&&"text-[#3B82F6]")})]}):jsxRuntime.jsx("span",{children:Pt(O)}),p&&O.resizable&&jsxRuntime.jsx("div",{className:u("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#3B82F6]",ie===O.id&&"bg-[#3B82F6]"),onMouseDown:ae=>X(ae,O.id)})]},O.id)),T&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-3",children:[jsxRuntime.jsx("button",{onClick:O=>{O.stopPropagation(),L(ae=>!ae);},className:u("p-1.5 rounded-lg transition-colors",N?"hover:bg-white/10 text-[#9CA3AF] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",Ie&&(N?"bg-white/10":"bg-gray-200")),title:c==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(Yu,{isOpen:Ie,onClose:()=>L(false),columns:A,customFields:m,onColumnsChange:pt,onCreateCustomField:()=>{L(false),S(true);},isDark:N,locale:c})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"popLayout",children:Ue.map((O,ae)=>{let Le=rt.has(O.id),je=Math.min(ae*.01,.2);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:je},className:u("flex items-center border-b transition-colors",N?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),onClick:()=>a.onTaskClick?.(O),onDoubleClick:()=>a.onTaskDoubleClick?.(O),onContextMenu:Ye=>Be(Ye,O),children:[ut.map(Ye=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[52px]",style:{width:Ye.width,minWidth:Ye.minWidth},children:Ye.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[f&&O.level>0&&jsxRuntime.jsx("div",{style:{width:`${O.level*24}px`},className:"flex-shrink-0"}),f&&O.hasChildren&&jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),It(O.id);},className:u("p-0.5 rounded flex-shrink-0",N?"hover:bg-white/10":"hover:bg-gray-200"),children:Le?jsxRuntime.jsx(lucideReact.ChevronDown,{className:u("w-4 h-4",N?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-4 h-4",N?"text-[#9CA3AF]":"text-gray-400")})}),f&&!O.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsx("span",{className:u("truncate font-medium",N?"text-white":"text-gray-900",O.progress===100&&(N?"line-through text-[#6B7280]":"line-through text-gray-400")),children:O.name})]}):nt(O,Ye)},Ye.id)),T&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},O.id)})}),Ue.length===0&&W&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:u("w-12 h-12 mx-auto mb-4",N?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:u(N?"text-[#9CA3AF]":"text-gray-600"),children:D.empty.noResults})]})})]})}),jsxRuntime.jsx(Uu,{state:K,onClose:B,isDark:N,locale:c,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:ce,onColumnSort:Ge,availableUsers:l}),jsxRuntime.jsx(Zu,{isOpen:U,onClose:()=>S(false),onSave:fe,isDark:N,locale:c})]})}var lp=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"assignees",type:"assignees",label:"Assignees",width:150,visible:false,sortable:false,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Time Logged",width:100,visible:false,sortable:true,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true}],dp=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"}],cp=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var Wl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgSelected:"#1f6feb20",bgAlternate:"#0d111780",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff",checkboxBg:"#21262d",checkboxChecked:"#58a6ff"},Gl={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da"},Vl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1"},Hs={dark:Wl,light:Gl,neutral:Vl};function mp(e){return Hs[e]||Hs.dark}var _l={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},jl={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},Ws={en:_l,es:jl};function Dn(e){return Ws[e]||Ws.en}function Gs(e,t){let a=Dn(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function up(e){let t=Dn(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function pp(e,t=0,a=true){let r=Dn(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function yp(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function ql(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function vp({task:e}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-green-500 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-blue-500 flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-3 h-3 text-gray-400 flex-shrink-0"})}function kp({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:l,availableTags:m=[],onCreateTag:i,attachmentsByTask:c,comments:d,onAddComment:g,currentUser:f,mentionableUsers:x,onUploadCommentAttachments:T,onTaskOpen:p,enableTimeTracking:y,timeTrackingSummary:h,timeEntries:b,timerState:k,onLogTime:D,onUpdateEstimate:N,onStartTimer:E,onStopTimer:w,onDiscardTimer:R}){let{theme:I="dark",locale:C="en",customTranslations:W}=t,H=Gs(C,W),v=I==="dark",[te,oe]=react.useState(r||new Date),[ne,A]=react.useState(null),[ke,Ie]=react.useState(null),[L,U]=react.useState({}),S=4,K=3,[J,ie]=react.useState(null),[ue,ye]=react.useState(""),[Oe,ee]=react.useState(void 0),[Je,Me]=react.useState(null),[rt,ut]=react.useState(false),[It,Xe]=react.useState(false),[pt,ce]=react.useState(null),[Ge,Be]=react.useState(false),[B,X]=react.useState(new Date),fe=react.useCallback(()=>{oe(new Date(te.getFullYear(),te.getMonth()-1,1));},[te]),Ae=react.useCallback(()=>{oe(new Date(te.getFullYear(),te.getMonth()+1,1));},[te]),Ue=react.useCallback(()=>{oe(new Date);},[]),nt=react.useMemo(()=>{let O=te.getFullYear(),ae=te.getMonth(),Le=new Date(O,ae,1),je=new Date(O,ae+1,0),Ye=Le.getDay(),j=je.getDate(),z=yp(e),De=new Date;De.setHours(0,0,0,0);let bt=[],le=Ye,He=new Date(O,ae,0).getDate();for(let Re=le-1;Re>=0;Re--){let de=new Date(O,ae-1,He-Re);bt.push({date:de,isCurrentMonth:false,isToday:false,isWeekend:de.getDay()===0||de.getDay()===6,events:z.filter(Ve=>ql(de,Ve)).map(Ve=>({id:Ve.id,title:Ve.name,start:Ve.startDate,end:Ve.endDate,task:Ve}))});}for(let Re=1;Re<=j;Re++){let de=new Date(O,ae,Re),Ve=de.getTime()===De.getTime();bt.push({date:de,isCurrentMonth:true,isToday:Ve,isWeekend:de.getDay()===0||de.getDay()===6,events:z.filter(G=>ql(de,G)).map(G=>({id:G.id,title:G.name,start:G.startDate,end:G.endDate,task:G}))});}let Se=42-bt.length;for(let Re=1;Re<=Se;Re++){let de=new Date(O,ae+1,Re);bt.push({date:de,isCurrentMonth:false,isToday:false,isWeekend:de.getDay()===0||de.getDay()===6,events:z.filter(Ve=>ql(de,Ve)).map(Ve=>({id:Ve.id,title:Ve.name,start:Ve.startDate,end:Ve.endDate,task:Ve}))});}return bt},[te,e]),Pt=C==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ze=te.toLocaleDateString(C==="es"?"es-ES":"en-US",{month:"long",year:"numeric"});return o?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",v?"bg-[#0F1117]":"bg-white",n),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:u("text-sm",v?"text-[#9CA3AF]":"text-gray-600"),children:[H.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",v?"bg-[#0F1117]":"bg-white",n),style:l,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",v?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:u("text-sm",v?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:u("flex-1 flex items-center justify-center",v?"bg-[#0F1117]":"bg-white",n),style:l,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:u("text-lg font-semibold mb-2",v?"text-white":"text-gray-900"),children:H.labels.noEvents}),jsxRuntime.jsx("p",{className:u("text-sm",v?"text-[#9CA3AF]":"text-gray-600"),children:H.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:u("flex-1 flex flex-col w-full h-full overflow-auto",v?"bg-[#0F1117]":"bg-white",n),style:l,children:[jsxRuntime.jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",v?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("h2",{className:u("text-xl font-semibold capitalize",v?"text-white":"text-gray-900"),children:ze}),jsxRuntime.jsx("button",{onClick:Ue,className:u("px-3 py-1.5 text-sm rounded-lg transition-colors",v?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:H.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:fe,className:u("p-2 rounded-lg transition-colors",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:u("w-5 h-5",v?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:Ae,className:u("p-2 rounded-lg transition-colors",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:u("w-5 h-5",v?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 min-h-0",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:Pt.map(O=>jsxRuntime.jsx("div",{className:u("py-2 text-center text-xs font-medium uppercase",v?"text-[#9CA3AF]":"text-gray-500"),children:O},O))}),jsxRuntime.jsx("div",{className:u("grid grid-cols-7 auto-rows-min gap-px rounded-lg",v?"bg-[#2D2D2D]":"bg-gray-300"),children:nt.map((O,ae)=>{let Le=O.date.getDay()===0||O.date.getDay()===6;return jsxRuntime.jsxs("div",{className:u("min-h-[120px] p-2 transition-colors flex flex-col relative group",v?Le?"bg-[#1C1F26]":O.isCurrentMonth?"bg-[#13161B]":"bg-[#0D0F13]":Le?"bg-gray-100":O.isCurrentMonth?"bg-white":"bg-gray-50",O.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let je=L[ae]||S,Ye=O.events.slice(0,je),j=O.events.length-je;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Ye.map(z=>jsxRuntime.jsx("div",{className:"relative group",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{A(z.task),a.onEventClick?.(z),p?.(z.task.id);},whileHover:{scale:1.02},className:u("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",z.task.progress===100?v?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":v?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(vp,{task:z.task}),jsxRuntime.jsx("span",{className:"truncate",children:z.title})]})},z.id)),j>0&&jsxRuntime.jsxs("button",{onClick:z=>{z.stopPropagation(),U(De=>({...De,[ae]:je+K}));},className:u("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",v?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",j," ",C==="es"?"M\xC1S":"MORE"]}),je>S&&O.events.length>S&&jsxRuntime.jsx("button",{onClick:z=>{z.stopPropagation(),U(De=>({...De,[ae]:S}));},className:u("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",v?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:C==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1",children:[(()=>{let je=ae>=28,Ye=ae%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),J===ae?ie(null):(ie(ae),ye(""),ee(void 0),Me(null),ce(null),ut(false),Xe(false),Be(false),X(O.date));},className:u("w-5 h-5 rounded flex items-center justify-center transition-all",J===ae?"opacity-100 bg-[#7C3AED] text-white":"opacity-0 group-hover:opacity-100",v?"hover:bg-[#7C3AED] text-[#6B7280] hover:text-white":"hover:bg-[#7C3AED] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:u("w-3.5 h-3.5 transition-transform",J===ae&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:J===ae&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{ie(null),ye(""),ee(void 0),Me(null),ce(null),ut(false),Xe(false),Be(false);}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:je?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:je?-5:5,scale:.95},transition:{duration:.12},className:u("absolute w-[320px] rounded-lg shadow-2xl z-50",je?"bottom-full mb-1":"top-full mt-1",Ye?"right-0":"left-0",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>{j.stopPropagation(),ut(false),Xe(false),Be(false);},children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{type:"text",value:ue,onChange:j=>ye(j.target.value),placeholder:C==="es"?'Escribe el nombre de la tarea o "/" para los comandos':'Type task name or "/" for commands',className:u("w-full bg-transparent text-sm outline-none placeholder:opacity-40",v?"text-white":"text-gray-900"),autoFocus:true,onKeyDown:j=>{if(j.key==="Enter"&&ue.trim()){let z=t.availableUsers?.find(bt=>bt.id===Je),De=pt||O.date;a.onTaskCreate?.({name:ue.trim(),startDate:De,endDate:De,priority:Oe,assignees:z?[z]:void 0}),ye(""),ee(void 0),Me(null),ce(null),ie(null);}j.key==="Escape"&&(ie(null),ye(""),ee(void 0),Me(null),ce(null));}})}),jsxRuntime.jsxs("div",{className:u("px-2.5 py-2 flex items-center justify-between border-t",v?"border-white/10":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),ut(!rt),Xe(false);},className:u("p-1 rounded transition-colors",Oe?Oe==="urgent"||Oe==="high"?"text-red-400 bg-red-500/20":Oe==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":v?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:rt&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:u("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>j.stopPropagation(),children:[{id:"urgent",label:C==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:C==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:C==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:C==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:C==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(j=>jsxRuntime.jsxs("button",{onClick:()=>{ee(j.id),ut(false);},className:u("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",v?"hover:bg-white/5":"hover:bg-gray-50",Oe===j.id&&(v?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:u("w-2 h-2 rounded-full",j.color)}),jsxRuntime.jsx("span",{className:v?"text-white":"text-gray-900",children:j.label})]},j.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:j=>{j.stopPropagation(),Be(!Ge),ut(false),Xe(false),X(pt||O.date);},className:u("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors",pt?"bg-[#7C3AED]/20 text-[#7C3AED]":v?"bg-white/5 text-[#9CA3AF] hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),(pt||O.date).toLocaleDateString(C==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ge&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:u("absolute left-0 bottom-full mb-1 z-[60] rounded-xl shadow-2xl overflow-hidden flex",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>j.stopPropagation(),children:[jsxRuntime.jsx("div",{className:u("w-40 py-2 border-r",v?"border-white/10":"border-gray-200"),children:(()=>{let j=new Date,z=new Date(j);z.setDate(j.getDate()+1);let De=new Date(j);De.setDate(j.getDate()+((6-j.getDay()+7)%7||7));let bt=new Date(j);bt.setDate(j.getDate()+((1-j.getDay()+7)%7||7));let le=new Date(j);le.setDate(j.getDate()+14);let He=new Date(j);return He.setDate(j.getDate()+28),[{label:C==="es"?"Hoy":"Today",date:j,display:j.toLocaleDateString(C==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:C==="es"?"Ma\xF1ana":"Tomorrow",date:z,display:z.toLocaleDateString(C==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:C==="es"?"Este fin de semana":"This weekend",date:De,display:C==="es"?"s\xE1b.":"sat."},{label:C==="es"?"Pr\xF3xima semana":"Next week",date:bt,display:C==="es"?"lun.":"mon."},{label:C==="es"?"2 semanas":"2 weeks",date:le,display:le.toLocaleDateString(C==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:C==="es"?"4 semanas":"4 weeks",date:He,display:He.toLocaleDateString(C==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Re,de)=>jsxRuntime.jsxs("button",{className:u("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",v?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{ce(Re.date),Be(false);},children:[jsxRuntime.jsx("span",{children:Re.label}),jsxRuntime.jsx("span",{className:u("text-[10px]",v?"text-[#6B7280]":"text-gray-400"),children:Re.display})]},de))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:u("text-xs font-medium",v?"text-white":"text-gray-900"),children:B.toLocaleDateString(C==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>X(new Date),className:u("px-1.5 py-0.5 rounded text-[10px] transition-colors",v?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:C==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>X(new Date(B.getFullYear(),B.getMonth()-1)),className:u("p-0.5 rounded",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:()=>X(new Date(B.getFullYear(),B.getMonth()+1)),className:u("p-0.5 rounded",v?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(C==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(j=>jsxRuntime.jsx("div",{className:u("w-6 h-6 flex items-center justify-center text-[10px]",v?"text-[#6B7280]":"text-gray-400"),children:j},j))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let j=B.getFullYear(),z=B.getMonth(),De=new Date(j,z,1).getDay(),bt=new Date(j,z+1,0).getDate(),le=new Date(j,z,0).getDate(),He=new Date,Se=[];for(let de=De-1;de>=0;de--)Se.push({dayNum:le-de,isCurrentMonth:false,date:new Date(j,z-1,le-de)});for(let de=1;de<=bt;de++)Se.push({dayNum:de,isCurrentMonth:true,date:new Date(j,z,de)});let Re=42-Se.length;for(let de=1;de<=Re;de++)Se.push({dayNum:de,isCurrentMonth:false,date:new Date(j,z+1,de)});return Se.map((de,Ve)=>{let G=de.date.toDateString()===He.toDateString(),Y=(pt||O.date).toDateString()===de.date.toDateString();return jsxRuntime.jsx("button",{className:u("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",!de.isCurrentMonth&&(v?"text-[#4B5563]":"text-gray-300"),de.isCurrentMonth&&(v?"text-white":"text-gray-900"),G&&"ring-1 ring-[#3B82F6]",Y&&"bg-[#7C3AED] text-white",!Y&&(v?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{ce(de.date),Be(false);},children:de.dayNum},Ve)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:j=>{j.stopPropagation(),Xe(!It),ut(false);},className:u("p-1 rounded transition-colors",Je?"text-[#7C3AED] bg-[#7C3AED]/20":v?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:Je?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-medium",style:{backgroundColor:t.availableUsers?.find(j=>j.id===Je)?.color||"#7C3AED"},children:t.availableUsers?.find(j=>j.id===Je)?.initials||t.availableUsers?.find(j=>j.id===Je)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:It&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:u("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",v?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:j=>j.stopPropagation(),children:[jsxRuntime.jsxs("button",{onClick:()=>{Me(null),Xe(false);},className:u("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",v?"hover:bg-white/5":"hover:bg-gray-50",!Je&&(v?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:u("w-5 h-5 rounded-full flex items-center justify-center",v?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:v?"text-[#9CA3AF]":"text-gray-500",children:C==="es"?"Sin asignar":"Unassigned"})]}),t.availableUsers?.map(j=>jsxRuntime.jsxs("button",{onClick:()=>{Me(j.id),Xe(false);},className:u("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",v?"hover:bg-white/5":"hover:bg-gray-50",Je===j.id&&(v?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-medium",style:{backgroundColor:j.color||"#7C3AED"},children:j.initials||j.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:v?"text-white":"text-gray-900",children:j.name})]},j.id)),(!t.availableUsers||t.availableUsers.length===0)&&jsxRuntime.jsx("div",{className:u("px-3 py-2 text-xs",v?"text-[#6B7280]":"text-gray-400"),children:C==="es"?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>{if(ue.trim()){let j=t.availableUsers?.find(De=>De.id===Je),z=pt||O.date;a.onTaskCreate?.({name:ue.trim(),startDate:z,endDate:z,priority:Oe,assignees:j?[j]:void 0}),ye(""),ee(void 0),Me(null),ce(null),ie(null);}},disabled:!ue.trim(),className:u("px-2.5 py-1 rounded text-xs font-medium transition-colors",ue.trim()?"bg-[#7C3AED] hover:bg-[#6D28D9] text-white":v?"bg-white/5 text-[#4B5563]":"bg-gray-100 text-gray-400"),children:C==="es"?"Guardar":"Save"})]})]})]})})]})})(),jsxRuntime.jsx("span",{className:u("text-sm font-medium",O.isToday?"text-[#3B82F6]":O.isCurrentMonth?v?"text-white":"text-gray-900":v?"text-[#6B7280]":"text-gray-400"),children:O.date.getDate()})]})]},ae)})})]})}),jsxRuntime.jsx(Mr,{task:ne,isOpen:!!ne,onClose:()=>A(null),onTaskUpdate:O=>{a.onTaskUpdate?.(O),A(O);},theme:I==="dark"?"dark":"light",locale:C,availableUsers:t.availableUsers?.map(O=>({id:O.id,name:O.name,avatar:O.avatar,initials:O.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:m,onCreateTag:i,attachments:ne?c?.get(ne.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:yp(e).filter(O=>O.id!==ne?.id),comments:d?.filter(O=>O.taskId===ne?.id).map(O=>({...O,createdAt:O.createdAt instanceof Date?O.createdAt:new Date(O.createdAt),updatedAt:O.updatedAt instanceof Date?O.updatedAt:O.updatedAt?new Date(O.updatedAt):void 0})),onAddComment:g,currentUser:f,mentionableUsers:x,onUploadCommentAttachments:T,enableTimeTracking:y,timeTrackingSummary:h,timeEntries:b,isTimerRunning:k?.isRunning,timerElapsedSeconds:k?.elapsedSeconds,onTimeLog:D,onEstimateUpdate:N,onTimerStart:E,onTimerStop:w,onTimerDiscard:R}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ke&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Ie(null),className:"fixed inset-0 bg-black/30 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:u("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",v?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:u("px-4 py-3 border-b flex items-center justify-between",v?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:u("font-medium",v?"text-white":"text-gray-900"),children:ke.date.toLocaleDateString(C==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>Ie(null),className:u("p-1 rounded",v?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-2",children:ke.events.map(O=>jsxRuntime.jsxs("button",{onClick:()=>{Ie(null),A(O.task),p?.(O.task.id);},className:u("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",v?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(vp,{task:O.task}),jsxRuntime.jsx("span",{className:u("text-sm truncate flex-1",v?"text-white":"text-gray-900"),children:O.title}),O.task.priority==="high"||O.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},O.id))})]})]})})]})}var Yl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgToday:"#1f6feb20",bgWeekend:"#161b2280",bgOtherMonth:"#0d111750",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",textToday:"#58a6ff",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff"},Xl={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da"},Jl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1"},Vs={dark:Yl,light:Xl,neutral:Jl};function wp(e){return Vs[e]||Vs.dark}function Gx({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:l}){let[m,i]=react.useState(false),c=react.useMemo(()=>t.filter(f=>e.cardIds.includes(f.id)),[t,e.cardIds]),d=react.useMemo(()=>{let f=c.length,x=new Set(c.flatMap(y=>y.assignedUserIds||[])).size,T=c.map(y=>y.priority).filter(Boolean),p=new Set(c.flatMap(y=>y.labels||[])).size;return {totalCards:f,uniqueAssignees:x,priorities:T,labels:p}},[c]),g=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:u("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:g,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:u("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"]})]}),m&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:f=>{f.stopPropagation(),n?.(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:c.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:c.map(f=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(f),children:a(f)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(f),children:[jsxRuntime.jsx("h4",{children:f.title}),f.description&&jsxRuntime.jsxs("p",{children:[f.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:x=>{x.stopPropagation(),s?.(e.id,f.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"})]})})]},f.id))})})]})}var Tp={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function En(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 Pn(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 Np(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 Dp({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:l}){let m=react.useMemo(()=>({...Tp,...n}),[n]),[i,c]=react.useState(new Set),d=react.useRef(null),g=react.useMemo(()=>{if(!m.groupByDay)return [{date:null,events:e}];let h=new Map;return e.forEach(b=>{let k=b.timestamp.toISOString().split("T")[0],D=h.get(k);D?D.push(b):h.set(k,[b]);}),Array.from(h.entries()).sort((b,k)=>k[0].localeCompare(b[0])).map(([b,k])=>({date:new Date(b),events:k.sort((D,N)=>N.timestamp.getTime()-D.timestamp.getTime())}))},[e,m.groupByDay]),{uniqueUsers:f,uniqueTypes:x}=react.useMemo(()=>{let h=new Set,b=new Set;return e.forEach(k=>{h.add(k.userId),b.add(k.type);}),{uniqueUsers:Array.from(h),uniqueTypes:Array.from(b)}},[e]),T=h=>{c(b=>{let k=new Set(b);return k.has(h)?k.delete(h):k.add(h),k});},p=h=>{let k=new Date().getTime()-h.getTime(),D=Math.floor(k/6e4),N=Math.floor(k/36e5),E=Math.floor(k/864e5);return D<1?"just now":D<60?`${D}m ago`:N<24?`${N}h ago`:E<7?`${E}d ago`:h.toLocaleDateString()},y=react.useMemo(()=>{let h=0;return t.types&&t.types.length>0&&h++,t.users&&t.users.length>0&&h++,t.dateRange&&h++,t.searchTerm&&h++,h},[t]);return react.useEffect(()=>{if(s&&d.current){let h=d.current.querySelector(`[data-event-id="${s}"]`);h&&h.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:u("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:u("history-timeline",m.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:h=>{let b=h.target.value;a({...t,types:b?[b]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),x.map(h=>jsxRuntime.jsxs("option",{value:h,children:[Pn(h)," ",h.replace("_"," ")]},h))]}),f.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:h=>{let b=h.target.value;a({...t,users:b?[b]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),f.map(h=>jsxRuntime.jsx("option",{value:h,children:h},h))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:h=>a({...t,searchTerm:h.target.value})})]}),y>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",y,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:d,children:g.map(h=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[m.groupByDay&&h.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:h.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[h.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:h.events.map((b,k)=>{let D=i.has(b.id),N=s===b.id,E=Np(b.type);return jsxRuntime.jsxs("div",{"data-event-id":b.id,className:u("history-timeline-event",D&&"expanded",N&&"selected"),onClick:()=>o?.(b),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:E},children:m.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:Pn(b.type)})}),k<h.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:E}})]}),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:[m.showAvatars&&b.userAvatar&&jsxRuntime.jsx("img",{src:b.userAvatar,alt:b.userName||b.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:b.userName||b.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:En(b)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:m.useRelativeTime?p(b.timestamp):b.timestamp.toLocaleString()})]}),Object.keys(b.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:w=>{w.stopPropagation(),T(b.id);},children:[D?"\u25BC":"\u25B6"," Show changes"]}),D&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(b.changes).map(([w,R])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[w,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(R.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(R.to)})]})]},w)),b.metadata&&Object.keys(b.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(b.metadata).map(([w,R])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[w,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(R)})]},w))]})]})]})]},b.id)})})]},h.date?.toISOString()||"all"))})]})}function Ep({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:l,onSpeedChange:m,className:i}){let c=[.5,1,1.5,2,3],d=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),g=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:u("history-replay-empty",i),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:u("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:d&&Pn(d.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:d&&En(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:f=>l(parseInt(f.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${g}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((f,x)=>jsxRuntime.jsx("div",{className:u("history-replay-progress-marker",x===e.currentIndex&&"active"),style:{left:`${x/(e.totalEvents-1)*100}%`},onClick:()=>l(x),title:En(f)},f.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,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:o,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:n,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:c.map(f=>jsxRuntime.jsxs("button",{className:u("history-replay-speed-btn",e.speed===f&&"active"),onClick:()=>m(f),children:[f,"x"]},f))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,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(f=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:f},f))})]})]})]})]}):jsxRuntime.jsxs("div",{className:u("history-replay-start",i),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,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 Zl(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 Ql(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 Pp(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 Mp(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Yx(e,t,a,r,o,s=100){let n=e.map(m=>({...m,x:m.x??a/2+Math.random()*100-50,y:m.y??r/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(n.map(m=>[m.id,m]));for(let m=0;m<s;m++){let i=1-m/s;n.forEach(c=>{let d=a/2,g=r/2;c.vx+=(d-c.x)*o.centerForce*i,c.vy+=(g-c.y)*o.centerForce*i,n.forEach(f=>{if(c.id===f.id)return;let x=c.x-f.x,T=c.y-f.y,p=Math.sqrt(x*x+T*T)||1,y=o.chargeStrength*i/(p*p);c.vx+=x/p*y,c.vy+=T/p*y;});}),t.forEach(c=>{let d=l.get(typeof c.source=="string"?c.source:c.source.id),g=l.get(typeof c.target=="string"?c.target:c.target.id);if(!d||!g)return;let f=g.x-d.x,x=g.y-d.y,T=Math.sqrt(f*f+x*x)||1,p=(T-o.linkDistance)/T*o.forceStrength*i;d.vx+=f*p,d.vy+=x*p,g.vx-=f*p,g.vy-=x*p;}),n.forEach(c=>{c.fx!==null&&c.fx!==void 0?(c.x=c.fx,c.vx=0):c.x+=c.vx,c.fy!==null&&c.fy!==void 0?(c.y=c.fy,c.vy=0):c.y+=c.vy,c.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,c.x)),c.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,c.y)),c.vx*=.9,c.vy*=.9;});}return n}function Fp({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:l,className:m}){let i=react.useRef(null),[c,d]=react.useState([]),[g,f]=react.useState(null),[x,T]=react.useState(null),[p,y]=react.useState(null),[h,b]=react.useState(1),[k,D]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let H=Yx(e,t,a.width,a.height,a,150);d(H);},[e,t,a]);let N=react.useCallback((H,v)=>{a.enableDragging&&(v.stopPropagation(),f(H));},[a.enableDragging]),E=react.useCallback(H=>{if(!g||!i.current)return;let te=i.current.getBoundingClientRect(),oe=(H.clientX-te.left-k.x)/h,ne=(H.clientY-te.top-k.y)/h;d(A=>A.map(ke=>ke.id===g?{...ke,x:oe,y:ne,fx:oe,fy:ne}:ke));},[g,h,k]),w=react.useCallback(()=>{f(null);},[]),R=react.useCallback((H,v)=>{v.stopPropagation(),l?.({type:"node-click",node:H,position:{x:v.clientX,y:v.clientY}});},[l]),I=react.useCallback((H,v)=>{v.stopPropagation(),l?.({type:"edge-click",edge:H,position:{x:v.clientX,y:v.clientY}});},[l]),C=react.useCallback(H=>{let v=c.find(te=>te.id===H);return v?{x:v.x,y:v.y}:{x:0,y:0}},[c]),W=react.useCallback(H=>{if(H.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return H.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let v=H.card.priority;return v==="URGENT"?"#ef4444":v==="HIGH"?"#f59e0b":v==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return H.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:u("relationships-graph-empty",m),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:u("relationships-graph",m),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:n.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:n.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>b(H=>Math.min(H+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(h*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>b(H=>Math.max(H-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{b(1),D({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(H=>H.type))).map(H=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Zl(H)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Pp(H)," ",Ql(H)]})]},H))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:E,onMouseUp:w,onMouseLeave:w,children:[jsxRuntime.jsxs("g",{transform:`translate(${k.x}, ${k.y}) scale(${h})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map(H=>{let v=C(typeof H.source=="string"?H.source:H.source.id),te=C(typeof H.target=="string"?H.target:H.target.id),oe=Mp(H.type),ne=p===H.id,A=H.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-edge",ne&&"hovered",A&&"critical"),onMouseEnter:()=>y(H.id),onMouseLeave:()=>y(null),onClick:ke=>I(H,ke),children:[jsxRuntime.jsx("line",{x1:v.x,y1:v.y,x2:te.x,y2:te.y,stroke:Zl(H.type),strokeWidth:A?a.edgeWidth*2:a.edgeWidth,strokeOpacity:ne?1:.6,markerEnd:oe?"url(#arrowhead)":void 0}),a.showEdgeLabels&&ne&&jsxRuntime.jsx("text",{x:(v.x+te.x)/2,y:(v.y+te.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Ql(H.type)})]},H.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:c.map(H=>{let v=x===H.id,te=H.onCriticalPath;return jsxRuntime.jsxs("g",{className:u("relationships-graph-node",v&&"hovered",te&&"critical"),transform:`translate(${H.x}, ${H.y})`,onMouseDown:oe=>N(H.id,oe),onMouseEnter:()=>T(H.id),onMouseLeave:()=>T(null),onClick:oe=>R(H,oe),children:[jsxRuntime.jsx("circle",{r:te?a.nodeSize*1.2:a.nodeSize,fill:W(H),stroke:te?"#fbbf24":"#ffffff",strokeWidth:te?3:2,opacity:v?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:H.card.title.length>20?H.card.title.substring(0,20)+"...":H.card.title})]},H.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 Ip({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[l,m]=react.useState(false),[i,c]=react.useState(null),[d,g]=react.useState(null),f=react.useRef(null),x=l||o;react.useEffect(()=>{e&&f.current&&f.current.focus();},[e]),react.useEffect(()=>{let h=b=>{b.key==="Escape"&&!x&&T();};if(e)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,x]);let T=()=>{x||(n(""),c(null),g(null),t());},p=async()=>{if(!(!s.trim()||x)){m(true),c(null),g(null);try{let h=await r(s.trim());g(h);}catch(h){c(h instanceof Error?h.message:"Failed to generate plan");}finally{m(false);}}},y=()=>{d&&(a(d),T());};return e?jsxRuntime.jsxs(yt,{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-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:h=>h.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:T,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((h,b)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:h.title},b))})]}),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((h,b)=>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:h.title}),h.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:h.description})]}),h.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${h.priority==="URGENT"?"bg-red-500/20 text-red-400":h.priority==="HIGH"?"bg-orange-500/20 text-orange-400":h.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:h.priority})]})},b)),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:f,value:s,onChange:h=>n(h.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."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),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((h,b)=>jsxRuntime.jsx("button",{onClick:()=>n(h),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:h},b))})]})]})}),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:T,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:y,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:p,disabled:!s.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 ed={"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 Jx={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Zx={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 Qx(e,t,a){let r=ed[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Mn(e){return `$${e.toFixed(4)}`}var td=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Qx(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let r=a.length,o=a.reduce((d,g)=>d+g.cost,0),s=a.reduce((d,g)=>d+g.inputTokens,0),n=a.reduce((d,g)=>d+g.outputTokens,0),l=a.filter(d=>d.success),m=a.reduce((d,g)=>d+g.duration,0),i={},c={};return a.forEach(d=>{i[d.feature]=(i[d.feature]||0)+1,c[d.feature]=(c[d.feature]||0)+d.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:c,averageDuration:r>0?m/r:0,successRate:r>0?l.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let l=this.operations.filter(c=>c.timestamp>=n).length,m=Math.max(0,o-l),i=l/o*100;return {used:l,limit:o,remaining:m,percentUsed:i,isExceeded:l>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},To=new td;function Op({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(To.getStats()),[s,n]=react.useState(To.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let m=setInterval(()=>{o(To.getStats()),n(To.checkLimit(a));},1e3);return ()=>clearInterval(m)},[e,a]),react.useEffect(()=>{let m=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),!e)return null;let l=To.getRecentOperations(5);return jsxRuntime.jsxs(yt,{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:m=>m.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 (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.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,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.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:Mn(r.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:r.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:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.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:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.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(r.operationsByFeature).map(([m,i])=>{let c=r.costsByFeature[m]||0,d=r.totalOperations>0?i/r.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:m.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:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Mn(c)})]})]}),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}%`}})})]},m)})})]}),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(m=>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:m.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(m.timestamp).toLocaleTimeString()," \u2022"," ",m.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[m.inputTokens+m.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:Mn(m.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${m.success?"bg-green-400":"bg-red-400"}`})]})]},m.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 Up({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,l]=react.useState(""),[m,i]=react.useState(""),[c,d]=react.useState(""),[g,f]=react.useState(false),[x,T]=react.useState(null),[p,y]=react.useState(null),[h,b]=react.useState(null),k=react.useRef(null),D=g||o;react.useEffect(()=>{e&&k.current&&k.current.focus();},[e]),react.useEffect(()=>{let I=C=>{C.key==="Escape"&&!D&&N();};if(e)return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,D]);let N=()=>{D||(l(""),i(""),d(""),T(null),y(null),b(null),t());},E=async()=>{if(!(!n.trim()||D)){f(true),T(null),y(null),b(null);try{let I=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:m||void 0,endDate:c||void 0});y(I.tasks.tasks),b({from_cache:I.from_cache,tokens_used:I.tokens_used,mock_mode:I.mock_mode,similarity:I.similarity,tokens_saved:I.tokens_saved});}catch(I){T(I instanceof Error?I.message:"Failed to generate tasks");}finally{f(false);}}},w=()=>{p&&(a(p),N());};if(!e)return null;let R=h?.similarity?((h.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(yt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:N}),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:I=>I.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:N,disabled:D,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:p?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:[h?.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"}),h?.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 (",R,"% 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:[h?.tokens_used||0," tokens"]}),h?.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:[h.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:[p.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:p.map((I,C)=>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:["#",C+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:I.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"})]}),I.start," \u2192 ",I.end]}),jsxRuntime.jsxs("span",{children:[I.duration," days"]}),I.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",I.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${I.priority==="high"?"bg-red-500/20 text-red-400":I.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:I.priority})]})},I.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:n,onChange:I=>l(I.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:D}),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:m,onChange:I=>i(I.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:D})]}),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:c,onChange:I=>d(I.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:D})]})]}),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((I,C)=>jsxRuntime.jsx("button",{onClick:()=>l(I),disabled:D,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:I},C))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:D&&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:N,disabled:D,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"}),p?jsxRuntime.jsx("button",{onClick:w,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:E,disabled:!n.trim()||D,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:D?"Generating...":"Generate Tasks"})]})]})]})})]})}function Ks({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(p=>{t&&Un(()=>Promise.resolve(t(p)),{maxAttempts:3,initialDelay:1e3,onRetry:(y,h,b)=>{console.warn(`Retry attempt ${h} after ${b}ms: ${y.message}`);}}).then(y=>{y.success||console.error(`Failed to persist board after ${y.attempts} attempts:`,y.error);});},[t]),s=react.useCallback(async(p,y,h)=>{r(b=>{let k=b.cards.find(I=>I.id===p);if(!k)return b;let D=k.columnId,N={...k,columnId:y,position:h},E=b.cards.map(I=>I.id===p?N:I),w=b.columns.map(I=>{if(I.id===D)return {...I,cardIds:I.cardIds.filter(C=>C!==p)};if(I.id===y){let C=E.filter(W=>W.columnId===y).sort((W,H)=>W.position-H.position);return {...I,cardIds:C.map(W=>W.id)}}return I}),R={...b,cards:E,columns:w};return o(R),R});},[o]),n=react.useCallback(async(p,y)=>{r(h=>{let b=h.cards.map(D=>D.id===p?{...D,...y}:D),k={...h,cards:b};return o(k),k});},[o]),l=react.useCallback(async p=>{let y=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let b={...p,id:y},k=h.columns.map(N=>N.id===p.columnId?{...N,cardIds:[...N.cardIds,y]}:N),D={...h,cards:[...h.cards,b],columns:k};return o(D),D});},[o]),m=react.useCallback(async p=>{r(y=>{let h=y.cards.find(N=>N.id===p);if(!h)return y;let b=y.cards.filter(N=>N.id!==p),k=y.columns.map(N=>N.id===h.columnId?{...N,cardIds:N.cardIds.filter(E=>E!==p)}:N),D={...y,cards:b,columns:k};return o(D),D});},[o]),i=react.useCallback(async p=>{let y=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(h=>{let b={...p,id:y,cardIds:[]},k={...h,columns:[...h.columns,b]};return o(k),k});},[o]),c=react.useCallback(async(p,y)=>{r(h=>{let b=h.columns.map(D=>D.id===p?{...D,...y}:D),k={...h,columns:b};return o(k),k});},[o]),d=react.useCallback(async p=>{r(y=>{let h=y.cards.filter(D=>D.columnId!==p),b=y.columns.filter(D=>D.id!==p),k={...y,cards:h,columns:b};return o(k),k});},[o]),g=react.useCallback(p=>{let y=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(p),y},[l]),f=react.useCallback(p=>{let y=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(p),y},[i]),x=react.useCallback(()=>{r(p=>{let y={...p,cards:[],columns:[]};return o(y),y});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:l,onCardDelete:m,onColumnCreate:i,onColumnUpdate:c,onColumnDelete:d},setBoard:r,helpers:{addCard:g,addColumn:f,deleteCard:m,deleteColumn:d,clearBoard:x}}}function Wp({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=Ks({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(m,i,c={})=>{s.addCard({title:i,columnId:m,position:r.cards.filter(d=>d.columnId===m).length,...c});},addColumn:(m,i)=>{let c=r.columns.length>0?Math.max(...r.columns.map(d=>d.position)):0;s.addColumn({title:m,position:i??c+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var Fn={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},Vp={by:"none",order:"asc"};function _p({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...Fn,...e}),[s,n]=react.useState({...Vp,...t}),l=react.useCallback(T=>{o(p=>({...p,...T}));},[]),m=react.useCallback(T=>{n(p=>({...p,...T}));},[]),i=react.useCallback(()=>{o(Fn),n(Vp);},[]),c=react.useCallback(()=>{a&&o({...Fn,assignees:[a]});},[a]),d=react.useCallback(()=>{o({...Fn,dateFilter:"overdue"});},[]),g=react.useCallback(()=>{o({...Fn,priorities:["HIGH","URGENT"]});},[]),f=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),x=react.useCallback(T=>{let p=[...T];if(r.search){let y=r.search.toLowerCase();p=p.filter(h=>h.title.toLowerCase().includes(y)||h.description?.toLowerCase().includes(y));}if(r.dateFilter!=="all"){let y=new Date,h=y.getFullYear(),b=String(y.getMonth()+1).padStart(2,"0"),k=String(y.getDate()).padStart(2,"0"),D=`${h}-${b}-${k}`;p=p.filter(N=>{if(!N.endDate&&!N.dueDate)return false;let E=N.endDate||N.dueDate;if(!E)return false;let w;if(typeof E=="string")w=E.split("T")[0]||E;else {let R=E.getUTCFullYear(),I=String(E.getUTCMonth()+1).padStart(2,"0"),C=String(E.getUTCDate()).padStart(2,"0");w=`${R}-${I}-${C}`;}switch(r.dateFilter){case "overdue":return w<D;case "today":return w===D;case "this-week":let R=new Date(D+"T00:00:00"),I=new Date(w+"T00:00:00"),C=new Date(R);return C.setDate(C.getDate()+7),I>=R&&I<=C;case "custom":if(r.dateRange){let W=typeof E=="string"?new Date(E):E;return W>=r.dateRange.start&&W<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(p=p.filter(y=>y.priority&&r.priorities.includes(y.priority))),r.assignees.length>0&&(p=p.filter(y=>(y.assignedUserIds||(y.assigneeId?[y.assigneeId]:[])).some(b=>r.assignees.includes(b)))),r.labels.length>0&&(p=p.filter(y=>y.labels&&y.labels.some(h=>r.labels.includes(h)))),r.columns.length>0&&(p=p.filter(y=>r.columns.includes(y.columnId))),s.by!=="none"&&p.sort((y,h)=>{let b=0;switch(s.by){case "created":let k=y.createdAt?new Date(y.createdAt).getTime():0,D=h.createdAt?new Date(h.createdAt).getTime():0;b=k-D;break;case "priority":let N={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},E=N[y.priority||"LOW"],w=N[h.priority||"LOW"];b=E-w;break;case "dueDate":let R=y.endDate||y.dueDate,I=h.endDate||h.dueDate;if(!R)return 1;if(!I)return -1;let C=typeof R=="string"?new Date(R).getTime():R.getTime(),W=typeof I=="string"?new Date(I).getTime():I.getTime();b=C-W;break;case "title":b=y.title.localeCompare(h.title);break;case "estimate":let H=y.estimatedTime||0,v=h.estimatedTime||0;b=H-v;break;default:b=0;}return s.order==="asc"?b:-b}),p},[r,s]);return {filters:r,sort:s,setFilters:l,setSort:m,resetFilters:i,filterMyTasks:c,filterOverdue:d,filterHighPriority:g,applyFilters:x,hasActiveFilters:f}}var Kp,qp;if(typeof window<"u")try{let e=On("ai");Kp=e.generateObject,qp=e.generateText;}catch{}function Yp(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Kp&&qp&&e.apiKey),n=react.useCallback(async d=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(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(g){let f=g instanceof Error?g:new Error("Failed to generate plan");throw o(f),f}finally{a(false);}},[s]),l=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(g){let f=g instanceof Error?g:new Error("Failed to suggest assignee");throw o(f),f}finally{a(false);}},[s]),m=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(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(g){let f=g instanceof Error?g:new Error("Failed to predict risks");throw o(f),f}finally{a(false);}},[s]),i=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(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(g){let f=g instanceof Error?g:new Error("Failed to generate subtasks");throw o(f),f}finally{a(false);}},[s]),c=react.useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(g){let f=g instanceof Error?g:new Error("Failed to estimate effort");throw o(f),f}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:l,onPredictRisks:m,onGenerateSubtasks:i,onEstimateEffort:c,isAvailable:s,isLoading:t,error:r}}function rd(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function Xp(e){let{cards:t}=e,[a,r]=rd(),o=react.useCallback(d=>a.selectedCardIds.includes(d),[a.selectedCardIds]),s=react.useCallback((d,g)=>{if(!g){r({selectedCardIds:[d],lastSelectedCardId:d});return}let f=g.ctrlKey||g.metaKey,x=g.shiftKey;if(f)a.selectedCardIds.includes(d)?r({selectedCardIds:a.selectedCardIds.filter(T=>T!==d),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});else if(x&&a.lastSelectedCardId){let T=t.find(y=>y.id===d),p=t.find(y=>y.id===a.lastSelectedCardId);if(T&&p&&T.columnId===p.columnId){let y=t.filter(w=>w.columnId===T.columnId).sort((w,R)=>w.position-R.position),h=y.findIndex(w=>w.id===a.lastSelectedCardId),b=y.findIndex(w=>w.id===d),[k,D]=h<b?[h,b]:[b,h],N=y.slice(k,D+1).map(w=>w.id),E=Array.from(new Set([...a.selectedCardIds,...N]));r({selectedCardIds:E,lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});},[t,a,r]),n=react.useCallback(d=>{r({selectedCardIds:a.selectedCardIds.filter(g=>g!==d),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),l=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),m=react.useCallback(()=>{r({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(d=>{a.selectedCardIds.includes(d)?n(d):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});},[a,n,r]),c=react.useCallback(()=>t.filter(d=>a.selectedCardIds.includes(d.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:l,selectAll:m,toggleCard:i,getSelectedCards:c}}var Jp={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Zp(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...Jp,...a}),[a]),[s,n]=react.useState([]),l=react.useCallback((T,p,y,h,b)=>{if(p.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let k={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:T,cardIds:p,columnId:y,strategy:h,color:b,isExpanded:true,position:s.filter(D=>D.columnId===y).length,createdAt:new Date};n(D=>[...D,k]);},[o.minCardsPerStack,s]),m=react.useCallback(T=>{n(p=>p.filter(y=>y.id!==T));},[]),i=react.useCallback(T=>{n(p=>p.map(y=>y.id===T?{...y,isExpanded:!y.isExpanded}:y));},[]),c=react.useCallback((T,p)=>{n(y=>y.map(h=>h.id===T&&!h.cardIds.includes(p)?{...h,cardIds:[...h.cardIds,p]}:h));},[]),d=react.useCallback((T,p)=>{n(y=>y.map(h=>{if(h.id===T){let b=h.cardIds.filter(k=>k!==p);return b.length<o.minCardsPerStack?null:{...h,cardIds:b}}return h}).filter(h=>h!==null));},[o.minCardsPerStack]),g=react.useCallback(T=>s.filter(p=>p.columnId===T).sort((p,y)=>p.position-y.position),[s]),f=react.useCallback(async T=>{let p=t.filter(D=>D.columnId===T);if(p.length<o.minCardsPerStack*2)return [];let y=[],h=new Map;p.forEach(D=>{D.labels&&D.labels.length>0&&D.labels.forEach(N=>{h.has(N)||h.set(N,[]),h.get(N).push(D);});}),h.forEach((D,N)=>{D.length>=o.minCardsPerStack&&y.push({stack:{title:`\u{1F4CC} ${N}`,cardIds:D.map(E=>E.id),columnId:T,strategy:"labels",color:"#3b82f6"},reason:`${D.length} cards with label "${N}"`,confidence:.85});});let b=new Map;p.forEach(D=>{D.assignedUserIds&&D.assignedUserIds.length>0&&D.assignedUserIds.forEach(N=>{b.has(N)||b.set(N,[]),b.get(N).push(D);});}),b.forEach((D,N)=>{D.length>=o.minCardsPerStack&&y.push({stack:{title:`\u{1F464} Assigned to user-${N.slice(-4)}`,cardIds:D.map(E=>E.id),columnId:T,strategy:"assignee",color:"#8b5cf6"},reason:`${D.length} cards assigned to the same user`,confidence:.8});});let k=new Map;if(p.forEach(D=>{D.priority&&(k.has(D.priority)||k.set(D.priority,[]),k.get(D.priority).push(D));}),k.forEach((D,N)=>{if(D.length>=o.minCardsPerStack){let E={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[N.toLowerCase()]||"\u26AA";y.push({stack:{title:`${E} ${N} Priority`,cardIds:D.map(w=>w.id),columnId:T,strategy:"priority",color:N==="high"||N==="urgent"?"#ef4444":"#10b981"},reason:`${D.length} cards with ${N} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let D of p){let E=(await r.findSimilar(D,p)).filter(w=>w.similarity>=o.autoStackConfidenceThreshold);if(E.length>=o.minCardsPerStack-1){let w=[D.id,...E.map(I=>I.card.id)],R=E.reduce((I,C)=>I+C.similarity,0)/E.length;y.push({stack:{title:`\u2728 Similar to "${D.title.substring(0,30)}${D.title.length>30?"...":""}"`,cardIds:w,columnId:T,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${E.length+1} similar tasks`,confidence:R});}}return y.filter(D=>D.confidence>=o.autoStackConfidenceThreshold).sort((D,N)=>N.confidence-D.confidence).slice(0,5)},[t,o,r]),x=react.useCallback(T=>{l(T.stack.title,T.stack.cardIds,T.stack.columnId,T.stack.strategy,T.stack.color);},[l]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(p=>p.columnId)).forEach(async p=>{let y=await f(p),h=y[0];y.length>0&&h&&h.confidence>=.9&&x(h);});},[]),{stacks:s,createStack:l,deleteStack:m,toggleStack:i,addToStack:c,removeFromStack:d,getStacksForColumn:g,getSuggestions:f,applySuggestion:x,config:o}}var Qp=react.createContext(null);function eg({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(m=>{let{Column:i}=On("@libxai/core");s.set(m.id,new i(m));}),t?.cards?.forEach(m=>{let{Card:i}=On("@libxai/core");n.set(m.id,new i(m));});let l=null;if(t?.board){let{Board:m}=On("@libxai/core");l=new m(t.board);}r.current=new core.BoardStore({board:l,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(Qp.Provider,{value:{store:o},children:e})}function qs(){let e=react.useContext(Qp);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Ln(){let e=qs(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,n]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let l=react.useCallback(h=>{e.updateBoard(h);},[e]),m=react.useCallback(h=>{e.addColumn(h);},[e]),i=react.useCallback((h,b)=>{e.updateColumn(h,b);},[e]),c=react.useCallback(h=>{e.deleteColumn(h);},[e]),d=react.useCallback(h=>e.getColumn(h),[e]),g=react.useCallback(h=>{e.addCard(h);},[e]),f=react.useCallback((h,b)=>{e.updateCard(h,b);},[e]),x=react.useCallback(h=>{e.deleteCard(h);},[e]),T=react.useCallback((h,b,k)=>{e.moveCard(h,b,k);},[e]),p=react.useCallback(h=>e.getCard(h),[e]),y=react.useCallback(h=>e.getCardsByColumn(h),[e]);return {board:t,columns:r,cards:s,updateBoard:l,addColumn:m,updateColumn:i,deleteColumn:c,getColumn:d,addCard:g,updateCard:f,deleteCard:x,moveCard:T,getCard:p,getCardsByColumn:y}}function ag(e){let{cards:t}=Ln();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function rg(e="position",t="asc"){let{cards:a}=Ln();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},m=o.priority?l[o.priority]:0,i=s.priority?l[s.priority]:0;n=m-i;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var Ys=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=Rd.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 a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} 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(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(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,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let l=await Promise.resolve(n.apply(s,a));l!==void 0&&(o=l,a[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,l,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},h2=new Ys;function ng({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:l=0,getItemKey:m}){let i=react.useRef(null),c=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:l}),d=c.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},f=n?{width:`${c.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${c.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:g,className:o,children:jsxRuntime.jsx("div",{style:f,children:d.map(x=>{let T=e[x.index];if(!T)return null;let p=m?m(T,x.index):x.index,y={position:"absolute",top:n?0:x.start,left:n?x.start:0,width:n?x.size:"100%",height:n?"100%":x.size};return jsxRuntime.jsx("div",{style:y,"data-index":x.index,children:r(T,x.index)},p)})})})}function sg(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 lg({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:l=16,getItemKey:m,horizontal:i=true}){let c=react.useRef(null),d=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>c.current,estimateSize:()=>r,overscan:n,gap:l}),g=d.getVirtualItems(),f={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},x={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:c,style:f,className:s,children:jsxRuntime.jsx("div",{style:x,children:g.map(T=>{let p=e[T.index];if(!p)return null;let y=m?m(p,T.index):T.index,h={position:"absolute",top:0,left:T.start,width:T.size,height:"100%"};return jsxRuntime.jsx("div",{style:h,"data-index":T.index,children:o(p,T.index)},y)})})})}function dg(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 cg(e,t=10){return e>t}var id={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},ld={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},dd={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},cd={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},md={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},ud={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},pd={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},gd={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)"},fd={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)"},hd={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},bd={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}},yd={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}},Xs={spacing:id,borderRadius:ld,fontSize:dd,fontWeight:cd,lineHeight:md,zIndex:ud,duration:pd,easing:gd,shadows:fd,opacity:hd,kanban:bd,gantt:yd};function mg(e,t,a){return e[t]??a}function vd(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?vd(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function v2(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function xd(e="asakaa"){let t=vd(Xs),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=v2(o);a.push(` ${s}: ${n};`);}return `:root {
404
404
  ${a.join(`
405
405
  `)}
406
406
  }`}function In(e,t="asakaa"){let a=[],r=vd(e);for(let[o,s]of Object.entries(r)){let n=`--${t}-color-${o}`;a.push(` ${n}: ${s};`);}return `:root {