@libxai/board 0.18.19 → 0.18.20
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/dist/styles.css +0 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';var client=require('react-dom/client'),core=require('@libxai/core'),react=require('react'),core$1=require('@dnd-kit/core'),sortable=require('@dnd-kit/sortable'),reactVirtual=require('@tanstack/react-virtual'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jspdf=require('jspdf'),lm=require('html2canvas'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime'),framerMotion=require('framer-motion'),lucideReact=require('lucide-react'),cmdk=require('cmdk'),Uf=require('react-markdown'),$f=require('remark-gfm'),Hf=require('rehype-sanitize'),recharts=require('recharts');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var lm__default=/*#__PURE__*/_interopDefault(lm);var Uf__default=/*#__PURE__*/_interopDefault(Uf);var $f__default=/*#__PURE__*/_interopDefault($f);var Hf__default=/*#__PURE__*/_interopDefault(Hf);var gn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var fn=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:a}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(a?Math.round(a):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:a}=e;return "scaleX("+t+") scaleY("+a+")"}},Transform:{toString(e){if(e)return [fn.Translate.toString(e),fn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:a,easing:r}=e;return t+" "+a+"ms "+r}}});function b(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function bn(e,t){return e===null&&t===null?1e3:e===null&&t!==null?t/2:e!==null&&t===null?e+1e3:e!==null&&t!==null?(e+t)/2:1e3}function _u(e){return Array.from({length:e},(t,a)=>(a+1)*1e3)}function Is(e,t){return e.length===0?1e3:t===0?bn(null,e[0].position):t>=e.length?bn(e[e.length-1].position,null):bn(e[t-1].position,e[t].position)}function td(e,t=100){return e>t}var Vu=e=>{if(e.message.includes("network")||e.message.includes("fetch"))return true;if("status"in e){let t=e.status;return t>=500||t===429}return false};function ju(e,t,a,r){let o=t*Math.pow(a,e-1),s=o*.2*Math.random();return Math.min(o+s,r)}async function hn(e,t={}){let{maxAttempts:a=3,initialDelay:r=1e3,backoffMultiplier:o=2,maxDelay:s=1e4,shouldRetry:n=Vu,onRetry:l}=t,m,i=0;for(let c=1;c<=a;c++){i=c;try{return {data:await e(),attempts:i,success:!0}}catch(d){if(m=d,c===a||!n(m,c))return {error:m,attempts:i,success:false};let f=ju(c,r,o,s);if(l)try{l(m,c,f);}catch(y){console.error("Error in retry callback:",y);}await new Promise(y=>setTimeout(y,f));}}return {error:m||new Error("Unknown error"),attempts:i,success:false}}function Ku(e,t=3){let a;for(let r=1;r<=t;r++)try{return {data:e(),success:!0}}catch(o){if(a=o,r===t)return {error:a,success:false}}return {error:a||new Error("Unknown error"),success:false}}function Yu(e,t={}){return async(...a)=>hn(()=>e(...a),t)}var Bs=class{constructor(t=5,a=6e4){this.threshold=t;this.resetTimeout=a;this.failures=0;this.lastFailureTime=0;this.isOpen=false;}async execute(t){if(this.isOpen)if(Date.now()-this.lastFailureTime>=this.resetTimeout)this.reset();else throw new Error("Circuit breaker is open - too many failures");try{let a=await t();return this.onSuccess(),a}catch(a){throw this.onFailure(),a}}onSuccess(){this.failures=0,this.isOpen=false;}onFailure(){this.failures++,this.lastFailureTime=Date.now(),this.failures>=this.threshold&&(this.isOpen=true);}reset(){this.failures=0,this.isOpen=false;}getStatus(){return {failures:this.failures,isOpen:this.isOpen}}};var ad=(s=>(s[s.DEBUG=0]="DEBUG",s[s.INFO=1]="INFO",s[s.WARN=2]="WARN",s[s.ERROR=3]="ERROR",s[s.NONE=4]="NONE",s))(ad||{}),jr=class jr{constructor(t={}){this.defaultLogHandler=t=>{let{timestamp:a,level:r,message:o,component:s,...n}=t,l=`[${a}] [${r}] [${s}]`,m=Object.keys(n).length>0;switch(r){case "DEBUG":console.debug(l,o,m?n:"");break;case "INFO":console.info(l,o,m?n:"");break;case "WARN":console.warn(l,o,m?n:"");break;case "ERROR":console.error(l,o,m?n:""),t.error?.stack&&console.error(t.error.stack);break}};let a=process.env.NODE_ENV==="development";this.options={minLevel:t.minLevel??(a?0:1),enabled:t.enabled??true,onLog:t.onLog??this.defaultLogHandler,enableTiming:t.enableTiming??true,componentName:t.componentName??"ASAKAA",...jr.globalOptions};}static configure(t){jr.globalOptions={...jr.globalOptions,...t};}child(t){return new jr({...this.options,componentName:`${this.options.componentName}:${t}`})}debug(t,a){this.log(0,t,a);}info(t,a){this.log(1,t,a);}warn(t,a){this.log(2,t,a);}error(t,a,r){this.log(3,t,{...r,error:a?{message:a.message,stack:a.stack,name:a.name}:void 0});}startTimer(t){return this.options.enableTiming?new yn((a,r)=>{this.log(0,`${t} completed`,{...r,action:t,duration:a});},true):new yn(()=>{},false)}log(t,a,r){if(!this.options.enabled||t<this.options.minLevel)return;let o={timestamp:new Date().toISOString(),level:ad[t],message:a,component:this.options.componentName,...r};this.options.onLog(o);}};jr.globalOptions={};var Rs=jr,yn=class{constructor(t,a){this.onEnd=t;this.enabled=a;this.startTime=a?performance.now():0;}end(t){if(!this.enabled)return 0;let a=Math.round(performance.now()-this.startTime);return this.onEnd(a,t),a}elapsed(){return this.enabled?Math.round(performance.now()-this.startTime):0}},rd=new Rs;function Xu(e,t){let a={board:{id:e.id,title:e.title,metadata:e.metadata,exportedAt:new Date().toISOString()},columns:e.columns,cards:e.cards,options:t};return JSON.stringify(a,null,2)}function Ju(e,t){let a=["Card ID","Title","Description","Column","Priority","Labels","Assigned Users","Start Date","End Date","Created At","Updated At"],r=e.cards.map(s=>{let n=e.columns.find(l=>l.id===s.columnId);return [s.id,Os(s.title),Os(s.description||""),Os(n?.title||""),s.priority||"",(s.labels||[]).join(";"),(s.assignedUserIds||[]).join(";"),s.startDate||"",s.endDate||"",s.createdAt||"",s.updatedAt||""]});return [a.join(","),...r.map(s=>s.join(","))].join(`
|
|
2
2
|
`)}async function Zu(e,t,a){let r=t;if(!r){let n=document.querySelector(".asakaa-board");n&&(r=n.parentElement||n);}if(r)try{let n=await lm__default.default(r,{backgroundColor:"#0a0a0a",scale:1.5,logging:!1,useCORS:!0,allowTaint:!0,windowWidth:r.scrollWidth,windowHeight:r.scrollHeight}),l=n.toDataURL("image/png"),m=297,i=210,c=n.width/n.height,d=m-20,u=d/c;u>i-20&&(u=i-20,d=u*c);let f=new jspdf.jsPDF({orientation:"landscape",unit:"mm",format:"a4"});f.setFontSize(16),f.setTextColor(255,255,255),f.setFillColor(10,10,10),f.rect(0,0,m,15,"F"),f.text(e.title||"Kanban Board",10,10);let y=(m-d)/2;return f.addImage(l,"PNG",y,20,d,u),f}catch(n){console.error("Error capturing board:",n);}let o=new jspdf.jsPDF,s=20;return o.setFontSize(20),o.text(e.title||"Kanban Board",20,s),s+=10,o.setFontSize(10),o.setTextColor(128,128,128),o.text(`Exported on ${new Date().toLocaleString()}`,20,s),s+=15,o.setTextColor(0,0,0),e.columns.forEach(n=>{let l=e.cards.filter(m=>m.columnId===n.id);s>250&&(o.addPage(),s=20),o.setFontSize(16),o.setFont("helvetica","bold"),o.text(n.title,20,s),s+=8,l.length===0?(o.setFontSize(10),o.setFont("helvetica","italic"),o.setTextColor(128,128,128),o.text("No cards in this column",20,s),o.setTextColor(0,0,0),s+=10):l.forEach(m=>{if(s>260&&(o.addPage(),s=20),o.setFontSize(12),o.setFont("helvetica","bold"),o.text(m.title,25,s),s+=6,m.description){o.setFontSize(9),o.setFont("helvetica","normal");let c=o.splitTextToSize(m.description,160);o.text(c,25,s),s+=c.length*5;}let i=[];if(m.priority&&i.push(`Priority: ${m.priority}`),m.labels&&m.labels.length>0&&i.push(`Labels: ${m.labels.join(", ")}`),m.assignedUserIds&&m.assignedUserIds.length>0&&i.push(`Assigned: ${m.assignedUserIds.length} user(s)`),m.startDate||m.endDate){let c=[];m.startDate&&c.push(`Start: ${m.startDate}`),m.endDate&&c.push(`End: ${m.endDate}`),i.push(c.join(" \u2192 "));}i.length>0&&(o.setFontSize(8),o.setTextColor(100,100,100),o.text(i.join(" \u2022 "),25,s),o.setTextColor(0,0,0),s+=5),s+=5;}),s+=5;}),o}function Os(e){return e.includes(",")||e.includes('"')||e.includes(`
|
|
3
3
|
`)?`"${e.replace(/"/g,'""')}"`:e}async function nd(e,t,a,r){switch(t){case "json":return Xu(e,r);case "csv":return Ju(e);case "pdf":return await Zu(e,a);default:throw new Error(`Unsupported export format: ${t}`)}}function sd(e,t,a){let r=`board-export-${new Date().getTime()}`;if(t==="pdf"&&typeof e=="object"&&e!==null&&"save"in e){let c=`${r}.pdf`;e.save(c);return}if(typeof e!="string")throw new Error("Invalid content type for non-PDF export");let s=`${r}.${{json:"json",csv:"csv",pdf:"pdf"}[t]}`,n={json:"application/json",csv:"text/csv",pdf:"application/pdf"},l=new Blob([e],{type:n[t]}),m=URL.createObjectURL(l),i=document.createElement("a");i.href=m,i.download=s,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(m);}function Qu(e){try{let t=JSON.parse(e);if(!t.board||!t.columns||!t.cards)return {success:!1,errors:["Invalid JSON format: missing required fields (board, columns, cards)"]};let a={id:t.board.id,title:t.board.title,columns:t.columns,cards:t.cards,metadata:t.board.metadata};return {success:!0,cardsImported:a.cards.length,columnsImported:a.columns.length}}catch(t){return {success:false,errors:[`Failed to parse JSON: ${t instanceof Error?t.message:"Unknown error"}`]}}}function eg(e){try{let t=e.trim().split(`
|
|
4
|
-
`);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let a=id(t[0]),r=[],o=new Map,s=[];for(let n=1;n<t.length;n++)try{let l=id(t[n]||"");if(l.length>a.length){s.push(`Line ${n+1}: Too many columns`);continue}if(a.length-l.length>3){s.push(`Line ${n+1}: Column count mismatch (expected ${a.length}, got ${l.length})`);continue}for(;l.length<a.length;)l.push("");let i={};a.forEach((f,y)=>{i[f]=l[y]||"";});let c=i.Column||"Unnamed";o.has(c)||o.set(c,{id:`col-${o.size+1}`,title:c,position:o.size+1,cardIds:[]});let d=o.get(c),u={id:i["Card ID"]||`card-${n}`,title:i.Title||"Untitled",description:i.Description?i.Description:void 0,columnId:d.id,position:d.cardIds.length+1,priority:i.Priority||void 0,labels:i.Labels?i.Labels.split(";").filter(Boolean):void 0,assignedUserIds:i["Assigned Users"]?i["Assigned Users"].split(";").filter(Boolean):void 0,startDate:i["Start Date"]?i["Start Date"]:void 0,endDate:i["End Date"]?i["End Date"]:void 0,createdAt:i["Created At"]?i["Created At"]:void 0,updatedAt:i["Updated At"]?i["Updated At"]:void 0};r.push(u),d.cardIds.push(u.id);}catch(l){s.push(`Line ${n+1}: ${l instanceof Error?l.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...s]}:{success:!0,cardsImported:r.length,columnsImported:o.size,errors:s.length>0?s:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function id(e){let t=[],a="",r=false;for(let o=0;o<e.length;o++){let s=e[o],n=e[o+1];s==='"'&&r&&n==='"'?(a+='"',o++):s==='"'?r=!r:s===","&&!r?(t.push(a),a=""):a+=s;}return t.push(a),t}function ld(e,t){switch(t){case "json":return Qu(e);case "csv":return eg(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function dd(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=o=>{o.target?.result?t(o.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var zs=react.createContext(null);function cd(){return react.useContext(zs)}var md=react.createContext(null);function pd({children:e,themeName:t}){return jsxRuntime.jsx(md.Provider,{value:{themeName:t},children:e})}function uo(){return react.useContext(md)}function gt({children:e,container:t}){let[a,r]=react.useState(false),o=cd(),s=uo();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let n=t||(typeof document<"u"?document.body:null);if(!n)return null;if(o){let{theme:l,themeName:m}=o,i={"--asakaa-color-background-primary":l.bgPrimary,"--asakaa-color-background-secondary":l.bgSecondary,"--asakaa-color-background-card":l.bgGrid,"--asakaa-color-background-hover":l.hoverBg,"--asakaa-color-text-primary":l.textPrimary,"--asakaa-color-text-secondary":l.textSecondary,"--asakaa-color-text-tertiary":l.textTertiary,"--asakaa-color-text-inverse":l.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":l.border,"--asakaa-color-border-hover":l.borderLight,"--asakaa-color-border-subtle":l.borderLight,"--asakaa-color-interactive-primary":l.accent,"--asakaa-color-interactive-primaryHover":l.accentHover,"--asakaa-color-interactive-primaryBorder":`${l.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${l.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${l.accent}33`,"--asakaa-color-status-success":l.statusCompleted,"--asakaa-color-status-warning":l.milestone,"--asakaa-color-status-error":l.criticalPath,"--asakaa-color-danger":l.criticalPath,"--asakaa-color-danger-border":`${l.criticalPath}4D`,"--asakaa-color-danger-background":`${l.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${l.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":m,"data-gantt-portal":"true",style:i,children:e}),n)}return s?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":s.themeName,"data-kanban-portal":"true",children:e}),n):reactDom.createPortal(e,n)}var hd={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},lg="#BDC3C7",dg=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]});function Kr({priority:e,onChange:t,className:a}){let[r,o]=react.useState(false),[s,n]=react.useState({top:0,left:0}),l=react.useRef(null),m=react.useRef(null),i=()=>{if(!m.current)return;let f=m.current.getBoundingClientRect(),y=window.innerHeight,k=window.innerWidth,g=160,v=220,h=4,p=f.right-g;p<10&&(p=f.left),p+g>k-10&&(p=k-g-10);let w=y-f.bottom,x=f.top,S;w>=v+h?S=f.bottom+h:x>=v+h?S=f.top-v-h:S=w>=x?f.bottom+h:Math.max(10,f.top-v-h),n({top:S,left:p}),o(true);};react.useEffect(()=>{let f=y=>{l.current&&!l.current.contains(y.target)&&!m.current?.contains(y.target)&&o(false);};if(r)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r]),react.useEffect(()=>{let f=y=>{y.key==="Escape"&&o(false);};if(r)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[r]);let c=f=>{t(f),o(false);},d=e?hd[e]:null,u=d?.color||lg;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:m,onClick:()=>r?o(false):i(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:e?`${u}10`:"transparent",boxShadow:e?`0 0 0 2px ${u}30 inset`:"none"},title:d?.label||"Set priority",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:u,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:u,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:l,className:"priority-selector-menu",style:{position:"fixed",top:`${s.top}px`,left:`${s.left}px`,zIndex:99999,minWidth:"160px",maxHeight:"calc(100vh - 40px)",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Priority"})}),jsxRuntime.jsxs("div",{className:"py-1",children:[Object.entries(hd).map(([f,y])=>jsxRuntime.jsxs("button",{onClick:()=>c(f),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98] priority-option",style:{color:y.color,background:"transparent"},onMouseEnter:k=>{k.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:k=>{k.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(dg,{color:y.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:y.label}),e===f&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},f)),jsxRuntime.jsx("div",{className:"mt-0.5 pt-0.5 border-t",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsxs("button",{onClick:()=>c(void 0),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98]",style:{color:"var(--modal-v2-text-primary, #e5e5e5)",background:"transparent"},onMouseEnter:f=>{f.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:f=>{f.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var cg=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function Ro({startDate:e,endDate:t,onChange:a,className:r}){let[o,s]=react.useState(false),[n,l]=react.useState({top:0,left:0}),m=react.useRef(null),i=react.useRef(null),u=(uo()?.themeName||"dark")==="dark",f=()=>{if(!i.current)return;let p=i.current.getBoundingClientRect(),w=window.innerHeight,x=window.innerWidth,S=320,T=380,C=4,A=p.left;A+S>x-10&&(A=x-S-10),A<10&&(A=10);let I=w-p.bottom,N=p.top,z;I>=T+C?z=p.bottom+C:N>=T+C?z=p.top-T-C:z=I>=N?p.bottom+C:Math.max(10,p.top-T-C),l({top:z,left:A}),s(true);};react.useEffect(()=>{let p=w=>{m.current&&!m.current.contains(w.target)&&!i.current?.contains(w.target)&&s(false);};if(o)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[o]),react.useEffect(()=>{let p=w=>{w.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[o]);let y=p=>{let w=new Date,x=A=>{let I=A.getFullYear(),N=String(A.getMonth()+1).padStart(2,"0"),z=String(A.getDate()).padStart(2,"0");return `${I}-${N}-${z}`},S=x(w),T=new Date(w);T.setDate(T.getDate()+p);let C=x(T);a(S,C),s(false);},k=()=>{if(!e||!t)return "Set date";let p=T=>{if(T instanceof Date)return T;if(typeof T!="string"||!T.match(/^\d{4}-\d{2}-\d{2}$/))return null;let C=T.split("-").map(Number);if(C.length!==3||C.some(z=>isNaN(z)))return null;let A=C[0],I=C[1],N=C[2];return A===void 0||I===void 0||N===void 0?null:new Date(A,I-1,N)},w=p(e),x=p(t);if(!w||!x||isNaN(w.getTime())||isNaN(x.getTime()))return "Set date";let S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${S[w.getMonth()]} ${w.getDate()} \u2013 ${S[x.getMonth()]} ${x.getDate()}`},g=e&&t,h=(()=>{if(!t)return false;let p=typeof t=="string"?new Date(t):t,w=new Date;return w.setHours(0,0,0,0),p<w})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>o?s(false):f(),className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${h?"asakaa-date-overdue":"asakaa-date"}`,title:g?`${k()}`:"Set date range",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:k()})]}),o&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:m,className:"date-picker-menu rounded-xl shadow-2xl border min-w-[320px]",style:{position:"fixed",top:`${n.top}px`,left:`${n.left}px`,background:u?"#1A1D25":"#FFFFFF",border:`1px solid ${u?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:u?"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)":"0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:u?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:u?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:cg.map(p=>jsxRuntime.jsx("button",{onClick:()=>y(p.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95",style:{color:u?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",border:`1px solid ${u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`,backgroundColor:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor=u?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",w.currentTarget.style.border=`1px solid ${u?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.25)"}`;},onMouseLeave:w=>{w.currentTarget.style.backgroundColor=u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",w.currentTarget.style.border=`1px solid ${u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`;},children:p.label},p.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:u?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:p=>a(p.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:u?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:u?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:p=>a(e,p.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:u?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:u?"dark":"light"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{a(void 0,void 0),s(false);},className:"mt-4 w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all active:scale-95 border",style:{color:"#ef4444",borderColor:"rgba(239, 68, 68, 0.3)",background:"rgba(239, 68, 68, 0.1)"},onMouseEnter:p=>{p.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:p=>{p.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function qr({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:o=3}){let[s,n]=react.useState(false),[l,m]=react.useState(""),[i,c]=react.useState({top:0,left:0}),d=react.useRef(null),u=react.useRef(null),f=()=>{if(!u.current)return;let h=u.current.getBoundingClientRect(),p=window.innerHeight,w=window.innerWidth,x=300,S=380,T=4,C=h.right-x;C<10&&(C=h.left),C+x>w-10&&(C=w-x-10);let A=p-h.bottom,I=h.top,N;A>=S+T?N=h.bottom+T:I>=S+T?N=h.top-S-T:N=A>=I?h.bottom+T:Math.max(10,h.top-S-T),c({top:N,left:C}),n(true);};react.useEffect(()=>{let h=p=>{d.current&&!d.current.contains(p.target)&&!u.current?.contains(p.target)&&(n(false),m(""));};if(s)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]),react.useEffect(()=>{let h=p=>{p.key==="Escape"&&(n(false),m(""));};if(s)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s]);let y=h=>{let p=e.some(w=>w.id===h.id);a(p?e.filter(w=>w.id!==h.id):[...e,h]);},k=t.filter(h=>h.name.toLowerCase().includes(l.toLowerCase())),g=e.slice(0,o),v=e.length-o;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:u,onClick:()=>s?n(false):f(),className:"flex items-center gap-1 p-0.5 rounded transition-all hover:bg-white/10 hover:scale-105 active:scale-95",title:e.length>0?`${e.length} assigned`:"Assign users",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[g.map(h=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:h.name,children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"asakaa-avatar-img"}):h.initials},h.id)),v>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",v]})]}):jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center transition-all",style:{background:"rgba(96, 165, 250, 0.15)",border:"1.5px solid rgba(96, 165, 250, 0.4)",color:"#60a5fa"},children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),s&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:d,className:"user-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${i.top}px`,left:`${i.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Assign Users"})}),jsxRuntime.jsx("div",{className:"px-3 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("input",{type:"text",value:l,onChange:h=>m(h.target.value),placeholder:"Search users...",className:"w-full px-3 py-2.5 rounded-lg text-sm border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[300px] overflow-y-auto",children:k.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-sm text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.6))"},children:"No users found"}):k.map(h=>{let p=e.some(w=>w.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>y(h),className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm transition-all active:scale-98",style:{background:"transparent"},onMouseEnter:w=>{w.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:w=>{w.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:h.color,color:"#fff"},children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"w-full h-full rounded-full object-cover"}):h.initials}),jsxRuntime.jsx("span",{className:"font-semibold flex-1 text-left truncate",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),jsxRuntime.jsx("span",{className:"w-5 text-lg flex-shrink-0 text-right",style:{color:p?"#3b82f6":"transparent"},children:p?"\u2713":""})]},h.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-3 border-t border-white/10",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),n(false);},className:"w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear All"})})]})})]})}function vn(e,t,a){let r=new Map;e.forEach(m=>{if(m.dependencies&&Array.isArray(m.dependencies)){let i=m.dependencies.map(c=>{if(typeof c=="string")return c;let d=c;return d.taskId||d.targetId||""}).filter(Boolean);r.set(m.id,i);}});let o=r.get(a)||[];r.set(a,[...o,t]);let s=new Set,n=new Set,l=m=>{if(!s.has(m)){s.add(m),n.add(m);let i=r.get(m)||[];for(let c of i){if(!s.has(c)&&l(c))return true;if(n.has(c))return true}}return n.delete(m),false};return l(a)}function zo({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:o,validateCircular:s=true,onCircularDependencyError:n}){let[l,m]=react.useState(false),[i,c]=react.useState(""),[d,u]=react.useState(t.length>0),[f,y]=react.useState({top:0,left:0}),[k,g]=react.useState(null),v=react.useRef(null),h=react.useRef(null),p=()=>{if(!h.current)return;let C=h.current.getBoundingClientRect(),A=window.innerHeight,I=window.innerWidth,N=300,z=d?380:120,R=4,_=C.right-N;_<10&&(_=C.left),_+N>I-10&&(_=I-N-10);let se=A-C.bottom,te=C.top,ie;se>=z+R?ie=C.bottom+R:te>=z+R?ie=C.top-z-R:ie=se>=te?C.bottom+R:Math.max(10,C.top-z-R),y({top:ie,left:_}),m(true);};react.useEffect(()=>{if(!l||!h.current)return;let C=h.current.getBoundingClientRect(),A=window.innerHeight,I=window.innerWidth,N=300,z=d?380:120,R=4,_=C.right-N;_<10&&(_=C.left),_+N>I-10&&(_=I-N-10);let se=A-C.bottom,te=C.top,ie;se>=z+R?ie=C.bottom+R:te>=z+R?ie=C.top-z-R:ie=se>=te?C.bottom+R:Math.max(10,C.top-z-R),y({top:ie,left:_});},[d,l]),react.useEffect(()=>{let C=A=>{v.current&&!v.current.contains(A.target)&&!h.current?.contains(A.target)&&(m(false),c(""));};if(l)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[l]),react.useEffect(()=>{let C=A=>{A.key==="Escape"&&(m(false),c(""));};if(l)return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[l]);let w=C=>{let A=t.includes(C),I=a.find(N=>N.id===C);if(g(null),A){let N=t.filter(z=>z!==C);r(N),N.length===0&&u(false);}else {if(s&&vn(a,C,e)){let z=`Cannot add "${I?.title||C}" as dependency - would create circular reference`;g(z),n?.(C,I?.title||C),setTimeout(()=>g(null),3e3);return}r([...t,C]),u(true);}},x=()=>{let C=!d;u(C),C||r([]);},S=a.filter(C=>C.id!==e).filter(C=>C.title.toLowerCase().includes(i.toLowerCase())||C.id.toLowerCase().includes(i.toLowerCase())),T=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsxs("button",{ref:h,onClick:()=>l?m(false):p(),className:"flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5",title:t.length>0?`${t.length} dependencies`:"Add dependencies",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:T,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:T},children:t.length})]}),l&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:v,className:"dependencies-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${f.top}px`,left:`${f.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[k&&jsxRuntime.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",style:{background:"rgba(239, 68, 68, 0.15)",borderBottom:"1px solid rgba(239, 68, 68, 0.3)"},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M8 5V8M8 11H8.01M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z",stroke:"#ef4444",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:"#ef4444"},children:k})]}),jsxRuntime.jsx("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Task Dependencies"})}),jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",onClick:x,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:d?"#3b82f6":"transparent",borderColor:d?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:d&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.8))"},children:"Has dependencies"})]})}),d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("input",{type:"text",value:i,onChange:C=>c(C.target.value),placeholder:"Search by name or ID...",className:"w-full px-3 py-2 rounded-md text-xs border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[280px] overflow-y-auto",children:S.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-xs text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:"No tasks found"}):S.map(C=>{let A=t.includes(C.id);return jsxRuntime.jsxs("button",{onClick:()=>w(C.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:I=>{I.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:I=>{I.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0 mt-0.5 transition-all",style:{background:A?"#3b82f6":"transparent",borderColor:A?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:A&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:"font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.9))"},children:C.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:C.id})]})]},C.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),u(false),m(false);},className:"w-full px-3 py-2 rounded-md text-xs font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#E74C3C"},children:"Clear All Dependencies"})})]})})]})}var gr=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:o,className:s,onUpdate:n,availableUsers:l=[],allCards:m=[]})=>{let{attributes:i,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:y}=sortable.useSortable({id:e.id,disabled:o,data:{type:"card",card:e}}),k={transform:fn.Transform.toString(u),transition:f};if(t)return jsxRuntime.jsx("div",{ref:d,style:k,...i,...c,onClick:()=>a?.(e),children:t(e)});let g=l.filter(w=>e.assignedUserIds?.includes(w.id)),v=e.progress===100,h=(e.attachments||[]).filter(w=>w.type.startsWith("image/")),p={...k,...e.color&&{borderTopWidth:"3px",borderTopStyle:"solid",borderTopColor:e.color}};return jsxRuntime.jsxs("div",{ref:d,style:p,className:b("asakaa-card",y&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",s),...i,...c,onClick:w=>{w.target.closest(".priority-selector, .date-picker, .user-selector, .dependencies-selector")||a?.(e);},children:[e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-cover mb-3",children:jsxRuntime.jsx("img",{src:e.coverImage,alt:`Cover for ${e.title}`,className:"w-full h-32 object-cover rounded-md",loading:"lazy",onError:w=>{w.currentTarget.style.display="none";}})}),h.length>0&&!e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-attachments mb-3",children:h.length===1&&h[0]?jsxRuntime.jsx("img",{src:h[0].url,alt:h[0].name,className:"w-full h-32 object-cover rounded-md",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:w=>{w.currentTarget.style.display="none";}}):jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1",children:h.slice(0,4).map((w,x)=>jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("img",{src:w.url,alt:w.name,className:"w-full h-16 object-cover rounded",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:S=>{S.currentTarget.style.display="none";}}),x===3&&h.length>4&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 rounded flex items-center justify-center",children:jsxRuntime.jsxs("span",{className:"text-white text-sm font-medium",children:["+",h.length-4]})})]},w.id))})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",style:{textDecoration:v?"line-through":"none",opacity:v?.6:1},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"asakaa-card-description mb-3",children:e.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3 pt-1",children:[jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(Kr,{priority:e.priority,onChange:w=>n?.(e.id,{priority:w})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(Ro,{startDate:e.startDate?typeof e.startDate=="string"?e.startDate:e.startDate.toISOString().split("T")[0]:void 0,endDate:e.endDate?typeof e.endDate=="string"?e.endDate:e.endDate.toISOString().split("T")[0]:void 0,onChange:(w,x)=>n?.(e.id,{startDate:w,endDate:x})})}),l.length>0&&jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(qr,{assignedUsers:g,availableUsers:l,onChange:w=>n?.(e.id,{assignedUserIds:w.map(x=>x.id)})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(zo,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(w=>typeof w=="string"?w:w.taskId):[],availableTasks:m,onChange:w=>n?.(e.id,{dependencies:w})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(w=>jsxRuntime.jsx("span",{className:"asakaa-label",children:w},w))}),typeof e.progress=="number"&&jsxRuntime.jsxs("div",{className:"mt-3 pt-2 border-t border-white/5",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-[#6B7280]",children:"Progreso"}),jsxRuntime.jsxs("span",{className:"text-[10px] font-medium",style:{color:"#3B82F6"},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx("div",{className:"h-1.5 rounded-full bg-white/5 overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,e.progress))}%`,backgroundColor:"#3B82F6"}})})]})]})},(e,t)=>e.card.id===t.card.id&&e.card.title===t.card.title&&e.card.description===t.card.description&&e.card.position===t.card.position&&e.card.columnId===t.card.columnId&&e.card.priority===t.card.priority&&e.card.color===t.card.color&&e.card.progress===t.card.progress&&e.card.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies)&&JSON.stringify(e.card.attachments?.map(a=>a.id))===JSON.stringify(t.card.attachments?.map(a=>a.id)));gr.displayName="Card";var xn={todo:{label:"To Do",color:"#94a3b8",icon:"circle"},"in-progress":{label:"In Progress",color:"#60a5fa",icon:"circle-dot"},completed:{label:"Completed",color:"#34d399",icon:"check-circle"}},Sd=({icon:e,color:t})=>e==="circle"?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"})}):e==="circle-dot"?jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3",fill:t})]}):jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:t,fillOpacity:"0.2"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});function Ed({status:e="todo",onChange:t,className:a,customStatuses:r=[]}){let[o,s]=react.useState(false),[n,l]=react.useState({top:0,left:0}),m=react.useRef(null),i=react.useRef(null),c=[...Object.entries(xn).map(([g,v])=>({id:g,label:v.label,color:v.color,icon:v.icon})),...r.filter(g=>!Object.keys(xn).includes(g.id)).map(g=>({id:g.id,label:g.title,color:g.color||"#8B5CF6",icon:"circle-dot"}))],d=()=>{let g=xn[e];if(g)return {...g,id:e};let v=r.find(h=>h.id===e);return v?{id:v.id,label:v.title,color:v.color||"#8B5CF6",icon:"circle-dot"}:{...xn.todo,id:"todo"}},u=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect(),v=window.innerHeight,h=window.innerWidth,p=180,w=280,x=4,S=g.right-p;S<10&&(S=g.left),S+p>h-10&&(S=h-p-10);let T=v-g.bottom,C=g.top,A;T>=w+x?A=g.bottom+x:C>=w+x?A=g.top-w-x:A=T>=C?g.bottom+x:Math.max(10,g.top-w-x),l({top:A,left:S}),s(true);};react.useEffect(()=>{let g=v=>{m.current&&!m.current.contains(v.target)&&!i.current?.contains(v.target)&&s(false);};if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]),react.useEffect(()=>{let g=v=>{v.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[o]);let f=g=>{t(g),s(false);},y=d(),k=y.color;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>o?s(false):u(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:`${k}10`,boxShadow:`0 0 0 2px ${k}30 inset`},title:y.label,children:jsxRuntime.jsx(Sd,{icon:y.icon,color:k})}),o&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:m,className:"status-selector-menu",style:{position:"fixed",top:`${n.top}px`,left:`${n.left}px`,zIndex:99999,minWidth:"180px",maxHeight:"calc(100vh - 40px)",overflowY:"auto",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Status"})}),jsxRuntime.jsx("div",{className:"py-1",children:c.map(g=>jsxRuntime.jsxs("button",{onClick:()=>f(g.id),className:"w-full px-3 py-2 flex items-center gap-2.5 text-sm font-medium transition-all active:scale-[0.98] status-option",style:{color:g.color,background:"transparent"},onMouseEnter:v=>{v.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:v=>{v.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(Sd,{icon:g.icon,color:g.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:g.label}),e===g.id&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},g.id))})]})})]})}function Pd({columnTitle:e,onRename:t,onDelete:a,isDeletable:r=false,className:o}){let[s,n]=react.useState(false),[l,m]=react.useState(false),[i,c]=react.useState(e),[d,u]=react.useState({top:0,left:0}),f=react.useRef(null),y=react.useRef(null),k=react.useRef(null);react.useEffect(()=>{if(s&&y.current){let p=y.current.getBoundingClientRect();u({top:p.bottom+window.scrollY+8,left:p.left+window.scrollX});}},[s]),react.useEffect(()=>{let p=w=>{f.current&&!f.current.contains(w.target)&&!y.current?.contains(w.target)&&(n(false),m(false));};if(s)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]),react.useEffect(()=>{let p=w=>{w.key==="Escape"&&(n(false),m(false),c(e));};if(s)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[s,e]),react.useEffect(()=>{l&&k.current&&(k.current.focus(),k.current.select());},[l]);let g=()=>{m(true),c(e);},v=()=>{let p=i.trim();p&&p!==e&&t(p),m(false),n(false),c(e);},h=p=>{p.key==="Enter"?v():p.key==="Escape"&&(m(false),c(e));};return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsx("button",{ref:y,onClick:()=>n(!s),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),s&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsx("div",{ref:f,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${d.top}px`,left:`${d.left}px`,background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:l?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:k,type:"text",value:i,onChange:p=>c(p.target.value),onKeyDown:h,onBlur:v,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsxs("button",{onClick:g,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]}),r&&a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-px bg-white/10 mx-2 my-1"}),jsxRuntime.jsxs("button",{onClick:()=>{a(),n(false);},className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-red-400 hover:bg-red-500/10 transition-all",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 4H14M5 4V2.5C5 2.22386 5.22386 2 5.5 2H10.5C10.7761 2 11 2.22386 11 2.5V4M12.5 4V13.5C12.5 13.7761 12.2761 14 12 14H4C3.72386 14 3.5 13.7761 3.5 13.5V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M6.5 7V11M9.5 7V11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),jsxRuntime.jsx("span",{className:"font-medium",children:"Delete"})]})]})]})})})]})}var bo=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:o,renderEmptyState:s,onCardClick:n,onCardUpdate:l,availableUsers:m,allCards:i,enableVirtualization:c,cardHeight:d=120,isCollapsed:u,onToggleCollapse:f,onColumnRename:y,onColumnDelete:k,isDeletable:g=false,className:v})=>{let{setNodeRef:h,isOver:p}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),w=react.useRef(null),x=c??td(t.length),S=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>w.current,estimateSize:()=>d,enabled:x});if(a)return jsxRuntime.jsx("div",{ref:h,className:v,children:a(e,t)});let C=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let N=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:N}:N>=80?{state:"warning",percentage:N}:N>=60?{state:"approaching",percentage:N}:{state:"ok",percentage:N}})(),A=C.state==="exceeded",I=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:h,className:b("asakaa-column",p&&"ring-2 ring-asakaa-accent-blue",A&&"ring-2 ring-asakaa-accent-red",v),children:[o?o(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:b(I()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&C.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${C.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[C.state==="exceeded"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#EF4444",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 5L11 11M11 5L5 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),C.state==="warning"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M8 1L15 14H1L8 1Z",fill:"#F59E0B",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),C.state==="approaching"&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8 1L10 7H14L10 10L12 16L8 12L4 16L6 10L2 7H6L8 1Z",fill:"#FB923C",opacity:"0.9"})}),C.state==="ok"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#10B981",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]}),(y||k)&&jsxRuntime.jsx(Pd,{columnTitle:e.title,onRename:N=>y?.(e.id,N),onDelete:k?()=>k(e.id):void 0,isDeletable:g}),f&&jsxRuntime.jsx("button",{onClick:f,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":u?"Expand column":"Collapse column",children:u?"\u25B6":"\u25BC"})]})]}),!u&&jsxRuntime.jsx("div",{ref:w,className:"asakaa-column-cards",style:{maxHeight:x?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(N=>N.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?s?s(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):x?jsxRuntime.jsx("div",{style:{height:`${S.getTotalSize()}px`,position:"relative"},children:S.getVirtualItems().map(N=>{let z=t[N.index];return z?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:jsxRuntime.jsx(gr,{card:z,render:r,onClick:n,onUpdate:l,availableUsers:m,allCards:i})},z.id):null})}):t.map(N=>jsxRuntime.jsx(gr,{card:N,render:r,onClick:n,onUpdate:l,availableUsers:m,allCards:i},N.id))})})]})});bo.displayName="Column";function Gs({title:e,onSave:t,className:a}){let[r,o]=react.useState(false),[s,n]=react.useState(e),l=react.useRef(null);react.useEffect(()=>{r&&l.current&&(l.current.focus(),l.current.select());},[r]);let m=()=>{let c=s.trim();c&&c!==e?t(c):n(e),o(false);},i=c=>{c.key==="Enter"?m():c.key==="Escape"&&(n(e),o(false));};return r?jsxRuntime.jsx("input",{ref:l,type:"text",value:s,onChange:c=>n(c.target.value),onBlur:m,onKeyDown:i,className:b("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:b("asakaa-column-title cursor-pointer",a),onClick:()=>o(true),title:"Click to edit",children:e})}function Mg(e,t){let a=e.slice(0,t),r=a.lastIndexOf("@");if(r===-1)return null;let o=a[r-1];if(r>0&&o&&!/\s/.test(o))return null;let s=a.slice(r+1);return /\s/.test(s)?null:{start:r,end:t,query:s.toLowerCase()}}function Bd(e,t){let a=[],r=/@(\S+)/g,o;for(;(o=r.exec(e))!==null;){let s=o[1]?.toLowerCase()??"";if(!s)continue;let n=t.find(l=>{let m=l.name.toLowerCase(),i=m.replace(/\s+/g,""),c=m.split(/\s+/);return !!(i===s||m===s||c.some(d=>d===s))});n&&!a.includes(n.id)&&a.push(n.id);}return a}function Fg(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Ag(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var Lg=["\u{1F600}","\u{1F602}","\u{1F970}","\u{1F60D}","\u{1F914}","\u{1F44D}","\u{1F44E}","\u{1F389}","\u{1F525}","\u2764\uFE0F","\u{1F4AF}","\u2705","\u274C","\u26A0\uFE0F","\u{1F4CC}","\u{1F4A1}","\u{1F680}","\u2B50","\u{1F3AF}","\u{1F4AA}","\u{1F64F}","\u{1F440}","\u{1F4DD}","\u{1F4AC}"];function Rd({value:e,onChange:t,onSubmit:a,users:r,placeholder:o,disabled:s=false,isSubmitting:n=false,theme:l="dark",locale:m="es",currentUser:i,enableEmoji:c=true,enableAttachments:d=true,pendingFiles:u=[],onFilesSelect:f,onRemoveFile:y,maxFileSizeMB:k=10}){let g=l==="dark",[v,h]=react.useState(false),[p,w]=react.useState([]),[x,S]=react.useState(0),[T,C]=react.useState(null),[A,I]=react.useState(false),N=react.useRef(null),z=react.useRef(null),R=react.useRef(null),_=react.useRef(null),se=react.useCallback((E,W)=>{let q=Mg(E,W);if(C(q),q){let pe=r.filter(fe=>fe.name.toLowerCase().includes(q.query)||fe.email&&fe.email.toLowerCase().includes(q.query)).slice(0,5);w(pe),h(pe.length>0),S(0);}else h(false),w([]);},[r]),te=E=>{let W=E.target.value;if(t(W),se(W,E.target.selectionStart||0),N.current){N.current.style.height="24px";let q=N.current.scrollHeight,pe=280,fe=Math.min(q,pe);N.current.style.height=`${fe}px`,N.current.style.overflowY=q>pe?"auto":"hidden";}},ie=()=>{N.current&&se(e,N.current.selectionStart||0);},xe=react.useCallback(E=>{if(!T||!N.current)return;let W=e.slice(0,T.start),q=e.slice(T.end),pe=`@${E.name.replace(/\s+/g,"")} `,fe=W+pe+q;t(fe),h(false),C(null),setTimeout(()=>{if(N.current){let Ce=T.start+pe.length;N.current.selectionStart=Ce,N.current.selectionEnd=Ce,N.current.focus();}},0);},[T,e,t]),Ne=E=>{if(v&&p.length>0)switch(E.key){case "ArrowDown":E.preventDefault(),S(W=>W<p.length-1?W+1:0);break;case "ArrowUp":E.preventDefault(),S(W=>W>0?W-1:p.length-1);break;case "Enter":{E.preventDefault();let W=p[x];W&&xe(W);break}case "Tab":{E.preventDefault();let W=p[x];W&&xe(W);break}case "Escape":E.preventDefault(),h(false);break}else E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),a());};react.useEffect(()=>{let E=W=>{z.current&&!z.current.contains(W.target)&&N.current&&!N.current.contains(W.target)&&h(false),_.current&&!_.current.contains(W.target)&&I(false);};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);let Ae=react.useCallback(E=>{if(!N.current)return;let W=N.current.selectionStart||e.length,q=e.slice(0,W)+E+e.slice(W);t(q),I(false),setTimeout(()=>{if(N.current){let pe=W+E.length;N.current.selectionStart=pe,N.current.selectionEnd=pe,N.current.focus();}},0);},[e,t]),F=react.useCallback(E=>{if(!f||!E.target.files)return;let W=Array.from(E.target.files),q=k*1024*1024,pe=W.filter(fe=>fe.size>q?(console.warn(`File ${fe.name} exceeds max size of ${k}MB`),false):true);pe.length>0&&f(pe),E.target.value="";},[f,k]),B=react.useCallback(E=>E.type.startsWith("image/")?lucideReact.Image:E.type.includes("pdf")||E.type.includes("document")?lucideReact.FileText:lucideReact.File,[]);return react.useEffect(()=>{if(v&&z.current){let E=z.current.children[x];E&&E.scrollIntoView({block:"nearest"});}},[x,v]),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[u.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(E=>{let W=B(E.file),q=E.file.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:b("relative group flex items-center gap-2 px-2 py-1.5 rounded-lg",g?"bg-white/10":"bg-gray-100"),children:[q&&E.preview?jsxRuntime.jsx("img",{src:E.preview,alt:E.file.name,className:"w-6 h-6 rounded object-cover"}):jsxRuntime.jsx(W,{className:b("w-4 h-4",g?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0 max-w-[120px]",children:[jsxRuntime.jsx("p",{className:b("text-xs truncate",g?"text-white":"text-gray-900"),children:E.file.name}),jsxRuntime.jsx("p",{className:b("text-xs",g?"text-[#6B7280]":"text-gray-400"),children:Ag(E.file.size)})]}),y&&jsxRuntime.jsx("button",{onClick:()=>y(E.id),className:b("p-0.5 rounded-full transition-colors",g?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},E.id)})}),jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[i&&jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:i.color||"#8B5CF6"},children:i.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:b("flex-1 relative min-w-0"),children:[jsxRuntime.jsxs("div",{className:b("flex items-end gap-1 px-2 py-2 rounded-lg",g?"bg-white/5":"bg-white border border-gray-200"),children:[c&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>I(!A),disabled:s||n,className:b("p-1 rounded transition-colors flex-shrink-0",g?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||n)&&"opacity-50"),title:"Emojis",children:jsxRuntime.jsx(lucideReact.Smile,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:A&&jsxRuntime.jsx(framerMotion.motion.div,{ref:_,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:b("absolute bottom-full left-0 mb-2 p-2 rounded-lg shadow-xl z-50",g?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-8 gap-1 w-[200px]",children:Lg.map(E=>jsxRuntime.jsx("button",{type:"button",onClick:()=>Ae(E),className:b("w-6 h-6 flex items-center justify-center text-lg rounded transition-colors hover:scale-110",g?"hover:bg-white/10":"hover:bg-gray-100"),children:E},E))})})})]}),d&&f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>R.current?.click(),disabled:s||n,className:b("p-1.5 rounded transition-colors",g?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||n)&&"opacity-50"),title:m==="es"?"Adjuntar archivo":"Attach file",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"w-4 h-4"})}),jsxRuntime.jsx("input",{ref:R,type:"file",multiple:true,onChange:F,className:"hidden",accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.txt,.zip"})]}),jsxRuntime.jsx("textarea",{ref:N,value:e,onChange:te,onSelect:ie,onKeyDown:Ne,placeholder:o||(m==="es"?"Escribe un comentario...":"Write a comment..."),disabled:s||n,rows:1,className:b("flex-1 bg-transparent text-sm outline-none min-w-[100px] resize-none py-0.5",g?"text-white placeholder:text-[#6B7280] scrollbar-slim":"text-gray-900 placeholder:text-gray-400 scrollbar-slim-light",(s||n)&&"opacity-50"),style:{lineHeight:"1.5",height:"24px",maxHeight:"280px",overflowY:"hidden"}}),jsxRuntime.jsx("button",{onClick:a,disabled:n||!e.trim()&&u.length===0||s,className:b("p-1.5 rounded transition-colors",(e.trim()||u.length>0)&&!s?"bg-blue-500 text-white hover:bg-blue-600":g?"text-[#6B7280]":"text-gray-400",n&&"opacity-50 cursor-not-allowed"),children:n?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:v&&p.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{ref:z,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:b("absolute bottom-full left-0 right-0 mb-1 py-1 rounded-lg shadow-xl z-50","max-h-[200px] overflow-y-auto",g?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:p.map((E,W)=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>xe(E),className:b("w-full flex items-center gap-3 px-3 py-2 text-left transition-colors",W===x?g?"bg-white/10":"bg-gray-100":g?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:E.color||"#8B5CF6"},children:Fg(E.name)}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:b("text-sm font-medium truncate",g?"text-white":"text-gray-900"),children:E.name}),E.email&&jsxRuntime.jsx("p",{className:b("text-xs truncate",g?"text-[#6B7280]":"text-gray-500"),children:E.email})]})]},E.id))})})]})]})]})}function Od({content:e,theme:t="dark"}){let a=t==="dark",r=[],o=/@(\S+)/g,s=0,n;for(;(n=o.exec(e))!==null;)n.index>s&&r.push({type:"text",value:e.slice(s,n.index)}),r.push({type:"mention",value:n[0]}),s=n.index+n[0].length;return s<e.length&&r.push({type:"text",value:e.slice(s)}),jsxRuntime.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.map((l,m)=>l.type==="mention"?jsxRuntime.jsx("span",{className:b("inline-flex items-center px-1 py-0.5 rounded","font-medium text-sm",a?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:l.value},m):jsxRuntime.jsx("span",{children:l.value},m))})}var Nn=["#EF4444","#F97316","#F59E0B","#EAB308","#84CC16","#22C55E","#10B981","#14B8A6","#06B6D4","#0EA5E9","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899"];function Sr({selectedTags:e,availableTags:t,onChange:a,onCreateTag:r,theme:o,disabled:s=false,compact:n=true}){let[l,m]=react.useState(false),[i,c]=react.useState(""),[d,u]=react.useState(false),[f,y]=react.useState(Nn[10]||"#3B82F6"),[k,g]=react.useState({top:0,left:0}),v=react.useRef(null),h=react.useRef(null),p=react.useRef(null),w=react.useRef(null),x=t.filter(N=>N.name.toLowerCase().includes(i.toLowerCase())),S=t.some(N=>N.name.toLowerCase()===i.toLowerCase());react.useEffect(()=>{if(l&&h.current){let N=h.current.getBoundingClientRect();g({top:N.bottom+6,left:N.left});}},[l]),react.useEffect(()=>{let N=z=>{let R=z.target,_=v.current?.contains(R),se=p.current?.contains(R);!_&&!se&&(m(false),c(""),u(false));};if(l)return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[l]),react.useEffect(()=>{l&&w.current&&w.current.focus();},[l]);let T=N=>{let z=e.some(R=>R.id===N.id);a(z?e.filter(R=>R.id!==N.id):[...e,N]);},C=async()=>{if(!(!r||!i.trim())){u(true);try{let N=await r(i.trim(),f);N&&(a([...e,N]),c(""),y(Nn[Math.floor(Math.random()*Nn.length)]||"#3B82F6"));}finally{u(false);}}},A=(N,z)=>{z.stopPropagation(),a(e.filter(R=>R.id!==N));},I={backgroundColor:`${o.textTertiary}15`,border:`1px solid ${o.borderLight}`,color:o.textSecondary};return jsxRuntime.jsxs("div",{ref:v,className:"relative",children:[jsxRuntime.jsxs("button",{ref:h,type:"button",onClick:()=>!s&&m(!l),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:I,disabled:s,children:[jsxRuntime.jsx(lucideReact.Tag,{className:"w-3.5 h-3.5"}),e.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[e.slice(0,2).map(N=>jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`${N.color}20`,color:N.color},children:N.name},N.id)),e.length>2&&jsxRuntime.jsxs("span",{className:"text-xs",style:{color:o.textTertiary},children:["+",e.length-2]})]}):jsxRuntime.jsx("span",{children:"Agregar"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:o.textTertiary}})]}),typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:l&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:p,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:k.top,left:k.left,zIndex:99999,backgroundColor:o.bgPrimary,border:`1px solid ${o.border}`,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.25)"},children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:o.border},children:jsxRuntime.jsx("input",{ref:w,type:"text",value:i,onChange:N=>c(N.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:N=>{N.key==="Enter"&&i.trim()&&!S&&r&&C();}})}),e.length>0&&jsxRuntime.jsxs("div",{className:"p-2 border-b",style:{borderColor:o.border},children:[jsxRuntime.jsx("p",{className:"text-xs mb-1.5",style:{color:o.textTertiary},children:"Seleccionadas"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.map(N=>jsxRuntime.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:`${N.color}20`,color:N.color},onClick:z=>A(N.id,z),children:[N.name,jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})]},N.id))})]}),jsxRuntime.jsx("div",{className:"max-h-[200px] overflow-y-auto p-1",children:x.length>0?x.map(N=>{let z=e.some(R=>R.id===N.id);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>T(N),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors",style:{backgroundColor:z?`${N.color}15`:"transparent",color:o.textPrimary},onMouseEnter:R=>{z||(R.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:R=>{z||(R.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:N.color}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:N.name}),z&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:N.color}})]},N.id)}):i.trim()?jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No se encontraron etiquetas"}):jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No hay etiquetas disponibles"})}),i.trim()&&!S&&r&&jsxRuntime.jsxs("div",{className:"p-2 border-t",style:{borderColor:o.border},children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-2",children:jsxRuntime.jsx("p",{className:"text-xs",style:{color:o.textTertiary},children:"Crear nueva etiqueta"})}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Nn.map(N=>jsxRuntime.jsx("button",{type:"button",onClick:()=>y(N),className:"w-5 h-5 rounded-full transition-transform hover:scale-110",style:{backgroundColor:N,outline:f===N?`2px solid ${N}`:"none",outlineOffset:"2px"}},N))}),jsxRuntime.jsxs("button",{type:"button",onClick:C,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:f,color:"#FFFFFF",opacity:d?.7:1},children:[d?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),'Crear "',i.trim(),'"']})]})]})}),document.body)]})}function Vs({tag:e,onRemove:t,size:a="sm"}){return jsxRuntime.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&&jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t();},className:"hover:opacity-70",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function Ud({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 jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.map(s=>jsxRuntime.jsx(Vs,{tag:s,size:a},s.id)),o>0&&jsxRuntime.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 Jr=[{name:"Azul",value:"#6366F1",light:"#818CF8"},{name:"P\xFArpura",value:"#A855F7",light:"#C084FC"},{name:"Rosa",value:"#EC4899",light:"#F472B6"},{name:"Rojo",value:"#EF4444",light:"#F87171"},{name:"Naranja",value:"#F59E0B",light:"#FBBF24"},{name:"Amarillo",value:"#EAB308",light:"#FACC15"},{name:"Lima",value:"#84CC16",light:"#A3E635"},{name:"Verde",value:"#10B981",light:"#34D399"},{name:"Esmeralda",value:"#059669",light:"#10B981"},{name:"Cyan",value:"#06B6D4",light:"#22D3EE"},{name:"Azul Cielo",value:"#0EA5E9",light:"#38BDF8"},{name:"\xCDndigo",value:"#4F46E5",light:"#6366F1"},{name:"Violeta",value:"#8B5CF6",light:"#A78BFA"},{name:"Fucsia",value:"#D946EF",light:"#E879F9"},{name:"Coral",value:"#F97316",light:"#FB923C"},{name:"Magenta",value:"#E11D48",light:"#FB7185"}];function Kd(e,t=[]){if("title"in e&&!("name"in e)){let a=e,r=(a.assignedUserIds||[]).map(o=>{let s=t.find(n=>n.id===o);return s||null}).filter(o=>o!==null);return {id:a.id,name:a.title,startDate:a.startDate?new Date(a.startDate):void 0,endDate:a.endDate?new Date(a.endDate):void 0,progress:a.progress||0,status:a.columnId,priority:a.priority?.toLowerCase(),assignees:r,dependencies:Array.isArray(a.dependencies)?a.dependencies.map(o=>typeof o=="string"?o:o.taskId):[],tags:a.tags,subtasks:a.subtasks?.map(o=>({id:o.id,name:o.title,progress:o.completed?100:0,startDate:new Date,endDate:new Date})),color:a.color,description:a.description}}return e}function rf(e,t){return {...t,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,priority:e.priority?.toUpperCase(),tags:e.tags,description:e.description,color:e.color,columnId:e.status,assignedUserIds:t.assignedUserIds,dependencies:e.dependencies}}function fr({task:e,isOpen:t,onClose:a,onTaskUpdate:r,onCardUpdate:o,theme:s="dark",locale:n="es",availableUsers:l=[],availableTags:m=[],onCreateTag:i,attachments:c=[],onUploadAttachments:d,onDeleteAttachment:u,availableTasks:f=[],comments:y=[],onAddComment:k,currentUser:g,mentionableUsers:v=[],onUploadCommentAttachments:h}){let p=s==="dark",w={textTertiary:p?"#6B7280":"#9CA3AF",textSecondary:p?"#9CA3AF":"#6B7280",textPrimary:p?"#FFFFFF":"#111827",borderLight:p?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:p?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:p?"#1A1D25":"#FFFFFF",bgSecondary:p?"#0F1117":"#F9FAFB",hoverBg:p?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},x=e&&"title"in e&&!("name"in e),S=e,[T,C]=react.useState(e?Kd(e,l):null),[A,I]=react.useState(false),[N,z]=react.useState(false),[R,_]=react.useState(false),[se,te]=react.useState(null),[ie,xe]=react.useState(new Date),[Ne,Ae]=react.useState(false),[F,B]=react.useState(false),[E,W]=react.useState(""),[q,pe]=react.useState(false),[fe,Ce]=react.useState(false),[Y,V]=react.useState(false),[Oe,ue]=react.useState(""),Le=react.useRef(null),Je=react.useRef(null),[st,Ge]=react.useState(""),bt=react.useRef(null),[ut,Pt]=react.useState(""),[ge,L]=react.useState(false),[re,Te]=react.useState([]),[Ue,Z]=react.useState(""),[Re,H]=react.useState(false),K=react.useRef(null);react.useEffect(()=>{if(e){let D=Kd(e,l);C(D),ue(D.description||""),Ge(D.name||"");}},[e?.id,l]),react.useEffect(()=>{if(!t||!Oe)return;let D=setTimeout(()=>{let Q=Je.current;Q&&(Q.style.height="auto",Q.style.height=`${Math.max(100,Q.scrollHeight)}px`);},50);return ()=>clearTimeout(D)},[t,Oe]),react.useEffect(()=>()=>{Le.current&&clearTimeout(Le.current),bt.current&&clearTimeout(bt.current);},[]),react.useEffect(()=>{t&&K.current&&y.length>0&&setTimeout(()=>{K.current&&(K.current.scrollTop=K.current.scrollHeight);},100);},[t,y.length]);let ke=react.useCallback(D=>{C(D),x&&o&&S?o(rf(D,S)):r&&r(D);},[x,S,o,r]),Ie=react.useCallback(()=>{I(false),z(false),_(false),te(null),B(false),W(""),pe(false);},[]),_e=react.useCallback((D,Q)=>{if(!T)return;let ce={...T,[D]:Q};ke(ce);},[T,ke]),We=react.useCallback(()=>{let D=Je.current;D&&(D.style.height="auto",D.style.height=`${Math.max(100,D.scrollHeight)}px`);},[]),ne=react.useCallback(D=>{ue(D),setTimeout(We,0),Le.current&&clearTimeout(Le.current),Le.current=setTimeout(()=>{if(T){let Q={...T,description:D};ke(Q);}},800);},[T,ke,We]),Be=react.useCallback(D=>{Ge(D),bt.current&&clearTimeout(bt.current),bt.current=setTimeout(()=>{if(T&&D.trim()){let Q={...T,name:D.trim()};ke(Q);}},800);},[T,ke]),ee=react.useCallback(D=>{let Q=D.map(ce=>{let Xe={id:`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,file:ce};return ce.type.startsWith("image/")&&(Xe.preview=URL.createObjectURL(ce)),Xe});Te(ce=>[...ce,...Q]);},[]),Ye=react.useCallback(D=>{Te(Q=>{let ce=Q.find(Xe=>Xe.id===D);return ce?.preview&&URL.revokeObjectURL(ce.preview),Q.filter(Xe=>Xe.id!==D)});},[]),Pa=react.useCallback(async()=>{if(!(!T||!ut.trim()&&re.length===0||!k)){L(true);try{let D=Bd(ut,v),Q=[];if(re.length>0&&h){let ce=re.map(Xe=>Xe.file);Q=await h(ce);}await k(T.id,ut.trim(),D.length>0?D:void 0,Q.length>0?Q:void 0),Pt(""),re.forEach(ce=>{ce.preview&&URL.revokeObjectURL(ce.preview);}),Te([]);}finally{L(false);}}},[T,ut,re,k,v,h]),be=react.useCallback(()=>{if(!T||!Ue.trim())return;let D={id:`subtask-${Date.now()}-${Math.random().toString(36).slice(2)}`,name:Ue.trim(),progress:0,startDate:new Date,endDate:new Date},Q=[...T.subtasks||[],D],ce={...T,subtasks:Q};ke(ce),Z(""),H(false);},[T,Ue,ke]),qe=react.useCallback(D=>{if(!T?.subtasks)return;let Q=T.subtasks.map(Xe=>Xe.id===D?{...Xe,progress:Xe.progress===100?0:100}:Xe),ce={...T,subtasks:Q};ke(ce);},[T,ke]),He=react.useCallback(D=>{if(!T?.subtasks)return;let Q=T.subtasks.filter(Xe=>Xe.id!==D),ce={...T,subtasks:Q};ke(ce);},[T,ke]),Ze=react.useCallback(D=>{let Q=typeof D=="string"?new Date(D):D,Xe=new Date().getTime()-Q.getTime(),Ft=Math.floor(Xe/6e4),Zt=Math.floor(Xe/36e5),Dt=Math.floor(Xe/864e5);return Ft<1?n==="es"?"Ahora":"Just now":Ft<60?n==="es"?`Hace ${Ft} min`:`${Ft}m ago`:Zt<24?n==="es"?`Hace ${Zt}h`:`${Zt}h ago`:Dt<7?n==="es"?`Hace ${Dt}d`:`${Dt}d ago`:Q.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})},[n]),rt=react.useCallback(D=>{if(!T)return;let Q=T.progress||0;D==="completed"?Q=100:D==="in-progress"&&Q===0?Q=10:D==="todo"&&(Q=0);let ce={...T,status:D,progress:Q};ke(ce),I(false);},[T,ke]),it=react.useCallback((D,Q)=>{if(!T)return;let ce={...T,startDate:D,endDate:Q};ke(ce);},[T,ke]),G=react.useCallback(()=>{let D=ie.getFullYear(),Q=ie.getMonth(),ce=new Date(D,Q,1),Ft=new Date(D,Q+1,0).getDate(),Zt=ce.getDay(),Dt=[],de=new Date(D,Q,0).getDate();for(let Ve=Zt-1;Ve>=0;Ve--)Dt.push({date:new Date(D,Q-1,de-Ve),isCurrentMonth:false});for(let Ve=1;Ve<=Ft;Ve++)Dt.push({date:new Date(D,Q,Ve),isCurrentMonth:true});let Qe=42-Dt.length;for(let Ve=1;Ve<=Qe;Ve++)Dt.push({date:new Date(D,Q+1,Ve),isCurrentMonth:false});return Dt},[ie]),X=react.useCallback(async D=>{if(D.preventDefault(),D.stopPropagation(),Ce(false),!T||!d)return;let Q=Array.from(D.dataTransfer.files);if(Q.length!==0){V(true);try{await d(T.id,Q);}finally{V(false);}}},[T,d]),Pe=react.useCallback(async D=>{if(!T||!d||!D.target.files)return;let Q=Array.from(D.target.files);if(Q.length!==0){V(true);try{await d(T.id,Q);}finally{V(false);}D.target.value="";}},[T,d]),Ke=react.useCallback(D=>{D.preventDefault(),D.stopPropagation(),Ce(true);},[]),ze=react.useCallback(D=>{D.preventDefault(),D.stopPropagation(),Ce(false);},[]),U=react.useCallback(D=>D<1024?`${D} B`:D<1024*1024?`${(D/1024).toFixed(1)} KB`:`${(D/(1024*1024)).toFixed(1)} MB`,[]),le=react.useCallback(D=>D.startsWith("image/")?lucideReact.Image:D.includes("pdf")||D.includes("document")?lucideReact.FileText:lucideReact.File,[]);return !t||!T?null:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:t&&T&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a,className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:b("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",p?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:b("px-6 py-3 border-b flex items-center gap-3",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:b("w-4 h-4",p?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:b("text-xs px-2 py-0.5 rounded",p?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[n==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:b("text-xs font-mono",p?"text-[#6B7280]":"text-gray-400"),children:T.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:b("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",p?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:b("p-1.5 rounded transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:b("p-1.5 rounded transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:a,className:b("p-1.5 rounded transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let D=T.progress===100?0:100,ce={...T,progress:D,status:D===100?"completed":"todo"};ke(ce);},className:b("mt-2 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors flex-shrink-0",T.progress===100?"bg-green-500 border-green-500":p?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:T.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("input",{type:"text",value:st,onChange:D=>Be(D.target.value),placeholder:n==="es"?"Nombre de la tarea...":"Task name...",className:b("text-xl font-semibold flex-1 bg-transparent outline-none border-none px-0 py-0","focus:ring-0 focus:outline-none",T.progress===100?"line-through text-[#6B7280]":p?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"px-6 pb-6 flex-1 overflow-y-auto overflow-x-visible",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-12 gap-y-5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{Ie(),I(!A);},className:b("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",T.progress===100||T.status==="completed"?"bg-green-500/20 text-green-400":T.progress&&T.progress>0||T.status==="in-progress"?"bg-blue-500/20 text-blue-400":p?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:T.progress===100||T.status==="completed"?n==="es"?"COMPLETADO":"DONE":T.progress&&T.progress>0||T.status==="in-progress"?n==="es"?"EN PROGRESO":"IN PROGRESS":n==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:A&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>I(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:n==="es"?"Por hacer":"To Do",color:"bg-gray-400"},{id:"in-progress",label:n==="es"?"En progreso":"In Progress",color:"bg-blue-500"},{id:"completed",label:n==="es"?"Completado":"Done",color:"bg-green-500"}].map(D=>jsxRuntime.jsxs("button",{onClick:()=>rt(D.id),className:b("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",T.status===D.id&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:b("w-2 h-2 rounded-full",D.color)}),jsxRuntime.jsx("span",{className:p?"text-white":"text-gray-900",children:D.label})]},D.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{Ie(),_(!R);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[T.assignees&&T.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[T.assignees.slice(0,3).map((D,Q)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:D.color||"#8B5CF6"},title:D.name,children:D.initials||D.name.slice(0,2).toUpperCase()},Q)),T.assignees.length>3&&jsxRuntime.jsxs("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:["+",T.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:b("text-sm",p?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:b("w-3 h-3",p?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>_(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:l.length>0?l.map(D=>{let Q=T.assignees?.some(ce=>ce.name===D.name);return jsxRuntime.jsxs("button",{onClick:()=>{let ce=T.assignees||[],Xe;Q?Xe=ce.filter(Ft=>Ft.name!==D.name):Xe=[...ce,D],_e("assignees",Xe);},className:b("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",Q&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:D.color||"#8B5CF6"},children:D.initials||D.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:b("flex-1",p?"text-white":"text-gray-900"),children:D.name}),Q&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},D.name)}):jsxRuntime.jsx("div",{className:b("px-3 py-4 text-sm text-center",p?"text-[#6B7280]":"text-gray-500"),children:n==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{te(se?null:"start"),xe(T.startDate||new Date);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[T.startDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:b("mx-1",p?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),T.endDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Fin":"End")]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:se&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>te(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:b("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:D=>D.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:b("w-44 py-2 border-r",p?"border-white/10":"border-gray-200"),children:[(()=>{let D=new Date,Q=new Date(D);Q.setDate(D.getDate()+1);let ce=new Date(D);ce.setDate(D.getDate()+((6-D.getDay()+7)%7||7));let Xe=new Date(D);Xe.setDate(D.getDate()+((1-D.getDay()+7)%7||7));let Ft=new Date(D);Ft.setDate(D.getDate()+(6-D.getDay()+7)%7+7);let Zt=new Date(D);Zt.setDate(D.getDate()+14);let Dt=new Date(D);return Dt.setDate(D.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:D,display:D.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:Q,display:Q.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:ce,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:Xe,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Ft,display:Ft.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:Zt,display:Zt.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:Dt,display:Dt.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Qe,Ve)=>jsxRuntime.jsxs("button",{className:b("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",p?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(se==="start"){let ar=T.endDate&&Qe.date>T.endDate?Qe.date:T.endDate;it(Qe.date,ar),te("end");}else {let ar=T.startDate&&Qe.date<T.startDate?Qe.date:T.startDate;it(ar,Qe.date),te(null);}},children:[jsxRuntime.jsx("span",{children:Qe.label}),jsxRuntime.jsx("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:Qe.display})]},Ve))})(),jsxRuntime.jsx("div",{className:b("border-t mt-2 pt-2",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{it(void 0,void 0),te(null);},className:b("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",p?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:b("text-xs mb-3 px-2 py-1 rounded",p?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:se==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:b("font-medium",p?"text-white":"text-gray-900"),children:ie.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>xe(new Date),className:b("p-1 rounded text-sm transition-colors",p?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>xe(new Date(ie.getFullYear(),ie.getMonth()-1)),className:b("p-1 rounded",p?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),jsxRuntime.jsx("button",{onClick:()=>xe(new Date(ie.getFullYear(),ie.getMonth()+1)),className:b("p-1 rounded",p?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(D=>jsxRuntime.jsx("div",{className:b("w-8 h-8 flex items-center justify-center text-xs",p?"text-[#6B7280]":"text-gray-400"),children:D},D))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:G().map((D,Q)=>{let ce=D.date.toDateString()===new Date().toDateString(),Xe=T.startDate?.toDateString()===D.date.toDateString(),Ft=T.endDate?.toDateString()===D.date.toDateString(),Zt=Xe||Ft,Dt=T.startDate&&T.endDate&&D.date>=T.startDate&&D.date<=T.endDate;return jsxRuntime.jsx("button",{onClick:()=>{let de=new Date(D.date);if(se==="start"){let Qe=T.endDate&&de>T.endDate?de:T.endDate;it(de,Qe),te("end");}else {let Qe=T.startDate&&de<T.startDate?de:T.startDate;it(Qe,de),te(null);}},className:b("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!D.isCurrentMonth&&(p?"text-[#4B5563]":"text-gray-300"),D.isCurrentMonth&&(p?"text-white":"text-gray-900"),ce&&"ring-2 ring-[#3B82F6]",Xe&&"bg-[#3B82F6] text-white",Ft&&!Xe&&"bg-[#7C3AED] text-white",Dt&&!Zt&&(p?"bg-[#7C3AED]/20":"bg-purple-100"),!Zt&&(p?"hover:bg-white/10":"hover:bg-gray-100")),children:D.date.getDate()},Q)})})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{Ie(),z(!N);},className:b("text-xs px-2 py-1 rounded font-medium transition-all hover:ring-2 hover:ring-white/20",T.priority==="high"||T.priority==="urgent"?"bg-red-500/20 text-red-400":T.priority==="medium"?"bg-yellow-500/20 text-yellow-400":T.priority==="low"?"bg-green-500/20 text-green-400":p?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:T.priority?T.priority==="high"||T.priority==="urgent"?n==="es"?"Alta":"High":T.priority==="medium"?n==="es"?"Media":"Medium":n==="es"?"Baja":"Low":n==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:N&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>z(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:n==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:n==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:n==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:n==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:n==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(D=>jsxRuntime.jsxs("button",{onClick:()=>{_e("priority",D.id),z(false);},className:b("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",T.priority===D.id&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:b("w-2 h-2 rounded-full",D.color)}),jsxRuntime.jsx("span",{className:p?"text-white":"text-gray-900",children:D.label})]},D.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-white":"text-gray-900"),children:T.startDate&&T.endDate?`${Math.ceil((T.endDate.getTime()-T.startDate.getTime())/(1e3*60*60*24))} ${n==="es"?"d\xEDas":"days"}`:n==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:b("w-4 h-4 rounded-full border-2",p?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[Ne?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:T.progress||0,onChange:D=>{let Q=parseInt(D.target.value),ce=T.status;Q===100?ce="completed":Q>0?ce="in-progress":ce="todo";let Xe={...T,progress:Q,status:ce};ke(Xe);},onBlur:()=>Ae(false),className:b("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",p?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>Ae(true),className:b("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",p?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:b("h-full rounded-full transition-all",T.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${T.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:b("text-sm font-medium min-w-[40px]",p?"text-white":"text-gray-900"),children:[T.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(Sr,{selectedTags:T.tags||[],availableTags:m,onChange:D=>{_e("tags",D);},onCreateTag:i,theme:w})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:b("w-4 h-4 mt-1.5",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24 mt-1",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[T.dependencies&&T.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:T.dependencies.map(D=>{let Q=f.find(ce=>ce.id===D);return jsxRuntime.jsxs("span",{className:b("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",p?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:[Q?.name||D.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let ce=(T.dependencies||[]).filter(Xe=>Xe!==D);_e("dependencies",ce);},className:b("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},D)})}),jsxRuntime.jsxs("button",{onClick:()=>{Ie(),B(!F);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:F&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{B(false),W("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:b("p-2 border-b",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:E,onChange:D=>W(D.target.value),placeholder:n==="es"?"Buscar tarea...":"Search task...",className:b("w-full px-3 py-2 rounded-md text-sm outline-none",p?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:f.length>0?f.filter(D=>D.id!==T.id).filter(D=>E===""||D.name.toLowerCase().includes(E.toLowerCase())).map(D=>{let Q=T.dependencies?.includes(D.id);return jsxRuntime.jsxs("button",{onClick:()=>{let ce=T.dependencies||[],Xe;Q?Xe=ce.filter(Ft=>Ft!==D.id):Xe=[...ce,D.id],_e("dependencies",Xe);},className:b("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",Q&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:b("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",Q?"bg-blue-500 border-blue-500":p?"border-white/30":"border-gray-300"),children:Q&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:b("block truncate",p?"text-white":"text-gray-900"),children:D.name}),jsxRuntime.jsx("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:D.id.slice(0,8)})]})]},D.id)}):jsxRuntime.jsx("div",{className:b("px-3 py-4 text-sm text-center",p?"text-[#6B7280]":"text-gray-500"),children:n==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{Ie(),pe(!q);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:T.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-white":"text-gray-900"),children:Jr.find(D=>D.value===T.color)?.name||(n==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:b("w-3 h-3",p?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:q&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>pe(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:Jr.map(D=>{let Q=T.color===D.value;return jsxRuntime.jsx("button",{onClick:()=>{_e("color",D.value),pe(false);},className:b("w-7 h-7 rounded-full flex items-center justify-center transition-all",Q&&"ring-2 ring-offset-2",p?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:D.value,outlineColor:Q?D.value:void 0},title:D.name,children:Q&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},D.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:T.isMilestone||false,onChange:D=>_e("isMilestone",D.target.checked),className:b("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",T.isMilestone?"bg-purple-500 border-purple-500":p?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-white":"text-gray-900"),children:n==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:b("mt-6 pt-4 border-t",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:b("text-sm font-semibold",p?"text-white":"text-gray-900"),children:n==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{ref:Je,value:Oe,onChange:D=>ne(D.target.value),placeholder:n==="es"?"Agregar descripci\xF3n...":"Add description...",className:b("w-full min-h-[100px] max-h-[400px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors overflow-y-auto",p?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")}),jsxRuntime.jsxs("button",{className:b("flex items-center gap-2 text-sm mt-2 transition-colors",p?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),n==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:b("mt-6 pt-4 border-t",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("div",{className:"flex items-center justify-between mb-3",children:jsxRuntime.jsxs("h3",{className:b("text-sm font-semibold",p?"text-white":"text-gray-900"),children:[n==="es"?"Subtareas":"Subtasks",T.subtasks&&T.subtasks.length>0&&jsxRuntime.jsxs("span",{className:b("ml-2 text-xs font-normal",p?"text-[#6B7280]":"text-gray-400"),children:["(",T.subtasks.filter(D=>D.progress===100).length,"/",T.subtasks.length,")"]})]})}),T.subtasks&&T.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:T.subtasks.map(D=>jsxRuntime.jsxs("div",{className:b("flex items-center gap-2 group p-2 rounded-lg -mx-2 transition-colors",p?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("button",{onClick:()=>qe(D.id),className:b("w-5 h-5 rounded border flex items-center justify-center flex-shrink-0 transition-colors",D.progress===100?"bg-green-500 border-green-500":p?"border-white/20 hover:border-green-500/50":"border-gray-300 hover:border-green-500"),children:D.progress===100&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:b("text-sm flex-1",D.progress===100?"line-through text-[#6B7280]":p?"text-white":"text-gray-900"),children:D.name}),jsxRuntime.jsx("button",{onClick:()=>He(D.id),className:b("p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",p?"hover:bg-white/10 text-[#6B7280] hover:text-red-400":"hover:bg-gray-100 text-gray-400 hover:text-red-500"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-3.5 h-3.5"})})]},D.id))}),Re?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:Ue,onChange:D=>Z(D.target.value),onKeyDown:D=>{D.key==="Enter"&&Ue.trim()?be():D.key==="Escape"&&(H(false),Z(""));},placeholder:n==="es"?"Nombre de la subtarea...":"Subtask name...",autoFocus:true,className:b("flex-1 px-3 py-2 rounded-lg text-sm outline-none transition-colors",p?"bg-white/5 border border-white/10 text-white placeholder:text-[#6B7280] focus:border-blue-500/50":"bg-gray-50 border border-gray-200 text-gray-900 placeholder:text-gray-400 focus:border-blue-500")}),jsxRuntime.jsx("button",{onClick:be,disabled:!Ue.trim(),className:b("px-3 py-2 rounded-lg text-sm font-medium transition-colors",Ue.trim()?"bg-blue-500 hover:bg-blue-600 text-white":p?"bg-white/5 text-[#6B7280] cursor-not-allowed":"bg-gray-100 text-gray-400 cursor-not-allowed"),children:n==="es"?"Agregar":"Add"}),jsxRuntime.jsx("button",{onClick:()=>{H(false),Z("");},className:b("p-2 rounded-lg transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}):jsxRuntime.jsxs("button",{onClick:()=>H(true),className:b("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),n==="es"?"Agregar subtarea":"Add subtask"]})]}),jsxRuntime.jsxs("div",{className:b("mt-6 pt-4 border-t",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:b("text-sm font-semibold mb-3",p?"text-white":"text-gray-900"),children:[n==="es"?"Adjuntos":"Attachments",c.length>0&&jsxRuntime.jsxs("span",{className:b("ml-2 text-xs font-normal",p?"text-[#6B7280]":"text-gray-400"),children:["(",c.length,")"]})]}),c.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:c.map(D=>{let Q=le(D.type),ce=D.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:b("flex items-center gap-3 p-2 rounded-lg group transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[ce&&D.thumbnailUrl?jsxRuntime.jsx("img",{src:D.thumbnailUrl,alt:D.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:b("w-10 h-10 rounded flex items-center justify-center",p?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(Q,{className:b("w-5 h-5",p?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:D.url,target:"_blank",rel:"noopener noreferrer",className:b("text-sm font-medium truncate block hover:underline",p?"text-white":"text-gray-900"),children:D.name}),jsxRuntime.jsx("p",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:U(D.size)})]}),u&&jsxRuntime.jsx("button",{onClick:()=>u(D.id),className:b("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",p?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:n==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},D.id)})}),jsxRuntime.jsxs("div",{onDragOver:Ke,onDragLeave:ze,onDrop:X,className:b("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",fe?p?"border-blue-500 bg-blue-500/10":"border-blue-400 bg-blue-50":p?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",Y&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:Pe,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!d||Y}),Y?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:b("w-6 h-6 mx-auto mb-2",fe?"text-blue-500":p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-500"),children:fe?n==="es"?"Suelta los archivos aqu\xED":"Drop files here":n==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!d&&jsxRuntime.jsx("p",{className:b("text-xs mt-1",p?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:b("w-80 border-l flex flex-col",p?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:b("px-4 py-3 border-b",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("h3",{className:b("text-sm font-semibold",p?"text-white":"text-gray-900"),children:[n==="es"?"Actividad":"Activity",y.length>0&&jsxRuntime.jsxs("span",{className:b("ml-2 text-xs font-normal",p?"text-[#6B7280]":"text-gray-400"),children:["(",y.length,")"]})]})}),jsxRuntime.jsx("div",{ref:K,className:b("flex-1 overflow-y-auto py-4 pl-4 pr-2",p?"scrollbar-slim":"scrollbar-slim-light"),children:y.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:[...y].sort((D,Q)=>{let ce=typeof D.createdAt=="string"?new Date(D.createdAt):D.createdAt,Xe=typeof Q.createdAt=="string"?new Date(Q.createdAt):Q.createdAt;return ce.getTime()-Xe.getTime()}).map(D=>jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:D.user?.color||"#8B5CF6"},children:D.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:b("text-sm font-medium",p?"text-white":"text-gray-900"),children:D.user?.name||(n==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:Ze(D.createdAt)})]}),jsxRuntime.jsx("div",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-600"),children:jsxRuntime.jsx(Od,{content:D.content,theme:s})}),D.attachments&&D.attachments.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:D.attachments.map(Q=>{let ce=Q.type.startsWith("image/");return jsxRuntime.jsxs("a",{href:Q.url,target:"_blank",rel:"noopener noreferrer",className:b("flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[ce?jsxRuntime.jsx(lucideReact.Image,{className:b("w-4 h-4",p?"text-[#9CA3AF]":"text-gray-500")}):jsxRuntime.jsx(lucideReact.File,{className:b("w-4 h-4",p?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsx("span",{className:b("text-xs truncate max-w-[100px]",p?"text-white":"text-gray-900"),children:Q.name})]},Q.id)})})]})]},D.id))}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:b("w-10 h-10 mb-3",p?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:b("text-sm",p?"text-[#6B7280]":"text-gray-500"),children:n==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:b("py-4 pl-4 pr-2 border-t",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx(Rd,{value:ut,onChange:Pt,onSubmit:Pa,users:v,placeholder:n==="es"?"Escribe un comentario... (usa @ para mencionar)":"Write a comment... (use @ to mention)",disabled:!k,isSubmitting:ge,theme:s,locale:n,currentUser:g,enableEmoji:true,enableAttachments:!!h,pendingFiles:re,onFilesSelect:ee,onRemoveFile:Ye})})]})]})]})})}function Ks(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function Mr({board:e,callbacks:t,onCardClick:a,renderProps:r,config:o,availableUsers:s=[],className:n,style:l,isLoading:m,error:i,children:c,availableTags:d=[],onCreateTag:u,attachmentsByCard:f,onUploadAttachments:y,onDeleteAttachment:k,comments:g,onAddComment:v,currentUser:h,mentionableUsers:p,onTaskOpen:w,onUploadCommentAttachments:x}){let[S,T]=Ks(),[C,A]=react.useState(null),[I,N]=react.useState(false),z=react.useRef(null),R=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),_=o?.theme||"dark",se=_==="dark"||_==="neutral",te=se?"dark":"",ie=react.useCallback((Y,V)=>{t.onCardUpdate?.(Y,V);},[t]),xe=react.useCallback((Y,V)=>{t.onColumnUpdate?.(Y,{title:V});},[t]),Ne=react.useCallback(Y=>{t.onColumnDelete?.(Y);},[t]),Ae=["todo","in-progress","completed"],F=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),B=react.useMemo(()=>{let Y=new Map;return e.columns.forEach(V=>{let Oe=V.cardIds.map(ue=>e.cards.find(Le=>Le.id===ue)).filter(ue=>ue!==void 0).sort((ue,Le)=>ue.position-Le.position);Y.set(V.id,Oe);}),Y},[e.cards,e.columns]);react.useEffect(()=>{let Y=z.current;if(!Y)return;let V=Je=>{let st=Je.target,Ge=Je.button===1,bt=st===Y||st.classList.contains("asakaa-column")&&!st.closest(".asakaa-card");(Ge||Je.button===0&&bt&&!S.isDragging)&&(Je.preventDefault(),N(true),R.current={x:Je.clientX,y:Je.clientY,scrollLeft:Y.scrollLeft,scrollTop:Y.scrollTop},Y.style.cursor="grabbing",Y.style.userSelect="none");},Oe=Je=>{if(!I)return;let st=Je.clientX-R.current.x,Ge=Je.clientY-R.current.y;Y.scrollLeft=R.current.scrollLeft-st,Y.scrollTop=R.current.scrollTop-Ge;},ue=()=>{I&&(N(false),Y.style.cursor="",Y.style.userSelect="");},Le=()=>{I&&(N(false),Y.style.cursor="",Y.style.userSelect="");};return Y.addEventListener("mousedown",V),document.addEventListener("mousemove",Oe),document.addEventListener("mouseup",ue),Y.addEventListener("mouseleave",Le),()=>{Y.removeEventListener("mousedown",V),document.removeEventListener("mousemove",Oe),document.removeEventListener("mouseup",ue),Y.removeEventListener("mouseleave",Le);}},[I,S.isDragging]);let E=react.useMemo(()=>e.cards.map(Y=>({id:Y.id,name:Y.title,startDate:Y.startDate?new Date(Y.startDate):void 0,endDate:Y.endDate?new Date(Y.endDate):void 0,progress:Y.progress||0,status:Y.columnId,priority:Y.priority?.toLowerCase(),dependencies:Array.isArray(Y.dependencies)?Y.dependencies.map(V=>typeof V=="string"?V:V.taskId):[]})),[e.cards]),W=react.useCallback(Y=>{let{active:V}=Y,Oe=e.cards.find(ue=>ue.id===V.id);Oe&&T({isDragging:true,draggedCardId:Oe.id,sourceColumnId:Oe.columnId,targetColumnId:Oe.columnId});},[e.cards,T]),q=react.useCallback(Y=>{let{active:V,over:Oe}=Y;if(!Oe||!e.cards.find(Je=>Je.id===V.id))return;let Le=null;Oe.data.current?.type==="column"?Le=Oe.id:Oe.data.current?.type==="card"&&(Le=e.cards.find(st=>st.id===Oe.id)?.columnId||null),Le&&Le!==S.targetColumnId&&T({...S,targetColumnId:Le});},[e.cards,S,T]),pe=react.useCallback(async Y=>{let{active:V,over:Oe}=Y;if(T({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!Oe)return;let ue=e.cards.find(Ge=>Ge.id===V.id);if(!ue)return;let Le,Je;if(Oe.data.current?.type==="column"){Le=Oe.id;let Ge=B.get(Le)||[];Je=Is(Ge,0);}else {let Ge=e.cards.find(Pt=>Pt.id===Oe.id);if(!Ge)return;Le=Ge.columnId;let bt=B.get(Le)||[],ut=bt.findIndex(Pt=>Pt.id===Oe.id);Je=Is(bt,ut);}let st=e.columns.find(Ge=>Ge.id===Le);if(st&&st.wipLimit&&st.wipLimitType==="hard"){let Ge=B.get(Le)||[];if(ue.columnId!==Le&&Ge.length>=st.wipLimit){t.onWipLimitExceeded?.(st,ue);return}}(ue.columnId!==Le||ue.position!==Je)&&await t.onCardMove?.(ue.id,Le,Je);},[e.cards,e.columns,B,t,T]),fe=react.useCallback(Y=>{A(Y),a?.(Y),w?.(Y.id);},[a,w]),Ce=react.useCallback(Y=>{t.onCardUpdate?.(Y.id,Y),A(Y);},[t]);return m?jsxRuntime.jsx("div",{className:b("asakaa-board",te,n),style:l,children:jsxRuntime.jsx(bf,{columnCount:3})}):i?jsxRuntime.jsx("div",{className:b("asakaa-board",te,n),style:l,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof i=="string"?i:i.message})]})})}):jsxRuntime.jsxs(pd,{themeName:_,children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:F,collisionDetection:core$1.closestCorners,onDragStart:W,onDragOver:q,onDragEnd:pe,children:[jsxRuntime.jsxs("div",{ref:z,className:b("asakaa-board",te,n),style:{...l,cursor:I?"grabbing":void 0},"data-theme":_,children:[e.columns.sort((Y,V)=>Y.position-V.position).map(Y=>{let V=B.get(Y.id)||[],Oe=!Ae.includes(Y.id);return jsxRuntime.jsx(bo,{column:Y,cards:V,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,onCardClick:fe,onCardUpdate:ie,onColumnRename:xe,onColumnDelete:Ne,isDeletable:Oe,availableUsers:s,allCards:e.cards,enableVirtualization:o?.enableVirtualization,cardHeight:o?.cardHeight},Y.id)}),c]}),jsxRuntime.jsx(core$1.DragOverlay,{children:S.draggedCardId?jsxRuntime.jsx(gr,{card:e.cards.find(Y=>Y.id===S.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),jsxRuntime.jsx(fr,{task:C,isOpen:!!C,onClose:()=>A(null),onCardUpdate:Ce,theme:se?"dark":"light",locale:o?.locale==="es"?"es":"en",availableUsers:s,availableTags:d,onCreateTag:u,attachments:C?f?.get(C.id)||[]:[],onUploadAttachments:y,onDeleteAttachment:k,availableTasks:E,comments:g,onAddComment:v,currentUser:h,mentionableUsers:p,onUploadCommentAttachments:x})]})}function bf({columnCount:e}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,a)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},a))})}var kf={bgGrid:"#0F1117",bgSecondary:"#1A1D25",border:"rgba(255, 255, 255, 0.1)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"#E5E7EB",textSecondary:"#9CA3AF",textTertiary:"#6B7280",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.15)",hoverBg:"rgba(255, 255, 255, 0.05)"},wf={bgGrid:"#FFFFFF",bgSecondary:"#F9FAFB",border:"rgba(0, 0, 0, 0.1)",borderLight:"rgba(0, 0, 0, 0.05)",textPrimary:"#111827",textSecondary:"#6B7280",textTertiary:"#9CA3AF",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},Cf={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},Tf={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Nf({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:o}){let[s,n]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let i=c=>{l.current&&!l.current.contains(c.target)&&n(false);};return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);let m=i=>{t(i),n(false);};return jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>n(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:o||r.newTask}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wider",style:{color:a.textTertiary},children:r.selectColumn}),e.sort((i,c)=>i.position-c.position).map((i,c)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>m(i.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:c<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:c*.03},children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color||a.accent}}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:i.title}),jsxRuntime.jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[i.cardIds.length," ",i.cardIds.length===1?"tarea":"tareas"]})]})]},i.id))]})})})]})}function Df({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:o}){let[s,n]=react.useState(false),[l,m]=react.useState(null),i=react.useRef(null);if(react.useEffect(()=>{let f=y=>{i.current&&!i.current.contains(y.target)&&n(false);};return s&&document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[s]),!(a||r||o))return null;let d=[{id:"csv",label:t.exportCSV,description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:o}].filter(f=>f.handler),u=async(f,y)=>{if(y){m(f);try{await y();}catch(k){console.error(`Export ${f} failed:`,k);}finally{m(null),n(false);}}};return jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>n(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:s?e.accent:e.bgSecondary,border:`1px solid ${s?e.accent:e.borderLight}`,color:s?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-44 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:d.map((f,y)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>u(f.id,f.handler),disabled:l!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:y<d.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:y*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:l===f.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):f.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:f.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:f.description})]})]},f.id))})})})]})}function Sf({onClick:e,label:t}){return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:e,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t})]})}function qs({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:o="es",useColumnSelector:s=false,onExportCSV:n,onExportJSON:l,onExportExcel:m,translations:i}){let c=r==="dark"?kf:wf,d={...o==="es"?Cf:Tf,...i},u=n||l||m;return jsxRuntime.jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:c.bgGrid,borderColor:c.border},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Df,{theme:c,t:d,onExportCSV:n,onExportJSON:l,onExportExcel:m}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:c.borderLight}})]}),t&&(s?jsxRuntime.jsx(Nf,{columns:e,onSelect:t,theme:c,t:d,createTaskLabel:a}):jsxRuntime.jsx(Sf,{onClick:()=>t(),label:a||d.newTask}))]})})}function Js({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:o=false}){let[s,n]=react.useState(false),[l,m]=react.useState(""),i=react.useCallback(()=>{let u=l.trim();u&&(e(u),m(""),n(false));},[l,e]),c=react.useCallback(u=>{u.key==="Enter"?(u.preventDefault(),i()):u.key==="Escape"&&(m(""),n(false));},[i]),d=react.useCallback(()=>{setTimeout(()=>{l.trim()||n(false);},150);},[l]);return s?jsxRuntime.jsx("div",{className:b("asakaa-add-column asakaa-add-column--editing",t),children:jsxRuntime.jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsxRuntime.jsx("input",{type:"text",value:l,onChange:u=>m(u.target.value),onKeyDown:c,onBlur:d,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:i,disabled:!l.trim(),className:"asakaa-add-column__submit",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsxRuntime.jsx("button",{onClick:()=>{m(""),n(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsxRuntime.jsx("div",{className:b("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>n(true),disabled:o,className:"asakaa-add-column__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r]})})}function Zs({columnId:e,onAddCard:t,availableUsers:a=[],className:r,placeholder:o,buttonLabel:s,disabled:n=false,theme:l="dark",locale:m="es"}){let[i,c]=react.useState(false),[d,u]=react.useState(false),[f,y]=react.useState(""),[k,g]=react.useState([]),[v,h]=react.useState(""),[p,w]=react.useState(""),[x,S]=react.useState(""),[T,C]=react.useState(false),[A,I]=react.useState(false),[N,z]=react.useState(false),R=react.useRef(null),_=react.useRef(null),se={placeholder:o||(m==="es"?"Nombre de la tarea...":"Task Name..."),buttonLabel:s||(m==="es"?"Agregar Tarea":"Add Task"),save:m==="es"?"Guardar":"Save",addAssignee:m==="es"?"Agregar asignado":"Add assignee",addDates:m==="es"?"Agregar fechas":"Add dates",addPriority:m==="es"?"Agregar prioridad":"Add priority",startDate:m==="es"?"Inicio":"Start",endDate:m==="es"?"Fin":"End",low:m==="es"?"Baja":"Low",medium:m==="es"?"Media":"Medium",high:m==="es"?"Alta":"High",urgent:m==="es"?"Urgente":"Urgent"},te=react.useCallback(()=>{y(""),g([]),h(""),w(""),S(""),C(false),I(false),z(false),c(false);},[]);react.useEffect(()=>{i&&R.current&&R.current.focus();},[i]),react.useEffect(()=>{if(!i)return;let F=B=>{_.current&&!_.current.contains(B.target)&&(f.trim()||te());};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[i,f,te]);let ie=react.useCallback(async()=>{let F=f.trim();if(!(!F||d)){u(true);try{await t({name:F,columnId:e,assigneeIds:k.length>0?k:void 0,startDate:v?new Date(v):void 0,endDate:p?new Date(p):void 0,priority:x||void 0}),y(""),g([]),h(""),w(""),S(""),C(!1),I(!1),z(!1),R.current?.focus();}catch(B){console.error("Error creating card:",B);}finally{u(false);}}},[f,e,k,v,p,x,t,d]),xe=react.useCallback(F=>{F.key==="Enter"&&!F.shiftKey?(F.preventDefault(),ie()):F.key==="Escape"&&te();},[ie,te]),Ne=react.useCallback(F=>{g(B=>B.includes(F)?B.filter(E=>E!==F):[...B,F]);},[]),Ae=l==="dark";return i?jsxRuntime.jsxs("div",{ref:_,className:b("rounded-lg overflow-hidden shadow-lg",Ae?"bg-[#1e1e2e]":"bg-white",r),style:{border:"2px solid #10b981"},children:[jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("input",{ref:R,type:"text",value:f,onChange:F=>y(F.target.value),onKeyDown:xe,placeholder:se.placeholder,disabled:d,className:b("w-full px-0 py-1 text-sm font-medium border-0 bg-transparent focus:outline-none focus:ring-0",Ae?"text-gray-100 placeholder-gray-500":"text-gray-800 placeholder-gray-400")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-3",children:[a.length>0&&jsxRuntime.jsxs("button",{onClick:()=>C(!T),className:b("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",T||k.length>0?"bg-emerald-500/20 text-emerald-400":Ae?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:se.addAssignee,children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),k.length>0&&jsxRuntime.jsx("span",{className:"ml-0.5",children:k.length})]}),jsxRuntime.jsx("button",{onClick:()=>I(!A),className:b("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",A||v||p?"bg-blue-500/20 text-blue-400":Ae?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:se.addDates,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),jsxRuntime.jsx("button",{onClick:()=>z(!N),className:b("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",N||x?x==="urgent"?"bg-red-500/20 text-red-400":x==="high"?"bg-orange-500/20 text-orange-400":x==="medium"?"bg-yellow-500/20 text-yellow-400":x==="low"?"bg-green-500/20 text-green-400":"bg-orange-500/20 text-orange-400":Ae?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:se.addPriority,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),jsxRuntime.jsx("line",{x1:"4",y1:"22",x2:"4",y2:"15"})]})}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{onClick:ie,disabled:!f.trim()||d,className:b("px-3 py-1.5 rounded-md text-xs font-medium text-white transition-all","bg-emerald-500 hover:bg-emerald-600","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-emerald-500"),type:"button",children:d?jsxRuntime.jsx("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}):se.save})]})]}),T&&a.length>0&&jsxRuntime.jsx("div",{className:b("px-3 pb-3 pt-0","border-t",Ae?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 pt-3",children:a.map(F=>jsxRuntime.jsxs("button",{onClick:()=>Ne(F.id),className:b("flex items-center gap-1.5 px-2 py-1 rounded-full text-xs transition-all",k.includes(F.id)?"bg-emerald-500 text-white":Ae?"bg-[#2a2a3e] text-gray-300 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-700 hover:bg-gray-200"),type:"button",children:[F.avatar?jsxRuntime.jsx("img",{src:F.avatar,alt:F.name,className:"w-4 h-4 rounded-full"}):jsxRuntime.jsx("div",{className:b("w-4 h-4 rounded-full flex items-center justify-center text-[10px] font-medium",k.includes(F.id)?"bg-emerald-600 text-white":"bg-emerald-500 text-white"),children:F.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{children:F.name.split(" ")[0]})]},F.id))})}),A&&jsxRuntime.jsx("div",{className:b("px-3 pb-3 pt-0","border-t",Ae?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:b("block text-[10px] uppercase tracking-wide mb-1",Ae?"text-gray-500":"text-gray-400"),children:se.startDate}),jsxRuntime.jsx("input",{type:"date",value:v,onChange:F=>h(F.target.value),className:b("w-full px-2 py-1.5 rounded text-xs border",Ae?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:b("block text-[10px] uppercase tracking-wide mb-1",Ae?"text-gray-500":"text-gray-400"),children:se.endDate}),jsxRuntime.jsx("input",{type:"date",value:p,onChange:F=>w(F.target.value),className:b("w-full px-2 py-1.5 rounded text-xs border",Ae?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]})]})}),N&&jsxRuntime.jsx("div",{className:b("px-3 pb-3 pt-0","border-t",Ae?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex gap-1.5 pt-3",children:["low","medium","high","urgent"].map(F=>jsxRuntime.jsx("button",{onClick:()=>S(x===F?"":F),className:b("flex-1 px-2 py-1.5 rounded text-xs font-medium transition-all",x===F?`${{low:"bg-green-500",medium:"bg-yellow-500",high:"bg-orange-500",urgent:"bg-red-500"}[F]} text-white`:Ae?"bg-[#2a2a3e] text-gray-400 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-600 hover:bg-gray-200"),type:"button",children:se[F]},F))})})]}):jsxRuntime.jsxs("button",{onClick:()=>c(true),disabled:n,className:b("w-full flex items-center gap-2 px-3 py-2 rounded-lg transition-all duration-200","text-emerald-500 hover:text-emerald-400",Ae?"hover:bg-[#2a2a3e]":"hover:bg-gray-100",n&&"opacity-50 cursor-not-allowed",r),type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:se.buttonLabel})]})}var _o=class extends core.BaseViewAdapter{constructor(a={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=a,this.options={animations:a.viewOptions?.animations??true,virtualScrolling:a.viewOptions?.virtualScrolling??false,theme:a.viewOptions?.theme??"dark",readonly:a.viewOptions?.readonly??false};}mount(a,r){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=a,this.data=r,this.root=client.createRoot(a),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(a){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=a,this.render(),this.emit("view:updated",{viewId:this.id,data:a});}configure(a){this.options={...this.options,...a},this.isMounted()&&this.render();}async export(a){if(!this.data)throw new Error("No data to export");switch(a){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${a}`)}}render(){if(!this.root||!this.data)return;let a={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsxRuntime.jsx(Mr,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let o=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,o?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(o=>`"${o}"`).join(",")).join(`
|
|
4
|
+
`);if(t.length<1||!t[0])return {success:!1,errors:["CSV file is empty or invalid"]};let a=id(t[0]),r=[],o=new Map,s=[];for(let n=1;n<t.length;n++)try{let l=id(t[n]||"");if(l.length>a.length){s.push(`Line ${n+1}: Too many columns`);continue}if(a.length-l.length>3){s.push(`Line ${n+1}: Column count mismatch (expected ${a.length}, got ${l.length})`);continue}for(;l.length<a.length;)l.push("");let i={};a.forEach((f,y)=>{i[f]=l[y]||"";});let c=i.Column||"Unnamed";o.has(c)||o.set(c,{id:`col-${o.size+1}`,title:c,position:o.size+1,cardIds:[]});let d=o.get(c),u={id:i["Card ID"]||`card-${n}`,title:i.Title||"Untitled",description:i.Description?i.Description:void 0,columnId:d.id,position:d.cardIds.length+1,priority:i.Priority||void 0,labels:i.Labels?i.Labels.split(";").filter(Boolean):void 0,assignedUserIds:i["Assigned Users"]?i["Assigned Users"].split(";").filter(Boolean):void 0,startDate:i["Start Date"]?i["Start Date"]:void 0,endDate:i["End Date"]?i["End Date"]:void 0,createdAt:i["Created At"]?i["Created At"]:void 0,updatedAt:i["Updated At"]?i["Updated At"]:void 0};r.push(u),d.cardIds.push(u.id);}catch(l){s.push(`Line ${n+1}: ${l instanceof Error?l.message:"Unknown error"}`);}return r.length===0?{success:!1,errors:["No valid cards found in CSV",...s]}:{success:!0,cardsImported:r.length,columnsImported:o.size,errors:s.length>0?s:void 0}}catch(t){return {success:false,errors:[`Failed to parse CSV: ${t instanceof Error?t.message:"Unknown error"}`]}}}function id(e){let t=[],a="",r=false;for(let o=0;o<e.length;o++){let s=e[o],n=e[o+1];s==='"'&&r&&n==='"'?(a+='"',o++):s==='"'?r=!r:s===","&&!r?(t.push(a),a=""):a+=s;}return t.push(a),t}function ld(e,t){switch(t){case "json":return Qu(e);case "csv":return eg(e);default:return {success:false,errors:[`Unsupported import format: ${t}`]}}}function dd(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=o=>{o.target?.result?t(o.target.result):a(new Error("Failed to read file"));},r.onerror=()=>a(new Error("Failed to read file")),r.readAsText(e);})}var zs=react.createContext(null);function cd(){return react.useContext(zs)}var md=react.createContext(null);function pd({children:e,themeName:t}){return jsxRuntime.jsx(md.Provider,{value:{themeName:t},children:e})}function uo(){return react.useContext(md)}function gt({children:e,container:t}){let[a,r]=react.useState(false),o=cd(),s=uo();if(react.useEffect(()=>(r(true),()=>r(false)),[]),!a)return null;let n=t||(typeof document<"u"?document.body:null);if(!n)return null;if(o){let{theme:l,themeName:m}=o,i={"--asakaa-color-background-primary":l.bgPrimary,"--asakaa-color-background-secondary":l.bgSecondary,"--asakaa-color-background-card":l.bgGrid,"--asakaa-color-background-hover":l.hoverBg,"--asakaa-color-text-primary":l.textPrimary,"--asakaa-color-text-secondary":l.textSecondary,"--asakaa-color-text-tertiary":l.textTertiary,"--asakaa-color-text-inverse":l.taskBarHandle||"#FFFFFF","--asakaa-color-border-default":l.border,"--asakaa-color-border-hover":l.borderLight,"--asakaa-color-border-subtle":l.borderLight,"--asakaa-color-interactive-primary":l.accent,"--asakaa-color-interactive-primaryHover":l.accentHover,"--asakaa-color-interactive-primaryBorder":`${l.accent}4D`,"--asakaa-color-interactive-primaryBackground":`${l.accent}1A`,"--asakaa-color-interactive-primaryBackgroundHover":`${l.accent}33`,"--asakaa-color-status-success":l.statusCompleted,"--asakaa-color-status-warning":l.milestone,"--asakaa-color-status-error":l.criticalPath,"--asakaa-color-danger":l.criticalPath,"--asakaa-color-danger-border":`${l.criticalPath}4D`,"--asakaa-color-danger-background":`${l.criticalPath}14`,"--asakaa-color-danger-backgroundHover":`${l.criticalPath}26`};return reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":m,"data-gantt-portal":"true",style:i,children:e}),n)}return s?reactDom.createPortal(jsxRuntime.jsx("div",{"data-theme":s.themeName,"data-kanban-portal":"true",children:e}),n):reactDom.createPortal(e,n)}var hd={URGENT:{label:"Urgent",color:"#E74C3C"},HIGH:{label:"High",color:"#E67E22"},MEDIUM:{label:"Normal",color:"#F1C40F"},LOW:{label:"Low",color:"#2ECC71"}},lg="#BDC3C7",dg=({color:e})=>jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",fill:e,opacity:"0.9"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"1.5",opacity:"0.3"})]});function Kr({priority:e,onChange:t,className:a}){let[r,o]=react.useState(false),[s,n]=react.useState({top:0,left:0}),l=react.useRef(null),m=react.useRef(null),i=()=>{if(!m.current)return;let f=m.current.getBoundingClientRect(),y=window.innerHeight,k=window.innerWidth,g=160,v=220,h=4,p=f.right-g;p<10&&(p=f.left),p+g>k-10&&(p=k-g-10);let w=y-f.bottom,x=f.top,S;w>=v+h?S=f.bottom+h:x>=v+h?S=f.top-v-h:S=w>=x?f.bottom+h:Math.max(10,f.top-v-h),n({top:S,left:p}),o(true);};react.useEffect(()=>{let f=y=>{l.current&&!l.current.contains(y.target)&&!m.current?.contains(y.target)&&o(false);};if(r)return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[r]),react.useEffect(()=>{let f=y=>{y.key==="Escape"&&o(false);};if(r)return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[r]);let c=f=>{t(f),o(false);},d=e?hd[e]:null,u=d?.color||lg;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:m,onClick:()=>r?o(false):i(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:e?`${u}10`:"transparent",boxShadow:e?`0 0 0 2px ${u}30 inset`:"none"},title:d?.label||"Set priority",children:jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M3 2L3 14M3 2L13 6L3 8V2Z",stroke:u,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:u,fillOpacity:e?"0.6":"0.4"})})}),r&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:l,className:"priority-selector-menu",style:{position:"fixed",top:`${s.top}px`,left:`${s.left}px`,zIndex:99999,minWidth:"160px",maxHeight:"calc(100vh - 40px)",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Priority"})}),jsxRuntime.jsxs("div",{className:"py-1",children:[Object.entries(hd).map(([f,y])=>jsxRuntime.jsxs("button",{onClick:()=>c(f),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98] priority-option",style:{color:y.color,background:"transparent"},onMouseEnter:k=>{k.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:k=>{k.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(dg,{color:y.color}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:y.label}),e===f&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},f)),jsxRuntime.jsx("div",{className:"mt-0.5 pt-0.5 border-t",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsxs("button",{onClick:()=>c(void 0),className:"w-full px-3 py-1.5 flex items-center gap-2 text-xs font-medium transition-all active:scale-[0.98]",style:{color:"var(--modal-v2-text-primary, #e5e5e5)",background:"transparent"},onMouseEnter:f=>{f.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:f=>{f.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"#9CA3AF",strokeWidth:"1.5",strokeDasharray:"2 2",opacity:"0.6"})}),jsxRuntime.jsx("span",{className:"font-semibold text-sm",children:"Clear"}),!e&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})})]})}var cg=[{label:"Today",days:0},{label:"Tomorrow",days:1},{label:"Next Week",days:7},{label:"2 Weeks",days:14},{label:"4 Weeks",days:28},{label:"8 Weeks",days:56}];function Ro({startDate:e,endDate:t,onChange:a,className:r}){let[o,s]=react.useState(false),[n,l]=react.useState({top:0,left:0}),m=react.useRef(null),i=react.useRef(null),u=(uo()?.themeName||"dark")==="dark",f=()=>{if(!i.current)return;let p=i.current.getBoundingClientRect(),w=window.innerHeight,x=window.innerWidth,S=320,T=380,C=4,A=p.left;A+S>x-10&&(A=x-S-10),A<10&&(A=10);let I=w-p.bottom,N=p.top,z;I>=T+C?z=p.bottom+C:N>=T+C?z=p.top-T-C:z=I>=N?p.bottom+C:Math.max(10,p.top-T-C),l({top:z,left:A}),s(true);};react.useEffect(()=>{let p=w=>{m.current&&!m.current.contains(w.target)&&!i.current?.contains(w.target)&&s(false);};if(o)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[o]),react.useEffect(()=>{let p=w=>{w.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[o]);let y=p=>{let w=new Date,x=A=>{let I=A.getFullYear(),N=String(A.getMonth()+1).padStart(2,"0"),z=String(A.getDate()).padStart(2,"0");return `${I}-${N}-${z}`},S=x(w),T=new Date(w);T.setDate(T.getDate()+p);let C=x(T);a(S,C),s(false);},k=()=>{if(!e||!t)return "Set date";let p=T=>{if(T instanceof Date)return T;if(typeof T!="string"||!T.match(/^\d{4}-\d{2}-\d{2}$/))return null;let C=T.split("-").map(Number);if(C.length!==3||C.some(z=>isNaN(z)))return null;let A=C[0],I=C[1],N=C[2];return A===void 0||I===void 0||N===void 0?null:new Date(A,I-1,N)},w=p(e),x=p(t);if(!w||!x||isNaN(w.getTime())||isNaN(x.getTime()))return "Set date";let S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return `${S[w.getMonth()]} ${w.getDate()} \u2013 ${S[x.getMonth()]} ${x.getDate()}`},g=e&&t,h=(()=>{if(!t)return false;let p=typeof t=="string"?new Date(t):t,w=new Date;return w.setHours(0,0,0,0),p<w})();return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsxs("button",{ref:i,onClick:()=>o?s(false):f(),className:`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-all hover:bg-white/5 ${h?"asakaa-date-overdue":"asakaa-date"}`,title:g?`${k()}`:"Set date range",children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("rect",{x:"2",y:"3",width:"12",height:"11",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M2 6H14",stroke:"currentColor",strokeWidth:"1.5"}),jsxRuntime.jsx("path",{d:"M5 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M11 2V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e&&t&&jsxRuntime.jsx("span",{className:"whitespace-nowrap",children:k()})]}),o&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:m,className:"date-picker-menu rounded-xl shadow-2xl border min-w-[320px]",style:{position:"fixed",top:`${n.top}px`,left:`${n.left}px`,background:u?"#1A1D25":"#FFFFFF",border:`1px solid ${u?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.12)"}`,boxShadow:u?"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)":"0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08)",zIndex:99999},children:[jsxRuntime.jsxs("div",{className:"p-4 border-b",style:{borderColor:u?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.08)"},children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:u?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Quick Select"}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-2",children:cg.map(p=>jsxRuntime.jsx("button",{onClick:()=>y(p.days),className:"px-3 py-2.5 rounded-lg text-xs font-semibold transition-all active:scale-95",style:{color:u?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",border:`1px solid ${u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`,backgroundColor:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor=u?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",w.currentTarget.style.border=`1px solid ${u?"rgba(255, 255, 255, 0.4)":"rgba(0, 0, 0, 0.25)"}`;},onMouseLeave:w=>{w.currentTarget.style.backgroundColor=u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",w.currentTarget.style.border=`1px solid ${u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)"}`;},children:p.label},p.label))})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider block mb-3",style:{color:u?"rgba(255, 255, 255, 0.85)":"rgba(0, 0, 0, 0.7)"},children:"Custom Range"}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx("input",{type:"date",value:e||"",onChange:p=>a(p.target.value,t),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:u?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:u?"dark":"light"}}),jsxRuntime.jsx("input",{type:"date",value:t||"",onChange:p=>a(e,p.target.value),className:"w-full px-3 py-2.5 rounded-lg text-sm border focus:outline-none transition-all",style:{background:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.05)",borderColor:u?"rgba(255, 255, 255, 0.25)":"rgba(0, 0, 0, 0.15)",color:u?"rgba(255, 255, 255, 0.95)":"rgba(0, 0, 0, 0.85)",colorScheme:u?"dark":"light"}})]}),(e||t)&&jsxRuntime.jsx("button",{onClick:()=>{a(void 0,void 0),s(false);},className:"mt-4 w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all active:scale-95 border",style:{color:"#ef4444",borderColor:"rgba(239, 68, 68, 0.3)",background:"rgba(239, 68, 68, 0.1)"},onMouseEnter:p=>{p.currentTarget.style.background="rgba(239, 68, 68, 0.2)";},onMouseLeave:p=>{p.currentTarget.style.background="rgba(239, 68, 68, 0.1)";},children:"Clear Dates"})]})]})})]})}function qr({assignedUsers:e=[],availableUsers:t,onChange:a,className:r,maxVisibleAvatars:o=3}){let[s,n]=react.useState(false),[l,m]=react.useState(""),[i,c]=react.useState({top:0,left:0}),d=react.useRef(null),u=react.useRef(null),f=()=>{if(!u.current)return;let h=u.current.getBoundingClientRect(),p=window.innerHeight,w=window.innerWidth,x=300,S=380,T=4,C=h.right-x;C<10&&(C=h.left),C+x>w-10&&(C=w-x-10);let A=p-h.bottom,I=h.top,N;A>=S+T?N=h.bottom+T:I>=S+T?N=h.top-S-T:N=A>=I?h.bottom+T:Math.max(10,h.top-S-T),c({top:N,left:C}),n(true);};react.useEffect(()=>{let h=p=>{d.current&&!d.current.contains(p.target)&&!u.current?.contains(p.target)&&(n(false),m(""));};if(s)return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]),react.useEffect(()=>{let h=p=>{p.key==="Escape"&&(n(false),m(""));};if(s)return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[s]);let y=h=>{let p=e.some(w=>w.id===h.id);a(p?e.filter(w=>w.id!==h.id):[...e,h]);},k=t.filter(h=>h.name.toLowerCase().includes(l.toLowerCase())),g=e.slice(0,o),v=e.length-o;return jsxRuntime.jsxs("div",{className:`relative ${r||""}`,children:[jsxRuntime.jsx("button",{ref:u,onClick:()=>s?n(false):f(),className:"flex items-center gap-1 p-0.5 rounded transition-all hover:bg-white/10 hover:scale-105 active:scale-95",title:e.length>0?`${e.length} assigned`:"Assign users",children:e.length>0?jsxRuntime.jsxs("div",{className:"asakaa-avatar-group",children:[g.map(h=>jsxRuntime.jsx("div",{className:"asakaa-avatar",title:h.name,children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"asakaa-avatar-img"}):h.initials},h.id)),v>0&&jsxRuntime.jsxs("div",{className:"asakaa-avatar",children:["+",v]})]}):jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center transition-all",style:{background:"rgba(96, 165, 250, 0.15)",border:"1.5px solid rgba(96, 165, 250, 0.4)",color:"#60a5fa"},children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M8 8a3 3 0 100-6 3 3 0 000 6zM4 14c0-2.21 1.79-4 4-4s4 1.79 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"13",y1:"5",x2:"13",y2:"9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:"11",y1:"7",x2:"15",y2:"7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})}),s&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:d,className:"user-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${i.top}px`,left:`${i.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-xs font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.8))"},children:"Assign Users"})}),jsxRuntime.jsx("div",{className:"px-3 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("input",{type:"text",value:l,onChange:h=>m(h.target.value),placeholder:"Search users...",className:"w-full px-3 py-2.5 rounded-lg text-sm border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.2))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[300px] overflow-y-auto",children:k.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-sm text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.6))"},children:"No users found"}):k.map(h=>{let p=e.some(w=>w.id===h.id);return jsxRuntime.jsxs("button",{onClick:()=>y(h),className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm transition-all active:scale-98",style:{background:"transparent"},onMouseEnter:w=>{w.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.1))";},onMouseLeave:w=>{w.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:h.color,color:"#fff"},children:h.avatar?jsxRuntime.jsx("img",{src:h.avatar,alt:h.name,className:"w-full h-full rounded-full object-cover"}):h.initials}),jsxRuntime.jsx("span",{className:"font-semibold flex-1 text-left truncate",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.95))"},children:h.name}),jsxRuntime.jsx("span",{className:"w-5 text-lg flex-shrink-0 text-right",style:{color:p?"#3b82f6":"transparent"},children:p?"\u2713":""})]},h.id)})}),e.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-3 border-t border-white/10",children:jsxRuntime.jsx("button",{onClick:()=>{a([]),n(false);},className:"w-full px-3 py-2.5 rounded-lg text-sm font-semibold transition-all hover:bg-red-600/30 active:scale-95 border",style:{color:"#f87171",borderColor:"rgba(248, 113, 113, 0.3)",background:"rgba(248, 113, 113, 0.08)"},children:"Clear All"})})]})})]})}function vn(e,t,a){let r=new Map;e.forEach(m=>{if(m.dependencies&&Array.isArray(m.dependencies)){let i=m.dependencies.map(c=>{if(typeof c=="string")return c;let d=c;return d.taskId||d.targetId||""}).filter(Boolean);r.set(m.id,i);}});let o=r.get(a)||[];r.set(a,[...o,t]);let s=new Set,n=new Set,l=m=>{if(!s.has(m)){s.add(m),n.add(m);let i=r.get(m)||[];for(let c of i){if(!s.has(c)&&l(c))return true;if(n.has(c))return true}}return n.delete(m),false};return l(a)}function zo({currentCardId:e,dependencies:t=[],availableTasks:a,onChange:r,className:o,validateCircular:s=true,onCircularDependencyError:n}){let[l,m]=react.useState(false),[i,c]=react.useState(""),[d,u]=react.useState(t.length>0),[f,y]=react.useState({top:0,left:0}),[k,g]=react.useState(null),v=react.useRef(null),h=react.useRef(null),p=()=>{if(!h.current)return;let C=h.current.getBoundingClientRect(),A=window.innerHeight,I=window.innerWidth,N=300,z=d?380:120,R=4,_=C.right-N;_<10&&(_=C.left),_+N>I-10&&(_=I-N-10);let se=A-C.bottom,te=C.top,ie;se>=z+R?ie=C.bottom+R:te>=z+R?ie=C.top-z-R:ie=se>=te?C.bottom+R:Math.max(10,C.top-z-R),y({top:ie,left:_}),m(true);};react.useEffect(()=>{if(!l||!h.current)return;let C=h.current.getBoundingClientRect(),A=window.innerHeight,I=window.innerWidth,N=300,z=d?380:120,R=4,_=C.right-N;_<10&&(_=C.left),_+N>I-10&&(_=I-N-10);let se=A-C.bottom,te=C.top,ie;se>=z+R?ie=C.bottom+R:te>=z+R?ie=C.top-z-R:ie=se>=te?C.bottom+R:Math.max(10,C.top-z-R),y({top:ie,left:_});},[d,l]),react.useEffect(()=>{let C=A=>{v.current&&!v.current.contains(A.target)&&!h.current?.contains(A.target)&&(m(false),c(""));};if(l)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[l]),react.useEffect(()=>{let C=A=>{A.key==="Escape"&&(m(false),c(""));};if(l)return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[l]);let w=C=>{let A=t.includes(C),I=a.find(N=>N.id===C);if(g(null),A){let N=t.filter(z=>z!==C);r(N),N.length===0&&u(false);}else {if(s&&vn(a,C,e)){let z=`Cannot add "${I?.title||C}" as dependency - would create circular reference`;g(z),n?.(C,I?.title||C),setTimeout(()=>g(null),3e3);return}r([...t,C]),u(true);}},x=()=>{let C=!d;u(C),C||r([]);},S=a.filter(C=>C.id!==e).filter(C=>C.title.toLowerCase().includes(i.toLowerCase())||C.id.toLowerCase().includes(i.toLowerCase())),T=t.length>0?"#3B82F6":"#BDC3C7";return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsxs("button",{ref:h,onClick:()=>l?m(false):p(),className:"flex items-center gap-1 px-2 py-1 rounded transition-all hover:bg-white/5",title:t.length>0?`${t.length} dependencies`:"Add dependencies",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M7 9L9 7M11.5 3.5L10 2C8.89543 0.89543 7.10457 0.89543 6 2C4.89543 3.10457 4.89543 4.89543 6 6L7.5 7.5M4.5 12.5L6 14C7.10457 15.1046 8.89543 15.1046 10 14C11.1046 12.8954 11.1046 11.1046 10 10L8.5 8.5",stroke:T,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),t.length>0&&jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:T},children:t.length})]}),l&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:v,className:"dependencies-selector-menu rounded-xl shadow-2xl border min-w-[300px]",style:{position:"fixed",top:`${f.top}px`,left:`${f.left}px`,maxHeight:"calc(100vh - 40px)",overflow:"hidden",display:"flex",flexDirection:"column",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:[k&&jsxRuntime.jsxs("div",{className:"px-4 py-3 flex items-center gap-2",style:{background:"rgba(239, 68, 68, 0.15)",borderBottom:"1px solid rgba(239, 68, 68, 0.3)"},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M8 5V8M8 11H8.01M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z",stroke:"#ef4444",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:"#ef4444"},children:k})]}),jsxRuntime.jsx("div",{className:"px-4 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Task Dependencies"})}),jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",onClick:x,children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center transition-all",style:{background:d?"#3b82f6":"transparent",borderColor:d?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:d&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsx("span",{className:"text-sm font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.8))"},children:"Has dependencies"})]})}),d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.05))"},children:jsxRuntime.jsx("input",{type:"text",value:i,onChange:C=>c(C.target.value),placeholder:"Search by name or ID...",className:"w-full px-3 py-2 rounded-md text-xs border outline-none transition-all",style:{background:"var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))",borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))",color:"var(--modal-v2-text-primary, #ffffff)"},autoFocus:true})}),jsxRuntime.jsx("div",{className:"py-2 max-h-[280px] overflow-y-auto",children:S.length===0?jsxRuntime.jsx("div",{className:"px-4 py-3 text-xs text-center",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:"No tasks found"}):S.map(C=>{let A=t.includes(C.id);return jsxRuntime.jsxs("button",{onClick:()=>w(C.id),className:"w-full px-4 py-2 flex items-start gap-3 text-sm transition-colors",style:{background:"transparent"},onMouseEnter:I=>{I.currentTarget.style.background="var(--modal-v2-bg-secondary, rgba(255, 255, 255, 0.05))";},onMouseLeave:I=>{I.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0 mt-0.5 transition-all",style:{background:A?"#3b82f6":"transparent",borderColor:A?"#3b82f6":"var(--modal-v2-border, rgba(255, 255, 255, 0.3))"},children:A&&jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:"font-medium",style:{color:"var(--modal-v2-text-primary, rgba(255, 255, 255, 0.9))"},children:C.title}),jsxRuntime.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--modal-v2-text-tertiary, rgba(255, 255, 255, 0.5))"},children:C.id})]})]},C.id)})})]}),t.length>0&&jsxRuntime.jsx("div",{className:"px-3 py-2 border-t border-white/5",children:jsxRuntime.jsx("button",{onClick:()=>{r([]),u(false),m(false);},className:"w-full px-3 py-2 rounded-md text-xs font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#E74C3C"},children:"Clear All Dependencies"})})]})})]})}var gr=react.memo(({card:e,render:t,onClick:a,isSelected:r,disableDrag:o,className:s,onUpdate:n,availableUsers:l=[],allCards:m=[]})=>{let{attributes:i,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:y}=sortable.useSortable({id:e.id,disabled:o,data:{type:"card",card:e}}),k={transform:fn.Transform.toString(u),transition:f};if(t)return jsxRuntime.jsx("div",{ref:d,style:k,...i,...c,onClick:()=>a?.(e),children:t(e)});let g=l.filter(w=>e.assignedUserIds?.includes(w.id)),v=e.progress===100,h=(e.attachments||[]).filter(w=>w.type.startsWith("image/")),p={...k,...e.color&&{borderTopWidth:"3px",borderTopStyle:"solid",borderTopColor:e.color}};return jsxRuntime.jsxs("div",{ref:d,style:p,className:b("asakaa-card",y&&"asakaa-card-dragging",r&&"ring-2 ring-asakaa-accent-blue",s),...i,...c,onClick:w=>{w.target.closest(".priority-selector, .date-picker, .user-selector, .dependencies-selector")||a?.(e);},children:[e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-cover mb-3",children:jsxRuntime.jsx("img",{src:e.coverImage,alt:`Cover for ${e.title}`,className:"w-full h-32 object-cover rounded-md",loading:"lazy",onError:w=>{w.currentTarget.style.display="none";}})}),h.length>0&&!e.coverImage&&jsxRuntime.jsx("div",{className:"asakaa-card-attachments mb-3",children:h.length===1&&h[0]?jsxRuntime.jsx("img",{src:h[0].url,alt:h[0].name,className:"w-full h-32 object-cover rounded-md",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:w=>{w.currentTarget.style.display="none";}}):jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-1",children:h.slice(0,4).map((w,x)=>jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("img",{src:w.url,alt:w.name,className:"w-full h-16 object-cover rounded",loading:"lazy",decoding:"async",style:{imageRendering:"auto",WebkitBackfaceVisibility:"hidden",backfaceVisibility:"hidden",transform:"translateZ(0)"},onError:S=>{S.currentTarget.style.display="none";}}),x===3&&h.length>4&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 rounded flex items-center justify-center",children:jsxRuntime.jsxs("span",{className:"text-white text-sm font-medium",children:["+",h.length-4]})})]},w.id))})}),jsxRuntime.jsx("h3",{className:"asakaa-card-title mb-2",style:{textDecoration:v?"line-through":"none",opacity:v?.6:1},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"asakaa-card-description mb-3",children:e.description}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 mb-3 pt-1",children:[jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"priority-selector",children:jsxRuntime.jsx(Kr,{priority:e.priority,onChange:w=>n?.(e.id,{priority:w})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"date-picker",children:jsxRuntime.jsx(Ro,{startDate:e.startDate?typeof e.startDate=="string"?e.startDate:e.startDate.toISOString().split("T")[0]:void 0,endDate:e.endDate?typeof e.endDate=="string"?e.endDate:e.endDate.toISOString().split("T")[0]:void 0,onChange:(w,x)=>n?.(e.id,{startDate:w,endDate:x})})}),l.length>0&&jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"user-selector",children:jsxRuntime.jsx(qr,{assignedUsers:g,availableUsers:l,onChange:w=>n?.(e.id,{assignedUserIds:w.map(x=>x.id)})})}),jsxRuntime.jsx("div",{onClick:w=>w.stopPropagation(),className:"dependencies-selector",children:jsxRuntime.jsx(zo,{currentCardId:e.id,dependencies:Array.isArray(e.dependencies)?e.dependencies.map(w=>typeof w=="string"?w:w.taskId):[],availableTasks:m,onChange:w=>n?.(e.id,{dependencies:w})})})]}),e.labels&&e.labels.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.labels.slice(0,3).map(w=>jsxRuntime.jsx("span",{className:"asakaa-label",children:w},w))}),typeof e.progress=="number"&&jsxRuntime.jsxs("div",{className:"mt-3 pt-2 border-t border-white/5",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("span",{className:"text-[10px] text-[#6B7280]",children:"Progreso"}),jsxRuntime.jsxs("span",{className:"text-[10px] font-medium",style:{color:"#3B82F6"},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx("div",{className:"h-1.5 rounded-full bg-white/5 overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all duration-300",style:{width:`${Math.min(100,Math.max(0,e.progress))}%`,backgroundColor:"#3B82F6"}})})]})]})},(e,t)=>e.card.id===t.card.id&&e.card.title===t.card.title&&e.card.description===t.card.description&&e.card.position===t.card.position&&e.card.columnId===t.card.columnId&&e.card.priority===t.card.priority&&e.card.color===t.card.color&&e.card.progress===t.card.progress&&e.card.startDate===t.card.startDate&&e.card.endDate===t.card.endDate&&e.isSelected===t.isSelected&&JSON.stringify(e.card.labels)===JSON.stringify(t.card.labels)&&JSON.stringify(e.card.assignedUserIds)===JSON.stringify(t.card.assignedUserIds)&&JSON.stringify(e.card.dependencies)===JSON.stringify(t.card.dependencies)&&JSON.stringify(e.card.attachments?.map(a=>a.id))===JSON.stringify(t.card.attachments?.map(a=>a.id)));gr.displayName="Card";var xn={todo:{label:"To Do",color:"#94a3b8",icon:"circle"},"in-progress":{label:"In Progress",color:"#60a5fa",icon:"circle-dot"},completed:{label:"Completed",color:"#34d399",icon:"check-circle"}},Sd=({icon:e,color:t})=>e==="circle"?jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"})}):e==="circle-dot"?jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:"none"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"3",fill:t})]}):jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"1.5",fill:t,fillOpacity:"0.2"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});function Ed({status:e="todo",onChange:t,className:a,customStatuses:r=[]}){let[o,s]=react.useState(false),[n,l]=react.useState({top:0,left:0}),m=react.useRef(null),i=react.useRef(null),c=[...Object.entries(xn).map(([g,v])=>({id:g,label:v.label,color:v.color,icon:v.icon})),...r.filter(g=>!Object.keys(xn).includes(g.id)).map(g=>({id:g.id,label:g.title,color:g.color||"#8B5CF6",icon:"circle-dot"}))],d=()=>{let g=xn[e];if(g)return {...g,id:e};let v=r.find(h=>h.id===e);return v?{id:v.id,label:v.title,color:v.color||"#8B5CF6",icon:"circle-dot"}:{...xn.todo,id:"todo"}},u=()=>{if(!i.current)return;let g=i.current.getBoundingClientRect(),v=window.innerHeight,h=window.innerWidth,p=180,w=280,x=4,S=g.right-p;S<10&&(S=g.left),S+p>h-10&&(S=h-p-10);let T=v-g.bottom,C=g.top,A;T>=w+x?A=g.bottom+x:C>=w+x?A=g.top-w-x:A=T>=C?g.bottom+x:Math.max(10,g.top-w-x),l({top:A,left:S}),s(true);};react.useEffect(()=>{let g=v=>{m.current&&!m.current.contains(v.target)&&!i.current?.contains(v.target)&&s(false);};if(o)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]),react.useEffect(()=>{let g=v=>{v.key==="Escape"&&s(false);};if(o)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[o]);let f=g=>{t(g),s(false);},y=d(),k=y.color;return jsxRuntime.jsxs("div",{className:`relative ${a||""}`,children:[jsxRuntime.jsx("button",{ref:i,onClick:()=>o?s(false):u(),className:"flex items-center justify-center w-8 h-8 rounded-lg transition-all hover:bg-white/15 hover:scale-110 active:scale-95",style:{background:`${k}10`,boxShadow:`0 0 0 2px ${k}30 inset`},title:y.label,children:jsxRuntime.jsx(Sd,{icon:y.icon,color:k})}),o&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsxs("div",{ref:m,className:"status-selector-menu",style:{position:"fixed",top:`${n.top}px`,left:`${n.left}px`,zIndex:99999,minWidth:"180px",maxHeight:"calc(100vh - 40px)",overflowY:"auto",borderRadius:"8px",background:"var(--modal-v2-bg, #1f1f1f)",border:"1px solid var(--modal-v2-border, rgba(255, 255, 255, 0.15))",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},children:[jsxRuntime.jsx("div",{className:"px-3 py-1.5 border-b",style:{borderColor:"var(--modal-v2-border, rgba(255, 255, 255, 0.1))"},children:jsxRuntime.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--modal-v2-text-secondary, rgba(255, 255, 255, 0.7))"},children:"Status"})}),jsxRuntime.jsx("div",{className:"py-1",children:c.map(g=>jsxRuntime.jsxs("button",{onClick:()=>f(g.id),className:"w-full px-3 py-2 flex items-center gap-2.5 text-sm font-medium transition-all active:scale-[0.98] status-option",style:{color:g.color,background:"transparent"},onMouseEnter:v=>{v.currentTarget.style.background="var(--modal-v2-bg-tertiary, rgba(255, 255, 255, 0.15))";},onMouseLeave:v=>{v.currentTarget.style.background="transparent";},children:[jsxRuntime.jsx(Sd,{icon:g.icon,color:g.color}),jsxRuntime.jsx("span",{className:"font-semibold",children:g.label}),e===g.id&&jsxRuntime.jsx("svg",{className:"ml-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#3B82F6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},g.id))})]})})]})}function Pd({columnTitle:e,onRename:t,onDelete:a,isDeletable:r=false,className:o}){let[s,n]=react.useState(false),[l,m]=react.useState(false),[i,c]=react.useState(e),[d,u]=react.useState({top:0,left:0}),f=react.useRef(null),y=react.useRef(null),k=react.useRef(null);react.useEffect(()=>{if(s&&y.current){let p=y.current.getBoundingClientRect();u({top:p.bottom+window.scrollY+8,left:p.left+window.scrollX});}},[s]),react.useEffect(()=>{let p=w=>{f.current&&!f.current.contains(w.target)&&!y.current?.contains(w.target)&&(n(false),m(false));};if(s)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]),react.useEffect(()=>{let p=w=>{w.key==="Escape"&&(n(false),m(false),c(e));};if(s)return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[s,e]),react.useEffect(()=>{l&&k.current&&(k.current.focus(),k.current.select());},[l]);let g=()=>{m(true),c(e);},v=()=>{let p=i.trim();p&&p!==e&&t(p),m(false),n(false),c(e);},h=p=>{p.key==="Enter"?v():p.key==="Escape"&&(m(false),c(e));};return jsxRuntime.jsxs("div",{className:`relative ${o||""}`,children:[jsxRuntime.jsx("button",{ref:y,onClick:()=>n(!s),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-white/10",title:"Column options","aria-label":"Column menu",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor"}),jsxRuntime.jsx("circle",{cx:"8",cy:"13",r:"1.5",fill:"currentColor"})]})}),s&&jsxRuntime.jsx(gt,{children:jsxRuntime.jsx("div",{ref:f,className:"fixed rounded-xl shadow-2xl border min-w-[200px]",style:{top:`${d.top}px`,left:`${d.left}px`,background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)",zIndex:99999},children:l?jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("label",{className:"text-xs font-bold text-white/80 uppercase tracking-wider block mb-2",children:"Rename Column"}),jsxRuntime.jsx("input",{ref:k,type:"text",value:i,onChange:p=>c(p.target.value),onKeyDown:h,onBlur:v,className:"w-full px-3 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/50 outline-none focus:border-blue-500/50 transition-all",placeholder:"Column name",maxLength:50})]}):jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsxs("button",{onClick:g,className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-white/90 hover:bg-white/10 transition-all",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-medium",children:"Rename"})]}),r&&a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"h-px bg-white/10 mx-2 my-1"}),jsxRuntime.jsxs("button",{onClick:()=>{a(),n(false);},className:"w-full px-4 py-2.5 flex items-center gap-3 text-sm text-red-400 hover:bg-red-500/10 transition-all",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("path",{d:"M2 4H14M5 4V2.5C5 2.22386 5.22386 2 5.5 2H10.5C10.7761 2 11 2.22386 11 2.5V4M12.5 4V13.5C12.5 13.7761 12.2761 14 12 14H4C3.72386 14 3.5 13.7761 3.5 13.5V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M6.5 7V11M9.5 7V11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),jsxRuntime.jsx("span",{className:"font-medium",children:"Delete"})]})]})]})})})]})}var bo=react.memo(({column:e,cards:t,renderColumn:a,renderCard:r,renderHeader:o,renderEmptyState:s,onCardClick:n,onCardUpdate:l,availableUsers:m,allCards:i,enableVirtualization:c,cardHeight:d=120,isCollapsed:u,onToggleCollapse:f,onColumnRename:y,onColumnDelete:k,isDeletable:g=false,className:v})=>{let{setNodeRef:h,isOver:p}=core$1.useDroppable({id:e.id,data:{type:"column",column:e}}),w=react.useRef(null),x=c??td(t.length),S=reactVirtual.useVirtualizer({count:t.length,getScrollElement:()=>w.current,estimateSize:()=>d,enabled:x});if(a)return jsxRuntime.jsx("div",{ref:h,className:v,children:a(e,t)});let C=(()=>{if(!e.wipLimit)return {state:"none",percentage:0};let N=t.length/e.wipLimit*100;return t.length>e.wipLimit?{state:"exceeded",percentage:N}:N>=80?{state:"warning",percentage:N}:N>=60?{state:"approaching",percentage:N}:{state:"ok",percentage:N}})(),A=C.state==="exceeded",I=()=>"asakaa-column-count";return jsxRuntime.jsxs("div",{ref:h,className:b("asakaa-column",p&&"ring-2 ring-asakaa-accent-blue",A&&"ring-2 ring-asakaa-accent-red",v),children:[o?o(e,t.length):jsxRuntime.jsxs("div",{className:"asakaa-column-header group",children:[jsxRuntime.jsx("h2",{className:"asakaa-column-title",children:e.title}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("span",{className:b(I()),children:[t.length,e.wipLimit&&` / ${e.wipLimit}`]}),e.wipLimit&&C.state!=="none"&&jsxRuntime.jsxs("span",{className:"text-xs font-medium flex items-center",title:`${C.percentage.toFixed(0)}% capacity${e.wipLimitType==="hard"?" (Hard limit - blocks new cards)":" (Soft limit - shows warning)"}`,children:[C.state==="exceeded"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#EF4444",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 5L11 11M11 5L5 11",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),C.state==="warning"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M8 1L15 14H1L8 1Z",fill:"#F59E0B",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M8 6V9M8 11V11.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})]}),C.state==="approaching"&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{d:"M8 1L10 7H14L10 10L12 16L8 12L4 16L6 10L2 7H6L8 1Z",fill:"#FB923C",opacity:"0.9"})}),C.state==="ok"&&jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("circle",{cx:"8",cy:"8",r:"7",fill:"#10B981",opacity:"0.9"}),jsxRuntime.jsx("path",{d:"M5 8L7 10L11 6",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})]}),(y||k)&&jsxRuntime.jsx(Pd,{columnTitle:e.title,onRename:N=>y?.(e.id,N),onDelete:k?()=>k(e.id):void 0,isDeletable:g}),f&&jsxRuntime.jsx("button",{onClick:f,className:"text-asakaa-text-tertiary hover:text-asakaa-text-primary","aria-label":u?"Expand column":"Collapse column",children:u?"\u25B6":"\u25BC"})]})]}),!u&&jsxRuntime.jsx("div",{ref:w,className:"asakaa-column-cards",style:{maxHeight:x?"600px":void 0},children:jsxRuntime.jsx(sortable.SortableContext,{items:t.map(N=>N.id),strategy:sortable.verticalListSortingStrategy,children:t.length===0?s?s(e):jsxRuntime.jsx("div",{className:"asakaa-drop-zone asakaa-empty",children:jsxRuntime.jsx("p",{children:"Drop cards here"})}):x?jsxRuntime.jsx("div",{style:{height:`${S.getTotalSize()}px`,position:"relative"},children:S.getVirtualItems().map(N=>{let z=t[N.index];return z?jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${N.start}px)`},children:jsxRuntime.jsx(gr,{card:z,render:r,onClick:n,onUpdate:l,availableUsers:m,allCards:i})},z.id):null})}):t.map(N=>jsxRuntime.jsx(gr,{card:N,render:r,onClick:n,onUpdate:l,availableUsers:m,allCards:i},N.id))})})]})});bo.displayName="Column";function Gs({title:e,onSave:t,className:a}){let[r,o]=react.useState(false),[s,n]=react.useState(e),l=react.useRef(null);react.useEffect(()=>{r&&l.current&&(l.current.focus(),l.current.select());},[r]);let m=()=>{let c=s.trim();c&&c!==e?t(c):n(e),o(false);},i=c=>{c.key==="Enter"?m():c.key==="Escape"&&(n(e),o(false));};return r?jsxRuntime.jsx("input",{ref:l,type:"text",value:s,onChange:c=>n(c.target.value),onBlur:m,onKeyDown:i,className:b("asakaa-column-title bg-transparent border-b-2 border-blue-500","outline-none px-1 -ml-1",a),maxLength:50}):jsxRuntime.jsx("h2",{className:b("asakaa-column-title cursor-pointer",a),onClick:()=>o(true),title:"Click to edit",children:e})}function Mg(e,t){let a=e.slice(0,t),r=a.lastIndexOf("@");if(r===-1)return null;let o=a[r-1];if(r>0&&o&&!/\s/.test(o))return null;let s=a.slice(r+1);return /\s/.test(s)?null:{start:r,end:t,query:s.toLowerCase()}}function Bd(e,t){let a=[],r=/@(\S+)/g,o;for(;(o=r.exec(e))!==null;){let s=o[1]?.toLowerCase()??"";if(!s)continue;let n=t.find(l=>{let m=l.name.toLowerCase(),i=m.replace(/\s+/g,""),c=m.split(/\s+/);return !!(i===s||m===s||c.some(d=>d===s))});n&&!a.includes(n.id)&&a.push(n.id);}return a}function Fg(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function Ag(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var Lg=["\u{1F600}","\u{1F602}","\u{1F970}","\u{1F60D}","\u{1F914}","\u{1F44D}","\u{1F44E}","\u{1F389}","\u{1F525}","\u2764\uFE0F","\u{1F4AF}","\u2705","\u274C","\u26A0\uFE0F","\u{1F4CC}","\u{1F4A1}","\u{1F680}","\u2B50","\u{1F3AF}","\u{1F4AA}","\u{1F64F}","\u{1F440}","\u{1F4DD}","\u{1F4AC}"];function Rd({value:e,onChange:t,onSubmit:a,users:r,placeholder:o,disabled:s=false,isSubmitting:n=false,theme:l="dark",locale:m="es",currentUser:i,enableEmoji:c=true,enableAttachments:d=true,pendingFiles:u=[],onFilesSelect:f,onRemoveFile:y,maxFileSizeMB:k=10}){let g=l==="dark",[v,h]=react.useState(false),[p,w]=react.useState([]),[x,S]=react.useState(0),[T,C]=react.useState(null),[A,I]=react.useState(false),N=react.useRef(null),z=react.useRef(null),R=react.useRef(null),_=react.useRef(null),se=react.useCallback((E,W)=>{let q=Mg(E,W);if(C(q),q){let pe=r.filter(fe=>fe.name.toLowerCase().includes(q.query)||fe.email&&fe.email.toLowerCase().includes(q.query)).slice(0,5);w(pe),h(pe.length>0),S(0);}else h(false),w([]);},[r]),te=E=>{let W=E.target.value;if(t(W),se(W,E.target.selectionStart||0),N.current){N.current.style.height="24px";let q=N.current.scrollHeight,pe=280,fe=Math.min(q,pe);N.current.style.height=`${fe}px`,N.current.style.overflowY=q>pe?"auto":"hidden";}},ie=()=>{N.current&&se(e,N.current.selectionStart||0);},xe=react.useCallback(E=>{if(!T||!N.current)return;let W=e.slice(0,T.start),q=e.slice(T.end),pe=`@${E.name.replace(/\s+/g,"")} `,fe=W+pe+q;t(fe),h(false),C(null),setTimeout(()=>{if(N.current){let Ce=T.start+pe.length;N.current.selectionStart=Ce,N.current.selectionEnd=Ce,N.current.focus();}},0);},[T,e,t]),Ne=E=>{if(v&&p.length>0)switch(E.key){case "ArrowDown":E.preventDefault(),S(W=>W<p.length-1?W+1:0);break;case "ArrowUp":E.preventDefault(),S(W=>W>0?W-1:p.length-1);break;case "Enter":{E.preventDefault();let W=p[x];W&&xe(W);break}case "Tab":{E.preventDefault();let W=p[x];W&&xe(W);break}case "Escape":E.preventDefault(),h(false);break}else E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),a());};react.useEffect(()=>{let E=W=>{z.current&&!z.current.contains(W.target)&&N.current&&!N.current.contains(W.target)&&h(false),_.current&&!_.current.contains(W.target)&&I(false);};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);let Ae=react.useCallback(E=>{if(!N.current)return;let W=N.current.selectionStart||e.length,q=e.slice(0,W)+E+e.slice(W);t(q),I(false),setTimeout(()=>{if(N.current){let pe=W+E.length;N.current.selectionStart=pe,N.current.selectionEnd=pe,N.current.focus();}},0);},[e,t]),F=react.useCallback(E=>{if(!f||!E.target.files)return;let W=Array.from(E.target.files),q=k*1024*1024,pe=W.filter(fe=>fe.size>q?(console.warn(`File ${fe.name} exceeds max size of ${k}MB`),false):true);pe.length>0&&f(pe),E.target.value="";},[f,k]),B=react.useCallback(E=>E.type.startsWith("image/")?lucideReact.Image:E.type.includes("pdf")||E.type.includes("document")?lucideReact.FileText:lucideReact.File,[]);return react.useEffect(()=>{if(v&&z.current){let E=z.current.children[x];E&&E.scrollIntoView({block:"nearest"});}},[x,v]),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[u.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(E=>{let W=B(E.file),q=E.file.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:b("relative group flex items-center gap-2 px-2 py-1.5 rounded-lg",g?"bg-white/10":"bg-gray-100"),children:[q&&E.preview?jsxRuntime.jsx("img",{src:E.preview,alt:E.file.name,className:"w-6 h-6 rounded object-cover"}):jsxRuntime.jsx(W,{className:b("w-4 h-4",g?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0 max-w-[120px]",children:[jsxRuntime.jsx("p",{className:b("text-xs truncate",g?"text-white":"text-gray-900"),children:E.file.name}),jsxRuntime.jsx("p",{className:b("text-xs",g?"text-[#6B7280]":"text-gray-400"),children:Ag(E.file.size)})]}),y&&jsxRuntime.jsx("button",{onClick:()=>y(E.id),className:b("p-0.5 rounded-full transition-colors",g?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},E.id)})}),jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[i&&jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:i.color||"#8B5CF6"},children:i.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:b("flex-1 relative min-w-0"),children:[jsxRuntime.jsxs("div",{className:b("flex items-end gap-1 px-2 py-2 rounded-lg",g?"bg-white/5":"bg-white border border-gray-200"),children:[c&&jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>I(!A),disabled:s||n,className:b("p-1 rounded transition-colors flex-shrink-0",g?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||n)&&"opacity-50"),title:"Emojis",children:jsxRuntime.jsx(lucideReact.Smile,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:A&&jsxRuntime.jsx(framerMotion.motion.div,{ref:_,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:b("absolute bottom-full left-0 mb-2 p-2 rounded-lg shadow-xl z-50",g?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-8 gap-1 w-[200px]",children:Lg.map(E=>jsxRuntime.jsx("button",{type:"button",onClick:()=>Ae(E),className:b("w-6 h-6 flex items-center justify-center text-lg rounded transition-colors hover:scale-110",g?"hover:bg-white/10":"hover:bg-gray-100"),children:E},E))})})})]}),d&&f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>R.current?.click(),disabled:s||n,className:b("p-1.5 rounded transition-colors",g?"hover:bg-white/10 text-[#6B7280] hover:text-white":"hover:bg-gray-100 text-gray-400 hover:text-gray-600",(s||n)&&"opacity-50"),title:m==="es"?"Adjuntar archivo":"Attach file",children:jsxRuntime.jsx(lucideReact.Paperclip,{className:"w-4 h-4"})}),jsxRuntime.jsx("input",{ref:R,type:"file",multiple:true,onChange:F,className:"hidden",accept:"image/*,.pdf,.doc,.docx,.xls,.xlsx,.txt,.zip"})]}),jsxRuntime.jsx("textarea",{ref:N,value:e,onChange:te,onSelect:ie,onKeyDown:Ne,placeholder:o||(m==="es"?"Escribe un comentario...":"Write a comment..."),disabled:s||n,rows:1,className:b("flex-1 bg-transparent text-sm outline-none min-w-[100px] resize-none py-0.5",g?"text-white placeholder:text-[#6B7280] scrollbar-slim":"text-gray-900 placeholder:text-gray-400 scrollbar-slim-light",(s||n)&&"opacity-50"),style:{lineHeight:"1.5",height:"24px",maxHeight:"280px",overflowY:"hidden"}}),jsxRuntime.jsx("button",{onClick:a,disabled:n||!e.trim()&&u.length===0||s,className:b("p-1.5 rounded transition-colors",(e.trim()||u.length>0)&&!s?"bg-blue-500 text-white hover:bg-blue-600":g?"text-[#6B7280]":"text-gray-400",n&&"opacity-50 cursor-not-allowed"),children:n?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:v&&p.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{ref:z,initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},className:b("absolute bottom-full left-0 right-0 mb-1 py-1 rounded-lg shadow-xl z-50","max-h-[200px] overflow-y-auto",g?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:p.map((E,W)=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>xe(E),className:b("w-full flex items-center gap-3 px-3 py-2 text-left transition-colors",W===x?g?"bg-white/10":"bg-gray-100":g?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:E.color||"#8B5CF6"},children:Fg(E.name)}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("p",{className:b("text-sm font-medium truncate",g?"text-white":"text-gray-900"),children:E.name}),E.email&&jsxRuntime.jsx("p",{className:b("text-xs truncate",g?"text-[#6B7280]":"text-gray-500"),children:E.email})]})]},E.id))})})]})]})]})}function Od({content:e,theme:t="dark"}){let a=t==="dark",r=[],o=/@(\S+)/g,s=0,n;for(;(n=o.exec(e))!==null;)n.index>s&&r.push({type:"text",value:e.slice(s,n.index)}),r.push({type:"mention",value:n[0]}),s=n.index+n[0].length;return s<e.length&&r.push({type:"text",value:e.slice(s)}),jsxRuntime.jsx("span",{className:"whitespace-pre-wrap break-words",children:r.map((l,m)=>l.type==="mention"?jsxRuntime.jsx("span",{className:b("inline-flex items-center px-1 py-0.5 rounded","font-medium text-sm",a?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:l.value},m):jsxRuntime.jsx("span",{children:l.value},m))})}var Nn=["#EF4444","#F97316","#F59E0B","#EAB308","#84CC16","#22C55E","#10B981","#14B8A6","#06B6D4","#0EA5E9","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899"];function Sr({selectedTags:e,availableTags:t,onChange:a,onCreateTag:r,theme:o,disabled:s=false,compact:n=true}){let[l,m]=react.useState(false),[i,c]=react.useState(""),[d,u]=react.useState(false),[f,y]=react.useState(Nn[10]||"#3B82F6"),[k,g]=react.useState({top:0,left:0}),v=react.useRef(null),h=react.useRef(null),p=react.useRef(null),w=react.useRef(null),x=t.filter(N=>N.name.toLowerCase().includes(i.toLowerCase())),S=t.some(N=>N.name.toLowerCase()===i.toLowerCase());react.useEffect(()=>{if(l&&h.current){let N=h.current.getBoundingClientRect();g({top:N.bottom+6,left:N.left});}},[l]),react.useEffect(()=>{let N=z=>{let R=z.target,_=v.current?.contains(R),se=p.current?.contains(R);!_&&!se&&(m(false),c(""),u(false));};if(l)return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[l]),react.useEffect(()=>{l&&w.current&&w.current.focus();},[l]);let T=N=>{let z=e.some(R=>R.id===N.id);a(z?e.filter(R=>R.id!==N.id):[...e,N]);},C=async()=>{if(!(!r||!i.trim())){u(true);try{let N=await r(i.trim(),f);N&&(a([...e,N]),c(""),y(Nn[Math.floor(Math.random()*Nn.length)]||"#3B82F6"));}finally{u(false);}}},A=(N,z)=>{z.stopPropagation(),a(e.filter(R=>R.id!==N));},I={backgroundColor:`${o.textTertiary}15`,border:`1px solid ${o.borderLight}`,color:o.textSecondary};return jsxRuntime.jsxs("div",{ref:v,className:"relative",children:[jsxRuntime.jsxs("button",{ref:h,type:"button",onClick:()=>!s&&m(!l),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm transition-all hover:opacity-80",style:I,disabled:s,children:[jsxRuntime.jsx(lucideReact.Tag,{className:"w-3.5 h-3.5"}),e.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[e.slice(0,2).map(N=>jsxRuntime.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium",style:{backgroundColor:`${N.color}20`,color:N.color},children:N.name},N.id)),e.length>2&&jsxRuntime.jsxs("span",{className:"text-xs",style:{color:o.textTertiary},children:["+",e.length-2]})]}):jsxRuntime.jsx("span",{children:"Agregar"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3",style:{color:o.textTertiary}})]}),typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx(framerMotion.AnimatePresence,{children:l&&jsxRuntime.jsxs(framerMotion.motion.div,{ref:p,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:k.top,left:k.left,zIndex:99999,backgroundColor:o.bgPrimary,border:`1px solid ${o.border}`,boxShadow:"0 4px 20px rgba(0, 0, 0, 0.25)"},children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:o.border},children:jsxRuntime.jsx("input",{ref:w,type:"text",value:i,onChange:N=>c(N.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:N=>{N.key==="Enter"&&i.trim()&&!S&&r&&C();}})}),e.length>0&&jsxRuntime.jsxs("div",{className:"p-2 border-b",style:{borderColor:o.border},children:[jsxRuntime.jsx("p",{className:"text-xs mb-1.5",style:{color:o.textTertiary},children:"Seleccionadas"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.map(N=>jsxRuntime.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:`${N.color}20`,color:N.color},onClick:z=>A(N.id,z),children:[N.name,jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})]},N.id))})]}),jsxRuntime.jsx("div",{className:"max-h-[200px] overflow-y-auto p-1",children:x.length>0?x.map(N=>{let z=e.some(R=>R.id===N.id);return jsxRuntime.jsxs("button",{type:"button",onClick:()=>T(N),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors",style:{backgroundColor:z?`${N.color}15`:"transparent",color:o.textPrimary},onMouseEnter:R=>{z||(R.currentTarget.style.backgroundColor=o.hoverBg);},onMouseLeave:R=>{z||(R.currentTarget.style.backgroundColor="transparent");},children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:N.color}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",children:N.name}),z&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:N.color}})]},N.id)}):i.trim()?jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No se encontraron etiquetas"}):jsxRuntime.jsx("div",{className:"p-2 text-center text-sm",style:{color:o.textTertiary},children:"No hay etiquetas disponibles"})}),i.trim()&&!S&&r&&jsxRuntime.jsxs("div",{className:"p-2 border-t",style:{borderColor:o.border},children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-2",children:jsxRuntime.jsx("p",{className:"text-xs",style:{color:o.textTertiary},children:"Crear nueva etiqueta"})}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:Nn.map(N=>jsxRuntime.jsx("button",{type:"button",onClick:()=>y(N),className:"w-5 h-5 rounded-full transition-transform hover:scale-110",style:{backgroundColor:N,outline:f===N?`2px solid ${N}`:"none",outlineOffset:"2px"}},N))}),jsxRuntime.jsxs("button",{type:"button",onClick:C,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:f,color:"#FFFFFF",opacity:d?.7:1},children:[d?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),'Crear "',i.trim(),'"']})]})]})}),document.body)]})}function Vs({tag:e,onRemove:t,size:a="sm"}){return jsxRuntime.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&&jsxRuntime.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),t();},className:"hover:opacity-70",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]})}function Ud({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 jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-1",children:[r.map(s=>jsxRuntime.jsx(Vs,{tag:s,size:a},s.id)),o>0&&jsxRuntime.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 Jr=[{name:"Azul",value:"#6366F1",light:"#818CF8"},{name:"P\xFArpura",value:"#A855F7",light:"#C084FC"},{name:"Rosa",value:"#EC4899",light:"#F472B6"},{name:"Rojo",value:"#EF4444",light:"#F87171"},{name:"Naranja",value:"#F59E0B",light:"#FBBF24"},{name:"Amarillo",value:"#EAB308",light:"#FACC15"},{name:"Lima",value:"#84CC16",light:"#A3E635"},{name:"Verde",value:"#10B981",light:"#34D399"},{name:"Esmeralda",value:"#059669",light:"#10B981"},{name:"Cyan",value:"#06B6D4",light:"#22D3EE"},{name:"Azul Cielo",value:"#0EA5E9",light:"#38BDF8"},{name:"\xCDndigo",value:"#4F46E5",light:"#6366F1"},{name:"Violeta",value:"#8B5CF6",light:"#A78BFA"},{name:"Fucsia",value:"#D946EF",light:"#E879F9"},{name:"Coral",value:"#F97316",light:"#FB923C"},{name:"Magenta",value:"#E11D48",light:"#FB7185"}];function Kd(e,t=[]){if("title"in e&&!("name"in e)){let a=e,r=(a.assignedUserIds||[]).map(o=>{let s=t.find(n=>n.id===o);return s||null}).filter(o=>o!==null);return {id:a.id,name:a.title,startDate:a.startDate?new Date(a.startDate):void 0,endDate:a.endDate?new Date(a.endDate):void 0,progress:a.progress||0,status:a.columnId,priority:a.priority?.toLowerCase(),assignees:r,dependencies:Array.isArray(a.dependencies)?a.dependencies.map(o=>typeof o=="string"?o:o.taskId):[],tags:a.tags,subtasks:a.subtasks?.map(o=>({id:o.id,name:o.title,progress:o.completed?100:0,startDate:new Date,endDate:new Date})),color:a.color,description:a.description}}return e}function rf(e,t){return {...t,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,priority:e.priority?.toUpperCase(),tags:e.tags,description:e.description,color:e.color,columnId:e.status,assignedUserIds:t.assignedUserIds,dependencies:e.dependencies}}function fr({task:e,isOpen:t,onClose:a,onTaskUpdate:r,onCardUpdate:o,theme:s="dark",locale:n="es",availableUsers:l=[],availableTags:m=[],onCreateTag:i,attachments:c=[],onUploadAttachments:d,onDeleteAttachment:u,availableTasks:f=[],comments:y=[],onAddComment:k,currentUser:g,mentionableUsers:v=[],onUploadCommentAttachments:h}){let p=s==="dark",w={textTertiary:p?"#6B7280":"#9CA3AF",textSecondary:p?"#9CA3AF":"#6B7280",textPrimary:p?"#FFFFFF":"#111827",borderLight:p?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:p?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:p?"#1A1D25":"#FFFFFF",bgSecondary:p?"#0F1117":"#F9FAFB",hoverBg:p?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},x=e&&"title"in e&&!("name"in e),S=e,[T,C]=react.useState(e?Kd(e,l):null),[A,I]=react.useState(false),[N,z]=react.useState(false),[R,_]=react.useState(false),[se,te]=react.useState(null),[ie,xe]=react.useState(new Date),[Ne,Ae]=react.useState(false),[F,B]=react.useState(false),[E,W]=react.useState(""),[q,pe]=react.useState(false),[fe,Ce]=react.useState(false),[Y,V]=react.useState(false),[Oe,ue]=react.useState(""),Le=react.useRef(null),Je=react.useRef(null),[st,Ge]=react.useState(""),bt=react.useRef(null),[ut,Pt]=react.useState(""),[ge,L]=react.useState(false),[re,Te]=react.useState([]),[Ue,Z]=react.useState(""),[Re,H]=react.useState(false),K=react.useRef(null);react.useEffect(()=>{if(e){let D=Kd(e,l);C(D),ue(D.description||""),Ge(D.name||"");}},[e?.id,l]),react.useEffect(()=>{if(!t||!Oe)return;let D=setTimeout(()=>{let Q=Je.current;Q&&(Q.style.height="auto",Q.style.height=`${Math.max(100,Q.scrollHeight)}px`);},50);return ()=>clearTimeout(D)},[t,Oe]),react.useEffect(()=>()=>{Le.current&&clearTimeout(Le.current),bt.current&&clearTimeout(bt.current);},[]),react.useEffect(()=>{t&&K.current&&y.length>0&&setTimeout(()=>{K.current&&(K.current.scrollTop=K.current.scrollHeight);},100);},[t,y.length]);let ke=react.useCallback(D=>{C(D),x&&o&&S?o(rf(D,S)):r&&r(D);},[x,S,o,r]),Ie=react.useCallback(()=>{I(false),z(false),_(false),te(null),B(false),W(""),pe(false);},[]),_e=react.useCallback((D,Q)=>{if(!T)return;let ce={...T,[D]:Q};ke(ce);},[T,ke]),We=react.useCallback(()=>{let D=Je.current;D&&(D.style.height="auto",D.style.height=`${Math.max(100,D.scrollHeight)}px`);},[]),ne=react.useCallback(D=>{ue(D),setTimeout(We,0),Le.current&&clearTimeout(Le.current),Le.current=setTimeout(()=>{if(T){let Q={...T,description:D};ke(Q);}},800);},[T,ke,We]),Be=react.useCallback(D=>{Ge(D),bt.current&&clearTimeout(bt.current),bt.current=setTimeout(()=>{if(T&&D.trim()){let Q={...T,name:D.trim()};ke(Q);}},800);},[T,ke]),ee=react.useCallback(D=>{let Q=D.map(ce=>{let Xe={id:`pending-${Date.now()}-${Math.random().toString(36).slice(2)}`,file:ce};return ce.type.startsWith("image/")&&(Xe.preview=URL.createObjectURL(ce)),Xe});Te(ce=>[...ce,...Q]);},[]),Ye=react.useCallback(D=>{Te(Q=>{let ce=Q.find(Xe=>Xe.id===D);return ce?.preview&&URL.revokeObjectURL(ce.preview),Q.filter(Xe=>Xe.id!==D)});},[]),Pa=react.useCallback(async()=>{if(!(!T||!ut.trim()&&re.length===0||!k)){L(true);try{let D=Bd(ut,v),Q=[];if(re.length>0&&h){let ce=re.map(Xe=>Xe.file);Q=await h(ce);}await k(T.id,ut.trim(),D.length>0?D:void 0,Q.length>0?Q:void 0),Pt(""),re.forEach(ce=>{ce.preview&&URL.revokeObjectURL(ce.preview);}),Te([]);}finally{L(false);}}},[T,ut,re,k,v,h]),be=react.useCallback(()=>{if(!T||!Ue.trim())return;let D={id:`subtask-${Date.now()}-${Math.random().toString(36).slice(2)}`,name:Ue.trim(),progress:0,startDate:new Date,endDate:new Date},Q=[...T.subtasks||[],D],ce={...T,subtasks:Q};ke(ce),Z(""),H(false);},[T,Ue,ke]),qe=react.useCallback(D=>{if(!T?.subtasks)return;let Q=T.subtasks.map(Xe=>Xe.id===D?{...Xe,progress:Xe.progress===100?0:100}:Xe),ce={...T,subtasks:Q};ke(ce);},[T,ke]),He=react.useCallback(D=>{if(!T?.subtasks)return;let Q=T.subtasks.filter(Xe=>Xe.id!==D),ce={...T,subtasks:Q};ke(ce);},[T,ke]),Ze=react.useCallback(D=>{let Q=typeof D=="string"?new Date(D):D,Xe=new Date().getTime()-Q.getTime(),Ft=Math.floor(Xe/6e4),Zt=Math.floor(Xe/36e5),Dt=Math.floor(Xe/864e5);return Ft<1?n==="es"?"Ahora":"Just now":Ft<60?n==="es"?`Hace ${Ft} min`:`${Ft}m ago`:Zt<24?n==="es"?`Hace ${Zt}h`:`${Zt}h ago`:Dt<7?n==="es"?`Hace ${Dt}d`:`${Dt}d ago`:Q.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})},[n]),rt=react.useCallback(D=>{if(!T)return;let Q=T.progress||0;D==="completed"?Q=100:D==="in-progress"&&Q===0?Q=10:D==="todo"&&(Q=0);let ce={...T,status:D,progress:Q};ke(ce),I(false);},[T,ke]),it=react.useCallback((D,Q)=>{if(!T)return;let ce={...T,startDate:D,endDate:Q};ke(ce);},[T,ke]),G=react.useCallback(()=>{let D=ie.getFullYear(),Q=ie.getMonth(),ce=new Date(D,Q,1),Ft=new Date(D,Q+1,0).getDate(),Zt=ce.getDay(),Dt=[],de=new Date(D,Q,0).getDate();for(let Ve=Zt-1;Ve>=0;Ve--)Dt.push({date:new Date(D,Q-1,de-Ve),isCurrentMonth:false});for(let Ve=1;Ve<=Ft;Ve++)Dt.push({date:new Date(D,Q,Ve),isCurrentMonth:true});let Qe=42-Dt.length;for(let Ve=1;Ve<=Qe;Ve++)Dt.push({date:new Date(D,Q+1,Ve),isCurrentMonth:false});return Dt},[ie]),X=react.useCallback(async D=>{if(D.preventDefault(),D.stopPropagation(),Ce(false),!T||!d)return;let Q=Array.from(D.dataTransfer.files);if(Q.length!==0){V(true);try{await d(T.id,Q);}finally{V(false);}}},[T,d]),Pe=react.useCallback(async D=>{if(!T||!d||!D.target.files)return;let Q=Array.from(D.target.files);if(Q.length!==0){V(true);try{await d(T.id,Q);}finally{V(false);}D.target.value="";}},[T,d]),Ke=react.useCallback(D=>{D.preventDefault(),D.stopPropagation(),Ce(true);},[]),ze=react.useCallback(D=>{D.preventDefault(),D.stopPropagation(),Ce(false);},[]),U=react.useCallback(D=>D<1024?`${D} B`:D<1024*1024?`${(D/1024).toFixed(1)} KB`:`${(D/(1024*1024)).toFixed(1)} MB`,[]),le=react.useCallback(D=>D.startsWith("image/")?lucideReact.Image:D.includes("pdf")||D.includes("document")?lucideReact.FileText:lucideReact.File,[]);return !t||!T?null:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:t&&T&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a,className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:b("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",p?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:b("px-6 py-3 border-b flex items-center gap-3",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:b("w-4 h-4",p?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:b("text-xs px-2 py-0.5 rounded",p?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[n==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:b("text-xs font-mono",p?"text-[#6B7280]":"text-gray-400"),children:T.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:b("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",p?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:b("p-1.5 rounded transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:b("p-1.5 rounded transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:a,className:b("p-1.5 rounded transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let D=T.progress===100?0:100,ce={...T,progress:D,status:D===100?"completed":"todo"};ke(ce);},className:b("mt-2 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors flex-shrink-0",T.progress===100?"bg-green-500 border-green-500":p?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:T.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("input",{type:"text",value:st,onChange:D=>Be(D.target.value),placeholder:n==="es"?"Nombre de la tarea...":"Task name...",className:b("text-xl font-semibold flex-1 bg-transparent outline-none border-none px-0 py-0","focus:ring-0 focus:outline-none",T.progress===100?"line-through text-[#6B7280]":p?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"px-6 pb-6 flex-1 overflow-y-auto overflow-x-visible",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-12 gap-y-5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{Ie(),I(!A);},className:b("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",T.progress===100||T.status==="completed"?"bg-green-500/20 text-green-400":T.progress&&T.progress>0||T.status==="in-progress"?"bg-blue-500/20 text-blue-400":p?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:T.progress===100||T.status==="completed"?n==="es"?"COMPLETADO":"DONE":T.progress&&T.progress>0||T.status==="in-progress"?n==="es"?"EN PROGRESO":"IN PROGRESS":n==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:A&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>I(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:n==="es"?"Por hacer":"To Do",color:"bg-gray-400"},{id:"in-progress",label:n==="es"?"En progreso":"In Progress",color:"bg-blue-500"},{id:"completed",label:n==="es"?"Completado":"Done",color:"bg-green-500"}].map(D=>jsxRuntime.jsxs("button",{onClick:()=>rt(D.id),className:b("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",T.status===D.id&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:b("w-2 h-2 rounded-full",D.color)}),jsxRuntime.jsx("span",{className:p?"text-white":"text-gray-900",children:D.label})]},D.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{Ie(),_(!R);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[T.assignees&&T.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[T.assignees.slice(0,3).map((D,Q)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:D.color||"#8B5CF6"},title:D.name,children:D.initials||D.name.slice(0,2).toUpperCase()},Q)),T.assignees.length>3&&jsxRuntime.jsxs("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:["+",T.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:b("text-sm",p?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:b("w-3 h-3",p?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>_(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:l.length>0?l.map(D=>{let Q=T.assignees?.some(ce=>ce.name===D.name);return jsxRuntime.jsxs("button",{onClick:()=>{let ce=T.assignees||[],Xe;Q?Xe=ce.filter(Ft=>Ft.name!==D.name):Xe=[...ce,D],_e("assignees",Xe);},className:b("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",Q&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:D.color||"#8B5CF6"},children:D.initials||D.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:b("flex-1",p?"text-white":"text-gray-900"),children:D.name}),Q&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},D.name)}):jsxRuntime.jsx("div",{className:b("px-3 py-4 text-sm text-center",p?"text-[#6B7280]":"text-gray-500"),children:n==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{te(se?null:"start"),xe(T.startDate||new Date);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[T.startDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:b("mx-1",p?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),T.endDate?.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(n==="es"?"Fin":"End")]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:se&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>te(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:b("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:D=>D.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:b("w-44 py-2 border-r",p?"border-white/10":"border-gray-200"),children:[(()=>{let D=new Date,Q=new Date(D);Q.setDate(D.getDate()+1);let ce=new Date(D);ce.setDate(D.getDate()+((6-D.getDay()+7)%7||7));let Xe=new Date(D);Xe.setDate(D.getDate()+((1-D.getDay()+7)%7||7));let Ft=new Date(D);Ft.setDate(D.getDate()+(6-D.getDay()+7)%7+7);let Zt=new Date(D);Zt.setDate(D.getDate()+14);let Dt=new Date(D);return Dt.setDate(D.getDate()+28),[{label:n==="es"?"Hoy":"Today",date:D,display:D.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Ma\xF1ana":"Tomorrow",date:Q,display:Q.toLocaleDateString(n==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:n==="es"?"Este fin de semana":"This weekend",date:ce,display:n==="es"?"s\xE1b.":"sat."},{label:n==="es"?"Pr\xF3xima semana":"Next week",date:Xe,display:n==="es"?"lun.":"mon."},{label:n==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Ft,display:Ft.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"2 semanas":"2 weeks",date:Zt,display:Zt.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:n==="es"?"4 semanas":"4 weeks",date:Dt,display:Dt.toLocaleDateString(n==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Qe,Ve)=>jsxRuntime.jsxs("button",{className:b("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",p?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(se==="start"){let ar=T.endDate&&Qe.date>T.endDate?Qe.date:T.endDate;it(Qe.date,ar),te("end");}else {let ar=T.startDate&&Qe.date<T.startDate?Qe.date:T.startDate;it(ar,Qe.date),te(null);}},children:[jsxRuntime.jsx("span",{children:Qe.label}),jsxRuntime.jsx("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:Qe.display})]},Ve))})(),jsxRuntime.jsx("div",{className:b("border-t mt-2 pt-2",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{it(void 0,void 0),te(null);},className:b("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",p?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:n==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:b("text-xs mb-3 px-2 py-1 rounded",p?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:se==="start"?n==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":n==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:b("font-medium",p?"text-white":"text-gray-900"),children:ie.toLocaleDateString(n==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>xe(new Date),className:b("p-1 rounded text-sm transition-colors",p?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:n==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>xe(new Date(ie.getFullYear(),ie.getMonth()-1)),className:b("p-1 rounded",p?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),jsxRuntime.jsx("button",{onClick:()=>xe(new Date(ie.getFullYear(),ie.getMonth()+1)),className:b("p-1 rounded",p?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(n==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(D=>jsxRuntime.jsx("div",{className:b("w-8 h-8 flex items-center justify-center text-xs",p?"text-[#6B7280]":"text-gray-400"),children:D},D))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:G().map((D,Q)=>{let ce=D.date.toDateString()===new Date().toDateString(),Xe=T.startDate?.toDateString()===D.date.toDateString(),Ft=T.endDate?.toDateString()===D.date.toDateString(),Zt=Xe||Ft,Dt=T.startDate&&T.endDate&&D.date>=T.startDate&&D.date<=T.endDate;return jsxRuntime.jsx("button",{onClick:()=>{let de=new Date(D.date);if(se==="start"){let Qe=T.endDate&&de>T.endDate?de:T.endDate;it(de,Qe),te("end");}else {let Qe=T.startDate&&de<T.startDate?de:T.startDate;it(Qe,de),te(null);}},className:b("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!D.isCurrentMonth&&(p?"text-[#4B5563]":"text-gray-300"),D.isCurrentMonth&&(p?"text-white":"text-gray-900"),ce&&"ring-2 ring-[#3B82F6]",Xe&&"bg-[#3B82F6] text-white",Ft&&!Xe&&"bg-[#7C3AED] text-white",Dt&&!Zt&&(p?"bg-[#7C3AED]/20":"bg-purple-100"),!Zt&&(p?"hover:bg-white/10":"hover:bg-gray-100")),children:D.date.getDate()},Q)})})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{Ie(),z(!N);},className:b("text-xs px-2 py-1 rounded font-medium transition-all hover:ring-2 hover:ring-white/20",T.priority==="high"||T.priority==="urgent"?"bg-red-500/20 text-red-400":T.priority==="medium"?"bg-yellow-500/20 text-yellow-400":T.priority==="low"?"bg-green-500/20 text-green-400":p?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:T.priority?T.priority==="high"||T.priority==="urgent"?n==="es"?"Alta":"High":T.priority==="medium"?n==="es"?"Media":"Medium":n==="es"?"Baja":"Low":n==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:N&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>z(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:n==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:n==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:n==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:n==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:n==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(D=>jsxRuntime.jsxs("button",{onClick:()=>{_e("priority",D.id),z(false);},className:b("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",T.priority===D.id&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:b("w-2 h-2 rounded-full",D.color)}),jsxRuntime.jsx("span",{className:p?"text-white":"text-gray-900",children:D.label})]},D.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-white":"text-gray-900"),children:T.startDate&&T.endDate?`${Math.ceil((T.endDate.getTime()-T.startDate.getTime())/(1e3*60*60*24))} ${n==="es"?"d\xEDas":"days"}`:n==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:b("w-4 h-4 rounded-full border-2",p?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[Ne?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:T.progress||0,onChange:D=>{let Q=parseInt(D.target.value),ce=T.status;Q===100?ce="completed":Q>0?ce="in-progress":ce="todo";let Xe={...T,progress:Q,status:ce};ke(Xe);},onBlur:()=>Ae(false),className:b("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",p?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>Ae(true),className:b("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",p?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:b("h-full rounded-full transition-all",T.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${T.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:b("text-sm font-medium min-w-[40px]",p?"text-white":"text-gray-900"),children:[T.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(Sr,{selectedTags:T.tags||[],availableTags:m,onChange:D=>{_e("tags",D);},onCreateTag:i,theme:w})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:b("w-4 h-4 mt-1.5",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24 mt-1",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[T.dependencies&&T.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:T.dependencies.map(D=>{let Q=f.find(ce=>ce.id===D);return jsxRuntime.jsxs("span",{className:b("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",p?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:[Q?.name||D.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let ce=(T.dependencies||[]).filter(Xe=>Xe!==D);_e("dependencies",ce);},className:b("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},D)})}),jsxRuntime.jsxs("button",{onClick:()=>{Ie(),B(!F);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:F&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{B(false),W("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:b("p-2 border-b",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:E,onChange:D=>W(D.target.value),placeholder:n==="es"?"Buscar tarea...":"Search task...",className:b("w-full px-3 py-2 rounded-md text-sm outline-none",p?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:f.length>0?f.filter(D=>D.id!==T.id).filter(D=>E===""||D.name.toLowerCase().includes(E.toLowerCase())).map(D=>{let Q=T.dependencies?.includes(D.id);return jsxRuntime.jsxs("button",{onClick:()=>{let ce=T.dependencies||[],Xe;Q?Xe=ce.filter(Ft=>Ft!==D.id):Xe=[...ce,D.id],_e("dependencies",Xe);},className:b("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",p?"hover:bg-white/5":"hover:bg-gray-50",Q&&(p?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:b("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",Q?"bg-blue-500 border-blue-500":p?"border-white/30":"border-gray-300"),children:Q&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:b("block truncate",p?"text-white":"text-gray-900"),children:D.name}),jsxRuntime.jsx("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:D.id.slice(0,8)})]})]},D.id)}):jsxRuntime.jsx("div",{className:b("px-3 py-4 text-sm text-center",p?"text-[#6B7280]":"text-gray-500"),children:n==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{Ie(),pe(!q);},className:b("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:T.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-white":"text-gray-900"),children:Jr.find(D=>D.value===T.color)?.name||(n==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:b("w-3 h-3",p?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:q&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>pe(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:b("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",p?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:Jr.map(D=>{let Q=T.color===D.value;return jsxRuntime.jsx("button",{onClick:()=>{_e("color",D.value),pe(false);},className:b("w-7 h-7 rounded-full flex items-center justify-center transition-all",Q&&"ring-2 ring-offset-2",p?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:D.value,outlineColor:Q?D.value:void 0},title:D.name,children:Q&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},D.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:b("text-sm w-24",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:T.isMilestone||false,onChange:D=>_e("isMilestone",D.target.checked),className:b("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",T.isMilestone?"bg-purple-500 border-purple-500":p?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:b("text-sm",p?"text-white":"text-gray-900"),children:n==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:b("mt-6 pt-4 border-t",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:b("w-4 h-4",p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:b("text-sm font-semibold",p?"text-white":"text-gray-900"),children:n==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{ref:Je,value:Oe,onChange:D=>ne(D.target.value),placeholder:n==="es"?"Agregar descripci\xF3n...":"Add description...",className:b("w-full min-h-[100px] max-h-[400px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors overflow-y-auto",p?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")}),jsxRuntime.jsxs("button",{className:b("flex items-center gap-2 text-sm mt-2 transition-colors",p?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),n==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:b("mt-6 pt-4 border-t",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("div",{className:"flex items-center justify-between mb-3",children:jsxRuntime.jsxs("h3",{className:b("text-sm font-semibold",p?"text-white":"text-gray-900"),children:[n==="es"?"Subtareas":"Subtasks",T.subtasks&&T.subtasks.length>0&&jsxRuntime.jsxs("span",{className:b("ml-2 text-xs font-normal",p?"text-[#6B7280]":"text-gray-400"),children:["(",T.subtasks.filter(D=>D.progress===100).length,"/",T.subtasks.length,")"]})]})}),T.subtasks&&T.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:T.subtasks.map(D=>jsxRuntime.jsxs("div",{className:b("flex items-center gap-2 group p-2 rounded-lg -mx-2 transition-colors",p?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx("button",{onClick:()=>qe(D.id),className:b("w-5 h-5 rounded border flex items-center justify-center flex-shrink-0 transition-colors",D.progress===100?"bg-green-500 border-green-500":p?"border-white/20 hover:border-green-500/50":"border-gray-300 hover:border-green-500"),children:D.progress===100&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:b("text-sm flex-1",D.progress===100?"line-through text-[#6B7280]":p?"text-white":"text-gray-900"),children:D.name}),jsxRuntime.jsx("button",{onClick:()=>He(D.id),className:b("p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",p?"hover:bg-white/10 text-[#6B7280] hover:text-red-400":"hover:bg-gray-100 text-gray-400 hover:text-red-500"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-3.5 h-3.5"})})]},D.id))}),Re?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:Ue,onChange:D=>Z(D.target.value),onKeyDown:D=>{D.key==="Enter"&&Ue.trim()?be():D.key==="Escape"&&(H(false),Z(""));},placeholder:n==="es"?"Nombre de la subtarea...":"Subtask name...",autoFocus:true,className:b("flex-1 px-3 py-2 rounded-lg text-sm outline-none transition-colors",p?"bg-white/5 border border-white/10 text-white placeholder:text-[#6B7280] focus:border-blue-500/50":"bg-gray-50 border border-gray-200 text-gray-900 placeholder:text-gray-400 focus:border-blue-500")}),jsxRuntime.jsx("button",{onClick:be,disabled:!Ue.trim(),className:b("px-3 py-2 rounded-lg text-sm font-medium transition-colors",Ue.trim()?"bg-blue-500 hover:bg-blue-600 text-white":p?"bg-white/5 text-[#6B7280] cursor-not-allowed":"bg-gray-100 text-gray-400 cursor-not-allowed"),children:n==="es"?"Agregar":"Add"}),jsxRuntime.jsx("button",{onClick:()=>{H(false),Z("");},className:b("p-2 rounded-lg transition-colors",p?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}):jsxRuntime.jsxs("button",{onClick:()=>H(true),className:b("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",p?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),n==="es"?"Agregar subtarea":"Add subtask"]})]}),jsxRuntime.jsxs("div",{className:b("mt-6 pt-4 border-t",p?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:b("text-sm font-semibold mb-3",p?"text-white":"text-gray-900"),children:[n==="es"?"Adjuntos":"Attachments",c.length>0&&jsxRuntime.jsxs("span",{className:b("ml-2 text-xs font-normal",p?"text-[#6B7280]":"text-gray-400"),children:["(",c.length,")"]})]}),c.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:c.map(D=>{let Q=le(D.type),ce=D.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:b("flex items-center gap-3 p-2 rounded-lg group transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[ce&&D.thumbnailUrl?jsxRuntime.jsx("img",{src:D.thumbnailUrl,alt:D.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:b("w-10 h-10 rounded flex items-center justify-center",p?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(Q,{className:b("w-5 h-5",p?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:D.url,target:"_blank",rel:"noopener noreferrer",className:b("text-sm font-medium truncate block hover:underline",p?"text-white":"text-gray-900"),children:D.name}),jsxRuntime.jsx("p",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:U(D.size)})]}),u&&jsxRuntime.jsx("button",{onClick:()=>u(D.id),className:b("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",p?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:n==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},D.id)})}),jsxRuntime.jsxs("div",{onDragOver:Ke,onDragLeave:ze,onDrop:X,className:b("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",fe?p?"border-blue-500 bg-blue-500/10":"border-blue-400 bg-blue-50":p?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",Y&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:Pe,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!d||Y}),Y?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-500"),children:n==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:b("w-6 h-6 mx-auto mb-2",fe?"text-blue-500":p?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-500"),children:fe?n==="es"?"Suelta los archivos aqu\xED":"Drop files here":n==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!d&&jsxRuntime.jsx("p",{className:b("text-xs mt-1",p?"text-[#6B7280]":"text-gray-400"),children:n==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:b("w-96 border-l flex flex-col",p?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:b("px-4 py-3 border-b",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("h3",{className:b("text-sm font-semibold",p?"text-white":"text-gray-900"),children:[n==="es"?"Actividad":"Activity",y.length>0&&jsxRuntime.jsxs("span",{className:b("ml-2 text-xs font-normal",p?"text-[#6B7280]":"text-gray-400"),children:["(",y.length,")"]})]})}),jsxRuntime.jsx("div",{ref:K,className:b("flex-1 overflow-y-auto py-4 pl-4 pr-2",p?"scrollbar-slim":"scrollbar-slim-light"),children:y.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:[...y].sort((D,Q)=>{let ce=typeof D.createdAt=="string"?new Date(D.createdAt):D.createdAt,Xe=typeof Q.createdAt=="string"?new Date(Q.createdAt):Q.createdAt;return ce.getTime()-Xe.getTime()}).map(D=>jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-[10px] font-medium flex-shrink-0",style:{backgroundColor:D.user?.color||"#8B5CF6"},children:D.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:b("text-sm font-medium",p?"text-white":"text-gray-900"),children:D.user?.name||(n==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:b("text-xs",p?"text-[#6B7280]":"text-gray-400"),children:Ze(D.createdAt)})]}),jsxRuntime.jsx("div",{className:b("text-sm",p?"text-[#9CA3AF]":"text-gray-600"),children:jsxRuntime.jsx(Od,{content:D.content,theme:s})}),D.attachments&&D.attachments.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:D.attachments.map(Q=>{let ce=Q.type.startsWith("image/");return jsxRuntime.jsxs("a",{href:Q.url,target:"_blank",rel:"noopener noreferrer",className:b("flex items-center gap-2 px-2 py-1.5 rounded-lg transition-colors",p?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[ce?jsxRuntime.jsx(lucideReact.Image,{className:b("w-4 h-4",p?"text-[#9CA3AF]":"text-gray-500")}):jsxRuntime.jsx(lucideReact.File,{className:b("w-4 h-4",p?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsx("span",{className:b("text-xs truncate max-w-[100px]",p?"text-white":"text-gray-900"),children:Q.name})]},Q.id)})})]})]},D.id))}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:b("w-10 h-10 mb-3",p?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:b("text-sm",p?"text-[#6B7280]":"text-gray-500"),children:n==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:b("py-4 pl-4 pr-2 border-t",p?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx(Rd,{value:ut,onChange:Pt,onSubmit:Pa,users:v,placeholder:n==="es"?"Escribe un comentario... (usa @ para mencionar)":"Write a comment... (use @ to mention)",disabled:!k,isSubmitting:ge,theme:s,locale:n,currentUser:g,enableEmoji:true,enableAttachments:!!h,pendingFiles:re,onFilesSelect:ee,onRemoveFile:Ye})})]})]})]})})}function Ks(){let[e,t]=react.useState(()=>core.dragStore.getState());react.useEffect(()=>core.dragStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.dragStore.setState(r);},[]);return [e,a]}function Mr({board:e,callbacks:t,onCardClick:a,renderProps:r,config:o,availableUsers:s=[],className:n,style:l,isLoading:m,error:i,children:c,availableTags:d=[],onCreateTag:u,attachmentsByCard:f,onUploadAttachments:y,onDeleteAttachment:k,comments:g,onAddComment:v,currentUser:h,mentionableUsers:p,onTaskOpen:w,onUploadCommentAttachments:x}){let[S,T]=Ks(),[C,A]=react.useState(null),[I,N]=react.useState(false),z=react.useRef(null),R=react.useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),_=o?.theme||"dark",se=_==="dark"||_==="neutral",te=se?"dark":"",ie=react.useCallback((Y,V)=>{t.onCardUpdate?.(Y,V);},[t]),xe=react.useCallback((Y,V)=>{t.onColumnUpdate?.(Y,{title:V});},[t]),Ne=react.useCallback(Y=>{t.onColumnDelete?.(Y);},[t]),Ae=["todo","in-progress","completed"],F=core$1.useSensors(core$1.useSensor(core$1.PointerSensor,{activationConstraint:{distance:8}}),core$1.useSensor(core$1.KeyboardSensor,{coordinateGetter:sortable.sortableKeyboardCoordinates})),B=react.useMemo(()=>{let Y=new Map;return e.columns.forEach(V=>{let Oe=V.cardIds.map(ue=>e.cards.find(Le=>Le.id===ue)).filter(ue=>ue!==void 0).sort((ue,Le)=>ue.position-Le.position);Y.set(V.id,Oe);}),Y},[e.cards,e.columns]);react.useEffect(()=>{let Y=z.current;if(!Y)return;let V=Je=>{let st=Je.target,Ge=Je.button===1,bt=st===Y||st.classList.contains("asakaa-column")&&!st.closest(".asakaa-card");(Ge||Je.button===0&&bt&&!S.isDragging)&&(Je.preventDefault(),N(true),R.current={x:Je.clientX,y:Je.clientY,scrollLeft:Y.scrollLeft,scrollTop:Y.scrollTop},Y.style.cursor="grabbing",Y.style.userSelect="none");},Oe=Je=>{if(!I)return;let st=Je.clientX-R.current.x,Ge=Je.clientY-R.current.y;Y.scrollLeft=R.current.scrollLeft-st,Y.scrollTop=R.current.scrollTop-Ge;},ue=()=>{I&&(N(false),Y.style.cursor="",Y.style.userSelect="");},Le=()=>{I&&(N(false),Y.style.cursor="",Y.style.userSelect="");};return Y.addEventListener("mousedown",V),document.addEventListener("mousemove",Oe),document.addEventListener("mouseup",ue),Y.addEventListener("mouseleave",Le),()=>{Y.removeEventListener("mousedown",V),document.removeEventListener("mousemove",Oe),document.removeEventListener("mouseup",ue),Y.removeEventListener("mouseleave",Le);}},[I,S.isDragging]);let E=react.useMemo(()=>e.cards.map(Y=>({id:Y.id,name:Y.title,startDate:Y.startDate?new Date(Y.startDate):void 0,endDate:Y.endDate?new Date(Y.endDate):void 0,progress:Y.progress||0,status:Y.columnId,priority:Y.priority?.toLowerCase(),dependencies:Array.isArray(Y.dependencies)?Y.dependencies.map(V=>typeof V=="string"?V:V.taskId):[]})),[e.cards]),W=react.useCallback(Y=>{let{active:V}=Y,Oe=e.cards.find(ue=>ue.id===V.id);Oe&&T({isDragging:true,draggedCardId:Oe.id,sourceColumnId:Oe.columnId,targetColumnId:Oe.columnId});},[e.cards,T]),q=react.useCallback(Y=>{let{active:V,over:Oe}=Y;if(!Oe||!e.cards.find(Je=>Je.id===V.id))return;let Le=null;Oe.data.current?.type==="column"?Le=Oe.id:Oe.data.current?.type==="card"&&(Le=e.cards.find(st=>st.id===Oe.id)?.columnId||null),Le&&Le!==S.targetColumnId&&T({...S,targetColumnId:Le});},[e.cards,S,T]),pe=react.useCallback(async Y=>{let{active:V,over:Oe}=Y;if(T({isDragging:false,draggedCardId:null,sourceColumnId:null,targetColumnId:null}),!Oe)return;let ue=e.cards.find(Ge=>Ge.id===V.id);if(!ue)return;let Le,Je;if(Oe.data.current?.type==="column"){Le=Oe.id;let Ge=B.get(Le)||[];Je=Is(Ge,0);}else {let Ge=e.cards.find(Pt=>Pt.id===Oe.id);if(!Ge)return;Le=Ge.columnId;let bt=B.get(Le)||[],ut=bt.findIndex(Pt=>Pt.id===Oe.id);Je=Is(bt,ut);}let st=e.columns.find(Ge=>Ge.id===Le);if(st&&st.wipLimit&&st.wipLimitType==="hard"){let Ge=B.get(Le)||[];if(ue.columnId!==Le&&Ge.length>=st.wipLimit){t.onWipLimitExceeded?.(st,ue);return}}(ue.columnId!==Le||ue.position!==Je)&&await t.onCardMove?.(ue.id,Le,Je);},[e.cards,e.columns,B,t,T]),fe=react.useCallback(Y=>{A(Y),a?.(Y),w?.(Y.id);},[a,w]),Ce=react.useCallback(Y=>{t.onCardUpdate?.(Y.id,Y),A(Y);},[t]);return m?jsxRuntime.jsx("div",{className:b("asakaa-board",te,n),style:l,children:jsxRuntime.jsx(bf,{columnCount:3})}):i?jsxRuntime.jsx("div",{className:b("asakaa-board",te,n),style:l,children:jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full h-64",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("p",{className:"text-asakaa-accent-red text-lg font-semibold mb-2",children:"Error loading board"}),jsxRuntime.jsx("p",{className:"text-asakaa-text-secondary text-sm",children:typeof i=="string"?i:i.message})]})})}):jsxRuntime.jsxs(pd,{themeName:_,children:[jsxRuntime.jsxs(core$1.DndContext,{sensors:F,collisionDetection:core$1.closestCorners,onDragStart:W,onDragOver:q,onDragEnd:pe,children:[jsxRuntime.jsxs("div",{ref:z,className:b("asakaa-board",te,n),style:{...l,cursor:I?"grabbing":void 0},"data-theme":_,children:[e.columns.sort((Y,V)=>Y.position-V.position).map(Y=>{let V=B.get(Y.id)||[],Oe=!Ae.includes(Y.id);return jsxRuntime.jsx(bo,{column:Y,cards:V,renderCard:r?.renderCard,renderColumn:r?.renderColumn,renderHeader:r?.renderColumnHeader,renderEmptyState:r?.renderEmptyState,onCardClick:fe,onCardUpdate:ie,onColumnRename:xe,onColumnDelete:Ne,isDeletable:Oe,availableUsers:s,allCards:e.cards,enableVirtualization:o?.enableVirtualization,cardHeight:o?.cardHeight},Y.id)}),c]}),jsxRuntime.jsx(core$1.DragOverlay,{children:S.draggedCardId?jsxRuntime.jsx(gr,{card:e.cards.find(Y=>Y.id===S.draggedCardId),render:r?.renderCardOverlay||r?.renderCard,disableDrag:true,className:"opacity-90 rotate-3 shadow-2xl"}):null})]}),jsxRuntime.jsx(fr,{task:C,isOpen:!!C,onClose:()=>A(null),onCardUpdate:Ce,theme:se?"dark":"light",locale:o?.locale==="es"?"es":"en",availableUsers:s,availableTags:d,onCreateTag:u,attachments:C?f?.get(C.id)||[]:[],onUploadAttachments:y,onDeleteAttachment:k,availableTasks:E,comments:g,onAddComment:v,currentUser:h,mentionableUsers:p,onUploadCommentAttachments:x})]})}function bf({columnCount:e}){return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Array.from({length:e}).map((t,a)=>jsxRuntime.jsxs("div",{className:"asakaa-column",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-8 mb-3"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsx("div",{className:"asakaa-skeleton h-24"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-32"}),jsxRuntime.jsx("div",{className:"asakaa-skeleton h-28"})]})]},a))})}var kf={bgGrid:"#0F1117",bgSecondary:"#1A1D25",border:"rgba(255, 255, 255, 0.1)",borderLight:"rgba(255, 255, 255, 0.05)",textPrimary:"#E5E7EB",textSecondary:"#9CA3AF",textTertiary:"#6B7280",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.15)",hoverBg:"rgba(255, 255, 255, 0.05)"},wf={bgGrid:"#FFFFFF",bgSecondary:"#F9FAFB",border:"rgba(0, 0, 0, 0.1)",borderLight:"rgba(0, 0, 0, 0.05)",textPrimary:"#111827",textSecondary:"#6B7280",textTertiary:"#9CA3AF",accent:"#3B82F6",accentLight:"rgba(59, 130, 246, 0.1)",hoverBg:"rgba(0, 0, 0, 0.05)"},Cf={newTask:"Nueva Tarea",selectColumn:"Seleccionar columna",export:"Exportar",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"},Tf={newTask:"New Task",selectColumn:"Select column",export:"Export",exportCSV:"CSV",exportJSON:"JSON",exportExcel:"Excel"};function Nf({columns:e,onSelect:t,theme:a,t:r,createTaskLabel:o}){let[s,n]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let i=c=>{l.current&&!l.current.contains(c.target)&&n(false);};return s&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[s]);let m=i=>{t(i),n(false);};return jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>n(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:o||r.newTask}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wider",style:{color:a.textTertiary},children:r.selectColumn}),e.sort((i,c)=>i.position-c.position).map((i,c)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>m(i.id),className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:c<e.length-1?`1px solid ${a.borderLight}`:"none"},whileHover:{backgroundColor:a.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:c*.03},children:[jsxRuntime.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color||a.accent}}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:a.textPrimary},children:i.title}),jsxRuntime.jsxs("div",{className:"text-[10px] truncate",style:{color:a.textTertiary},children:[i.cardIds.length," ",i.cardIds.length===1?"tarea":"tareas"]})]})]},i.id))]})})})]})}function Df({theme:e,t,onExportCSV:a,onExportJSON:r,onExportExcel:o}){let[s,n]=react.useState(false),[l,m]=react.useState(null),i=react.useRef(null);if(react.useEffect(()=>{let f=y=>{i.current&&!i.current.contains(y.target)&&n(false);};return s&&document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[s]),!(a||r||o))return null;let d=[{id:"csv",label:t.exportCSV,description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"json",label:t.exportJSON,description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:r},{id:"excel",label:t.exportExcel,description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:o}].filter(f=>f.handler),u=async(f,y)=>{if(y){m(f);try{await y();}catch(k){console.error(`Export ${f} failed:`,k);}finally{m(null),n(false);}}};return jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>n(!s),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:s?e.accent:e.bgSecondary,border:`1px solid ${s?e.accent:e.borderLight}`,color:s?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:s?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-44 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:d.map((f,y)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>u(f.id,f.handler),disabled:l!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:y<d.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:y*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:l===f.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):f.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:f.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:f.description})]})]},f.id))})})})]})}function Sf({onClick:e,label:t}){return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:e,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:t})]})}function qs({columns:e,onCreateTask:t,createTaskLabel:a,theme:r="dark",locale:o="es",useColumnSelector:s=false,onExportCSV:n,onExportJSON:l,onExportExcel:m,translations:i}){let c=r==="dark"?kf:wf,d={...o==="es"?Cf:Tf,...i},u=n||l||m;return jsxRuntime.jsx("div",{className:"h-12 px-4 flex items-center justify-end border-b sticky top-0 z-10",style:{backgroundColor:c.bgGrid,borderColor:c.border},children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[u&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Df,{theme:c,t:d,onExportCSV:n,onExportJSON:l,onExportExcel:m}),t&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:c.borderLight}})]}),t&&(s?jsxRuntime.jsx(Nf,{columns:e,onSelect:t,theme:c,t:d,createTaskLabel:a}):jsxRuntime.jsx(Sf,{onClick:()=>t(),label:a||d.newTask}))]})})}function Js({onAddColumn:e,className:t,placeholder:a="Nombre de la columna...",buttonLabel:r="Agregar Columna",disabled:o=false}){let[s,n]=react.useState(false),[l,m]=react.useState(""),i=react.useCallback(()=>{let u=l.trim();u&&(e(u),m(""),n(false));},[l,e]),c=react.useCallback(u=>{u.key==="Enter"?(u.preventDefault(),i()):u.key==="Escape"&&(m(""),n(false));},[i]),d=react.useCallback(()=>{setTimeout(()=>{l.trim()||n(false);},150);},[l]);return s?jsxRuntime.jsx("div",{className:b("asakaa-add-column asakaa-add-column--editing",t),children:jsxRuntime.jsxs("div",{className:"asakaa-add-column__input-wrapper",children:[jsxRuntime.jsx("input",{type:"text",value:l,onChange:u=>m(u.target.value),onKeyDown:c,onBlur:d,placeholder:a,autoFocus:true,className:"asakaa-add-column__input"}),jsxRuntime.jsxs("div",{className:"asakaa-add-column__actions",children:[jsxRuntime.jsx("button",{onClick:i,disabled:!l.trim(),className:"asakaa-add-column__submit",type:"button",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})}),jsxRuntime.jsx("button",{onClick:()=>{m(""),n(false);},className:"asakaa-add-column__cancel",type:"button",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]})}):jsxRuntime.jsx("div",{className:b("asakaa-add-column",t),children:jsxRuntime.jsxs("button",{onClick:()=>n(true),disabled:o,className:"asakaa-add-column__button",type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r]})})}function Zs({columnId:e,onAddCard:t,availableUsers:a=[],className:r,placeholder:o,buttonLabel:s,disabled:n=false,theme:l="dark",locale:m="es"}){let[i,c]=react.useState(false),[d,u]=react.useState(false),[f,y]=react.useState(""),[k,g]=react.useState([]),[v,h]=react.useState(""),[p,w]=react.useState(""),[x,S]=react.useState(""),[T,C]=react.useState(false),[A,I]=react.useState(false),[N,z]=react.useState(false),R=react.useRef(null),_=react.useRef(null),se={placeholder:o||(m==="es"?"Nombre de la tarea...":"Task Name..."),buttonLabel:s||(m==="es"?"Agregar Tarea":"Add Task"),save:m==="es"?"Guardar":"Save",addAssignee:m==="es"?"Agregar asignado":"Add assignee",addDates:m==="es"?"Agregar fechas":"Add dates",addPriority:m==="es"?"Agregar prioridad":"Add priority",startDate:m==="es"?"Inicio":"Start",endDate:m==="es"?"Fin":"End",low:m==="es"?"Baja":"Low",medium:m==="es"?"Media":"Medium",high:m==="es"?"Alta":"High",urgent:m==="es"?"Urgente":"Urgent"},te=react.useCallback(()=>{y(""),g([]),h(""),w(""),S(""),C(false),I(false),z(false),c(false);},[]);react.useEffect(()=>{i&&R.current&&R.current.focus();},[i]),react.useEffect(()=>{if(!i)return;let F=B=>{_.current&&!_.current.contains(B.target)&&(f.trim()||te());};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[i,f,te]);let ie=react.useCallback(async()=>{let F=f.trim();if(!(!F||d)){u(true);try{await t({name:F,columnId:e,assigneeIds:k.length>0?k:void 0,startDate:v?new Date(v):void 0,endDate:p?new Date(p):void 0,priority:x||void 0}),y(""),g([]),h(""),w(""),S(""),C(!1),I(!1),z(!1),R.current?.focus();}catch(B){console.error("Error creating card:",B);}finally{u(false);}}},[f,e,k,v,p,x,t,d]),xe=react.useCallback(F=>{F.key==="Enter"&&!F.shiftKey?(F.preventDefault(),ie()):F.key==="Escape"&&te();},[ie,te]),Ne=react.useCallback(F=>{g(B=>B.includes(F)?B.filter(E=>E!==F):[...B,F]);},[]),Ae=l==="dark";return i?jsxRuntime.jsxs("div",{ref:_,className:b("rounded-lg overflow-hidden shadow-lg",Ae?"bg-[#1e1e2e]":"bg-white",r),style:{border:"2px solid #10b981"},children:[jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsx("input",{ref:R,type:"text",value:f,onChange:F=>y(F.target.value),onKeyDown:xe,placeholder:se.placeholder,disabled:d,className:b("w-full px-0 py-1 text-sm font-medium border-0 bg-transparent focus:outline-none focus:ring-0",Ae?"text-gray-100 placeholder-gray-500":"text-gray-800 placeholder-gray-400")}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 mt-3",children:[a.length>0&&jsxRuntime.jsxs("button",{onClick:()=>C(!T),className:b("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",T||k.length>0?"bg-emerald-500/20 text-emerald-400":Ae?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:se.addAssignee,children:[jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),k.length>0&&jsxRuntime.jsx("span",{className:"ml-0.5",children:k.length})]}),jsxRuntime.jsx("button",{onClick:()=>I(!A),className:b("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",A||v||p?"bg-blue-500/20 text-blue-400":Ae?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:se.addDates,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsxRuntime.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsxRuntime.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),jsxRuntime.jsx("button",{onClick:()=>z(!N),className:b("flex items-center gap-1 px-2 py-1.5 rounded-md text-xs transition-colors",N||x?x==="urgent"?"bg-red-500/20 text-red-400":x==="high"?"bg-orange-500/20 text-orange-400":x==="medium"?"bg-yellow-500/20 text-yellow-400":x==="low"?"bg-green-500/20 text-green-400":"bg-orange-500/20 text-orange-400":Ae?"text-gray-400 hover:bg-[#2a2a3e] hover:text-gray-300":"text-gray-500 hover:bg-gray-100 hover:text-gray-700"),type:"button",title:se.addPriority,children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),jsxRuntime.jsx("line",{x1:"4",y1:"22",x2:"4",y2:"15"})]})}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{onClick:ie,disabled:!f.trim()||d,className:b("px-3 py-1.5 rounded-md text-xs font-medium text-white transition-all","bg-emerald-500 hover:bg-emerald-600","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-emerald-500"),type:"button",children:d?jsxRuntime.jsx("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}):se.save})]})]}),T&&a.length>0&&jsxRuntime.jsx("div",{className:b("px-3 pb-3 pt-0","border-t",Ae?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 pt-3",children:a.map(F=>jsxRuntime.jsxs("button",{onClick:()=>Ne(F.id),className:b("flex items-center gap-1.5 px-2 py-1 rounded-full text-xs transition-all",k.includes(F.id)?"bg-emerald-500 text-white":Ae?"bg-[#2a2a3e] text-gray-300 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-700 hover:bg-gray-200"),type:"button",children:[F.avatar?jsxRuntime.jsx("img",{src:F.avatar,alt:F.name,className:"w-4 h-4 rounded-full"}):jsxRuntime.jsx("div",{className:b("w-4 h-4 rounded-full flex items-center justify-center text-[10px] font-medium",k.includes(F.id)?"bg-emerald-600 text-white":"bg-emerald-500 text-white"),children:F.name.charAt(0).toUpperCase()}),jsxRuntime.jsx("span",{children:F.name.split(" ")[0]})]},F.id))})}),A&&jsxRuntime.jsx("div",{className:b("px-3 pb-3 pt-0","border-t",Ae?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:b("block text-[10px] uppercase tracking-wide mb-1",Ae?"text-gray-500":"text-gray-400"),children:se.startDate}),jsxRuntime.jsx("input",{type:"date",value:v,onChange:F=>h(F.target.value),className:b("w-full px-2 py-1.5 rounded text-xs border",Ae?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:b("block text-[10px] uppercase tracking-wide mb-1",Ae?"text-gray-500":"text-gray-400"),children:se.endDate}),jsxRuntime.jsx("input",{type:"date",value:p,onChange:F=>w(F.target.value),className:b("w-full px-2 py-1.5 rounded text-xs border",Ae?"bg-[#2a2a3e] border-[#3a3a4e] text-gray-200":"bg-gray-50 border-gray-200 text-gray-800")})]})]})}),N&&jsxRuntime.jsx("div",{className:b("px-3 pb-3 pt-0","border-t",Ae?"border-[#3a3a4e]":"border-gray-200"),children:jsxRuntime.jsx("div",{className:"flex gap-1.5 pt-3",children:["low","medium","high","urgent"].map(F=>jsxRuntime.jsx("button",{onClick:()=>S(x===F?"":F),className:b("flex-1 px-2 py-1.5 rounded text-xs font-medium transition-all",x===F?`${{low:"bg-green-500",medium:"bg-yellow-500",high:"bg-orange-500",urgent:"bg-red-500"}[F]} text-white`:Ae?"bg-[#2a2a3e] text-gray-400 hover:bg-[#3a3a4e]":"bg-gray-100 text-gray-600 hover:bg-gray-200"),type:"button",children:se[F]},F))})})]}):jsxRuntime.jsxs("button",{onClick:()=>c(true),disabled:n,className:b("w-full flex items-center gap-2 px-3 py-2 rounded-lg transition-all duration-200","text-emerald-500 hover:text-emerald-400",Ae?"hover:bg-[#2a2a3e]":"hover:bg-gray-100",n&&"opacity-50 cursor-not-allowed",r),type:"button",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),jsxRuntime.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:se.buttonLabel})]})}var _o=class extends core.BaseViewAdapter{constructor(a={}){super();this.id="kanban";this.name="Kanban Board";this.version="1.0.0";this.description="";this.icon="";this.supportedExports=["json","csv","pdf","png"];this.root=null;this.description="Interactive Kanban board with drag & drop, filters, and real-time updates",this.icon="\u{1F4CB}",this.kanbanConfig=a,this.options={animations:a.viewOptions?.animations??true,virtualScrolling:a.viewOptions?.virtualScrolling??false,theme:a.viewOptions?.theme??"dark",readonly:a.viewOptions?.readonly??false};}mount(a,r){this.isMounted()&&(console.warn("[KanbanViewAdapter] Already mounted, unmounting first"),this.unmount()),this.container=a,this.data=r,this.root=client.createRoot(a),this.render(),this.emit("view:mounted",{viewId:this.id,timestamp:Date.now()});}unmount(){this.isMounted()&&(this.emit("view:unmounted",{viewId:this.id,timestamp:Date.now()}),this.root&&(this.root.unmount(),this.root=null),this.container&&(this.container.innerHTML="",this.container=null),this.data=null);}update(a){if(!this.isMounted()){console.warn("[KanbanViewAdapter] Not mounted, cannot update");return}this.data=a,this.render(),this.emit("view:updated",{viewId:this.id,data:a});}configure(a){this.options={...this.options,...a},this.isMounted()&&this.render();}async export(a){if(!this.data)throw new Error("No data to export");switch(a){case "json":return JSON.stringify(this.data,null,2);case "csv":return this.exportToCSV();case "pdf":return this.exportToPDF();case "png":return this.exportToPNG();default:throw new Error(`Unsupported export format: ${a}`)}}render(){if(!this.root||!this.data)return;let a={id:this.data.board?.id||"board-1",title:this.data.board?.title||"Untitled Board",columns:this.data.columns,cards:this.data.cards};this.root.render(jsxRuntime.jsx(Mr,{board:a,callbacks:this.kanbanConfig.callbacks||{},onCardClick:this.kanbanConfig.onCardClick,renderProps:this.kanbanConfig.renderProps,config:this.kanbanConfig.config,availableUsers:this.kanbanConfig.availableUsers,className:this.kanbanConfig.className,style:this.kanbanConfig.style}));}exportToCSV(){if(!this.data)return "";let a=[["Card ID","Title","Column","Description","Labels","Assignees","Due Date","Position"]];return this.data.cards.forEach(r=>{let o=this.data.columns.find(s=>s.id===r.columnId);a.push([r.id,r.title,o?.title||"",r.description||"",r.labels?.join(", ")||"",r.assignedUserIds?.join(", ")||r.assigneeId||"",r.dueDate?.toString()||"",r.position.toString()]);}),a.map(r=>r.map(o=>`"${o}"`).join(",")).join(`
|
|
5
5
|
`)}async exportToPDF(){throw new Error("PDF export not yet implemented in ViewAdapter")}async exportToPNG(){if(!this.container)throw new Error("View not mounted");let r=await(await import('html2canvas')).default(this.container,{backgroundColor:this.options.theme==="dark"?"#1a1a1a":"#ffffff",scale:2});return new Promise((o,s)=>{r.toBlob(n=>{n?o(n):s(new Error("Failed to create PNG blob"));},"image/png");})}};function ic(e={}){return new _o(e)}var yo=class extends react.Component{constructor(a){super(a);this.resetError=()=>{this.setState({hasError:false,error:null,errorInfo:null});};this.state={hasError:false,error:null,errorInfo:null};}static getDerivedStateFromError(a){return {hasError:true,error:a}}componentDidCatch(a,r){let{onError:o,componentName:s}=this.props;if(process.env.NODE_ENV==="development"&&(console.error(`Error in ${s||"Component"}:`,a),console.error("Error Info:",r)),this.setState({errorInfo:r}),o)try{o(a,r);}catch(n){console.error("Error in error handler:",n);}}render(){let{hasError:a,error:r}=this.state,{children:o,fallback:s,componentName:n}=this.props;return a&&r?s?s(r,this.resetError):jsxRuntime.jsx("div",{className:"p-6 rounded-lg border",style:{background:"linear-gradient(135deg, #2d1b1b 0%, #1a1a1a 100%)",borderColor:"rgba(239, 68, 68, 0.3)"},children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"flex-shrink-0",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"#EF4444",strokeWidth:"2"}),jsxRuntime.jsx("path",{d:"M12 8V12",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"12",cy:"16",r:"1",fill:"#EF4444"})]}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold text-red-400 mb-1",children:n?`Error in ${n}`:"Something went wrong"}),jsxRuntime.jsx("p",{className:"text-sm text-white/70 mb-3",children:r.message||"An unexpected error occurred"}),process.env.NODE_ENV==="development"&&jsxRuntime.jsxs("details",{className:"mb-3",children:[jsxRuntime.jsx("summary",{className:"text-xs text-white/50 cursor-pointer hover:text-white/70 mb-2",children:"Error Details (Development Only)"}),jsxRuntime.jsx("pre",{className:"text-xs text-white/60 bg-black/30 p-3 rounded overflow-auto max-h-48",children:r.stack})]}),jsxRuntime.jsx("button",{onClick:this.resetError,className:"px-4 py-2 rounded-lg text-sm font-medium transition-all hover:bg-red-600/20 border border-red-500/30",style:{color:"#EF4444"},children:"Try Again"})]})]})}):o}};function Qs(e,t){let a=r=>jsxRuntime.jsx(yo,{...t,children:jsxRuntime.jsx(e,{...r})});return a.displayName=`withErrorBoundary(${e.displayName||e.name||"Component"})`,a}function ti({board:e,onCreateCard:t,onNavigateToCard:a,onSearch:r,onChangePriority:o,onAssignUser:s,onGeneratePlan:n,onPredictRisks:l,onOpenAIUsage:m,shortcut:i="k",className:c=""}){let[d,u]=react.useState(false),[f,y]=react.useState(""),[k,g]=react.useState("home"),[v,h]=react.useState(""),[p,w]=react.useState("");react.useEffect(()=>{let C=A=>{(A.metaKey||A.ctrlKey)&&A.key===i&&(A.preventDefault(),u(I=>!I)),A.key==="Escape"&&(u(false),g("home"),y(""));};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[i]),react.useEffect(()=>{d||(g("home"),y(""),h(""),w(""));},[d]);let x=react.useCallback(()=>{u(false);},[]),S=react.useCallback(C=>{let[A,I]=C.split(":");switch(A){case "create-card":g("create-card");break;case "create-card-in":h(I||"");break;case "navigate":I?(a?.(I),x()):g("navigate");break;case "search":r?.(f),x();break;case "priority":g("priority");break;case "set-priority":p&&I&&(o?.(p,I),x());break;case "assign":g("assign");break;case "assign-user":p&&I&&(s?.(p,I),x());break;case "ai":g("ai");break;case "ai-generate-plan":n?.(),x();break;case "ai-predict-risks":l?.(),x();break;case "ai-usage":m?.(),x();break;case "back":g("home");break;}},[f,p,t,a,r,o,s,n,l,m,x]),T=react.useCallback(()=>{v&&f.trim()&&(t?.(v,f.trim()),x());},[v,f,t,x]);return d?jsxRuntime.jsx(gt,{children:jsxRuntime.jsx("div",{className:"command-palette-overlay",onClick:x,children:jsxRuntime.jsx("div",{className:`command-palette ${c}`,onClick:C=>C.stopPropagation(),children:jsxRuntime.jsxs(cmdk.Command,{value:f,onValueChange:y,label:"Command Menu",children:[jsxRuntime.jsxs("div",{className:"command-palette-header",children:[jsxRuntime.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx(cmdk.Command.Input,{placeholder:k==="create-card"&&v?"Type card title and press Enter...":k==="create-card"?"Select a column first...":"Type a command or search...",className:"command-palette-input",onKeyDown:C=>{C.key==="Enter"&&k==="create-card"&&v&&T();}}),jsxRuntime.jsxs("div",{className:"command-palette-shortcut",children:[jsxRuntime.jsx("kbd",{children:navigator.platform.includes("Mac")?"\u2318":"Ctrl"}),jsxRuntime.jsx("kbd",{children:"K"})]})]}),jsxRuntime.jsxs(cmdk.Command.List,{className:"command-palette-list",children:[jsxRuntime.jsx(cmdk.Command.Empty,{className:"command-palette-empty",children:"No results found."}),k==="home"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Group,{heading:"Actions",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"create-card",onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),jsxRuntime.jsx("path",{d:"M12 8v8m-4-4h8"})]}),jsxRuntime.jsx("span",{children:"Create Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"C"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"navigate",onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"10"}),jsxRuntime.jsx("polyline",{points:"12 16 16 12 12 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"12",x2:"16",y2:"12"})]}),jsxRuntime.jsx("span",{children:"Navigate to Card"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"G"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"search",onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"8"}),jsxRuntime.jsx("path",{d:"m21 21-4.35-4.35"})]}),jsxRuntime.jsx("span",{children:"Search Cards"}),jsxRuntime.jsx("div",{className:"command-palette-item-shortcut",children:"/"})]})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai",onSelect:S,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"AI Commands"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Cards",className:"command-palette-group",children:e.cards.slice(0,5).map(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsx("span",{children:C.title}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(A=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:A},A))})]},C.id))})]}),k==="create-card"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"Select Column",className:"command-palette-group",children:e.columns.map(C=>jsxRuntime.jsxs(cmdk.Command.Item,{value:`create-card-in:${C.id}`,onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("rect",{x:"3",y:"3",width:"7",height:"18",rx:"1"})}),jsxRuntime.jsx("span",{children:C.title}),jsxRuntime.jsxs("div",{className:"command-palette-item-count",children:[C.cardIds.length," cards"]})]},C.id))})]}),k==="navigate"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsx(cmdk.Command.Group,{heading:"All Cards",className:"command-palette-group",children:e.cards.map(C=>{let A=e.columns.find(I=>I.id===C.columnId);return jsxRuntime.jsxs(cmdk.Command.Item,{value:`navigate:${C.id}`,onSelect:S,className:"command-palette-item",keywords:[C.title,C.description||"",...C.labels||[]],children:[jsxRuntime.jsx("div",{className:"command-palette-item-dot",style:{background:C.priority==="URGENT"?"#EF4444":C.priority==="HIGH"?"#F59E0B":C.priority==="MEDIUM"?"#3B82F6":"#6B7280"}}),jsxRuntime.jsxs("div",{className:"command-palette-item-content",children:[jsxRuntime.jsx("div",{children:C.title}),jsxRuntime.jsx("div",{className:"command-palette-item-meta",children:A?.title})]}),C.labels&&C.labels.length>0&&jsxRuntime.jsx("div",{className:"command-palette-item-labels",children:C.labels.slice(0,2).map(I=>jsxRuntime.jsx("span",{className:"command-palette-item-label",children:I},I))})]},C.id)})})]}),k==="ai"&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"back",onSelect:S,className:"command-palette-item",children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M19 12H5M12 19l-7-7 7-7"})}),jsxRuntime.jsx("span",{children:"Back"})]}),jsxRuntime.jsxs(cmdk.Command.Group,{heading:"AI Features",className:"command-palette-group",children:[jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-generate-plan",onSelect:S,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12"})]}),jsxRuntime.jsx("span",{children:"Generate Project Plan"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-predict-risks",onSelect:S,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),jsxRuntime.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),jsxRuntime.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),jsxRuntime.jsx("span",{children:"Predict Risks"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]}),jsxRuntime.jsxs(cmdk.Command.Item,{value:"ai-usage",onSelect:S,className:"command-palette-item command-palette-item-ai",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),jsxRuntime.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"})]}),jsxRuntime.jsx("span",{children:"AI Usage & Costs"}),jsxRuntime.jsx("div",{className:"command-palette-item-badge",children:"AI"})]})]})]})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer",children:[jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"\u2191"}),jsxRuntime.jsx("kbd",{children:"\u2193"}),jsxRuntime.jsx("span",{children:"Navigate"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Enter"}),jsxRuntime.jsx("span",{children:"Select"})]}),jsxRuntime.jsxs("div",{className:"command-palette-footer-hint",children:[jsxRuntime.jsx("kbd",{children:"Esc"}),jsxRuntime.jsx("span",{children:"Close"})]})]})]})})})}):null}function cc(e,t,a,r,o){let s=document.getElementById("attachment-lightbox-native");s&&s.remove();let n=document.createElement("div");n.id="attachment-lightbox-native",n.className="attachment-lightbox",n.style.cssText=`
|
|
6
6
|
position: fixed !important;
|
|
7
7
|
inset: 0 !important;
|