@libxai/board 1.9.36 → 1.9.37
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.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1027,6 +1027,12 @@ interface BoardConfig {
|
|
|
1027
1027
|
columnWidth?: number;
|
|
1028
1028
|
/** Estimated card height for virtualization */
|
|
1029
1029
|
cardHeight?: number;
|
|
1030
|
+
/**
|
|
1031
|
+
* 1.9.37 · columnas plegadas: no pintan sus tarjetas pero siguen aceptando
|
|
1032
|
+
* arrastres. La app decide cuáles y pinta su propio aviso (p. ej. en
|
|
1033
|
+
* renderColumnFooter, «27 completed · Show»).
|
|
1034
|
+
*/
|
|
1035
|
+
collapsedColumnIds?: string[];
|
|
1030
1036
|
/** Enable keyboard shortcuts */
|
|
1031
1037
|
enableKeyboardShortcuts?: boolean;
|
|
1032
1038
|
/** Show card count in column headers */
|
package/dist/index.d.ts
CHANGED
|
@@ -1027,6 +1027,12 @@ interface BoardConfig {
|
|
|
1027
1027
|
columnWidth?: number;
|
|
1028
1028
|
/** Estimated card height for virtualization */
|
|
1029
1029
|
cardHeight?: number;
|
|
1030
|
+
/**
|
|
1031
|
+
* 1.9.37 · columnas plegadas: no pintan sus tarjetas pero siguen aceptando
|
|
1032
|
+
* arrastres. La app decide cuáles y pinta su propio aviso (p. ej. en
|
|
1033
|
+
* renderColumnFooter, «27 completed · Show»).
|
|
1034
|
+
*/
|
|
1035
|
+
collapsedColumnIds?: string[];
|
|
1030
1036
|
/** Enable keyboard shortcuts */
|
|
1031
1037
|
enableKeyboardShortcuts?: boolean;
|
|
1032
1038
|
/** Show card count in column headers */
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {createRoot}from'react-dom/client';import {dragStore,BaseViewAdapter,sele
|
|
|
15
15
|
.activity-comments-scroll:hover::-webkit-scrollbar-thumb {
|
|
16
16
|
background: ${L?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.15)"} !important;
|
|
17
17
|
}
|
|
18
|
-
`}),jsx("div",{ref:Gt,className:g("flex-1 overflow-y-auto py-4 pl-4 pr-2 activity-comments-scroll",L?"scrollbar-slim":"scrollbar-slim-light"),children:f.length>0?jsx("div",{className:"space-y-4",children:[...f].sort((D,W)=>{let pe=typeof D.createdAt=="string"?new Date(D.createdAt):D.createdAt,ve=typeof W.createdAt=="string"?new Date(W.createdAt):W.createdAt;return pe.getTime()-ve.getTime()}).map(D=>jsxs("div",{className:"flex gap-3",children:[jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:D.user?.color||"#8B5CF6"},children:D.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsx("span",{className:g("text-sm font-medium",L?"text-white":"text-gray-900"),children:D.user?.name||(o==="es"?"Usuario":"User")}),jsx("span",{className:g("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:Wa(D.createdAt)})]}),jsx("div",{className:g("text-sm",L?"text-[#9CA3AF]":"text-gray-600"),children:jsx(Np,{content:D.content,theme:s})}),D.attachments&&D.attachments.length>0&&jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:D.attachments.map(W=>{let pe=W.type.startsWith("image/");return jsxs("a",{href:W.url,target:"_blank",rel:"noopener noreferrer",className:g("flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[pe?jsx(Image,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}):jsx(File,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsx("span",{className:g("text-xs truncate max-w-[100px]",L?"text-white":"text-gray-900"),children:W.name})]},W.id)})})]})]},D.id))}):jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsx(MessageSquare,{className:g("w-10 h-10 mb-3",L?"text-[#3B4252]":"text-gray-300")}),jsx("p",{className:g("text-sm",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsx("div",{className:g("py-4 pl-4 pr-2 border-t",L?"border-white/10":"border-gray-200"),children:jsx(Tp,{value:ie,onChange:ce,onSubmit:Aa,users:b,placeholder:o==="es"?"Escribe un comentario... (usa @ para mencionar)":"Write a comment... (use @ to mention)",disabled:!v,isSubmitting:He,theme:s,locale:o,currentUser:h,enableEmoji:true,enableAttachments:!!y,pendingFiles:ft,onFilesSelect:et,onRemoveFile:Je})})]})]})]})})}function wc(){let[e,t]=useState(()=>dragStore.getState());useEffect(()=>dragStore.subscribe(n=>{t(n);}),[]);let a=useCallback(r=>{dragStore.setState(r);},[]);return [e,a]}function eo({board:e,callbacks:t,onCardClick:a,renderProps:r,config:n,availableUsers:s=[],className:o,style:l,isLoading:c,error:i,children:u,availableTags:p=[],onCreateTag:d,attachmentsByCard:m,onUploadAttachments:f,onDeleteAttachment:v,comments:h,onAddComment:b,currentUser:y,mentionableUsers:x,onTaskOpen:w,onUploadCommentAttachments:k,enableTimeTracking:M,timeTrackingSummary:I,timeEntries:C,timerState:N,onLogTime:P,onUpdateEstimate:T,onUpdateSoldEffort:V,onStartTimer:O,onStopTimer:J,onDiscardTimer:L,blurFinancials:Ie=false,sidePanel:G,renderColumnMetrics:ke,suppressDetailModal:R=false}){let[U,Pe]=wc(),[Ze,oe]=useState(null),[Fe,Q]=useState(false),Se=useRef(null),Ue=useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),Le=n?.theme||"dark",Be=Le==="dark"||Le==="neutral",ot=Be?"dark":"",se=useCallback((A,X)=>{t.onCardUpdate?.(A,X);},[t]),je=useCallback((A,X)=>{t.onColumnUpdate?.(A,{title:X});},[t]),Xe=useCallback(A=>{t.onColumnDelete?.(A);},[t]),$e=["todo","in-progress","completed"],mt=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),Et=useMemo(()=>{let A=new Map;return e.columns.forEach(X=>{let we=X.cardIds.map(B=>e.cards.find(q=>q.id===B)).filter(B=>B!==void 0).sort((B,q)=>B.position-q.position);A.set(X.id,we);}),A},[e.cards,e.columns]);useEffect(()=>{let A=Se.current;if(!A)return;let X=he=>{let Ae=he.target,ye=he.button===1,tt=Ae===A||Ae.classList.contains("asakaa-column")&&!Ae.closest(".asakaa-card");(ye||he.button===0&&tt&&!U.isDragging)&&(he.preventDefault(),Q(true),Ue.current={x:he.clientX,y:he.clientY,scrollLeft:A.scrollLeft,scrollTop:A.scrollTop},A.style.cursor="grabbing",A.style.userSelect="none");},we=he=>{if(!Fe)return;let Ae=he.clientX-Ue.current.x,ye=he.clientY-Ue.current.y;A.scrollLeft=Ue.current.scrollLeft-Ae,A.scrollTop=Ue.current.scrollTop-ye;},B=()=>{Fe&&(Q(false),A.style.cursor="",A.style.userSelect="");},q=()=>{Fe&&(Q(false),A.style.cursor="",A.style.userSelect="");};return A.addEventListener("mousedown",X),document.addEventListener("mousemove",we),document.addEventListener("mouseup",B),A.addEventListener("mouseleave",q),()=>{A.removeEventListener("mousedown",X),document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",B),A.removeEventListener("mouseleave",q);}},[Fe,U.isDragging]);let st=useMemo(()=>e.cards.map(A=>({id:A.id,name:A.title,startDate:A.startDate?new Date(A.startDate):void 0,endDate:A.endDate?new Date(A.endDate):void 0,progress:A.progress||0,status:A.columnId,priority:A.priority?.toLowerCase(),dependencies:Array.isArray(A.dependencies)?A.dependencies.map(X=>typeof X=="string"?X:X.taskId):[]})),[e.cards]),Ne=useCallback(A=>{let{active:X}=A,we=e.cards.find(B=>B.id===X.id);we&&Pe({isDragging:true,draggedCardId:we.id,sourceColumnId:we.columnId,targetColumnId:we.columnId});},[e.cards,Pe]),lt=useCallback(A=>{let{active:X,over:we}=A;if(!we||!e.cards.find(he=>he.id===X.id))return;let q=null;we.data.current?.type==="column"?q=we.id:we.data.current?.type==="card"&&(q=e.cards.find(Ae=>Ae.id===we.id)?.columnId||null),q&&q!==U.targetColumnId&&Pe({...U,targetColumnId:q});},[e.cards,U,Pe]),Mt=useCallback(async A=>{let{active:X,over:we}=A;if(Pe({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!we)return;let B=e.cards.find(ye=>ye.id===X.id);if(!B)return;let q,he;if(we.data.current?.type==="column"){q=we.id;let ye=Et.get(q)||[];he=rc(ye,0);}else {let ye=e.cards.find(ce=>ce.id===we.id);if(!ye)return;q=ye.columnId;let tt=Et.get(q)||[],ie=tt.findIndex(ce=>ce.id===we.id);he=rc(tt,ie);}let Ae=e.columns.find(ye=>ye.id===q);if(Ae&&Ae.wipLimit&&Ae.wipLimitType==="hard"){let ye=Et.get(q)||[];if(B.columnId!==q&&ye.length>=Ae.wipLimit){t.onWipLimitExceeded?.(Ae,B);return}}(B.columnId!==q||B.position!==he)&&await t.onCardMove?.(B.id,q,he);},[e.cards,e.columns,Et,t,Pe]),Oe=useCallback(A=>{R||oe(A),a?.(A),w?.(A.id);},[a,w,R]),xt=useCallback(A=>{t.onCardUpdate?.(A.id,A),oe(A);},[t]);return c?jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsx(Py,{columnCount:3})}):i?jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxs("div",{className:"text-center",children:[jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof i=="string"?i:i.message})]})})}):jsxs(Zu,{themeName:Le,children:[jsxs("div",{className:g("flex h-full overflow-hidden",G?"flex-row":""),children:[jsxs(DndContext,{sensors:mt,collisionDetection:closestCorners,onDragStart:Ne,onDragOver:lt,onDragEnd:Mt,children:[jsxs("div",{ref:Se,className:g("asakaa-board",G?"flex-1":"",ot,o),style:{...l,cursor:Fe?"grabbing":void 0},"data-theme":Le,children:[e.columns.sort((A,X)=>A.position-X.position).map(A=>{let X=Et.get(A.id)||[],we=!$e.includes(A.id),B=r?.renderColumnFooter?.(A);return jsxs("div",{className:"asakaa-column-wrapper",children:[jsx(Qo,{column:A,cards:X,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,renderMetrics:ke?(q,he)=>ke(q,he):void 0,onCardClick:Oe,onCardUpdate:se,onColumnRename:t.onColumnUpdate?je:void 0,onColumnDelete:t.onColumnDelete?Xe:void 0,isDeletable:we,locale:n?.locale==="es"?"es":"en",availableUsers:s,allCards:e.cards,enableVirtualization:n?.enableVirtualization,cardHeight:n?.cardHeight}),B]},A.id)}),u]}),jsx(DragOverlay,{children:U.draggedCardId?jsx(In,{card:e.cards.find(A=>A.id===U.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),G]}),!R&&jsx(Eo,{task:Ze,isOpen:!!Ze,onClose:()=>oe(null),onCardUpdate:xt,theme:Be?"dark":"light",locale:n?.locale==="es"?"es":"en",availableUsers:s,availableTags:p,onCreateTag:d,attachments:Ze?m?.get(Ze.id)||[]:[],onUploadAttachments:f,onDeleteAttachment:v,availableTasks:st,comments:h,onAddComment:b,currentUser:y,mentionableUsers:x,onUploadCommentAttachments:k,enableTimeTracking:M,timeTrackingSummary:I,timeEntries:C,isTimerRunning:N?.isRunning,timerElapsedSeconds:N?.elapsedSeconds,onTimeLog:P,onEstimateUpdate:T,onSoldEffortUpdate:V,onTimerStart:O,onTimerStop:J,onTimerDiscard:L,blurFinancials:Ie})]})}function Py({columnCount:e}){return jsx(Fragment,{children:Array.from({length:e}).map((t,a)=>jsxs("div",{className:"asakaa-column",children:[jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxs("div",{className:"flex flex-col gap-2",children:[jsx("div",{className:"asakaa-skeleton h-24"}),jsx("div",{className:"asakaa-skeleton h-32"}),jsx("div",{className:"asakaa-skeleton h-28"})]})]},a))})}var Ry={bgGrid:"#050505",bgSecondary:"#0A0A0A",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#007FFF",accentLight:"rgba(0, 229, 204, 0.15)",hoverBg:"rgba(255, 255, 255, 0.04)"},By={bgGrid:"#FFFFFF",bgSecondary:"#F9FAFB",border:"rgba(0, 0, 0, 0.1)",borderLight:"rgba(0, 0, 0, 0.05)",textPrimary:"#111827",textSecondary:"#6B7280",textTertiary:"#9CA3AF",accent:"#00E5CC",accentLight:"rgba(0, 229, 204, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},$y={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},Oy={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Hy({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:n}){let[s,o]=useState(false),l=useRef(null);useEffect(()=>{let i=u=>{l.current&&!l.current.contains(u.target)&&o(false);};return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);let c=i=>{t(i),o(false);};return jsxs("div",{ref:l,className:"relative",children:[jsxs(motion.button,{onClick:()=>o(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:n||r.newTask}),jsx(ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsx(AnimatePresence,{children:s&&jsx(motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxs("div",{className:"py-1",children:[jsx("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wider",style:{color:a.textTertiary},children:r.selectColumn}),e.sort((i,u)=>i.position-u.position).map((i,u)=>jsxs(motion.button,{onClick:()=>c(i.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:u<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:u*.03},children:[jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color||a.accent}}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:i.title}),jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[i.cardIds.length," ",i.cardIds.length===1?"tarea":"tareas"]})]})]},i.id))]})})})]})}function Uy({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:n}){let[s,o]=useState(false),[l,c]=useState(null),i=useRef(null);if(useEffect(()=>{let m=f=>{i.current&&!i.current.contains(f.target)&&o(false);};return s&&document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),!(a||r||n))return null;let p=[{id:"csv",label:t.exportCSV,description:"Comma-separated",icon:jsx(FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsx(FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsx(FileSpreadsheet,{className:"w-4 h-4"}),handler:n}].filter(m=>m.handler),d=async(m,f)=>{if(f){c(m);try{await f();}catch(v){console.error(`Export ${m} failed:`,v);}finally{c(null),o(false);}}};return jsxs("div",{ref:i,className:"relative",children:[jsxs(motion.button,{onClick:()=>o(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:s?e.accent:e.bgSecondary,border:`1px solid ${s?e.accent:e.borderLight}`,color:s?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsx(Download,{className:"w-3.5 h-3.5"}),jsx("span",{children:t.export}),jsx(ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsx(AnimatePresence,{children:s&&jsx(motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-44 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsx("div",{className:"py-1",children:p.map((m,f)=>jsxs(motion.button,{onClick:()=>d(m.id,m.handler),disabled:l!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:f<p.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:f*.03},children:[jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:l===m.id?jsx(motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsx(Download,{className:"w-4 h-4"})}):m.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:m.label}),jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:m.description})]})]},m.id))})})})]})}function Wy({onClick:e,label:t}){return jsxs(motion.button,{onClick:e,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:t})]})}function Cc({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:n="es",useColumnSelector:s=false,onExportCSV:o,onExportJSON:l,onExportExcel:c,translations:i,toolbarRightContent:u,toolbarEndContent:p}){let d=r==="dark"?Ry:By,m={...n==="es"?$y:Oy,...i},f=o||l||c;return jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:d.bgGrid,borderColor:d.border},children:jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxs(Fragment,{children:[u,jsx("div",{className:"w-px h-5",style:{backgroundColor:d.borderLight}})]}),f&&jsxs(Fragment,{children:[jsx(Uy,{theme:d,t:m,onExportCSV:o,onExportJSON:l,onExportExcel:c}),t&&jsx("div",{className:"w-px h-6",style:{backgroundColor:d.borderLight}})]}),p,t&&(s?jsx(Hy,{columns:e,onSelect:t,theme:d,t:m,createTaskLabel:a}):jsx(Wy,{onClick:()=>t(),label:a||m.newTask}))]})})}function Nc({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:n=false}){let[s,o]=useState(false),[l,c]=useState(""),i=useCallback(()=>{let d=l.trim();d&&(e(d),c(""),o(false));},[l,e]),u=useCallback(d=>{d.key==="Enter"?(d.preventDefault(),i()):d.key==="Escape"&&(c(""),o(false));},[i]),p=useCallback(()=>{setTimeout(()=>{l.trim()||o(false);},150);},[l]);return s?jsx("div",{className:g("asakaa-add-column asakaa-add-column--editing",t),children:jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsx("input",{type:"text",value:l,onChange:d=>c(d.target.value),onKeyDown:u,onBlur:p,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxs("div",{className:"asakaa-add-column__actions",children:[jsx("button",{onClick:i,disabled:!l.trim(),className:"asakaa-add-column__submit",type:"button",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsx("button",{onClick:()=>{c(""),o(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsx("div",{className:g("asakaa-add-column",t),children:jsxs("button",{onClick:()=>o(true),disabled:n,className:"asakaa-add-column__button",type:"button",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r]})})}function Us({onSubmit:e,onCancel:t,availableUsers:a=[],isDark:r=true,locale:n="es",defaultDate:s,className:o,dropdownDirection:l="up"}){let[c,i]=useState(""),[u,p]=useState(void 0),[d,m]=useState(null),[f,v]=useState(null),[h,b]=useState(false),[y,x]=useState(false),[w,k]=useState(false),[M,I]=useState(s||new Date),C=useRef(null),N=n==="es",P=l==="up"?"bottom-full mb-1":"top-full mt-1";useEffect(()=>{C.current?.focus();},[]);let T=useCallback(()=>{b(false),x(false),k(false);},[]),V=useCallback(()=>{i(""),p(void 0),m(null),v(null),T(),t();},[t,T]),O=f||s||new Date,J=useCallback(()=>{let G=c.trim();if(!G)return;let ke=a.find(U=>U.id===d),R=O;e({name:G,priority:u,assignee:ke||void 0,assigneeId:d,startDate:R,endDate:R}),i(""),p(void 0),m(null),v(null),T(),C.current?.focus();},[c,u,d,O,a,e,T]),L=useCallback(G=>{G.key==="Enter"&&c.trim()&&(G.preventDefault(),J()),G.key==="Escape"&&V();},[J,V,c]),Ie=O;return jsxs("div",{className:g("quick-task-create",o),onClick:()=>T(),children:[jsx("div",{className:"p-2.5",children:jsx("input",{ref:C,type:"text",value:c,onChange:G=>i(G.target.value),placeholder:N?"Nombre de la tarea...":"Task name...",className:g("w-full bg-transparent text-sm outline-none font-mono",r?"text-white/90 placeholder:text-white/20":"text-gray-900 placeholder:text-gray-400"),autoFocus:true,onKeyDown:L})}),jsxs("div",{className:g("px-2.5 py-2 flex items-center justify-between border-t",r?"border-white/[0.08]":"border-gray-100"),children:[jsxs("div",{className:"flex items-center gap-1",children:[jsxs("div",{className:"relative",children:[jsx("button",{onClick:G=>{G.stopPropagation(),b(!h),x(false),k(false);},type:"button",className:g("p-1 rounded transition-colors",u?u==="urgent"||u==="high"?"text-red-400 bg-red-500/20":u==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:jsx(Flag,{className:"w-3.5 h-3.5"})}),jsx(AnimatePresence,{children:h&&jsx(motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:g("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",P,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:G=>G.stopPropagation(),children:[{id:"urgent",label:N?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:N?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:N?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:N?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:N?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(G=>jsxs("button",{onClick:()=>{p(G.id),b(false);},type:"button",className:g("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",u===G.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsx("span",{className:g("w-2 h-2 rounded-full",G.color)}),jsx("span",{className:r?"text-white":"text-gray-900",children:G.label})]},G.id||"none"))})})]}),jsxs("div",{className:"relative",children:[jsxs("button",{onClick:G=>{G.stopPropagation(),k(!w),b(false),x(false),I(f||s||new Date);},type:"button",className:g("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors font-mono",f?r?"bg-[#007FFF]/20 text-[#007FFF]":"bg-[#00E5CC]/20 text-[#00C4AE]":r?"bg-white/5 text-white/30 hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsx(CalendarDays,{className:"w-3 h-3"}),Ie.toLocaleDateString(N?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsx(AnimatePresence,{children:w&&jsxs(motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:g("absolute left-0 z-[60] rounded-xl shadow-2xl overflow-hidden flex",P,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:G=>G.stopPropagation(),children:[jsx("div",{className:g("w-40 py-2 border-r",r?"border-white/10":"border-gray-200"),children:(()=>{let G=new Date,ke=new Date(G);ke.setDate(G.getDate()+1);let R=new Date(G);R.setDate(G.getDate()+((6-G.getDay()+7)%7||7));let U=new Date(G);U.setDate(G.getDate()+((1-G.getDay()+7)%7||7));let Pe=new Date(G);Pe.setDate(G.getDate()+14);let Ze=new Date(G);Ze.setDate(G.getDate()+28);let oe=N?"es-ES":"en-US";return [{label:N?"Hoy":"Today",date:G,display:G.toLocaleDateString(oe,{weekday:"short"}).slice(0,3)+"."},{label:N?"Ma\xF1ana":"Tomorrow",date:ke,display:ke.toLocaleDateString(oe,{weekday:"short"}).slice(0,3)+"."},{label:N?"Este fin de semana":"This weekend",date:R,display:N?"s\xE1b.":"sat."},{label:N?"Pr\xF3xima semana":"Next week",date:U,display:N?"lun.":"mon."},{label:N?"2 semanas":"2 weeks",date:Pe,display:Pe.toLocaleDateString(oe,{day:"numeric",month:"short"})},{label:N?"4 semanas":"4 weeks",date:Ze,display:Ze.toLocaleDateString(oe,{day:"numeric",month:"short"})}].map((Q,Se)=>jsxs("button",{type:"button",className:g("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",r?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{v(Q.date),k(false);},children:[jsx("span",{children:Q.label}),jsx("span",{className:g("text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:Q.display})]},Se))})()}),jsxs("div",{className:"p-3",children:[jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsx("span",{className:g("text-xs font-medium font-mono",r?"text-white":"text-gray-900"),children:M.toLocaleDateString(N?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxs("div",{className:"flex items-center gap-0.5",children:[jsx("button",{type:"button",onClick:()=>I(new Date),className:g("px-1.5 py-0.5 rounded text-[10px] transition-colors font-mono",r?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:N?"Hoy":"Today"}),jsx("button",{type:"button",onClick:()=>I(new Date(M.getFullYear(),M.getMonth()-1)),className:g("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsx(ChevronLeft,{className:"w-3.5 h-3.5"})}),jsx("button",{type:"button",onClick:()=>I(new Date(M.getFullYear(),M.getMonth()+1)),className:g("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsx(ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(N?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(G=>jsx("div",{className:g("w-6 h-6 flex items-center justify-center text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:G},G))}),jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let G=M.getFullYear(),ke=M.getMonth(),R=new Date(G,ke,1).getDay(),U=new Date(G,ke+1,0).getDate(),Pe=new Date(G,ke,0).getDate(),Ze=new Date().toDateString(),oe=[];for(let Q=R-1;Q>=0;Q--)oe.push({dayNum:Pe-Q,isCurrent:false,date:new Date(G,ke-1,Pe-Q)});for(let Q=1;Q<=U;Q++)oe.push({dayNum:Q,isCurrent:true,date:new Date(G,ke,Q)});let Fe=42-oe.length;for(let Q=1;Q<=Fe;Q++)oe.push({dayNum:Q,isCurrent:false,date:new Date(G,ke+1,Q)});return oe.map((Q,Se)=>{let Ue=Q.date.toDateString()===Ze,Le=(f||s)?.toDateString()===Q.date.toDateString();return jsx("button",{type:"button",className:g("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors font-mono",!Q.isCurrent&&(r?"text-white/20":"text-gray-300"),Q.isCurrent&&(r?"text-white":"text-gray-900"),Ue&&"ring-1 ring-[#007FFF]",Le&&"bg-[#007FFF] text-white",!Le&&(r?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{v(Q.date),k(false);},children:Q.dayNum},Se)})})()})]})]})})]}),jsxs("div",{className:"relative",children:[jsx("button",{onClick:G=>{G.stopPropagation(),x(!y),b(false),k(false);},type:"button",className:g("p-1 rounded transition-colors",d?"text-[#007FFF] bg-[#007FFF]/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:d?jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-mono font-bold",style:{backgroundColor:a.find(G=>G.id===d)?.color||"#007FFF"},children:a.find(G=>G.id===d)?.initials||a.find(G=>G.id===d)?.name?.slice(0,2).toUpperCase()}):jsx(User,{className:"w-3.5 h-3.5"})}),jsx(AnimatePresence,{children:y&&jsxs(motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:g("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",P,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:G=>G.stopPropagation(),children:[jsxs("button",{type:"button",onClick:()=>{m(null),x(false);},className:g("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",!d&&(r?"bg-white/5":"bg-gray-50")),children:[jsx("div",{className:g("w-5 h-5 rounded-full flex items-center justify-center",r?"bg-white/10":"bg-gray-200"),children:jsx(User,{className:"w-3 h-3 text-gray-400"})}),jsx("span",{className:r?"text-white/40":"text-gray-500",children:N?"Sin asignar":"Unassigned"})]}),a.map(G=>jsxs("button",{type:"button",onClick:()=>{m(G.id),x(false);},className:g("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",d===G.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-mono font-bold",style:{backgroundColor:G.color||"#007FFF"},children:G.initials||G.name?.slice(0,2).toUpperCase()}),jsx("span",{className:r?"text-white":"text-gray-900",children:G.name})]},G.id)),a.length===0&&jsx("div",{className:g("px-3 py-2 text-xs font-mono",r?"text-white/30":"text-gray-400"),children:N?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsx("button",{onClick:J,disabled:!c.trim(),type:"button",className:g("px-2.5 py-1 rounded text-xs font-mono font-medium transition-colors",c.trim()?"bg-[#007FFF] hover:bg-[#0066CC] text-white":r?"bg-white/5 text-white/20":"bg-gray-100 text-gray-400"),children:N?"Guardar":"Save"})]})]})}function Pc({columnId:e,onAddCard:t,availableUsers:a=[],className:r,buttonLabel:n,disabled:s=false,theme:o="dark",locale:l="es"}){let[c,i]=useState(false),u=useRef(null),p=useRef(null),[d,m]=useState({}),[f,v]=useState(false),h=o==="dark",y={buttonLabel:n||(l==="es"?"Agregar Tarea":"Add Task")};useEffect(()=>{if(!c||!u.current)return;let w=90,k=()=>{let M=u.current.getBoundingClientRect(),C=window.innerHeight-M.bottom<w+8;v(C),m({position:"fixed",...C?{bottom:window.innerHeight-M.top+4}:{top:M.bottom+4},left:M.left,width:M.width,zIndex:9999});};return k(),window.addEventListener("scroll",k,true),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,true),window.removeEventListener("resize",k);}},[c]),useEffect(()=>{if(!c)return;let w=k=>{let M=k.target;p.current&&!p.current.contains(M)&&u.current&&!u.current.contains(M)&&i(false);};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);let x=useCallback(w=>{t({name:w.name,columnId:e,assigneeIds:w.assigneeId?[w.assigneeId]:void 0,startDate:w.startDate,endDate:w.endDate,priority:w.priority});},[t,e]);return jsxs("div",{ref:u,className:g("asakaa-add-card",r),children:[jsxs("button",{onClick:()=>i(!c),disabled:s,className:"asakaa-add-card__button",type:"button",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),y.buttonLabel]}),createPortal(jsx(AnimatePresence,{children:c&&jsx(motion.div,{ref:p,initial:{opacity:0,y:f?4:-4,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:f?4:-4,scale:.97},transition:{duration:.12},style:d,className:g("rounded-lg shadow-2xl",h?"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(Us,{onSubmit:x,onCancel:()=>i(false),availableUsers:a,isDark:h,locale:l,dropdownDirection:"up"})})}),document.body)]})}var zs=class extends BaseViewAdapter{constructor(a={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=a,this.options={animations:a.viewOptions?.animations??true,virtualScrolling:a.viewOptions?.virtualScrolling??false,theme:a.viewOptions?.theme??"dark",readonly:a.viewOptions?.readonly??false};}mount(a,r){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=a,this.data=r,this.root=createRoot(a),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(a){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=a,this.render(),this.emit("view:updated",{viewId:this.id,data:a});}configure(a){this.options={...this.options,...a},this.isMounted()&&this.render();}async export(a){if(!this.data)throw new Error("No data to export");switch(a){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${a}`)}}render(){if(!this.root||!this.data)return;let a={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsx(eo,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let n=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,n?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(n=>`"${n}"`).join(",")).join(`
|
|
18
|
+
`}),jsx("div",{ref:Gt,className:g("flex-1 overflow-y-auto py-4 pl-4 pr-2 activity-comments-scroll",L?"scrollbar-slim":"scrollbar-slim-light"),children:f.length>0?jsx("div",{className:"space-y-4",children:[...f].sort((D,W)=>{let pe=typeof D.createdAt=="string"?new Date(D.createdAt):D.createdAt,ve=typeof W.createdAt=="string"?new Date(W.createdAt):W.createdAt;return pe.getTime()-ve.getTime()}).map(D=>jsxs("div",{className:"flex gap-3",children:[jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:D.user?.color||"#8B5CF6"},children:D.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsx("span",{className:g("text-sm font-medium",L?"text-white":"text-gray-900"),children:D.user?.name||(o==="es"?"Usuario":"User")}),jsx("span",{className:g("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:Wa(D.createdAt)})]}),jsx("div",{className:g("text-sm",L?"text-[#9CA3AF]":"text-gray-600"),children:jsx(Np,{content:D.content,theme:s})}),D.attachments&&D.attachments.length>0&&jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:D.attachments.map(W=>{let pe=W.type.startsWith("image/");return jsxs("a",{href:W.url,target:"_blank",rel:"noopener noreferrer",className:g("flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors",L?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[pe?jsx(Image,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}):jsx(File,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsx("span",{className:g("text-xs truncate max-w-[100px]",L?"text-white":"text-gray-900"),children:W.name})]},W.id)})})]})]},D.id))}):jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsx(MessageSquare,{className:g("w-10 h-10 mb-3",L?"text-[#3B4252]":"text-gray-300")}),jsx("p",{className:g("text-sm",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsx("div",{className:g("py-4 pl-4 pr-2 border-t",L?"border-white/10":"border-gray-200"),children:jsx(Tp,{value:ie,onChange:ce,onSubmit:Aa,users:b,placeholder:o==="es"?"Escribe un comentario... (usa @ para mencionar)":"Write a comment... (use @ to mention)",disabled:!v,isSubmitting:He,theme:s,locale:o,currentUser:h,enableEmoji:true,enableAttachments:!!y,pendingFiles:ft,onFilesSelect:et,onRemoveFile:Je})})]})]})]})})}function wc(){let[e,t]=useState(()=>dragStore.getState());useEffect(()=>dragStore.subscribe(n=>{t(n);}),[]);let a=useCallback(r=>{dragStore.setState(r);},[]);return [e,a]}function eo({board:e,callbacks:t,onCardClick:a,renderProps:r,config:n,availableUsers:s=[],className:o,style:l,isLoading:c,error:i,children:u,availableTags:p=[],onCreateTag:d,attachmentsByCard:m,onUploadAttachments:f,onDeleteAttachment:v,comments:h,onAddComment:b,currentUser:y,mentionableUsers:x,onTaskOpen:w,onUploadCommentAttachments:k,enableTimeTracking:M,timeTrackingSummary:I,timeEntries:C,timerState:N,onLogTime:P,onUpdateEstimate:T,onUpdateSoldEffort:V,onStartTimer:O,onStopTimer:J,onDiscardTimer:L,blurFinancials:Ie=false,sidePanel:G,renderColumnMetrics:ke,suppressDetailModal:R=false}){let[U,Pe]=wc(),[Ze,oe]=useState(null),[Fe,Q]=useState(false),Se=useRef(null),Ue=useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),Le=n?.theme||"dark",Be=Le==="dark"||Le==="neutral",ot=Be?"dark":"",se=useCallback((A,X)=>{t.onCardUpdate?.(A,X);},[t]),je=useCallback((A,X)=>{t.onColumnUpdate?.(A,{title:X});},[t]),Xe=useCallback(A=>{t.onColumnDelete?.(A);},[t]),$e=["todo","in-progress","completed"],mt=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}}),useSensor(KeyboardSensor,{coordinateGetter:sortableKeyboardCoordinates})),Et=useMemo(()=>{let A=new Map;return e.columns.forEach(X=>{let we=X.cardIds.map(B=>e.cards.find(q=>q.id===B)).filter(B=>B!==void 0).sort((B,q)=>B.position-q.position);A.set(X.id,we);}),A},[e.cards,e.columns]);useEffect(()=>{let A=Se.current;if(!A)return;let X=he=>{let Ae=he.target,ye=he.button===1,tt=Ae===A||Ae.classList.contains("asakaa-column")&&!Ae.closest(".asakaa-card");(ye||he.button===0&&tt&&!U.isDragging)&&(he.preventDefault(),Q(true),Ue.current={x:he.clientX,y:he.clientY,scrollLeft:A.scrollLeft,scrollTop:A.scrollTop},A.style.cursor="grabbing",A.style.userSelect="none");},we=he=>{if(!Fe)return;let Ae=he.clientX-Ue.current.x,ye=he.clientY-Ue.current.y;A.scrollLeft=Ue.current.scrollLeft-Ae,A.scrollTop=Ue.current.scrollTop-ye;},B=()=>{Fe&&(Q(false),A.style.cursor="",A.style.userSelect="");},q=()=>{Fe&&(Q(false),A.style.cursor="",A.style.userSelect="");};return A.addEventListener("mousedown",X),document.addEventListener("mousemove",we),document.addEventListener("mouseup",B),A.addEventListener("mouseleave",q),()=>{A.removeEventListener("mousedown",X),document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",B),A.removeEventListener("mouseleave",q);}},[Fe,U.isDragging]);let st=useMemo(()=>e.cards.map(A=>({id:A.id,name:A.title,startDate:A.startDate?new Date(A.startDate):void 0,endDate:A.endDate?new Date(A.endDate):void 0,progress:A.progress||0,status:A.columnId,priority:A.priority?.toLowerCase(),dependencies:Array.isArray(A.dependencies)?A.dependencies.map(X=>typeof X=="string"?X:X.taskId):[]})),[e.cards]),Ne=useCallback(A=>{let{active:X}=A,we=e.cards.find(B=>B.id===X.id);we&&Pe({isDragging:true,draggedCardId:we.id,sourceColumnId:we.columnId,targetColumnId:we.columnId});},[e.cards,Pe]),lt=useCallback(A=>{let{active:X,over:we}=A;if(!we||!e.cards.find(he=>he.id===X.id))return;let q=null;we.data.current?.type==="column"?q=we.id:we.data.current?.type==="card"&&(q=e.cards.find(Ae=>Ae.id===we.id)?.columnId||null),q&&q!==U.targetColumnId&&Pe({...U,targetColumnId:q});},[e.cards,U,Pe]),Mt=useCallback(async A=>{let{active:X,over:we}=A;if(Pe({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!we)return;let B=e.cards.find(ye=>ye.id===X.id);if(!B)return;let q,he;if(we.data.current?.type==="column"){q=we.id;let ye=Et.get(q)||[];he=rc(ye,0);}else {let ye=e.cards.find(ce=>ce.id===we.id);if(!ye)return;q=ye.columnId;let tt=Et.get(q)||[],ie=tt.findIndex(ce=>ce.id===we.id);he=rc(tt,ie);}let Ae=e.columns.find(ye=>ye.id===q);if(Ae&&Ae.wipLimit&&Ae.wipLimitType==="hard"){let ye=Et.get(q)||[];if(B.columnId!==q&&ye.length>=Ae.wipLimit){t.onWipLimitExceeded?.(Ae,B);return}}(B.columnId!==q||B.position!==he)&&await t.onCardMove?.(B.id,q,he);},[e.cards,e.columns,Et,t,Pe]),Oe=useCallback(A=>{R||oe(A),a?.(A),w?.(A.id);},[a,w,R]),xt=useCallback(A=>{t.onCardUpdate?.(A.id,A),oe(A);},[t]);return c?jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsx(Py,{columnCount:3})}):i?jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxs("div",{className:"text-center",children:[jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof i=="string"?i:i.message})]})})}):jsxs(Zu,{themeName:Le,children:[jsxs("div",{className:g("flex h-full overflow-hidden",G?"flex-row":""),children:[jsxs(DndContext,{sensors:mt,collisionDetection:closestCorners,onDragStart:Ne,onDragOver:lt,onDragEnd:Mt,children:[jsxs("div",{ref:Se,className:g("asakaa-board",G?"flex-1":"",ot,o),style:{...l,cursor:Fe?"grabbing":void 0},"data-theme":Le,children:[e.columns.sort((A,X)=>A.position-X.position).map(A=>{let X=Et.get(A.id)||[],we=!$e.includes(A.id),B=r?.renderColumnFooter?.(A);return jsxs("div",{className:"asakaa-column-wrapper",children:[jsx(Qo,{column:A,cards:X,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,renderMetrics:ke?(q,he)=>ke(q,he):void 0,onCardClick:Oe,onCardUpdate:se,onColumnRename:t.onColumnUpdate?je:void 0,onColumnDelete:t.onColumnDelete?Xe:void 0,isDeletable:we,locale:n?.locale==="es"?"es":"en",availableUsers:s,allCards:e.cards,enableVirtualization:n?.enableVirtualization,cardHeight:n?.cardHeight,isCollapsed:n?.collapsedColumnIds?.includes(A.id)}),B]},A.id)}),u]}),jsx(DragOverlay,{children:U.draggedCardId?jsx(In,{card:e.cards.find(A=>A.id===U.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),G]}),!R&&jsx(Eo,{task:Ze,isOpen:!!Ze,onClose:()=>oe(null),onCardUpdate:xt,theme:Be?"dark":"light",locale:n?.locale==="es"?"es":"en",availableUsers:s,availableTags:p,onCreateTag:d,attachments:Ze?m?.get(Ze.id)||[]:[],onUploadAttachments:f,onDeleteAttachment:v,availableTasks:st,comments:h,onAddComment:b,currentUser:y,mentionableUsers:x,onUploadCommentAttachments:k,enableTimeTracking:M,timeTrackingSummary:I,timeEntries:C,isTimerRunning:N?.isRunning,timerElapsedSeconds:N?.elapsedSeconds,onTimeLog:P,onEstimateUpdate:T,onSoldEffortUpdate:V,onTimerStart:O,onTimerStop:J,onTimerDiscard:L,blurFinancials:Ie})]})}function Py({columnCount:e}){return jsx(Fragment,{children:Array.from({length:e}).map((t,a)=>jsxs("div",{className:"asakaa-column",children:[jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxs("div",{className:"flex flex-col gap-2",children:[jsx("div",{className:"asakaa-skeleton h-24"}),jsx("div",{className:"asakaa-skeleton h-32"}),jsx("div",{className:"asakaa-skeleton h-28"})]})]},a))})}var Ry={bgGrid:"#050505",bgSecondary:"#0A0A0A",border:"rgba(255, 255, 255, 0.08)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"rgba(255, 255, 255, 0.92)",textSecondary:"rgba(255, 255, 255, 0.60)",textTertiary:"rgba(255, 255, 255, 0.35)",accent:"#007FFF",accentLight:"rgba(0, 229, 204, 0.15)",hoverBg:"rgba(255, 255, 255, 0.04)"},By={bgGrid:"#FFFFFF",bgSecondary:"#F9FAFB",border:"rgba(0, 0, 0, 0.1)",borderLight:"rgba(0, 0, 0, 0.05)",textPrimary:"#111827",textSecondary:"#6B7280",textTertiary:"#9CA3AF",accent:"#00E5CC",accentLight:"rgba(0, 229, 204, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},$y={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},Oy={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Hy({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:n}){let[s,o]=useState(false),l=useRef(null);useEffect(()=>{let i=u=>{l.current&&!l.current.contains(u.target)&&o(false);};return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);let c=i=>{t(i),o(false);};return jsxs("div",{ref:l,className:"relative",children:[jsxs(motion.button,{onClick:()=>o(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:n||r.newTask}),jsx(ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsx(AnimatePresence,{children:s&&jsx(motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxs("div",{className:"py-1",children:[jsx("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wider",style:{color:a.textTertiary},children:r.selectColumn}),e.sort((i,u)=>i.position-u.position).map((i,u)=>jsxs(motion.button,{onClick:()=>c(i.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:u<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:u*.03},children:[jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color||a.accent}}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:i.title}),jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[i.cardIds.length," ",i.cardIds.length===1?"tarea":"tareas"]})]})]},i.id))]})})})]})}function Uy({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:n}){let[s,o]=useState(false),[l,c]=useState(null),i=useRef(null);if(useEffect(()=>{let m=f=>{i.current&&!i.current.contains(f.target)&&o(false);};return s&&document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[s]),!(a||r||n))return null;let p=[{id:"csv",label:t.exportCSV,description:"Comma-separated",icon:jsx(FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsx(FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsx(FileSpreadsheet,{className:"w-4 h-4"}),handler:n}].filter(m=>m.handler),d=async(m,f)=>{if(f){c(m);try{await f();}catch(v){console.error(`Export ${m} failed:`,v);}finally{c(null),o(false);}}};return jsxs("div",{ref:i,className:"relative",children:[jsxs(motion.button,{onClick:()=>o(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:s?e.accent:e.bgSecondary,border:`1px solid ${s?e.accent:e.borderLight}`,color:s?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsx(Download,{className:"w-3.5 h-3.5"}),jsx("span",{children:t.export}),jsx(ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsx(AnimatePresence,{children:s&&jsx(motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-44 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsx("div",{className:"py-1",children:p.map((m,f)=>jsxs(motion.button,{onClick:()=>d(m.id,m.handler),disabled:l!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:f<p.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:f*.03},children:[jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:l===m.id?jsx(motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsx(Download,{className:"w-4 h-4"})}):m.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:m.label}),jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:m.description})]})]},m.id))})})})]})}function Wy({onClick:e,label:t}){return jsxs(motion.button,{onClick:e,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #007FFF 0%, #0055CC 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(0, 229, 204, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(0, 229, 204, 0.4)"},whileTap:{scale:.98},children:[jsx(Plus,{className:"w-3.5 h-3.5"}),jsx("span",{children:t})]})}function Cc({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:n="es",useColumnSelector:s=false,onExportCSV:o,onExportJSON:l,onExportExcel:c,translations:i,toolbarRightContent:u,toolbarEndContent:p}){let d=r==="dark"?Ry:By,m={...n==="es"?$y:Oy,...i},f=o||l||c;return jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:d.bgGrid,borderColor:d.border},children:jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxs(Fragment,{children:[u,jsx("div",{className:"w-px h-5",style:{backgroundColor:d.borderLight}})]}),f&&jsxs(Fragment,{children:[jsx(Uy,{theme:d,t:m,onExportCSV:o,onExportJSON:l,onExportExcel:c}),t&&jsx("div",{className:"w-px h-6",style:{backgroundColor:d.borderLight}})]}),p,t&&(s?jsx(Hy,{columns:e,onSelect:t,theme:d,t:m,createTaskLabel:a}):jsx(Wy,{onClick:()=>t(),label:a||m.newTask}))]})})}function Nc({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:n=false}){let[s,o]=useState(false),[l,c]=useState(""),i=useCallback(()=>{let d=l.trim();d&&(e(d),c(""),o(false));},[l,e]),u=useCallback(d=>{d.key==="Enter"?(d.preventDefault(),i()):d.key==="Escape"&&(c(""),o(false));},[i]),p=useCallback(()=>{setTimeout(()=>{l.trim()||o(false);},150);},[l]);return s?jsx("div",{className:g("asakaa-add-column asakaa-add-column--editing",t),children:jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsx("input",{type:"text",value:l,onChange:d=>c(d.target.value),onKeyDown:u,onBlur:p,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxs("div",{className:"asakaa-add-column__actions",children:[jsx("button",{onClick:i,disabled:!l.trim(),className:"asakaa-add-column__submit",type:"button",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsx("button",{onClick:()=>{c(""),o(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsx("div",{className:g("asakaa-add-column",t),children:jsxs("button",{onClick:()=>o(true),disabled:n,className:"asakaa-add-column__button",type:"button",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r]})})}function Us({onSubmit:e,onCancel:t,availableUsers:a=[],isDark:r=true,locale:n="es",defaultDate:s,className:o,dropdownDirection:l="up"}){let[c,i]=useState(""),[u,p]=useState(void 0),[d,m]=useState(null),[f,v]=useState(null),[h,b]=useState(false),[y,x]=useState(false),[w,k]=useState(false),[M,I]=useState(s||new Date),C=useRef(null),N=n==="es",P=l==="up"?"bottom-full mb-1":"top-full mt-1";useEffect(()=>{C.current?.focus();},[]);let T=useCallback(()=>{b(false),x(false),k(false);},[]),V=useCallback(()=>{i(""),p(void 0),m(null),v(null),T(),t();},[t,T]),O=f||s||new Date,J=useCallback(()=>{let G=c.trim();if(!G)return;let ke=a.find(U=>U.id===d),R=O;e({name:G,priority:u,assignee:ke||void 0,assigneeId:d,startDate:R,endDate:R}),i(""),p(void 0),m(null),v(null),T(),C.current?.focus();},[c,u,d,O,a,e,T]),L=useCallback(G=>{G.key==="Enter"&&c.trim()&&(G.preventDefault(),J()),G.key==="Escape"&&V();},[J,V,c]),Ie=O;return jsxs("div",{className:g("quick-task-create",o),onClick:()=>T(),children:[jsx("div",{className:"p-2.5",children:jsx("input",{ref:C,type:"text",value:c,onChange:G=>i(G.target.value),placeholder:N?"Nombre de la tarea...":"Task name...",className:g("w-full bg-transparent text-sm outline-none font-mono",r?"text-white/90 placeholder:text-white/20":"text-gray-900 placeholder:text-gray-400"),autoFocus:true,onKeyDown:L})}),jsxs("div",{className:g("px-2.5 py-2 flex items-center justify-between border-t",r?"border-white/[0.08]":"border-gray-100"),children:[jsxs("div",{className:"flex items-center gap-1",children:[jsxs("div",{className:"relative",children:[jsx("button",{onClick:G=>{G.stopPropagation(),b(!h),x(false),k(false);},type:"button",className:g("p-1 rounded transition-colors",u?u==="urgent"||u==="high"?"text-red-400 bg-red-500/20":u==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:jsx(Flag,{className:"w-3.5 h-3.5"})}),jsx(AnimatePresence,{children:h&&jsx(motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:g("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",P,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:G=>G.stopPropagation(),children:[{id:"urgent",label:N?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:N?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:N?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:N?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:N?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(G=>jsxs("button",{onClick:()=>{p(G.id),b(false);},type:"button",className:g("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",u===G.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsx("span",{className:g("w-2 h-2 rounded-full",G.color)}),jsx("span",{className:r?"text-white":"text-gray-900",children:G.label})]},G.id||"none"))})})]}),jsxs("div",{className:"relative",children:[jsxs("button",{onClick:G=>{G.stopPropagation(),k(!w),b(false),x(false),I(f||s||new Date);},type:"button",className:g("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors font-mono",f?r?"bg-[#007FFF]/20 text-[#007FFF]":"bg-[#00E5CC]/20 text-[#00C4AE]":r?"bg-white/5 text-white/30 hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsx(CalendarDays,{className:"w-3 h-3"}),Ie.toLocaleDateString(N?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsx(AnimatePresence,{children:w&&jsxs(motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:g("absolute left-0 z-[60] rounded-xl shadow-2xl overflow-hidden flex",P,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:G=>G.stopPropagation(),children:[jsx("div",{className:g("w-40 py-2 border-r",r?"border-white/10":"border-gray-200"),children:(()=>{let G=new Date,ke=new Date(G);ke.setDate(G.getDate()+1);let R=new Date(G);R.setDate(G.getDate()+((6-G.getDay()+7)%7||7));let U=new Date(G);U.setDate(G.getDate()+((1-G.getDay()+7)%7||7));let Pe=new Date(G);Pe.setDate(G.getDate()+14);let Ze=new Date(G);Ze.setDate(G.getDate()+28);let oe=N?"es-ES":"en-US";return [{label:N?"Hoy":"Today",date:G,display:G.toLocaleDateString(oe,{weekday:"short"}).slice(0,3)+"."},{label:N?"Ma\xF1ana":"Tomorrow",date:ke,display:ke.toLocaleDateString(oe,{weekday:"short"}).slice(0,3)+"."},{label:N?"Este fin de semana":"This weekend",date:R,display:N?"s\xE1b.":"sat."},{label:N?"Pr\xF3xima semana":"Next week",date:U,display:N?"lun.":"mon."},{label:N?"2 semanas":"2 weeks",date:Pe,display:Pe.toLocaleDateString(oe,{day:"numeric",month:"short"})},{label:N?"4 semanas":"4 weeks",date:Ze,display:Ze.toLocaleDateString(oe,{day:"numeric",month:"short"})}].map((Q,Se)=>jsxs("button",{type:"button",className:g("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",r?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{v(Q.date),k(false);},children:[jsx("span",{children:Q.label}),jsx("span",{className:g("text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:Q.display})]},Se))})()}),jsxs("div",{className:"p-3",children:[jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsx("span",{className:g("text-xs font-medium font-mono",r?"text-white":"text-gray-900"),children:M.toLocaleDateString(N?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxs("div",{className:"flex items-center gap-0.5",children:[jsx("button",{type:"button",onClick:()=>I(new Date),className:g("px-1.5 py-0.5 rounded text-[10px] transition-colors font-mono",r?"hover:bg-white/10 text-white/40":"hover:bg-gray-100 text-gray-500"),children:N?"Hoy":"Today"}),jsx("button",{type:"button",onClick:()=>I(new Date(M.getFullYear(),M.getMonth()-1)),className:g("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsx(ChevronLeft,{className:"w-3.5 h-3.5"})}),jsx("button",{type:"button",onClick:()=>I(new Date(M.getFullYear(),M.getMonth()+1)),className:g("p-0.5 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsx(ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(N?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(G=>jsx("div",{className:g("w-6 h-6 flex items-center justify-center text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:G},G))}),jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let G=M.getFullYear(),ke=M.getMonth(),R=new Date(G,ke,1).getDay(),U=new Date(G,ke+1,0).getDate(),Pe=new Date(G,ke,0).getDate(),Ze=new Date().toDateString(),oe=[];for(let Q=R-1;Q>=0;Q--)oe.push({dayNum:Pe-Q,isCurrent:false,date:new Date(G,ke-1,Pe-Q)});for(let Q=1;Q<=U;Q++)oe.push({dayNum:Q,isCurrent:true,date:new Date(G,ke,Q)});let Fe=42-oe.length;for(let Q=1;Q<=Fe;Q++)oe.push({dayNum:Q,isCurrent:false,date:new Date(G,ke+1,Q)});return oe.map((Q,Se)=>{let Ue=Q.date.toDateString()===Ze,Le=(f||s)?.toDateString()===Q.date.toDateString();return jsx("button",{type:"button",className:g("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors font-mono",!Q.isCurrent&&(r?"text-white/20":"text-gray-300"),Q.isCurrent&&(r?"text-white":"text-gray-900"),Ue&&"ring-1 ring-[#007FFF]",Le&&"bg-[#007FFF] text-white",!Le&&(r?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{v(Q.date),k(false);},children:Q.dayNum},Se)})})()})]})]})})]}),jsxs("div",{className:"relative",children:[jsx("button",{onClick:G=>{G.stopPropagation(),x(!y),b(false),k(false);},type:"button",className:g("p-1 rounded transition-colors",d?"text-[#007FFF] bg-[#007FFF]/20":r?"hover:bg-white/10 text-white/30":"hover:bg-gray-100 text-gray-400"),children:d?jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-mono font-bold",style:{backgroundColor:a.find(G=>G.id===d)?.color||"#007FFF"},children:a.find(G=>G.id===d)?.initials||a.find(G=>G.id===d)?.name?.slice(0,2).toUpperCase()}):jsx(User,{className:"w-3.5 h-3.5"})}),jsx(AnimatePresence,{children:y&&jsxs(motion.div,{initial:{opacity:0,y:l==="up"?-5:5},animate:{opacity:1,y:0},exit:{opacity:0,y:l==="up"?-5:5},className:g("absolute left-0 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",P,r?"bg-[#111] border border-white/10":"bg-white border border-gray-200"),onClick:G=>G.stopPropagation(),children:[jsxs("button",{type:"button",onClick:()=>{m(null),x(false);},className:g("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",!d&&(r?"bg-white/5":"bg-gray-50")),children:[jsx("div",{className:g("w-5 h-5 rounded-full flex items-center justify-center",r?"bg-white/10":"bg-gray-200"),children:jsx(User,{className:"w-3 h-3 text-gray-400"})}),jsx("span",{className:r?"text-white/40":"text-gray-500",children:N?"Sin asignar":"Unassigned"})]}),a.map(G=>jsxs("button",{type:"button",onClick:()=>{m(G.id),x(false);},className:g("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",r?"hover:bg-white/5":"hover:bg-gray-50",d===G.id&&(r?"bg-white/5":"bg-gray-50")),children:[jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-mono font-bold",style:{backgroundColor:G.color||"#007FFF"},children:G.initials||G.name?.slice(0,2).toUpperCase()}),jsx("span",{className:r?"text-white":"text-gray-900",children:G.name})]},G.id)),a.length===0&&jsx("div",{className:g("px-3 py-2 text-xs font-mono",r?"text-white/30":"text-gray-400"),children:N?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsx("button",{onClick:J,disabled:!c.trim(),type:"button",className:g("px-2.5 py-1 rounded text-xs font-mono font-medium transition-colors",c.trim()?"bg-[#007FFF] hover:bg-[#0066CC] text-white":r?"bg-white/5 text-white/20":"bg-gray-100 text-gray-400"),children:N?"Guardar":"Save"})]})]})}function Pc({columnId:e,onAddCard:t,availableUsers:a=[],className:r,buttonLabel:n,disabled:s=false,theme:o="dark",locale:l="es"}){let[c,i]=useState(false),u=useRef(null),p=useRef(null),[d,m]=useState({}),[f,v]=useState(false),h=o==="dark",y={buttonLabel:n||(l==="es"?"Agregar Tarea":"Add Task")};useEffect(()=>{if(!c||!u.current)return;let w=90,k=()=>{let M=u.current.getBoundingClientRect(),C=window.innerHeight-M.bottom<w+8;v(C),m({position:"fixed",...C?{bottom:window.innerHeight-M.top+4}:{top:M.bottom+4},left:M.left,width:M.width,zIndex:9999});};return k(),window.addEventListener("scroll",k,true),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,true),window.removeEventListener("resize",k);}},[c]),useEffect(()=>{if(!c)return;let w=k=>{let M=k.target;p.current&&!p.current.contains(M)&&u.current&&!u.current.contains(M)&&i(false);};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]);let x=useCallback(w=>{t({name:w.name,columnId:e,assigneeIds:w.assigneeId?[w.assigneeId]:void 0,startDate:w.startDate,endDate:w.endDate,priority:w.priority});},[t,e]);return jsxs("div",{ref:u,className:g("asakaa-add-card",r),children:[jsxs("button",{onClick:()=>i(!c),disabled:s,className:"asakaa-add-card__button",type:"button",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),y.buttonLabel]}),createPortal(jsx(AnimatePresence,{children:c&&jsx(motion.div,{ref:p,initial:{opacity:0,y:f?4:-4,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:f?4:-4,scale:.97},transition:{duration:.12},style:d,className:g("rounded-lg shadow-2xl",h?"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(Us,{onSubmit:x,onCancel:()=>i(false),availableUsers:a,isDark:h,locale:l,dropdownDirection:"up"})})}),document.body)]})}var zs=class extends BaseViewAdapter{constructor(a={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=a,this.options={animations:a.viewOptions?.animations??true,virtualScrolling:a.viewOptions?.virtualScrolling??false,theme:a.viewOptions?.theme??"dark",readonly:a.viewOptions?.readonly??false};}mount(a,r){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=a,this.data=r,this.root=createRoot(a),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(a){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=a,this.render(),this.emit("view:updated",{viewId:this.id,data:a});}configure(a){this.options={...this.options,...a},this.isMounted()&&this.render();}async export(a){if(!this.data)throw new Error("No data to export");switch(a){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${a}`)}}render(){if(!this.root||!this.data)return;let a={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsx(eo,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let n=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,n?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(n=>`"${n}"`).join(",")).join(`
|
|
19
19
|
`)}async exportToPDF(){throw new Error("PDF export not yet implemented in ViewAdapter")}async exportToPNG(){if(!this.container)throw new Error("View not mounted");let r=await(await import('html2canvas')).default(this.container,{backgroundColor:this.options.theme==="dark"?"#1a1a1a":"#ffffff",scale:2});return new Promise((n,s)=>{r.toBlob(o=>{o?n(o):s(new Error("Failed to create PNG blob"));},"image/png");})}};function rm(e={}){return new zs(e)}var as=class extends Component{constructor(a){super(a);this.resetError=()=>{this.setState({hasError:false,error:null,errorInfo:null});};this.state={hasError:false,error:null,errorInfo:null};}static getDerivedStateFromError(a){return {hasError:true,error:a}}componentDidCatch(a,r){let{onError:n,componentName:s}=this.props;if(process.env.NODE_ENV==="development"&&(console.error(`Error in ${s||"Component"}:`,a),console.error("Error Info:",r)),this.setState({errorInfo:r}),n)try{n(a,r);}catch(o){console.error("Error in error handler:",o);}}render(){let{hasError:a,error:r}=this.state,{children:n,fallback:s,componentName:o}=this.props;return a&&r?s?s(r,this.resetError):jsx("div",{className:"p-6 rounded-lg border",style:{background:"linear-gradient(135deg, #2d1b1b 0%, #1a1a1a 100%)",borderColor:"rgba(239, 68, 68, 0.3)"},children:jsxs("div",{className:"flex items-start gap-3",children:[jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:[jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#EF4444",strokeWidth:"2"}),jsx("path",{d:"M12 8V12",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round"}),jsx("circle",{cx:"12",cy:"16",r:"1",fill:"#EF4444"})]}),jsxs("div",{className:"flex-1",children:[jsx("h3",{className:"text-lg font-semibold text-red-400 mb-1",children:o?`Error in ${o}`:"Something went wrong"}),jsx("p",{className:"text-sm text-white/70 mb-3",children:r.message||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&jsxs("details",{className:"mb-3",children:[jsx("summary",{className:"text-xs text-white/50 cursor-pointer hover:text-white/70 mb-2",children:"Error Details (Development Only)"}),jsx("pre",{className:"text-xs text-white/60 bg-black/30 p-3 rounded overflow-auto max-h-48",children:r.stack})]}),jsx("button",{onClick:this.resetError,className:"px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#EF4444"},children:"Try Again"})]})]})}):n}};function Fc(e,t){let a=r=>jsx(as,{...t,children:jsx(e,{...r})});return a.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,a}function Ac({board:e,onCreateCard:t,onNavigateToCard:a,onSearch:r,onChangePriority:n,onAssignUser:s,onGeneratePlan:o,onPredictRisks:l,onOpenAIUsage:c,shortcut:i="k",className:u=""}){let[p,d]=useState(false),[m,f]=useState(""),[v,h]=useState("home"),[b,y]=useState(""),[x,w]=useState("");useEffect(()=>{let C=N=>{(N.metaKey||N.ctrlKey)&&N.key===i&&(N.preventDefault(),d(P=>!P)),N.key==="Escape"&&(d(false),h("home"),f(""));};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[i]),useEffect(()=>{p||(h("home"),f(""),y(""),w(""));},[p]);let k=useCallback(()=>{d(false);},[]),M=useCallback(C=>{let[N,P]=C.split(":");switch(N){case "create-card":h("create-card");break;case "create-card-in":y(P||"");break;case "navigate":P?(a?.(P),k()):h("navigate");break;case "search":r?.(m),k();break;case "priority":h("priority");break;case "set-priority":x&&P&&(n?.(x,P),k());break;case "assign":h("assign");break;case "assign-user":x&&P&&(s?.(x,P),k());break;case "ai":h("ai");break;case "ai-generate-plan":o?.(),k();break;case "ai-predict-risks":l?.(),k();break;case "ai-usage":c?.(),k();break;case "back":h("home");break;}},[m,x,t,a,r,n,s,o,l,c,k]),I=useCallback(()=>{b&&m.trim()&&(t?.(b,m.trim()),k());},[b,m,t,k]);return p?jsx(ia,{children:jsx("div",{className:"command-palette-overlay",onClick:k,children:jsx("div",{className:`command-palette ${u}`,onClick:C=>C.stopPropagation(),children:jsxs(Command,{value:m,onValueChange:f,label:"Command Menu",children:[jsxs("div",{className:"command-palette-header",children:[jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"11",cy:"11",r:"8"}),jsx("path",{d:"m21 21-4.35-4.35"})]}),jsx(Command.Input,{placeholder:v==="create-card"&&b?"Type card title and press Enter...":v==="create-card"?"Select a column first...":"Type a command or search...",className:"command-palette-input",onKeyDown:C=>{C.key==="Enter"&&v==="create-card"&&b&&I();}}),jsxs("div",{className:"command-palette-shortcut",children:[jsx("kbd",{children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsx("kbd",{children:"K"})]})]}),jsxs(Command.List,{className:"command-palette-list",children:[jsx(Command.Empty,{className:"command-palette-empty",children:"No results found."}),v==="home"&&jsxs(Fragment,{children:[jsxs(Command.Group,{heading:"Actions",className:"command-palette-group",children:[jsxs(Command.Item,{value:"create-card",onSelect:M,className:"command-palette-item",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsx("path",{d:"M12 8v8m-4-4h8"})]}),jsx("span",{children:"Create Card"}),jsx("div",{className:"command-palette-item-shortcut",children:"C"})]}),jsxs(Command.Item,{value:"navigate",onSelect:M,className:"command-palette-item",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("polyline",{points:"12 16 16 12 12 8"}),jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),jsx("span",{children:"Navigate to Card"}),jsx("div",{className:"command-palette-item-shortcut",children:"G"})]}),jsxs(Command.Item,{value:"search",onSelect:M,className:"command-palette-item",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("circle",{cx:"11",cy:"11",r:"8"}),jsx("path",{d:"m21 21-4.35-4.35"})]}),jsx("span",{children:"Search Cards"}),jsx("div",{className:"command-palette-item-shortcut",children:"/"})]})]}),jsx(Command.Group,{heading:"AI Features",className:"command-palette-group",children:jsxs(Command.Item,{value:"ai",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsx("path",{d:"M2 17L12 22L22 17"}),jsx("path",{d:"M2 12L12 17L22 12"})]}),jsx("span",{children:"AI Commands"}),jsx("div",{className:"command-palette-item-badge",children:"AI"})]})}),jsx(Command.Group,{heading:"Cards",className:"command-palette-group",children:e.cards.slice(0,5).map(C=>jsxs(Command.Item,{value:`navigate:${C.id}`,onSelect:M,className:"command-palette-item",children:[jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsx("span",{children:C.title}),C.labels&&C.labels.length>0&&jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(N=>jsx("span",{className:"command-palette-item-label",children:N},N))})]},C.id))})]}),v==="create-card"&&jsxs(Fragment,{children:[jsxs(Command.Item,{value:"back",onSelect:M,className:"command-palette-item",children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsx("span",{children:"Back"})]}),jsx(Command.Group,{heading:"Select Column",className:"command-palette-group",children:e.columns.map(C=>jsxs(Command.Item,{value:`create-card-in:${C.id}`,onSelect:M,className:"command-palette-item",children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("rect",{x:"3",y:"3",width:"7",height:"18",rx:"1"})}),jsx("span",{children:C.title}),jsxs("div",{className:"command-palette-item-count",children:[C.cardIds.length," cards"]})]},C.id))})]}),v==="navigate"&&jsxs(Fragment,{children:[jsxs(Command.Item,{value:"back",onSelect:M,className:"command-palette-item",children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsx("span",{children:"Back"})]}),jsx(Command.Group,{heading:"All Cards",className:"command-palette-group",children:e.cards.map(C=>{let N=e.columns.find(P=>P.id===C.columnId);return jsxs(Command.Item,{value:`navigate:${C.id}`,onSelect:M,className:"command-palette-item",keywords:[C.title,C.description||"",...C.labels||[]],children:[jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsxs("div",{className:"command-palette-item-content",children:[jsx("div",{children:C.title}),jsx("div",{className:"command-palette-item-meta",children:N?.title})]}),C.labels&&C.labels.length>0&&jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(P=>jsx("span",{className:"command-palette-item-label",children:P},P))})]},C.id)})})]}),v==="ai"&&jsxs(Fragment,{children:[jsxs(Command.Item,{value:"back",onSelect:M,className:"command-palette-item",children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsx("span",{children:"Back"})]}),jsxs(Command.Group,{heading:"AI Features",className:"command-palette-group",children:[jsxs(Command.Item,{value:"ai-generate-plan",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsx("path",{d:"M2 17L12 22L22 17"}),jsx("path",{d:"M2 12L12 17L22 12"})]}),jsx("span",{children:"Generate Project Plan"}),jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxs(Command.Item,{value:"ai-predict-risks",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsx("span",{children:"Predict Risks"}),jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxs(Command.Item,{value:"ai-usage",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),jsx("path",{d:"M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"})]}),jsx("span",{children:"AI Usage & Costs"}),jsx("div",{className:"command-palette-item-badge",children:"AI"})]})]})]})]}),jsxs("div",{className:"command-palette-footer",children:[jsxs("div",{className:"command-palette-footer-hint",children:[jsx("kbd",{children:"\u2191"}),jsx("kbd",{children:"\u2193"}),jsx("span",{children:"Navigate"})]}),jsxs("div",{className:"command-palette-footer-hint",children:[jsx("kbd",{children:"Enter"}),jsx("span",{children:"Select"})]}),jsxs("div",{className:"command-palette-footer-hint",children:[jsx("kbd",{children:"Esc"}),jsx("span",{children:"Close"})]})]})]})})})}):null}function sm(e,t,a,r,n){let s=document.getElementById("attachment-lightbox-native");s&&s.remove();let o=document.createElement("div");o.id="attachment-lightbox-native",o.className="attachment-lightbox",o.style.cssText=`
|
|
20
20
|
position: fixed !important;
|
|
21
21
|
inset: 0 !important;
|