@cosmicstack/mercury-agent 1.1.7 → 1.1.11
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/README.md +137 -3
- package/README.zh-CN.md +265 -140
- package/dist/index.js +13191 -4776
- package/dist/index.js.map +1 -1
- package/dist/web/static/vendor/geist/Geist-Italic[wght].woff2 +0 -0
- package/dist/web/static/vendor/geist/Geist-Variable.woff2 +0 -0
- package/dist/web/static/vendor/geist/GeistMono-Italic[wght].woff2 +0 -0
- package/dist/web/static/vendor/geist/GeistMono-Variable.woff2 +0 -0
- package/dist/web/static/vendor/graphology.min.js +2 -0
- package/dist/web/static/vendor/icons.svg +108 -0
- package/dist/web/static/vendor/sql-wasm.wasm +0 -0
- package/dist/web/ui/assets/Chat-DXSn2dY8.js +28 -0
- package/dist/web/ui/assets/Chat-DXSn2dY8.js.map +1 -0
- package/dist/web/ui/assets/Dashboard-1rlAqQ-Y.js +2 -0
- package/dist/web/ui/assets/Dashboard-1rlAqQ-Y.js.map +1 -0
- package/dist/web/ui/assets/Goals-CgSUAXLH.js +12 -0
- package/dist/web/ui/assets/Goals-CgSUAXLH.js.map +1 -0
- package/dist/web/ui/assets/Graph-DnlOWkay.js +7 -0
- package/dist/web/ui/assets/Graph-DnlOWkay.js.map +1 -0
- package/dist/web/ui/assets/Kanban-DRlNiNRF.js +45 -0
- package/dist/web/ui/assets/Kanban-DRlNiNRF.js.map +1 -0
- package/dist/web/ui/assets/Login-BP5524pC.js +2 -0
- package/dist/web/ui/assets/Login-BP5524pC.js.map +1 -0
- package/dist/web/ui/assets/MarkdownRenderer-B9KGVD0X.js +22 -0
- package/dist/web/ui/assets/MarkdownRenderer-B9KGVD0X.js.map +1 -0
- package/dist/web/ui/assets/Memory-BOQEY0H8.js +12 -0
- package/dist/web/ui/assets/Memory-BOQEY0H8.js.map +1 -0
- package/dist/web/ui/assets/Permissions-jbFH-toa.js +17 -0
- package/dist/web/ui/assets/Permissions-jbFH-toa.js.map +1 -0
- package/dist/web/ui/assets/PersonDetail-Ca8B9io8.js +2 -0
- package/dist/web/ui/assets/PersonDetail-Ca8B9io8.js.map +1 -0
- package/dist/web/ui/assets/Persons-epdmUeBM.js +2 -0
- package/dist/web/ui/assets/Persons-epdmUeBM.js.map +1 -0
- package/dist/web/ui/assets/Providers-Bm8sZNZo.js +7 -0
- package/dist/web/ui/assets/Providers-Bm8sZNZo.js.map +1 -0
- package/dist/web/ui/assets/Schedules-BZKhm9R7.js +17 -0
- package/dist/web/ui/assets/Schedules-BZKhm9R7.js.map +1 -0
- package/dist/web/ui/assets/Settings-Hii-5oku.js +12 -0
- package/dist/web/ui/assets/Settings-Hii-5oku.js.map +1 -0
- package/dist/web/ui/assets/Skills-BHJp2CgD.js +17 -0
- package/dist/web/ui/assets/Skills-BHJp2CgD.js.map +1 -0
- package/dist/web/ui/assets/Tasks-D36pqkro.js +7 -0
- package/dist/web/ui/assets/Tasks-D36pqkro.js.map +1 -0
- package/dist/web/ui/assets/Usage-CmjaYrsT.js +12 -0
- package/dist/web/ui/assets/Usage-CmjaYrsT.js.map +1 -0
- package/dist/web/ui/assets/Workspace-BYLf-wTJ.js +52 -0
- package/dist/web/ui/assets/Workspace-BYLf-wTJ.js.map +1 -0
- package/dist/web/ui/assets/activity-MOTqH8zM.js +7 -0
- package/dist/web/ui/assets/activity-MOTqH8zM.js.map +1 -0
- package/dist/web/ui/assets/alert-dialog-MbYSbZx5.js +7 -0
- package/dist/web/ui/assets/alert-dialog-MbYSbZx5.js.map +1 -0
- package/dist/web/ui/assets/arrow-left-CtqQsBC6.js +7 -0
- package/dist/web/ui/assets/arrow-left-CtqQsBC6.js.map +1 -0
- package/dist/web/ui/assets/avatar-BIYaY7pR.js +7 -0
- package/dist/web/ui/assets/avatar-BIYaY7pR.js.map +1 -0
- package/dist/web/ui/assets/badge-CUJiWF1y.js +2 -0
- package/dist/web/ui/assets/badge-CUJiWF1y.js.map +1 -0
- package/dist/web/ui/assets/button-CNasMlFE.js +2 -0
- package/dist/web/ui/assets/button-CNasMlFE.js.map +1 -0
- package/dist/web/ui/assets/card-BdsEOP7t.js +2 -0
- package/dist/web/ui/assets/card-BdsEOP7t.js.map +1 -0
- package/dist/web/ui/assets/chevron-down-CB9J_vvZ.js +12 -0
- package/dist/web/ui/assets/chevron-down-CB9J_vvZ.js.map +1 -0
- package/dist/web/ui/assets/circle-check-DvGSe1uZ.js +7 -0
- package/dist/web/ui/assets/circle-check-DvGSe1uZ.js.map +1 -0
- package/dist/web/ui/assets/circle-x-CyaGJ_BM.js +7 -0
- package/dist/web/ui/assets/circle-x-CyaGJ_BM.js.map +1 -0
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js +2 -0
- package/dist/web/ui/assets/collapsible-BU_K9n8f.js.map +1 -0
- package/dist/web/ui/assets/dialog-Bd1rELXb.js +2 -0
- package/dist/web/ui/assets/dialog-Bd1rELXb.js.map +1 -0
- package/dist/web/ui/assets/download-C8RvlFqO.js +7 -0
- package/dist/web/ui/assets/download-C8RvlFqO.js.map +1 -0
- package/dist/web/ui/assets/eye-BJ0NucMz.js +7 -0
- package/dist/web/ui/assets/eye-BJ0NucMz.js.map +1 -0
- package/dist/web/ui/assets/file-text-BWWBuD_N.js +7 -0
- package/dist/web/ui/assets/file-text-BWWBuD_N.js.map +1 -0
- package/dist/web/ui/assets/folder-open-BwjemFy7.js +7 -0
- package/dist/web/ui/assets/folder-open-BwjemFy7.js.map +1 -0
- package/dist/web/ui/assets/git-branch-D9JVASpC.js +7 -0
- package/dist/web/ui/assets/git-branch-D9JVASpC.js.map +1 -0
- package/dist/web/ui/assets/index-C3YiF4qv.js +163 -0
- package/dist/web/ui/assets/index-C3YiF4qv.js.map +1 -0
- package/dist/web/ui/assets/index-CaqLZNof.js +2 -0
- package/dist/web/ui/assets/index-CaqLZNof.js.map +1 -0
- package/dist/web/ui/assets/index-CuhiuVab.css +1 -0
- package/dist/web/ui/assets/input-CH3dmo9r.js +2 -0
- package/dist/web/ui/assets/input-CH3dmo9r.js.map +1 -0
- package/dist/web/ui/assets/loader-circle-DbYKk0_Q.js +7 -0
- package/dist/web/ui/assets/loader-circle-DbYKk0_Q.js.map +1 -0
- package/dist/web/ui/assets/pencil-gNDEMhav.js +7 -0
- package/dist/web/ui/assets/pencil-gNDEMhav.js.map +1 -0
- package/dist/web/ui/assets/plus-7rbHkByr.js +7 -0
- package/dist/web/ui/assets/plus-7rbHkByr.js.map +1 -0
- package/dist/web/ui/assets/power-BS7gCDWs.js +12 -0
- package/dist/web/ui/assets/power-BS7gCDWs.js.map +1 -0
- package/dist/web/ui/assets/progress-ZzhsBV2v.js +2 -0
- package/dist/web/ui/assets/progress-ZzhsBV2v.js.map +1 -0
- package/dist/web/ui/assets/search-BZsbhO0B.js +7 -0
- package/dist/web/ui/assets/search-BZsbhO0B.js.map +1 -0
- package/dist/web/ui/assets/select-vRSgBrHz.js +2 -0
- package/dist/web/ui/assets/select-vRSgBrHz.js.map +1 -0
- package/dist/web/ui/assets/send-BkyTIUtJ.js +7 -0
- package/dist/web/ui/assets/send-BkyTIUtJ.js.map +1 -0
- package/dist/web/ui/assets/sparkles-DcP24GEL.js +7 -0
- package/dist/web/ui/assets/sparkles-DcP24GEL.js.map +1 -0
- package/dist/web/ui/assets/switch-LRN9wWy2.js +2 -0
- package/dist/web/ui/assets/switch-LRN9wWy2.js.map +1 -0
- package/dist/web/ui/assets/terminal-CWG62zdD.js +7 -0
- package/dist/web/ui/assets/terminal-CWG62zdD.js.map +1 -0
- package/dist/web/ui/assets/textarea-CXh3tmJ1.js +2 -0
- package/dist/web/ui/assets/textarea-CXh3tmJ1.js.map +1 -0
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js +6 -0
- package/dist/web/ui/assets/vendor-dnd-DRBSMxXo.js.map +1 -0
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js +30 -0
- package/dist/web/ui/assets/vendor-markdown-DwTbvico.js.map +1 -0
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js +18 -0
- package/dist/web/ui/assets/vendor-motion-Dwx3-JO5.js.map +1 -0
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js +65 -0
- package/dist/web/ui/assets/vendor-radix-3UdfCgs_.js.map +1 -0
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js +44 -0
- package/dist/web/ui/assets/vendor-react-C7pctHW3.js.map +1 -0
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js +17 -0
- package/dist/web/ui/assets/vendor-syntax-xZUI6Op9.js.map +1 -0
- package/dist/web/ui/assets/zap-BEfqVtvZ.js +7 -0
- package/dist/web/ui/assets/zap-BEfqVtvZ.js.map +1 -0
- package/dist/web/ui/favicon.svg +10 -0
- package/dist/web/ui/icons/icon-192.svg +10 -0
- package/dist/web/ui/icons/icon-512-maskable.svg +10 -0
- package/dist/web/ui/icons/icon-512.svg +10 -0
- package/dist/web/ui/index.html +24 -0
- package/dist/web/ui/logo-dark.png +0 -0
- package/dist/web/ui/logo-full-dark.png +0 -0
- package/dist/web/ui/logo-full-light.png +0 -0
- package/dist/web/ui/logo-light.png +0 -0
- package/dist/web/ui/manifest.webmanifest +1 -0
- package/dist/web/ui/registerSW.js +1 -0
- package/dist/web/ui/sw.js +11 -0
- package/package.json +17 -7
- package/src/web/static/vendor/geist/Geist-Italic[wght].woff2 +0 -0
- package/src/web/static/vendor/geist/Geist-Variable.woff2 +0 -0
- package/src/web/static/vendor/geist/GeistMono-Italic[wght].woff2 +0 -0
- package/src/web/static/vendor/geist/GeistMono-Variable.woff2 +0 -0
- package/src/web/static/vendor/graphology.min.js +2 -0
- package/src/web/static/vendor/icons.svg +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Graph-DnlOWkay.js","sources":["../../node_modules/lucide-react/dist/esm/icons/network.js","../../src/pages/brain/Graph.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.511.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { x: \"16\", y: \"16\", width: \"6\", height: \"6\", rx: \"1\", key: \"4q2zg0\" }],\n [\"rect\", { x: \"2\", y: \"16\", width: \"6\", height: \"6\", rx: \"1\", key: \"8cvhb9\" }],\n [\"rect\", { x: \"9\", y: \"2\", width: \"6\", height: \"6\", rx: \"1\", key: \"1egb70\" }],\n [\"path\", { d: \"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3\", key: \"1jsf9p\" }],\n [\"path\", { d: \"M12 12V8\", key: \"2874zd\" }]\n];\nconst Network = createLucideIcon(\"network\", __iconNode);\n\nexport { __iconNode, Network as default };\n//# sourceMappingURL=network.js.map\n","import { useEffect, useRef, useState, useCallback } from \"react\";\nimport { Network, Search, Loader2 } from \"lucide-react\";\nimport api, { type GraphNode, type GraphEdge, type Memory } from \"@/lib/api\";\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\";\n\n// ── Node type color map ──\nconst TYPE_COLORS: Record<string, string> = {\n fact: \"#3b82f6\",\n preference: \"#a78bfa\",\n experience: \"#22c55e\",\n goal: \"#f59e0b\",\n project: \"#00d4ff\",\n person: \"#ec4899\",\n skill: \"#6366f1\",\n belief: \"#f97316\",\n observation: \"#14b8a6\",\n default: \"#6b7280\",\n};\n\nfunction getTypeColor(type: string): string {\n return TYPE_COLORS[type] || TYPE_COLORS.default;\n}\n\n// ── Internal layout types ──\ninterface NodePos {\n x: number;\n y: number;\n}\n\ninterface NodeVelocity {\n seed: number;\n freq: number;\n amp: number;\n}\n\ninterface TooltipInfo {\n x: number;\n y: number;\n node: GraphNode;\n connections: number;\n}\n\nfunction isDarkMode(): boolean {\n return (\n document.documentElement.classList.contains(\"dark\") ||\n document.documentElement.getAttribute(\"data-theme\") !== \"light\"\n );\n}\n\nexport function GraphPage() {\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const [loading, setLoading] = useState(true);\n const [nodes, setNodes] = useState<GraphNode[]>([]);\n const [edges, setEdges] = useState<GraphEdge[]>([]);\n const [searchQuery, setSearchQuery] = useState(\"\");\n const [tooltip, setTooltip] = useState<TooltipInfo | null>(null);\n\n // Detail dialog state — opens on single-click of a node.\n const [detailOpen, setDetailOpen] = useState(false);\n const [detailNode, setDetailNode] = useState<GraphNode | null>(null);\n const [detailMemory, setDetailMemory] = useState<Memory | null>(null);\n const [detailLoading, setDetailLoading] = useState(false);\n const [detailError, setDetailError] = useState<string | null>(null);\n\n // Mutable refs for canvas state (avoid re-renders during animation)\n const stateRef = useRef({\n nodes: [] as GraphNode[],\n edges: [] as GraphEdge[],\n positions: new Map<string, NodePos>(),\n anchors: new Map<string, NodePos>(),\n velocities: new Map<string, NodeVelocity>(),\n pan: { x: 0, y: 0 },\n zoom: 1,\n dragging: false,\n dragNode: null as GraphNode | null,\n hoveredNode: null as GraphNode | null,\n selectedNode: null as GraphNode | null,\n lastMouse: { x: 0, y: 0 },\n // Press tracking — used to distinguish a click from a drag.\n pressNode: null as GraphNode | null,\n pressX: 0,\n pressY: 0,\n pressT: 0,\n moved: false,\n searchQuery: \"\",\n animFrame: 0,\n dpr: 1,\n });\n\n // Keep searchQuery in sync with ref\n useEffect(() => {\n stateRef.current.searchQuery = searchQuery;\n }, [searchQuery]);\n\n // ── Connection count helper ──\n const connectionCount = useCallback((nodeId: string, edgeList: GraphEdge[]) => {\n let count = 0;\n for (const e of edgeList) {\n if (e.source === nodeId || e.target === nodeId) count++;\n }\n return count;\n }, []);\n\n // ── Init positions in a circle ──\n const initPositions = useCallback(\n (nodeList: GraphNode[], canvasW: number, canvasH: number) => {\n const s = stateRef.current;\n const cx = canvasW / 2;\n const cy = canvasH / 2;\n s.positions.clear();\n s.anchors.clear();\n s.velocities.clear();\n\n nodeList.forEach((node, i) => {\n const angle = (i / nodeList.length) * Math.PI * 2;\n const r = 150 + Math.random() * 100;\n const x = cx + r * Math.cos(angle);\n const y = cy + r * Math.sin(angle);\n s.positions.set(node.id, { x, y });\n s.anchors.set(node.id, { x, y });\n s.velocities.set(node.id, {\n seed: Math.random(),\n freq: 0.00009 + Math.random() * 0.00007,\n amp: 0.25 + Math.random() * 0.25,\n });\n });\n },\n []\n );\n\n // ── Force-directed layout (80 iterations) ──\n const runLayout = useCallback(\n (nodeList: GraphNode[], edgeList: GraphEdge[], w: number, h: number) => {\n const s = stateRef.current;\n const iters = 80;\n\n for (let iter = 0; iter < iters; iter++) {\n const area = w * h;\n const k = Math.sqrt(area / Math.max(1, nodeList.length));\n const repForce = k * k;\n const attForce = 0.01;\n const forces = new Map<string, { fx: number; fy: number }>();\n nodeList.forEach((n) => forces.set(n.id, { fx: 0, fy: 0 }));\n\n // Repulsion (Coulomb)\n for (let i = 0; i < nodeList.length; i++) {\n for (let j = i + 1; j < nodeList.length; j++) {\n const pi = s.positions.get(nodeList[i].id);\n const pj = s.positions.get(nodeList[j].id);\n if (!pi || !pj) continue;\n const dx = pi.x - pj.x;\n const dy = pi.y - pj.y;\n const dist = Math.max(Math.sqrt(dx * dx + dy * dy), 1);\n const f = repForce / (dist * dist);\n const fx = (dx / dist) * f;\n const fy = (dy / dist) * f;\n forces.get(nodeList[i].id)!.fx += fx;\n forces.get(nodeList[i].id)!.fy += fy;\n forces.get(nodeList[j].id)!.fx -= fx;\n forces.get(nodeList[j].id)!.fy -= fy;\n }\n }\n\n // Attraction (Hooke) along edges\n edgeList.forEach((e) => {\n const ps = s.positions.get(e.source);\n const pt = s.positions.get(e.target);\n if (!ps || !pt) return;\n const dx = pt.x - ps.x;\n const dy = pt.y - ps.y;\n const fs = forces.get(e.source);\n const ft = forces.get(e.target);\n if (fs) {\n fs.fx += dx * attForce;\n fs.fy += dy * attForce;\n }\n if (ft) {\n ft.fx -= dx * attForce;\n ft.fy -= dy * attForce;\n }\n });\n\n // Center gravity\n const cx = w / 2;\n const cy = h / 2;\n const gravity = 0.001;\n nodeList.forEach((n) => {\n const p = s.positions.get(n.id);\n const f = forces.get(n.id);\n if (!p || !f) return;\n f.fx += (cx - p.x) * gravity;\n f.fy += (cy - p.y) * gravity;\n });\n\n // Apply with damping\n const damp = 0.1;\n nodeList.forEach((n) => {\n const f = forces.get(n.id);\n const p = s.positions.get(n.id);\n if (!f || !p) return;\n p.x += f.fx * damp;\n p.y += f.fy * damp;\n });\n }\n\n // Sync anchors\n nodeList.forEach((n) => {\n const p = s.positions.get(n.id);\n const a = s.anchors.get(n.id);\n if (p && a) {\n a.x = p.x;\n a.y = p.y;\n }\n });\n },\n []\n );\n\n // ── Resize canvas with DPR ──\n const resizeCanvas = useCallback(() => {\n const canvas = canvasRef.current;\n const container = containerRef.current;\n if (!canvas || !container) return;\n\n const dpr = window.devicePixelRatio || 1;\n stateRef.current.dpr = dpr;\n const w = container.clientWidth;\n const h = container.clientHeight;\n canvas.width = w * dpr;\n canvas.height = h * dpr;\n canvas.style.width = `${w}px`;\n canvas.style.height = `${h}px`;\n }, []);\n\n // ── Screen → graph coordinate transform ──\n const screenToGraph = useCallback(\n (sx: number, sy: number): { x: number; y: number } => {\n const s = stateRef.current;\n const dpr = s.dpr;\n return {\n x: (sx * dpr - s.pan.x) / s.zoom,\n y: (sy * dpr - s.pan.y) / s.zoom,\n };\n },\n []\n );\n\n // ── Hit test ──\n const findNodeAt = useCallback(\n (gx: number, gy: number): GraphNode | null => {\n const s = stateRef.current;\n for (let i = s.nodes.length - 1; i >= 0; i--) {\n const n = s.nodes[i];\n const p = s.positions.get(n.id);\n if (!p) continue;\n const r = (n.size || 8) * 1.5;\n const dx = gx - p.x;\n const dy = gy - p.y;\n if (dx * dx + dy * dy < r * r) return n;\n }\n return null;\n },\n []\n );\n\n // ── Draw ──\n const draw = useCallback((ts: number) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n\n const s = stateRef.current;\n const dpr = s.dpr;\n const w = canvas.width;\n const h = canvas.height;\n const dark = isDarkMode();\n\n ctx.clearRect(0, 0, w, h);\n\n // Background\n ctx.fillStyle = dark ? \"#0a0e14\" : \"#ffffff\";\n ctx.fillRect(0, 0, w, h);\n\n ctx.save();\n ctx.translate(s.pan.x, s.pan.y);\n ctx.scale(s.zoom, s.zoom);\n\n // Focus neighborhood\n const focus = s.hoveredNode || s.selectedNode;\n const neighbors = new Set<string>();\n const activeEdgeIdx = new Set<number>();\n if (focus) {\n s.edges.forEach((e, i) => {\n if (e.source === focus.id) {\n neighbors.add(e.target);\n activeEdgeIdx.add(i);\n }\n if (e.target === focus.id) {\n neighbors.add(e.source);\n activeEdgeIdx.add(i);\n }\n });\n neighbors.add(focus.id);\n }\n\n // ── Edges ──\n s.edges.forEach((e, i) => {\n const ps = s.positions.get(e.source);\n const pt = s.positions.get(e.target);\n if (!ps || !pt) return;\n\n const active = activeEdgeIdx.has(i);\n if (active) {\n ctx.strokeStyle = dark\n ? \"rgba(0,212,255,0.7)\"\n : \"rgba(0,136,170,0.6)\";\n ctx.lineWidth = (2 * dpr) / s.zoom;\n } else if (focus) {\n ctx.strokeStyle = dark\n ? \"rgba(0,212,255,0.06)\"\n : \"rgba(0,136,170,0.05)\";\n ctx.lineWidth = (0.6 * dpr) / s.zoom;\n } else {\n const pulse = (Math.sin(ts * 0.00022 + i * 1.3) + 1) * 0.5;\n const alpha = (dark ? 0.16 : 0.13) + pulse * 0.06;\n ctx.strokeStyle = dark\n ? `rgba(0,212,255,${alpha.toFixed(3)})`\n : `rgba(0,136,170,${alpha.toFixed(3)})`;\n ctx.lineWidth = ((0.7 + pulse * 0.3) * dpr) / s.zoom;\n }\n\n ctx.beginPath();\n ctx.moveTo(ps.x, ps.y);\n ctx.lineTo(pt.x, pt.y);\n ctx.stroke();\n });\n\n // ── Nodes ──\n const searchQ = s.searchQuery.toLowerCase();\n\n s.nodes.forEach((n) => {\n const p = s.positions.get(n.id);\n if (!p) return;\n\n const isHovered = s.hoveredNode?.id === n.id;\n const isSelected = s.selectedNode?.id === n.id;\n const isNeighbor = neighbors.has(n.id);\n\n const v = s.velocities.get(n.id);\n const breathe =\n 1 + Math.sin(ts * 0.00035 + (v?.seed ?? 0) * 11.7) * 0.01;\n const baseR = (n.size || 8) * dpr;\n const r = baseR * (isHovered || isSelected ? 1.4 : breathe);\n\n // Alpha based on search / focus\n let alpha = 1;\n if (searchQ) {\n const hay = (n.fullLabel || n.label).toLowerCase();\n alpha = hay.includes(searchQ) ? 1 : 0.12;\n } else if (focus) {\n alpha = isHovered || isSelected || isNeighbor ? 1 : 0.18;\n }\n ctx.globalAlpha = alpha;\n\n // Glow\n if (isHovered || isSelected) {\n ctx.beginPath();\n ctx.arc(p.x, p.y, r + (5 * dpr) / s.zoom, 0, Math.PI * 2);\n ctx.fillStyle = dark\n ? \"rgba(0,212,255,0.14)\"\n : \"rgba(0,136,170,0.12)\";\n ctx.fill();\n }\n\n // Node circle\n ctx.beginPath();\n ctx.arc(p.x, p.y, r, 0, Math.PI * 2);\n ctx.fillStyle = getTypeColor(n.type);\n ctx.fill();\n\n // Stroke\n if (isHovered || isSelected) {\n ctx.strokeStyle = dark ? \"#f0f0f0\" : \"#1a1a1a\";\n ctx.lineWidth = (2 * dpr) / s.zoom;\n ctx.stroke();\n } else if (isNeighbor && focus) {\n ctx.strokeStyle = dark\n ? \"rgba(0,212,255,0.65)\"\n : \"rgba(0,136,170,0.55)\";\n ctx.lineWidth = (1.8 * dpr) / s.zoom;\n ctx.stroke();\n }\n\n // Label — only for hovered / selected node. Keep it short (truncated `label`)\n // since the full text is shown in the tooltip / detail dialog instead.\n // This keeps the canvas clean and readable.\n if (isHovered || isSelected) {\n const fontSize = Math.max(10 * dpr, (11 * dpr) / s.zoom);\n ctx.font = `${fontSize}px -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif`;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"top\";\n\n // Background pill for legibility\n const text = n.label;\n const metrics = ctx.measureText(text);\n const padX = 6 * dpr;\n const padY = 3 * dpr;\n const bx = p.x - metrics.width / 2 - padX;\n const by = p.y + r + 4 * dpr;\n const bw = metrics.width + padX * 2;\n const bh = fontSize + padY * 2;\n ctx.fillStyle = dark ? \"rgba(10,14,20,0.92)\" : \"rgba(255,255,255,0.95)\";\n ctx.beginPath();\n ctx.roundRect?.(bx, by, bw, bh, 4 * dpr);\n ctx.fill();\n\n ctx.fillStyle = dark\n ? `rgba(240,240,240,${alpha})`\n : `rgba(20,20,20,${alpha})`;\n ctx.fillText(text, p.x, by + padY);\n }\n\n ctx.globalAlpha = 1;\n });\n\n ctx.restore();\n }, []);\n\n // ── Motion update (breathing drift) ──\n const updateMotion = useCallback((ts: number) => {\n const s = stateRef.current;\n s.nodes.forEach((n) => {\n if (s.dragNode?.id === n.id) return;\n const p = s.positions.get(n.id);\n const a = s.anchors.get(n.id);\n const v = s.velocities.get(n.id);\n if (!p || !a || !v) return;\n p.x = a.x + Math.sin(ts * v.freq + v.seed * 11.1) * v.amp;\n p.y = a.y + Math.cos(ts * v.freq * 0.87 + v.seed * 17.3) * v.amp;\n });\n }, []);\n\n // ── Open detail dialog for a node (fetches full memory record) ──\n const openNodeDetail = useCallback(async (node: GraphNode) => {\n setDetailNode(node);\n setDetailMemory(null);\n setDetailError(null);\n setDetailOpen(true);\n setDetailLoading(true);\n stateRef.current.selectedNode = node;\n try {\n const mem = await api.brain.memory.get(node.id);\n setDetailMemory(mem);\n } catch (err) {\n // Not every node has a backing memory record (graph may include\n // person / goal aggregates) — fall back gracefully to node-only info.\n setDetailError(\n err instanceof Error ? err.message : \"Failed to load details\"\n );\n } finally {\n setDetailLoading(false);\n }\n }, []);\n\n // ── Mouse handlers ──\n const onMouseDown = useCallback(\n (e: MouseEvent) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n const sx = e.clientX - rect.left;\n const sy = e.clientY - rect.top;\n const gp = screenToGraph(sx, sy);\n const node = findNodeAt(gp.x, gp.y);\n const s = stateRef.current;\n\n s.pressNode = node;\n s.pressX = e.clientX;\n s.pressY = e.clientY;\n s.pressT = performance.now();\n s.moved = false;\n\n if (node) {\n s.dragNode = node;\n } else {\n s.dragging = true;\n }\n s.lastMouse = { x: e.clientX, y: e.clientY };\n },\n [screenToGraph, findNodeAt]\n );\n\n const onMouseMove = useCallback(\n (e: MouseEvent) => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n const sx = e.clientX - rect.left;\n const sy = e.clientY - rect.top;\n const s = stateRef.current;\n\n // Track whether the mouse has moved meaningfully since press.\n // 4px threshold lets micro-jitter still count as a click.\n if (s.pressT && !s.moved) {\n const ddx = e.clientX - s.pressX;\n const ddy = e.clientY - s.pressY;\n if (ddx * ddx + ddy * ddy > 16) s.moved = true;\n }\n\n if (s.dragNode) {\n const gp = screenToGraph(sx, sy);\n const p = s.positions.get(s.dragNode.id);\n const a = s.anchors.get(s.dragNode.id);\n if (p) {\n p.x = gp.x;\n p.y = gp.y;\n }\n if (a) {\n a.x = gp.x;\n a.y = gp.y;\n }\n } else if (s.dragging) {\n const dpr = s.dpr;\n s.pan.x += (e.clientX - s.lastMouse.x) * dpr;\n s.pan.y += (e.clientY - s.lastMouse.y) * dpr;\n } else {\n const gp = screenToGraph(sx, sy);\n const node = findNodeAt(gp.x, gp.y);\n if (node !== s.hoveredNode) {\n s.hoveredNode = node;\n if (node) {\n setTooltip({\n x: e.clientX - rect.left + 14,\n y: e.clientY - rect.top + 14,\n node,\n connections: connectionCount(node.id, s.edges),\n });\n } else {\n setTooltip(null);\n }\n } else if (node && tooltip) {\n setTooltip((prev) =>\n prev\n ? {\n ...prev,\n x: e.clientX - rect.left + 14,\n y: e.clientY - rect.top + 14,\n }\n : null\n );\n }\n }\n s.lastMouse = { x: e.clientX, y: e.clientY };\n },\n [screenToGraph, findNodeAt, connectionCount, tooltip]\n );\n\n const onMouseUp = useCallback(() => {\n const s = stateRef.current;\n const wasClick =\n !s.moved &&\n s.pressNode !== null &&\n performance.now() - s.pressT < 500;\n const clickedNode = s.pressNode;\n\n s.dragNode = null;\n s.dragging = false;\n s.pressNode = null;\n s.pressT = 0;\n s.moved = false;\n\n if (wasClick && clickedNode) {\n openNodeDetail(clickedNode);\n }\n }, [openNodeDetail]);\n\n const onWheel = useCallback(\n (e: WheelEvent) => {\n e.preventDefault();\n const s = stateRef.current;\n const delta = e.deltaY > 0 ? 0.92 : 1.08;\n const newZoom = Math.min(3.0, Math.max(0.3, s.zoom * delta));\n const scaleFactor = newZoom / s.zoom;\n\n const canvas = canvasRef.current;\n if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n const mx = (e.clientX - rect.left) * s.dpr;\n const my = (e.clientY - rect.top) * s.dpr;\n\n s.pan.x = mx - (mx - s.pan.x) * scaleFactor;\n s.pan.y = my - (my - s.pan.y) * scaleFactor;\n s.zoom = newZoom;\n },\n []\n );\n\n // ── Main effect: fetch, layout, animate ──\n useEffect(() => {\n let cancelled = false;\n\n async function init() {\n setLoading(true);\n try {\n const data = await api.brain.graph();\n if (cancelled) return;\n const n = data.nodes || [];\n const e = data.edges || [];\n setNodes(n);\n setEdges(e);\n\n const s = stateRef.current;\n s.nodes = n;\n s.edges = e;\n\n resizeCanvas();\n const canvas = canvasRef.current;\n const cw = canvas ? canvas.width : 800;\n const ch = canvas ? canvas.height : 600;\n\n initPositions(n, cw, ch);\n runLayout(n, e, cw, ch);\n } catch (err) {\n console.error(\"Failed to load graph data:\", err);\n }\n if (!cancelled) setLoading(false);\n }\n\n init();\n return () => {\n cancelled = true;\n };\n }, [initPositions, runLayout, resizeCanvas]);\n\n // ── Animation loop + event listeners ──\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || loading) return;\n\n resizeCanvas();\n\n // Animation loop\n let running = true;\n const loop = (ts: number) => {\n if (!running) return;\n updateMotion(ts);\n draw(ts);\n stateRef.current.animFrame = requestAnimationFrame(loop);\n };\n stateRef.current.animFrame = requestAnimationFrame(loop);\n\n // Event listeners\n canvas.addEventListener(\"mousedown\", onMouseDown);\n canvas.addEventListener(\"mousemove\", onMouseMove);\n canvas.addEventListener(\"mouseup\", onMouseUp);\n canvas.addEventListener(\"mouseleave\", onMouseUp);\n canvas.addEventListener(\"wheel\", onWheel, { passive: false });\n\n const handleResize = () => {\n resizeCanvas();\n };\n window.addEventListener(\"resize\", handleResize);\n\n return () => {\n running = false;\n cancelAnimationFrame(stateRef.current.animFrame);\n canvas.removeEventListener(\"mousedown\", onMouseDown);\n canvas.removeEventListener(\"mousemove\", onMouseMove);\n canvas.removeEventListener(\"mouseup\", onMouseUp);\n canvas.removeEventListener(\"mouseleave\", onMouseUp);\n canvas.removeEventListener(\"wheel\", onWheel);\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [\n loading,\n resizeCanvas,\n updateMotion,\n draw,\n onMouseDown,\n onMouseMove,\n onMouseUp,\n onWheel,\n ]);\n\n // ── Legend entries ──\n const legendEntries = nodes.length\n ? [...new Set(nodes.map((n) => n.type))].sort()\n : [];\n\n return (\n <div className=\"flex h-full flex-col\">\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-border/50 bg-background/80 px-6 py-4 backdrop-blur-sm\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex h-9 w-9 items-center justify-center rounded-lg bg-[#00d4ff]/10\">\n <Network className=\"h-5 w-5 text-[#00d4ff]\" />\n </div>\n <div>\n <h1 className=\"text-xl font-semibold tracking-tight text-foreground\">\n Knowledge Graph\n </h1>\n <p className=\"text-xs text-muted-foreground\">\n Visualize connections in Mercury's memory\n </p>\n </div>\n </div>\n </div>\n\n {/* Canvas area */}\n <div\n ref={containerRef}\n className=\"relative flex-1\"\n style={{ minHeight: 500 }}\n >\n {loading && (\n <div className=\"absolute inset-0 z-20 flex items-center justify-center bg-background/60 backdrop-blur-sm\">\n <div className=\"flex flex-col items-center gap-3\">\n <Loader2 className=\"h-8 w-8 animate-spin text-[#00d4ff]\" />\n <span className=\"text-sm text-muted-foreground\">\n Loading knowledge graph...\n </span>\n </div>\n </div>\n )}\n\n {!loading && nodes.length === 0 && (\n <div className=\"absolute inset-0 z-20 flex items-center justify-center\">\n <div className=\"flex flex-col items-center gap-3 text-center\">\n <Network className=\"h-12 w-12 text-muted-foreground/40\" />\n <p className=\"text-sm text-muted-foreground\">\n No knowledge graph data available yet\n </p>\n </div>\n </div>\n )}\n\n <canvas\n ref={canvasRef}\n className={`absolute inset-0 h-full w-full ${tooltip ? \"cursor-pointer\" : \"cursor-grab\"}`}\n />\n\n {/* Search overlay */}\n <div className=\"absolute right-4 top-4 z-10\">\n <div className=\"flex items-center gap-2 rounded-lg border border-border/60 bg-background/90 px-3 py-1.5 shadow-lg backdrop-blur-sm\">\n <Search className=\"h-4 w-4 text-muted-foreground\" />\n <input\n type=\"text\"\n placeholder=\"Search nodes...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-48 border-none bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground/60\"\n />\n </div>\n </div>\n\n {/* Legend overlay */}\n {legendEntries.length > 0 && (\n <div className=\"absolute bottom-4 left-4 z-10 rounded-lg border border-border/60 bg-background/90 px-3 py-2.5 shadow-lg backdrop-blur-sm\">\n <p className=\"mb-1.5 text-[10px] font-medium uppercase tracking-wider text-muted-foreground\">\n Node Types\n </p>\n <div className=\"flex flex-col gap-1\">\n {legendEntries.map((type) => (\n <div key={type} className=\"flex items-center gap-2\">\n <span\n className=\"inline-block h-2.5 w-2.5 rounded-full\"\n style={{ backgroundColor: getTypeColor(type) }}\n />\n <span className=\"text-[11px] capitalize text-foreground/80\">\n {type}\n </span>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Tooltip */}\n {tooltip && (\n <div\n className=\"pointer-events-none absolute z-30 rounded-lg border border-border/60 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur-sm\"\n style={{\n left: tooltip.x,\n top: tooltip.y,\n maxWidth: 320,\n // Flip horizontally near the right edge of the container so the\n // tooltip never gets clipped or pushes off-screen.\n transform:\n containerRef.current &&\n tooltip.x + 340 > containerRef.current.clientWidth\n ? \"translateX(calc(-100% - 28px))\"\n : undefined,\n }}\n >\n <p className=\"break-words text-sm font-medium leading-snug text-foreground\">\n {tooltip.node.fullLabel || tooltip.node.label}\n </p>\n <div className=\"mt-1 flex items-center gap-2\">\n <span\n className=\"inline-block h-2 w-2 rounded-full\"\n style={{ backgroundColor: getTypeColor(tooltip.node.type) }}\n />\n <span className=\"text-xs capitalize text-muted-foreground\">\n {tooltip.node.type}\n </span>\n <span className=\"text-xs text-muted-foreground/60\">·</span>\n <span className=\"text-xs text-muted-foreground\">\n {tooltip.connections} connection\n {tooltip.connections !== 1 ? \"s\" : \"\"}\n </span>\n </div>\n <p className=\"mt-1.5 text-[10px] uppercase tracking-wider text-muted-foreground/70\">\n Click for details\n </p>\n </div>\n )}\n </div>\n\n {/* Node detail dialog */}\n <NodeDetailDialog\n open={detailOpen}\n onOpenChange={(v) => {\n setDetailOpen(v);\n if (!v) {\n stateRef.current.selectedNode = null;\n }\n }}\n node={detailNode}\n memory={detailMemory}\n loading={detailLoading}\n error={detailError}\n connections={\n detailNode ? connectionCount(detailNode.id, edges) : 0\n }\n />\n </div>\n );\n}\n\n// ── Detail dialog ──\ninterface NodeDetailDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n node: GraphNode | null;\n memory: Memory | null;\n loading: boolean;\n error: string | null;\n connections: number;\n}\n\nfunction formatTs(ts: string | number | undefined): string {\n if (!ts) return \"—\";\n const d = typeof ts === \"number\" ? new Date(ts) : new Date(ts);\n if (Number.isNaN(d.getTime())) return String(ts);\n return d.toLocaleString();\n}\n\nfunction NodeDetailDialog({\n open,\n onOpenChange,\n node,\n memory,\n loading,\n error,\n connections,\n}: NodeDetailDialogProps) {\n if (!node) return null;\n const color = getTypeColor(node.type);\n const fullLabel = node.fullLabel || node.label;\n const summary = memory?.summary || fullLabel;\n const detail = memory?.detail;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <div className=\"flex items-center gap-2\">\n <span\n className=\"inline-block h-3 w-3 rounded-full\"\n style={{ backgroundColor: color }}\n />\n <span className=\"text-xs font-medium uppercase tracking-wider text-muted-foreground\">\n {node.type}\n </span>\n </div>\n <DialogTitle className=\"mt-1 break-words text-lg leading-snug\">\n {summary}\n </DialogTitle>\n </DialogHeader>\n\n {loading && (\n <div className=\"flex items-center gap-2 py-4 text-sm text-muted-foreground\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n Loading details…\n </div>\n )}\n\n {!loading && memory && (\n <div className=\"space-y-4\">\n {detail && (\n <div>\n <p className=\"mb-1 text-[10px] font-medium uppercase tracking-wider text-muted-foreground\">\n Detail\n </p>\n <p className=\"whitespace-pre-wrap break-words text-sm leading-relaxed text-foreground/90\">\n {detail}\n </p>\n </div>\n )}\n\n <div className=\"grid grid-cols-2 gap-3 text-xs sm:grid-cols-3\">\n {memory.scope && (\n <DetailField label=\"Scope\" value={memory.scope} />\n )}\n {typeof memory.importance === \"number\" && (\n <DetailField\n label=\"Importance\"\n value={memory.importance.toFixed(2)}\n />\n )}\n {typeof memory.confidence === \"number\" && (\n <DetailField\n label=\"Confidence\"\n value={memory.confidence.toFixed(2)}\n />\n )}\n {typeof memory.evidenceCount === \"number\" && (\n <DetailField\n label=\"Evidence\"\n value={String(memory.evidenceCount)}\n />\n )}\n <DetailField label=\"Connections\" value={String(connections)} />\n {memory.evidenceKind && (\n <DetailField label=\"Source\" value={memory.evidenceKind} />\n )}\n <DetailField label=\"Created\" value={formatTs(memory.createdAt)} />\n {memory.updatedAt && (\n <DetailField label=\"Updated\" value={formatTs(memory.updatedAt)} />\n )}\n {memory.lastSeenAt && (\n <DetailField\n label=\"Last seen\"\n value={formatTs(memory.lastSeenAt)}\n />\n )}\n </div>\n\n <div className=\"border-t border-border/40 pt-2\">\n <p className=\"font-mono text-[10px] text-muted-foreground/70\">\n {memory.id}\n </p>\n </div>\n </div>\n )}\n\n {!loading && !memory && (\n <div className=\"space-y-3\">\n <p className=\"whitespace-pre-wrap break-words text-sm leading-relaxed text-foreground/90\">\n {fullLabel}\n </p>\n <div className=\"grid grid-cols-2 gap-3 text-xs\">\n <DetailField label=\"Type\" value={node.type} />\n <DetailField label=\"Connections\" value={String(connections)} />\n {typeof node.importance === \"number\" && (\n <DetailField\n label=\"Importance\"\n value={node.importance.toFixed(2)}\n />\n )}\n {typeof node.confidence === \"number\" && (\n <DetailField\n label=\"Confidence\"\n value={node.confidence.toFixed(2)}\n />\n )}\n </div>\n {error && (\n <p className=\"text-xs text-muted-foreground/70\">\n Could not load full record: {error}\n </p>\n )}\n <p className=\"font-mono text-[10px] text-muted-foreground/70\">\n {node.id}\n </p>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n\nfunction DetailField({ label, value }: { label: string; value: string }) {\n return (\n <div>\n <p className=\"text-[10px] font-medium uppercase tracking-wider text-muted-foreground\">\n {label}\n </p>\n <p className=\"mt-0.5 break-words text-foreground/90\">{value}</p>\n </div>\n );\n}\n"],"names":["__iconNode","Network","createLucideIcon","TYPE_COLORS","getTypeColor","type","isDarkMode","GraphPage","canvasRef","useRef","containerRef","loading","setLoading","useState","nodes","setNodes","edges","setEdges","searchQuery","setSearchQuery","tooltip","setTooltip","detailOpen","setDetailOpen","detailNode","setDetailNode","detailMemory","setDetailMemory","detailLoading","setDetailLoading","detailError","setDetailError","stateRef","useEffect","connectionCount","useCallback","nodeId","edgeList","count","e","initPositions","nodeList","canvasW","canvasH","s","cx","cy","node","i","angle","r","x","y","runLayout","w","h","iters","iter","area","k","repForce","attForce","forces","n","j","pi","pj","dx","dy","dist","f","fx","fy","ps","pt","fs","ft","gravity","p","damp","a","resizeCanvas","canvas","container","dpr","screenToGraph","sx","sy","findNodeAt","gx","gy","draw","ts","ctx","dark","focus","neighbors","activeEdgeIdx","pulse","alpha","searchQ","isHovered","_a","isSelected","_b","isNeighbor","v","breathe","fontSize","text","metrics","padX","padY","bx","by","bw","bh","_c","updateMotion","openNodeDetail","mem","api","err","onMouseDown","rect","gp","onMouseMove","ddx","ddy","prev","onMouseUp","wasClick","clickedNode","onWheel","delta","newZoom","scaleFactor","mx","my","cancelled","init","data","cw","ch","running","loop","handleResize","legendEntries","jsxs","jsx","Loader2","Search","NodeDetailDialog","formatTs","d","open","onOpenChange","memory","error","connections","color","fullLabel","summary","detail","Dialog","DialogContent","DialogHeader","DialogTitle","DetailField","label","value"],"mappings":"oXAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,GAAa,CACjB,CAAC,OAAQ,CAAE,EAAG,KAAM,EAAG,KAAM,MAAO,IAAK,OAAQ,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC9E,CAAC,OAAQ,CAAE,EAAG,IAAK,EAAG,KAAM,MAAO,IAAK,OAAQ,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC7E,CAAC,OAAQ,CAAE,EAAG,IAAK,EAAG,IAAK,MAAO,IAAK,OAAQ,IAAK,GAAI,IAAK,IAAK,QAAQ,CAAE,EAC5E,CAAC,OAAQ,CAAE,EAAG,4CAA6C,IAAK,QAAQ,CAAE,EAC1E,CAAC,OAAQ,CAAE,EAAG,WAAY,IAAK,QAAQ,CAAE,CAC3C,EACMC,GAAUC,GAAiB,UAAWF,EAAU,ECLhDG,GAAsC,CAC1C,KAAM,UACN,WAAY,UACZ,WAAY,UACZ,KAAM,UACN,QAAS,UACT,OAAQ,UACR,MAAO,UACP,OAAQ,UACR,YAAa,UACb,QAAS,SACX,EAEA,SAASC,EAAaC,EAAsB,CAC1C,OAAOF,GAAYE,CAAI,GAAKF,GAAY,OAC1C,CAqBA,SAASG,IAAsB,CAC7B,OACE,SAAS,gBAAgB,UAAU,SAAS,MAAM,GAClD,SAAS,gBAAgB,aAAa,YAAY,IAAM,OAE5D,CAEO,SAASC,IAAY,CAC1B,MAAMC,EAAYC,EAAAA,OAA0B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E,UAAU,iDACV,WAAK,EAAA,CACR,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,CACF,CAEJ,CAEA,SAASmB,EAAY,CAAE,MAAAC,EAAO,MAAAC,GAA2C,CACvE,cACG,MAAA,CACC,SAAA,CAAArB,EAAAA,IAAC,IAAA,CAAE,UAAU,yEACV,SAAAoB,EACH,EACApB,EAAAA,IAAC,IAAA,CAAE,UAAU,wCAAyC,SAAAqB,CAAA,CAAM,CAAA,EAC9D,CAEJ","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{j as e,m as Ke,A as Ve}from"./vendor-motion-Dwx3-JO5.js";import{r,j as Ps,e as Ls}from"./vendor-react-C7pctHW3.js";import{u as Es,a as es,D as Bs,c as Us,b as Ms,K as Rs,P as zs,S as cs,v as xs,d as Fs,C as Os}from"./vendor-dnd-DRBSMxXo.js";import{C as ss,c as ts,a as _s,b as Hs}from"./card-BdsEOP7t.js";import{B as j}from"./button-CNasMlFE.js";import{B as z}from"./badge-CUJiWF1y.js";import{I as ke}from"./input-CH3dmo9r.js";import{T as re}from"./textarea-CXh3tmJ1.js";import{D as be,a as ve,b as ye,c as we,d as We,e as Ge,f as Ze}from"./dialog-Bd1rELXb.js";import{A as Ce,h as Se,a as De,b as Ae,c as Te,d as Pe,e as Le,f as Ee,g as Be,T as Ue}from"./alert-dialog-MbYSbZx5.js";import{S as Fe,a as Oe,b as _e,c as He,d as q}from"./select-vRSgBrHz.js";import{j as qs,k as $s,l as ms,m as Is,n as us,D as hs,O as ps}from"./vendor-radix-3UdfCgs_.js";import{c as Ks}from"./index-CaqLZNof.js";import{e as I,X as qe,c as D,a as b,b as S,P as Je,t as $,h as ne,S as Vs,g as fs,M as Ws}from"./index-C3YiF4qv.js";import{C as Gs,a as Zs,b as Js}from"./collapsible-BU_K9n8f.js";import{A as as}from"./arrow-left-CtqQsBC6.js";import{P as gs}from"./pencil-gNDEMhav.js";import{P as js}from"./plus-7rbHkByr.js";import{L as ee}from"./loader-circle-DbYKk0_Q.js";import{S as Xs}from"./sparkles-DcP24GEL.js";import{Z as ns}from"./zap-BEfqVtvZ.js";import{G as ie}from"./git-branch-D9JVASpC.js";import{C as Ys}from"./circle-check-DvGSe1uZ.js";import{P as Qs,a as et}from"./power-BS7gCDWs.js";import{C as st}from"./chevron-down-CB9J_vvZ.js";import{S as Ns}from"./send-BkyTIUtJ.js";import{F as ze}from"./file-text-BWWBuD_N.js";import{E as tt}from"./eye-BJ0NucMz.js";import{D as at}from"./download-C8RvlFqO.js";import"./vendor-syntax-xZUI6Op9.js";/**
|
|
2
|
+
* @license lucide-react v0.511.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const nt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],ls=I("circle-dot",nt);/**
|
|
7
|
+
* @license lucide-react v0.511.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const lt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],rs=I("columns-3",lt);/**
|
|
12
|
+
* @license lucide-react v0.511.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const rt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],it=I("image",rt);/**
|
|
17
|
+
* @license lucide-react v0.511.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const ot=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Xe=I("link-2",ot);/**
|
|
22
|
+
* @license lucide-react v0.511.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const dt=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],Ye=I("paperclip",dt);/**
|
|
27
|
+
* @license lucide-react v0.511.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const ct=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],is=I("rotate-ccw",ct);/**
|
|
32
|
+
* @license lucide-react v0.511.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const xt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Qe=I("square",xt);/**
|
|
37
|
+
* @license lucide-react v0.511.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const mt=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],ut=I("tag",mt),ht=qs,pt=$s,bs=r.forwardRef(({className:s,...l},t)=>e.jsx(ps,{className:D("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...l,ref:t}));bs.displayName=ps.displayName;const ft=Ks("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r border-border sm:max-w-sm data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",right:"inset-y-0 right-0 h-full w-3/4 border-l border-border sm:max-w-sm data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),vs=r.forwardRef(({side:s="right",className:l,children:t,...h},m)=>e.jsxs(pt,{children:[e.jsx(bs,{}),e.jsxs(ms,{ref:m,className:D(ft({side:s}),l),...h,children:[e.jsxs(Is,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(qe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]}),t]})]}));vs.displayName=ms.displayName;const ys=({className:s,...l})=>e.jsx("div",{className:D("flex flex-col space-y-2 text-center sm:text-left",s),...l});ys.displayName="SheetHeader";const ws=r.forwardRef(({className:s,...l},t)=>e.jsx(us,{ref:t,className:D("text-lg font-semibold text-foreground",s),...l}));ws.displayName=us.displayName;const ks=r.forwardRef(({className:s,...l},t)=>e.jsx(hs,{ref:t,className:D("text-sm text-muted-foreground",s),...l}));ks.displayName=hs.displayName;const os=[{key:"pending",label:"To Do"},{key:"running",label:"In Progress"},{key:"done",label:"Done"},{key:"failed",label:"Blocked"}],gt={low:{label:"Low",color:"text-muted-foreground border-muted-foreground/40"},normal:{label:"Med",color:"text-yellow-400 border-yellow-400/40"},medium:{label:"Med",color:"text-yellow-400 border-yellow-400/40"},high:{label:"High",color:"text-orange-400 border-orange-400/40"},critical:{label:"Crit",color:"text-red-400 border-red-400/40"}},ds={pending:"border-l-muted-foreground/40 border-dashed",running:"border-l-[#00d4ff]",paused:"border-l-yellow-400",done:"border-l-emerald-500",failed:"border-l-red-500",question:"border-l-purple-500"},jt=[{name:"Bug",color:"#ef4444"},{name:"Feature",color:"#3b82f6"},{name:"Refactor",color:"#a78bfa"},{name:"Docs",color:"#10b981"},{name:"Test",color:"#f59e0b"},{name:"Urgent",color:"#dc2626"},{name:"Backend",color:"#06b6d4"},{name:"Frontend",color:"#8b5cf6"},{name:"DevOps",color:"#64748b"}],Nt={markdown:ze,document:ze,image:it,presentation:ze,other:Ye},bt={hidden:{opacity:0,y:12},visible:s=>({opacity:1,y:0,transition:{delay:s*.05,duration:.3,ease:"easeOut"}})};function Cs(s,l){const[t,h]=r.useState("");return r.useEffect(()=>{if(!s||!l){h("");return}const m=()=>{const i=typeof s=="number"?s:new Date(s).getTime(),C=Math.max(0,Math.floor((Date.now()-i)/1e3)),f=Math.floor(C/60),d=C%60;h(f>0?`${f}m ${d}s`:`${d}s`)};m();const u=setInterval(m,1e3);return()=>clearInterval(u)},[s,l]),t}function $e({className:s}){return e.jsx("div",{className:D("animate-pulse rounded-lg bg-muted",s)})}function Ss({priority:s}){if(!s)return null;const l=gt[s]??{label:s,color:"text-muted-foreground border-muted-foreground/40"};return e.jsx("span",{className:D("text-[10px] font-semibold uppercase border rounded px-1.5 py-0.5",l.color),children:l.label})}function le(s){if(!s)return"";const l=(s.input*3+s.output*15)/1e6;return l<.01?"<$0.01":`$${l.toFixed(2)}`}function Ie(s){const l=Math.floor((Date.now()-s)/1e3);return l<60?`${l}s ago`:l<3600?`${Math.floor(l/60)}m ago`:l<86400?`${Math.floor(l/3600)}h ago`:`${Math.floor(l/86400)}d ago`}function la(){const{boardId:s}=Ps(),l=Ls();return s?e.jsx(yt,{boardId:s,onBack:()=>l("/board")}):e.jsx(vt,{onSelect:t=>l(`/board/${t}`)})}function vt({onSelect:s}){const[l,t]=r.useState([]),[h,m]=r.useState(!0),[u,i]=r.useState(""),[C,f]=r.useState(!1),[d,y]=r.useState(""),[p,g]=r.useState(""),[o,N]=r.useState(!1),w=r.useCallback(()=>{b.boards.list().then(c=>{t(c.boards),i("")}).catch(c=>i(c.message)).finally(()=>m(!1))},[]);r.useEffect(()=>{w()},[w]);const k=async()=>{if(d.trim()){N(!0);try{const{board:c}=await b.boards.create({name:d.trim(),description:p.trim()||void 0});f(!1),y(""),g(""),s(c.id)}catch(c){i(c.message)}finally{N(!1)}}},P=async c=>{try{await b.boards.delete(c),w()}catch(U){i(U.message)}},v=async c=>{try{c.active?await b.boards.deactivate(c.id):await b.boards.activate(c.id),w()}catch(U){i(U.message)}};return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(rs,{className:"h-6 w-6 text-[#00d4ff]"}),e.jsxs("h1",{className:"text-2xl font-semibold text-foreground",children:["Kanban Boards ",e.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:"(Beta mode)"})]})]}),e.jsxs(j,{onClick:()=>f(!0),className:"gap-2 bg-[#00d4ff] text-black hover:bg-[#00d4ff]/80",children:[e.jsx(js,{className:"h-4 w-4"})," Create Board"]})]}),u&&e.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-400",children:u}),h&&e.jsx("div",{className:"grid gap-4 sm:grid-cols-1 lg:grid-cols-2",children:[0,1,2,3].map(c=>e.jsx($e,{className:"h-36"},c))}),!h&&l.length===0&&!u&&e.jsx(ss,{children:e.jsxs(ts,{className:"py-16 text-center",children:[e.jsx(rs,{className:"mx-auto mb-4 h-12 w-12 text-muted-foreground/40"}),e.jsx("p",{className:"text-muted-foreground",children:"No boards yet. Create one to get started."})]})}),!h&&l.length>0&&e.jsx("div",{className:"grid gap-4 sm:grid-cols-1 lg:grid-cols-2",children:e.jsx(Ve,{mode:"popLayout",children:l.map((c,U)=>{var F;return e.jsx(Ke.div,{custom:U,variants:bt,initial:"hidden",animate:"visible",exit:{opacity:0,scale:.95,transition:{duration:.2}},layout:!0,children:e.jsxs(ss,{className:"cursor-pointer transition-colors hover:border-[#00d4ff]/40",onClick:()=>s(c.id),children:[e.jsxs(_s,{className:"flex flex-row items-start justify-between gap-4 pb-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(Hs,{className:"text-base font-semibold",children:c.name}),c.description&&e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:$(c.description,100)})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onClick:V=>V.stopPropagation(),children:[e.jsx(z,{variant:c.active?"default":"secondary",className:D("cursor-pointer text-[10px]",c.active&&"bg-[#00d4ff]/20 text-[#00d4ff] hover:bg-[#00d4ff]/30"),onClick:()=>v(c),children:c.active?e.jsxs(e.Fragment,{children:[e.jsx(Qs,{className:"mr-1 h-3 w-3"})," Active"]}):e.jsxs(e.Fragment,{children:[e.jsx(et,{className:"mr-1 h-3 w-3"})," Inactive"]})}),e.jsxs(Ce,{children:[e.jsx(Se,{asChild:!0,children:e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-red-400",children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})}),e.jsxs(De,{children:[e.jsxs(Ae,{children:[e.jsx(Te,{children:"Delete board?"}),e.jsxs(Pe,{children:['This will permanently delete "',c.name,'" and all its cards.']})]}),e.jsxs(Le,{children:[e.jsx(Ee,{children:"Cancel"}),e.jsx(Be,{className:"bg-red-600 hover:bg-red-700",onClick:()=>P(c.id),children:"Delete"})]})]})]})]})]}),e.jsx(ts,{children:e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[c.cardCount??((F=c.cards)==null?void 0:F.length)??0," cards"]}),e.jsx("span",{children:ne(c.createdAt)})]})})]})},c.id)})})}),e.jsx(be,{open:C,onOpenChange:f,children:e.jsxs(ve,{children:[e.jsxs(ye,{children:[e.jsx(we,{children:"Create Board"}),e.jsx(We,{children:"Add a new Kanban board for organizing agent tasks."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Name"}),e.jsx(ke,{placeholder:"Board name",value:d,onChange:c=>y(c.target.value),onKeyDown:c=>c.key==="Enter"&&k()})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Description"}),e.jsx(re,{placeholder:"Describe the project — AI will use this to generate task cards with dependencies...",value:p,onChange:c=>g(c.target.value),rows:4})]})]}),e.jsxs(Ge,{children:[e.jsx(Ze,{asChild:!0,children:e.jsx(j,{variant:"ghost",children:"Cancel"})}),e.jsxs(j,{onClick:k,disabled:!d.trim()||o,className:"bg-[#00d4ff] text-black hover:bg-[#00d4ff]/80",children:[o&&e.jsx(ee,{className:"mr-2 h-4 w-4 animate-spin"})," Create"]})]})]})})]})}function yt({boardId:s,onBack:l}){const[t,h]=r.useState(null),[m,u]=r.useState(null),[i,C]=r.useState(!0),[f,d]=r.useState(""),[y,p]=r.useState(!1),[g,o]=r.useState(!1),[N,w]=r.useState(null),[k,P]=r.useState(null),[v,c]=r.useState(!1),[U,F]=r.useState(""),[V,W]=r.useState(!1),[de,G]=r.useState(!1),[M,Z]=r.useState(null),[J,ce]=r.useState(!1),se=r.useRef(),te=r.useRef(null),xe=Es(es(zs,{activationConstraint:{distance:5}}),es(Rs)),L=r.useCallback(async()=>{var a;try{const x=await b.boards.get(s);if(h(x.board),u(x.resources),d(""),N){const T=(a=x.board.cards)==null?void 0:a.find(B=>B.id===N.id);T&&w(T)}}catch(x){d(x.message)}finally{C(!1)}},[s,N==null?void 0:N.id]);r.useEffect(()=>{L();const a=window.location.origin,x=new EventSource(`${a}/api/boards/${s}/events`);return te.current=x,x.addEventListener("board-update",T=>{try{const B=JSON.parse(T.data);h(B),d(""),w(_=>{var Q;return _?((Q=B.cards)==null?void 0:Q.find(H=>H.id===_.id))??_:null})}catch{}}),x.onerror=()=>{x.close(),te.current=null,se.current=setInterval(L,2500)},()=>{x.close(),te.current=null,se.current&&clearInterval(se.current)}},[s]);const A=r.useMemo(()=>(t==null?void 0:t.cards)??[],[t]),E=r.useMemo(()=>{const a={pending:[],running:[],paused:[],done:[],failed:[],question:[]};for(const x of A)a[x.status]?a[x.status].push(x):a.pending.push(x);return a},[A]),me=r.useMemo(()=>os.map(a=>({...a,cards:a.key==="pending"?[...E.pending,...E.paused,...E.question]:E[a.key]??[]})),[E]),ue=r.useMemo(()=>k?A.find(a=>a.id===k):void 0,[k,A]),O=r.useMemo(()=>{let a=0,x=0;for(const T of A)T.tokenUsage&&(a+=T.tokenUsage.input,x+=T.tokenUsage.output);return a===0&&x===0?null:{input:a,output:x,total:a+x}},[A]);r.useMemo(()=>{const a=new Map;for(const x of A)a.set(x.id,x);return a},[A]);const he=a=>P(a.active.id),pe=async a=>{P(null);const{active:x,over:T}=a;if(!T||x.id===T.id)return;const B=T.id;let _;const Re=os.find(H=>H.key===B);if(Re)_=Re.key;else{const H=A.find(Ts=>Ts.id===B);H&&(_=H.status)}if(!_)return;const Q=A.find(H=>H.id===x.id);if(!(!Q||Q.status===_))try{await b.boards.cards.update(s,Q.id,{status:_}),L()}catch{}},fe=async()=>{o(!0);try{await b.boards.generate(s),L()}catch(a){d(a.message)}finally{o(!1)}},ae=async()=>{try{await b.boards.smartExecute(s),L()}catch(a){d(a.message)}},ge=async()=>{try{await b.boards.runAll(s),L()}catch(a){d(a.message)}},je=async()=>{try{await b.boards.cards.clearDone(s),L()}catch(a){d(a.message)}},n=async()=>{try{await b.boards.haltAll(s),L()}catch(a){d(a.message)}},R=async a=>{const x=A.find(B=>B.id===a),T=x!=null&&x.pausedForTokens?{overrideBudget:!0}:void 0;try{await b.boards.cards.run(s,a,T),L()}catch(B){d(B.message)}},X=async a=>{try{await b.boards.cards.halt(s,a),L()}catch(x){d(x.message)}},Y=async a=>{try{await b.boards.cards.delete(s,a),(N==null?void 0:N.id)===a&&w(null),L()}catch(x){d(x.message)}},Ne=async()=>{try{await b.boards.update(s,{description:U}),c(!1),L()}catch(a){d(a.message)}},Me=async()=>{ce(!0),G(!0);try{const a=await b.boards.executionPlan(s);Z(a)}catch(a){d(a.message)}finally{ce(!1)}};return i&&!t?e.jsxs("div",{className:"space-y-4 p-6",children:[e.jsx($e,{className:"h-10 w-64"}),e.jsx("div",{className:"flex gap-4",children:[0,1,2,3].map(a=>e.jsx($e,{className:"h-96 flex-1"},a))})]}):f&&!t?e.jsxs("div",{className:"p-6",children:[e.jsxs(j,{variant:"ghost",onClick:l,className:"mb-4 gap-2",children:[e.jsx(as,{className:"h-4 w-4"})," Back"]}),e.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-400",children:f})]}):e.jsxs("div",{className:"flex h-full flex-col p-6",children:[e.jsxs("div",{className:"mb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(j,{variant:"ghost",size:"icon",onClick:l,className:"h-8 w-8 shrink-0",children:e.jsx(as,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-xl font-semibold text-foreground",children:t==null?void 0:t.name}),(t==null?void 0:t.active)&&e.jsx(z,{className:"bg-[#00d4ff]/20 text-[#00d4ff] text-[10px]",children:"Active"})]}),e.jsx("div",{className:"group",children:v?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(re,{value:U,onChange:a=>F(a.target.value),rows:2,className:"text-sm flex-1",placeholder:"Board description...",autoFocus:!0}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(j,{size:"sm",onClick:Ne,className:"h-7 text-xs bg-[#00d4ff] text-black hover:bg-[#00d4ff]/80",children:"Save"}),e.jsx(j,{size:"sm",variant:"ghost",onClick:()=>c(!1),className:"h-7 text-xs",children:"Cancel"})]})]}):e.jsxs("div",{className:"flex items-start gap-2 rounded-md px-2 py-1 -mx-2 transition-colors hover:bg-muted/30",children:[e.jsx("div",{className:"flex-1 min-w-0 text-sm text-muted-foreground",children:t!=null&&t.description?(()=>{const x=t.description,T=x.length>280,B=T?x.slice(0,280).trimEnd()+"…":x;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:D(T&&"cursor-pointer"),onClick:()=>{T&&W(!0)},children:e.jsx(oe,{content:B,className:"prose-sm prose-invert max-w-none"})}),T&&e.jsx("div",{className:"mt-2 flex justify-center",children:e.jsx("button",{type:"button",onClick:()=>W(!0),className:"text-sm font-medium text-[#00d4ff] hover:underline",children:"See more"})})]})})():e.jsx("p",{className:"cursor-pointer italic text-muted-foreground/60",onClick:()=>{F(""),c(!0)},children:"Click to add a description..."})}),e.jsx("button",{type:"button",onClick:()=>{F((t==null?void 0:t.description)??""),c(!0)},className:"mt-0.5 shrink-0 rounded p-1 text-muted-foreground/50 opacity-0 transition-opacity hover:bg-muted hover:text-foreground group-hover:opacity-100",title:"Edit description","aria-label":"Edit description",children:e.jsx(gs,{className:"h-3.5 w-3.5"})})]})}),m&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"text-[#00d4ff]",children:[m.runningCount," running"]}),e.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.jsxs("span",{children:[m.pendingCount," pending"]}),e.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.jsxs("span",{className:"text-emerald-400",children:[m.doneCount," done"]}),e.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.jsxs("span",{className:"text-red-400",children:[m.failedCount," failed"]}),e.jsx("span",{className:"text-muted-foreground/40",children:"|"}),e.jsxs("span",{children:[S(m.totalTokens)," tokens"]}),O&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.jsx("span",{className:"text-emerald-400 font-medium",children:le(O)}),e.jsxs("span",{className:"text-muted-foreground/60",children:["(",S(O.input)," in / ",S(O.output)," out)"]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(j,{size:"sm",variant:"outline",onClick:()=>p(!0),className:"gap-1.5 text-xs",children:[e.jsx(js,{className:"h-3.5 w-3.5"})," Add Card"]}),e.jsxs(j,{size:"sm",variant:"outline",onClick:fe,disabled:g,className:"gap-1.5 text-xs",children:[g?e.jsx(ee,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Xs,{className:"h-3.5 w-3.5"}),"Generate Cards"]}),e.jsxs(j,{size:"sm",onClick:ae,className:"gap-1.5 text-xs bg-gradient-to-r from-[#00d4ff] to-[#a78bfa] text-black hover:opacity-90 font-semibold",children:[e.jsx(ns,{className:"h-3.5 w-3.5"})," Smart Execute"]}),e.jsxs(j,{size:"sm",variant:"outline",onClick:Me,className:"gap-1.5 text-xs",children:[e.jsx(ie,{className:"h-3.5 w-3.5"})," View Plan"]}),e.jsxs(j,{size:"sm",onClick:ge,className:"gap-1.5 text-xs bg-[#00d4ff] text-black hover:bg-[#00d4ff]/80",children:[e.jsx(Je,{className:"h-3.5 w-3.5"})," Run All"]}),e.jsxs(Ce,{children:[e.jsx(Se,{asChild:!0,children:e.jsxs(j,{size:"sm",variant:"outline",className:"gap-1.5 text-xs text-red-400 hover:text-red-300",children:[e.jsx(Qe,{className:"h-3.5 w-3.5"})," Halt All"]})}),e.jsxs(De,{children:[e.jsxs(Ae,{children:[e.jsx(Te,{children:"Halt all running agents?"}),e.jsx(Pe,{children:"All currently running cards will be stopped immediately."})]}),e.jsxs(Le,{children:[e.jsx(Ee,{children:"Cancel"}),e.jsx(Be,{className:"bg-red-600 hover:bg-red-700",onClick:n,children:"Halt All"})]})]})]}),e.jsxs(j,{size:"sm",variant:"ghost",onClick:je,className:"gap-1.5 text-xs text-muted-foreground",children:[e.jsx(Ys,{className:"h-3.5 w-3.5"})," Clear Done"]})]}),f&&e.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-3 text-sm text-red-400",children:f}),E.question&&E.question.length>0&&e.jsxs(Ke.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},className:"rounded-lg border border-purple-500/40 bg-purple-500/10 px-4 py-3 flex items-center gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-purple-400 animate-pulse"}),e.jsxs("span",{className:"text-sm font-medium text-purple-300",children:[E.question.length," card",E.question.length>1?"s":""," need",E.question.length===1?"s":""," your attention"]})]}),e.jsx("div",{className:"flex gap-2 ml-auto",children:E.question.map(a=>e.jsxs(j,{size:"sm",variant:"outline",className:"text-xs border-purple-400/40 text-purple-300 hover:bg-purple-500/20 gap-1",onClick:()=>w(a),children:[e.jsx(ls,{className:"h-3 w-3"}),$(a.task,30)]},a.id))})]})]}),e.jsxs(Bs,{sensors:xe,collisionDetection:Us,onDragStart:he,onDragEnd:pe,children:[e.jsx("div",{className:"hidden md:flex flex-1 min-h-0 gap-4 overflow-x-auto pb-4",children:me.map(a=>e.jsx(wt,{status:a.key,label:a.label,cards:a.cards,allCards:A,boardId:s,onRun:R,onHalt:X,onDelete:Y,onSelect:w},a.key))}),e.jsx("div",{className:"flex flex-col gap-3 md:hidden",children:me.map(a=>e.jsx(kt,{status:a.key,label:a.label,cards:a.cards,allCards:A,boardId:s,onRun:R,onHalt:X,onDelete:Y,onSelect:w},a.key))}),e.jsx(Ms,{children:ue&&e.jsx("div",{className:"w-72 scale-105 opacity-90",children:e.jsx(As,{card:ue,allCards:A,boardId:s,onRun:R,onHalt:X,onDelete:Y,onSelect:w,overlay:!0})})})]}),A.length===0&&!i&&e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(ls,{className:"mx-auto mb-3 h-10 w-10 text-muted-foreground/30"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No cards yet. Add tasks or use AI to generate them."})]})}),e.jsx(Ct,{boardId:s,open:y,onOpenChange:p,onCreated:L,allCards:A}),e.jsx(Dt,{card:N,boardId:s,allCards:A,open:!!N,onOpenChange:a=>{a||w(null)},onRun:R,onHalt:X,onDelete:Y,onRefresh:L}),e.jsx(be,{open:de,onOpenChange:G,children:e.jsxs(ve,{className:"max-w-lg",children:[e.jsxs(ye,{children:[e.jsxs(we,{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-5 w-5 text-[#00d4ff]"})," Execution Plan"]}),e.jsx(We,{children:"Dependency-aware execution order. Cards in each wave run concurrently."})]}),J&&e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(ee,{className:"h-6 w-6 animate-spin text-[#00d4ff]"})}),M&&!J&&e.jsxs("div",{className:"space-y-3 max-h-96 overflow-y-auto",children:[M.batches.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No pending cards to execute."}),M.batches.map(a=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(z,{variant:"outline",className:"text-[10px] bg-[#00d4ff]/10 text-[#00d4ff] border-[#00d4ff]/30",children:["Wave ",a.wave]}),e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:[a.cards.length," card",a.cards.length>1?"s":""]})]}),a.cards.map(x=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border/50 bg-muted/30 px-3 py-1.5 text-xs",children:[e.jsx(Ss,{priority:x.priority}),e.jsx("span",{className:"flex-1 truncate text-foreground/80",children:x.task}),x.dependsOn&&x.dependsOn.length>0&&e.jsxs("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[e.jsx(Xe,{className:"h-3 w-3 inline mr-0.5"}),x.dependsOn.length," dep",x.dependsOn.length>1?"s":""]})]},x.id))]},a.wave)),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50 text-xs text-muted-foreground",children:[e.jsxs("span",{children:[M.totalBatches," wave",M.totalBatches>1?"s":"",", ",M.totalCards," card",M.totalCards>1?"s":""]}),e.jsxs(j,{size:"sm",onClick:()=>{G(!1),ae()},className:"gap-1.5 text-xs bg-gradient-to-r from-[#00d4ff] to-[#a78bfa] text-black",children:[e.jsx(ns,{className:"h-3 w-3"})," Execute Plan"]})]})]})]})}),e.jsx(be,{open:V,onOpenChange:W,children:e.jsxs(ve,{className:"max-w-2xl",children:[e.jsx(ye,{children:e.jsxs(we,{children:[(t==null?void 0:t.name)??"Board"," — Description"]})}),e.jsx("div",{className:"max-h-[60vh] overflow-y-auto pr-2",children:t!=null&&t.description?e.jsx(oe,{content:t.description,className:"prose-sm prose-invert max-w-none"}):e.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No description."})}),e.jsx(Ge,{children:e.jsx(Ze,{asChild:!0,children:e.jsx(j,{variant:"ghost",size:"sm",children:"Close"})})})]})})]})}function wt({status:s,label:l,cards:t,allCards:h,boardId:m,onRun:u,onHalt:i,onDelete:C,onSelect:f}){const d=s==="running"?"text-[#00d4ff]":s==="done"?"text-emerald-400":s==="failed"?"text-red-400":"text-muted-foreground";return e.jsxs("div",{className:"flex min-w-[260px] flex-1 flex-col min-h-0 rounded-lg border border-border/50 bg-muted/20",children:[e.jsx("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:D("text-sm font-medium",d),children:l}),e.jsx(z,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5 min-w-[20px] justify-center",children:t.length})]})}),e.jsx(cs,{items:t.map(y=>y.id),strategy:xs,id:s,children:e.jsx(Vs,{className:"flex-1 min-h-0 p-2",children:e.jsx("div",{className:"space-y-2 min-h-[60px]",children:e.jsx(Ve,{mode:"popLayout",children:t.map((y,p)=>e.jsx(Ds,{card:y,index:p,allCards:h,boardId:m,onRun:u,onHalt:i,onDelete:C,onSelect:f},y.id))})})})})]})}function kt({status:s,label:l,cards:t,allCards:h,boardId:m,onRun:u,onHalt:i,onDelete:C,onSelect:f}){const[d,y]=r.useState(s==="running"||s==="pending"),p=s==="running"?"text-[#00d4ff]":s==="done"?"text-emerald-400":s==="failed"?"text-red-400":"text-muted-foreground";return e.jsxs(Gs,{open:d,onOpenChange:y,children:[e.jsx(Zs,{asChild:!0,children:e.jsx("button",{className:"flex w-full items-center justify-between rounded-lg border border-border/50 bg-muted/20 px-3 py-2.5",children:e.jsxs("div",{className:"flex items-center gap-2",children:[d?e.jsx(st,{className:"h-4 w-4 text-muted-foreground"}):e.jsx(fs,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:D("text-sm font-medium",p),children:l}),e.jsx(z,{variant:"secondary",className:"text-[10px] px-1.5 py-0 h-5",children:t.length})]})})}),e.jsx(Js,{children:e.jsx(cs,{items:t.map(g=>g.id),strategy:xs,children:e.jsx("div",{className:"space-y-2 pt-2",children:e.jsx(Ve,{mode:"popLayout",children:t.map((g,o)=>e.jsx(Ds,{card:g,index:o,allCards:h,boardId:m,onRun:u,onHalt:i,onDelete:C,onSelect:f},g.id))})})})})]})}function Ds({card:s,index:l,allCards:t,boardId:h,onRun:m,onHalt:u,onDelete:i,onSelect:C}){const{attributes:f,listeners:d,setNodeRef:y,transform:p,transition:g,isDragging:o}=Fs({id:s.id}),N={transform:Os.Transform.toString(p),transition:g};return e.jsx(Ke.div,{ref:y,style:N,layout:!0,initial:{opacity:0,y:8},animate:{opacity:o?.4:1,y:0,transition:{delay:l*.03}},exit:{opacity:0,scale:.95,transition:{duration:.15}},...f,...d,children:e.jsx(As,{card:s,allCards:t,boardId:h,onRun:m,onHalt:u,onDelete:i,onSelect:C})})}function As({card:s,allCards:l,boardId:t,onRun:h,onHalt:m,onDelete:u,onSelect:i,overlay:C}){var N,w,k,P;const f=Cs(s.startedAt,s.status==="running"),[d,y]=r.useState(!1),p=s.parentId?l.find(v=>v.id===s.parentId):null,g=l.filter(v=>v.parentId===s.id).length,o=((N=s.dependsOn)==null?void 0:N.length)??0;return e.jsxs("div",{className:D("group relative rounded-md border border-border/50 bg-card p-3 text-sm transition-all border-l-[3px] cursor-pointer",ds[s.status]??ds.pending,s.status==="running"&&"animate-pulse border-l-[3px]",s.status==="question"&&"ring-1 ring-purple-500/30",s.status==="done"&&"opacity-80",C&&"shadow-lg shadow-[#00d4ff]/10 ring-1 ring-[#00d4ff]/20"),onClick:v=>{v.target.closest("button")||i(s)},children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap min-w-0",children:[e.jsx(Ss,{priority:s.priority}),(w=s.labels)==null?void 0:w.map(v=>e.jsx("span",{className:"text-[9px] font-medium rounded px-1.5 py-0.5 text-white",style:{backgroundColor:v.color},children:v.name},v.id)),s.status==="question"&&e.jsx("span",{className:"text-[9px] font-semibold uppercase border border-purple-400/40 text-purple-400 rounded px-1.5 py-0.5",children:"Needs Input"})]}),e.jsxs(Ce,{children:[e.jsx(Se,{asChild:!0,children:e.jsx("button",{className:"opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-red-400 p-0.5",onClick:v=>v.stopPropagation(),children:e.jsx(Ue,{className:"h-3 w-3"})})}),e.jsxs(De,{children:[e.jsxs(Ae,{children:[e.jsx(Te,{children:"Delete card?"}),e.jsx(Pe,{children:"This card will be permanently removed."})]}),e.jsxs(Le,{children:[e.jsx(Ee,{children:"Cancel"}),e.jsx(Be,{className:"bg-red-600 hover:bg-red-700",onClick:()=>u(s.id),children:"Delete"})]})]})]})]}),p&&e.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-muted-foreground/70 mb-1",children:[e.jsx(ie,{className:"h-2.5 w-2.5"}),e.jsx("span",{className:"truncate",children:$(p.task,40)})]}),e.jsx("p",{className:"text-xs leading-relaxed text-foreground/90",children:$(s.task,120)}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5 flex-wrap",children:[o>0&&e.jsxs("span",{className:"text-[9px] text-muted-foreground/70 flex items-center gap-0.5",children:[e.jsx(Xe,{className:"h-2.5 w-2.5"})," ",o]}),g>0&&e.jsxs("span",{className:"text-[9px] text-muted-foreground/70 flex items-center gap-0.5",children:[e.jsx(ie,{className:"h-2.5 w-2.5"})," ",g]}),(((k=s.comments)==null?void 0:k.length)??0)>0&&e.jsxs("span",{className:"text-[9px] text-muted-foreground/70 flex items-center gap-0.5",children:[e.jsx(Ws,{className:"h-2.5 w-2.5"})," ",s.comments.length]}),(((P=s.attachments)==null?void 0:P.length)??0)>0&&e.jsxs("span",{className:"text-[9px] text-muted-foreground/70 flex items-center gap-0.5",children:[e.jsx(Ye,{className:"h-2.5 w-2.5"})," ",s.attachments.length]})]}),s.status==="running"&&e.jsxs("div",{className:"mt-2 space-y-1.5",children:[s.progress&&e.jsx("p",{className:"text-[10px] text-[#00d4ff]/70 truncate",children:s.progress}),s.filesLocked&&s.filesLocked.length>0&&e.jsxs("div",{className:"text-[9px] text-muted-foreground/60",children:["Editing: ",s.filesLocked.slice(0,2).map(v=>v.split("/").pop()).join(", "),s.filesLocked.length>2&&` +${s.filesLocked.length-2}`]}),e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[e.jsx("span",{children:s.tokenUsage?e.jsxs(e.Fragment,{children:[S(s.tokenUsage.total)," tokens · ",le(s.tokenUsage)]}):s.tokensUsed!=null?e.jsxs(e.Fragment,{children:[S(s.tokensUsed)," tokens"]}):null}),f&&e.jsx("span",{className:"text-[#00d4ff]",children:f})]}),s.tokenUsage&&e.jsxs("div",{className:"flex gap-2 text-[9px] text-muted-foreground/60",children:[e.jsxs("span",{children:[S(s.tokenUsage.input)," in"]}),e.jsxs("span",{children:[S(s.tokenUsage.output)," out"]})]}),e.jsxs(j,{size:"sm",variant:"destructive",className:"h-6 w-full text-[10px] gap-1",onClick:v=>{v.stopPropagation(),m(s.id)},children:[e.jsx(Qe,{className:"h-3 w-3"})," Halt"]})]}),s.status==="paused"&&s.pausedForTokens&&e.jsxs("div",{className:"mt-2 space-y-1.5",children:[e.jsxs("div",{className:"rounded border border-yellow-500/40 bg-yellow-500/10 px-2 py-1.5",children:[e.jsx("p",{className:"text-[10px] font-medium text-yellow-400",children:"Token budget exhausted"}),e.jsxs("p",{className:"text-[9px] text-yellow-300/70 mt-0.5",children:[s.tokenUsage?S(s.tokenUsage.total):"?"," / ",s.tokenBudget?S(s.tokenBudget):"?"," tokens"]})]}),e.jsxs(j,{size:"sm",variant:"outline",className:"h-6 w-full text-[10px] gap-1 border-yellow-500/40 text-yellow-300 hover:bg-yellow-500/10",onClick:v=>{v.stopPropagation(),h(s.id)},children:[e.jsx(is,{className:"h-3 w-3"})," Resume (override)"]})]}),(s.status==="pending"||s.status==="paused"&&!s.pausedForTokens)&&e.jsx("div",{className:"mt-2",children:e.jsxs(j,{size:"sm",variant:"outline",className:"h-6 w-full text-[10px] gap-1 border-[#00d4ff]/30 text-[#00d4ff] hover:bg-[#00d4ff]/10",onClick:v=>{v.stopPropagation(),h(s.id)},children:[e.jsx(Je,{className:"h-3 w-3"})," Run"]})}),s.status==="done"&&e.jsxs("div",{className:"mt-2 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground flex-wrap",children:[s.tokenUsage?e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:[S(s.tokenUsage.total)," tokens"]}),e.jsx("span",{className:"text-emerald-400 font-medium",children:le(s.tokenUsage)}),e.jsxs("span",{className:"text-muted-foreground/50",children:["(",S(s.tokenUsage.input)," in / ",S(s.tokenUsage.output)," out)"]})]}):s.tokensUsed!=null?e.jsxs("span",{children:[S(s.tokensUsed)," tokens"]}):null,s.completedAt&&e.jsx("span",{children:ne(s.completedAt)})]}),s.result&&e.jsx("button",{className:"text-[10px] text-[#00d4ff] hover:underline",onClick:v=>{v.stopPropagation(),y(!d)},children:d?"Hide result":"Show result"}),d&&s.result&&e.jsx("div",{className:"mt-1 text-[10px] rounded bg-muted/50 p-2",children:e.jsx(oe,{content:s.result,className:"prose-xs prose-invert max-w-none"})})]}),s.status==="failed"&&e.jsxs("div",{className:"mt-2 space-y-1.5",children:[s.error&&e.jsx("p",{className:"text-[10px] text-red-400 line-clamp-2",children:s.error}),s.tokenUsage&&e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[S(s.tokenUsage.total)," tokens · ",le(s.tokenUsage)]}),e.jsxs(j,{size:"sm",variant:"outline",className:"h-6 w-full text-[10px] gap-1 border-orange-400/30 text-orange-400 hover:bg-orange-400/10",onClick:v=>{v.stopPropagation(),h(s.id)},children:[e.jsx(is,{className:"h-3 w-3"})," Retry"]})]})]})}function Ct({boardId:s,open:l,onOpenChange:t,onCreated:h,allCards:m}){const[u,i]=r.useState(""),[C,f]=r.useState("normal"),[d,y]=r.useState("none"),[p,g]=r.useState(""),[o,N]=r.useState(!1),w=async()=>{if(u.trim()){N(!0);try{const k={task:u.trim(),priority:C||void 0};p&&parseInt(p)>0&&(k.tokenBudget=parseInt(p));const P=await b.boards.cards.add(s,k);d!=="none"&&P.card&&await b.boards.cards.setParent(s,P.card.id,d),i(""),f("normal"),y("none"),g(""),t(!1),h()}catch{}finally{N(!1)}}};return e.jsx(be,{open:l,onOpenChange:t,children:e.jsxs(ve,{children:[e.jsxs(ye,{children:[e.jsx(we,{children:"Add Card"}),e.jsx(We,{children:"Create a new task card for this board."})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Task"}),e.jsx(re,{placeholder:"Describe the task...",value:u,onChange:k=>i(k.target.value),rows:4})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Priority"}),e.jsxs(Fe,{value:C,onValueChange:f,children:[e.jsx(Oe,{children:e.jsx(_e,{})}),e.jsxs(He,{children:[e.jsx(q,{value:"low",children:"Low"}),e.jsx(q,{value:"normal",children:"Normal"}),e.jsx(q,{value:"high",children:"High"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Token Budget"}),e.jsx(ke,{type:"number",placeholder:"No limit",value:p,onChange:k=>g(k.target.value),min:0,step:1e3}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Max tokens before auto-pause"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Parent Card"}),e.jsxs(Fe,{value:d,onValueChange:y,children:[e.jsx(Oe,{children:e.jsx(_e,{placeholder:"None"})}),e.jsxs(He,{children:[e.jsx(q,{value:"none",children:"None"}),m.map(k=>e.jsx(q,{value:k.id,children:$(k.task,50)},k.id))]})]})]})]}),e.jsxs(Ge,{children:[e.jsx(Ze,{asChild:!0,children:e.jsx(j,{variant:"ghost",children:"Cancel"})}),e.jsxs(j,{onClick:w,disabled:!u.trim()||o,className:"bg-[#00d4ff] text-black hover:bg-[#00d4ff]/80",children:[o&&e.jsx(ee,{className:"mr-2 h-4 w-4 animate-spin"})," Add Card"]})]})]})})}function St({boardId:s,cardId:l,progress:t,onRefresh:h}){const[m,u]=r.useState([]),[i,C]=r.useState(""),[f,d]=r.useState(!1);r.useEffect(()=>{b.boards.feedback.list(s).then(p=>{const g=p.feedback.filter(o=>o.cardId===l);u(g)}).catch(()=>{})},[s,l,t]);const y=async(p,g)=>{d(!0);try{await b.boards.feedback.respond(s,p,g),u(o=>o.filter(N=>N.id!==p)),C(""),h()}catch{}finally{d(!1)}};return m.length===0?e.jsxs("div",{className:"rounded-lg border border-purple-500/30 bg-purple-500/5 p-3",children:[e.jsx("p",{className:"text-xs text-purple-300 font-medium uppercase tracking-wider mb-1",children:"Awaiting Input"}),e.jsx("p",{className:"text-sm text-purple-200/80",children:(t==null?void 0:t.replace("Awaiting feedback: ",""))||"Agent is waiting for a decision..."})]}):e.jsx("div",{className:"space-y-3",children:m.map(p=>e.jsxs("div",{className:"rounded-lg border border-purple-500/30 bg-purple-500/5 p-3 space-y-2",children:[e.jsx("p",{className:"text-xs text-purple-300 font-medium uppercase tracking-wider",children:"Decision Required"}),e.jsx("p",{className:"text-sm text-foreground",children:p.question}),p.options&&p.options.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2",children:p.options.map(g=>e.jsx(j,{size:"sm",variant:"outline",disabled:f,className:"text-xs border-purple-400/40 text-purple-300 hover:bg-purple-500/20",onClick:()=>y(p.id,g),children:g},g))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ke,{value:i,onChange:g=>C(g.target.value),placeholder:"Type a custom response...",className:"text-sm h-8",onKeyDown:g=>{g.key==="Enter"&&i.trim()&&y(p.id,i.trim())}}),e.jsx(j,{size:"sm",disabled:!i.trim()||f,className:"h-8 bg-purple-500 hover:bg-purple-600 text-white",onClick:()=>y(p.id,i.trim()),children:e.jsx(Ns,{className:"h-3 w-3"})})]})]},p.id))})}function Dt({card:s,boardId:l,allCards:t,open:h,onOpenChange:m,onRun:u,onHalt:i,onDelete:C,onRefresh:f}){var he,pe,fe,ae,ge,je;const[d,y]=r.useState("details"),[p,g]=r.useState(!1),[o,N]=r.useState(""),[w,k]=r.useState(""),[P,v]=r.useState(!1),[c,U]=r.useState(""),[F,V]=r.useState("#3b82f6"),[W,de]=r.useState(!1),G=Cs(s==null?void 0:s.startedAt,(s==null?void 0:s.status)==="running");if(!s)return null;const M=s.parentId?t.find(n=>n.id===s.parentId):null,Z=t.filter(n=>n.parentId===s.id),J=(s.dependsOn??[]).map(n=>t.find(R=>R.id===n)).filter(Boolean),ce=s.status==="running"?"Running":s.status==="pending"?"Pending":s.status==="paused"&&s.pausedForTokens?"Budget Exhausted":s.status==="paused"?"Paused":s.status==="done"?"Done":s.status==="question"?"Needs Input":"Failed",se=s.status==="running"?"text-[#00d4ff]":s.status==="done"?"text-emerald-400":s.status==="failed"?"text-red-400":s.status==="question"?"text-purple-400":s.pausedForTokens?"text-yellow-400":"text-muted-foreground",te=async()=>{try{await b.boards.cards.update(l,s.id,{task:o}),g(!1),f()}catch{}},xe=async()=>{if(w.trim()){v(!0);try{await b.boards.cards.comments.add(l,s.id,w.trim(),"user","Admin"),k(""),f()}catch{}finally{v(!1)}}},L=async n=>{try{await b.boards.cards.comments.delete(l,s.id,n),f()}catch{}},A=async()=>{if(c.trim())try{await b.boards.cards.labels.add(l,s.id,c.trim(),F),U(""),de(!1),f()}catch{}},E=async n=>{try{await b.boards.cards.labels.remove(l,s.id,n),f()}catch{}},me=async n=>{try{await b.boards.cards.attachments.delete(l,s.id,n),f()}catch{}},ue=async n=>{try{await b.boards.cards.update(l,s.id,{priority:n}),f()}catch{}},O=n=>D("px-3 py-1.5 text-xs font-medium rounded-md transition-colors",d===n?"bg-[#00d4ff]/15 text-[#00d4ff]":"text-muted-foreground hover:text-foreground hover:bg-muted/50");return e.jsx(ht,{open:h,onOpenChange:m,children:e.jsxs(vs,{className:"w-full sm:max-w-lg overflow-y-auto",children:[e.jsxs(ys,{children:[e.jsx(ws,{className:"text-base",children:"Card Details"}),e.jsx(ks,{className:"sr-only",children:"Detailed view of the selected task card."})]}),e.jsxs("div",{className:"mt-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("span",{className:D("text-sm font-semibold",se),children:ce}),e.jsxs(Fe,{value:s.priority??"normal",onValueChange:ue,children:[e.jsx(Oe,{className:"h-7 w-24 text-xs",children:e.jsx(_e,{})}),e.jsxs(He,{children:[e.jsx(q,{value:"low",children:"Low"}),e.jsx(q,{value:"normal",children:"Normal"}),e.jsx(q,{value:"high",children:"High"})]})]})]}),s.pausedForTokens&&e.jsxs("div",{className:"rounded-md border border-yellow-500/40 bg-yellow-500/10 px-3 py-2 space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-yellow-400",children:"Token budget exhausted"}),e.jsxs("p",{className:"text-[10px] text-yellow-300/70",children:["Used ",s.tokenUsage?S(s.tokenUsage.total):"?"," of ",s.tokenBudget?S(s.tokenBudget):"?"," token budget. Click Run to resume with override."]})]}),s.tokenBudget&&!s.pausedForTokens&&e.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Budget: ",S(s.tokenBudget)," tokens",s.tokenUsage?` (${S(s.tokenUsage.total)} used)`:""]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[(he=s.labels)==null?void 0:he.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium rounded px-2 py-0.5 text-white",style:{backgroundColor:n.color},children:[n.name,e.jsx("button",{onClick:()=>E(n.id),className:"hover:opacity-70",children:e.jsx(qe,{className:"h-2.5 w-2.5"})})]},n.id)),e.jsxs("button",{onClick:()=>de(!W),className:"text-[10px] text-muted-foreground hover:text-foreground flex items-center gap-0.5",children:[e.jsx(ut,{className:"h-3 w-3"})," Add Label"]})]}),W&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex flex-wrap gap-1",children:jt.map(n=>e.jsx("button",{onClick:()=>{U(n.name),V(n.color)},className:D("text-[9px] font-medium rounded px-1.5 py-0.5 text-white transition-all",c===n.name&&"ring-2 ring-white/50"),style:{backgroundColor:n.color},children:n.name},n.name))}),e.jsx(ke,{value:c,onChange:n=>U(n.target.value),placeholder:"Custom...",className:"h-6 text-xs w-20"}),e.jsx("input",{type:"color",value:F,onChange:n=>V(n.target.value),className:"h-6 w-6 rounded cursor-pointer"}),e.jsx(j,{size:"sm",onClick:A,disabled:!c.trim(),className:"h-6 text-[10px] px-2 bg-[#00d4ff] text-black",children:"Add"})]})]}),e.jsxs("div",{className:"flex gap-1 border-b border-border/50 pb-2",children:[e.jsx("button",{className:O("details"),onClick:()=>y("details"),children:"Details"}),e.jsxs("button",{className:O("activity"),onClick:()=>y("activity"),children:["Activity ",(((pe=s.activityLog)==null?void 0:pe.length)??0)>0&&e.jsx(z,{variant:"secondary",className:"ml-1 text-[9px] px-1 h-4",children:s.activityLog.length})]}),e.jsxs("button",{className:O("comments"),onClick:()=>y("comments"),children:["Comments ",(((fe=s.comments)==null?void 0:fe.length)??0)>0&&e.jsx(z,{variant:"secondary",className:"ml-1 text-[9px] px-1 h-4",children:s.comments.length})]}),e.jsxs("button",{className:O("attachments"),onClick:()=>y("attachments"),children:["Attachments ",(((ae=s.attachments)==null?void 0:ae.length)??0)>0&&e.jsx(z,{variant:"secondary",className:"ml-1 text-[9px] px-1 h-4",children:s.attachments.length})]})]}),d==="details"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Task"}),!p&&e.jsxs("button",{onClick:()=>{N(s.task),g(!0)},className:"text-[10px] text-muted-foreground hover:text-foreground flex items-center gap-0.5",children:[e.jsx(gs,{className:"h-2.5 w-2.5"})," Edit"]})]}),p?e.jsxs("div",{className:"space-y-2",children:[e.jsx(re,{value:o,onChange:n=>N(n.target.value),rows:3,className:"text-sm"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{size:"sm",onClick:te,className:"h-6 text-xs bg-[#00d4ff] text-black",children:"Save"}),e.jsx(j,{size:"sm",variant:"ghost",onClick:()=>g(!1),className:"h-6 text-xs",children:"Cancel"})]})]}):e.jsx("p",{className:"text-sm leading-relaxed text-foreground whitespace-pre-wrap",children:s.task})]}),s.progress&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Progress"}),e.jsx("p",{className:"text-sm text-[#00d4ff]/80 mt-0.5",children:s.progress})]}),s.status==="question"&&e.jsx(St,{boardId:l,cardId:s.id,progress:s.progress,onRefresh:f}),s.filesLocked&&s.filesLocked.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Files Locked"}),e.jsx("div",{className:"mt-1 space-y-0.5",children:s.filesLocked.map((n,R)=>e.jsx("p",{className:"text-[11px] font-mono text-foreground/70 truncate",children:n},R))})]}),s.tokenUsage&&e.jsxs("div",{className:"rounded-md border border-border/50 bg-muted/30 p-3 space-y-2",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Token Usage & Cost"}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-semibold text-foreground",children:S(s.tokenUsage.total)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Total"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-semibold text-[#00d4ff]",children:S(s.tokenUsage.input)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Input"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-semibold text-[#a78bfa]",children:S(s.tokenUsage.output)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Output"})]})]}),e.jsxs("div",{className:"text-center pt-1 border-t border-border/30",children:[e.jsx("p",{className:"text-sm font-semibold text-emerald-400",children:le(s.tokenUsage)}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Estimated Cost"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Created"}),e.jsx("p",{className:"text-foreground",children:ne(s.createdAt)})]}),s.startedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Started"}),e.jsx("p",{className:"text-foreground",children:ne(s.startedAt)})]}),s.completedAt&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Completed"}),e.jsx("p",{className:"text-foreground",children:ne(s.completedAt)})]}),s.status==="running"&&G&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Elapsed"}),e.jsx("p",{className:"text-[#00d4ff]",children:G})]})]}),(M||Z.length>0||J.length>0)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Dependencies"}),M&&e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(ie,{className:"h-3 w-3 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Parent:"}),e.jsx("span",{className:"text-foreground truncate",children:$(M.task,60)})]}),J.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Depends on:"}),J.map(n=>e.jsxs("div",{className:"flex items-center gap-2 text-xs pl-2",children:[e.jsx(Xe,{className:"h-2.5 w-2.5 text-muted-foreground/60"}),e.jsx("span",{className:D("truncate",n.status==="done"?"text-emerald-400 line-through":"text-foreground/70"),children:$(n.task,50)}),e.jsx(z,{variant:"secondary",className:"text-[8px] px-1 h-3.5",children:n.status})]},n.id))]}),Z.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["Children (",Z.length,"):"]}),Z.map(n=>e.jsxs("div",{className:"flex items-center gap-2 text-xs pl-2",children:[e.jsx(fs,{className:"h-2.5 w-2.5 text-muted-foreground/60"}),e.jsx("span",{className:"truncate text-foreground/70",children:$(n.task,50)}),e.jsx(z,{variant:"secondary",className:"text-[8px] px-1 h-3.5",children:n.status})]},n.id))]})]}),s.result&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Result"}),e.jsx("div",{className:"mt-1 max-h-60 overflow-y-auto rounded-md bg-muted/50 p-3",children:e.jsx(oe,{content:s.result,className:"prose-sm prose-invert max-w-none"})})]}),s.error&&e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Error"}),e.jsx("div",{className:"mt-1 rounded-md border border-red-500/20 bg-red-500/5 p-3 text-xs text-red-400 whitespace-pre-wrap",children:s.error})]})]}),d==="activity"&&e.jsxs("div",{className:"space-y-1",children:[!s.activityLog||s.activityLog.length===0?e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No activity recorded yet. Run this card to see live steps."}):e.jsx("div",{className:"relative pl-4 border-l-2 border-border/40 space-y-2 max-h-[400px] overflow-y-auto",children:[...s.activityLog].reverse().map((n,R)=>{var Ne;const X=n.type==="started"?"🚀":n.type==="tool-use"?"🔧":n.type==="thinking"?"💭":n.type==="file-lock"?"📁":n.type==="completed"?"✅":n.type==="failed"?"❌":n.type==="feedback"?"❓":"▸",Y=n.type==="completed"?"text-emerald-400":n.type==="failed"?"text-red-400":n.type==="tool-use"?"text-[#00d4ff]":n.type==="thinking"?"text-yellow-300":n.type==="feedback"?"text-purple-400":"text-muted-foreground";return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute -left-[21px] top-1 w-2.5 h-2.5 rounded-full bg-border border-2 border-background"}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-xs shrink-0",children:X}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:D("text-xs leading-relaxed",Y),children:n.message}),((Ne=n.data)==null?void 0:Ne.files)&&e.jsx("div",{className:"mt-0.5",children:n.data.files.slice(0,3).map((Me,a)=>e.jsx("p",{className:"text-[10px] font-mono text-muted-foreground/60 truncate",children:Me.split("/").pop()},a))})]}),e.jsx("span",{className:"text-[9px] text-muted-foreground/50 shrink-0 tabular-nums",children:Ie(n.timestamp)})]})]},R)})}),s.status==="running"&&e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border/30",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#00d4ff] animate-pulse"}),e.jsx("span",{className:"text-xs text-[#00d4ff]/80",children:"Agent is working..."}),s.progress&&e.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto truncate max-w-[150px]",children:s.progress})]})]}),d==="comments"&&e.jsxs("div",{className:"space-y-3",children:[(((ge=s.comments)==null?void 0:ge.length)??0)===0&&e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No comments yet. Start a conversation."}),(je=s.comments)==null?void 0:je.map(n=>e.jsxs("div",{className:D("rounded-md p-3 text-sm space-y-1",n.author==="agent"?"bg-[#00d4ff]/5 border border-[#00d4ff]/20":"bg-muted/50 border border-border/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:D("text-xs font-medium",n.author==="agent"?"text-[#00d4ff]":"text-foreground"),children:n.authorName}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:Ie(n.timestamp)})]}),e.jsx("button",{onClick:()=>L(n.id),className:"text-muted-foreground/50 hover:text-red-400",children:e.jsx(qe,{className:"h-3 w-3"})})]}),e.jsx("p",{className:"text-xs text-foreground/80 whitespace-pre-wrap",children:n.content})]},n.id)),e.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/30",children:[e.jsx(re,{value:w,onChange:n=>k(n.target.value),placeholder:"Write a comment...",rows:2,className:"text-xs flex-1",onKeyDown:n=>{n.key==="Enter"&&(n.metaKey||n.ctrlKey)&&xe()}}),e.jsx(j,{size:"sm",onClick:xe,disabled:!w.trim()||P,className:"h-8 w-8 p-0 bg-[#00d4ff] text-black hover:bg-[#00d4ff]/80 self-end",children:P?e.jsx(ee,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ns,{className:"h-3.5 w-3.5"})})]})]}),d==="attachments"&&e.jsx(At,{card:s,boardId:l,onDelete:me}),e.jsxs("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-border/50",children:[(s.status==="pending"||s.status==="paused"||s.status==="failed")&&e.jsxs(j,{size:"sm",className:"gap-1.5 bg-[#00d4ff] text-black hover:bg-[#00d4ff]/80",onClick:()=>{u(s.id),m(!1)},children:[e.jsx(Je,{className:"h-3.5 w-3.5"})," ",s.status==="failed"?"Retry":"Run"]}),s.status==="running"&&e.jsxs(j,{size:"sm",variant:"destructive",className:"gap-1.5",onClick:()=>{i(s.id),m(!1)},children:[e.jsx(Qe,{className:"h-3.5 w-3.5"})," Halt"]}),e.jsxs(Ce,{children:[e.jsx(Se,{asChild:!0,children:e.jsxs(j,{size:"sm",variant:"ghost",className:"gap-1.5 text-red-400 hover:text-red-300",children:[e.jsx(Ue,{className:"h-3.5 w-3.5"})," Delete"]})}),e.jsxs(De,{children:[e.jsxs(Ae,{children:[e.jsx(Te,{children:"Delete card?"}),e.jsx(Pe,{children:"This card will be permanently removed."})]}),e.jsxs(Le,{children:[e.jsx(Ee,{children:"Cancel"}),e.jsx(Be,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{C(s.id),m(!1)},children:"Delete"})]})]})]})]})]})]})})}function At({card:s,boardId:l,onDelete:t}){var p,g;const[h,m]=r.useState(null),[u,i]=r.useState(""),[C,f]=r.useState(!1),d=async o=>{if(h===o.id){m(null);return}m(o.id),f(!0);try{const N=await b.boards.cards.attachments.content(l,s.id,o.id);i(N.content)}catch{i("Failed to load file content.")}finally{f(!1)}},y=o=>{const N=b.boards.cards.attachments.downloadUrl(l,s.id,o.id),w=document.createElement("a");w.href=N,w.download=o.name,w.click()};return e.jsxs("div",{className:"space-y-3",children:[(((p=s.attachments)==null?void 0:p.length)??0)===0&&e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No attachments. Documents generated by the agent will appear here."}),(g=s.attachments)==null?void 0:g.map(o=>{const N=Nt[o.type]??Ye,w=o.type==="markdown"||o.type==="document",k=o.type==="image",P=h===o.id;return e.jsxs("div",{className:"rounded-md border border-border/50 bg-muted/30 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3",children:[e.jsx("div",{className:D("h-9 w-9 rounded-md flex items-center justify-center shrink-0",o.type==="markdown"?"bg-emerald-500/15 text-emerald-400":o.type==="image"?"bg-purple-500/15 text-purple-400":"bg-muted text-muted-foreground"),children:e.jsx(N,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[e.jsx("span",{className:"capitalize",children:o.type}),o.size!=null&&e.jsxs("span",{children:[(o.size/1024).toFixed(1)," KB"]}),e.jsx("span",{children:Ie(o.addedAt)}),e.jsxs("span",{children:["by ",o.addedBy]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[(w||k)&&e.jsx("button",{onClick:()=>d(o),className:D("p-1.5 rounded-md transition-colors",P?"bg-[#00d4ff]/15 text-[#00d4ff]":"text-muted-foreground/50 hover:text-foreground"),title:"Preview",children:e.jsx(tt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>y(o),className:"p-1.5 text-muted-foreground/50 hover:text-foreground",title:"Download",children:e.jsx(at,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>t(o.id),className:"p-1.5 text-muted-foreground/50 hover:text-red-400",title:"Delete",children:e.jsx(Ue,{className:"h-3.5 w-3.5"})})]})]}),P&&e.jsx("div",{className:"border-t border-border/30 bg-background/50",children:C?e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(ee,{className:"h-5 w-5 animate-spin text-[#00d4ff]"})}):k?e.jsx("div",{className:"p-3",children:e.jsx("img",{src:b.boards.cards.attachments.downloadUrl(l,s.id,o.id),alt:o.name,className:"max-w-full max-h-96 rounded-md mx-auto"})}):e.jsx("div",{className:"p-3 max-h-96 overflow-y-auto",children:e.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none text-xs",children:e.jsx(oe,{content:u})})})})]},o.id)})]})}function oe({content:s}){const l=s.split(`
|
|
42
|
+
`),t=[];let h=!1,m=[];for(let u=0;u<l.length;u++){const i=l[u];if(i.startsWith("```")){h?(t.push(e.jsx("pre",{className:"rounded-md bg-muted p-3 text-[11px] font-mono overflow-x-auto my-2",children:e.jsx("code",{children:m.join(`
|
|
43
|
+
`)})},u)),m=[],h=!1):(h=!0,i.slice(3).trim());continue}if(h){m.push(i);continue}i.startsWith("# ")?t.push(e.jsx("h1",{className:"text-lg font-bold mt-3 mb-1",children:K(i.slice(2))},u)):i.startsWith("## ")?t.push(e.jsx("h2",{className:"text-base font-semibold mt-2 mb-1",children:K(i.slice(3))},u)):i.startsWith("### ")?t.push(e.jsx("h3",{className:"text-sm font-semibold mt-2 mb-0.5",children:K(i.slice(4))},u)):i.startsWith("- ")||i.startsWith("* ")?t.push(e.jsx("li",{className:"ml-4 list-disc text-foreground/80",children:K(i.slice(2))},u)):/^\d+\.\s/.test(i)?t.push(e.jsx("li",{className:"ml-4 list-decimal text-foreground/80",children:K(i.replace(/^\d+\.\s/,""))},u)):i.startsWith("> ")?t.push(e.jsx("blockquote",{className:"border-l-2 border-[#00d4ff]/40 pl-3 text-muted-foreground italic my-1",children:K(i.slice(2))},u)):i.trim()===""?t.push(e.jsx("div",{className:"h-2"},u)):t.push(e.jsx("p",{className:"text-foreground/80 my-0.5",children:K(i)},u))}return h&&m.length>0&&t.push(e.jsx("pre",{className:"rounded-md bg-muted p-3 text-[11px] font-mono overflow-x-auto my-2",children:e.jsx("code",{children:m.join(`
|
|
44
|
+
`)})},"unclosed")),e.jsx(e.Fragment,{children:t})}function K(s){const l=[];let t=s,h=0;for(;t.length>0;){const m=t.match(/^(.*?)`([^`]+)`/);if(m){m[1]&&l.push(e.jsx("span",{children:m[1]},h++)),l.push(e.jsx("code",{className:"bg-muted px-1 py-0.5 rounded text-[10px] font-mono text-[#00d4ff]",children:m[2]},h++)),t=t.slice(m[0].length);continue}const u=t.match(/^(.*?)\*\*([^*]+)\*\*/);if(u){u[1]&&l.push(e.jsx("span",{children:u[1]},h++)),l.push(e.jsx("strong",{children:u[2]},h++)),t=t.slice(u[0].length);continue}l.push(e.jsx("span",{children:t},h++));break}return e.jsx(e.Fragment,{children:l})}export{la as KanbanPage};
|
|
45
|
+
//# sourceMappingURL=Kanban-DRlNiNRF.js.map
|