@libxai/board 0.17.179 → 0.17.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68,7 +68,7 @@ import {createRoot}from'react-dom/client';import {dragStore,BaseViewAdapter,sele
|
|
|
68
68
|
border: none !important;
|
|
69
69
|
cursor: pointer !important;
|
|
70
70
|
opacity: 0.5 !important;
|
|
71
|
-
`,u.onmouseenter=()=>{u.style.opacity="1";},u.onmouseleave=()=>{u.style.opacity="0.5";},u.onclick=y=>{y.stopPropagation();let f=r<a.length-1?r+1:0;n(),o(f);},l.appendChild(d),l.appendChild(i),l.appendChild(u);}l.appendChild(c),l.appendChild(p),document.body.appendChild(l),setTimeout(()=>{p.style.transition="opacity 0.5s ease",p.style.opacity="0";},2e3);}function mm(e){if(e===0)return "0 Bytes";let t=1024,a=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+a[r]}function um(e){return e.startsWith("image/")?"\u{1F5BC}\uFE0F":e.startsWith("video/")?"\u{1F3A5}":e.startsWith("audio/")?"\u{1F3B5}":e.includes("pdf")?"\u{1F4C4}":e.includes("word")||e.includes("document")?"\u{1F4DD}":e.includes("sheet")||e.includes("excel")?"\u{1F4CA}":e.includes("presentation")||e.includes("powerpoint")?"\u{1F4FD}\uFE0F":e.includes("zip")||e.includes("rar")||e.includes("compressed")?"\u{1F5DC}\uFE0F":e.includes("text")?"\u{1F4C3}":"\u{1F4CE}"}function Qn(e){return e.startsWith("image/")}function za({attachments:e=[],onUpload:t,onDelete:a,maxSizeMB:r=10,allowedTypes:o,maxFiles:s=10}){let[l,c]=useState(false),[p,n]=useState(false),[m,d]=useState(null),i=useRef(null),u=useRef(e);u.current=e;let y=useCallback((v,L)=>{L.preventDefault(),L.stopPropagation();let T=u.current.filter(P=>Qn(P.type)),k=T.findIndex(P=>P.id===v.id),F=P=>{let H=u.current.filter(ye=>Qn(ye.type)),X=H[P];X&&Sl(X.url,X.name,H,P,F);};Sl(v.url,v.name,T,k,F);},[]),f=useCallback(v=>{let L=[],T=[];return e.length+v.length>s?(T.push(`Maximum ${s} files allowed`),{valid:L,errors:T}):(v.forEach(k=>{if(k.size/1048576>r){T.push(`${k.name} is too large (max ${r}MB)`);return}if(o&&!o.some(P=>k.type.match(P))){T.push(`${k.name} has invalid file type`);return}L.push(k);}),{valid:L,errors:T})},[e.length,s,r,o]),g=useCallback(async v=>{let{valid:L,errors:T}=f(v);if(T.length>0){d(T.join(", ")),setTimeout(()=>d(null),5e3);return}if(L.length!==0){n(true),d(null);try{await t?.(L);}catch(k){d(k instanceof Error?k.message:"Upload failed"),setTimeout(()=>d(null),5e3);}finally{n(false);}}},[f,t]),x=useCallback(v=>{v.preventDefault(),v.stopPropagation(),c(true);},[]),b=useCallback(v=>{v.preventDefault(),v.stopPropagation(),c(false);},[]),h=useCallback(v=>{v.preventDefault(),v.stopPropagation();},[]),w=useCallback(v=>{v.preventDefault(),v.stopPropagation(),c(false);let L=Array.from(v.dataTransfer.files);g(L);},[g]),D=useCallback(v=>{let L=v.target.files?Array.from(v.target.files):[];g(L),i.current&&(i.current.value="");},[g]),N=useCallback(()=>{i.current?.click();},[]),M=useCallback(v=>{confirm("Are you sure you want to delete this attachment?")&&a?.(v);},[a]);return jsxs("div",{className:"attachment-uploader",children:[jsxs("div",{className:`attachment-dropzone ${l?"dragging":""} ${p?"uploading":""}`,onDragEnter:x,onDragLeave:b,onDragOver:h,onDrop:w,onClick:N,children:[jsx("input",{ref:i,type:"file",multiple:true,onChange:D,style:{display:"none"},accept:o?.join(",")}),jsx("div",{className:"attachment-dropzone-content",children:p?jsxs(Fragment,{children:[jsx("div",{className:"attachment-spinner"}),jsx("p",{className:"attachment-dropzone-text",children:"Uploading..."})]}):jsxs(Fragment,{children:[jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"attachment-dropzone-icon",children:[jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M17 8L12 3L7 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M12 3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("p",{className:"attachment-dropzone-text",children:l?"Drop files here":"Drag & drop files here"}),jsx("p",{className:"attachment-dropzone-subtext",children:"or click to browse"}),jsxs("p",{className:"attachment-dropzone-info",children:["Max ",r,"MB \u2022 ",e.length,"/",s," files"]})]})})]}),m&&jsxs("div",{className:"attachment-error",children:[jsx("span",{className:"attachment-error-icon",children:"\u26A0\uFE0F"}),jsx("span",{className:"attachment-error-text",children:m})]}),e.length>0&&jsx("div",{className:"attachment-list",children:e.map(v=>jsxs("div",{className:"attachment-item",children:[jsx("div",{className:"attachment-preview",children:Qn(v.type)&&v.url?jsxs("button",{type:"button",className:"attachment-thumbnail-btn",onClick:L=>y(v,L),title:"Click to view full size",children:[jsx("img",{src:v.thumbnailUrl||v.url,alt:v.name,className:"attachment-thumbnail"}),jsx("div",{className:"attachment-thumbnail-overlay",children:jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M15 3H21V9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M9 21H3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M21 3L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M3 21L10 14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}):jsx("div",{className:"attachment-icon",children:um(v.type)})}),jsxs("div",{className:"attachment-info",children:[jsx("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",className:"attachment-name",title:v.name,children:v.name}),jsxs("div",{className:"attachment-meta",children:[jsx("span",{className:"attachment-size",children:mm(v.size)}),jsx("span",{className:"attachment-separator",children:"\u2022"}),jsx("span",{className:"attachment-date",children:new Date(v.uploadedAt).toLocaleDateString()})]})]}),jsx("button",{onClick:()=>M(v.id),className:"attachment-delete",title:"Delete attachment",type:"button",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},v.id))})]})}function es({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:o,availableUsers:s=[],comments:l=[],activities:c=[],aiInsights:p=[],attachments:n=[],onAddComment:m,onDeleteComment:d,onUploadAttachments:i,onDeleteAttachment:u,onSuggestAssignee:y,onGenerateSubtasks:f,onEstimateEffort:g,currentUserId:x="user-1"}){let[b,h]=useState("details"),[w,D]=useState(false),[N,M]=useState({}),[v,L]=useState(""),[T,k]=useState(false),[F,P]=useState({});if(!t||!e)return null;let H=useCallback(()=>{D(false),M({}),h("details"),L(""),P({}),a();},[a]),X=useCallback(()=>{r&&Object.keys(N).length>0&&(r(e.id,N),M({}),D(false));},[e.id,N,r]),ye=useCallback(()=>{o&&window.confirm("Are you sure you want to delete this card?")&&(o(e.id),H());},[e.id,o,H]),we=useCallback(()=>{m&&v.trim()&&(m(e.id,v.trim()),L(""));},[e.id,v,m]),Ie=useCallback(async()=>{if(y){k(true);try{let S=await y(e);P(q=>({...q,assignees:S}));}catch(S){console.error("Failed to suggest assignee:",S);}finally{k(false);}}},[e,y]),Le=useCallback(async()=>{if(f){k(true);try{let S=await f(e);P(q=>({...q,subtasks:S}));}catch(S){console.error("Failed to generate subtasks:",S);}finally{k(false);}}},[e,f]),O=useCallback(async()=>{if(g){k(true);try{let S=await g(e);P(q=>({...q,effort:S}));}catch(S){console.error("Failed to estimate effort:",S);}finally{k(false);}}},[e,g]),B={...e,...N},W=s.filter(S=>B.assignedUserIds?.includes(S.id));return jsx(tt,{children:jsx("div",{className:"card-detail-overlay",onClick:H,children:jsxs("div",{className:"card-detail-modal",onClick:S=>S.stopPropagation(),children:[jsxs("div",{className:"card-detail-header",children:[jsxs("div",{className:"card-detail-header-left",children:[jsx("div",{className:"card-detail-priority-dot",style:{background:B.priority==="URGENT"?"#EF4444":B.priority==="HIGH"?"#F59E0B":B.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),w?jsx("input",{type:"text",value:N.title??B.title,onChange:S=>M({...N,title:S.target.value}),className:"card-detail-title-input",placeholder:"Card title"}):jsx("h2",{className:"card-detail-title",children:B.title})]}),jsxs("div",{className:"card-detail-header-actions",children:[w?jsxs(Fragment,{children:[jsx("button",{onClick:X,className:"card-detail-btn card-detail-btn-primary",children:"Save"}),jsx("button",{onClick:()=>{D(false),M({});},className:"card-detail-btn",children:"Cancel"})]}):jsxs("button",{onClick:()=>D(true),className:"card-detail-btn",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]}),jsxs("button",{onClick:ye,className:"card-detail-btn card-detail-btn-danger",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]}),"Delete"]}),jsx("button",{onClick:H,className:"card-detail-btn-close",children:jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),jsxs("div",{className:"card-detail-tabs",children:[jsxs("button",{onClick:()=>h("details"),className:`card-detail-tab ${b==="details"?"active":""}`,children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Details"]}),jsxs("button",{onClick:()=>h("comments"),className:`card-detail-tab ${b==="comments"?"active":""}`,children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),"Comments",l.length>0&&jsx("span",{className:"card-detail-tab-badge",children:l.length})]}),jsxs("button",{onClick:()=>h("activity"),className:`card-detail-tab ${b==="activity"?"active":""}`,children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Activity",c.length>0&&jsx("span",{className:"card-detail-tab-badge",children:c.length})]}),jsxs("button",{onClick:()=>h("attachments"),className:`card-detail-tab ${b==="attachments"?"active":""}`,children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),"Attachments",n.length>0&&jsx("span",{className:"card-detail-tab-badge",children:n.length})]}),jsxs("button",{onClick:()=>h("ai"),className:`card-detail-tab ${b==="ai"?"active":""}`,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"})]}),"AI Insights",jsx("span",{className:"card-detail-tab-badge card-detail-tab-badge-ai",children:"AI"})]})]}),jsxs("div",{className:"card-detail-content",children:[b==="details"&&jsxs("div",{className:"card-detail-details",children:[jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Description"}),w?jsx("textarea",{value:N.description??B.description??"",onChange:S=>M({...N,description:S.target.value}),className:"card-detail-textarea",placeholder:"Add a description...",rows:4}):jsx("p",{className:"card-detail-text",children:B.description||"No description"})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Assigned To"}),w?jsx("select",{multiple:true,value:N.assignedUserIds??B.assignedUserIds??[],onChange:S=>{let q=Array.from(S.target.selectedOptions,ee=>ee.value);M({...N,assignedUserIds:q});},className:"card-detail-textarea",style:{height:"120px",padding:"8px 12px"},children:s.map(S=>jsx("option",{value:S.id,children:S.name},S.id))}):jsx("div",{className:"card-detail-users",children:W.length>0?W.map(S=>jsxs("div",{className:"card-detail-user",children:[jsx("div",{className:"card-detail-user-avatar",style:{background:S.color},children:S.initials}),jsx("span",{children:S.name})]},S.id)):jsx("span",{className:"card-detail-empty",children:"Unassigned"})})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Priority"}),w?jsxs("select",{value:N.priority??B.priority??"",onChange:S=>M({...N,priority:S.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},children:[jsx("option",{value:"",children:"None"}),jsx("option",{value:"LOW",children:"LOW"}),jsx("option",{value:"MEDIUM",children:"MEDIUM"}),jsx("option",{value:"HIGH",children:"HIGH"}),jsx("option",{value:"URGENT",children:"URGENT"})]}):jsxs("div",{className:"card-detail-priority",children:[jsx("div",{className:"card-detail-priority-dot",style:{background:B.priority==="URGENT"?"#EF4444":B.priority==="HIGH"?"#F59E0B":B.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsx("span",{children:B.priority||"None"})]})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Labels"}),jsx("div",{className:"card-detail-labels",children:B.labels&&B.labels.length>0?B.labels.map(S=>jsx("span",{className:"card-detail-label-tag",children:S},S)):jsx("span",{className:"card-detail-empty",children:"No labels"})})]}),jsxs("div",{className:"card-detail-section-row",children:[jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Start Date"}),w?jsx("input",{type:"date",value:N.startDate?new Date(N.startDate).toISOString().split("T")[0]:B.startDate?new Date(B.startDate).toISOString().split("T")[0]:"",onChange:S=>M({...N,startDate:S.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsx("span",{className:"card-detail-text",children:B.startDate?new Date(B.startDate).toLocaleDateString():"Not set"})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"End Date"}),w?jsx("input",{type:"date",value:N.endDate?new Date(N.endDate).toISOString().split("T")[0]:B.endDate?new Date(B.endDate).toISOString().split("T")[0]:"",onChange:S=>M({...N,endDate:S.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsx("span",{className:"card-detail-text",children:B.endDate?new Date(B.endDate).toLocaleDateString():"Not set"})]})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Estimated Hours"}),w?jsx("input",{type:"number",min:"0",step:"0.5",value:N.estimatedTime??B.estimatedTime??"",onChange:S=>M({...N,estimatedTime:S.target.value?parseFloat(S.target.value):void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},placeholder:"Enter hours"}):jsx("span",{className:"card-detail-text",children:B.estimatedTime||"Not estimated"})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Dependencies"}),jsx("div",{className:"card-detail-dependencies",children:B.dependencies&&B.dependencies.length>0?B.dependencies.map(S=>{let q=typeof S=="string"?S:S.taskId;return jsxs("span",{className:"card-detail-dependency",children:["Card #",q.slice(-4)]},q)}):jsx("span",{className:"card-detail-empty",children:"No dependencies"})})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Created"}),jsx("span",{className:"card-detail-text",children:B.createdAt?new Date(B.createdAt).toLocaleString():"Unknown"})]})]}),b==="comments"&&jsxs("div",{className:"card-detail-comments",children:[jsxs("div",{className:"card-detail-comment-form",children:[jsx("textarea",{value:v,onChange:S=>L(S.target.value),className:"card-detail-comment-textarea",placeholder:"Write a comment...",rows:3}),jsx("button",{onClick:we,disabled:!v.trim(),className:"card-detail-btn card-detail-btn-primary",children:"Add Comment"})]}),jsx("div",{className:"card-detail-comments-list",children:l.length>0?l.map(S=>{let q=s.find(ee=>ee.id===S.authorId);return jsxs("div",{className:"card-detail-comment",children:[jsxs("div",{className:"card-detail-comment-header",children:[jsxs("div",{className:"card-detail-comment-author",children:[q&&jsx("div",{className:"card-detail-user-avatar",style:{background:q.color},children:q.initials}),jsxs("div",{children:[jsx("div",{className:"card-detail-comment-author-name",children:q?.name||"Unknown"}),jsx("div",{className:"card-detail-comment-time",children:new Date(S.createdAt).toLocaleString()})]})]}),d&&jsx("button",{onClick:()=>d(S.id),className:"card-detail-comment-delete",children:jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]}),jsx("p",{className:"card-detail-comment-content",children:S.content})]},S.id)}):jsxs("div",{className:"card-detail-empty-state",children:[jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsx("p",{children:"No comments yet"}),jsx("span",{children:"Be the first to comment"})]})})]}),b==="activity"&&jsx("div",{className:"card-detail-activity",children:c.length>0?jsx("div",{className:"card-detail-activity-list",children:c.map(S=>{let q=s.find(ee=>ee.id===S.userId);return jsxs("div",{className:"card-detail-activity-item",children:[jsxs("div",{className:"card-detail-activity-icon",children:[S.type.includes("CREATED")&&"\u2795",S.type.includes("UPDATED")&&"\u270F\uFE0F",S.type.includes("MOVED")&&"\u27A1\uFE0F",S.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",S.type.includes("COMMENT")&&"\u{1F4AC}",S.type.includes("ASSIGNED")&&"\u{1F464}",S.type.includes("PRIORITY")&&"\u{1F3AF}",S.type.includes("LABEL")&&"\u{1F3F7}\uFE0F",S.type.includes("ATTACHMENT")&&"\u{1F4CE}"]}),jsxs("div",{className:"card-detail-activity-content",children:[jsxs("div",{className:"card-detail-activity-text",children:[jsx("strong",{children:q?.name||"Unknown"})," ",S.type.replace(/_/g," ").toLowerCase(),S.newValue&&jsxs("span",{className:"card-detail-activity-value",children:[" ","to ",jsx("strong",{children:S.newValue})]})]}),jsx("div",{className:"card-detail-activity-time",children:new Date(S.timestamp).toLocaleString()})]})]},S.id)})}):jsxs("div",{className:"card-detail-empty-state",children:[jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),jsx("p",{children:"No activity yet"}),jsx("span",{children:"Activity will appear here"})]})}),b==="attachments"&&jsx("div",{className:"card-detail-attachments",children:jsx(za,{cardId:e.id,attachments:n,onUpload:i?S=>i(e.id,S):void 0,onDelete:u,currentUserId:x,maxSizeMB:10,maxFiles:20})}),b==="ai"&&jsxs("div",{className:"card-detail-ai",children:[jsxs("div",{className:"card-detail-ai-actions",children:[jsx("h3",{className:"card-detail-ai-heading",children:"AI-Powered Suggestions"}),jsxs("button",{onClick:Ie,disabled:T||!y,className:"card-detail-ai-btn",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Suggest Best Assignee"]}),jsxs("button",{onClick:Le,disabled:T||!f,className:"card-detail-ai-btn",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),"Generate Subtasks"]}),jsxs("button",{onClick:O,disabled:T||!g,className:"card-detail-ai-btn",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 6 12 12 16 14"})]}),"Estimate Effort"]})]}),F.assignees&&jsxs("div",{className:"card-detail-ai-results",children:[jsx("h4",{children:"Assignee Suggestions"}),F.assignees.map((S,q)=>{let ee=s.find($=>$.id===S.userId);return jsxs("div",{className:"card-detail-ai-suggestion",children:[ee&&jsx("div",{className:"card-detail-user-avatar",style:{background:ee.color},children:ee.initials}),jsxs("div",{children:[jsx("div",{className:"card-detail-ai-suggestion-name",children:ee?.name}),jsx("div",{className:"card-detail-ai-suggestion-reason",children:S.reasoning}),jsxs("div",{className:"card-detail-ai-suggestion-confidence",children:["Confidence: ",(S.confidence*100).toFixed(0),"%"]})]})]},q)})]}),F.subtasks&&jsxs("div",{className:"card-detail-ai-results",children:[jsx("h4",{children:"Suggested Subtasks"}),F.subtasks.map((S,q)=>jsxs("div",{className:"card-detail-ai-subtask",children:[jsx("div",{className:"card-detail-ai-subtask-title",children:S.title}),S.description&&jsx("div",{className:"card-detail-ai-subtask-desc",children:S.description}),S.estimatedTime&&jsxs("div",{className:"card-detail-ai-subtask-time",children:["Est: ",S.estimatedTime,"h"]})]},q))]}),F.effort&&jsxs("div",{className:"card-detail-ai-results",children:[jsx("h4",{children:"Effort Estimate"}),jsxs("div",{className:"card-detail-ai-effort",children:[jsxs("div",{className:"card-detail-ai-effort-hours",children:[F.effort.hours," hours"]}),jsxs("div",{className:"card-detail-ai-effort-confidence",children:["Confidence: ",(F.effort.confidence*100).toFixed(0),"%"]})]})]}),p.length>0&&jsxs("div",{className:"card-detail-ai-insights",children:[jsx("h4",{children:"AI Insights"}),p.map(S=>jsxs("div",{className:`card-detail-ai-insight card-detail-ai-insight-${S.severity.toLowerCase()}`,children:[jsxs("div",{className:"card-detail-ai-insight-header",children:[jsx("span",{className:"card-detail-ai-insight-title",children:S.title}),jsx("span",{className:"card-detail-ai-insight-severity",children:S.severity})]}),jsx("p",{className:"card-detail-ai-insight-desc",children:S.description}),S.suggestedAction&&jsxs("div",{className:"card-detail-ai-insight-action",children:["\u{1F4A1} ",S.suggestedAction]})]},S.id))]}),!F.assignees&&!F.subtasks&&!F.effort&&p.length===0&&jsxs("div",{className:"card-detail-empty-state",children:[jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",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("p",{children:"AI Suggestions"}),jsx("span",{children:"Click a button above to get AI-powered insights"})]})]})]})]})})})}function io({triggerRef:e,isOpen:t,onClose:a,children:r,width:o=200,estimatedHeight:s=300,className:l=""}){let[c,p]=useState({top:0,left:0}),n=useRef(null),m=useCallback(()=>{if(!e.current)return {top:0,left:0};let d=e.current.getBoundingClientRect(),i=window.innerHeight,u=window.innerWidth,y=4,f=d.left;f+o>u-10&&(f=u-o-10),f<10&&(f=10);let g=i-d.bottom,x=d.top,b;return g>=s+y?b=d.bottom+y:x>=s+y?b=d.top-s-y:g>=x?b=d.bottom+y:b=Math.max(10,d.top-s-y),{top:b,left:f}},[e,o,s]);return useEffect(()=>{t&&p(m());},[t,m]),useEffect(()=>{if(!t)return;let d=u=>{let y=u.target;n.current&&!n.current.contains(y)&&e.current&&!e.current.contains(y)&&a();},i=setTimeout(()=>{document.addEventListener("mousedown",d);},0);return ()=>{clearTimeout(i),document.removeEventListener("mousedown",d);}},[t,a,e]),useEffect(()=>{if(!t)return;let d=i=>{i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),a());};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[t,a]),t?jsx(tt,{children:jsx("div",{ref:n,className:`smart-popover ${l}`,style:{position:"fixed",top:`${c.top}px`,left:`${c.left}px`,width:`${o}px`,maxHeight:"calc(100vh - 40px)",overflowY:"auto",zIndex:99999,padding:"6px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.3)",animation:"popoverSlideIn 100ms ease-out"},children:r})}):null}var Ho=["#EF4444","#F97316","#F59E0B","#EAB308","#84CC16","#22C55E","#10B981","#14B8A6","#06B6D4","#0EA5E9","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899"];function Rr({selectedTags:e,availableTags:t,onChange:a,onCreateTag:r,theme:o,disabled:s=false,compact:l=true}){let[c,p]=useState(false),[n,m]=useState(""),[d,i]=useState(false),[u,y]=useState(Ho[10]||"#3B82F6"),[f,g]=useState({top:0,left:0}),x=useRef(null),b=useRef(null),h=useRef(null),w=useRef(null),D=t.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())),N=t.some(k=>k.name.toLowerCase()===n.toLowerCase());useEffect(()=>{if(c&&b.current){let k=b.current.getBoundingClientRect();g({top:k.bottom+6,left:k.left});}},[c]),useEffect(()=>{let k=F=>{let P=F.target,H=x.current?.contains(P),X=h.current?.contains(P);!H&&!X&&(p(false),m(""),i(false));};if(c)return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[c]),useEffect(()=>{c&&w.current&&w.current.focus();},[c]);let M=k=>{let F=e.some(P=>P.id===k.id);a(F?e.filter(P=>P.id!==k.id):[...e,k]);},v=async()=>{if(!(!r||!n.trim())){i(true);try{let k=await r(n.trim(),u);k&&(a([...e,k]),m(""),y(Ho[Math.floor(Math.random()*Ho.length)]||"#3B82F6"));}finally{i(false);}}},L=(k,F)=>{F.stopPropagation(),a(e.filter(P=>P.id!==k));},T={backgroundColor:`${o.textTertiary}15`,border:`1px solid ${o.borderLight}`,color:o.textSecondary};return jsxs("div",{ref:x,className:"relative",children:[jsxs("button",{ref:b,type:"button",onClick:()=>!s&&p(!c),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:T,disabled:s,children:[jsx(Tag,{className:"w-3.5 h-3.5"}),e.length>0?jsxs("div",{className:"flex items-center gap-1",children:[e.slice(0,2).map(k=>jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`${k.color}20`,color:k.color},children:k.name},k.id)),e.length>2&&jsxs("span",{className:"text-xs",style:{color:o.textTertiary},children:["+",e.length-2]})]}):jsx("span",{children:"Etiquetas"}),jsx(ChevronDown,{className:"w-3 h-3",style:{color:o.textTertiary}})]}),typeof document<"u"&&createPortal(jsx(AnimatePresence,{children:c&&jsxs(motion.div,{ref:h,initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.12},className:"rounded-lg min-w-[240px]",style:{position:"fixed",top:f.top,left:f.left,zIndex:99999,backgroundColor:o.bgPrimary,border:`1px solid ${o.border}`,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.25)"},children:[jsx("div",{className:"p-2 border-b",style:{borderColor:o.border},children:jsx("input",{ref:w,type:"text",value:n,onChange:k=>m(k.target.value),placeholder:"Buscar o crear etiqueta...",className:"w-full px-3 py-1.5 text-sm rounded-md outline-none",style:{backgroundColor:o.bgSecondary,color:o.textPrimary,border:`1px solid ${o.borderLight}`},onKeyDown:k=>{k.key==="Enter"&&n.trim()&&!N&&r&&v();}})}),e.length>0&&jsxs("div",{className:"p-2 border-b",style:{borderColor:o.border},children:[jsx("p",{className:"text-xs mb-1.5",style:{color:o.textTertiary},children:"Seleccionadas"}),jsx("div",{className:"flex flex-wrap gap-1",children:e.map(k=>jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium cursor-pointer hover:opacity-80",style:{backgroundColor:`${k.color}20`,color:k.color},onClick:F=>L(k.id,F),children:[k.name,jsx(X,{className:"w-3 h-3"})]},k.id))})]}),jsx("div",{className:"max-h-[200px] overflow-y-auto p-1",children:D.length>0?D.map(k=>{let F=e.some(P=>P.id===k.id);return jsxs("button",{type:"button",onClick:()=>M(k),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors",style:{backgroundColor:F?`${k.color}15`:"transparent",color:o.textPrimary},onMouseEnter:P=>{F||(P.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:P=>{F||(P.currentTarget.style.backgroundColor="transparent");},children:[jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:k.color}}),jsx("span",{className:"flex-1 text-left",children:k.name}),F&&jsx(Check,{className:"w-4 h-4",style:{color:k.color}})]},k.id)}):n.trim()?jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No se encontraron etiquetas"}):jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No hay etiquetas disponibles"})}),n.trim()&&!N&&r&&jsxs("div",{className:"p-2 border-t",style:{borderColor:o.border},children:[jsx("div",{className:"flex items-center gap-2 mb-2",children:jsx("p",{className:"text-xs",style:{color:o.textTertiary},children:"Crear nueva etiqueta"})}),jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Ho.map(k=>jsx("button",{type:"button",onClick:()=>y(k),className:"w-5 h-5 rounded-full transition-transform hover:scale-110",style:{backgroundColor:k,outline:u===k?`2px solid ${k}`:"none",outlineOffset:"2px"}},k))}),jsxs("button",{type:"button",onClick:v,disabled:d,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-colors",style:{backgroundColor:u,color:"#FFFFFF",opacity:d?.7:1},children:[d?jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):jsx(Plus,{className:"w-4 h-4"}),'Crear "',n.trim(),'"']})]})]})}),document.body)]})}function rs({tag:e,onRemove:t,size:a="sm"}){return jsxs("span",{className:`inline-flex items-center gap-1 rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:`${e.color}20`,color:e.color},children:[e.name,t&&jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t();},className:"hover:opacity-70",children:jsx(X,{className:"w-3 h-3"})})]})}function Al({tags:e,maxVisible:t=3,size:a="sm"}){if(!e||e.length===0)return null;let r=e.slice(0,t),o=e.length-t;return jsxs("div",{className:"flex flex-wrap gap-1",children:[r.map(s=>jsx(rs,{tag:s,size:a},s.id)),o>0&&jsxs("span",{className:`inline-flex items-center rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:"rgba(100,100,100,0.2)",color:"#9CA3AF"},children:["+",o]})]})}var Ge={dark:{bgPrimary:"#1A1D21",bgSecondary:"#22262D",bgGrid:"#1E2126",bgWeekend:"rgba(59, 130, 246, 0.03)",border:"#334155",borderLight:"#2D3139",textPrimary:"#FFFFFF",textSecondary:"#CBD5E1",textTertiary:"#64748B",accent:"#3B82F6",accentHover:"#60A5FA",accentLight:"rgba(59, 130, 246, 0.12)",taskBarPrimary:"#3B82F6",taskBarProgress:"#2563EB",taskBarHandle:"#FFFFFF",dependency:"rgba(180, 185, 197, 0.25)",dependencyHover:"rgba(180, 185, 197, 0.45)",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.12)",today:"#EF4444",todayLight:"rgba(239, 68, 68, 0.12)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.1)",statusTodo:"#64748B",statusInProgress:"#3B82F6",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.06)",focusRing:"#3B82F6"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(37, 99, 235, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#2563EB",accentHover:"#1D4ED8",accentLight:"rgba(37, 99, 235, 0.08)",taskBarPrimary:"#2563EB",taskBarProgress:"#1E40AF",taskBarHandle:"#FFFFFF",dependency:"rgba(75, 85, 99, 0.25)",dependencyHover:"rgba(75, 85, 99, 0.45)",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#DC2626",todayLight:"rgba(220, 38, 38, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#2563EB",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#2563EB"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"rgba(87, 83, 78, 0.25)",dependencyHover:"rgba(87, 83, 78, 0.4)",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524"}};var Em=["LOW","MEDIUM","HIGH","URGENT"],Pm=["todo","in-progress","review","done"];function ns({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:o,availableUsers:s=[],comments:l=[],activities:c=[],onAddComment:p,onDeleteComment:n,currentUser:m,onAIGenerateDescription:d,onAICreateSubtasks:i,onAIFindSimilar:u,availableColumns:y=[],availableLabels:f=[],availableTags:g=[],onCreateTag:x,onUploadCoverImage:b,unsplashAccessKey:h,theme:w,onSubtasksChange:D,attachments:N=[],onUploadAttachments:M,onDeleteAttachment:v}){let L=Mr(),T=w||L?.themeName||"dark",[k,F]=useState(e),[P,H]=useState(false),[X,ye]=useState(e?.subtasks||[]),[we,Ie]=useState(false),[Le,O]=useState(""),[B,W]=useState(""),[S,q]=useState("all"),[ee,$]=useState(false),[Me,be]=useState(false),[qe,ue]=useState(false),[Qe,Te]=useState(false),[rt,gt]=useState(false),[ft,et]=useState(false),R=useRef(null),se=useRef(null),ve=useRef(null),De=useRef(null),Ee=useRef(null),Ve=useRef(null),Ct=useRef(null),Y=useRef(null),z=useRef(null),ke=useRef(null),We=useRef(null),Ue=useRef(null);useEffect(()=>{e&&!k?(F({...e}),ye(e.subtasks||[])):e&&k&&e.id!==k.id&&(F({...e}),ye(e.subtasks||[]));},[e,k]),useEffect(()=>{let U=ce=>{let Ce=ce.target;De.current&&!De.current.contains(Ce)&&$(false),Ee.current&&!Ee.current.contains(Ce)&&be(false),Ve.current&&!Ve.current.contains(Ce)&&ue(false),Ct.current&&!Ct.current.contains(Ce)&&Te(false);};if(ee||Me||qe||Qe)return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[ee,Me,qe,Qe]),useEffect(()=>{if(!t)return;let U=ce=>{let Ce=ce.target,zt=Ce.tagName==="INPUT"||Ce.tagName==="TEXTAREA"||Ce.isContentEditable;if(ce.key==="Escape"){ce.preventDefault(),ee||Me||qe||Qe||rt||ft?($(false),be(false),ue(false),Te(false),gt(false),et(false)):zt||a();return}if(zt&&ce.key!=="Escape")return;let ea=ce.metaKey||ce.ctrlKey;switch(ce.key.toLowerCase()){case "s":ce.preventDefault(),$(true);break;case "a":ce.preventDefault(),ue(true);break;case "p":ce.preventDefault(),be(true);break;case "l":ce.preventDefault(),Te(true);break;case "d":ea||(ce.preventDefault(),gt(true),setTimeout(()=>Y.current?.focus(),0));break;case "e":ea||(ce.preventDefault(),et(true));break;case "i":ce.preventDefault(),H(true),setTimeout(()=>se.current?.focus(),0);break;case "t":ce.preventDefault(),Ie(true);break;case "c":ce.preventDefault(),ve.current?.focus();break}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[t,a,ee,Me,qe,Qe,rt,ft]);let ht=useCallback(U=>{let ce=U.currentTarget.textContent?.trim()||"";if(k&&ce!==k.title){let Ce={...k,title:ce};F(Ce),r?.(k.id,{title:ce});}},[k,r]),Z=useCallback(U=>{U.key==="Enter"&&(U.preventDefault(),U.currentTarget.blur()),U.key==="Escape"&&(U.preventDefault(),U.currentTarget.textContent=k?.title||"",U.currentTarget.blur());},[k]),te=useCallback(()=>{k&&e&&k.description!==e.description&&r?.(k.id,{description:k.description}),H(false);},[k,e,r]),xe=useCallback(U=>{if(k){let ce={...k,columnId:U};F(ce),r?.(k.id,{columnId:U}),$(false);}},[k,r]),Pe=useCallback(U=>{if(k){let ce={...k,priority:U};F(ce),r?.(k.id,{priority:U}),be(false);}},[k,r]),J=useCallback(U=>{if(k){let ce=k.assignedUserIds||[],Ce=ce.includes(U)?ce.filter(ea=>ea!==U):[...ce,U],zt={...k,assignedUserIds:Ce};F(zt),r?.(k.id,{assignedUserIds:Ce});}},[k,r]),Ae=useCallback(U=>{if(k){let ce=k.labels||[],Ce=ce.includes(U)?ce.filter(ea=>ea!==U):[...ce,U],zt={...k,labels:Ce};F(zt),r?.(k.id,{labels:Ce});}},[k,r]),he=useCallback(U=>{if(k){let ce={...k,tags:U};F(ce),r?.(k.id,{tags:U});}},[k,r]),Ne=useCallback(U=>{if(k){let ce=U.target.value,Ce={...k,endDate:ce};F(Ce),r?.(k.id,{endDate:ce}),gt(false);}},[k,r]),de=useCallback(U=>{if(k){let ce={...k,estimatedTime:parseFloat(U)||0};F(ce),r?.(k.id,{estimatedTime:parseFloat(U)||0});}},[k,r]),Re=useCallback(()=>{if(Le.trim()&&k){let U={id:`subtask-${Date.now()}`,title:Le.trim(),completed:false,createdAt:new Date},ce=[...X,U];ye(ce),O(""),Ie(false),D?.(k.id,ce);}},[Le,X,k,D]),Fe=useCallback(U=>{let ce=X.map(Ce=>Ce.id===U?{...Ce,completed:!Ce.completed,updatedAt:new Date}:Ce);ye(ce),k&&D?.(k.id,ce);},[X,k,D]),Oe=useCallback(U=>{let ce=X.filter(Ce=>Ce.id!==U);ye(ce),k&&D?.(k.id,ce);},[X,k,D]),_=useCallback(()=>{B.trim()&&k&&p&&(p(k.id,B.trim()),W(""));},[B,k,p]),j=useCallback(U=>{(U.metaKey||U.ctrlKey)&&U.key==="Enter"&&(U.preventDefault(),_());},[_]),nt=U=>jsx(Dm,{remarkPlugins:[Nm],rehypePlugins:[Sm],components:{a:({node:ce,...Ce})=>jsx("a",{...Ce,target:"_blank",rel:"noopener noreferrer"})},children:U}),He=c.filter(U=>S==="comments"?U.type.includes("COMMENT"):S==="history"?!U.type.includes("COMMENT"):true);if(!t||!e)return null;let ge=k||e,Vt=s.filter(U=>ge.assignedUserIds?.includes(U.id)),Tt=X.filter(U=>U.completed).length;return jsx(tt,{children:jsx("div",{className:"modal-v2-backdrop",onClick:a,style:{position:"fixed",inset:"0",zIndex:9999,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxs("div",{className:"modal-v2-container",onClick:U=>U.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"modal-title","data-theme":T,children:[jsxs("header",{className:"modal-v2-header",children:[jsx("h1",{id:"modal-title",ref:R,className:"modal-v2-title",contentEditable:true,suppressContentEditableWarning:true,onBlur:ht,onKeyDown:Z,children:ge.title}),jsxs("p",{className:"modal-v2-ai-prompt",children:[jsx("span",{className:"modal-v2-ai-icon",children:"\u2728"}),"Ask AI to write a description, create subtasks, or find similar tasks"]}),jsx("button",{className:"modal-v2-close",onClick:a,"aria-label":"Close",children:jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxs("section",{className:"modal-v2-metadata",children:[jsxs("div",{className:"modal-v2-field-wrapper",ref:De,children:[jsxs("button",{ref:z,className:"modal-v2-field",onClick:()=>$(!ee),children:[jsxs("div",{className:"modal-v2-field-label",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("path",{d:"M12 6v6l4 2"})]}),jsx("span",{children:"Status"}),jsx("kbd",{className:"modal-v2-shortcut",children:"S"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.columnId||"No status"})]}),jsx(io,{triggerRef:z,isOpen:ee,onClose:()=>$(false),width:250,estimatedHeight:200,children:(y.length>0?y:Pm.map(U=>({id:U,title:U}))).map(U=>jsx("button",{className:`modal-v2-popover-item ${ge.columnId===U.id?"active":""}`,onClick:()=>xe(U.id),children:U.title},U.id))})]}),jsxs("div",{className:"modal-v2-field-wrapper",ref:Ve,children:[jsxs("button",{ref:ke,className:"modal-v2-field",onClick:()=>ue(!qe),children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsx("span",{children:"Assignees"}),jsx("kbd",{className:"modal-v2-shortcut",children:"A"})]}),jsx("div",{className:"modal-v2-field-value",children:Vt.length>0?jsx("div",{className:"modal-v2-avatars",children:Vt.map(U=>jsx("div",{className:"modal-v2-avatar",style:{background:U.color},title:U.name,children:U.initials},U.id))}):jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsx(io,{triggerRef:ke,isOpen:qe,onClose:()=>ue(false),width:280,estimatedHeight:300,children:s.map(U=>jsxs("button",{className:`modal-v2-popover-item ${ge.assignedUserIds?.includes(U.id)?"active":""}`,onClick:()=>J(U.id),children:[jsx("div",{className:"modal-v2-avatar-small",style:{background:U.color},children:U.initials}),U.name,ge.assignedUserIds?.includes(U.id)&&jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},U.id))})]}),jsxs("div",{className:"modal-v2-field-wrapper",ref:Ee,children:[jsxs("button",{ref:We,className:"modal-v2-field",onClick:()=>be(!Me),children:[jsxs("div",{className:"modal-v2-field-label",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:"Priority"}),jsx("kbd",{className:"modal-v2-shortcut",children:"P"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.priority||"None"})]}),jsxs(io,{triggerRef:We,isOpen:Me,onClose:()=>be(false),width:180,estimatedHeight:220,children:[Em.map(U=>jsx("button",{className:`modal-v2-popover-item priority-${U.toLowerCase()} ${ge.priority===U?"active":""}`,onClick:()=>Pe(U),children:U},U)),jsx("button",{className:"modal-v2-popover-item",onClick:()=>Pe(""),children:"None"})]})]}),g.length>0||x?jsx("div",{className:"modal-v2-field-wrapper",children:jsxs("div",{className:"modal-v2-field",style:{cursor:"default"},children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsx("span",{children:"Etiquetas"})]}),jsx("div",{className:"modal-v2-field-value",children:jsx(Rr,{selectedTags:ge.tags||[],availableTags:g,onChange:he,onCreateTag:x,theme:Ge[T]||Ge.dark})})]})}):jsxs("div",{className:"modal-v2-field-wrapper",ref:Ct,children:[jsxs("button",{ref:Ue,className:"modal-v2-field",onClick:()=>Te(!Qe),children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsx("span",{children:"Labels"}),jsx("kbd",{className:"modal-v2-shortcut",children:"L"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.labels&&ge.labels.length>0?jsx("span",{children:ge.labels.join(", ")}):jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsx(io,{triggerRef:Ue,isOpen:Qe,onClose:()=>Te(false),width:220,estimatedHeight:200,children:(f.length>0?f:["Bug","Feature","Enhancement","Documentation"]).map(U=>jsxs("button",{className:`modal-v2-popover-item ${ge.labels?.includes(U)?"active":""}`,onClick:()=>Ae(U),children:[U,ge.labels?.includes(U)&&jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},U))})]}),jsxs("button",{className:"modal-v2-field",onClick:()=>{gt(!rt),setTimeout(()=>Y.current?.showPicker?.(),0);},children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),jsx("span",{children:"Due Date"}),jsx("kbd",{className:"modal-v2-shortcut",children:"D"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.endDate?new Date(ge.endDate).toLocaleDateString():"Not set"}),jsx("input",{ref:Y,type:"date",value:typeof ge.endDate=="string"?ge.endDate.split("T")[0]:ge.endDate?(()=>{let U=new Date(ge.endDate),ce=U.getUTCFullYear(),Ce=String(U.getUTCMonth()+1).padStart(2,"0"),zt=String(U.getUTCDate()).padStart(2,"0");return `${ce}-${Ce}-${zt}`})():"",onChange:Ne,style:{position:"absolute",opacity:0,pointerEvents:"none"}})]}),jsxs("div",{className:"modal-v2-field-wrapper",children:[jsxs("button",{className:"modal-v2-field",onClick:()=>et(!ft),children:[jsxs("div",{className:"modal-v2-field-label",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 6 12 12 16 14"})]}),jsx("span",{children:"Estimated Time"}),jsx("kbd",{className:"modal-v2-shortcut",children:"E"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.estimatedTime?`${ge.estimatedTime}h`:"Not set"})]}),ft&&jsx("div",{className:"modal-v2-popover",children:jsx("input",{type:"number",min:"0",step:"0.5",placeholder:"Hours",value:ge.estimatedTime||"",onChange:U=>de(U.target.value),className:"modal-v2-time-input",autoFocus:true,onBlur:()=>et(false)})})]})]}),jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsx("polyline",{points:"10 9 9 9 8 9"})]}),jsx("h2",{children:"Description"})]}),P?jsx("textarea",{className:"modal-v2-textarea",value:ge.description||"",onChange:U=>{if(k){let ce={...k,description:U.target.value};F(ce);}},onBlur:te,placeholder:"Add a detailed description...",autoFocus:true}):jsx("div",{className:"modal-v2-content",onClick:()=>H(true),children:ge.description?jsx("div",{className:"modal-v2-markdown",children:nt(ge.description)}):jsxs("p",{className:"modal-v2-placeholder",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Add description..."]})})]}),jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M9 11l3 3L22 4"}),jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),jsx("h2",{children:"Subtasks"}),X.length>0&&jsxs("span",{className:"modal-v2-count",children:[Tt,"/",X.length]}),jsxs("button",{className:"modal-v2-add-button",onClick:()=>Ie(true),children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add"]})]}),jsxs("div",{className:"modal-v2-subtasks",children:[X.map(U=>jsxs("div",{className:`modal-v2-subtask ${U.completed?"completed":""}`,children:[jsx("button",{className:"modal-v2-subtask-checkbox",onClick:()=>Fe(U.id),children:U.completed?jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("path",{d:"M9 12l2 2 4-4",stroke:"white",strokeWidth:"2",fill:"none"})]}):jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("circle",{cx:"12",cy:"12",r:"10"})})}),jsx("span",{className:"modal-v2-subtask-title",children:U.title}),jsx("button",{className:"modal-v2-subtask-delete",onClick:()=>Oe(U.id),children:jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]},U.id)),we&&jsx("div",{className:"modal-v2-subtask-input-row",children:jsx("input",{type:"text",placeholder:"Subtask title...",value:Le,onChange:U=>O(U.target.value),onKeyDown:U=>{U.key==="Enter"&&Re(),U.key==="Escape"&&(Ie(false),O(""));},onBlur:Re,autoFocus:true,className:"modal-v2-subtask-input"})})]})]}),(M||N.length>0)&&jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),jsx("h2",{children:"Attachments"}),N.length>0&&jsx("span",{className:"modal-v2-count",children:N.length})]}),jsx(za,{cardId:ge.id,attachments:N,onUpload:M?U=>M(ge.id,U):void 0,onDelete:v,maxSizeMB:10,maxFiles:20})]}),jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsx("h2",{children:"Activity"}),jsxs("div",{className:"modal-v2-filters",children:[jsx("button",{className:`modal-v2-filter ${S==="all"?"active":""}`,onClick:()=>q("all"),children:"All"}),jsx("button",{className:`modal-v2-filter ${S==="comments"?"active":""}`,onClick:()=>q("comments"),children:"Comments"}),jsx("button",{className:`modal-v2-filter ${S==="history"?"active":""}`,onClick:()=>q("history"),children:"History"})]})]}),jsxs("div",{className:"modal-v2-comment-input",children:[m&&jsx("div",{className:"modal-v2-avatar",style:{background:m.color},children:m.initials}),jsxs("div",{className:"modal-v2-comment-wrapper",children:[jsx("textarea",{ref:ve,className:"modal-v2-comment-textarea",placeholder:"Write a comment...",value:B,onChange:U=>W(U.target.value),onKeyDown:j,rows:1}),jsxs("div",{className:"modal-v2-comment-toolbar",children:[jsxs("div",{className:"modal-v2-toolbar-left",children:[jsx("button",{className:"modal-v2-toolbar-button",title:"Attach file",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})})}),jsx("button",{className:"modal-v2-toolbar-button",title:"Mention user",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:"4"}),jsx("path",{d:"M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94"})]})}),jsx("button",{className:"modal-v2-toolbar-button",title:"Add emoji",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("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})})]}),jsx("button",{className:"modal-v2-send-button",onClick:_,disabled:!B.trim(),children:"Send"})]})]})]}),jsxs("div",{className:"modal-v2-timeline",children:[He.map(U=>{let ce=s.find(zt=>zt.id===U.userId);if(U.type.includes("COMMENT")){let zt=l.find(ea=>ea.id===U.metadata?.commentId);return zt?jsxs("div",{className:"modal-v2-activity-item comment-item",children:[ce&&jsx("div",{className:"modal-v2-avatar",style:{background:ce.color},children:ce.initials}),jsxs("div",{className:"modal-v2-activity-content",children:[jsxs("div",{className:"modal-v2-activity-header",children:[jsx("span",{className:"modal-v2-activity-user",children:ce?.name||"Unknown"}),jsx("span",{className:"modal-v2-activity-time",children:new Date(U.timestamp).toLocaleString()})]}),jsx("div",{className:"modal-v2-comment-body",children:zt.content})]})]},U.id):null}return jsxs("div",{className:"modal-v2-activity-item history-item",children:[jsxs("div",{className:"modal-v2-history-icon",children:[U.type.includes("CREATED")&&"\u2795",U.type.includes("UPDATED")&&"\u270F\uFE0F",U.type.includes("MOVED")&&"\u27A1\uFE0F",U.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",U.type.includes("ASSIGNED")&&"\u{1F464}",U.type.includes("PRIORITY")&&"\u{1F3AF}",U.type.includes("LABEL")&&"\u{1F3F7}\uFE0F"]}),jsxs("div",{className:"modal-v2-activity-content",children:[jsxs("div",{className:"modal-v2-history-text",children:[jsx("span",{className:"modal-v2-activity-user",children:ce?.name||"Unknown"})," ",U.type.replace(/_/g," ").toLowerCase(),U.newValue&&jsxs(Fragment,{children:[" to ",jsx("strong",{children:U.newValue})]})]}),jsx("span",{className:"modal-v2-activity-time",children:new Date(U.timestamp).toLocaleString()})]})]},U.id)}),He.length===0&&jsxs("div",{className:"modal-v2-empty",children:[jsx("p",{children:"No activity yet"}),jsx("span",{children:"Activity will appear here"})]})]})]})]})})})}function zm({active:e,payload:t}){return !e||!t||!t.length?null:jsxs("div",{className:"chart-tooltip",children:[jsx("p",{className:"chart-tooltip-label",children:t[0].payload.period}),t.map((a,r)=>jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsx("strong",{children:a.value})," cards"]},r))]})}function is({data:e,title:t="Team Velocity",height:a=300,showAverage:r=true,showPlanned:o=true}){let s=e.map(l=>({...l,average:l.average??e.reduce((c,p)=>c+p.completed,0)/e.length}));return jsxs("div",{className:"chart-container",children:[t&&jsx("h3",{className:"chart-title",children:t}),jsx(ResponsiveContainer,{width:"100%",height:a,children:jsxs(LineChart,{data:s,margin:{top:5,right:30,left:20,bottom:5},children:[jsx(CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsx(XAxis,{dataKey:"period",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(Tooltip,{content:jsx(zm,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsx(Line,{type:"monotone",dataKey:"completed",stroke:"#10B981",strokeWidth:3,name:"Completed",dot:{fill:"#10B981",r:5},activeDot:{r:7}}),o&&jsx(Line,{type:"monotone",dataKey:"planned",stroke:"#3B82F6",strokeWidth:2,strokeDasharray:"5 5",name:"Planned",dot:{fill:"#3B82F6",r:4}}),r&&jsx(Line,{type:"monotone",dataKey:"average",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"3 3",name:"Average",dot:false})]})}),jsxs("div",{className:"chart-stats",children:[jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Total Completed"}),jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.reduce((l,c)=>l+c.completed,0)})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Average Velocity"}),jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:(e.reduce((l,c)=>l+c.completed,0)/e.length).toFixed(1)})]}),o&&e.some(l=>l.planned)&&jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Total Planned"}),jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:e.reduce((l,c)=>l+(c.planned||0),0)})]})]})]})}function Km({active:e,payload:t}){return !e||!t||!t.length?null:jsxs("div",{className:"chart-tooltip",children:[jsx("p",{className:"chart-tooltip-label",children:t[0].payload.day}),t.map((a,r)=>jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsx("strong",{children:a.value})," tasks"]},r))]})}function ls({data:e,title:t="Sprint Burndown",height:a=300,totalTasks:r,useArea:o=false}){let s=r??(e[0]?.ideal||e[0]?.remaining||0),l=e[e.length-1]?.remaining||0,c=e[e.length-1]?.ideal||0,p=s>0?(s-l)/s*100:0,n=l<=c;return jsxs("div",{className:"chart-container",children:[t&&jsx("h3",{className:"chart-title",children:t}),jsx(ResponsiveContainer,{width:"100%",height:a,children:jsxs(o?AreaChart:LineChart,{data:e,margin:{top:5,right:30,left:20,bottom:5},children:[jsx(CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsx(XAxis,{dataKey:"day",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(Tooltip,{content:jsx(Km,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),o?jsxs(Fragment,{children:[jsx(Area,{type:"monotone",dataKey:"ideal",stroke:"#F59E0B",fill:"rgba(245, 158, 11, 0.2)",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal"}),jsx(Area,{type:"monotone",dataKey:"remaining",stroke:n?"#10B981":"#EF4444",fill:n?"rgba(16, 185, 129, 0.2)":"rgba(239, 68, 68, 0.2)",strokeWidth:3,name:"Remaining"})]}):jsxs(Fragment,{children:[jsx(Line,{type:"linear",dataKey:"ideal",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal",dot:{fill:"#F59E0B",r:4}}),jsx(Line,{type:"monotone",dataKey:"remaining",stroke:n?"#10B981":"#EF4444",strokeWidth:3,name:"Remaining",dot:{fill:n?"#10B981":"#EF4444",r:5},activeDot:{r:7}})]})]})}),jsxs("div",{className:"chart-stats",children:[jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Progress"}),jsxs("span",{className:"chart-stat-value",style:{color:p>=50?"#10B981":"#F59E0B"},children:[p.toFixed(0),"%"]})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Remaining"}),jsx("span",{className:"chart-stat-value",style:{color:n?"#10B981":"#EF4444"},children:l})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Status"}),jsx("span",{className:"chart-stat-badge",style:{background:n?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:n?"#10B981":"#EF4444"},children:n?"\u2713 On Track":"\u26A0 Behind"})]})]})]})}var au={URGENT:"#EF4444",HIGH:"#F59E0B",MEDIUM:"#3B82F6",LOW:"#10B981"},zl=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"];function ru({cx:e,cy:t,midAngle:a,innerRadius:r,outerRadius:o,percent:s}){let l=r+(o-r)*.5,c=e+l*Math.cos(-a*(Math.PI/180)),p=t+l*Math.sin(-a*(Math.PI/180));return s<.05?null:jsx("text",{x:c,y:p,fill:"white",textAnchor:c>e?"start":"end",dominantBaseline:"central",style:{fontSize:"12px",fontWeight:600},children:`${(s*100).toFixed(0)}%`})}function $l({active:e,payload:t}){if(!e||!t||!t.length)return null;let a=t[0].payload,r=t[0].payload.totalValue||0,o=r>0?(a.value/r*100).toFixed(1):"0";return jsxs("div",{className:"chart-tooltip",children:[jsx("p",{className:"chart-tooltip-label",children:a.name}),jsxs("p",{className:"chart-tooltip-value",style:{color:a.color||t[0].color},children:["Count: ",jsx("strong",{children:a.value})]}),jsxs("p",{className:"chart-tooltip-value",style:{color:"rgba(255, 255, 255, 0.7)"},children:["Percentage: ",jsxs("strong",{children:[o,"%"]})]})]})}function ds({data:e,title:t="Distribution",type:a="pie",height:r=300,showPercentages:o=true}){let s=e.reduce((p,n)=>p+n.value,0),l=e.map(p=>({...p,totalValue:s,color:p.color||au[p.name]||zl[e.indexOf(p)%zl.length]})),c=l.map(p=>p.color);return jsxs("div",{className:"chart-container",children:[t&&jsx("h3",{className:"chart-title",children:t}),jsx(ResponsiveContainer,{width:"100%",height:r,children:a==="pie"?jsxs(PieChart,{children:[jsx(Pie,{data:l,cx:"50%",cy:"50%",labelLine:false,label:o?ru:false,outerRadius:r*.35,fill:"#8884d8",dataKey:"value",children:l.map((p,n)=>jsx(Cell,{fill:c[n]},`cell-${n}`))}),jsx(Tooltip,{content:jsx($l,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"},formatter:(p,n)=>{let m=n.payload,d=s>0?(m.value/s*100).toFixed(0):"0";return `${p} (${m.value} - ${d}%)`}})]}):jsxs(BarChart,{data:l,margin:{top:5,right:30,left:20,bottom:5},children:[jsx(CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsx(XAxis,{dataKey:"name",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(Tooltip,{content:jsx($l,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsx(Bar,{dataKey:"value",name:"Count",radius:[8,8,0,0],children:l.map((p,n)=>jsx(Cell,{fill:c[n]},`cell-${n}`))})]})}),jsxs("div",{className:"chart-stats",children:[jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Total Cards"}),jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:s})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Categories"}),jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.length})]}),e.length>0&&jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Largest Category"}),jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:e.reduce((p,n)=>n.value>p.value?n:p).name})]})]})]})}var _o=memo(({selectedCards:e,availableUsers:t=[],onClearSelection:a,callbacks:r,columns:o=[],availableLabels:s=[]})=>{let[l,c]=useState(false),[p,n]=useState(false),[m,d]=useState(false),[i,u]=useState(false);if(e.length===0)return null;let y=e.map(w=>w.id),f=w=>{r.onBulkUpdate?.(y,{priority:w}),c(false);},g=w=>{r.onBulkMove?.(y,w),n(false),a();},x=w=>{r.onBulkUpdate?.(y,{assignedUserIds:w}),d(false);},b=w=>{let D=new Set;e.forEach(M=>{M.labels?.forEach(v=>D.add(v));});let N=Array.from(new Set([...D,...w]));r.onBulkUpdate?.(y,{labels:N}),u(false);},h=()=>{confirm(`Delete ${e.length} card(s)? This cannot be undone.`)&&(r.onBulkDelete?.(y),a());};return jsx("div",{className:"asakaa-bulk-toolbar",children:jsxs("div",{className:"asakaa-bulk-toolbar-content",children:[jsxs("div",{className:"asakaa-bulk-toolbar-count",children:[e.length," card",e.length!==1?"s":""," selected"]}),jsxs("div",{className:"asakaa-bulk-toolbar-actions",children:[jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>c(!l),title:"Update priority",children:jsx("span",{className:"text-sm",children:"Priority"})}),l&&jsx("div",{className:"asakaa-bulk-menu",children:["LOW","MEDIUM","HIGH","URGENT"].map(w=>jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>f(w),children:[jsx("span",{className:C("asakaa-priority-dot",w==="LOW"&&"bg-asakaa-priority-low",w==="MEDIUM"&&"bg-asakaa-priority-medium",w==="HIGH"&&"bg-asakaa-priority-high",w==="URGENT"&&"bg-asakaa-priority-urgent")}),w]},w))})]}),o.length>0&&jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>n(!p),title:"Move to column",children:jsx("span",{className:"text-sm",children:"Move"})}),p&&jsx("div",{className:"asakaa-bulk-menu",children:o.map(w=>jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>g(w.id),children:w.title},w.id))})]}),t.length>0&&jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>d(!m),title:"Assign users",children:jsx("span",{className:"text-sm",children:"Assign"})}),m&&jsx("div",{className:"asakaa-bulk-menu",children:t.map(w=>jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>x([w.id]),children:[jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:w.color},children:w.initials}),w.name]},w.id))})]}),s.length>0&&jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>u(!i),title:"Add labels",children:jsx("span",{className:"text-sm",children:"Labels"})}),i&&jsx("div",{className:"asakaa-bulk-menu",children:s.map(w=>jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>b([w]),children:w},w))})]}),jsx("button",{className:"asakaa-bulk-toolbar-button asakaa-bulk-toolbar-button-danger",onClick:h,title:"Delete selected cards",children:jsx("span",{className:"text-sm",children:"Delete"})}),jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:a,title:"Clear selection",children:jsx("span",{className:"text-sm",children:"\u2715"})})]})]})})});_o.displayName="BulkOperationsToolbar";function lu(e,t,a){if(t==="none")return [];let r=new Map;return e.forEach(o=>{let s,l,c,p,n;switch(t){case "assignee":let m=o.assignedUserIds||(o.assigneeId?[o.assigneeId]:[]);m.length>0?m.forEach(u=>{let y=a?.find(f=>f.id===u);l=`assignee-${u}`,c=y?.name||`User ${u}`,p=y?.color,n=y?.avatar,r.has(l)||r.set(l,{id:l,title:c,groupValue:u,cardIds:[],color:p,icon:n}),r.get(l).cardIds.push(o.id);}):(l="assignee-unassigned",c="Unassigned",p="#6b7280",n="\u{1F464}",r.has(l)||r.set(l,{id:l,title:c,groupValue:null,cardIds:[],color:p,icon:n}),r.get(l).cardIds.push(o.id));break;case "priority":s=o.priority||"NONE",l=`priority-${s}`;let i={URGENT:{title:"\u{1F534} Urgent",color:"#ef4444"},HIGH:{title:"\u{1F7E0} High",color:"#f97316"},MEDIUM:{title:"\u{1F7E1} Medium",color:"#eab308"},LOW:{title:"\u{1F7E2} Low",color:"#22c55e"},NONE:{title:"\u26AA No Priority",color:"#6b7280"}}[s];c=i.title,p=i.color,r.has(l)||r.set(l,{id:l,title:c,groupValue:s,cardIds:[],color:p}),r.get(l).cardIds.push(o.id);break;case "label":o.labels&&o.labels.length>0?o.labels.forEach(u=>{l=`label-${u}`,c=u,p="#6b7280",r.has(l)||r.set(l,{id:l,title:c,groupValue:u,cardIds:[],color:p}),r.get(l).cardIds.push(o.id);}):(l="label-none",c="No Labels",p="#6b7280",r.has(l)||r.set(l,{id:l,title:c,groupValue:null,cardIds:[],color:p}),r.get(l).cardIds.push(o.id));break}}),Array.from(r.values()).sort((o,s)=>o.title.localeCompare(s.title))}function cs({board:e,swimlaneConfig:t,availableUsers:a,callbacks:r,className:o}){let[s,l]=useState(new Set),c=useMemo(()=>lu(e.cards,t.groupBy,a),[e.cards,t.groupBy,a]),p=useCallback(n=>{l(m=>{let d=new Set(m);return d.has(n)?d.delete(n):d.add(n),d});},[]);return t.groupBy==="none"||c.length===0?jsx(Qa,{board:e,callbacks:r,availableUsers:a,className:o}):jsxs("div",{className:C("asakaa-swimlane-view",o),children:[c.map(n=>{let m=s.has(n.id),d=e.cards.filter(u=>n.cardIds.includes(u.id)),i={...e,cards:d};return jsxs("div",{className:"asakaa-swimlane mb-6 rounded-lg border border-white/10 overflow-hidden",children:[jsxs("div",{className:"asakaa-swimlane-header px-4 py-3 bg-white/5 backdrop-blur-sm flex items-center justify-between cursor-pointer hover:bg-white/10 transition-colors",onClick:()=>t.collapsible&&p(n.id),style:{borderLeft:n.color?`4px solid ${n.color}`:void 0},children:[jsxs("div",{className:"flex items-center gap-3",children:[n.icon&&jsx("span",{className:"text-2xl leading-none",children:n.icon}),jsx("h3",{className:"text-lg font-semibold",style:{color:n.color},children:n.title}),jsxs("span",{className:"text-sm text-white/50 font-medium",children:["(",n.cardIds.length," ",n.cardIds.length===1?"card":"cards",")"]})]}),t.collapsible&&jsx("button",{className:"text-white/50 hover:text-white transition-colors","aria-label":m?"Expand lane":"Collapse lane",children:m?"\u25B6":"\u25BC"})]}),!m&&jsx("div",{className:"asakaa-swimlane-content p-4",children:jsx(Qa,{board:i,callbacks:r,availableUsers:a})})]},n.id)}),c.length===0&&jsxs("div",{className:"text-center py-12 text-white/50",children:[jsx("p",{className:"text-lg",children:"No cards to display"}),jsx("p",{className:"text-sm mt-2",children:"Cards will appear here when they match the grouping criteria"})]})]})}var ps=[{value:"none",label:"No Grouping",icon:"\u{1F4CB}",description:"Standard Kanban board view"},{value:"assignee",label:"By Assignee",icon:"\u{1F465}",description:"Group cards by assigned user"},{value:"priority",label:"By Priority",icon:"\u{1F3AF}",description:"Group cards by priority level"},{value:"label",label:"By Label",icon:"\u{1F3F7}\uFE0F",description:"Group cards by label/tag"}];function ms({value:e,onChange:t,className:a}){let[r,o]=useState(false),s=useRef(null),l=useRef(null),c=ps.find(n=>n.value===e)||ps[0];useEffect(()=>{function n(m){s.current&&!s.current.contains(m.target)&&l.current&&!l.current.contains(m.target)&&o(false);}if(r)return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[r]);let p=n=>{t(n),o(false);};return jsxs("div",{className:C("relative inline-block",a),children:[jsxs("button",{ref:l,onClick:()=>o(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-white/10 hover:bg-white/15 border border-white/20 transition-all text-sm font-medium text-white/90",children:[jsx("span",{className:"text-base leading-none",children:c.icon}),jsx("span",{children:c.label}),jsx("svg",{className:C("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[280px] rounded-lg bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl border border-white/20 shadow-2xl z-50 overflow-hidden",children:[jsx("div",{className:"px-3 py-2 border-b border-white/10",children:jsx("span",{className:"text-[10px] font-bold text-white/70 uppercase tracking-wider",children:"Group By"})}),jsx("div",{className:"py-1",children:ps.map(n=>jsxs("button",{onClick:()=>p(n.value),className:C("w-full px-3 py-2 flex items-start gap-3 text-left transition-all hover:bg-white/10",e===n.value&&"bg-white/5"),children:[jsx("span",{className:"text-xl leading-none mt-0.5",children:n.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"font-semibold text-sm text-white",children:n.label}),e===n.value&&jsx("span",{className:"text-blue-400 text-xs",children:"\u2713"})]}),jsx("p",{className:"text-xs text-white/60 mt-0.5",children:n.description})]})]},n.value))})]})]})}var co=[{keys:"ArrowUp",action:"navigate_up",description:"Navigate to card above"},{keys:"ArrowDown",action:"navigate_down",description:"Navigate to card below"},{keys:"ArrowLeft",action:"navigate_left",description:"Navigate to previous column"},{keys:"ArrowRight",action:"navigate_right",description:"Navigate to next column"},{keys:"Enter",action:"open_card",description:"Open selected card"},{keys:"Escape",action:"close_modal",description:"Close modal or dialog"},{keys:"Delete",action:"delete_card",description:"Delete selected card",modifiers:{shift:true}},{keys:"n",action:"new_card",description:"Create new card",modifiers:{ctrl:true}},{keys:"k",action:"search",description:"Open search/command palette",modifiers:{ctrl:true}},{keys:"s",action:"save",description:"Save changes",modifiers:{ctrl:true}},{keys:"z",action:"undo",description:"Undo last action",modifiers:{ctrl:true}},{keys:"y",action:"redo",description:"Redo last undone action",modifiers:{ctrl:true}},{keys:"a",action:"select_all",description:"Select all cards",modifiers:{ctrl:true}},{keys:"Escape",action:"deselect_all",description:"Deselect all cards"},{keys:"?",action:"show_shortcuts",description:"Show keyboard shortcuts help",modifiers:{shift:true}}];function pu(e,t){if(!(Array.isArray(t.keys)?t.keys:[t.keys]).some(n=>e.key===n||e.code===n))return false;let o=t.modifiers||{},s=o.ctrl?e.ctrlKey||e.metaKey:!e.ctrlKey&&!e.metaKey,l=o.shift?e.shiftKey:!e.shiftKey,c=o.alt?e.altKey:!e.altKey,p=o.meta?e.metaKey:true;return s&&l&&c&&p}function _l(e={}){let{shortcuts:t=co,enabled:a=true,preventDefault:r=true}=e,o=useRef(t),s=useRef(a);useEffect(()=>{o.current=t,s.current=a;},[t,a]);let l=useCallback(p=>{o.current=[...o.current,p];},[]),c=useCallback(p=>{o.current=o.current.filter(n=>n.action!==p);},[]);return useEffect(()=>{function p(n){if(!s.current)return;let m=n.target;if(!((m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable)&&n.key!=="Escape"&&!n.ctrlKey&&!n.metaKey)){for(let d of o.current)if(pu(n,d)){r&&n.preventDefault();let i=new CustomEvent("keyboard-action",{detail:d.action,bubbles:true,cancelable:true});window.dispatchEvent(i);break}}}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[r]),{registerShortcut:l,unregisterShortcut:c,isEnabled:a}}function uu(e){return {ArrowUp:"\u2191",ArrowDown:"\u2193",ArrowLeft:"\u2190",ArrowRight:"\u2192",Enter:"\u21B5",Escape:"Esc",Delete:"Del"," ":"Space"}[e]||e.toUpperCase()}function gu(e){let t=[],a=typeof navigator<"u"&&navigator.platform.includes("Mac");return e.modifiers?.ctrl&&t.push(a?"\u2318":"Ctrl"),e.modifiers?.shift&&t.push("Shift"),e.modifiers?.alt&&t.push(a?"\u2325":"Alt"),e.modifiers?.meta&&t.push("\u2318"),t.join(" + ")}function fu(e){let t=Array.isArray(e.keys)?e.keys[0]:e.keys,a=gu(e),r=t?uu(t):"";return a?`${a} + ${r}`:r}function hu(e){let t={Navigation:[],Actions:[],Editing:[],Selection:[]};return e.forEach(a=>{a.action.includes("navigate")?t.Navigation?.push(a):a.action.includes("select")?t.Selection?.push(a):["undo","redo","save"].includes(a.action)?t.Editing?.push(a):t.Actions?.push(a);}),t}function us({shortcuts:e=co,isOpen:t,onClose:a,className:r}){let[o,s]=useState(false);if(useEffect(()=>{s(true);},[]),useEffect(()=>{function c(p){p.key==="Escape"&&t&&a();}if(t)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[t,a]),!o||!t)return null;let l=hu(e);return jsxs("div",{className:C("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-3xl w-full mx-4 max-h-[80vh] overflow-hidden",children:[jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsx("span",{className:"text-3xl",children:"\u2328\uFE0F"}),"Keyboard Shortcuts"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Speed up your workflow with these shortcuts"})]}),jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsx("div",{className:"px-6 py-6 overflow-y-auto max-h-[calc(80vh-120px)]",children:jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:Object.entries(l).map(([c,p])=>p.length===0?null:jsxs("div",{children:[jsxs("h3",{className:"text-lg font-semibold text-white/90 mb-4 flex items-center gap-2",children:[jsx("span",{className:"w-1 h-5 bg-blue-500 rounded-full"}),c]}),jsx("div",{className:"space-y-3",children:p.map(n=>jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-lg bg-white/5 hover:bg-white/10 transition-colors",children:[jsx("span",{className:"text-sm text-white/80",children:n.description}),jsx("kbd",{className:"px-3 py-1.5 bg-gradient-to-br from-gray-700 to-gray-800 border border-white/20 rounded-md text-xs font-mono text-white/90 shadow-lg whitespace-nowrap",children:fu(n)})]},n.action))})]},c))})}),jsx("div",{className:"px-6 py-4 border-t border-white/10 bg-white/5",children:jsxs("p",{className:"text-xs text-white/50 text-center",children:["Press ",jsx("kbd",{className:"px-2 py-0.5 bg-white/10 rounded text-white/70",children:"?"})," to toggle this help panel"]})})]})]})}var gs=[{id:"bug-report",name:"Bug Report",description:"Report a bug or issue",icon:"\u{1F41B}",category:"Development",template:{title:"[BUG] ",description:`**Steps to reproduce:**
|
|
71
|
+
`,u.onmouseenter=()=>{u.style.opacity="1";},u.onmouseleave=()=>{u.style.opacity="0.5";},u.onclick=y=>{y.stopPropagation();let f=r<a.length-1?r+1:0;n(),o(f);},l.appendChild(d),l.appendChild(i),l.appendChild(u);}l.appendChild(c),l.appendChild(p),document.body.appendChild(l),setTimeout(()=>{p.style.transition="opacity 0.5s ease",p.style.opacity="0";},2e3);}function mm(e){if(e===0)return "0 Bytes";let t=1024,a=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+a[r]}function um(e){return e.startsWith("image/")?"\u{1F5BC}\uFE0F":e.startsWith("video/")?"\u{1F3A5}":e.startsWith("audio/")?"\u{1F3B5}":e.includes("pdf")?"\u{1F4C4}":e.includes("word")||e.includes("document")?"\u{1F4DD}":e.includes("sheet")||e.includes("excel")?"\u{1F4CA}":e.includes("presentation")||e.includes("powerpoint")?"\u{1F4FD}\uFE0F":e.includes("zip")||e.includes("rar")||e.includes("compressed")?"\u{1F5DC}\uFE0F":e.includes("text")?"\u{1F4C3}":"\u{1F4CE}"}function Qn(e){return e.startsWith("image/")}function za({attachments:e=[],onUpload:t,onDelete:a,maxSizeMB:r=10,allowedTypes:o,maxFiles:s=10}){let[l,c]=useState(false),[p,n]=useState(false),[m,d]=useState(null),i=useRef(null),u=useRef(e);u.current=e;let y=useCallback((v,L)=>{L.preventDefault(),L.stopPropagation();let T=u.current.filter(P=>Qn(P.type)),k=T.findIndex(P=>P.id===v.id),F=P=>{let H=u.current.filter(ye=>Qn(ye.type)),X=H[P];X&&Sl(X.url,X.name,H,P,F);};Sl(v.url,v.name,T,k,F);},[]),f=useCallback(v=>{let L=[],T=[];return e.length+v.length>s?(T.push(`Maximum ${s} files allowed`),{valid:L,errors:T}):(v.forEach(k=>{if(k.size/1048576>r){T.push(`${k.name} is too large (max ${r}MB)`);return}if(o&&!o.some(P=>k.type.match(P))){T.push(`${k.name} has invalid file type`);return}L.push(k);}),{valid:L,errors:T})},[e.length,s,r,o]),g=useCallback(async v=>{let{valid:L,errors:T}=f(v);if(T.length>0){d(T.join(", ")),setTimeout(()=>d(null),5e3);return}if(L.length!==0){n(true),d(null);try{await t?.(L);}catch(k){d(k instanceof Error?k.message:"Upload failed"),setTimeout(()=>d(null),5e3);}finally{n(false);}}},[f,t]),x=useCallback(v=>{v.preventDefault(),v.stopPropagation(),c(true);},[]),b=useCallback(v=>{v.preventDefault(),v.stopPropagation(),c(false);},[]),h=useCallback(v=>{v.preventDefault(),v.stopPropagation();},[]),w=useCallback(v=>{v.preventDefault(),v.stopPropagation(),c(false);let L=Array.from(v.dataTransfer.files);g(L);},[g]),D=useCallback(v=>{let L=v.target.files?Array.from(v.target.files):[];g(L),i.current&&(i.current.value="");},[g]),N=useCallback(()=>{i.current?.click();},[]),M=useCallback(v=>{confirm("Are you sure you want to delete this attachment?")&&a?.(v);},[a]);return jsxs("div",{className:"attachment-uploader",children:[jsxs("div",{className:`attachment-dropzone ${l?"dragging":""} ${p?"uploading":""}`,onDragEnter:x,onDragLeave:b,onDragOver:h,onDrop:w,onClick:N,children:[jsx("input",{ref:i,type:"file",multiple:true,onChange:D,style:{display:"none"},accept:o?.join(",")}),jsx("div",{className:"attachment-dropzone-content",children:p?jsxs(Fragment,{children:[jsx("div",{className:"attachment-spinner"}),jsx("p",{className:"attachment-dropzone-text",children:"Uploading..."})]}):jsxs(Fragment,{children:[jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"attachment-dropzone-icon",children:[jsx("path",{d:"M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M17 8L12 3L7 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M12 3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsx("p",{className:"attachment-dropzone-text",children:l?"Drop files here":"Drag & drop files here"}),jsx("p",{className:"attachment-dropzone-subtext",children:"or click to browse"}),jsxs("p",{className:"attachment-dropzone-info",children:["Max ",r,"MB \u2022 ",e.length,"/",s," files"]})]})})]}),m&&jsxs("div",{className:"attachment-error",children:[jsx("span",{className:"attachment-error-icon",children:"\u26A0\uFE0F"}),jsx("span",{className:"attachment-error-text",children:m})]}),e.length>0&&jsx("div",{className:"attachment-list",children:e.map(v=>jsxs("div",{className:"attachment-item",children:[jsx("div",{className:"attachment-preview",children:Qn(v.type)&&v.url?jsxs("button",{type:"button",className:"attachment-thumbnail-btn",onClick:L=>y(v,L),title:"Click to view full size",children:[jsx("img",{src:v.thumbnailUrl||v.url,alt:v.name,className:"attachment-thumbnail"}),jsx("div",{className:"attachment-thumbnail-overlay",children:jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M15 3H21V9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M9 21H3V15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M21 3L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M3 21L10 14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}):jsx("div",{className:"attachment-icon",children:um(v.type)})}),jsxs("div",{className:"attachment-info",children:[jsx("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",className:"attachment-name",title:v.name,children:v.name}),jsxs("div",{className:"attachment-meta",children:[jsx("span",{className:"attachment-size",children:mm(v.size)}),jsx("span",{className:"attachment-separator",children:"\u2022"}),jsx("span",{className:"attachment-date",children:new Date(v.uploadedAt).toLocaleDateString()})]})]}),jsx("button",{onClick:()=>M(v.id),className:"attachment-delete",title:"Delete attachment",type:"button",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},v.id))})]})}function es({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:o,availableUsers:s=[],comments:l=[],activities:c=[],aiInsights:p=[],attachments:n=[],onAddComment:m,onDeleteComment:d,onUploadAttachments:i,onDeleteAttachment:u,onSuggestAssignee:y,onGenerateSubtasks:f,onEstimateEffort:g,currentUserId:x="user-1"}){let[b,h]=useState("details"),[w,D]=useState(false),[N,M]=useState({}),[v,L]=useState(""),[T,k]=useState(false),[F,P]=useState({});if(!t||!e)return null;let H=useCallback(()=>{D(false),M({}),h("details"),L(""),P({}),a();},[a]),X=useCallback(()=>{r&&Object.keys(N).length>0&&(r(e.id,N),M({}),D(false));},[e.id,N,r]),ye=useCallback(()=>{o&&window.confirm("Are you sure you want to delete this card?")&&(o(e.id),H());},[e.id,o,H]),we=useCallback(()=>{m&&v.trim()&&(m(e.id,v.trim()),L(""));},[e.id,v,m]),Ie=useCallback(async()=>{if(y){k(true);try{let S=await y(e);P(q=>({...q,assignees:S}));}catch(S){console.error("Failed to suggest assignee:",S);}finally{k(false);}}},[e,y]),Le=useCallback(async()=>{if(f){k(true);try{let S=await f(e);P(q=>({...q,subtasks:S}));}catch(S){console.error("Failed to generate subtasks:",S);}finally{k(false);}}},[e,f]),O=useCallback(async()=>{if(g){k(true);try{let S=await g(e);P(q=>({...q,effort:S}));}catch(S){console.error("Failed to estimate effort:",S);}finally{k(false);}}},[e,g]),B={...e,...N},W=s.filter(S=>B.assignedUserIds?.includes(S.id));return jsx(tt,{children:jsx("div",{className:"card-detail-overlay",onClick:H,children:jsxs("div",{className:"card-detail-modal",onClick:S=>S.stopPropagation(),children:[jsxs("div",{className:"card-detail-header",children:[jsxs("div",{className:"card-detail-header-left",children:[jsx("div",{className:"card-detail-priority-dot",style:{background:B.priority==="URGENT"?"#EF4444":B.priority==="HIGH"?"#F59E0B":B.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),w?jsx("input",{type:"text",value:N.title??B.title,onChange:S=>M({...N,title:S.target.value}),className:"card-detail-title-input",placeholder:"Card title"}):jsx("h2",{className:"card-detail-title",children:B.title})]}),jsxs("div",{className:"card-detail-header-actions",children:[w?jsxs(Fragment,{children:[jsx("button",{onClick:X,className:"card-detail-btn card-detail-btn-primary",children:"Save"}),jsx("button",{onClick:()=>{D(false),M({});},className:"card-detail-btn",children:"Cancel"})]}):jsxs("button",{onClick:()=>D(true),className:"card-detail-btn",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit"]}),jsxs("button",{onClick:ye,className:"card-detail-btn card-detail-btn-danger",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]}),"Delete"]}),jsx("button",{onClick:H,className:"card-detail-btn-close",children:jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),jsxs("div",{className:"card-detail-tabs",children:[jsxs("button",{onClick:()=>h("details"),className:`card-detail-tab ${b==="details"?"active":""}`,children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Details"]}),jsxs("button",{onClick:()=>h("comments"),className:`card-detail-tab ${b==="comments"?"active":""}`,children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),"Comments",l.length>0&&jsx("span",{className:"card-detail-tab-badge",children:l.length})]}),jsxs("button",{onClick:()=>h("activity"),className:`card-detail-tab ${b==="activity"?"active":""}`,children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),"Activity",c.length>0&&jsx("span",{className:"card-detail-tab-badge",children:c.length})]}),jsxs("button",{onClick:()=>h("attachments"),className:`card-detail-tab ${b==="attachments"?"active":""}`,children:[jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),"Attachments",n.length>0&&jsx("span",{className:"card-detail-tab-badge",children:n.length})]}),jsxs("button",{onClick:()=>h("ai"),className:`card-detail-tab ${b==="ai"?"active":""}`,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"})]}),"AI Insights",jsx("span",{className:"card-detail-tab-badge card-detail-tab-badge-ai",children:"AI"})]})]}),jsxs("div",{className:"card-detail-content",children:[b==="details"&&jsxs("div",{className:"card-detail-details",children:[jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Description"}),w?jsx("textarea",{value:N.description??B.description??"",onChange:S=>M({...N,description:S.target.value}),className:"card-detail-textarea",placeholder:"Add a description...",rows:4}):jsx("p",{className:"card-detail-text",children:B.description||"No description"})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Assigned To"}),w?jsx("select",{multiple:true,value:N.assignedUserIds??B.assignedUserIds??[],onChange:S=>{let q=Array.from(S.target.selectedOptions,ee=>ee.value);M({...N,assignedUserIds:q});},className:"card-detail-textarea",style:{height:"120px",padding:"8px 12px"},children:s.map(S=>jsx("option",{value:S.id,children:S.name},S.id))}):jsx("div",{className:"card-detail-users",children:W.length>0?W.map(S=>jsxs("div",{className:"card-detail-user",children:[jsx("div",{className:"card-detail-user-avatar",style:{background:S.color},children:S.initials}),jsx("span",{children:S.name})]},S.id)):jsx("span",{className:"card-detail-empty",children:"Unassigned"})})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Priority"}),w?jsxs("select",{value:N.priority??B.priority??"",onChange:S=>M({...N,priority:S.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},children:[jsx("option",{value:"",children:"None"}),jsx("option",{value:"LOW",children:"LOW"}),jsx("option",{value:"MEDIUM",children:"MEDIUM"}),jsx("option",{value:"HIGH",children:"HIGH"}),jsx("option",{value:"URGENT",children:"URGENT"})]}):jsxs("div",{className:"card-detail-priority",children:[jsx("div",{className:"card-detail-priority-dot",style:{background:B.priority==="URGENT"?"#EF4444":B.priority==="HIGH"?"#F59E0B":B.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsx("span",{children:B.priority||"None"})]})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Labels"}),jsx("div",{className:"card-detail-labels",children:B.labels&&B.labels.length>0?B.labels.map(S=>jsx("span",{className:"card-detail-label-tag",children:S},S)):jsx("span",{className:"card-detail-empty",children:"No labels"})})]}),jsxs("div",{className:"card-detail-section-row",children:[jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Start Date"}),w?jsx("input",{type:"date",value:N.startDate?new Date(N.startDate).toISOString().split("T")[0]:B.startDate?new Date(B.startDate).toISOString().split("T")[0]:"",onChange:S=>M({...N,startDate:S.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsx("span",{className:"card-detail-text",children:B.startDate?new Date(B.startDate).toLocaleDateString():"Not set"})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"End Date"}),w?jsx("input",{type:"date",value:N.endDate?new Date(N.endDate).toISOString().split("T")[0]:B.endDate?new Date(B.endDate).toISOString().split("T")[0]:"",onChange:S=>M({...N,endDate:S.target.value||void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"}}):jsx("span",{className:"card-detail-text",children:B.endDate?new Date(B.endDate).toLocaleDateString():"Not set"})]})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Estimated Hours"}),w?jsx("input",{type:"number",min:"0",step:"0.5",value:N.estimatedTime??B.estimatedTime??"",onChange:S=>M({...N,estimatedTime:S.target.value?parseFloat(S.target.value):void 0}),className:"card-detail-textarea",style:{height:"auto",padding:"8px 12px"},placeholder:"Enter hours"}):jsx("span",{className:"card-detail-text",children:B.estimatedTime||"Not estimated"})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Dependencies"}),jsx("div",{className:"card-detail-dependencies",children:B.dependencies&&B.dependencies.length>0?B.dependencies.map(S=>{let q=typeof S=="string"?S:S.taskId;return jsxs("span",{className:"card-detail-dependency",children:["Card #",q.slice(-4)]},q)}):jsx("span",{className:"card-detail-empty",children:"No dependencies"})})]}),jsxs("div",{className:"card-detail-section",children:[jsx("label",{className:"card-detail-label",children:"Created"}),jsx("span",{className:"card-detail-text",children:B.createdAt?new Date(B.createdAt).toLocaleString():"Unknown"})]})]}),b==="comments"&&jsxs("div",{className:"card-detail-comments",children:[jsxs("div",{className:"card-detail-comment-form",children:[jsx("textarea",{value:v,onChange:S=>L(S.target.value),className:"card-detail-comment-textarea",placeholder:"Write a comment...",rows:3}),jsx("button",{onClick:we,disabled:!v.trim(),className:"card-detail-btn card-detail-btn-primary",children:"Add Comment"})]}),jsx("div",{className:"card-detail-comments-list",children:l.length>0?l.map(S=>{let q=s.find(ee=>ee.id===S.authorId);return jsxs("div",{className:"card-detail-comment",children:[jsxs("div",{className:"card-detail-comment-header",children:[jsxs("div",{className:"card-detail-comment-author",children:[q&&jsx("div",{className:"card-detail-user-avatar",style:{background:q.color},children:q.initials}),jsxs("div",{children:[jsx("div",{className:"card-detail-comment-author-name",children:q?.name||"Unknown"}),jsx("div",{className:"card-detail-comment-time",children:new Date(S.createdAt).toLocaleString()})]})]}),d&&jsx("button",{onClick:()=>d(S.id),className:"card-detail-comment-delete",children:jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]}),jsx("p",{className:"card-detail-comment-content",children:S.content})]},S.id)}):jsxs("div",{className:"card-detail-empty-state",children:[jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsx("p",{children:"No comments yet"}),jsx("span",{children:"Be the first to comment"})]})})]}),b==="activity"&&jsx("div",{className:"card-detail-activity",children:c.length>0?jsx("div",{className:"card-detail-activity-list",children:c.map(S=>{let q=s.find(ee=>ee.id===S.userId);return jsxs("div",{className:"card-detail-activity-item",children:[jsxs("div",{className:"card-detail-activity-icon",children:[S.type.includes("CREATED")&&"\u2795",S.type.includes("UPDATED")&&"\u270F\uFE0F",S.type.includes("MOVED")&&"\u27A1\uFE0F",S.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",S.type.includes("COMMENT")&&"\u{1F4AC}",S.type.includes("ASSIGNED")&&"\u{1F464}",S.type.includes("PRIORITY")&&"\u{1F3AF}",S.type.includes("LABEL")&&"\u{1F3F7}\uFE0F",S.type.includes("ATTACHMENT")&&"\u{1F4CE}"]}),jsxs("div",{className:"card-detail-activity-content",children:[jsxs("div",{className:"card-detail-activity-text",children:[jsx("strong",{children:q?.name||"Unknown"})," ",S.type.replace(/_/g," ").toLowerCase(),S.newValue&&jsxs("span",{className:"card-detail-activity-value",children:[" ","to ",jsx("strong",{children:S.newValue})]})]}),jsx("div",{className:"card-detail-activity-time",children:new Date(S.timestamp).toLocaleString()})]})]},S.id)})}):jsxs("div",{className:"card-detail-empty-state",children:[jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),jsx("p",{children:"No activity yet"}),jsx("span",{children:"Activity will appear here"})]})}),b==="attachments"&&jsx("div",{className:"card-detail-attachments",children:jsx(za,{cardId:e.id,attachments:n,onUpload:i?S=>i(e.id,S):void 0,onDelete:u,currentUserId:x,maxSizeMB:10,maxFiles:20})}),b==="ai"&&jsxs("div",{className:"card-detail-ai",children:[jsxs("div",{className:"card-detail-ai-actions",children:[jsx("h3",{className:"card-detail-ai-heading",children:"AI-Powered Suggestions"}),jsxs("button",{onClick:Ie,disabled:T||!y,className:"card-detail-ai-btn",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Suggest Best Assignee"]}),jsxs("button",{onClick:Le,disabled:T||!f,className:"card-detail-ai-btn",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),"Generate Subtasks"]}),jsxs("button",{onClick:O,disabled:T||!g,className:"card-detail-ai-btn",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 6 12 12 16 14"})]}),"Estimate Effort"]})]}),F.assignees&&jsxs("div",{className:"card-detail-ai-results",children:[jsx("h4",{children:"Assignee Suggestions"}),F.assignees.map((S,q)=>{let ee=s.find($=>$.id===S.userId);return jsxs("div",{className:"card-detail-ai-suggestion",children:[ee&&jsx("div",{className:"card-detail-user-avatar",style:{background:ee.color},children:ee.initials}),jsxs("div",{children:[jsx("div",{className:"card-detail-ai-suggestion-name",children:ee?.name}),jsx("div",{className:"card-detail-ai-suggestion-reason",children:S.reasoning}),jsxs("div",{className:"card-detail-ai-suggestion-confidence",children:["Confidence: ",(S.confidence*100).toFixed(0),"%"]})]})]},q)})]}),F.subtasks&&jsxs("div",{className:"card-detail-ai-results",children:[jsx("h4",{children:"Suggested Subtasks"}),F.subtasks.map((S,q)=>jsxs("div",{className:"card-detail-ai-subtask",children:[jsx("div",{className:"card-detail-ai-subtask-title",children:S.title}),S.description&&jsx("div",{className:"card-detail-ai-subtask-desc",children:S.description}),S.estimatedTime&&jsxs("div",{className:"card-detail-ai-subtask-time",children:["Est: ",S.estimatedTime,"h"]})]},q))]}),F.effort&&jsxs("div",{className:"card-detail-ai-results",children:[jsx("h4",{children:"Effort Estimate"}),jsxs("div",{className:"card-detail-ai-effort",children:[jsxs("div",{className:"card-detail-ai-effort-hours",children:[F.effort.hours," hours"]}),jsxs("div",{className:"card-detail-ai-effort-confidence",children:["Confidence: ",(F.effort.confidence*100).toFixed(0),"%"]})]})]}),p.length>0&&jsxs("div",{className:"card-detail-ai-insights",children:[jsx("h4",{children:"AI Insights"}),p.map(S=>jsxs("div",{className:`card-detail-ai-insight card-detail-ai-insight-${S.severity.toLowerCase()}`,children:[jsxs("div",{className:"card-detail-ai-insight-header",children:[jsx("span",{className:"card-detail-ai-insight-title",children:S.title}),jsx("span",{className:"card-detail-ai-insight-severity",children:S.severity})]}),jsx("p",{className:"card-detail-ai-insight-desc",children:S.description}),S.suggestedAction&&jsxs("div",{className:"card-detail-ai-insight-action",children:["\u{1F4A1} ",S.suggestedAction]})]},S.id))]}),!F.assignees&&!F.subtasks&&!F.effort&&p.length===0&&jsxs("div",{className:"card-detail-empty-state",children:[jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",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("p",{children:"AI Suggestions"}),jsx("span",{children:"Click a button above to get AI-powered insights"})]})]})]})]})})})}function io({triggerRef:e,isOpen:t,onClose:a,children:r,width:o=200,estimatedHeight:s=300,className:l=""}){let[c,p]=useState({top:0,left:0}),n=useRef(null),m=useCallback(()=>{if(!e.current)return {top:0,left:0};let d=e.current.getBoundingClientRect(),i=window.innerHeight,u=window.innerWidth,y=4,f=d.left;f+o>u-10&&(f=u-o-10),f<10&&(f=10);let g=i-d.bottom,x=d.top,b;return g>=s+y?b=d.bottom+y:x>=s+y?b=d.top-s-y:g>=x?b=d.bottom+y:b=Math.max(10,d.top-s-y),{top:b,left:f}},[e,o,s]);return useEffect(()=>{t&&p(m());},[t,m]),useEffect(()=>{if(!t)return;let d=u=>{let y=u.target;n.current&&!n.current.contains(y)&&e.current&&!e.current.contains(y)&&a();},i=setTimeout(()=>{document.addEventListener("mousedown",d);},0);return ()=>{clearTimeout(i),document.removeEventListener("mousedown",d);}},[t,a,e]),useEffect(()=>{if(!t)return;let d=i=>{i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),a());};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[t,a]),t?jsx(tt,{children:jsx("div",{ref:n,className:`smart-popover ${l}`,style:{position:"fixed",top:`${c.top}px`,left:`${c.left}px`,width:`${o}px`,maxHeight:"calc(100vh - 40px)",overflowY:"auto",zIndex:99999,padding:"6px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.3)",animation:"popoverSlideIn 100ms ease-out"},children:r})}):null}var Ho=["#EF4444","#F97316","#F59E0B","#EAB308","#84CC16","#22C55E","#10B981","#14B8A6","#06B6D4","#0EA5E9","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899"];function Rr({selectedTags:e,availableTags:t,onChange:a,onCreateTag:r,theme:o,disabled:s=false,compact:l=true}){let[c,p]=useState(false),[n,m]=useState(""),[d,i]=useState(false),[u,y]=useState(Ho[10]||"#3B82F6"),[f,g]=useState({top:0,left:0}),x=useRef(null),b=useRef(null),h=useRef(null),w=useRef(null),D=t.filter(k=>k.name.toLowerCase().includes(n.toLowerCase())),N=t.some(k=>k.name.toLowerCase()===n.toLowerCase());useEffect(()=>{if(c&&b.current){let k=b.current.getBoundingClientRect();g({top:k.bottom+6,left:k.left});}},[c]),useEffect(()=>{let k=F=>{let P=F.target,H=x.current?.contains(P),X=h.current?.contains(P);!H&&!X&&(p(false),m(""),i(false));};if(c)return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[c]),useEffect(()=>{c&&w.current&&w.current.focus();},[c]);let M=k=>{let F=e.some(P=>P.id===k.id);a(F?e.filter(P=>P.id!==k.id):[...e,k]);},v=async()=>{if(!(!r||!n.trim())){i(true);try{let k=await r(n.trim(),u);k&&(a([...e,k]),m(""),y(Ho[Math.floor(Math.random()*Ho.length)]||"#3B82F6"));}finally{i(false);}}},L=(k,F)=>{F.stopPropagation(),a(e.filter(P=>P.id!==k));},T={backgroundColor:`${o.textTertiary}15`,border:`1px solid ${o.borderLight}`,color:o.textSecondary};return jsxs("div",{ref:x,className:"relative",children:[jsxs("button",{ref:b,type:"button",onClick:()=>!s&&p(!c),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:T,disabled:s,children:[jsx(Tag,{className:"w-3.5 h-3.5"}),e.length>0?jsxs("div",{className:"flex items-center gap-1",children:[e.slice(0,2).map(k=>jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`${k.color}20`,color:k.color},children:k.name},k.id)),e.length>2&&jsxs("span",{className:"text-xs",style:{color:o.textTertiary},children:["+",e.length-2]})]}):jsx("span",{children:"Etiquetas"}),jsx(ChevronDown,{className:"w-3 h-3",style:{color:o.textTertiary}})]}),typeof document<"u"&&createPortal(jsx(AnimatePresence,{children:c&&jsxs(motion.div,{ref:h,initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.12},className:"rounded-lg min-w-[240px]",style:{position:"fixed",top:f.top,left:f.left,zIndex:99999,backgroundColor:o.bgPrimary,border:`1px solid ${o.border}`,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.25)"},children:[jsx("div",{className:"p-2 border-b",style:{borderColor:o.border},children:jsx("input",{ref:w,type:"text",value:n,onChange:k=>m(k.target.value),placeholder:"Buscar o crear etiqueta...",className:"w-full px-3 py-1.5 text-sm rounded-md outline-none",style:{backgroundColor:o.bgSecondary,color:o.textPrimary,border:`1px solid ${o.borderLight}`},onKeyDown:k=>{k.key==="Enter"&&n.trim()&&!N&&r&&v();}})}),e.length>0&&jsxs("div",{className:"p-2 border-b",style:{borderColor:o.border},children:[jsx("p",{className:"text-xs mb-1.5",style:{color:o.textTertiary},children:"Seleccionadas"}),jsx("div",{className:"flex flex-wrap gap-1",children:e.map(k=>jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium cursor-pointer hover:opacity-80",style:{backgroundColor:`${k.color}20`,color:k.color},onClick:F=>L(k.id,F),children:[k.name,jsx(X,{className:"w-3 h-3"})]},k.id))})]}),jsx("div",{className:"max-h-[200px] overflow-y-auto p-1",children:D.length>0?D.map(k=>{let F=e.some(P=>P.id===k.id);return jsxs("button",{type:"button",onClick:()=>M(k),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors",style:{backgroundColor:F?`${k.color}15`:"transparent",color:o.textPrimary},onMouseEnter:P=>{F||(P.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:P=>{F||(P.currentTarget.style.backgroundColor="transparent");},children:[jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:k.color}}),jsx("span",{className:"flex-1 text-left",children:k.name}),F&&jsx(Check,{className:"w-4 h-4",style:{color:k.color}})]},k.id)}):n.trim()?jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No se encontraron etiquetas"}):jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No hay etiquetas disponibles"})}),n.trim()&&!N&&r&&jsxs("div",{className:"p-2 border-t",style:{borderColor:o.border},children:[jsx("div",{className:"flex items-center gap-2 mb-2",children:jsx("p",{className:"text-xs",style:{color:o.textTertiary},children:"Crear nueva etiqueta"})}),jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Ho.map(k=>jsx("button",{type:"button",onClick:()=>y(k),className:"w-5 h-5 rounded-full transition-transform hover:scale-110",style:{backgroundColor:k,outline:u===k?`2px solid ${k}`:"none",outlineOffset:"2px"}},k))}),jsxs("button",{type:"button",onClick:v,disabled:d,className:"w-full flex items-center justify-center gap-2 px-3 py-2 rounded-md text-sm font-medium transition-colors",style:{backgroundColor:u,color:"#FFFFFF",opacity:d?.7:1},children:[d?jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):jsx(Plus,{className:"w-4 h-4"}),'Crear "',n.trim(),'"']})]})]})}),document.body)]})}function rs({tag:e,onRemove:t,size:a="sm"}){return jsxs("span",{className:`inline-flex items-center gap-1 rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:`${e.color}20`,color:e.color},children:[e.name,t&&jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t();},className:"hover:opacity-70",children:jsx(X,{className:"w-3 h-3"})})]})}function Al({tags:e,maxVisible:t=3,size:a="sm"}){if(!e||e.length===0)return null;let r=e.slice(0,t),o=e.length-t;return jsxs("div",{className:"flex flex-wrap gap-1",children:[r.map(s=>jsx(rs,{tag:s,size:a},s.id)),o>0&&jsxs("span",{className:`inline-flex items-center rounded-full font-medium ${a==="xs"?"px-1.5 py-0.5 text-[10px]":"px-2 py-0.5 text-xs"}`,style:{backgroundColor:"rgba(100,100,100,0.2)",color:"#9CA3AF"},children:["+",o]})]})}var Ge={dark:{bgPrimary:"#1A1D21",bgSecondary:"#22262D",bgGrid:"#1E2126",bgWeekend:"rgba(59, 130, 246, 0.03)",border:"#334155",borderLight:"#2D3139",textPrimary:"#FFFFFF",textSecondary:"#CBD5E1",textTertiary:"#64748B",accent:"#3B82F6",accentHover:"#60A5FA",accentLight:"rgba(59, 130, 246, 0.12)",taskBarPrimary:"#3B82F6",taskBarProgress:"#2563EB",taskBarHandle:"#FFFFFF",dependency:"rgba(180, 185, 197, 0.25)",dependencyHover:"rgba(180, 185, 197, 0.45)",criticalPath:"#EF4444",criticalPathLight:"rgba(239, 68, 68, 0.12)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.12)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.1)",statusTodo:"#64748B",statusInProgress:"#3B82F6",statusCompleted:"#10B981",hoverBg:"rgba(255, 255, 255, 0.06)",focusRing:"#3B82F6"},light:{bgPrimary:"#FFFFFF",bgSecondary:"#F8FAFC",bgGrid:"#F1F5F9",bgWeekend:"rgba(37, 99, 235, 0.03)",border:"#CBD5E1",borderLight:"#E2E8F0",textPrimary:"#0F172A",textSecondary:"#334155",textTertiary:"#64748B",accent:"#2563EB",accentHover:"#1D4ED8",accentLight:"rgba(37, 99, 235, 0.08)",taskBarPrimary:"#2563EB",taskBarProgress:"#1E40AF",taskBarHandle:"#FFFFFF",dependency:"rgba(75, 85, 99, 0.25)",dependencyHover:"rgba(75, 85, 99, 0.45)",criticalPath:"#DC2626",criticalPathLight:"rgba(220, 38, 38, 0.1)",today:"#D21E24",todayLight:"rgba(210, 30, 36, 0.1)",milestone:"#F59E0B",milestoneLight:"rgba(245, 158, 11, 0.08)",statusTodo:"#64748B",statusInProgress:"#2563EB",statusCompleted:"#059669",hoverBg:"rgba(0, 0, 0, 0.04)",focusRing:"#2563EB"},neutral:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgGrid:"#EFEDEC",bgWeekend:"rgba(41, 37, 36, 0.02)",border:"#D6D3D1",borderLight:"#E7E5E4",textPrimary:"#0C0A09",textSecondary:"#44403C",textTertiary:"#78716C",accent:"#292524",accentHover:"#44403C",accentLight:"rgba(41, 37, 36, 0.08)",taskBarPrimary:"#292524",taskBarProgress:"#1C1917",taskBarHandle:"#FFFFFF",dependency:"rgba(87, 83, 78, 0.25)",dependencyHover:"rgba(87, 83, 78, 0.4)",criticalPath:"#44403C",criticalPathLight:"rgba(68, 64, 60, 0.08)",today:"#1C1917",todayLight:"rgba(28, 25, 23, 0.06)",milestone:"#57534E",milestoneLight:"rgba(87, 83, 78, 0.08)",statusTodo:"#78716C",statusInProgress:"#292524",statusCompleted:"#15803D",hoverBg:"rgba(0, 0, 0, 0.035)",focusRing:"#292524"}};var Em=["LOW","MEDIUM","HIGH","URGENT"],Pm=["todo","in-progress","review","done"];function ns({card:e,isOpen:t,onClose:a,onUpdate:r,onDelete:o,availableUsers:s=[],comments:l=[],activities:c=[],onAddComment:p,onDeleteComment:n,currentUser:m,onAIGenerateDescription:d,onAICreateSubtasks:i,onAIFindSimilar:u,availableColumns:y=[],availableLabels:f=[],availableTags:g=[],onCreateTag:x,onUploadCoverImage:b,unsplashAccessKey:h,theme:w,onSubtasksChange:D,attachments:N=[],onUploadAttachments:M,onDeleteAttachment:v}){let L=Mr(),T=w||L?.themeName||"dark",[k,F]=useState(e),[P,H]=useState(false),[X,ye]=useState(e?.subtasks||[]),[we,Ie]=useState(false),[Le,O]=useState(""),[B,W]=useState(""),[S,q]=useState("all"),[ee,$]=useState(false),[Me,be]=useState(false),[qe,ue]=useState(false),[Qe,Te]=useState(false),[rt,gt]=useState(false),[ft,et]=useState(false),R=useRef(null),se=useRef(null),ve=useRef(null),De=useRef(null),Ee=useRef(null),Ve=useRef(null),Ct=useRef(null),Y=useRef(null),z=useRef(null),ke=useRef(null),We=useRef(null),Ue=useRef(null);useEffect(()=>{e&&!k?(F({...e}),ye(e.subtasks||[])):e&&k&&e.id!==k.id&&(F({...e}),ye(e.subtasks||[]));},[e,k]),useEffect(()=>{let U=ce=>{let Ce=ce.target;De.current&&!De.current.contains(Ce)&&$(false),Ee.current&&!Ee.current.contains(Ce)&&be(false),Ve.current&&!Ve.current.contains(Ce)&&ue(false),Ct.current&&!Ct.current.contains(Ce)&&Te(false);};if(ee||Me||qe||Qe)return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[ee,Me,qe,Qe]),useEffect(()=>{if(!t)return;let U=ce=>{let Ce=ce.target,zt=Ce.tagName==="INPUT"||Ce.tagName==="TEXTAREA"||Ce.isContentEditable;if(ce.key==="Escape"){ce.preventDefault(),ee||Me||qe||Qe||rt||ft?($(false),be(false),ue(false),Te(false),gt(false),et(false)):zt||a();return}if(zt&&ce.key!=="Escape")return;let ea=ce.metaKey||ce.ctrlKey;switch(ce.key.toLowerCase()){case "s":ce.preventDefault(),$(true);break;case "a":ce.preventDefault(),ue(true);break;case "p":ce.preventDefault(),be(true);break;case "l":ce.preventDefault(),Te(true);break;case "d":ea||(ce.preventDefault(),gt(true),setTimeout(()=>Y.current?.focus(),0));break;case "e":ea||(ce.preventDefault(),et(true));break;case "i":ce.preventDefault(),H(true),setTimeout(()=>se.current?.focus(),0);break;case "t":ce.preventDefault(),Ie(true);break;case "c":ce.preventDefault(),ve.current?.focus();break}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[t,a,ee,Me,qe,Qe,rt,ft]);let ht=useCallback(U=>{let ce=U.currentTarget.textContent?.trim()||"";if(k&&ce!==k.title){let Ce={...k,title:ce};F(Ce),r?.(k.id,{title:ce});}},[k,r]),Z=useCallback(U=>{U.key==="Enter"&&(U.preventDefault(),U.currentTarget.blur()),U.key==="Escape"&&(U.preventDefault(),U.currentTarget.textContent=k?.title||"",U.currentTarget.blur());},[k]),te=useCallback(()=>{k&&e&&k.description!==e.description&&r?.(k.id,{description:k.description}),H(false);},[k,e,r]),xe=useCallback(U=>{if(k){let ce={...k,columnId:U};F(ce),r?.(k.id,{columnId:U}),$(false);}},[k,r]),Pe=useCallback(U=>{if(k){let ce={...k,priority:U};F(ce),r?.(k.id,{priority:U}),be(false);}},[k,r]),J=useCallback(U=>{if(k){let ce=k.assignedUserIds||[],Ce=ce.includes(U)?ce.filter(ea=>ea!==U):[...ce,U],zt={...k,assignedUserIds:Ce};F(zt),r?.(k.id,{assignedUserIds:Ce});}},[k,r]),Ae=useCallback(U=>{if(k){let ce=k.labels||[],Ce=ce.includes(U)?ce.filter(ea=>ea!==U):[...ce,U],zt={...k,labels:Ce};F(zt),r?.(k.id,{labels:Ce});}},[k,r]),he=useCallback(U=>{if(k){let ce={...k,tags:U};F(ce),r?.(k.id,{tags:U});}},[k,r]),Ne=useCallback(U=>{if(k){let ce=U.target.value,Ce={...k,endDate:ce};F(Ce),r?.(k.id,{endDate:ce}),gt(false);}},[k,r]),de=useCallback(U=>{if(k){let ce={...k,estimatedTime:parseFloat(U)||0};F(ce),r?.(k.id,{estimatedTime:parseFloat(U)||0});}},[k,r]),Re=useCallback(()=>{if(Le.trim()&&k){let U={id:`subtask-${Date.now()}`,title:Le.trim(),completed:false,createdAt:new Date},ce=[...X,U];ye(ce),O(""),Ie(false),D?.(k.id,ce);}},[Le,X,k,D]),Fe=useCallback(U=>{let ce=X.map(Ce=>Ce.id===U?{...Ce,completed:!Ce.completed,updatedAt:new Date}:Ce);ye(ce),k&&D?.(k.id,ce);},[X,k,D]),Oe=useCallback(U=>{let ce=X.filter(Ce=>Ce.id!==U);ye(ce),k&&D?.(k.id,ce);},[X,k,D]),_=useCallback(()=>{B.trim()&&k&&p&&(p(k.id,B.trim()),W(""));},[B,k,p]),j=useCallback(U=>{(U.metaKey||U.ctrlKey)&&U.key==="Enter"&&(U.preventDefault(),_());},[_]),nt=U=>jsx(Dm,{remarkPlugins:[Nm],rehypePlugins:[Sm],components:{a:({node:ce,...Ce})=>jsx("a",{...Ce,target:"_blank",rel:"noopener noreferrer"})},children:U}),He=c.filter(U=>S==="comments"?U.type.includes("COMMENT"):S==="history"?!U.type.includes("COMMENT"):true);if(!t||!e)return null;let ge=k||e,Vt=s.filter(U=>ge.assignedUserIds?.includes(U.id)),Tt=X.filter(U=>U.completed).length;return jsx(tt,{children:jsx("div",{className:"modal-v2-backdrop",onClick:a,style:{position:"fixed",inset:"0",zIndex:9999,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxs("div",{className:"modal-v2-container",onClick:U=>U.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"modal-title","data-theme":T,children:[jsxs("header",{className:"modal-v2-header",children:[jsx("h1",{id:"modal-title",ref:R,className:"modal-v2-title",contentEditable:true,suppressContentEditableWarning:true,onBlur:ht,onKeyDown:Z,children:ge.title}),jsxs("p",{className:"modal-v2-ai-prompt",children:[jsx("span",{className:"modal-v2-ai-icon",children:"\u2728"}),"Ask AI to write a description, create subtasks, or find similar tasks"]}),jsx("button",{className:"modal-v2-close",onClick:a,"aria-label":"Close",children:jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxs("section",{className:"modal-v2-metadata",children:[jsxs("div",{className:"modal-v2-field-wrapper",ref:De,children:[jsxs("button",{ref:z,className:"modal-v2-field",onClick:()=>$(!ee),children:[jsxs("div",{className:"modal-v2-field-label",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("path",{d:"M12 6v6l4 2"})]}),jsx("span",{children:"Status"}),jsx("kbd",{className:"modal-v2-shortcut",children:"S"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.columnId||"No status"})]}),jsx(io,{triggerRef:z,isOpen:ee,onClose:()=>$(false),width:250,estimatedHeight:200,children:(y.length>0?y:Pm.map(U=>({id:U,title:U}))).map(U=>jsx("button",{className:`modal-v2-popover-item ${ge.columnId===U.id?"active":""}`,onClick:()=>xe(U.id),children:U.title},U.id))})]}),jsxs("div",{className:"modal-v2-field-wrapper",ref:Ve,children:[jsxs("button",{ref:ke,className:"modal-v2-field",onClick:()=>ue(!qe),children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsx("span",{children:"Assignees"}),jsx("kbd",{className:"modal-v2-shortcut",children:"A"})]}),jsx("div",{className:"modal-v2-field-value",children:Vt.length>0?jsx("div",{className:"modal-v2-avatars",children:Vt.map(U=>jsx("div",{className:"modal-v2-avatar",style:{background:U.color},title:U.name,children:U.initials},U.id))}):jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsx(io,{triggerRef:ke,isOpen:qe,onClose:()=>ue(false),width:280,estimatedHeight:300,children:s.map(U=>jsxs("button",{className:`modal-v2-popover-item ${ge.assignedUserIds?.includes(U.id)?"active":""}`,onClick:()=>J(U.id),children:[jsx("div",{className:"modal-v2-avatar-small",style:{background:U.color},children:U.initials}),U.name,ge.assignedUserIds?.includes(U.id)&&jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},U.id))})]}),jsxs("div",{className:"modal-v2-field-wrapper",ref:Ee,children:[jsxs("button",{ref:We,className:"modal-v2-field",onClick:()=>be(!Me),children:[jsxs("div",{className:"modal-v2-field-label",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:"Priority"}),jsx("kbd",{className:"modal-v2-shortcut",children:"P"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.priority||"None"})]}),jsxs(io,{triggerRef:We,isOpen:Me,onClose:()=>be(false),width:180,estimatedHeight:220,children:[Em.map(U=>jsx("button",{className:`modal-v2-popover-item priority-${U.toLowerCase()} ${ge.priority===U?"active":""}`,onClick:()=>Pe(U),children:U},U)),jsx("button",{className:"modal-v2-popover-item",onClick:()=>Pe(""),children:"None"})]})]}),g.length>0||x?jsx("div",{className:"modal-v2-field-wrapper",children:jsxs("div",{className:"modal-v2-field",style:{cursor:"default"},children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsx("span",{children:"Etiquetas"})]}),jsx("div",{className:"modal-v2-field-value",children:jsx(Rr,{selectedTags:ge.tags||[],availableTags:g,onChange:he,onCreateTag:x,theme:Ge[T]||Ge.dark})})]})}):jsxs("div",{className:"modal-v2-field-wrapper",ref:Ct,children:[jsxs("button",{ref:Ue,className:"modal-v2-field",onClick:()=>Te(!Qe),children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"}),jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsx("span",{children:"Labels"}),jsx("kbd",{className:"modal-v2-shortcut",children:"L"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.labels&&ge.labels.length>0?jsx("span",{children:ge.labels.join(", ")}):jsx("span",{className:"modal-v2-empty",children:"Empty"})})]}),jsx(io,{triggerRef:Ue,isOpen:Qe,onClose:()=>Te(false),width:220,estimatedHeight:200,children:(f.length>0?f:["Bug","Feature","Enhancement","Documentation"]).map(U=>jsxs("button",{className:`modal-v2-popover-item ${ge.labels?.includes(U)?"active":""}`,onClick:()=>Ae(U),children:[U,ge.labels?.includes(U)&&jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginLeft:"auto"},children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},U))})]}),jsxs("button",{className:"modal-v2-field",onClick:()=>{gt(!rt),setTimeout(()=>Y.current?.showPicker?.(),0);},children:[jsxs("div",{className:"modal-v2-field-label",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),jsx("span",{children:"Due Date"}),jsx("kbd",{className:"modal-v2-shortcut",children:"D"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.endDate?new Date(ge.endDate).toLocaleDateString():"Not set"}),jsx("input",{ref:Y,type:"date",value:typeof ge.endDate=="string"?ge.endDate.split("T")[0]:ge.endDate?(()=>{let U=new Date(ge.endDate),ce=U.getUTCFullYear(),Ce=String(U.getUTCMonth()+1).padStart(2,"0"),zt=String(U.getUTCDate()).padStart(2,"0");return `${ce}-${Ce}-${zt}`})():"",onChange:Ne,style:{position:"absolute",opacity:0,pointerEvents:"none"}})]}),jsxs("div",{className:"modal-v2-field-wrapper",children:[jsxs("button",{className:"modal-v2-field",onClick:()=>et(!ft),children:[jsxs("div",{className:"modal-v2-field-label",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 6 12 12 16 14"})]}),jsx("span",{children:"Estimated Time"}),jsx("kbd",{className:"modal-v2-shortcut",children:"E"})]}),jsx("div",{className:"modal-v2-field-value",children:ge.estimatedTime?`${ge.estimatedTime}h`:"Not set"})]}),ft&&jsx("div",{className:"modal-v2-popover",children:jsx("input",{type:"number",min:"0",step:"0.5",placeholder:"Hours",value:ge.estimatedTime||"",onChange:U=>de(U.target.value),className:"modal-v2-time-input",autoFocus:true,onBlur:()=>et(false)})})]})]}),jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),jsx("polyline",{points:"14 2 14 8 20 8"}),jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsx("polyline",{points:"10 9 9 9 8 9"})]}),jsx("h2",{children:"Description"})]}),P?jsx("textarea",{className:"modal-v2-textarea",value:ge.description||"",onChange:U=>{if(k){let ce={...k,description:U.target.value};F(ce);}},onBlur:te,placeholder:"Add a detailed description...",autoFocus:true}):jsx("div",{className:"modal-v2-content",onClick:()=>H(true),children:ge.description?jsx("div",{className:"modal-v2-markdown",children:nt(ge.description)}):jsxs("p",{className:"modal-v2-placeholder",children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),jsx("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Add description..."]})})]}),jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("path",{d:"M9 11l3 3L22 4"}),jsx("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),jsx("h2",{children:"Subtasks"}),X.length>0&&jsxs("span",{className:"modal-v2-count",children:[Tt,"/",X.length]}),jsxs("button",{className:"modal-v2-add-button",onClick:()=>Ie(true),children:[jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Add"]})]}),jsxs("div",{className:"modal-v2-subtasks",children:[X.map(U=>jsxs("div",{className:`modal-v2-subtask ${U.completed?"completed":""}`,children:[jsx("button",{className:"modal-v2-subtask-checkbox",onClick:()=>Fe(U.id),children:U.completed?jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:[jsx("circle",{cx:"12",cy:"12",r:"10"}),jsx("path",{d:"M9 12l2 2 4-4",stroke:"white",strokeWidth:"2",fill:"none"})]}):jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("circle",{cx:"12",cy:"12",r:"10"})})}),jsx("span",{className:"modal-v2-subtask-title",children:U.title}),jsx("button",{className:"modal-v2-subtask-delete",onClick:()=>Oe(U.id),children:jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("polyline",{points:"3 6 5 6 21 6"}),jsx("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})]})})]},U.id)),we&&jsx("div",{className:"modal-v2-subtask-input-row",children:jsx("input",{type:"text",placeholder:"Subtask title...",value:Le,onChange:U=>O(U.target.value),onKeyDown:U=>{U.key==="Enter"&&Re(),U.key==="Escape"&&(Ie(false),O(""));},onBlur:Re,autoFocus:true,className:"modal-v2-subtask-input"})})]})]}),(M||N.length>0)&&jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})}),jsx("h2",{children:"Attachments"}),N.length>0&&jsx("span",{className:"modal-v2-count",children:N.length})]}),jsx(za,{cardId:ge.id,attachments:N,onUpload:M?U=>M(ge.id,U):void 0,onDelete:v,maxSizeMB:10,maxFiles:20})]}),jsxs("section",{className:"modal-v2-section",children:[jsxs("div",{className:"modal-v2-section-header",children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})}),jsx("h2",{children:"Activity"}),jsxs("div",{className:"modal-v2-filters",children:[jsx("button",{className:`modal-v2-filter ${S==="all"?"active":""}`,onClick:()=>q("all"),children:"All"}),jsx("button",{className:`modal-v2-filter ${S==="comments"?"active":""}`,onClick:()=>q("comments"),children:"Comments"}),jsx("button",{className:`modal-v2-filter ${S==="history"?"active":""}`,onClick:()=>q("history"),children:"History"})]})]}),jsxs("div",{className:"modal-v2-comment-input",children:[m&&jsx("div",{className:"modal-v2-avatar",style:{background:m.color},children:m.initials}),jsxs("div",{className:"modal-v2-comment-wrapper",children:[jsx("textarea",{ref:ve,className:"modal-v2-comment-textarea",placeholder:"Write a comment...",value:B,onChange:U=>W(U.target.value),onKeyDown:j,rows:1}),jsxs("div",{className:"modal-v2-comment-toolbar",children:[jsxs("div",{className:"modal-v2-toolbar-left",children:[jsx("button",{className:"modal-v2-toolbar-button",title:"Attach file",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})})}),jsx("button",{className:"modal-v2-toolbar-button",title:"Mention user",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:"4"}),jsx("path",{d:"M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94"})]})}),jsx("button",{className:"modal-v2-toolbar-button",title:"Add emoji",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("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})})]}),jsx("button",{className:"modal-v2-send-button",onClick:_,disabled:!B.trim(),children:"Send"})]})]})]}),jsxs("div",{className:"modal-v2-timeline",children:[He.map(U=>{let ce=s.find(zt=>zt.id===U.userId);if(U.type.includes("COMMENT")){let zt=l.find(ea=>ea.id===U.metadata?.commentId);return zt?jsxs("div",{className:"modal-v2-activity-item comment-item",children:[ce&&jsx("div",{className:"modal-v2-avatar",style:{background:ce.color},children:ce.initials}),jsxs("div",{className:"modal-v2-activity-content",children:[jsxs("div",{className:"modal-v2-activity-header",children:[jsx("span",{className:"modal-v2-activity-user",children:ce?.name||"Unknown"}),jsx("span",{className:"modal-v2-activity-time",children:new Date(U.timestamp).toLocaleString()})]}),jsx("div",{className:"modal-v2-comment-body",children:zt.content})]})]},U.id):null}return jsxs("div",{className:"modal-v2-activity-item history-item",children:[jsxs("div",{className:"modal-v2-history-icon",children:[U.type.includes("CREATED")&&"\u2795",U.type.includes("UPDATED")&&"\u270F\uFE0F",U.type.includes("MOVED")&&"\u27A1\uFE0F",U.type.includes("DELETED")&&"\u{1F5D1}\uFE0F",U.type.includes("ASSIGNED")&&"\u{1F464}",U.type.includes("PRIORITY")&&"\u{1F3AF}",U.type.includes("LABEL")&&"\u{1F3F7}\uFE0F"]}),jsxs("div",{className:"modal-v2-activity-content",children:[jsxs("div",{className:"modal-v2-history-text",children:[jsx("span",{className:"modal-v2-activity-user",children:ce?.name||"Unknown"})," ",U.type.replace(/_/g," ").toLowerCase(),U.newValue&&jsxs(Fragment,{children:[" to ",jsx("strong",{children:U.newValue})]})]}),jsx("span",{className:"modal-v2-activity-time",children:new Date(U.timestamp).toLocaleString()})]})]},U.id)}),He.length===0&&jsxs("div",{className:"modal-v2-empty",children:[jsx("p",{children:"No activity yet"}),jsx("span",{children:"Activity will appear here"})]})]})]})]})})})}function zm({active:e,payload:t}){return !e||!t||!t.length?null:jsxs("div",{className:"chart-tooltip",children:[jsx("p",{className:"chart-tooltip-label",children:t[0].payload.period}),t.map((a,r)=>jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsx("strong",{children:a.value})," cards"]},r))]})}function is({data:e,title:t="Team Velocity",height:a=300,showAverage:r=true,showPlanned:o=true}){let s=e.map(l=>({...l,average:l.average??e.reduce((c,p)=>c+p.completed,0)/e.length}));return jsxs("div",{className:"chart-container",children:[t&&jsx("h3",{className:"chart-title",children:t}),jsx(ResponsiveContainer,{width:"100%",height:a,children:jsxs(LineChart,{data:s,margin:{top:5,right:30,left:20,bottom:5},children:[jsx(CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsx(XAxis,{dataKey:"period",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(Tooltip,{content:jsx(zm,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsx(Line,{type:"monotone",dataKey:"completed",stroke:"#10B981",strokeWidth:3,name:"Completed",dot:{fill:"#10B981",r:5},activeDot:{r:7}}),o&&jsx(Line,{type:"monotone",dataKey:"planned",stroke:"#3B82F6",strokeWidth:2,strokeDasharray:"5 5",name:"Planned",dot:{fill:"#3B82F6",r:4}}),r&&jsx(Line,{type:"monotone",dataKey:"average",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"3 3",name:"Average",dot:false})]})}),jsxs("div",{className:"chart-stats",children:[jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Total Completed"}),jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.reduce((l,c)=>l+c.completed,0)})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Average Velocity"}),jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:(e.reduce((l,c)=>l+c.completed,0)/e.length).toFixed(1)})]}),o&&e.some(l=>l.planned)&&jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Total Planned"}),jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:e.reduce((l,c)=>l+(c.planned||0),0)})]})]})]})}function Km({active:e,payload:t}){return !e||!t||!t.length?null:jsxs("div",{className:"chart-tooltip",children:[jsx("p",{className:"chart-tooltip-label",children:t[0].payload.day}),t.map((a,r)=>jsxs("p",{className:"chart-tooltip-value",style:{color:a.color},children:[a.name,": ",jsx("strong",{children:a.value})," tasks"]},r))]})}function ls({data:e,title:t="Sprint Burndown",height:a=300,totalTasks:r,useArea:o=false}){let s=r??(e[0]?.ideal||e[0]?.remaining||0),l=e[e.length-1]?.remaining||0,c=e[e.length-1]?.ideal||0,p=s>0?(s-l)/s*100:0,n=l<=c;return jsxs("div",{className:"chart-container",children:[t&&jsx("h3",{className:"chart-title",children:t}),jsx(ResponsiveContainer,{width:"100%",height:a,children:jsxs(o?AreaChart:LineChart,{data:e,margin:{top:5,right:30,left:20,bottom:5},children:[jsx(CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsx(XAxis,{dataKey:"day",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(Tooltip,{content:jsx(Km,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),o?jsxs(Fragment,{children:[jsx(Area,{type:"monotone",dataKey:"ideal",stroke:"#F59E0B",fill:"rgba(245, 158, 11, 0.2)",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal"}),jsx(Area,{type:"monotone",dataKey:"remaining",stroke:n?"#10B981":"#EF4444",fill:n?"rgba(16, 185, 129, 0.2)":"rgba(239, 68, 68, 0.2)",strokeWidth:3,name:"Remaining"})]}):jsxs(Fragment,{children:[jsx(Line,{type:"linear",dataKey:"ideal",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",name:"Ideal",dot:{fill:"#F59E0B",r:4}}),jsx(Line,{type:"monotone",dataKey:"remaining",stroke:n?"#10B981":"#EF4444",strokeWidth:3,name:"Remaining",dot:{fill:n?"#10B981":"#EF4444",r:5},activeDot:{r:7}})]})]})}),jsxs("div",{className:"chart-stats",children:[jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Progress"}),jsxs("span",{className:"chart-stat-value",style:{color:p>=50?"#10B981":"#F59E0B"},children:[p.toFixed(0),"%"]})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Remaining"}),jsx("span",{className:"chart-stat-value",style:{color:n?"#10B981":"#EF4444"},children:l})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Status"}),jsx("span",{className:"chart-stat-badge",style:{background:n?"rgba(16, 185, 129, 0.15)":"rgba(239, 68, 68, 0.15)",color:n?"#10B981":"#EF4444"},children:n?"\u2713 On Track":"\u26A0 Behind"})]})]})]})}var au={URGENT:"#EF4444",HIGH:"#F59E0B",MEDIUM:"#3B82F6",LOW:"#10B981"},zl=["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899"];function ru({cx:e,cy:t,midAngle:a,innerRadius:r,outerRadius:o,percent:s}){let l=r+(o-r)*.5,c=e+l*Math.cos(-a*(Math.PI/180)),p=t+l*Math.sin(-a*(Math.PI/180));return s<.05?null:jsx("text",{x:c,y:p,fill:"white",textAnchor:c>e?"start":"end",dominantBaseline:"central",style:{fontSize:"12px",fontWeight:600},children:`${(s*100).toFixed(0)}%`})}function $l({active:e,payload:t}){if(!e||!t||!t.length)return null;let a=t[0].payload,r=t[0].payload.totalValue||0,o=r>0?(a.value/r*100).toFixed(1):"0";return jsxs("div",{className:"chart-tooltip",children:[jsx("p",{className:"chart-tooltip-label",children:a.name}),jsxs("p",{className:"chart-tooltip-value",style:{color:a.color||t[0].color},children:["Count: ",jsx("strong",{children:a.value})]}),jsxs("p",{className:"chart-tooltip-value",style:{color:"rgba(255, 255, 255, 0.7)"},children:["Percentage: ",jsxs("strong",{children:[o,"%"]})]})]})}function ds({data:e,title:t="Distribution",type:a="pie",height:r=300,showPercentages:o=true}){let s=e.reduce((p,n)=>p+n.value,0),l=e.map(p=>({...p,totalValue:s,color:p.color||au[p.name]||zl[e.indexOf(p)%zl.length]})),c=l.map(p=>p.color);return jsxs("div",{className:"chart-container",children:[t&&jsx("h3",{className:"chart-title",children:t}),jsx(ResponsiveContainer,{width:"100%",height:r,children:a==="pie"?jsxs(PieChart,{children:[jsx(Pie,{data:l,cx:"50%",cy:"50%",labelLine:false,label:o?ru:false,outerRadius:r*.35,fill:"#8884d8",dataKey:"value",children:l.map((p,n)=>jsx(Cell,{fill:c[n]},`cell-${n}`))}),jsx(Tooltip,{content:jsx($l,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"},formatter:(p,n)=>{let m=n.payload,d=s>0?(m.value/s*100).toFixed(0):"0";return `${p} (${m.value} - ${d}%)`}})]}):jsxs(BarChart,{data:l,margin:{top:5,right:30,left:20,bottom:5},children:[jsx(CartesianGrid,{strokeDasharray:"3 3",stroke:"rgba(255, 255, 255, 0.1)"}),jsx(XAxis,{dataKey:"name",stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(YAxis,{stroke:"rgba(255, 255, 255, 0.5)",style:{fontSize:"12px"}}),jsx(Tooltip,{content:jsx($l,{})}),jsx(Legend,{wrapperStyle:{fontSize:"12px",color:"rgba(255, 255, 255, 0.7)"}}),jsx(Bar,{dataKey:"value",name:"Count",radius:[8,8,0,0],children:l.map((p,n)=>jsx(Cell,{fill:c[n]},`cell-${n}`))})]})}),jsxs("div",{className:"chart-stats",children:[jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Total Cards"}),jsx("span",{className:"chart-stat-value",style:{color:"#3B82F6"},children:s})]}),jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Categories"}),jsx("span",{className:"chart-stat-value",style:{color:"#10B981"},children:e.length})]}),e.length>0&&jsxs("div",{className:"chart-stat",children:[jsx("span",{className:"chart-stat-label",children:"Largest Category"}),jsx("span",{className:"chart-stat-value",style:{color:"#F59E0B"},children:e.reduce((p,n)=>n.value>p.value?n:p).name})]})]})]})}var _o=memo(({selectedCards:e,availableUsers:t=[],onClearSelection:a,callbacks:r,columns:o=[],availableLabels:s=[]})=>{let[l,c]=useState(false),[p,n]=useState(false),[m,d]=useState(false),[i,u]=useState(false);if(e.length===0)return null;let y=e.map(w=>w.id),f=w=>{r.onBulkUpdate?.(y,{priority:w}),c(false);},g=w=>{r.onBulkMove?.(y,w),n(false),a();},x=w=>{r.onBulkUpdate?.(y,{assignedUserIds:w}),d(false);},b=w=>{let D=new Set;e.forEach(M=>{M.labels?.forEach(v=>D.add(v));});let N=Array.from(new Set([...D,...w]));r.onBulkUpdate?.(y,{labels:N}),u(false);},h=()=>{confirm(`Delete ${e.length} card(s)? This cannot be undone.`)&&(r.onBulkDelete?.(y),a());};return jsx("div",{className:"asakaa-bulk-toolbar",children:jsxs("div",{className:"asakaa-bulk-toolbar-content",children:[jsxs("div",{className:"asakaa-bulk-toolbar-count",children:[e.length," card",e.length!==1?"s":""," selected"]}),jsxs("div",{className:"asakaa-bulk-toolbar-actions",children:[jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>c(!l),title:"Update priority",children:jsx("span",{className:"text-sm",children:"Priority"})}),l&&jsx("div",{className:"asakaa-bulk-menu",children:["LOW","MEDIUM","HIGH","URGENT"].map(w=>jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>f(w),children:[jsx("span",{className:C("asakaa-priority-dot",w==="LOW"&&"bg-asakaa-priority-low",w==="MEDIUM"&&"bg-asakaa-priority-medium",w==="HIGH"&&"bg-asakaa-priority-high",w==="URGENT"&&"bg-asakaa-priority-urgent")}),w]},w))})]}),o.length>0&&jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>n(!p),title:"Move to column",children:jsx("span",{className:"text-sm",children:"Move"})}),p&&jsx("div",{className:"asakaa-bulk-menu",children:o.map(w=>jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>g(w.id),children:w.title},w.id))})]}),t.length>0&&jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>d(!m),title:"Assign users",children:jsx("span",{className:"text-sm",children:"Assign"})}),m&&jsx("div",{className:"asakaa-bulk-menu",children:t.map(w=>jsxs("button",{className:"asakaa-bulk-menu-item",onClick:()=>x([w.id]),children:[jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:w.color},children:w.initials}),w.name]},w.id))})]}),s.length>0&&jsxs("div",{className:"relative",children:[jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:()=>u(!i),title:"Add labels",children:jsx("span",{className:"text-sm",children:"Labels"})}),i&&jsx("div",{className:"asakaa-bulk-menu",children:s.map(w=>jsx("button",{className:"asakaa-bulk-menu-item",onClick:()=>b([w]),children:w},w))})]}),jsx("button",{className:"asakaa-bulk-toolbar-button asakaa-bulk-toolbar-button-danger",onClick:h,title:"Delete selected cards",children:jsx("span",{className:"text-sm",children:"Delete"})}),jsx("button",{className:"asakaa-bulk-toolbar-button",onClick:a,title:"Clear selection",children:jsx("span",{className:"text-sm",children:"\u2715"})})]})]})})});_o.displayName="BulkOperationsToolbar";function lu(e,t,a){if(t==="none")return [];let r=new Map;return e.forEach(o=>{let s,l,c,p,n;switch(t){case "assignee":let m=o.assignedUserIds||(o.assigneeId?[o.assigneeId]:[]);m.length>0?m.forEach(u=>{let y=a?.find(f=>f.id===u);l=`assignee-${u}`,c=y?.name||`User ${u}`,p=y?.color,n=y?.avatar,r.has(l)||r.set(l,{id:l,title:c,groupValue:u,cardIds:[],color:p,icon:n}),r.get(l).cardIds.push(o.id);}):(l="assignee-unassigned",c="Unassigned",p="#6b7280",n="\u{1F464}",r.has(l)||r.set(l,{id:l,title:c,groupValue:null,cardIds:[],color:p,icon:n}),r.get(l).cardIds.push(o.id));break;case "priority":s=o.priority||"NONE",l=`priority-${s}`;let i={URGENT:{title:"\u{1F534} Urgent",color:"#ef4444"},HIGH:{title:"\u{1F7E0} High",color:"#f97316"},MEDIUM:{title:"\u{1F7E1} Medium",color:"#eab308"},LOW:{title:"\u{1F7E2} Low",color:"#22c55e"},NONE:{title:"\u26AA No Priority",color:"#6b7280"}}[s];c=i.title,p=i.color,r.has(l)||r.set(l,{id:l,title:c,groupValue:s,cardIds:[],color:p}),r.get(l).cardIds.push(o.id);break;case "label":o.labels&&o.labels.length>0?o.labels.forEach(u=>{l=`label-${u}`,c=u,p="#6b7280",r.has(l)||r.set(l,{id:l,title:c,groupValue:u,cardIds:[],color:p}),r.get(l).cardIds.push(o.id);}):(l="label-none",c="No Labels",p="#6b7280",r.has(l)||r.set(l,{id:l,title:c,groupValue:null,cardIds:[],color:p}),r.get(l).cardIds.push(o.id));break}}),Array.from(r.values()).sort((o,s)=>o.title.localeCompare(s.title))}function cs({board:e,swimlaneConfig:t,availableUsers:a,callbacks:r,className:o}){let[s,l]=useState(new Set),c=useMemo(()=>lu(e.cards,t.groupBy,a),[e.cards,t.groupBy,a]),p=useCallback(n=>{l(m=>{let d=new Set(m);return d.has(n)?d.delete(n):d.add(n),d});},[]);return t.groupBy==="none"||c.length===0?jsx(Qa,{board:e,callbacks:r,availableUsers:a,className:o}):jsxs("div",{className:C("asakaa-swimlane-view",o),children:[c.map(n=>{let m=s.has(n.id),d=e.cards.filter(u=>n.cardIds.includes(u.id)),i={...e,cards:d};return jsxs("div",{className:"asakaa-swimlane mb-6 rounded-lg border border-white/10 overflow-hidden",children:[jsxs("div",{className:"asakaa-swimlane-header px-4 py-3 bg-white/5 backdrop-blur-sm flex items-center justify-between cursor-pointer hover:bg-white/10 transition-colors",onClick:()=>t.collapsible&&p(n.id),style:{borderLeft:n.color?`4px solid ${n.color}`:void 0},children:[jsxs("div",{className:"flex items-center gap-3",children:[n.icon&&jsx("span",{className:"text-2xl leading-none",children:n.icon}),jsx("h3",{className:"text-lg font-semibold",style:{color:n.color},children:n.title}),jsxs("span",{className:"text-sm text-white/50 font-medium",children:["(",n.cardIds.length," ",n.cardIds.length===1?"card":"cards",")"]})]}),t.collapsible&&jsx("button",{className:"text-white/50 hover:text-white transition-colors","aria-label":m?"Expand lane":"Collapse lane",children:m?"\u25B6":"\u25BC"})]}),!m&&jsx("div",{className:"asakaa-swimlane-content p-4",children:jsx(Qa,{board:i,callbacks:r,availableUsers:a})})]},n.id)}),c.length===0&&jsxs("div",{className:"text-center py-12 text-white/50",children:[jsx("p",{className:"text-lg",children:"No cards to display"}),jsx("p",{className:"text-sm mt-2",children:"Cards will appear here when they match the grouping criteria"})]})]})}var ps=[{value:"none",label:"No Grouping",icon:"\u{1F4CB}",description:"Standard Kanban board view"},{value:"assignee",label:"By Assignee",icon:"\u{1F465}",description:"Group cards by assigned user"},{value:"priority",label:"By Priority",icon:"\u{1F3AF}",description:"Group cards by priority level"},{value:"label",label:"By Label",icon:"\u{1F3F7}\uFE0F",description:"Group cards by label/tag"}];function ms({value:e,onChange:t,className:a}){let[r,o]=useState(false),s=useRef(null),l=useRef(null),c=ps.find(n=>n.value===e)||ps[0];useEffect(()=>{function n(m){s.current&&!s.current.contains(m.target)&&l.current&&!l.current.contains(m.target)&&o(false);}if(r)return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[r]);let p=n=>{t(n),o(false);};return jsxs("div",{className:C("relative inline-block",a),children:[jsxs("button",{ref:l,onClick:()=>o(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-white/10 hover:bg-white/15 border border-white/20 transition-all text-sm font-medium text-white/90",children:[jsx("span",{className:"text-base leading-none",children:c.icon}),jsx("span",{children:c.label}),jsx("svg",{className:C("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[280px] rounded-lg bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl border border-white/20 shadow-2xl z-50 overflow-hidden",children:[jsx("div",{className:"px-3 py-2 border-b border-white/10",children:jsx("span",{className:"text-[10px] font-bold text-white/70 uppercase tracking-wider",children:"Group By"})}),jsx("div",{className:"py-1",children:ps.map(n=>jsxs("button",{onClick:()=>p(n.value),className:C("w-full px-3 py-2 flex items-start gap-3 text-left transition-all hover:bg-white/10",e===n.value&&"bg-white/5"),children:[jsx("span",{className:"text-xl leading-none mt-0.5",children:n.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"font-semibold text-sm text-white",children:n.label}),e===n.value&&jsx("span",{className:"text-blue-400 text-xs",children:"\u2713"})]}),jsx("p",{className:"text-xs text-white/60 mt-0.5",children:n.description})]})]},n.value))})]})]})}var co=[{keys:"ArrowUp",action:"navigate_up",description:"Navigate to card above"},{keys:"ArrowDown",action:"navigate_down",description:"Navigate to card below"},{keys:"ArrowLeft",action:"navigate_left",description:"Navigate to previous column"},{keys:"ArrowRight",action:"navigate_right",description:"Navigate to next column"},{keys:"Enter",action:"open_card",description:"Open selected card"},{keys:"Escape",action:"close_modal",description:"Close modal or dialog"},{keys:"Delete",action:"delete_card",description:"Delete selected card",modifiers:{shift:true}},{keys:"n",action:"new_card",description:"Create new card",modifiers:{ctrl:true}},{keys:"k",action:"search",description:"Open search/command palette",modifiers:{ctrl:true}},{keys:"s",action:"save",description:"Save changes",modifiers:{ctrl:true}},{keys:"z",action:"undo",description:"Undo last action",modifiers:{ctrl:true}},{keys:"y",action:"redo",description:"Redo last undone action",modifiers:{ctrl:true}},{keys:"a",action:"select_all",description:"Select all cards",modifiers:{ctrl:true}},{keys:"Escape",action:"deselect_all",description:"Deselect all cards"},{keys:"?",action:"show_shortcuts",description:"Show keyboard shortcuts help",modifiers:{shift:true}}];function pu(e,t){if(!(Array.isArray(t.keys)?t.keys:[t.keys]).some(n=>e.key===n||e.code===n))return false;let o=t.modifiers||{},s=o.ctrl?e.ctrlKey||e.metaKey:!e.ctrlKey&&!e.metaKey,l=o.shift?e.shiftKey:!e.shiftKey,c=o.alt?e.altKey:!e.altKey,p=o.meta?e.metaKey:true;return s&&l&&c&&p}function _l(e={}){let{shortcuts:t=co,enabled:a=true,preventDefault:r=true}=e,o=useRef(t),s=useRef(a);useEffect(()=>{o.current=t,s.current=a;},[t,a]);let l=useCallback(p=>{o.current=[...o.current,p];},[]),c=useCallback(p=>{o.current=o.current.filter(n=>n.action!==p);},[]);return useEffect(()=>{function p(n){if(!s.current)return;let m=n.target;if(!((m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable)&&n.key!=="Escape"&&!n.ctrlKey&&!n.metaKey)){for(let d of o.current)if(pu(n,d)){r&&n.preventDefault();let i=new CustomEvent("keyboard-action",{detail:d.action,bubbles:true,cancelable:true});window.dispatchEvent(i);break}}}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[r]),{registerShortcut:l,unregisterShortcut:c,isEnabled:a}}function uu(e){return {ArrowUp:"\u2191",ArrowDown:"\u2193",ArrowLeft:"\u2190",ArrowRight:"\u2192",Enter:"\u21B5",Escape:"Esc",Delete:"Del"," ":"Space"}[e]||e.toUpperCase()}function gu(e){let t=[],a=typeof navigator<"u"&&navigator.platform.includes("Mac");return e.modifiers?.ctrl&&t.push(a?"\u2318":"Ctrl"),e.modifiers?.shift&&t.push("Shift"),e.modifiers?.alt&&t.push(a?"\u2325":"Alt"),e.modifiers?.meta&&t.push("\u2318"),t.join(" + ")}function fu(e){let t=Array.isArray(e.keys)?e.keys[0]:e.keys,a=gu(e),r=t?uu(t):"";return a?`${a} + ${r}`:r}function hu(e){let t={Navigation:[],Actions:[],Editing:[],Selection:[]};return e.forEach(a=>{a.action.includes("navigate")?t.Navigation?.push(a):a.action.includes("select")?t.Selection?.push(a):["undo","redo","save"].includes(a.action)?t.Editing?.push(a):t.Actions?.push(a);}),t}function us({shortcuts:e=co,isOpen:t,onClose:a,className:r}){let[o,s]=useState(false);if(useEffect(()=>{s(true);},[]),useEffect(()=>{function c(p){p.key==="Escape"&&t&&a();}if(t)return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[t,a]),!o||!t)return null;let l=hu(e);return jsxs("div",{className:C("fixed inset-0 z-[9999] flex items-center justify-center",r),children:[jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-3xl w-full mx-4 max-h-[80vh] overflow-hidden",children:[jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxs("div",{children:[jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsx("span",{className:"text-3xl",children:"\u2328\uFE0F"}),"Keyboard Shortcuts"]}),jsx("p",{className:"text-sm text-white/60 mt-1",children:"Speed up your workflow with these shortcuts"})]}),jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsx("div",{className:"px-6 py-6 overflow-y-auto max-h-[calc(80vh-120px)]",children:jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:Object.entries(l).map(([c,p])=>p.length===0?null:jsxs("div",{children:[jsxs("h3",{className:"text-lg font-semibold text-white/90 mb-4 flex items-center gap-2",children:[jsx("span",{className:"w-1 h-5 bg-blue-500 rounded-full"}),c]}),jsx("div",{className:"space-y-3",children:p.map(n=>jsxs("div",{className:"flex items-center justify-between gap-4 p-3 rounded-lg bg-white/5 hover:bg-white/10 transition-colors",children:[jsx("span",{className:"text-sm text-white/80",children:n.description}),jsx("kbd",{className:"px-3 py-1.5 bg-gradient-to-br from-gray-700 to-gray-800 border border-white/20 rounded-md text-xs font-mono text-white/90 shadow-lg whitespace-nowrap",children:fu(n)})]},n.action))})]},c))})}),jsx("div",{className:"px-6 py-4 border-t border-white/10 bg-white/5",children:jsxs("p",{className:"text-xs text-white/50 text-center",children:["Press ",jsx("kbd",{className:"px-2 py-0.5 bg-white/10 rounded text-white/70",children:"?"})," to toggle this help panel"]})})]})]})}var gs=[{id:"bug-report",name:"Bug Report",description:"Report a bug or issue",icon:"\u{1F41B}",category:"Development",template:{title:"[BUG] ",description:`**Steps to reproduce:**
|
|
72
72
|
1.
|
|
73
73
|
|
|
74
74
|
**Expected behavior:**
|