@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.cjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
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
|
-
`}),jsxRuntime.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?jsxRuntime.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=>jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.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"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:g("text-sm font-medium",L?"text-white":"text-gray-900"),children:D.user?.name||(o==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:g("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:Wa(D.createdAt)})]}),jsxRuntime.jsx("div",{className:g("text-sm",L?"text-[#9CA3AF]":"text-gray-600"),children:jsxRuntime.jsx(Np,{content:D.content,theme:s})}),D.attachments&&D.attachments.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:D.attachments.map(W=>{let pe=W.type.startsWith("image/");return jsxRuntime.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?jsxRuntime.jsx(lucideReact.Image,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}):jsxRuntime.jsx(lucideReact.File,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsx("span",{className:g("text-xs truncate max-w-[100px]",L?"text-white":"text-gray-900"),children:W.name})]},W.id)})})]})]},D.id))}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:g("w-10 h-10 mb-3",L?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:g("text-sm",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:g("py-4 pl-4 pr-2 border-t",L?"border-white/10":"border-gray-200"),children:jsxRuntime.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]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(n=>{t(n);}),[]);let a=react.useCallback(r=>{core.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]=react.useState(null),[Fe,Q]=react.useState(false),Se=react.useRef(null),Ue=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),Le=n?.theme||"dark",Be=Le==="dark"||Le==="neutral",ot=Be?"dark":"",se=react.useCallback((A,X)=>{t.onCardUpdate?.(A,X);},[t]),je=react.useCallback((A,X)=>{t.onColumnUpdate?.(A,{title:X});},[t]),Xe=react.useCallback(A=>{t.onColumnDelete?.(A);},[t]),$e=["todo","in-progress","completed"],mt=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),Et=react.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]);react.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=react.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=react.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=react.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=react.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=react.useCallback(A=>{R||oe(A),a?.(A),w?.(A.id);},[a,w,R]),xt=react.useCallback(A=>{t.onCardUpdate?.(A.id,A),oe(A);},[t]);return c?jsxRuntime.jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsxRuntime.jsx(Py,{columnCount:3})}):i?jsxRuntime.jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof i=="string"?i:i.message})]})})}):jsxRuntime.jsxs(Zu,{themeName:Le,children:[jsxRuntime.jsxs("div",{className:g("flex h-full overflow-hidden",G?"flex-row":""),children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:mt,collisionDetection:core$1.closestCorners,onDragStart:Ne,onDragOver:lt,onDragEnd:Mt,children:[jsxRuntime.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 jsxRuntime.jsxs("div",{className:"asakaa-column-wrapper",children:[jsxRuntime.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]}),jsxRuntime.jsx(core$1.DragOverlay,{children:U.draggedCardId?jsxRuntime.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&&jsxRuntime.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 jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,a)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},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]=react.useState(false),l=react.useRef(null);react.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 jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:n||r.newTask}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.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)=>jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color||a.accent}}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:i.title}),jsxRuntime.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]=react.useState(false),[l,c]=react.useState(null),i=react.useRef(null);if(react.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:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.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 jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsx("div",{className:"py-1",children:p.map((m,f)=>jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.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?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):m.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:m.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:m.description})]})]},m.id))})})})]})}function Wy({onClick:e,label:t}){return jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.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 jsxRuntime.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:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:d.borderLight}})]}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Uy,{theme:d,t:m,onExportCSV:o,onExportJSON:l,onExportExcel:c}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:d.borderLight}})]}),p,t&&(s?jsxRuntime.jsx(Hy,{columns:e,onSelect:t,theme:d,t:m,createTaskLabel:a}):jsxRuntime.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]=react.useState(false),[l,c]=react.useState(""),i=react.useCallback(()=>{let d=l.trim();d&&(e(d),c(""),o(false));},[l,e]),u=react.useCallback(d=>{d.key==="Enter"?(d.preventDefault(),i()):d.key==="Escape"&&(c(""),o(false));},[i]),p=react.useCallback(()=>{setTimeout(()=>{l.trim()||o(false);},150);},[l]);return s?jsxRuntime.jsx("div",{className:g("asakaa-add-column asakaa-add-column--editing",t),children:jsxRuntime.jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsxRuntime.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"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:i,disabled:!l.trim(),className:"asakaa-add-column__submit",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsxRuntime.jsx("button",{onClick:()=>{c(""),o(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsxRuntime.jsx("div",{className:g("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>o(true),disabled:n,className:"asakaa-add-column__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.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]=react.useState(""),[u,p]=react.useState(void 0),[d,m]=react.useState(null),[f,v]=react.useState(null),[h,b]=react.useState(false),[y,x]=react.useState(false),[w,k]=react.useState(false),[M,I]=react.useState(s||new Date),C=react.useRef(null),N=n==="es",P=l==="up"?"bottom-full mb-1":"top-full mt-1";react.useEffect(()=>{C.current?.focus();},[]);let T=react.useCallback(()=>{b(false),x(false),k(false);},[]),V=react.useCallback(()=>{i(""),p(void 0),m(null),v(null),T(),t();},[t,T]),O=f||s||new Date,J=react.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=react.useCallback(G=>{G.key==="Enter"&&c.trim()&&(G.preventDefault(),J()),G.key==="Escape"&&V();},[J,V,c]),Ie=O;return jsxRuntime.jsxs("div",{className:g("quick-task-create",o),onClick:()=>T(),children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.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})}),jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx(framerMotion.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=>jsxRuntime.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:[jsxRuntime.jsx("span",{className:g("w-2 h-2 rounded-full",G.color)}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:G.label})]},G.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),Ie.toLocaleDateString(N?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w&&jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.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)=>jsxRuntime.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:[jsxRuntime.jsx("span",{children:Q.label}),jsxRuntime.jsx("span",{className:g("text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:Q.display})]},Se))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.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"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(N?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(G=>jsxRuntime.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))}),jsxRuntime.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 jsxRuntime.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)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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?jsxRuntime.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()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.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:[jsxRuntime.jsx("div",{className:g("w-5 h-5 rounded-full flex items-center justify-center",r?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:r?"text-white/40":"text-gray-500",children:N?"Sin asignar":"Unassigned"})]}),a.map(G=>jsxRuntime.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:[jsxRuntime.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()}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:G.name})]},G.id)),a.length===0&&jsxRuntime.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"})]})})]})]}),jsxRuntime.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]=react.useState(false),u=react.useRef(null),p=react.useRef(null),[d,m]=react.useState({}),[f,v]=react.useState(false),h=o==="dark",y={buttonLabel:n||(l==="es"?"Agregar Tarea":"Add Task")};react.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]),react.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=react.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 jsxRuntime.jsxs("div",{ref:u,className:g("asakaa-add-card",r),children:[jsxRuntime.jsxs("button",{onClick:()=>i(!c),disabled:s,className:"asakaa-add-card__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),y.buttonLabel]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:c&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsx(Us,{onSubmit:x,onCancel:()=>i(false),availableUsers:a,isDark:h,locale:l,dropdownDirection:"up"})})}),document.body)]})}var zs=class extends core.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=client.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(jsxRuntime.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
|
+
`}),jsxRuntime.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?jsxRuntime.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=>jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.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"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:g("text-sm font-medium",L?"text-white":"text-gray-900"),children:D.user?.name||(o==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:g("text-xs",L?"text-[#6B7280]":"text-gray-400"),children:Wa(D.createdAt)})]}),jsxRuntime.jsx("div",{className:g("text-sm",L?"text-[#9CA3AF]":"text-gray-600"),children:jsxRuntime.jsx(Np,{content:D.content,theme:s})}),D.attachments&&D.attachments.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:D.attachments.map(W=>{let pe=W.type.startsWith("image/");return jsxRuntime.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?jsxRuntime.jsx(lucideReact.Image,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}):jsxRuntime.jsx(lucideReact.File,{className:g("w-4 h-4",L?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsx("span",{className:g("text-xs truncate max-w-[100px]",L?"text-white":"text-gray-900"),children:W.name})]},W.id)})})]})]},D.id))}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:g("w-10 h-10 mb-3",L?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:g("text-sm",L?"text-[#6B7280]":"text-gray-500"),children:o==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:g("py-4 pl-4 pr-2 border-t",L?"border-white/10":"border-gray-200"),children:jsxRuntime.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]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(n=>{t(n);}),[]);let a=react.useCallback(r=>{core.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]=react.useState(null),[Fe,Q]=react.useState(false),Se=react.useRef(null),Ue=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),Le=n?.theme||"dark",Be=Le==="dark"||Le==="neutral",ot=Be?"dark":"",se=react.useCallback((A,X)=>{t.onCardUpdate?.(A,X);},[t]),je=react.useCallback((A,X)=>{t.onColumnUpdate?.(A,{title:X});},[t]),Xe=react.useCallback(A=>{t.onColumnDelete?.(A);},[t]),$e=["todo","in-progress","completed"],mt=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),Et=react.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]);react.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=react.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=react.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=react.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=react.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=react.useCallback(A=>{R||oe(A),a?.(A),w?.(A.id);},[a,w,R]),xt=react.useCallback(A=>{t.onCardUpdate?.(A.id,A),oe(A);},[t]);return c?jsxRuntime.jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsxRuntime.jsx(Py,{columnCount:3})}):i?jsxRuntime.jsx("div",{className:g("asakaa-board",ot,o),style:l,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof i=="string"?i:i.message})]})})}):jsxRuntime.jsxs(Zu,{themeName:Le,children:[jsxRuntime.jsxs("div",{className:g("flex h-full overflow-hidden",G?"flex-row":""),children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:mt,collisionDetection:core$1.closestCorners,onDragStart:Ne,onDragOver:lt,onDragEnd:Mt,children:[jsxRuntime.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 jsxRuntime.jsxs("div",{className:"asakaa-column-wrapper",children:[jsxRuntime.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]}),jsxRuntime.jsx(core$1.DragOverlay,{children:U.draggedCardId?jsxRuntime.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&&jsxRuntime.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 jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,a)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},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]=react.useState(false),l=react.useRef(null);react.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 jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:n||r.newTask}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.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)=>jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color||a.accent}}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:i.title}),jsxRuntime.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]=react.useState(false),[l,c]=react.useState(null),i=react.useRef(null);if(react.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:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.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 jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsx("div",{className:"py-1",children:p.map((m,f)=>jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.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?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):m.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:m.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:m.description})]})]},m.id))})})})]})}function Wy({onClick:e,label:t}){return jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.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 jsxRuntime.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:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u,jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:d.borderLight}})]}),f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Uy,{theme:d,t:m,onExportCSV:o,onExportJSON:l,onExportExcel:c}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:d.borderLight}})]}),p,t&&(s?jsxRuntime.jsx(Hy,{columns:e,onSelect:t,theme:d,t:m,createTaskLabel:a}):jsxRuntime.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]=react.useState(false),[l,c]=react.useState(""),i=react.useCallback(()=>{let d=l.trim();d&&(e(d),c(""),o(false));},[l,e]),u=react.useCallback(d=>{d.key==="Enter"?(d.preventDefault(),i()):d.key==="Escape"&&(c(""),o(false));},[i]),p=react.useCallback(()=>{setTimeout(()=>{l.trim()||o(false);},150);},[l]);return s?jsxRuntime.jsx("div",{className:g("asakaa-add-column asakaa-add-column--editing",t),children:jsxRuntime.jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsxRuntime.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"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:i,disabled:!l.trim(),className:"asakaa-add-column__submit",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsxRuntime.jsx("button",{onClick:()=>{c(""),o(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsxRuntime.jsx("div",{className:g("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>o(true),disabled:n,className:"asakaa-add-column__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.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]=react.useState(""),[u,p]=react.useState(void 0),[d,m]=react.useState(null),[f,v]=react.useState(null),[h,b]=react.useState(false),[y,x]=react.useState(false),[w,k]=react.useState(false),[M,I]=react.useState(s||new Date),C=react.useRef(null),N=n==="es",P=l==="up"?"bottom-full mb-1":"top-full mt-1";react.useEffect(()=>{C.current?.focus();},[]);let T=react.useCallback(()=>{b(false),x(false),k(false);},[]),V=react.useCallback(()=>{i(""),p(void 0),m(null),v(null),T(),t();},[t,T]),O=f||s||new Date,J=react.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=react.useCallback(G=>{G.key==="Enter"&&c.trim()&&(G.preventDefault(),J()),G.key==="Escape"&&V();},[J,V,c]),Ie=O;return jsxRuntime.jsxs("div",{className:g("quick-task-create",o),onClick:()=>T(),children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.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})}),jsxRuntime.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:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:h&&jsxRuntime.jsx(framerMotion.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=>jsxRuntime.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:[jsxRuntime.jsx("span",{className:g("w-2 h-2 rounded-full",G.color)}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:G.label})]},G.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),Ie.toLocaleDateString(N?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:w&&jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.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)=>jsxRuntime.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:[jsxRuntime.jsx("span",{children:Q.label}),jsxRuntime.jsx("span",{className:g("text-[10px] font-mono",r?"text-white/30":"text-gray-400"),children:Q.display})]},Se))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.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"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.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"}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.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:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(N?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(G=>jsxRuntime.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))}),jsxRuntime.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 jsxRuntime.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)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.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?jsxRuntime.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()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:y&&jsxRuntime.jsxs(framerMotion.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:[jsxRuntime.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:[jsxRuntime.jsx("div",{className:g("w-5 h-5 rounded-full flex items-center justify-center",r?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:r?"text-white/40":"text-gray-500",children:N?"Sin asignar":"Unassigned"})]}),a.map(G=>jsxRuntime.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:[jsxRuntime.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()}),jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:G.name})]},G.id)),a.length===0&&jsxRuntime.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"})]})})]})]}),jsxRuntime.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]=react.useState(false),u=react.useRef(null),p=react.useRef(null),[d,m]=react.useState({}),[f,v]=react.useState(false),h=o==="dark",y={buttonLabel:n||(l==="es"?"Agregar Tarea":"Add Task")};react.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]),react.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=react.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 jsxRuntime.jsxs("div",{ref:u,className:g("asakaa-add-card",r),children:[jsxRuntime.jsxs("button",{onClick:()=>i(!c),disabled:s,className:"asakaa-add-card__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),y.buttonLabel]}),reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:c&&jsxRuntime.jsx(framerMotion.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:jsxRuntime.jsx(Us,{onSubmit:x,onCancel:()=>i(false),availableUsers:a,isDark:h,locale:l,dropdownDirection:"up"})})}),document.body)]})}var zs=class extends core.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=client.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(jsxRuntime.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 react.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):jsxRuntime.jsx("div",{className:"p-6 rounded-lg border",style:{background:"linear-gradient(135deg, #2d1b1b 0%, #1a1a1a 100%)",borderColor:"rgba(239, 68, 68, 0.3)"},children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#EF4444",strokeWidth:"2"}),jsxRuntime.jsx("path",{d:"M12 8V12",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"#EF4444"})]}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold text-red-400 mb-1",children:o?`Error in ${o}`:"Something went wrong"}),jsxRuntime.jsx("p",{className:"text-sm text-white/70 mb-3",children:r.message||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&jsxRuntime.jsxs("details",{className:"mb-3",children:[jsxRuntime.jsx("summary",{className:"text-xs text-white/50 cursor-pointer hover:text-white/70 mb-2",children:"Error Details (Development Only)"}),jsxRuntime.jsx("pre",{className:"text-xs text-white/60 bg-black/30 p-3 rounded overflow-auto max-h-48",children:r.stack})]}),jsxRuntime.jsx("button",{onClick:this.resetError,className:"px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#EF4444"},children:"Try Again"})]})]})}):n}};function Fc(e,t){let a=r=>jsxRuntime.jsx(as,{...t,children:jsxRuntime.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]=react.useState(false),[m,f]=react.useState(""),[v,h]=react.useState("home"),[b,y]=react.useState(""),[x,w]=react.useState("");react.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]),react.useEffect(()=>{p||(h("home"),f(""),y(""),w(""));},[p]);let k=react.useCallback(()=>{d(false);},[]),M=react.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=react.useCallback(()=>{b&&m.trim()&&(t?.(b,m.trim()),k());},[b,m,t,k]);return p?jsxRuntime.jsx(ia,{children:jsxRuntime.jsx("div",{className:"command-palette-overlay",onClick:k,children:jsxRuntime.jsx("div",{className:`command-palette ${u}`,onClick:C=>C.stopPropagation(),children:jsxRuntime.jsxs(cmdk.Command,{value:m,onValueChange:f,label:"Command Menu",children:[jsxRuntime.jsxs("div",{className:"command-palette-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx(cmdk.Command.Input,{placeholder: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();}}),jsxRuntime.jsxs("div",{className:"command-palette-shortcut",children:[jsxRuntime.jsx("kbd",{children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsxRuntime.jsx("kbd",{children:"K"})]})]}),jsxRuntime.jsxs(cmdk.Command.List,{className:"command-palette-list",children:[jsxRuntime.jsx(cmdk.Command.Empty,{className:"command-palette-empty",children:"No results found."}),v==="home"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Group,{heading:"Actions",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"create-card",onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntime.jsx("path",{d:"M12 8v8m-4-4h8"})]}),jsxRuntime.jsx("span",{children:"Create Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"C"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"navigate",onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 16 16 12 12 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),jsxRuntime.jsx("span",{children:"Navigate to Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"G"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"search",onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx("span",{children:"Search Cards"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"/"})]})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"AI Commands"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Cards",className:"command-palette-group",children:e.cards.slice(0,5).map(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsxRuntime.jsx("span",{children:C.title}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(N=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:N},N))})]},C.id))})]}),v==="create-card"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Select Column",className:"command-palette-group",children:e.columns.map(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`create-card-in:${C.id}`,onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"18",rx:"1"})}),jsxRuntime.jsx("span",{children:C.title}),jsxRuntime.jsxs("div",{className:"command-palette-item-count",children:[C.cardIds.length," cards"]})]},C.id))})]}),v==="navigate"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"All Cards",className:"command-palette-group",children:e.cards.map(C=>{let N=e.columns.find(P=>P.id===C.columnId);return jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:M,className:"command-palette-item",keywords:[C.title,C.description||"",...C.labels||[]],children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#00E5CC":"#6B7280"}}),jsxRuntime.jsxs("div",{className:"command-palette-item-content",children:[jsxRuntime.jsx("div",{children:C.title}),jsxRuntime.jsx("div",{className:"command-palette-item-meta",children:N?.title})]}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(P=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:P},P))})]},C.id)})})]}),v==="ai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:M,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsxs(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-generate-plan",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"Generate Project Plan"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-predict-risks",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsxRuntime.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsxRuntime.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsxRuntime.jsx("span",{children:"Predict Risks"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-usage",onSelect:M,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),jsxRuntime.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"})]}),jsxRuntime.jsx("span",{children:"AI Usage & Costs"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})]})]})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer",children:[jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"\u2191"}),jsxRuntime.jsx("kbd",{children:"\u2193"}),jsxRuntime.jsx("span",{children:"Navigate"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Enter"}),jsxRuntime.jsx("span",{children:"Select"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Esc"}),jsxRuntime.jsx("span",{children:"Close"})]})]})]})})})}):null}function 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;
|