claude-team-dashboard 1.2.6
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/LICENSE +21 -0
- package/README.md +898 -0
- package/cleanup.js +73 -0
- package/config.js +55 -0
- package/dist/assets/AgentNetworkGraph-D5Yt9AQ3.js +3 -0
- package/dist/assets/AnalyticsPanel-sfGbRsBJ.js +1 -0
- package/dist/assets/ArchiveViewer-CUZaBhkp.js +1 -0
- package/dist/assets/TaskDependencyGraph-DnviYlHT.js +1 -0
- package/dist/assets/charts-F7VEQUVb.js +36 -0
- package/dist/assets/d3-core-8TMKOAYc.js +1 -0
- package/dist/assets/icons-Bi3kLKdY.js +1 -0
- package/dist/assets/index-CMd_AsXc.js +43 -0
- package/dist/assets/index-D5qSH_Zn.css +1 -0
- package/dist/assets/utils-mxxv0KtI.js +177 -0
- package/dist/icons/icon-192.png +0 -0
- package/dist/icons/icon-512.png +0 -0
- package/dist/index.html +33 -0
- package/dist/manifest.json +15 -0
- package/dist/sw.js +105 -0
- package/package.json +81 -0
- package/public/icons/icon-192.png +0 -0
- package/public/icons/icon-512.png +0 -0
- package/public/manifest.json +15 -0
- package/public/sw.js +105 -0
- package/server.js +1996 -0
- package/start.js +24 -0
package/cleanup.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
|
|
3
|
+
console.log('Cleaning up running processes...\n');
|
|
4
|
+
|
|
5
|
+
// Kill processes on port 3001 (backend)
|
|
6
|
+
try {
|
|
7
|
+
console.log('Checking port 3001...');
|
|
8
|
+
const netstatOutput = execSync('netstat -ano | findstr :3001', { encoding: 'utf8' });
|
|
9
|
+
|
|
10
|
+
const lines = netstatOutput.split('\n').filter(line => line.trim());
|
|
11
|
+
const pids = new Set();
|
|
12
|
+
|
|
13
|
+
lines.forEach(line => {
|
|
14
|
+
const parts = line.trim().split(/\s+/);
|
|
15
|
+
const pid = parts[parts.length - 1];
|
|
16
|
+
if (pid && !isNaN(pid) && pid !== '0') {
|
|
17
|
+
pids.add(pid);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
pids.forEach(pid => {
|
|
22
|
+
try {
|
|
23
|
+
console.log(`Killing process ${pid} on port 3001...`);
|
|
24
|
+
execSync(`powershell -Command "Stop-Process -Id ${pid} -Force"`, { stdio: 'ignore' });
|
|
25
|
+
console.log(`✓ Process ${pid} terminated`);
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.log(`× Could not kill process ${pid} (may have already stopped)`);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
if (pids.size === 0) {
|
|
32
|
+
console.log('✓ Port 3001 is free');
|
|
33
|
+
}
|
|
34
|
+
} catch (err) {
|
|
35
|
+
console.log('✓ Port 3001 is free');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Kill processes on port 5173-5175 (frontend)
|
|
39
|
+
[5173, 5174, 5175].forEach(port => {
|
|
40
|
+
try {
|
|
41
|
+
console.log(`\nChecking port ${port}...`);
|
|
42
|
+
const netstatOutput = execSync(`netstat -ano | findstr :${port}`, { encoding: 'utf8' });
|
|
43
|
+
|
|
44
|
+
const lines = netstatOutput.split('\n').filter(line => line.trim());
|
|
45
|
+
const pids = new Set();
|
|
46
|
+
|
|
47
|
+
lines.forEach(line => {
|
|
48
|
+
const parts = line.trim().split(/\s+/);
|
|
49
|
+
const pid = parts[parts.length - 1];
|
|
50
|
+
if (pid && !isNaN(pid) && pid !== '0') {
|
|
51
|
+
pids.add(pid);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
pids.forEach(pid => {
|
|
56
|
+
try {
|
|
57
|
+
console.log(`Killing process ${pid} on port ${port}...`);
|
|
58
|
+
execSync(`powershell -Command "Stop-Process -Id ${pid} -Force"`, { stdio: 'ignore' });
|
|
59
|
+
console.log(`✓ Process ${pid} terminated`);
|
|
60
|
+
} catch (err) {
|
|
61
|
+
console.log(`× Could not kill process ${pid} (may have already stopped)`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
if (pids.size === 0) {
|
|
66
|
+
console.log(`✓ Port ${port} is free`);
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
console.log(`✓ Port ${port} is free`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
console.log('\n✓ Cleanup complete! You can now run "npm start"\n');
|
package/config.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Server Configuration
|
|
2
|
+
module.exports = {
|
|
3
|
+
// Server Port
|
|
4
|
+
PORT: process.env.PORT || 3001,
|
|
5
|
+
|
|
6
|
+
// Allowed CORS Origins
|
|
7
|
+
CORS_ORIGINS: ['http://localhost:3001', 'http://127.0.0.1:3001', 'http://localhost:5173', 'http://127.0.0.1:5173'],
|
|
8
|
+
|
|
9
|
+
// Rate Limiting
|
|
10
|
+
RATE_LIMIT: {
|
|
11
|
+
WINDOW_MS: 15 * 60 * 1000, // 15 minutes
|
|
12
|
+
MAX_REQUESTS: 100,
|
|
13
|
+
MESSAGE: 'Too many requests from this IP, please try again later.'
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
// File Watching
|
|
17
|
+
WATCH_CONFIG: {
|
|
18
|
+
PERSISTENT: true,
|
|
19
|
+
IGNORE_INITIAL: true,
|
|
20
|
+
USE_POLLING: true,
|
|
21
|
+
INTERVAL: 1000,
|
|
22
|
+
BINARY_INTERVAL: 1000,
|
|
23
|
+
DEPTH: 10,
|
|
24
|
+
AWAIT_WRITE_FINISH: {
|
|
25
|
+
stabilityThreshold: 500,
|
|
26
|
+
pollInterval: 100
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
// Security
|
|
31
|
+
HELMET_CONFIG: {
|
|
32
|
+
contentSecurityPolicy: {
|
|
33
|
+
directives: {
|
|
34
|
+
defaultSrc: ["'self'"],
|
|
35
|
+
scriptSrc: ["'self'", "'unsafe-inline'"],
|
|
36
|
+
styleSrc: ["'self'", "'unsafe-inline'"],
|
|
37
|
+
connectSrc: ["'self'", "ws://localhost:3001", "ws://localhost:5173", "http://localhost:3001", "http://localhost:5173"],
|
|
38
|
+
imgSrc: ["'self'", "data:", "https://cdn.jsdelivr.net", "https://api.star-history.com", "https://avatars.githubusercontent.com"],
|
|
39
|
+
fontSrc: ["'self'", "data:"],
|
|
40
|
+
frameAncestors: ["'none'"],
|
|
41
|
+
objectSrc: ["'none'"],
|
|
42
|
+
baseUri: ["'self'"],
|
|
43
|
+
formAction: ["'self'"]
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
crossOriginEmbedderPolicy: false,
|
|
47
|
+
crossOriginResourcePolicy: { policy: "same-origin" },
|
|
48
|
+
crossOriginOpenerPolicy: { policy: "same-origin" },
|
|
49
|
+
hsts: { maxAge: 31536000, includeSubDomains: true, preload: false },
|
|
50
|
+
referrerPolicy: { policy: 'strict-origin-when-cross-origin' },
|
|
51
|
+
noSniff: true,
|
|
52
|
+
frameguard: { action: 'deny' },
|
|
53
|
+
xssFilter: true
|
|
54
|
+
}
|
|
55
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as Z,j as s,P as K}from"./index-CMd_AsXc.js";import{r as E}from"./utils-mxxv0KtI.js";import{a3 as J,a4 as P,Z as Q,K as U,a5 as V,a6 as tt,a7 as et,a8 as rt,a9 as nt,aa as st,ab as at,ac as ot}from"./d3-core-8TMKOAYc.js";import{aj as W}from"./icons-Bi3kLKdY.js";import"./charts-F7VEQUVb.js";const B=["#3b82f6","#22c55e","#a855f7","#06b6d4","#f97316","#ec4899","#eab308","#ef4444","#6366f1","#14b8a6"];function ct(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function it(e,t){const n=new Map,f=new Map,g=new Map;(t||[]).forEach((i,b)=>{const d=B[b%B.length];g.set(i.name,d),(i.config?.members||[]).forEach(a=>{a.name&&!n.has(a.name)&&n.set(a.name,{id:a.name,team:i.name,color:d,msgCount:0})})}),Object.entries(e||{}).forEach(([i,b])=>{const d=g.get(i)||B[ct(i)%B.length];Object.entries(b||{}).forEach(([m,a])=>{n.has(m)||n.set(m,{id:m,team:i,color:d,msgCount:0}),(Array.isArray(a)?a:a?.messages||[]).forEach(w=>{const r=w.from||"unknown",o=m;if(r===o)return;n.has(r)||n.set(r,{id:r,team:i,color:d,msgCount:0}),n.get(r).msgCount+=1,n.get(o).msgCount+=1;const h=`${r}|||${o}`;f.has(h)?f.get(h).count+=1:f.set(h,{source:r,target:o,count:1})})})});const M=Array.from(n.values()),y=Array.from(f.values());return{nodes:M,edges:y}}function lt(e){const t=Z.c(31),{allInboxes:n,teams:f}=e;let g;t[0]!==n?(g=n===void 0?{}:n,t[0]=n,t[1]=g):g=t[1];const M=g;let y;t[2]!==f?(y=f===void 0?[]:f,t[2]=f,t[3]=y):y=t[3];const i=y,b=E.useRef(null),d=E.useRef(null);let m;t[4]===Symbol.for("react.memo_cache_sentinel")?(m={width:800,height:500},t[4]=m):m=t[4];const[a,D]=E.useState(m);let w;t[5]!==M||t[6]!==i?(w=it(M,i),t[5]=M,t[6]=i,t[7]=w):w=t[7];const{nodes:r,edges:o}=w;let h,N;t[8]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{const l=d.current;if(!l)return;const p=new ResizeObserver(G=>{for(const I of G){const{width:u}=I.contentRect;u>0&&D({width:u,height:Math.max(400,Math.min(u*.6,600))})}});return p.observe(l),()=>p.disconnect()},N=[],t[8]=h,t[9]=N):(h=t[8],N=t[9]),E.useEffect(h,N);let A,_;t[10]!==a||t[11]!==o||t[12]!==r?(_=()=>{if(r.length===0)return;const l=J(b.current);l.selectAll("*").remove();const{width:p,height:G}=a,I=Math.max(1,P(r,Et)||1),u=Q().domain([0,I]).range([8,24]),q=Math.max(1,P(o,Mt)||1),F=U().domain([1,q]).range([1.5,6]),z=l.append("g"),H=V().scaleExtent([.3,4]).on("zoom",c=>{z.attr("transform",c.transform)});l.call(H);const L=tt(r).force("link",et(o).id(Ct).distance(100)).force("charge",rt().strength(-250)).force("center",nt(p/2,G/2)).force("collide",st().radius(c=>u(c.msgCount)+10));l.append("defs").append("marker").attr("id","arrowhead").attr("viewBox","0 -5 10 10").attr("refX",20).attr("refY",0).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5").attr("fill","#6b7280");const X=z.append("g").selectAll("line").data(o).join("line").attr("stroke","#4b5563").attr("stroke-opacity",.6).attr("stroke-width",c=>F(c.count)).attr("marker-end","url(#arrowhead)"),Y=z.append("g").selectAll("text").data(o).join("text").attr("fill","#9ca3af").attr("font-size","10px").attr("text-anchor","middle").attr("dy",-4).text(kt),O=z.append("g").selectAll("g").data(r).join("g").call(at().on("start",(c,x)=>{c.active||L.alphaTarget(.3).restart(),x.fx=x.x,x.fy=x.y}).on("drag",vt).on("end",(c,x)=>{c.active||L.alphaTarget(0),x.fx=null,x.fy=null}));return O.append("circle").attr("r",c=>u(c.msgCount)).attr("fill",jt).attr("fill-opacity",.85).attr("stroke",wt).attr("stroke-width",2).style("cursor","grab"),O.append("title").text(bt),O.append("text").attr("dy",c=>u(c.msgCount)+14).attr("text-anchor","middle").attr("fill","#d1d5db").attr("font-size","11px").attr("font-weight",500).attr("pointer-events","none").text(yt),L.on("tick",()=>{X.attr("x1",xt).attr("y1",ut).attr("x2",gt).attr("y2",pt),Y.attr("x",ht).attr("y",dt),O.attr("transform",ft)}),()=>{L.stop()}},A=[r,o,a],t[10]=a,t[11]=o,t[12]=r,t[13]=A,t[14]=_):(A=t[13],_=t[14]),E.useEffect(_,A);let R;if(t[15]!==r){const l=new Map;r.forEach(p=>{l.has(p.team)||l.set(p.team,p.color)}),R=Array.from(l.entries()),t[15]=r,t[16]=R}else R=t[16];const S=R,j=r.length>0;let T;t[17]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(W,{className:"h-5 w-5 text-claude-orange"}),s.jsx("h3",{className:"text-lg font-semibold text-white",children:"Agent Network Graph"})]}),t[17]=T):T=t[17];let v;t[18]!==o||t[19]!==j||t[20]!==r.length?(v=j&&s.jsxs("span",{className:"text-xs text-gray-400",children:[r.length," agents, ",o.length," connections"]}),t[18]=o,t[19]=j,t[20]=r.length,t[21]=v):v=t[21];let k;t[22]!==v?(k=s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[T,v]}),t[22]=v,t[23]=k):k=t[23];let C;t[24]!==a||t[25]!==j||t[26]!==S?(C=j?s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:d,style:{width:"100%",position:"relative"},children:s.jsx("svg",{ref:b,width:a.width,height:a.height,style:{width:"100%",height:a.height,borderRadius:"8px",background:"rgba(15, 23, 42, 0.4)",border:"1px solid rgba(55, 65, 81, 0.4)"}})}),S.length>0&&s.jsxs("div",{className:"flex flex-wrap gap-4 mt-4",style:{paddingTop:"12px",borderTop:"1px solid rgba(55, 65, 81, 0.6)"},children:[s.jsx("span",{className:"text-xs text-gray-500 font-medium",style:{marginRight:"4px"},children:"Teams:"}),S.map(mt)]}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Drag nodes to rearrange. Scroll to zoom. Edge width indicates message volume."})]}):s.jsxs("div",{className:"flex items-center text-gray-400",style:{flexDirection:"column",justifyContent:"center",paddingTop:"64px",paddingBottom:"64px"},children:[s.jsx(W,{className:"mb-3",style:{height:"64px",width:"64px",opacity:.4}}),s.jsx("p",{className:"text-sm",children:"No agent communication data yet"}),s.jsx("p",{className:"text-xs mt-1 text-gray-500",children:"Connections will appear as agents exchange messages"})]}),t[24]=a,t[25]=j,t[26]=S,t[27]=C):C=t[27];let $;return t[28]!==k||t[29]!==C?($=s.jsxs("div",{className:"card",children:[k,C]}),t[28]=k,t[29]=C,t[30]=$):$=t[30],$}function mt(e){const[t,n]=e;return s.jsxs("div",{className:"flex items-center",style:{gap:"6px"},children:[s.jsx("span",{style:{width:10,height:10,borderRadius:"50%",background:n,display:"inline-block",flexShrink:0}}),s.jsx("span",{className:"text-xs text-gray-300",children:t})]},t)}function ft(e){return`translate(${e.x},${e.y})`}function dt(e){return(e.source.y+e.target.y)/2}function ht(e){return(e.source.x+e.target.x)/2}function pt(e){return e.target.y}function gt(e){return e.target.x}function ut(e){return e.source.y}function xt(e){return e.source.x}function yt(e){const t=e.id;return t.length>14?t.slice(0,12)+"..":t}function bt(e){return`${e.id}
|
|
2
|
+
Team: ${e.team}
|
|
3
|
+
Messages: ${e.msgCount}`}function wt(e){return ot(e.color).brighter(.8)}function jt(e){return e.color}function vt(e,t){t.fx=e.x,t.fy=e.y}function kt(e){return e.count>1?e.count:""}function Ct(e){return e.id}function Mt(e){return e.count}function Et(e){return e.msgCount}lt.propTypes={allInboxes:K.object,teams:K.array};export{lt as AgentNetworkGraph};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as xe,j as t,g as we}from"./index-CMd_AsXc.js";import"./utils-mxxv0KtI.js";import{C as Ce,a as ve,X as ke,Y as De,T as ce,L as Oe,R as me,b as Ne,B as Te,c as Re,P as ze,d as Be,e as $e,A as Ke,f as Le}from"./charts-F7VEQUVb.js";import{a7 as Me}from"./icons-Bi3kLKdY.js";import"./d3-core-8TMKOAYc.js";const he=["#f97316","#3b82f6","#22c55e","#a855f7","#ec4899","#eab308","#06b6d4","#ef4444","#6366f1","#14b8a6"],Ee={pending:"#eab308",in_progress:"#3b82f6",completed:"#22c55e",blocked:"#ef4444"};function Pe(s){const e=[];for(const[l,r]of Object.entries(s))for(const[m,c]of Object.entries(r||{})){const f=we(c);for(const o of f)e.push({...o,teamName:l,agentName:m})}return e}function Ge(s){const e=xe.c(1);let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex items-center justify-center h-full text-sm",style:{color:"var(--text-secondary)"},children:"No data yet"}),e[0]=l):l=e[0],l}function fe(s){const e=xe.c(14),{title:l,children:r,hasData:m}=s;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={background:"var(--bg-card-gradient)",border:"1px solid var(--border-color)",boxShadow:"var(--card-shadow)",backdropFilter:"blur(16px)",height:300,display:"flex",flexDirection:"column"},e[0]=c):c=e[0];let f;e[1]===Symbol.for("react.memo_cache_sentinel")?(f={color:"var(--text-heading)"},e[1]=f):f=e[1];let o;e[2]!==l?(o=t.jsx("h3",{className:"text-sm font-semibold mb-3",style:f,children:l}),e[2]=l,e[3]=o):o=e[3];let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d={flex:1,minHeight:0},e[4]=d):d=e[4];let a;e[5]!==r||e[6]!==m||e[7]!==l?(a=m?r:t.jsx(Ge,{label:l}),e[5]=r,e[6]=m,e[7]=l,e[8]=a):a=e[8];let g;e[9]!==a?(g=t.jsx("div",{style:d,children:a}),e[9]=a,e[10]=g):g=e[10];let u;return e[11]!==o||e[12]!==g?(u=t.jsxs("div",{className:"rounded-2xl p-5",style:c,children:[o,g]}),e[11]=o,e[12]=g,e[13]=u):u=e[13],u}const de=s=>{const e=xe.c(9),{active:l,payload:r,label:m}=s;if(!l||!r||!r.length)return null;let c,f;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={background:"var(--bg-card)",border:"1px solid var(--border-color)",borderRadius:8,padding:"8px 12px",fontSize:12,boxShadow:"var(--card-shadow)"},f={color:"var(--text-secondary)",marginBottom:"4px"},e[0]=c,e[1]=f):(c=e[0],f=e[1]);let o;e[2]!==m?(o=t.jsx("p",{style:f,children:m}),e[2]=m,e[3]=o):o=e[3];let d;e[4]!==r?(d=r.map(et),e[4]=r,e[5]=d):d=e[5];let a;return e[6]!==o||e[7]!==d?(a=t.jsxs("div",{style:c,children:[o,d]}),e[6]=o,e[7]=d,e[8]=a):a=e[8],a};function nt(s){const e=xe.c(85),{teams:l,allInboxes:r}=s;let m;e[0]!==l?(m=l===void 0?[]:l,e[0]=l,e[1]=m):m=e[1];const c=m;let f;e[2]!==r?(f=r===void 0?{}:r,e[2]=r,e[3]=f):f=e[3];const o=f;let d;e[4]!==o?(d=Pe(o),e[4]=o,e[5]=d):d=e[5];const a=d;let g;e:{if(a.length===0){let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=[],e[6]=x):x=e[6],g=x;break e}const h=Date.now(),n=h-864e5;let i;if(e[7]!==a){const x={};for(let B=0;B<24;B++){const K=new Date(n+B*60*60*1e3),je=`${String(K.getHours()).padStart(2,"0")}:00`;x[je]=0}for(const B of a){const K=B.timestamp?new Date(B.timestamp).getTime():0;if(K>=n&&K<=h){const je=new Date(K),Se=`${String(je.getHours()).padStart(2,"0")}:00`;Se in x&&(x[Se]=x[Se]+1)}}i=Object.entries(x).map(Ze),e[7]=a,e[8]=i}else i=e[8];g=i}const u=g;let ge;e:{if(a.length===0){let n;e[9]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[9]=n):n=e[9],ge=n;break e}let h;if(e[10]!==a){const n={};for(const i of a){const x=i.from||i.agentName||"unknown";n[x]=(n[x]||0)+1}h=Object.entries(n).sort(Ve).slice(0,10).map(Ue),e[10]=a,e[11]=h}else h=e[11];ge=h}const b=ge;let $;if(e[12]!==c){e:{const h=c.flatMap(Qe);if(h.length===0){let i;e[14]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[14]=i):i=e[14],$=i;break e}const n={pending:0,in_progress:0,completed:0,blocked:0};for(const i of h)i.blockedBy&&i.blockedBy.length>0?n.blocked=n.blocked+1:i.status in n&&(n[i.status]=n[i.status]+1);$=Object.entries(n).filter(Je).map(qe)}e[12]=c,e[13]=$}else $=e[13];const p=$;let ue;e:{if(Object.keys(o).length===0){let n;e[15]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[15]=n):n=e[15],ue=n;break e}let h;e[16]!==o?(h=Object.entries(o).map(Ye).sort(Xe),e[16]=o,e[17]=h):h=e[17],ue=h}const L=ue;let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Me,{className:"h-6 w-6 text-claude-orange"}),e[18]=M):M=e[18];let E;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("h2",{className:"text-xl font-bold",style:{color:"var(--text-heading)"},children:"Analytics"}),e[19]=E):E=e[19];let P;e[20]===Symbol.for("react.memo_cache_sentinel")?(P={color:"var(--text-muted)"},e[20]=P):P=e[20];const Ae=a.length;let _;e[21]!==o?(_=Object.keys(o),e[21]=o,e[22]=_):_=e[22];let y;e[23]!==a.length||e[24]!==_.length?(y=t.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[M,E,t.jsxs("span",{className:"text-sm ml-2",style:P,children:[Ae," total messages across ",_.length," teams"]})]}),e[23]=a.length,e[24]=_.length,e[25]=y):y=e[25];const be=u.length>0;let G,H;e[26]===Symbol.for("react.memo_cache_sentinel")?(G={top:5,right:20,left:0,bottom:5},H=t.jsx(ve,{strokeDasharray:"3 3",stroke:"var(--border-color)"}),e[26]=G,e[27]=H):(G=e[26],H=e[27]);let I;e[28]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ke,{dataKey:"hour",tick:{fill:"var(--text-muted)",fontSize:11},interval:"preserveStartEnd"}),e[28]=I):I=e[28];let F;e[29]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(De,{tick:{fill:"var(--text-muted)",fontSize:11},allowDecimals:!1}),e[29]=F):F=e[29];let W;e[30]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(ce,{content:t.jsx(de,{})}),e[30]=W):W=e[30];let X;e[31]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(Oe,{type:"monotone",dataKey:"messages",stroke:"#f97316",strokeWidth:2,dot:{fill:"#f97316",r:3},activeDot:{r:5,fill:"#fb923c"}}),e[31]=X):X=e[31];let j;e[32]!==u?(j=t.jsx(me,{width:"100%",height:"100%",children:t.jsxs(Ne,{data:u,margin:G,children:[H,I,F,W,X]})}),e[32]=u,e[33]=j):j=e[33];let S;e[34]!==be||e[35]!==j?(S=t.jsx(fe,{title:"Message Activity (Last 24h)",hasData:be,children:j}),e[34]=be,e[35]=j,e[36]=S):S=e[36];const pe=b.length>0;let Y,q;e[37]===Symbol.for("react.memo_cache_sentinel")?(Y={top:5,right:20,left:0,bottom:5},q=t.jsx(ve,{strokeDasharray:"3 3",stroke:"var(--border-color)"}),e[37]=Y,e[38]=q):(Y=e[37],q=e[38]);let J;e[39]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(ke,{dataKey:"name",tick:{fill:"var(--text-muted)",fontSize:10},angle:-30,textAnchor:"end",height:50}),e[39]=J):J=e[39];let Q;e[40]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(De,{tick:{fill:"var(--text-muted)",fontSize:11},allowDecimals:!1}),e[40]=Q):Q=e[40];let U;e[41]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(ce,{content:t.jsx(de,{})}),e[41]=U):U=e[41];let V;e[42]===Symbol.for("react.memo_cache_sentinel")?(V=[4,4,0,0],e[42]=V):V=e[42];let v;e[43]!==b?(v=b.map(We),e[43]=b,e[44]=v):v=e[44];let k;e[45]!==v?(k=t.jsx(Te,{dataKey:"messages",radius:V,children:v}),e[45]=v,e[46]=k):k=e[46];let D;e[47]!==k||e[48]!==b?(D=t.jsx(me,{width:"100%",height:"100%",children:t.jsxs(Re,{data:b,margin:Y,children:[q,J,Q,U,k]})}),e[47]=k,e[48]=b,e[49]=D):D=e[49];let w;e[50]!==pe||e[51]!==D?(w=t.jsx(fe,{title:"Top 10 Agents by Message Count",hasData:pe,children:D}),e[50]=pe,e[51]=D,e[52]=w):w=e[52];const _e=p.length>0;let C;e[53]!==p?(C=p.map(Ie),e[53]=p,e[54]=C):C=e[54];let A;e[55]!==C||e[56]!==p?(A=t.jsx(ze,{data:p,cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:3,dataKey:"value",label:Fe,children:C}),e[55]=C,e[56]=p,e[57]=A):A=e[57];let Z;e[58]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(ce,{content:t.jsx(de,{})}),e[58]=Z):Z=e[58];let ee;e[59]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(Be,{wrapperStyle:{fontSize:11,color:"var(--text-muted)"},formatter:He}),e[59]=ee):ee=e[59];let O;e[60]!==A?(O=t.jsx(me,{width:"100%",height:"100%",children:t.jsxs($e,{children:[A,Z,ee]})}),e[60]=A,e[61]=O):O=e[61];let N;e[62]!==_e||e[63]!==O?(N=t.jsx(fe,{title:"Task Status Distribution",hasData:_e,children:O}),e[62]=_e,e[63]=O,e[64]=N):N=e[64];const ye=L.length>0;let te,se;e[65]===Symbol.for("react.memo_cache_sentinel")?(te={top:5,right:20,left:0,bottom:5},se=t.jsx(ve,{strokeDasharray:"3 3",stroke:"var(--border-color)"}),e[65]=te,e[66]=se):(te=e[65],se=e[66]);let le;e[67]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx(ke,{dataKey:"name",tick:{fill:"var(--text-muted)",fontSize:10},angle:-20,textAnchor:"end",height:50}),e[67]=le):le=e[67];let oe;e[68]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx(De,{tick:{fill:"var(--text-muted)",fontSize:11},allowDecimals:!1}),e[68]=oe):oe=e[68];let ae;e[69]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx(ce,{content:t.jsx(de,{})}),e[69]=ae):ae=e[69];let ne,re;e[70]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("defs",{children:t.jsxs("linearGradient",{id:"analyticsGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[t.jsx("stop",{offset:"5%",stopColor:"#f97316",stopOpacity:.4}),t.jsx("stop",{offset:"95%",stopColor:"#f97316",stopOpacity:.05})]})}),re=t.jsx(Ke,{type:"monotone",dataKey:"messages",stroke:"#f97316",strokeWidth:2,fill:"url(#analyticsGradient)"}),e[70]=ne,e[71]=re):(ne=e[70],re=e[71]);let T;e[72]!==L?(T=t.jsx(me,{width:"100%",height:"100%",children:t.jsxs(Le,{data:L,margin:te,children:[se,le,oe,ae,ne,re]})}),e[72]=L,e[73]=T):T=e[73];let R;e[74]!==ye||e[75]!==T?(R=t.jsx(fe,{title:"Team Comparison - Messages per Team",hasData:ye,children:T}),e[74]=ye,e[75]=T,e[76]=R):R=e[76];let z;e[77]!==S||e[78]!==w||e[79]!==N||e[80]!==R?(z=t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[S,w,N,R]}),e[77]=S,e[78]=w,e[79]=N,e[80]=R,e[81]=z):z=e[81];let ie;return e[82]!==y||e[83]!==z?(ie=t.jsxs("div",{children:[y,z]}),e[82]=y,e[83]=z,e[84]=ie):ie=e[84],ie}function He(s){return t.jsx("span",{style:{color:"var(--text-secondary)"},children:s})}function Ie(s,e){return t.jsx(Ce,{fill:Ee[s.status]||he[e%he.length]},e)}function Fe(s){const{name:e,value:l}=s;return`${e} (${l})`}function We(s,e){return t.jsx(Ce,{fill:he[e%he.length]},e)}function Xe(s,e){return e.messages-s.messages}function Ye(s){const[e,l]=s;let r=0;for(const m of Object.values(l||{})){const c=we(m);r=r+c.length}return{name:e.length>18?e.slice(0,18)+"..":e,messages:r}}function qe(s){const[e,l]=s;return{name:e.replace("_"," "),value:l,status:e}}function Je(s){const[,e]=s;return e>0}function Qe(s){return s.tasks||[]}function Ue(s){const[e,l]=s;return{name:e.length>12?e.slice(0,12)+"..":e,messages:l}}function Ve(s,e){return e[1]-s[1]}function Ze(s){const[e,l]=s;return{hour:e,messages:l}}function et(s,e){return t.jsxs("p",{style:{color:s.color||s.fill||"#f97316"},children:[s.name,": ",s.value]},e)}export{nt as AnalyticsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as U,j as e,S as W,d as A,r as z}from"./index-CMd_AsXc.js";import{g as B,r as g}from"./utils-mxxv0KtI.js";import{a8 as F,x as P,l as J,m as K,a3 as Z,U as L,e as R,C as G,b as Q}from"./icons-Bi3kLKdY.js";import"./charts-F7VEQUVb.js";import"./d3-core-8TMKOAYc.js";var E={exports:{}},X=E.exports,_;function ee(){return _||(_=1,(function(C,I){(function(S,o){C.exports=o()})(X,(function(){var S,o,j=1e3,v=6e4,x=36e5,N=864e5,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,$=31536e6,w=2628e6,D=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,f={years:$,months:w,days:N,hours:x,minutes:v,seconds:j,milliseconds:1,weeks:6048e5},k=function(a){return a instanceof M},p=function(a,r,s){return new M(a,s,r.$l)},b=function(a){return o.p(a)+"s"},Y=function(a){return a<0},t=function(a){return Y(a)?Math.ceil(a):Math.floor(a)},c=function(a){return Math.abs(a)},m=function(a,r){return a?Y(a)?{negative:!0,format:""+c(a)+r}:{negative:!1,format:""+a+r}:{negative:!1,format:""}},M=(function(){function a(s,n,l){var i=this;if(this.$d={},this.$l=l,s===void 0&&(this.$ms=0,this.parseFromMilliseconds()),n)return p(s*f[b(n)],this);if(typeof s=="number")return this.$ms=s,this.parseFromMilliseconds(),this;if(typeof s=="object")return Object.keys(s).forEach((function(u){i.$d[b(u)]=s[u]})),this.calMilliseconds(),this;if(typeof s=="string"){var d=s.match(D);if(d){var h=d.slice(2).map((function(u){return u!=null?Number(u):0}));return this.$d.years=h[0],this.$d.months=h[1],this.$d.weeks=h[2],this.$d.days=h[3],this.$d.hours=h[4],this.$d.minutes=h[5],this.$d.seconds=h[6],this.calMilliseconds(),this}}return this}var r=a.prototype;return r.calMilliseconds=function(){var s=this;this.$ms=Object.keys(this.$d).reduce((function(n,l){return n+(s.$d[l]||0)*f[l]}),0)},r.parseFromMilliseconds=function(){var s=this.$ms;this.$d.years=t(s/$),s%=$,this.$d.months=t(s/w),s%=w,this.$d.days=t(s/N),s%=N,this.$d.hours=t(s/x),s%=x,this.$d.minutes=t(s/v),s%=v,this.$d.seconds=t(s/j),s%=j,this.$d.milliseconds=s},r.toISOString=function(){var s=m(this.$d.years,"Y"),n=m(this.$d.months,"M"),l=+this.$d.days||0;this.$d.weeks&&(l+=7*this.$d.weeks);var i=m(l,"D"),d=m(this.$d.hours,"H"),h=m(this.$d.minutes,"M"),u=this.$d.seconds||0;this.$d.milliseconds&&(u+=this.$d.milliseconds/1e3,u=Math.round(1e3*u)/1e3);var T=m(u,"S"),q=s.negative||n.negative||i.negative||d.negative||h.negative||T.negative,V=d.format||h.format||T.format?"T":"",H=(q?"-":"")+"P"+s.format+n.format+i.format+V+d.format+h.format+T.format;return H==="P"||H==="-P"?"P0D":H},r.toJSON=function(){return this.toISOString()},r.format=function(s){var n=s||"YYYY-MM-DDTHH:mm:ss",l={Y:this.$d.years,YY:o.s(this.$d.years,2,"0"),YYYY:o.s(this.$d.years,4,"0"),M:this.$d.months,MM:o.s(this.$d.months,2,"0"),D:this.$d.days,DD:o.s(this.$d.days,2,"0"),H:this.$d.hours,HH:o.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:o.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:o.s(this.$d.seconds,2,"0"),SSS:o.s(this.$d.milliseconds,3,"0")};return n.replace(y,(function(i,d){return d||String(l[i])}))},r.as=function(s){return this.$ms/f[b(s)]},r.get=function(s){var n=this.$ms,l=b(s);return l==="milliseconds"?n%=1e3:n=l==="weeks"?t(n/f[l]):this.$d[l],n||0},r.add=function(s,n,l){var i;return i=n?s*f[b(n)]:k(s)?s.$ms:p(s,this).$ms,p(this.$ms+i*(l?-1:1),this)},r.subtract=function(s,n){return this.add(s,n,!0)},r.locale=function(s){var n=this.clone();return n.$l=s,n},r.clone=function(){return p(this.$ms,this)},r.humanize=function(s){return S().add(this.$ms,"ms").locale(this.$l).fromNow(!s)},r.valueOf=function(){return this.asMilliseconds()},r.milliseconds=function(){return this.get("milliseconds")},r.asMilliseconds=function(){return this.as("milliseconds")},r.seconds=function(){return this.get("seconds")},r.asSeconds=function(){return this.as("seconds")},r.minutes=function(){return this.get("minutes")},r.asMinutes=function(){return this.as("minutes")},r.hours=function(){return this.get("hours")},r.asHours=function(){return this.as("hours")},r.days=function(){return this.get("days")},r.asDays=function(){return this.as("days")},r.weeks=function(){return this.get("weeks")},r.asWeeks=function(){return this.as("weeks")},r.months=function(){return this.get("months")},r.asMonths=function(){return this.as("months")},r.years=function(){return this.get("years")},r.asYears=function(){return this.as("years")},a})(),O=function(a,r,s){return a.add(r.years()*s,"y").add(r.months()*s,"M").add(r.days()*s,"d").add(r.hours()*s,"h").add(r.minutes()*s,"m").add(r.seconds()*s,"s").add(r.milliseconds()*s,"ms")};return function(a,r,s){S=s,o=s().$utils(),s.duration=function(i,d){var h=s.locale();return p(i,{$l:h},d)},s.isDuration=k;var n=r.prototype.add,l=r.prototype.subtract;r.prototype.add=function(i,d){return k(i)?O(this,i,1):n.bind(this)(i,d)},r.prototype.subtract=function(i,d){return k(i)?O(this,i,-1):l.bind(this)(i,d)}}}))})(E)),E.exports}var se=ee();const te=B(se);A.extend(z);A.extend(te);const re=3e4;function ae(){const[C,I]=g.useState([]),[S,o]=g.useState(!0),[j,v]=g.useState(null),[x,N]=g.useState(null),[y,$]=g.useState(null),[w,D]=g.useState(null),[f,k]=g.useState(null);g.useEffect(()=>{p();const t=setInterval(p,re);return()=>clearInterval(t)},[]);const p=async()=>{try{o(!0);const t=await U("/api/archive");if(!t.ok)throw new Error("Failed to fetch archives");const c=await t.json();I(c.archives||[]),v(null),k(new Date)}catch(t){v(t.message),console.error("Error fetching archives:",t)}finally{o(!1)}},b=async t=>{try{D(null);const c=await U(`/api/archive/${encodeURIComponent(t)}`);if(!c.ok)throw new Error("Failed to fetch archive details");const m=await c.json();$(m)}catch(c){console.error("Error fetching archive details:",c),D(c.message||"Failed to load archive details")}},Y=async t=>{x===t?(N(null),$(null),D(null)):(N(t),await b(t))};return S?e.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((t,c)=>e.jsx(W,{lines:2},c))}):j?e.jsx("div",{className:"card border-l-4 border-l-red-500",children:e.jsxs("div",{className:"flex items-center gap-3 text-red-400",children:[e.jsx(F,{className:"h-6 w-6"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:"Error Loading Archives"}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:j})]})]})}):C.length===0?e.jsx("div",{className:"card",children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx(F,{className:"h-16 w-16 text-gray-600 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No Archived Teams Yet"}),e.jsx("p",{className:"text-gray-400",children:"No archived teams yet. Teams are archived when they complete."})]})}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"card border-l-4 border-l-purple-500",style:{background:"linear-gradient(to right, rgba(88,28,135,0.2), transparent)"},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-3 rounded-lg",style:{backgroundColor:"rgba(168,85,247,0.2)"},children:e.jsx(F,{className:"h-6 w-6 text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"Team Archive"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"History of completed agent teams and their accomplishments"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{style:{textAlign:"right"},children:[e.jsxs("div",{className:"px-4 py-2 rounded-lg",style:{backgroundColor:"rgba(168,85,247,0.2)"},children:[e.jsx("span",{className:"text-2xl font-bold text-purple-400",children:C.length}),e.jsx("span",{className:"text-sm text-gray-400 ml-2",children:"archived"})]}),f&&e.jsxs("p",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:["Updated ",A(f).fromNow()]})]}),e.jsx("button",{onClick:p,title:"Refresh archives","aria-label":"Refresh archives",style:{padding:"8px",borderRadius:"8px",background:"rgba(168,85,247,0.15)",border:"1px solid rgba(168,85,247,0.3)",color:"#a855f7",cursor:"pointer",display:"flex",alignItems:"center"},children:e.jsx(P,{style:{width:"16px",height:"16px"}})})]})]})}),C.map((t,c)=>e.jsxs("div",{className:"card border-l-4 border-l-purple-500 hover:border-l-purple-400 transition-all duration-300",children:[e.jsxs("div",{className:"flex items-start justify-between mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("h3",{className:"text-xl font-bold text-white",children:t.overview?.split('"')[1]||"Unknown Team"}),e.jsxs("span",{className:"px-3 py-1 text-purple-400 text-xs font-medium rounded-full",style:{backgroundColor:"rgba(168,85,247,0.2)"},children:["#",c+1]})]}),e.jsx("p",{className:"text-gray-300 text-sm leading-relaxed",children:t.overview})]}),e.jsx("button",{onClick:()=>Y(t.filename),className:"ml-4 p-2 hover:bg-gray-700 rounded-lg transition-colors flex-shrink-0","aria-label":x===t.filename?"Collapse details":"Expand details","aria-expanded":x===t.filename,children:x===t.filename?e.jsx(J,{className:"h-5 w-5 text-gray-400"}):e.jsx(K,{className:"h-5 w-5 text-gray-400"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{backgroundColor:"rgba(55,65,81,0.5)"},children:[e.jsx(Z,{className:"h-4 w-4 text-purple-400"}),e.jsx("span",{className:"text-sm text-gray-300",children:A(t.archivedAt).format("MMM D, YYYY")}),e.jsxs("span",{className:"text-xs text-gray-500",children:["(",A(t.archivedAt).fromNow(),")"]})]}),t.members&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{backgroundColor:"rgba(55,65,81,0.5)"},children:[e.jsx(L,{className:"h-4 w-4 text-blue-400"}),e.jsxs("span",{className:"text-sm text-gray-300",children:[Array.isArray(t.members)?t.members.length:0," members"]})]}),t.accomplishments&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{backgroundColor:"rgba(55,65,81,0.5)"},children:[e.jsx(R,{className:"h-4 w-4 text-green-400"}),e.jsxs("span",{className:"text-sm text-gray-300",children:[t.accomplishments.length," completed"]})]}),t.duration&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg",style:{backgroundColor:"rgba(55,65,81,0.5)"},children:[e.jsx(G,{className:"h-4 w-4 text-orange-400"}),e.jsx("span",{className:"text-sm text-gray-300",children:t.duration})]})]}),t.created&&e.jsx("div",{className:"rounded-lg p-3 mb-4",style:{backgroundColor:"rgba(31,41,55,0.5)"},children:e.jsxs("p",{className:"text-sm text-gray-400 flex items-center gap-2",children:[e.jsx(P,{className:"h-4 w-4 text-purple-400"}),t.created]})}),x===t.filename&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-700 space-y-4 animate-fadeIn",children:[w&&e.jsxs("div",{role:"alert",className:"p-3 rounded-lg text-sm",style:{color:"#f87171",background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.3)"},children:["Error loading details: ",w]}),t.members&&t.members.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5 text-blue-400"}),"Team Members"]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:t.members.map((m,M)=>e.jsxs("div",{className:"rounded-lg p-3 flex items-center gap-3",style:{backgroundColor:"rgba(31,41,55,0.5)"},children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center text-white font-semibold text-sm",children:m.split(" ")[0]?.[0]||"?"}),e.jsx("span",{className:"text-sm text-gray-300",children:m})]},M))})]}),t.accomplishments&&t.accomplishments.length>0&&e.jsxs("div",{children:[e.jsxs("h4",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[e.jsx(R,{className:"h-5 w-5 text-green-400"}),"Key Accomplishments"]}),e.jsx("div",{className:"space-y-2",children:t.accomplishments.map((m,M)=>e.jsxs("div",{className:"rounded-lg p-3 flex items-start gap-3",style:{backgroundColor:"rgba(31,41,55,0.5)"},children:[e.jsx(R,{className:"h-4 w-4 text-green-400 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-gray-300 leading-relaxed",children:m.replace("✅ ","")})]},M))})]}),y&&e.jsxs("div",{className:"rounded-lg p-4",style:{backgroundColor:"rgba(88,28,135,0.2)",border:"1px solid rgba(168,85,247,0.3)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Q,{className:"h-4 w-4 text-purple-400"}),e.jsx("h4",{className:"text-sm font-semibold text-purple-400",children:"Full Archive Data"})]}),e.jsxs("p",{className:"text-xs text-gray-400 mb-2",children:["Team: ",y.teamName]}),e.jsxs("p",{className:"text-xs text-gray-400",children:["Total Tasks: ",y.rawData?.tasks?.length||0]}),y.rawData?.config&&e.jsxs("p",{className:"text-xs text-gray-400",children:["Configuration: ",y.rawData.config.members?.length||0," members configured"]})]})]})]},t.filename))]})}ae.propTypes={};export{ae as ArchiveViewer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as ee,j as s,u as ke,P as A}from"./index-CMd_AsXc.js";import{b as ce,r as K}from"./utils-mxxv0KtI.js";import"./charts-F7VEQUVb.js";import"./d3-core-8TMKOAYc.js";import"./icons-Bi3kLKdY.js";const V={pending:{bg:"rgba(234, 179, 8, 0.15)",border:"rgba(234, 179, 8, 0.5)",text:"#facc15",glow:"rgba(234, 179, 8, 0.3)",fill:"#eab308",columnBg:"rgba(234, 179, 8, 0.06)",columnBorder:"rgba(234, 179, 8, 0.2)",label:"Pending",barFill:"rgba(234, 179, 8, 0.6)"},in_progress:{bg:"rgba(59, 130, 246, 0.15)",border:"rgba(59, 130, 246, 0.5)",text:"#60a5fa",glow:"rgba(59, 130, 246, 0.3)",fill:"#3b82f6",columnBg:"rgba(59, 130, 246, 0.06)",columnBorder:"rgba(59, 130, 246, 0.2)",label:"In Progress",barFill:"rgba(59, 130, 246, 0.6)"},completed:{bg:"rgba(34, 197, 94, 0.15)",border:"rgba(34, 197, 94, 0.5)",text:"#4ade80",glow:"rgba(34, 197, 94, 0.3)",fill:"#22c55e",columnBg:"rgba(34, 197, 94, 0.06)",columnBorder:"rgba(34, 197, 94, 0.2)",label:"Completed",barFill:"rgba(34, 197, 94, 0.6)"},blocked:{bg:"rgba(239, 68, 68, 0.15)",border:"rgba(239, 68, 68, 0.5)",text:"#f87171",glow:"rgba(239, 68, 68, 0.3)",fill:"#ef4444",columnBg:"rgba(239, 68, 68, 0.06)",columnBorder:"rgba(239, 68, 68, 0.2)",label:"Blocked",barFill:"rgba(239, 68, 68, 0.6)"}};function Q(l){return l.blockedBy&&l.blockedBy.length>0?"blocked":l.status||"pending"}function G(l,t){return l?l.length>t?l.slice(0,t)+"...":l:""}function we(l){const t=ee.c(50),{task:e,onClose:j}=l,i=ke(!!e);if(!e)return null;const r=Q(e),k=V[r]||V.pending;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={background:"rgba(0,0,0,0.5)"},t[0]=n):n=t[0];const S=`1px solid ${k.border}`,a=`0 0 40px ${k.glow}, 0 20px 60px rgba(0,0,0,0.5)`;let x;t[1]!==S||t[2]!==a?(x={background:"linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%)",border:S,boxShadow:a},t[1]=S,t[2]=a,t[3]=x):x=t[3];const h=`1px solid ${k.border}`;let M;t[4]!==k.bg||t[5]!==k.text||t[6]!==h?(M={fontSize:10,background:k.bg,color:k.text,border:h},t[4]=k.bg,t[5]=k.text,t[6]=h,t[7]=M):M=t[7];let o;t[8]!==k.label||t[9]!==M?(o=s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full font-bold uppercase tracking-wider mb-2",style:M,children:k.label}),t[8]=k.label,t[9]=M,t[10]=o):o=t[10];let W;t[11]!==e.subject?(W=s.jsx("h4",{className:"text-white font-bold text-base leading-tight",children:e.subject}),t[11]=e.subject,t[12]=W):W=t[12];let f;t[13]!==o||t[14]!==W?(f=s.jsxs("div",{className:"flex-1 min-w-0",children:[o,W]}),t[13]=o,t[14]=W,t[15]=f):f=t[15];let b;t[16]===Symbol.for("react.memo_cache_sentinel")?(b={backgroundColor:"transparent"},t[16]=b):b=t[16];let u;t[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t[17]=u):u=t[17];let m;t[18]!==j?(m=s.jsx("button",{onClick:j,className:"ml-3 p-1 rounded-lg transition-colors flex-shrink-0",style:b,onMouseEnter:Be,onMouseLeave:Se,"aria-label":"Close task details",children:u}),t[18]=j,t[19]=m):m=t[19];let B;t[20]!==m||t[21]!==f?(B=s.jsxs("div",{className:"flex items-start justify-between mb-4",children:[f,m]}),t[20]=m,t[21]=f,t[22]=B):B=t[22];let _;t[23]!==e.description?(_=e.description&&s.jsx("p",{className:"text-gray-300 text-sm leading-relaxed mb-4",style:{maxHeight:"120px",overflowY:"auto"},children:e.description}),t[23]=e.description,t[24]=_):_=t[24];let g;t[25]!==e._teamName?(g=e._teamName&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:"Team"}),s.jsx("span",{className:"text-gray-300 text-xs font-medium",children:e._teamName})]}),t[25]=e._teamName,t[26]=g):g=t[26];let p;t[27]!==e.owner?(p=e.owner&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:"Owner"}),s.jsx("span",{className:"text-gray-300 text-xs font-medium",children:e.owner})]}),t[27]=e.owner,t[28]=p):p=t[28];let w;t[29]!==e.id?(w=e.id&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:"Task ID"}),s.jsx("span",{className:"text-gray-400 text-xs font-mono",children:e.id})]}),t[29]=e.id,t[30]=w):w=t[30];let v;t[31]!==e.blockedBy?(v=e.blockedBy&&e.blockedBy.length>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:"Blocked by"}),s.jsx("div",{className:"flex flex-wrap gap-1",children:e.blockedBy.map(Ne)})]}),t[31]=e.blockedBy,t[32]=v):v=t[32];let c;t[33]!==e.blocks?(c=e.blocks&&e.blocks.length>0&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-gray-500 text-xs w-20 flex-shrink-0",children:"Blocks"}),s.jsx("div",{className:"flex flex-wrap gap-1",children:e.blocks.map(ve)})]}),t[33]=e.blocks,t[34]=c):c=t[34];let y;t[35]!==g||t[36]!==p||t[37]!==w||t[38]!==v||t[39]!==c?(y=s.jsxs("div",{className:"space-y-2",children:[g,p,w,v,c]}),t[35]=g,t[36]=p,t[37]=w,t[38]=v,t[39]=c,t[40]=y):y=t[40];let $;t[41]!==B||t[42]!==_||t[43]!==y||t[44]!==x?($=s.jsxs("div",{className:"rounded-xl p-5 max-w-md w-full mx-4 shadow-2xl",style:x,onClick:Te,children:[B,_,y]}),t[41]=B,t[42]=_,t[43]=y,t[44]=x,t[45]=$):$=t[45];let R;return t[46]!==j||t[47]!==$||t[48]!==i?(R=s.jsx("div",{ref:i,className:"fixed inset-0 z-50 flex items-center justify-center",style:n,onClick:j,role:"dialog","aria-modal":"true","aria-label":"Task details",children:$}),t[46]=j,t[47]=$,t[48]=i,t[49]=R):R=t[49],R}function ve(l){return s.jsxs("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded",style:{background:"rgba(249, 115, 22, 0.15)",color:"#fdba74",border:"1px solid rgba(249, 115, 22, 0.3)"},children:["#",l]},l)}function Ne(l){return s.jsxs("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded",style:{background:"rgba(239, 68, 68, 0.15)",color:"#fca5a5",border:"1px solid rgba(239, 68, 68, 0.3)"},children:["#",l]},l)}function Se(l){l.currentTarget.style.backgroundColor="transparent"}function Be(l){l.currentTarget.style.backgroundColor="rgba(55,65,81,0.5)"}function Te(l){return l.stopPropagation()}function Me(l){const t=ee.c(37),{task:e,x:j,y:i,svgRect:r}=l;if(!e||!r)return null;const k=Q(e),n=V[k]||V.pending,S=e.description?100:70;let a=j+10,x=i-S-10;x<0&&(x=i+20),a+240>r.width&&(a=j-240-10);const h=`1px solid ${n.border}`,M=`0 0 20px ${n.glow}`;let o;t[0]!==a||t[1]!==h||t[2]!==M||t[3]!==x?(o={left:a,top:x,width:240,background:"rgba(17, 24, 39, 0.95)",border:h,boxShadow:M,backdropFilter:"blur(8px)"},t[0]=a,t[1]=h,t[2]=M,t[3]=x,t[4]=o):o=t[4];let W;t[5]===Symbol.for("react.memo_cache_sentinel")?(W={gap:8},t[5]=W):W=t[5];let f;t[6]!==n.fill?(f=s.jsx("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:n.fill}}),t[6]=n.fill,t[7]=f):f=t[7];let b;t[8]!==e.subject?(b=G(e.subject,40),t[8]=e.subject,t[9]=b):b=t[9];let u;t[10]!==b?(u=s.jsx("span",{className:"text-white text-xs font-bold leading-tight",children:b}),t[10]=b,t[11]=u):u=t[11];let m;t[12]!==f||t[13]!==u?(m=s.jsxs("div",{className:"flex items-center mb-1.5",style:W,children:[f,u]}),t[12]=f,t[13]=u,t[14]=m):m=t[14];let B;t[15]!==e.description?(B=e.description&&s.jsx("p",{className:"text-gray-400 leading-relaxed mb-1.5",style:{fontSize:10,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.description}),t[15]=e.description,t[16]=B):B=t[16];let _;t[17]===Symbol.for("react.memo_cache_sentinel")?(_={gap:12,fontSize:10},t[17]=_):_=t[17];let g;t[18]!==e._teamName?(g=e._teamName&&s.jsx("span",{className:"text-gray-500",children:e._teamName}),t[18]=e._teamName,t[19]=g):g=t[19];let p;t[20]!==n.text||t[21]!==e.owner?(p=e.owner&&s.jsx("span",{style:{color:n.text},children:e.owner}),t[20]=n.text,t[21]=e.owner,t[22]=p):p=t[22];let w;t[23]!==n.text?(w={color:n.text},t[23]=n.text,t[24]=w):w=t[24];let v;t[25]!==n.label||t[26]!==w?(v=s.jsx("span",{className:"font-semibold uppercase",style:w,children:n.label}),t[25]=n.label,t[26]=w,t[27]=v):v=t[27];let c;t[28]!==g||t[29]!==p||t[30]!==v?(c=s.jsxs("div",{className:"flex items-center",style:_,children:[g,p,v]}),t[28]=g,t[29]=p,t[30]=v,t[31]=c):c=t[31];let y;return t[32]!==c||t[33]!==o||t[34]!==m||t[35]!==B?(y=s.jsxs("div",{className:"absolute pointer-events-none z-40 rounded-lg p-3 shadow-xl",style:o,children:[m,B,c]}),t[32]=c,t[33]=o,t[34]=m,t[35]=B,t[36]=y):y=t[36],y}const $e=ce.memo(function(t){const e=ee.c(6),{allTasks:j,onTaskClick:i}=t;let r;e[0]!==j?(r={pending:[],in_progress:[],completed:[],blocked:[]},j.forEach(x=>{const h=Q(x);r[h]?r[h].push(x):r.pending.push(x)}),e[0]=j,e[1]=r):r=e[1];const k=r;let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=["pending","in_progress","completed","blocked"],e[2]=n):n=e[2];const S=n;let a;return e[3]!==k||e[4]!==i?(a=s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4",children:S.map(x=>{const h=V[x],M=k[x];return s.jsxs("div",{className:"rounded-xl overflow-hidden",style:{background:h.columnBg,border:`1px solid ${h.columnBorder}`},children:[s.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",style:{background:h.bg,borderBottom:`1px solid ${h.columnBorder}`},children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{background:h.fill,boxShadow:`0 0 8px ${h.glow}`}}),s.jsx("span",{className:"text-sm font-semibold",style:{color:h.text},children:h.label})]}),s.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full",style:{background:h.bg,color:h.text,border:`1px solid ${h.border}`},children:M.length})]}),s.jsx("div",{className:"p-3 space-y-2 overflow-y-auto custom-scrollbar",style:{maxHeight:420},children:M.length===0?s.jsx("div",{className:"text-center py-6",children:s.jsx("p",{className:"text-gray-500 text-xs",children:"No tasks"})}):M.map((o,W)=>s.jsxs("div",{className:"rounded-lg p-3 transition-all duration-200 cursor-pointer",style:{background:"linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.6) 100%)",border:"1px solid rgba(75, 85, 99, 0.3)"},role:"button",tabIndex:0,onClick:()=>i(o),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),i(o))},"aria-label":`View details for task: ${G(o.subject,40)}`,onMouseEnter:f=>{f.currentTarget.style.borderColor=h.border,f.currentTarget.style.boxShadow=`0 2px 12px ${h.glow}`},onMouseLeave:_e,children:[o._teamName&&s.jsx("span",{className:"font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded mb-1.5 inline-block",style:{fontSize:10,background:"rgba(249, 115, 22, 0.15)",color:"#fb923c",border:"1px solid rgba(249, 115, 22, 0.3)"},children:o._teamName}),s.jsx("p",{className:"text-white text-sm font-medium leading-snug mb-1.5",children:G(o.subject,60)}),o.owner&&s.jsxs("div",{className:"flex items-center",style:{gap:6},children:[s.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),s.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),s.jsx("span",{className:"text-gray-400 text-xs",children:o.owner})]}),o.blockedBy&&o.blockedBy.length>0&&s.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[s.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#f87171",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("line",{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"})]}),s.jsxs("span",{className:"text-xs",style:{color:"#fca5a5"},children:["Blocked by ",o.blockedBy.length," task",o.blockedBy.length!==1?"s":""]})]})]},o.id||W))})]},x)})}),e[3]=k,e[4]=i,e[5]=a):a=e[5],a}),We=ce.memo(function(t){const e=ee.c(57),{allTasks:j,onTaskClick:i}=t,[r,k]=K.useState(null);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={x:0,y:0},e[0]=n):n=e[0];const[S,a]=K.useState(n),[x,h]=K.useState(null),M=j.some(De);let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=E=>{E&&h({width:E.offsetWidth,height:E.offsetHeight})},e[1]=o):o=e[1];const W=o;let f;e:{if(!M){f=null;break e}const E={};j.forEach(T=>{T.id&&(E[T.id]=T)});let d;e[2]!==j?(d=new Set,j.forEach(T=>{T.blockedBy&&T.blockedBy.length>0&&(d.add(T.id),T.blockedBy.forEach(D=>d.add(D))),T.blocks&&T.blocks.length>0&&(d.add(T.id),T.blocks.forEach(D=>d.add(D)))}),e[2]=j,e[3]=d):d=e[3];let F;if(e[4]!==j||e[5]!==d){let T;e[7]!==d?(T=N=>d.has(N.id),e[7]=d,e[8]=T):T=e[8];const D=j.filter(T),z={};D.forEach(N=>{N.blockedBy&&N.blockedBy.forEach(L=>{z[L]||(z[L]=[]),z[L].push(N.id)})});const H={},J=D.filter(He).map(Le),ne=new Set;for(;J.length>0;){const{id:N,depth:L}=J.shift();if(ne.has(N)){H[N]=Math.max(H[N]||0,L);continue}ne.add(N),H[N]=Math.max(H[N]||0,L),(z[N]||[]).forEach(he=>{J.push({id:he,depth:L+1})})}D.forEach(N=>{H[N.id]===void 0&&(H[N.id]=0)});const O={};D.forEach(N=>{const L=H[N.id];O[L]||(O[L]=[]),O[L].push(N)});const Y=Object.keys(O).map(Number).sort(Re),ge=Math.max(...Y.map(N=>O[N].length)),pe=80+Y.length*290-80,fe=80+ge*92-24,ie={};Y.forEach((N,L)=>{const ae=O[N],he=40+L*290,be=ae.length*68+(ae.length-1)*24,ue=40+(fe-80-be)/2;ae.forEach((ye,je)=>{ie[ye.id]={x:he,y:ue+je*92}})});const me=[];D.forEach(N=>{N.blockedBy&&N.blockedBy.forEach(L=>{ie[L]&&ie[N.id]&&me.push({from:L,to:N.id})})}),F={involvedTasks:D,positions:ie,edges:me,svgWidth:pe,svgHeight:fe,nodeW:210,nodeH:68},e[4]=j,e[5]=d,e[6]=F}else F=e[6];f=F}const b=f;let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=(E,d)=>{const F=d.currentTarget.closest(".dep-graph-container");if(F){const T=F.getBoundingClientRect();a({x:d.clientX-T.left,y:d.clientY-T.top}),h({width:T.width,height:T.height})}k(E)},e[9]=u):u=e[9];const m=u;let B;e[10]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{k(null)},e[10]=B):B=e[10];const _=B;if(!M){let E;return e[11]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("div",{className:"text-center py-16",children:[s.jsxs("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"#4b5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"mx-auto mb-4 opacity-50",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:"M8 12h8"})]}),s.jsx("p",{className:"text-gray-400 text-base font-medium",children:"No task dependencies found"}),s.jsx("p",{className:"text-gray-500 text-sm mt-1",children:"Dependencies will appear here when tasks have blockedBy relationships"})]}),e[11]=E):E=e[11],E}const{involvedTasks:g,positions:p,edges:w,svgWidth:v,svgHeight:c,nodeW:y,nodeH:$}=b;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R={maxHeight:"520px"},e[12]=R):R=e[12];let C;e[13]!==x||e[14]!==S||e[15]!==r?(C=r&&s.jsx(Me,{task:r,x:S.x,y:S.y,svgRect:x}),e[13]=x,e[14]=S,e[15]=r,e[16]=C):C=e[16];const P=Math.max(v,600),de=Math.max(c,200),xe=`0 0 ${Math.max(v,600)} ${Math.max(c,200)}`;let X;e[17]!==v?(X={minWidth:v},e[17]=v,e[18]=X):X=e[18];let te;e[19]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx("marker",{id:"dep-arrowhead",markerWidth:"8",markerHeight:"6",refX:"8",refY:"3",orient:"auto",children:s.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:"#6b7280"})}),e[19]=te):te=e[19];let se;e[20]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsx("marker",{id:"dep-arrowhead-hl",markerWidth:"8",markerHeight:"6",refX:"8",refY:"3",orient:"auto",children:s.jsx("polygon",{points:"0 0, 8 3, 0 6",fill:"#f97316"})}),e[20]=se):se=e[20];let le;e[21]===Symbol.for("react.memo_cache_sentinel")?(le=s.jsx("filter",{id:"dep-node-shadow",children:s.jsx("feDropShadow",{dx:"0",dy:"2",stdDeviation:"4",floodColor:"rgba(0,0,0,0.4)"})}),e[21]=le):le=e[21];let re;e[22]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsxs("defs",{children:[te,se,le,s.jsx("filter",{id:"dep-node-glow",children:s.jsx("feDropShadow",{dx:"0",dy:"0",stdDeviation:"8",floodColor:"rgba(249,115,22,0.5)"})})]}),e[22]=re):re=e[22];let I;if(e[23]!==w||e[24]!==r||e[25]!==$||e[26]!==y||e[27]!==p){let E;e[29]!==r||e[30]!==$||e[31]!==y||e[32]!==p?(E=(d,F)=>{const T=p[d.from],D=p[d.to],z=T.x+y,H=T.y+$/2,Z=D.x,J=D.y+$/2,ne=z+(Z-z)*.4,O=Z-(Z-z)*.4,Y=r&&(r.id===d.from||r.id===d.to);return s.jsx("path",{d:`M ${z} ${H} C ${ne} ${H}, ${O} ${J}, ${Z} ${J}`,fill:"none",stroke:Y?"#f97316":"#4b5563",strokeWidth:Y?2.5:1.5,markerEnd:Y?"url(#dep-arrowhead-hl)":"url(#dep-arrowhead)",opacity:Y?1:.6,style:{transition:"all 0.2s ease"}},`edge-${F}`)},e[29]=r,e[30]=$,e[31]=y,e[32]=p,e[33]=E):E=e[33],I=w.map(E),e[23]=w,e[24]=r,e[25]=$,e[26]=y,e[27]=p,e[28]=I}else I=e[28];let q;if(e[34]!==r||e[35]!==g||e[36]!==$||e[37]!==y||e[38]!==i||e[39]!==p){let E;e[41]!==r||e[42]!==$||e[43]!==y||e[44]!==i||e[45]!==p?(E=d=>{const F=p[d.id];if(!F)return null;const T=Q(d),D=V[T]||V.pending,z=r&&r.id===d.id;return s.jsxs("g",{transform:`translate(${F.x}, ${F.y})`,style:{cursor:"pointer",transition:"transform 0.2s ease"},onMouseEnter:H=>m(d,H),onMouseLeave:_,onClick:()=>i(d),role:"button",tabIndex:0,onKeyDown:H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),i(d))},"aria-label":`Task: ${G(d.subject,40)}`,children:[s.jsx("rect",{width:y,height:$,rx:"10",ry:"10",fill:"rgba(17, 24, 39, 0.9)",stroke:z?"#f97316":D.fill,strokeWidth:z?2.5:1.5,filter:z?"url(#dep-node-glow)":"url(#dep-node-shadow)"}),s.jsx("rect",{x:"0",y:"0",width:"4",height:$,rx:"2",fill:D.fill}),s.jsx("text",{x:"14",y:"24",fill:"white",fontSize:"12",fontWeight:"600",fontFamily:"system-ui, -apple-system, sans-serif",children:G(d.subject,24)}),s.jsxs("text",{x:"14",y:"42",fill:"#9ca3af",fontSize:"10",fontFamily:"system-ui, -apple-system, sans-serif",children:[d._teamName?G(d._teamName,12):"",d._teamName&&d.owner?" / ":"",d.owner?G(d.owner,12):""]}),s.jsx("rect",{x:y-72,y:"6",width:"62",height:"18",rx:"9",fill:D.bg,stroke:D.border,strokeWidth:"0.5"}),s.jsx("text",{x:y-41,y:"18",fill:D.text,fontSize:"8",fontWeight:"700",textAnchor:"middle",fontFamily:"system-ui, -apple-system, sans-serif",children:D.label.toUpperCase()})]},d.id)},e[41]=r,e[42]=$,e[43]=y,e[44]=i,e[45]=p,e[46]=E):E=e[46],q=g.map(E),e[34]=r,e[35]=g,e[36]=$,e[37]=y,e[38]=i,e[39]=p,e[40]=q}else q=e[40];let U;e[47]!==xe||e[48]!==X||e[49]!==I||e[50]!==q||e[51]!==P||e[52]!==de?(U=s.jsxs("svg",{width:P,height:de,viewBox:xe,style:X,children:[re,I,q]}),e[47]=xe,e[48]=X,e[49]=I,e[50]=q,e[51]=P,e[52]=de,e[53]=U):U=e[53];let oe;return e[54]!==U||e[55]!==C?(oe=s.jsxs("div",{className:"relative overflow-x-auto overflow-y-auto custom-scrollbar dep-graph-container",ref:W,style:R,children:[C,U]}),e[54]=U,e[55]=C,e[56]=oe):oe=e[56],oe}),Ce=ce.memo(function({allTasks:t,onTaskClick:e}){const j=["in_progress","pending","blocked","completed"],i=K.useMemo(()=>{const b={};return j.forEach(u=>{b[u]=[]}),t.forEach(u=>{const m=Q(u);b[m]?b[m].push(u):b.pending.push(u)}),b},[t]),r=32,k=6,n=200,S=20,a=16,x=500;let h=0;j.forEach(b=>{i[b].length>0&&(h+=i[b].length+1)});const M=a*2+h*(r+k),o=n+S*2+x+40,W=b=>{switch(Q(b)){case"completed":return x;case"in_progress":return x*.6;case"pending":return x*.2;case"blocked":return x*.15;default:return x*.3}};let f=0;return s.jsx("div",{className:"overflow-x-auto overflow-y-auto custom-scrollbar",style:{maxHeight:"520px"},children:s.jsxs("svg",{width:Math.max(o,600),height:Math.max(M,100),viewBox:`0 0 ${Math.max(o,600)} ${Math.max(M,100)}`,style:{minWidth:o},children:[s.jsx("defs",{children:s.jsx("filter",{id:"gantt-bar-shadow",children:s.jsx("feDropShadow",{dx:"0",dy:"1",stdDeviation:"2",floodColor:"rgba(0,0,0,0.3)"})})}),j.map(b=>{const u=i[b];if(u.length===0)return null;const m=V[b],B=a+f*(r+k);f++;const _=u.map((g,p)=>{const w=a+f*(r+k);f++;const v=W(g);return s.jsxs("g",{style:{cursor:"pointer"},onClick:()=>e(g),role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),e(g))},"aria-label":`Task: ${G(g.subject,40)}`,children:[s.jsx("rect",{x:"0",y:w-2,width:o,height:r+4,rx:"4",fill:"transparent",onMouseEnter:c=>{c.currentTarget.setAttribute("fill","rgba(255,255,255,0.03)")},onMouseLeave:c=>{c.currentTarget.setAttribute("fill","transparent")}}),s.jsx("text",{x:S,y:w+r/2+4,fill:"#d1d5db",fontSize:"11",fontFamily:"system-ui, -apple-system, sans-serif",fontWeight:"500",children:G(g.subject,28)}),g.owner&&s.jsx("text",{x:S+n-10,y:w+r/2+4,fill:"#6b7280",fontSize:"9",fontFamily:"system-ui, -apple-system, sans-serif",textAnchor:"end",children:G(g.owner,14)}),s.jsx("rect",{x:n+S,y:w+4,width:v,height:r-8,rx:"6",fill:m.barFill,stroke:m.fill,strokeWidth:"0.5",filter:"url(#gantt-bar-shadow)",onMouseEnter:c=>{c.currentTarget.setAttribute("fill",m.fill),c.currentTarget.setAttribute("stroke-width","1.5")},onMouseLeave:c=>{c.currentTarget.setAttribute("fill",m.barFill),c.currentTarget.setAttribute("stroke-width","0.5")}}),s.jsx("text",{x:n+S+8,y:w+r/2+3,fill:"white",fontSize:"10",fontWeight:"600",fontFamily:"system-ui, -apple-system, sans-serif",children:G(g.subject,20)})]},g.id||p)});return s.jsxs("g",{children:[s.jsx("rect",{x:"0",y:B-2,width:o,height:r+4,fill:m.bg,rx:"6"}),s.jsx("circle",{cx:S+6,cy:B+r/2,r:"4",fill:m.fill}),s.jsxs("text",{x:S+18,y:B+r/2+4,fill:m.text,fontSize:"12",fontWeight:"700",fontFamily:"system-ui, -apple-system, sans-serif",children:[m.label," (",u.length,")"]}),_]},b)}),s.jsx("line",{x1:n+S,y1:a-4,x2:n+S,y2:M-a,stroke:"rgba(75, 85, 99, 0.3)",strokeWidth:"1",strokeDasharray:"4,4"})]})})}),Ee=ce.memo(function(t){const e=ee.c(39),{teams:j}=t,[i,r]=K.useState("board"),[k,n]=K.useState(null);let S;e[0]!==j?(S=j.flatMap(Fe),e[0]=j,e[1]=S):S=e[1];const a=S;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=C=>{n(C)},e[2]=x):x=e[2];const h=x;if(a.length===0){let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={background:"linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%)",border:"1px dashed rgba(156, 163, 175, 0.3)"},e[3]=C):C=e[3];let P;return e[4]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsxs("div",{className:"rounded-2xl p-8 text-center mt-6",style:C,children:[s.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#4b5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"mx-auto mb-3 opacity-50",children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]}),s.jsx("p",{className:"text-gray-400 text-sm",children:"No tasks to display"})]}),e[4]=P):P=e[4],P}let M;e[5]===Symbol.for("react.memo_cache_sentinel")?(M={background:"linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%)",border:"1px solid rgba(75, 85, 99, 0.3)"},e[5]=M):M=e[5];let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={borderBottom:"1px solid rgba(75, 85, 99, 0.3)"},e[6]=o):o=e[6];let W,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#f97316",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),s.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"}),s.jsx("path",{d:"M10 6.5h4"}),s.jsx("path",{d:"M6.5 10v4"}),s.jsx("path",{d:"M17.5 10v4"})]}),f=s.jsx("h3",{className:"text-lg font-bold text-white",children:"Task Dependency Graph"}),e[7]=W,e[8]=f):(W=e[7],f=e[8]);let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b={background:"rgba(75, 85, 99, 0.3)"},e[9]=b):b=e[9];const u=a.length!==1?"s":"";let m;e[10]!==a.length||e[11]!==u?(m=s.jsxs("div",{className:"flex items-center gap-3",children:[W,f,s.jsxs("span",{className:"text-xs text-gray-400 font-medium px-2 py-0.5 rounded-full",style:b,children:[a.length," task",u]})]}),e[10]=a.length,e[11]=u,e[12]=m):m=e[12];let B,_;e[13]===Symbol.for("react.memo_cache_sentinel")?(B={background:"rgba(17, 24, 39, 0.5)"},_=[{key:"board",label:"Status Board"},{key:"graph",label:"Dependency Graph"},{key:"gantt",label:"Gantt View"}],e[13]=B,e[14]=_):(B=e[13],_=e[14]);let g;e[15]!==i?(g=s.jsx("div",{className:"flex gap-1 p-1 rounded-lg",style:B,children:_.map(C=>s.jsx("button",{onClick:()=>r(C.key),className:"px-3 py-1.5 rounded-md text-xs font-semibold transition-all duration-200",style:{background:i===C.key?"rgba(249, 115, 22, 0.2)":"transparent",color:i===C.key?"#fb923c":"#9ca3af",border:i===C.key?"1px solid rgba(249, 115, 22, 0.4)":"1px solid transparent"},"aria-label":`Switch to ${C.label} view`,"aria-pressed":i===C.key,children:C.label},C.key))}),e[15]=i,e[16]=g):g=e[16];let p;e[17]!==g||e[18]!==m?(p=s.jsxs("div",{className:"px-5 py-4 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",style:o,children:[m,g]}),e[17]=g,e[18]=m,e[19]=p):p=e[19];let w;e[20]!==a||e[21]!==i?(w=i==="board"&&s.jsx($e,{allTasks:a,onTaskClick:h}),e[20]=a,e[21]=i,e[22]=w):w=e[22];let v;e[23]!==a||e[24]!==i?(v=i==="graph"&&s.jsx(We,{allTasks:a,onTaskClick:h}),e[23]=a,e[24]=i,e[25]=v):v=e[25];let c;e[26]!==a||e[27]!==i?(c=i==="gantt"&&s.jsx(Ce,{allTasks:a,onTaskClick:h}),e[26]=a,e[27]=i,e[28]=c):c=e[28];let y;e[29]!==w||e[30]!==v||e[31]!==c?(y=s.jsxs("div",{className:"p-5",children:[w,v,c]}),e[29]=w,e[30]=v,e[31]=c,e[32]=y):y=e[32];let $;e[33]!==k?($=k&&s.jsx(we,{task:k,onClose:()=>n(null)}),e[33]=k,e[34]=$):$=e[34];let R;return e[35]!==p||e[36]!==y||e[37]!==$?(R=s.jsxs("div",{className:"rounded-2xl mt-6 overflow-hidden",style:M,children:[p,y,$]}),e[35]=p,e[36]=y,e[37]=$,e[38]=R):R=e[38],R});Ee.propTypes={teams:A.arrayOf(A.shape({name:A.string.isRequired,tasks:A.arrayOf(A.shape({id:A.string,subject:A.string,description:A.string,status:A.string,owner:A.string,blockedBy:A.array,blocks:A.array}))})).isRequired};function _e(l){l.currentTarget.style.borderColor="rgba(75, 85, 99, 0.3)",l.currentTarget.style.boxShadow="none"}function De(l){return l.blockedBy&&l.blockedBy.length>0||l.blocks&&l.blocks.length>0}function He(l){return!l.blockedBy||l.blockedBy.length===0}function Le(l){return{id:l.id,depth:0}}function Re(l,t){return l-t}function Fe(l){return(l.tasks||[]).map(t=>({...t,_teamName:l.name}))}export{Ee as TaskDependencyGraph};
|