@libxai/board 1.5.90 → 1.5.92
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.js
CHANGED
|
@@ -430,7 +430,7 @@ Total: ${Ka(p)}`:`Executed breakdown:
|
|
|
430
430
|
\xB7 Equipment: ${Ka(f)}
|
|
431
431
|
\xB7 Travel: ${Ka(b)}
|
|
432
432
|
\u2500\u2500\u2500
|
|
433
|
-
Total: ${Ka(p)}`:void 0;return jsxs("div",{className:u("flex items-center justify-between",w&&"cursor-help"),title:C,children:[jsxs("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:[n?"Ejecutado":"Executed",w&&jsx("span",{className:"ml-1 opacity-50",children:"\u24D8"})]}),jsx("span",{className:u("text-[11px] font-mono font-bold",y?"text-[#F87171]":t?"text-white/80":"text-gray-800"),children:Ka(p)})]})})(),c>0&&jsx("div",{className:u("w-full h-2.5 rounded-full overflow-hidden mt-2",t?"bg-white/[0.06]":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(g,100)}%`,backgroundColor:x}})}),jsxs("div",{className:u("mt-2 px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",d>=0?t?"bg-[#00E5CC]/10 text-[#00E5CC]":"bg-emerald-50 text-emerald-600":t?"bg-[#F87171]/10 text-[#F87171]":"bg-red-50 text-red-600"),children:[d>=0?`+${Ka(d)} ${n?"Disp.":"Avail."}`:`${Ka(Math.abs(d))} ${n?"P\xE9rdida":"Loss"}`,c>0&&jsxs("span",{className:"text-[10px] ml-1 opacity-60",children:["(",m,"%)"]})]})]})]})})(),(e.totalHoursSpentMinutes!==void 0||e.totalHoursAllocatedMinutes!==void 0)&&(()=>{let c=e.totalHoursSpentMinutes??0,i=e.totalHoursAllocatedMinutes??0,p=i>0?Math.min(Math.round(c/i*100),100):0,g=(i>0?c/i:0)>1.1?"#F87171":p>=90?"#FFD60A":"#3BF06E";return jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"HORAS DEL PROYECTO":"PROJECT HOURS"}),jsxs("div",{className:"space-y-2",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"Usado":"Spent"}),jsx("span",{className:u("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:jg(c)})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"Asignado":"Allocated"}),jsx("span",{className:u("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:jg(i)})]}),i>0&&jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden mt-1",t?"bg-white/[0.06]":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${p}%`,backgroundColor:g}})})]})]})})(),(e.openRFIs!==void 0||e.submittalsApprovalPercent!==void 0)&&jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"SALUD T\xC9CNICA":"TECHNICAL HEALTH"}),jsxs("div",{className:"space-y-3",children:[e.openRFIs!==void 0&&jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"RFIs Abiertos":"Open RFIs"}),jsx("span",{className:u("px-2 py-0.5 rounded text-[11px] font-mono font-bold",e.openRFIs>0?"bg-[#F87171]/15 text-[#F87171]":"bg-[#3BF06E]/15 text-[#3BF06E]"),children:e.openRFIs})]}),e.submittalsApprovalPercent!==void 0&&jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"Aprobaci\xF3n Submittals":"Submittals Approval"}),jsxs("span",{className:u("text-[11px] font-mono font-bold",e.submittalsApprovalPercent>=80?"text-[#3BF06E]":"text-[#FFD60A]"),children:[e.submittalsApprovalPercent,"%"]})]})]})]}),e.unassignedCount!=null&&e.unassignedCount>0&&jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"TAREAS SIN ASIGNAR":"UNASSIGNED TASKS"}),jsxs("div",{className:"flex items-center gap-3 mb-3",children:[jsx("div",{className:u("flex items-center justify-center w-10 h-10 rounded-lg font-mono text-lg font-bold",e.unassignedCount>=10?"bg-[#F87171]/15 text-[#F87171]":"bg-[#FFD60A]/15 text-[#FFD60A]"),children:e.unassignedCount}),jsxs("div",{children:[jsx("p",{className:u("text-xs font-medium",t?"text-white/80":"text-gray-700"),children:e.unassignedCount===1?n?"tarea pendiente":"pending task":n?"tareas pendientes":"pending tasks"}),jsx("p",{className:u("text-[10px]",t?"text-white/40":"text-gray-400"),children:n?"sin recurso asignado":"without assigned resource"})]})]}),e.unassignedTasks&&e.unassignedTasks.length>0&&jsx("div",{className:u("space-y-1.5 overflow-y-auto scrollbar-slim",e.unassignedTasks.length>5?"max-h-[170px]":""),children:e.unassignedTasks.map(c=>jsxs("button",{onClick:()=>s?.(c.id),className:u("flex items-center gap-2 px-2.5 py-1.5 rounded-md text-[11px] w-full text-left transition-colors",t?"bg-white/[0.04] text-white/70 hover:bg-white/[0.08] hover:text-white":"bg-gray-50 text-gray-600 hover:bg-gray-100 hover:text-gray-900",s&&"cursor-pointer"),children:[jsx("span",{className:u("w-1.5 h-1.5 rounded-full flex-shrink-0",(e.unassignedCount??0)>=10?"bg-[#F87171]":"bg-[#FFD60A]")}),jsx("span",{className:"truncate",children:c.name})]},c.id))})]}),e.scheduleVarianceDays!==void 0&&jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:n?"VARIACI\xD3N DE CRONOGRAMA":"SCHEDULE VARIANCE"}),(()=>{let c=e.scheduleVarianceDays??0,i=c>0,p=c<0,d=e.scheduleVarianceLabel||(i?`+${c} ${n?"D\xEDas ADELANTE":"Days AHEAD"}`:p?`${c} ${n?"D\xEDas ATR\xC1S":"Days BEHIND"}`:n?"EN TIEMPO":"ON TRACK");return jsx("div",{className:u("px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",i&&"bg-[#3BF06E]/15 text-[#3BF06E]",p&&"bg-[#F87171]/15 text-[#F87171]",!i&&!p&&"bg-[#3B9EFF]/15 text-[#3B9EFF]"),children:d})})()]}),e.teams&&e.teams.length>0&&jsxs("div",{className:"px-5 py-4",children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"DISPONIBILIDAD DEL EQUIPO":"TEAM AVAILABILITY"}),jsx("div",{className:"space-y-3",children:e.teams.map((c,i)=>{let p=c.utilizationPercent>=100?"#F87171":c.utilizationPercent>=80?"#FFD60A":c.color||"#3BF06E";return jsxs("div",{children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:c.name}),jsxs("span",{className:u("text-[10px] font-mono",t?"text-white/40":"text-gray-500"),children:[c.utilizationPercent,"%"]})]}),jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden",t?"bg-white/[0.06]":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(c.utilizationPercent,100)}%`,backgroundColor:p}})})]},`${c.name}-${i}`)})})]})]})}var lw=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function Zg(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...Zg(r.subtasks,t+1));return a}function dw(e){let t=e.subtasks;if(!t?.length)return null;let a=new Date,r=0,o=0;for(let s of t){if(!s.startDate||!s.endDate)continue;let n=s.startDate.getTime(),c=s.endDate.getTime()-n;if(c<=0)continue;let p=Math.max(0,Math.min(a.getTime()-n,c))/c*100;if(p<=0)continue;let d=(s.progress||0)/p;r+=d,o++;}return o>0?r/o:null}function Xn(e){if(!e.subtasks?.length)return {spent:0,allocated:0,quoted:0};let t=0,a=0,r=0;for(let o of e.subtasks)if(o.subtasks?.length){let s=Xn(o);t+=s.spent>0?s.spent:o.timeLoggedMinutes??0,a+=s.allocated>0?s.allocated:o.effortMinutes??0,r+=s.quoted>0?s.quoted:o.soldEffortMinutes??0;}else t+=o.timeLoggedMinutes??0,a+=o.effortMinutes??0,r+=o.soldEffortMinutes??0;return {spent:t,allocated:a,quoted:r}}function Yn(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function cw({value:e,onChange:t,isDark:a}){let[r,o]=useState(false),[s,n]=useState(String(e||""));return r?jsx("input",{autoFocus:true,type:"text",inputMode:"decimal",value:s,onClick:l=>l.stopPropagation(),onChange:l=>n(l.target.value.replace(/[^0-9.]/g,"")),onBlur:()=>{let l=parseFloat(s);!isNaN(l)&&l>=0&&l<=100?t(l):s===""&&t(0),o(false);},onKeyDown:l=>{l.key==="Enter"&&l.target.blur(),l.key==="Escape"&&(n(String(e||"")),o(false));},className:u("w-14 text-xs text-right font-mono px-1 py-0.5 rounded border outline-none",a?"bg-white/5 border-[#00E5CC]/50 text-white":"bg-gray-50 border-blue-400 text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"}}):jsx("button",{onClick:l=>{l.stopPropagation(),n(String(e||"")),o(true);},className:u("text-xs font-mono cursor-pointer hover:underline",e>0?a?"text-white/80":"text-gray-700":a?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:e>0?`${e}%`:"\u2014"})}function Jg(e){if(e.length===0)return 0;let t=0,a=0,r=0,o=0;for(let c of e){let i=c.weight||0;i>0&&(t+=(c.progress||0)*i,a+=i,r+=1),o+=c.progress||0;}let s=r/e.length,l=a>=99&&s>=.95?t/a:o/e.length;return Math.round(l*10)/10}function uc(e,t=[]){for(let a of e)a.subtasks&&a.subtasks.length>0?uc(a.subtasks,t):t.push({progress:a.progress||0,weight:a.weight||0});return t}function e0({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:l=[],customFields:c=[],toolbarRightContent:i}){let{theme:p="dark",locale:d="en",customTranslations:m,showSearch:g=true,showHierarchy:y=true,tableColumns:x,allowColumnCustomization:h=true,allowColumnResize:f=true,enableContextMenu:b=true,showCreateTaskButton:w=false,onCreateTask:C,persistFilter:S=false,financialBlur:E,healthSidebar:k,lens:v="hours",hourlyRate:P=0,rateMap:L,aggregateParentHours:M=false,showProjectTotals:J=false,totalsDollarOverride:H}=t,Y=Vi(d,m),T=p==="dark",G=F=>{if(!L||!F.assignees||F.assignees.length===0)return P;let se=0,Ce=0;for(let Re of F.assignees){let tt=Re.id?L[Re.id]:void 0;if(tt==null||tt<=0)continue;let me=typeof Re.estimatedMinutes=="number"?Re.estimatedMinutes:0;me>0&&(se+=tt*me,Ce+=me);}if(Ce>0)return se/Ce;let ve=F.assignees.map(Re=>Re.id?L[Re.id]:void 0).filter(Re=>Re!=null&&Re>0);return ve.length===0?P:ve.reduce((Re,tt)=>Re+tt,0)/ve.length},te=F=>{let se=0,Ce=0,ve=0,Re=tt=>{for(let me of tt)if(me.subtasks&&me.subtasks.length>0){let Ke={s:se,a:Ce,q:ve};if(Re(me.subtasks),se-Ke.s+(Ce-Ke.a)+(ve-Ke.q)===0){let yt=G(me);se+=(me.timeLoggedMinutes??0)/60*yt,Ce+=(me.effortMinutes??0)/60*yt,ve+=(me.soldEffortMinutes??0)/60*yt;}}else {let Ke=G(me);se+=(me.timeLoggedMinutes??0)/60*Ke,Ce+=(me.effortMinutes??0)/60*Ke,ve+=(me.soldEffortMinutes??0)/60*Ke;}};return F.subtasks&&Re(F.subtasks),{dollarSpent:se,dollarAllocated:Ce,dollarQuoted:ve}},Le=useCallback(()=>{if(!S||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let F=localStorage.getItem(S);if(F){let se=JSON.parse(F);return {statusFilter:se.statusFilter||"all",hideCompleted:se.hideCompleted||!1}}}catch(F){console.error("Error loading persisted filter:",F);}return {statusFilter:"all",hideCompleted:false}},[S]),B=useMemo(()=>{function F(se){let Ce=0,ve=0,Re=0,tt=0,me=0,Ke=0;for(let Ze of se)if(Ze.subtasks&&Ze.subtasks.length>0){let yt=F(Ze.subtasks);if(yt.spent+yt.allocated+yt.quoted>0)Ce+=yt.spent,ve+=yt.allocated,Re+=yt.quoted,tt+=yt.dollarSpent,me+=yt.dollarAllocated,Ke+=yt.dollarQuoted;else {let jt=Ze.timeLoggedMinutes??0,Ut=Ze.effortMinutes??0,na=Ze.soldEffortMinutes??0;Ce+=jt,ve+=Ut,Re+=na;let _t=G(Ze);tt+=jt/60*_t,me+=Ut/60*_t,Ke+=na/60*_t;}}else {let yt=Ze.timeLoggedMinutes??0,oa=Ze.effortMinutes??0,jt=Ze.soldEffortMinutes??0;Ce+=yt,ve+=oa,Re+=jt;let Ut=G(Ze);tt+=yt/60*Ut,me+=oa/60*Ut,Ke+=jt/60*Ut;}return {spent:Ce,allocated:ve,quoted:Re,dollarSpent:tt,dollarAllocated:me,dollarQuoted:Ke}}return F(e)},[e]),q=useMemo(()=>{let F=new Map;function se(Ce){let ve=0;for(let Re of Ce)if(Re.subtasks&&Re.subtasks.length>0){let tt=se(Re.subtasks);F.set(Re.id,tt),ve+=tt;}else ve+=Re.weight||0;return ve}return se(e),F},[e]),be=useMemo(()=>!k?.enabled||!k.data?k:{...k,data:{...k.data,totalHoursSpentMinutes:B.spent,totalHoursAllocatedMinutes:B.allocated}},[k,B]),[_e,$]=useState(true),[ee,le]=useState(null),[ke,xe]=useState("position"),[Be,He]=useState("asc"),[at,ue]=useState(""),[je,Xe]=useState(()=>Le().statusFilter),[he,kt]=useState(()=>Le().hideCompleted),[xt,nt]=useState(x||lw),[ze,ct]=useState(false),[et,Ee]=useState(false),[V,D]=useState({isOpen:false,x:0,y:0,type:"task"}),[U,ae]=useState(null),[Ne,z]=useState(false),[oe,Ge]=useState(null),[ge,Ve]=useState(null),[Oe,Ue]=useState(null),lt=useRef(0),ot=useRef(false),st=!!(a.onTaskMove||a.onTaskReparent),pt=useCallback((F,se)=>{st&&(se.preventDefault(),lt.current=se.clientY,ae(F),ot.current=false,z(false),Ue({x:se.clientX,y:se.clientY}));},[st]),Tt=useCallback(F=>{if(!U||(Math.abs(F.clientY-lt.current)>5&&!ot.current&&(ot.current=true,z(true)),Ue({x:F.clientX,y:F.clientY}),!ot.current))return;let Ce=document.querySelectorAll("[data-listview-row]"),ve=null,Re=null;Ce.forEach(tt=>{let me=tt.getBoundingClientRect(),Ke=tt.getAttribute("data-listview-row");if(Ke&&Ke!==U&&F.clientY>=me.top&&F.clientY<=me.bottom){ve=Ke;let Ze=F.clientY-me.top,yt=me.height;Re=Ze<yt*.25?"above":Ze>yt*.75?"below":"child";}}),Ge(ve),Ve(Re);},[U]),Ot=useCallback(()=>{if(ot.current&&U&&oe&&ge){if(ge==="child"&&a.onTaskReparent)a.onTaskReparent(U,oe);else if(ge==="above"||ge==="below"){let F=(ve,Re,tt=null)=>{for(let me of ve){if(me.id===Re)return tt;if(me.subtasks){let Ke=F(me.subtasks,Re,me.id);if(Ke!==void 0)return Ke}}},se=F(e,U,null),Ce=F(e,oe,null);if(a.onTaskReparent){let ve=(yt,oa)=>{if(oa===null)return yt;for(let jt of yt){if(jt.id===oa)return jt.subtasks||[];if(jt.subtasks){let Ut=ve(jt.subtasks,oa);if(Ut.length>0||jt.subtasks.some(na=>na.id===oa))return Ut}}return []},Re=ve(e,Ce??null),tt=Re.findIndex(yt=>yt.id===oe),me=se===Ce,Ke=me?Re.findIndex(yt=>yt.id===U):-1,Ze=ge==="below"?tt+1:tt;me&&Ke!==-1&&Ke<tt&&(Ze-=1),a.onTaskReparent(U,Ce??null,Math.max(0,Ze));}}}ae(null),Ge(null),Ve(null),Ue(null),ot.current=false,z(false);},[U,oe,ge,e,a]);useEffect(()=>{if(U)return document.addEventListener("mousemove",Tt),document.addEventListener("mouseup",Ot),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",Tt),document.removeEventListener("mouseup",Ot),document.body.style.cursor="",document.body.style.userSelect="";}},[U,Tt,Ot]);let[St,Et]=useState("all"),[Ft,mt]=useState(false),Vt=useRef(null),ht=useRef(null),it=useMemo(()=>{let F=0;function se(Ce,ve){for(let Re of Ce)ve>F&&(F=ve),Re.subtasks?.length&&se(Re.subtasks,ve+1);}return se(e,1),F},[e]);useEffect(()=>{if(!Ft)return;let F=se=>{Vt.current?.contains(se.target)||ht.current?.contains(se.target)||mt(false);};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[Ft]),useEffect(()=>{if(St==="all"){let Ce=function(ve){for(let Re of ve)Re.subtasks?.length&&(Re.isExpanded===false&&a.onTaskToggleExpand?.(Re.id),Ce(Re.subtasks));};Ce(e);}else {let Ce=function(ve,Re){for(let tt of ve)if(tt.subtasks?.length){let me=Re<St,Ke=tt.isExpanded!==false;me!==Ke&&a.onTaskToggleExpand?.(tt.id),Ce(tt.subtasks,Re+1);}};Ce(e,1);}},[St]);let[ne,pe]=useState(null),[O,_]=useState(0),[De,Qe]=useState(0),bt=useRef(null),[Dt,Pt]=useState(null),[At,ta]=useState(null);useEffect(()=>{x&&nt(F=>{if(F.length===x.length){let se=true;for(let Ce=0;Ce<F.length;Ce++){let ve=F[Ce],Re=x[Ce];if(!ve||!Re||ve.id!==Re.id||ve.visible!==Re.visible||ve.width!==Re.width||ve.label!==Re.label){se=false;break}}if(se)return F}return x});},[x]),useEffect(()=>{if(!(!S||typeof window>"u"))try{localStorage.setItem(S,JSON.stringify({statusFilter:je,hideCompleted:he}));}catch(F){console.error("Error persisting filter state:",F);}},[S,je,he]);let la=useMemo(()=>{let F=new Set;function se(Ce){for(let ve of Ce)ve.subtasks?.length&&(ve.isExpanded!==false&&F.add(ve.id),se(ve.subtasks));}return se(e),F},[e]),Q=useMemo(()=>xt.filter(F=>F.visible),[xt]),$e=useCallback(F=>{a.onTaskToggleExpand?.(F);},[a]),Fe=useCallback(F=>{ke===F?He(se=>se==="asc"?"desc":"asc"):(xe(F),He("asc")),a.onSortChange?.({column:F,direction:Be==="asc"?"desc":"asc"});},[ke,Be,a]),I=useCallback(F=>{nt(F),a.onColumnsChange?.(F);},[a]),ye=useCallback(F=>{let se=xt.map(Ce=>Ce.id===F?{...Ce,visible:false}:Ce);I(se);},[xt,I]),Z=useCallback((F,se)=>{xe(F),He(se);},[]),N=useCallback((F,se,Ce)=>{b&&(F.preventDefault(),D({isOpen:true,x:F.clientX,y:F.clientY,type:se?"task":"header",task:se,columnId:Ce}));},[b]),K=useCallback(()=>{D(F=>({...F,isOpen:false}));},[]),Te=useCallback((F,se)=>{if(!f)return;F.preventDefault(),F.stopPropagation();let Ce=xt.find(ve=>ve.id===se);Ce&&(pe(se),_(F.clientX),Qe(Ce.width));},[xt,f]);useEffect(()=>{if(!ne)return;let F=xt,se=ve=>{let Re=ve.clientX-O,tt=Math.max(50,De+Re);F=F.map(me=>me.id===ne?{...me,width:tt}:me),nt(F);},Ce=()=>{a.onColumnsChange?.(F),pe(null);};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",Ce);}},[ne,O,De,a]);let Pe=useCallback((F,se)=>{if(se==="name"){F.preventDefault();return}Pt(se),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",se),F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="0.5");},[]),$t=useCallback(F=>{F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="1"),Pt(null),ta(null);},[]),Ct=useCallback((F,se)=>{F.preventDefault(),se!=="name"&&(F.dataTransfer.dropEffect="move",ta(se));},[]),Jt=useCallback(()=>{ta(null);},[]),Wa=useCallback((F,se)=>{if(F.preventDefault(),!Dt||Dt===se||se==="name")return;let Ce=[...xt],ve=Ce.findIndex(me=>me.id===Dt),Re=Ce.findIndex(me=>me.id===se);if(ve===-1||Re===-1)return;let tt=Ce.splice(ve,1);tt[0]&&(Ce.splice(Re,0,tt[0]),I(Ce),Pt(null),ta(null));},[Dt,xt,I]),ya=useCallback(async F=>{if(a.onCreateCustomField){let se={...F,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(se);}Ee(false);},[a]),wa=useCallback(F=>F.progress===100||F.status==="completed"?"completed":F.progress&&F.progress>0||F.status==="in-progress"?"in-progress":"todo",[]),dr=useMemo(()=>{let F=Zg(e);if(at.trim()){let se=at.toLowerCase();F=F.filter(Ce=>Ce.name.toLowerCase().includes(se));}return je!=="all"&&(F=F.filter(se=>wa(se)===je)),he&&(F=F.filter(se=>wa(se)!=="completed")),F.sort((se,Ce)=>{let ve,Re;switch(ke){case "name":ve=se.name.toLowerCase(),Re=Ce.name.toLowerCase();break;case "startDate":ve=se.startDate?.getTime()||0,Re=Ce.startDate?.getTime()||0;break;case "endDate":ve=se.endDate?.getTime()||0,Re=Ce.endDate?.getTime()||0;break;case "progress":ve=se.progress||0,Re=Ce.progress||0;break;case "status":ve=se.status||"todo",Re=Ce.status||"todo";break;case "priority":let tt={urgent:0,high:1,medium:2,low:3,none:4};ve=tt[se.priority]??4,Re=tt[Ce.priority]??4;break;case "position":return 0;default:return 0}return ve<Re?Be==="asc"?-1:1:ve>Re?Be==="asc"?1:-1:0}),F},[e,at,je,he,ke,Be,wa]),Ar=useCallback((F,se)=>{let Ce=tt=>{a.onTaskUpdate?.({...F,...tt});},ve=tt=>tt?F.customFields?.find(Ke=>Ke.fieldId===tt)?.value:void 0,Re=(tt,me)=>{if(!tt)return;let Ze=[...F.customFields||[]],yt=Ze.findIndex(oa=>oa.fieldId===tt);yt>=0?Ze[yt]={fieldId:tt,value:me}:Ze.push({fieldId:tt,value:me}),Ce({customFields:Ze});};switch(se.type){case "name":return null;case "status":return jsx(Wm,{value:F.status||(F.progress===100?"completed":F.progress&&F.progress>0?"in-progress":"todo"),onChange:me=>{Ce({status:me,progress:me==="completed"?100:me==="in-progress"?50:0});},isDark:T,locale:d,translations:Y.status});case "priority":return jsx(Gm,{value:F.priority,onChange:me=>Ce({priority:me}),isDark:T,locale:d});case "assignees":{let me=F.hasChildren,Ke=F.assignees||[];if(me&&F.subtasks?.length){let Ze=new Map,yt=oa=>{(oa||[]).forEach(jt=>{(jt.assignees||[]).forEach(Ut=>{Ze.has(Ut.name)||Ze.set(Ut.name,Ut);}),jt.subtasks?.length&&yt(jt.subtasks);});};yt(F.subtasks),Ke=Array.from(Ze.values());}else me&&(Ke=[]);return jsx(qd,{value:Ke,availableUsers:l,onChange:Ze=>Ce({assignees:Ze}),isDark:T,locale:d,disabled:me})}case "startDate":return jsx(_i,{value:F.startDate,onChange:me=>Ce({startDate:me}),isDark:T,locale:d,dateField:"start",startDate:F.startDate,endDate:F.endDate});case "endDate":return jsx(_i,{value:F.endDate,onChange:me=>Ce({endDate:me}),isDark:T,locale:d,dateField:"end",startDate:F.startDate,endDate:F.endDate});case "progress":{let me=!!(F.subtasks&&F.subtasks.length>0),Ke=me?Jg(uc(F.subtasks||[])):F.progress||0;return jsx(Zm,{value:Ke,onChange:me?void 0:Ze=>{let yt=Ze===100?"completed":Ze>0?"in-progress":"todo";Ce({progress:Ze,status:yt});},isDark:T,disabled:me})}case "tags":return jsx(ug,{value:F.tags||[],isDark:T});case "text":return jsx(ag,{value:ve(se.customFieldId)||"",onChange:me=>Re(se.customFieldId,me),isDark:T});case "number":return jsx(ng,{value:ve(se.customFieldId)||0,onChange:me=>Re(se.customFieldId,me),isDark:T});case "date":let tt=ve(se.customFieldId);return jsx(_i,{value:tt?new Date(tt):void 0,onChange:me=>Re(se.customFieldId,me),isDark:T,locale:d});case "dropdown":return jsx(sg,{value:ve(se.customFieldId)||"",options:se.options||[],onChange:me=>Re(se.customFieldId,me),isDark:T});case "checkbox":return jsx(lg,{value:ve(se.customFieldId)||false,onChange:me=>Re(se.customFieldId,me),isDark:T});case "estimatedTime":{let me=F.status==="completed"||F.progress===100;return jsx(Dr,{value:F.estimatedTime,onChange:Ke=>Ce({estimatedTime:Ke}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F)})}case "quotedTime":{let me=F.status==="completed"||F.progress===100,Ke=E?.enabled&&(!E.columns||E.columns.includes("quotedTime"));return jsx(Dr,{value:F.quotedTime,onChange:Ze=>Ce({quotedTime:Ze}),isDark:T,locale:d,disabled:me,isBlurred:Ke,lens:v,hourlyRate:G(F)})}case "elapsedTime":{let me=F.status==="completed"||F.progress===100,Ke=F.executedDollarsCanonical;return jsx(Dr,{value:F.elapsedTime,onChange:Ze=>Ce({elapsedTime:Ze}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F),financialOverride:Ke})}case "effortMinutes":{if(M&&F.subtasks&&F.subtasks.length>0){let{allocated:oa}=Xn(F);if(v==="financial"){let jt=te(F),Ut=Math.round(jt.dollarAllocated),na=Math.round(jt.dollarQuoted),_t=na-Ut;return jsxs("div",{className:"flex flex-col",children:[Ut>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",Ut.toLocaleString("es-CO")]}):null,_t!==0&&Ut>0&&na>0&&jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",_t>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[_t>0?"+":"",Math.abs(_t)>=1e3?`$${(_t/1e3).toFixed(1)}K`:`$${_t}`]})]})}return jsx(Dr,{value:oa>0?oa:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:P})}let me=F.status==="completed"||F.progress===100,Ke=F.effortMinutes||0,Ze=F.soldEffortMinutes||0,yt=G(F);if(v==="financial"&&yt&&Ke>0&&Ze>0){let oa=Math.round(Ke/60*yt),Ut=Math.round(Ze/60*yt)-oa;return jsxs("div",{className:"flex flex-col",children:[jsx(Dr,{value:Ke,onChange:na=>Ce({effortMinutes:na}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F)}),Ut!==0&&jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Ut>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Ut>0?"+":"",Math.abs(Ut)>=1e3?`$${(Ut/1e3).toFixed(1)}K`:`$${Ut}`]})]})}return jsx(Dr,{value:Ke,onChange:oa=>Ce({effortMinutes:oa}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F)})}case "timeLoggedMinutes":{let me=F.executedDollarsCanonical;if(M&&F.subtasks&&F.subtasks.length>0){let{spent:Ze}=Xn(F);return jsx(Dr,{value:Ze>0?Ze:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F),financialOverride:me})}let Ke=F.status==="completed"||F.progress===100;return jsx(Dr,{value:F.timeLoggedMinutes,onChange:a.onLogTime?Ze=>{a.onLogTime?.(F,Ze);}:void 0,isDark:T,locale:d,placeholder:d==="es"?"Agregar":"Add",disabled:Ke,lens:v,hourlyRate:G(F),financialOverride:me})}case "soldEffortMinutes":{if(M&&F.subtasks&&F.subtasks.length>0){let{quoted:Ze}=Xn(F),yt=E?.enabled&&(!E.columns||E.columns.includes("soldEffortMinutes"));return jsx(Dr,{value:Ze>0?Ze:void 0,isDark:T,locale:d,disabled:true,isBlurred:yt,lens:v,hourlyRate:G(F)})}let me=F.status==="completed"||F.progress===100,Ke=E?.enabled&&(!E.columns||E.columns.includes("soldEffortMinutes"));return jsx(Dr,{value:F.soldEffortMinutes,onChange:Ze=>Ce({soldEffortMinutes:Ze}),isDark:T,locale:d,disabled:me,isBlurred:Ke,lens:v,hourlyRate:G(F)})}case "scheduleVariance":{let me=F.effortMinutes||0,Ke=F.soldEffortMinutes||0,Ze=F.timeLoggedMinutes||0,yt=me>0||Ke>0||Ze>0;return jsx(fg,{startDate:F.startDate,endDate:F.endDate,scheduleVariance:F.scheduleVariance,isDark:T,locale:d,hasTimeAllocated:yt})}case "hoursBar":{if(M&&F.hasChildren){let{spent:me,allocated:Ke,quoted:Ze}=Xn(F),yt=me>Ke&&Ke>0;return jsxs("span",{className:u("text-[11px] font-mono flex items-center gap-1.5",T?"text-white/50":"text-gray-500"),children:[jsx("span",{className:u("font-bold",yt?"text-[#FF453A]":T?"text-white/80":"text-gray-800"),children:Yn(me)}),Ke>0&&jsxs(Fragment,{children:[" / ",jsx("span",{className:T?"text-white/60":"text-gray-600",children:Yn(Ke)})]}),Ze>0&&jsxs(Fragment,{children:[" / ",jsx("span",{className:T?"text-amber-400/70":"text-amber-600",children:Yn(Ze)})]})]})}return jsx(hg,{task:F,isDark:T,locale:d,onLogTime:a.onLogTime,onEstimateUpdate:a.onEstimateUpdate,onSoldEffortUpdate:a.onSoldEffortUpdate,showSoldEffort:t.showSoldEffort,onOpenTimeLog:a.onOpenTimeLog,lens:v,hourlyRate:G(F)})}case "teamLoad":return F.hasChildren||F.subtasks&&F.subtasks.length>0?jsx(xg,{task:F,isDark:T,locale:d}):jsx(qd,{value:F.assignees||[],availableUsers:l,onChange:Ke=>{a.onTaskUpdate?.({...F,assignees:Ke});},isDark:T,locale:d});case "blockers":return jsx(wg,{blockers:F.blockers,isDark:T,locale:d});case "weight":{let me=q.get(F.id);if(me!==void 0)return jsx("span",{className:u("text-xs font-mono",me>0?T?"text-white/50":"text-gray-400":T?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:me>0?`${Number(me.toFixed(2))}%`:"\u2014"});let Ke=F.weight||0;return jsx(cw,{value:Ke,onChange:Ze=>Ce({weight:Ze}),isDark:T})}default:return jsx("span",{className:u("text-sm",T?"text-white/60":"text-gray-500"),children:"-"})}},[a,T,d,l,Y,M,q]),Zn=useCallback(F=>{let Ce={name:Y.columns.name,status:Y.columns.status,priority:Y.columns.priority,assignees:Y.columns.assignees,startDate:Y.columns.startDate,endDate:Y.columns.endDate,progress:Y.columns.progress,tags:Y.columns.tags||(d==="es"?"Etiquetas":"Tags"),estimatedTime:Y.columns.estimatedTime||(d==="es"?"Estimado":"Estimated"),quotedTime:Y.columns.quotedTime||(d==="es"?"Ofertado":"Quoted"),elapsedTime:Y.columns.elapsedTime||(d==="es"?"Ejecutado":"Executed"),soldEffortMinutes:Y.columns.soldEffortMinutes||(d==="es"?"Ofertado":"Quoted"),effortMinutes:Y.columns.effortMinutes||(d==="es"?"Estimado":"Estimated"),timeLoggedMinutes:Y.columns.timeLoggedMinutes||(d==="es"?"Ejecutado":"Executed"),scheduleVariance:Y.columns.scheduleVariance||(d==="es"?"Prog / Var":"Sched / Var"),hoursBar:Y.columns.hoursBar||(d==="es"?"Horas (Usado / Asignado)":"Hours (Spent / Allocated)"),teamLoad:Y.columns.teamLoad||(d==="es"?"Equipo":"Team"),blockers:Y.columns.blockers||(d==="es"?"Bloqueantes":"Blockers"),weight:Y.columns.weight||(d==="es"?"Peso":"Weight")}[F.type]||F.label;return typeof Ce=="string"?Ce:String(Ce||F.type)},[Y,d]),Wr=useMemo(()=>{let Ce=Q.reduce((Re,tt)=>Re+tt.width,0)+(h?48:0),ve={};for(let Re of Q)ve[Re.id]=`${Re.width/Ce*100}%`;return ve},[Q,h]);return r?jsx("div",{className:u("flex-1 flex items-center justify-center",T?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007BFF]"}),jsxs("p",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:[Y.empty.noTasks,"..."]})]})}):o?jsx("div",{className:u("flex-1 flex items-center justify-center",T?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxs("div",{children:[jsx("h3",{className:u("text-lg font-semibold mb-2",T?"text-white":"text-gray-900"),children:"Error"}),jsx("p",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsx("div",{className:u("flex-1 flex items-center justify-center",T?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxs("div",{className:"text-center max-w-md",children:[jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#007BFF]/10 flex items-center justify-center",children:jsx(List,{className:"w-8 h-8 text-[#007BFF]"})}),jsx("h3",{className:u("text-lg font-semibold mb-2",T?"text-white":"text-gray-900"),children:Y.empty.noTasks}),jsx("p",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:Y.empty.addFirstTask})]})}):jsxs("div",{ref:bt,className:u(T?"bg-[#0D0D0D]":"bg-white",ne&&"select-none",s),style:{display:"flex",flexDirection:"column",flex:"1 1 0%",width:"100%",height:"100%",overflow:"hidden",minHeight:0,...n},children:[jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",T?"border-[#222]":"border-gray-200"),children:jsxs("div",{className:"flex items-center gap-4",children:[jsxs("div",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:[dr.length," ",Y.pagination.tasks]}),g&&jsxs("div",{className:"relative flex-1 max-w-md",children:[jsx(Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",T?"text-white/60":"text-gray-400")}),jsx("input",{type:"text",value:at,onChange:F=>ue(F.target.value),placeholder:Y.toolbar.searchPlaceholder,className:u("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",T?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30 font-mono":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsx("div",{className:"flex-1"}),i&&jsx("div",{className:"flex items-center gap-2",children:i}),y&&it>1&&jsxs("div",{className:"relative",children:[jsxs("button",{ref:Vt,onClick:()=>mt(!Ft),className:u("flex items-center gap-1.5 px-2 py-1.5 rounded-lg border transition-colors text-[11px] font-medium",T?Ft?"bg-blue-500/10 border-blue-500/40 text-blue-400":"bg-white/[0.03] border-[#333] text-white/50 hover:text-white/70 hover:bg-white/[0.05]":Ft?"bg-blue-50 border-blue-300 text-blue-600":"bg-gray-100 border-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-200"),style:{fontFamily:"'JetBrains Mono', monospace"},children:[jsx(Layers,{className:"w-3.5 h-3.5"}),St==="all"?d==="es"?"Todos":"All":`L${St}`]}),Ft&&jsx("div",{ref:ht,className:u("absolute top-full mt-1 right-0 w-24 rounded-lg border overflow-hidden z-50 shadow-lg",T?"bg-[#1A1A1A] border-[#333]":"bg-white border-gray-200"),children:[{value:"all",label:d==="es"?"Todos":"All"},...Array.from({length:Math.min(it,5)},(F,se)=>({value:se+1,label:`L${se+1}`}))].map(F=>jsxs("button",{onClick:()=>{Et(F.value),mt(false);},className:u("w-full px-3 py-2 text-left text-xs transition-colors flex items-center justify-between",T?St===F.value?"bg-blue-500/10 text-blue-400":"text-white/60 hover:bg-white/[0.05] hover:text-white/80":St===F.value?"bg-blue-50 text-blue-600":"text-gray-600 hover:bg-gray-100"),children:[jsx("span",{children:F.label}),St===F.value&&jsx("span",{className:"text-blue-400",children:"\u2713"})]},String(F.value)))})]}),jsx(Gg,{value:je,hideCompleted:he,onChange:Xe,onHideCompletedChange:kt,isDark:T,locale:d}),be?.enabled&&be.data&&!_e&&jsx("button",{onClick:()=>$(true),className:u("flex items-center justify-center w-8 h-8 rounded-lg border transition-colors",T?"border-[#333] text-white/40 hover:text-white/70 hover:bg-white/[0.05]":"border-gray-200 text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:d==="es"?"Abrir panel de salud":"Open health panel",children:jsx(PanelRight,{className:"w-4 h-4"})}),t.toolbarEndContent,w&&C&&jsxs(motion.button,{onClick:C,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-[transform,box-shadow]",style:{background:"linear-gradient(135deg, #007BFF 0%, #005FCC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 123, 255, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 123, 255, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-4 h-4"}),jsx("span",{children:Y.toolbar.newTask})]})]})}),jsxs("div",{style:{display:"flex",flex:"1 1 0%",overflow:"hidden",minHeight:0},children:[jsx("div",{style:{flex:"1 1 0%",overflow:"auto",minHeight:0},children:jsxs("div",{style:{width:"100%"},children:[jsxs("div",{className:u("flex-shrink-0 flex items-center border-b text-[10px] font-bold uppercase tracking-wider sticky top-0 z-10",T?"border-[#222] bg-[#1A1A1A] font-mono text-white/70":"border-gray-200 bg-gray-50 text-gray-600"),children:[st&&jsx("div",{className:"w-5 flex-shrink-0"}),Q.map(F=>{let se=F.id!=="name",Ce=At===F.id&&Dt!==F.id;return jsxs("div",{className:u("relative flex items-center gap-2 px-4 py-2 transition-all duration-150 group",T?"text-white/60":"text-gray-500",se&&"cursor-grab",F.type!=="name"&&"justify-center",Dt===F.id&&"opacity-50",Ce&&(T?"bg-[#007BFF]/20 border-l-2 border-l-[#007BFF]":"bg-blue-50 border-l-2 border-l-blue-400")),style:{width:Wr[F.id],minWidth:F.minWidth},draggable:se,onDragStart:se?ve=>Pe(ve,F.id):void 0,onDragEnd:se?$t:void 0,onDragOver:se?ve=>Ct(ve,F.id):void 0,onDragLeave:se?Jt:void 0,onDrop:se?ve=>Wa(ve,F.id):void 0,onContextMenu:ve=>N(ve,void 0,F.id),children:[se&&jsx(GripVertical,{className:u("w-3 h-3 flex-shrink-0 transition-opacity",T?"text-white/20 group-hover:text-white/50":"text-gray-300 group-hover:text-gray-500")}),F.sortable?jsxs("button",{draggable:false,onClick:()=>Fe(F.id),className:"flex items-center gap-1 hover:text-[#007BFF]",children:[Zn(F),jsx(ArrowUpDown,{className:u("w-3 h-3",ke===F.id&&"text-[#007BFF]")})]}):jsx("span",{draggable:false,children:Zn(F)}),f&&F.resizable&&jsx("div",{className:u("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#007BFF]",ne===F.id&&"bg-[#007BFF]"),onMouseDown:ve=>Te(ve,F.id)})]},F.id)}),h&&jsxs("div",{className:"relative flex items-center justify-center w-12 flex-shrink-0",children:[jsx("button",{onClick:F=>{F.stopPropagation(),ct(se=>!se);},className:u("p-0.5 rounded transition-colors",T?"hover:bg-white/[0.05] text-white/60 hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",ze&&(T?"bg-white/[0.05]":"bg-gray-200")),title:d==="es"?"Agregar columna":"Add column",children:jsx(Plus,{className:"w-3 h-3"})}),jsx(Og,{isOpen:ze,onClose:()=>ct(false),columns:xt,customFields:c,onColumnsChange:I,onCreateCustomField:()=>{ct(false),Ee(true);},isDark:T,locale:d})]})]}),jsx(AnimatePresence,{mode:"popLayout",children:dr.map((F,se)=>{let Ce=la.has(F.id),ve=Math.min(se*.01,.2),Re=F.hasChildren&&F.level===0,tt=F.subtasks?.length||0;if(Re){let{spent:jt,allocated:Ut,quoted:na}=Xn(F),_t=dw(F);return jsxs(motion.div,{"data-task-id":F.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:ve},className:u("flex items-center border-y cursor-pointer transition-colors duration-500",T?"border-[#222] bg-[#222]":"border-gray-200 bg-gray-100",ee===F.id&&(T?"!bg-[#FFD60A]/15":"!bg-yellow-100")),onClick:()=>a.onTaskClick?.(F),children:[st&&jsx("div",{className:"w-5 flex-shrink-0"}),Q.map(Ba=>jsx("div",{className:u("flex items-center px-4 py-3 min-h-[56px]",Ba.type!=="name"&&"justify-center"),style:{width:Wr[Ba.id],minWidth:Ba.minWidth},children:Ba.type==="name"?jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[jsx("button",{onClick:Nt=>{Nt.stopPropagation(),$e(F.id);},className:u("p-0.5 rounded flex-shrink-0 mt-0.5",T?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsx(ChevronDown,{className:u("w-4 h-4",T?"text-white/40":"text-gray-500")}):jsx(ChevronRight,{className:u("w-4 h-4",T?"text-white/40":"text-gray-500")})}),jsx("span",{onClick:Nt=>{Nt.stopPropagation(),$e(F.id);},className:"flex-shrink-0 cursor-pointer mt-0.5",children:Ce?jsx(FolderOpen,{className:"w-4 h-4",style:{color:T?"#FFD60A":"#B45309"}}):jsx(Folder,{className:"w-4 h-4",style:{color:T?"#FFD60A":"#B45309"}})}),F.wbsCode&&jsx("span",{className:"text-[10px] font-mono flex-shrink-0 mt-1",style:{color:T?"#FFD60A":"#B45309"},children:F.wbsCode}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:u("text-[13px] font-bold uppercase tracking-wide",T?"text-white":"text-gray-900"),style:{fontFamily:"Inter, system-ui, sans-serif"},children:F.name}),jsxs("span",{className:u("text-[10px] font-mono",T?"text-white/30":"text-gray-500"),children:["(",tt," ",d==="es"?tt===1?"Tarea":"Tareas":tt===1?"Item":"Items",")"]}),_t!==null&&jsxs("span",{className:u("text-[9px] font-mono px-1.5 py-0.5 rounded w-fit mt-0.5",_t>=1?"text-[#32D74B] bg-[#32D74B]/10":_t>=.8?"text-[#FFD60A] bg-[#FFD60A]/10":"text-[#FF453A] bg-[#FF453A]/10"),children:["Avg SPI: ",_t.toFixed(2)]})]})]}):Ba.type==="timeLoggedMinutes"?v==="financial"?(()=>{let Nt=F.executedDollarsCanonical,mr=Nt!=null?Math.round(Nt):Math.round(te(F).dollarSpent);return mr>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",mr.toLocaleString("en-US")]}):null})():jsx(Dr,{value:jt>0?jt:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F)}):Ba.type==="soldEffortMinutes"?v==="financial"?(()=>{let Nt=te(F),mr=Math.round(Nt.dollarQuoted);return mr>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",mr.toLocaleString("en-US")]}):null})():jsx(Dr,{value:na>0?na:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F)}):Ba.type==="effortMinutes"?v==="financial"?(()=>{let Nt=te(F),mr=Math.round(Nt.dollarAllocated),To=Math.round(Nt.dollarQuoted),Lr=To-mr;return jsxs("div",{className:"flex flex-col",children:[mr>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",mr.toLocaleString("es-CO")]}):null,Lr!==0&&mr>0&&To>0&&jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Lr>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Lr>0?"+":"",Math.abs(Lr)>=1e3?`$${(Lr/1e3).toFixed(1)}K`:`$${Lr}`]})]})})():jsx(Dr,{value:Ut>0?Ut:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F)}):Ar(F,Ba)},Ba.id)),h&&jsx("div",{className:"w-12 flex-shrink-0"})]},F.id)}let me=U===F.id,Ke=oe===F.id,Ze=Ke&&ge==="above",yt=Ke&&ge==="below",oa=Ke&&ge==="child";return jsxs(motion.div,{"data-task-id":F.id,"data-listview-row":F.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:ve},className:u("flex items-center border-b transition-colors relative group",T?"border-[#222] hover:bg-white/[0.05]":"border-gray-100 hover:bg-gray-50",ee===F.id&&(T?"!bg-[#FFD60A]/15":"!bg-yellow-100")),style:{opacity:me?.4:1,backgroundColor:oa?T?"rgba(46,148,255,0.08)":"rgba(46,148,255,0.05)":void 0,boxShadow:oa?"inset 0 0 0 2px #2E94FF":void 0},onClick:()=>a.onTaskClick?.(F),onDoubleClick:()=>a.onTaskDoubleClick?.(F),onContextMenu:jt=>N(jt,F),children:[Ze&&jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),yt&&jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),st&&jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-5 cursor-grab opacity-0 group-hover:opacity-40 hover:!opacity-80 transition-opacity",onMouseDown:jt=>pt(F.id,jt),style:{color:T?"#888":"#999"},children:jsx(GripVertical,{className:"w-3 h-3"})}),Q.map(jt=>jsx("div",{className:u("flex items-center px-4 py-3 min-h-[56px]",jt.type!=="name"&&"justify-center"),style:{width:Wr[jt.id],minWidth:jt.minWidth},children:jt.type==="name"?jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[y&&F.level>0&&jsx("div",{style:{width:`${F.level*24}px`},className:"flex-shrink-0"}),y&&F.hasChildren&&jsx("button",{onClick:Ut=>{Ut.stopPropagation(),$e(F.id);},className:u("p-0.5 rounded flex-shrink-0",T?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsx(ChevronDown,{className:u("w-4 h-4",T?"text-white/60":"text-gray-400")}):jsx(ChevronRight,{className:u("w-4 h-4",T?"text-white/60":"text-gray-400")})}),y&&!F.hasChildren&&jsx("div",{className:"w-5 flex-shrink-0"}),jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[(F.wbsCode||F.taskCode)&&jsxs("div",{className:"flex items-center gap-1.5",children:[F.wbsCode&&jsx("span",{className:u("text-[10px] font-mono",T?"text-[#007BFF]":"text-blue-600"),children:F.wbsCode}),F.taskCode&&jsx("span",{className:u("text-[10px] font-mono",T?"text-white/40":"text-gray-400"),children:F.taskCode})]}),jsx("span",{className:u("truncate",F.hasChildren?"text-[14px] font-bold":"text-[13px] font-normal",F.progress===100?T?"line-through text-white/50":"line-through text-gray-400":F.hasChildren?T?"text-white":"text-gray-900":T?"text-[#D1D5DB]":"text-gray-600"),children:F.name}),F.tags?.[0]&&jsx("span",{className:"text-[9px] font-mono uppercase tracking-wide px-1.5 py-0.5 rounded w-fit",style:{backgroundColor:`${F.tags[0].color}20`,color:F.tags[0].color},children:F.tags[0].name})]})]}):Ar(F,jt)},jt.id)),h&&jsx("div",{className:"w-12 flex-shrink-0"})]},F.id)})}),J&&dr.length>0&&(()=>{let{spent:F,allocated:se,quoted:Ce}=B,ve=se-F,Re=ve<0,tt=Re?`+${Yn(Math.abs(ve))} ${d==="es"?"EXCEDIDO":"OVER"}`:`+${Yn(ve)} ${d==="es"?"AHORRADO":"SAVED"}`,me=v==="financial"&&P>0,Ke=H?.spent!=null?H.spent:B.dollarSpent,Ze=H?.allocated!=null?H.allocated:B.dollarAllocated,yt=H?.quoted!=null?H.quoted:B.dollarQuoted,oa=(na,_t)=>{if(me){let Ba=_t??na/60*P;return `$${Math.round(Ba).toLocaleString("es-CO")}`}return Yn(na)},jt=me?Math.abs(Ze-Ke):0,Ut=me?`+$${jt.toLocaleString("es-CO",{minimumFractionDigits:0,maximumFractionDigits:0})} ${Re?d==="es"?"EXCEDIDO":"OVER":d==="es"?"AHORRADO":"SAVED"}`:tt;return jsxs("div",{className:u("flex items-center sticky bottom-0 z-[5]",T?"border-t border-[#2A2A3A]":"border-t border-gray-300"),style:{backgroundColor:T?"rgba(13, 17, 23, 0.95)":"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[st&&jsx("div",{className:"w-5 flex-shrink-0"}),Q.map(na=>jsx("div",{className:u("flex items-center px-4 py-3",na.type!=="name"&&"justify-center"),style:{width:Wr[na.id],minWidth:na.minWidth},children:na.type==="name"?jsx("span",{className:u("text-[11px] font-black uppercase tracking-widest",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:d==="es"?"TOTAL PROYECTO":"TOTAL PROJECT"}):na.type==="hoursBar"?jsxs("div",{className:"flex flex-col items-center w-full",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:oa(F,me?Ke:void 0)}),jsx("span",{className:u("text-[11px]",T?"text-white/40":"text-gray-400"),children:"/"}),jsx("span",{className:u("text-[11px]",T?"text-white/50":"text-gray-500"),style:{fontFamily:"JetBrains Mono, monospace"},children:oa(se,me?Ze:void 0)})]}),se>0&&jsx("span",{className:u("text-[10px] font-semibold mt-0.5 whitespace-nowrap",Re?"text-[#FF453A]":"text-[#32D74B]"),style:{fontFamily:"JetBrains Mono, monospace"},children:me?Ut:tt})]}):na.type==="soldEffortMinutes"?jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Ce>0?oa(Ce,me?yt:void 0):"\u2013"}):na.type==="effortMinutes"?(()=>{if(me&&Ce>0&&se>0){let _t=Math.round(yt),Ba=Math.round(Ze),Nt=_t-Ba,mr=_t>0?Math.round(Nt/_t*100):0;return jsxs("div",{className:"flex flex-col items-center",children:[jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:oa(se,Ze)}),jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Nt>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Nt>=0?"+":"",Math.abs(Nt)>=1e3?`$${(Nt/1e3).toFixed(1)}K`:`$${Nt}`,jsxs("span",{className:"ml-0.5 opacity-60",children:["(",mr,"%)"]})]})]})}return jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:se>0?oa(se,me?Ze:void 0):"\u2013"})})():na.type==="timeLoggedMinutes"?jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:F>0?oa(F,me?Ke:void 0):"\u2013"}):na.type==="progress"?(()=>{let _t=Jg(uc(e||[]));return jsxs("span",{className:u("text-[12px] font-bold font-mono",T?"text-[#00E5CC]":"text-cyan-600"),style:{fontFamily:"JetBrains Mono, monospace"},children:[_t,"%"]})})():na.type==="weight"?(()=>{let _t=e||[],Ba=[],Nt=No=>{for(let Do of No)Ba.push(Do),Do.subtasks?.length&&Nt(Do.subtasks);};Nt(_t);let To=Ba.filter(No=>!No.subtasks?.length||No.subtasks.length===0).reduce((No,Do)=>No+(Do.weight||0),0),Lr=Math.abs(To-100)<.1;return jsxs("span",{className:u("text-[12px] font-bold font-mono",Lr?T?"text-[#22C55E]":"text-green-600":"text-[#EF4444]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Number(To.toFixed(1)),"%"]})})():jsx("span",{className:u("text-[11px]",T?"text-white/30":"text-gray-300"),children:"\u2013"})},na.id)),h&&jsx("div",{className:"w-12 flex-shrink-0"})]})})(),dr.length===0&&at&&jsx("div",{className:"flex items-center justify-center py-12",children:jsxs("div",{className:"text-center",children:[jsx(List,{className:u("w-12 h-12 mx-auto mb-4",T?"text-white/30":"text-gray-400")}),jsx("p",{className:u(T?"text-white/60":"text-gray-600"),children:Y.empty.noResults})]})})]})}),be?.enabled&&be.data&&_e&&jsx(_g,{data:be.data,isDark:T,locale:d,onClose:()=>$(false),lens:t?.lens,onUnassignedTaskClick:F=>{let se=document.querySelector(`[data-task-id="${F}"]`);se&&(se.scrollIntoView({behavior:"smooth",block:"center"}),le(F),setTimeout(()=>le(null),2e3));}})]}),jsx(Sg,{state:V,onClose:K,isDark:T,locale:d,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:ye,onColumnSort:Z,availableUsers:l,onOpenTimeLog:a.onOpenTimeLog,onReportBlocker:a.onReportBlocker,onCopyTaskLink:a.onCopyTaskLink,onTaskMove:a.onTaskMove,onTaskIndent:a.onTaskIndent,onTaskOutdent:a.onTaskOutdent}),Ne&&Oe&&U&&createPortal(jsx("div",{style:{position:"fixed",left:Oe.x+12,top:Oe.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let se=Se.flattenTasks(e).find(Ce=>Ce.id===U);return se?jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:T?"rgba(10,10,10,0.9)":"rgba(255,255,255,0.95)",border:`1px solid ${T?"rgba(255,255,255,0.1)":"#e5e7eb"}`,backdropFilter:"blur(8px)",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:[jsx(GripVertical,{className:"w-3 h-3",style:{color:"#2E94FF"}}),jsx("span",{className:"text-xs font-medium",style:{color:T?"#e6edf3":"#111827"},children:se.name})]}):null})()}),document.body),jsx(zg,{isOpen:et,onClose:()=>Ee(false),onSave:ya,isDark:T,locale:d})]})}var t0=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Executed",width:100,visible:false,sortable:true,resizable:true},{id:"scheduleVariance",type:"scheduleVariance",label:"Sched / Var",width:180,visible:false,sortable:true,resizable:true},{id:"hoursBar",type:"hoursBar",label:"Hours",width:200,visible:false,sortable:true,resizable:true},{id:"teamLoad",type:"teamLoad",label:"Team Load",width:160,visible:false,sortable:true,resizable:true},{id:"blockers",type:"blockers",label:"Blockers",width:150,visible:false,sortable:false,resizable:true},{id:"weight",type:"weight",label:"Weight",width:80,visible:false,sortable:true,resizable:true}],a0=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"},{type:"scheduleVariance",labelKey:"columns.scheduleVariance",icon:"CalendarClock"},{type:"hoursBar",labelKey:"columns.hoursBar",icon:"BarChart3"},{type:"teamLoad",labelKey:"columns.teamLoad",icon:"Users"},{type:"blockers",labelKey:"columns.blockers",icon:"AlertTriangle"},{type:"weight",labelKey:"columns.weight",icon:"Scale"}],r0=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var pc={bgPrimary:"#0D0D0D",bgSecondary:"#141414",bgHover:"rgba(255,255,255,0.05)",bgSelected:"#0D131E",bgAlternate:"#141414",border:"#222222",borderLight:"#1A1A1A",textPrimary:"rgba(255,255,255,0.9)",textSecondary:"rgba(255,255,255,0.6)",textMuted:"rgba(255,255,255,0.3)",accent:"#007BFF",accentHover:"#2979FF",accentLight:"rgba(0,123,255,0.15)",statusTodo:"rgba(255,255,255,0.4)",statusInProgress:"#007BFF",statusCompleted:"#34D399",focusRing:"#007BFF",checkboxBg:"#1A1A1A",checkboxChecked:"#007BFF",bgGroupHeader:"#222222",headerBg:"#1A1A1A",neonRed:"#FF2D20",neonGreen:"#3BF06E",neonAmber:"#FFD60A",neonBlue:"#3B9EFF"},mc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da",bgGroupHeader:"#F3F4F6",headerBg:"#F9FAFB",neonRed:"#DC2626",neonGreen:"#16A34A",neonAmber:"#D97706",neonBlue:"#2E94FF"},gc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1",bgGroupHeader:"#1f3460",headerBg:"#16213e",neonRed:"#EF4444",neonGreen:"#34D399",neonAmber:"#FBBF24",neonBlue:"#6366F1"},Zi={dark:pc,light:mc,neutral:gc};function o0(e){return Zi[e]||Zi.dark}var fc={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week",backlogTitle:"BACKLOG / UNSCHEDULED",systemStatus:"SYSTEM STATUS",budgetUtil:"Budget Util.",variance:"VARIANCE",cost:"COST",estimate:"Est",sold:"Sold",cashOut:"Cash Out",typeToAdd:"Type to add (e.g., Crane Inspection)",critical:"CRITICAL",blocker:"Blocker",risk:"Risk",delay:"delay",days:"Days"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},bc={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana",backlogTitle:"BACKLOG / SIN FECHA",systemStatus:"ESTADO DEL SISTEMA",budgetUtil:"Util. Presupuesto",variance:"VARIANZA",cost:"COSTO",estimate:"Est",sold:"Vendido",cashOut:"Desembolso",typeToAdd:"Escribe para agregar (ej: Inspecci\xF3n)",critical:"CR\xCDTICO",blocker:"Bloqueador",risk:"Riesgo",delay:"retraso",days:"D\xEDas"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},el={en:fc,es:bc};function Ls(e){return el[e]||el.en}function tl(e,t){let a=Ls(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function n0(e){let t=Ls(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function s0(e,t=0,a=true){let r=Ls(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function Bs(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function yc(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function d0({task:e,isDark:t}){return e.progress===100||e.status==="completed"?jsx(CheckCircle2,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsx(PlayCircle,{className:"w-3 h-3 text-[#007FFF] flex-shrink-0"}):jsx(Circle,{className:u("w-3 h-3 flex-shrink-0",t?"text-white/40":"text-gray-400")})}var p0=26,yw=22,xw=10;function c0(e,t){let a=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((a-r)/(1e3*60*60*24))}function xc(e,t="hours",a=0){if(!e||e<=0)return null;if(t==="financial"&&a>0){let o=Math.round(e/60*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(e/480);return r>0?`${r}d`:null}function m0(e,t="hours",a=0){if(e.soldEffortMinutes==null||e.effortMinutes==null)return null;let r=e.soldEffortMinutes-e.effortMinutes;if(r===0)return null;let o=r<0,s;if(t==="financial"&&a>0){let n=Math.round(Math.abs(r/60)*a);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}else {let n=Math.round(Math.abs(r)/60);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}return {text:`${o?"-":"+"}${s}`,isNegative:o}}function u0(e,t="hours",a=0){if(t==="financial"&&a>0){let o=Math.round(Math.abs(e/60)*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(Math.abs(e)/60);return r>=1e3?`$${(r/1e3).toFixed(1)}k`:`$${r}`}function vw({segment:e,isDark:t,onClick:a,blurFinancials:r,isSelected:o,t:s,lens:n="hours",hourlyRate:l=0}){let{task:c,spanCols:i,lane:p,isStart:d,isEnd:m}=e,g=c.progress===100||c.status==="completed",y=c.isCriticalPath,x=d&&m?"rounded":d?"rounded-l":m?"rounded-r":"",h=m?xc(c.effortMinutes,n,l):null,f=m?m0(c,n,l):null,b=m?c.blockers?.find(w=>w.severity==="critical"):null;return jsxs(motion.button,{onClick:w=>{w.stopPropagation(),a();},whileHover:{scale:1.005},className:u("absolute flex items-center gap-1.5 px-2 text-xs cursor-pointer overflow-hidden",x,g?t?"text-emerald-400":"bg-emerald-500/10 text-emerald-600 border border-emerald-200":y?t?"text-white/90":"bg-red-50 border border-red-200 text-red-700 hover:border-red-300":t?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:{top:`${p*p0}px`,left:"1px",width:`calc(${i*100}% - 2px)`,height:`${yw}px`,zIndex:10,...t?g?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:y?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:{},borderLeftWidth:d?"3px":void 0,borderLeftColor:d?y?"#EF4444":g?"#10B981":"#1264FF":void 0,...o?{boxShadow:t?"0 0 0 1.5px rgba(0, 229, 255, 0.7), 0 0 12px rgba(0, 229, 255, 0.3)":"0 0 0 1.5px rgba(59, 130, 246, 0.7), 0 0 12px rgba(59, 130, 246, 0.2)",zIndex:20}:{}},children:[y&&d&&jsxs("span",{className:"text-[9px] font-mono font-bold text-red-400 uppercase tracking-wider flex-shrink-0",children:[s.labels.critical,":"]}),jsx("span",{className:"truncate flex-1 text-left font-medium",children:c.name}),m&&(h||f)&&jsxs("span",{className:"flex items-center gap-1 flex-shrink-0 text-[9px] font-mono text-white/35 ml-1",children:[h&&jsxs("span",{children:[s.labels.estimate,": ",h]}),f&&jsxs(Fragment,{children:[jsx("span",{className:"text-white/15",children:"|"}),jsx("span",{className:u(f.isNegative?"text-red-400":"text-emerald-400",r&&"blur-sm select-none"),children:f.text})]})]}),b&&jsxs("span",{className:"flex-shrink-0 text-[8px] font-mono px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 ml-1",children:[s.labels.blocker,": ",b.type]}),c.progress>0&&c.progress<100&&jsx("div",{className:"absolute bottom-0 left-0 h-[2px] bg-[#1264FF]",style:{width:`${c.progress}%`}})]})}function g0({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:l,availableTags:c=[],onCreateTag:i,attachmentsByTask:p,comments:d,onAddComment:m,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,onTaskOpen:h,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:w,timerState:C,onLogTime:S,onUpdateEstimate:E,onUpdateSoldEffort:k,onStartTimer:v,onStopTimer:P,onDiscardTimer:L,blurFinancials:M=false,suppressDetailModal:J=false,lens:H="hours",hourlyRate:Y=0}){let{theme:T="dark",locale:G="en",customTranslations:te,showBacklog:Le=true}=t,B=tl(G,te),q=T==="dark"||T==="neutral",[be,_e]=useState(r||new Date),[$,ee]=useState(null),[le,ke]=useState(null),[xe,Be]=useState(null),[He,at]=useState({}),ue=3,je=3,Xe=useCallback(z=>{ke(z.id),J||ee(z),h?.(z.id);},[J,h]),[he,kt]=useState(null),xt=useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()-1,1));},[be]),nt=useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()+1,1));},[be]),ze=useCallback(()=>{_e(new Date);},[]),ct=useMemo(()=>{let z=be.getFullYear(),oe=be.getMonth(),Ge=new Date(z,oe,1),ge=new Date(z,oe+1,0),Ve=Ge.getDay(),Oe=ge.getDate(),Ue=Bs(e),lt=new Date;lt.setHours(0,0,0,0);let ot=[],st=Ve,pt=new Date(z,oe,0).getDate();for(let Ot=st-1;Ot>=0;Ot--){let St=new Date(z,oe-1,pt-Ot);ot.push({date:St,isCurrentMonth:false,isToday:false,isWeekend:St.getDay()===0||St.getDay()===6,events:Ue.filter(Et=>yc(St,Et)).map(Et=>({id:Et.id,title:Et.name,start:Et.startDate,end:Et.endDate,task:Et}))});}for(let Ot=1;Ot<=Oe;Ot++){let St=new Date(z,oe,Ot),Et=St.getTime()===lt.getTime();ot.push({date:St,isCurrentMonth:true,isToday:Et,isWeekend:St.getDay()===0||St.getDay()===6,events:Ue.filter(Ft=>yc(St,Ft)).map(Ft=>({id:Ft.id,title:Ft.name,start:Ft.startDate,end:Ft.endDate,task:Ft}))});}let Tt=42-ot.length;for(let Ot=1;Ot<=Tt;Ot++){let St=new Date(z,oe+1,Ot);ot.push({date:St,isCurrentMonth:false,isToday:false,isWeekend:St.getDay()===0||St.getDay()===6,events:Ue.filter(Et=>yc(St,Et)).map(Et=>({id:Et.id,title:Et.name,start:Et.startDate,end:Et.endDate,task:Et}))});}return ot},[be,e]),et=useMemo(()=>Bs(e).filter(z=>!z.startDate||!z.endDate),[e]),Ee=useMemo(()=>{let z=Bs(e),oe=0,Ge=0,ge=0,Ve=0,Oe=0;z.forEach(pt=>{pt.effortMinutes&&(oe+=pt.effortMinutes),pt.soldEffortMinutes&&(Ge+=pt.soldEffortMinutes),pt.scheduleVariance!=null&&(ge+=pt.scheduleVariance,Ve++),pt.soldEffortMinutes&&pt.effortMinutes&&(Oe+=pt.soldEffortMinutes-pt.effortMinutes);});let Ue=Ge>0?Math.min(100,Math.round(oe/Ge*100)):0,lt=Ve>0?Math.round(ge/Ve):0,st=`${Oe<0?"-":"+"}${u0(Oe,H,Y)}`;return {budgetUtil:Ue,avgVariance:lt,costDisplay:st,hasCostData:Ge>0}},[e,H,Y]),V=useMemo(()=>{let z=[0,0,0,0,0,0];return ct.forEach((oe,Ge)=>{let ge=Math.floor(Ge/7);oe.events.forEach(Ve=>{if(Ve.task.startDate&&Ve.task.soldEffortMinutes){let Oe=new Date(Ve.task.startDate),Ue=oe.date;Oe.getFullYear()===Ue.getFullYear()&&Oe.getMonth()===Ue.getMonth()&&Oe.getDate()===Ue.getDate()&&ge<z.length&&(z[ge]-=Ve.task.soldEffortMinutes);}});}),z},[ct]),D=useMemo(()=>{let z=Bs(e),oe=new Map,Ge=new Set,ge=[0,0,0,0,0,0];if(ct.length===0)return {segmentsByCell:oe,multiDayTaskIds:Ge,maxLanesPerRow:ge};let Ve=st=>new Date(st.getFullYear(),st.getMonth(),st.getDate()),Oe=Ve(ct[0].date),Ue=Ve(ct[ct.length-1].date),lt=[];for(let st of z){if(!st.startDate||!st.endDate)continue;let pt=Ve(st.startDate),Tt=Ve(st.endDate);if(pt.getTime()===Tt.getTime()||Tt<Oe||pt>Ue)continue;let Ot=pt<Oe?Oe:pt,St=Tt>Ue?Ue:Tt,Et=c0(Ot,Oe),Ft=c0(St,Oe);Et<0||Et>41||Ft<0||Ft>41||Et!==Ft&&(Ge.add(st.id),lt.push({task:st,startIdx:Et,endIdx:Ft}));}lt.sort((st,pt)=>st.startIdx!==pt.startIdx?st.startIdx-pt.startIdx:pt.endIdx-pt.startIdx-(st.endIdx-st.startIdx));let ot=[[],[],[],[],[],[]];for(let{task:st,startIdx:pt,endIdx:Tt}of lt){let Ot=Math.floor(pt/7),St=Math.floor(Tt/7),Et=Ve(st.startDate),Ft=Ve(st.endDate),mt=false;for(let Vt=Ot;Vt<=St;Vt++){let ht=Vt===Ot?pt%7:0,it=Vt===St?Tt%7:6,ne=it-ht+1,pe=0,O=ot[Vt]??[];for(ot[Vt]||(ot[Vt]=O);pe<O.length&&(O[pe]??-1)>=ht;)pe++;if(pe>=xw){mt=true;break}pe>=O.length?O.push(it):O[pe]=it,ge[Vt]=Math.max(ge[Vt]??0,pe+1);let _=Vt===Ot&&Et>=Oe,De=Vt===St&&Ft<=Ue,Qe=Vt*7+ht,bt={taskId:st.id,task:st,rowIndex:Vt,startCol:ht,endCol:it,spanCols:ne,lane:pe,isStart:_,isEnd:De};oe.has(Qe)||oe.set(Qe,[]),oe.get(Qe).push(bt);}mt&&(Ge.delete(st.id),oe.forEach((Vt,ht)=>{let it=Vt.filter(ne=>ne.taskId!==st.id);it.length===0?oe.delete(ht):oe.set(ht,it);}));}return {segmentsByCell:oe,multiDayTaskIds:Ge,maxLanesPerRow:ge}},[ct,e]),U=G==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ae=be.toLocaleDateString(G==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),Ne=ae.charAt(0).toUpperCase()+ae.slice(1);return o?jsx("div",{className:u("flex-1 flex items-center justify-center",q?"bg-[#050505]":"bg-white",n),style:l,children:jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007FFF]"}),jsxs("p",{className:u("text-sm font-mono",q?"text-white/30":"text-gray-600"),children:[B.labels.noEvents,"..."]})]})}):s?jsx("div",{className:u("flex-1 flex items-center justify-center",q?"bg-[#050505]":"bg-white",n),style:l,children:jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsx("div",{className:u("w-12 h-12 rounded-full flex items-center justify-center",q?"bg-red-500/10 border border-red-500/20":"bg-red-500/10"),children:jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxs("div",{children:[jsx("h3",{className:u("text-lg font-semibold mb-2",q?"text-white/90":"text-gray-900"),children:"Error"}),jsx("p",{className:u("text-sm",q?"text-white/40":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsx("div",{className:u("flex-1 flex items-center justify-center",q?"bg-[#050505]":"bg-white",n),style:l,children:jsxs("div",{className:"text-center max-w-md",children:[jsx("div",{className:u("w-16 h-16 mx-auto mb-4 rounded-2xl flex items-center justify-center",q?"bg-[#007FFF]/10 border border-[#007FFF]/20":"bg-blue-500/10"),children:jsx(Calendar,{className:u("w-8 h-8",q?"text-[#007FFF]":"text-blue-500")})}),jsx("h3",{className:u("text-lg font-semibold mb-2",q?"text-white/90":"text-gray-900"),children:B.labels.noEvents}),jsx("p",{className:u("text-sm",q?"text-white/30":"text-gray-600"),children:B.labels.newTask})]})}):jsxs("div",{className:u("flex-1 flex flex-col w-full h-full overflow-hidden",q?"bg-[#050505]":"bg-white",n),style:l,children:[jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative overflow-hidden",children:[jsxs("div",{className:u("flex-shrink-0 h-10 flex items-center justify-between px-4 z-20",q?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:[jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[jsxs("div",{className:u("flex items-center gap-1.5 pl-2.5 pr-2 py-1 rounded-md text-xs transition-all",q?"bg-[#111] border border-white/10":"bg-gray-100 border border-gray-200"),children:[jsx(Calendar,{className:u("w-3.5 h-3.5",q?"text-[#007FFF]":"text-blue-500")}),jsx("span",{className:u("font-medium",q?"text-white":"text-gray-900"),children:G==="es"?"Calendario":"Calendar"})]}),jsx("div",{className:u("h-4 w-px",q?"bg-white/10":"bg-gray-200")}),jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[jsx("button",{onClick:xt,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",q?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsx(ChevronLeft,{className:"w-3.5 h-3.5"})}),jsx("span",{className:u("text-sm font-semibold tracking-tight min-w-[150px] text-center",q?"text-white":"text-gray-900"),children:Ne}),jsx("button",{onClick:nt,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",q?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsx(ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.toolbarRightContent&&jsxs(Fragment,{children:[t.toolbarRightContent,jsx("div",{className:u("h-4 w-px",q?"bg-white/10":"bg-gray-200")})]}),jsx("button",{onClick:ze,className:u("px-2.5 py-1 text-xs rounded-md transition-all font-medium",q?"bg-white/5 border border-white/10 text-white/70 hover:bg-white/10 hover:text-white":"bg-gray-100 border border-gray-200 text-gray-700 hover:bg-gray-200"),children:B.navigation.today})]})]}),jsx("div",{className:u("grid grid-cols-7 sticky top-0 z-10",q?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:U.map(z=>jsx("div",{className:u("py-2 text-center text-[10px] font-bold uppercase tracking-widest",q?"text-white/60 font-mono":"text-gray-500"),children:z},z))}),jsx("div",{className:"flex-1 overflow-y-auto",children:jsx("div",{className:u("grid grid-cols-7 min-h-[800px]",q?"bg-[#050505]":"bg-white"),style:{gridAutoRows:"minmax(140px, auto)"},onClick:()=>ke(null),children:ct.map((z,oe)=>{let Ge=oe%7===6,ge=oe>=35;return jsxs("div",{className:u("min-h-[140px] p-2 transition-colors flex flex-col relative group overflow-visible",!Ge&&(q?"border-r border-[#222]":"border-r border-gray-200"),!ge&&(q?"border-b border-[#222]":"border-b border-gray-200"),q?z.isCurrentMonth?"bg-[#050505] hover:bg-white/[0.02]":"bg-[#080808] opacity-50":z.isCurrentMonth?"bg-white hover:bg-gray-50":"bg-gray-50 opacity-50",z.isToday&&q&&"ring-1 ring-[#007FFF]/40 ring-inset bg-[#007FFF]/[0.03]",z.isToday&&!q&&"ring-2 ring-blue-500 ring-inset"),children:[jsx("span",{className:u("text-xs font-mono select-none relative z-20",z.isToday?q?"text-[#007FFF] font-bold":"text-blue-600 font-bold":z.isCurrentMonth?q?"text-white/60":"text-gray-900":q?"text-white/20":"text-gray-400"),children:String(z.date.getDate()).padStart(2,"0")}),(()=>{let Ve=Math.floor(oe/7),Oe=(D.maxLanesPerRow[Ve]??0)*p0,Ue=D.segmentsByCell.get(oe);return Oe===0&&!Ue?null:jsx("div",{className:"relative -mx-2 overflow-visible",style:{minHeight:`${Oe}px`,zIndex:5},children:Ue?.map(lt=>jsx(vw,{segment:lt,isDark:q,blurFinancials:M,isSelected:le===lt.taskId,t:B,lens:H,hourlyRate:Y,onClick:()=>{Xe(lt.task),a.onEventClick?.({id:lt.task.id,title:lt.task.name,start:lt.task.startDate,end:lt.task.endDate,task:lt.task});}},lt.taskId))})})(),(()=>{let Ve=z.events.filter(Oe=>Oe.task.isMilestone&&!D.multiDayTaskIds.has(Oe.id));return Ve.length===0?null:jsxs("div",{className:"flex items-center gap-1 mt-0.5 px-0.5",children:[Ve.slice(0,4).map(Oe=>jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 flex-shrink-0 cursor-pointer",title:Oe.title,onClick:Ue=>{Ue.stopPropagation(),Xe(Oe.task);}},Oe.id)),Ve.length>4&&jsxs("span",{className:u("text-[8px] font-mono",q?"text-white/30":"text-gray-400"),children:["+",Ve.length-4]})]})})(),(()=>{let Ve=[];z.events.forEach(Ue=>{Ue.task.blockers?.forEach(lt=>{(lt.severity==="warning"||lt.severity==="critical")&&Ve.push({taskId:Ue.id,type:lt.type,severity:lt.severity,variance:Ue.task.scheduleVariance});});});let Oe=Ve[0];return Oe?jsx("div",{className:"mt-0.5 px-0.5",children:jsxs("div",{className:u("text-[8px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",Oe.severity==="critical"?"bg-red-500/15 text-red-400 border border-red-500/20":"bg-amber-500/15 text-amber-400 border border-amber-500/20"),children:[jsx("span",{children:"\u26A0"}),jsxs("span",{className:"truncate",children:[B.labels.risk,": ",Oe.type,Oe.variance?` (+${Math.abs(Oe.variance)}d ${B.labels.delay})`:""]})]})}):null})(),(()=>{let Ve=z.events.filter(ot=>!D.multiDayTaskIds.has(ot.id)),Oe=He[oe]||ue,Ue=Ve.slice(0,Oe),lt=Ve.length-Oe;return jsxs("div",{className:"mt-1 space-y-0.5 flex-1",children:[Ue.map(ot=>jsxs(motion.button,{onClick:()=>{Xe(ot.task),a.onEventClick?.(ot);},whileHover:{scale:1.01},className:u("w-full flex items-center gap-1.5 px-1.5 py-1 rounded text-[11px] transition-all text-left",ot.task.progress===100||ot.task.status==="completed"?q?"text-emerald-400":"bg-emerald-500/10 text-emerald-600":q?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:q?ot.task.progress===100||ot.task.status==="completed"?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:ot.task.isCriticalPath?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:void 0,children:[jsx("span",{className:u("flex-shrink-0 text-[9px]",ot.task.isMilestone?q?"text-amber-400":"text-amber-600":ot.task.isCriticalPath?"text-red-400":q?"text-[#1264FF]":"text-gray-400"),children:ot.task.isMilestone?"\u25C6":"\u25CF"}),jsx("span",{className:"truncate flex-1",children:ot.title})]},ot.id)),lt>0&&jsxs("button",{onClick:ot=>{ot.stopPropagation(),at(st=>({...st,[oe]:Oe+je}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",q?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:["+",lt," ",G==="es"?"m\xE1s":"more"]}),Oe>ue&&Ve.length>ue&&jsx("button",{onClick:ot=>{ot.stopPropagation(),at(st=>({...st,[oe]:ue}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",q?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:G==="es"?"menos":"less"})]})})(),z.isCurrentMonth&&a.onTaskCreate&&jsx("div",{className:"flex items-center justify-end mt-1",children:(()=>{let Ve=oe>=28,Oe=oe%7>=5;return jsxs("div",{className:"relative",children:[jsx("button",{onClick:Ue=>{Ue.stopPropagation(),kt(he===oe?null:oe);},className:u("w-5 h-5 rounded flex items-center justify-center transition-all",he===oe?"opacity-100 bg-[#007FFF] text-white":"opacity-0 group-hover:opacity-100",q?"hover:bg-[#007FFF] text-white/30 hover:text-white":"hover:bg-blue-500 text-gray-400 hover:text-white"),children:jsx(Plus,{className:u("w-3.5 h-3.5 transition-transform",he===oe&&"rotate-45")})}),jsx(AnimatePresence,{children:he===oe&&jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-40",onClick:()=>kt(null)}),jsx(motion.div,{initial:{opacity:0,y:Ve?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Ve?-5:5,scale:.95},transition:{duration:.12},className:u("absolute w-[320px] rounded-lg shadow-2xl z-50",Ve?"bottom-full mb-1":"top-full mt-1",Oe?"right-0":"left-0",q?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsx(rn,{onSubmit:Ue=>{a.onTaskCreate?.({name:Ue.name,startDate:Ue.startDate||z.date,endDate:Ue.endDate||z.date,priority:Ue.priority,assignees:Ue.assignee?[Ue.assignee]:void 0}),kt(null);},onCancel:()=>kt(null),availableUsers:t.availableUsers,isDark:q,locale:G==="es"?"es":"en",defaultDate:z.date,dropdownDirection:Ve?"up":"down"})})]})})]})})()}),oe%7===6&&(()=>{let Ve=Math.floor(oe/7),Oe=V[Ve];if(!Oe||Oe===0)return null;let Ue=u0(Oe,H,Y);return jsxs("div",{className:u("absolute bottom-1 right-2 text-[9px] font-mono font-bold tabular-nums z-20",Oe<0?"text-red-400":"text-emerald-400",M&&"blur-sm select-none"),children:[B.labels.cashOut,": ",Oe<0?"-":"+",Ue]})})()]},oe)})})})]}),Le&&jsxs("aside",{className:u("w-[280px] flex-shrink-0 flex flex-col overflow-hidden",q?"bg-[#050505] border-l border-[#222]":"bg-white border-l border-gray-200"),children:[jsxs("div",{className:u("flex-shrink-0 h-14 flex items-center justify-between px-4",q?"bg-[#080808] border-b border-[#222]":"bg-gray-50 border-b border-gray-200"),children:[jsx("span",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",q?"text-white/40":"text-gray-500"),children:B.labels.backlogTitle}),jsx("div",{className:"flex items-center gap-2",children:jsx("span",{className:u("text-[10px] font-mono tabular-nums",q?"text-white/20":"text-gray-400"),children:et.length})})]}),jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:et.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[jsx("div",{className:u("w-10 h-10 rounded-xl flex items-center justify-center mb-3",q?"bg-white/5":"bg-gray-100"),children:jsx(Calendar,{className:u("w-5 h-5",q?"text-white/20":"text-gray-400")})}),jsx("p",{className:u("text-xs font-mono",q?"text-white/20":"text-gray-400"),children:G==="es"?"Sin tareas pendientes":"No unscheduled tasks"})]}):et.map(z=>jsxs("button",{onClick:()=>{Xe(z);},className:u("w-full text-left rounded-md p-3 transition-all group/card",q?"bg-[#0A0A0A] border border-white/[0.05] hover:border-white/[0.12] hover:bg-[#0E0E0E]":"bg-white border border-gray-100 hover:border-gray-200 hover:shadow-sm"),children:[jsxs("div",{className:"flex items-start gap-2 mb-2",children:[jsx("div",{className:u("w-1 h-1 rounded-full mt-1.5 flex-shrink-0",q?"bg-white/20":"bg-gray-300")}),jsx("span",{className:u("text-sm font-medium leading-snug line-clamp-2",q?"text-white/80 group-hover/card:text-white":"text-gray-800"),children:z.name})]}),z.tags&&z.tags.length>0&&jsxs("div",{className:"flex flex-wrap gap-1 ml-3",children:[z.tags.slice(0,3).map(oe=>jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:{backgroundColor:`${oe.color}15`,color:oe.color,border:`1px solid ${oe.color}30`},children:oe.name},oe.id)),z.tags.length>3&&jsxs("span",{className:u("text-[9px] font-mono px-1 py-0.5",q?"text-white/20":"text-gray-400"),children:["+",z.tags.length-3]})]}),(z.effortMinutes||z.soldEffortMinutes)&&jsxs("div",{className:u("flex items-center gap-2 mt-1.5 ml-3 text-[9px] font-mono",q?"text-white/25":"text-gray-400",M&&"blur-sm select-none"),children:[xc(z.effortMinutes,H,Y)&&jsxs("span",{children:[B.labels.estimate,": ",xc(z.effortMinutes,H,Y)]}),(()=>{let oe=m0(z,H,Y);return oe?jsx("span",{className:oe.isNegative?"text-red-400":"text-emerald-400",children:oe.text}):null})()]}),jsxs("div",{className:"flex items-center justify-between mt-2 ml-3",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[z.priority&&jsx(Flag,{className:u("w-3 h-3",z.priority==="urgent"||z.priority==="high"?"text-red-400":z.priority==="medium"?"text-yellow-400":"text-green-400")}),jsx(d0,{task:z,isDark:q})]}),z.assignees&&z.assignees.length>0&&jsx("div",{className:"flex -space-x-1",children:z.assignees.slice(0,2).map((oe,Ge)=>jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-mono font-bold text-white ring-1 ring-[#050505]",style:{backgroundColor:oe.color||"#007FFF"},title:oe.name,children:oe.initials||oe.name?.slice(0,2).toUpperCase()},Ge))})]})]},z.id))}),a.onTaskCreate&&jsx("div",{className:u("flex-shrink-0 px-3 py-2.5 border-t",q?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:jsx("input",{type:"text",placeholder:B.labels.typeToAdd,className:u("w-full text-[11px] font-mono bg-transparent outline-none",q?"text-white/70 placeholder:text-white/15":"text-gray-700 placeholder:text-gray-400"),onKeyDown:z=>{z.key==="Enter"&&z.target.value.trim()&&(a.onTaskCreate?.({name:z.target.value.trim()}),z.target.value="");}})}),Ee.hasCostData&&jsxs("div",{className:u("flex-shrink-0 px-4 py-3 border-t space-y-2.5",q?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:[jsxs("div",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",q?"text-white/40":"text-gray-500"),children:["\u25C8 ",B.labels.systemStatus]}),jsxs("div",{children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("span",{className:u("text-[10px] font-mono",q?"text-white/40":"text-gray-500"),children:B.labels.budgetUtil}),jsxs("span",{className:u("text-[10px] font-mono font-bold tabular-nums",q?"text-white/60":"text-gray-700",M&&"blur-sm select-none"),children:[Ee.budgetUtil,"%"]})]}),jsx("div",{className:u("h-1.5 rounded-full overflow-hidden",q?"bg-white/5":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Ee.budgetUtil}%`,background:Ee.budgetUtil>90?"#EF4444":Ee.budgetUtil>70?"#F59E0B":"linear-gradient(to right, #2E94FF, #8B5CF6)"}})})]}),jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",q?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",q?"text-white/25":"text-gray-400"),children:B.labels.variance}),jsxs("div",{className:u("text-[11px] font-mono font-bold tabular-nums",Ee.avgVariance>0?"text-emerald-400":Ee.avgVariance<0?"text-red-400":q?"text-white/50":"text-gray-600"),children:[Ee.avgVariance>0?"+":"",Ee.avgVariance," ",B.labels.days]})]}),jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",q?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",q?"text-white/25":"text-gray-400"),children:B.labels.cost}),jsx("div",{className:u("text-[11px] font-mono font-bold tabular-nums",Ee.costDisplay.startsWith("-")?"text-red-400":"text-emerald-400",M&&"blur-sm select-none"),children:Ee.costDisplay})]})]})]})]})]}),!J&&jsx(ho,{task:$,isOpen:!!$,onClose:()=>ee(null),onTaskUpdate:z=>{a.onTaskUpdate?.(z),ee(z);},theme:T==="dark"?"dark":"light",locale:G,availableUsers:t.availableUsers?.map(z=>({id:z.id,name:z.name,avatar:z.avatar,initials:z.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:c,onCreateTag:i,attachments:$?p?.get($.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:Bs(e).filter(z=>z.id!==$?.id),comments:d?.filter(z=>z.taskId===$?.id).map(z=>({...z,createdAt:z.createdAt instanceof Date?z.createdAt:new Date(z.createdAt),updatedAt:z.updatedAt instanceof Date?z.updatedAt:z.updatedAt?new Date(z.updatedAt):void 0})),onAddComment:m,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:w,isTimerRunning:C?.isRunning,timerElapsedSeconds:C?.elapsedSeconds,onTimeLog:S,onEstimateUpdate:E,onSoldEffortUpdate:k,onTimerStart:v,onTimerStop:P,onTimerDiscard:L,blurFinancials:M}),jsx(AnimatePresence,{children:xe&&jsxs(Fragment,{children:[jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Be(null),className:"fixed inset-0 bg-black/50 z-40"}),jsxs(motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:u("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",q?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08]":"bg-white border border-gray-200"),children:[jsxs("div",{className:u("px-4 py-3 border-b flex items-center justify-between",q?"border-white/[0.08] bg-[#080808]":"border-gray-200"),children:[jsx("span",{className:u("font-medium text-sm",q?"text-white/90":"text-gray-900"),children:xe.date.toLocaleDateString(G==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsx("button",{onClick:()=>Be(null),className:u("p-1 rounded",q?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:jsx(X,{className:"w-4 h-4"})})]}),jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-1.5",children:xe.events.map(z=>jsxs("button",{onClick:()=>{Be(null),Xe(z.task);},className:u("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",q?"hover:bg-white/5 border border-white/5":"hover:bg-gray-50 border border-gray-100"),children:[jsx(d0,{task:z.task,isDark:q}),jsx("span",{className:u("text-sm truncate flex-1",q?"text-white/80":"text-gray-900"),children:z.title}),(z.task.priority==="high"||z.task.priority==="urgent")&&jsx(Flag,{className:"w-3.5 h-3.5 text-red-400"})]},z.id))})]})]})})]})}var vc={bgPrimary:"#050505",bgSecondary:"#080808",bgHover:"rgba(255, 255, 255, 0.02)",bgToday:"rgba(0, 127, 255, 0.08)",bgWeekend:"#050505",bgOtherMonth:"#080808",border:"#222222",borderLight:"#1a1a1a",textPrimary:"rgba(255, 255, 255, 0.90)",textSecondary:"rgba(255, 255, 255, 0.60)",textMuted:"rgba(255, 255, 255, 0.30)",textToday:"#007FFF",accent:"#007FFF",accentHover:"#3399FF",accentLight:"rgba(0, 127, 255, 0.15)",statusTodo:"rgba(255, 255, 255, 0.40)",statusInProgress:"#007FFF",statusCompleted:"#34D399",focusRing:"#007FFF",glass:"rgba(20, 20, 20, 0.6)",glassBorder:"rgba(255, 255, 255, 0.08)",glassHover:"rgba(255, 255, 255, 0.05)",neonRed:"#FF2E2E",glowBlue:"0 0 10px rgba(0, 127, 255, 0.3)",glowRed:"0 0 10px rgba(255, 46, 46, 0.4)"},wc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",glass:"rgba(255, 255, 255, 0.8)",glassBorder:"rgba(0, 0, 0, 0.08)",glassHover:"rgba(0, 0, 0, 0.04)",neonRed:"#DC2626",glowBlue:"0 0 10px rgba(0, 127, 255, 0.15)",glowRed:"0 0 10px rgba(220, 38, 38, 0.2)"},kc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",glass:"rgba(26, 26, 46, 0.6)",glassBorder:"rgba(255, 255, 255, 0.06)",glassHover:"rgba(255, 255, 255, 0.04)",neonRed:"#EF4444",glowBlue:"0 0 10px rgba(99, 102, 241, 0.3)",glowRed:"0 0 10px rgba(239, 68, 68, 0.3)"},ol={dark:vc,light:wc,neutral:kc};function f0(e){return ol[e]||ol.dark}function kw({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:l}){let[c,i]=useState(false),p=useMemo(()=>t.filter(g=>e.cardIds.includes(g.id)),[t,e.cardIds]),d=useMemo(()=>{let g=p.length,y=new Set(p.flatMap(f=>f.assignedUserIds||[])).size,x=p.map(f=>f.priority).filter(Boolean),h=new Set(p.flatMap(f=>f.labels||[])).size;return {totalCards:g,uniqueAssignees:y,priorities:x,labels:h}},[p]),m=()=>{o?.(e.id);};return jsxs("div",{className:u("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxs("div",{className:"card-stack-header",onClick:m,children:[jsxs("div",{className:"card-stack-header-left",children:[jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:u("card-stack-chevron",e.isExpanded&&"expanded"),children:jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsx("h3",{className:"card-stack-title",children:e.title}),jsx("div",{className:"card-stack-badge",children:d.totalCards}),jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),c&&jsx("div",{className:"card-stack-actions",children:jsx("button",{className:"card-stack-action",onClick:g=>{g.stopPropagation(),n?.(e.id);},"aria-label":"Delete stack",children:jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxs("div",{className:"card-stack-summary",children:[jsxs("div",{className:"card-stack-summary-item",children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxs("span",{children:[d.uniqueAssignees," assignees"]})]}),d.labels>0&&jsxs("div",{className:"card-stack-summary-item",children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxs("span",{children:[d.labels," labels"]})]}),e.confidence&&jsx("div",{className:"card-stack-summary-item",children:jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsx("div",{className:"card-stack-content",children:p.length===0?jsxs("div",{className:"card-stack-empty",children:[jsx("p",{children:"No cards in this stack"}),jsx("span",{children:"Drag cards here or delete this stack"})]}):jsx("div",{className:"card-stack-cards",children:p.map(g=>jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsx("div",{onClick:()=>r?.(g),children:a(g)}):jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(g),children:[jsx("h4",{children:g.title}),g.description&&jsxs("p",{children:[g.description.substring(0,100),"..."]})]}),jsx("button",{className:"card-stack-unstack-btn",onClick:y=>{y.stopPropagation(),s?.(e.id,g.id);},"aria-label":"Remove from stack",children:jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.id))})})]})}var h0={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Os(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function $s(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function y0(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function x0({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:l}){let c=useMemo(()=>({...h0,...n}),[n]),[i,p]=useState(new Set),d=useRef(null),m=useMemo(()=>{if(!c.groupByDay)return [{date:null,events:e}];let b=new Map;return e.forEach(w=>{let C=w.timestamp.toISOString().split("T")[0],S=b.get(C);S?S.push(w):b.set(C,[w]);}),Array.from(b.entries()).sort((w,C)=>C[0].localeCompare(w[0])).map(([w,C])=>({date:new Date(w),events:C.sort((S,E)=>E.timestamp.getTime()-S.timestamp.getTime())}))},[e,c.groupByDay]),{uniqueUsers:g,uniqueTypes:y}=useMemo(()=>{let b=new Set,w=new Set;return e.forEach(C=>{b.add(C.userId),w.add(C.type);}),{uniqueUsers:Array.from(b),uniqueTypes:Array.from(w)}},[e]),x=b=>{p(w=>{let C=new Set(w);return C.has(b)?C.delete(b):C.add(b),C});},h=b=>{let C=new Date().getTime()-b.getTime(),S=Math.floor(C/6e4),E=Math.floor(C/36e5),k=Math.floor(C/864e5);return S<1?"just now":S<60?`${S}m ago`:E<24?`${E}h ago`:k<7?`${k}d ago`:b.toLocaleDateString()},f=useMemo(()=>{let b=0;return t.types&&t.types.length>0&&b++,t.users&&t.users.length>0&&b++,t.dateRange&&b++,t.searchTerm&&b++,b},[t]);return useEffect(()=>{if(s&&d.current){let b=d.current.querySelector(`[data-event-id="${s}"]`);b&&b.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxs("div",{className:u("history-timeline-empty",l),children:[jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxs("div",{className:u("history-timeline",c.compact&&"compact",l),children:[jsxs("div",{className:"history-timeline-filters",children:[jsxs("div",{className:"history-timeline-filter-group",children:[jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:b=>{let w=b.target.value;a({...t,types:w?[w]:void 0});},children:[jsx("option",{value:"",children:"All Events"}),y.map(b=>jsxs("option",{value:b,children:[$s(b)," ",b.replace("_"," ")]},b))]}),g.length>1&&jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:b=>{let w=b.target.value;a({...t,users:w?[w]:void 0});},children:[jsx("option",{value:"",children:"All Users"}),g.map(b=>jsx("option",{value:b,children:b},b))]}),jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:b=>a({...t,searchTerm:b.target.value})})]}),f>0&&jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",f,")"]})]}),jsx("div",{className:"history-timeline-container",ref:d,children:m.map(b=>jsxs("div",{className:"history-timeline-group",children:[c.groupByDay&&b.date&&jsxs("div",{className:"history-timeline-day-header",children:[jsx("span",{className:"history-timeline-day-date",children:b.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxs("span",{className:"history-timeline-day-count",children:[b.events.length," events"]})]}),jsx("div",{className:"history-timeline-events",children:b.events.map((w,C)=>{let S=i.has(w.id),E=s===w.id,k=y0(w.type);return jsxs("div",{"data-event-id":w.id,className:u("history-timeline-event",S&&"expanded",E&&"selected"),onClick:()=>o?.(w),children:[jsxs("div",{className:"history-timeline-line",children:[jsx("div",{className:"history-timeline-dot",style:{backgroundColor:k},children:c.showIcons&&jsx("span",{className:"history-timeline-dot-icon",children:$s(w.type)})}),C<b.events.length-1&&jsx("div",{className:"history-timeline-connector",style:{borderColor:k}})]}),jsxs("div",{className:"history-timeline-event-content",children:[jsxs("div",{className:"history-timeline-event-header",children:[jsxs("div",{className:"history-timeline-event-header-left",children:[c.showAvatars&&w.userAvatar&&jsx("img",{src:w.userAvatar,alt:w.userName||w.userId,className:"history-timeline-event-avatar"}),jsxs("div",{className:"history-timeline-event-description",children:[jsx("span",{className:"history-timeline-event-user",children:w.userName||w.userId}),jsx("span",{className:"history-timeline-event-action",children:Os(w)})]})]}),jsx("div",{className:"history-timeline-event-time",children:c.useRelativeTime?h(w.timestamp):w.timestamp.toLocaleString()})]}),Object.keys(w.changes).length>0&&jsxs("button",{className:"history-timeline-event-toggle",onClick:v=>{v.stopPropagation(),x(w.id);},children:[S?"\u25BC":"\u25B6"," Show changes"]}),S&&jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(w.changes).map(([v,P])=>jsxs("div",{className:"history-timeline-event-change",children:[jsxs("span",{className:"history-timeline-event-change-key",children:[v,":"]}),jsxs("div",{className:"history-timeline-event-change-values",children:[jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(P.from)}),jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(P.to)})]})]},v)),w.metadata&&Object.keys(w.metadata).length>0&&jsxs("div",{className:"history-timeline-event-metadata",children:[jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(w.metadata).map(([v,P])=>jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxs("span",{className:"history-timeline-event-metadata-key",children:[v,":"]}),jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(P)})]},v))]})]})]})]},w.id)})})]},b.date?.toISOString()||"all"))})]})}function w0({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:l,onSpeedChange:c,className:i}){let p=[.5,1,1.5,2,3],d=useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),m=useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxs("div",{className:u("history-replay-empty",i),children:[jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxs("div",{className:u("history-replay",i),children:[jsxs("div",{className:"history-replay-current-event",children:[jsx("div",{className:"history-replay-event-icon",children:d&&$s(d.type)}),jsxs("div",{className:"history-replay-event-info",children:[jsx("div",{className:"history-replay-event-description",children:d&&Os(d)}),jsxs("div",{className:"history-replay-event-meta",children:[jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsx("span",{className:"history-replay-event-time",children:d&&d.timestamp.toLocaleString()})]})]})]}),jsxs("div",{className:"history-replay-progress-container",children:[jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:g=>l(parseInt(g.target.value))}),jsx("div",{className:"history-replay-progress-fill",style:{width:`${m}%`}}),jsx("div",{className:"history-replay-progress-markers",children:t.map((g,y)=>jsx("div",{className:u("history-replay-progress-marker",y===e.currentIndex&&"active"),style:{left:`${y/(e.totalEvents-1)*100}%`},onClick:()=>l(y),title:Os(g)},g.id))})]}),jsxs("div",{className:"history-replay-controls",children:[jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:o,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsx("button",{className:"history-replay-control-btn",onClick:n,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxs("div",{className:"history-replay-speed",children:[jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsx("div",{className:"history-replay-speed-buttons",children:p.map(g=>jsxs("button",{className:u("history-replay-speed-btn",e.speed===g&&"active"),onClick:()=>c(g),children:[g,"x"]},g))})]}),jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxs("div",{className:"history-replay-shortcuts",children:[jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"\u2190"})," Previous"]}),jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"\u2192"})," Next"]}),jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxs("div",{className:"history-replay-card-preview",children:[jsxs("div",{className:"history-replay-card-preview-header",children:[jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsx("span",{className:"history-replay-card-preview-time",children:d&&d.timestamp.toLocaleDateString()})]}),jsxs("div",{className:"history-replay-card-preview-content",children:[jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(g=>jsx("span",{className:"history-replay-card-preview-label-tag",children:g},g))})]})]})]})]}):jsxs("div",{className:u("history-replay-start",i),children:[jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsx("span",{children:"Start Time Travel"})]}),jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function Cc(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function Tc(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function k0(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function C0(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Ew(e,t,a,r,o,s=100){let n=e.map(c=>({...c,x:c.x??a/2+Math.random()*100-50,y:c.y??r/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(n.map(c=>[c.id,c]));for(let c=0;c<s;c++){let i=1-c/s;n.forEach(p=>{let d=a/2,m=r/2;p.vx+=(d-p.x)*o.centerForce*i,p.vy+=(m-p.y)*o.centerForce*i,n.forEach(g=>{if(p.id===g.id)return;let y=p.x-g.x,x=p.y-g.y,h=Math.sqrt(y*y+x*x)||1,f=o.chargeStrength*i/(h*h);p.vx+=y/h*f,p.vy+=x/h*f;});}),t.forEach(p=>{let d=l.get(typeof p.source=="string"?p.source:p.source.id),m=l.get(typeof p.target=="string"?p.target:p.target.id);if(!d||!m)return;let g=m.x-d.x,y=m.y-d.y,x=Math.sqrt(g*g+y*y)||1,h=(x-o.linkDistance)/x*o.forceStrength*i;d.vx+=g*h,d.vy+=y*h,m.vx-=g*h,m.vy-=y*h;}),n.forEach(p=>{p.fx!==null&&p.fx!==void 0?(p.x=p.fx,p.vx=0):p.x+=p.vx,p.fy!==null&&p.fy!==void 0?(p.y=p.fy,p.vy=0):p.y+=p.vy,p.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,p.x)),p.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,p.y)),p.vx*=.9,p.vy*=.9;});}return n}function T0({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:l,className:c}){let i=useRef(null),[p,d]=useState([]),[m,g]=useState(null),[y,x]=useState(null),[h,f]=useState(null),[b,w]=useState(1),[C,S]=useState({x:0,y:0});useEffect(()=>{if(e.length===0)return;let H=Ew(e,t,a.width,a.height,a,150);d(H);},[e,t,a]);let E=useCallback((H,Y)=>{a.enableDragging&&(Y.stopPropagation(),g(H));},[a.enableDragging]),k=useCallback(H=>{if(!m||!i.current)return;let T=i.current.getBoundingClientRect(),G=(H.clientX-T.left-C.x)/b,te=(H.clientY-T.top-C.y)/b;d(Le=>Le.map(B=>B.id===m?{...B,x:G,y:te,fx:G,fy:te}:B));},[m,b,C]),v=useCallback(()=>{g(null);},[]),P=useCallback((H,Y)=>{Y.stopPropagation(),l?.({type:"node-click",node:H,position:{x:Y.clientX,y:Y.clientY}});},[l]),L=useCallback((H,Y)=>{Y.stopPropagation(),l?.({type:"edge-click",edge:H,position:{x:Y.clientX,y:Y.clientY}});},[l]),M=useCallback(H=>{let Y=p.find(T=>T.id===H);return Y?{x:Y.x,y:Y.y}:{x:0,y:0}},[p]),J=useCallback(H=>{if(H.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return H.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let Y=H.card.priority;return Y==="URGENT"?"#ef4444":Y==="HIGH"?"#f59e0b":Y==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return H.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxs("div",{className:u("relationships-graph-empty",c),children:[jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxs("div",{className:u("relationships-graph",c),children:[jsxs("div",{className:"relationships-graph-controls",children:[jsxs("div",{className:"relationships-graph-stats",children:[jsxs("span",{className:"relationships-graph-stat",children:[jsx("span",{className:"relationships-graph-stat-value",children:n.totalNodes}),jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxs("span",{className:"relationships-graph-stat",children:[jsx("span",{className:"relationships-graph-stat-value",children:n.totalEdges}),jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>w(H=>Math.min(H+.2,3)),children:"+"}),jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(b*100),"%"]}),jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>w(H=>Math.max(H-.2,.5)),children:"\u2212"}),jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{w(1),S({x:0,y:0});},children:"Reset"})]})]}),jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(H=>H.type))).map(H=>jsxs("div",{className:"relationships-graph-legend-item",children:[jsx("div",{className:"relationships-graph-legend-color",style:{background:Cc(H)}}),jsxs("span",{className:"relationships-graph-legend-label",children:[k0(H)," ",Tc(H)]})]},H))}),jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:k,onMouseUp:v,onMouseLeave:v,children:[jsxs("g",{transform:`translate(${C.x}, ${C.y}) scale(${b})`,children:[jsx("g",{className:"relationships-graph-edges",children:t.map(H=>{let Y=M(typeof H.source=="string"?H.source:H.source.id),T=M(typeof H.target=="string"?H.target:H.target.id),G=C0(H.type),te=h===H.id,Le=H.onCriticalPath;return jsxs("g",{className:u("relationships-graph-edge",te&&"hovered",Le&&"critical"),onMouseEnter:()=>f(H.id),onMouseLeave:()=>f(null),onClick:B=>L(H,B),children:[jsx("line",{x1:Y.x,y1:Y.y,x2:T.x,y2:T.y,stroke:Cc(H.type),strokeWidth:Le?a.edgeWidth*2:a.edgeWidth,strokeOpacity:te?1:.6,markerEnd:G?"url(#arrowhead)":void 0}),a.showEdgeLabels&&te&&jsx("text",{x:(Y.x+T.x)/2,y:(Y.y+T.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Tc(H.type)})]},H.id)})}),jsx("g",{className:"relationships-graph-nodes",children:p.map(H=>{let Y=y===H.id,T=H.onCriticalPath;return jsxs("g",{className:u("relationships-graph-node",Y&&"hovered",T&&"critical"),transform:`translate(${H.x}, ${H.y})`,onMouseDown:G=>E(H.id,G),onMouseEnter:()=>x(H.id),onMouseLeave:()=>x(null),onClick:G=>P(H,G),children:[jsx("circle",{r:T?a.nodeSize*1.2:a.nodeSize,fill:J(H),stroke:T?"#fbbf24":"#ffffff",strokeWidth:T?3:2,opacity:Y?1:.9}),a.showLabels&&jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:H.card.title.length>20?H.card.title.substring(0,20)+"...":H.card.title})]},H.id)})})]}),jsx("defs",{children:jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function S0({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=useState(""),[l,c]=useState(false),[i,p]=useState(null),[d,m]=useState(null),g=useRef(null),y=l||o;useEffect(()=>{e&&g.current&&g.current.focus();},[e]),useEffect(()=>{let b=w=>{w.key==="Escape"&&!y&&x();};if(e)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,y]);let x=()=>{y||(n(""),p(null),m(null),t());},h=async()=>{if(!(!s.trim()||y)){c(true),p(null),m(null);try{let b=await r(s.trim());m(b);}catch(b){p(b instanceof Error?b.message:"Failed to generate plan");}finally{c(false);}}},f=()=>{d&&(a(d),x());};return e?jsxs(Zt,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:x}),jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:b=>b.stopPropagation(),children:[jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsx("button",{onClick:x,disabled:y,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:d?jsx(Fragment,{children:jsxs("div",{className:"space-y-4",children:[jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),d.explanation&&jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsx("p",{className:"text-sm text-white/90",children:d.explanation})}),jsxs("div",{children:[jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",d.columns.length,")"]}),jsx("div",{className:"flex gap-2 flex-wrap",children:d.columns.map((b,w)=>jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:b.title},w))})]}),jsxs("div",{children:[jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",d.cards.length,")"]}),jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[d.cards.slice(0,10).map((b,w)=>jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex-1",children:[jsx("p",{className:"text-sm font-medium text-white/90",children:b.title}),b.description&&jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:b.description})]}),b.priority&&jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${b.priority==="URGENT"?"bg-red-500/20 text-red-400":b.priority==="HIGH"?"bg-orange-500/20 text-orange-400":b.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:b.priority})]})},w)),d.cards.length>10&&jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",d.cards.length-10," more tasks..."]})]})]})]})}):jsxs(Fragment,{children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsx("textarea",{ref:g,value:s,onChange:b=>n(b.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:y}),jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((b,w)=>jsx("button",{onClick:()=>n(b),disabled:y,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:b},w))})]})]})}),jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsx("div",{children:y&&jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsx("span",{children:"Generating with AI..."})]})}),jsxs("div",{className:"flex items-center gap-3",children:[jsx("button",{onClick:x,disabled:y,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),d?jsx("button",{onClick:f,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsx("button",{onClick:h,disabled:!s.trim()||y,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:y?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Nc={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Fw={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Pw={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Aw(e,t,a){let r=Nc[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Hs(e){return `$${e.toFixed(4)}`}var Dc=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Aw(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let r=a.length,o=a.reduce((d,m)=>d+m.cost,0),s=a.reduce((d,m)=>d+m.inputTokens,0),n=a.reduce((d,m)=>d+m.outputTokens,0),l=a.filter(d=>d.success),c=a.reduce((d,m)=>d+m.duration,0),i={},p={};return a.forEach(d=>{i[d.feature]=(i[d.feature]||0)+1,p[d.feature]=(p[d.feature]||0)+d.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:p,averageDuration:r>0?c/r:0,successRate:r>0?l.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let l=this.operations.filter(p=>p.timestamp>=n).length,c=Math.max(0,o-l),i=l/o*100;return {used:l,limit:o,remaining:c,percentUsed:i,isExceeded:l>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},gn=new Dc;function F0({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=useState(gn.getStats()),[s,n]=useState(gn.checkLimit(a));if(useEffect(()=>{if(!e)return;let c=setInterval(()=>{o(gn.getStats()),n(gn.checkLimit(a));},1e3);return ()=>clearInterval(c)},[e,a]),useEffect(()=>{let c=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]),!e)return null;let l=gn.getRecentOperations(5);return jsxs(Zt,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:c=>c.stopPropagation(),children:[jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Hs(r.totalCost)})]}),jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:r.totalOperations})]}),jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([c,i])=>{let p=r.costsByFeature[c]||0,d=r.totalOperations>0?i/r.totalOperations*100:0;return jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:c.replace(/([A-Z])/g," $1").trim()}),jsxs("div",{className:"flex items-center gap-3",children:[jsxs("span",{className:"text-xs text-white/60",children:[i," ops"]}),jsx("span",{className:"text-xs font-semibold text-green-400",children:Hs(p)})]})]}),jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsx("div",{className:"h-full bg-blue-500",style:{width:`${d}%`}})})]},c)})})]}),jsxs("div",{children:[jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),l.length===0?jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsx("div",{className:"space-y-2",children:l.map(c=>jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:c.feature.replace(/([A-Z])/g," $1").trim()}),jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(c.timestamp).toLocaleTimeString()," \u2022"," ",c.duration,"ms"]})]}),jsxs("div",{className:"flex items-center gap-3",children:[jsxs("span",{className:"text-xs text-white/60",children:[c.inputTokens+c.outputTokens," tokens"]}),jsx("span",{className:"text-xs font-semibold text-green-400",children:Hs(c.cost)}),jsx("div",{className:`w-2 h-2 rounded-full ${c.success?"bg-green-400":"bg-red-400"}`})]})]},c.id))})]})]}),jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function L0({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,l]=useState(""),[c,i]=useState(""),[p,d]=useState(""),[m,g]=useState(false),[y,x]=useState(null),[h,f]=useState(null),[b,w]=useState(null),C=useRef(null),S=m||o;useEffect(()=>{e&&C.current&&C.current.focus();},[e]),useEffect(()=>{let L=M=>{M.key==="Escape"&&!S&&E();};if(e)return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[e,S]);let E=()=>{S||(l(""),i(""),d(""),x(null),f(null),w(null),t());},k=async()=>{if(!(!n.trim()||S)){g(true),x(null),f(null),w(null);try{let L=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:c||void 0,endDate:p||void 0});f(L.tasks.tasks),w({from_cache:L.from_cache,tokens_used:L.tokens_used,mock_mode:L.mock_mode,similarity:L.similarity,tokens_saved:L.tokens_saved});}catch(L){x(L instanceof Error?L.message:"Failed to generate tasks");}finally{g(false);}}},v=()=>{h&&(a(h),E());};if(!e)return null;let P=b?.similarity?((b.similarity||0)*100).toFixed(0):"0";return jsxs(Zt,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:E}),jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:L=>L.stopPropagation(),children:[jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsx("button",{onClick:E,disabled:S,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:h?jsx(Fragment,{children:jsxs("div",{className:"space-y-4",children:[jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxs("div",{className:"flex flex-wrap gap-2",children:[b?.mock_mode&&jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),b?.from_cache?jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",P,"% similar)"]}):jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[b?.tokens_used||0," tokens"]}),b?.tokens_saved&&jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[b.tokens_saved," tokens saved"]}),jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[h.length," tasks"]})]}),jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:h.map((L,M)=>jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex-1",children:[jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxs("span",{className:"text-xs text-white/50",children:["#",M+1]}),jsx("p",{className:"text-sm font-medium text-white/90",children:L.name})]}),jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),L.start," \u2192 ",L.end]}),jsxs("span",{children:[L.duration," days"]}),L.dependencies.length>0&&jsxs("span",{className:"text-blue-400",children:["Depends: ",L.dependencies.join(", ")]})]})]}),jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${L.priority==="high"?"bg-red-500/20 text-red-400":L.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:L.priority})]})},L.id))})]})}):jsxs(Fragment,{children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsx("textarea",{ref:C,value:n,onChange:L=>l(L.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:S}),jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsx("input",{type:"date",value:c,onChange:L=>i(L.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:S})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsx("input",{type:"date",value:p,onChange:L=>d(L.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:S})]})]}),y&&jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:y}),jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((L,M)=>jsx("button",{onClick:()=>l(L),disabled:S,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:L},M))})]})]})}),jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsx("div",{children:S&&jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsx("span",{children:"Generating with AI..."})]})}),jsxs("div",{className:"flex items-center gap-3",children:[jsx("button",{onClick:E,disabled:S,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),h?jsx("button",{onClick:v,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsx("button",{onClick:k,disabled:!n.trim()||S,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:S?"Generating...":"Generate Tasks"})]})]})]})})]})}function il({initialBoard:e,onPersist:t}){let[a,r]=useState(e),o=useCallback(h=>{t&&Xs(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(f,b,w)=>{console.warn(`Retry attempt ${b} after ${w}ms: ${f.message}`);}}).then(f=>{f.success||console.error(`Failed to persist board after ${f.attempts} attempts:`,f.error);});},[t]),s=useCallback(async(h,f,b)=>{r(w=>{let C=w.cards.find(L=>L.id===h);if(!C)return w;let S=C.columnId,E={...C,columnId:f,position:b},k=w.cards.map(L=>L.id===h?E:L),v=w.columns.map(L=>{if(L.id===S)return {...L,cardIds:L.cardIds.filter(M=>M!==h)};if(L.id===f){let M=k.filter(J=>J.columnId===f).sort((J,H)=>J.position-H.position);return {...L,cardIds:M.map(J=>J.id)}}return L}),P={...w,cards:k,columns:v};return o(P),P});},[o]),n=useCallback(async(h,f)=>{r(b=>{let w=b.cards.map(S=>S.id===h?{...S,...f}:S),C={...b,cards:w};return o(C),C});},[o]),l=useCallback(async h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let w={...h,id:f},C=b.columns.map(E=>E.id===h.columnId?{...E,cardIds:[...E.cardIds,f]}:E),S={...b,cards:[...b.cards,w],columns:C};return o(S),S});},[o]),c=useCallback(async h=>{r(f=>{let b=f.cards.find(E=>E.id===h);if(!b)return f;let w=f.cards.filter(E=>E.id!==h),C=f.columns.map(E=>E.id===b.columnId?{...E,cardIds:E.cardIds.filter(k=>k!==h)}:E),S={...f,cards:w,columns:C};return o(S),S});},[o]),i=useCallback(async h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let w={...h,id:f,cardIds:[]},C={...b,columns:[...b.columns,w]};return o(C),C});},[o]),p=useCallback(async(h,f)=>{r(b=>{let w=b.columns.map(S=>S.id===h?{...S,...f}:S),C={...b,columns:w};return o(C),C});},[o]),d=useCallback(async h=>{r(f=>{let b=f.cards.filter(S=>S.columnId!==h),w=f.columns.filter(S=>S.id!==h),C={...f,cards:b,columns:w};return o(C),C});},[o]),m=useCallback(h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(h),f},[l]),g=useCallback(h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),f},[i]),y=useCallback(()=>{r(h=>{let f={...h,cards:[],columns:[]};return o(f),f});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:l,onCardDelete:c,onColumnCreate:i,onColumnUpdate:p,onColumnDelete:d},setBoard:r,helpers:{addCard:m,addColumn:g,deleteCard:c,deleteColumn:d,clearBoard:y}}}function B0({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=il({initialBoard:e,onPersist:a}),n=useMemo(()=>({addCard:(c,i,p={})=>{s.addCard({title:i,columnId:c,position:r.cards.filter(d=>d.columnId===c).length,...p});},addColumn:(c,i)=>{let p=r.columns.length>0?Math.max(...r.columns.map(d=>d.position)):0;s.addColumn({title:c,position:i??p+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var zs={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},O0={by:"none",order:"asc"};function $0({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=useState({...zs,...e}),[s,n]=useState({...O0,...t}),l=useCallback(x=>{o(h=>({...h,...x}));},[]),c=useCallback(x=>{n(h=>({...h,...x}));},[]),i=useCallback(()=>{o(zs),n(O0);},[]),p=useCallback(()=>{a&&o({...zs,assignees:[a]});},[a]),d=useCallback(()=>{o({...zs,dateFilter:"overdue"});},[]),m=useCallback(()=>{o({...zs,priorities:["HIGH","URGENT"]});},[]),g=useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),y=useCallback(x=>{let h=[...x];if(r.search){let f=r.search.toLowerCase();h=h.filter(b=>b.title.toLowerCase().includes(f)||b.description?.toLowerCase().includes(f));}if(r.dateFilter!=="all"){let f=new Date,b=f.getFullYear(),w=String(f.getMonth()+1).padStart(2,"0"),C=String(f.getDate()).padStart(2,"0"),S=`${b}-${w}-${C}`;h=h.filter(E=>{if(!E.endDate&&!E.dueDate)return false;let k=E.endDate||E.dueDate;if(!k)return false;let v;if(typeof k=="string")v=k.split("T")[0]||k;else {let P=k.getUTCFullYear(),L=String(k.getUTCMonth()+1).padStart(2,"0"),M=String(k.getUTCDate()).padStart(2,"0");v=`${P}-${L}-${M}`;}switch(r.dateFilter){case "overdue":return v<S;case "today":return v===S;case "this-week":let P=new Date(S+"T00:00:00"),L=new Date(v+"T00:00:00"),M=new Date(P);return M.setDate(M.getDate()+7),L>=P&&L<=M;case "custom":if(r.dateRange){let J=typeof k=="string"?new Date(k):k;return J>=r.dateRange.start&&J<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(h=h.filter(f=>f.priority&&r.priorities.includes(f.priority))),r.assignees.length>0&&(h=h.filter(f=>(f.assignedUserIds||(f.assigneeId?[f.assigneeId]:[])).some(w=>r.assignees.includes(w)))),r.labels.length>0&&(h=h.filter(f=>f.labels&&f.labels.some(b=>r.labels.includes(b)))),r.columns.length>0&&(h=h.filter(f=>r.columns.includes(f.columnId))),s.by!=="none"&&h.sort((f,b)=>{let w=0;switch(s.by){case "created":let C=f.createdAt?new Date(f.createdAt).getTime():0,S=b.createdAt?new Date(b.createdAt).getTime():0;w=C-S;break;case "priority":let E={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},k=E[f.priority||"LOW"],v=E[b.priority||"LOW"];w=k-v;break;case "dueDate":let P=f.endDate||f.dueDate,L=b.endDate||b.dueDate;if(!P)return 1;if(!L)return -1;let M=typeof P=="string"?new Date(P).getTime():P.getTime(),J=typeof L=="string"?new Date(L).getTime():L.getTime();w=M-J;break;case "title":w=f.title.localeCompare(b.title);break;case "estimate":let H=f.estimatedTime||0,Y=b.estimatedTime||0;w=H-Y;break;default:w=0;}return s.order==="asc"?w:-w}),h},[r,s]);return {filters:r,sort:s,setFilters:l,setSort:c,resetFilters:i,filterMyTasks:p,filterOverdue:d,filterHighPriority:m,applyFilters:y,hasActiveFilters:g}}var z0,U0;if(typeof window<"u")try{let e=Ks("ai");z0=e.generateObject,U0=e.generateText;}catch{}function W0(e={}){let[t,a]=useState(false),[r,o]=useState(null),s=!!(z0&&U0&&e.apiKey),n=useCallback(async d=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(null);try{return console.log("Generating plan for:",d),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${d}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(m){let g=m instanceof Error?m:new Error("Failed to generate plan");throw o(g),g}finally{a(false);}},[s]),l=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(m){let g=m instanceof Error?m:new Error("Failed to suggest assignee");throw o(g),g}finally{a(false);}},[s]),c=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(m){let g=m instanceof Error?m:new Error("Failed to predict risks");throw o(g),g}finally{a(false);}},[s]),i=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",d.title),[{title:`Subtask 1 for: ${d.title}`,position:d.position+.1,columnId:d.columnId},{title:`Subtask 2 for: ${d.title}`,position:d.position+.2,columnId:d.columnId}]}catch(m){let g=m instanceof Error?m:new Error("Failed to generate subtasks");throw o(g),g}finally{a(false);}},[s]),p=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(m){let g=m instanceof Error?m:new Error("Failed to estimate effort");throw o(g),g}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:l,onPredictRisks:c,onGenerateSubtasks:i,onEstimateEffort:p,isAvailable:s,isLoading:t,error:r}}function Ec(){let[e,t]=useState(()=>selectionStore.getState());useEffect(()=>selectionStore.subscribe(o=>{t(o);}),[]);let a=useCallback(r=>{selectionStore.setState(r);},[]);return [e,a]}function V0(e){let{cards:t}=e,[a,r]=Ec(),o=useCallback(d=>a.selectedCardIds.includes(d),[a.selectedCardIds]),s=useCallback((d,m)=>{if(!m){r({selectedCardIds:[d],lastSelectedCardId:d});return}let g=m.ctrlKey||m.metaKey,y=m.shiftKey;if(g)a.selectedCardIds.includes(d)?r({selectedCardIds:a.selectedCardIds.filter(x=>x!==d),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});else if(y&&a.lastSelectedCardId){let x=t.find(f=>f.id===d),h=t.find(f=>f.id===a.lastSelectedCardId);if(x&&h&&x.columnId===h.columnId){let f=t.filter(v=>v.columnId===x.columnId).sort((v,P)=>v.position-P.position),b=f.findIndex(v=>v.id===a.lastSelectedCardId),w=f.findIndex(v=>v.id===d),[C,S]=b<w?[b,w]:[w,b],E=f.slice(C,S+1).map(v=>v.id),k=Array.from(new Set([...a.selectedCardIds,...E]));r({selectedCardIds:k,lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});},[t,a,r]),n=useCallback(d=>{r({selectedCardIds:a.selectedCardIds.filter(m=>m!==d),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),l=useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),c=useCallback(()=>{r({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=useCallback(d=>{a.selectedCardIds.includes(d)?n(d):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});},[a,n,r]),p=useCallback(()=>t.filter(d=>a.selectedCardIds.includes(d.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:l,selectAll:c,toggleCard:i,getSelectedCards:p}}var G0={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function j0(e){let{cards:t,config:a,aiService:r}=e,o=useMemo(()=>({...G0,...a}),[a]),[s,n]=useState([]),l=useCallback((x,h,f,b,w)=>{if(h.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let C={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:x,cardIds:h,columnId:f,strategy:b,color:w,isExpanded:true,position:s.filter(S=>S.columnId===f).length,createdAt:new Date};n(S=>[...S,C]);},[o.minCardsPerStack,s]),c=useCallback(x=>{n(h=>h.filter(f=>f.id!==x));},[]),i=useCallback(x=>{n(h=>h.map(f=>f.id===x?{...f,isExpanded:!f.isExpanded}:f));},[]),p=useCallback((x,h)=>{n(f=>f.map(b=>b.id===x&&!b.cardIds.includes(h)?{...b,cardIds:[...b.cardIds,h]}:b));},[]),d=useCallback((x,h)=>{n(f=>f.map(b=>{if(b.id===x){let w=b.cardIds.filter(C=>C!==h);return w.length<o.minCardsPerStack?null:{...b,cardIds:w}}return b}).filter(b=>b!==null));},[o.minCardsPerStack]),m=useCallback(x=>s.filter(h=>h.columnId===x).sort((h,f)=>h.position-f.position),[s]),g=useCallback(async x=>{let h=t.filter(S=>S.columnId===x);if(h.length<o.minCardsPerStack*2)return [];let f=[],b=new Map;h.forEach(S=>{S.labels&&S.labels.length>0&&S.labels.forEach(E=>{b.has(E)||b.set(E,[]),b.get(E).push(S);});}),b.forEach((S,E)=>{S.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F4CC} ${E}`,cardIds:S.map(k=>k.id),columnId:x,strategy:"labels",color:"#3b82f6"},reason:`${S.length} cards with label "${E}"`,confidence:.85});});let w=new Map;h.forEach(S=>{S.assignedUserIds&&S.assignedUserIds.length>0&&S.assignedUserIds.forEach(E=>{w.has(E)||w.set(E,[]),w.get(E).push(S);});}),w.forEach((S,E)=>{S.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F464} Assigned to user-${E.slice(-4)}`,cardIds:S.map(k=>k.id),columnId:x,strategy:"assignee",color:"#8b5cf6"},reason:`${S.length} cards assigned to the same user`,confidence:.8});});let C=new Map;if(h.forEach(S=>{S.priority&&(C.has(S.priority)||C.set(S.priority,[]),C.get(S.priority).push(S));}),C.forEach((S,E)=>{if(S.length>=o.minCardsPerStack){let k={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[E.toLowerCase()]||"\u26AA";f.push({stack:{title:`${k} ${E} Priority`,cardIds:S.map(v=>v.id),columnId:x,strategy:"priority",color:E==="high"||E==="urgent"?"#ef4444":"#10b981"},reason:`${S.length} cards with ${E} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let S of h){let k=(await r.findSimilar(S,h)).filter(v=>v.similarity>=o.autoStackConfidenceThreshold);if(k.length>=o.minCardsPerStack-1){let v=[S.id,...k.map(L=>L.card.id)],P=k.reduce((L,M)=>L+M.similarity,0)/k.length;f.push({stack:{title:`\u2728 Similar to "${S.title.substring(0,30)}${S.title.length>30?"...":""}"`,cardIds:v,columnId:x,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${k.length+1} similar tasks`,confidence:P});}}return f.filter(S=>S.confidence>=o.autoStackConfidenceThreshold).sort((S,E)=>E.confidence-S.confidence).slice(0,5)},[t,o,r]),y=useCallback(x=>{l(x.stack.title,x.stack.cardIds,x.stack.columnId,x.stack.strategy,x.stack.color);},[l]);return useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let f=await g(h),b=f[0];f.length>0&&b&&b.confidence>=.9&&y(b);});},[]),{stacks:s,createStack:l,deleteStack:c,toggleStack:i,addToStack:p,removeFromStack:d,getStacksForColumn:m,getSuggestions:g,applySuggestion:y,config:o}}var _0=createContext(null);function K0({children:e,initialData:t,onStateChange:a}){let r=useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(c=>{let{Column:i}=Ks("@libxai/core");s.set(c.id,new i(c));}),t?.cards?.forEach(c=>{let{Card:i}=Ks("@libxai/core");n.set(c.id,new i(c));});let l=null;if(t?.board){let{Board:c}=Ks("@libxai/core");l=new c(t.board);}r.current=new BoardStore({board:l,columns:s,cards:n});}let o=r.current;return useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsx(_0.Provider,{value:{store:o},children:e})}function ll(){let e=useContext(_0);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Ws(){let e=ll(),[t,a]=useState(e.getBoard()),[r,o]=useState(e.getAllColumns()),[s,n]=useState(e.getAllCards());useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let l=useCallback(b=>{e.updateBoard(b);},[e]),c=useCallback(b=>{e.addColumn(b);},[e]),i=useCallback((b,w)=>{e.updateColumn(b,w);},[e]),p=useCallback(b=>{e.deleteColumn(b);},[e]),d=useCallback(b=>e.getColumn(b),[e]),m=useCallback(b=>{e.addCard(b);},[e]),g=useCallback((b,w)=>{e.updateCard(b,w);},[e]),y=useCallback(b=>{e.deleteCard(b);},[e]),x=useCallback((b,w,C)=>{e.moveCard(b,w,C);},[e]),h=useCallback(b=>e.getCard(b),[e]),f=useCallback(b=>e.getCardsByColumn(b),[e]);return {board:t,columns:r,cards:s,updateBoard:l,addColumn:c,updateColumn:i,deleteColumn:p,getColumn:d,addCard:m,updateCard:g,deleteCard:y,moveCard:x,getCard:h,getCardsByColumn:f}}function Y0(e){let{cards:t}=Ws();return useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function X0(e="position",t="asc"){let{cards:a}=Ws();return useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},c=o.priority?l[o.priority]:0,i=s.priority?l[s.priority]:0;n=c-i;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var dl=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=lu.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let l=await Promise.resolve(n.apply(s,a));l!==void 0&&(o=l,a[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,l,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},Yw=new dl;function Q0({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:l=0,getItemKey:c}){let i=useRef(null),p=useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:l}),d=p.getVirtualItems(),m={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},g=n?{width:`${p.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${p.getTotalSize()}px`,width:"100%",position:"relative"};return jsx("div",{ref:i,style:m,className:o,children:jsx("div",{style:g,children:d.map(y=>{let x=e[y.index];if(!x)return null;let h=c?c(x,y.index):y.index,f={position:"absolute",top:n?0:y.start,left:n?y.start:0,width:n?y.size:"100%",height:n?"100%":y.size};return jsx("div",{style:f,"data-index":y.index,children:r(x,y.index)},h)})})})}function Z0(e){return useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function tf({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:l=16,getItemKey:c,horizontal:i=true}){let p=useRef(null),d=useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>p.current,estimateSize:()=>r,overscan:n,gap:l}),m=d.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},y={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsx("div",{ref:p,style:g,className:s,children:jsx("div",{style:y,children:m.map(x=>{let h=e[x.index];if(!h)return null;let f=c?c(h,x.index):x.index,b={position:"absolute",top:0,left:x.start,width:x.size,height:"100%"};return jsx("div",{style:b,"data-index":x.index,children:o(h,x.index)},f)})})})}function af(e){let t=useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function rf(e,t=10){return e>t}var Ac={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Lc={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Ic={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Bc={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Rc={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Oc={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},$c={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Hc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},zc={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Uc={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Wc={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},Vc={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},cl={spacing:Ac,borderRadius:Lc,fontSize:Ic,fontWeight:Bc,lineHeight:Rc,zIndex:Oc,duration:$c,easing:Hc,shadows:zc,opacity:Uc,kanban:Wc,gantt:Vc};function of(e,t,a){return e[t]??a}function Gc(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?Gc(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function Qw(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function jc(e="asakaa"){let t=Gc(cl),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=Qw(o);a.push(` ${s}: ${n};`);}return `:root {
|
|
433
|
+
Total: ${Ka(p)}`:void 0;return jsxs("div",{className:u("flex items-center justify-between",w&&"cursor-help"),title:C,children:[jsxs("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:[n?"Ejecutado":"Executed",w&&jsx("span",{className:"ml-1 opacity-50",children:"\u24D8"})]}),jsx("span",{className:u("text-[11px] font-mono font-bold",y?"text-[#F87171]":t?"text-white/80":"text-gray-800"),children:Ka(p)})]})})(),c>0&&jsx("div",{className:u("w-full h-2.5 rounded-full overflow-hidden mt-2",t?"bg-white/[0.06]":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(g,100)}%`,backgroundColor:x}})}),jsxs("div",{className:u("mt-2 px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",d>=0?t?"bg-[#00E5CC]/10 text-[#00E5CC]":"bg-emerald-50 text-emerald-600":t?"bg-[#F87171]/10 text-[#F87171]":"bg-red-50 text-red-600"),children:[d>=0?`+${Ka(d)} ${n?"Disp.":"Avail."}`:`${Ka(Math.abs(d))} ${n?"P\xE9rdida":"Loss"}`,c>0&&jsxs("span",{className:"text-[10px] ml-1 opacity-60",children:["(",m,"%)"]})]})]})]})})(),(e.totalHoursSpentMinutes!==void 0||e.totalHoursAllocatedMinutes!==void 0)&&(()=>{let c=e.totalHoursSpentMinutes??0,i=e.totalHoursAllocatedMinutes??0,p=i>0?Math.min(Math.round(c/i*100),100):0,g=(i>0?c/i:0)>1.1?"#F87171":p>=90?"#FFD60A":"#3BF06E";return jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"HORAS DEL PROYECTO":"PROJECT HOURS"}),jsxs("div",{className:"space-y-2",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"Usado":"Spent"}),jsx("span",{className:u("text-[11px] font-mono font-bold",t?"text-white/80":"text-gray-800"),children:jg(c)})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"Asignado":"Allocated"}),jsx("span",{className:u("text-[11px] font-mono",t?"text-white/60":"text-gray-600"),children:jg(i)})]}),i>0&&jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden mt-1",t?"bg-white/[0.06]":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${p}%`,backgroundColor:g}})})]})]})})(),(e.openRFIs!==void 0||e.submittalsApprovalPercent!==void 0)&&jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"SALUD T\xC9CNICA":"TECHNICAL HEALTH"}),jsxs("div",{className:"space-y-3",children:[e.openRFIs!==void 0&&jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"RFIs Abiertos":"Open RFIs"}),jsx("span",{className:u("px-2 py-0.5 rounded text-[11px] font-mono font-bold",e.openRFIs>0?"bg-[#F87171]/15 text-[#F87171]":"bg-[#3BF06E]/15 text-[#3BF06E]"),children:e.openRFIs})]}),e.submittalsApprovalPercent!==void 0&&jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:n?"Aprobaci\xF3n Submittals":"Submittals Approval"}),jsxs("span",{className:u("text-[11px] font-mono font-bold",e.submittalsApprovalPercent>=80?"text-[#3BF06E]":"text-[#FFD60A]"),children:[e.submittalsApprovalPercent,"%"]})]})]})]}),e.unassignedCount!=null&&e.unassignedCount>0&&jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"TAREAS SIN ASIGNAR":"UNASSIGNED TASKS"}),jsxs("div",{className:"flex items-center gap-3 mb-3",children:[jsx("div",{className:u("flex items-center justify-center w-10 h-10 rounded-lg font-mono text-lg font-bold",e.unassignedCount>=10?"bg-[#F87171]/15 text-[#F87171]":"bg-[#FFD60A]/15 text-[#FFD60A]"),children:e.unassignedCount}),jsxs("div",{children:[jsx("p",{className:u("text-xs font-medium",t?"text-white/80":"text-gray-700"),children:e.unassignedCount===1?n?"tarea pendiente":"pending task":n?"tareas pendientes":"pending tasks"}),jsx("p",{className:u("text-[10px]",t?"text-white/40":"text-gray-400"),children:n?"sin recurso asignado":"without assigned resource"})]})]}),e.unassignedTasks&&e.unassignedTasks.length>0&&jsx("div",{className:u("space-y-1.5 overflow-y-auto scrollbar-slim",e.unassignedTasks.length>5?"max-h-[170px]":""),children:e.unassignedTasks.map(c=>jsxs("button",{onClick:()=>s?.(c.id),className:u("flex items-center gap-2 px-2.5 py-1.5 rounded-md text-[11px] w-full text-left transition-colors",t?"bg-white/[0.04] text-white/70 hover:bg-white/[0.08] hover:text-white":"bg-gray-50 text-gray-600 hover:bg-gray-100 hover:text-gray-900",s&&"cursor-pointer"),children:[jsx("span",{className:u("w-1.5 h-1.5 rounded-full flex-shrink-0",(e.unassignedCount??0)>=10?"bg-[#F87171]":"bg-[#FFD60A]")}),jsx("span",{className:"truncate",children:c.name})]},c.id))})]}),e.scheduleVarianceDays!==void 0&&jsxs("div",{className:u("px-5 py-4 border-b",t?"border-[#222]":"border-gray-200"),children:[jsx("h4",{className:u("text-[10px] font-mono uppercase tracking-wider mb-3",t?"text-white/40":"text-gray-500"),children:n?"VARIACI\xD3N DE CRONOGRAMA":"SCHEDULE VARIANCE"}),(()=>{let c=e.scheduleVarianceDays??0,i=c>0,p=c<0,d=e.scheduleVarianceLabel||(i?`+${c} ${n?"D\xEDas ADELANTE":"Days AHEAD"}`:p?`${c} ${n?"D\xEDas ATR\xC1S":"Days BEHIND"}`:n?"EN TIEMPO":"ON TRACK");return jsx("div",{className:u("px-3 py-2 rounded-lg text-center font-mono text-sm font-bold",i&&"bg-[#3BF06E]/15 text-[#3BF06E]",p&&"bg-[#F87171]/15 text-[#F87171]",!i&&!p&&"bg-[#3B9EFF]/15 text-[#3B9EFF]"),children:d})})()]}),e.teams&&e.teams.length>0&&jsxs("div",{className:"px-5 py-4",children:[jsx("h4",{className:u("text-[11px] font-mono uppercase tracking-wider font-semibold mb-3",t?"text-white/60":"text-gray-600"),children:n?"DISPONIBILIDAD DEL EQUIPO":"TEAM AVAILABILITY"}),jsx("div",{className:"space-y-3",children:e.teams.map((c,i)=>{let p=c.utilizationPercent>=100?"#F87171":c.utilizationPercent>=80?"#FFD60A":c.color||"#3BF06E";return jsxs("div",{children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("span",{className:u("text-xs",t?"text-white/60":"text-gray-600"),children:c.name}),jsxs("span",{className:u("text-[10px] font-mono",t?"text-white/40":"text-gray-500"),children:[c.utilizationPercent,"%"]})]}),jsx("div",{className:u("w-full h-1.5 rounded-full overflow-hidden",t?"bg-white/[0.06]":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(c.utilizationPercent,100)}%`,backgroundColor:p}})})]},`${c.name}-${i}`)})})]})]})}var lw=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function Zg(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...Zg(r.subtasks,t+1));return a}function dw(e){let t=e.subtasks;if(!t?.length)return null;let a=new Date,r=0,o=0;for(let s of t){if(!s.startDate||!s.endDate)continue;let n=s.startDate.getTime(),c=s.endDate.getTime()-n;if(c<=0)continue;let p=Math.max(0,Math.min(a.getTime()-n,c))/c*100;if(p<=0)continue;let d=(s.progress||0)/p;r+=d,o++;}return o>0?r/o:null}function Xn(e){if(!e.subtasks?.length)return {spent:0,allocated:0,quoted:0};let t=0,a=0,r=0;for(let o of e.subtasks)if(o.subtasks?.length){let s=Xn(o);t+=s.spent>0?s.spent:o.timeLoggedMinutes??0,a+=s.allocated>0?s.allocated:o.effortMinutes??0,r+=s.quoted>0?s.quoted:o.soldEffortMinutes??0;}else t+=o.timeLoggedMinutes??0,a+=o.effortMinutes??0,r+=o.soldEffortMinutes??0;return {spent:t,allocated:a,quoted:r}}function Yn(e){if(e<=0)return "0h";let t=Math.floor(e/60),a=e%60;return a>0?`${t}h ${a}m`:`${t}h`}function cw({value:e,onChange:t,isDark:a}){let[r,o]=useState(false),[s,n]=useState(String(e||""));return r?jsx("input",{autoFocus:true,type:"text",inputMode:"decimal",value:s,onClick:l=>l.stopPropagation(),onChange:l=>n(l.target.value.replace(/[^0-9.]/g,"")),onBlur:()=>{let l=parseFloat(s);!isNaN(l)&&l>=0&&l<=100?t(l):s===""&&t(0),o(false);},onKeyDown:l=>{l.key==="Enter"&&l.target.blur(),l.key==="Escape"&&(n(String(e||"")),o(false));},className:u("w-14 text-xs text-right font-mono px-1 py-0.5 rounded border outline-none",a?"bg-white/5 border-[#00E5CC]/50 text-white":"bg-gray-50 border-blue-400 text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"}}):jsx("button",{onClick:l=>{l.stopPropagation(),n(String(e||"")),o(true);},className:u("text-xs font-mono cursor-pointer hover:underline",e>0?a?"text-white/80":"text-gray-700":a?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:e>0?`${e}%`:"\u2014"})}function Jg(e){if(e.length===0)return 0;let t=0,a=0,r=0;for(let l of e){let c=l.weight||0;c>0&&(t+=(l.progress||0)*c,a+=c,r+=1);}let o=r/e.length;if(a>=99&&o>=.95)return Math.round(t/a*10)/10;if(e.reduce((l,c)=>l+(c.effort_minutes||0),0)>0){let l=0,c=0;for(let i of e){let p=i.effort_minutes||60;l+=(i.progress||0)*p,c+=p;}return Math.round(l/c*10)/10}let n=e.reduce((l,c)=>l+(c.progress||0),0);return Math.round(n/e.length*10)/10}function uc(e,t=[]){for(let a of e)a.subtasks&&a.subtasks.length>0?uc(a.subtasks,t):t.push({progress:a.progress||0,weight:a.weight||0,effort_minutes:a.effort_minutes??a.effortMinutes});return t}function e0({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:l=[],customFields:c=[],toolbarRightContent:i}){let{theme:p="dark",locale:d="en",customTranslations:m,showSearch:g=true,showHierarchy:y=true,tableColumns:x,allowColumnCustomization:h=true,allowColumnResize:f=true,enableContextMenu:b=true,showCreateTaskButton:w=false,onCreateTask:C,persistFilter:S=false,financialBlur:E,healthSidebar:k,lens:v="hours",hourlyRate:P=0,rateMap:L,aggregateParentHours:M=false,showProjectTotals:J=false,totalsDollarOverride:H}=t,Y=Vi(d,m),T=p==="dark",G=F=>{if(!L||!F.assignees||F.assignees.length===0)return P;let se=0,Ce=0;for(let Re of F.assignees){let tt=Re.id?L[Re.id]:void 0;if(tt==null||tt<=0)continue;let me=typeof Re.estimatedMinutes=="number"?Re.estimatedMinutes:0;me>0&&(se+=tt*me,Ce+=me);}if(Ce>0)return se/Ce;let ve=F.assignees.map(Re=>Re.id?L[Re.id]:void 0).filter(Re=>Re!=null&&Re>0);return ve.length===0?P:ve.reduce((Re,tt)=>Re+tt,0)/ve.length},te=F=>{let se=0,Ce=0,ve=0,Re=tt=>{for(let me of tt)if(me.subtasks&&me.subtasks.length>0){let Ke={s:se,a:Ce,q:ve};if(Re(me.subtasks),se-Ke.s+(Ce-Ke.a)+(ve-Ke.q)===0){let yt=G(me);se+=(me.timeLoggedMinutes??0)/60*yt,Ce+=(me.effortMinutes??0)/60*yt,ve+=(me.soldEffortMinutes??0)/60*yt;}}else {let Ke=G(me);se+=(me.timeLoggedMinutes??0)/60*Ke,Ce+=(me.effortMinutes??0)/60*Ke,ve+=(me.soldEffortMinutes??0)/60*Ke;}};return F.subtasks&&Re(F.subtasks),{dollarSpent:se,dollarAllocated:Ce,dollarQuoted:ve}},Le=useCallback(()=>{if(!S||typeof window>"u")return {statusFilter:"all",hideCompleted:false};try{let F=localStorage.getItem(S);if(F){let se=JSON.parse(F);return {statusFilter:se.statusFilter||"all",hideCompleted:se.hideCompleted||!1}}}catch(F){console.error("Error loading persisted filter:",F);}return {statusFilter:"all",hideCompleted:false}},[S]),B=useMemo(()=>{function F(se){let Ce=0,ve=0,Re=0,tt=0,me=0,Ke=0;for(let Ze of se)if(Ze.subtasks&&Ze.subtasks.length>0){let yt=F(Ze.subtasks);if(yt.spent+yt.allocated+yt.quoted>0)Ce+=yt.spent,ve+=yt.allocated,Re+=yt.quoted,tt+=yt.dollarSpent,me+=yt.dollarAllocated,Ke+=yt.dollarQuoted;else {let jt=Ze.timeLoggedMinutes??0,Ut=Ze.effortMinutes??0,na=Ze.soldEffortMinutes??0;Ce+=jt,ve+=Ut,Re+=na;let _t=G(Ze);tt+=jt/60*_t,me+=Ut/60*_t,Ke+=na/60*_t;}}else {let yt=Ze.timeLoggedMinutes??0,oa=Ze.effortMinutes??0,jt=Ze.soldEffortMinutes??0;Ce+=yt,ve+=oa,Re+=jt;let Ut=G(Ze);tt+=yt/60*Ut,me+=oa/60*Ut,Ke+=jt/60*Ut;}return {spent:Ce,allocated:ve,quoted:Re,dollarSpent:tt,dollarAllocated:me,dollarQuoted:Ke}}return F(e)},[e]),q=useMemo(()=>{let F=new Map;function se(Ce){let ve=0;for(let Re of Ce)if(Re.subtasks&&Re.subtasks.length>0){let tt=se(Re.subtasks);F.set(Re.id,tt),ve+=tt;}else ve+=Re.weight||0;return ve}return se(e),F},[e]),be=useMemo(()=>!k?.enabled||!k.data?k:{...k,data:{...k.data,totalHoursSpentMinutes:B.spent,totalHoursAllocatedMinutes:B.allocated}},[k,B]),[_e,$]=useState(true),[ee,le]=useState(null),[ke,xe]=useState("position"),[Be,He]=useState("asc"),[at,ue]=useState(""),[je,Xe]=useState(()=>Le().statusFilter),[he,kt]=useState(()=>Le().hideCompleted),[xt,nt]=useState(x||lw),[ze,ct]=useState(false),[et,Ee]=useState(false),[V,D]=useState({isOpen:false,x:0,y:0,type:"task"}),[U,ae]=useState(null),[Ne,z]=useState(false),[oe,Ge]=useState(null),[ge,Ve]=useState(null),[Oe,Ue]=useState(null),lt=useRef(0),ot=useRef(false),st=!!(a.onTaskMove||a.onTaskReparent),pt=useCallback((F,se)=>{st&&(se.preventDefault(),lt.current=se.clientY,ae(F),ot.current=false,z(false),Ue({x:se.clientX,y:se.clientY}));},[st]),Tt=useCallback(F=>{if(!U||(Math.abs(F.clientY-lt.current)>5&&!ot.current&&(ot.current=true,z(true)),Ue({x:F.clientX,y:F.clientY}),!ot.current))return;let Ce=document.querySelectorAll("[data-listview-row]"),ve=null,Re=null;Ce.forEach(tt=>{let me=tt.getBoundingClientRect(),Ke=tt.getAttribute("data-listview-row");if(Ke&&Ke!==U&&F.clientY>=me.top&&F.clientY<=me.bottom){ve=Ke;let Ze=F.clientY-me.top,yt=me.height;Re=Ze<yt*.25?"above":Ze>yt*.75?"below":"child";}}),Ge(ve),Ve(Re);},[U]),Ot=useCallback(()=>{if(ot.current&&U&&oe&&ge){if(ge==="child"&&a.onTaskReparent)a.onTaskReparent(U,oe);else if(ge==="above"||ge==="below"){let F=(ve,Re,tt=null)=>{for(let me of ve){if(me.id===Re)return tt;if(me.subtasks){let Ke=F(me.subtasks,Re,me.id);if(Ke!==void 0)return Ke}}},se=F(e,U,null),Ce=F(e,oe,null);if(a.onTaskReparent){let ve=(yt,oa)=>{if(oa===null)return yt;for(let jt of yt){if(jt.id===oa)return jt.subtasks||[];if(jt.subtasks){let Ut=ve(jt.subtasks,oa);if(Ut.length>0||jt.subtasks.some(na=>na.id===oa))return Ut}}return []},Re=ve(e,Ce??null),tt=Re.findIndex(yt=>yt.id===oe),me=se===Ce,Ke=me?Re.findIndex(yt=>yt.id===U):-1,Ze=ge==="below"?tt+1:tt;me&&Ke!==-1&&Ke<tt&&(Ze-=1),a.onTaskReparent(U,Ce??null,Math.max(0,Ze));}}}ae(null),Ge(null),Ve(null),Ue(null),ot.current=false,z(false);},[U,oe,ge,e,a]);useEffect(()=>{if(U)return document.addEventListener("mousemove",Tt),document.addEventListener("mouseup",Ot),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",Tt),document.removeEventListener("mouseup",Ot),document.body.style.cursor="",document.body.style.userSelect="";}},[U,Tt,Ot]);let[St,Et]=useState("all"),[Ft,mt]=useState(false),Vt=useRef(null),ht=useRef(null),it=useMemo(()=>{let F=0;function se(Ce,ve){for(let Re of Ce)ve>F&&(F=ve),Re.subtasks?.length&&se(Re.subtasks,ve+1);}return se(e,1),F},[e]);useEffect(()=>{if(!Ft)return;let F=se=>{Vt.current?.contains(se.target)||ht.current?.contains(se.target)||mt(false);};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[Ft]),useEffect(()=>{if(St==="all"){let Ce=function(ve){for(let Re of ve)Re.subtasks?.length&&(Re.isExpanded===false&&a.onTaskToggleExpand?.(Re.id),Ce(Re.subtasks));};Ce(e);}else {let Ce=function(ve,Re){for(let tt of ve)if(tt.subtasks?.length){let me=Re<St,Ke=tt.isExpanded!==false;me!==Ke&&a.onTaskToggleExpand?.(tt.id),Ce(tt.subtasks,Re+1);}};Ce(e,1);}},[St]);let[ne,pe]=useState(null),[O,_]=useState(0),[De,Qe]=useState(0),bt=useRef(null),[Dt,Pt]=useState(null),[At,ta]=useState(null);useEffect(()=>{x&&nt(F=>{if(F.length===x.length){let se=true;for(let Ce=0;Ce<F.length;Ce++){let ve=F[Ce],Re=x[Ce];if(!ve||!Re||ve.id!==Re.id||ve.visible!==Re.visible||ve.width!==Re.width||ve.label!==Re.label){se=false;break}}if(se)return F}return x});},[x]),useEffect(()=>{if(!(!S||typeof window>"u"))try{localStorage.setItem(S,JSON.stringify({statusFilter:je,hideCompleted:he}));}catch(F){console.error("Error persisting filter state:",F);}},[S,je,he]);let la=useMemo(()=>{let F=new Set;function se(Ce){for(let ve of Ce)ve.subtasks?.length&&(ve.isExpanded!==false&&F.add(ve.id),se(ve.subtasks));}return se(e),F},[e]),Q=useMemo(()=>xt.filter(F=>F.visible),[xt]),$e=useCallback(F=>{a.onTaskToggleExpand?.(F);},[a]),Fe=useCallback(F=>{ke===F?He(se=>se==="asc"?"desc":"asc"):(xe(F),He("asc")),a.onSortChange?.({column:F,direction:Be==="asc"?"desc":"asc"});},[ke,Be,a]),I=useCallback(F=>{nt(F),a.onColumnsChange?.(F);},[a]),ye=useCallback(F=>{let se=xt.map(Ce=>Ce.id===F?{...Ce,visible:false}:Ce);I(se);},[xt,I]),Z=useCallback((F,se)=>{xe(F),He(se);},[]),N=useCallback((F,se,Ce)=>{b&&(F.preventDefault(),D({isOpen:true,x:F.clientX,y:F.clientY,type:se?"task":"header",task:se,columnId:Ce}));},[b]),K=useCallback(()=>{D(F=>({...F,isOpen:false}));},[]),Te=useCallback((F,se)=>{if(!f)return;F.preventDefault(),F.stopPropagation();let Ce=xt.find(ve=>ve.id===se);Ce&&(pe(se),_(F.clientX),Qe(Ce.width));},[xt,f]);useEffect(()=>{if(!ne)return;let F=xt,se=ve=>{let Re=ve.clientX-O,tt=Math.max(50,De+Re);F=F.map(me=>me.id===ne?{...me,width:tt}:me),nt(F);},Ce=()=>{a.onColumnsChange?.(F),pe(null);};return document.addEventListener("mousemove",se),document.addEventListener("mouseup",Ce),()=>{document.removeEventListener("mousemove",se),document.removeEventListener("mouseup",Ce);}},[ne,O,De,a]);let Pe=useCallback((F,se)=>{if(se==="name"){F.preventDefault();return}Pt(se),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",se),F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="0.5");},[]),$t=useCallback(F=>{F.currentTarget instanceof HTMLElement&&(F.currentTarget.style.opacity="1"),Pt(null),ta(null);},[]),Ct=useCallback((F,se)=>{F.preventDefault(),se!=="name"&&(F.dataTransfer.dropEffect="move",ta(se));},[]),Jt=useCallback(()=>{ta(null);},[]),Wa=useCallback((F,se)=>{if(F.preventDefault(),!Dt||Dt===se||se==="name")return;let Ce=[...xt],ve=Ce.findIndex(me=>me.id===Dt),Re=Ce.findIndex(me=>me.id===se);if(ve===-1||Re===-1)return;let tt=Ce.splice(ve,1);tt[0]&&(Ce.splice(Re,0,tt[0]),I(Ce),Pt(null),ta(null));},[Dt,xt,I]),ya=useCallback(async F=>{if(a.onCreateCustomField){let se={...F,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(se);}Ee(false);},[a]),wa=useCallback(F=>F.progress===100||F.status==="completed"?"completed":F.progress&&F.progress>0||F.status==="in-progress"?"in-progress":"todo",[]),dr=useMemo(()=>{let F=Zg(e);if(at.trim()){let se=at.toLowerCase();F=F.filter(Ce=>Ce.name.toLowerCase().includes(se));}return je!=="all"&&(F=F.filter(se=>wa(se)===je)),he&&(F=F.filter(se=>wa(se)!=="completed")),F.sort((se,Ce)=>{let ve,Re;switch(ke){case "name":ve=se.name.toLowerCase(),Re=Ce.name.toLowerCase();break;case "startDate":ve=se.startDate?.getTime()||0,Re=Ce.startDate?.getTime()||0;break;case "endDate":ve=se.endDate?.getTime()||0,Re=Ce.endDate?.getTime()||0;break;case "progress":ve=se.progress||0,Re=Ce.progress||0;break;case "status":ve=se.status||"todo",Re=Ce.status||"todo";break;case "priority":let tt={urgent:0,high:1,medium:2,low:3,none:4};ve=tt[se.priority]??4,Re=tt[Ce.priority]??4;break;case "position":return 0;default:return 0}return ve<Re?Be==="asc"?-1:1:ve>Re?Be==="asc"?1:-1:0}),F},[e,at,je,he,ke,Be,wa]),Ar=useCallback((F,se)=>{let Ce=tt=>{a.onTaskUpdate?.({...F,...tt});},ve=tt=>tt?F.customFields?.find(Ke=>Ke.fieldId===tt)?.value:void 0,Re=(tt,me)=>{if(!tt)return;let Ze=[...F.customFields||[]],yt=Ze.findIndex(oa=>oa.fieldId===tt);yt>=0?Ze[yt]={fieldId:tt,value:me}:Ze.push({fieldId:tt,value:me}),Ce({customFields:Ze});};switch(se.type){case "name":return null;case "status":return jsx(Wm,{value:F.status||(F.progress===100?"completed":F.progress&&F.progress>0?"in-progress":"todo"),onChange:me=>{Ce({status:me,progress:me==="completed"?100:me==="in-progress"?50:0});},isDark:T,locale:d,translations:Y.status});case "priority":return jsx(Gm,{value:F.priority,onChange:me=>Ce({priority:me}),isDark:T,locale:d});case "assignees":{let me=F.hasChildren,Ke=F.assignees||[];if(me&&F.subtasks?.length){let Ze=new Map,yt=oa=>{(oa||[]).forEach(jt=>{(jt.assignees||[]).forEach(Ut=>{Ze.has(Ut.name)||Ze.set(Ut.name,Ut);}),jt.subtasks?.length&&yt(jt.subtasks);});};yt(F.subtasks),Ke=Array.from(Ze.values());}else me&&(Ke=[]);return jsx(qd,{value:Ke,availableUsers:l,onChange:Ze=>Ce({assignees:Ze}),isDark:T,locale:d,disabled:me})}case "startDate":return jsx(_i,{value:F.startDate,onChange:me=>Ce({startDate:me}),isDark:T,locale:d,dateField:"start",startDate:F.startDate,endDate:F.endDate});case "endDate":return jsx(_i,{value:F.endDate,onChange:me=>Ce({endDate:me}),isDark:T,locale:d,dateField:"end",startDate:F.startDate,endDate:F.endDate});case "progress":{let me=!!(F.subtasks&&F.subtasks.length>0),Ke=me?Jg(uc(F.subtasks||[])):F.progress||0;return jsx(Zm,{value:Ke,onChange:me?void 0:Ze=>{let yt=Ze===100?"completed":Ze>0?"in-progress":"todo";Ce({progress:Ze,status:yt});},isDark:T,disabled:me})}case "tags":return jsx(ug,{value:F.tags||[],isDark:T});case "text":return jsx(ag,{value:ve(se.customFieldId)||"",onChange:me=>Re(se.customFieldId,me),isDark:T});case "number":return jsx(ng,{value:ve(se.customFieldId)||0,onChange:me=>Re(se.customFieldId,me),isDark:T});case "date":let tt=ve(se.customFieldId);return jsx(_i,{value:tt?new Date(tt):void 0,onChange:me=>Re(se.customFieldId,me),isDark:T,locale:d});case "dropdown":return jsx(sg,{value:ve(se.customFieldId)||"",options:se.options||[],onChange:me=>Re(se.customFieldId,me),isDark:T});case "checkbox":return jsx(lg,{value:ve(se.customFieldId)||false,onChange:me=>Re(se.customFieldId,me),isDark:T});case "estimatedTime":{let me=F.status==="completed"||F.progress===100;return jsx(Dr,{value:F.estimatedTime,onChange:Ke=>Ce({estimatedTime:Ke}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F)})}case "quotedTime":{let me=F.status==="completed"||F.progress===100,Ke=E?.enabled&&(!E.columns||E.columns.includes("quotedTime"));return jsx(Dr,{value:F.quotedTime,onChange:Ze=>Ce({quotedTime:Ze}),isDark:T,locale:d,disabled:me,isBlurred:Ke,lens:v,hourlyRate:G(F)})}case "elapsedTime":{let me=F.status==="completed"||F.progress===100,Ke=F.executedDollarsCanonical;return jsx(Dr,{value:F.elapsedTime,onChange:Ze=>Ce({elapsedTime:Ze}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F),financialOverride:Ke})}case "effortMinutes":{if(M&&F.subtasks&&F.subtasks.length>0){let{allocated:oa}=Xn(F);if(v==="financial"){let jt=te(F),Ut=Math.round(jt.dollarAllocated),na=Math.round(jt.dollarQuoted),_t=na-Ut;return jsxs("div",{className:"flex flex-col",children:[Ut>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",Ut.toLocaleString("es-CO")]}):null,_t!==0&&Ut>0&&na>0&&jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",_t>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[_t>0?"+":"",Math.abs(_t)>=1e3?`$${(_t/1e3).toFixed(1)}K`:`$${_t}`]})]})}return jsx(Dr,{value:oa>0?oa:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:P})}let me=F.status==="completed"||F.progress===100,Ke=F.effortMinutes||0,Ze=F.soldEffortMinutes||0,yt=G(F);if(v==="financial"&&yt&&Ke>0&&Ze>0){let oa=Math.round(Ke/60*yt),Ut=Math.round(Ze/60*yt)-oa;return jsxs("div",{className:"flex flex-col",children:[jsx(Dr,{value:Ke,onChange:na=>Ce({effortMinutes:na}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F)}),Ut!==0&&jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Ut>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Ut>0?"+":"",Math.abs(Ut)>=1e3?`$${(Ut/1e3).toFixed(1)}K`:`$${Ut}`]})]})}return jsx(Dr,{value:Ke,onChange:oa=>Ce({effortMinutes:oa}),isDark:T,locale:d,disabled:me,lens:v,hourlyRate:G(F)})}case "timeLoggedMinutes":{let me=F.executedDollarsCanonical;if(M&&F.subtasks&&F.subtasks.length>0){let{spent:Ze}=Xn(F);return jsx(Dr,{value:Ze>0?Ze:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F),financialOverride:me})}let Ke=F.status==="completed"||F.progress===100;return jsx(Dr,{value:F.timeLoggedMinutes,onChange:a.onLogTime?Ze=>{a.onLogTime?.(F,Ze);}:void 0,isDark:T,locale:d,placeholder:d==="es"?"Agregar":"Add",disabled:Ke,lens:v,hourlyRate:G(F),financialOverride:me})}case "soldEffortMinutes":{if(M&&F.subtasks&&F.subtasks.length>0){let{quoted:Ze}=Xn(F),yt=E?.enabled&&(!E.columns||E.columns.includes("soldEffortMinutes"));return jsx(Dr,{value:Ze>0?Ze:void 0,isDark:T,locale:d,disabled:true,isBlurred:yt,lens:v,hourlyRate:G(F)})}let me=F.status==="completed"||F.progress===100,Ke=E?.enabled&&(!E.columns||E.columns.includes("soldEffortMinutes"));return jsx(Dr,{value:F.soldEffortMinutes,onChange:Ze=>Ce({soldEffortMinutes:Ze}),isDark:T,locale:d,disabled:me,isBlurred:Ke,lens:v,hourlyRate:G(F)})}case "scheduleVariance":{let me=F.effortMinutes||0,Ke=F.soldEffortMinutes||0,Ze=F.timeLoggedMinutes||0,yt=me>0||Ke>0||Ze>0;return jsx(fg,{startDate:F.startDate,endDate:F.endDate,scheduleVariance:F.scheduleVariance,isDark:T,locale:d,hasTimeAllocated:yt})}case "hoursBar":{if(M&&F.hasChildren){let{spent:me,allocated:Ke,quoted:Ze}=Xn(F),yt=me>Ke&&Ke>0;return jsxs("span",{className:u("text-[11px] font-mono flex items-center gap-1.5",T?"text-white/50":"text-gray-500"),children:[jsx("span",{className:u("font-bold",yt?"text-[#FF453A]":T?"text-white/80":"text-gray-800"),children:Yn(me)}),Ke>0&&jsxs(Fragment,{children:[" / ",jsx("span",{className:T?"text-white/60":"text-gray-600",children:Yn(Ke)})]}),Ze>0&&jsxs(Fragment,{children:[" / ",jsx("span",{className:T?"text-amber-400/70":"text-amber-600",children:Yn(Ze)})]})]})}return jsx(hg,{task:F,isDark:T,locale:d,onLogTime:a.onLogTime,onEstimateUpdate:a.onEstimateUpdate,onSoldEffortUpdate:a.onSoldEffortUpdate,showSoldEffort:t.showSoldEffort,onOpenTimeLog:a.onOpenTimeLog,lens:v,hourlyRate:G(F)})}case "teamLoad":return F.hasChildren||F.subtasks&&F.subtasks.length>0?jsx(xg,{task:F,isDark:T,locale:d}):jsx(qd,{value:F.assignees||[],availableUsers:l,onChange:Ke=>{a.onTaskUpdate?.({...F,assignees:Ke});},isDark:T,locale:d});case "blockers":return jsx(wg,{blockers:F.blockers,isDark:T,locale:d});case "weight":{let me=q.get(F.id);if(me!==void 0)return jsx("span",{className:u("text-xs font-mono",me>0?T?"text-white/50":"text-gray-400":T?"text-white/30":"text-gray-300"),style:{fontFamily:"JetBrains Mono, monospace"},children:me>0?`${Number(me.toFixed(2))}%`:"\u2014"});let Ke=F.weight||0;return jsx(cw,{value:Ke,onChange:Ze=>Ce({weight:Ze}),isDark:T})}default:return jsx("span",{className:u("text-sm",T?"text-white/60":"text-gray-500"),children:"-"})}},[a,T,d,l,Y,M,q]),Zn=useCallback(F=>{let Ce={name:Y.columns.name,status:Y.columns.status,priority:Y.columns.priority,assignees:Y.columns.assignees,startDate:Y.columns.startDate,endDate:Y.columns.endDate,progress:Y.columns.progress,tags:Y.columns.tags||(d==="es"?"Etiquetas":"Tags"),estimatedTime:Y.columns.estimatedTime||(d==="es"?"Estimado":"Estimated"),quotedTime:Y.columns.quotedTime||(d==="es"?"Ofertado":"Quoted"),elapsedTime:Y.columns.elapsedTime||(d==="es"?"Ejecutado":"Executed"),soldEffortMinutes:Y.columns.soldEffortMinutes||(d==="es"?"Ofertado":"Quoted"),effortMinutes:Y.columns.effortMinutes||(d==="es"?"Estimado":"Estimated"),timeLoggedMinutes:Y.columns.timeLoggedMinutes||(d==="es"?"Ejecutado":"Executed"),scheduleVariance:Y.columns.scheduleVariance||(d==="es"?"Prog / Var":"Sched / Var"),hoursBar:Y.columns.hoursBar||(d==="es"?"Horas (Usado / Asignado)":"Hours (Spent / Allocated)"),teamLoad:Y.columns.teamLoad||(d==="es"?"Equipo":"Team"),blockers:Y.columns.blockers||(d==="es"?"Bloqueantes":"Blockers"),weight:Y.columns.weight||(d==="es"?"Peso":"Weight")}[F.type]||F.label;return typeof Ce=="string"?Ce:String(Ce||F.type)},[Y,d]),Wr=useMemo(()=>{let Ce=Q.reduce((Re,tt)=>Re+tt.width,0)+(h?48:0),ve={};for(let Re of Q)ve[Re.id]=`${Re.width/Ce*100}%`;return ve},[Q,h]);return r?jsx("div",{className:u("flex-1 flex items-center justify-center",T?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007BFF]"}),jsxs("p",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:[Y.empty.noTasks,"..."]})]})}):o?jsx("div",{className:u("flex-1 flex items-center justify-center",T?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxs("div",{children:[jsx("h3",{className:u("text-lg font-semibold mb-2",T?"text-white":"text-gray-900"),children:"Error"}),jsx("p",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsx("div",{className:u("flex-1 flex items-center justify-center",T?"bg-[#0D0D0D]":"bg-white",s),style:n,children:jsxs("div",{className:"text-center max-w-md",children:[jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#007BFF]/10 flex items-center justify-center",children:jsx(List,{className:"w-8 h-8 text-[#007BFF]"})}),jsx("h3",{className:u("text-lg font-semibold mb-2",T?"text-white":"text-gray-900"),children:Y.empty.noTasks}),jsx("p",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:Y.empty.addFirstTask})]})}):jsxs("div",{ref:bt,className:u(T?"bg-[#0D0D0D]":"bg-white",ne&&"select-none",s),style:{display:"flex",flexDirection:"column",flex:"1 1 0%",width:"100%",height:"100%",overflow:"hidden",minHeight:0,...n},children:[jsx("div",{className:u("flex-shrink-0 px-6 py-4 border-b",T?"border-[#222]":"border-gray-200"),children:jsxs("div",{className:"flex items-center gap-4",children:[jsxs("div",{className:u("text-sm",T?"text-white/60":"text-gray-600"),children:[dr.length," ",Y.pagination.tasks]}),g&&jsxs("div",{className:"relative flex-1 max-w-md",children:[jsx(Search,{className:u("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",T?"text-white/60":"text-gray-400")}),jsx("input",{type:"text",value:at,onChange:F=>ue(F.target.value),placeholder:Y.toolbar.searchPlaceholder,className:u("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#007BFF]/30",T?"bg-white/[0.03] border-[#222] text-white placeholder:text-white/30 font-mono":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsx("div",{className:"flex-1"}),i&&jsx("div",{className:"flex items-center gap-2",children:i}),y&&it>1&&jsxs("div",{className:"relative",children:[jsxs("button",{ref:Vt,onClick:()=>mt(!Ft),className:u("flex items-center gap-1.5 px-2 py-1.5 rounded-lg border transition-colors text-[11px] font-medium",T?Ft?"bg-blue-500/10 border-blue-500/40 text-blue-400":"bg-white/[0.03] border-[#333] text-white/50 hover:text-white/70 hover:bg-white/[0.05]":Ft?"bg-blue-50 border-blue-300 text-blue-600":"bg-gray-100 border-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-200"),style:{fontFamily:"'JetBrains Mono', monospace"},children:[jsx(Layers,{className:"w-3.5 h-3.5"}),St==="all"?d==="es"?"Todos":"All":`L${St}`]}),Ft&&jsx("div",{ref:ht,className:u("absolute top-full mt-1 right-0 w-24 rounded-lg border overflow-hidden z-50 shadow-lg",T?"bg-[#1A1A1A] border-[#333]":"bg-white border-gray-200"),children:[{value:"all",label:d==="es"?"Todos":"All"},...Array.from({length:Math.min(it,5)},(F,se)=>({value:se+1,label:`L${se+1}`}))].map(F=>jsxs("button",{onClick:()=>{Et(F.value),mt(false);},className:u("w-full px-3 py-2 text-left text-xs transition-colors flex items-center justify-between",T?St===F.value?"bg-blue-500/10 text-blue-400":"text-white/60 hover:bg-white/[0.05] hover:text-white/80":St===F.value?"bg-blue-50 text-blue-600":"text-gray-600 hover:bg-gray-100"),children:[jsx("span",{children:F.label}),St===F.value&&jsx("span",{className:"text-blue-400",children:"\u2713"})]},String(F.value)))})]}),jsx(Gg,{value:je,hideCompleted:he,onChange:Xe,onHideCompletedChange:kt,isDark:T,locale:d}),be?.enabled&&be.data&&!_e&&jsx("button",{onClick:()=>$(true),className:u("flex items-center justify-center w-8 h-8 rounded-lg border transition-colors",T?"border-[#333] text-white/40 hover:text-white/70 hover:bg-white/[0.05]":"border-gray-200 text-gray-400 hover:text-gray-600 hover:bg-gray-100"),title:d==="es"?"Abrir panel de salud":"Open health panel",children:jsx(PanelRight,{className:"w-4 h-4"})}),t.toolbarEndContent,w&&C&&jsxs(motion.button,{onClick:C,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-[transform,box-shadow]",style:{background:"linear-gradient(135deg, #007BFF 0%, #005FCC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 123, 255, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 123, 255, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-4 h-4"}),jsx("span",{children:Y.toolbar.newTask})]})]})}),jsxs("div",{style:{display:"flex",flex:"1 1 0%",overflow:"hidden",minHeight:0},children:[jsx("div",{style:{flex:"1 1 0%",overflow:"auto",minHeight:0},children:jsxs("div",{style:{width:"100%"},children:[jsxs("div",{className:u("flex-shrink-0 flex items-center border-b text-[10px] font-bold uppercase tracking-wider sticky top-0 z-10",T?"border-[#222] bg-[#1A1A1A] font-mono text-white/70":"border-gray-200 bg-gray-50 text-gray-600"),children:[st&&jsx("div",{className:"w-5 flex-shrink-0"}),Q.map(F=>{let se=F.id!=="name",Ce=At===F.id&&Dt!==F.id;return jsxs("div",{className:u("relative flex items-center gap-2 px-4 py-2 transition-all duration-150 group",T?"text-white/60":"text-gray-500",se&&"cursor-grab",F.type!=="name"&&"justify-center",Dt===F.id&&"opacity-50",Ce&&(T?"bg-[#007BFF]/20 border-l-2 border-l-[#007BFF]":"bg-blue-50 border-l-2 border-l-blue-400")),style:{width:Wr[F.id],minWidth:F.minWidth},draggable:se,onDragStart:se?ve=>Pe(ve,F.id):void 0,onDragEnd:se?$t:void 0,onDragOver:se?ve=>Ct(ve,F.id):void 0,onDragLeave:se?Jt:void 0,onDrop:se?ve=>Wa(ve,F.id):void 0,onContextMenu:ve=>N(ve,void 0,F.id),children:[se&&jsx(GripVertical,{className:u("w-3 h-3 flex-shrink-0 transition-opacity",T?"text-white/20 group-hover:text-white/50":"text-gray-300 group-hover:text-gray-500")}),F.sortable?jsxs("button",{draggable:false,onClick:()=>Fe(F.id),className:"flex items-center gap-1 hover:text-[#007BFF]",children:[Zn(F),jsx(ArrowUpDown,{className:u("w-3 h-3",ke===F.id&&"text-[#007BFF]")})]}):jsx("span",{draggable:false,children:Zn(F)}),f&&F.resizable&&jsx("div",{className:u("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#007BFF]",ne===F.id&&"bg-[#007BFF]"),onMouseDown:ve=>Te(ve,F.id)})]},F.id)}),h&&jsxs("div",{className:"relative flex items-center justify-center w-12 flex-shrink-0",children:[jsx("button",{onClick:F=>{F.stopPropagation(),ct(se=>!se);},className:u("p-0.5 rounded transition-colors",T?"hover:bg-white/[0.05] text-white/60 hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",ze&&(T?"bg-white/[0.05]":"bg-gray-200")),title:d==="es"?"Agregar columna":"Add column",children:jsx(Plus,{className:"w-3 h-3"})}),jsx(Og,{isOpen:ze,onClose:()=>ct(false),columns:xt,customFields:c,onColumnsChange:I,onCreateCustomField:()=>{ct(false),Ee(true);},isDark:T,locale:d})]})]}),jsx(AnimatePresence,{mode:"popLayout",children:dr.map((F,se)=>{let Ce=la.has(F.id),ve=Math.min(se*.01,.2),Re=F.hasChildren&&F.level===0,tt=F.subtasks?.length||0;if(Re){let{spent:jt,allocated:Ut,quoted:na}=Xn(F),_t=dw(F);return jsxs(motion.div,{"data-task-id":F.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:ve},className:u("flex items-center border-y cursor-pointer transition-colors duration-500",T?"border-[#222] bg-[#222]":"border-gray-200 bg-gray-100",ee===F.id&&(T?"!bg-[#FFD60A]/15":"!bg-yellow-100")),onClick:()=>a.onTaskClick?.(F),children:[st&&jsx("div",{className:"w-5 flex-shrink-0"}),Q.map(Ba=>jsx("div",{className:u("flex items-center px-4 py-3 min-h-[56px]",Ba.type!=="name"&&"justify-center"),style:{width:Wr[Ba.id],minWidth:Ba.minWidth},children:Ba.type==="name"?jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[jsx("button",{onClick:Nt=>{Nt.stopPropagation(),$e(F.id);},className:u("p-0.5 rounded flex-shrink-0 mt-0.5",T?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsx(ChevronDown,{className:u("w-4 h-4",T?"text-white/40":"text-gray-500")}):jsx(ChevronRight,{className:u("w-4 h-4",T?"text-white/40":"text-gray-500")})}),jsx("span",{onClick:Nt=>{Nt.stopPropagation(),$e(F.id);},className:"flex-shrink-0 cursor-pointer mt-0.5",children:Ce?jsx(FolderOpen,{className:"w-4 h-4",style:{color:T?"#FFD60A":"#B45309"}}):jsx(Folder,{className:"w-4 h-4",style:{color:T?"#FFD60A":"#B45309"}})}),F.wbsCode&&jsx("span",{className:"text-[10px] font-mono flex-shrink-0 mt-1",style:{color:T?"#FFD60A":"#B45309"},children:F.wbsCode}),jsxs("div",{className:"flex flex-col min-w-0",children:[jsx("span",{className:u("text-[13px] font-bold uppercase tracking-wide",T?"text-white":"text-gray-900"),style:{fontFamily:"Inter, system-ui, sans-serif"},children:F.name}),jsxs("span",{className:u("text-[10px] font-mono",T?"text-white/30":"text-gray-500"),children:["(",tt," ",d==="es"?tt===1?"Tarea":"Tareas":tt===1?"Item":"Items",")"]}),_t!==null&&jsxs("span",{className:u("text-[9px] font-mono px-1.5 py-0.5 rounded w-fit mt-0.5",_t>=1?"text-[#32D74B] bg-[#32D74B]/10":_t>=.8?"text-[#FFD60A] bg-[#FFD60A]/10":"text-[#FF453A] bg-[#FF453A]/10"),children:["Avg SPI: ",_t.toFixed(2)]})]})]}):Ba.type==="timeLoggedMinutes"?v==="financial"?(()=>{let Nt=F.executedDollarsCanonical,mr=Nt!=null?Math.round(Nt):Math.round(te(F).dollarSpent);return mr>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",mr.toLocaleString("en-US")]}):null})():jsx(Dr,{value:jt>0?jt:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F)}):Ba.type==="soldEffortMinutes"?v==="financial"?(()=>{let Nt=te(F),mr=Math.round(Nt.dollarQuoted);return mr>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",mr.toLocaleString("en-US")]}):null})():jsx(Dr,{value:na>0?na:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F)}):Ba.type==="effortMinutes"?v==="financial"?(()=>{let Nt=te(F),mr=Math.round(Nt.dollarAllocated),To=Math.round(Nt.dollarQuoted),Lr=To-mr;return jsxs("div",{className:"flex flex-col",children:[mr>0?jsxs("span",{className:u("text-sm font-mono",T?"text-white/60":"text-gray-500"),children:["$",mr.toLocaleString("es-CO")]}):null,Lr!==0&&mr>0&&To>0&&jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Lr>0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Lr>0?"+":"",Math.abs(Lr)>=1e3?`$${(Lr/1e3).toFixed(1)}K`:`$${Lr}`]})]})})():jsx(Dr,{value:Ut>0?Ut:void 0,isDark:T,locale:d,disabled:true,lens:v,hourlyRate:G(F)}):Ar(F,Ba)},Ba.id)),h&&jsx("div",{className:"w-12 flex-shrink-0"})]},F.id)}let me=U===F.id,Ke=oe===F.id,Ze=Ke&&ge==="above",yt=Ke&&ge==="below",oa=Ke&&ge==="child";return jsxs(motion.div,{"data-task-id":F.id,"data-listview-row":F.id,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,delay:ve},className:u("flex items-center border-b transition-colors relative group",T?"border-[#222] hover:bg-white/[0.05]":"border-gray-100 hover:bg-gray-50",ee===F.id&&(T?"!bg-[#FFD60A]/15":"!bg-yellow-100")),style:{opacity:me?.4:1,backgroundColor:oa?T?"rgba(46,148,255,0.08)":"rgba(46,148,255,0.05)":void 0,boxShadow:oa?"inset 0 0 0 2px #2E94FF":void 0},onClick:()=>a.onTaskClick?.(F),onDoubleClick:()=>a.onTaskDoubleClick?.(F),onContextMenu:jt=>N(jt,F),children:[Ze&&jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),yt&&jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:2,backgroundColor:"#2E94FF",zIndex:10}}),st&&jsx("div",{className:"flex-shrink-0 flex items-center justify-center w-5 cursor-grab opacity-0 group-hover:opacity-40 hover:!opacity-80 transition-opacity",onMouseDown:jt=>pt(F.id,jt),style:{color:T?"#888":"#999"},children:jsx(GripVertical,{className:"w-3 h-3"})}),Q.map(jt=>jsx("div",{className:u("flex items-center px-4 py-3 min-h-[56px]",jt.type!=="name"&&"justify-center"),style:{width:Wr[jt.id],minWidth:jt.minWidth},children:jt.type==="name"?jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[y&&F.level>0&&jsx("div",{style:{width:`${F.level*24}px`},className:"flex-shrink-0"}),y&&F.hasChildren&&jsx("button",{onClick:Ut=>{Ut.stopPropagation(),$e(F.id);},className:u("p-0.5 rounded flex-shrink-0",T?"hover:bg-white/[0.05]":"hover:bg-gray-200"),children:Ce?jsx(ChevronDown,{className:u("w-4 h-4",T?"text-white/60":"text-gray-400")}):jsx(ChevronRight,{className:u("w-4 h-4",T?"text-white/60":"text-gray-400")})}),y&&!F.hasChildren&&jsx("div",{className:"w-5 flex-shrink-0"}),jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[(F.wbsCode||F.taskCode)&&jsxs("div",{className:"flex items-center gap-1.5",children:[F.wbsCode&&jsx("span",{className:u("text-[10px] font-mono",T?"text-[#007BFF]":"text-blue-600"),children:F.wbsCode}),F.taskCode&&jsx("span",{className:u("text-[10px] font-mono",T?"text-white/40":"text-gray-400"),children:F.taskCode})]}),jsx("span",{className:u("truncate",F.hasChildren?"text-[14px] font-bold":"text-[13px] font-normal",F.progress===100?T?"line-through text-white/50":"line-through text-gray-400":F.hasChildren?T?"text-white":"text-gray-900":T?"text-[#D1D5DB]":"text-gray-600"),children:F.name}),F.tags?.[0]&&jsx("span",{className:"text-[9px] font-mono uppercase tracking-wide px-1.5 py-0.5 rounded w-fit",style:{backgroundColor:`${F.tags[0].color}20`,color:F.tags[0].color},children:F.tags[0].name})]})]}):Ar(F,jt)},jt.id)),h&&jsx("div",{className:"w-12 flex-shrink-0"})]},F.id)})}),J&&dr.length>0&&(()=>{let{spent:F,allocated:se,quoted:Ce}=B,ve=se-F,Re=ve<0,tt=Re?`+${Yn(Math.abs(ve))} ${d==="es"?"EXCEDIDO":"OVER"}`:`+${Yn(ve)} ${d==="es"?"AHORRADO":"SAVED"}`,me=v==="financial"&&P>0,Ke=H?.spent!=null?H.spent:B.dollarSpent,Ze=H?.allocated!=null?H.allocated:B.dollarAllocated,yt=H?.quoted!=null?H.quoted:B.dollarQuoted,oa=(na,_t)=>{if(me){let Ba=_t??na/60*P;return `$${Math.round(Ba).toLocaleString("es-CO")}`}return Yn(na)},jt=me?Math.abs(Ze-Ke):0,Ut=me?`+$${jt.toLocaleString("es-CO",{minimumFractionDigits:0,maximumFractionDigits:0})} ${Re?d==="es"?"EXCEDIDO":"OVER":d==="es"?"AHORRADO":"SAVED"}`:tt;return jsxs("div",{className:u("flex items-center sticky bottom-0 z-[5]",T?"border-t border-[#2A2A3A]":"border-t border-gray-300"),style:{backgroundColor:T?"rgba(13, 17, 23, 0.95)":"rgba(255, 255, 255, 0.95)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)"},children:[st&&jsx("div",{className:"w-5 flex-shrink-0"}),Q.map(na=>jsx("div",{className:u("flex items-center px-4 py-3",na.type!=="name"&&"justify-center"),style:{width:Wr[na.id],minWidth:na.minWidth},children:na.type==="name"?jsx("span",{className:u("text-[11px] font-black uppercase tracking-widest",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:d==="es"?"TOTAL PROYECTO":"TOTAL PROJECT"}):na.type==="hoursBar"?jsxs("div",{className:"flex flex-col items-center w-full",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:oa(F,me?Ke:void 0)}),jsx("span",{className:u("text-[11px]",T?"text-white/40":"text-gray-400"),children:"/"}),jsx("span",{className:u("text-[11px]",T?"text-white/50":"text-gray-500"),style:{fontFamily:"JetBrains Mono, monospace"},children:oa(se,me?Ze:void 0)})]}),se>0&&jsx("span",{className:u("text-[10px] font-semibold mt-0.5 whitespace-nowrap",Re?"text-[#FF453A]":"text-[#32D74B]"),style:{fontFamily:"JetBrains Mono, monospace"},children:me?Ut:tt})]}):na.type==="soldEffortMinutes"?jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:Ce>0?oa(Ce,me?yt:void 0):"\u2013"}):na.type==="effortMinutes"?(()=>{if(me&&Ce>0&&se>0){let _t=Math.round(yt),Ba=Math.round(Ze),Nt=_t-Ba,mr=_t>0?Math.round(Nt/_t*100):0;return jsxs("div",{className:"flex flex-col items-center",children:[jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:oa(se,Ze)}),jsxs("span",{className:u("text-[9px] font-mono font-bold px-1.5 py-0.5 rounded whitespace-nowrap mt-0.5",Nt>=0?"bg-[#064e3b] text-[#10b981] border border-[#065f46]/30":"bg-[#451a03] text-[#f59e0b] border border-[#78350f]/30"),children:[Nt>=0?"+":"",Math.abs(Nt)>=1e3?`$${(Nt/1e3).toFixed(1)}K`:`$${Nt}`,jsxs("span",{className:"ml-0.5 opacity-60",children:["(",mr,"%)"]})]})]})}return jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:se>0?oa(se,me?Ze:void 0):"\u2013"})})():na.type==="timeLoggedMinutes"?jsx("span",{className:u("text-[12px] font-bold",T?"text-white":"text-gray-900"),style:{fontFamily:"JetBrains Mono, monospace"},children:F>0?oa(F,me?Ke:void 0):"\u2013"}):na.type==="progress"?(()=>{let _t=Jg(uc(e||[]));return jsxs("span",{className:u("text-[12px] font-bold font-mono",T?"text-[#00E5CC]":"text-cyan-600"),style:{fontFamily:"JetBrains Mono, monospace"},children:[_t,"%"]})})():na.type==="weight"?(()=>{let _t=e||[],Ba=[],Nt=No=>{for(let Do of No)Ba.push(Do),Do.subtasks?.length&&Nt(Do.subtasks);};Nt(_t);let To=Ba.filter(No=>!No.subtasks?.length||No.subtasks.length===0).reduce((No,Do)=>No+(Do.weight||0),0),Lr=Math.abs(To-100)<.1;return jsxs("span",{className:u("text-[12px] font-bold font-mono",Lr?T?"text-[#22C55E]":"text-green-600":"text-[#EF4444]"),style:{fontFamily:"JetBrains Mono, monospace"},children:[Number(To.toFixed(1)),"%"]})})():jsx("span",{className:u("text-[11px]",T?"text-white/30":"text-gray-300"),children:"\u2013"})},na.id)),h&&jsx("div",{className:"w-12 flex-shrink-0"})]})})(),dr.length===0&&at&&jsx("div",{className:"flex items-center justify-center py-12",children:jsxs("div",{className:"text-center",children:[jsx(List,{className:u("w-12 h-12 mx-auto mb-4",T?"text-white/30":"text-gray-400")}),jsx("p",{className:u(T?"text-white/60":"text-gray-600"),children:Y.empty.noResults})]})})]})}),be?.enabled&&be.data&&_e&&jsx(_g,{data:be.data,isDark:T,locale:d,onClose:()=>$(false),lens:t?.lens,onUnassignedTaskClick:F=>{let se=document.querySelector(`[data-task-id="${F}"]`);se&&(se.scrollIntoView({behavior:"smooth",block:"center"}),le(F),setTimeout(()=>le(null),2e3));}})]}),jsx(Sg,{state:V,onClose:K,isDark:T,locale:d,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:ye,onColumnSort:Z,availableUsers:l,onOpenTimeLog:a.onOpenTimeLog,onReportBlocker:a.onReportBlocker,onCopyTaskLink:a.onCopyTaskLink,onTaskMove:a.onTaskMove,onTaskIndent:a.onTaskIndent,onTaskOutdent:a.onTaskOutdent}),Ne&&Oe&&U&&createPortal(jsx("div",{style:{position:"fixed",left:Oe.x+12,top:Oe.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let se=Se.flattenTasks(e).find(Ce=>Ce.id===U);return se?jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:T?"rgba(10,10,10,0.9)":"rgba(255,255,255,0.95)",border:`1px solid ${T?"rgba(255,255,255,0.1)":"#e5e7eb"}`,backdropFilter:"blur(8px)",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"},children:[jsx(GripVertical,{className:"w-3 h-3",style:{color:"#2E94FF"}}),jsx("span",{className:"text-xs font-medium",style:{color:T?"#e6edf3":"#111827"},children:se.name})]}):null})()}),document.body),jsx(zg,{isOpen:et,onClose:()=>Ee(false),onSave:ya,isDark:T,locale:d})]})}var t0=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:140,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true},{id:"soldEffortMinutes",type:"soldEffortMinutes",label:"Quoted",width:100,visible:false,sortable:true,resizable:true},{id:"effortMinutes",type:"effortMinutes",label:"Estimated",width:100,visible:false,sortable:true,resizable:true},{id:"timeLoggedMinutes",type:"timeLoggedMinutes",label:"Executed",width:100,visible:false,sortable:true,resizable:true},{id:"scheduleVariance",type:"scheduleVariance",label:"Sched / Var",width:180,visible:false,sortable:true,resizable:true},{id:"hoursBar",type:"hoursBar",label:"Hours",width:200,visible:false,sortable:true,resizable:true},{id:"teamLoad",type:"teamLoad",label:"Team Load",width:160,visible:false,sortable:true,resizable:true},{id:"blockers",type:"blockers",label:"Blockers",width:150,visible:false,sortable:false,resizable:true},{id:"weight",type:"weight",label:"Weight",width:80,visible:false,sortable:true,resizable:true}],a0=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"},{type:"effortMinutes",labelKey:"columns.effortMinutes",icon:"Clock"},{type:"timeLoggedMinutes",labelKey:"columns.timeLoggedMinutes",icon:"Timer"},{type:"soldEffortMinutes",labelKey:"columns.soldEffortMinutes",icon:"FileText"},{type:"scheduleVariance",labelKey:"columns.scheduleVariance",icon:"CalendarClock"},{type:"hoursBar",labelKey:"columns.hoursBar",icon:"BarChart3"},{type:"teamLoad",labelKey:"columns.teamLoad",icon:"Users"},{type:"blockers",labelKey:"columns.blockers",icon:"AlertTriangle"},{type:"weight",labelKey:"columns.weight",icon:"Scale"}],r0=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var pc={bgPrimary:"#0D0D0D",bgSecondary:"#141414",bgHover:"rgba(255,255,255,0.05)",bgSelected:"#0D131E",bgAlternate:"#141414",border:"#222222",borderLight:"#1A1A1A",textPrimary:"rgba(255,255,255,0.9)",textSecondary:"rgba(255,255,255,0.6)",textMuted:"rgba(255,255,255,0.3)",accent:"#007BFF",accentHover:"#2979FF",accentLight:"rgba(0,123,255,0.15)",statusTodo:"rgba(255,255,255,0.4)",statusInProgress:"#007BFF",statusCompleted:"#34D399",focusRing:"#007BFF",checkboxBg:"#1A1A1A",checkboxChecked:"#007BFF",bgGroupHeader:"#222222",headerBg:"#1A1A1A",neonRed:"#FF2D20",neonGreen:"#3BF06E",neonAmber:"#FFD60A",neonBlue:"#3B9EFF"},mc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da",bgGroupHeader:"#F3F4F6",headerBg:"#F9FAFB",neonRed:"#DC2626",neonGreen:"#16A34A",neonAmber:"#D97706",neonBlue:"#2E94FF"},gc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1",bgGroupHeader:"#1f3460",headerBg:"#16213e",neonRed:"#EF4444",neonGreen:"#34D399",neonAmber:"#FBBF24",neonBlue:"#6366F1"},Zi={dark:pc,light:mc,neutral:gc};function o0(e){return Zi[e]||Zi.dark}var fc={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week",backlogTitle:"BACKLOG / UNSCHEDULED",systemStatus:"SYSTEM STATUS",budgetUtil:"Budget Util.",variance:"VARIANCE",cost:"COST",estimate:"Est",sold:"Sold",cashOut:"Cash Out",typeToAdd:"Type to add (e.g., Crane Inspection)",critical:"CRITICAL",blocker:"Blocker",risk:"Risk",delay:"delay",days:"Days"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},bc={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana",backlogTitle:"BACKLOG / SIN FECHA",systemStatus:"ESTADO DEL SISTEMA",budgetUtil:"Util. Presupuesto",variance:"VARIANZA",cost:"COSTO",estimate:"Est",sold:"Vendido",cashOut:"Desembolso",typeToAdd:"Escribe para agregar (ej: Inspecci\xF3n)",critical:"CR\xCDTICO",blocker:"Bloqueador",risk:"Riesgo",delay:"retraso",days:"D\xEDas"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},el={en:fc,es:bc};function Ls(e){return el[e]||el.en}function tl(e,t){let a=Ls(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function n0(e){let t=Ls(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function s0(e,t=0,a=true){let r=Ls(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function Bs(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function yc(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function d0({task:e,isDark:t}){return e.progress===100||e.status==="completed"?jsx(CheckCircle2,{className:"w-3 h-3 text-emerald-400 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsx(PlayCircle,{className:"w-3 h-3 text-[#007FFF] flex-shrink-0"}):jsx(Circle,{className:u("w-3 h-3 flex-shrink-0",t?"text-white/40":"text-gray-400")})}var p0=26,yw=22,xw=10;function c0(e,t){let a=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((a-r)/(1e3*60*60*24))}function xc(e,t="hours",a=0){if(!e||e<=0)return null;if(t==="financial"&&a>0){let o=Math.round(e/60*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(e/480);return r>0?`${r}d`:null}function m0(e,t="hours",a=0){if(e.soldEffortMinutes==null||e.effortMinutes==null)return null;let r=e.soldEffortMinutes-e.effortMinutes;if(r===0)return null;let o=r<0,s;if(t==="financial"&&a>0){let n=Math.round(Math.abs(r/60)*a);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}else {let n=Math.round(Math.abs(r)/60);s=n>=1e3?`$${(n/1e3).toFixed(1)}k`:`$${n}`;}return {text:`${o?"-":"+"}${s}`,isNegative:o}}function u0(e,t="hours",a=0){if(t==="financial"&&a>0){let o=Math.round(Math.abs(e/60)*a);return o>=1e3?`$${(o/1e3).toFixed(1)}k`:`$${o}`}let r=Math.round(Math.abs(e)/60);return r>=1e3?`$${(r/1e3).toFixed(1)}k`:`$${r}`}function vw({segment:e,isDark:t,onClick:a,blurFinancials:r,isSelected:o,t:s,lens:n="hours",hourlyRate:l=0}){let{task:c,spanCols:i,lane:p,isStart:d,isEnd:m}=e,g=c.progress===100||c.status==="completed",y=c.isCriticalPath,x=d&&m?"rounded":d?"rounded-l":m?"rounded-r":"",h=m?xc(c.effortMinutes,n,l):null,f=m?m0(c,n,l):null,b=m?c.blockers?.find(w=>w.severity==="critical"):null;return jsxs(motion.button,{onClick:w=>{w.stopPropagation(),a();},whileHover:{scale:1.005},className:u("absolute flex items-center gap-1.5 px-2 text-xs cursor-pointer overflow-hidden",x,g?t?"text-emerald-400":"bg-emerald-500/10 text-emerald-600 border border-emerald-200":y?t?"text-white/90":"bg-red-50 border border-red-200 text-red-700 hover:border-red-300":t?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:{top:`${p*p0}px`,left:"1px",width:`calc(${i*100}% - 2px)`,height:`${yw}px`,zIndex:10,...t?g?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:y?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:{},borderLeftWidth:d?"3px":void 0,borderLeftColor:d?y?"#EF4444":g?"#10B981":"#1264FF":void 0,...o?{boxShadow:t?"0 0 0 1.5px rgba(0, 229, 255, 0.7), 0 0 12px rgba(0, 229, 255, 0.3)":"0 0 0 1.5px rgba(59, 130, 246, 0.7), 0 0 12px rgba(59, 130, 246, 0.2)",zIndex:20}:{}},children:[y&&d&&jsxs("span",{className:"text-[9px] font-mono font-bold text-red-400 uppercase tracking-wider flex-shrink-0",children:[s.labels.critical,":"]}),jsx("span",{className:"truncate flex-1 text-left font-medium",children:c.name}),m&&(h||f)&&jsxs("span",{className:"flex items-center gap-1 flex-shrink-0 text-[9px] font-mono text-white/35 ml-1",children:[h&&jsxs("span",{children:[s.labels.estimate,": ",h]}),f&&jsxs(Fragment,{children:[jsx("span",{className:"text-white/15",children:"|"}),jsx("span",{className:u(f.isNegative?"text-red-400":"text-emerald-400",r&&"blur-sm select-none"),children:f.text})]})]}),b&&jsxs("span",{className:"flex-shrink-0 text-[8px] font-mono px-1.5 py-0.5 rounded bg-red-500/20 text-red-400 border border-red-500/30 ml-1",children:[s.labels.blocker,": ",b.type]}),c.progress>0&&c.progress<100&&jsx("div",{className:"absolute bottom-0 left-0 h-[2px] bg-[#1264FF]",style:{width:`${c.progress}%`}})]})}function g0({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:l,availableTags:c=[],onCreateTag:i,attachmentsByTask:p,comments:d,onAddComment:m,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,onTaskOpen:h,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:w,timerState:C,onLogTime:S,onUpdateEstimate:E,onUpdateSoldEffort:k,onStartTimer:v,onStopTimer:P,onDiscardTimer:L,blurFinancials:M=false,suppressDetailModal:J=false,lens:H="hours",hourlyRate:Y=0}){let{theme:T="dark",locale:G="en",customTranslations:te,showBacklog:Le=true}=t,B=tl(G,te),q=T==="dark"||T==="neutral",[be,_e]=useState(r||new Date),[$,ee]=useState(null),[le,ke]=useState(null),[xe,Be]=useState(null),[He,at]=useState({}),ue=3,je=3,Xe=useCallback(z=>{ke(z.id),J||ee(z),h?.(z.id);},[J,h]),[he,kt]=useState(null),xt=useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()-1,1));},[be]),nt=useCallback(()=>{_e(new Date(be.getFullYear(),be.getMonth()+1,1));},[be]),ze=useCallback(()=>{_e(new Date);},[]),ct=useMemo(()=>{let z=be.getFullYear(),oe=be.getMonth(),Ge=new Date(z,oe,1),ge=new Date(z,oe+1,0),Ve=Ge.getDay(),Oe=ge.getDate(),Ue=Bs(e),lt=new Date;lt.setHours(0,0,0,0);let ot=[],st=Ve,pt=new Date(z,oe,0).getDate();for(let Ot=st-1;Ot>=0;Ot--){let St=new Date(z,oe-1,pt-Ot);ot.push({date:St,isCurrentMonth:false,isToday:false,isWeekend:St.getDay()===0||St.getDay()===6,events:Ue.filter(Et=>yc(St,Et)).map(Et=>({id:Et.id,title:Et.name,start:Et.startDate,end:Et.endDate,task:Et}))});}for(let Ot=1;Ot<=Oe;Ot++){let St=new Date(z,oe,Ot),Et=St.getTime()===lt.getTime();ot.push({date:St,isCurrentMonth:true,isToday:Et,isWeekend:St.getDay()===0||St.getDay()===6,events:Ue.filter(Ft=>yc(St,Ft)).map(Ft=>({id:Ft.id,title:Ft.name,start:Ft.startDate,end:Ft.endDate,task:Ft}))});}let Tt=42-ot.length;for(let Ot=1;Ot<=Tt;Ot++){let St=new Date(z,oe+1,Ot);ot.push({date:St,isCurrentMonth:false,isToday:false,isWeekend:St.getDay()===0||St.getDay()===6,events:Ue.filter(Et=>yc(St,Et)).map(Et=>({id:Et.id,title:Et.name,start:Et.startDate,end:Et.endDate,task:Et}))});}return ot},[be,e]),et=useMemo(()=>Bs(e).filter(z=>!z.startDate||!z.endDate),[e]),Ee=useMemo(()=>{let z=Bs(e),oe=0,Ge=0,ge=0,Ve=0,Oe=0;z.forEach(pt=>{pt.effortMinutes&&(oe+=pt.effortMinutes),pt.soldEffortMinutes&&(Ge+=pt.soldEffortMinutes),pt.scheduleVariance!=null&&(ge+=pt.scheduleVariance,Ve++),pt.soldEffortMinutes&&pt.effortMinutes&&(Oe+=pt.soldEffortMinutes-pt.effortMinutes);});let Ue=Ge>0?Math.min(100,Math.round(oe/Ge*100)):0,lt=Ve>0?Math.round(ge/Ve):0,st=`${Oe<0?"-":"+"}${u0(Oe,H,Y)}`;return {budgetUtil:Ue,avgVariance:lt,costDisplay:st,hasCostData:Ge>0}},[e,H,Y]),V=useMemo(()=>{let z=[0,0,0,0,0,0];return ct.forEach((oe,Ge)=>{let ge=Math.floor(Ge/7);oe.events.forEach(Ve=>{if(Ve.task.startDate&&Ve.task.soldEffortMinutes){let Oe=new Date(Ve.task.startDate),Ue=oe.date;Oe.getFullYear()===Ue.getFullYear()&&Oe.getMonth()===Ue.getMonth()&&Oe.getDate()===Ue.getDate()&&ge<z.length&&(z[ge]-=Ve.task.soldEffortMinutes);}});}),z},[ct]),D=useMemo(()=>{let z=Bs(e),oe=new Map,Ge=new Set,ge=[0,0,0,0,0,0];if(ct.length===0)return {segmentsByCell:oe,multiDayTaskIds:Ge,maxLanesPerRow:ge};let Ve=st=>new Date(st.getFullYear(),st.getMonth(),st.getDate()),Oe=Ve(ct[0].date),Ue=Ve(ct[ct.length-1].date),lt=[];for(let st of z){if(!st.startDate||!st.endDate)continue;let pt=Ve(st.startDate),Tt=Ve(st.endDate);if(pt.getTime()===Tt.getTime()||Tt<Oe||pt>Ue)continue;let Ot=pt<Oe?Oe:pt,St=Tt>Ue?Ue:Tt,Et=c0(Ot,Oe),Ft=c0(St,Oe);Et<0||Et>41||Ft<0||Ft>41||Et!==Ft&&(Ge.add(st.id),lt.push({task:st,startIdx:Et,endIdx:Ft}));}lt.sort((st,pt)=>st.startIdx!==pt.startIdx?st.startIdx-pt.startIdx:pt.endIdx-pt.startIdx-(st.endIdx-st.startIdx));let ot=[[],[],[],[],[],[]];for(let{task:st,startIdx:pt,endIdx:Tt}of lt){let Ot=Math.floor(pt/7),St=Math.floor(Tt/7),Et=Ve(st.startDate),Ft=Ve(st.endDate),mt=false;for(let Vt=Ot;Vt<=St;Vt++){let ht=Vt===Ot?pt%7:0,it=Vt===St?Tt%7:6,ne=it-ht+1,pe=0,O=ot[Vt]??[];for(ot[Vt]||(ot[Vt]=O);pe<O.length&&(O[pe]??-1)>=ht;)pe++;if(pe>=xw){mt=true;break}pe>=O.length?O.push(it):O[pe]=it,ge[Vt]=Math.max(ge[Vt]??0,pe+1);let _=Vt===Ot&&Et>=Oe,De=Vt===St&&Ft<=Ue,Qe=Vt*7+ht,bt={taskId:st.id,task:st,rowIndex:Vt,startCol:ht,endCol:it,spanCols:ne,lane:pe,isStart:_,isEnd:De};oe.has(Qe)||oe.set(Qe,[]),oe.get(Qe).push(bt);}mt&&(Ge.delete(st.id),oe.forEach((Vt,ht)=>{let it=Vt.filter(ne=>ne.taskId!==st.id);it.length===0?oe.delete(ht):oe.set(ht,it);}));}return {segmentsByCell:oe,multiDayTaskIds:Ge,maxLanesPerRow:ge}},[ct,e]),U=G==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ae=be.toLocaleDateString(G==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),Ne=ae.charAt(0).toUpperCase()+ae.slice(1);return o?jsx("div",{className:u("flex-1 flex items-center justify-center",q?"bg-[#050505]":"bg-white",n),style:l,children:jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#007FFF]"}),jsxs("p",{className:u("text-sm font-mono",q?"text-white/30":"text-gray-600"),children:[B.labels.noEvents,"..."]})]})}):s?jsx("div",{className:u("flex-1 flex items-center justify-center",q?"bg-[#050505]":"bg-white",n),style:l,children:jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsx("div",{className:u("w-12 h-12 rounded-full flex items-center justify-center",q?"bg-red-500/10 border border-red-500/20":"bg-red-500/10"),children:jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxs("div",{children:[jsx("h3",{className:u("text-lg font-semibold mb-2",q?"text-white/90":"text-gray-900"),children:"Error"}),jsx("p",{className:u("text-sm",q?"text-white/40":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsx("div",{className:u("flex-1 flex items-center justify-center",q?"bg-[#050505]":"bg-white",n),style:l,children:jsxs("div",{className:"text-center max-w-md",children:[jsx("div",{className:u("w-16 h-16 mx-auto mb-4 rounded-2xl flex items-center justify-center",q?"bg-[#007FFF]/10 border border-[#007FFF]/20":"bg-blue-500/10"),children:jsx(Calendar,{className:u("w-8 h-8",q?"text-[#007FFF]":"text-blue-500")})}),jsx("h3",{className:u("text-lg font-semibold mb-2",q?"text-white/90":"text-gray-900"),children:B.labels.noEvents}),jsx("p",{className:u("text-sm",q?"text-white/30":"text-gray-600"),children:B.labels.newTask})]})}):jsxs("div",{className:u("flex-1 flex flex-col w-full h-full overflow-hidden",q?"bg-[#050505]":"bg-white",n),style:l,children:[jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative overflow-hidden",children:[jsxs("div",{className:u("flex-shrink-0 h-10 flex items-center justify-between px-4 z-20",q?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:[jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[jsxs("div",{className:u("flex items-center gap-1.5 pl-2.5 pr-2 py-1 rounded-md text-xs transition-all",q?"bg-[#111] border border-white/10":"bg-gray-100 border border-gray-200"),children:[jsx(Calendar,{className:u("w-3.5 h-3.5",q?"text-[#007FFF]":"text-blue-500")}),jsx("span",{className:u("font-medium",q?"text-white":"text-gray-900"),children:G==="es"?"Calendario":"Calendar"})]}),jsx("div",{className:u("h-4 w-px",q?"bg-white/10":"bg-gray-200")}),jsxs("div",{className:"flex items-center gap-1.5 select-none",children:[jsx("button",{onClick:xt,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",q?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsx(ChevronLeft,{className:"w-3.5 h-3.5"})}),jsx("span",{className:u("text-sm font-semibold tracking-tight min-w-[150px] text-center",q?"text-white":"text-gray-900"),children:Ne}),jsx("button",{onClick:nt,className:u("w-6 h-6 flex items-center justify-center rounded transition-colors",q?"text-white/50 hover:text-white hover:bg-white/5":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:jsx(ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.toolbarRightContent&&jsxs(Fragment,{children:[t.toolbarRightContent,jsx("div",{className:u("h-4 w-px",q?"bg-white/10":"bg-gray-200")})]}),jsx("button",{onClick:ze,className:u("px-2.5 py-1 text-xs rounded-md transition-all font-medium",q?"bg-white/5 border border-white/10 text-white/70 hover:bg-white/10 hover:text-white":"bg-gray-100 border border-gray-200 text-gray-700 hover:bg-gray-200"),children:B.navigation.today})]})]}),jsx("div",{className:u("grid grid-cols-7 sticky top-0 z-10",q?"bg-[#050505] border-b border-[#222]":"bg-white border-b border-gray-200"),children:U.map(z=>jsx("div",{className:u("py-2 text-center text-[10px] font-bold uppercase tracking-widest",q?"text-white/60 font-mono":"text-gray-500"),children:z},z))}),jsx("div",{className:"flex-1 overflow-y-auto",children:jsx("div",{className:u("grid grid-cols-7 min-h-[800px]",q?"bg-[#050505]":"bg-white"),style:{gridAutoRows:"minmax(140px, auto)"},onClick:()=>ke(null),children:ct.map((z,oe)=>{let Ge=oe%7===6,ge=oe>=35;return jsxs("div",{className:u("min-h-[140px] p-2 transition-colors flex flex-col relative group overflow-visible",!Ge&&(q?"border-r border-[#222]":"border-r border-gray-200"),!ge&&(q?"border-b border-[#222]":"border-b border-gray-200"),q?z.isCurrentMonth?"bg-[#050505] hover:bg-white/[0.02]":"bg-[#080808] opacity-50":z.isCurrentMonth?"bg-white hover:bg-gray-50":"bg-gray-50 opacity-50",z.isToday&&q&&"ring-1 ring-[#007FFF]/40 ring-inset bg-[#007FFF]/[0.03]",z.isToday&&!q&&"ring-2 ring-blue-500 ring-inset"),children:[jsx("span",{className:u("text-xs font-mono select-none relative z-20",z.isToday?q?"text-[#007FFF] font-bold":"text-blue-600 font-bold":z.isCurrentMonth?q?"text-white/60":"text-gray-900":q?"text-white/20":"text-gray-400"),children:String(z.date.getDate()).padStart(2,"0")}),(()=>{let Ve=Math.floor(oe/7),Oe=(D.maxLanesPerRow[Ve]??0)*p0,Ue=D.segmentsByCell.get(oe);return Oe===0&&!Ue?null:jsx("div",{className:"relative -mx-2 overflow-visible",style:{minHeight:`${Oe}px`,zIndex:5},children:Ue?.map(lt=>jsx(vw,{segment:lt,isDark:q,blurFinancials:M,isSelected:le===lt.taskId,t:B,lens:H,hourlyRate:Y,onClick:()=>{Xe(lt.task),a.onEventClick?.({id:lt.task.id,title:lt.task.name,start:lt.task.startDate,end:lt.task.endDate,task:lt.task});}},lt.taskId))})})(),(()=>{let Ve=z.events.filter(Oe=>Oe.task.isMilestone&&!D.multiDayTaskIds.has(Oe.id));return Ve.length===0?null:jsxs("div",{className:"flex items-center gap-1 mt-0.5 px-0.5",children:[Ve.slice(0,4).map(Oe=>jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 flex-shrink-0 cursor-pointer",title:Oe.title,onClick:Ue=>{Ue.stopPropagation(),Xe(Oe.task);}},Oe.id)),Ve.length>4&&jsxs("span",{className:u("text-[8px] font-mono",q?"text-white/30":"text-gray-400"),children:["+",Ve.length-4]})]})})(),(()=>{let Ve=[];z.events.forEach(Ue=>{Ue.task.blockers?.forEach(lt=>{(lt.severity==="warning"||lt.severity==="critical")&&Ve.push({taskId:Ue.id,type:lt.type,severity:lt.severity,variance:Ue.task.scheduleVariance});});});let Oe=Ve[0];return Oe?jsx("div",{className:"mt-0.5 px-0.5",children:jsxs("div",{className:u("text-[8px] font-mono px-1.5 py-0.5 rounded flex items-center gap-1",Oe.severity==="critical"?"bg-red-500/15 text-red-400 border border-red-500/20":"bg-amber-500/15 text-amber-400 border border-amber-500/20"),children:[jsx("span",{children:"\u26A0"}),jsxs("span",{className:"truncate",children:[B.labels.risk,": ",Oe.type,Oe.variance?` (+${Math.abs(Oe.variance)}d ${B.labels.delay})`:""]})]})}):null})(),(()=>{let Ve=z.events.filter(ot=>!D.multiDayTaskIds.has(ot.id)),Oe=He[oe]||ue,Ue=Ve.slice(0,Oe),lt=Ve.length-Oe;return jsxs("div",{className:"mt-1 space-y-0.5 flex-1",children:[Ue.map(ot=>jsxs(motion.button,{onClick:()=>{Xe(ot.task),a.onEventClick?.(ot);},whileHover:{scale:1.01},className:u("w-full flex items-center gap-1.5 px-1.5 py-1 rounded text-[11px] transition-all text-left",ot.task.progress===100||ot.task.status==="completed"?q?"text-emerald-400":"bg-emerald-500/10 text-emerald-600":q?"text-white/90":"bg-gray-50 border border-gray-200 text-gray-700 hover:border-blue-300"),style:q?ot.task.progress===100||ot.task.status==="completed"?{background:"rgba(16, 185, 129, 0.28)",border:"1px solid rgba(16, 185, 129, 0.50)",boxShadow:"0 0 14px rgba(16, 185, 129, 0.2), inset 0 0 14px rgba(16, 185, 129, 0.1)"}:ot.task.isCriticalPath?{background:"rgba(239, 68, 68, 0.35)",border:"1px solid rgba(239, 68, 68, 0.65)",boxShadow:"0 0 18px rgba(239, 68, 68, 0.3), inset 0 0 18px rgba(239, 68, 68, 0.15)"}:{background:"rgba(18, 100, 255, 0.38)",border:"1px solid rgba(18, 100, 255, 0.65)",boxShadow:"0 0 18px rgba(18, 100, 255, 0.28), inset 0 0 18px rgba(18, 100, 255, 0.14)"}:void 0,children:[jsx("span",{className:u("flex-shrink-0 text-[9px]",ot.task.isMilestone?q?"text-amber-400":"text-amber-600":ot.task.isCriticalPath?"text-red-400":q?"text-[#1264FF]":"text-gray-400"),children:ot.task.isMilestone?"\u25C6":"\u25CF"}),jsx("span",{className:"truncate flex-1",children:ot.title})]},ot.id)),lt>0&&jsxs("button",{onClick:ot=>{ot.stopPropagation(),at(st=>({...st,[oe]:Oe+je}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",q?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:["+",lt," ",G==="es"?"m\xE1s":"more"]}),Oe>ue&&Ve.length>ue&&jsx("button",{onClick:ot=>{ot.stopPropagation(),at(st=>({...st,[oe]:ue}));},className:u("text-[10px] px-1.5 py-0.5 cursor-pointer font-mono font-medium uppercase tracking-wide transition-all rounded",q?"text-white/25 hover:text-white/50 hover:bg-white/5":"text-gray-400 hover:text-gray-600"),children:G==="es"?"menos":"less"})]})})(),z.isCurrentMonth&&a.onTaskCreate&&jsx("div",{className:"flex items-center justify-end mt-1",children:(()=>{let Ve=oe>=28,Oe=oe%7>=5;return jsxs("div",{className:"relative",children:[jsx("button",{onClick:Ue=>{Ue.stopPropagation(),kt(he===oe?null:oe);},className:u("w-5 h-5 rounded flex items-center justify-center transition-all",he===oe?"opacity-100 bg-[#007FFF] text-white":"opacity-0 group-hover:opacity-100",q?"hover:bg-[#007FFF] text-white/30 hover:text-white":"hover:bg-blue-500 text-gray-400 hover:text-white"),children:jsx(Plus,{className:u("w-3.5 h-3.5 transition-transform",he===oe&&"rotate-45")})}),jsx(AnimatePresence,{children:he===oe&&jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 z-40",onClick:()=>kt(null)}),jsx(motion.div,{initial:{opacity:0,y:Ve?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Ve?-5:5,scale:.95},transition:{duration:.12},className:u("absolute w-[320px] rounded-lg shadow-2xl z-50",Ve?"bottom-full mb-1":"top-full mt-1",Oe?"right-0":"left-0",q?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08] shadow-[0_8px_32px_rgba(0,0,0,0.6)]":"bg-white border border-gray-200 shadow-xl"),children:jsx(rn,{onSubmit:Ue=>{a.onTaskCreate?.({name:Ue.name,startDate:Ue.startDate||z.date,endDate:Ue.endDate||z.date,priority:Ue.priority,assignees:Ue.assignee?[Ue.assignee]:void 0}),kt(null);},onCancel:()=>kt(null),availableUsers:t.availableUsers,isDark:q,locale:G==="es"?"es":"en",defaultDate:z.date,dropdownDirection:Ve?"up":"down"})})]})})]})})()}),oe%7===6&&(()=>{let Ve=Math.floor(oe/7),Oe=V[Ve];if(!Oe||Oe===0)return null;let Ue=u0(Oe,H,Y);return jsxs("div",{className:u("absolute bottom-1 right-2 text-[9px] font-mono font-bold tabular-nums z-20",Oe<0?"text-red-400":"text-emerald-400",M&&"blur-sm select-none"),children:[B.labels.cashOut,": ",Oe<0?"-":"+",Ue]})})()]},oe)})})})]}),Le&&jsxs("aside",{className:u("w-[280px] flex-shrink-0 flex flex-col overflow-hidden",q?"bg-[#050505] border-l border-[#222]":"bg-white border-l border-gray-200"),children:[jsxs("div",{className:u("flex-shrink-0 h-14 flex items-center justify-between px-4",q?"bg-[#080808] border-b border-[#222]":"bg-gray-50 border-b border-gray-200"),children:[jsx("span",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",q?"text-white/40":"text-gray-500"),children:B.labels.backlogTitle}),jsx("div",{className:"flex items-center gap-2",children:jsx("span",{className:u("text-[10px] font-mono tabular-nums",q?"text-white/20":"text-gray-400"),children:et.length})})]}),jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-2",children:et.length===0?jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[jsx("div",{className:u("w-10 h-10 rounded-xl flex items-center justify-center mb-3",q?"bg-white/5":"bg-gray-100"),children:jsx(Calendar,{className:u("w-5 h-5",q?"text-white/20":"text-gray-400")})}),jsx("p",{className:u("text-xs font-mono",q?"text-white/20":"text-gray-400"),children:G==="es"?"Sin tareas pendientes":"No unscheduled tasks"})]}):et.map(z=>jsxs("button",{onClick:()=>{Xe(z);},className:u("w-full text-left rounded-md p-3 transition-all group/card",q?"bg-[#0A0A0A] border border-white/[0.05] hover:border-white/[0.12] hover:bg-[#0E0E0E]":"bg-white border border-gray-100 hover:border-gray-200 hover:shadow-sm"),children:[jsxs("div",{className:"flex items-start gap-2 mb-2",children:[jsx("div",{className:u("w-1 h-1 rounded-full mt-1.5 flex-shrink-0",q?"bg-white/20":"bg-gray-300")}),jsx("span",{className:u("text-sm font-medium leading-snug line-clamp-2",q?"text-white/80 group-hover/card:text-white":"text-gray-800"),children:z.name})]}),z.tags&&z.tags.length>0&&jsxs("div",{className:"flex flex-wrap gap-1 ml-3",children:[z.tags.slice(0,3).map(oe=>jsx("span",{className:"text-[9px] font-mono uppercase tracking-wider px-1.5 py-0.5 rounded",style:{backgroundColor:`${oe.color}15`,color:oe.color,border:`1px solid ${oe.color}30`},children:oe.name},oe.id)),z.tags.length>3&&jsxs("span",{className:u("text-[9px] font-mono px-1 py-0.5",q?"text-white/20":"text-gray-400"),children:["+",z.tags.length-3]})]}),(z.effortMinutes||z.soldEffortMinutes)&&jsxs("div",{className:u("flex items-center gap-2 mt-1.5 ml-3 text-[9px] font-mono",q?"text-white/25":"text-gray-400",M&&"blur-sm select-none"),children:[xc(z.effortMinutes,H,Y)&&jsxs("span",{children:[B.labels.estimate,": ",xc(z.effortMinutes,H,Y)]}),(()=>{let oe=m0(z,H,Y);return oe?jsx("span",{className:oe.isNegative?"text-red-400":"text-emerald-400",children:oe.text}):null})()]}),jsxs("div",{className:"flex items-center justify-between mt-2 ml-3",children:[jsxs("div",{className:"flex items-center gap-1.5",children:[z.priority&&jsx(Flag,{className:u("w-3 h-3",z.priority==="urgent"||z.priority==="high"?"text-red-400":z.priority==="medium"?"text-yellow-400":"text-green-400")}),jsx(d0,{task:z,isDark:q})]}),z.assignees&&z.assignees.length>0&&jsx("div",{className:"flex -space-x-1",children:z.assignees.slice(0,2).map((oe,Ge)=>jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[8px] font-mono font-bold text-white ring-1 ring-[#050505]",style:{backgroundColor:oe.color||"#007FFF"},title:oe.name,children:oe.initials||oe.name?.slice(0,2).toUpperCase()},Ge))})]})]},z.id))}),a.onTaskCreate&&jsx("div",{className:u("flex-shrink-0 px-3 py-2.5 border-t",q?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:jsx("input",{type:"text",placeholder:B.labels.typeToAdd,className:u("w-full text-[11px] font-mono bg-transparent outline-none",q?"text-white/70 placeholder:text-white/15":"text-gray-700 placeholder:text-gray-400"),onKeyDown:z=>{z.key==="Enter"&&z.target.value.trim()&&(a.onTaskCreate?.({name:z.target.value.trim()}),z.target.value="");}})}),Ee.hasCostData&&jsxs("div",{className:u("flex-shrink-0 px-4 py-3 border-t space-y-2.5",q?"border-[#222] bg-[#080808]":"border-gray-200 bg-gray-50"),children:[jsxs("div",{className:u("text-[10px] font-mono font-bold uppercase tracking-[0.2em]",q?"text-white/40":"text-gray-500"),children:["\u25C8 ",B.labels.systemStatus]}),jsxs("div",{children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("span",{className:u("text-[10px] font-mono",q?"text-white/40":"text-gray-500"),children:B.labels.budgetUtil}),jsxs("span",{className:u("text-[10px] font-mono font-bold tabular-nums",q?"text-white/60":"text-gray-700",M&&"blur-sm select-none"),children:[Ee.budgetUtil,"%"]})]}),jsx("div",{className:u("h-1.5 rounded-full overflow-hidden",q?"bg-white/5":"bg-gray-200"),children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Ee.budgetUtil}%`,background:Ee.budgetUtil>90?"#EF4444":Ee.budgetUtil>70?"#F59E0B":"linear-gradient(to right, #2E94FF, #8B5CF6)"}})})]}),jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",q?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",q?"text-white/25":"text-gray-400"),children:B.labels.variance}),jsxs("div",{className:u("text-[11px] font-mono font-bold tabular-nums",Ee.avgVariance>0?"text-emerald-400":Ee.avgVariance<0?"text-red-400":q?"text-white/50":"text-gray-600"),children:[Ee.avgVariance>0?"+":"",Ee.avgVariance," ",B.labels.days]})]}),jsxs("div",{className:u("rounded-md px-2 py-1.5 text-center",q?"bg-white/[0.03] border border-white/[0.06]":"bg-gray-100 border border-gray-200"),children:[jsx("div",{className:u("text-[8px] font-mono uppercase tracking-wider mb-0.5",q?"text-white/25":"text-gray-400"),children:B.labels.cost}),jsx("div",{className:u("text-[11px] font-mono font-bold tabular-nums",Ee.costDisplay.startsWith("-")?"text-red-400":"text-emerald-400",M&&"blur-sm select-none"),children:Ee.costDisplay})]})]})]})]})]}),!J&&jsx(ho,{task:$,isOpen:!!$,onClose:()=>ee(null),onTaskUpdate:z=>{a.onTaskUpdate?.(z),ee(z);},theme:T==="dark"?"dark":"light",locale:G,availableUsers:t.availableUsers?.map(z=>({id:z.id,name:z.name,avatar:z.avatar,initials:z.name?.slice(0,2).toUpperCase()||"U",color:"#8B5CF6"}))||[],availableTags:c,onCreateTag:i,attachments:$?p?.get($.id)||[]:[],onUploadAttachments:a.onUploadAttachments,onDeleteAttachment:a.onDeleteAttachment,availableTasks:Bs(e).filter(z=>z.id!==$?.id),comments:d?.filter(z=>z.taskId===$?.id).map(z=>({...z,createdAt:z.createdAt instanceof Date?z.createdAt:new Date(z.createdAt),updatedAt:z.updatedAt instanceof Date?z.updatedAt:z.updatedAt?new Date(z.updatedAt):void 0})),onAddComment:m,currentUser:g,mentionableUsers:y,onUploadCommentAttachments:x,enableTimeTracking:f,timeTrackingSummary:b,timeEntries:w,isTimerRunning:C?.isRunning,timerElapsedSeconds:C?.elapsedSeconds,onTimeLog:S,onEstimateUpdate:E,onSoldEffortUpdate:k,onTimerStart:v,onTimerStop:P,onTimerDiscard:L,blurFinancials:M}),jsx(AnimatePresence,{children:xe&&jsxs(Fragment,{children:[jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>Be(null),className:"fixed inset-0 bg-black/50 z-40"}),jsxs(motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:u("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",q?"bg-[#0A0A0A]/95 backdrop-blur-xl border border-white/[0.08]":"bg-white border border-gray-200"),children:[jsxs("div",{className:u("px-4 py-3 border-b flex items-center justify-between",q?"border-white/[0.08] bg-[#080808]":"border-gray-200"),children:[jsx("span",{className:u("font-medium text-sm",q?"text-white/90":"text-gray-900"),children:xe.date.toLocaleDateString(G==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsx("button",{onClick:()=>Be(null),className:u("p-1 rounded",q?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:jsx(X,{className:"w-4 h-4"})})]}),jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-1.5",children:xe.events.map(z=>jsxs("button",{onClick:()=>{Be(null),Xe(z.task);},className:u("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",q?"hover:bg-white/5 border border-white/5":"hover:bg-gray-50 border border-gray-100"),children:[jsx(d0,{task:z.task,isDark:q}),jsx("span",{className:u("text-sm truncate flex-1",q?"text-white/80":"text-gray-900"),children:z.title}),(z.task.priority==="high"||z.task.priority==="urgent")&&jsx(Flag,{className:"w-3.5 h-3.5 text-red-400"})]},z.id))})]})]})})]})}var vc={bgPrimary:"#050505",bgSecondary:"#080808",bgHover:"rgba(255, 255, 255, 0.02)",bgToday:"rgba(0, 127, 255, 0.08)",bgWeekend:"#050505",bgOtherMonth:"#080808",border:"#222222",borderLight:"#1a1a1a",textPrimary:"rgba(255, 255, 255, 0.90)",textSecondary:"rgba(255, 255, 255, 0.60)",textMuted:"rgba(255, 255, 255, 0.30)",textToday:"#007FFF",accent:"#007FFF",accentHover:"#3399FF",accentLight:"rgba(0, 127, 255, 0.15)",statusTodo:"rgba(255, 255, 255, 0.40)",statusInProgress:"#007FFF",statusCompleted:"#34D399",focusRing:"#007FFF",glass:"rgba(20, 20, 20, 0.6)",glassBorder:"rgba(255, 255, 255, 0.08)",glassHover:"rgba(255, 255, 255, 0.05)",neonRed:"#FF2E2E",glowBlue:"0 0 10px rgba(0, 127, 255, 0.3)",glowRed:"0 0 10px rgba(255, 46, 46, 0.4)"},wc={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",glass:"rgba(255, 255, 255, 0.8)",glassBorder:"rgba(0, 0, 0, 0.08)",glassHover:"rgba(0, 0, 0, 0.04)",neonRed:"#DC2626",glowBlue:"0 0 10px rgba(0, 127, 255, 0.15)",glowRed:"0 0 10px rgba(220, 38, 38, 0.2)"},kc={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",glass:"rgba(26, 26, 46, 0.6)",glassBorder:"rgba(255, 255, 255, 0.06)",glassHover:"rgba(255, 255, 255, 0.04)",neonRed:"#EF4444",glowBlue:"0 0 10px rgba(99, 102, 241, 0.3)",glowRed:"0 0 10px rgba(239, 68, 68, 0.3)"},ol={dark:vc,light:wc,neutral:kc};function f0(e){return ol[e]||ol.dark}function kw({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:l}){let[c,i]=useState(false),p=useMemo(()=>t.filter(g=>e.cardIds.includes(g.id)),[t,e.cardIds]),d=useMemo(()=>{let g=p.length,y=new Set(p.flatMap(f=>f.assignedUserIds||[])).size,x=p.map(f=>f.priority).filter(Boolean),h=new Set(p.flatMap(f=>f.labels||[])).size;return {totalCards:g,uniqueAssignees:y,priorities:x,labels:h}},[p]),m=()=>{o?.(e.id);};return jsxs("div",{className:u("card-stack",!e.isExpanded&&"card-stack-collapsed",l),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxs("div",{className:"card-stack-header",onClick:m,children:[jsxs("div",{className:"card-stack-header-left",children:[jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:u("card-stack-chevron",e.isExpanded&&"expanded"),children:jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsx("h3",{className:"card-stack-title",children:e.title}),jsx("div",{className:"card-stack-badge",children:d.totalCards}),jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),c&&jsx("div",{className:"card-stack-actions",children:jsx("button",{className:"card-stack-action",onClick:g=>{g.stopPropagation(),n?.(e.id);},"aria-label":"Delete stack",children:jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxs("div",{className:"card-stack-summary",children:[jsxs("div",{className:"card-stack-summary-item",children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxs("span",{children:[d.uniqueAssignees," assignees"]})]}),d.labels>0&&jsxs("div",{className:"card-stack-summary-item",children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxs("span",{children:[d.labels," labels"]})]}),e.confidence&&jsx("div",{className:"card-stack-summary-item",children:jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsx("div",{className:"card-stack-content",children:p.length===0?jsxs("div",{className:"card-stack-empty",children:[jsx("p",{children:"No cards in this stack"}),jsx("span",{children:"Drag cards here or delete this stack"})]}):jsx("div",{className:"card-stack-cards",children:p.map(g=>jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsx("div",{onClick:()=>r?.(g),children:a(g)}):jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(g),children:[jsx("h4",{children:g.title}),g.description&&jsxs("p",{children:[g.description.substring(0,100),"..."]})]}),jsx("button",{className:"card-stack-unstack-btn",onClick:y=>{y.stopPropagation(),s?.(e.id,g.id);},"aria-label":"Remove from stack",children:jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.id))})})]})}var h0={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function Os(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function $s(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function y0(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function x0({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:l}){let c=useMemo(()=>({...h0,...n}),[n]),[i,p]=useState(new Set),d=useRef(null),m=useMemo(()=>{if(!c.groupByDay)return [{date:null,events:e}];let b=new Map;return e.forEach(w=>{let C=w.timestamp.toISOString().split("T")[0],S=b.get(C);S?S.push(w):b.set(C,[w]);}),Array.from(b.entries()).sort((w,C)=>C[0].localeCompare(w[0])).map(([w,C])=>({date:new Date(w),events:C.sort((S,E)=>E.timestamp.getTime()-S.timestamp.getTime())}))},[e,c.groupByDay]),{uniqueUsers:g,uniqueTypes:y}=useMemo(()=>{let b=new Set,w=new Set;return e.forEach(C=>{b.add(C.userId),w.add(C.type);}),{uniqueUsers:Array.from(b),uniqueTypes:Array.from(w)}},[e]),x=b=>{p(w=>{let C=new Set(w);return C.has(b)?C.delete(b):C.add(b),C});},h=b=>{let C=new Date().getTime()-b.getTime(),S=Math.floor(C/6e4),E=Math.floor(C/36e5),k=Math.floor(C/864e5);return S<1?"just now":S<60?`${S}m ago`:E<24?`${E}h ago`:k<7?`${k}d ago`:b.toLocaleDateString()},f=useMemo(()=>{let b=0;return t.types&&t.types.length>0&&b++,t.users&&t.users.length>0&&b++,t.dateRange&&b++,t.searchTerm&&b++,b},[t]);return useEffect(()=>{if(s&&d.current){let b=d.current.querySelector(`[data-event-id="${s}"]`);b&&b.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxs("div",{className:u("history-timeline-empty",l),children:[jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxs("div",{className:u("history-timeline",c.compact&&"compact",l),children:[jsxs("div",{className:"history-timeline-filters",children:[jsxs("div",{className:"history-timeline-filter-group",children:[jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:b=>{let w=b.target.value;a({...t,types:w?[w]:void 0});},children:[jsx("option",{value:"",children:"All Events"}),y.map(b=>jsxs("option",{value:b,children:[$s(b)," ",b.replace("_"," ")]},b))]}),g.length>1&&jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:b=>{let w=b.target.value;a({...t,users:w?[w]:void 0});},children:[jsx("option",{value:"",children:"All Users"}),g.map(b=>jsx("option",{value:b,children:b},b))]}),jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:b=>a({...t,searchTerm:b.target.value})})]}),f>0&&jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",f,")"]})]}),jsx("div",{className:"history-timeline-container",ref:d,children:m.map(b=>jsxs("div",{className:"history-timeline-group",children:[c.groupByDay&&b.date&&jsxs("div",{className:"history-timeline-day-header",children:[jsx("span",{className:"history-timeline-day-date",children:b.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxs("span",{className:"history-timeline-day-count",children:[b.events.length," events"]})]}),jsx("div",{className:"history-timeline-events",children:b.events.map((w,C)=>{let S=i.has(w.id),E=s===w.id,k=y0(w.type);return jsxs("div",{"data-event-id":w.id,className:u("history-timeline-event",S&&"expanded",E&&"selected"),onClick:()=>o?.(w),children:[jsxs("div",{className:"history-timeline-line",children:[jsx("div",{className:"history-timeline-dot",style:{backgroundColor:k},children:c.showIcons&&jsx("span",{className:"history-timeline-dot-icon",children:$s(w.type)})}),C<b.events.length-1&&jsx("div",{className:"history-timeline-connector",style:{borderColor:k}})]}),jsxs("div",{className:"history-timeline-event-content",children:[jsxs("div",{className:"history-timeline-event-header",children:[jsxs("div",{className:"history-timeline-event-header-left",children:[c.showAvatars&&w.userAvatar&&jsx("img",{src:w.userAvatar,alt:w.userName||w.userId,className:"history-timeline-event-avatar"}),jsxs("div",{className:"history-timeline-event-description",children:[jsx("span",{className:"history-timeline-event-user",children:w.userName||w.userId}),jsx("span",{className:"history-timeline-event-action",children:Os(w)})]})]}),jsx("div",{className:"history-timeline-event-time",children:c.useRelativeTime?h(w.timestamp):w.timestamp.toLocaleString()})]}),Object.keys(w.changes).length>0&&jsxs("button",{className:"history-timeline-event-toggle",onClick:v=>{v.stopPropagation(),x(w.id);},children:[S?"\u25BC":"\u25B6"," Show changes"]}),S&&jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(w.changes).map(([v,P])=>jsxs("div",{className:"history-timeline-event-change",children:[jsxs("span",{className:"history-timeline-event-change-key",children:[v,":"]}),jsxs("div",{className:"history-timeline-event-change-values",children:[jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(P.from)}),jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(P.to)})]})]},v)),w.metadata&&Object.keys(w.metadata).length>0&&jsxs("div",{className:"history-timeline-event-metadata",children:[jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(w.metadata).map(([v,P])=>jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxs("span",{className:"history-timeline-event-metadata-key",children:[v,":"]}),jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(P)})]},v))]})]})]})]},w.id)})})]},b.date?.toISOString()||"all"))})]})}function w0({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:l,onSpeedChange:c,className:i}){let p=[.5,1,1.5,2,3],d=useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),m=useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxs("div",{className:u("history-replay-empty",i),children:[jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxs("div",{className:u("history-replay",i),children:[jsxs("div",{className:"history-replay-current-event",children:[jsx("div",{className:"history-replay-event-icon",children:d&&$s(d.type)}),jsxs("div",{className:"history-replay-event-info",children:[jsx("div",{className:"history-replay-event-description",children:d&&Os(d)}),jsxs("div",{className:"history-replay-event-meta",children:[jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsx("span",{className:"history-replay-event-time",children:d&&d.timestamp.toLocaleString()})]})]})]}),jsxs("div",{className:"history-replay-progress-container",children:[jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:g=>l(parseInt(g.target.value))}),jsx("div",{className:"history-replay-progress-fill",style:{width:`${m}%`}}),jsx("div",{className:"history-replay-progress-markers",children:t.map((g,y)=>jsx("div",{className:u("history-replay-progress-marker",y===e.currentIndex&&"active"),style:{left:`${y/(e.totalEvents-1)*100}%`},onClick:()=>l(y),title:Os(g)},g.id))})]}),jsxs("div",{className:"history-replay-controls",children:[jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:o,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsx("button",{className:"history-replay-control-btn",onClick:n,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxs("div",{className:"history-replay-speed",children:[jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsx("div",{className:"history-replay-speed-buttons",children:p.map(g=>jsxs("button",{className:u("history-replay-speed-btn",e.speed===g&&"active"),onClick:()=>c(g),children:[g,"x"]},g))})]}),jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxs("div",{className:"history-replay-shortcuts",children:[jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"\u2190"})," Previous"]}),jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"\u2192"})," Next"]}),jsxs("span",{className:"history-replay-shortcut",children:[jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxs("div",{className:"history-replay-card-preview",children:[jsxs("div",{className:"history-replay-card-preview-header",children:[jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsx("span",{className:"history-replay-card-preview-time",children:d&&d.timestamp.toLocaleDateString()})]}),jsxs("div",{className:"history-replay-card-preview-content",children:[jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxs("div",{className:"history-replay-card-preview-field",children:[jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(g=>jsx("span",{className:"history-replay-card-preview-label-tag",children:g},g))})]})]})]})]}):jsxs("div",{className:u("history-replay-start",i),children:[jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsx("span",{children:"Start Time Travel"})]}),jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function Cc(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function Tc(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function k0(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function C0(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Ew(e,t,a,r,o,s=100){let n=e.map(c=>({...c,x:c.x??a/2+Math.random()*100-50,y:c.y??r/2+Math.random()*100-50,vx:0,vy:0})),l=new Map(n.map(c=>[c.id,c]));for(let c=0;c<s;c++){let i=1-c/s;n.forEach(p=>{let d=a/2,m=r/2;p.vx+=(d-p.x)*o.centerForce*i,p.vy+=(m-p.y)*o.centerForce*i,n.forEach(g=>{if(p.id===g.id)return;let y=p.x-g.x,x=p.y-g.y,h=Math.sqrt(y*y+x*x)||1,f=o.chargeStrength*i/(h*h);p.vx+=y/h*f,p.vy+=x/h*f;});}),t.forEach(p=>{let d=l.get(typeof p.source=="string"?p.source:p.source.id),m=l.get(typeof p.target=="string"?p.target:p.target.id);if(!d||!m)return;let g=m.x-d.x,y=m.y-d.y,x=Math.sqrt(g*g+y*y)||1,h=(x-o.linkDistance)/x*o.forceStrength*i;d.vx+=g*h,d.vy+=y*h,m.vx-=g*h,m.vy-=y*h;}),n.forEach(p=>{p.fx!==null&&p.fx!==void 0?(p.x=p.fx,p.vx=0):p.x+=p.vx,p.fy!==null&&p.fy!==void 0?(p.y=p.fy,p.vy=0):p.y+=p.vy,p.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,p.x)),p.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,p.y)),p.vx*=.9,p.vy*=.9;});}return n}function T0({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:l,className:c}){let i=useRef(null),[p,d]=useState([]),[m,g]=useState(null),[y,x]=useState(null),[h,f]=useState(null),[b,w]=useState(1),[C,S]=useState({x:0,y:0});useEffect(()=>{if(e.length===0)return;let H=Ew(e,t,a.width,a.height,a,150);d(H);},[e,t,a]);let E=useCallback((H,Y)=>{a.enableDragging&&(Y.stopPropagation(),g(H));},[a.enableDragging]),k=useCallback(H=>{if(!m||!i.current)return;let T=i.current.getBoundingClientRect(),G=(H.clientX-T.left-C.x)/b,te=(H.clientY-T.top-C.y)/b;d(Le=>Le.map(B=>B.id===m?{...B,x:G,y:te,fx:G,fy:te}:B));},[m,b,C]),v=useCallback(()=>{g(null);},[]),P=useCallback((H,Y)=>{Y.stopPropagation(),l?.({type:"node-click",node:H,position:{x:Y.clientX,y:Y.clientY}});},[l]),L=useCallback((H,Y)=>{Y.stopPropagation(),l?.({type:"edge-click",edge:H,position:{x:Y.clientX,y:Y.clientY}});},[l]),M=useCallback(H=>{let Y=p.find(T=>T.id===H);return Y?{x:Y.x,y:Y.y}:{x:0,y:0}},[p]),J=useCallback(H=>{if(H.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return H.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let Y=H.card.priority;return Y==="URGENT"?"#ef4444":Y==="HIGH"?"#f59e0b":Y==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return H.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxs("div",{className:u("relationships-graph-empty",c),children:[jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxs("div",{className:u("relationships-graph",c),children:[jsxs("div",{className:"relationships-graph-controls",children:[jsxs("div",{className:"relationships-graph-stats",children:[jsxs("span",{className:"relationships-graph-stat",children:[jsx("span",{className:"relationships-graph-stat-value",children:n.totalNodes}),jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxs("span",{className:"relationships-graph-stat",children:[jsx("span",{className:"relationships-graph-stat-value",children:n.totalEdges}),jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>w(H=>Math.min(H+.2,3)),children:"+"}),jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(b*100),"%"]}),jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>w(H=>Math.max(H-.2,.5)),children:"\u2212"}),jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{w(1),S({x:0,y:0});},children:"Reset"})]})]}),jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map(H=>H.type))).map(H=>jsxs("div",{className:"relationships-graph-legend-item",children:[jsx("div",{className:"relationships-graph-legend-color",style:{background:Cc(H)}}),jsxs("span",{className:"relationships-graph-legend-label",children:[k0(H)," ",Tc(H)]})]},H))}),jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:k,onMouseUp:v,onMouseLeave:v,children:[jsxs("g",{transform:`translate(${C.x}, ${C.y}) scale(${b})`,children:[jsx("g",{className:"relationships-graph-edges",children:t.map(H=>{let Y=M(typeof H.source=="string"?H.source:H.source.id),T=M(typeof H.target=="string"?H.target:H.target.id),G=C0(H.type),te=h===H.id,Le=H.onCriticalPath;return jsxs("g",{className:u("relationships-graph-edge",te&&"hovered",Le&&"critical"),onMouseEnter:()=>f(H.id),onMouseLeave:()=>f(null),onClick:B=>L(H,B),children:[jsx("line",{x1:Y.x,y1:Y.y,x2:T.x,y2:T.y,stroke:Cc(H.type),strokeWidth:Le?a.edgeWidth*2:a.edgeWidth,strokeOpacity:te?1:.6,markerEnd:G?"url(#arrowhead)":void 0}),a.showEdgeLabels&&te&&jsx("text",{x:(Y.x+T.x)/2,y:(Y.y+T.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Tc(H.type)})]},H.id)})}),jsx("g",{className:"relationships-graph-nodes",children:p.map(H=>{let Y=y===H.id,T=H.onCriticalPath;return jsxs("g",{className:u("relationships-graph-node",Y&&"hovered",T&&"critical"),transform:`translate(${H.x}, ${H.y})`,onMouseDown:G=>E(H.id,G),onMouseEnter:()=>x(H.id),onMouseLeave:()=>x(null),onClick:G=>P(H,G),children:[jsx("circle",{r:T?a.nodeSize*1.2:a.nodeSize,fill:J(H),stroke:T?"#fbbf24":"#ffffff",strokeWidth:T?3:2,opacity:Y?1:.9}),a.showLabels&&jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:H.card.title.length>20?H.card.title.substring(0,20)+"...":H.card.title})]},H.id)})})]}),jsx("defs",{children:jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function S0({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=useState(""),[l,c]=useState(false),[i,p]=useState(null),[d,m]=useState(null),g=useRef(null),y=l||o;useEffect(()=>{e&&g.current&&g.current.focus();},[e]),useEffect(()=>{let b=w=>{w.key==="Escape"&&!y&&x();};if(e)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,y]);let x=()=>{y||(n(""),p(null),m(null),t());},h=async()=>{if(!(!s.trim()||y)){c(true),p(null),m(null);try{let b=await r(s.trim());m(b);}catch(b){p(b instanceof Error?b.message:"Failed to generate plan");}finally{c(false);}}},f=()=>{d&&(a(d),x());};return e?jsxs(Zt,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:x}),jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:b=>b.stopPropagation(),children:[jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsx("button",{onClick:x,disabled:y,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:d?jsx(Fragment,{children:jsxs("div",{className:"space-y-4",children:[jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),d.explanation&&jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsx("p",{className:"text-sm text-white/90",children:d.explanation})}),jsxs("div",{children:[jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",d.columns.length,")"]}),jsx("div",{className:"flex gap-2 flex-wrap",children:d.columns.map((b,w)=>jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:b.title},w))})]}),jsxs("div",{children:[jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",d.cards.length,")"]}),jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[d.cards.slice(0,10).map((b,w)=>jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex-1",children:[jsx("p",{className:"text-sm font-medium text-white/90",children:b.title}),b.description&&jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:b.description})]}),b.priority&&jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${b.priority==="URGENT"?"bg-red-500/20 text-red-400":b.priority==="HIGH"?"bg-orange-500/20 text-orange-400":b.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:b.priority})]})},w)),d.cards.length>10&&jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",d.cards.length-10," more tasks..."]})]})]})]})}):jsxs(Fragment,{children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsx("textarea",{ref:g,value:s,onChange:b=>n(b.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:y}),jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((b,w)=>jsx("button",{onClick:()=>n(b),disabled:y,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:b},w))})]})]})}),jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsx("div",{children:y&&jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsx("span",{children:"Generating with AI..."})]})}),jsxs("div",{className:"flex items-center gap-3",children:[jsx("button",{onClick:x,disabled:y,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),d?jsx("button",{onClick:f,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsx("button",{onClick:h,disabled:!s.trim()||y,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:y?"Generating...":"Generate Plan"})]})]})]})})]}):null}var Nc={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Fw={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},Pw={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Aw(e,t,a){let r=Nc[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function Hs(e){return `$${e.toFixed(4)}`}var Dc=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Aw(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(d=>d.timestamp>=t.start&&d.timestamp<=t.end));let r=a.length,o=a.reduce((d,m)=>d+m.cost,0),s=a.reduce((d,m)=>d+m.inputTokens,0),n=a.reduce((d,m)=>d+m.outputTokens,0),l=a.filter(d=>d.success),c=a.reduce((d,m)=>d+m.duration,0),i={},p={};return a.forEach(d=>{i[d.feature]=(i[d.feature]||0)+1,p[d.feature]=(p[d.feature]||0)+d.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:p,averageDuration:r>0?c/r:0,successRate:r>0?l.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let l=this.operations.filter(p=>p.timestamp>=n).length,c=Math.max(0,o-l),i=l/o*100;return {used:l,limit:o,remaining:c,percentUsed:i,isExceeded:l>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},gn=new Dc;function F0({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=useState(gn.getStats()),[s,n]=useState(gn.checkLimit(a));if(useEffect(()=>{if(!e)return;let c=setInterval(()=>{o(gn.getStats()),n(gn.checkLimit(a));},1e3);return ()=>clearInterval(c)},[e,a]),useEffect(()=>{let c=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[e,t]),!e)return null;let l=gn.getRecentOperations(5);return jsxs(Zt,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:c=>c.stopPropagation(),children:[jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:Hs(r.totalCost)})]}),jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:r.totalOperations})]}),jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([c,i])=>{let p=r.costsByFeature[c]||0,d=r.totalOperations>0?i/r.totalOperations*100:0;return jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:c.replace(/([A-Z])/g," $1").trim()}),jsxs("div",{className:"flex items-center gap-3",children:[jsxs("span",{className:"text-xs text-white/60",children:[i," ops"]}),jsx("span",{className:"text-xs font-semibold text-green-400",children:Hs(p)})]})]}),jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsx("div",{className:"h-full bg-blue-500",style:{width:`${d}%`}})})]},c)})})]}),jsxs("div",{children:[jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),l.length===0?jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsx("div",{className:"space-y-2",children:l.map(c=>jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:c.feature.replace(/([A-Z])/g," $1").trim()}),jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(c.timestamp).toLocaleTimeString()," \u2022"," ",c.duration,"ms"]})]}),jsxs("div",{className:"flex items-center gap-3",children:[jsxs("span",{className:"text-xs text-white/60",children:[c.inputTokens+c.outputTokens," tokens"]}),jsx("span",{className:"text-xs font-semibold text-green-400",children:Hs(c.cost)}),jsx("div",{className:`w-2 h-2 rounded-full ${c.success?"bg-green-400":"bg-red-400"}`})]})]},c.id))})]})]}),jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function L0({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,l]=useState(""),[c,i]=useState(""),[p,d]=useState(""),[m,g]=useState(false),[y,x]=useState(null),[h,f]=useState(null),[b,w]=useState(null),C=useRef(null),S=m||o;useEffect(()=>{e&&C.current&&C.current.focus();},[e]),useEffect(()=>{let L=M=>{M.key==="Escape"&&!S&&E();};if(e)return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[e,S]);let E=()=>{S||(l(""),i(""),d(""),x(null),f(null),w(null),t());},k=async()=>{if(!(!n.trim()||S)){g(true),x(null),f(null),w(null);try{let L=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:c||void 0,endDate:p||void 0});f(L.tasks.tasks),w({from_cache:L.from_cache,tokens_used:L.tokens_used,mock_mode:L.mock_mode,similarity:L.similarity,tokens_saved:L.tokens_saved});}catch(L){x(L instanceof Error?L.message:"Failed to generate tasks");}finally{g(false);}}},v=()=>{h&&(a(h),E());};if(!e)return null;let P=b?.similarity?((b.similarity||0)*100).toFixed(0):"0";return jsxs(Zt,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:E}),jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:L=>L.stopPropagation(),children:[jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsx("button",{onClick:E,disabled:S,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:h?jsx(Fragment,{children:jsxs("div",{className:"space-y-4",children:[jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxs("div",{className:"flex flex-wrap gap-2",children:[b?.mock_mode&&jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),b?.from_cache?jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",P,"% similar)"]}):jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[b?.tokens_used||0," tokens"]}),b?.tokens_saved&&jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[b.tokens_saved," tokens saved"]}),jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[h.length," tasks"]})]}),jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:h.map((L,M)=>jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex-1",children:[jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxs("span",{className:"text-xs text-white/50",children:["#",M+1]}),jsx("p",{className:"text-sm font-medium text-white/90",children:L.name})]}),jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),L.start," \u2192 ",L.end]}),jsxs("span",{children:[L.duration," days"]}),L.dependencies.length>0&&jsxs("span",{className:"text-blue-400",children:["Depends: ",L.dependencies.join(", ")]})]})]}),jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${L.priority==="high"?"bg-red-500/20 text-red-400":L.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:L.priority})]})},L.id))})]})}):jsxs(Fragment,{children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsx("textarea",{ref:C,value:n,onChange:L=>l(L.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:S}),jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsx("input",{type:"date",value:c,onChange:L=>i(L.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:S})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsx("input",{type:"date",value:p,onChange:L=>d(L.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:S})]})]}),y&&jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:y}),jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((L,M)=>jsx("button",{onClick:()=>l(L),disabled:S,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:L},M))})]})]})}),jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsx("div",{children:S&&jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsx("span",{children:"Generating with AI..."})]})}),jsxs("div",{className:"flex items-center gap-3",children:[jsx("button",{onClick:E,disabled:S,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),h?jsx("button",{onClick:v,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsx("button",{onClick:k,disabled:!n.trim()||S,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #2E94FF 0%, #2E94FF 100%)",color:"#ffffff"},children:S?"Generating...":"Generate Tasks"})]})]})]})})]})}function il({initialBoard:e,onPersist:t}){let[a,r]=useState(e),o=useCallback(h=>{t&&Xs(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(f,b,w)=>{console.warn(`Retry attempt ${b} after ${w}ms: ${f.message}`);}}).then(f=>{f.success||console.error(`Failed to persist board after ${f.attempts} attempts:`,f.error);});},[t]),s=useCallback(async(h,f,b)=>{r(w=>{let C=w.cards.find(L=>L.id===h);if(!C)return w;let S=C.columnId,E={...C,columnId:f,position:b},k=w.cards.map(L=>L.id===h?E:L),v=w.columns.map(L=>{if(L.id===S)return {...L,cardIds:L.cardIds.filter(M=>M!==h)};if(L.id===f){let M=k.filter(J=>J.columnId===f).sort((J,H)=>J.position-H.position);return {...L,cardIds:M.map(J=>J.id)}}return L}),P={...w,cards:k,columns:v};return o(P),P});},[o]),n=useCallback(async(h,f)=>{r(b=>{let w=b.cards.map(S=>S.id===h?{...S,...f}:S),C={...b,cards:w};return o(C),C});},[o]),l=useCallback(async h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let w={...h,id:f},C=b.columns.map(E=>E.id===h.columnId?{...E,cardIds:[...E.cardIds,f]}:E),S={...b,cards:[...b.cards,w],columns:C};return o(S),S});},[o]),c=useCallback(async h=>{r(f=>{let b=f.cards.find(E=>E.id===h);if(!b)return f;let w=f.cards.filter(E=>E.id!==h),C=f.columns.map(E=>E.id===b.columnId?{...E,cardIds:E.cardIds.filter(k=>k!==h)}:E),S={...f,cards:w,columns:C};return o(S),S});},[o]),i=useCallback(async h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(b=>{let w={...h,id:f,cardIds:[]},C={...b,columns:[...b.columns,w]};return o(C),C});},[o]),p=useCallback(async(h,f)=>{r(b=>{let w=b.columns.map(S=>S.id===h?{...S,...f}:S),C={...b,columns:w};return o(C),C});},[o]),d=useCallback(async h=>{r(f=>{let b=f.cards.filter(S=>S.columnId!==h),w=f.columns.filter(S=>S.id!==h),C={...f,cards:b,columns:w};return o(C),C});},[o]),m=useCallback(h=>{let f=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return l(h),f},[l]),g=useCallback(h=>{let f=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),f},[i]),y=useCallback(()=>{r(h=>{let f={...h,cards:[],columns:[]};return o(f),f});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:l,onCardDelete:c,onColumnCreate:i,onColumnUpdate:p,onColumnDelete:d},setBoard:r,helpers:{addCard:m,addColumn:g,deleteCard:c,deleteColumn:d,clearBoard:y}}}function B0({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=il({initialBoard:e,onPersist:a}),n=useMemo(()=>({addCard:(c,i,p={})=>{s.addCard({title:i,columnId:c,position:r.cards.filter(d=>d.columnId===c).length,...p});},addColumn:(c,i)=>{let p=r.columns.length>0?Math.max(...r.columns.map(d=>d.position)):0;s.addColumn({title:c,position:i??p+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var zs={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},O0={by:"none",order:"asc"};function $0({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=useState({...zs,...e}),[s,n]=useState({...O0,...t}),l=useCallback(x=>{o(h=>({...h,...x}));},[]),c=useCallback(x=>{n(h=>({...h,...x}));},[]),i=useCallback(()=>{o(zs),n(O0);},[]),p=useCallback(()=>{a&&o({...zs,assignees:[a]});},[a]),d=useCallback(()=>{o({...zs,dateFilter:"overdue"});},[]),m=useCallback(()=>{o({...zs,priorities:["HIGH","URGENT"]});},[]),g=useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),y=useCallback(x=>{let h=[...x];if(r.search){let f=r.search.toLowerCase();h=h.filter(b=>b.title.toLowerCase().includes(f)||b.description?.toLowerCase().includes(f));}if(r.dateFilter!=="all"){let f=new Date,b=f.getFullYear(),w=String(f.getMonth()+1).padStart(2,"0"),C=String(f.getDate()).padStart(2,"0"),S=`${b}-${w}-${C}`;h=h.filter(E=>{if(!E.endDate&&!E.dueDate)return false;let k=E.endDate||E.dueDate;if(!k)return false;let v;if(typeof k=="string")v=k.split("T")[0]||k;else {let P=k.getUTCFullYear(),L=String(k.getUTCMonth()+1).padStart(2,"0"),M=String(k.getUTCDate()).padStart(2,"0");v=`${P}-${L}-${M}`;}switch(r.dateFilter){case "overdue":return v<S;case "today":return v===S;case "this-week":let P=new Date(S+"T00:00:00"),L=new Date(v+"T00:00:00"),M=new Date(P);return M.setDate(M.getDate()+7),L>=P&&L<=M;case "custom":if(r.dateRange){let J=typeof k=="string"?new Date(k):k;return J>=r.dateRange.start&&J<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(h=h.filter(f=>f.priority&&r.priorities.includes(f.priority))),r.assignees.length>0&&(h=h.filter(f=>(f.assignedUserIds||(f.assigneeId?[f.assigneeId]:[])).some(w=>r.assignees.includes(w)))),r.labels.length>0&&(h=h.filter(f=>f.labels&&f.labels.some(b=>r.labels.includes(b)))),r.columns.length>0&&(h=h.filter(f=>r.columns.includes(f.columnId))),s.by!=="none"&&h.sort((f,b)=>{let w=0;switch(s.by){case "created":let C=f.createdAt?new Date(f.createdAt).getTime():0,S=b.createdAt?new Date(b.createdAt).getTime():0;w=C-S;break;case "priority":let E={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},k=E[f.priority||"LOW"],v=E[b.priority||"LOW"];w=k-v;break;case "dueDate":let P=f.endDate||f.dueDate,L=b.endDate||b.dueDate;if(!P)return 1;if(!L)return -1;let M=typeof P=="string"?new Date(P).getTime():P.getTime(),J=typeof L=="string"?new Date(L).getTime():L.getTime();w=M-J;break;case "title":w=f.title.localeCompare(b.title);break;case "estimate":let H=f.estimatedTime||0,Y=b.estimatedTime||0;w=H-Y;break;default:w=0;}return s.order==="asc"?w:-w}),h},[r,s]);return {filters:r,sort:s,setFilters:l,setSort:c,resetFilters:i,filterMyTasks:p,filterOverdue:d,filterHighPriority:m,applyFilters:y,hasActiveFilters:g}}var z0,U0;if(typeof window<"u")try{let e=Ks("ai");z0=e.generateObject,U0=e.generateText;}catch{}function W0(e={}){let[t,a]=useState(false),[r,o]=useState(null),s=!!(z0&&U0&&e.apiKey),n=useCallback(async d=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(null);try{return console.log("Generating plan for:",d),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${d}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(m){let g=m instanceof Error?m:new Error("Failed to generate plan");throw o(g),g}finally{a(false);}},[s]),l=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",d.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(m){let g=m instanceof Error?m:new Error("Failed to suggest assignee");throw o(g),g}finally{a(false);}},[s]),c=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(m){let g=m instanceof Error?m:new Error("Failed to predict risks");throw o(g),g}finally{a(false);}},[s]),i=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",d.title),[{title:`Subtask 1 for: ${d.title}`,position:d.position+.1,columnId:d.columnId},{title:`Subtask 2 for: ${d.title}`,position:d.position+.2,columnId:d.columnId}]}catch(m){let g=m instanceof Error?m:new Error("Failed to generate subtasks");throw o(g),g}finally{a(false);}},[s]),p=useCallback(async d=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",d.title),{hours:8,confidence:.75}}catch(m){let g=m instanceof Error?m:new Error("Failed to estimate effort");throw o(g),g}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:l,onPredictRisks:c,onGenerateSubtasks:i,onEstimateEffort:p,isAvailable:s,isLoading:t,error:r}}function Ec(){let[e,t]=useState(()=>selectionStore.getState());useEffect(()=>selectionStore.subscribe(o=>{t(o);}),[]);let a=useCallback(r=>{selectionStore.setState(r);},[]);return [e,a]}function V0(e){let{cards:t}=e,[a,r]=Ec(),o=useCallback(d=>a.selectedCardIds.includes(d),[a.selectedCardIds]),s=useCallback((d,m)=>{if(!m){r({selectedCardIds:[d],lastSelectedCardId:d});return}let g=m.ctrlKey||m.metaKey,y=m.shiftKey;if(g)a.selectedCardIds.includes(d)?r({selectedCardIds:a.selectedCardIds.filter(x=>x!==d),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});else if(y&&a.lastSelectedCardId){let x=t.find(f=>f.id===d),h=t.find(f=>f.id===a.lastSelectedCardId);if(x&&h&&x.columnId===h.columnId){let f=t.filter(v=>v.columnId===x.columnId).sort((v,P)=>v.position-P.position),b=f.findIndex(v=>v.id===a.lastSelectedCardId),w=f.findIndex(v=>v.id===d),[C,S]=b<w?[b,w]:[w,b],E=f.slice(C,S+1).map(v=>v.id),k=Array.from(new Set([...a.selectedCardIds,...E]));r({selectedCardIds:k,lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});}else r({selectedCardIds:[d],lastSelectedCardId:d});},[t,a,r]),n=useCallback(d=>{r({selectedCardIds:a.selectedCardIds.filter(m=>m!==d),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),l=useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),c=useCallback(()=>{r({selectedCardIds:t.map(d=>d.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=useCallback(d=>{a.selectedCardIds.includes(d)?n(d):r({selectedCardIds:[...a.selectedCardIds,d],lastSelectedCardId:d});},[a,n,r]),p=useCallback(()=>t.filter(d=>a.selectedCardIds.includes(d.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:l,selectAll:c,toggleCard:i,getSelectedCards:p}}var G0={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function j0(e){let{cards:t,config:a,aiService:r}=e,o=useMemo(()=>({...G0,...a}),[a]),[s,n]=useState([]),l=useCallback((x,h,f,b,w)=>{if(h.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let C={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:x,cardIds:h,columnId:f,strategy:b,color:w,isExpanded:true,position:s.filter(S=>S.columnId===f).length,createdAt:new Date};n(S=>[...S,C]);},[o.minCardsPerStack,s]),c=useCallback(x=>{n(h=>h.filter(f=>f.id!==x));},[]),i=useCallback(x=>{n(h=>h.map(f=>f.id===x?{...f,isExpanded:!f.isExpanded}:f));},[]),p=useCallback((x,h)=>{n(f=>f.map(b=>b.id===x&&!b.cardIds.includes(h)?{...b,cardIds:[...b.cardIds,h]}:b));},[]),d=useCallback((x,h)=>{n(f=>f.map(b=>{if(b.id===x){let w=b.cardIds.filter(C=>C!==h);return w.length<o.minCardsPerStack?null:{...b,cardIds:w}}return b}).filter(b=>b!==null));},[o.minCardsPerStack]),m=useCallback(x=>s.filter(h=>h.columnId===x).sort((h,f)=>h.position-f.position),[s]),g=useCallback(async x=>{let h=t.filter(S=>S.columnId===x);if(h.length<o.minCardsPerStack*2)return [];let f=[],b=new Map;h.forEach(S=>{S.labels&&S.labels.length>0&&S.labels.forEach(E=>{b.has(E)||b.set(E,[]),b.get(E).push(S);});}),b.forEach((S,E)=>{S.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F4CC} ${E}`,cardIds:S.map(k=>k.id),columnId:x,strategy:"labels",color:"#3b82f6"},reason:`${S.length} cards with label "${E}"`,confidence:.85});});let w=new Map;h.forEach(S=>{S.assignedUserIds&&S.assignedUserIds.length>0&&S.assignedUserIds.forEach(E=>{w.has(E)||w.set(E,[]),w.get(E).push(S);});}),w.forEach((S,E)=>{S.length>=o.minCardsPerStack&&f.push({stack:{title:`\u{1F464} Assigned to user-${E.slice(-4)}`,cardIds:S.map(k=>k.id),columnId:x,strategy:"assignee",color:"#8b5cf6"},reason:`${S.length} cards assigned to the same user`,confidence:.8});});let C=new Map;if(h.forEach(S=>{S.priority&&(C.has(S.priority)||C.set(S.priority,[]),C.get(S.priority).push(S));}),C.forEach((S,E)=>{if(S.length>=o.minCardsPerStack){let k={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[E.toLowerCase()]||"\u26AA";f.push({stack:{title:`${k} ${E} Priority`,cardIds:S.map(v=>v.id),columnId:x,strategy:"priority",color:E==="high"||E==="urgent"?"#ef4444":"#10b981"},reason:`${S.length} cards with ${E} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let S of h){let k=(await r.findSimilar(S,h)).filter(v=>v.similarity>=o.autoStackConfidenceThreshold);if(k.length>=o.minCardsPerStack-1){let v=[S.id,...k.map(L=>L.card.id)],P=k.reduce((L,M)=>L+M.similarity,0)/k.length;f.push({stack:{title:`\u2728 Similar to "${S.title.substring(0,30)}${S.title.length>30?"...":""}"`,cardIds:v,columnId:x,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${k.length+1} similar tasks`,confidence:P});}}return f.filter(S=>S.confidence>=o.autoStackConfidenceThreshold).sort((S,E)=>E.confidence-S.confidence).slice(0,5)},[t,o,r]),y=useCallback(x=>{l(x.stack.title,x.stack.cardIds,x.stack.columnId,x.stack.strategy,x.stack.color);},[l]);return useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let f=await g(h),b=f[0];f.length>0&&b&&b.confidence>=.9&&y(b);});},[]),{stacks:s,createStack:l,deleteStack:c,toggleStack:i,addToStack:p,removeFromStack:d,getStacksForColumn:m,getSuggestions:g,applySuggestion:y,config:o}}var _0=createContext(null);function K0({children:e,initialData:t,onStateChange:a}){let r=useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(c=>{let{Column:i}=Ks("@libxai/core");s.set(c.id,new i(c));}),t?.cards?.forEach(c=>{let{Card:i}=Ks("@libxai/core");n.set(c.id,new i(c));});let l=null;if(t?.board){let{Board:c}=Ks("@libxai/core");l=new c(t.board);}r.current=new BoardStore({board:l,columns:s,cards:n});}let o=r.current;return useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsx(_0.Provider,{value:{store:o},children:e})}function ll(){let e=useContext(_0);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function Ws(){let e=ll(),[t,a]=useState(e.getBoard()),[r,o]=useState(e.getAllColumns()),[s,n]=useState(e.getAllCards());useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let l=useCallback(b=>{e.updateBoard(b);},[e]),c=useCallback(b=>{e.addColumn(b);},[e]),i=useCallback((b,w)=>{e.updateColumn(b,w);},[e]),p=useCallback(b=>{e.deleteColumn(b);},[e]),d=useCallback(b=>e.getColumn(b),[e]),m=useCallback(b=>{e.addCard(b);},[e]),g=useCallback((b,w)=>{e.updateCard(b,w);},[e]),y=useCallback(b=>{e.deleteCard(b);},[e]),x=useCallback((b,w,C)=>{e.moveCard(b,w,C);},[e]),h=useCallback(b=>e.getCard(b),[e]),f=useCallback(b=>e.getCardsByColumn(b),[e]);return {board:t,columns:r,cards:s,updateBoard:l,addColumn:c,updateColumn:i,deleteColumn:p,getColumn:d,addCard:m,updateCard:g,deleteCard:y,moveCard:x,getCard:h,getCardsByColumn:f}}function Y0(e){let{cards:t}=Ws();return useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function X0(e="position",t="asc"){let{cards:a}=Ws();return useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let l={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},c=o.priority?l[o.priority]:0,i=s.priority?l[s.priority]:0;n=c-i;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var dl=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=lu.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let l=await Promise.resolve(n.apply(s,a));l!==void 0&&(o=l,a[0]=l);}catch(l){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,l,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},Yw=new dl;function Q0({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:l=0,getItemKey:c}){let i=useRef(null),p=useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:l}),d=p.getVirtualItems(),m={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},g=n?{width:`${p.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${p.getTotalSize()}px`,width:"100%",position:"relative"};return jsx("div",{ref:i,style:m,className:o,children:jsx("div",{style:g,children:d.map(y=>{let x=e[y.index];if(!x)return null;let h=c?c(x,y.index):y.index,f={position:"absolute",top:n?0:y.start,left:n?y.start:0,width:n?y.size:"100%",height:n?"100%":y.size};return jsx("div",{style:f,"data-index":y.index,children:r(x,y.index)},h)})})})}function Z0(e){return useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function tf({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:l=16,getItemKey:c,horizontal:i=true}){let p=useRef(null),d=useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>p.current,estimateSize:()=>r,overscan:n,gap:l}),m=d.getVirtualItems(),g={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},y={width:`${d.getTotalSize()}px`,height:"100%",position:"relative"};return jsx("div",{ref:p,style:g,className:s,children:jsx("div",{style:y,children:m.map(x=>{let h=e[x.index];if(!h)return null;let f=c?c(h,x.index):x.index,b={position:"absolute",top:0,left:x.start,width:x.size,height:"100%"};return jsx("div",{style:b,"data-index":x.index,children:o(h,x.index)},f)})})})}function af(e){let t=useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function rf(e,t=10){return e>t}var Ac={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Lc={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Ic={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},Bc={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Rc={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},Oc={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},$c={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Hc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},zc={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},Uc={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Wc={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},Vc={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},cl={spacing:Ac,borderRadius:Lc,fontSize:Ic,fontWeight:Bc,lineHeight:Rc,zIndex:Oc,duration:$c,easing:Hc,shadows:zc,opacity:Uc,kanban:Wc,gantt:Vc};function of(e,t,a){return e[t]??a}function Gc(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?Gc(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function Qw(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function jc(e="asakaa"){let t=Gc(cl),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=Qw(o);a.push(` ${s}: ${n};`);}return `:root {
|
|
434
434
|
${a.join(`
|
|
435
435
|
`)}
|
|
436
436
|
}`}function Vs(e,t="asakaa"){let a=[],r=Gc(e);for(let[o,s]of Object.entries(r)){let n=`--${t}-color-${o}`;a.push(` ${n}: ${s};`);}return `:root {
|