@libxai/board 1.9.54 → 1.9.55
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
1.
|
|
123
123
|
|
|
124
124
|
**Action items:**
|
|
125
|
-
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function em({templates:e,onSelectTemplate:t,className:a}){let[n,r]=react.useState(false),o=react.useRef(null),s=react.useRef(null);react.useEffect(()=>{function l(p){o.current&&!o.current.contains(p.target)&&s.current&&!s.current.contains(p.target)&&r(false);}if(n)return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n]);let i=l=>{t(l),r(false);},d=e.reduce((l,p)=>{let c=p.category||"Other";return l[c]||(l[c]=[]),l[c].push(p),l},{});return jsxRuntime.jsxs("div",{className:v("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:s,onClick:()=>r(!n),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",l.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",l.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:v("w-4 h-4 transition-transform",n&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&jsxRuntime.jsxs("div",{ref:o,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(d).map(([l,p])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:l})}),jsxRuntime.jsx("div",{children:p.map(c=>jsxRuntime.jsxs("button",{onClick:()=>i(c),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:c.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:c.name}),c.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:c.description})]})]},c.id))})]},l)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function am({board:e,isOpen:t,onClose:a,onImport:n,boardElementRef:r,className:o}){let[s,i]=react.useState("export"),[d,l]=react.useState("json"),[p,c]=react.useState(null),u=react.useRef(null);if(!t)return null;let g=async()=>{let w=r?.current||void 0,f=await jf(e,d,w);Wf(f,d);},h=async w=>{let f=w.target.files?.[0];if(f){try{let C=await _f(f),y=f.name.endsWith(".json")?"json":"csv",N=Gf(C,y);c(N),N.success&&n&&n(N,C);}catch(C){c({success:false,errors:[`Failed to read file: ${C instanceof Error?C.message:"Unknown error"}`]});}u.current&&(u.current.value="");}};return jsxRuntime.jsxs("div",{className:v("fixed inset-0 z-[9999] flex items-center justify-center",o),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>i("export"),className:v("flex-1 px-6 py-4 font-semibold transition-colors",s==="export"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>i("import"),className:v("flex-1 px-6 py-4 font-semibold transition-colors",s==="import"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[s==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(w=>jsxRuntime.jsxs("button",{onClick:()=>l(w),className:v("p-4 rounded-lg border-2 transition-all text-center",d===w?"border-[#00E5CC] bg-[#00E5CC]/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[w==="json"&&"\u{1F4C4}",w==="csv"&&"\u{1F4CA}",w==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:w})]},w))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:g,className:"w-full py-3 px-4 bg-gradient-to-r from-[#00C4AE] to-[#00C4AE] hover:from-[#00E5CC] hover:to-[#00C4AE] text-white font-semibold rounded-lg transition-all shadow-lg shadow-[#00E5CC]/20",children:"Export Board"})]}),s==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:u,type:"file",accept:".json,.csv",onChange:h,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>u.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),p&&jsxRuntime.jsxs("div",{className:v("p-4 rounded-lg",p.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:v("font-semibold mb-2",p.success?"text-green-400":"text-red-400"),children:p.success?"\u2713 Import Successful":"\u2717 Import Failed"}),p.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",p.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",p.columnsImported]})]}),p.errors&&p.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:p.errors.map((w,f)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",w]},f))})]})]})]})]})]})}var g2=["URGENT","HIGH","MEDIUM","LOW"],f2=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],b2=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function nm({filters:e,sort:t,onFiltersChange:a,onSortChange:n,onReset:r,onFilterMyTasks:o,onFilterOverdue:s,onFilterHighPriority:i,availableUsers:d=[],availableLabels:l=[],availableColumns:p=[],showQuickFilters:c=true,compact:u=false,groupBy:g="none",onGroupByChange:h}){let[w,f]=react.useState(true),C=react.useCallback(x=>{a({search:x.target.value});},[a]),y=react.useCallback(x=>{a({dateFilter:x.target.value});},[a]),N=react.useCallback(x=>{n({by:x.target.value});},[n]),m=react.useCallback(()=>{n({order:t.order==="asc"?"desc":"asc"});},[t.order,n]),k=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${u?"filter-bar--compact":""} ${w?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>f(!w),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:w?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:x=>{x.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:x=>{x.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:w?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),k&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!w&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[c&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),o&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),s&&jsxRuntime.jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),i&&jsxRuntime.jsx("button",{onClick:i,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:C,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:y,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:x=>{let I=x.target.value;a({priorities:I==="all"?[]:[I]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),g2.map(x=>jsxRuntime.jsx("option",{value:x,children:x},x))]})}),d.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:x=>{let I=x.target.value;a({assignees:I==="all"?[]:[I]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),d.map(x=>jsxRuntime.jsx("option",{value:x.id,children:x.name},x.id))]})}),l.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:x=>{let I=x.target.value;a({labels:I==="all"?[]:[I]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),l.map(x=>jsxRuntime.jsx("option",{value:x,children:x},x))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:N,className:"filter-bar__select filter-bar__select--sm",children:f2.map(x=>jsxRuntime.jsx("option",{value:x.value,children:x.label},x.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:m,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),h&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:g,onChange:x=>h(x.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:b2.map(x=>jsxRuntime.jsx("option",{value:x.value,children:x.label},x.value))})}),k&&jsxRuntime.jsx("button",{onClick:r,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function rm({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:a,className:n,viewMode:r="kanban",onExportGanttPDF:o,onExportGanttExcel:s,onExportGanttPNG:i,onExportGanttCSV:d}){let[l,p]=react.useState(false),c=react.useRef(null);react.useEffect(()=>{let g=h=>{c.current&&!c.current.contains(h.target)&&p(false);};return l&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g);}},[l]);let u=g=>{g(),p(false);};return jsxRuntime.jsxs("div",{className:v("relative",n),ref:c,children:[jsxRuntime.jsxs("button",{onClick:()=>p(!l),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",g.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",g.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":l,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),l&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[r==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>u(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>u(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>u(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>u(async()=>await i?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>u(()=>d?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>u(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>u(a),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var om={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#00E5CC",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},sm={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#00E5CC",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},im={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Mi={dark:om,light:sm,neutral:im},Vc="dark";var jc=react.createContext(void 0),N2="asakaa-theme";function C0({children:e,defaultTheme:t=Vc,storageKey:a=N2}){let[n,r]=react.useState(()=>{if(typeof window<"u"){let i=localStorage.getItem(a);if(i&&(i==="dark"||i==="light"||i==="neutral"))return i}return t}),o=react.useCallback(i=>{r(i),typeof window<"u"&&localStorage.setItem(a,i);},[a]);react.useEffect(()=>{if(typeof window>"u")return;let i=document.documentElement,d=Mi[n];Object.entries(d.colors).forEach(([p,c])=>{c&&i.style.setProperty(`--theme-${S2(p)}`,c);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([p,c])=>{let u=d.colors[p];u&&i.style.setProperty(c,u);}),i.setAttribute("data-theme",n),i.classList.remove("theme-dark","theme-light","theme-neutral"),i.classList.add(`theme-${n}`);},[n]);let s={theme:n,setTheme:o,themes:Mi};return jsxRuntime.jsx(jc.Provider,{value:s,children:e})}function pl(){let e=react.useContext(jc);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function S2(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function lm({isOpen:e,onClose:t,className:a}){let{theme:n,setTheme:r}=pl();return e?jsxRuntime.jsxs("div",{className:v("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(Mi).map(([o,s])=>jsxRuntime.jsxs("button",{onClick:()=>{r(o),t();},className:v("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",n===o?"border-[#00E5CC] bg-[#00E5CC]/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:n===o?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:s.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:s.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[o==="dark"&&"Default dark theme with Linear-inspired colors",o==="light"&&"Clean light theme with high contrast",o==="neutral"&&"Monochrome zen theme"]})]}),n===o&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},o))})]})]}):null}var cs={responsables:[],fases:[],prioridades:[],desde:null,hasta:null},Wc="__sin_responsable__";function bd(e){return e.responsables.length+e.fases.length+e.prioridades.length+(e.desde||e.hasta?1:0)}var dm=e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},M2=["urgent","high","medium","low"];function T0(e){let t=new Set,a=new Set,n=false,r=o=>{for(let s of o){if(s.subtasks?.length){r(s.subtasks);continue}s.assignees?.length?s.assignees.forEach(i=>t.add(i.name)):n=true,s.priority&&a.add(s.priority);}};return r(e),{responsables:[...t].sort((o,s)=>o.localeCompare(s)),haySinResponsable:n,fases:e.filter(o=>o.subtasks?.length).map(o=>({id:o.id,nombre:o.name})),prioridades:M2.filter(o=>a.has(o))}}function D0(e,t){if(bd(t)===0)return e;let a=o=>{if(t.responsables.length&&!(o.assignees?.length?o.assignees.map(i=>i.name):[Wc]).some(i=>t.responsables.includes(i))||t.prioridades.length&&!(o.priority&&t.prioridades.includes(o.priority)))return false;if(t.desde||t.hasta){let s=dm(o.startDate)??dm(o.endDate),i=dm(o.endDate)??s;if(!s||!i||t.desde&&i<t.desde||t.hasta&&s>t.hasta)return false}return true},n=o=>{let s=[];for(let i of o)if(i.subtasks?.length){let d=n(i.subtasks);d.length&&s.push({...i,subtasks:d});}else a(i)&&s.push(i);return s},r=t.fases.length?e.filter(o=>t.fases.includes(o.id)):e;return n(r)}var N0="gantt-vistas-v6";function S0(){try{let e=JSON.parse(localStorage.getItem(N0)??"[]");return Array.isArray(e)?e:[]}catch{return []}}function cm(e){try{localStorage.setItem(N0,JSON.stringify(e));}catch{}}function E0(e,t){return e.some(a=>a.nombre===t.nombre)?e.map(a=>a.nombre===t.nombre?t:a):[...e,t]}var sa={dark:{bgPrimary:"#050505",bgSecondary:"#0A0A0A",bgGrid:"rgba(255, 255, 255, 0.02)",bgWeekend:"rgba(17, 17, 17, 0.4)",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#00E5CC",accentHover:"#5AADFF",accentLight:"rgba(0, 229, 204, 0.12)",taskBarPrimary:"#00E5CC",taskBarProgress:"#5AADFF",taskBarHandle:"#FFFFFF",dependency:"#444444",dependencyHover:"#FFFFFF",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.15)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#FFFFFF",milestoneLight:"rgba(255, 255, 255, 0.1)",statusTodo:"#666666",statusInProgress:"#00E5CC",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(255, 255, 255, 0.05)",glassHeader:"#0A0A0A",glassToolbar:"rgba(0, 0, 0, 0.4)",forecastHud:"rgba(15, 15, 15, 0.9)",neonRedGlow:"0 0 8px rgba(239, 68, 68, 0.25)",executionBarBg:"rgba(0, 229, 204, 0.12)"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(0, 196, 174, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#00E5CC",accentHover:"#1D4ED8",accentLight:"rgba(0, 196, 174, 0.08)",taskBarPrimary:"#00E5CC",taskBarProgress:"#00A893",taskBarHandle:"#FFFFFF",dependency:"#6B7280",dependencyHover:"#00E5CC",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#00E5CC",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(0, 0, 0, 0.04)",glassHeader:"#F8FAFC",glassToolbar:"rgba(255, 255, 255, 0.85)",forecastHud:"rgba(248, 250, 252, 0.95)",neonRedGlow:"0 0 10px rgba(220, 38, 38, 0.3)",executionBarBg:"rgba(0, 196, 174, 0.28)"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"#78716C",dependencyHover:"#A8A29E",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524",dotGrid:"rgba(0, 0, 0, 0.03)",glassHeader:"#F5F5F4",glassToolbar:"rgba(250, 250, 249, 0.85)",forecastHud:"rgba(245, 245, 244, 0.95)",neonRedGlow:"0 0 10px rgba(68, 64, 60, 0.3)",executionBarBg:"rgba(41, 37, 36, 0.25)"}};function M0(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return sa[e]||sa.dark;let t=document.documentElement,a=getComputedStyle(t),n=(o,s)=>a.getPropertyValue(o).trim()||s;return {bgPrimary:n("--theme-bg-primary",sa[e].bgPrimary),bgSecondary:n("--theme-bg-secondary",sa[e].bgSecondary),bgGrid:n("--theme-bg-card",sa[e].bgGrid),bgWeekend:n("--theme-bg-hover",sa[e].bgWeekend),border:n("--theme-border-primary",sa[e].border),borderLight:n("--theme-border-subtle",sa[e].borderLight),textPrimary:n("--theme-text-primary",sa[e].textPrimary),textSecondary:n("--theme-text-secondary",sa[e].textSecondary),textTertiary:n("--theme-text-tertiary",sa[e].textTertiary),accent:n("--theme-accent-primary",sa[e].accent),accentHover:n("--theme-accent-hover",sa[e].accentHover),accentLight:n("--theme-accent-primary",sa[e].accentLight),taskBarPrimary:n("--theme-accent-primary",sa[e].taskBarPrimary),taskBarProgress:n("--theme-accent-hover",sa[e].taskBarProgress),taskBarHandle:n("--theme-text-inverse",sa[e].taskBarHandle||"#FFFFFF"),dependency:n("--theme-border-secondary",sa[e].dependency),dependencyHover:n("--theme-border-secondary",sa[e].dependencyHover),criticalPath:n("--theme-error",sa[e].criticalPath),criticalPathLight:n("--theme-error",sa[e].criticalPathLight),today:e==="light"?n("--theme-accent-primary",sa[e].today):e==="neutral"?n("--theme-text-primary",sa[e].today):n("--theme-error",sa[e].today),todayLight:e==="light"?n("--theme-accent-primary",sa[e].todayLight):e==="neutral"?n("--theme-text-primary",sa[e].todayLight):n("--theme-error",sa[e].todayLight),milestone:n("--theme-warning",sa[e].milestone),milestoneLight:n("--theme-warning",sa[e].milestoneLight),statusTodo:n("--theme-text-tertiary",sa[e].statusTodo),statusInProgress:n("--theme-accent-primary",sa[e].statusInProgress),statusCompleted:n("--theme-success",sa[e].statusCompleted),hoverBg:n("--theme-bg-hover",sa[e].hoverBg),focusRing:n("--theme-accent-primary",sa[e].focusRing),...sa[e].dotGrid&&{dotGrid:sa[e].dotGrid},...sa[e].glassHeader&&{glassHeader:sa[e].glassHeader},...sa[e].glassToolbar&&{glassToolbar:sa[e].glassToolbar},...sa[e].forecastHud&&{forecastHud:sa[e].forecastHud},...sa[e].neonRedGlow&&{neonRedGlow:sa[e].neonRedGlow},...sa[e].executionBarBg&&{executionBarBg:sa[e].executionBarBg}}}function xd(e,t,a="left",n=208){let[r,o]=react.useState({top:0,left:0});return react.useEffect(()=>{if(!t||!e.current)return;let s=e.current.getBoundingClientRect(),i=s.bottom+4,d;a==="right"?d=s.right-n:d=s.left;let l=8;d+n>window.innerWidth-l&&(d=window.innerWidth-l-n),d<l&&(d=l),o({top:i,left:d});},[t,a,e,n]),r}function H0({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:n,onExportCSV:r,onExportJSON:o,onExportMSProject:s}){let[i,d]=react.useState(false),[l,p]=react.useState(null),c=react.useRef(null),u=react.useRef(null),g=Sr(),h=xd(c,i,"right",176);if(react.useEffect(()=>{if(!i)return;let y=N=>{let m=N.target;c.current&&!c.current.contains(m)&&u.current&&!u.current.contains(m)&&d(false);};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]),!(t||a||n||r||o||s))return null;let f=[{id:"png",label:"PNG",description:"Image",icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:n},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:r},{id:"json",label:"JSON",description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:o},{id:"msproject",label:"MS Project",description:"XML",icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-4 h-4"}),handler:s}].filter(y=>y.handler),C=async(y,N)=>{if(N){p(y);try{await N();}catch(m){console.error(`Export ${y} failed:`,m);}finally{p(null),d(false);}}};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:c,onClick:()=>d(!i),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:i?e.accent:e.bgSecondary,border:`1px solid ${i?e.accent:e.borderLight}`,color:i?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:g.toolbar.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:i?"rotate(180deg)":"rotate(0deg)"}})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:i&&jsxRuntime.jsx(framerMotion.motion.div,{ref:u,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-44 rounded-xl overflow-hidden",style:{top:h.top,left:h.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:f.map((y,N)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>C(y.id,y.handler),disabled:l!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:N<f.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:N*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:l===y.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):y.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium truncate",style:{color:e.textPrimary},children:y.label}),jsxRuntime.jsx("div",{className:"text-[9px] truncate",style:{color:e.textTertiary},children:y.description})]})]},y.id))})})}),document.body)]})}function um({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:n,onExportMSProject:r,onCopySnapshotLink:o}){let[s,i]=react.useState(false),[d,l]=react.useState(null),[p,c]=react.useState(false),u=react.useRef(null),g=react.useRef(null),h=Sr(),w=xd(u,s,"right",224),f=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0",C=h.toolbar.visibility==="Visibilidad";react.useEffect(()=>{if(!s)return;let k=x=>{let I=x.target;u.current&&!u.current.contains(I)&&g.current&&!g.current.contains(I)&&i(false);};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[s]);let y=[{id:"png",label:h.toolbar.exportPng,icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-3.5 h-3.5"}),handler:t},{id:"pdf",label:h.toolbar.exportPdf,icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-3.5 h-3.5"}),handler:a},{id:"excel",label:h.toolbar.exportExcel,icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-3.5 h-3.5"}),handler:n},{id:"msproject",label:h.toolbar.exportMsProject,icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-3.5 h-3.5"}),handler:r}].filter(k=>k.handler),N=async(k,x)=>{if(x){l(k);try{await x();}catch(I){console.error(`Export ${k} failed:`,I);}finally{l(null),i(false);}}},m=()=>{o?.(),c(true),setTimeout(()=>c(false),2e3);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:u,onClick:()=>i(!s),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:s?e.accent:e.textTertiary,backgroundColor:s?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:h.toolbar.share,children:jsxRuntime.jsx(lucideReact.Share2,{className:"w-4 h-4"})}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:g,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:w.top,left:w.left,zIndex:99999,backgroundColor:f?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${f?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:f?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[y.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:f?"rgba(255,255,255,0.35)":e.textTertiary},children:C?"EXPORTAR":"EXPORT"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:y.map((k,x)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>N(k.id,k.handler),disabled:d!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:f?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:x*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:e.accentLight,color:e.accent},children:d===k.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):k.icon}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:k.label})]},k.id))})]}),y.length>0&&o&&jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:f?"rgba(255,255,255,0.06)":e.borderLight}}),o&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:f?"rgba(255,255,255,0.35)":e.textTertiary},children:C?"COMPARTIR":"SHARE"})}),jsxRuntime.jsx("div",{className:"py-0.5 pb-1.5",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:m,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:f?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:y.length*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:p?"rgba(34,197,94,0.15)":e.accentLight,color:p?"#22C55E":e.accent},children:p?jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5"}):jsxRuntime.jsx(lucideReact.Link2,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:p?h.toolbar.copied:h.toolbar.copySnapshotLink})]})})]})]})}),document.body)]})}function X2({options:e,value:t,onChange:a,theme:n,layoutId:r="activeSegment"}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:n.bgSecondary,border:`1px solid ${n.borderLight}`},children:e.map(o=>{let s=t===o.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(o.value),className:"relative px-3 py-1.5 rounded-md text-[11px] transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:s?n.textPrimary:n.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500,zIndex:s?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[s&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:r,className:"absolute inset-0 rounded-md",style:{backgroundColor:n.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),o.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:s?"#FFFFFF":n.textTertiary},children:o.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:s?"#FFFFFF":n.textTertiary},children:o.label})]},o.value)})})}function J2({options:e,value:t,onChange:a,theme:n}){return jsxRuntime.jsx("div",{className:"inline-flex items-center gap-1",children:e.map(r=>{let o=t===r.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(r.value),className:"relative px-3 py-1.5 text-[11px] transition-all",style:{color:o?n.accent:n.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500},whileHover:{color:o?n.accent:n.textSecondary},whileTap:{scale:.98},children:[jsxRuntime.jsx("span",{children:r.label}),o&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:n.accent},transition:{type:"spring",stiffness:400,damping:30}})]},r.value)})})}function pm({theme:e,value:t,onChange:a,maxDepth:n}){let[r,o]=react.useState(false),s=react.useRef(null),i=react.useRef(null),d=Sr(),l=xd(s,r,"left");react.useEffect(()=>{if(!r)return;let u=g=>{let h=g.target;s.current&&!s.current.contains(h)&&i.current&&!i.current.contains(h)&&o(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]);let p=[{value:"all",label:d.toolbar.wbsAllLevels||"All"},...Array.from({length:Math.min(n,5)},(u,g)=>({value:g+1,label:d.toolbar.wbsLevel==="Nivel"?`Nivel ${g+1}`:`L${g+1}`}))],c=t==="all"?d.toolbar.wbsAllLevels||"All":d.toolbar.wbsLevel==="Nivel"?`Nivel ${t}`:`L${t}`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:s,onClick:()=>o(!r),className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-all",style:{backgroundColor:r?e.accentLight:e.bgSecondary,border:`1px solid ${r?e.accent:e.borderLight}`,color:r?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${d.toolbar.wbsLevel||"Level"}: ${c}`,children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium",style:{fontFamily:"'JetBrains Mono', monospace"},children:c})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(framerMotion.motion.div,{ref:i,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-24 rounded-xl overflow-hidden",style:{top:l.top,left:l.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:p.map((u,g)=>{let h=t===u.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(u.value),o(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:h?e.accentLight:"transparent",borderBottom:g<p.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none"},whileHover:{backgroundColor:h?e.accentLight:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:g*.03},children:[jsxRuntime.jsx("span",{className:"text-[11px]",style:{color:h?e.accent:e.textPrimary,fontFamily:"'JetBrains Mono', monospace",fontWeight:h?600:500},children:u.label}),h&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},String(u.value))})})})}),document.body)]})}function mm({theme:e,value:t,onChange:a,hideCompleted:n=false,onHideCompletedChange:r}){let[o,s]=react.useState(false),i=react.useRef(null),d=react.useRef(null),l=Sr(),p=xd(i,o,"left");react.useEffect(()=>{if(!o)return;let w=setTimeout(()=>{let f=y=>{let N=y.target;i.current&&!i.current.contains(N)&&d.current&&!d.current.contains(N)&&s(false);},C=y=>{y.key==="Escape"&&s(false);};document.addEventListener("mousedown",f),document.addEventListener("keydown",C),d._cleanup=()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",C);};},100);return ()=>{clearTimeout(w),d._cleanup&&d._cleanup();}},[o]);let c=[{value:"all",label:l.toolbar.filterAll||"Show All",icon:jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:l.toolbar.filterCompleted||"Completed",icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3.5 h-3.5"}),color:"text-green-500"},{value:"in_progress",label:l.toolbar.filterInProgress||"In Progress",icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3.5 h-3.5"}),color:"text-[#00E5CC]"},{value:"incomplete",label:l.toolbar.toDo||"To Do / Pending",icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-3.5 h-3.5"}),color:"text-gray-400"}],u=t!=="all"||n,g=(t!=="all"?1:0)+(n?1:0),h=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:i,onClick:w=>{w.stopPropagation(),s(f=>!f);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:u?h?"rgba(0, 229, 204, 0.2)":"rgb(239 246 255)":o?e.hoverBg:e.bgSecondary,border:`1px solid ${u?h?"rgba(0, 229, 204, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:u?"#00E5CC":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:g===0?l.toolbar.filter||"Filters":[t!=="all"?c.find(w=>w.value===t)?.label:null,n?l.toolbar.visibility==="Visibilidad"?"sin completadas":"no completed":null].filter(Boolean).join(" \xB7 ")})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:o&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:d,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:p.top,left:p.left,zIndex:99999,backgroundColor:h?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:`1px solid ${h?"rgba(255,255,255,0.08)":"rgb(229 231 235)"}`,boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:h?"rgba(255,255,255,0.06)":"rgb(229 231 235)"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":"#9CA3AF",fontFamily:"Inter, sans-serif"},children:l.toolbar.filterBy||"FILTER BY STATUS"})}),jsxRuntime.jsx("div",{className:"py-1",children:c.map(w=>{let f=t===w.value&&!n,C=()=>w.value==="all"?f?jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-gray-400"}):w.icon;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(w.value),r&&r(false),s(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:f?h?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:h?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx("span",{className:`${f?w.color:"text-gray-400"} flex-shrink-0`,children:C()}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},children:w.label}),f&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]},w.value)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:h?"rgba(255,255,255,0.06)":"rgb(229 231 235)"}}),r&&jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{r(!n),n||a("all"),s(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:n?h?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:h?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:n?"#00E5CC":h?"rgba(255,255,255,0.35)":"#9CA3AF"}}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},children:l.toolbar.hideCompleted||"Hide Completed Tasks"}),n&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]})})]})}),document.body)]})}function F0({value:e,onChange:t,theme:a}){let n=Sr(),r=a.bgPrimary==="#050505"||a.textPrimary==="#FFFFFF",o=n.toolbar.visibility==="Visibilidad",s=[{value:"compact",label:n.toolbar.compact||"Compact",Icono:lucideReact.Rows4},{value:"comfortable",label:n.toolbar.normal||"Normal",Icono:lucideReact.Rows3},{value:"spacious",label:n.toolbar.spacious||"Spacious",Icono:lucideReact.Rows2}];return jsxRuntime.jsx("div",{role:"group","aria-label":o?"Densidad de las filas":"Row density","data-densidad-a-la-vista":true,className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:r?"#000000":a.bgSecondary,border:`1px solid ${r?"rgba(255,255,255,0.1)":a.border}`},children:s.map(({value:i,label:d,Icono:l})=>{let p=e===i;return jsxRuntime.jsx("button",{type:"button",onClick:()=>t(i),"aria-pressed":p,"aria-label":(o?"Densidad: ":"Density: ")+d,title:(o?"Densidad: ":"Density: ")+d,className:"relative px-2 py-1 rounded-full transition-colors",style:{color:p?r?"#FFFFFF":a.textPrimary:a.textTertiary,backgroundColor:p?r?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},children:jsxRuntime.jsx(l,{className:"w-3.5 h-3.5"})},i)})})}function A0({value:e,onChange:t,theme:a}){let n=Sr(),r=a.bgPrimary==="#050505"||a.textPrimary==="#FFFFFF",o=[{value:"day",label:n.toolbar.day.charAt(0).toUpperCase()},{value:"week",label:n.toolbar.week.charAt(0).toUpperCase()},{value:"month",label:n.toolbar.month.charAt(0).toUpperCase()}];return jsxRuntime.jsx("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:r?"#000000":a.bgSecondary,border:`1px solid ${r?"rgba(255,255,255,0.1)":a.border}`},children:o.map(s=>{let i=e===s.value;return jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>t(s.value),className:"relative px-3 py-1 text-[11px] font-medium rounded-full transition-colors",style:{color:i?r?"#FFFFFF":a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",backgroundColor:i?r?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},whileHover:{color:r?"#FFFFFF":a.textPrimary},whileTap:{scale:.95},children:s.label},s.value)})})}function Q2({theme:e,forecast:t,currencyCode:a}){let n=Sr(),r=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF",o=n.toolbar.visibility==="Visibilidad"?"es":"en",s=t?.expectedFinish?Br(t.expectedFinish,o):"\u2014",i=t?.delayDays,d=i!=null,l=i!=null?i>0?`+${i}d ${n.toolbar.delayLabel}`:i<0?`${i}d ${n.toolbar.earlyLabel}`:n.toolbar.onTimeLabel:null,p=i!=null&&i>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:i!=null&&i<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",text:e.textTertiary},c=t?.confidencePercent,u=c!=null?c>=75?"#22C55E":c>=40?"#F59E0B":"#EF4444":e.textTertiary,g=t?.costAtCompletion,h=t?.currency||"$",w=g!=null?(()=>{let m=Vn(g,a,o,{compacto:true});return h!=="$"?m.replace("$",h):m})():"\u2014",f=t?.budgetVariancePercent,C=f!=null&&f!==0,y=f!=null?f>0?`+${Rr(f,o)} ${n.toolbar.budgetOver}`:`${Rr(f,o)} ${n.toolbar.budgetUnder}`:null,N=f!=null&&f>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:f!=null&&f<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:"transparent",text:e.textTertiary};return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.forecastHud||(r?"rgba(15,15,15,0.9)":"rgba(248,250,252,0.95)"),borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsx("span",{className:"text-[9px] uppercase tracking-[0.15em]",style:{color:e.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:n.toolbar.projectForecast}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[13px] font-semibold",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},children:[n.toolbar.expectedFinish,": ",s]}),d&&l&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:p.bg,color:p.text,fontFamily:"'JetBrains Mono', monospace",cursor:t?.causaDelDesvio?"help":void 0},title:t?.causaDelDesvio||void 0,children:l})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[n.toolbar.confidence,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-semibold",style:{color:u,fontFamily:"'JetBrains Mono', monospace"},children:c!=null?Rr(c,o):"\u2014"})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:r?"rgba(255,255,255,0.08)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[n.toolbar.costAtCompletion,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-bold",style:{color:e.textPrimary,fontFamily:"'JetBrains Mono', monospace"},children:w}),C&&y&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:N.bg,color:N.text,fontFamily:"'JetBrains Mono', monospace"},children:y})]})]})]})}var Uc={width:22,height:10,borderRadius:2,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},Z2=[{es:"Festivo (el d\xEDa en \xE1mbar)",en:"Holiday (amber day)",muestra:{...Uc,color:"#F59E0B",fontSize:10,fontWeight:700},texto:"12"},{es:"Vencida o en ruta cr\xEDtica",en:"Overdue or on the critical path",muestra:{...Uc,background:"#EF4444"}},{es:"Fin de semana o d\xEDa no laborable",en:"Weekend or non-working day",muestra:{...Uc,background:"repeating-linear-gradient(45deg, rgba(148,163,184,0.45) 0 2px, transparent 2px 5px)"}},{es:"Parte de la barra sin avanzar",en:"Unfinished part of the bar",muestra:{...Uc,background:"repeating-linear-gradient(45deg, rgba(0,229,204,0.55) 0 3px, rgba(148,163,184,0.25) 3px 6px)"}}];function L0({theme:e,showCriticalPath:t,onShowCriticalPathChange:a,showBaseline:n,onShowBaselineChange:r,highlightWeekends:o,onHighlightWeekendsChange:s,showDependencies:i,onShowDependenciesChange:d,rowDensity:l,onRowDensityChange:p,hasDependencies:c=true}){let[u,g]=react.useState(false),h=react.useRef(null),w=react.useRef(null),f=Sr(),C=xd(h,u,"right",208),y=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0";react.useEffect(()=>{if(!u)return;let x=M=>{let L=M.target;h.current&&!h.current.contains(L)&&w.current&&!w.current.contains(L)&&g(false);},I=M=>{M.key==="Escape"&&g(false);};return document.addEventListener("mousedown",x),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",I);}},[u]);let N=f.toolbar.visibility==="Visibilidad",m=[{key:"criticalPath",label:N?"Ruta Cr\xEDtica":"Critical Path",icon:lucideReact.Zap,active:t,onChange:a,disabled:!c,tooltip:c?void 0:N?"Agrega dependencias entre tareas para ver la ruta cr\xEDtica":"Add dependencies between tasks to see the critical path"},{key:"baselines",label:N?"L\xEDneas Base":"Baselines",icon:lucideReact.Layers,active:n,onChange:r},{key:"weekends",label:N?"Fines de Semana":"Weekends",icon:lucideReact.CalendarDays,active:o,onChange:s},{key:"dependencies",label:N?"Dependencias":"Dependencies",icon:lucideReact.GitBranch,active:i,onChange:d}],k=[{value:"compact",label:f.toolbar.visibility==="Visibilidad"?"Compacto":"Compact"},{value:"comfortable",label:"Normal"},{value:"spacious",label:f.toolbar.visibility==="Visibilidad"?"Amplio":"Spacious"}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:h,onClick:()=>g(!u),className:"flex items-center gap-1.5 h-8 px-2.5 rounded-lg text-xs font-medium",style:{color:u?e.accent:e.textSecondary,backgroundColor:u?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:N?"Opciones de vista, densidad y leyenda":"Display options, density and legend","aria-haspopup":"menu","aria-expanded":u,children:[jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:N?"Vista":"View"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3"})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:u&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:w,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-52 rounded-xl overflow-hidden",style:{top:C.top,left:C.left,zIndex:99999,backgroundColor:y?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${y?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:y?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:f.toolbar.visibility==="Visibilidad"?"OPCIONES DE VISTA":"DISPLAY OPTIONS"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:m.map((x,I)=>{let M=x.icon,L=x.disabled,F=x.tooltip;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>!L&&x.onChange?.(!x.active),className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:L?y?"rgba(255,255,255,0.3)":"#9CA3AF":y?"rgba(255,255,255,0.85)":"#111827",cursor:L?"not-allowed":"pointer"},whileHover:L?{}:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:I*.03},title:F,children:[jsxRuntime.jsx(M,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:L?y?"rgba(255,255,255,0.2)":"#D1D5DB":x.active?e.accent||"#00E5CC":e.textTertiary}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:x.label}),x.active&&!L&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},x.key)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:y?"rgba(255,255,255,0.06)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"py-0.5",children:[jsxRuntime.jsx("div",{className:"px-3 pt-2 pb-1",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:f.toolbar.visibility==="Visibilidad"?"DENSIDAD":"DENSITY"})}),k.map((x,I)=>{let M=l===x.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>p(x.value),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:(m.length+I)*.03},children:[jsxRuntime.jsx("span",{style:{color:M?e.accent||"#00E5CC":y?"rgba(255,255,255,0.85)":e.textPrimary},children:x.label}),M&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},x.value)})]}),jsxRuntime.jsxs("div",{className:"py-0.5",style:{borderTop:`1px solid ${y?"rgba(255,255,255,0.06)":e.border||"#E2E8F0"}`},children:[jsxRuntime.jsx("div",{className:"px-3 pt-2 pb-1",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:N?"LEYENDA":"LEGEND"})}),Z2.map(x=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5 text-[11px]",style:{color:y?"rgba(255,255,255,0.75)":e.textSecondary},children:[jsxRuntime.jsx("span",{"aria-hidden":true,style:x.muestra,children:x.texto??null}),jsxRuntime.jsx("span",{children:N?x.es:x.en})]},x.es))]})]})}),document.body)]})}function e5({theme:e,etiqueta:t,children:a}){let[n,r]=react.useState(false),o=react.useRef(null);return react.useEffect(()=>{if(!n)return;let s=d=>{o.current&&!o.current.contains(d.target)&&r(false);},i=d=>{d.key==="Escape"&&r(false);};return document.addEventListener("mousedown",s),document.addEventListener("keydown",i),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",i);}},[n]),jsxRuntime.jsxs("div",{ref:o,className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>r(s=>!s),"aria-label":t,"aria-expanded":n,title:t,className:"flex items-center justify-center rounded-md",style:{width:32,height:32,color:e.textSecondary,border:`1px solid ${e.borderLight}`},children:"\u22EF"}),n&&jsxRuntime.jsx("div",{className:"absolute right-0 mt-1 p-1.5 rounded-lg shadow-lg",style:{top:"100%",minWidth:200,zIndex:300,backgroundColor:e.bgPrimary,border:`1px solid ${e.borderLight}`},children:a})]})}function Gc({enCabecera:e=false,theme:t,timeScale:a,onTimeScaleChange:n,zoom:r,onZoomChange:o,currentTheme:s,onThemeChange:i,rowDensity:d,onRowDensityChange:l,showThemeSelector:p=false,showCreateTaskButton:c=false,createTaskLabel:u,onCreateTask:g,taskFilter:h="all",onTaskFilterChange:w,hideCompleted:f=false,onHideCompletedChange:C,toolbarRightContent:y,wbsLevel:N,onWbsLevelChange:m,maxWbsDepth:k=4,viewMode:x="execution",onViewModeChange:I,projectForecast:M,hideForecastHud:L,currencyCode:F,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportCSV:P,onExportJSON:B,onExportMSProject:ge,showCriticalPath:ae=true,onShowCriticalPathChange:xe,showDependencies:V=true,onShowDependenciesChange:fe,highlightWeekends:bt=true,onHighlightWeekendsChange:st,showBaseline:q=false,onShowBaselineChange:He,onCopySnapshotLink:we,hasDependencies:kt=true}){let Je=Sr(),Ct=H||z||Y||P||B||ge,$t=!!t.glassToolbar,Tt=[{value:"day",label:Je.toolbar.day},{value:"week",label:Je.toolbar.week},{value:"month",label:Je.toolbar.month}],At=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}],Ze=t.bgPrimary==="#050505"||t.textPrimary==="#FFFFFF";if(e)return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(A0,{value:a,onChange:n,theme:t}),jsxRuntime.jsx(F0,{value:d,onChange:l,theme:t}),w&&jsxRuntime.jsx(mm,{theme:t,value:h,onChange:w,hideCompleted:f,onHideCompletedChange:C}),y,jsxRuntime.jsx(L0,{theme:t,showCriticalPath:ae,onShowCriticalPathChange:xe,showBaseline:q,onShowBaselineChange:He,highlightWeekends:bt,onHighlightWeekendsChange:st,showDependencies:V,onShowDependenciesChange:fe,rowDensity:d,onRowDensityChange:l,hasDependencies:kt}),jsxRuntime.jsx(um,{theme:t,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportMSProject:ge,onCopySnapshotLink:we}),(I||m)&&jsxRuntime.jsxs(e5,{theme:t,etiqueta:Je.toolbar.today==="Hoy"?"M\xE1s opciones":"More options",children:[I&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:["execution","oracle"].map(mt=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>I(mt),className:"flex items-center justify-between gap-3 px-2 py-1.5 rounded-md text-[12px] text-left",style:{color:t.textPrimary,backgroundColor:x===mt?Ze?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.05)":"transparent"},children:[mt==="execution"?Je.toolbar.viewExecution:Je.toolbar.viewOracle,x===mt&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5"})]},mt))}),m&&jsxRuntime.jsx("div",{className:"pt-1 mt-1",style:{borderTop:`1px solid ${t.borderLight}`},children:jsxRuntime.jsx(pm,{theme:t,value:N??"all",onChange:m,maxDepth:k})})]})]});if($t){let mt=Ze?"rgba(255,255,255,0.08)":t.borderLight;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxs("div",{className:"h-[52px] px-4 flex items-center justify-between border-b",style:{backgroundColor:t.glassToolbar,borderColor:t.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsx("div",{className:"flex items-center gap-3",children:I&&jsxRuntime.jsxs("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:Ze?"#000000":t.bgSecondary,border:`1px solid ${Ze?"rgba(255,255,255,0.08)":t.border}`},children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>I("execution"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:x==="execution"?Ze?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent",color:x==="execution"?t.textPrimary:t.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:x!=="execution"?{color:t.textSecondary}:{},children:Je.toolbar.viewExecution}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>I("oracle"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:x==="oracle"?Ze?"rgba(0, 229, 204,0.15)":"rgba(0, 196, 174,0.08)":"transparent",color:x==="oracle"?"#00E5CC":t.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:x!=="oracle"?{color:t.textSecondary}:{},children:Je.toolbar.viewOracle})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(A0,{value:a,onChange:n,theme:t}),jsxRuntime.jsx(F0,{value:d,onChange:l,theme:t}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:mt}}),m&&jsxRuntime.jsx(pm,{theme:t,value:N??"all",onChange:m,maxDepth:k}),w&&jsxRuntime.jsx(mm,{theme:t,value:h,onChange:w,hideCompleted:f,onHideCompletedChange:C}),y&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:mt}}),y]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:mt}}),jsxRuntime.jsx(L0,{theme:t,showCriticalPath:ae,onShowCriticalPathChange:xe,showBaseline:q,onShowBaselineChange:He,highlightWeekends:bt,onHighlightWeekendsChange:st,showDependencies:V,onShowDependenciesChange:fe,rowDensity:d,onRowDensityChange:l,hasDependencies:kt}),jsxRuntime.jsx(um,{theme:t,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportMSProject:ge,onCopySnapshotLink:we}),c&&g&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:g,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px]",style:{background:`linear-gradient(135deg, ${t.accent} 0%, ${t.accentHover} 100%)`,color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:`0 2px 8px ${Ze?"rgba(0, 229, 204,0.3)":"rgba(0, 196, 174,0.3)"}`},whileHover:{scale:1.02,boxShadow:`0 4px 12px ${Ze?"rgba(0, 229, 204,0.4)":"rgba(0, 196, 174,0.4)"}`},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:u||Je.toolbar.createTask})]})]})]}),M&&!L&&jsxRuntime.jsx(Q2,{theme:t,forecast:M,currencyCode:F})]})}return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:t.bgGrid,borderColor:t.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(J2,{options:Tt,value:a,onChange:mt=>n(mt),theme:t}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.max(.5,r-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:t.textSecondary},whileHover:{backgroundColor:t.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("div",{className:"px-2 py-0.5 rounded text-[11px] tabular-nums min-w-[42px] text-center",style:{color:t.textSecondary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:[Math.round(r*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.min(2,r+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:t.textSecondary},whileHover:{backgroundColor:t.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}}),m&&jsxRuntime.jsx(pm,{theme:t,value:N??"all",onChange:m,maxDepth:k}),w&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}}),jsxRuntime.jsx(mm,{theme:t,value:h,onChange:w,hideCompleted:f,onHideCompletedChange:C})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[y&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[y,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}})]}),c&&g&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:g,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:u||Je.toolbar.createTask})]}),(Ct||p)&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:t.borderLight}})]}),jsxRuntime.jsx(um,{theme:t,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportMSProject:ge,onCopySnapshotLink:we}),p&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:t.borderLight}}),p&&jsxRuntime.jsx(X2,{options:At,value:s,onChange:mt=>i(mt),theme:t})]})]})}var Ba={texto:"var(--v6-texto, #0E1114)",texto2:"var(--v6-texto-2, #4D5761)",tenue:"var(--v6-tenue, #5F6972)",borde:"var(--v6-borde, #E2E5E9)",tarjeta:"var(--v6-tarjeta, #FFFFFF)",neutroFondo:"var(--v6-neutro-fondo, #E1E4E8)",segmentado:"var(--v6-segmentado, #E9ECEF)",acento:"var(--v6-acento, #0FA392)",acentoTexto:"var(--v6-acento-texto, #066A5F)",acentoFondo2:"var(--v6-acento-fondo-2, rgba(15,163,146,0.14))",acentoBordeSuave:"var(--v6-acento-borde-suave, rgba(8,127,114,0.55))",sobreAcento:"var(--v6-sobre-acento, #03231F)"},l5="'JetBrains Mono', ui-monospace, Menlo, monospace",wd={flex:"1 1 0",minWidth:0,height:30,boxSizing:"border-box",padding:"0 4px",borderRadius:8,border:`1px solid ${Ba.borde}`,background:Ba.tarjeta,color:Ba.texto,font:"inherit",fontSize:12};function qc({boton:e,children:t,alinear:a="izquierda",ancho:n=220}){let[r,o]=react.useState(false),s=react.useRef(null),i=react.useRef(null),[d,l]=react.useState({top:0,left:0});return react.useEffect(()=>{if(!r||!s.current)return;let p=s.current.getBoundingClientRect(),c=a==="derecha"?Math.max(8,p.right-n):Math.min(p.left,window.innerWidth-n-8);l({top:p.bottom+6,left:c});let u=h=>{let w=h.target;!s.current?.contains(w)&&!i.current?.contains(w)&&o(false);},g=h=>{h.key==="Escape"&&(o(false),s.current?.focus());};return document.addEventListener("mousedown",u),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",g);}},[r,a,n]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e(()=>o(p=>!p),r,s),r&&reactDom.createPortal(jsxRuntime.jsx("div",{ref:i,role:"menu","data-menu-v6":true,style:{position:"fixed",top:d.top,left:d.left,width:n,zIndex:99999,maxHeight:`calc(100vh - ${Math.round(d.top)+16}px)`,overflowY:"auto",padding:6,borderRadius:12,background:Ba.tarjeta,border:`1px solid ${Ba.borde}`,boxShadow:"0 12px 32px -8px rgba(14,17,20,0.25)",color:Ba.texto,fontSize:13},children:t(()=>o(false))}),document.body)]})}function sr({children:e,marcada:t,alPulsar:a,icono:n}){return jsxRuntime.jsxs("button",{type:"button",role:t===void 0?"menuitem":"menuitemcheckbox","aria-checked":t,onClick:a,className:"w-full flex items-center text-left",style:{gap:8,height:32,padding:"0 8px",borderRadius:8,background:"transparent",border:0,color:Ba.texto,font:"inherit",cursor:"pointer"},onMouseEnter:r=>{r.currentTarget.style.background=Ba.segmentado;},onMouseLeave:r=>{r.currentTarget.style.background="transparent";},children:[n&&jsxRuntime.jsx("span",{"aria-hidden":true,className:"flex items-center",style:{color:Ba.texto2},children:n}),jsxRuntime.jsx("span",{className:"flex-1",children:e}),t&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:Ba.acentoTexto},"aria-hidden":true})]})}function W0({es:e,elegidas:t,alternar:a,opciones:n}){let r=e?"Ver u ocultar columnas":"Show or hide columns";return jsxRuntime.jsx(qc,{alinear:"derecha",ancho:220,boton:(o,s,i)=>jsxRuntime.jsx("button",{ref:i,type:"button","data-columnas-v6":true,"aria-haspopup":"menu","aria-expanded":s,"aria-label":r,title:r,onClick:o,style:{flex:"none",width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:Ba.tenue,cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-[13px] h-[13px]",strokeWidth:2,"aria-hidden":true})}),children:()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:e?"Columnas":"Columns"}),n.map(o=>jsxRuntime.jsx(sr,{marcada:t.includes(o.id),alPulsar:()=>a(o.id),children:e?o.es:o.en},o.id))]})})}function d5({alGuardar:e,texto:t,guardar:a}){let[n,r]=react.useState(""),o=()=>{let s=n.trim();s&&(e(s),r(""));};return jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:6,padding:"2px 8px 6px"},children:[jsxRuntime.jsx("input",{"data-nombre-de-vista":true,value:n,placeholder:t,"aria-label":t,onChange:s=>r(s.target.value),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&o();},style:{...wd,padding:"0 8px"}}),jsxRuntime.jsx("button",{type:"button","data-guardar-vista":true,onClick:o,disabled:!n.trim(),style:{flex:"none",height:30,padding:"0 10px",border:0,borderRadius:8,background:Ba.acento,color:Ba.sobreAcento,font:"inherit",fontSize:12,fontWeight:500,cursor:"pointer",opacity:n.trim()?1:.5},children:a})]})}function uo({children:e}){return jsxRuntime.jsx("div",{style:{padding:"6px 8px 4px",fontSize:11,fontWeight:500,color:Ba.tenue},children:e})}function co(){return jsxRuntime.jsx("div",{"aria-hidden":true,style:{height:1,margin:"4px 2px",background:Ba.borde}})}var _c={height:36,boxSizing:"border-box",display:"flex",alignItems:"center",gap:6,borderRadius:10,font:"inherit",fontWeight:500,cursor:"pointer",whiteSpace:"nowrap"};function U0(e){let t=Sr(),a=t.toolbar.today==="Hoy",n=(k,x)=>a?k:x,r=[{valor:"all",etiqueta:n("Todas","All")},{valor:"incomplete",etiqueta:n("Por hacer","To do")},{valor:"in_progress",etiqueta:n("En progreso","In progress")},{valor:"completed",etiqueta:n("Completadas","Completed")},{valor:"overdue",etiqueta:n("Vencidas","Overdue")}],[o,s]=react.useState("carta"),[i,d]=react.useState("todo"),l=e.filtros??cs,p=(e.taskFilter!=="all"?1:0)+bd(l),c=k=>e.onFiltrosChange?.({...l,...k}),u=(k,x)=>k.includes(x)?k.filter(I=>I!==x):[...k,x],g={urgent:n("Urgente","Urgent"),high:n("Alta","High"),medium:n("Media","Medium"),low:n("Baja","Low")},h=k=>k===Wc?n("Sin responsable","Unassigned"):k,w=k=>e.opcionesDeFiltro?.fases.find(x=>x.id===k)?.nombre??k,f=k=>k.length>1?`${k[0]} +${k.length-1}`:k[0]??"",C=e.opcionesDeFiltro,y=[{valor:"compact",etiqueta:n("Compacta","Compact")},{valor:"comfortable",etiqueta:n("Normal","Normal")},{valor:"spacious",etiqueta:n("C\xF3moda","Comfortable")}],N=y.find(k=>k.valor===e.rowDensity)??y[1],m=[!e.onExportarDocumento&&e.onExportPNG&&{id:"png",etiqueta:n("Exportar imagen (PNG)","Export image (PNG)"),f:e.onExportPNG},!e.onExportarDocumento&&e.onExportPDF&&{id:"pdf",etiqueta:n("Exportar PDF","Export PDF"),f:e.onExportPDF},e.onExportExcel&&{id:"xlsx",etiqueta:n("Exportar Excel","Export Excel"),f:e.onExportExcel},e.onExportMSProject&&{id:"msp",etiqueta:n("Exportar a MS Project","Export to MS Project"),f:e.onExportMSProject}].filter(Boolean);return jsxRuntime.jsxs("div",{"data-barra-v6":true,className:"flex flex-wrap items-center min-w-0",style:{gap:8,flex:"1 1 auto",fontSize:13,color:Ba.texto},children:[e.onTaskFilterChange&&jsxRuntime.jsx(qc,{ancho:280,boton:(k,x,I)=>jsxRuntime.jsxs("button",{ref:I,type:"button","aria-haspopup":"menu","aria-expanded":x,onClick:k,"data-boton-filtros-v6":true,style:{..._c,padding:"0 8px 0 10px",background:Ba.tarjeta,color:Ba.texto,border:`1px solid ${p?Ba.acentoBordeSuave:Ba.borde}`},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-[15px] h-[15px]",style:{color:p?Ba.acentoTexto:Ba.texto2},"aria-hidden":true}),n("Filtros","Filters"),p>0&&jsxRuntime.jsx("span",{style:{fontFamily:l5,fontSize:11,fontWeight:500,color:Ba.acentoTexto,padding:"1px 6px",borderRadius:6,background:Ba.acentoFondo2},children:p})]}),children:k=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:n("Estado de la tarea","Task status")}),r.map(x=>jsxRuntime.jsx(sr,{marcada:e.taskFilter===x.valor&&!e.hideCompleted,alPulsar:()=>{e.onTaskFilterChange?.(x.valor),e.onHideCompletedChange?.(false),k();},children:x.etiqueta},x.valor)),e.onFiltrosChange&&C&&(C.responsables.length>0||C.haySinResponsable)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Responsable","Assignee")}),[...C.responsables,...C.haySinResponsable?[Wc]:[]].map(x=>jsxRuntime.jsx(sr,{marcada:l.responsables.includes(x),alPulsar:()=>c({responsables:u(l.responsables,x)}),children:h(x)},x))]}),e.onFiltrosChange&&C&&C.fases.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Fase","Phase")}),C.fases.map(x=>jsxRuntime.jsx(sr,{marcada:l.fases.includes(x.id),alPulsar:()=>c({fases:u(l.fases,x.id)}),children:x.nombre},x.id))]}),e.onFiltrosChange&&C&&C.prioridades.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Prioridad","Priority")}),C.prioridades.map(x=>jsxRuntime.jsx(sr,{marcada:l.prioridades.includes(x),alPulsar:()=>c({prioridades:u(l.prioridades,x)}),children:g[x]??x},x))]}),e.onFiltrosChange&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Fechas","Dates")}),jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:6,padding:"2px 8px 6px"},children:[jsxRuntime.jsx("input",{type:"date","aria-label":n("Desde","From"),value:l.desde??"",max:l.hasta??void 0,"data-filtro-desde":true,onChange:x=>c({desde:x.target.value||null}),style:wd}),jsxRuntime.jsx("span",{"aria-hidden":true,style:{color:Ba.tenue},children:"\u2013"}),jsxRuntime.jsx("input",{type:"date","aria-label":n("Hasta","To"),value:l.hasta??"",min:l.desde??void 0,"data-filtro-hasta":true,onChange:x=>c({hasta:x.target.value||null}),style:wd})]})]}),p>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(sr,{alPulsar:()=>{e.onTaskFilterChange?.("all"),e.onFiltrosChange?.(cs),k();},children:n("Quitar todos los filtros","Clear all filters")})]}),e.onGuardarVista&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Vistas guardadas","Saved views")}),(e.vistasGuardadas??[]).map(x=>jsxRuntime.jsxs("div",{className:"flex items-center","data-vista-guardada":x.nombre,children:[jsxRuntime.jsx("div",{className:"flex-1 min-w-0",children:jsxRuntime.jsx(sr,{alPulsar:()=>{e.onAplicarVista?.(x),k();},children:x.nombre})}),jsxRuntime.jsx("button",{type:"button","aria-label":`${n("Borrar vista","Delete view")} ${x.nombre}`,onClick:()=>e.onBorrarVista?.(x.nombre),style:{flex:"none",width:24,height:24,padding:0,border:0,borderRadius:6,background:"transparent",color:Ba.tenue,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3",strokeWidth:2,"aria-hidden":true})})]},x.nombre)),jsxRuntime.jsx(d5,{alGuardar:e.onGuardarVista,texto:n("Guardar la vista actual","Save current view"),guardar:n("Guardar","Save")})]})]})}),e.taskFilter!=="all"&&jsxRuntime.jsx(yd,{texto:r.find(k=>k.valor===e.taskFilter)?.etiqueta??e.taskFilter,quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>e.onTaskFilterChange?.("all")}),l.responsables.length>0&&jsxRuntime.jsx(yd,{texto:f(l.responsables.map(h)),quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({responsables:[]})}),l.fases.length>0&&jsxRuntime.jsx(yd,{texto:f(l.fases.map(w)),quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({fases:[]})}),l.prioridades.length>0&&jsxRuntime.jsx(yd,{texto:f(l.prioridades.map(k=>g[k]??k)),quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({prioridades:[]})}),(l.desde||l.hasta)&&jsxRuntime.jsx(yd,{texto:`${l.desde??"\u2026"} \u2013 ${l.hasta??"\u2026"}`,quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({desde:null,hasta:null})}),jsxRuntime.jsx("div",{"aria-hidden":true,style:{flex:"1 1 0",minWidth:0}}),jsxRuntime.jsx("div",{role:"group","aria-label":n("Escala de tiempo","Time scale"),className:"flex items-center",style:{height:36,boxSizing:"border-box",gap:2,padding:"0 2px",border:`1px solid ${Ba.borde}`,borderRadius:10,background:Ba.segmentado},children:[["day",n("D","D"),n("D\xEDa","Day")],["week",n("S","W"),n("Semana","Week")],["month",n("M","M"),n("Mes","Month")],["quarter",n("T","Q"),n("Trimestre","Quarter")],["year",n("A","Y"),n("A\xF1o","Year")]].map(([k,x,I])=>{let M=e.timeScale===k;return jsxRuntime.jsx("button",{type:"button","aria-pressed":M,"aria-label":I,title:I,"data-escala-v6":k,onClick:()=>e.onTimeScaleChange(k),style:{width:32,height:30,padding:0,border:0,borderRadius:8,font:"inherit",fontWeight:500,cursor:"pointer",background:M?"var(--v6-escala-activa, #FFFFFF)":"transparent",boxShadow:M?"var(--v6-escala-sombra, 0 1px 2px rgba(14,17,20,0.14))":"none",color:M?Ba.texto:Ba.texto2},children:x},k)})}),e.toolbarRightContent,jsxRuntime.jsx(qc,{alinear:"derecha",ancho:264,boton:(k,x,I)=>jsxRuntime.jsxs("button",{ref:I,type:"button","aria-haspopup":"menu","aria-expanded":x,onClick:k,"data-menu-vista-v6":true,"aria-label":`${n("Vista","View")}: ${N.etiqueta}`,style:{..._c,padding:"0 8px 0 10px",border:0,background:"transparent",color:Ba.texto},children:[jsxRuntime.jsx(lucideReact.Rows3,{className:"w-[15px] h-[15px]",style:{color:Ba.texto2},"aria-hidden":true}),n("Vista","View"),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5",style:{color:Ba.tenue},"aria-hidden":true})]}),children:k=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:n("Densidad de filas","Row density")}),y.map(x=>jsxRuntime.jsx(sr,{marcada:e.rowDensity===x.valor,alPulsar:()=>{e.onRowDensityChange(x.valor),k();},children:x.etiqueta},x.valor)),e.onAjustarAlProyecto&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(sr,{alPulsar:()=>{e.onAjustarAlProyecto?.(),k();},children:n("Ajustar al proyecto","Fit to project")})]}),e.contenidoDeVista&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),e.contenidoDeVista(k)]}),(e.onHideCompletedChange||e.onLeyendaVisibleChange)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Mostrar","Show")}),e.onHideCompletedChange&&jsxRuntime.jsx(sr,{marcada:e.hideCompleted,alPulsar:()=>{let x=!e.hideCompleted;e.onHideCompletedChange?.(x),x&&e.onTaskFilterChange?.("all"),k();},children:n("Ocultar completadas","Hide completed")}),e.onLeyendaVisibleChange&&jsxRuntime.jsx(sr,{marcada:!!e.leyendaVisible,alPulsar:()=>{e.onLeyendaVisibleChange?.(!e.leyendaVisible),k();},children:n("Leyenda","Legend")})]}),jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Ver","Show")}),e.onShowCriticalPathChange&&jsxRuntime.jsx(sr,{marcada:e.showCriticalPath,alPulsar:()=>e.onShowCriticalPathChange?.(!e.showCriticalPath),children:n("Ruta cr\xEDtica","Critical path")}),e.onHighlightWeekendsChange&&jsxRuntime.jsx(sr,{marcada:e.highlightWeekends,alPulsar:()=>e.onHighlightWeekendsChange?.(!e.highlightWeekends),children:n("Fines de semana y festivos","Weekends and holidays")}),e.onShowDependenciesChange&&e.hasDependencies!==false&&jsxRuntime.jsx(sr,{marcada:e.showDependencies,alPulsar:()=>e.onShowDependenciesChange?.(!e.showDependencies),children:n("Dependencias","Dependencies")}),e.onWbsLevelChange&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Nivel de la estructura","Structure level")}),["all",...Array.from({length:Math.max(1,e.maxWbsDepth??4)},(x,I)=>I+1)].map(x=>jsxRuntime.jsx(sr,{marcada:(e.wbsLevel??"all")===x,alPulsar:()=>{e.onWbsLevelChange?.(x),k();},children:x==="all"?n("Todos los niveles","All levels"):`${n("Hasta el nivel","Up to level")} ${x}`},String(x)))]}),e.onViewModeChange&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Modo","Mode")}),["execution","oracle"].map(x=>jsxRuntime.jsx(sr,{marcada:e.viewMode===x,alPulsar:()=>{e.onViewModeChange?.(x),k();},children:x==="execution"?t.toolbar.viewExecution:t.toolbar.viewOracle},x))]})]})}),jsxRuntime.jsx(qc,{alinear:"derecha",ancho:248,boton:(k,x,I)=>jsxRuntime.jsx("button",{ref:I,type:"button","aria-haspopup":"menu","aria-expanded":x,onClick:k,"aria-label":n("M\xE1s opciones: exportar, compartir","More options: export, share"),title:n("M\xE1s opciones","More options"),style:{..._c,width:36,justifyContent:"center",padding:0,border:0,background:"transparent",color:Ba.texto2},children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-4 h-4","aria-hidden":true})}),children:k=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.onExportarDocumento&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:n("Exportar","Export")}),jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:6,padding:"2px 8px 6px"},children:[jsxRuntime.jsxs("select",{"aria-label":n("Papel","Paper"),"data-papel":true,value:o,onChange:x=>s(x.target.value),style:wd,children:[jsxRuntime.jsx("option",{value:"carta",children:n("Carta","Letter")}),jsxRuntime.jsx("option",{value:"a4",children:"A4"}),jsxRuntime.jsx("option",{value:"plotter",children:n("Plotter (A1)","Plotter (A1)")})]}),jsxRuntime.jsxs("select",{"aria-label":n("Rango","Range"),"data-rango":true,value:i,onChange:x=>d(x.target.value),style:wd,children:[jsxRuntime.jsx("option",{value:"todo",children:n("Todo","Everything")}),jsxRuntime.jsx("option",{value:"vista",children:n("Lo que se ve","Current view")})]})]}),jsxRuntime.jsx(sr,{alPulsar:()=>{k(),e.onExportarDocumento?.("pdf",{papel:o,rango:i});},children:n("Exportar PDF","Export PDF")}),jsxRuntime.jsx(sr,{alPulsar:()=>{k(),e.onExportarDocumento?.("png",{papel:o,rango:i});},children:n("Exportar imagen (PNG)","Export image (PNG)")})]}),m.map(x=>jsxRuntime.jsx(sr,{alPulsar:()=>{k(),x.f();},children:x.etiqueta},x.id)),e.onCopySnapshotLink&&jsxRuntime.jsx(sr,{alPulsar:()=>{k(),e.onCopySnapshotLink?.();},children:n("Copiar enlace","Copy link")}),(e.masOpciones?.length??0)>0&&jsxRuntime.jsx(co,{}),e.masOpciones?.map(x=>jsxRuntime.jsx(sr,{icono:x.icono,alPulsar:()=>{k(),x.alPulsar();},children:x.etiqueta},x.id))]})}),e.showCreateTaskButton&&e.onCreateTask&&jsxRuntime.jsxs("button",{type:"button","data-nueva-tarea-v6":true,onClick:e.onCreateTask,style:{..._c,padding:"0 14px 0 11px",border:0,background:Ba.acento,color:Ba.sobreAcento,fontWeight:600},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-[15px] h-[15px]",strokeWidth:2.2,"aria-hidden":true}),e.createTaskLabel||n("Nueva tarea","New task")]})]})}function yd({texto:e,quitar:t,alQuitar:a}){return jsxRuntime.jsxs("span",{"data-filtro-activo-v6":true,className:"flex items-center whitespace-nowrap",style:{height:28,boxSizing:"border-box",gap:2,padding:"0 3px 0 10px",borderRadius:8,background:Ba.neutroFondo,color:Ba.texto2,fontSize:12},children:[e,jsxRuntime.jsx("button",{type:"button","aria-label":`${t} ${e}`,onClick:a,className:"flex items-center justify-center",style:{width:22,height:22,padding:0,border:0,borderRadius:6,background:"transparent",color:Ba.tenue,cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3",strokeWidth:2,"aria-hidden":true})})]})}function G0(e,t=0){let a=e.trim();if(t<12||t>=a.length)return {comienzo:a,cola:""};let n=t;for(;n>0&&!/\s/.test(a[n-1]??"");)n--;let r=a.slice(0,n).trimEnd();return r?{comienzo:r,cola:a.slice(r.length)}:{comienzo:a,cola:""}}function c5(e,t){let a=Math.min(e.length,t.length),n=0;for(;n<a&&e[n]===t[n];)n++;return n}function _0(e){let t=e.map(a=>a.trim());return t.map((a,n)=>{let r=0;for(let o=0;o<t.length;o++)o!==n&&(r=Math.max(r,c5(a,t[o]??"")));return r})}function q0(e,t){return [...e.map(a=>a.wbsCode?`${a.wbsCode} ${a.name}`:a.name),t].join(" \u203A ")}var K0=["critico","alto","medio","bajo"],Y0={es:{critico:"Cr\xEDtico",alto:"Alto",medio:"Medio",bajo:"Bajo"},en:{critico:"Critical",alto:"High",medio:"Medium",bajo:"Low"}},fl=(e,t)=>(t?Y0.es:Y0.en)[e],bl=e=>[...e].sort((t,a)=>K0.indexOf(t.nivel)-K0.indexOf(a.nivel))[0];function u5(e,t){let a=bl(e);if(!a)return "";let n=e.length>1?t?` (y ${e.length-1} m\xE1s)`:` (and ${e.length-1} more)`:"";return `${t?"Riesgo":"Risk"} ${a.codigo} \xB7 ${fl(a.nivel,t)}${n}`}function p5({nivel:e,tam:t=8}){let a=e==="bajo",n=e==="critico"?"var(--v6-rojo-punto, #D13A40)":e==="alto"?"var(--v6-ambar-punto, #9A5B00)":"var(--v6-tenue, #5F6972)";return jsxRuntime.jsx("i",{"aria-hidden":"true",style:{width:t,height:t,borderRadius:"50%",display:"inline-block",flex:"none",boxSizing:"border-box",background:a?"none":n,border:a?`1.5px solid ${n}`:0}})}function X0(e,t){let a=bl(e);if(!a)return "";let n=e.length>1?t?` (y ${e.length-1} m\xE1s)`:` (and ${e.length-1} more)`:"";return `${t?"Riesgo":"Risk"} ${a.codigo} \xB7 ${fl(a.nivel,t)}${a.titulo?`: ${a.titulo}`:""}${n}`}function Ms({riesgos:e,es:t,className:a="kc-risk"}){let n=e?.length?bl(e):void 0;if(!n)return null;let r=X0(e,t);return jsxRuntime.jsx("span",{className:a,"data-nivel":n.nivel,"data-punto-riesgo":n.nivel,role:"img","aria-label":r,title:r,children:jsxRuntime.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M8 2l5 2v4c0 3-2.2 5.3-5 6-2.8-.7-5-3-5-6V4z"})})})}function J0({riesgos:e,es:t}){let a=e?.length?bl(e):void 0;if(!a)return null;let n=u5(e,t);return jsxRuntime.jsx("span",{role:"img","aria-label":n,title:n,"data-punto-riesgo":a.nivel,style:{display:"inline-flex",flex:"none"},children:jsxRuntime.jsx(p5,{nivel:a.nivel})})}var m5=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],g5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ga(e,t,a=new Date){let n=e.getFullYear()!==a.getFullYear();return !t||t.toLowerCase().startsWith("es")?`${e.getDate()} ${m5[e.getMonth()]}${n?` ${e.getFullYear()}`:""}`:`${g5[e.getMonth()]} ${e.getDate()}${n?`, ${e.getFullYear()}`:""}`}var kr=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),f5=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Cd=(e,t)=>{let a=kr(e);return a.setDate(a.getDate()+t),a},Zs=(e,t)=>kr(e).getTime()<kr(t).getTime(),hl={esHabil:()=>true};function Ur(e){if(!e)return hl;let t=e.enabledWeekdays&&e.enabledWeekdays.length===7?e.enabledWeekdays:null,a=e.holidayDates?e.holidayDates instanceof Set?e.holidayDates:new Set(e.holidayDates):null;return t&&!t.some(Boolean)?hl:{esHabil:n=>(!t||!!t[n.getDay()])&&!(a&&a.has(f5(n)))}}function ei(e,t,a=false){let n=kr(e);for(let r=0;r<3660&&!t.esHabil(n);r++)n=Cd(n,a?-1:1);return n}function po(e,t,a){if(t===0)return ei(e,a);let n=kr(e),r=t>0?1:-1,o=Math.abs(t);for(let s=0;s<36600&&o>0;s++)n=Cd(n,r),a.esHabil(n)&&o--;return n}function Q0(e,t,a,n){let r=kr(t).getTime()!==kr(e.inicio).getTime(),o=kr(a).getTime()-kr(t).getTime()===kr(e.fin).getTime()-kr(e.inicio).getTime();if(!r||!o)return {inicio:t,fin:a};let s=ei(t,n,t<e.inicio);return {inicio:s,fin:Ai(s,fr(e.inicio,e.fin,n),n)}}function Li(e,t,a){let n=kr(e),r=kr(t),o=r.getTime()>=n.getTime()?1:-1,[s,i]=o>0?[n,r]:[r,n],d=0;for(let l=Cd(s,1);l.getTime()<=i.getTime();l=Cd(l,1))a.esHabil(l)&&d++;return d*o}function fr(e,t,a){let n=kr(e),r=kr(t);if(r.getTime()<n.getTime())return 1;let o=0;for(let s=n;s.getTime()<=r.getTime();s=Cd(s,1))a.esHabil(s)&&o++;return Math.max(1,o)}function Ai(e,t,a){return po(ei(e,a),Math.max(1,t)-1,a)}function ps(e){let t=new Map((e.dependencyLinks??[]).map(n=>[n.id,n]));return [...new Set([...e.dependencies??[],...t.keys()])].map(n=>t.get(n)??{id:n,type:"FS",lag:0})}function Td(e,t=new Map){for(let a of e)t.set(a.id,a),a.subtasks?.length&&Td(a.subtasks,t);return t}function Kc(e,t,a){if(!t.startDate||!t.endDate)return null;switch(e.type){case "FS":return {inicioMin:po(t.endDate,1+e.lag,a),enlace:e,predecesora:t};case "SS":return {inicioMin:po(t.startDate,e.lag,a),enlace:e,predecesora:t};case "FF":return {finMin:po(t.endDate,e.lag,a),enlace:e,predecesora:t};case "SF":return {finMin:po(t.startDate,e.lag,a),enlace:e,predecesora:t}}}function $i(e,t,a,n,r){let o=n instanceof Map?n:Td(n),s=e.isMilestone?1:fr(t,a,r),i=e.isMilestone?kr(a):kr(t),d=null;for(let l=0;l<8;l++){let p=false;e.noAntesDe&&Zs(i,e.noAntesDe)&&(i=ei(new Date(e.noAntesDe),r),d={inicioMin:new Date(e.noAntesDe),enlace:{id:e.id,type:"FS",lag:0},predecesora:e,restriccion:true},p=true);let c=e.isMilestone?i:Ai(i,s,r);for(let u of ps(e)){let g=o.get(u.id);if(!g||g.id===e.id)continue;let h=Kc(u,g,r);h&&(h.inicioMin&&Zs(i,h.inicioMin)?(i=ei(h.inicioMin,r),d=h,p=true):h.finMin&&Zs(c,h.finMin)&&(i=e.isMilestone?ei(h.finMin,r):po(h.finMin,-(s-1),r),d=h,p=true));}if(!p)break}return d?{inicio:i,fin:e.isMilestone?i:Ai(i,s,r),porQue:d}:{inicio:t,fin:a,porQue:null}}function vl(e,t,a){let n=Td(e),r=new Map;for(let d of n.values())for(let l of ps(d)){let p=r.get(l.id)??[];p.push(d.id),r.set(l.id,p);}let o=[...t],s=new Map,i=0;for(;o.length>0&&i++<2e4;){let d=o.shift();for(let l of r.get(d)??[]){let p=n.get(l);if(!p?.startDate||!p.endDate||p.fijada)continue;let c=$i(p,p.startDate,p.endDate,n,a);if(!c.porQue)continue;let u={...p,startDate:c.inicio,endDate:c.fin};n.set(l,u),s.set(l,{id:l,startDate:c.inicio,endDate:c.fin,porQue:c.porQue}),o.push(l);}}return [...s.values()]}function Yc(e,t){let a=Td(e),n=[];for(let r of a.values())if(!(!r.startDate||!r.endDate))for(let o of ps(r)){let s=a.get(o.id);if(!s)continue;let i=Kc(o,s,t);if(!i)continue;let d=r.isMilestone?r.startDate:r.endDate,l=0;i.inicioMin&&Zs(r.startDate,i.inicioMin)?l=fr(r.startDate,i.inicioMin,t)-1:i.finMin&&Zs(d,i.finMin)&&(l=fr(d,i.finMin,t)-1),(l>0||i.inicioMin&&Zs(r.startDate,i.inicioMin)||i.finMin&&Zs(d,i.finMin))&&n.push({sucesora:r,predecesora:s,enlace:o,dias:Math.max(1,l)});}return n}function Z0(e){return !!e.terminarEl&&!!e.endDate&&Zs(new Date(e.terminarEl),new Date(e.endDate))}function eh(e,t){let a=[...Td(e).values()].filter(w=>w.startDate&&w.endDate),n=new Map;if(a.length===0)return n;let r=a.reduce((w,f)=>f.startDate<w?f.startDate:w,a[0].startDate),o=a.reduce((w,f)=>f.endDate>w?f.endDate:w,a[0].endDate),s=new Map,i=w=>{let f=kr(w).getTime(),C=s.get(f);return C===void 0&&(C=Li(r,w,t),s.set(f,C)),C},d=new Map(a.map(w=>[w.id,{es:i(w.startDate),ef:i(w.endDate),dur:fr(w.startDate,w.endDate,t)}])),l=i(o),p=new Map,c=(w,f)=>{let C=p.get(w);C?C.push(f):p.set(w,[f]);};for(let w of a){for(let f of ps(w))d.has(f.id)&&c(f.id,{hacia:w.id,tipo:f.type,lag:f.lag});for(let f of w.subtasks??[])d.has(f.id)&&c(f.id,{hacia:w.id,tipo:"FF",lag:0});}let u=new Map,g=new Set,h=w=>{let f=u.get(w);if(f!==void 0)return f;let C=d.get(w);if(g.has(w))return l;g.add(w);let y=l;for(let N of p.get(w)??[]){let m=h(N.hacia),k=m-d.get(N.hacia).dur+1,x=N.tipo==="FS"?k-1-N.lag:N.tipo==="SS"?k-N.lag+C.dur-1:N.tipo==="FF"?m-N.lag:m-N.lag+C.dur-1;y=Math.min(y,x);}return g.delete(w),u.set(w,y),y};for(let w of a){let f=d.get(w.id),C=h(w.id)-f.ef,y=l-f.ef;for(let N of p.get(w.id)??[]){if(w.subtasks?.some(x=>x.id===N.hacia))continue;let m=d.get(N.hacia),k=N.tipo==="FS"?m.es-f.ef-1-N.lag:N.tipo==="SS"?m.es-f.es-N.lag:N.tipo==="FF"?m.ef-f.ef-N.lag:m.ef-f.es-N.lag;y=Math.min(y,k);}n.set(w.id,{total:C,libre:Math.max(0,Math.min(y,Math.max(C,0))),critica:C<=0});}return n}var xl=[{id:"duration",es:"Duraci\xF3n",en:"Duration",ancho:52},{id:"predecessors",es:"Predecesoras",en:"Predecessors",ancho:92},{id:"hours",es:"Horas",en:"Hours",ancho:48},{id:"cost",es:"Costo",en:"Cost",ancho:80},{id:"slack",es:"Holgura",en:"Slack",ancho:56},{id:"baselineEnd",es:"Fin L. base",en:"Baseline end",ancho:72},{id:"variance",es:"Variaci\xF3n",en:"Variance",ancho:64}];function th(e){return e.subtasks?.length?e.subtasks.reduce((t,a)=>t+th(a),0):e.effortMinutes??0}function ah(e,t){return e.subtasks?.length?e.subtasks.reduce((a,n)=>a+ah(n,t),0):(e.effortMinutes??0)/60*t(e)}function Xc(e,t){return !e.baselineEndDate||!e.endDate?null:Li(new Date(e.baselineEndDate),new Date(e.endDate),t)}var Ps="\u2014";function bm(e,t,a){let n=!!t.subtasks?.length;switch(e){case "duration":return t.startDate&&t.endDate?`${fr(new Date(t.startDate),new Date(t.endDate),a.cal)} d`:Ps;case "predecessors":{let r=ps(t);return r.length?r.map(o=>{let s=a.wbsDe.get(o.id)??"?",i=o.lag?`${o.lag>0?"+":""}${o.lag}`:"";return o.type==="FS"&&!i?s:`${s}${o.type}${i}`}).join(", "):Ps}case "hours":{let r=th(t);return r?`${Math.round(r/60*10)/10} h`:Ps}case "cost":{if(!a.tarifa)return Ps;let r=ah(t,a.tarifa);return r?a.dinero?a.dinero(r):String(Math.round(r)):Ps}case "slack":return !n&&t.cpmData?`${t.cpmData.totalFloat} d`:Ps;case "baselineEnd":return t.baselineEndDate?ga(new Date(t.baselineEndDate),a.es?"es":"en"):Ps;case "variance":{let r=Xc(t,a.cal);return r===null?Ps:`${r>0?"+":""}${r} d`}default:return Ps}}function nh(e,t,a){if(e==="slack"&&t.cpmData&&!t.subtasks?.length)return t.cpmData.totalFloat<=0?"rojo":null;if(e==="variance"){let n=Xc(t,a);return n===null||n===0?null:n>0?"rojo":"verde"}return null}function Jc({columns:e,onToggleColumn:t,theme:a}){let n=Sr(),[r,o]=react.useState(false),[s,i]=react.useState({x:0,y:0}),d=react.useRef(null),l=react.useRef(null);react.useEffect(()=>{if(!r)return;let c=u=>{d.current&&!d.current.contains(u.target)&&o(false);};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[r]);let p=e.filter(c=>c.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:l,onClick:()=>{if(!r&&l.current){let c=l.current.getBoundingClientRect();i({x:c.left,y:c.bottom+4});}o(!r);},className:"p-2 rounded-md transition-colors flex items-center gap-1",title:n.toolbar.columns||"Columns","aria-label":n.toolbar.columns||"Columns",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`,color:a.textSecondary},whileHover:{backgroundColor:a.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Columns3,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(yn,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:d,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),p.map(c=>jsxRuntime.jsxs("button",{onClick:()=>{t(c.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:a.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor=a.hoverBg;},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:c.label}),c.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:a.accent}})]},c.id))]})})})})]})}function yl({isOpen:e,x:t,y:a,items:n,onClose:r,theme:o}){let s=react.useRef(null),[i,d]=react.useState({x:t,y:a});if(react.useEffect(()=>{if(!e)return;let p=200,c=n.filter(C=>!C.separator).length*36+n.filter(C=>C.separator).length*9+8,u=8,g=window.innerWidth,h=window.innerHeight,w=t,f=a;t+p+u>g&&(w=t-p,w<u&&(w=u)),a+c+u>h&&(f=h-c-u,f<u&&(f=u)),d({x:w,y:f});},[e,t,a,n.length]),react.useEffect(()=>{if(!e)return;let p=u=>{s.current&&!s.current.contains(u.target)&&r();},c=u=>{u.key==="Escape"&&r();};return document.addEventListener("mousedown",p),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",c);}},[e,r]),!e)return null;let l=p=>p.startsWith("#")&&(p.length===7||p.length===4)?p:o.bgPrimary?.includes("1")||o.bgPrimary?.includes("2")||o.textPrimary?.toLowerCase().includes("fff")||o.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:s,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${i.x}px`,top:`${i.y}px`,backgroundColor:l(o.bgSecondary),border:`1px solid ${o.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsxRuntime.jsx("div",{className:"py-1",children:n.map(p=>jsxRuntime.jsxs("div",{children:[p.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:o.borderLight}}),!(p.separator&&!p.label)&&jsxRuntime.jsxs("button",{onClick:()=>{p.disabled||(p.onClick(),r());},disabled:p.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:p.disabled?o.textTertiary:o.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?.5:1},onMouseEnter:c=>{p.disabled||(c.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="transparent";},children:[p.icon&&jsxRuntime.jsx("span",{style:{color:o.textSecondary},children:p.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:p.label}),p.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:o.textTertiary}})]})]},p.id))})})})}var ka={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Pencil:jsxRuntime.jsx(lucideReact.Pencil,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),AddSubtask:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"}),Duplicate:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),Milestone:jsxRuntime.jsx(lucideReact.Diamond,{className:"w-4 h-4"}),Indent:jsxRuntime.jsx(lucideReact.IndentIncrease,{className:"w-4 h-4"}),Outdent:jsxRuntime.jsx(lucideReact.IndentDecrease,{className:"w-4 h-4"}),MarkIncomplete:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),SetInProgress:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"})};function ch({tasks:e,selectedTaskIds:t,onTaskSelect:a,onTaskCreate:n,onTaskDelete:r,onTaskDuplicate:o,onTaskMove:s,onTaskIndent:i,onTaskOutdent:d,onTaskRename:l,onTaskToggleExpand:p,onOpenTaskModal:c,enableKeyboard:u=true,v6:g}){let h=react.useRef(false),w=react.useCallback(m=>{h.current=m;},[]),f=react.useCallback(m=>{let k=[],x=I=>{for(let M of I)k.push(M),M.subtasks&&M.subtasks.length>0&&M.isExpanded&&x(M.subtasks);};return x(m),k},[]),C=react.useCallback(()=>{let m=f(e);for(let k of m)if(t.has(k.id))return k;return null},[e,t,f]),y=react.useCallback((m,k)=>{let x=f(e);if(x.length===0)return;let I=C();if(!I){a(x[0].id,false);return}let M=x.findIndex(H=>H.id===I.id);if(M===-1)return;let L=m==="up"?M-1:M+1;if(L<0||L>=x.length)return;let F=x[L];a(F.id,k);},[e,C,f,a]),N=react.useCallback(m=>{if(!u)return;let k=m.target;if(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable||h.current){m.key==="Escape"&&(k.blur(),h.current=false);return}let M=navigator.platform.toUpperCase().indexOf("MAC")>=0?m.metaKey:m.ctrlKey,L=Array.from(t),F=C();if(g){let H=k.closest?.("[data-task-row]");if(!H||k!==H&&(m.key==="Enter"||m.key===" ")||m.key==="Tab")return;let z=f(e),Y=H.getAttribute("data-task-row"),P=z.findIndex(ge=>ge.id===Y),B=z[P]??F;if((m.key==="ArrowUp"||m.key==="ArrowDown")&&!m.altKey&&!m.shiftKey){m.preventDefault();let ge=z[P+(m.key==="ArrowUp"?-1:1)];ge&&a(ge.id,false);return}if(m.altKey&&m.shiftKey&&L.length>0&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){m.preventDefault(),m.key==="ArrowRight"?i(L):d(L);return}if(m.altKey&&B&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){m.preventDefault(),g.moverDias?.(B,m.key==="ArrowRight"?1:-1);return}if(B&&!m.altKey&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){m.preventDefault();let ge=!!B.subtasks?.length;if(m.key==="ArrowRight"){if(ge&&!B.isExpanded)p(B.id);else if(ge){let ae=z[P+1];ae&&a(ae.id,false);}}else if(ge&&B.isExpanded)p(B.id);else {let ae=z.find(xe=>xe.subtasks?.some(V=>V.id===B.id));ae&&a(ae.id,false);}return}if(m.key==="Enter"&&!m.shiftKey&&!M&&B){m.preventDefault(),g.abrirPanel(B);return}if(m.key==="Home"||m.key==="End"){let ge=m.key==="Home"?z[0]:z[z.length-1];ge&&(m.preventDefault(),a(ge.id,false));return}}if(m.key==="ArrowUp"&&!m.altKey){m.preventDefault(),y("up",m.shiftKey);return}if(m.key==="ArrowDown"&&!m.altKey){m.preventDefault(),y("down",m.shiftKey);return}if(F&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){F.subtasks&&F.subtasks.length>0&&(m.preventDefault(),(m.key==="ArrowRight"&&!F.isExpanded||m.key==="ArrowLeft"&&F.isExpanded)&&p(F.id));return}if(m.altKey&&(m.key==="ArrowUp"||m.key==="ArrowDown")){L.length>0&&(m.preventDefault(),s(L,m.key==="ArrowUp"?"up":"down"));return}if(m.key==="Tab"&&!m.shiftKey){L.length>0&&(m.preventDefault(),i(L));return}if(m.key==="Tab"&&m.shiftKey){L.length>0&&(m.preventDefault(),d(L));return}if(m.key==="Enter"&&!m.shiftKey&&!M){F&&(m.preventDefault(),n(F.id,"below"));return}if(m.key==="Enter"&&m.shiftKey&&!M){F&&(m.preventDefault(),n(F.id,"above"));return}if(m.key==="Enter"&&M){F&&(m.preventDefault(),c(F.id));return}if(m.key==="F2"){F&&(m.preventDefault(),l(F.id));return}if(m.key==="Delete"||m.key==="Backspace"&&M){L.length>0&&(m.preventDefault(),r(L));return}if(m.key==="d"&&M&&!m.shiftKey){L.length>0&&(m.preventDefault(),o(L));return}},[u,t,C,y,n,r,o,s,i,d,l,p,c,g,e,f,a]);return react.useEffect(()=>{if(u)return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N);}},[u,N]),{setIsEditing:w}}function ph(e){let[t,a]=react.useState(new Set),[n,r]=react.useState(null);react.useEffect(()=>{e&&(a(u=>u.size===1&&u.has(e)?u:new Set([e])),r(u=>u===e?u:e));},[e]);let o=react.useCallback(u=>{a(new Set([u])),r(u);},[]),s=react.useCallback(u=>{a(g=>{let h=new Set(g);return h.has(u)?h.delete(u):h.add(u),h}),r(u);},[]),i=react.useCallback((u,g)=>{if(!n){o(u);return}let h=g.indexOf(n),w=g.indexOf(u);if(h===-1||w===-1){o(u);return}let f=Math.min(h,w),C=Math.max(h,w),y=g.slice(f,C+1);a(new Set(y)),r(u);},[n,o]),d=react.useCallback((u,g,h,w)=>{w?i(u,g):h?s(u):o(u);},[o,s,i]),l=react.useCallback((u,g)=>{g?a(h=>{let w=new Set(h);return w.add(u),w}):o(u);},[o]),p=react.useCallback(()=>{a(new Set),r(null);},[]),c=react.useCallback(u=>t.has(u),[t]);return {selectedTaskIds:t,selectTask:o,toggleTaskSelection:s,selectTaskRange:i,handleTaskClick:d,handleKeyboardSelection:l,clearSelection:p,isTaskSelected:c}}var Y5=[["edit","addSubtask","indent","outdent","dependencies","milestone"],["markIncomplete","setInProgress","markComplete"],["duplicate","split"],["delete"]];function wl(e){let t=[];for(let a of Y5){let n=a.filter(r=>e[r]);if(n.length){t.length&&t.push({id:`sep-${n[0]}`,label:"",onClick:()=>{},separator:true});for(let r of n)t.push({id:r,...e[r]});}}return t}function Ri(e,t){let a=[...e].sort((r,o)=>(r.position??0)-(o.position??0)),n=a.findIndex(r=>r.id===t);if(n>0)return a[n-1];if(n===0)return null;for(let r of e)if(r.subtasks?.length){let o=Ri(r.subtasks,t);if(o||r.subtasks.some(s=>s.id===t))return o}return null}function Nd(e,t){for(let a of e)if(a.subtasks?.some(n=>n.id===t)||a.subtasks?.length&&Nd(a.subtasks,t))return true;return false}var X5=new Set(["completed","complete","done","closed","finished"]),J5=new Set(["in-progress","in_progress","inprogress","doing","active"]),Q5=new Set(["blocked","bloqueada"]),nn=e=>!!e.subtasks&&e.subtasks.length>0;function ba(e){let t=String(e.status??"").trim().toLowerCase();return X5.has(t)||!t&&(e.progress??0)>=100?"done":Q5.has(t)?"blocked":J5.has(t)||(e.progress??0)>0?"prog":"todo"}function On(e,t=[]){if(nn(e))for(let a of e.subtasks)On(a,t);else t.push(e);return t}function ko(e){if(!nn(e))return ba(e);let t=On(e).map(ba);if(t.every(n=>n==="done"))return "done";let a=t.filter(n=>n!=="done");return a.length&&a.every(n=>n==="blocked")?"blocked":t.some(n=>n==="prog"||n==="done")?"prog":"todo"}var Fs=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate(),12);function An(e,t){return nn(e)||!e.endDate||ba(e)==="done"?false:Fs(new Date(e.endDate)).getTime()<Fs(t).getTime()}function Zr(e,t,a){if(!An(e,t)||!e.endDate)return 0;let n=Fs(new Date(e.endDate));n.setDate(n.getDate()+1);let r=Fs(t);for(let o=new Date(n);o.getTime()<=r.getTime();o.setDate(o.getDate()+1))if(a.esHabil(o))return fr(n,r,a);return 0}function Bi(e,t){return !e.startDate||!e.endDate?null:fr(Fs(new Date(e.startDate)),Fs(new Date(e.endDate)),t)}function kl(e,t,a){let n={reg:0,est:0,costo:0,hechas:0,hojas:0,vencidas:0};for(let r of On(e)){let o=(r.timeLoggedMinutes??0)/60;n.reg+=o,n.est+=(r.effortMinutes??0)/60,n.costo+=o*(t(r)||0),n.hojas+=1,ba(r)==="done"&&(n.hechas+=1),An(r,a)&&(n.vencidas+=1);}return n}function Co(e,t){if(!e)return "\u2014";if(Math.abs(e)<1e6)return `${e<0?"-":""}$${os(Math.round(Math.abs(e)),t?"es":"en")}`;let a=(e/1e6).toFixed(1);return t?`$${a.replace(".",",")} M`:`$${a}M`}function _a(e,t){let a=Math.round(e*10)/10,n=Number.isInteger(a)?String(a):a.toFixed(1);return t?n.replace(".",","):n}function mh(e,t,a,n,r){let o=e.trim();if(o.startsWith("-"))return {tipo:"error",motivo:"negativas"};if(!/^\d{1,6}([.,]\d{1,2})?$/.test(o))return {tipo:"error",motivo:"numero"};let s=Number(o.replace(",","."));if(Math.abs(s-t)<.005)return {tipo:"igual"};if(s<t)return {tipo:"error",motivo:"menos"};let i=(a.effortMinutes??0)/60;if(i>0&&s>i*2)return {tipo:"aviso",motivo:"doble",valor:s};if(a.startDate){let d=Fs(new Date(a.startDate));if(d.getTime()>Fs(n).getTime())return {tipo:"aviso",motivo:"noEmpieza",valor:s};let l=fr(d,Fs(n),r);if(s>l*24)return {tipo:"aviso",motivo:"porDia",valor:s,dias:l}}return {tipo:"ok",valor:s}}function vm(e){let t=e.effort_minutes??0;return t>0?t:60}var gh=e=>e.hecha?100:Math.max(0,Math.min(100,e.progress||0));function qo(e){if(e.length===0)return 0;let t=e.filter(r=>(r.weight||0)>0),a=t.reduce((r,o)=>r+o.weight,0);if(a>=99&&t.length/e.length>=.95)return Math.round(t.reduce((r,o)=>r+gh(o)*o.weight,0)/a);let n=e.reduce((r,o)=>r+vm(o),0);return n>0?Math.round(e.reduce((r,o)=>r+gh(o)*vm(o),0)/n):0}function mo(e,t=[]){for(let a of e)if(a.subtasks&&a.subtasks.length>0)mo(a.subtasks,t);else {let n=a;t.push({progress:a.progress||0,weight:n.weight||0,effort_minutes:n.effort_minutes??n.effortMinutes??null,sold_effort_minutes:n.sold_effort_minutes??n.soldEffortMinutes??null,hecha:ba(a)==="done"});}return t}function Oi(e){return e.subtasks&&e.subtasks.length>0?qo(mo(e.subtasks)):Math.round(ba(e)==="done"?100:Math.max(0,Math.min(100,e.progress??0)))}function ym(e){return e.map((t,a)=>({...t,position:a,subtasks:t.subtasks?.length?ym(t.subtasks):t.subtasks}))}function Cl(e){let t=[],a=(n,r,o=0)=>{let s=[...n].sort((i,d)=>(i.position??0)-(d.position??0));for(let i=0;i<s.length;i++){let d={...s[i],parentId:r,level:o,position:s[i].position??i};t.push(d),d.subtasks&&d.subtasks.length>0&&d.isExpanded&&a(d.subtasks,d.id,o+1);}};return a(e),t}function Tl(e,t){for(let a of e){if(a.id===t)return a;if(a.subtasks){let n=Tl(a.subtasks,t);if(n)return n}}return null}function xm(e,t){for(let a of e)if(a.subtasks){if(a.subtasks.some(r=>r.id===t))return a;let n=xm(a.subtasks,t);if(n)return n}return null}function wm(e,t){if(t.length===0)return e;let a=Ri(e,t[0]);if(!a)return e;let n=(l,p)=>{let c=[];return {tasks:l.filter(g=>{if(p.has(g.id))return c.push(g),false;if(g.subtasks){let h=n(g.subtasks,p);g.subtasks=h.tasks,c.push(...h.removed);}return true}),removed:c}},r=(l,p,c)=>l.map(u=>u.id===p?{...u,subtasks:[...u.subtasks||[],...c],isExpanded:true}:u.subtasks?{...u,subtasks:r(u.subtasks,p,c)}:u),o=new Set(t),{tasks:s,removed:i}=n(e,o),d=r(s,a.id,i);return ym(d)}function km(e,t){if(t.length===0)return e;let a=[...e];for(let n of t){let r=xm(a,n);if(!r)continue;let o=xm(a,r.id),s=(l,p,c)=>{for(let u=0;u<l.length;u++){let g=l[u];if(g.id===p&&g.subtasks){let h=g.subtasks.findIndex(w=>w.id===c);if(h!==-1){let[w]=g.subtasks.splice(h,1);return w}}if(g.subtasks){let h=s(g.subtasks,p,c);if(h)return h}}return null},i=(l,p,c)=>{let u=l.findIndex(g=>g.id===p);if(u!==-1)return l.splice(u+1,0,c),l;for(let g of l)g.subtasks&&i(g.subtasks,p,c);return l},d=s(a,r.id,n);d&&(o&&o.subtasks?i(o.subtasks,r.id,d):i(a,r.id,d));}return ym(a)}function Cm(e,t,a){if(t.length===0)return e;let n=[...e],r=t[0],o=(s,i,d)=>{let l=s.findIndex(c=>c.id===i);if(l===-1){for(let c of s)if(c.subtasks&&o(c.subtasks,i,d))return true;return false}let p=d==="up"?l-1:l+1;return p<0||p>=s.length?false:([s[l],s[p]]=[s[p],s[l]],s[l]={...s[l],position:l},s[p]={...s[p],position:p},true)};return o(n,r,a),n}function Tm(e,t){let a=new Set(t),n=r=>r.filter(o=>!a.has(o.id)).map(o=>o.subtasks?{...o,subtasks:n(o.subtasks)}:o);return n(e)}function Qc(e,t){let a=[...e],n=[];for(let r of t){let o=(d,l)=>d.map((p,c)=>({...p,id:`${p.id}-copy-${Date.now()}-${c}`,parentId:l,subtasks:p.subtasks?o(p.subtasks,`${p.id}-copy-${Date.now()}-${c}`):void 0})),s=d=>{let l=d.findIndex(g=>g.id===r);if(l===-1){for(let g of d)if(g.subtasks){let h=s(g.subtasks);if(h)return h}return null}let p=d[l],c=`${p.id}-copy-${Date.now()}`,u={...p,id:c,name:`${p.name} (Copy)`,subtasks:p.subtasks?o(p.subtasks,c):void 0};return d.splice(l+1,0,u),u},i=s(a);i&&n.push(i);}return {tasks:a,duplicatedTasks:n}}function fh(e,t,a){let n=[...e],r=new Date,o=new Date(r);o.setDate(o.getDate()+7);let s={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:r,endDate:o,color:"#00E5CC"},i=d=>{let l=d.findIndex(c=>c.id===t);if(l===-1){for(let c of d)if(c.subtasks&&i(c.subtasks))return true;return false}let p=a==="above"?l:l+1;return d.splice(p,0,s),true};return i(n),{tasks:n,newTask:s}}function Dm(e,t,a){return e.map(n=>n.id===t?{...n,name:a}:n.subtasks?{...n,subtasks:Dm(n.subtasks,t,a)}:n)}function Nm(e,t){return e.map(a=>a.id===t?{...a,isExpanded:!a.isExpanded}:a.subtasks?{...a,subtasks:Nm(a.subtasks,t)}:a)}function Sm(e,t){let a=u=>{for(let g of u){if(g.id===t)return g;if(g.subtasks){let h=a(g.subtasks);if(h)return h}}return null},n=a(e),r=new Date,o=new Date(r);o.setDate(o.getDate()+7);let s=n?.startDate||r,i=n?.endDate||o,d=u=>{for(let g of u){if(g.id===t)return (g.subtasks||[]).length;if(g.subtasks){let h=d(g.subtasks);if(h>=0)return h}}return 0},l=d(e),p={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(s),endDate:new Date(i),color:n?.color||"#00E5CC",position:l,parentId:t},c=u=>u.map(g=>{if(g.id===t){let h=g.subtasks||[];return {...g,subtasks:[...h,p],isExpanded:true}}return g.subtasks?{...g,subtasks:c(g.subtasks)}:g});return {tasks:c(e),newTask:p}}function bh(e,t,a,n){if(t===a)return e;let r=Tl(e,t);if(!r)return e;if(a){let i=(d,l)=>{if(!d.subtasks)return false;for(let p of d.subtasks)if(p.id===l||i(p,l))return true;return false};if(i(r,a))return e}let o=i=>{let d=i.filter(p=>p.id!==t),l=d.length<i.length;return d.map((p,c)=>{let u=l?{...p,position:c}:p;return u.subtasks&&u.subtasks.length>0?{...u,subtasks:o(u.subtasks)}:u})},s=o(e);if(a===null){let i=n!==void 0?n:s.length;s.splice(i,0,{...r,parentId:void 0}),s=s.map((d,l)=>({...d,position:l}));}else {let i=d=>d.map(l=>{if(l.id===a){let p=l.subtasks||[],c=n!==void 0?n:p.length,u=[...p];u.splice(c,0,{...r,parentId:a});let g=u.map((h,w)=>({...h,position:w}));return {...l,subtasks:g,isExpanded:true}}return l.subtasks&&l.subtasks.length>0?{...l,subtasks:i(l.subtasks)}:l});s=i(s);}return s}function To(e){return e.map(t=>{if(!t.subtasks||t.subtasks.length===0)return t;let a=To(t.subtasks),n=a.reduce((i,d)=>(d.startDate&&i.starts.push(new Date(d.startDate).getTime()),d.endDate&&i.ends.push(new Date(d.endDate).getTime()),i.progresses.push(d.progress??0),i),{starts:[],ends:[],progresses:[]}),r=n.starts.length>0?new Date(Math.min(...n.starts)):t.startDate,o=n.ends.length>0?new Date(Math.max(...n.ends)):t.endDate,s=n.progresses.length>0?qo(mo(a)):t.progress;return {...t,subtasks:a,startDate:r,endDate:o,progress:s}})}function Th({valor:e,sufijo:t,min:a,max:n,derecha:r,etiqueta:o,alGuardar:s}){let[i,d]=react.useState(null),l=()=>{let c=Number(i);d(null),i!==null&&i.trim()!==""&&Number.isFinite(c)&&c!==e&&s(Math.min(n,Math.max(a,Math.round(c))));},p={width:"100%",textAlign:r?"right":"left",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:12,color:"var(--v6-texto-2, #4D5761)"};return i===null?jsxRuntime.jsx("button",{type:"button","data-celda-editable":true,"aria-label":`${o}: ${e} ${t}`,onClick:c=>{c.stopPropagation(),d(String(e));},style:{...p,background:"transparent",border:0,padding:0,cursor:"text"},children:t==="%"?`${e}%`:`${e} ${t}`}):jsxRuntime.jsx("input",{autoFocus:true,type:"number",min:a,max:n,value:i,"aria-label":o,onClick:c=>c.stopPropagation(),onFocus:c=>c.currentTarget.select(),onChange:c=>d(c.target.value),onBlur:l,onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"&&(c.preventDefault(),c.currentTarget.blur()),c.key==="Escape"&&d(null);},style:{...p,height:24,boxSizing:"border-box",padding:"0 4px",borderRadius:6,border:"1px solid var(--v6-acento, #0FA392)",background:"var(--v6-tarjeta, #fff)",outline:"none"}})}function Zc({tasks:e,theme:t,rowHeight:a,availableUsers:n=[],templates:r,onTaskClick:o,onTaskSelectionChange:s,selectedTaskId:i,onTaskDblClick:d,onTaskContextMenu:l,onTaskToggle:p,scrollTop:c,columns:u,onToggleColumn:g,onColumnResize:h,onTaskUpdate:w,onBulkFill:f,onTaskIndent:C,onTaskOutdent:y,onTaskMove:N,onMultiTaskDelete:m,onTaskDuplicate:k,onTaskCreate:x,onTaskRename:I,addTaskRow:M,onCreateSubtask:L,onTaskDependencies:F,onOpenTaskModal:H,onDeleteRequest:z,onTaskReparent:Y,allTasks:P,scrollContainerRef:B,showCriticalPath:ge=false,v6:ae=false,onMoverDias:xe,columnasV6:V,puedeEditarEnTabla:fe=()=>true,onDuracionEnTabla:bt,onProgresoEnTabla:st,resumenV6:q,onContraerTodo:He,onMostrarOcultas:we,onOcultarCompletadas:kt,filasVisibles:Je=null,avisoVencidas:Ct,onVerVencidas:$t}){let Tt=Bo(),At=react.useContext(Di),[Ze,mt]=react.useState(null),[Dt,Bt]=react.useState(null),[jt,je]=react.useState(""),aa=react.useRef(null),[Ut,Pt]=react.useState(null),[Ht,et]=react.useState(0),[re,ke]=react.useState(0),[Ce,it]=react.useState({isOpen:false,x:0,y:0,type:"header"}),[se,at]=react.useState(null),[X,Te]=react.useState(null),[Le,Xe]=react.useState(null),Rt=react.useRef(0),Ft=5,da=react.useRef(false),[nt,ca]=react.useState(null),[na,Gt]=react.useState(false),Ee=react.useRef(null),[qe,Z]=react.useState(null),[Ue,ut]=react.useState(null),[gt,ta]=react.useState(false),ra=react.useRef(null);react.useEffect(()=>{function b(D){ra.current&&!ra.current.contains(D.target)&&ta(false);}if(gt)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[gt]),react.useEffect(()=>{Dt&&aa.current&&(aa.current.focus(),aa.current.select());},[Dt]),react.useEffect(()=>{if(!Ut)return;let b=j=>{let K=j.clientX-Ht,Q=re+K;h?.(Ut,Q);},D=()=>{Pt(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",b),document.addEventListener("mouseup",D),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",D),document.body.style.cursor="",document.body.style.userSelect="";}},[Ut,Ht,re,h]);let{selectedTaskIds:Pa,handleTaskClick:Fa,isTaskSelected:Oa}=ph(i),ua=react.useRef(null),{setIsEditing:Za}=ch({tasks:e,selectedTaskIds:Pa,onTaskSelect:(b,D)=>{let K=Cl(e).map(Q=>Q.id);Fa(b,K,D||false,false),ua.current=b,s?.(b);},onTaskCreate:x||(()=>{}),onTaskDelete:m||(()=>{}),onTaskDuplicate:k||(()=>{}),onTaskMove:N||(()=>{}),onTaskIndent:C||(()=>{}),onTaskOutdent:y||(()=>{}),onTaskRename:b=>{let D=Cl(e).find(j=>j.id===b);D&&Me(D);},onTaskToggleExpand:p||(()=>{}),onOpenTaskModal:b=>{let D=Cl(e).find(j=>j.id===b);D&&H&&H(D);},enableKeyboard:true,v6:ae?{abrirPanel:b=>o?.(b),moverDias:xe}:void 0}),en=(b,D=0,j="")=>{let K=[],Q=[...b].sort((te,W)=>(te.position??0)-(W.position??0));for(let te=0;te<Q.length;te++){let W=Q[te],le=te+1,Ve=j?`${j}.${le}`:`${le}.0`,Ge=W.wbsCode||Ve;if(W.wbsCode=Ge,K.push({task:W,level:D}),W.subtasks&&W.subtasks.length>0&&W.isExpanded){let Et=W.wbsCode?.replace(/\.0$/,"")||(j?`${j}.${le}`:`${le}`);K.push(...en(W.subtasks,D+1,Et));}}return K},ya=en(e),za=(()=>{let b=Je?.desde??0,D=Je?.hasta??ya.length-1;for(let j=b;j<=D;j++)if(ya[j]&&Oa(ya[j].task.id))return ya[j].task.id;return ya[b]?.task.id})();react.useEffect(()=>{let b=ua.current;if(!b)return;ua.current=null;let D=ya.findIndex(te=>te.task.id===b),j=B?.current;if(D<0)return;if(j){let te=D*a,W=j.clientHeight-Xa;te<j.scrollTop?j.scrollTop=te:te+a>j.scrollTop+W&&(j.scrollTop=te+a-W);}let K=0,Q=()=>{let te=document.querySelector(`[data-task-row="${CSS.escape(b)}"]`);te?te.focus({preventScroll:true}):K++<6&&requestAnimationFrame(Q);};Q();});let Xa=ae?60:48,un=Math.max(ya.length*a,600-Xa),oa=(b,D)=>D==="assignees"?b.assignees:D==="startDate"?b.startDate:b.endDate,St=(b,D,j,K)=>{b.preventDefault(),b.stopPropagation(),Z({sourceTaskId:D,column:j,sourceIndex:K,targetIndex:K}),document.body.style.cursor="crosshair",document.body.style.userSelect="none";let Q=b.currentTarget.closest("[data-grid-body]"),te=Da=>{let fa=Q?.getBoundingClientRect().top??0,Re=Math.floor((Da-fa)/a);return Re=Math.max(0,Math.min(ya.length-1,Re)),Re<K&&(Re=K),Re},W=b.clientY,le=B?.current??null,Ve=()=>{Ee.current&&(cancelAnimationFrame(Ee.current),Ee.current=null);},Ge=()=>{let Da=te(W);Z(fa=>fa&&{...fa,targetIndex:Da});},Ke=()=>{if(Ve(),!le)return;let Da=le.getBoundingClientRect(),fa=60,Re=12,Yt=W-Da.top,Ea=Da.bottom-W;if(Ea<fa&&le.scrollTop<le.scrollHeight-le.clientHeight){let Ua=Math.max(1,Math.round(Re*(1-Math.max(0,Ea)/fa))),qn=()=>{le.scrollTop+=Ua,Ge(),le.scrollTop<le.scrollHeight-le.clientHeight&&(Ee.current=requestAnimationFrame(qn));};Ee.current=requestAnimationFrame(qn);}else if(Yt<fa&&le.scrollTop>0){let Ua=Math.max(1,Math.round(Re*(1-Math.max(0,Yt)/fa))),qn=()=>{le.scrollTop-=Ua,Ge(),le.scrollTop>0&&(Ee.current=requestAnimationFrame(qn));};Ee.current=requestAnimationFrame(qn);}},Et=Da=>{W=Da.clientY,Ge(),Ke();},Ha=Da=>{window.removeEventListener("mousemove",Et),window.removeEventListener("mouseup",Ha),Ve(),document.body.style.cursor="",document.body.style.userSelect="",Z(null);let fa=te(Da.clientY),Re=ya.find(O=>O.task.id===D)?.task;if(!Re)return;let Yt=oa(Re,j),Ea=Math.min(K,fa),Ua=Math.max(K,fa),qn=[];for(let O=Ea;O<=Ua;O++){if(O===K)continue;let me=ya[O]?.task;!me||me.subtasks&&me.subtasks.length>0||qn.push(me.id);}qn.length!==0&&f?.(qn,j,Yt);};window.addEventListener("mousemove",Et),window.addEventListener("mouseup",Ha);},_e=b=>{if(!qe)return false;let D=Math.min(qe.sourceIndex,qe.targetIndex),j=Math.max(qe.sourceIndex,qe.targetIndex);return b>=D&&b<=j},ia=b=>!b.startDate||!b.endDate?"-":`${Math.ceil((b.endDate.getTime()-b.startDate.getTime())/(1e3*60*60*24))}d`,Me=b=>{Bt(b.id),je(b.name),Za(true);},_t=b=>{jt.trim()&&jt!==e.find(D=>D.id===b)?.name&&I?.(b,jt.trim()),Bt(null),je(""),Za(false);},Aa=()=>{Bt(null),je(""),Za(false);},U=(b,D)=>{D.stopPropagation(),L?.(b.id);},T=(b,D)=>{D.preventDefault(),Rt.current=D.clientY,at(b),da.current=false,Gt(false),ca({x:D.clientX,y:D.clientY});},G=b=>{if(!se||(Math.abs(b.clientY-Rt.current)>Ft&&!da.current&&(da.current=true,Gt(true)),ca({x:b.clientX,y:b.clientY}),!da.current))return;if(B?.current){let te=B.current,W=te.getBoundingClientRect(),le=60,Ve=12;Ee.current&&(cancelAnimationFrame(Ee.current),Ee.current=null);let Ge=b.clientY-W.top,Ke=W.bottom-b.clientY;if(Ge<le&&te.scrollTop>0){let Et=Math.round(Ve*(1-Ge/le)),Ha=()=>{te.scrollTop-=Et,da.current&&te.scrollTop>0&&(Ee.current=requestAnimationFrame(Ha));};Ee.current=requestAnimationFrame(Ha);}else if(Ke<le&&te.scrollTop<te.scrollHeight-te.clientHeight){let Et=Math.round(Ve*(1-Ke/le)),Ha=()=>{te.scrollTop+=Et,da.current&&te.scrollTop<te.scrollHeight-te.clientHeight&&(Ee.current=requestAnimationFrame(Ha));};Ee.current=requestAnimationFrame(Ha);}}let j=document.querySelectorAll("[data-task-row]"),K=null,Q=null;j.forEach(te=>{let W=te.getBoundingClientRect(),le=te.getAttribute("data-task-row");if(le&&le!==se&&b.clientY>=W.top&&b.clientY<=W.bottom){K=le;let Ve=b.clientY-W.top,Ge=W.height;Ve<Ge*.25?Q="above":Ve>Ge*.75?Q="below":Q="child";}}),Te(K),Xe(Q);},ie=()=>{if(da.current&&se&&X&&Le){if(Le==="child")Y?.(se,X);else if(Le==="above"||Le==="below"){let b=(te,W,le=null)=>{for(let Ve of te){if(Ve.id===W)return le;if(Ve.subtasks){let Ge=b(Ve.subtasks,W,Ve.id);if(Ge!==void 0)return Ge}}},D=P&&P.length>0?P:e,j=b(D,se,null),K=b(D,X,null),Q=(te,W,le,Ve)=>{let Ge=te.findIndex(Ha=>Ha.id===W),Ke=Ve?te.findIndex(Ha=>Ha.id===le):-1,Et=Le==="below"?Ge+1:Ge;return Ve&&Ke!==-1&&Ke<Ge&&(Et-=1),Math.max(0,Et)};if(K===null){let W=Q(D,X,se,j===null);Y?.(se,null,W);}else {let te=Tl(D,K);if(te?.subtasks){let W=j===K,le=Q(te.subtasks,X,se,W);Y?.(se,K,le);}}}}Ee.current&&(cancelAnimationFrame(Ee.current),Ee.current=null),at(null),Te(null),Xe(null),ca(null),da.current=false,Gt(false);};react.useEffect(()=>{if(se)return document.addEventListener("mousemove",G),document.addEventListener("mouseup",ie),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",ie),document.body.style.cursor="",document.body.style.userSelect="";}},[se,X,Le]);let _=react.useMemo(()=>{let b=new Map,D=(j,K)=>{for(let Q of j)b.set(Q.id,K),Q.subtasks?.length&&D(Q.subtasks,[...K,{name:Q.name,wbsCode:Q.wbsCode}]);};return D(e,[]),b},[e]),oe=react.useMemo(()=>{let b=new Map,D=j=>{let K=_0(j.map(Q=>Q.name));j.forEach((Q,te)=>{b.set(Q.id,K[te]??0),Q.subtasks?.length&&D(Q.subtasks);});};return D(e),b},[e]),S=12,$=(b,D,j,K)=>{if(b.id==="name"){let Q=Dt===D.id,te=Ze===D.id;return jsxRuntime.jsxs("div",{"data-celda-nombre-v6":true,className:"flex items-center min-w-0 relative",style:{gap:6,alignSelf:"stretch",width:"100%",paddingLeft:`${j*S}px`},children:[Array.from({length:j},(W,le)=>jsxRuntime.jsx("span",{"aria-hidden":true,style:{position:"absolute",left:8+le*S,top:0,bottom:0,width:1,background:"var(--v6-separador, #CDD2D8)"}},le)),Y&&te&&!Q&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing flex items-center",style:{position:"absolute",left:-10,top:0,bottom:0,width:10,color:"var(--v6-tenue, #5F6972)"},onMouseDown:W=>T(D.id,W),title:Tt?"Arrastrar para mover la tarea":"Drag to move the task",children:jsxRuntime.jsx(lucideReact.GripVertical,{style:{width:10,height:14}})}),K?jsxRuntime.jsx("button",{type:"button",onClick:W=>{W.stopPropagation(),p?.(D.id);},"aria-label":Tt?D.isExpanded?`Contraer ${D.name}`:`Desplegar ${D.name}`:D.isExpanded?`Collapse ${D.name}`:`Expand ${D.name}`,"aria-expanded":!!D.isExpanded,style:{flex:"none",width:18,height:18,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:D.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{style:{width:14,height:14},strokeWidth:2}):jsxRuntime.jsx(lucideReact.ChevronRight,{style:{width:14,height:14},strokeWidth:2})}):jsxRuntime.jsx("span",{"aria-hidden":true,style:{flex:"none",width:18}}),D.wbsCode&&jsxRuntime.jsx("span",{style:{flex:"none",minWidth:28,textAlign:"right",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:11,color:"var(--v6-tenue, #5F6972)"},children:D.wbsCode}),Q?jsxRuntime.jsx("input",{ref:aa,type:"text",value:jt,onChange:W=>je(W.target.value),onKeyDown:W=>{if(W.stopPropagation(),W.key==="Escape"){Aa();return}if(W.key==="Enter"){_t(D.id),x?.(D.id,"below");return}W.key==="Tab"&&(W.preventDefault(),_t(D.id),W.shiftKey?y?.([D.id]):C?.([D.id]));},onBlur:()=>_t(D.id),className:"flex-1 min-w-0 px-2 py-1 rounded border outline-none",style:{background:"var(--v6-tarjeta, #fff)",borderColor:"var(--v6-acento, #0FA392)",color:"var(--v6-texto, #0E1114)",font:"inherit",fontSize:13},onClick:W=>W.stopPropagation()}):(()=>{let{comienzo:W,cola:le}=G0(D.name,oe.get(D.id)??0),Ve=_.get(D.id)??[];return jsxRuntime.jsxs("span",{title:Ve.length?q0(Ve,D.name):D.name,"data-nombre-v6":true,style:{marginLeft:2,flex:"1 1 auto",minWidth:0,display:"flex",whiteSpace:"nowrap",fontSize:13,fontWeight:K||D.isMilestone?600:500,color:"var(--v6-texto, #0E1114)"},children:[jsxRuntime.jsx("span",{style:{minWidth:le&&W.length>12?`${12}ch`:0,overflow:"hidden",textOverflow:"ellipsis",flex:"0 1 auto"},children:W}),le&&jsxRuntime.jsx("span",{style:{flex:"none",whiteSpace:"pre",maxWidth:"60%",overflow:"hidden",textOverflow:"ellipsis"},children:le})]})})(),D.fijada&&jsxRuntime.jsx(lucideReact.Lock,{"aria-label":Tt?"Fechas fijadas":"Dates locked","data-tarea-fijada":true,style:{flex:"none",width:11,height:11,color:"var(--v6-tenue, #5F6972)"}}),jsxRuntime.jsx(J0,{riesgos:D.riesgos,es:Tt}),ge&&D.isCriticalPath&&jsxRuntime.jsx("span",{"aria-label":Tt?"En la ruta cr\xEDtica":"On the critical path",style:{flex:"none",width:6,height:6,borderRadius:"50%",background:"var(--v6-rojo-punto, #D13A40)"}}),te&&!Q&&jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:2,flex:"none"},onClick:W=>W.stopPropagation(),children:[jsxRuntime.jsx("button",{type:"button",onClick:W=>U(D,W),"aria-label":Tt?"Crear subtarea":"Create subtask",title:Tt?"Crear subtarea":"Create subtask",style:{width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.Plus,{style:{width:13,height:13}})}),jsxRuntime.jsx("button",{type:"button",onClick:W=>{W.stopPropagation(),Me(D);},"aria-label":Tt?"Renombrar (F2)":"Rename (F2)",title:Tt?"Renombrar (F2)":"Rename (F2)",style:{width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.Edit3,{style:{width:13,height:13}})})]})]})}if(b.id==="assignees"){if(K)return jsxRuntime.jsx("span",{"aria-hidden":true});let Q=n.filter(te=>D.assignees?.some(W=>W.id?W.id===te.id:W.name===te.name||W.initials===te.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:te=>te.stopPropagation(),children:jsxRuntime.jsx(Vs,{variante:"v6",es:Tt,nombreDeLaTarea:D.name,assignedUsers:Q,availableUsers:n,onChange:te=>w?.(D.id,{assignees:te.map(W=>({id:W.id,name:W.name,initials:W.initials,color:W.color}))})})})}if(V&&b.id==="duration"&&!K&&D.startDate&&D.endDate&&!D.isMilestone&&fe(D)){let Q=V.contexto.cal,te=fr(new Date(D.startDate),new Date(D.endDate),Q);return jsxRuntime.jsx(Th,{valor:te,sufijo:"d",min:1,max:3650,etiqueta:`${Tt?"Duraci\xF3n de":"Duration of"} ${D.name}`,alGuardar:W=>bt?.(D,W)})}if(V&&b.id==="predecessors"&&!K&&F&&fe(D)){let Q=bm("predecessors",D,V.contexto);return jsxRuntime.jsx("button",{type:"button","data-celda-v6":"predecessors",className:"truncate w-full",title:Tt?"Editar predecesoras":"Edit predecessors",onClick:te=>{te.stopPropagation(),F(D);},style:{textAlign:"left",background:"transparent",border:0,padding:0,cursor:"pointer",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontSize:12,color:Q==="\u2014"?"var(--v6-tenue, #5F6972)":"var(--v6-texto-2, #4D5761)"},children:Q})}if(V&&xl.some(Q=>Q.id===b.id)){let Q=nh(b.id,D,V.contexto.cal),te=bm(b.id,D,V.contexto);return jsxRuntime.jsx("div",{className:"truncate w-full","data-celda-v6":b.id,title:b.id==="predecessors"&&te!=="\u2014"?te:void 0,style:{fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:12,fontWeight:K?500:400,color:Q==="rojo"?"var(--v6-rojo, #B02A33)":Q==="verde"?"var(--v6-acento-texto, #066A5F)":te==="\u2014"?"var(--v6-tenue, #5F6972)":"var(--v6-texto-2, #4D5761)"},children:te})}if(b.id==="progress"&&!K&&st&&fe(D)){let Q=Math.round(D.progress||0);return jsxRuntime.jsx(Th,{valor:Q,sufijo:"%",min:0,max:100,derecha:true,etiqueta:`${Tt?"Avance de":"Progress of"} ${D.name}`,alGuardar:te=>st(D,te)})}if(b.id==="progress"){let Q=Math.round(D.progress||0),te=!K&&Q>0&&Q<100;return jsxRuntime.jsxs("div",{className:"w-full",style:{textAlign:"right",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:12,fontWeight:K||te?500:400,color:te?"var(--v6-acento-texto, #066A5F)":Q===0?"var(--v6-tenue, #5F6972)":"var(--v6-texto, #0E1114)"},children:[Q,"%"]})}},ee=(b,D,j)=>{let K=D.subtasks&&D.subtasks.length>0;if(ae){let Q=$(b,D,j,!!K);if(Q!==void 0)return Q}switch(b.id){case "name":let Q=Dt===D.id,te=Ze===D.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${j*20}px`},children:[Y&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:te?1:.3},onMouseDown:Re=>T(D.id,Re),title:"Arrastrar para mover tarea",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-4 h-4"})}),D.subtasks&&D.subtasks.length>0?jsxRuntime.jsx("button",{onClick:Re=>{Re.stopPropagation(),p?.(D.id);},"aria-label":Tt?D.isExpanded?`Contraer ${D.name}`:`Desplegar ${D.name}`:D.isExpanded?`Collapse ${D.name}`:`Expand ${D.name}`,"aria-expanded":!!D.isExpanded,className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:D.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}):jsxRuntime.jsx("div",{className:"w-5 h-5 flex-shrink-0"}),Q?jsxRuntime.jsx("input",{ref:aa,type:"text",value:jt,onChange:Re=>je(Re.target.value),onKeyDown:Re=>{Re.key==="Enter"?_t(D.id):Re.key==="Escape"&&Aa();},onBlur:()=>_t(D.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:Re=>Re.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:"flex-1 min-w-0",style:{display:"flex",alignItems:"baseline",gap:"6px",color:D.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:D.parentId?"13px":"14px",fontWeight:D.isMilestone?600:D.parentId?400:600,letterSpacing:D.parentId?"0":"-0.01em"},title:D.name,children:[D.wbsCode&&jsxRuntime.jsx("span",{style:{color:`var(--pj-texto-tenue, ${t.textTertiary})`,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,flexShrink:0},children:D.wbsCode}),D.isHighlighted&&D.status==="completed"&&jsxRuntime.jsx("span",{title:"\u2605",style:{color:"#F59E0B",fontSize:"10px",flexShrink:0,lineHeight:1},children:"\u2605"}),jsxRuntime.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D.name}),D.subtasks&&D.subtasks.length>0&&jsxRuntime.jsxs("span",{style:{color:"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:400,flexShrink:0,whiteSpace:"nowrap"},children:["\xB7 ",Math.round(D.progress||0),"%"]}),ge&&D.isCriticalPath&&jsxRuntime.jsx("span",{style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#EF4444",flexShrink:0,marginLeft:"2px"}}),ge&&D.cpmData&&jsxRuntime.jsx("span",{title:Tt?"D\xEDas que la tarea puede retrasarse sin mover el fin del proyecto":"Total float: days the task can slip without moving the project end",style:{color:D.cpmData.totalFloat<=0?"#EF4444":D.cpmData.totalFloat<=5?"#F59E0B":"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:500,flexShrink:0,whiteSpace:"nowrap",marginLeft:"4px"},children:Tt?`Holgura: ${Math.round(D.cpmData.totalFloat)} d`:`TF: ${Math.round(D.cpmData.totalFloat)}d`})]}),te&&!Q&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:Re=>Re.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:Re=>U(D,Re),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:Re=>{Re.stopPropagation(),Me(D);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let W=b.id==="startDate",le=W?"startDate":"endDate",Ve=D[le],Ge=Ue?.taskId===D.id&&Ue?.field===le,Ke=Re=>{if(!Re)return ae?"\u2014":"-";let Yt=typeof Re=="string"?new Date(Re):Re;return ae?ga(Yt,Tt?"es":"en"):Yt.toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"})};return jsxRuntime.jsxs("div",{className:`flex items-center w-full relative ${ae?"justify-start":"justify-center"}`,onClick:Re=>Re.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",className:ae?"flex items-center rounded":"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:ae?{whiteSpace:"nowrap",padding:0,border:0,background:"transparent",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:11,color:!W&&Z0(D)||!W&&!K&&D.status!=="completed"&&(D.progress??0)<100&&Ve&&new Date(Ve).getTime()<new Date(new Date().toDateString()).getTime()?"var(--v6-rojo, #B02A33)":"var(--v6-texto-2, #4D5761)",cursor:K?"default":"pointer"}:{color:t.textSecondary,opacity:K?.5:1,cursor:K?"default":"pointer"},title:K?"Auto-calculated from subtasks":void 0,onClick:Re=>{if(!K)if(Ge)ut(null);else {let Yt=Re.currentTarget.getBoundingClientRect();ut({taskId:D.id,field:le,month:Ve?typeof Ve=="string"?new Date(Ve):Ve:new Date,position:{top:Yt.bottom+4,left:Yt.left}});}},children:[!ae&&jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsxRuntime.jsx("span",{children:Ke(Ve)}),K&&!ae&&jsxRuntime.jsx("span",{style:{fontSize:"9px",color:t.textTertiary,marginLeft:"2px"},children:"\u25BC"})]}),Ge&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>ut(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:Ue?.position.top,left:Ue?.position.left},onClick:Re=>Re.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let Re=new Date,Yt=new Date(Re);Yt.setDate(Re.getDate()+1);let Ea=new Date(Re);Ea.setDate(Re.getDate()+7);let Ua=new Date(Re);return Ua.setDate(Re.getDate()+14),[{label:"Hoy",date:Re},{label:"Ma\xF1ana",date:Yt},{label:"Pr\xF3xima semana",date:Ea},{label:"2 semanas",date:Ua}].map((O,me)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:ye=>ye.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:ye=>ye.currentTarget.style.backgroundColor="transparent",onClick:()=>{w?.(D.id,{[le]:O.date}),ut(null);},children:O.label},me))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:Re=>Re.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:Re=>Re.currentTarget.style.backgroundColor="transparent",onClick:()=>{w?.(D.id,{[le]:void 0}),ut(null);},children:"Borrar"})]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>ut(Re=>Re?{...Re,month:new Date(Re.month.getFullYear(),Re.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:Ue?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>ut(Re=>Re?{...Re,month:new Date(Re.month.getFullYear(),Re.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["L","M","X","J","V","S","D"].map((Re,Yt)=>jsxRuntime.jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:Re},Yt))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let Re=Ue?.month||new Date,Yt=Re.getFullYear(),Ea=Re.getMonth(),Ua=(new Date(Yt,Ea,1).getDay()+6)%7,qn=new Date(Yt,Ea+1,0).getDate(),O=new Date,me=[];for(let tt=Ua-1;tt>=0;tt--)me.push({day:new Date(Yt,Ea,-tt).getDate(),date:new Date(Yt,Ea-1,new Date(Yt,Ea,-tt).getDate()),isCurrentMonth:false});for(let tt=1;tt<=qn;tt++)me.push({day:tt,date:new Date(Yt,Ea,tt),isCurrentMonth:true});let ye=42-me.length;for(let tt=1;tt<=ye;tt++)me.push({day:tt,date:new Date(Yt,Ea+1,tt),isCurrentMonth:false});return me.map((tt,Ot)=>{let lt=tt.date.toDateString()===O.toDateString(),$a=(Ve?typeof Ve=="string"?new Date(Ve):Ve:null)?.toDateString()===tt.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:tt.isCurrentMonth?$a?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:$a?"#00E5CC":"transparent",boxShadow:lt&&!$a?"inset 0 0 0 1px #00E5CC":"none"},onClick:()=>{w?.(D.id,{[le]:tt.date}),ut(null);},children:tt.day},Ot)})})()})]})]})]}),document.body)]});case "duration":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",children:jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:ia(D)})});case "assignees":if(K)return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.4},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:"\u2014"})});let Et=n.filter(Re=>D.assignees?.some(Yt=>Yt.id?Yt.id===Re.id:Yt.name===Re.name||Yt.initials===Re.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:Re=>Re.stopPropagation(),children:jsxRuntime.jsx(Vs,{assignedUsers:Et,availableUsers:n,onChange:Re=>{let Yt=Re.map(Ea=>({id:Ea.id,name:Ea.name,initials:Ea.initials,color:Ea.color}));w?.(D.id,{assignees:Yt});}})});case "status":if(K){let Re=D.progress===100?"\u2713":D.progress>0?"\u25D0":"\u25CB";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.5},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:Re})})}return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:Re=>Re.stopPropagation(),children:jsxRuntime.jsx(gb,{status:D.status||"todo",onChange:Re=>{w?.(D.id,{status:Re,progress:Re==="completed"?100:D.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 w-full",style:{opacity:K?.6:1},children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${D.progress}%`,backgroundColor:D.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[D.progress,"%"]})]});case "priority":let Ha={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},Da={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},fa=Ha[D.priority||"medium"]||"MEDIUM";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:Re=>Re.stopPropagation(),children:jsxRuntime.jsx(ki,{priority:fa,onChange:Re=>{Re&&w?.(D.id,{priority:Da[Re]||"medium"});}})});default:return null}},ce=b=>[{id:"hide",label:"Hide Column",icon:ka.Hide,onClick:()=>g(b),disabled:b==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:ka.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:ka.SortDesc,onClick:()=>{}}],ue=b=>{let D=b.subtasks&&b.subtasks.length>0,j=Cl(e),K=Pa.size>1&&Pa.has(b.id),Q=K?j.filter(Ke=>Pa.has(Ke.id)):[b],te=Q.map(Ke=>Ke.id),W=Q.filter(Ke=>!(Ke.subtasks&&Ke.subtasks.length>0)),le=K?` (${te.length})`:"",Ve=()=>{z?z(te,b.name):m?.(te);},Ge=At?.contextMenu;return wl({edit:{label:Ge?.editTask||"Edit Task",icon:ka.Pencil,onClick:()=>d?.(b),disabled:!!D},addSubtask:{label:Ge?.addSubtask||"Add Subtask",icon:ka.Add,onClick:()=>L?.(b.id)},...C?{indent:{label:Ge?.indent||"Indent",icon:ka.Indent,onClick:()=>C([b.id]),disabled:K||!Ri(e,b.id)}}:{},...y?{outdent:{label:Ge?.outdent||"Outdent",icon:ka.Outdent,onClick:()=>y([b.id]),disabled:K||!Nd(e,b.id)}}:{},...F?{dependencies:{label:Ge?.dependencies||"Dependencies\u2026",icon:ka.Link,onClick:()=>F(b),disabled:!!D}}:{},...w?{milestone:{label:b.isMilestone?Tt?"Quitar hito":"Remove milestone":Tt?"Convertir en hito":"Convert to milestone",icon:ka.Milestone,onClick:()=>w(b.id,{isMilestone:!b.isMilestone}),disabled:!!D}}:{},markIncomplete:{label:(Ge?.markIncomplete||"Mark Incomplete")+le,icon:ka.MarkIncomplete,onClick:()=>W.forEach(Ke=>w?.(Ke.id,{status:"todo",progress:0})),disabled:W.length===0||W.every(Ke=>Ke.status==="todo")},setInProgress:{label:(Ge?.setInProgress||"Set In Progress")+le,icon:ka.SetInProgress,onClick:()=>W.forEach(Ke=>w?.(Ke.id,{status:"in-progress"})),disabled:W.length===0||W.every(Ke=>Ke.status==="in-progress")},markComplete:{label:(Ge?.markComplete||"Mark Complete")+le,icon:ka.MarkComplete,onClick:()=>W.forEach(Ke=>w?.(Ke.id,{status:"completed",progress:100})),disabled:W.length===0||W.every(Ke=>Ke.status==="completed")},duplicate:{label:(Ge?.duplicateTask||"Duplicate Task")+le,icon:ka.Duplicate,onClick:()=>k?.(te)},split:{label:Ge?.splitTask||"Split Task",icon:ka.Split,onClick:()=>{},disabled:true},delete:{label:(Ge?.deleteTask||"Delete Task")+le,icon:ka.Delete,onClick:Ve}})},pe=u.filter(b=>b.visible),We=pe.reduce((b,D)=>b+D.width,0);return jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:ae?"var(--v6-tarjeta, #FFFFFF)":t.bgPrimary,minWidth:We},children:[ae?jsxRuntime.jsxs("div",{"data-cabecera-tabla-v6":true,className:"sticky top-0 z-10 flex flex-col",style:{height:`${Xa}px`,boxSizing:"border-box",background:"var(--v6-tarjeta, #FFFFFF)",borderBottom:"1px solid var(--v6-borde, #E2E5E9)"},children:[jsxRuntime.jsxs("div",{style:{height:24,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 10px 0 14px",borderBottom:"1px solid var(--v6-linea, #EEF0F2)",fontSize:11,color:"var(--v6-tenue, #5F6972)"},children:[jsxRuntime.jsxs("span",{className:"truncate","data-resumen-v6":true,children:[q,we&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" \xB7 ",jsxRuntime.jsx("button",{type:"button",onClick:we,"data-mostrar-ocultas":true,style:{border:0,padding:0,background:"transparent",font:"inherit",color:"var(--v6-acento-texto, #087F72)",fontWeight:500,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:Tt?"Mostrar":"Show"})]}),kt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" \xB7 ",jsxRuntime.jsx("button",{type:"button",onClick:kt,"data-ocultar-completadas":true,style:{border:0,padding:0,background:"transparent",font:"inherit",color:"var(--v6-acento-texto, #087F72)",cursor:"pointer"},children:Tt?"Ocultar completadas":"Hide completed"})]}),Ct&&$t&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" \xB7 ",jsxRuntime.jsx("span",{"data-aviso-vencidas":true,style:{color:"var(--v6-rojo, #B02A33)",fontWeight:500},children:Ct})," \xB7 ",jsxRuntime.jsx("button",{type:"button",onClick:$t,"data-ver-vencidas":true,style:{border:0,padding:0,background:"transparent",font:"inherit",color:"var(--v6-acento-texto, #087F72)",fontWeight:500,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:Tt?"Ver":"View"})]})]}),He&&jsxRuntime.jsx("button",{type:"button",onClick:He,"aria-label":Tt?"Contraer todos los grupos":"Collapse all groups",title:Tt?"Contraer todos los grupos":"Collapse all groups",style:{width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.ChevronsDownUp,{style:{width:13,height:13},strokeWidth:2})})]}),jsxRuntime.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:10,padding:"0 14px 0 10px",fontSize:11,fontWeight:500,color:"var(--v6-tenue, #5F6972)"},children:[pe.map(b=>jsxRuntime.jsx("div",{style:{width:b.id==="name"?void 0:b.width,flex:b.id==="name"?"1 1 0":"0 0 auto",minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textAlign:b.id==="assignees"?"center":b.id==="progress"?"right":"left",paddingLeft:b.id==="name"?60:0},title:b.id==="assignees"?b.label:void 0,children:b.id==="assignees"&&(b.width??0)<=40?jsxRuntime.jsx("span",{role:"img","aria-label":b.label,"data-encabezado-responsable":true,style:{display:"inline-flex",justifyContent:"center",width:"100%"},children:jsxRuntime.jsx(lucideReact.User,{"aria-hidden":true,style:{width:13,height:13},strokeWidth:2})}):b.label},b.id)),V&&jsxRuntime.jsx(W0,{es:Tt,elegidas:V.elegidas,alternar:V.alternar,opciones:xl.filter(b=>b.id!=="cost"||V.verCostos)})]})]}):jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.glassHeader||t.bgSecondary,height:`${Xa}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsxRuntime.jsx("div",{className:"flex items-center flex-1 min-w-0",children:pe.map((b,D)=>{let j=D===pe.length-1,K=b.id==="name";return jsxRuntime.jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${K?"":"justify-center"}`,style:{width:`${b.width}px`,minWidth:`${b.minWidth??(K?200:60)}px`,maxWidth:`${b.maxWidth??2e3}px`,flexShrink:K&&pe.length===1?1:0,flexGrow:K&&pe.length===1?1:0,borderRight:j?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:Q=>{Q.preventDefault(),it({isOpen:true,x:Q.clientX,y:Q.clientY,type:"header",columnId:b.id});},onMouseEnter:Q=>{Q.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:Q=>{Q.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:b.label,children:b.label}),b.resizable&&jsxRuntime.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"12px",marginRight:"-6px",backgroundColor:Ut===b.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:Q=>{Q.preventDefault(),Q.stopPropagation(),Pt(b.id),et(Q.clientX),ke(b.width);},title:Tt?"Arrastra para cambiar el ancho":"Drag to resize column",children:jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 transition-opacity",style:{left:"5px",width:"2px",backgroundColor:t.accent,borderRadius:"1px",opacity:Ut===b.id?.8:void 0},children:jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-20 group-hover:opacity-80 transition-opacity",style:{backgroundColor:t.accent}})})})]},b.id)})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.glassHeader||t.bgSecondary,zIndex:5},children:[jsxRuntime.jsx(Jc,{columns:u,onToggleColumn:g,theme:t}),jsxRuntime.jsx("button",{onClick:()=>ta(!gt),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"})}),gt&&jsxRuntime.jsxs("div",{ref:ra,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>ta(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content","data-grid-body":true,style:{minHeight:un},role:"treegrid","aria-label":Tt?"Tareas del cronograma":"Schedule tasks","aria-rowcount":ya.length,children:[Je&&Je.desde>0&&jsxRuntime.jsx("div",{"aria-hidden":true,"data-relleno-arriba":true,style:{height:Je.desde*a}}),ya.map(({task:b,level:D},j)=>{if(Je&&(j<Je.desde||j>Je.hasta))return null;let K=Oa(b.id),Q=_e(j),te=X===b.id,W=te&&Le==="above",le=te&&Le==="below",Ve=te&&Le==="child",Ge={};return Ve&&(Ge.backgroundColor=`${t.accent}15`,Ge.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-row":b.id,role:"row","aria-rowindex":j+1,"aria-level":D+1,"aria-expanded":b.subtasks?.length?!!b.isExpanded:void 0,"aria-selected":K,tabIndex:ae?b.id===za?0:-1:void 0,className:`flex items-center cursor-pointer group ${se===b.id?"opacity-50":""}`,style:{position:"relative",height:`${a}px`,...ae?{boxSizing:"border-box",padding:"0 14px 0 10px",gap:10,borderBottom:"1px solid var(--v6-linea, #EEF0F2)",boxShadow:K?"inset 2px 0 0 var(--v6-acento, #0FA392)":void 0,backgroundColor:K?"var(--v6-fila-seleccionada, rgba(15,163,146,0.08))":Ve?`${t.accent}15`:"transparent"}:{borderLeft:K?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:K?t.accentLight:Ve?`${t.accent}15`:j%2===0?t.bgPrimary:t.bgGrid},opacity:ge?b.isCriticalPath?1:.4:void 0,transition:"opacity 300ms ease",...Ge},onMouseEnter:()=>mt(b.id),onMouseLeave:()=>mt(null),onClick:Ke=>{let Ha=Cl(e).map(Re=>Re.id),fa=navigator.platform.toUpperCase().indexOf("MAC")>=0?Ke.metaKey:Ke.ctrlKey;Fa(b.id,Ha,fa,Ke.shiftKey),s?.(b.id),!fa&&!Ke.shiftKey&&o?.(b);},onDoubleClick:Ke=>{Ke.stopPropagation(),d?.(b);},onContextMenu:Ke=>{Ke.preventDefault(),it({isOpen:true,x:Ke.clientX,y:Ke.clientY,type:"task",task:b}),l?.(b,Ke);},whileHover:{backgroundColor:ae?K?"var(--v6-fila-seleccionada, rgba(15,163,146,0.08))":"var(--v6-fila-hover, rgba(14,17,20,0.025))":K?t.accentLight:t.hoverBg},children:[W&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),le&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),pe.map((Ke,Et)=>{let Ha=Et===pe.length-1,Da=Ke.id==="name",fa=!!(b.subtasks&&b.subtasks.length>0),Re=Ke.id==="assignees"||Ke.id==="startDate"||Ke.id==="endDate"?Ke.id:null,Ea=!!Re&&!fa&&Ze===b.id&&!qe,Ua=Q&&!!qe&&qe.column===Ke.id;return jsxRuntime.jsxs("div",{role:"gridcell",className:ae?"flex items-center":`px-4 flex items-center ${Da?"justify-start":"justify-center"}`,style:ae?{position:"relative",width:Da?void 0:`${Ke.width}px`,flex:Da?"1 1 0":"0 0 auto",minWidth:0,height:"100%",alignItems:"center",overflow:"visible",backgroundColor:Ua?`${t.accent}22`:void 0}:{position:"relative",width:`${Ke.width}px`,minWidth:`${Ke.minWidth??(Da?200:60)}px`,maxWidth:`${Ke.maxWidth??2e3}px`,flexShrink:Da&&pe.length===1?1:0,flexGrow:Da&&pe.length===1?1:0,borderRight:Ha?"none":`1px solid ${Ze===b.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"visible",backgroundColor:Ua?`${t.accent}22`:void 0,boxShadow:Ua?`inset 0 0 0 1px ${t.accent}66`:void 0},children:[ee(Ke,b,Da?D:0),Ea&&Re&&jsxRuntime.jsx("div",{title:"Arrastr\xE1 hacia abajo para aplicar a varias tareas",onMouseDown:qn=>St(qn,b.id,Re,j),style:{position:"absolute",right:2,bottom:2,width:8,height:8,borderRadius:2,background:t.accent,border:`1px solid ${t.bgPrimary}`,cursor:"crosshair",zIndex:5}})]},`${b.id}-${Ke.id}`)})]},b.id)}),Je&&Je.hasta<ya.length-1&&jsxRuntime.jsx("div",{"aria-hidden":true,"data-relleno-abajo":true,style:{height:(ya.length-1-Je.hasta)*a}}),M&&jsxRuntime.jsxs("button",{type:"button","data-anadir-tarea":true,onClick:M.onClick,className:ae?"w-full flex items-center text-left":"w-full flex items-center gap-2 px-3 text-left text-[13px] transition-colors",style:ae?{height:36,gap:8,padding:"0 14px 0 34px",border:0,background:"transparent",color:"var(--v6-tenue, #5F6972)",font:"inherit",fontSize:13,cursor:"pointer"}:{height:`${a}px`,color:t.textTertiary,borderBottom:`1px solid ${t.borderLight}`},onMouseEnter:b=>{b.currentTarget.style.color=ae?"var(--v6-texto, #0E1114)":t.textPrimary;},onMouseLeave:b=>{b.currentTarget.style.color=ae?"var(--v6-tenue, #5F6972)":t.textTertiary;},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),M.label]})]}),jsxRuntime.jsx(yl,{isOpen:Ce.isOpen,x:Ce.x,y:Ce.y,items:Ce.type==="header"&&Ce.columnId?ce(Ce.columnId):Ce.type==="task"&&Ce.task?ue(Ce.task):[],onClose:()=>it({...Ce,isOpen:false}),theme:t}),na&&nt&&se&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:nt.x+12,top:nt.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let b=ya.find(D=>D.task.id===se)?.task;return b?jsxRuntime.jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:b.name})}):null})()}),document.body)]})}function Dh(e,t){let[a,n]=react.useState("none"),[r,o]=react.useState(0),[s,i]=react.useState(e),[d,l]=react.useState(t),[p,c]=react.useState(null),[u,g]=react.useState(null),[h,w]=react.useState(null),[f,C]=react.useState(null),[y,N]=react.useState(0),[m,k]=react.useState(0),[x,I]=react.useState(null),[M,L]=react.useState(false);return {dragMode:a,setDragMode:n,dragOffset:r,setDragOffset:o,ghostX:s,setGhostX:i,ghostWidth:d,setGhostWidth:l,connectionLine:p,setConnectionLine:c,hoveredTaskId:u,setHoveredTaskId:g,activeZone:h,setActiveZone:w,draggedSegmentIndex:f,setDraggedSegmentIndex:C,draggedSegmentStartX:y,setDraggedSegmentStartX:N,segmentDragOffsetX:m,setSegmentDragOffsetX:k,hoveredSegmentIndex:x,setHoveredSegmentIndex:I,isHovered:M,setIsHovered:L,isDragging:a!=="none",isResizing:a==="resize-start"||a==="resize-end",isConnecting:a==="connect",resetDragState:(P,B)=>{n("none"),c(null),g(null),i(P),l(B),k(0),C(null),N(0);}}}function eu({task:e,x:t,y:a,width:n,theme:r,dayWidth:o,startDate:s,templates:i,onClick:d,onDoubleClick:l,onContextMenu:p,onDateChange:c,onDependencyCreate:u,allTaskPositions:g=[],onDragMove:h,onHoverChange:w,showBaseline:f,showTaskBarLabels:C=true,showCriticalPath:y=true,readOnly:N=false,onProgressChange:m,v6:k=false,alturaBarra:x,duracionV6:I,sobreasignada:M=false,calendario:L,transversal:F=false}){let H=Bo(),z=Dh(t,n),Y=react.useRef(null),P=react.useRef(false),B=Bo(),ge=react.useRef(false),ae=react.useRef(null),xe=react.useRef(null),{dragMode:V,setDragMode:fe,dragOffset:bt,setDragOffset:st,ghostX:q,setGhostX:He,ghostWidth:we,setGhostWidth:kt,connectionLine:Je,setConnectionLine:Ct,hoveredTaskId:$t,setHoveredTaskId:Tt,activeZone:At,setActiveZone:Ze,draggedSegmentIndex:mt,setDraggedSegmentIndex:Dt,draggedSegmentStartX:Bt,setDraggedSegmentStartX:jt,segmentDragOffsetX:je,setSegmentDragOffsetX:aa,hoveredSegmentIndex:Ut,setHoveredSegmentIndex:Pt,isHovered:Ht,setIsHovered:et,isDragging:re,isResizing:ke,isConnecting:Ce,resetDragState:it}=z,se=x??18,at=!!r.executionBarBg,X=r.textPrimary==="#FFFFFF"||r.bgPrimary==="#050505",Te=at?3:6,Le=e.subtasks&&e.subtasks.length>0,Xe=react.useRef(null),[Rt,Ft]=(()=>{let _=react.useRef(null),[,oe]=react.useState(0);return [_.current,S=>{_.current=S,oe($=>$+1);}]})(),da=!!m&&!N&&!Le&&!e.segments&&!!e.startDate&&!!e.endDate,nt=e.endDate&&(()=>{let _=new Date;_.setHours(0,0,0,0);let oe=new Date(e.endDate);return oe.setHours(0,0,0,0),oe<_})()&&e.progress<100,ca=y&&e.isCriticalPath,na=r.name==="neutral"||r.today==="#1C1917",Gt=e.status==="completed"||e.progress===100,Ee={low:"#10B981",LOW:"#10B981",medium:"#F59E0B",MEDIUM:"#F59E0B",high:"#F97316",HIGH:"#F97316",urgent:"#EF4444",URGENT:"#EF4444"},Z=y&&e.isCriticalPath||nt?"#EF4444":e.color?e.color:e.priority&&Ee[e.priority]?Ee[e.priority]:r.taskBarPrimary,Ue=N?"default":re?Ce?"crosshair":ke?"ew-resize":"grabbing":"grab",ut=N?"default":"ew-resize",ta=(_=>_>=80?20:_>=60?15:_>=50?12:10)(n),ra=n<50,Pa=n<40;react.useEffect(()=>{w&&(!Ht||re||e.segments)&&w(null);},[Ht,re,e.segments,w]);let Fa=_=>_.toLocaleDateString(H?"es-CO":"en-US",{month:"short",day:"numeric",year:"numeric"}),Oa=()=>{let _=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return H?`${_} d\xEDa${_!==1?"s":""}`:`${_} day${_!==1?"s":""}`},ua=_=>Math.round(_/o)*o,Za=_=>{let oe=Math.round(_/o),S=new Date(s);return S.setDate(S.getDate()+oe),S},en=_=>{let oe=g.find($=>$.id===_),S=!!oe&&!!Je&&Je.x>oe.x+oe.width/2;return P.current?S?"SF":"SS":S?"FF":"FS"},ya=(_,oe)=>{for(let S of g){if(S.id===e.id)continue;let $=5;if(_>=S.x-$&&_<=S.x+S.width+$&&oe>=S.y-$&&oe<=S.y+S.height+$)return S.id}return null},za=react.useCallback((_,oe,S)=>{if(N)return;_.preventDefault(),_.stopPropagation();let $=Y.current?.ownerSVGElement;if(!$)return;let ee=$.createSVGPoint();ee.x=_.clientX,ee.y=_.clientY;let ce=ee.matrixTransform($.getScreenCTM()?.inverse()),ue=S!==void 0?S:t,pe=oe;if(!pe){let We=ce.x-ue;_.shiftKey?(pe="connect",P.current=false,Ct({x:t+n,y:a+se/2})):_.ctrlKey||_.metaKey?pe="move":_.altKey?pe=We<n/2?"resize-start":"resize-end":Pa?We<n/2?pe="move":pe="resize-end":ra?We<=ta/2?pe="resize-start":We>=n-ta/2?pe="resize-end":pe="move":We<=ta?pe="resize-start":We>=n-ta?pe="resize-end":pe="move";}ge.current=false,fe(pe),et(false),Ze(null),pe==="move"?st(ce.x-ue):pe==="connect"?Ct({x:P.current?t:t+n,y:a+se/2}):st(0),He(ue),kt(n);},[t,n,a,se,N]),Xa=react.useCallback(_=>{let oe=Y.current?.ownerSVGElement;if(!oe)return;let S=oe.closest(".gantt-timeline-scroll");if(!S)return;let $=S.getBoundingClientRect(),ee=60,ce=15,ue=0;if(_.clientX<$.left+ee){let pe=$.left+ee-_.clientX;ue=-Math.min(ce,pe/2);}else if(_.clientX>$.right-ee){let pe=_.clientX-($.right-ee);ue=Math.min(ce,pe/2);}return ue!==0&&(S.scrollLeft+=ue),ue!==0},[]),un=react.useCallback(_=>{if(V==="none")return;ge.current=true,xe.current=_;let oe=Y.current?.ownerSVGElement;if(!oe)return;if(V==="move"||V==="resize-start"||V==="resize-end"){let ee=Xa(_);ee&&!ae.current?ae.current=window.setInterval(()=>{xe.current&&(Xa(xe.current),un(xe.current));},16):!ee&&ae.current&&(window.clearInterval(ae.current),ae.current=null);}let S=oe.createSVGPoint();S.x=_.clientX,S.y=_.clientY;let $=S.matrixTransform(oe.getScreenCTM()?.inverse());if(V==="connect"){Ct({x:$.x,y:$.y});let ee=ya($.x,$.y);Tt(ee);}else if(V==="move"){let ee=$.x-bt,ce=ua(ee);He(ce),kt(n);let ue=Math.round((ce-t)/o);if(h?.(e.id,ue,true),e.segments&&e.segments.length>0&&mt!==null){let pe=ce-Bt;aa(pe);}}else if(V==="resize-start"){let ee=$.x,ce=ua(ee),ue=t+n-ce;ue>=o&&(He(ce),kt(ue));}else if(V==="resize-end"){let ee=$.x,ue=ua(ee)-t;ue>=o&&kt(ue);}},[V,t,n,o,bt,e,ua,mt,Bt,ya,Tt,Ct,He,kt,aa,h,Xa]),oa=react.useCallback(()=>{if(ae.current&&(window.clearInterval(ae.current),ae.current=null),xe.current=null,V!=="none"){if(V==="connect")$t&&u&&u(e,$t,en($t)),Ct(null),Tt(null);else {let _=e.endDate.getTime()-e.startDate.getTime(),oe,S,$=true;if(V==="move"){if(oe=Za(q),S=new Date(oe.getTime()+_),e.segments&&e.segments.length>0&&mt!==null){let ee=Math.round(je/o),ce=e.segments.map((b,D)=>{if(D===mt){let j=new Date(b.startDate),K=new Date(b.endDate);return j.setDate(j.getDate()+ee),K.setDate(K.getDate()+ee),{startDate:j,endDate:K}}return b}),ue=ce.flatMap(b=>[b.startDate,b.endDate]),pe=new Date(Math.min(...ue.map(b=>b.getTime()))),We=new Date(Math.max(...ue.map(b=>b.getTime())));c?.({...e,segments:ce},pe,We),it(t,n);return}}else V==="resize-start"?(oe=Za(q),S=e.endDate,oe>S&&(console.warn("Invalid date range: start date must be before or equal to end date"),$=false)):V==="resize-end"?(oe=e.startDate,S=Za(q+we),S.setDate(S.getDate()-1),S<oe&&(console.warn("Invalid date range: end date must be after or equal to start date"),$=false)):$=false;$&&oe&&S&&(S.getTime()<oe.getTime()?console.warn("Invalid date range: end date cannot be before start date"):c?.(e,oe,S));}h?.(e.id,0,false),it(t,n);}},[V,q,we,e,c,$t,u,t,n,o,Za,je,mt,it,h]);react.useEffect(()=>{if(V==="none")return;let _=S=>{un(S);},oe=()=>{oa();};return window.addEventListener("mousemove",_),window.addEventListener("mouseup",oe),()=>{window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",oe),ae.current&&(window.clearInterval(ae.current),ae.current=null);}},[V,un,oa]);let St=re&&!Ce?q:t,_e=re&&!Ce?we:n,ia=i.taskClass(e),Me=24,_t=y?e.isCriticalPath?1:.25:1,Aa=react.useCallback(_=>{if(!da)return;_.stopPropagation(),_.preventDefault();let S=Y.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??null;Xe.current={barRect:S,initialPct:e.progress||0},_.currentTarget.setPointerCapture(_.pointerId),Ft(e.progress||0);},[da,e.progress,Ft]),U=react.useCallback(_=>{let oe=Xe.current;if(!oe)return;let $=Y.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??oe.barRect;if(!$||$.width<=0)return;let ee=(_.clientX-$.left)/$.width,ce=Math.round(Math.max(0,Math.min(1,ee))*100);_.shiftKey&&(ce=Math.round(ce/25)*25),Ft(ce);},[Ft]),T=react.useCallback(_=>{let oe=Xe.current;if(!oe)return;_.stopPropagation(),_.preventDefault();try{_.currentTarget.releasePointerCapture(_.pointerId);}catch{}let S=Rt;Xe.current=null,Ft(null),S!=null&&S!==oe.initialPct&&m&&m(e,S);},[Rt,m,e,Ft]),G=react.useCallback(_=>{_.stopPropagation(),_.preventDefault();},[]),ie=Rt??(e.progress||0);return jsxRuntime.jsxs("g",{ref:Y,"data-task-bar":"true",role:"img","aria-label":`${e.name}, ${e.progress??0}%`,"data-estado":Gt?"completed":nt?"overdue":"planned","data-resumen":Le?"true":void 0,style:{opacity:_t,transition:"opacity 300ms ease"},onClick:()=>{!re&&!ge.current&&d?.(e),ge.current=false;},onDoubleClick:_=>{!re&&!ge.current&&(_.stopPropagation(),l?.(e));},onContextMenu:_=>{_.preventDefault(),p?.(e,_);},onMouseEnter:_=>{re||(et(true),w&&!e.segments&&w({task:e,x:t,y:a,width:n,height:se,showBelow:false,mouseX:_.clientX,mouseY:_.clientY}));},onMouseMove:_=>{w&&Ht&&!re&&!e.segments&&w({task:e,x:t,y:a,width:n,height:se,showBelow:false,mouseX:_.clientX,mouseY:_.clientY});},onMouseLeave:()=>{re||(et(false),Ze(null));},children:[jsxRuntime.jsx("rect",{x:t,y:a,width:n+Me,height:se,fill:"transparent",style:{pointerEvents:"all"}}),Ht&&!re&&!ra&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:ta,height:se,fill:At==="resize-start"?r.accent:"transparent",opacity:At==="resize-start"?.15:0,style:{cursor:ut,pointerEvents:"all"},onMouseEnter:()=>Ze("resize-start"),onMouseDown:_=>za(_,"resize-start")}),jsxRuntime.jsx("rect",{x:t+ta,y:a,width:n-ta*2,height:se,fill:At==="move"?r.accent:"transparent",opacity:At==="move"?.1:0,style:{cursor:N?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>Ze("move"),onMouseDown:_=>za(_,"move")}),jsxRuntime.jsx("rect",{x:t+n-ta,y:a,width:ta,height:se,fill:At==="resize-end"?r.accent:"transparent",opacity:At==="resize-end"?.15:0,style:{cursor:ut,pointerEvents:"all"},onMouseEnter:()=>Ze("resize-end"),onMouseDown:_=>za(_,"resize-end")})]}),Ht&&!re&&Pa&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:n/2,height:se,fill:At==="move"?r.accent:"transparent",opacity:At==="move"?.2:0,style:{cursor:N?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>Ze("move"),onMouseDown:_=>za(_,"move")}),jsxRuntime.jsx("rect",{x:t+n/2,y:a,width:n/2,height:se,fill:At==="resize-end"?r.accent:"transparent",opacity:At==="resize-end"?.2:0,style:{cursor:ut,pointerEvents:"all"},onMouseEnter:()=>Ze("resize-end"),onMouseDown:_=>za(_,"resize-end")}),Ht&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+n/2,y1:a+4,x2:t+n/2,y2:a+se-4,stroke:r.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),re&&!Ce&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:q,y:a,width:we,height:se,rx:Te,fill:r.accent,opacity:.15,stroke:r.accent,strokeWidth:1,strokeDasharray:"4 3",initial:{opacity:0},animate:{opacity:.25},transition:{duration:.15},style:{pointerEvents:"none"}}),f&&e.baselineStartDate&&e.baselineEndDate&&!re&&(()=>{let _=e.baselineStartDate.getTime(),oe=e.baselineEndDate.getTime(),S=s.getTime(),$=864e5,ee=(_-S)/$,ce=(oe-_)/$,ue=ee*o,pe=Math.max(ce*o,o),We=St+_e,b=ue+pe,D=e.endDate?.getTime()??0,j=L&&e.endDate?Li(new Date(oe),e.endDate,L):Math.ceil((D-oe)/$),K=j>0,Q=j<-0;return k?jsxRuntime.jsx("rect",{"data-linea-base":e.id,x:ue,y:a+se+2,width:pe,height:3,rx:1.5,style:{fill:"var(--v6-pista, #D5DADF)",pointerEvents:"none"}}):jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:ue,y:a,width:pe,height:se,rx:Te,fill:"none",stroke:X?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.35)",strokeWidth:1.5,strokeDasharray:"6 4"}),K&&We>b&&jsxRuntime.jsx("rect",{x:b,y:a,width:We-b,height:se,rx:0,fill:"#EF4444",opacity:.2}),K&&jsxRuntime.jsxs("text",{x:Math.max(We,b)+6,y:a+se/2+1,fill:"#EF4444",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:["+",j,"d"]}),Q&&jsxRuntime.jsxs("text",{x:We+6,y:a+se/2+1,fill:"#10B981",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:[j,"d"]})]})})(),!e.segments&&at&&Le&&(()=>{let oe=a+(se-8)/2,S=4,$=e.progress||0,ee=new Date;ee.setHours(0,0,0,0);let ce=e.startDate&&ee>=e.startDate,ue=e.endDate&&(()=>{let K=new Date(e.endDate);return K.setHours(0,0,0,0),ee>K})(),pe=e.startDate&&ee<e.startDate,We=1;if(ce&&e.startDate&&e.endDate&&!pe){let K=new Date(e.startDate);K.setHours(0,0,0,0);let Q=new Date(e.endDate);Q.setHours(0,0,0,0);let te=Math.max(1,(Q.getTime()-K.getTime())/(1e3*60*60*24)),le=Math.min((ee.getTime()-K.getTime())/(1e3*60*60*24),te)/te*100;We=le>0?$/le:1;}let b;$>=100?b="#00E5CC":pe?b="#4B5563":ue&&$<100?b="#EF4444":We>=.95?b="#22C55E":We>=.8?b="#F59E0B":b="#EF4444";let D=Math.max($/100*_e,$>0?S*2:0),j=_e>100&&$>0;return jsxRuntime.jsxs("g",{"data-task-class":ia,style:{cursor:"default",pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{"data-parte":"pista",x:St,y:oe,width:_e,height:8,rx:S,fill:"rgba(255,255,255,0.10)"}),$>0&&jsxRuntime.jsx("rect",{"data-parte":"avance",x:St,y:oe,width:D,height:8,rx:S,fill:b}),j&&jsxRuntime.jsxs("text",{x:St+D+6,y:oe+8/2,dominantBaseline:"central",fill:r.textSecondary,fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round($),"%"]})]})})(),k&&!e.segments&&!Le&&(()=>{let _=`v6-barra-${String(e.id).replace(/[^A-Za-z0-9_-]/g,"")}`,oe=!!nt&&!Gt,S=Math.max(0,Math.min(100,ie));if(F){let $=Math.round(a+se/2),ee=Math.round(St),ce=Math.round(St+_e);return jsxRuntime.jsxs("g",{"data-transversal":"",children:[jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,fill:"transparent","data-parte":"pista","data-bar-background":"true",onMouseDown:ue=>za(ue),style:{cursor:Ue,pointerEvents:"all"}}),jsxRuntime.jsx("line",{x1:ee,y1:$,x2:ce,y2:$,stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))",strokeWidth:2,style:{pointerEvents:"none",opacity:re&&!Ce?.25:1}}),S>0&&jsxRuntime.jsx("line",{x1:ee,y1:$,x2:ee+(ce-ee)*(S/100),y2:$,stroke:"var(--v6-acento, #0FA392)",strokeWidth:2,"data-parte":"avance",style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:ee+1,y1:$-5,x2:ee+1,y2:$+5,stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))",strokeWidth:2,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:ce-1,y1:$-5,x2:ce-1,y2:$+5,stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))",strokeWidth:2,style:{pointerEvents:"none"}}),I&&!re&&jsxRuntime.jsx("text",{x:St+_e+6,y:a+se/2,dominantBaseline:"middle","data-etiqueta-barra":true,"data-sobreasignada":M||void 0,fill:M?"var(--v6-ambar, #9A5B00)":"var(--v6-tenue, #5F6972)",fontSize:11,fontFamily:"'JetBrains Mono', ui-monospace, monospace",style:{fontVariantNumeric:"tabular-nums",pointerEvents:"none",userSelect:"none"},children:I})]})}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:_,children:jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:6})})}),jsxRuntime.jsx("rect",{x:Math.round(St)+.5,y:Math.round(a)+.5,width:Math.max(0,Math.round(St+_e)-Math.round(St)-1),height:Math.round(se)-1,rx:6,shapeRendering:"geometricPrecision","data-parte":"pista","data-bar-background":"true","data-task-class":ia,fill:S>0?"var(--v6-acento-fondo-3, rgba(15,163,146,0.16))":"var(--v6-acento-fondo, rgba(15,163,146,0.1))",stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))","data-v6-vencida":oe?"":void 0,strokeWidth:1,onMouseDown:$=>za($),style:{cursor:Ue,pointerEvents:"all",opacity:re&&!Ce?.25:1}}),S>0&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e*(S/100),height:se,clipPath:`url(#${_})`,"data-parte":"avance",fill:"var(--v6-acento, #0FA392)",style:{pointerEvents:"none"}}),ca&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:6,fill:"none",stroke:"var(--v6-texto, #0E1114)",strokeWidth:2,"data-parte":"alerta",style:{pointerEvents:"none"}}),I&&!re&&jsxRuntime.jsx("text",{x:St+_e+6,y:a+se/2,dominantBaseline:"middle","data-etiqueta-barra":true,"data-sobreasignada":M||void 0,fill:M?"var(--v6-ambar, #9A5B00)":"var(--v6-tenue, #5F6972)",fontSize:11,fontFamily:"'JetBrains Mono', ui-monospace, monospace",style:{fontVariantNumeric:"tabular-nums",pointerEvents:"none",userSelect:"none"},children:I})]})})(),!k&&!e.segments&&at&&!Le&&jsxRuntime.jsx(framerMotion.motion.rect,{x:St,y:a,width:_e,height:se,rx:Te,fill:r.executionBarBg||"rgba(255,255,255,0.06)",stroke:r.border||"rgba(255,255,255,0.1)",strokeWidth:1,"data-task-class":ia,"data-bar-background":"true","data-parte":"pista",initial:{opacity:0,scale:.95},animate:{opacity:re&&!Ce?.15:e.parentId?.6:1,scale:Ht&&!re?1.01:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:_=>za(_),style:{cursor:Ue,pointerEvents:"all"}}),!k&&!e.segments&&!at&&jsxRuntime.jsx(framerMotion.motion.rect,{x:St,y:a,width:_e,height:se,rx:Te,fill:Z,"data-task-class":ia,"data-parte":"pista",initial:{opacity:0,scale:.95},animate:{opacity:re&&!Ce?.15:e.parentId?.6:Ht?.9:.8,scale:Ht&&!re?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Le?void 0:_=>za(_),style:{cursor:Le?"default":Ue,pointerEvents:"all"}}),!k&&at&&(nt||ca)&&!e.segments&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:Te,fill:"none",stroke:r.criticalPath,strokeWidth:2,"data-parte":"alerta",style:{pointerEvents:"none",filter:`drop-shadow(0 0 6px ${r.criticalPathLight||"rgba(255,46,46,0.4)"})`}}),nt&&!Gt&&!e.segments&&!Le&&jsxRuntime.jsxs("g",{"data-parte":"icono-vencida",display:"none",style:{pointerEvents:"none"},transform:`translate(${St+_e+4}, ${a+se/2-6})`,children:[jsxRuntime.jsx("circle",{cx:6,cy:6,r:5.25,fill:"none",stroke:"currentColor",strokeWidth:1.5}),jsxRuntime.jsx("line",{x1:6,y1:3.5,x2:6,y2:6.5,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:6,cy:8.6,r:.8,fill:"currentColor"})]}),!k&&!e.segments&&ie>0&&!Le&&jsxRuntime.jsx("rect",{x:St,y:a,width:Math.max(_e*(ie/100),Te*2),height:se,rx:Te,fill:Z,opacity:1,"data-parte":"avance",style:{pointerEvents:"none"}}),!k&&!e.segments&&!Le&&e.progress<100&&(()=>{let _=e.progress>0?_e*(e.progress/100):0,oe=St+_,S=_e-_,$=e.progress===0?Te:0,ee=e.progress===0?St:oe,ce=e.progress===0?_e:S;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:ee,y:a,width:ce,height:se,rx:$,fill:"url(#bar-remaining-hatch)","data-parte":"trama",style:{pointerEvents:"none"}}),jsxRuntime.jsx("rect",{x:ee,y:a,width:ce,height:se,rx:$,fill:"none",stroke:Z,strokeWidth:.8,strokeDasharray:"5 3","data-parte":"borde-restante",style:{pointerEvents:"none"}})]})})(),!k&&at&&!e.segments&&e.progress>0&&e.progress<100&&!Le&&!re&&Rt===null&&(()=>{let _=St+_e*(e.progress/100),oe=8,S=e.assignees?.[0];return jsxRuntime.jsxs("g",{"data-parte":"avatar",style:{pointerEvents:"none"},children:[jsxRuntime.jsx("circle",{cx:_,cy:a+se/2,r:oe,fill:S?.color||r.accent,stroke:"#000",strokeWidth:1.5}),jsxRuntime.jsx("text",{x:_,y:a+se/2,textAnchor:"middle",dominantBaseline:"central",fill:"#FFF",fontSize:"8",fontWeight:"600",fontFamily:"Inter, sans-serif",children:S?.initials||(S?.name?on(S.name):"")})]})})(),da&&!re&&_e>=40&&(Rt!==null||ie<88)&&(()=>{let _=St+_e*(ie/100),oe=a+se/2,S=Rt!==null,$=S?7:Ht?6:5,ee=S||Ht?1:k?0:.35,ce=St+_e-_,ue=Math.max(4,Math.min(12,ce-10)),pe=12;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:_-pe,y:oe-12,width:pe+ue,height:24,fill:"transparent",style:{cursor:"ew-resize",touchAction:"none"},onPointerDown:Aa,onPointerMove:U,onPointerUp:T,onPointerCancel:T,onClick:G,onDoubleClick:G,onMouseDown:We=>We.stopPropagation()}),jsxRuntime.jsx("circle",{"data-parte":"asa-avance",cx:_,cy:oe,r:$,fill:"#FFFFFF",stroke:Z,strokeWidth:2,opacity:ee,style:{pointerEvents:"none",filter:S?`drop-shadow(0 0 4px ${Z})`:void 0,transition:"r 120ms ease, opacity 120ms ease"}}),S&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:_-20,y:oe-28,width:40,height:18,rx:4,fill:X?"rgba(15, 15, 20, 0.95)":"rgba(255, 255, 255, 0.95)",stroke:Z,strokeWidth:1}),jsxRuntime.jsxs("text",{x:_,y:oe-16,textAnchor:"middle",dominantBaseline:"central",fill:X?"#FFFFFF":"#111111",fontSize:"11",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",children:[Rt,"%"]})]})]})})(),e.segments&&e.segments.map((_,oe)=>{let S=(_.startDate.getTime()-s.getTime())/864e5*o,ee=(_.endDate.getTime()-s.getTime())/(1e3*60*60*24)*o-S+o,ce=re&&V==="move"&&mt===oe,ue=Ut===oe,pe=ce?S+je:S;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!re&&Pt(oe),onMouseLeave:()=>!re&&Pt(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:pe,y:a,width:ee,height:se,rx:Te,fill:Z,initial:{opacity:0,scale:.95},animate:{opacity:ce||e.parentId?.6:ue?.9:.8,scale:ue&&!re?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:We=>{We.stopPropagation(),Dt(oe),jt(S),za(We,void 0,S);},style:{cursor:Ue,pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:pe,y:a,width:ee*(e.progress/100),height:se,rx:Te,fill:Z,opacity:1,style:{pointerEvents:"none"}})]},`segment-${oe}`)}),na&&(nt||ca)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[ca&&!nt&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:Te,fill:"none",stroke:r.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),nt&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:Te,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),!k&&C&&_e>60&&!e.segments&&!(at&&Le)&&(()=>{let _=i.taskLabel(e),oe=typeof _=="string"?_:e.name,S=oe.length>Math.floor(_e/8)?`${oe.substring(0,Math.floor(_e/8))}...`:oe;return jsxRuntime.jsx("text",{"data-parte":"etiqueta",x:St+8,y:a+se/2,dominantBaseline:"middle",fill:Gt?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:Gt?"line-through":"none"},children:S})})(),!k&&!re&&!e.segments&&!Le&&e.progress>0&&e.progress<100&&(at?jsxRuntime.jsxs("text",{x:St+_e+6,y:a+se/2,dominantBaseline:"middle",fill:r.textSecondary,fontSize:"9",fontWeight:"500",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):_e>100?jsxRuntime.jsxs("text",{x:St+_e-12,y:a+se/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):null),!k&&e.status&&_e>80&&!re&&!e.segments&&!(at&&Le)&&jsxRuntime.jsxs("g",{"data-parte":"insignia-estado",style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:St+_e-8,cy:a+8,r:4,fill:r.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:St+_e-8,cy:a+8,r:4,fill:r.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(Ht||ke)&&!Ce&&!e.segments&&!Le&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:St-2,y:a,width:16,height:se,fill:"transparent",style:{cursor:ut},onMouseEnter:()=>Ze("resize-start"),onMouseLeave:()=>Ze(null),onMouseDown:_=>{_.stopPropagation(),za(_,"resize-start");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:St+4,y:a+8,width:3,height:se-16,rx:1.5,fill:At==="resize-start"||V==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:St+_e-14,y:a,width:16,height:se,fill:"transparent",style:{cursor:ut},onMouseEnter:()=>Ze("resize-end"),onMouseLeave:()=>Ze(null),onMouseDown:_=>{_.stopPropagation(),za(_,"resize-end");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:St+_e-7,y:a+8,width:3,height:se-16,rx:1.5,fill:At==="resize-end"||V==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ht&&!re&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx("circle",{cx:t-10,cy:a+se/2,r:10,fill:"transparent",style:{cursor:"crosshair"},"data-conectar-desde":"inicio",onMouseEnter:()=>Ze("connect-start"),onMouseLeave:()=>Ze(null),onMouseDown:_=>{_.stopPropagation(),P.current=true,za(_,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t-10,cy:a+se/2,r:4,fill:r.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:At==="connect-start"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}}),jsxRuntime.jsx("circle",{cx:t+n+10,cy:a+se/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>Ze("connect"),onMouseLeave:()=>Ze(null),"data-conectar-desde":"fin",onMouseDown:_=>{_.stopPropagation(),P.current=false,za(_,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+n+10,cy:a+se/2,r:4,fill:r.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:At==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),Ce&&Je&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:P.current?t:t+n,y1:a+se/2,x2:Je.x,y2:Je.y,stroke:$t?r.statusCompleted:r.accent,strokeWidth:$t?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:$t?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:Je.x,cy:Je.y,r:$t?8:6,fill:$t?r.statusCompleted:r.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),$t&&jsxRuntime.jsx(framerMotion.motion.text,{x:Je.x+15,y:Je.y,dominantBaseline:"middle",fill:r.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:Je.x+10},animate:{opacity:1,x:Je.x+15},transition:{duration:.2},children:(()=>{let _=B;return {FS:_?"Fin \u2192 Comienzo":"Finish \u2192 Start",SS:_?"Comienzo \u2192 Comienzo":"Start \u2192 Start",FF:_?"Fin \u2192 Fin":"Finish \u2192 Finish",SF:_?"Comienzo \u2192 Fin":"Start \u2192 Finish"}[en($t)]})()})]}),(Ht||re)&&!Ce&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:St-1,y:a-1,width:_e+2,height:se+2,rx:Te+1,fill:"none",stroke:re?r.accent:at?"rgba(255,255,255,0.2)":r.taskBarPrimary,strokeWidth:at?1:2,opacity:re||at?.6:.4,initial:{opacity:0},animate:{opacity:re||at?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),ke&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:q,y1:0,x2:q,y2:1e3,stroke:r.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:q+we,y1:0,x2:q+we,y2:1e3,stroke:r.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ht&&!re&&!e.segments&&!w&&(()=>{let S=a<100,$=S?a+se+13:a-82-13,ee=S?`M ${St+_e/2-6} ${a+se+3} L ${St+_e/2} ${a+se+13} L ${St+_e/2+6} ${a+se+3}`:`M ${St+_e/2-6} ${a-13} L ${St+_e/2} ${a-3} L ${St+_e/2+6} ${a-13}`,ce=$+22,ue=$+40,pe=$+55,We=$+70,b=S?$+82-5:a-18;return jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:S?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:S?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:ee,fill:r.bgSecondary,stroke:r.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:St+_e/2-120,y:$,width:240,height:82,rx:8,fill:r.bgSecondary,stroke:r.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:St+_e/2,y:ce,textAnchor:"middle",fill:r.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:St+_e/2-110,y:ue,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Inicio:":"Start:"}),jsxRuntime.jsx("text",{x:St+_e/2-70,y:ue,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Fa(e.startDate)}),jsxRuntime.jsx("text",{x:St+_e/2-110,y:pe,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Fin:":"End:"}),jsxRuntime.jsx("text",{x:St+_e/2-70,y:pe,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Fa(e.endDate)}),jsxRuntime.jsx("text",{x:St+_e/2+10,y:ue,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Duraci\xF3n:":"Duration:"}),jsxRuntime.jsx("text",{x:St+_e/2+65,y:ue,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Oa()}),jsxRuntime.jsx("text",{x:St+_e/2+10,y:pe,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Avance:":"Progress:"}),jsxRuntime.jsxs("text",{x:St+_e/2+65,y:pe,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:St+_e/2-110,y:We,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Responsables:":"Assignees:"}),jsxRuntime.jsxs("text",{x:St+_e/2-50,y:We,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(D=>D.name).join(", ").substring(0,30),e.assignees.map(D=>D.name).join(", ").length>30?"...":""]})]}),!S&&jsxRuntime.jsx("text",{x:St+_e/2,y:b,textAnchor:"middle",fill:r.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:Pa?H?"Izquierda: mover \u2022 Derecha: cambiar tama\xF1o":"Left: move \u2022 Right: resize":ra?H?"Arrastra para mover \u2022 ALT + arrastrar el borde para cambiar tama\xF1o":"Drag to move \u2022 Hold ALT + drag edge to resize":H?"Arrastra los bordes para cambiar tama\xF1o \u2022 el centro para mover \u2022 \u26AB para enlazar":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}function zi(e,t=new Date){return !e.endDate||e.status==="completed"||(e.progress??0)>=100?false:new Date(e.endDate.getFullYear(),e.endDate.getMonth(),e.endDate.getDate()).getTime()<new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function Eh(e,t=new Date){let a=0,n=r=>{for(let o of r??[])o.subtasks?.length?n(o.subtasks):zi(o,t)&&a++;};return n(e.subtasks),a}var Pm=260,Nl=8,Mh=16,cT=-12;function Ph({tooltipData:e,theme:t,locale:a="en",workingDaysConfig:n}){let[r,o]=react.useState(null);if(react.useLayoutEffect(()=>{if(!e){o(null);return}let{task:x,mouseX:I,mouseY:M}=e,L=x.effortMinutes!=null||x.timeLoggedMinutes!=null||x.soldEffortMinutes!=null,F=x.lastActivity!=null,H=(L?155:105)+(F?28:0),z=I+Mh,Y=M+cT-H;z+Pm>window.innerWidth-Nl&&(z=I-Pm-Mh),z<Nl&&(z=Nl);let P=Y<Nl;P&&(Y=M+20),Y+H>window.innerHeight-Nl&&(Y=window.innerHeight-Nl-H),o({left:z,top:Y,showBelow:P});},[e]),!e||!r)return null;let{task:s}=e,i=s.effortMinutes!=null||s.timeLoggedMinutes!=null||s.soldEffortMinutes!=null,d={start:a==="es"?"Inicio":"Start",end:a==="es"?"Fin":"End",duration:a==="es"?"Duraci\xF3n":"Duration",progress:a==="es"?"Progreso":"Progress",status:a==="es"?"Estado":"Status",terminarEl:a==="es"?"Terminar el":"Finish by",noAntesDe:a==="es"?"No antes de":"Not before",baselineEnd:a==="es"?"Fin L. base":"Baseline end",variance:a==="es"?"Variaci\xF3n":"Variance",slack:a==="es"?"Holgura":"Slack",assignees:a==="es"?"Asignados":"Assignees",estimated:a==="es"?"Estimado":"Estimated",logged:a==="es"?"Registrado":"Logged",quoted:a==="es"?"Ofertado":"Quoted",tags:a==="es"?"Etiqueta":"Tag"},l=x=>x.toLocaleDateString(a==="es"?"es-ES":"en-US",{month:"short",day:"numeric",year:"numeric"}),p=()=>{if(!s.startDate||!s.endDate)return "N/A";if(!n?.enabledWeekdays){let Y=Math.max(1,Math.round((s.endDate.getTime()-s.startDate.getTime())/864e5)+1);return a==="es"?`${Y} d\xEDa${Y!==1?"s":""}`:`${Y} day${Y!==1?"s":""}`}let x=n.enabledWeekdays,I=n.holidayDates instanceof Set?n.holidayDates:new Set(n.holidayDates??[]),M=Y=>`${Y.getFullYear()}-${String(Y.getMonth()+1).padStart(2,"0")}-${String(Y.getDate()).padStart(2,"0")}`,L=0,F=new Date(s.startDate.getFullYear(),s.startDate.getMonth(),s.startDate.getDate()),H=new Date(s.endDate.getFullYear(),s.endDate.getMonth(),s.endDate.getDate());for(;F.getTime()<=H.getTime();){let Y=F.getDay();x[Y]&&!I.has(M(F))&&L++,F.setDate(F.getDate()+1);}let z=Math.max(0,L);return a==="es"?`${z} d\xEDa${z!==1?"s":""}`:`${z} day${z!==1?"s":""}`},c=x=>{if(x==null||x===0)return "N/A";let I=Math.floor(x/60),M=x%60;return I===0?`${M}m`:M===0?`${I}h`:`${I}h ${M}m`},u=Xc(s,Ur(n)),g=s.status==="completed"||s.progress>=100,h=a==="es"?g?"Completada":zi(s)?"Vencida":s.progress>0||s.status==="in-progress"?"En progreso":"Por hacer":g?"Completed":zi(s)?"Overdue":s.progress>0||s.status==="in-progress"?"In progress":"To do",w=t.textTertiary||"#9CA3AF",f=t.textSecondary||"#D1D5DB",C=t.textPrimary||"#F9FAFB",y=t.accent||"#00E5CC",N=t.bgSecondary||"#1F2937",m=t.border||"#374151",k=jsxRuntime.jsxs("div",{style:{position:"fixed",left:r.left,top:r.top,width:Pm,zIndex:99999,pointerEvents:"none",fontFamily:"Inter, system-ui, sans-serif",animation:"gantt-tooltip-fade 0.12s ease-out"},children:[jsxRuntime.jsxs("div",{style:{background:N,border:`1px solid ${m}`,borderRadius:8,padding:"12px 14px",boxShadow:"0 8px 24px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx("div",{style:{fontSize:13,fontWeight:600,color:C,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.name}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:11},children:[jsxRuntime.jsx(ms,{label:d.start,value:s.startDate?l(s.startDate):"N/A",labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.duration,value:p(),labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.end,value:s.endDate?l(s.endDate):"N/A",labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.progress,value:`${s.progress}%`,labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.status,value:h,labelColor:w,valueColor:f}),s.cpmData&&!s.subtasks?.length&&jsxRuntime.jsx(ms,{label:d.slack,value:`${s.cpmData.totalFloat} d`,labelColor:w,valueColor:f}),s.terminarEl&&jsxRuntime.jsx(ms,{label:d.terminarEl,value:l(s.terminarEl),labelColor:w,valueColor:f}),s.noAntesDe&&jsxRuntime.jsx(ms,{label:d.noAntesDe,value:l(s.noAntesDe),labelColor:w,valueColor:f}),s.baselineEndDate&&jsxRuntime.jsx(ms,{label:d.baselineEnd,value:l(s.baselineEndDate),labelColor:w,valueColor:f}),u!==null&&jsxRuntime.jsx(ms,{label:d.variance,value:`${u>0?"+":""}${u} d`,labelColor:w,valueColor:f})]}),s.assignees&&s.assignees.length>0&&jsxRuntime.jsxs("div",{style:{fontSize:11,marginTop:6},children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.assignees,": "]}),jsxRuntime.jsx("span",{style:{color:f,fontWeight:500},children:s.assignees.map(x=>x.name).join(", ")})]}),s.tags&&s.tags.length>0&&jsxRuntime.jsxs("div",{style:{marginTop:6,fontSize:11},children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.tags,": "]}),jsxRuntime.jsx("span",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,verticalAlign:"middle"},children:s.tags.map(x=>jsxRuntime.jsx("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:10,fontWeight:600,backgroundColor:`${x.color}22`,color:x.color,border:`1px solid ${x.color}55`,whiteSpace:"nowrap"},children:x.name},x.id))})]}),i&&jsxRuntime.jsxs("div",{style:{marginTop:6,display:"flex",gap:10,fontSize:11},children:[s.effortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.estimated,":"]})," ",jsxRuntime.jsx("span",{style:{color:f,fontWeight:600},children:c(s.effortMinutes)})]}),s.timeLoggedMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.logged,":"]})," ",jsxRuntime.jsx("span",{style:{color:y,fontWeight:600},children:c(s.timeLoggedMinutes)})]}),s.soldEffortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.quoted,":"]})," ",jsxRuntime.jsx("span",{style:{color:f,fontWeight:600},children:c(s.soldEffortMinutes)})]})]}),s.lastActivity&&jsxRuntime.jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${t?.borderSubtle||"rgba(255,255,255,0.08)"}`,fontSize:11,color:w,lineHeight:1.4},children:[jsxRuntime.jsx("span",{style:{opacity:.7},children:a==="es"?"\xDAltimo: ":"Last: "}),jsxRuntime.jsx("span",{style:{color:f},children:s.lastActivity.userName})," ",jsxRuntime.jsx("span",{children:s.lastActivity.summary})," ",jsxRuntime.jsx("span",{style:{opacity:.6},children:s.lastActivity.relativeTime})]})]}),jsxRuntime.jsx("style",{children:`
|
|
125
|
+
- [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function em({templates:e,onSelectTemplate:t,className:a}){let[n,r]=react.useState(false),o=react.useRef(null),s=react.useRef(null);react.useEffect(()=>{function l(p){o.current&&!o.current.contains(p.target)&&s.current&&!s.current.contains(p.target)&&r(false);}if(n)return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n]);let i=l=>{t(l),r(false);},d=e.reduce((l,p)=>{let c=p.category||"Other";return l[c]||(l[c]=[]),l[c].push(p),l},{});return jsxRuntime.jsxs("div",{className:v("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:s,onClick:()=>r(!n),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",l.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",l.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:v("w-4 h-4 transition-transform",n&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&jsxRuntime.jsxs("div",{ref:o,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(d).map(([l,p])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:l})}),jsxRuntime.jsx("div",{children:p.map(c=>jsxRuntime.jsxs("button",{onClick:()=>i(c),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:c.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:c.name}),c.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:c.description})]})]},c.id))})]},l)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function am({board:e,isOpen:t,onClose:a,onImport:n,boardElementRef:r,className:o}){let[s,i]=react.useState("export"),[d,l]=react.useState("json"),[p,c]=react.useState(null),u=react.useRef(null);if(!t)return null;let g=async()=>{let w=r?.current||void 0,f=await jf(e,d,w);Wf(f,d);},h=async w=>{let f=w.target.files?.[0];if(f){try{let C=await _f(f),y=f.name.endsWith(".json")?"json":"csv",N=Gf(C,y);c(N),N.success&&n&&n(N,C);}catch(C){c({success:false,errors:[`Failed to read file: ${C instanceof Error?C.message:"Unknown error"}`]});}u.current&&(u.current.value="");}};return jsxRuntime.jsxs("div",{className:v("fixed inset-0 z-[9999] flex items-center justify-center",o),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>i("export"),className:v("flex-1 px-6 py-4 font-semibold transition-colors",s==="export"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>i("import"),className:v("flex-1 px-6 py-4 font-semibold transition-colors",s==="import"?"text-white border-b-2 border-[#00E5CC]":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[s==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(w=>jsxRuntime.jsxs("button",{onClick:()=>l(w),className:v("p-4 rounded-lg border-2 transition-all text-center",d===w?"border-[#00E5CC] bg-[#00E5CC]/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[w==="json"&&"\u{1F4C4}",w==="csv"&&"\u{1F4CA}",w==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:w})]},w))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:g,className:"w-full py-3 px-4 bg-gradient-to-r from-[#00C4AE] to-[#00C4AE] hover:from-[#00E5CC] hover:to-[#00C4AE] text-white font-semibold rounded-lg transition-all shadow-lg shadow-[#00E5CC]/20",children:"Export Board"})]}),s==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:u,type:"file",accept:".json,.csv",onChange:h,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>u.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),p&&jsxRuntime.jsxs("div",{className:v("p-4 rounded-lg",p.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:v("font-semibold mb-2",p.success?"text-green-400":"text-red-400"),children:p.success?"\u2713 Import Successful":"\u2717 Import Failed"}),p.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",p.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",p.columnsImported]})]}),p.errors&&p.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:p.errors.map((w,f)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",w]},f))})]})]})]})]})]})}var g2=["URGENT","HIGH","MEDIUM","LOW"],f2=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],b2=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function nm({filters:e,sort:t,onFiltersChange:a,onSortChange:n,onReset:r,onFilterMyTasks:o,onFilterOverdue:s,onFilterHighPriority:i,availableUsers:d=[],availableLabels:l=[],availableColumns:p=[],showQuickFilters:c=true,compact:u=false,groupBy:g="none",onGroupByChange:h}){let[w,f]=react.useState(true),C=react.useCallback(x=>{a({search:x.target.value});},[a]),y=react.useCallback(x=>{a({dateFilter:x.target.value});},[a]),N=react.useCallback(x=>{n({by:x.target.value});},[n]),m=react.useCallback(()=>{n({order:t.order==="asc"?"desc":"asc"});},[t.order,n]),k=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${u?"filter-bar--compact":""} ${w?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>f(!w),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:w?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:x=>{x.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:x=>{x.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:w?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),k&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!w&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[c&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),o&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),s&&jsxRuntime.jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),i&&jsxRuntime.jsx("button",{onClick:i,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:C,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:y,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:x=>{let I=x.target.value;a({priorities:I==="all"?[]:[I]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),g2.map(x=>jsxRuntime.jsx("option",{value:x,children:x},x))]})}),d.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:x=>{let I=x.target.value;a({assignees:I==="all"?[]:[I]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),d.map(x=>jsxRuntime.jsx("option",{value:x.id,children:x.name},x.id))]})}),l.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:x=>{let I=x.target.value;a({labels:I==="all"?[]:[I]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),l.map(x=>jsxRuntime.jsx("option",{value:x,children:x},x))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:N,className:"filter-bar__select filter-bar__select--sm",children:f2.map(x=>jsxRuntime.jsx("option",{value:x.value,children:x.label},x.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:m,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),h&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:g,onChange:x=>h(x.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:b2.map(x=>jsxRuntime.jsx("option",{value:x.value,children:x.label},x.value))})}),k&&jsxRuntime.jsx("button",{onClick:r,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function rm({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:a,className:n,viewMode:r="kanban",onExportGanttPDF:o,onExportGanttExcel:s,onExportGanttPNG:i,onExportGanttCSV:d}){let[l,p]=react.useState(false),c=react.useRef(null);react.useEffect(()=>{let g=h=>{c.current&&!c.current.contains(h.target)&&p(false);};return l&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g);}},[l]);let u=g=>{g(),p(false);};return jsxRuntime.jsxs("div",{className:v("relative",n),ref:c,children:[jsxRuntime.jsxs("button",{onClick:()=>p(!l),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",g.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",g.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":l,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),l&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[r==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>u(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>u(async()=>await o?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>u(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>u(async()=>await i?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>u(()=>d?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>u(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>u(a),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:g=>{g.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:g=>{g.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var om={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#00E5CC",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},sm={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#00E5CC",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},im={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Mi={dark:om,light:sm,neutral:im},Vc="dark";var jc=react.createContext(void 0),N2="asakaa-theme";function C0({children:e,defaultTheme:t=Vc,storageKey:a=N2}){let[n,r]=react.useState(()=>{if(typeof window<"u"){let i=localStorage.getItem(a);if(i&&(i==="dark"||i==="light"||i==="neutral"))return i}return t}),o=react.useCallback(i=>{r(i),typeof window<"u"&&localStorage.setItem(a,i);},[a]);react.useEffect(()=>{if(typeof window>"u")return;let i=document.documentElement,d=Mi[n];Object.entries(d.colors).forEach(([p,c])=>{c&&i.style.setProperty(`--theme-${S2(p)}`,c);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([p,c])=>{let u=d.colors[p];u&&i.style.setProperty(c,u);}),i.setAttribute("data-theme",n),i.classList.remove("theme-dark","theme-light","theme-neutral"),i.classList.add(`theme-${n}`);},[n]);let s={theme:n,setTheme:o,themes:Mi};return jsxRuntime.jsx(jc.Provider,{value:s,children:e})}function pl(){let e=react.useContext(jc);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function S2(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function lm({isOpen:e,onClose:t,className:a}){let{theme:n,setTheme:r}=pl();return e?jsxRuntime.jsxs("div",{className:v("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(Mi).map(([o,s])=>jsxRuntime.jsxs("button",{onClick:()=>{r(o),t();},className:v("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",n===o?"border-[#00E5CC] bg-[#00E5CC]/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:n===o?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:s.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:s.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[o==="dark"&&"Default dark theme with Linear-inspired colors",o==="light"&&"Clean light theme with high contrast",o==="neutral"&&"Monochrome zen theme"]})]}),n===o&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},o))})]})]}):null}var cs={responsables:[],fases:[],prioridades:[],desde:null,hasta:null},Wc="__sin_responsable__";function bd(e){return e.responsables.length+e.fases.length+e.prioridades.length+(e.desde||e.hasta?1:0)}var dm=e=>{if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},M2=["urgent","high","medium","low"];function T0(e){let t=new Set,a=new Set,n=false,r=o=>{for(let s of o){if(s.subtasks?.length){r(s.subtasks);continue}s.assignees?.length?s.assignees.forEach(i=>t.add(i.name)):n=true,s.priority&&a.add(s.priority);}};return r(e),{responsables:[...t].sort((o,s)=>o.localeCompare(s)),haySinResponsable:n,fases:e.filter(o=>o.subtasks?.length).map(o=>({id:o.id,nombre:o.name})),prioridades:M2.filter(o=>a.has(o))}}function D0(e,t){if(bd(t)===0)return e;let a=o=>{if(t.responsables.length&&!(o.assignees?.length?o.assignees.map(i=>i.name):[Wc]).some(i=>t.responsables.includes(i))||t.prioridades.length&&!(o.priority&&t.prioridades.includes(o.priority)))return false;if(t.desde||t.hasta){let s=dm(o.startDate)??dm(o.endDate),i=dm(o.endDate)??s;if(!s||!i||t.desde&&i<t.desde||t.hasta&&s>t.hasta)return false}return true},n=o=>{let s=[];for(let i of o)if(i.subtasks?.length){let d=n(i.subtasks);d.length&&s.push({...i,subtasks:d});}else a(i)&&s.push(i);return s},r=t.fases.length?e.filter(o=>t.fases.includes(o.id)):e;return n(r)}var N0="gantt-vistas-v6";function S0(){try{let e=JSON.parse(localStorage.getItem(N0)??"[]");return Array.isArray(e)?e:[]}catch{return []}}function cm(e){try{localStorage.setItem(N0,JSON.stringify(e));}catch{}}function E0(e,t){return e.some(a=>a.nombre===t.nombre)?e.map(a=>a.nombre===t.nombre?t:a):[...e,t]}var sa={dark:{bgPrimary:"#050505",bgSecondary:"#0A0A0A",bgGrid:"rgba(255, 255, 255, 0.02)",bgWeekend:"rgba(17, 17, 17, 0.4)",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#00E5CC",accentHover:"#5AADFF",accentLight:"rgba(0, 229, 204, 0.12)",taskBarPrimary:"#00E5CC",taskBarProgress:"#5AADFF",taskBarHandle:"#FFFFFF",dependency:"#444444",dependencyHover:"#FFFFFF",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.15)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.08)",milestone:"#FFFFFF",milestoneLight:"rgba(255, 255, 255, 0.1)",statusTodo:"#666666",statusInProgress:"#00E5CC",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(255, 255, 255, 0.05)",glassHeader:"#0A0A0A",glassToolbar:"rgba(0, 0, 0, 0.4)",forecastHud:"rgba(15, 15, 15, 0.9)",neonRedGlow:"0 0 8px rgba(239, 68, 68, 0.25)",executionBarBg:"rgba(0, 229, 204, 0.12)"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(0, 196, 174, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#00E5CC",accentHover:"#1D4ED8",accentLight:"rgba(0, 196, 174, 0.08)",taskBarPrimary:"#00E5CC",taskBarProgress:"#00A893",taskBarHandle:"#FFFFFF",dependency:"#6B7280",dependencyHover:"#00E5CC",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#00E5CC",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#00E5CC",dotGrid:"rgba(0, 0, 0, 0.04)",glassHeader:"#F8FAFC",glassToolbar:"rgba(255, 255, 255, 0.85)",forecastHud:"rgba(248, 250, 252, 0.95)",neonRedGlow:"0 0 10px rgba(220, 38, 38, 0.3)",executionBarBg:"rgba(0, 196, 174, 0.28)"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"#78716C",dependencyHover:"#A8A29E",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524",dotGrid:"rgba(0, 0, 0, 0.03)",glassHeader:"#F5F5F4",glassToolbar:"rgba(250, 250, 249, 0.85)",forecastHud:"rgba(245, 245, 244, 0.95)",neonRedGlow:"0 0 10px rgba(68, 64, 60, 0.3)",executionBarBg:"rgba(41, 37, 36, 0.25)"}};function M0(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return sa[e]||sa.dark;let t=document.documentElement,a=getComputedStyle(t),n=(o,s)=>a.getPropertyValue(o).trim()||s;return {bgPrimary:n("--theme-bg-primary",sa[e].bgPrimary),bgSecondary:n("--theme-bg-secondary",sa[e].bgSecondary),bgGrid:n("--theme-bg-card",sa[e].bgGrid),bgWeekend:n("--theme-bg-hover",sa[e].bgWeekend),border:n("--theme-border-primary",sa[e].border),borderLight:n("--theme-border-subtle",sa[e].borderLight),textPrimary:n("--theme-text-primary",sa[e].textPrimary),textSecondary:n("--theme-text-secondary",sa[e].textSecondary),textTertiary:n("--theme-text-tertiary",sa[e].textTertiary),accent:n("--theme-accent-primary",sa[e].accent),accentHover:n("--theme-accent-hover",sa[e].accentHover),accentLight:n("--theme-accent-primary",sa[e].accentLight),taskBarPrimary:n("--theme-accent-primary",sa[e].taskBarPrimary),taskBarProgress:n("--theme-accent-hover",sa[e].taskBarProgress),taskBarHandle:n("--theme-text-inverse",sa[e].taskBarHandle||"#FFFFFF"),dependency:n("--theme-border-secondary",sa[e].dependency),dependencyHover:n("--theme-border-secondary",sa[e].dependencyHover),criticalPath:n("--theme-error",sa[e].criticalPath),criticalPathLight:n("--theme-error",sa[e].criticalPathLight),today:e==="light"?n("--theme-accent-primary",sa[e].today):e==="neutral"?n("--theme-text-primary",sa[e].today):n("--theme-error",sa[e].today),todayLight:e==="light"?n("--theme-accent-primary",sa[e].todayLight):e==="neutral"?n("--theme-text-primary",sa[e].todayLight):n("--theme-error",sa[e].todayLight),milestone:n("--theme-warning",sa[e].milestone),milestoneLight:n("--theme-warning",sa[e].milestoneLight),statusTodo:n("--theme-text-tertiary",sa[e].statusTodo),statusInProgress:n("--theme-accent-primary",sa[e].statusInProgress),statusCompleted:n("--theme-success",sa[e].statusCompleted),hoverBg:n("--theme-bg-hover",sa[e].hoverBg),focusRing:n("--theme-accent-primary",sa[e].focusRing),...sa[e].dotGrid&&{dotGrid:sa[e].dotGrid},...sa[e].glassHeader&&{glassHeader:sa[e].glassHeader},...sa[e].glassToolbar&&{glassToolbar:sa[e].glassToolbar},...sa[e].forecastHud&&{forecastHud:sa[e].forecastHud},...sa[e].neonRedGlow&&{neonRedGlow:sa[e].neonRedGlow},...sa[e].executionBarBg&&{executionBarBg:sa[e].executionBarBg}}}function xd(e,t,a="left",n=208){let[r,o]=react.useState({top:0,left:0});return react.useEffect(()=>{if(!t||!e.current)return;let s=e.current.getBoundingClientRect(),i=s.bottom+4,d;a==="right"?d=s.right-n:d=s.left;let l=8;d+n>window.innerWidth-l&&(d=window.innerWidth-l-n),d<l&&(d=l),o({top:i,left:d});},[t,a,e,n]),r}function H0({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:n,onExportCSV:r,onExportJSON:o,onExportMSProject:s}){let[i,d]=react.useState(false),[l,p]=react.useState(null),c=react.useRef(null),u=react.useRef(null),g=Sr(),h=xd(c,i,"right",176);if(react.useEffect(()=>{if(!i)return;let y=N=>{let m=N.target;c.current&&!c.current.contains(m)&&u.current&&!u.current.contains(m)&&d(false);};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[i]),!(t||a||n||r||o||s))return null;let f=[{id:"png",label:"PNG",description:"Image",icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:n},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:r},{id:"json",label:"JSON",description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:o},{id:"msproject",label:"MS Project",description:"XML",icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-4 h-4"}),handler:s}].filter(y=>y.handler),C=async(y,N)=>{if(N){p(y);try{await N();}catch(m){console.error(`Export ${y} failed:`,m);}finally{p(null),d(false);}}};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:c,onClick:()=>d(!i),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:i?e.accent:e.bgSecondary,border:`1px solid ${i?e.accent:e.borderLight}`,color:i?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:g.toolbar.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:i?"rotate(180deg)":"rotate(0deg)"}})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:i&&jsxRuntime.jsx(framerMotion.motion.div,{ref:u,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-44 rounded-xl overflow-hidden",style:{top:h.top,left:h.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:f.map((y,N)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>C(y.id,y.handler),disabled:l!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:N<f.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:N*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:l===y.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):y.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-[11px] font-medium truncate",style:{color:e.textPrimary},children:y.label}),jsxRuntime.jsx("div",{className:"text-[9px] truncate",style:{color:e.textTertiary},children:y.description})]})]},y.id))})})}),document.body)]})}function um({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:n,onExportMSProject:r,onCopySnapshotLink:o}){let[s,i]=react.useState(false),[d,l]=react.useState(null),[p,c]=react.useState(false),u=react.useRef(null),g=react.useRef(null),h=Sr(),w=xd(u,s,"right",224),f=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0",C=h.toolbar.visibility==="Visibilidad";react.useEffect(()=>{if(!s)return;let k=x=>{let I=x.target;u.current&&!u.current.contains(I)&&g.current&&!g.current.contains(I)&&i(false);};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[s]);let y=[{id:"png",label:h.toolbar.exportPng,icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-3.5 h-3.5"}),handler:t},{id:"pdf",label:h.toolbar.exportPdf,icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-3.5 h-3.5"}),handler:a},{id:"excel",label:h.toolbar.exportExcel,icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-3.5 h-3.5"}),handler:n},{id:"msproject",label:h.toolbar.exportMsProject,icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-3.5 h-3.5"}),handler:r}].filter(k=>k.handler),N=async(k,x)=>{if(x){l(k);try{await x();}catch(I){console.error(`Export ${k} failed:`,I);}finally{l(null),i(false);}}},m=()=>{o?.(),c(true),setTimeout(()=>c(false),2e3);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:u,onClick:()=>i(!s),className:"flex items-center justify-center w-8 h-8 rounded-lg",style:{color:s?e.accent:e.textTertiary,backgroundColor:s?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:h.toolbar.share,children:jsxRuntime.jsx(lucideReact.Share2,{className:"w-4 h-4"})}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:g,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:w.top,left:w.left,zIndex:99999,backgroundColor:f?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${f?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:f?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[y.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:f?"rgba(255,255,255,0.35)":e.textTertiary},children:C?"EXPORTAR":"EXPORT"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:y.map((k,x)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>N(k.id,k.handler),disabled:d!==null,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:f?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:x*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:e.accentLight,color:e.accent},children:d===k.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"})}):k.icon}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:k.label})]},k.id))})]}),y.length>0&&o&&jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:f?"rgba(255,255,255,0.06)":e.borderLight}}),o&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:f?"rgba(255,255,255,0.35)":e.textTertiary},children:C?"COMPARTIR":"SHARE"})}),jsxRuntime.jsx("div",{className:"py-0.5 pb-1.5",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:m,className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:f?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:y.length*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-md flex-shrink-0",style:{backgroundColor:p?"rgba(34,197,94,0.15)":e.accentLight,color:p?"#22C55E":e.accent},children:p?jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5"}):jsxRuntime.jsx(lucideReact.Link2,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:p?h.toolbar.copied:h.toolbar.copySnapshotLink})]})})]})]})}),document.body)]})}function X2({options:e,value:t,onChange:a,theme:n,layoutId:r="activeSegment"}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:n.bgSecondary,border:`1px solid ${n.borderLight}`},children:e.map(o=>{let s=t===o.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(o.value),className:"relative px-3 py-1.5 rounded-md text-[11px] transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:s?n.textPrimary:n.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500,zIndex:s?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[s&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:r,className:"absolute inset-0 rounded-md",style:{backgroundColor:n.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),o.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:s?"#FFFFFF":n.textTertiary},children:o.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:s?"#FFFFFF":n.textTertiary},children:o.label})]},o.value)})})}function J2({options:e,value:t,onChange:a,theme:n}){return jsxRuntime.jsx("div",{className:"inline-flex items-center gap-1",children:e.map(r=>{let o=t===r.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(r.value),className:"relative px-3 py-1.5 text-[11px] transition-all",style:{color:o?n.accent:n.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:o?600:500},whileHover:{color:o?n.accent:n.textSecondary},whileTap:{scale:.98},children:[jsxRuntime.jsx("span",{children:r.label}),o&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:n.accent},transition:{type:"spring",stiffness:400,damping:30}})]},r.value)})})}function pm({theme:e,value:t,onChange:a,maxDepth:n}){let[r,o]=react.useState(false),s=react.useRef(null),i=react.useRef(null),d=Sr(),l=xd(s,r,"left");react.useEffect(()=>{if(!r)return;let u=g=>{let h=g.target;s.current&&!s.current.contains(h)&&i.current&&!i.current.contains(h)&&o(false);};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[r]);let p=[{value:"all",label:d.toolbar.wbsAllLevels||"All"},...Array.from({length:Math.min(n,5)},(u,g)=>({value:g+1,label:d.toolbar.wbsLevel==="Nivel"?`Nivel ${g+1}`:`L${g+1}`}))],c=t==="all"?d.toolbar.wbsAllLevels||"All":d.toolbar.wbsLevel==="Nivel"?`Nivel ${t}`:`L${t}`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:s,onClick:()=>o(!r),className:"flex items-center gap-1.5 px-2 py-1.5 rounded-lg transition-all",style:{backgroundColor:r?e.accentLight:e.bgSecondary,border:`1px solid ${r?e.accent:e.borderLight}`,color:r?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${d.toolbar.wbsLevel||"Level"}: ${c}`,children:[jsxRuntime.jsx(lucideReact.Layers,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium",style:{fontFamily:"'JetBrains Mono', monospace"},children:c})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(framerMotion.motion.div,{ref:i,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-24 rounded-xl overflow-hidden",style:{top:l.top,left:l.left,zIndex:99999,backgroundColor:e.bgPrimary==="#050505"?"rgba(10, 10, 10, 0.95)":e.bgSecondary,border:`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.08)":e.border}`,boxShadow:e.bgPrimary==="#050505"?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:jsxRuntime.jsx("div",{className:"py-1",children:p.map((u,g)=>{let h=t===u.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(u.value),o(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:h?e.accentLight:"transparent",borderBottom:g<p.length-1?`1px solid ${e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.borderLight}`:"none"},whileHover:{backgroundColor:h?e.accentLight:e.bgPrimary==="#050505"?"rgba(255,255,255,0.06)":e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:g*.03},children:[jsxRuntime.jsx("span",{className:"text-[11px]",style:{color:h?e.accent:e.textPrimary,fontFamily:"'JetBrains Mono', monospace",fontWeight:h?600:500},children:u.label}),h&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},String(u.value))})})})}),document.body)]})}function mm({theme:e,value:t,onChange:a,hideCompleted:n=false,onHideCompletedChange:r}){let[o,s]=react.useState(false),i=react.useRef(null),d=react.useRef(null),l=Sr(),p=xd(i,o,"left");react.useEffect(()=>{if(!o)return;let w=setTimeout(()=>{let f=y=>{let N=y.target;i.current&&!i.current.contains(N)&&d.current&&!d.current.contains(N)&&s(false);},C=y=>{y.key==="Escape"&&s(false);};document.addEventListener("mousedown",f),document.addEventListener("keydown",C),d._cleanup=()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",C);};},100);return ()=>{clearTimeout(w),d._cleanup&&d._cleanup();}},[o]);let c=[{value:"all",label:l.toolbar.filterAll||"Show All",icon:jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}),color:"text-[#00E5CC]"},{value:"completed",label:l.toolbar.filterCompleted||"Completed",icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3.5 h-3.5"}),color:"text-green-500"},{value:"in_progress",label:l.toolbar.filterInProgress||"In Progress",icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3.5 h-3.5"}),color:"text-[#00E5CC]"},{value:"incomplete",label:l.toolbar.toDo||"To Do / Pending",icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-3.5 h-3.5"}),color:"text-gray-400"}],u=t!=="all"||n,g=(t!=="all"?1:0)+(n?1:0),h=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:i,onClick:w=>{w.stopPropagation(),s(f=>!f);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{backgroundColor:u?h?"rgba(0, 229, 204, 0.2)":"rgb(239 246 255)":o?e.hoverBg:e.bgSecondary,border:`1px solid ${u?h?"rgba(0, 229, 204, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:u?"#00E5CC":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:g===0?l.toolbar.filter||"Filters":[t!=="all"?c.find(w=>w.value===t)?.label:null,n?l.toolbar.visibility==="Visibilidad"?"sin completadas":"no completed":null].filter(Boolean).join(" \xB7 ")})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:o&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:d,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-56 rounded-xl overflow-hidden",style:{top:p.top,left:p.left,zIndex:99999,backgroundColor:h?"rgba(10, 10, 10, 0.95)":"#FFFFFF",border:`1px solid ${h?"rgba(255,255,255,0.08)":"rgb(229 231 235)"}`,boxShadow:h?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:h?"rgba(255,255,255,0.06)":"rgb(229 231 235)"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:h?"rgba(255,255,255,0.35)":"#9CA3AF",fontFamily:"Inter, sans-serif"},children:l.toolbar.filterBy||"FILTER BY STATUS"})}),jsxRuntime.jsx("div",{className:"py-1",children:c.map(w=>{let f=t===w.value&&!n,C=()=>w.value==="all"?f?jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-[#00E5CC] bg-[#00E5CC]"}):jsxRuntime.jsx("div",{className:"w-3.5 h-3.5 rounded-full border-2 border-gray-400"}):w.icon;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(w.value),r&&r(false),s(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:f?h?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:h?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx("span",{className:`${f?w.color:"text-gray-400"} flex-shrink-0`,children:C()}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},children:w.label}),f&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]},w.value)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:h?"rgba(255,255,255,0.06)":"rgb(229 231 235)"}}),r&&jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{r(!n),n||a("all"),s(false);},className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{backgroundColor:n?h?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent",fontFamily:"Inter, sans-serif"},whileHover:{backgroundColor:h?"rgba(255,255,255,0.06)":"rgb(243 244 246)"},children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:n?"#00E5CC":h?"rgba(255,255,255,0.35)":"#9CA3AF"}}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap font-medium",style:{color:h?"rgba(255,255,255,0.85)":"#111827"},children:l.toolbar.hideCompleted||"Hide Completed Tasks"}),n&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"#00E5CC"}})]})})]})}),document.body)]})}function F0({value:e,onChange:t,theme:a}){let n=Sr(),r=a.bgPrimary==="#050505"||a.textPrimary==="#FFFFFF",o=n.toolbar.visibility==="Visibilidad",s=[{value:"compact",label:n.toolbar.compact||"Compact",Icono:lucideReact.Rows4},{value:"comfortable",label:n.toolbar.normal||"Normal",Icono:lucideReact.Rows3},{value:"spacious",label:n.toolbar.spacious||"Spacious",Icono:lucideReact.Rows2}];return jsxRuntime.jsx("div",{role:"group","aria-label":o?"Densidad de las filas":"Row density","data-densidad-a-la-vista":true,className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:r?"#000000":a.bgSecondary,border:`1px solid ${r?"rgba(255,255,255,0.1)":a.border}`},children:s.map(({value:i,label:d,Icono:l})=>{let p=e===i;return jsxRuntime.jsx("button",{type:"button",onClick:()=>t(i),"aria-pressed":p,"aria-label":(o?"Densidad: ":"Density: ")+d,title:(o?"Densidad: ":"Density: ")+d,className:"relative px-2 py-1 rounded-full transition-colors",style:{color:p?r?"#FFFFFF":a.textPrimary:a.textTertiary,backgroundColor:p?r?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},children:jsxRuntime.jsx(l,{className:"w-3.5 h-3.5"})},i)})})}function A0({value:e,onChange:t,theme:a}){let n=Sr(),r=a.bgPrimary==="#050505"||a.textPrimary==="#FFFFFF",o=[{value:"day",label:n.toolbar.day.charAt(0).toUpperCase()},{value:"week",label:n.toolbar.week.charAt(0).toUpperCase()},{value:"month",label:n.toolbar.month.charAt(0).toUpperCase()}];return jsxRuntime.jsx("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:r?"#000000":a.bgSecondary,border:`1px solid ${r?"rgba(255,255,255,0.1)":a.border}`},children:o.map(s=>{let i=e===s.value;return jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>t(s.value),className:"relative px-3 py-1 text-[11px] font-medium rounded-full transition-colors",style:{color:i?r?"#FFFFFF":a.textPrimary:a.textTertiary,fontFamily:"Inter, sans-serif",backgroundColor:i?r?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent"},whileHover:{color:r?"#FFFFFF":a.textPrimary},whileTap:{scale:.95},children:s.label},s.value)})})}function Q2({theme:e,forecast:t,currencyCode:a}){let n=Sr(),r=e.bgPrimary==="#050505"||e.textPrimary==="#FFFFFF",o=n.toolbar.visibility==="Visibilidad"?"es":"en",s=t?.expectedFinish?Br(t.expectedFinish,o):"\u2014",i=t?.delayDays,d=i!=null,l=i!=null?i>0?`+${i}d ${n.toolbar.delayLabel}`:i<0?`${i}d ${n.toolbar.earlyLabel}`:n.toolbar.onTimeLabel:null,p=i!=null&&i>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:i!=null&&i<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:r?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.05)",text:e.textTertiary},c=t?.confidencePercent,u=c!=null?c>=75?"#22C55E":c>=40?"#F59E0B":"#EF4444":e.textTertiary,g=t?.costAtCompletion,h=t?.currency||"$",w=g!=null?(()=>{let m=Vn(g,a,o,{compacto:true});return h!=="$"?m.replace("$",h):m})():"\u2014",f=t?.budgetVariancePercent,C=f!=null&&f!==0,y=f!=null?f>0?`+${Rr(f,o)} ${n.toolbar.budgetOver}`:`${Rr(f,o)} ${n.toolbar.budgetUnder}`:null,N=f!=null&&f>0?{bg:r?"rgba(239,68,68,0.15)":"rgba(220,38,38,0.1)",text:r?"#EF4444":"#DC2626"}:f!=null&&f<0?{bg:r?"rgba(34,197,94,0.15)":"rgba(22,163,74,0.1)",text:r?"#22C55E":"#16A34A"}:{bg:"transparent",text:e.textTertiary};return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.forecastHud||(r?"rgba(15,15,15,0.9)":"rgba(248,250,252,0.95)"),borderColor:e.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsx("span",{className:"text-[9px] uppercase tracking-[0.15em]",style:{color:e.textTertiary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:n.toolbar.projectForecast}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[13px] font-semibold",style:{color:e.textPrimary,fontFamily:"Inter, sans-serif"},children:[n.toolbar.expectedFinish,": ",s]}),d&&l&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:p.bg,color:p.text,fontFamily:"'JetBrains Mono', monospace",cursor:t?.causaDelDesvio?"help":void 0},title:t?.causaDelDesvio||void 0,children:l})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[n.toolbar.confidence,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-semibold",style:{color:u,fontFamily:"'JetBrains Mono', monospace"},children:c!=null?Rr(c,o):"\u2014"})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:r?"rgba(255,255,255,0.08)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:"text-[11px]",style:{color:e.textTertiary,fontFamily:"Inter, sans-serif"},children:[n.toolbar.costAtCompletion,":"]}),jsxRuntime.jsx("span",{className:"text-[13px] font-bold",style:{color:e.textPrimary,fontFamily:"'JetBrains Mono', monospace"},children:w}),C&&y&&jsxRuntime.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:N.bg,color:N.text,fontFamily:"'JetBrains Mono', monospace"},children:y})]})]})]})}var Uc={width:22,height:10,borderRadius:2,flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center"},Z2=[{es:"Festivo (el d\xEDa en \xE1mbar)",en:"Holiday (amber day)",muestra:{...Uc,color:"#F59E0B",fontSize:10,fontWeight:700},texto:"12"},{es:"Vencida o en ruta cr\xEDtica",en:"Overdue or on the critical path",muestra:{...Uc,background:"#EF4444"}},{es:"Fin de semana o d\xEDa no laborable",en:"Weekend or non-working day",muestra:{...Uc,background:"repeating-linear-gradient(45deg, rgba(148,163,184,0.45) 0 2px, transparent 2px 5px)"}},{es:"Parte de la barra sin avanzar",en:"Unfinished part of the bar",muestra:{...Uc,background:"repeating-linear-gradient(45deg, rgba(0,229,204,0.55) 0 3px, rgba(148,163,184,0.25) 3px 6px)"}}];function L0({theme:e,showCriticalPath:t,onShowCriticalPathChange:a,showBaseline:n,onShowBaselineChange:r,highlightWeekends:o,onHighlightWeekendsChange:s,showDependencies:i,onShowDependenciesChange:d,rowDensity:l,onRowDensityChange:p,hasDependencies:c=true}){let[u,g]=react.useState(false),h=react.useRef(null),w=react.useRef(null),f=Sr(),C=xd(h,u,"right",208),y=e.bgPrimary==="#050505"||(e.bgPrimary||"").charAt(1)==="0";react.useEffect(()=>{if(!u)return;let x=M=>{let L=M.target;h.current&&!h.current.contains(L)&&w.current&&!w.current.contains(L)&&g(false);},I=M=>{M.key==="Escape"&&g(false);};return document.addEventListener("mousedown",x),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",I);}},[u]);let N=f.toolbar.visibility==="Visibilidad",m=[{key:"criticalPath",label:N?"Ruta Cr\xEDtica":"Critical Path",icon:lucideReact.Zap,active:t,onChange:a,disabled:!c,tooltip:c?void 0:N?"Agrega dependencias entre tareas para ver la ruta cr\xEDtica":"Add dependencies between tasks to see the critical path"},{key:"baselines",label:N?"L\xEDneas Base":"Baselines",icon:lucideReact.Layers,active:n,onChange:r},{key:"weekends",label:N?"Fines de Semana":"Weekends",icon:lucideReact.CalendarDays,active:o,onChange:s},{key:"dependencies",label:N?"Dependencias":"Dependencies",icon:lucideReact.GitBranch,active:i,onChange:d}],k=[{value:"compact",label:f.toolbar.visibility==="Visibilidad"?"Compacto":"Compact"},{value:"comfortable",label:"Normal"},{value:"spacious",label:f.toolbar.visibility==="Visibilidad"?"Amplio":"Spacious"}];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{ref:h,onClick:()=>g(!u),className:"flex items-center gap-1.5 h-8 px-2.5 rounded-lg text-xs font-medium",style:{color:u?e.accent:e.textSecondary,backgroundColor:u?e.accentLight:"transparent"},whileHover:{color:e.textPrimary,backgroundColor:e.hoverBg},title:N?"Opciones de vista, densidad y leyenda":"Display options, density and legend","aria-haspopup":"menu","aria-expanded":u,children:[jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:N?"Opciones":"Options"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3"})]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:u&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:w,initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"fixed w-52 rounded-xl overflow-hidden",style:{top:C.top,left:C.left,zIndex:99999,backgroundColor:y?"rgba(10, 10, 10, 0.95)":e.bgSecondary||"#F8FAFC",border:`1px solid ${y?"rgba(255,255,255,0.08)":e.border||"#CBD5E1"}`,boxShadow:y?"0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04)":"0 10px 40px rgba(0, 0, 0, 0.12)",backdropFilter:"blur(16px)"},children:[jsxRuntime.jsx("div",{className:"px-3 pt-2.5 pb-1.5",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:f.toolbar.visibility==="Visibilidad"?"OPCIONES DE VISTA":"DISPLAY OPTIONS"})}),jsxRuntime.jsx("div",{className:"py-0.5",children:m.map((x,I)=>{let M=x.icon,L=x.disabled,F=x.tooltip;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>!L&&x.onChange?.(!x.active),className:"w-full flex items-center gap-2.5 px-3 py-2 text-[11px] transition-colors",style:{color:L?y?"rgba(255,255,255,0.3)":"#9CA3AF":y?"rgba(255,255,255,0.85)":"#111827",cursor:L?"not-allowed":"pointer"},whileHover:L?{}:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:I*.03},title:F,children:[jsxRuntime.jsx(M,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:L?y?"rgba(255,255,255,0.2)":"#D1D5DB":x.active?e.accent||"#00E5CC":e.textTertiary}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:x.label}),x.active&&!L&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},x.key)})}),jsxRuntime.jsx("div",{className:"mx-3 h-px",style:{backgroundColor:y?"rgba(255,255,255,0.06)":e.borderLight}}),jsxRuntime.jsxs("div",{className:"py-0.5",children:[jsxRuntime.jsx("div",{className:"px-3 pt-2 pb-1",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:f.toolbar.visibility==="Visibilidad"?"DENSIDAD":"DENSITY"})}),k.map((x,I)=>{let M=l===x.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>p(x.value),className:"w-full flex items-center justify-between px-3 py-2 text-[11px] transition-colors",style:{color:y?"rgba(255,255,255,0.85)":"#111827"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:(m.length+I)*.03},children:[jsxRuntime.jsx("span",{style:{color:M?e.accent||"#00E5CC":y?"rgba(255,255,255,0.85)":e.textPrimary},children:x.label}),M&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent||"#00E5CC"}})]},x.value)})]}),jsxRuntime.jsxs("div",{className:"py-0.5",style:{borderTop:`1px solid ${y?"rgba(255,255,255,0.06)":e.border||"#E2E8F0"}`},children:[jsxRuntime.jsx("div",{className:"px-3 pt-2 pb-1",children:jsxRuntime.jsx("span",{className:"text-[10px] font-medium uppercase tracking-[0.1em]",style:{color:y?"rgba(255,255,255,0.35)":e.textTertiary},children:N?"LEYENDA":"LEGEND"})}),Z2.map(x=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-1.5 text-[11px]",style:{color:y?"rgba(255,255,255,0.75)":e.textSecondary},children:[jsxRuntime.jsx("span",{"aria-hidden":true,style:x.muestra,children:x.texto??null}),jsxRuntime.jsx("span",{children:N?x.es:x.en})]},x.es))]})]})}),document.body)]})}function e5({theme:e,etiqueta:t,children:a}){let[n,r]=react.useState(false),o=react.useRef(null);return react.useEffect(()=>{if(!n)return;let s=d=>{o.current&&!o.current.contains(d.target)&&r(false);},i=d=>{d.key==="Escape"&&r(false);};return document.addEventListener("mousedown",s),document.addEventListener("keydown",i),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",i);}},[n]),jsxRuntime.jsxs("div",{ref:o,className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>r(s=>!s),"aria-label":t,"aria-expanded":n,title:t,className:"flex items-center justify-center rounded-md",style:{width:32,height:32,color:e.textSecondary,border:`1px solid ${e.borderLight}`},children:"\u22EF"}),n&&jsxRuntime.jsx("div",{className:"absolute right-0 mt-1 p-1.5 rounded-lg shadow-lg",style:{top:"100%",minWidth:200,zIndex:300,backgroundColor:e.bgPrimary,border:`1px solid ${e.borderLight}`},children:a})]})}function Gc({enCabecera:e=false,theme:t,timeScale:a,onTimeScaleChange:n,zoom:r,onZoomChange:o,currentTheme:s,onThemeChange:i,rowDensity:d,onRowDensityChange:l,showThemeSelector:p=false,showCreateTaskButton:c=false,createTaskLabel:u,onCreateTask:g,taskFilter:h="all",onTaskFilterChange:w,hideCompleted:f=false,onHideCompletedChange:C,toolbarRightContent:y,wbsLevel:N,onWbsLevelChange:m,maxWbsDepth:k=4,viewMode:x="execution",onViewModeChange:I,projectForecast:M,hideForecastHud:L,currencyCode:F,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportCSV:P,onExportJSON:B,onExportMSProject:ge,showCriticalPath:ae=true,onShowCriticalPathChange:xe,showDependencies:V=true,onShowDependenciesChange:fe,highlightWeekends:bt=true,onHighlightWeekendsChange:st,showBaseline:q=false,onShowBaselineChange:He,onCopySnapshotLink:we,hasDependencies:kt=true}){let Je=Sr(),Ct=H||z||Y||P||B||ge,$t=!!t.glassToolbar,Tt=[{value:"day",label:Je.toolbar.day},{value:"week",label:Je.toolbar.week},{value:"month",label:Je.toolbar.month}],At=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}],Ze=t.bgPrimary==="#050505"||t.textPrimary==="#FFFFFF";if(e)return jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(A0,{value:a,onChange:n,theme:t}),jsxRuntime.jsx(F0,{value:d,onChange:l,theme:t}),w&&jsxRuntime.jsx(mm,{theme:t,value:h,onChange:w,hideCompleted:f,onHideCompletedChange:C}),y,jsxRuntime.jsx(L0,{theme:t,showCriticalPath:ae,onShowCriticalPathChange:xe,showBaseline:q,onShowBaselineChange:He,highlightWeekends:bt,onHighlightWeekendsChange:st,showDependencies:V,onShowDependenciesChange:fe,rowDensity:d,onRowDensityChange:l,hasDependencies:kt}),jsxRuntime.jsx(um,{theme:t,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportMSProject:ge,onCopySnapshotLink:we}),(I||m)&&jsxRuntime.jsxs(e5,{theme:t,etiqueta:Je.toolbar.today==="Hoy"?"M\xE1s opciones":"More options",children:[I&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:["execution","oracle"].map(mt=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>I(mt),className:"flex items-center justify-between gap-3 px-2 py-1.5 rounded-md text-[12px] text-left",style:{color:t.textPrimary,backgroundColor:x===mt?Ze?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.05)":"transparent"},children:[mt==="execution"?Je.toolbar.viewExecution:Je.toolbar.viewOracle,x===mt&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5"})]},mt))}),m&&jsxRuntime.jsx("div",{className:"pt-1 mt-1",style:{borderTop:`1px solid ${t.borderLight}`},children:jsxRuntime.jsx(pm,{theme:t,value:N??"all",onChange:m,maxDepth:k})})]})]});if($t){let mt=Ze?"rgba(255,255,255,0.08)":t.borderLight;return jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsxs("div",{className:"h-[52px] px-4 flex items-center justify-between border-b",style:{backgroundColor:t.glassToolbar,borderColor:t.borderLight,backdropFilter:"blur(12px)"},children:[jsxRuntime.jsx("div",{className:"flex items-center gap-3",children:I&&jsxRuntime.jsxs("div",{className:"inline-flex items-center rounded-full p-0.5",style:{backgroundColor:Ze?"#000000":t.bgSecondary,border:`1px solid ${Ze?"rgba(255,255,255,0.08)":t.border}`},children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>I("execution"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:x==="execution"?Ze?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.06)":"transparent",color:x==="execution"?t.textPrimary:t.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:x!=="execution"?{color:t.textSecondary}:{},children:Je.toolbar.viewExecution}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>I("oracle"),className:"px-3 py-1.5 rounded-full text-[11px] font-medium transition-colors",style:{backgroundColor:x==="oracle"?Ze?"rgba(0, 229, 204,0.15)":"rgba(0, 196, 174,0.08)":"transparent",color:x==="oracle"?"#00E5CC":t.textTertiary,fontFamily:"Inter, sans-serif"},whileHover:x!=="oracle"?{color:t.textSecondary}:{},children:Je.toolbar.viewOracle})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(A0,{value:a,onChange:n,theme:t}),jsxRuntime.jsx(F0,{value:d,onChange:l,theme:t}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:mt}}),m&&jsxRuntime.jsx(pm,{theme:t,value:N??"all",onChange:m,maxDepth:k}),w&&jsxRuntime.jsx(mm,{theme:t,value:h,onChange:w,hideCompleted:f,onHideCompletedChange:C}),y&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:mt}}),y]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:mt}}),jsxRuntime.jsx(L0,{theme:t,showCriticalPath:ae,onShowCriticalPathChange:xe,showBaseline:q,onShowBaselineChange:He,highlightWeekends:bt,onHighlightWeekendsChange:st,showDependencies:V,onShowDependenciesChange:fe,rowDensity:d,onRowDensityChange:l,hasDependencies:kt}),jsxRuntime.jsx(um,{theme:t,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportMSProject:ge,onCopySnapshotLink:we}),c&&g&&jsxRuntime.jsxs(framerMotion.motion.button,{onClick:g,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px]",style:{background:`linear-gradient(135deg, ${t.accent} 0%, ${t.accentHover} 100%)`,color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:`0 2px 8px ${Ze?"rgba(0, 229, 204,0.3)":"rgba(0, 196, 174,0.3)"}`},whileHover:{scale:1.02,boxShadow:`0 4px 12px ${Ze?"rgba(0, 229, 204,0.4)":"rgba(0, 196, 174,0.4)"}`},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:u||Je.toolbar.createTask})]})]})]}),M&&!L&&jsxRuntime.jsx(Q2,{theme:t,forecast:M,currencyCode:F})]})}return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:t.bgGrid,borderColor:t.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(J2,{options:Tt,value:a,onChange:mt=>n(mt),theme:t}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.max(.5,r-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:t.textSecondary},whileHover:{backgroundColor:t.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("div",{className:"px-2 py-0.5 rounded text-[11px] tabular-nums min-w-[42px] text-center",style:{color:t.textSecondary,fontFamily:"'JetBrains Mono', monospace",fontWeight:500},children:[Math.round(r*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.min(2,r+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:t.textSecondary},whileHover:{backgroundColor:t.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}}),m&&jsxRuntime.jsx(pm,{theme:t,value:N??"all",onChange:m,maxDepth:k}),w&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}}),jsxRuntime.jsx(mm,{theme:t,value:h,onChange:w,hideCompleted:f,onHideCompletedChange:C})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[y&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[y,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:t.borderLight}})]}),c&&g&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:g,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-[11px] transition-all",style:{background:"linear-gradient(135deg, #00E5CC 0%, #00E5CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:u||Je.toolbar.createTask})]}),(Ct||p)&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:t.borderLight}})]}),jsxRuntime.jsx(um,{theme:t,onExportPNG:H,onExportPDF:z,onExportExcel:Y,onExportMSProject:ge,onCopySnapshotLink:we}),p&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:t.borderLight}}),p&&jsxRuntime.jsx(X2,{options:At,value:s,onChange:mt=>i(mt),theme:t})]})]})}var Ba={texto:"var(--v6-texto, #0E1114)",texto2:"var(--v6-texto-2, #4D5761)",tenue:"var(--v6-tenue, #5F6972)",borde:"var(--v6-borde, #E2E5E9)",tarjeta:"var(--v6-tarjeta, #FFFFFF)",neutroFondo:"var(--v6-neutro-fondo, #E1E4E8)",segmentado:"var(--v6-segmentado, #E9ECEF)",acento:"var(--v6-acento, #0FA392)",acentoTexto:"var(--v6-acento-texto, #066A5F)",acentoFondo2:"var(--v6-acento-fondo-2, rgba(15,163,146,0.14))",acentoBordeSuave:"var(--v6-acento-borde-suave, rgba(8,127,114,0.55))",sobreAcento:"var(--v6-sobre-acento, #03231F)"},l5="'JetBrains Mono', ui-monospace, Menlo, monospace",wd={flex:"1 1 0",minWidth:0,height:30,boxSizing:"border-box",padding:"0 4px",borderRadius:8,border:`1px solid ${Ba.borde}`,background:Ba.tarjeta,color:Ba.texto,font:"inherit",fontSize:12};function qc({boton:e,children:t,alinear:a="izquierda",ancho:n=220}){let[r,o]=react.useState(false),s=react.useRef(null),i=react.useRef(null),[d,l]=react.useState({top:0,left:0});return react.useEffect(()=>{if(!r||!s.current)return;let p=s.current.getBoundingClientRect(),c=a==="derecha"?Math.max(8,p.right-n):Math.min(p.left,window.innerWidth-n-8);l({top:p.bottom+6,left:c});let u=h=>{let w=h.target;!s.current?.contains(w)&&!i.current?.contains(w)&&o(false);},g=h=>{h.key==="Escape"&&(o(false),s.current?.focus());};return document.addEventListener("mousedown",u),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",g);}},[r,a,n]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e(()=>o(p=>!p),r,s),r&&reactDom.createPortal(jsxRuntime.jsx("div",{ref:i,role:"menu","data-menu-v6":true,style:{position:"fixed",top:d.top,left:d.left,width:n,zIndex:99999,maxHeight:`calc(100vh - ${Math.round(d.top)+16}px)`,overflowY:"auto",padding:6,borderRadius:12,background:Ba.tarjeta,border:`1px solid ${Ba.borde}`,boxShadow:"0 12px 32px -8px rgba(14,17,20,0.25)",color:Ba.texto,fontSize:13},children:t(()=>o(false))}),document.body)]})}function sr({children:e,marcada:t,alPulsar:a,icono:n}){return jsxRuntime.jsxs("button",{type:"button",role:t===void 0?"menuitem":"menuitemcheckbox","aria-checked":t,onClick:a,className:"w-full flex items-center text-left",style:{gap:8,height:32,padding:"0 8px",borderRadius:8,background:"transparent",border:0,color:Ba.texto,font:"inherit",cursor:"pointer"},onMouseEnter:r=>{r.currentTarget.style.background=Ba.segmentado;},onMouseLeave:r=>{r.currentTarget.style.background="transparent";},children:[n&&jsxRuntime.jsx("span",{"aria-hidden":true,className:"flex items-center",style:{color:Ba.texto2},children:n}),jsxRuntime.jsx("span",{className:"flex-1",children:e}),t&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:Ba.acentoTexto},"aria-hidden":true})]})}function W0({es:e,elegidas:t,alternar:a,opciones:n}){let r=e?"Ver u ocultar columnas":"Show or hide columns";return jsxRuntime.jsx(qc,{alinear:"derecha",ancho:220,boton:(o,s,i)=>jsxRuntime.jsx("button",{ref:i,type:"button","data-columnas-v6":true,"aria-haspopup":"menu","aria-expanded":s,"aria-label":r,title:r,onClick:o,style:{flex:"none",width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:Ba.tenue,cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-[13px] h-[13px]",strokeWidth:2,"aria-hidden":true})}),children:()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:e?"Columnas":"Columns"}),n.map(o=>jsxRuntime.jsx(sr,{marcada:t.includes(o.id),alPulsar:()=>a(o.id),children:e?o.es:o.en},o.id))]})})}function d5({alGuardar:e,texto:t,guardar:a}){let[n,r]=react.useState(""),o=()=>{let s=n.trim();s&&(e(s),r(""));};return jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:6,padding:"2px 8px 6px"},children:[jsxRuntime.jsx("input",{"data-nombre-de-vista":true,value:n,placeholder:t,"aria-label":t,onChange:s=>r(s.target.value),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"&&o();},style:{...wd,padding:"0 8px"}}),jsxRuntime.jsx("button",{type:"button","data-guardar-vista":true,onClick:o,disabled:!n.trim(),style:{flex:"none",height:30,padding:"0 10px",border:0,borderRadius:8,background:Ba.acento,color:Ba.sobreAcento,font:"inherit",fontSize:12,fontWeight:500,cursor:"pointer",opacity:n.trim()?1:.5},children:a})]})}function uo({children:e}){return jsxRuntime.jsx("div",{style:{padding:"6px 8px 4px",fontSize:11,fontWeight:500,color:Ba.tenue},children:e})}function co(){return jsxRuntime.jsx("div",{"aria-hidden":true,style:{height:1,margin:"4px 2px",background:Ba.borde}})}var _c={height:36,boxSizing:"border-box",display:"flex",alignItems:"center",gap:6,borderRadius:10,font:"inherit",fontWeight:500,cursor:"pointer",whiteSpace:"nowrap"};function U0(e){let t=Sr(),a=t.toolbar.today==="Hoy",n=(k,x)=>a?k:x,r=[{valor:"all",etiqueta:n("Todas","All")},{valor:"incomplete",etiqueta:n("Por hacer","To do")},{valor:"in_progress",etiqueta:n("En progreso","In progress")},{valor:"completed",etiqueta:n("Completadas","Completed")},{valor:"overdue",etiqueta:n("Vencidas","Overdue")}],[o,s]=react.useState("carta"),[i,d]=react.useState("todo"),l=e.filtros??cs,p=(e.taskFilter!=="all"?1:0)+bd(l),c=k=>e.onFiltrosChange?.({...l,...k}),u=(k,x)=>k.includes(x)?k.filter(I=>I!==x):[...k,x],g={urgent:n("Urgente","Urgent"),high:n("Alta","High"),medium:n("Media","Medium"),low:n("Baja","Low")},h=k=>k===Wc?n("Sin responsable","Unassigned"):k,w=k=>e.opcionesDeFiltro?.fases.find(x=>x.id===k)?.nombre??k,f=k=>k.length>1?`${k[0]} +${k.length-1}`:k[0]??"",C=e.opcionesDeFiltro,y=[{valor:"compact",etiqueta:n("Compacta","Compact")},{valor:"comfortable",etiqueta:n("Normal","Normal")},{valor:"spacious",etiqueta:n("C\xF3moda","Comfortable")}],N=y.find(k=>k.valor===e.rowDensity)??y[1],m=[!e.onExportarDocumento&&e.onExportPNG&&{id:"png",etiqueta:n("Exportar imagen (PNG)","Export image (PNG)"),f:e.onExportPNG},!e.onExportarDocumento&&e.onExportPDF&&{id:"pdf",etiqueta:n("Exportar PDF","Export PDF"),f:e.onExportPDF},e.onExportExcel&&{id:"xlsx",etiqueta:n("Exportar Excel","Export Excel"),f:e.onExportExcel},e.onExportMSProject&&{id:"msp",etiqueta:n("Exportar a MS Project","Export to MS Project"),f:e.onExportMSProject}].filter(Boolean);return jsxRuntime.jsxs("div",{"data-barra-v6":true,className:"flex flex-wrap items-center min-w-0",style:{gap:8,flex:"1 1 auto",fontSize:13,color:Ba.texto},children:[e.onTaskFilterChange&&jsxRuntime.jsx(qc,{ancho:280,boton:(k,x,I)=>jsxRuntime.jsxs("button",{ref:I,type:"button","aria-haspopup":"menu","aria-expanded":x,onClick:k,"data-boton-filtros-v6":true,style:{..._c,padding:"0 8px 0 10px",background:Ba.tarjeta,color:Ba.texto,border:`1px solid ${p?Ba.acentoBordeSuave:Ba.borde}`},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-[15px] h-[15px]",style:{color:p?Ba.acentoTexto:Ba.texto2},"aria-hidden":true}),n("Filtros","Filters"),p>0&&jsxRuntime.jsx("span",{style:{fontFamily:l5,fontSize:11,fontWeight:500,color:Ba.acentoTexto,padding:"1px 6px",borderRadius:6,background:Ba.acentoFondo2},children:p})]}),children:k=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:n("Estado de la tarea","Task status")}),r.map(x=>jsxRuntime.jsx(sr,{marcada:e.taskFilter===x.valor&&!e.hideCompleted,alPulsar:()=>{e.onTaskFilterChange?.(x.valor),e.onHideCompletedChange?.(false),k();},children:x.etiqueta},x.valor)),e.onFiltrosChange&&C&&(C.responsables.length>0||C.haySinResponsable)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Responsable","Assignee")}),[...C.responsables,...C.haySinResponsable?[Wc]:[]].map(x=>jsxRuntime.jsx(sr,{marcada:l.responsables.includes(x),alPulsar:()=>c({responsables:u(l.responsables,x)}),children:h(x)},x))]}),e.onFiltrosChange&&C&&C.fases.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Fase","Phase")}),C.fases.map(x=>jsxRuntime.jsx(sr,{marcada:l.fases.includes(x.id),alPulsar:()=>c({fases:u(l.fases,x.id)}),children:x.nombre},x.id))]}),e.onFiltrosChange&&C&&C.prioridades.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Prioridad","Priority")}),C.prioridades.map(x=>jsxRuntime.jsx(sr,{marcada:l.prioridades.includes(x),alPulsar:()=>c({prioridades:u(l.prioridades,x)}),children:g[x]??x},x))]}),e.onFiltrosChange&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Fechas","Dates")}),jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:6,padding:"2px 8px 6px"},children:[jsxRuntime.jsx("input",{type:"date","aria-label":n("Desde","From"),value:l.desde??"",max:l.hasta??void 0,"data-filtro-desde":true,onChange:x=>c({desde:x.target.value||null}),style:wd}),jsxRuntime.jsx("span",{"aria-hidden":true,style:{color:Ba.tenue},children:"\u2013"}),jsxRuntime.jsx("input",{type:"date","aria-label":n("Hasta","To"),value:l.hasta??"",min:l.desde??void 0,"data-filtro-hasta":true,onChange:x=>c({hasta:x.target.value||null}),style:wd})]})]}),p>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(sr,{alPulsar:()=>{e.onTaskFilterChange?.("all"),e.onFiltrosChange?.(cs),k();},children:n("Quitar todos los filtros","Clear all filters")})]}),e.onGuardarVista&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Vistas guardadas","Saved views")}),(e.vistasGuardadas??[]).map(x=>jsxRuntime.jsxs("div",{className:"flex items-center","data-vista-guardada":x.nombre,children:[jsxRuntime.jsx("div",{className:"flex-1 min-w-0",children:jsxRuntime.jsx(sr,{alPulsar:()=>{e.onAplicarVista?.(x),k();},children:x.nombre})}),jsxRuntime.jsx("button",{type:"button","aria-label":`${n("Borrar vista","Delete view")} ${x.nombre}`,onClick:()=>e.onBorrarVista?.(x.nombre),style:{flex:"none",width:24,height:24,padding:0,border:0,borderRadius:6,background:"transparent",color:Ba.tenue,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3",strokeWidth:2,"aria-hidden":true})})]},x.nombre)),jsxRuntime.jsx(d5,{alGuardar:e.onGuardarVista,texto:n("Guardar la vista actual","Save current view"),guardar:n("Guardar","Save")})]})]})}),e.taskFilter!=="all"&&jsxRuntime.jsx(yd,{texto:r.find(k=>k.valor===e.taskFilter)?.etiqueta??e.taskFilter,quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>e.onTaskFilterChange?.("all")}),l.responsables.length>0&&jsxRuntime.jsx(yd,{texto:f(l.responsables.map(h)),quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({responsables:[]})}),l.fases.length>0&&jsxRuntime.jsx(yd,{texto:f(l.fases.map(w)),quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({fases:[]})}),l.prioridades.length>0&&jsxRuntime.jsx(yd,{texto:f(l.prioridades.map(k=>g[k]??k)),quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({prioridades:[]})}),(l.desde||l.hasta)&&jsxRuntime.jsx(yd,{texto:`${l.desde??"\u2026"} \u2013 ${l.hasta??"\u2026"}`,quitar:n("Quitar filtro","Remove filter"),alQuitar:()=>c({desde:null,hasta:null})}),jsxRuntime.jsx("div",{"aria-hidden":true,style:{flex:"1 1 0",minWidth:0}}),jsxRuntime.jsx("div",{role:"group","aria-label":n("Escala de tiempo","Time scale"),className:"flex items-center",style:{height:36,boxSizing:"border-box",gap:2,padding:"0 2px",border:`1px solid ${Ba.borde}`,borderRadius:10,background:Ba.segmentado},children:[["day",n("D","D"),n("D\xEDa","Day")],["week",n("S","W"),n("Semana","Week")],["month",n("M","M"),n("Mes","Month")],["quarter",n("T","Q"),n("Trimestre","Quarter")],["year",n("A","Y"),n("A\xF1o","Year")]].map(([k,x,I])=>{let M=e.timeScale===k;return jsxRuntime.jsx("button",{type:"button","aria-pressed":M,"aria-label":I,title:I,"data-escala-v6":k,onClick:()=>e.onTimeScaleChange(k),style:{width:32,height:30,padding:0,border:0,borderRadius:8,font:"inherit",fontWeight:500,cursor:"pointer",background:M?"var(--v6-escala-activa, #FFFFFF)":"transparent",boxShadow:M?"var(--v6-escala-sombra, 0 1px 2px rgba(14,17,20,0.14))":"none",color:M?Ba.texto:Ba.texto2},children:x},k)})}),e.toolbarRightContent,jsxRuntime.jsx(qc,{alinear:"derecha",ancho:264,boton:(k,x,I)=>jsxRuntime.jsxs("button",{ref:I,type:"button","aria-haspopup":"menu","aria-expanded":x,onClick:k,"data-menu-vista-v6":true,"aria-label":`${n("Opciones","Options")}: ${N.etiqueta}`,style:{..._c,padding:"0 8px 0 10px",border:0,background:"transparent",color:Ba.texto},children:[jsxRuntime.jsx(lucideReact.Rows3,{className:"w-[15px] h-[15px]",style:{color:Ba.texto2},"aria-hidden":true}),n("Opciones","Options"),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5",style:{color:Ba.tenue},"aria-hidden":true})]}),children:k=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:n("Densidad de filas","Row density")}),y.map(x=>jsxRuntime.jsx(sr,{marcada:e.rowDensity===x.valor,alPulsar:()=>{e.onRowDensityChange(x.valor),k();},children:x.etiqueta},x.valor)),e.onAjustarAlProyecto&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(sr,{alPulsar:()=>{e.onAjustarAlProyecto?.(),k();},children:n("Ajustar al proyecto","Fit to project")})]}),e.contenidoDeVista&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),e.contenidoDeVista(k)]}),(e.onHideCompletedChange||e.onLeyendaVisibleChange)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Mostrar","Show")}),e.onHideCompletedChange&&jsxRuntime.jsx(sr,{marcada:e.hideCompleted,alPulsar:()=>{let x=!e.hideCompleted;e.onHideCompletedChange?.(x),x&&e.onTaskFilterChange?.("all"),k();},children:n("Ocultar completadas","Hide completed")}),e.onLeyendaVisibleChange&&jsxRuntime.jsx(sr,{marcada:!!e.leyendaVisible,alPulsar:()=>{e.onLeyendaVisibleChange?.(!e.leyendaVisible),k();},children:n("Leyenda","Legend")})]}),jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Ver","Show")}),e.onShowCriticalPathChange&&jsxRuntime.jsx(sr,{marcada:e.showCriticalPath,alPulsar:()=>e.onShowCriticalPathChange?.(!e.showCriticalPath),children:n("Ruta cr\xEDtica","Critical path")}),e.onHighlightWeekendsChange&&jsxRuntime.jsx(sr,{marcada:e.highlightWeekends,alPulsar:()=>e.onHighlightWeekendsChange?.(!e.highlightWeekends),children:n("Fines de semana y festivos","Weekends and holidays")}),e.onShowDependenciesChange&&e.hasDependencies!==false&&jsxRuntime.jsx(sr,{marcada:e.showDependencies,alPulsar:()=>e.onShowDependenciesChange?.(!e.showDependencies),children:n("Dependencias","Dependencies")}),e.onWbsLevelChange&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Nivel de la estructura","Structure level")}),["all",...Array.from({length:Math.max(1,e.maxWbsDepth??4)},(x,I)=>I+1)].map(x=>jsxRuntime.jsx(sr,{marcada:(e.wbsLevel??"all")===x,alPulsar:()=>{e.onWbsLevelChange?.(x),k();},children:x==="all"?n("Todos los niveles","All levels"):`${n("Hasta el nivel","Up to level")} ${x}`},String(x)))]}),e.onViewModeChange&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{}),jsxRuntime.jsx(uo,{children:n("Modo","Mode")}),["execution","oracle"].map(x=>jsxRuntime.jsx(sr,{marcada:e.viewMode===x,alPulsar:()=>{e.onViewModeChange?.(x),k();},children:x==="execution"?t.toolbar.viewExecution:t.toolbar.viewOracle},x))]})]})}),jsxRuntime.jsx(qc,{alinear:"derecha",ancho:248,boton:(k,x,I)=>jsxRuntime.jsx("button",{ref:I,type:"button","aria-haspopup":"menu","aria-expanded":x,onClick:k,"aria-label":n("M\xE1s opciones: exportar, compartir","More options: export, share"),title:n("M\xE1s opciones","More options"),style:{..._c,width:36,justifyContent:"center",padding:0,border:0,background:"transparent",color:Ba.texto2},children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-4 h-4","aria-hidden":true})}),children:k=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.onExportarDocumento&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(uo,{children:n("Exportar","Export")}),jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:6,padding:"2px 8px 6px"},children:[jsxRuntime.jsxs("select",{"aria-label":n("Papel","Paper"),"data-papel":true,value:o,onChange:x=>s(x.target.value),style:wd,children:[jsxRuntime.jsx("option",{value:"carta",children:n("Carta","Letter")}),jsxRuntime.jsx("option",{value:"a4",children:"A4"}),jsxRuntime.jsx("option",{value:"plotter",children:n("Plotter (A1)","Plotter (A1)")})]}),jsxRuntime.jsxs("select",{"aria-label":n("Rango","Range"),"data-rango":true,value:i,onChange:x=>d(x.target.value),style:wd,children:[jsxRuntime.jsx("option",{value:"todo",children:n("Todo","Everything")}),jsxRuntime.jsx("option",{value:"vista",children:n("Lo que se ve","Current view")})]})]}),jsxRuntime.jsx(sr,{alPulsar:()=>{k(),e.onExportarDocumento?.("pdf",{papel:o,rango:i});},children:n("Exportar PDF","Export PDF")}),jsxRuntime.jsx(sr,{alPulsar:()=>{k(),e.onExportarDocumento?.("png",{papel:o,rango:i});},children:n("Exportar imagen (PNG)","Export image (PNG)")})]}),m.map(x=>jsxRuntime.jsx(sr,{alPulsar:()=>{k(),x.f();},children:x.etiqueta},x.id)),e.onCopySnapshotLink&&jsxRuntime.jsx(sr,{alPulsar:()=>{k(),e.onCopySnapshotLink?.();},children:n("Copiar enlace","Copy link")}),(e.masOpciones?.length??0)>0&&jsxRuntime.jsx(co,{}),e.masOpciones?.map(x=>jsxRuntime.jsx(sr,{icono:x.icono,alPulsar:()=>{k(),x.alPulsar();},children:x.etiqueta},x.id))]})}),e.showCreateTaskButton&&e.onCreateTask&&jsxRuntime.jsxs("button",{type:"button","data-nueva-tarea-v6":true,onClick:e.onCreateTask,style:{..._c,padding:"0 14px 0 11px",border:0,background:Ba.acento,color:Ba.sobreAcento,fontWeight:600},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-[15px] h-[15px]",strokeWidth:2.2,"aria-hidden":true}),e.createTaskLabel||n("Nueva tarea","New task")]})]})}function yd({texto:e,quitar:t,alQuitar:a}){return jsxRuntime.jsxs("span",{"data-filtro-activo-v6":true,className:"flex items-center whitespace-nowrap",style:{height:28,boxSizing:"border-box",gap:2,padding:"0 3px 0 10px",borderRadius:8,background:Ba.neutroFondo,color:Ba.texto2,fontSize:12},children:[e,jsxRuntime.jsx("button",{type:"button","aria-label":`${t} ${e}`,onClick:a,className:"flex items-center justify-center",style:{width:22,height:22,padding:0,border:0,borderRadius:6,background:"transparent",color:Ba.tenue,cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3",strokeWidth:2,"aria-hidden":true})})]})}function G0(e,t=0){let a=e.trim();if(t<12||t>=a.length)return {comienzo:a,cola:""};let n=t;for(;n>0&&!/\s/.test(a[n-1]??"");)n--;let r=a.slice(0,n).trimEnd();return r?{comienzo:r,cola:a.slice(r.length)}:{comienzo:a,cola:""}}function c5(e,t){let a=Math.min(e.length,t.length),n=0;for(;n<a&&e[n]===t[n];)n++;return n}function _0(e){let t=e.map(a=>a.trim());return t.map((a,n)=>{let r=0;for(let o=0;o<t.length;o++)o!==n&&(r=Math.max(r,c5(a,t[o]??"")));return r})}function q0(e,t){return [...e.map(a=>a.wbsCode?`${a.wbsCode} ${a.name}`:a.name),t].join(" \u203A ")}var K0=["critico","alto","medio","bajo"],Y0={es:{critico:"Cr\xEDtico",alto:"Alto",medio:"Medio",bajo:"Bajo"},en:{critico:"Critical",alto:"High",medio:"Medium",bajo:"Low"}},fl=(e,t)=>(t?Y0.es:Y0.en)[e],bl=e=>[...e].sort((t,a)=>K0.indexOf(t.nivel)-K0.indexOf(a.nivel))[0];function u5(e,t){let a=bl(e);if(!a)return "";let n=e.length>1?t?` (y ${e.length-1} m\xE1s)`:` (and ${e.length-1} more)`:"";return `${t?"Riesgo":"Risk"} ${a.codigo} \xB7 ${fl(a.nivel,t)}${n}`}function p5({nivel:e,tam:t=8}){let a=e==="bajo",n=e==="critico"?"var(--v6-rojo-punto, #D13A40)":e==="alto"?"var(--v6-ambar-punto, #9A5B00)":"var(--v6-tenue, #5F6972)";return jsxRuntime.jsx("i",{"aria-hidden":"true",style:{width:t,height:t,borderRadius:"50%",display:"inline-block",flex:"none",boxSizing:"border-box",background:a?"none":n,border:a?`1.5px solid ${n}`:0}})}function X0(e,t){let a=bl(e);if(!a)return "";let n=e.length>1?t?` (y ${e.length-1} m\xE1s)`:` (and ${e.length-1} more)`:"";return `${t?"Riesgo":"Risk"} ${a.codigo} \xB7 ${fl(a.nivel,t)}${a.titulo?`: ${a.titulo}`:""}${n}`}function Ms({riesgos:e,es:t,className:a="kc-risk"}){let n=e?.length?bl(e):void 0;if(!n)return null;let r=X0(e,t);return jsxRuntime.jsx("span",{className:a,"data-nivel":n.nivel,"data-punto-riesgo":n.nivel,role:"img","aria-label":r,title:r,children:jsxRuntime.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M8 2l5 2v4c0 3-2.2 5.3-5 6-2.8-.7-5-3-5-6V4z"})})})}function J0({riesgos:e,es:t}){let a=e?.length?bl(e):void 0;if(!a)return null;let n=u5(e,t);return jsxRuntime.jsx("span",{role:"img","aria-label":n,title:n,"data-punto-riesgo":a.nivel,style:{display:"inline-flex",flex:"none"},children:jsxRuntime.jsx(p5,{nivel:a.nivel})})}var m5=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],g5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ga(e,t,a=new Date){let n=e.getFullYear()!==a.getFullYear();return !t||t.toLowerCase().startsWith("es")?`${e.getDate()} ${m5[e.getMonth()]}${n?` ${e.getFullYear()}`:""}`:`${g5[e.getMonth()]} ${e.getDate()}${n?`, ${e.getFullYear()}`:""}`}var kr=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),f5=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Cd=(e,t)=>{let a=kr(e);return a.setDate(a.getDate()+t),a},Zs=(e,t)=>kr(e).getTime()<kr(t).getTime(),hl={esHabil:()=>true};function Ur(e){if(!e)return hl;let t=e.enabledWeekdays&&e.enabledWeekdays.length===7?e.enabledWeekdays:null,a=e.holidayDates?e.holidayDates instanceof Set?e.holidayDates:new Set(e.holidayDates):null;return t&&!t.some(Boolean)?hl:{esHabil:n=>(!t||!!t[n.getDay()])&&!(a&&a.has(f5(n)))}}function ei(e,t,a=false){let n=kr(e);for(let r=0;r<3660&&!t.esHabil(n);r++)n=Cd(n,a?-1:1);return n}function po(e,t,a){if(t===0)return ei(e,a);let n=kr(e),r=t>0?1:-1,o=Math.abs(t);for(let s=0;s<36600&&o>0;s++)n=Cd(n,r),a.esHabil(n)&&o--;return n}function Q0(e,t,a,n){let r=kr(t).getTime()!==kr(e.inicio).getTime(),o=kr(a).getTime()-kr(t).getTime()===kr(e.fin).getTime()-kr(e.inicio).getTime();if(!r||!o)return {inicio:t,fin:a};let s=ei(t,n,t<e.inicio);return {inicio:s,fin:Ai(s,fr(e.inicio,e.fin,n),n)}}function Li(e,t,a){let n=kr(e),r=kr(t),o=r.getTime()>=n.getTime()?1:-1,[s,i]=o>0?[n,r]:[r,n],d=0;for(let l=Cd(s,1);l.getTime()<=i.getTime();l=Cd(l,1))a.esHabil(l)&&d++;return d*o}function fr(e,t,a){let n=kr(e),r=kr(t);if(r.getTime()<n.getTime())return 1;let o=0;for(let s=n;s.getTime()<=r.getTime();s=Cd(s,1))a.esHabil(s)&&o++;return Math.max(1,o)}function Ai(e,t,a){return po(ei(e,a),Math.max(1,t)-1,a)}function ps(e){let t=new Map((e.dependencyLinks??[]).map(n=>[n.id,n]));return [...new Set([...e.dependencies??[],...t.keys()])].map(n=>t.get(n)??{id:n,type:"FS",lag:0})}function Td(e,t=new Map){for(let a of e)t.set(a.id,a),a.subtasks?.length&&Td(a.subtasks,t);return t}function Kc(e,t,a){if(!t.startDate||!t.endDate)return null;switch(e.type){case "FS":return {inicioMin:po(t.endDate,1+e.lag,a),enlace:e,predecesora:t};case "SS":return {inicioMin:po(t.startDate,e.lag,a),enlace:e,predecesora:t};case "FF":return {finMin:po(t.endDate,e.lag,a),enlace:e,predecesora:t};case "SF":return {finMin:po(t.startDate,e.lag,a),enlace:e,predecesora:t}}}function $i(e,t,a,n,r){let o=n instanceof Map?n:Td(n),s=e.isMilestone?1:fr(t,a,r),i=e.isMilestone?kr(a):kr(t),d=null;for(let l=0;l<8;l++){let p=false;e.noAntesDe&&Zs(i,e.noAntesDe)&&(i=ei(new Date(e.noAntesDe),r),d={inicioMin:new Date(e.noAntesDe),enlace:{id:e.id,type:"FS",lag:0},predecesora:e,restriccion:true},p=true);let c=e.isMilestone?i:Ai(i,s,r);for(let u of ps(e)){let g=o.get(u.id);if(!g||g.id===e.id)continue;let h=Kc(u,g,r);h&&(h.inicioMin&&Zs(i,h.inicioMin)?(i=ei(h.inicioMin,r),d=h,p=true):h.finMin&&Zs(c,h.finMin)&&(i=e.isMilestone?ei(h.finMin,r):po(h.finMin,-(s-1),r),d=h,p=true));}if(!p)break}return d?{inicio:i,fin:e.isMilestone?i:Ai(i,s,r),porQue:d}:{inicio:t,fin:a,porQue:null}}function vl(e,t,a){let n=Td(e),r=new Map;for(let d of n.values())for(let l of ps(d)){let p=r.get(l.id)??[];p.push(d.id),r.set(l.id,p);}let o=[...t],s=new Map,i=0;for(;o.length>0&&i++<2e4;){let d=o.shift();for(let l of r.get(d)??[]){let p=n.get(l);if(!p?.startDate||!p.endDate||p.fijada)continue;let c=$i(p,p.startDate,p.endDate,n,a);if(!c.porQue)continue;let u={...p,startDate:c.inicio,endDate:c.fin};n.set(l,u),s.set(l,{id:l,startDate:c.inicio,endDate:c.fin,porQue:c.porQue}),o.push(l);}}return [...s.values()]}function Yc(e,t){let a=Td(e),n=[];for(let r of a.values())if(!(!r.startDate||!r.endDate))for(let o of ps(r)){let s=a.get(o.id);if(!s)continue;let i=Kc(o,s,t);if(!i)continue;let d=r.isMilestone?r.startDate:r.endDate,l=0;i.inicioMin&&Zs(r.startDate,i.inicioMin)?l=fr(r.startDate,i.inicioMin,t)-1:i.finMin&&Zs(d,i.finMin)&&(l=fr(d,i.finMin,t)-1),(l>0||i.inicioMin&&Zs(r.startDate,i.inicioMin)||i.finMin&&Zs(d,i.finMin))&&n.push({sucesora:r,predecesora:s,enlace:o,dias:Math.max(1,l)});}return n}function Z0(e){return !!e.terminarEl&&!!e.endDate&&Zs(new Date(e.terminarEl),new Date(e.endDate))}function eh(e,t){let a=[...Td(e).values()].filter(w=>w.startDate&&w.endDate),n=new Map;if(a.length===0)return n;let r=a.reduce((w,f)=>f.startDate<w?f.startDate:w,a[0].startDate),o=a.reduce((w,f)=>f.endDate>w?f.endDate:w,a[0].endDate),s=new Map,i=w=>{let f=kr(w).getTime(),C=s.get(f);return C===void 0&&(C=Li(r,w,t),s.set(f,C)),C},d=new Map(a.map(w=>[w.id,{es:i(w.startDate),ef:i(w.endDate),dur:fr(w.startDate,w.endDate,t)}])),l=i(o),p=new Map,c=(w,f)=>{let C=p.get(w);C?C.push(f):p.set(w,[f]);};for(let w of a){for(let f of ps(w))d.has(f.id)&&c(f.id,{hacia:w.id,tipo:f.type,lag:f.lag});for(let f of w.subtasks??[])d.has(f.id)&&c(f.id,{hacia:w.id,tipo:"FF",lag:0});}let u=new Map,g=new Set,h=w=>{let f=u.get(w);if(f!==void 0)return f;let C=d.get(w);if(g.has(w))return l;g.add(w);let y=l;for(let N of p.get(w)??[]){let m=h(N.hacia),k=m-d.get(N.hacia).dur+1,x=N.tipo==="FS"?k-1-N.lag:N.tipo==="SS"?k-N.lag+C.dur-1:N.tipo==="FF"?m-N.lag:m-N.lag+C.dur-1;y=Math.min(y,x);}return g.delete(w),u.set(w,y),y};for(let w of a){let f=d.get(w.id),C=h(w.id)-f.ef,y=l-f.ef;for(let N of p.get(w.id)??[]){if(w.subtasks?.some(x=>x.id===N.hacia))continue;let m=d.get(N.hacia),k=N.tipo==="FS"?m.es-f.ef-1-N.lag:N.tipo==="SS"?m.es-f.es-N.lag:N.tipo==="FF"?m.ef-f.ef-N.lag:m.ef-f.es-N.lag;y=Math.min(y,k);}n.set(w.id,{total:C,libre:Math.max(0,Math.min(y,Math.max(C,0))),critica:C<=0});}return n}var xl=[{id:"duration",es:"Duraci\xF3n",en:"Duration",ancho:52},{id:"predecessors",es:"Predecesoras",en:"Predecessors",ancho:92},{id:"hours",es:"Horas",en:"Hours",ancho:48},{id:"cost",es:"Costo",en:"Cost",ancho:80},{id:"slack",es:"Holgura",en:"Slack",ancho:56},{id:"baselineEnd",es:"Fin L. base",en:"Baseline end",ancho:72},{id:"variance",es:"Variaci\xF3n",en:"Variance",ancho:64}];function th(e){return e.subtasks?.length?e.subtasks.reduce((t,a)=>t+th(a),0):e.effortMinutes??0}function ah(e,t){return e.subtasks?.length?e.subtasks.reduce((a,n)=>a+ah(n,t),0):(e.effortMinutes??0)/60*t(e)}function Xc(e,t){return !e.baselineEndDate||!e.endDate?null:Li(new Date(e.baselineEndDate),new Date(e.endDate),t)}var Ps="\u2014";function bm(e,t,a){let n=!!t.subtasks?.length;switch(e){case "duration":return t.startDate&&t.endDate?`${fr(new Date(t.startDate),new Date(t.endDate),a.cal)} d`:Ps;case "predecessors":{let r=ps(t);return r.length?r.map(o=>{let s=a.wbsDe.get(o.id)??"?",i=o.lag?`${o.lag>0?"+":""}${o.lag}`:"";return o.type==="FS"&&!i?s:`${s}${o.type}${i}`}).join(", "):Ps}case "hours":{let r=th(t);return r?`${Math.round(r/60*10)/10} h`:Ps}case "cost":{if(!a.tarifa)return Ps;let r=ah(t,a.tarifa);return r?a.dinero?a.dinero(r):String(Math.round(r)):Ps}case "slack":return !n&&t.cpmData?`${t.cpmData.totalFloat} d`:Ps;case "baselineEnd":return t.baselineEndDate?ga(new Date(t.baselineEndDate),a.es?"es":"en"):Ps;case "variance":{let r=Xc(t,a.cal);return r===null?Ps:`${r>0?"+":""}${r} d`}default:return Ps}}function nh(e,t,a){if(e==="slack"&&t.cpmData&&!t.subtasks?.length)return t.cpmData.totalFloat<=0?"rojo":null;if(e==="variance"){let n=Xc(t,a);return n===null||n===0?null:n>0?"rojo":"verde"}return null}function Jc({columns:e,onToggleColumn:t,theme:a}){let n=Sr(),[r,o]=react.useState(false),[s,i]=react.useState({x:0,y:0}),d=react.useRef(null),l=react.useRef(null);react.useEffect(()=>{if(!r)return;let c=u=>{d.current&&!d.current.contains(u.target)&&o(false);};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[r]);let p=e.filter(c=>c.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:l,onClick:()=>{if(!r&&l.current){let c=l.current.getBoundingClientRect();i({x:c.left,y:c.bottom+4});}o(!r);},className:"p-2 rounded-md transition-colors flex items-center gap-1",title:n.toolbar.columns||"Columns","aria-label":n.toolbar.columns||"Columns",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`,color:a.textSecondary},whileHover:{backgroundColor:a.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Columns3,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(yn,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:d,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),p.map(c=>jsxRuntime.jsxs("button",{onClick:()=>{t(c.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:a.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:u=>{u.currentTarget.style.backgroundColor=a.hoverBg;},onMouseLeave:u=>{u.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:c.label}),c.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:a.accent}})]},c.id))]})})})})]})}function yl({isOpen:e,x:t,y:a,items:n,onClose:r,theme:o}){let s=react.useRef(null),[i,d]=react.useState({x:t,y:a});if(react.useEffect(()=>{if(!e)return;let p=200,c=n.filter(C=>!C.separator).length*36+n.filter(C=>C.separator).length*9+8,u=8,g=window.innerWidth,h=window.innerHeight,w=t,f=a;t+p+u>g&&(w=t-p,w<u&&(w=u)),a+c+u>h&&(f=h-c-u,f<u&&(f=u)),d({x:w,y:f});},[e,t,a,n.length]),react.useEffect(()=>{if(!e)return;let p=u=>{s.current&&!s.current.contains(u.target)&&r();},c=u=>{u.key==="Escape"&&r();};return document.addEventListener("mousedown",p),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",c);}},[e,r]),!e)return null;let l=p=>p.startsWith("#")&&(p.length===7||p.length===4)?p:o.bgPrimary?.includes("1")||o.bgPrimary?.includes("2")||o.textPrimary?.toLowerCase().includes("fff")||o.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:s,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${i.x}px`,top:`${i.y}px`,backgroundColor:l(o.bgSecondary),border:`1px solid ${o.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsxRuntime.jsx("div",{className:"py-1",children:n.map(p=>jsxRuntime.jsxs("div",{children:[p.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:o.borderLight}}),!(p.separator&&!p.label)&&jsxRuntime.jsxs("button",{onClick:()=>{p.disabled||(p.onClick(),r());},disabled:p.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:p.disabled?o.textTertiary:o.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?.5:1},onMouseEnter:c=>{p.disabled||(c.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:c=>{c.currentTarget.style.backgroundColor="transparent";},children:[p.icon&&jsxRuntime.jsx("span",{style:{color:o.textSecondary},children:p.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:p.label}),p.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:o.textTertiary}})]})]},p.id))})})})}var ka={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Pencil:jsxRuntime.jsx(lucideReact.Pencil,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),AddSubtask:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"}),Duplicate:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),Milestone:jsxRuntime.jsx(lucideReact.Diamond,{className:"w-4 h-4"}),Indent:jsxRuntime.jsx(lucideReact.IndentIncrease,{className:"w-4 h-4"}),Outdent:jsxRuntime.jsx(lucideReact.IndentDecrease,{className:"w-4 h-4"}),MarkIncomplete:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),SetInProgress:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"})};function ch({tasks:e,selectedTaskIds:t,onTaskSelect:a,onTaskCreate:n,onTaskDelete:r,onTaskDuplicate:o,onTaskMove:s,onTaskIndent:i,onTaskOutdent:d,onTaskRename:l,onTaskToggleExpand:p,onOpenTaskModal:c,enableKeyboard:u=true,v6:g}){let h=react.useRef(false),w=react.useCallback(m=>{h.current=m;},[]),f=react.useCallback(m=>{let k=[],x=I=>{for(let M of I)k.push(M),M.subtasks&&M.subtasks.length>0&&M.isExpanded&&x(M.subtasks);};return x(m),k},[]),C=react.useCallback(()=>{let m=f(e);for(let k of m)if(t.has(k.id))return k;return null},[e,t,f]),y=react.useCallback((m,k)=>{let x=f(e);if(x.length===0)return;let I=C();if(!I){a(x[0].id,false);return}let M=x.findIndex(H=>H.id===I.id);if(M===-1)return;let L=m==="up"?M-1:M+1;if(L<0||L>=x.length)return;let F=x[L];a(F.id,k);},[e,C,f,a]),N=react.useCallback(m=>{if(!u)return;let k=m.target;if(k.tagName==="INPUT"||k.tagName==="TEXTAREA"||k.isContentEditable||h.current){m.key==="Escape"&&(k.blur(),h.current=false);return}let M=navigator.platform.toUpperCase().indexOf("MAC")>=0?m.metaKey:m.ctrlKey,L=Array.from(t),F=C();if(g){let H=k.closest?.("[data-task-row]");if(!H||k!==H&&(m.key==="Enter"||m.key===" ")||m.key==="Tab")return;let z=f(e),Y=H.getAttribute("data-task-row"),P=z.findIndex(ge=>ge.id===Y),B=z[P]??F;if((m.key==="ArrowUp"||m.key==="ArrowDown")&&!m.altKey&&!m.shiftKey){m.preventDefault();let ge=z[P+(m.key==="ArrowUp"?-1:1)];ge&&a(ge.id,false);return}if(m.altKey&&m.shiftKey&&L.length>0&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){m.preventDefault(),m.key==="ArrowRight"?i(L):d(L);return}if(m.altKey&&B&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){m.preventDefault(),g.moverDias?.(B,m.key==="ArrowRight"?1:-1);return}if(B&&!m.altKey&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){m.preventDefault();let ge=!!B.subtasks?.length;if(m.key==="ArrowRight"){if(ge&&!B.isExpanded)p(B.id);else if(ge){let ae=z[P+1];ae&&a(ae.id,false);}}else if(ge&&B.isExpanded)p(B.id);else {let ae=z.find(xe=>xe.subtasks?.some(V=>V.id===B.id));ae&&a(ae.id,false);}return}if(m.key==="Enter"&&!m.shiftKey&&!M&&B){m.preventDefault(),g.abrirPanel(B);return}if(m.key==="Home"||m.key==="End"){let ge=m.key==="Home"?z[0]:z[z.length-1];ge&&(m.preventDefault(),a(ge.id,false));return}}if(m.key==="ArrowUp"&&!m.altKey){m.preventDefault(),y("up",m.shiftKey);return}if(m.key==="ArrowDown"&&!m.altKey){m.preventDefault(),y("down",m.shiftKey);return}if(F&&(m.key==="ArrowRight"||m.key==="ArrowLeft")){F.subtasks&&F.subtasks.length>0&&(m.preventDefault(),(m.key==="ArrowRight"&&!F.isExpanded||m.key==="ArrowLeft"&&F.isExpanded)&&p(F.id));return}if(m.altKey&&(m.key==="ArrowUp"||m.key==="ArrowDown")){L.length>0&&(m.preventDefault(),s(L,m.key==="ArrowUp"?"up":"down"));return}if(m.key==="Tab"&&!m.shiftKey){L.length>0&&(m.preventDefault(),i(L));return}if(m.key==="Tab"&&m.shiftKey){L.length>0&&(m.preventDefault(),d(L));return}if(m.key==="Enter"&&!m.shiftKey&&!M){F&&(m.preventDefault(),n(F.id,"below"));return}if(m.key==="Enter"&&m.shiftKey&&!M){F&&(m.preventDefault(),n(F.id,"above"));return}if(m.key==="Enter"&&M){F&&(m.preventDefault(),c(F.id));return}if(m.key==="F2"){F&&(m.preventDefault(),l(F.id));return}if(m.key==="Delete"||m.key==="Backspace"&&M){L.length>0&&(m.preventDefault(),r(L));return}if(m.key==="d"&&M&&!m.shiftKey){L.length>0&&(m.preventDefault(),o(L));return}},[u,t,C,y,n,r,o,s,i,d,l,p,c,g,e,f,a]);return react.useEffect(()=>{if(u)return window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N);}},[u,N]),{setIsEditing:w}}function ph(e){let[t,a]=react.useState(new Set),[n,r]=react.useState(null);react.useEffect(()=>{e&&(a(u=>u.size===1&&u.has(e)?u:new Set([e])),r(u=>u===e?u:e));},[e]);let o=react.useCallback(u=>{a(new Set([u])),r(u);},[]),s=react.useCallback(u=>{a(g=>{let h=new Set(g);return h.has(u)?h.delete(u):h.add(u),h}),r(u);},[]),i=react.useCallback((u,g)=>{if(!n){o(u);return}let h=g.indexOf(n),w=g.indexOf(u);if(h===-1||w===-1){o(u);return}let f=Math.min(h,w),C=Math.max(h,w),y=g.slice(f,C+1);a(new Set(y)),r(u);},[n,o]),d=react.useCallback((u,g,h,w)=>{w?i(u,g):h?s(u):o(u);},[o,s,i]),l=react.useCallback((u,g)=>{g?a(h=>{let w=new Set(h);return w.add(u),w}):o(u);},[o]),p=react.useCallback(()=>{a(new Set),r(null);},[]),c=react.useCallback(u=>t.has(u),[t]);return {selectedTaskIds:t,selectTask:o,toggleTaskSelection:s,selectTaskRange:i,handleTaskClick:d,handleKeyboardSelection:l,clearSelection:p,isTaskSelected:c}}var Y5=[["edit","addSubtask","indent","outdent","dependencies","milestone"],["markIncomplete","setInProgress","markComplete"],["duplicate","split"],["delete"]];function wl(e){let t=[];for(let a of Y5){let n=a.filter(r=>e[r]);if(n.length){t.length&&t.push({id:`sep-${n[0]}`,label:"",onClick:()=>{},separator:true});for(let r of n)t.push({id:r,...e[r]});}}return t}function Ri(e,t){let a=[...e].sort((r,o)=>(r.position??0)-(o.position??0)),n=a.findIndex(r=>r.id===t);if(n>0)return a[n-1];if(n===0)return null;for(let r of e)if(r.subtasks?.length){let o=Ri(r.subtasks,t);if(o||r.subtasks.some(s=>s.id===t))return o}return null}function Nd(e,t){for(let a of e)if(a.subtasks?.some(n=>n.id===t)||a.subtasks?.length&&Nd(a.subtasks,t))return true;return false}var X5=new Set(["completed","complete","done","closed","finished"]),J5=new Set(["in-progress","in_progress","inprogress","doing","active"]),Q5=new Set(["blocked","bloqueada"]),nn=e=>!!e.subtasks&&e.subtasks.length>0;function ba(e){let t=String(e.status??"").trim().toLowerCase();return X5.has(t)||!t&&(e.progress??0)>=100?"done":Q5.has(t)?"blocked":J5.has(t)||(e.progress??0)>0?"prog":"todo"}function On(e,t=[]){if(nn(e))for(let a of e.subtasks)On(a,t);else t.push(e);return t}function ko(e){if(!nn(e))return ba(e);let t=On(e).map(ba);if(t.every(n=>n==="done"))return "done";let a=t.filter(n=>n!=="done");return a.length&&a.every(n=>n==="blocked")?"blocked":t.some(n=>n==="prog"||n==="done")?"prog":"todo"}var Fs=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate(),12);function An(e,t){return nn(e)||!e.endDate||ba(e)==="done"?false:Fs(new Date(e.endDate)).getTime()<Fs(t).getTime()}function Zr(e,t,a){if(!An(e,t)||!e.endDate)return 0;let n=Fs(new Date(e.endDate));n.setDate(n.getDate()+1);let r=Fs(t);for(let o=new Date(n);o.getTime()<=r.getTime();o.setDate(o.getDate()+1))if(a.esHabil(o))return fr(n,r,a);return 0}function Bi(e,t){return !e.startDate||!e.endDate?null:fr(Fs(new Date(e.startDate)),Fs(new Date(e.endDate)),t)}function kl(e,t,a){let n={reg:0,est:0,costo:0,hechas:0,hojas:0,vencidas:0};for(let r of On(e)){let o=(r.timeLoggedMinutes??0)/60;n.reg+=o,n.est+=(r.effortMinutes??0)/60,n.costo+=o*(t(r)||0),n.hojas+=1,ba(r)==="done"&&(n.hechas+=1),An(r,a)&&(n.vencidas+=1);}return n}function Co(e,t){if(!e)return "\u2014";if(Math.abs(e)<1e6)return `${e<0?"-":""}$${os(Math.round(Math.abs(e)),t?"es":"en")}`;let a=(e/1e6).toFixed(1);return t?`$${a.replace(".",",")} M`:`$${a}M`}function _a(e,t){let a=Math.round(e*10)/10,n=Number.isInteger(a)?String(a):a.toFixed(1);return t?n.replace(".",","):n}function mh(e,t,a,n,r){let o=e.trim();if(o.startsWith("-"))return {tipo:"error",motivo:"negativas"};if(!/^\d{1,6}([.,]\d{1,2})?$/.test(o))return {tipo:"error",motivo:"numero"};let s=Number(o.replace(",","."));if(Math.abs(s-t)<.005)return {tipo:"igual"};if(s<t)return {tipo:"error",motivo:"menos"};let i=(a.effortMinutes??0)/60;if(i>0&&s>i*2)return {tipo:"aviso",motivo:"doble",valor:s};if(a.startDate){let d=Fs(new Date(a.startDate));if(d.getTime()>Fs(n).getTime())return {tipo:"aviso",motivo:"noEmpieza",valor:s};let l=fr(d,Fs(n),r);if(s>l*24)return {tipo:"aviso",motivo:"porDia",valor:s,dias:l}}return {tipo:"ok",valor:s}}function vm(e){let t=e.effort_minutes??0;return t>0?t:60}var gh=e=>e.hecha?100:Math.max(0,Math.min(100,e.progress||0));function qo(e){if(e.length===0)return 0;let t=e.filter(r=>(r.weight||0)>0),a=t.reduce((r,o)=>r+o.weight,0);if(a>=99&&t.length/e.length>=.95)return Math.round(t.reduce((r,o)=>r+gh(o)*o.weight,0)/a);let n=e.reduce((r,o)=>r+vm(o),0);return n>0?Math.round(e.reduce((r,o)=>r+gh(o)*vm(o),0)/n):0}function mo(e,t=[]){for(let a of e)if(a.subtasks&&a.subtasks.length>0)mo(a.subtasks,t);else {let n=a;t.push({progress:a.progress||0,weight:n.weight||0,effort_minutes:n.effort_minutes??n.effortMinutes??null,sold_effort_minutes:n.sold_effort_minutes??n.soldEffortMinutes??null,hecha:ba(a)==="done"});}return t}function Oi(e){return e.subtasks&&e.subtasks.length>0?qo(mo(e.subtasks)):Math.round(ba(e)==="done"?100:Math.max(0,Math.min(100,e.progress??0)))}function ym(e){return e.map((t,a)=>({...t,position:a,subtasks:t.subtasks?.length?ym(t.subtasks):t.subtasks}))}function Cl(e){let t=[],a=(n,r,o=0)=>{let s=[...n].sort((i,d)=>(i.position??0)-(d.position??0));for(let i=0;i<s.length;i++){let d={...s[i],parentId:r,level:o,position:s[i].position??i};t.push(d),d.subtasks&&d.subtasks.length>0&&d.isExpanded&&a(d.subtasks,d.id,o+1);}};return a(e),t}function Tl(e,t){for(let a of e){if(a.id===t)return a;if(a.subtasks){let n=Tl(a.subtasks,t);if(n)return n}}return null}function xm(e,t){for(let a of e)if(a.subtasks){if(a.subtasks.some(r=>r.id===t))return a;let n=xm(a.subtasks,t);if(n)return n}return null}function wm(e,t){if(t.length===0)return e;let a=Ri(e,t[0]);if(!a)return e;let n=(l,p)=>{let c=[];return {tasks:l.filter(g=>{if(p.has(g.id))return c.push(g),false;if(g.subtasks){let h=n(g.subtasks,p);g.subtasks=h.tasks,c.push(...h.removed);}return true}),removed:c}},r=(l,p,c)=>l.map(u=>u.id===p?{...u,subtasks:[...u.subtasks||[],...c],isExpanded:true}:u.subtasks?{...u,subtasks:r(u.subtasks,p,c)}:u),o=new Set(t),{tasks:s,removed:i}=n(e,o),d=r(s,a.id,i);return ym(d)}function km(e,t){if(t.length===0)return e;let a=[...e];for(let n of t){let r=xm(a,n);if(!r)continue;let o=xm(a,r.id),s=(l,p,c)=>{for(let u=0;u<l.length;u++){let g=l[u];if(g.id===p&&g.subtasks){let h=g.subtasks.findIndex(w=>w.id===c);if(h!==-1){let[w]=g.subtasks.splice(h,1);return w}}if(g.subtasks){let h=s(g.subtasks,p,c);if(h)return h}}return null},i=(l,p,c)=>{let u=l.findIndex(g=>g.id===p);if(u!==-1)return l.splice(u+1,0,c),l;for(let g of l)g.subtasks&&i(g.subtasks,p,c);return l},d=s(a,r.id,n);d&&(o&&o.subtasks?i(o.subtasks,r.id,d):i(a,r.id,d));}return ym(a)}function Cm(e,t,a){if(t.length===0)return e;let n=[...e],r=t[0],o=(s,i,d)=>{let l=s.findIndex(c=>c.id===i);if(l===-1){for(let c of s)if(c.subtasks&&o(c.subtasks,i,d))return true;return false}let p=d==="up"?l-1:l+1;return p<0||p>=s.length?false:([s[l],s[p]]=[s[p],s[l]],s[l]={...s[l],position:l},s[p]={...s[p],position:p},true)};return o(n,r,a),n}function Tm(e,t){let a=new Set(t),n=r=>r.filter(o=>!a.has(o.id)).map(o=>o.subtasks?{...o,subtasks:n(o.subtasks)}:o);return n(e)}function Qc(e,t){let a=[...e],n=[];for(let r of t){let o=(d,l)=>d.map((p,c)=>({...p,id:`${p.id}-copy-${Date.now()}-${c}`,parentId:l,subtasks:p.subtasks?o(p.subtasks,`${p.id}-copy-${Date.now()}-${c}`):void 0})),s=d=>{let l=d.findIndex(g=>g.id===r);if(l===-1){for(let g of d)if(g.subtasks){let h=s(g.subtasks);if(h)return h}return null}let p=d[l],c=`${p.id}-copy-${Date.now()}`,u={...p,id:c,name:`${p.name} (Copy)`,subtasks:p.subtasks?o(p.subtasks,c):void 0};return d.splice(l+1,0,u),u},i=s(a);i&&n.push(i);}return {tasks:a,duplicatedTasks:n}}function fh(e,t,a){let n=[...e],r=new Date,o=new Date(r);o.setDate(o.getDate()+7);let s={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:r,endDate:o,color:"#00E5CC"},i=d=>{let l=d.findIndex(c=>c.id===t);if(l===-1){for(let c of d)if(c.subtasks&&i(c.subtasks))return true;return false}let p=a==="above"?l:l+1;return d.splice(p,0,s),true};return i(n),{tasks:n,newTask:s}}function Dm(e,t,a){return e.map(n=>n.id===t?{...n,name:a}:n.subtasks?{...n,subtasks:Dm(n.subtasks,t,a)}:n)}function Nm(e,t){return e.map(a=>a.id===t?{...a,isExpanded:!a.isExpanded}:a.subtasks?{...a,subtasks:Nm(a.subtasks,t)}:a)}function Sm(e,t){let a=u=>{for(let g of u){if(g.id===t)return g;if(g.subtasks){let h=a(g.subtasks);if(h)return h}}return null},n=a(e),r=new Date,o=new Date(r);o.setDate(o.getDate()+7);let s=n?.startDate||r,i=n?.endDate||o,d=u=>{for(let g of u){if(g.id===t)return (g.subtasks||[]).length;if(g.subtasks){let h=d(g.subtasks);if(h>=0)return h}}return 0},l=d(e),p={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(s),endDate:new Date(i),color:n?.color||"#00E5CC",position:l,parentId:t},c=u=>u.map(g=>{if(g.id===t){let h=g.subtasks||[];return {...g,subtasks:[...h,p],isExpanded:true}}return g.subtasks?{...g,subtasks:c(g.subtasks)}:g});return {tasks:c(e),newTask:p}}function bh(e,t,a,n){if(t===a)return e;let r=Tl(e,t);if(!r)return e;if(a){let i=(d,l)=>{if(!d.subtasks)return false;for(let p of d.subtasks)if(p.id===l||i(p,l))return true;return false};if(i(r,a))return e}let o=i=>{let d=i.filter(p=>p.id!==t),l=d.length<i.length;return d.map((p,c)=>{let u=l?{...p,position:c}:p;return u.subtasks&&u.subtasks.length>0?{...u,subtasks:o(u.subtasks)}:u})},s=o(e);if(a===null){let i=n!==void 0?n:s.length;s.splice(i,0,{...r,parentId:void 0}),s=s.map((d,l)=>({...d,position:l}));}else {let i=d=>d.map(l=>{if(l.id===a){let p=l.subtasks||[],c=n!==void 0?n:p.length,u=[...p];u.splice(c,0,{...r,parentId:a});let g=u.map((h,w)=>({...h,position:w}));return {...l,subtasks:g,isExpanded:true}}return l.subtasks&&l.subtasks.length>0?{...l,subtasks:i(l.subtasks)}:l});s=i(s);}return s}function To(e){return e.map(t=>{if(!t.subtasks||t.subtasks.length===0)return t;let a=To(t.subtasks),n=a.reduce((i,d)=>(d.startDate&&i.starts.push(new Date(d.startDate).getTime()),d.endDate&&i.ends.push(new Date(d.endDate).getTime()),i.progresses.push(d.progress??0),i),{starts:[],ends:[],progresses:[]}),r=n.starts.length>0?new Date(Math.min(...n.starts)):t.startDate,o=n.ends.length>0?new Date(Math.max(...n.ends)):t.endDate,s=n.progresses.length>0?qo(mo(a)):t.progress;return {...t,subtasks:a,startDate:r,endDate:o,progress:s}})}function Th({valor:e,sufijo:t,min:a,max:n,derecha:r,etiqueta:o,alGuardar:s}){let[i,d]=react.useState(null),l=()=>{let c=Number(i);d(null),i!==null&&i.trim()!==""&&Number.isFinite(c)&&c!==e&&s(Math.min(n,Math.max(a,Math.round(c))));},p={width:"100%",textAlign:r?"right":"left",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:12,color:"var(--v6-texto-2, #4D5761)"};return i===null?jsxRuntime.jsx("button",{type:"button","data-celda-editable":true,"aria-label":`${o}: ${e} ${t}`,onClick:c=>{c.stopPropagation(),d(String(e));},style:{...p,background:"transparent",border:0,padding:0,cursor:"text"},children:t==="%"?`${e}%`:`${e} ${t}`}):jsxRuntime.jsx("input",{autoFocus:true,type:"number",min:a,max:n,value:i,"aria-label":o,onClick:c=>c.stopPropagation(),onFocus:c=>c.currentTarget.select(),onChange:c=>d(c.target.value),onBlur:l,onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"&&(c.preventDefault(),c.currentTarget.blur()),c.key==="Escape"&&d(null);},style:{...p,height:24,boxSizing:"border-box",padding:"0 4px",borderRadius:6,border:"1px solid var(--v6-acento, #0FA392)",background:"var(--v6-tarjeta, #fff)",outline:"none"}})}function Zc({tasks:e,theme:t,rowHeight:a,availableUsers:n=[],templates:r,onTaskClick:o,onTaskSelectionChange:s,selectedTaskId:i,onTaskDblClick:d,onTaskContextMenu:l,onTaskToggle:p,scrollTop:c,columns:u,onToggleColumn:g,onColumnResize:h,onTaskUpdate:w,onBulkFill:f,onTaskIndent:C,onTaskOutdent:y,onTaskMove:N,onMultiTaskDelete:m,onTaskDuplicate:k,onTaskCreate:x,onTaskRename:I,addTaskRow:M,onCreateSubtask:L,onTaskDependencies:F,onOpenTaskModal:H,onDeleteRequest:z,onTaskReparent:Y,allTasks:P,scrollContainerRef:B,showCriticalPath:ge=false,v6:ae=false,onMoverDias:xe,columnasV6:V,puedeEditarEnTabla:fe=()=>true,onDuracionEnTabla:bt,onProgresoEnTabla:st,resumenV6:q,onContraerTodo:He,onMostrarOcultas:we,onOcultarCompletadas:kt,filasVisibles:Je=null,avisoVencidas:Ct,onVerVencidas:$t}){let Tt=Bo(),At=react.useContext(Di),[Ze,mt]=react.useState(null),[Dt,Bt]=react.useState(null),[jt,je]=react.useState(""),aa=react.useRef(null),[Ut,Pt]=react.useState(null),[Ht,et]=react.useState(0),[re,ke]=react.useState(0),[Ce,it]=react.useState({isOpen:false,x:0,y:0,type:"header"}),[se,at]=react.useState(null),[X,Te]=react.useState(null),[Le,Xe]=react.useState(null),Rt=react.useRef(0),Ft=5,da=react.useRef(false),[nt,ca]=react.useState(null),[na,Gt]=react.useState(false),Ee=react.useRef(null),[qe,Z]=react.useState(null),[Ue,ut]=react.useState(null),[gt,ta]=react.useState(false),ra=react.useRef(null);react.useEffect(()=>{function b(D){ra.current&&!ra.current.contains(D.target)&&ta(false);}if(gt)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[gt]),react.useEffect(()=>{Dt&&aa.current&&(aa.current.focus(),aa.current.select());},[Dt]),react.useEffect(()=>{if(!Ut)return;let b=j=>{let K=j.clientX-Ht,Q=re+K;h?.(Ut,Q);},D=()=>{Pt(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",b),document.addEventListener("mouseup",D),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",D),document.body.style.cursor="",document.body.style.userSelect="";}},[Ut,Ht,re,h]);let{selectedTaskIds:Pa,handleTaskClick:Fa,isTaskSelected:Oa}=ph(i),ua=react.useRef(null),{setIsEditing:Za}=ch({tasks:e,selectedTaskIds:Pa,onTaskSelect:(b,D)=>{let K=Cl(e).map(Q=>Q.id);Fa(b,K,D||false,false),ua.current=b,s?.(b);},onTaskCreate:x||(()=>{}),onTaskDelete:m||(()=>{}),onTaskDuplicate:k||(()=>{}),onTaskMove:N||(()=>{}),onTaskIndent:C||(()=>{}),onTaskOutdent:y||(()=>{}),onTaskRename:b=>{let D=Cl(e).find(j=>j.id===b);D&&Me(D);},onTaskToggleExpand:p||(()=>{}),onOpenTaskModal:b=>{let D=Cl(e).find(j=>j.id===b);D&&H&&H(D);},enableKeyboard:true,v6:ae?{abrirPanel:b=>o?.(b),moverDias:xe}:void 0}),en=(b,D=0,j="")=>{let K=[],Q=[...b].sort((te,W)=>(te.position??0)-(W.position??0));for(let te=0;te<Q.length;te++){let W=Q[te],le=te+1,Ve=j?`${j}.${le}`:`${le}.0`,Ge=W.wbsCode||Ve;if(W.wbsCode=Ge,K.push({task:W,level:D}),W.subtasks&&W.subtasks.length>0&&W.isExpanded){let Et=W.wbsCode?.replace(/\.0$/,"")||(j?`${j}.${le}`:`${le}`);K.push(...en(W.subtasks,D+1,Et));}}return K},ya=en(e),za=(()=>{let b=Je?.desde??0,D=Je?.hasta??ya.length-1;for(let j=b;j<=D;j++)if(ya[j]&&Oa(ya[j].task.id))return ya[j].task.id;return ya[b]?.task.id})();react.useEffect(()=>{let b=ua.current;if(!b)return;ua.current=null;let D=ya.findIndex(te=>te.task.id===b),j=B?.current;if(D<0)return;if(j){let te=D*a,W=j.clientHeight-Xa;te<j.scrollTop?j.scrollTop=te:te+a>j.scrollTop+W&&(j.scrollTop=te+a-W);}let K=0,Q=()=>{let te=document.querySelector(`[data-task-row="${CSS.escape(b)}"]`);te?te.focus({preventScroll:true}):K++<6&&requestAnimationFrame(Q);};Q();});let Xa=ae?60:48,un=Math.max(ya.length*a,600-Xa),oa=(b,D)=>D==="assignees"?b.assignees:D==="startDate"?b.startDate:b.endDate,St=(b,D,j,K)=>{b.preventDefault(),b.stopPropagation(),Z({sourceTaskId:D,column:j,sourceIndex:K,targetIndex:K}),document.body.style.cursor="crosshair",document.body.style.userSelect="none";let Q=b.currentTarget.closest("[data-grid-body]"),te=Da=>{let fa=Q?.getBoundingClientRect().top??0,Re=Math.floor((Da-fa)/a);return Re=Math.max(0,Math.min(ya.length-1,Re)),Re<K&&(Re=K),Re},W=b.clientY,le=B?.current??null,Ve=()=>{Ee.current&&(cancelAnimationFrame(Ee.current),Ee.current=null);},Ge=()=>{let Da=te(W);Z(fa=>fa&&{...fa,targetIndex:Da});},Ke=()=>{if(Ve(),!le)return;let Da=le.getBoundingClientRect(),fa=60,Re=12,Yt=W-Da.top,Ea=Da.bottom-W;if(Ea<fa&&le.scrollTop<le.scrollHeight-le.clientHeight){let Ua=Math.max(1,Math.round(Re*(1-Math.max(0,Ea)/fa))),qn=()=>{le.scrollTop+=Ua,Ge(),le.scrollTop<le.scrollHeight-le.clientHeight&&(Ee.current=requestAnimationFrame(qn));};Ee.current=requestAnimationFrame(qn);}else if(Yt<fa&&le.scrollTop>0){let Ua=Math.max(1,Math.round(Re*(1-Math.max(0,Yt)/fa))),qn=()=>{le.scrollTop-=Ua,Ge(),le.scrollTop>0&&(Ee.current=requestAnimationFrame(qn));};Ee.current=requestAnimationFrame(qn);}},Et=Da=>{W=Da.clientY,Ge(),Ke();},Ha=Da=>{window.removeEventListener("mousemove",Et),window.removeEventListener("mouseup",Ha),Ve(),document.body.style.cursor="",document.body.style.userSelect="",Z(null);let fa=te(Da.clientY),Re=ya.find(O=>O.task.id===D)?.task;if(!Re)return;let Yt=oa(Re,j),Ea=Math.min(K,fa),Ua=Math.max(K,fa),qn=[];for(let O=Ea;O<=Ua;O++){if(O===K)continue;let me=ya[O]?.task;!me||me.subtasks&&me.subtasks.length>0||qn.push(me.id);}qn.length!==0&&f?.(qn,j,Yt);};window.addEventListener("mousemove",Et),window.addEventListener("mouseup",Ha);},_e=b=>{if(!qe)return false;let D=Math.min(qe.sourceIndex,qe.targetIndex),j=Math.max(qe.sourceIndex,qe.targetIndex);return b>=D&&b<=j},ia=b=>!b.startDate||!b.endDate?"-":`${Math.ceil((b.endDate.getTime()-b.startDate.getTime())/(1e3*60*60*24))}d`,Me=b=>{Bt(b.id),je(b.name),Za(true);},_t=b=>{jt.trim()&&jt!==e.find(D=>D.id===b)?.name&&I?.(b,jt.trim()),Bt(null),je(""),Za(false);},Aa=()=>{Bt(null),je(""),Za(false);},U=(b,D)=>{D.stopPropagation(),L?.(b.id);},T=(b,D)=>{D.preventDefault(),Rt.current=D.clientY,at(b),da.current=false,Gt(false),ca({x:D.clientX,y:D.clientY});},G=b=>{if(!se||(Math.abs(b.clientY-Rt.current)>Ft&&!da.current&&(da.current=true,Gt(true)),ca({x:b.clientX,y:b.clientY}),!da.current))return;if(B?.current){let te=B.current,W=te.getBoundingClientRect(),le=60,Ve=12;Ee.current&&(cancelAnimationFrame(Ee.current),Ee.current=null);let Ge=b.clientY-W.top,Ke=W.bottom-b.clientY;if(Ge<le&&te.scrollTop>0){let Et=Math.round(Ve*(1-Ge/le)),Ha=()=>{te.scrollTop-=Et,da.current&&te.scrollTop>0&&(Ee.current=requestAnimationFrame(Ha));};Ee.current=requestAnimationFrame(Ha);}else if(Ke<le&&te.scrollTop<te.scrollHeight-te.clientHeight){let Et=Math.round(Ve*(1-Ke/le)),Ha=()=>{te.scrollTop+=Et,da.current&&te.scrollTop<te.scrollHeight-te.clientHeight&&(Ee.current=requestAnimationFrame(Ha));};Ee.current=requestAnimationFrame(Ha);}}let j=document.querySelectorAll("[data-task-row]"),K=null,Q=null;j.forEach(te=>{let W=te.getBoundingClientRect(),le=te.getAttribute("data-task-row");if(le&&le!==se&&b.clientY>=W.top&&b.clientY<=W.bottom){K=le;let Ve=b.clientY-W.top,Ge=W.height;Ve<Ge*.25?Q="above":Ve>Ge*.75?Q="below":Q="child";}}),Te(K),Xe(Q);},ie=()=>{if(da.current&&se&&X&&Le){if(Le==="child")Y?.(se,X);else if(Le==="above"||Le==="below"){let b=(te,W,le=null)=>{for(let Ve of te){if(Ve.id===W)return le;if(Ve.subtasks){let Ge=b(Ve.subtasks,W,Ve.id);if(Ge!==void 0)return Ge}}},D=P&&P.length>0?P:e,j=b(D,se,null),K=b(D,X,null),Q=(te,W,le,Ve)=>{let Ge=te.findIndex(Ha=>Ha.id===W),Ke=Ve?te.findIndex(Ha=>Ha.id===le):-1,Et=Le==="below"?Ge+1:Ge;return Ve&&Ke!==-1&&Ke<Ge&&(Et-=1),Math.max(0,Et)};if(K===null){let W=Q(D,X,se,j===null);Y?.(se,null,W);}else {let te=Tl(D,K);if(te?.subtasks){let W=j===K,le=Q(te.subtasks,X,se,W);Y?.(se,K,le);}}}}Ee.current&&(cancelAnimationFrame(Ee.current),Ee.current=null),at(null),Te(null),Xe(null),ca(null),da.current=false,Gt(false);};react.useEffect(()=>{if(se)return document.addEventListener("mousemove",G),document.addEventListener("mouseup",ie),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",ie),document.body.style.cursor="",document.body.style.userSelect="";}},[se,X,Le]);let _=react.useMemo(()=>{let b=new Map,D=(j,K)=>{for(let Q of j)b.set(Q.id,K),Q.subtasks?.length&&D(Q.subtasks,[...K,{name:Q.name,wbsCode:Q.wbsCode}]);};return D(e,[]),b},[e]),oe=react.useMemo(()=>{let b=new Map,D=j=>{let K=_0(j.map(Q=>Q.name));j.forEach((Q,te)=>{b.set(Q.id,K[te]??0),Q.subtasks?.length&&D(Q.subtasks);});};return D(e),b},[e]),S=12,$=(b,D,j,K)=>{if(b.id==="name"){let Q=Dt===D.id,te=Ze===D.id;return jsxRuntime.jsxs("div",{"data-celda-nombre-v6":true,className:"flex items-center min-w-0 relative",style:{gap:6,alignSelf:"stretch",width:"100%",paddingLeft:`${j*S}px`},children:[Array.from({length:j},(W,le)=>jsxRuntime.jsx("span",{"aria-hidden":true,style:{position:"absolute",left:8+le*S,top:0,bottom:0,width:1,background:"var(--v6-separador, #CDD2D8)"}},le)),Y&&te&&!Q&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing flex items-center",style:{position:"absolute",left:-10,top:0,bottom:0,width:10,color:"var(--v6-tenue, #5F6972)"},onMouseDown:W=>T(D.id,W),title:Tt?"Arrastrar para mover la tarea":"Drag to move the task",children:jsxRuntime.jsx(lucideReact.GripVertical,{style:{width:10,height:14}})}),K?jsxRuntime.jsx("button",{type:"button",onClick:W=>{W.stopPropagation(),p?.(D.id);},"aria-label":Tt?D.isExpanded?`Contraer ${D.name}`:`Desplegar ${D.name}`:D.isExpanded?`Collapse ${D.name}`:`Expand ${D.name}`,"aria-expanded":!!D.isExpanded,style:{flex:"none",width:18,height:18,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:D.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{style:{width:14,height:14},strokeWidth:2}):jsxRuntime.jsx(lucideReact.ChevronRight,{style:{width:14,height:14},strokeWidth:2})}):jsxRuntime.jsx("span",{"aria-hidden":true,style:{flex:"none",width:18}}),D.wbsCode&&jsxRuntime.jsx("span",{style:{flex:"none",minWidth:28,textAlign:"right",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:11,color:"var(--v6-tenue, #5F6972)"},children:D.wbsCode}),Q?jsxRuntime.jsx("input",{ref:aa,type:"text",value:jt,onChange:W=>je(W.target.value),onKeyDown:W=>{if(W.stopPropagation(),W.key==="Escape"){Aa();return}if(W.key==="Enter"){_t(D.id),x?.(D.id,"below");return}W.key==="Tab"&&(W.preventDefault(),_t(D.id),W.shiftKey?y?.([D.id]):C?.([D.id]));},onBlur:()=>_t(D.id),className:"flex-1 min-w-0 px-2 py-1 rounded border outline-none",style:{background:"var(--v6-tarjeta, #fff)",borderColor:"var(--v6-acento, #0FA392)",color:"var(--v6-texto, #0E1114)",font:"inherit",fontSize:13},onClick:W=>W.stopPropagation()}):(()=>{let{comienzo:W,cola:le}=G0(D.name,oe.get(D.id)??0),Ve=_.get(D.id)??[];return jsxRuntime.jsxs("span",{title:Ve.length?q0(Ve,D.name):D.name,"data-nombre-v6":true,style:{marginLeft:2,flex:"1 1 auto",minWidth:0,display:"flex",whiteSpace:"nowrap",fontSize:13,fontWeight:K||D.isMilestone?600:500,color:"var(--v6-texto, #0E1114)"},children:[jsxRuntime.jsx("span",{style:{minWidth:le&&W.length>12?`${12}ch`:0,overflow:"hidden",textOverflow:"ellipsis",flex:"0 1 auto"},children:W}),le&&jsxRuntime.jsx("span",{style:{flex:"none",whiteSpace:"pre",maxWidth:"60%",overflow:"hidden",textOverflow:"ellipsis"},children:le})]})})(),D.fijada&&jsxRuntime.jsx(lucideReact.Lock,{"aria-label":Tt?"Fechas fijadas":"Dates locked","data-tarea-fijada":true,style:{flex:"none",width:11,height:11,color:"var(--v6-tenue, #5F6972)"}}),jsxRuntime.jsx(J0,{riesgos:D.riesgos,es:Tt}),ge&&D.isCriticalPath&&jsxRuntime.jsx("span",{"aria-label":Tt?"En la ruta cr\xEDtica":"On the critical path",style:{flex:"none",width:6,height:6,borderRadius:"50%",background:"var(--v6-rojo-punto, #D13A40)"}}),te&&!Q&&jsxRuntime.jsxs("div",{className:"flex items-center",style:{gap:2,flex:"none"},onClick:W=>W.stopPropagation(),children:[jsxRuntime.jsx("button",{type:"button",onClick:W=>U(D,W),"aria-label":Tt?"Crear subtarea":"Create subtask",title:Tt?"Crear subtarea":"Create subtask",style:{width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.Plus,{style:{width:13,height:13}})}),jsxRuntime.jsx("button",{type:"button",onClick:W=>{W.stopPropagation(),Me(D);},"aria-label":Tt?"Renombrar (F2)":"Rename (F2)",title:Tt?"Renombrar (F2)":"Rename (F2)",style:{width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.Edit3,{style:{width:13,height:13}})})]})]})}if(b.id==="assignees"){if(K)return jsxRuntime.jsx("span",{"aria-hidden":true});let Q=n.filter(te=>D.assignees?.some(W=>W.id?W.id===te.id:W.name===te.name||W.initials===te.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:te=>te.stopPropagation(),children:jsxRuntime.jsx(Vs,{variante:"v6",es:Tt,nombreDeLaTarea:D.name,assignedUsers:Q,availableUsers:n,onChange:te=>w?.(D.id,{assignees:te.map(W=>({id:W.id,name:W.name,initials:W.initials,color:W.color}))})})})}if(V&&b.id==="duration"&&!K&&D.startDate&&D.endDate&&!D.isMilestone&&fe(D)){let Q=V.contexto.cal,te=fr(new Date(D.startDate),new Date(D.endDate),Q);return jsxRuntime.jsx(Th,{valor:te,sufijo:"d",min:1,max:3650,etiqueta:`${Tt?"Duraci\xF3n de":"Duration of"} ${D.name}`,alGuardar:W=>bt?.(D,W)})}if(V&&b.id==="predecessors"&&!K&&F&&fe(D)){let Q=bm("predecessors",D,V.contexto);return jsxRuntime.jsx("button",{type:"button","data-celda-v6":"predecessors",className:"truncate w-full",title:Tt?"Editar predecesoras":"Edit predecessors",onClick:te=>{te.stopPropagation(),F(D);},style:{textAlign:"left",background:"transparent",border:0,padding:0,cursor:"pointer",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontSize:12,color:Q==="\u2014"?"var(--v6-tenue, #5F6972)":"var(--v6-texto-2, #4D5761)"},children:Q})}if(V&&xl.some(Q=>Q.id===b.id)){let Q=nh(b.id,D,V.contexto.cal),te=bm(b.id,D,V.contexto);return jsxRuntime.jsx("div",{className:"truncate w-full","data-celda-v6":b.id,title:b.id==="predecessors"&&te!=="\u2014"?te:void 0,style:{fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:12,fontWeight:K?500:400,color:Q==="rojo"?"var(--v6-rojo, #B02A33)":Q==="verde"?"var(--v6-acento-texto, #066A5F)":te==="\u2014"?"var(--v6-tenue, #5F6972)":"var(--v6-texto-2, #4D5761)"},children:te})}if(b.id==="progress"&&!K&&st&&fe(D)){let Q=Math.round(D.progress||0);return jsxRuntime.jsx(Th,{valor:Q,sufijo:"%",min:0,max:100,derecha:true,etiqueta:`${Tt?"Avance de":"Progress of"} ${D.name}`,alGuardar:te=>st(D,te)})}if(b.id==="progress"){let Q=Math.round(D.progress||0),te=!K&&Q>0&&Q<100;return jsxRuntime.jsxs("div",{className:"w-full",style:{textAlign:"right",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:12,fontWeight:K||te?500:400,color:te?"var(--v6-acento-texto, #066A5F)":Q===0?"var(--v6-tenue, #5F6972)":"var(--v6-texto, #0E1114)"},children:[Q,"%"]})}},ee=(b,D,j)=>{let K=D.subtasks&&D.subtasks.length>0;if(ae){let Q=$(b,D,j,!!K);if(Q!==void 0)return Q}switch(b.id){case "name":let Q=Dt===D.id,te=Ze===D.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${j*20}px`},children:[Y&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:te?1:.3},onMouseDown:Re=>T(D.id,Re),title:"Arrastrar para mover tarea",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-4 h-4"})}),D.subtasks&&D.subtasks.length>0?jsxRuntime.jsx("button",{onClick:Re=>{Re.stopPropagation(),p?.(D.id);},"aria-label":Tt?D.isExpanded?`Contraer ${D.name}`:`Desplegar ${D.name}`:D.isExpanded?`Collapse ${D.name}`:`Expand ${D.name}`,"aria-expanded":!!D.isExpanded,className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:D.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}):jsxRuntime.jsx("div",{className:"w-5 h-5 flex-shrink-0"}),Q?jsxRuntime.jsx("input",{ref:aa,type:"text",value:jt,onChange:Re=>je(Re.target.value),onKeyDown:Re=>{Re.key==="Enter"?_t(D.id):Re.key==="Escape"&&Aa();},onBlur:()=>_t(D.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:Re=>Re.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("span",{className:"flex-1 min-w-0",style:{display:"flex",alignItems:"baseline",gap:"6px",color:D.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:D.parentId?"13px":"14px",fontWeight:D.isMilestone?600:D.parentId?400:600,letterSpacing:D.parentId?"0":"-0.01em"},title:D.name,children:[D.wbsCode&&jsxRuntime.jsx("span",{style:{color:`var(--pj-texto-tenue, ${t.textTertiary})`,fontFamily:"'JetBrains Mono', monospace",fontSize:"11px",fontWeight:500,flexShrink:0},children:D.wbsCode}),D.isHighlighted&&D.status==="completed"&&jsxRuntime.jsx("span",{title:"\u2605",style:{color:"#F59E0B",fontSize:"10px",flexShrink:0,lineHeight:1},children:"\u2605"}),jsxRuntime.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D.name}),D.subtasks&&D.subtasks.length>0&&jsxRuntime.jsxs("span",{style:{color:"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"12px",fontWeight:400,flexShrink:0,whiteSpace:"nowrap"},children:["\xB7 ",Math.round(D.progress||0),"%"]}),ge&&D.isCriticalPath&&jsxRuntime.jsx("span",{style:{display:"inline-block",width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#EF4444",flexShrink:0,marginLeft:"2px"}}),ge&&D.cpmData&&jsxRuntime.jsx("span",{title:Tt?"D\xEDas que la tarea puede retrasarse sin mover el fin del proyecto":"Total float: days the task can slip without moving the project end",style:{color:D.cpmData.totalFloat<=0?"#EF4444":D.cpmData.totalFloat<=5?"#F59E0B":"#6B7280",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px",fontWeight:500,flexShrink:0,whiteSpace:"nowrap",marginLeft:"4px"},children:Tt?`Holgura: ${Math.round(D.cpmData.totalFloat)} d`:`TF: ${Math.round(D.cpmData.totalFloat)}d`})]}),te&&!Q&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:Re=>Re.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:Re=>U(D,Re),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:Re=>{Re.stopPropagation(),Me(D);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let W=b.id==="startDate",le=W?"startDate":"endDate",Ve=D[le],Ge=Ue?.taskId===D.id&&Ue?.field===le,Ke=Re=>{if(!Re)return ae?"\u2014":"-";let Yt=typeof Re=="string"?new Date(Re):Re;return ae?ga(Yt,Tt?"es":"en"):Yt.toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"})};return jsxRuntime.jsxs("div",{className:`flex items-center w-full relative ${ae?"justify-start":"justify-center"}`,onClick:Re=>Re.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",className:ae?"flex items-center rounded":"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:ae?{whiteSpace:"nowrap",padding:0,border:0,background:"transparent",fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontVariantNumeric:"tabular-nums",fontSize:11,color:!W&&Z0(D)||!W&&!K&&D.status!=="completed"&&(D.progress??0)<100&&Ve&&new Date(Ve).getTime()<new Date(new Date().toDateString()).getTime()?"var(--v6-rojo, #B02A33)":"var(--v6-texto-2, #4D5761)",cursor:K?"default":"pointer"}:{color:t.textSecondary,opacity:K?.5:1,cursor:K?"default":"pointer"},title:K?"Auto-calculated from subtasks":void 0,onClick:Re=>{if(!K)if(Ge)ut(null);else {let Yt=Re.currentTarget.getBoundingClientRect();ut({taskId:D.id,field:le,month:Ve?typeof Ve=="string"?new Date(Ve):Ve:new Date,position:{top:Yt.bottom+4,left:Yt.left}});}},children:[!ae&&jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsxRuntime.jsx("span",{children:Ke(Ve)}),K&&!ae&&jsxRuntime.jsx("span",{style:{fontSize:"9px",color:t.textTertiary,marginLeft:"2px"},children:"\u25BC"})]}),Ge&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>ut(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:Ue?.position.top,left:Ue?.position.left},onClick:Re=>Re.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let Re=new Date,Yt=new Date(Re);Yt.setDate(Re.getDate()+1);let Ea=new Date(Re);Ea.setDate(Re.getDate()+7);let Ua=new Date(Re);return Ua.setDate(Re.getDate()+14),[{label:"Hoy",date:Re},{label:"Ma\xF1ana",date:Yt},{label:"Pr\xF3xima semana",date:Ea},{label:"2 semanas",date:Ua}].map((O,me)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:ye=>ye.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:ye=>ye.currentTarget.style.backgroundColor="transparent",onClick:()=>{w?.(D.id,{[le]:O.date}),ut(null);},children:O.label},me))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:Re=>Re.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:Re=>Re.currentTarget.style.backgroundColor="transparent",onClick:()=>{w?.(D.id,{[le]:void 0}),ut(null);},children:"Borrar"})]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>ut(Re=>Re?{...Re,month:new Date(Re.month.getFullYear(),Re.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:Ue?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>ut(Re=>Re?{...Re,month:new Date(Re.month.getFullYear(),Re.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["L","M","X","J","V","S","D"].map((Re,Yt)=>jsxRuntime.jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:Re},Yt))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let Re=Ue?.month||new Date,Yt=Re.getFullYear(),Ea=Re.getMonth(),Ua=(new Date(Yt,Ea,1).getDay()+6)%7,qn=new Date(Yt,Ea+1,0).getDate(),O=new Date,me=[];for(let tt=Ua-1;tt>=0;tt--)me.push({day:new Date(Yt,Ea,-tt).getDate(),date:new Date(Yt,Ea-1,new Date(Yt,Ea,-tt).getDate()),isCurrentMonth:false});for(let tt=1;tt<=qn;tt++)me.push({day:tt,date:new Date(Yt,Ea,tt),isCurrentMonth:true});let ye=42-me.length;for(let tt=1;tt<=ye;tt++)me.push({day:tt,date:new Date(Yt,Ea+1,tt),isCurrentMonth:false});return me.map((tt,Ot)=>{let lt=tt.date.toDateString()===O.toDateString(),$a=(Ve?typeof Ve=="string"?new Date(Ve):Ve:null)?.toDateString()===tt.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:tt.isCurrentMonth?$a?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:$a?"#00E5CC":"transparent",boxShadow:lt&&!$a?"inset 0 0 0 1px #00E5CC":"none"},onClick:()=>{w?.(D.id,{[le]:tt.date}),ut(null);},children:tt.day},Ot)})})()})]})]})]}),document.body)]});case "duration":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",children:jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:ia(D)})});case "assignees":if(K)return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.4},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:"\u2014"})});let Et=n.filter(Re=>D.assignees?.some(Yt=>Yt.id?Yt.id===Re.id:Yt.name===Re.name||Yt.initials===Re.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:Re=>Re.stopPropagation(),children:jsxRuntime.jsx(Vs,{assignedUsers:Et,availableUsers:n,onChange:Re=>{let Yt=Re.map(Ea=>({id:Ea.id,name:Ea.name,initials:Ea.initials,color:Ea.color}));w?.(D.id,{assignees:Yt});}})});case "status":if(K){let Re=D.progress===100?"\u2713":D.progress>0?"\u25D0":"\u25CB";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",style:{opacity:.5},children:jsxRuntime.jsx("span",{className:"text-xs",style:{color:t.textTertiary},children:Re})})}return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:Re=>Re.stopPropagation(),children:jsxRuntime.jsx(gb,{status:D.status||"todo",onChange:Re=>{w?.(D.id,{status:Re,progress:Re==="completed"?100:D.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 w-full",style:{opacity:K?.6:1},children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${D.progress}%`,backgroundColor:D.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[D.progress,"%"]})]});case "priority":let Ha={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},Da={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},fa=Ha[D.priority||"medium"]||"MEDIUM";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:Re=>Re.stopPropagation(),children:jsxRuntime.jsx(ki,{priority:fa,onChange:Re=>{Re&&w?.(D.id,{priority:Da[Re]||"medium"});}})});default:return null}},ce=b=>[{id:"hide",label:"Hide Column",icon:ka.Hide,onClick:()=>g(b),disabled:b==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:ka.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:ka.SortDesc,onClick:()=>{}}],ue=b=>{let D=b.subtasks&&b.subtasks.length>0,j=Cl(e),K=Pa.size>1&&Pa.has(b.id),Q=K?j.filter(Ke=>Pa.has(Ke.id)):[b],te=Q.map(Ke=>Ke.id),W=Q.filter(Ke=>!(Ke.subtasks&&Ke.subtasks.length>0)),le=K?` (${te.length})`:"",Ve=()=>{z?z(te,b.name):m?.(te);},Ge=At?.contextMenu;return wl({edit:{label:Ge?.editTask||"Edit Task",icon:ka.Pencil,onClick:()=>d?.(b),disabled:!!D},addSubtask:{label:Ge?.addSubtask||"Add Subtask",icon:ka.Add,onClick:()=>L?.(b.id)},...C?{indent:{label:Ge?.indent||"Indent",icon:ka.Indent,onClick:()=>C([b.id]),disabled:K||!Ri(e,b.id)}}:{},...y?{outdent:{label:Ge?.outdent||"Outdent",icon:ka.Outdent,onClick:()=>y([b.id]),disabled:K||!Nd(e,b.id)}}:{},...F?{dependencies:{label:Ge?.dependencies||"Dependencies\u2026",icon:ka.Link,onClick:()=>F(b),disabled:!!D}}:{},...w?{milestone:{label:b.isMilestone?Tt?"Quitar hito":"Remove milestone":Tt?"Convertir en hito":"Convert to milestone",icon:ka.Milestone,onClick:()=>w(b.id,{isMilestone:!b.isMilestone}),disabled:!!D}}:{},markIncomplete:{label:(Ge?.markIncomplete||"Mark Incomplete")+le,icon:ka.MarkIncomplete,onClick:()=>W.forEach(Ke=>w?.(Ke.id,{status:"todo",progress:0})),disabled:W.length===0||W.every(Ke=>Ke.status==="todo")},setInProgress:{label:(Ge?.setInProgress||"Set In Progress")+le,icon:ka.SetInProgress,onClick:()=>W.forEach(Ke=>w?.(Ke.id,{status:"in-progress"})),disabled:W.length===0||W.every(Ke=>Ke.status==="in-progress")},markComplete:{label:(Ge?.markComplete||"Mark Complete")+le,icon:ka.MarkComplete,onClick:()=>W.forEach(Ke=>w?.(Ke.id,{status:"completed",progress:100})),disabled:W.length===0||W.every(Ke=>Ke.status==="completed")},duplicate:{label:(Ge?.duplicateTask||"Duplicate Task")+le,icon:ka.Duplicate,onClick:()=>k?.(te)},split:{label:Ge?.splitTask||"Split Task",icon:ka.Split,onClick:()=>{},disabled:true},delete:{label:(Ge?.deleteTask||"Delete Task")+le,icon:ka.Delete,onClick:Ve}})},pe=u.filter(b=>b.visible),We=pe.reduce((b,D)=>b+D.width,0);return jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:ae?"var(--v6-tarjeta, #FFFFFF)":t.bgPrimary,minWidth:We},children:[ae?jsxRuntime.jsxs("div",{"data-cabecera-tabla-v6":true,className:"sticky top-0 z-10 flex flex-col",style:{height:`${Xa}px`,boxSizing:"border-box",background:"var(--v6-tarjeta, #FFFFFF)",borderBottom:"1px solid var(--v6-borde, #E2E5E9)"},children:[jsxRuntime.jsxs("div",{style:{height:24,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 10px 0 14px",borderBottom:"1px solid var(--v6-linea, #EEF0F2)",fontSize:11,color:"var(--v6-tenue, #5F6972)"},children:[jsxRuntime.jsxs("span",{className:"truncate","data-resumen-v6":true,children:[q,we&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" \xB7 ",jsxRuntime.jsx("button",{type:"button",onClick:we,"data-mostrar-ocultas":true,style:{border:0,padding:0,background:"transparent",font:"inherit",color:"var(--v6-acento-texto, #087F72)",fontWeight:500,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:Tt?"Mostrar":"Show"})]}),kt&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" \xB7 ",jsxRuntime.jsx("button",{type:"button",onClick:kt,"data-ocultar-completadas":true,style:{border:0,padding:0,background:"transparent",font:"inherit",color:"var(--v6-acento-texto, #087F72)",cursor:"pointer"},children:Tt?"Ocultar completadas":"Hide completed"})]}),Ct&&$t&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" \xB7 ",jsxRuntime.jsx("span",{"data-aviso-vencidas":true,style:{color:"var(--v6-rojo, #B02A33)",fontWeight:500},children:Ct})," \xB7 ",jsxRuntime.jsx("button",{type:"button",onClick:$t,"data-ver-vencidas":true,style:{border:0,padding:0,background:"transparent",font:"inherit",color:"var(--v6-acento-texto, #087F72)",fontWeight:500,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:2},children:Tt?"Ver":"View"})]})]}),He&&jsxRuntime.jsx("button",{type:"button",onClick:He,"aria-label":Tt?"Contraer todos los grupos":"Collapse all groups",title:Tt?"Contraer todos los grupos":"Collapse all groups",style:{width:20,height:20,padding:0,display:"flex",alignItems:"center",justifyContent:"center",border:0,borderRadius:6,background:"transparent",color:"var(--v6-tenue, #5F6972)",cursor:"pointer"},children:jsxRuntime.jsx(lucideReact.ChevronsDownUp,{style:{width:13,height:13},strokeWidth:2})})]}),jsxRuntime.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:10,padding:"0 14px 0 10px",fontSize:11,fontWeight:500,color:"var(--v6-tenue, #5F6972)"},children:[pe.map(b=>jsxRuntime.jsx("div",{style:{width:b.id==="name"?void 0:b.width,flex:b.id==="name"?"1 1 0":"0 0 auto",minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textAlign:b.id==="assignees"?"center":b.id==="progress"?"right":"left",paddingLeft:b.id==="name"?60:0},title:b.id==="assignees"?b.label:void 0,children:b.id==="assignees"&&(b.width??0)<=40?jsxRuntime.jsx("span",{role:"img","aria-label":b.label,"data-encabezado-responsable":true,style:{display:"inline-flex",justifyContent:"center",width:"100%"},children:jsxRuntime.jsx(lucideReact.User,{"aria-hidden":true,style:{width:13,height:13},strokeWidth:2})}):b.label},b.id)),V&&jsxRuntime.jsx(W0,{es:Tt,elegidas:V.elegidas,alternar:V.alternar,opciones:xl.filter(b=>b.id!=="cost"||V.verCostos)})]})]}):jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.glassHeader||t.bgSecondary,height:`${Xa}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsxRuntime.jsx("div",{className:"flex items-center flex-1 min-w-0",children:pe.map((b,D)=>{let j=D===pe.length-1,K=b.id==="name";return jsxRuntime.jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${K?"":"justify-center"}`,style:{width:`${b.width}px`,minWidth:`${b.minWidth??(K?200:60)}px`,maxWidth:`${b.maxWidth??2e3}px`,flexShrink:K&&pe.length===1?1:0,flexGrow:K&&pe.length===1?1:0,borderRight:j?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:Q=>{Q.preventDefault(),it({isOpen:true,x:Q.clientX,y:Q.clientY,type:"header",columnId:b.id});},onMouseEnter:Q=>{Q.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:Q=>{Q.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:b.label,children:b.label}),b.resizable&&jsxRuntime.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"12px",marginRight:"-6px",backgroundColor:Ut===b.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:Q=>{Q.preventDefault(),Q.stopPropagation(),Pt(b.id),et(Q.clientX),ke(b.width);},title:Tt?"Arrastra para cambiar el ancho":"Drag to resize column",children:jsxRuntime.jsx("div",{className:"absolute top-0 bottom-0 transition-opacity",style:{left:"5px",width:"2px",backgroundColor:t.accent,borderRadius:"1px",opacity:Ut===b.id?.8:void 0},children:jsxRuntime.jsx("div",{className:"absolute inset-0 opacity-20 group-hover:opacity-80 transition-opacity",style:{backgroundColor:t.accent}})})})]},b.id)})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.glassHeader||t.bgSecondary,zIndex:5},children:[jsxRuntime.jsx(Jc,{columns:u,onToggleColumn:g,theme:t}),jsxRuntime.jsx("button",{onClick:()=>ta(!gt),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"})}),gt&&jsxRuntime.jsxs("div",{ref:ra,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:b=>b.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>ta(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content","data-grid-body":true,style:{minHeight:un},role:"treegrid","aria-label":Tt?"Tareas del cronograma":"Schedule tasks","aria-rowcount":ya.length,children:[Je&&Je.desde>0&&jsxRuntime.jsx("div",{"aria-hidden":true,"data-relleno-arriba":true,style:{height:Je.desde*a}}),ya.map(({task:b,level:D},j)=>{if(Je&&(j<Je.desde||j>Je.hasta))return null;let K=Oa(b.id),Q=_e(j),te=X===b.id,W=te&&Le==="above",le=te&&Le==="below",Ve=te&&Le==="child",Ge={};return Ve&&(Ge.backgroundColor=`${t.accent}15`,Ge.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-row":b.id,role:"row","aria-rowindex":j+1,"aria-level":D+1,"aria-expanded":b.subtasks?.length?!!b.isExpanded:void 0,"aria-selected":K,tabIndex:ae?b.id===za?0:-1:void 0,className:`flex items-center cursor-pointer group ${se===b.id?"opacity-50":""}`,style:{position:"relative",height:`${a}px`,...ae?{boxSizing:"border-box",padding:"0 14px 0 10px",gap:10,borderBottom:"1px solid var(--v6-linea, #EEF0F2)",boxShadow:K?"inset 2px 0 0 var(--v6-acento, #0FA392)":void 0,backgroundColor:K?"var(--v6-fila-seleccionada, rgba(15,163,146,0.08))":Ve?`${t.accent}15`:"transparent"}:{borderLeft:K?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:K?t.accentLight:Ve?`${t.accent}15`:j%2===0?t.bgPrimary:t.bgGrid},opacity:ge?b.isCriticalPath?1:.4:void 0,transition:"opacity 300ms ease",...Ge},onMouseEnter:()=>mt(b.id),onMouseLeave:()=>mt(null),onClick:Ke=>{let Ha=Cl(e).map(Re=>Re.id),fa=navigator.platform.toUpperCase().indexOf("MAC")>=0?Ke.metaKey:Ke.ctrlKey;Fa(b.id,Ha,fa,Ke.shiftKey),s?.(b.id),!fa&&!Ke.shiftKey&&o?.(b);},onDoubleClick:Ke=>{Ke.stopPropagation(),d?.(b);},onContextMenu:Ke=>{Ke.preventDefault(),it({isOpen:true,x:Ke.clientX,y:Ke.clientY,type:"task",task:b}),l?.(b,Ke);},whileHover:{backgroundColor:ae?K?"var(--v6-fila-seleccionada, rgba(15,163,146,0.08))":"var(--v6-fila-hover, rgba(14,17,20,0.025))":K?t.accentLight:t.hoverBg},children:[W&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),le&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),pe.map((Ke,Et)=>{let Ha=Et===pe.length-1,Da=Ke.id==="name",fa=!!(b.subtasks&&b.subtasks.length>0),Re=Ke.id==="assignees"||Ke.id==="startDate"||Ke.id==="endDate"?Ke.id:null,Ea=!!Re&&!fa&&Ze===b.id&&!qe,Ua=Q&&!!qe&&qe.column===Ke.id;return jsxRuntime.jsxs("div",{role:"gridcell",className:ae?"flex items-center":`px-4 flex items-center ${Da?"justify-start":"justify-center"}`,style:ae?{position:"relative",width:Da?void 0:`${Ke.width}px`,flex:Da?"1 1 0":"0 0 auto",minWidth:0,height:"100%",alignItems:"center",overflow:"visible",backgroundColor:Ua?`${t.accent}22`:void 0}:{position:"relative",width:`${Ke.width}px`,minWidth:`${Ke.minWidth??(Da?200:60)}px`,maxWidth:`${Ke.maxWidth??2e3}px`,flexShrink:Da&&pe.length===1?1:0,flexGrow:Da&&pe.length===1?1:0,borderRight:Ha?"none":`1px solid ${Ze===b.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"visible",backgroundColor:Ua?`${t.accent}22`:void 0,boxShadow:Ua?`inset 0 0 0 1px ${t.accent}66`:void 0},children:[ee(Ke,b,Da?D:0),Ea&&Re&&jsxRuntime.jsx("div",{title:"Arrastr\xE1 hacia abajo para aplicar a varias tareas",onMouseDown:qn=>St(qn,b.id,Re,j),style:{position:"absolute",right:2,bottom:2,width:8,height:8,borderRadius:2,background:t.accent,border:`1px solid ${t.bgPrimary}`,cursor:"crosshair",zIndex:5}})]},`${b.id}-${Ke.id}`)})]},b.id)}),Je&&Je.hasta<ya.length-1&&jsxRuntime.jsx("div",{"aria-hidden":true,"data-relleno-abajo":true,style:{height:(ya.length-1-Je.hasta)*a}}),M&&jsxRuntime.jsxs("button",{type:"button","data-anadir-tarea":true,onClick:M.onClick,className:ae?"w-full flex items-center text-left":"w-full flex items-center gap-2 px-3 text-left text-[13px] transition-colors",style:ae?{height:36,gap:8,padding:"0 14px 0 34px",border:0,background:"transparent",color:"var(--v6-tenue, #5F6972)",font:"inherit",fontSize:13,cursor:"pointer"}:{height:`${a}px`,color:t.textTertiary,borderBottom:`1px solid ${t.borderLight}`},onMouseEnter:b=>{b.currentTarget.style.color=ae?"var(--v6-texto, #0E1114)":t.textPrimary;},onMouseLeave:b=>{b.currentTarget.style.color=ae?"var(--v6-tenue, #5F6972)":t.textTertiary;},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),M.label]})]}),jsxRuntime.jsx(yl,{isOpen:Ce.isOpen,x:Ce.x,y:Ce.y,items:Ce.type==="header"&&Ce.columnId?ce(Ce.columnId):Ce.type==="task"&&Ce.task?ue(Ce.task):[],onClose:()=>it({...Ce,isOpen:false}),theme:t}),na&&nt&&se&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:nt.x+12,top:nt.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let b=ya.find(D=>D.task.id===se)?.task;return b?jsxRuntime.jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:b.name})}):null})()}),document.body)]})}function Dh(e,t){let[a,n]=react.useState("none"),[r,o]=react.useState(0),[s,i]=react.useState(e),[d,l]=react.useState(t),[p,c]=react.useState(null),[u,g]=react.useState(null),[h,w]=react.useState(null),[f,C]=react.useState(null),[y,N]=react.useState(0),[m,k]=react.useState(0),[x,I]=react.useState(null),[M,L]=react.useState(false);return {dragMode:a,setDragMode:n,dragOffset:r,setDragOffset:o,ghostX:s,setGhostX:i,ghostWidth:d,setGhostWidth:l,connectionLine:p,setConnectionLine:c,hoveredTaskId:u,setHoveredTaskId:g,activeZone:h,setActiveZone:w,draggedSegmentIndex:f,setDraggedSegmentIndex:C,draggedSegmentStartX:y,setDraggedSegmentStartX:N,segmentDragOffsetX:m,setSegmentDragOffsetX:k,hoveredSegmentIndex:x,setHoveredSegmentIndex:I,isHovered:M,setIsHovered:L,isDragging:a!=="none",isResizing:a==="resize-start"||a==="resize-end",isConnecting:a==="connect",resetDragState:(P,B)=>{n("none"),c(null),g(null),i(P),l(B),k(0),C(null),N(0);}}}function eu({task:e,x:t,y:a,width:n,theme:r,dayWidth:o,startDate:s,templates:i,onClick:d,onDoubleClick:l,onContextMenu:p,onDateChange:c,onDependencyCreate:u,allTaskPositions:g=[],onDragMove:h,onHoverChange:w,showBaseline:f,showTaskBarLabels:C=true,showCriticalPath:y=true,readOnly:N=false,onProgressChange:m,v6:k=false,alturaBarra:x,duracionV6:I,sobreasignada:M=false,calendario:L,transversal:F=false}){let H=Bo(),z=Dh(t,n),Y=react.useRef(null),P=react.useRef(false),B=Bo(),ge=react.useRef(false),ae=react.useRef(null),xe=react.useRef(null),{dragMode:V,setDragMode:fe,dragOffset:bt,setDragOffset:st,ghostX:q,setGhostX:He,ghostWidth:we,setGhostWidth:kt,connectionLine:Je,setConnectionLine:Ct,hoveredTaskId:$t,setHoveredTaskId:Tt,activeZone:At,setActiveZone:Ze,draggedSegmentIndex:mt,setDraggedSegmentIndex:Dt,draggedSegmentStartX:Bt,setDraggedSegmentStartX:jt,segmentDragOffsetX:je,setSegmentDragOffsetX:aa,hoveredSegmentIndex:Ut,setHoveredSegmentIndex:Pt,isHovered:Ht,setIsHovered:et,isDragging:re,isResizing:ke,isConnecting:Ce,resetDragState:it}=z,se=x??18,at=!!r.executionBarBg,X=r.textPrimary==="#FFFFFF"||r.bgPrimary==="#050505",Te=at?3:6,Le=e.subtasks&&e.subtasks.length>0,Xe=react.useRef(null),[Rt,Ft]=(()=>{let _=react.useRef(null),[,oe]=react.useState(0);return [_.current,S=>{_.current=S,oe($=>$+1);}]})(),da=!!m&&!N&&!Le&&!e.segments&&!!e.startDate&&!!e.endDate,nt=e.endDate&&(()=>{let _=new Date;_.setHours(0,0,0,0);let oe=new Date(e.endDate);return oe.setHours(0,0,0,0),oe<_})()&&e.progress<100,ca=y&&e.isCriticalPath,na=r.name==="neutral"||r.today==="#1C1917",Gt=e.status==="completed"||e.progress===100,Ee={low:"#10B981",LOW:"#10B981",medium:"#F59E0B",MEDIUM:"#F59E0B",high:"#F97316",HIGH:"#F97316",urgent:"#EF4444",URGENT:"#EF4444"},Z=y&&e.isCriticalPath||nt?"#EF4444":e.color?e.color:e.priority&&Ee[e.priority]?Ee[e.priority]:r.taskBarPrimary,Ue=N?"default":re?Ce?"crosshair":ke?"ew-resize":"grabbing":"grab",ut=N?"default":"ew-resize",ta=(_=>_>=80?20:_>=60?15:_>=50?12:10)(n),ra=n<50,Pa=n<40;react.useEffect(()=>{w&&(!Ht||re||e.segments)&&w(null);},[Ht,re,e.segments,w]);let Fa=_=>_.toLocaleDateString(H?"es-CO":"en-US",{month:"short",day:"numeric",year:"numeric"}),Oa=()=>{let _=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return H?`${_} d\xEDa${_!==1?"s":""}`:`${_} day${_!==1?"s":""}`},ua=_=>Math.round(_/o)*o,Za=_=>{let oe=Math.round(_/o),S=new Date(s);return S.setDate(S.getDate()+oe),S},en=_=>{let oe=g.find($=>$.id===_),S=!!oe&&!!Je&&Je.x>oe.x+oe.width/2;return P.current?S?"SF":"SS":S?"FF":"FS"},ya=(_,oe)=>{for(let S of g){if(S.id===e.id)continue;let $=5;if(_>=S.x-$&&_<=S.x+S.width+$&&oe>=S.y-$&&oe<=S.y+S.height+$)return S.id}return null},za=react.useCallback((_,oe,S)=>{if(N)return;_.preventDefault(),_.stopPropagation();let $=Y.current?.ownerSVGElement;if(!$)return;let ee=$.createSVGPoint();ee.x=_.clientX,ee.y=_.clientY;let ce=ee.matrixTransform($.getScreenCTM()?.inverse()),ue=S!==void 0?S:t,pe=oe;if(!pe){let We=ce.x-ue;_.shiftKey?(pe="connect",P.current=false,Ct({x:t+n,y:a+se/2})):_.ctrlKey||_.metaKey?pe="move":_.altKey?pe=We<n/2?"resize-start":"resize-end":Pa?We<n/2?pe="move":pe="resize-end":ra?We<=ta/2?pe="resize-start":We>=n-ta/2?pe="resize-end":pe="move":We<=ta?pe="resize-start":We>=n-ta?pe="resize-end":pe="move";}ge.current=false,fe(pe),et(false),Ze(null),pe==="move"?st(ce.x-ue):pe==="connect"?Ct({x:P.current?t:t+n,y:a+se/2}):st(0),He(ue),kt(n);},[t,n,a,se,N]),Xa=react.useCallback(_=>{let oe=Y.current?.ownerSVGElement;if(!oe)return;let S=oe.closest(".gantt-timeline-scroll");if(!S)return;let $=S.getBoundingClientRect(),ee=60,ce=15,ue=0;if(_.clientX<$.left+ee){let pe=$.left+ee-_.clientX;ue=-Math.min(ce,pe/2);}else if(_.clientX>$.right-ee){let pe=_.clientX-($.right-ee);ue=Math.min(ce,pe/2);}return ue!==0&&(S.scrollLeft+=ue),ue!==0},[]),un=react.useCallback(_=>{if(V==="none")return;ge.current=true,xe.current=_;let oe=Y.current?.ownerSVGElement;if(!oe)return;if(V==="move"||V==="resize-start"||V==="resize-end"){let ee=Xa(_);ee&&!ae.current?ae.current=window.setInterval(()=>{xe.current&&(Xa(xe.current),un(xe.current));},16):!ee&&ae.current&&(window.clearInterval(ae.current),ae.current=null);}let S=oe.createSVGPoint();S.x=_.clientX,S.y=_.clientY;let $=S.matrixTransform(oe.getScreenCTM()?.inverse());if(V==="connect"){Ct({x:$.x,y:$.y});let ee=ya($.x,$.y);Tt(ee);}else if(V==="move"){let ee=$.x-bt,ce=ua(ee);He(ce),kt(n);let ue=Math.round((ce-t)/o);if(h?.(e.id,ue,true),e.segments&&e.segments.length>0&&mt!==null){let pe=ce-Bt;aa(pe);}}else if(V==="resize-start"){let ee=$.x,ce=ua(ee),ue=t+n-ce;ue>=o&&(He(ce),kt(ue));}else if(V==="resize-end"){let ee=$.x,ue=ua(ee)-t;ue>=o&&kt(ue);}},[V,t,n,o,bt,e,ua,mt,Bt,ya,Tt,Ct,He,kt,aa,h,Xa]),oa=react.useCallback(()=>{if(ae.current&&(window.clearInterval(ae.current),ae.current=null),xe.current=null,V!=="none"){if(V==="connect")$t&&u&&u(e,$t,en($t)),Ct(null),Tt(null);else {let _=e.endDate.getTime()-e.startDate.getTime(),oe,S,$=true;if(V==="move"){if(oe=Za(q),S=new Date(oe.getTime()+_),e.segments&&e.segments.length>0&&mt!==null){let ee=Math.round(je/o),ce=e.segments.map((b,D)=>{if(D===mt){let j=new Date(b.startDate),K=new Date(b.endDate);return j.setDate(j.getDate()+ee),K.setDate(K.getDate()+ee),{startDate:j,endDate:K}}return b}),ue=ce.flatMap(b=>[b.startDate,b.endDate]),pe=new Date(Math.min(...ue.map(b=>b.getTime()))),We=new Date(Math.max(...ue.map(b=>b.getTime())));c?.({...e,segments:ce},pe,We),it(t,n);return}}else V==="resize-start"?(oe=Za(q),S=e.endDate,oe>S&&(console.warn("Invalid date range: start date must be before or equal to end date"),$=false)):V==="resize-end"?(oe=e.startDate,S=Za(q+we),S.setDate(S.getDate()-1),S<oe&&(console.warn("Invalid date range: end date must be after or equal to start date"),$=false)):$=false;$&&oe&&S&&(S.getTime()<oe.getTime()?console.warn("Invalid date range: end date cannot be before start date"):c?.(e,oe,S));}h?.(e.id,0,false),it(t,n);}},[V,q,we,e,c,$t,u,t,n,o,Za,je,mt,it,h]);react.useEffect(()=>{if(V==="none")return;let _=S=>{un(S);},oe=()=>{oa();};return window.addEventListener("mousemove",_),window.addEventListener("mouseup",oe),()=>{window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",oe),ae.current&&(window.clearInterval(ae.current),ae.current=null);}},[V,un,oa]);let St=re&&!Ce?q:t,_e=re&&!Ce?we:n,ia=i.taskClass(e),Me=24,_t=y?e.isCriticalPath?1:.25:1,Aa=react.useCallback(_=>{if(!da)return;_.stopPropagation(),_.preventDefault();let S=Y.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??null;Xe.current={barRect:S,initialPct:e.progress||0},_.currentTarget.setPointerCapture(_.pointerId),Ft(e.progress||0);},[da,e.progress,Ft]),U=react.useCallback(_=>{let oe=Xe.current;if(!oe)return;let $=Y.current?.querySelector('rect[data-bar-background="true"]')?.getBoundingClientRect()??oe.barRect;if(!$||$.width<=0)return;let ee=(_.clientX-$.left)/$.width,ce=Math.round(Math.max(0,Math.min(1,ee))*100);_.shiftKey&&(ce=Math.round(ce/25)*25),Ft(ce);},[Ft]),T=react.useCallback(_=>{let oe=Xe.current;if(!oe)return;_.stopPropagation(),_.preventDefault();try{_.currentTarget.releasePointerCapture(_.pointerId);}catch{}let S=Rt;Xe.current=null,Ft(null),S!=null&&S!==oe.initialPct&&m&&m(e,S);},[Rt,m,e,Ft]),G=react.useCallback(_=>{_.stopPropagation(),_.preventDefault();},[]),ie=Rt??(e.progress||0);return jsxRuntime.jsxs("g",{ref:Y,"data-task-bar":"true",role:"img","aria-label":`${e.name}, ${e.progress??0}%`,"data-estado":Gt?"completed":nt?"overdue":"planned","data-resumen":Le?"true":void 0,style:{opacity:_t,transition:"opacity 300ms ease"},onClick:()=>{!re&&!ge.current&&d?.(e),ge.current=false;},onDoubleClick:_=>{!re&&!ge.current&&(_.stopPropagation(),l?.(e));},onContextMenu:_=>{_.preventDefault(),p?.(e,_);},onMouseEnter:_=>{re||(et(true),w&&!e.segments&&w({task:e,x:t,y:a,width:n,height:se,showBelow:false,mouseX:_.clientX,mouseY:_.clientY}));},onMouseMove:_=>{w&&Ht&&!re&&!e.segments&&w({task:e,x:t,y:a,width:n,height:se,showBelow:false,mouseX:_.clientX,mouseY:_.clientY});},onMouseLeave:()=>{re||(et(false),Ze(null));},children:[jsxRuntime.jsx("rect",{x:t,y:a,width:n+Me,height:se,fill:"transparent",style:{pointerEvents:"all"}}),Ht&&!re&&!ra&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:ta,height:se,fill:At==="resize-start"?r.accent:"transparent",opacity:At==="resize-start"?.15:0,style:{cursor:ut,pointerEvents:"all"},onMouseEnter:()=>Ze("resize-start"),onMouseDown:_=>za(_,"resize-start")}),jsxRuntime.jsx("rect",{x:t+ta,y:a,width:n-ta*2,height:se,fill:At==="move"?r.accent:"transparent",opacity:At==="move"?.1:0,style:{cursor:N?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>Ze("move"),onMouseDown:_=>za(_,"move")}),jsxRuntime.jsx("rect",{x:t+n-ta,y:a,width:ta,height:se,fill:At==="resize-end"?r.accent:"transparent",opacity:At==="resize-end"?.15:0,style:{cursor:ut,pointerEvents:"all"},onMouseEnter:()=>Ze("resize-end"),onMouseDown:_=>za(_,"resize-end")})]}),Ht&&!re&&Pa&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:n/2,height:se,fill:At==="move"?r.accent:"transparent",opacity:At==="move"?.2:0,style:{cursor:N?"default":"grab",pointerEvents:"all"},onMouseEnter:()=>Ze("move"),onMouseDown:_=>za(_,"move")}),jsxRuntime.jsx("rect",{x:t+n/2,y:a,width:n/2,height:se,fill:At==="resize-end"?r.accent:"transparent",opacity:At==="resize-end"?.2:0,style:{cursor:ut,pointerEvents:"all"},onMouseEnter:()=>Ze("resize-end"),onMouseDown:_=>za(_,"resize-end")}),Ht&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+n/2,y1:a+4,x2:t+n/2,y2:a+se-4,stroke:r.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),re&&!Ce&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:q,y:a,width:we,height:se,rx:Te,fill:r.accent,opacity:.15,stroke:r.accent,strokeWidth:1,strokeDasharray:"4 3",initial:{opacity:0},animate:{opacity:.25},transition:{duration:.15},style:{pointerEvents:"none"}}),f&&e.baselineStartDate&&e.baselineEndDate&&!re&&(()=>{let _=e.baselineStartDate.getTime(),oe=e.baselineEndDate.getTime(),S=s.getTime(),$=864e5,ee=(_-S)/$,ce=(oe-_)/$,ue=ee*o,pe=Math.max(ce*o,o),We=St+_e,b=ue+pe,D=e.endDate?.getTime()??0,j=L&&e.endDate?Li(new Date(oe),e.endDate,L):Math.ceil((D-oe)/$),K=j>0,Q=j<-0;return k?jsxRuntime.jsx("rect",{"data-linea-base":e.id,x:ue,y:a+se+2,width:pe,height:3,rx:1.5,style:{fill:"var(--v6-pista, #D5DADF)",pointerEvents:"none"}}):jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:ue,y:a,width:pe,height:se,rx:Te,fill:"none",stroke:X?"rgba(255,255,255,0.45)":"rgba(0,0,0,0.35)",strokeWidth:1.5,strokeDasharray:"6 4"}),K&&We>b&&jsxRuntime.jsx("rect",{x:b,y:a,width:We-b,height:se,rx:0,fill:"#EF4444",opacity:.2}),K&&jsxRuntime.jsxs("text",{x:Math.max(We,b)+6,y:a+se/2+1,fill:"#EF4444",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:["+",j,"d"]}),Q&&jsxRuntime.jsxs("text",{x:We+6,y:a+se/2+1,fill:"#10B981",fontSize:"10",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",dominantBaseline:"middle",children:[j,"d"]})]})})(),!e.segments&&at&&Le&&(()=>{let oe=a+(se-8)/2,S=4,$=e.progress||0,ee=new Date;ee.setHours(0,0,0,0);let ce=e.startDate&&ee>=e.startDate,ue=e.endDate&&(()=>{let K=new Date(e.endDate);return K.setHours(0,0,0,0),ee>K})(),pe=e.startDate&&ee<e.startDate,We=1;if(ce&&e.startDate&&e.endDate&&!pe){let K=new Date(e.startDate);K.setHours(0,0,0,0);let Q=new Date(e.endDate);Q.setHours(0,0,0,0);let te=Math.max(1,(Q.getTime()-K.getTime())/(1e3*60*60*24)),le=Math.min((ee.getTime()-K.getTime())/(1e3*60*60*24),te)/te*100;We=le>0?$/le:1;}let b;$>=100?b="#00E5CC":pe?b="#4B5563":ue&&$<100?b="#EF4444":We>=.95?b="#22C55E":We>=.8?b="#F59E0B":b="#EF4444";let D=Math.max($/100*_e,$>0?S*2:0),j=_e>100&&$>0;return jsxRuntime.jsxs("g",{"data-task-class":ia,style:{cursor:"default",pointerEvents:"all"},children:[jsxRuntime.jsx("rect",{"data-parte":"pista",x:St,y:oe,width:_e,height:8,rx:S,fill:"rgba(255,255,255,0.10)"}),$>0&&jsxRuntime.jsx("rect",{"data-parte":"avance",x:St,y:oe,width:D,height:8,rx:S,fill:b}),j&&jsxRuntime.jsxs("text",{x:St+D+6,y:oe+8/2,dominantBaseline:"central",fill:r.textSecondary,fontSize:"9",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[Math.round($),"%"]})]})})(),k&&!e.segments&&!Le&&(()=>{let _=`v6-barra-${String(e.id).replace(/[^A-Za-z0-9_-]/g,"")}`,oe=!!nt&&!Gt,S=Math.max(0,Math.min(100,ie));if(F){let $=Math.round(a+se/2),ee=Math.round(St),ce=Math.round(St+_e);return jsxRuntime.jsxs("g",{"data-transversal":"",children:[jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,fill:"transparent","data-parte":"pista","data-bar-background":"true",onMouseDown:ue=>za(ue),style:{cursor:Ue,pointerEvents:"all"}}),jsxRuntime.jsx("line",{x1:ee,y1:$,x2:ce,y2:$,stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))",strokeWidth:2,style:{pointerEvents:"none",opacity:re&&!Ce?.25:1}}),S>0&&jsxRuntime.jsx("line",{x1:ee,y1:$,x2:ee+(ce-ee)*(S/100),y2:$,stroke:"var(--v6-acento, #0FA392)",strokeWidth:2,"data-parte":"avance",style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:ee+1,y1:$-5,x2:ee+1,y2:$+5,stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))",strokeWidth:2,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:ce-1,y1:$-5,x2:ce-1,y2:$+5,stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))",strokeWidth:2,style:{pointerEvents:"none"}}),I&&!re&&jsxRuntime.jsx("text",{x:St+_e+6,y:a+se/2,dominantBaseline:"middle","data-etiqueta-barra":true,"data-sobreasignada":M||void 0,fill:M?"var(--v6-ambar, #9A5B00)":"var(--v6-tenue, #5F6972)",fontSize:11,fontFamily:"'JetBrains Mono', ui-monospace, monospace",style:{fontVariantNumeric:"tabular-nums",pointerEvents:"none",userSelect:"none"},children:I})]})}return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("clipPath",{id:_,children:jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:6})})}),jsxRuntime.jsx("rect",{x:Math.round(St)+.5,y:Math.round(a)+.5,width:Math.max(0,Math.round(St+_e)-Math.round(St)-1),height:Math.round(se)-1,rx:6,shapeRendering:"geometricPrecision","data-parte":"pista","data-bar-background":"true","data-task-class":ia,fill:S>0?"var(--v6-acento-fondo-3, rgba(15,163,146,0.16))":"var(--v6-acento-fondo, rgba(15,163,146,0.1))",stroke:"var(--v6-acento-borde, rgba(8,127,114,0.85))","data-v6-vencida":oe?"":void 0,strokeWidth:1,onMouseDown:$=>za($),style:{cursor:Ue,pointerEvents:"all",opacity:re&&!Ce?.25:1}}),S>0&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e*(S/100),height:se,clipPath:`url(#${_})`,"data-parte":"avance",fill:"var(--v6-acento, #0FA392)",style:{pointerEvents:"none"}}),ca&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:6,fill:"none",stroke:"var(--v6-texto, #0E1114)",strokeWidth:2,"data-parte":"alerta",style:{pointerEvents:"none"}}),I&&!re&&jsxRuntime.jsx("text",{x:St+_e+6,y:a+se/2,dominantBaseline:"middle","data-etiqueta-barra":true,"data-sobreasignada":M||void 0,fill:M?"var(--v6-ambar, #9A5B00)":"var(--v6-tenue, #5F6972)",fontSize:11,fontFamily:"'JetBrains Mono', ui-monospace, monospace",style:{fontVariantNumeric:"tabular-nums",pointerEvents:"none",userSelect:"none"},children:I})]})})(),!k&&!e.segments&&at&&!Le&&jsxRuntime.jsx(framerMotion.motion.rect,{x:St,y:a,width:_e,height:se,rx:Te,fill:r.executionBarBg||"rgba(255,255,255,0.06)",stroke:r.border||"rgba(255,255,255,0.1)",strokeWidth:1,"data-task-class":ia,"data-bar-background":"true","data-parte":"pista",initial:{opacity:0,scale:.95},animate:{opacity:re&&!Ce?.15:e.parentId?.6:1,scale:Ht&&!re?1.01:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:_=>za(_),style:{cursor:Ue,pointerEvents:"all"}}),!k&&!e.segments&&!at&&jsxRuntime.jsx(framerMotion.motion.rect,{x:St,y:a,width:_e,height:se,rx:Te,fill:Z,"data-task-class":ia,"data-parte":"pista",initial:{opacity:0,scale:.95},animate:{opacity:re&&!Ce?.15:e.parentId?.6:Ht?.9:.8,scale:Ht&&!re?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Le?void 0:_=>za(_),style:{cursor:Le?"default":Ue,pointerEvents:"all"}}),!k&&at&&(nt||ca)&&!e.segments&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:Te,fill:"none",stroke:r.criticalPath,strokeWidth:2,"data-parte":"alerta",style:{pointerEvents:"none",filter:`drop-shadow(0 0 6px ${r.criticalPathLight||"rgba(255,46,46,0.4)"})`}}),nt&&!Gt&&!e.segments&&!Le&&jsxRuntime.jsxs("g",{"data-parte":"icono-vencida",display:"none",style:{pointerEvents:"none"},transform:`translate(${St+_e+4}, ${a+se/2-6})`,children:[jsxRuntime.jsx("circle",{cx:6,cy:6,r:5.25,fill:"none",stroke:"currentColor",strokeWidth:1.5}),jsxRuntime.jsx("line",{x1:6,y1:3.5,x2:6,y2:6.5,stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:6,cy:8.6,r:.8,fill:"currentColor"})]}),!k&&!e.segments&&ie>0&&!Le&&jsxRuntime.jsx("rect",{x:St,y:a,width:Math.max(_e*(ie/100),Te*2),height:se,rx:Te,fill:Z,opacity:1,"data-parte":"avance",style:{pointerEvents:"none"}}),!k&&!e.segments&&!Le&&e.progress<100&&(()=>{let _=e.progress>0?_e*(e.progress/100):0,oe=St+_,S=_e-_,$=e.progress===0?Te:0,ee=e.progress===0?St:oe,ce=e.progress===0?_e:S;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:ee,y:a,width:ce,height:se,rx:$,fill:"url(#bar-remaining-hatch)","data-parte":"trama",style:{pointerEvents:"none"}}),jsxRuntime.jsx("rect",{x:ee,y:a,width:ce,height:se,rx:$,fill:"none",stroke:Z,strokeWidth:.8,strokeDasharray:"5 3","data-parte":"borde-restante",style:{pointerEvents:"none"}})]})})(),!k&&at&&!e.segments&&e.progress>0&&e.progress<100&&!Le&&!re&&Rt===null&&(()=>{let _=St+_e*(e.progress/100),oe=8,S=e.assignees?.[0];return jsxRuntime.jsxs("g",{"data-parte":"avatar",style:{pointerEvents:"none"},children:[jsxRuntime.jsx("circle",{cx:_,cy:a+se/2,r:oe,fill:S?.color||r.accent,stroke:"#000",strokeWidth:1.5}),jsxRuntime.jsx("text",{x:_,y:a+se/2,textAnchor:"middle",dominantBaseline:"central",fill:"#FFF",fontSize:"8",fontWeight:"600",fontFamily:"Inter, sans-serif",children:S?.initials||(S?.name?on(S.name):"")})]})})(),da&&!re&&_e>=40&&(Rt!==null||ie<88)&&(()=>{let _=St+_e*(ie/100),oe=a+se/2,S=Rt!==null,$=S?7:Ht?6:5,ee=S||Ht?1:k?0:.35,ce=St+_e-_,ue=Math.max(4,Math.min(12,ce-10)),pe=12;return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:_-pe,y:oe-12,width:pe+ue,height:24,fill:"transparent",style:{cursor:"ew-resize",touchAction:"none"},onPointerDown:Aa,onPointerMove:U,onPointerUp:T,onPointerCancel:T,onClick:G,onDoubleClick:G,onMouseDown:We=>We.stopPropagation()}),jsxRuntime.jsx("circle",{"data-parte":"asa-avance",cx:_,cy:oe,r:$,fill:"#FFFFFF",stroke:Z,strokeWidth:2,opacity:ee,style:{pointerEvents:"none",filter:S?`drop-shadow(0 0 4px ${Z})`:void 0,transition:"r 120ms ease, opacity 120ms ease"}}),S&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx("rect",{x:_-20,y:oe-28,width:40,height:18,rx:4,fill:X?"rgba(15, 15, 20, 0.95)":"rgba(255, 255, 255, 0.95)",stroke:Z,strokeWidth:1}),jsxRuntime.jsxs("text",{x:_,y:oe-16,textAnchor:"middle",dominantBaseline:"central",fill:X?"#FFFFFF":"#111111",fontSize:"11",fontWeight:"700",fontFamily:"'JetBrains Mono', monospace",children:[Rt,"%"]})]})]})})(),e.segments&&e.segments.map((_,oe)=>{let S=(_.startDate.getTime()-s.getTime())/864e5*o,ee=(_.endDate.getTime()-s.getTime())/(1e3*60*60*24)*o-S+o,ce=re&&V==="move"&&mt===oe,ue=Ut===oe,pe=ce?S+je:S;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!re&&Pt(oe),onMouseLeave:()=>!re&&Pt(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:pe,y:a,width:ee,height:se,rx:Te,fill:Z,initial:{opacity:0,scale:.95},animate:{opacity:ce||e.parentId?.6:ue?.9:.8,scale:ue&&!re?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:We=>{We.stopPropagation(),Dt(oe),jt(S),za(We,void 0,S);},style:{cursor:Ue,pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:pe,y:a,width:ee*(e.progress/100),height:se,rx:Te,fill:Z,opacity:1,style:{pointerEvents:"none"}})]},`segment-${oe}`)}),na&&(nt||ca)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[ca&&!nt&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:Te,fill:"none",stroke:r.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),nt&&jsxRuntime.jsx("rect",{x:St,y:a,width:_e,height:se,rx:Te,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),!k&&C&&_e>60&&!e.segments&&!(at&&Le)&&(()=>{let _=i.taskLabel(e),oe=typeof _=="string"?_:e.name,S=oe.length>Math.floor(_e/8)?`${oe.substring(0,Math.floor(_e/8))}...`:oe;return jsxRuntime.jsx("text",{"data-parte":"etiqueta",x:St+8,y:a+se/2,dominantBaseline:"middle",fill:Gt?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:Gt?"line-through":"none"},children:S})})(),!k&&!re&&!e.segments&&!Le&&e.progress>0&&e.progress<100&&(at?jsxRuntime.jsxs("text",{x:St+_e+6,y:a+se/2,dominantBaseline:"middle",fill:r.textSecondary,fontSize:"9",fontWeight:"500",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):_e>100?jsxRuntime.jsxs("text",{x:St+_e-12,y:a+se/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}):null),!k&&e.status&&_e>80&&!re&&!e.segments&&!(at&&Le)&&jsxRuntime.jsxs("g",{"data-parte":"insignia-estado",style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:St+_e-8,cy:a+8,r:4,fill:r.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:St+_e-8,cy:a+8,r:4,fill:r.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(Ht||ke)&&!Ce&&!e.segments&&!Le&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:St-2,y:a,width:16,height:se,fill:"transparent",style:{cursor:ut},onMouseEnter:()=>Ze("resize-start"),onMouseLeave:()=>Ze(null),onMouseDown:_=>{_.stopPropagation(),za(_,"resize-start");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:St+4,y:a+8,width:3,height:se-16,rx:1.5,fill:At==="resize-start"||V==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:St+_e-14,y:a,width:16,height:se,fill:"transparent",style:{cursor:ut},onMouseEnter:()=>Ze("resize-end"),onMouseLeave:()=>Ze(null),onMouseDown:_=>{_.stopPropagation(),za(_,"resize-end");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:St+_e-7,y:a+8,width:3,height:se-16,rx:1.5,fill:At==="resize-end"||V==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ht&&!re&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx("circle",{cx:t-10,cy:a+se/2,r:10,fill:"transparent",style:{cursor:"crosshair"},"data-conectar-desde":"inicio",onMouseEnter:()=>Ze("connect-start"),onMouseLeave:()=>Ze(null),onMouseDown:_=>{_.stopPropagation(),P.current=true,za(_,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t-10,cy:a+se/2,r:4,fill:r.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:At==="connect-start"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}}),jsxRuntime.jsx("circle",{cx:t+n+10,cy:a+se/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>Ze("connect"),onMouseLeave:()=>Ze(null),"data-conectar-desde":"fin",onMouseDown:_=>{_.stopPropagation(),P.current=false,za(_,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+n+10,cy:a+se/2,r:4,fill:r.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:At==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),Ce&&Je&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:P.current?t:t+n,y1:a+se/2,x2:Je.x,y2:Je.y,stroke:$t?r.statusCompleted:r.accent,strokeWidth:$t?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:$t?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:Je.x,cy:Je.y,r:$t?8:6,fill:$t?r.statusCompleted:r.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),$t&&jsxRuntime.jsx(framerMotion.motion.text,{x:Je.x+15,y:Je.y,dominantBaseline:"middle",fill:r.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:Je.x+10},animate:{opacity:1,x:Je.x+15},transition:{duration:.2},children:(()=>{let _=B;return {FS:_?"Fin \u2192 Comienzo":"Finish \u2192 Start",SS:_?"Comienzo \u2192 Comienzo":"Start \u2192 Start",FF:_?"Fin \u2192 Fin":"Finish \u2192 Finish",SF:_?"Comienzo \u2192 Fin":"Start \u2192 Finish"}[en($t)]})()})]}),(Ht||re)&&!Ce&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:St-1,y:a-1,width:_e+2,height:se+2,rx:Te+1,fill:"none",stroke:re?r.accent:at?"rgba(255,255,255,0.2)":r.taskBarPrimary,strokeWidth:at?1:2,opacity:re||at?.6:.4,initial:{opacity:0},animate:{opacity:re||at?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),ke&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:q,y1:0,x2:q,y2:1e3,stroke:r.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:q+we,y1:0,x2:q+we,y2:1e3,stroke:r.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ht&&!re&&!e.segments&&!w&&(()=>{let S=a<100,$=S?a+se+13:a-82-13,ee=S?`M ${St+_e/2-6} ${a+se+3} L ${St+_e/2} ${a+se+13} L ${St+_e/2+6} ${a+se+3}`:`M ${St+_e/2-6} ${a-13} L ${St+_e/2} ${a-3} L ${St+_e/2+6} ${a-13}`,ce=$+22,ue=$+40,pe=$+55,We=$+70,b=S?$+82-5:a-18;return jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:S?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:S?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:ee,fill:r.bgSecondary,stroke:r.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:St+_e/2-120,y:$,width:240,height:82,rx:8,fill:r.bgSecondary,stroke:r.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:St+_e/2,y:ce,textAnchor:"middle",fill:r.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:St+_e/2-110,y:ue,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Inicio:":"Start:"}),jsxRuntime.jsx("text",{x:St+_e/2-70,y:ue,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Fa(e.startDate)}),jsxRuntime.jsx("text",{x:St+_e/2-110,y:pe,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Fin:":"End:"}),jsxRuntime.jsx("text",{x:St+_e/2-70,y:pe,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Fa(e.endDate)}),jsxRuntime.jsx("text",{x:St+_e/2+10,y:ue,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Duraci\xF3n:":"Duration:"}),jsxRuntime.jsx("text",{x:St+_e/2+65,y:ue,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:Oa()}),jsxRuntime.jsx("text",{x:St+_e/2+10,y:pe,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Avance:":"Progress:"}),jsxRuntime.jsxs("text",{x:St+_e/2+65,y:pe,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:St+_e/2-110,y:We,fill:r.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:H?"Responsables:":"Assignees:"}),jsxRuntime.jsxs("text",{x:St+_e/2-50,y:We,fill:r.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(D=>D.name).join(", ").substring(0,30),e.assignees.map(D=>D.name).join(", ").length>30?"...":""]})]}),!S&&jsxRuntime.jsx("text",{x:St+_e/2,y:b,textAnchor:"middle",fill:r.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:Pa?H?"Izquierda: mover \u2022 Derecha: cambiar tama\xF1o":"Left: move \u2022 Right: resize":ra?H?"Arrastra para mover \u2022 ALT + arrastrar el borde para cambiar tama\xF1o":"Drag to move \u2022 Hold ALT + drag edge to resize":H?"Arrastra los bordes para cambiar tama\xF1o \u2022 el centro para mover \u2022 \u26AB para enlazar":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}function zi(e,t=new Date){return !e.endDate||e.status==="completed"||(e.progress??0)>=100?false:new Date(e.endDate.getFullYear(),e.endDate.getMonth(),e.endDate.getDate()).getTime()<new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function Eh(e,t=new Date){let a=0,n=r=>{for(let o of r??[])o.subtasks?.length?n(o.subtasks):zi(o,t)&&a++;};return n(e.subtasks),a}var Pm=260,Nl=8,Mh=16,cT=-12;function Ph({tooltipData:e,theme:t,locale:a="en",workingDaysConfig:n}){let[r,o]=react.useState(null);if(react.useLayoutEffect(()=>{if(!e){o(null);return}let{task:x,mouseX:I,mouseY:M}=e,L=x.effortMinutes!=null||x.timeLoggedMinutes!=null||x.soldEffortMinutes!=null,F=x.lastActivity!=null,H=(L?155:105)+(F?28:0),z=I+Mh,Y=M+cT-H;z+Pm>window.innerWidth-Nl&&(z=I-Pm-Mh),z<Nl&&(z=Nl);let P=Y<Nl;P&&(Y=M+20),Y+H>window.innerHeight-Nl&&(Y=window.innerHeight-Nl-H),o({left:z,top:Y,showBelow:P});},[e]),!e||!r)return null;let{task:s}=e,i=s.effortMinutes!=null||s.timeLoggedMinutes!=null||s.soldEffortMinutes!=null,d={start:a==="es"?"Inicio":"Start",end:a==="es"?"Fin":"End",duration:a==="es"?"Duraci\xF3n":"Duration",progress:a==="es"?"Progreso":"Progress",status:a==="es"?"Estado":"Status",terminarEl:a==="es"?"Terminar el":"Finish by",noAntesDe:a==="es"?"No antes de":"Not before",baselineEnd:a==="es"?"Fin L. base":"Baseline end",variance:a==="es"?"Variaci\xF3n":"Variance",slack:a==="es"?"Holgura":"Slack",assignees:a==="es"?"Asignados":"Assignees",estimated:a==="es"?"Estimado":"Estimated",logged:a==="es"?"Registrado":"Logged",quoted:a==="es"?"Ofertado":"Quoted",tags:a==="es"?"Etiqueta":"Tag"},l=x=>x.toLocaleDateString(a==="es"?"es-ES":"en-US",{month:"short",day:"numeric",year:"numeric"}),p=()=>{if(!s.startDate||!s.endDate)return "N/A";if(!n?.enabledWeekdays){let Y=Math.max(1,Math.round((s.endDate.getTime()-s.startDate.getTime())/864e5)+1);return a==="es"?`${Y} d\xEDa${Y!==1?"s":""}`:`${Y} day${Y!==1?"s":""}`}let x=n.enabledWeekdays,I=n.holidayDates instanceof Set?n.holidayDates:new Set(n.holidayDates??[]),M=Y=>`${Y.getFullYear()}-${String(Y.getMonth()+1).padStart(2,"0")}-${String(Y.getDate()).padStart(2,"0")}`,L=0,F=new Date(s.startDate.getFullYear(),s.startDate.getMonth(),s.startDate.getDate()),H=new Date(s.endDate.getFullYear(),s.endDate.getMonth(),s.endDate.getDate());for(;F.getTime()<=H.getTime();){let Y=F.getDay();x[Y]&&!I.has(M(F))&&L++,F.setDate(F.getDate()+1);}let z=Math.max(0,L);return a==="es"?`${z} d\xEDa${z!==1?"s":""}`:`${z} day${z!==1?"s":""}`},c=x=>{if(x==null||x===0)return "N/A";let I=Math.floor(x/60),M=x%60;return I===0?`${M}m`:M===0?`${I}h`:`${I}h ${M}m`},u=Xc(s,Ur(n)),g=s.status==="completed"||s.progress>=100,h=a==="es"?g?"Completada":zi(s)?"Vencida":s.progress>0||s.status==="in-progress"?"En progreso":"Por hacer":g?"Completed":zi(s)?"Overdue":s.progress>0||s.status==="in-progress"?"In progress":"To do",w=t.textTertiary||"#9CA3AF",f=t.textSecondary||"#D1D5DB",C=t.textPrimary||"#F9FAFB",y=t.accent||"#00E5CC",N=t.bgSecondary||"#1F2937",m=t.border||"#374151",k=jsxRuntime.jsxs("div",{style:{position:"fixed",left:r.left,top:r.top,width:Pm,zIndex:99999,pointerEvents:"none",fontFamily:"Inter, system-ui, sans-serif",animation:"gantt-tooltip-fade 0.12s ease-out"},children:[jsxRuntime.jsxs("div",{style:{background:N,border:`1px solid ${m}`,borderRadius:8,padding:"12px 14px",boxShadow:"0 8px 24px rgba(0,0,0,0.3)"},children:[jsxRuntime.jsx("div",{style:{fontSize:13,fontWeight:600,color:C,marginBottom:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.name}),jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"3px 12px",fontSize:11},children:[jsxRuntime.jsx(ms,{label:d.start,value:s.startDate?l(s.startDate):"N/A",labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.duration,value:p(),labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.end,value:s.endDate?l(s.endDate):"N/A",labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.progress,value:`${s.progress}%`,labelColor:w,valueColor:f}),jsxRuntime.jsx(ms,{label:d.status,value:h,labelColor:w,valueColor:f}),s.cpmData&&!s.subtasks?.length&&jsxRuntime.jsx(ms,{label:d.slack,value:`${s.cpmData.totalFloat} d`,labelColor:w,valueColor:f}),s.terminarEl&&jsxRuntime.jsx(ms,{label:d.terminarEl,value:l(s.terminarEl),labelColor:w,valueColor:f}),s.noAntesDe&&jsxRuntime.jsx(ms,{label:d.noAntesDe,value:l(s.noAntesDe),labelColor:w,valueColor:f}),s.baselineEndDate&&jsxRuntime.jsx(ms,{label:d.baselineEnd,value:l(s.baselineEndDate),labelColor:w,valueColor:f}),u!==null&&jsxRuntime.jsx(ms,{label:d.variance,value:`${u>0?"+":""}${u} d`,labelColor:w,valueColor:f})]}),s.assignees&&s.assignees.length>0&&jsxRuntime.jsxs("div",{style:{fontSize:11,marginTop:6},children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.assignees,": "]}),jsxRuntime.jsx("span",{style:{color:f,fontWeight:500},children:s.assignees.map(x=>x.name).join(", ")})]}),s.tags&&s.tags.length>0&&jsxRuntime.jsxs("div",{style:{marginTop:6,fontSize:11},children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.tags,": "]}),jsxRuntime.jsx("span",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,verticalAlign:"middle"},children:s.tags.map(x=>jsxRuntime.jsx("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:10,fontWeight:600,backgroundColor:`${x.color}22`,color:x.color,border:`1px solid ${x.color}55`,whiteSpace:"nowrap"},children:x.name},x.id))})]}),i&&jsxRuntime.jsxs("div",{style:{marginTop:6,display:"flex",gap:10,fontSize:11},children:[s.effortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.estimated,":"]})," ",jsxRuntime.jsx("span",{style:{color:f,fontWeight:600},children:c(s.effortMinutes)})]}),s.timeLoggedMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.logged,":"]})," ",jsxRuntime.jsx("span",{style:{color:y,fontWeight:600},children:c(s.timeLoggedMinutes)})]}),s.soldEffortMinutes!=null&&jsxRuntime.jsxs("span",{children:[jsxRuntime.jsxs("span",{style:{color:w},children:[d.quoted,":"]})," ",jsxRuntime.jsx("span",{style:{color:f,fontWeight:600},children:c(s.soldEffortMinutes)})]})]}),s.lastActivity&&jsxRuntime.jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${t?.borderSubtle||"rgba(255,255,255,0.08)"}`,fontSize:11,color:w,lineHeight:1.4},children:[jsxRuntime.jsx("span",{style:{opacity:.7},children:a==="es"?"\xDAltimo: ":"Last: "}),jsxRuntime.jsx("span",{style:{color:f},children:s.lastActivity.userName})," ",jsxRuntime.jsx("span",{children:s.lastActivity.summary})," ",jsxRuntime.jsx("span",{style:{opacity:.6},children:s.lastActivity.relativeTime})]})]}),jsxRuntime.jsx("style",{children:`
|
|
126
126
|
@keyframes gantt-tooltip-fade {
|
|
127
127
|
from { opacity: 0; transform: translateY(${r.showBelow?"-4px":"4px"}); }
|
|
128
128
|
to { opacity: 1; transform: translateY(0); }
|