diff --git a/.agents/mcp_config.json b/.agents/mcp_config.json new file mode 100644 index 0000000..6b39384 --- /dev/null +++ b/.agents/mcp_config.json @@ -0,0 +1,22 @@ +{ + "mcpServers": { + "mc2-memory": { + "command": "python", + "args": [ + "F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py" + ] + }, + "mc2-system": { + "command": "python", + "args": [ + "F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_mc.py" + ] + }, + "mc2-web": { + "command": "python", + "args": [ + "F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_web.py" + ] + } + } +} diff --git a/AGENTS.md b/AGENTS.md index 41ebe60..137a149 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,6 +24,12 @@ Engine (llama-swap) · Builtin-Routing-Gateway (`model: auto`) · MC2 (FastAPI + dem Deploy auf Gitea liegen**, und uncommittete Box-Änderungen gehen verloren (Absicht). - **Nie direkt auf `main` arbeiten.** Immer Branch (`wartung/...`), Gate grün, dann Merge/Deploy. +## Agentic IDE & Vibe Coding +- **Zero Middle-Layers:** Coding passiert zu 100% lokal auf dem Dev-PC in der **OpenCode Desktop IDE**. +- Es gibt keinen Zed-Workflow, keine OpenCode-CLI-Mittelschicht und keinen Governor mehr. +- Der Agent in OpenCode Desktop nutzt via MCP (`.agents/mcp_config.json`) die API der Box (`:9001/v1`), um autonom Projekte zu bauen. +- **Mix-Ansatz beim Testen:** Der Agent testet lokal. Vor dem Push muss er prüfen, ob das Gitea-`VERIFY`-Skript fehlerfrei durchläuft. + ## Zeit & Umgebung - **Box = Ubuntu, läuft in `Europe/Berlin`** (seit 03.07.2026; vorher UTC). Dev-PC = Windows. Naive/lokale Zeiten immer über `MC_LOCAL_TZ` (= `Europe/Berlin`) auflösen, nie `datetime.now()` ohne TZ annehmen diff --git a/README.md b/README.md index d70d120..9ea49bd 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ prüft sich selbst und meldet sich, wenn etwas nicht stimmt. | Bahn | Was sie tut | Wo | |---|---|---| | **Steuerzentrale** | Modelle, Routing, Wartung, Gedächtnis, Ideen-Queue, Auftragsbuch | MC2 `:9001` | -| **Coding** | Zed + OpenCode am Tag, `opencode-lauf.sh` in der Nacht — **ein Regelwerk, zwei Auslöser** | Governor `:8100` | +| **Coding** | Agentic IDE (z.B. OpenCode Desktop) auf Dev-PC via lokaler API + MCP | 100% lokal | | **Lucy** | Sprach-Companion mit 3D-Avatar, Augen und Ohren | eigenes Repo `Hitonabi/lucy` | Lucy holt ihr Hirn über MC2, spricht aber nie durch den Governor — ein Gespräch ist keine @@ -23,31 +23,31 @@ Bau-Sitzung und wird nie unterbrochen. | Port | Dienst | Erreichbar | |---|---|---| | `9001` | **MC2** (FastAPI + React) — Cockpit, API, Konsole | LAN | -| `8100` | **Governor** — Token-Wächter vor dem Gateway | LAN | + | `8080` | **llama-swap** — Modell-Router | LAN | | `9010` | `mc2-gateway` — `/v1`-Datenpfad (`model: auto`, Bild-Weiche) | loopback | | `8642` · `9119` | Hermes-Gateway · Hermes-Web-UI | loopback | | `8765` · `8650` | Mem0-Sidecar · Voice-Sidecar (STT/TTS) | loopback | | `7682` | ttyd — Box-Konsole, same-origin unter `/console/` | loopback | -Units in [`deploy/`](deploy/): `mission-control-2` · `mc2-gateway` · `mc2-steward` · `governor` · +Units in [`deploy/`](deploy/): `mission-control-2` · `mc2-gateway` · `mc2-steward` · `mem0-service` · `voice-service` · `box-console` · `hermes-builtin-ui` + Timer für Backup, Auto-Update, Self-Smoke und Bagatell-Annahme. `llama-swap` läuft als System-Unit. ## Der Weg einer Idee ``` -Idee in MC2 → Gitea-Repo (mit CI-Ampel + VERIFY) → in Zed bauen → Ampel → main - └── oder nachts: Hermes-Cron → opencode-lauf.sh → dieselben Regeln +Idee in MC2 → Gitea-Repo (mit CI-Ampel + VERIFY) → in Agentic IDE bauen → Ampel → main + └── autonomes Vibe Coding via OpenCode Desktop + MCP ``` Jedes neue Repo wird von [`deploy/gitea-repo-create.sh`](deploy/gitea-repo-create.sh) **mit beiden Wächtern geboren**: - **`.gitea/workflows/ci.yml`** — die Außen-Prüfung nach dem Push (Gitea Actions) -- **`VERIFY`** — die Innen-Prüfung: eine Zeile, wie man das Projekt testet. Das OpenCode-Plugin - führt sie nach jeder Etappe aus und gibt rote Tests dem Agenten **sofort** zurück, statt sie - erst der CI zu zeigen. Keine `VERIFY`-Datei = Prüf-Tor aus. +- **`VERIFY`** — die Innen-Prüfung: eine Zeile, wie man das Projekt testet. Die Agentic IDE + führt sie im Mix-Ansatz vor jedem Push aus, um Code-Fehler ("Quality Gap") abzufangen. + Keine `VERIFY`-Datei = Prüf-Tor aus. ## Modelle & Rollen @@ -75,13 +75,8 @@ Messwerte: [`docs/wissen/VERDIKTE.md`](docs/wissen/VERDIKTE.md). ## Qualitäts-Tore -1. **Werkzeug-Zaun** ([`deploy/opencode/plugin/`](deploy/opencode/plugin/)) — blockt `git push`, - `rm -rf`, `sudo`, `curl | sh` und Fremd-Hosts im Agentenlauf. -2. **Prüf-Tor** — `VERIFY` nach jeder Etappe; rot → der Agent repariert selbst weiter (max. 3 Runden). -3. **Governor** ([`deploy/governor/`](deploy/governor/)) — zählt Tokens ehrlich (aus den echten - `usage.prompt_tokens` jeder Antwort, selbstkalibrierend). Bei ~45.000: Savepoint schreiben und - Sitzung sauber beenden. Bei ~50.000: harter Riegel. Sichtbar als Kachel im Cockpit. -4. **CI-Ampel** — Lint (ruff) · Import/Syntax (compileall) · Frontend-Build. Läuft bei jedem Push. +1. **Prüf-Tor** — `VERIFY` nach jeder Etappe; rot → der Agent (OpenCode Desktop) repariert lokal nach. +2. **CI-Ampel** — Lint (ruff) · Import/Syntax (compileall) · Frontend-Build. Läuft in Gitea. Gemeinsame Lehre dahinter: **Wissen lebt in Datei + git, nicht im schrumpfenden Chat-Kontext.** Kontext-Komprimierung löscht still die Regeln mit. @@ -98,7 +93,7 @@ Kontext-Komprimierung löscht still die Regeln mit. ## API (Auswahl) `health · models/* · discover · fit · groups · routing/* · system/* · maintenance/* · connect · -memory/* · agent/* · **governor** · ideen/* · auftragsbuch/* · chronik · eigenleben · wissen · +memory/* · agent/* · ideen/* · auftragsbuch/* · chronik · eigenleben · wissen · zeitmaschine/* · reminders/* · voice/* · events (SSE)` OpenAI-kompatibel: `/v1/chat/completions`, `/v1/completions`. MCP-Server: [`mcp/`](mcp/). @@ -128,13 +123,12 @@ Dienst-Neustart. Vor jedem Commit lohnt der Ampel-Vorlauf: `ruff check .` und `n | `MC_LLAMA_SWAP_URL` | `http://127.0.0.1:8080` | Engine/Router | | `MC_CONFIG_PATH` | `/etc/llama-swap/config.yaml` | llama-swap-Config | | `MC_V1_UPSTREAM` | – | gesetzt → `/v1` geht an `mc2-gateway` (`:9010`) statt in-process | -| `MC_GOVERNOR_URL` | `http://127.0.0.1:8100` | Token-Wächter für die Cockpit-Kachel | + | `MC_ENGINE_PATH` | `/opt/llamacpp-vulkan` | aktive Engine (Vulkan-Build) | | `MC_REWARM_ENABLED` | `1` | Warm-Set-Wächter (auf der Box bewusst `0`) | | `MC_DRAFTS_DIR` · `MC_SPEC_TYPE` | `$MODELS/drafts` · `draft-simple` | Spekulatives Dekodieren | -Governor-eigene Schalter (`GOV_THRESHOLD`, `GOV_HARD_CEILING`, `GOV_EXEMPT_MODELS`, …): -[`deploy/governor/README.md`](deploy/governor/README.md). + ## Weiterlesen @@ -146,5 +140,5 @@ Governor-eigene Schalter (`GOV_THRESHOLD`, `GOV_HARD_CEILING`, `GOV_EXEMPT_MODEL | [`docs/AUFTRAGSBUCH.md`](docs/AUFTRAGSBUCH.md) | Vorschlags-Inbox und das Ein-Klick-Gate | | [`docs/wissen/VERDIKTE.md`](docs/wissen/VERDIKTE.md) | **Finale Technik-Entscheide — nicht neu aufrollen** | | [`docs/wissen/FALLEN.md`](docs/wissen/FALLEN.md) · [`docs/wissen/OFFENE-FAEDEN.md`](docs/wissen/OFFENE-FAEDEN.md) | Stolpersteine · offene Punkte | -| [`deploy/opencode/README.md`](deploy/opencode/README.md) | Coding-Bahn: Mannschaft, Verteilung, Fallen | + | [`AGENTS.md`](AGENTS.md) | Arbeitsregeln für Agenten in diesem Repo | diff --git a/backend/routers/ideen.py b/backend/routers/ideen.py index eef0110..00e0023 100644 --- a/backend/routers/ideen.py +++ b/backend/routers/ideen.py @@ -11,7 +11,7 @@ router = APIRouter(prefix="/api") class IdeeIn(BaseModel): titel: str notiz: str = "" - welt: str = "box" # "box" = Werkstatt baut · "ide" = vorbereiten für Zed + welt: str = "box" # "box" = Werkstatt baut · "ide" = vorbereiten für Agentic IDE tiefe: str = "" # nur ide: "simpel" | "gruendlich" (leer = Box schätzt selbst) ziel: str = "" # nur ide-Projekt: "lxc" | "docker" (leer = Box entscheidet) art: str = "projekt" # nur ide: "projekt" (Repo+Roadmap+Bau) | "idee" (nur durchdenken) diff --git a/backend/services/ideen.py b/backend/services/ideen.py index 3ff278e..94b612a 100644 --- a/backend/services/ideen.py +++ b/backend/services/ideen.py @@ -392,12 +392,12 @@ def add_idea(titel: str, notiz: str = "", created_by: str = "mc2-ui", welt='ide': geht DIREKT an das Profil `projektstart` (am Triage/Auto-Zerleger vorbei) — die Box härtet ein Konzept (konzept-fliessband), legt ein leeres Gitea-Repo an und füllt es NUR mit Doku. Ergebnis ist ein vorbereitetes Projekt, das der Commander in - Zed selbst baut (IDE-Welt). Bewusst KEIN --triage: so fasst der Auto-Zerleger die + Agentic IDE selbst baut (IDE-Welt). Bewusst KEIN --triage: so fasst der Auto-Zerleger die Karte nie an und die Werkstatt baut sie nie (der Fan-out-Fehler vom 20.07.). tiefe (nur ide): 'simpel' | 'gruendlich' — vom Knopf gewaehlte Konzept-Tiefe; leer = die Box schaetzt selbst (Fallback fuer Telegram/Lucy). ziel (nur ide-Projekt): 'lxc' | 'docker' — Ziel-Plattform; leer = die Box entscheidet. - art (nur ide): 'projekt' (Default, Repo+Doku+Roadmap, Bau in Zed) oder 'idee' + art (nur ide): 'projekt' (Default, Repo+Doku+Roadmap, Bau in IDE) oder 'idee' (Produkt-Idee nur durchdenken: NUR Konzept, keine Roadmap/Geruest, kein Bau-Druck).""" if not _available(): return {"ok": False, "error": "Die Ideen-Queue lebt auf der Box."} @@ -456,7 +456,7 @@ def add_idea(titel: str, notiz: str = "", created_by: str = "mc2-ui", "[Ideen-Queue]", "ideen-queue", "silent") elif welt == "ide": announce.add(f"Neues IDE-Projekt in Vorbereitung: „{titel}“ ({task['id']}) — die Box " - "härtet das Konzept und legt das Repo an, dann baust du in Zed.", + "härtet das Konzept und legt das Repo an, dann baust du in der Agentic IDE.", "[Ideen-Queue]", "ideen-queue", "silent") else: announce.add(f"Neue Idee in der Queue: „{titel}“ ({task['id']}) — die Box arbeitet sie aus.", @@ -515,10 +515,10 @@ def archive_task(task_id: str) -> dict: _EINORDNEN_SYS = ( "Du ordnest eine frisch getippte Projekt-Idee ein. Antworte AUSSCHLIESSLICH mit einem " "JSON-Objekt, ohne Prosa, ohne Codezaun:\n" - '{"wer":"box"|"zed","tiefe":"schlank"|"gruendlich","nur_denken":true|false}\n\n' + '{"wer":"box"|"ide","tiefe":"schlank"|"gruendlich","nur_denken":true|false}\n\n' "wer=box: Aufgabe am eigenen Heimlabor des Nutzers — seine Server, seine bestehenden " "Dienste (Mission Control, Lucy, Rippy), Wartung, Doku, Automatisierung. Die Box baut selbst.\n" - "wer=zed: ein NEUES eigenstaendiges Programm/Werkzeug/App, das der Nutzer danach selbst " + "wer=ide: ein NEUES eigenstaendiges Programm/Werkzeug/App, das der Nutzer danach selbst " "programmieren will. Er bekommt nur ein vorbereitetes Repo.\n" "tiefe=gruendlich: gross, vage oder mit vielen offenen Entwurfsfragen. " "tiefe=schlank: klein und klar umrissen.\n" @@ -564,11 +564,11 @@ def einordnen(text: str) -> dict: except Exception: return {"ok": False} - wer = d.get("wer") if d.get("wer") in ("box", "zed") else None + wer = d.get("wer") if d.get("wer") in ("box", "ide") else None tiefe = d.get("tiefe") if d.get("tiefe") in ("schlank", "gruendlich") else None if wer is None and tiefe is None: return {"ok": False} - return {"ok": True, "wer": wer or "zed", "tiefe": tiefe or "schlank", + return {"ok": True, "wer": wer or "ide", "tiefe": tiefe or "schlank", "nur_denken": bool(d.get("nur_denken"))} @@ -981,7 +981,7 @@ def konzept_of(task_id: str) -> dict: _AUS_IDEE_KOPF = ( "AUFTRAGS-ART: PROJEKT AUS GEPRUEFTER IDEE. Der Commander hat diese Idee erst durchdenken " "lassen — das Konzept gefaellt ihm, jetzt soll daraus ein startklares Repo werden, das er " - "SELBST in Zed baut.") + "SELBST in der Agentic IDE baut.") _AUS_IDEE_FUSS = ( "· Denk das Konzept NICHT neu. Es ist bereits mit voller Kaskade + Advocatus Diaboli " "gehaertet. Lies es vollstaendig und uebernimm es; eine kurze Nachschaerf-Runde fuer die " @@ -989,7 +989,7 @@ _AUS_IDEE_FUSS = ( "Verschwendung.\n" "· Der Rest ist deine normale Projektstart-Rolle: das Repo enthaelt am Ende NUR Doku " "(KONZEPT.md, ROADMAP.md, AGENTS.md, README.md, SAVEPOINT.md, .aiexclude) — KEIN Code.\n" - "· Uebergabe wie ueblich: Repo-URL nennen, damit der Commander in Zed loslegen kann.") + "· Uebergabe wie ueblich: Repo-URL nennen, damit der Commander in der Agentic IDE loslegen kann.") def _wo_liegt(konz: dict) -> str: @@ -1090,7 +1090,7 @@ def projekt_aus_idee(task_id: str, ziel: str = "", tiefe: str = "") -> dict: try: from services import announce announce.add(f"Aus der Idee „{_kurz(kurz, 60)}“ wird ein Projekt: {task['id']} — die Box " - "bereitet das Repo vor, gebaut wird in Zed.", + "bereitet das Repo vor, gebaut wird in der Agentic IDE.", "[Ideen-Queue]", "ideen-queue", "silent") except Exception: pass diff --git a/deploy/projektstart-SOUL.md b/deploy/projektstart-SOUL.md index dc4fbd0..3569c86 100644 --- a/deploy/projektstart-SOUL.md +++ b/deploy/projektstart-SOUL.md @@ -1,12 +1,12 @@ # Projektstart-Worker (Profil „projektstart") — IDE-Vorbereiter Du bist der **IDE-Vorbereiter** der AI-Box. Du bearbeitest EINE Kanban-Aufgabe: eine Idee des -Commanders, die er **selbst in seiner IDE (Zed / OpenCode) bauen** will — nicht die Box. +Commanders, die er **selbst in der Agentic IDE bauen** will — nicht die Box. Dein Ergebnis ist **kein Code**, sondern ein **startklares, leeres Projekt-Repo**: ein -wasserdicht durchdachtes Konzept plus alle Steuerungs-Dokumente, mit denen der Commander in Zed +wasserdicht durchdachtes Konzept plus alle Steuerungs-Dokumente, mit denen der Commander in der Agentic IDE dem Coder sofort einen sauberen Auftrag geben kann. Du denkst und bereitest vor — **gebaut wird -in Zed, von ihm.** +in der Agentic IDE, von ihm.** ## Schritt 0: WIEDERAUFNAHME — immer zuerst, nie aus Reflex neu anfangen @@ -84,13 +84,13 @@ genau diese Dateien — sonst **nichts**, kein Code, kein Gerüst: offene Entscheidungen, was der Advocatus Diaboli geprüft hat). - **`ROADMAP.md`** — der Etappen-/Meilenstein-Plan aus dem Konzept: jede Etappe für sich lauffähig, in Reihenfolge, mit klarem „fertig wenn …". -- **`AGENTS.md`** — Arbeits-Konventionen für den Zed-Coder (nach dem `projekt-start`-Ritual): +- **`AGENTS.md`** — Arbeits-Konventionen für die Agentic IDE (nach dem `projekt-start`-Ritual): Deutsch/Nicht-Entwickler, Plan-vor-Code, kleine Schritte, beweisen statt behaupten, Savepoints, Box-Modelle je Aufgabe (plan=heavy, build=coder). Kurz, konkret, projektbezogen. **Ganz oben hinein — wörtlich:** „Dieses Projekt ist von der AI-Box vorbereitet: KONZEPT.md ist bereits gehärtet, ROADMAP.md ist der Plan. Beim ersten Chat den Skill **`projekt-uebernehmen`** nutzen (einlesen → nachfragen → Etappe 1) — das Konzept wird NICHT neu geplant." - Das ist die Übergabe an den Agenten in Zed; ohne diese Zeile fängt er womöglich von vorn an. + Das ist die Übergabe an die Agentic IDE; ohne diese Zeile fängt er womöglich von vorn an. **Dazu diese drei HARTEN Regeln — wörtlich in die AGENTS.md (Wasserdicht-Runde 22.07., Lehre aus rippy: Prosa-Regeln wurden komplett ignoriert, darum stehen sie ab jetzt überall):** „1. Die **CI-Ampel** (Gitea Actions, liegt seit der Repo-Anlage unter `.gitea/workflows/ci.yml` — @@ -100,9 +100,9 @@ genau diese Dateien — sonst **nichts**, kein Code, kein Gerüst: ‚MakeMKV lossless' wurde still durch lossy HandBrake ersetzt.) 3. Deployment NUR über `./deploy.sh` (idempotent, EIN fester Compose-Projektname) — nie freihändig per SSH zusammenbauen. (rippy-Lehre: Doppel-Anlage `Rippy`+`rippy` auf der VM.)" -- **`README.md`** — was das Projekt ist, in Alltagssprache; erste Schritte zum Loslegen in Zed. -- **`SAVEPOINT.md`** — Startzustand: „vorbereitet — Bau beginnt in Zed", Stand/nächste Schritte/ - offene Fragen (lebendes Übergabe-Dokument für den ersten Zed-Chat). +- **`README.md`** — was das Projekt ist, in Alltagssprache; erste Schritte zum Loslegen in der Agentic IDE. +- **`SAVEPOINT.md`** — Startzustand: „vorbereitet — Bau beginnt in der Agentic IDE", Stand/nächste Schritte/ + offene Fragen (lebendes Übergabe-Dokument für den ersten Chat). - **`.aiexclude`** — gitignore-Syntax: was die KI NICHT lesen soll (`.env`, Secrets, große Daten). Committe (`git add -A && git commit`) und pushe auf **main dieses NEUEN Repos** — das ist korrekt: @@ -112,7 +112,7 @@ Prüfe nach dem Push mit `git ls-remote origin main`, dass es wirklich angekomme ### 4. Übergabe — `kanban_complete` Schließe die Karte mit einer Zusammenfassung ab, die das Auftragsbuch dem Commander zeigt: -> „Projekt **** ist vorbereitet. Repo: ``. Öffne es in Zed und wirf dem Coder +> „Projekt **** ist vorbereitet. Repo: ``. Öffne es in der Agentic IDE und wirf dem Coder > **KONZEPT.md** vor — der Plan steht in **ROADMAP.md**. Die Box baut ab hier nicht mehr mit." Nenne knapp, was das Konzept-Härten ergab (Rollen-Cast, was der Skeptiker fand, welche Etappen). @@ -130,7 +130,7 @@ DURCHDACHT haben — er hat sich NICHT entschieden, sie zu bauen. Dann gilt abwe `AGENTS.md`, KEIN `SAVEPOINT.md`, KEIN `.aiexclude`, kein Geruest. Das entsteht erst, wenn der Commander die Idee spaeter als Projekt startet. - Schritt 4 (Uebergabe) NICHT als Bau-Aufforderung: sag, was die Idee waere, was sie braeuchte und - was dagegen spricht — und dass die Entscheidung bei ihm liegt. Kein „oeffne in Zed und bau". + was dagegen spricht — und dass die Entscheidung bei ihm liegt. Kein „öffne in der IDE und bau". ## Sonderfall: „UEBERARBEITUNG" (der Commander hat das Konzept gelesen) Steht im Auftrag **`AUFTRAGS-ART: IDEE PRUEFEN — UEBERARBEITUNG`**, existiert das Konzept schon diff --git a/deploy/setup_autonomous_crons.sh b/deploy/setup_autonomous_crons.sh index 90b525c..7711cbd 100644 --- a/deploy/setup_autonomous_crons.sh +++ b/deploy/setup_autonomous_crons.sh @@ -31,7 +31,7 @@ $HERMES cron create --name trend-radar --deliver origin "15 5 * * 6" "Führe den $HERMES cron create --name pruefstand --deliver origin "0 1 * * 0" "Prüfe, ob offene Prüfstand-Tickets im Kanban liegen. Wenn ja, führe den 'pruefstand' Skill aus." # 4. LLM Wiki: Jeden Montag um 03:00 -$HERMES cron create --name llm-wiki --deliver origin "0 3 * * 1" "Führe den 'llm_wiki' Skill aus. Analysiere den Code und aktualisiere autonom die Wissensdatenbank in docs/wissen/." +$HERMES cron create --name llm-wiki --deliver origin "0 3 * * 1" "Führe den 'llm_wiki' Skill aus. Analysiere den Code und aktualisiere autonom die Wissensdatenbank in ~/wissens-vault/." echo "Autonome Crons erfolgreich eingerichtet!" $HERMES cron list diff --git a/docs/wissen/UEBERGABE-DREI-WELTEN.md b/docs/wissen/UEBERGABE-DREI-WELTEN.md index 0fcb0c0..e8ff8c5 100644 --- a/docs/wissen/UEBERGABE-DREI-WELTEN.md +++ b/docs/wissen/UEBERGABE-DREI-WELTEN.md @@ -1,5 +1,7 @@ # ÜBERGABE: Drei-Welten-Umbau (19.07.2026) — letzter Claude-Stand +> [!WARNING] +> **UPDATE (August 2026):** Der hier beschriebene "Zed + OpenCode CLI"-Workflow wurde durch das "Zero Middle-Layers"-Prinzip ersetzt. Coding passiert jetzt zu 100% in der **OpenCode Desktop** Agentic IDE via MCP. Die technischen Entscheidungen zur Box und zu Gitea bleiben jedoch gültig. **Dieses Dokument ist die finale Übergabe der externen Claude-Sessions an die Box.** Alles Wichtige aus dem Umbau vom 19.07. steht HIER (nicht nur im Claude-Gedächtnis, das mit dem Abo-Ende unlesbar wird). Bei Widerspruch zu älteren Dokumenten gilt dieses. diff --git a/frontend/dist/assets/AgentView-C4FGklqQ.js b/frontend/dist/assets/AgentView-LlJDd33l.js similarity index 99% rename from frontend/dist/assets/AgentView-C4FGklqQ.js rename to frontend/dist/assets/AgentView-LlJDd33l.js index 8ecd141..c18a779 100644 --- a/frontend/dist/assets/AgentView-C4FGklqQ.js +++ b/frontend/dist/assets/AgentView-LlJDd33l.js @@ -1,4 +1,4 @@ -import{c as A,K as P,l as M,b as B,u as D,r as z,j as e,M as T,e as a,N as g,O as b,Q as W,x as f,W as j,R as G,X as I,C as N,g as y,q as i}from"./index-B1_ue-6-.js";/** +import{c as A,K as P,l as M,b as B,u as D,r as z,j as e,M as T,e as a,N as g,O as b,Q as W,x as f,W as j,R as G,X as I,C as N,g as y,q as i}from"./index-CUuKs_1x.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/AuftragsbuchView-Czf9cRFv.js b/frontend/dist/assets/AuftragsbuchView-C2dG-lAH.js similarity index 99% rename from frontend/dist/assets/AuftragsbuchView-Czf9cRFv.js rename to frontend/dist/assets/AuftragsbuchView-C2dG-lAH.js index 4d9b987..6a07a75 100644 --- a/frontend/dist/assets/AuftragsbuchView-Czf9cRFv.js +++ b/frontend/dist/assets/AuftragsbuchView-C2dG-lAH.js @@ -1,4 +1,4 @@ -import{c as W,a3 as G,a4 as H,u as T,b as F,r as b,j as e,U as O,e as y,L as m,C as E,a0 as P,G as _,a2 as z,a5 as R,a6 as V,X as D,T as C,I as K,g as $,a7 as q,q as U}from"./index-B1_ue-6-.js";import{S,H as Q}from"./SectionLabel-Bm9VMRua.js";import{C as M}from"./chevron-down-CxeBPXxe.js";/** +import{c as W,a3 as G,a4 as H,u as T,b as F,r as b,j as e,U as O,e as y,L as m,C as E,a0 as P,G as _,a2 as z,a5 as R,a6 as V,X as D,T as C,I as K,g as $,a7 as q,q as U}from"./index-CUuKs_1x.js";import{S,H as Q}from"./SectionLabel-SQgndpwc.js";import{C as M}from"./chevron-down-MK8qZkE9.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ChronikView-Dk5QIymr.js b/frontend/dist/assets/ChronikView-BB9XGeGn.js similarity index 99% rename from frontend/dist/assets/ChronikView-Dk5QIymr.js rename to frontend/dist/assets/ChronikView-BB9XGeGn.js index d8e0efc..85500fe 100644 --- a/frontend/dist/assets/ChronikView-Dk5QIymr.js +++ b/frontend/dist/assets/ChronikView-BB9XGeGn.js @@ -1,4 +1,4 @@ -import{c as d,ab as S,r as h,j as e,ac as M,L as p,a2 as z,a7 as C,ad as D,ae as A,e as B,af as Z,u as E,b as L,g as k,q}from"./index-B1_ue-6-.js";import{R as j}from"./rotate-ccw-KIERrTyE.js";/** +import{c as d,ab as S,r as h,j as e,ac as M,L as p,a2 as z,a7 as C,ad as D,ae as A,e as B,af as Z,u as E,b as L,g as k,q}from"./index-CUuKs_1x.js";import{R as j}from"./rotate-ccw-BtnOKhJQ.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ConnectView-BMtGTagE.js b/frontend/dist/assets/ConnectView-nzWBlbXD.js similarity index 98% rename from frontend/dist/assets/ConnectView-BMtGTagE.js rename to frontend/dist/assets/ConnectView-nzWBlbXD.js index e8f74b8..be2858c 100644 --- a/frontend/dist/assets/ConnectView-BMtGTagE.js +++ b/frontend/dist/assets/ConnectView-nzWBlbXD.js @@ -1,4 +1,4 @@ -import{c as x,r as c,D as I,F as A,j as e,G as f,x as B,B as z,I as H,e as M,L as E,J as T,C as F}from"./index-B1_ue-6-.js";import{C as K}from"./chevron-down-CxeBPXxe.js";import{F as O}from"./folder-open-BJ80fZwG.js";/** +import{c as x,r as c,D as I,F as A,j as e,G as f,x as B,B as z,I as H,e as M,L as E,J as T,C as F}from"./index-CUuKs_1x.js";import{C as K}from"./chevron-down-MK8qZkE9.js";import{F as O}from"./folder-open-CbSQGCoL.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/GuideView-CYIumbOa.js b/frontend/dist/assets/GuideView-D3weMCzU.js similarity index 99% rename from frontend/dist/assets/GuideView-CYIumbOa.js rename to frontend/dist/assets/GuideView-D3weMCzU.js index a0594cd..cee6a39 100644 --- a/frontend/dist/assets/GuideView-CYIumbOa.js +++ b/frontend/dist/assets/GuideView-D3weMCzU.js @@ -1,4 +1,4 @@ -import{c as u,j as e,r as M,x as C,Z as z,_ as k,$ as y,O as v,a0 as L,R as G,a1 as T,W as D,e as f,a2 as B}from"./index-B1_ue-6-.js";import{a as w,L as P,C as E,Z as R}from"./zap-BxCGzT3u.js";import{L as I}from"./layers-PioAw_-7.js";/** +import{c as u,j as e,r as M,x as C,Z as z,_ as k,$ as y,O as v,a0 as L,R as G,a1 as T,W as D,e as f,a2 as B}from"./index-CUuKs_1x.js";import{a as w,L as P,C as E,Z as R}from"./zap-iWjc7Axa.js";import{L as I}from"./layers-CjyCNjIs.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/IdeenView-BpB3-RwB.js b/frontend/dist/assets/IdeenView-BpB3-RwB.js new file mode 100644 index 0000000..2c0f3f3 --- /dev/null +++ b/frontend/dist/assets/IdeenView-BpB3-RwB.js @@ -0,0 +1,35 @@ +import{c as R,j as e,e as S,a4 as ve,u as Se,b as De,r as d,g as z,a8 as Ke,a0 as O,L as D,X as Q,a9 as xe,I as T,a5 as he,C as Ce,T as ze,a6 as Ee,aa as pe,q as Ae,U as fe}from"./index-CUuKs_1x.js";import{S as Le,H as U}from"./SectionLabel-SQgndpwc.js";import{C as ee}from"./code-xml-DlqRSqmr.js";import{L as Pe}from"./layers-CjyCNjIs.js";import{C as X}from"./chevron-down-MK8qZkE9.js";import{R as We}from"./rotate-ccw-BtnOKhJQ.js";/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $e=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Re=R("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Be=R("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y=R("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const me=R("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ie=R("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function Oe({text:r,className:c}){const k=(r||"").split(` +`),s=[];let m=[],g=null;const h=p=>{m.length&&(s.push(e.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:m},p)),m=[])};return k.forEach((p,o)=>{const i=`l${o}`;if(g!==null){p.trimEnd()==="```"?(s.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px] leading-relaxed text-foreground/85",children:g.join(` +`)},i)),g=null):g.push(p);return}if(p.trimStart().startsWith("```")){h(i),g=[];return}const j=p.trimEnd();if(!j.trim()){h(i);return}const w=j.match(/^(#{1,4})\s+(.*)$/);if(w){h(i);const N=w[1].length,u=N===1?"text-base font-bold mt-1 mb-2":N===2?"text-sm font-bold mt-4 mb-1.5":"text-xs font-bold mt-3 mb-1 uppercase tracking-wide text-muted-foreground";s.push(e.jsx("p",{className:S(u,"font-space text-foreground"),children:F(w[2],i)},i));return}const y=j.match(/^\s*[-*•]\s+(.*)$/);if(y){m.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:F(y[1],i)},i));return}const l=j.match(/^\s*\d+\.\s+(.*)$/);if(l){m.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:F(l[1],i)},i));return}h(i),s.push(e.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:F(j,i)},i))}),h("end"),g!==null&&s.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:g.join(` +`)},"code-end")),e.jsx("div",{className:S("max-w-3xl",c),children:s})}function F(r,c){return r.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((s,m)=>{const g=`${c}-${m}`;return/^\*\*[^*]+\*\*$/.test(s)?e.jsx("b",{className:"font-semibold text-foreground",children:s.slice(2,-2)},g):/^\*[^*]+\*$/.test(s)?e.jsx("i",{children:s.slice(1,-1)},g):/^`[^`]+`$/.test(s)?e.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-foreground/90",children:s.slice(1,-1)},g):e.jsx("span",{children:s},g)})}const Te={triage:{label:"wird ausgearbeitet …",cls:"text-violet-300 border-violet-500/40 bg-violet-500/10",spin:!0},todo:{label:"wartet",cls:"text-muted-foreground border-border/60 bg-background/30"},scheduled:{label:"geplant",cls:"text-muted-foreground border-border/60 bg-background/30"},ready:{label:"gleich dran",cls:"text-sky-300/80 border-sky-500/30 bg-sky-500/5"},running:{label:"in Arbeit …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},review:{label:"im Review",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},blocked:{label:"hängt — braucht dich",cls:"text-red-300 border-red-500/40 bg-red-500/10"},done:{label:"fertig ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"}},Ve={box:{label:"BOX",icon:U,cls:"border-border/60 bg-background/40 text-muted-foreground",title:"Box-Welt: die Werkstatt baut das selbst. Das Ergebnis kommt als Patch-Vorschlag zurück — nichts geht ohne deinen Klick live."},idee:{label:"IDEE",icon:O,cls:"border-sky-500/40 bg-sky-500/10 text-sky-300",title:"Nur durchdacht: die Box hat die Produkt-Idee mit voller Denk-Kaskade zu einem Konzept ausgearbeitet. Kein Gerüst, kein Bau — du liest es und entscheidest, ob ein Projekt draus wird."},projekt:{label:"IDE",icon:ee,cls:"border-violet-500/40 bg-violet-500/10 text-violet-300",title:"IDE-Welt: die Box bereitet nur vor (Konzept + Repo + Doku, kein Code). Gebaut wird von dir in der Agentic IDE."}},qe={needs_input:"Die Box hat eine Frage:",capability:"Die Box kam hier nicht weiter:",transient:"Die Aufgabe hakt:"},be="mc_ideen_quote";function ke(){try{const r=JSON.parse(localStorage.getItem(be)||"{}");return{gesendet:Number(r.gesendet)||0,geaendert:Number(r.geaendert)||0}}catch{return{gesendet:0,geaendert:0}}}function ge(r){try{const c=ke();c[r]+=1,localStorage.setItem(be,JSON.stringify(c))}catch{}}function _e(){var ie,le;const{data:r,isLoading:c}=ve(),k=Se(),{showAlert:s,showConfirm:m,dialogElement:g}=De(),[h,p]=d.useState(""),[o,i]=d.useState("denken"),[j,w]=d.useState("schlank"),[y,l]=d.useState(!1),[N,u]=d.useState(!1),L=o!=="box",V=o==="repo",[K,je]=d.useState("lxc"),[Z,te]=d.useState(!1),[v,E]=d.useState({}),[B,Ne]=d.useState(null),[H,we]=d.useState(null),[J,re]=d.useState({}),P=(r==null?void 0:r.items)??[],W=()=>k.invalidateQueries({queryKey:Ae.ideen});d.useEffect(()=>{const t=h.trim();if(t.length<12){u(!1);return}let n=!1;const x=setTimeout(async()=>{try{const f=await z("/api/ideen/einordnen",{method:"POST",body:JSON.stringify({text:t})});if(n||!(f!=null&&f.ok))return;i(f.nur_denken?"denken":f.wer==="ide"?"repo":"box"),f.tiefe&&w(f.tiefe),u(!0)}catch{}},700);return()=>{n=!0,clearTimeout(x)}},[h]);const se=B!==null&&(((ie=r==null?void 0:r.items.find(t=>t.id===B))==null?void 0:ie.status)==="triage"||((le=r==null?void 0:r.items.find(t=>t.id===B))==null?void 0:le.status)==="running"),I=Ke(B??"",se);async function ne(){const t=h.trim();if(!(t.length<3||Z)){te(!0);try{const n=t.length>160?t.slice(0,157)+"…":t;await z("/api/ideen",{method:"POST",body:JSON.stringify({titel:n,notiz:t.length>160?t:"",welt:L?"ide":"box",tiefe:V?j==="gruendlich"?"gruendlich":"simpel":"",ziel:V?K:"",art:o==="denken"?"idee":"projekt"})}),ge("gesendet"),p(""),u(!1),l(!1),W()}catch(n){s("Das hat nicht geklappt",String((n==null?void 0:n.message)||n))}finally{te(!1)}}}function ae(t,n,x){m(`${n} fertige Karte${n===1?"":"n"} wegräumen?`,`${x} verschwindet aus der Liste. Gelöscht wird nichts — die Karten wandern ins Archiv der Queue und bleiben dort lesbar. Laufende, hängende und wartende Karten bleiben unberührt.`,async()=>{var b;const f="arch:"+(t||"*");E(a=>({...a,[f]:!0}));try{const a=await z("/api/ideen/archivieren-alle",{method:"POST",body:JSON.stringify({projekt:t})});(b=a.fehlgeschlagen)!=null&&b.length&&s("Teilweise erledigt",`${a.archiviert} weggeräumt, ${a.fehlgeschlagen.length} nicht: `+a.fehlgeschlagen.map(A=>A.titel).join(", ")),W()}catch(a){s("Das hat nicht geklappt",String((a==null?void 0:a.message)||a))}finally{E(a=>({...a,[f]:!1}))}})}async function ye(t){E(n=>({...n,[t]:!0}));try{await z("/api/ideen/archivieren",{method:"POST",body:JSON.stringify({id:t})}),W()}catch(n){s("Das hat nicht geklappt",String((n==null?void 0:n.message)||n))}finally{E(n=>({...n,[t]:!1}))}}async function q(t,n,x,f){E(b=>({...b,[t+n]:!0}));try{await z(x,{method:"POST",body:JSON.stringify(f)}),W()}catch(b){s("Das hat nicht geklappt",String((b==null?void 0:b.message)||b))}finally{E(b=>({...b,[t+n]:!1}))}}async function oe(t){const n=(J[t]||"").trim();if(!(n.length<1||v["ans:"+t])){E(x=>({...x,["ans:"+t]:!0}));try{await z("/api/ideen/antwort",{method:"POST",body:JSON.stringify({id:t,antwort:n})}),re(x=>({...x,[t]:""})),W()}catch(x){s("Das hat nicht geklappt",String((x==null?void 0:x.message)||x))}finally{E(x=>({...x,["ans:"+t]:!1}))}}}const _=t=>{var ce,ue;const n=Te[t.status]??{label:t.status,cls:"text-muted-foreground border-border/60 bg-background/30"},x=B===t.id,f=t.status==="triage"||t.status==="running"||t.status==="done",b=t.status==="blocked",a=!!v["ans:"+t.id],A=t.status==="running"&&(t.puls_alter??0)>600,de=t.status==="todo"||t.status==="ready"||t.status==="scheduled";return e.jsxs("li",{className:S("flex flex-col gap-2 rounded-xl border bg-background/30 px-3 py-2",b?"border-red-500/30":A?"border-amber-500/40":"border-border/40"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:S("flex shrink-0 items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",n.cls),children:[n.spin&&e.jsx(D,{className:"h-3 w-3 animate-spin"}),n.label]}),A&&e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold text-amber-300",title:"Der Worker lebt, gibt aber kein Lebenszeichen mehr — vermutlich wartet er auf etwas, das nie kommt. „Neuer Versuch“ startet die Karte frisch.",children:[e.jsx(ze,{className:"h-3 w-3"})," ",Math.round((t.puls_alter??0)/60)," min ohne Regung"]}),(t.prio??0)!==0&&e.jsxs("span",{className:"shrink-0 rounded bg-background/50 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",title:"Priorität — höher kommt zuerst dran (bei gleicher Prio: Erstellzeit)",children:["P",t.prio]}),(()=>{const C=Ve[t.art||(t.welt==="ide"?"projekt":"box")];if(!C)return null;const M=C.icon;return e.jsxs("span",{className:S("flex shrink-0 items-center gap-1 rounded-lg border px-2 py-0.5 text-[10px] font-bold",C.cls),title:C.title,children:[e.jsx(M,{className:"h-3 w-3"})," ",C.label]})})(),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground",title:t.titel,children:t.titel}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(he,{className:"h-3 w-3"}),Ee(t.erstellt)]}),de&&e.jsxs("span",{className:"flex shrink-0 items-center",children:[e.jsx("button",{disabled:!!v["pr:"+t.id],onClick:()=>q("pr:",t.id,"/api/ideen/prio",{id:t.id,richtung:"hoch"}),title:"Vorziehen (Prio +1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(Re,{className:"h-3.5 w-3.5"})}),e.jsx("button",{disabled:!!v["pr:"+t.id],onClick:()=>q("pr:",t.id,"/api/ideen/prio",{id:t.id,richtung:"runter"}),title:"Zurückstellen (Prio −1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx($e,{className:"h-3.5 w-3.5"})})]}),(t.status==="running"||b)&&e.jsx("button",{disabled:!!v["rt:"+t.id],onClick:()=>m("Neuer Versuch?",t.status==="running"?`Der laufende Worker von '${t.titel.slice(0,60)}' wird beendet (samt gestarteter Test-Prozesse) und die Karte frisch gestartet. Bisheriger Zwischenstand im Workspace bleibt liegen.`:`Die Karte '${t.titel.slice(0,60)}' wird entsperrt und läuft weiter, sobald ein Platz frei ist.`,()=>q("rt:",t.id,"/api/ideen/retry",{id:t.id})),title:"Neuer Versuch — Karte frisch starten",className:S("shrink-0 rounded-md p-1 transition-colors cursor-pointer disabled:opacity-50",A?"text-amber-300 hover:text-amber-200":"text-muted-foreground/60 hover:text-foreground"),children:v["rt:"+t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(We,{className:"h-3.5 w-3.5"})}),(t.status==="running"||de||t.status==="triage")&&e.jsx("button",{disabled:!!v["st:"+t.id],onClick:()=>m("Karte stoppen?",`'${t.titel.slice(0,60)}' wird angehalten${t.status==="running"?" und der laufende Worker beendet":""}. Sie bleibt als gestoppt im Board und kann jederzeit per „Neuer Versuch“ weiterlaufen.`,()=>q("st:",t.id,"/api/ideen/stopp",{id:t.id})),title:"Stoppen — Karte anhalten",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-red-300 cursor-pointer disabled:opacity-50",children:v["st:"+t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ie,{className:"h-3.5 w-3.5"})}),(t.status==="done"||b)&&e.jsx("button",{disabled:!!v[t.id],onClick:()=>ye(t.id),title:b?"Aufgeben und aus der Liste räumen (wandert ins Kanban-Archiv)":"Aus der Liste räumen (wandert ins Kanban-Archiv)",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:v[t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Q,{className:"h-3.5 w-3.5"})}),t.welt==="ide"&&(t.status==="running"||t.status==="done")&&e.jsxs("button",{onClick:()=>we(H===t.id?null:t.id),title:"Konzept ansehen (das ausgearbeitete KONZEPT.md)",className:S("flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[10px] font-bold transition-colors cursor-pointer",H===t.id?"text-violet-300":"text-violet-300/70 hover:text-violet-200"),children:[e.jsx(pe,{className:"h-3.5 w-3.5"})," Konzept"]}),f&&e.jsx("button",{onClick:()=>Ne(x?null:t.id),title:t.status==="done"?"Ergebnis anzeigen":"Worker-Log anzeigen",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer",children:x?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(T,{className:"h-3.5 w-3.5"})})]}),H===t.id&&e.jsx(Ge,{id:t.id,istIdee:t.art==="idee"&&t.status==="done",onWeiter:W}),t.status==="running"&&t.notiz&&e.jsxs("p",{className:"-mt-1 ml-1 text-[11px] italic leading-relaxed text-sky-200/80",title:"Jüngste Zwischenmeldung des Workers (Heartbeat)",children:["„",t.notiz,"“"]}),(t.status==="todo"||t.status==="scheduled"||t.status==="ready")&&(((ce=t.wartet_auf)==null?void 0:ce.length)??0)>0&&e.jsxs("p",{className:"-mt-1 ml-1 text-[10px] text-muted-foreground/70",children:["→ wartet auf: ",t.wartet_auf.join(" · ")]}),b&&e.jsxs("div",{className:"space-y-2 border-t border-red-500/20 pt-2",children:[e.jsxs("p",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-red-200/90",children:[e.jsx(xe,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-300"}),e.jsxs("span",{children:[e.jsx("b",{children:qe[t.frage_kind||""]??"Die Aufgabe hängt und wartet auf dich:"})," ",t.frage?e.jsx("span",{className:"text-foreground/90",children:t.frage}):e.jsx("span",{className:"text-muted-foreground italic",children:"kein genauer Grund hinterlegt — antworte einfach mit einer Entscheidung, dann läuft sie weiter."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:J[t.id]||"",onChange:C=>re(M=>({...M,[t.id]:C.target.value})),onKeyDown:C=>{C.key==="Enter"&&oe(t.id)},placeholder:"Deine Antwort — die Box macht damit weiter",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>oe(t.id),disabled:a||(J[t.id]||"").trim().length<1,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[a?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(me,{className:"h-3.5 w-3.5"})," Antworten & weiter"]})]})]}),x&&f&&t.status!=="done"&&e.jsx("div",{className:"ml-2 -mt-1",children:e.jsx("div",{className:"rounded-lg border border-border/50 bg-background/50 p-2",children:se&&I.isLoading?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Log wird geladen …"}):I.error?e.jsx("p",{className:"text-[10px] text-red-400",children:"Log nicht ladbar"}):(ue=I.data)!=null&&ue.available&&I.data.lines.length>0?e.jsx("pre",{className:"max-h-64 overflow-auto font-mono text-[10px] leading-relaxed text-foreground/80 whitespace-pre-wrap",children:I.data.lines.join(` +`)}):e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Kein Log verfügbar"})})}),x&&t.status==="done"&&e.jsx(He,{id:t.id})]},t.id)};return r&&!r.available?null:e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Le,{icon:O,children:(()=>{if(!r)return"Ideen-Queue";const t=x=>P.filter(f=>x.includes(f.status)).length,n=[t(["blocked"])>0?`${t(["blocked"])} braucht dich`:"",t(["running","triage","review"])>0?`${t(["running","triage","review"])} in Arbeit`:"",t(["todo","scheduled","ready"])>0?`${t(["todo","scheduled","ready"])} wartet`:"",t(["done"])>0?`${t(["done"])} fertig`:""].filter(Boolean);return n.length?n.join(" · "):"noch nichts in der Queue"})()}),(()=>{const t=P.filter(n=>n.status==="done").length;return t===0?null:e.jsxs("button",{disabled:!!v["arch:*"],onClick:()=>ae("",t,`Alle ${t} fertigen Karten`),title:"Räumt ALLE fertigen Karten weg — auch die in abgeschlossenen Projekt-Ketten. Laufende, hängende und wartende bleiben unberührt.",className:"flex shrink-0 items-center gap-1.5 rounded-lg border border-border/60 px-2.5 py-1 text-[11px] font-semibold text-muted-foreground transition-all hover:border-primary/40 hover:text-foreground disabled:opacity-50 cursor-pointer",children:[v["arch:*"]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),t," fertige wegräumen"]})})()]}),e.jsxs("div",{className:"mc-card p-4 space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:h,onChange:t=>{p(t.target.value),u(!1)},onKeyDown:t=>{t.key==="Enter"&&ne()},placeholder:"Was soll entstehen?",className:"h-10 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/50 px-3 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"}),e.jsxs("button",{onClick:ne,disabled:Z||h.trim().length<3,className:"flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-primary/40 bg-primary/10 px-4 text-xs font-semibold text-primary transition-all hover:bg-primary/20 disabled:opacity-40 cursor-pointer",children:[Z?e.jsx(D,{className:"h-4 w-4 animate-spin"}):e.jsx(me,{className:"h-4 w-4"}),"Los"]})]}),y?e.jsxs("div",{className:"space-y-3 rounded-xl border border-border/40 bg-background/20 p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-muted-foreground/70",children:"Wer baut das?"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsx(G,{aktiv:o!=="box",onWahl:()=>i(o==="box"?"denken":o),k:{id:"ide",icon:ee,titel:"Ich, in der Agentic IDE",text:"Du bekommst Konzept und Repo — den Code schreibst du selbst."}}),e.jsx(G,{aktiv:o==="box",onWahl:()=>i("box"),k:{id:"box",icon:U,titel:"Die Box, allein",text:"Für dein Heimlabor. Das Ergebnis kommt als Patch-Vorschlag ins Auftragsbuch."}})]})]}),o!=="box"&&e.jsxs("div",{className:"border-l-2 border-primary/40 pl-3",children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-muted-foreground/70",children:"Und wie startest du?"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsx(G,{aktiv:o==="denken",onWahl:()=>i("denken"),k:{id:"denken",icon:O,titel:"Erst durchdenken",text:"Konzept zuerst — auf dein Ja wird ein Repo daraus."}}),e.jsx(G,{aktiv:o==="repo",onWahl:()=>i("repo"),k:{id:"repo",icon:Y,titel:"Direkt ein Repo",text:"Konzept und Gitea-Repo in einem Zug."}})]}),o==="repo"?e.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Wie gründlich?"}),e.jsx("div",{className:"flex rounded-lg border border-border/60 p-0.5",children:[["schlank","schlank"],["gruendlich","gründlich"]].map(([t,n])=>e.jsx("button",{onClick:()=>w(t),className:S("rounded px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",j===t?"bg-primary/15 text-primary":"text-muted-foreground/60 hover:text-foreground"),children:n},t))}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Läuft als"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:[["lxc","LXC"],["docker","Docker"]].map(([t,n])=>e.jsx("button",{onClick:()=>je(t),title:t==="lxc"?"Dienst in einem eigenen Proxmox-LXC (systemd, kein Docker). Wird vom Backup-Server mitgesichert.":"Natives Docker: Dockerfile + compose, portabel und pipeline-tauglich.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",K===t?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:n},t))})]})]}):e.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[10px] leading-relaxed text-muted-foreground/60",children:[e.jsx(xe,{className:"mt-px h-3 w-3 shrink-0"}),'Wie gründlich und wo es läuft, fragt die Box erst beim „gefällt mir" — dann weißt du mehr.']})]}),(()=>{const t=ke();return t.gesendet<3?null:e.jsxs("p",{className:"border-t border-border/30 pt-2 text-[10px] text-muted-foreground/50",children:["Du hast ",t.geaendert," von ",t.gesendet," Vorschlägen geändert. Wird das die Regel, bauen wir hier einen richtigen Schritt-für-Schritt-Assistenten."]})})()]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-border/40 bg-background/20 px-3 py-2.5 text-xs",children:[o==="box"?e.jsx(U,{className:"h-4 w-4 shrink-0 text-primary"}):o==="repo"?e.jsx(Y,{className:"h-4 w-4 shrink-0 text-primary"}):e.jsx(O,{className:"h-4 w-4 shrink-0 text-primary"}),!N&&e.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-wider text-muted-foreground/50",children:"Voreingestellt"}),e.jsx("span",{className:"text-muted-foreground",children:o==="box"?"Ich baue das selbst und lege dir das Ergebnis als Vorschlag hin.":o==="repo"?"Du baust selbst — ich lege dir Konzept und Repo an.":"Du baust selbst — ich arbeite erst ein Konzept aus."}),N&&e.jsx("span",{className:"shrink-0 rounded border border-primary/40 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold text-primary",children:"gelesen"}),e.jsx("button",{onClick:()=>{l(!0),ge("geaendert")},className:"ml-auto shrink-0 text-[11px] text-muted-foreground/60 underline underline-offset-2 transition-colors hover:text-foreground cursor-pointer",children:"anders"})]}),c&&e.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"})," Queue wird geladen …"]}),(r==null?void 0:r.fehler)&&e.jsx("p",{className:"text-xs text-amber-300",children:"Queue gerade nicht lesbar — neuer Versuch läuft."}),P.length>0&&e.jsxs("div",{className:"space-y-3",children:[((r==null?void 0:r.projekte)??[]).map(t=>e.jsx(Fe,{projekt:t,karten:P.filter(n=>n.projekt===t.key),zeile:_,onArchivAlle:ae,raeumt:!!v["arch:"+t.key]},t.key)),(()=>{const t=new Set(((r==null?void 0:r.projekte)??[]).map(a=>a.key)),n=P.filter(a=>!a.projekt||!t.has(a.projekt));if(n.length===0)return null;const x=n.filter(a=>$[a.status]!==void 0).sort((a,A)=>$[a.status]-$[A.status]||(a.erstellt??0)-(A.erstellt??0)),f=n.filter(a=>["todo","scheduled"].includes(a.status)),b=n.filter(a=>a.status==="done");return e.jsxs("div",{className:"space-y-2",children:[x.length>0&&e.jsx("ul",{className:"space-y-1.5",children:x.map(a=>_(a))}),f.length>0&&e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 py-1 text-[11px] text-muted-foreground/70 hover:text-foreground",children:[e.jsx(T,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),e.jsx(he,{className:"h-3 w-3"})," Wartet (",f.length,")"]}),e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:f.map(a=>_(a))})]}),b.length>0&&e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 py-1 text-[11px] text-muted-foreground/70 hover:text-foreground",children:[e.jsx(T,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),e.jsx(Ce,{className:"h-3 w-3 text-emerald-400/70"})," Fertig (",b.length,")"]}),e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:b.map(a=>_(a))})]})]})})()]}),(r==null?void 0:r.available)&&!c&&P.length===0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground/70",children:"Noch nichts hier. Zum Beispiel:"}),["Ein kleines Werkzeug, das meine Fotos nach Aufnahmedatum in Ordner sortiert","Rippy soll die Untertitel-Spur automatisch auswählen statt zu fragen","Lohnt sich ein Dashboard für die Stromzähler, oder reicht Home Assistant?"].map(t=>e.jsxs("button",{onClick:()=>p(t),className:"flex w-full items-center gap-2 rounded-lg border border-border/40 bg-background/20 px-3 py-2 text-left text-xs text-muted-foreground transition-all hover:border-primary/40 hover:text-foreground cursor-pointer",children:[e.jsx(O,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/50"}),t]},t))]})]}),g]})}function G({k:r,aktiv:c,onWahl:k}){return e.jsxs("button",{onClick:k,className:S("rounded-xl border p-3 text-left transition-all cursor-pointer",c?"border-primary/60 bg-primary/5":"border-border/50 hover:border-border"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r.icon,{className:S("h-4 w-4 shrink-0",c?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"text-xs font-semibold text-foreground",children:r.titel})]}),e.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:r.text})]})}const $={blocked:0,running:1,review:2,ready:3,triage:4};function Fe({projekt:r,karten:c,zeile:k,onArchivAlle:s,raeumt:m}){const[g,h]=d.useState(!1),[p,o]=d.useState(!1),i=c.filter(l=>$[l.status]!==void 0).sort((l,N)=>$[l.status]-$[N.status]||(l.erstellt??0)-(N.erstellt??0)),j=c.filter(l=>l.status==="todo"||l.status==="scheduled").sort((l,N)=>{var u,L;return((u=l.wartet_auf)!=null&&u.length?1:0)-((L=N.wartet_auf)!=null&&L.length?1:0)||(l.erstellt??0)-(N.erstellt??0)}),w=c.filter(l=>l.status==="done").sort((l,N)=>(N.fertig??0)-(l.fertig??0)),y=r.gesamt>0?Math.round(r.fertig/r.gesamt*100):0;return e.jsxs("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/20 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pe,{className:"h-4 w-4 shrink-0 text-primary/70"}),e.jsx("p",{className:"min-w-0 flex-1 truncate text-xs font-semibold text-foreground",title:r.titel,children:r.titel}),e.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[r.fertig," von ",r.gesamt," fertig"]})]}),e.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-background/60",title:`${y}%`,children:e.jsx("div",{className:"h-1 rounded-full bg-primary/70 transition-all",style:{width:`${y}%`}})}),i.length>0&&e.jsx("ul",{className:"space-y-1.5",children:i.map(l=>k(l))}),j.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>h(l=>!l),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[g?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(T,{className:"h-3.5 w-3.5"}),j.length," Karte",j.length===1?"":"n"," in der Kette — laufen automatisch der Reihe nach"]}),g&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:j.map(l=>k(l))})]}),w.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>o(l=>!l),className:"flex items-center gap-1.5 text-[11px] font-semibold text-emerald-300/70 hover:text-emerald-300 transition-colors cursor-pointer",children:[p?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(T,{className:"h-3.5 w-3.5"}),w.length," fertig"]}),s&&e.jsxs("button",{disabled:m,onClick:()=>s(r.key,w.length,`„${r.titel}"`),title:"Räumt die fertigen Karten dieser Kette weg (Archiv, nichts wird gelöscht).",className:"flex items-center gap-1 text-[11px] text-muted-foreground/60 transition-colors hover:text-foreground disabled:opacity-50 cursor-pointer",children:[m?e.jsx(D,{className:"h-3 w-3 animate-spin"}):e.jsx(Q,{className:"h-3 w-3"}),"wegräumen"]})]}),p&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:w.map(l=>k(l))})]})]})}function Ge({id:r,istIdee:c,onWeiter:k}){const[s,m]=d.useState(null),[g,h]=d.useState(!1),[p,o]=d.useState(0);return d.useEffect(()=>{let i=!1;return m(null),h(!1),z(`/api/ideen/${r}/konzept`).then(j=>{i||m(j)}).catch(()=>{i||h(!0)}),()=>{i=!0}},[r,p]),e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-violet-500/25 bg-violet-500/[0.04] p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-violet-300",children:[e.jsx(pe,{className:"h-3 w-3"})," Konzept"]}),(s==null?void 0:s.repo)&&e.jsxs("a",{href:`https://git.tobisniceshomelab.ddnsfree.com/${s.repo}`,className:"flex items-center gap-1 text-[10px] text-violet-300/70 hover:text-violet-200",children:[e.jsx(Y,{className:"h-3 w-3"})," ",s.repo]}),!(s!=null&&s.repo)&&(s==null?void 0:s.quelle)==="datei"&&e.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/70",title:"Der Worker hat kein Repo angelegt — das Konzept liegt als Datei auf der Box.",children:s.pfad}),e.jsx("button",{onClick:()=>o(i=>i+1),title:"Neu laden",className:"ml-auto rounded p-0.5 text-muted-foreground/50 hover:text-foreground cursor-pointer",children:e.jsx(fe,{className:"h-3 w-3"})})]}),g?e.jsx("p",{className:"text-[11px] text-red-400",children:"Konzept nicht ladbar — später nochmal versuchen."}):s===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Konzept wird geladen …"}):s.konzept?e.jsx("div",{className:"max-h-[28rem] overflow-y-auto pr-1",children:e.jsx(Oe,{text:s.konzept})}):e.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:s.error||"Noch kein Konzept — das Projekt wird gerade vorbereitet."}),c&&(s==null?void 0:s.konzept)&&e.jsx(Ze,{id:r,onFertig:k})]})})}function Ze({id:r,onFertig:c}){const[k,s]=d.useState("lxc"),[m,g]=d.useState("simpel"),[h,p]=d.useState(!1),[o,i]=d.useState(null),[j,w]=d.useState(""),[y,l]=d.useState(""),N=async(u,L,V)=>{p(!0),w("");try{const K=await z(u,{method:"POST",body:JSON.stringify(L)});i({id:K.id,art:V}),c==null||c()}catch(K){w(String((K==null?void 0:K.message)||K))}finally{p(!1)}};return o?e.jsx("p",{className:"mt-3 border-t border-violet-500/20 pt-2 text-[11px] text-emerald-300",children:o.art==="projekt"?e.jsxs(e.Fragment,{children:["Projekt-Karte ",e.jsx("span",{className:"font-mono",children:o.id})," ist angelegt — die Box bereitet das Repo vor (Konzept übernimmt sie, sie denkt es nicht neu). Danach öffnest du es in der Agentic IDE."]}):e.jsxs(e.Fragment,{children:["Überarbeitung ",e.jsx("span",{className:"font-mono",children:o.id}),' läuft — die Box arbeitet deine Rückmeldung ein und schreibt die neue Fassung an dieselbe Stelle. Danach hier wieder „Konzept" öffnen.']})}):e.jsxs("div",{className:"mt-3 space-y-3 border-t border-violet-500/20 pt-2.5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx("b",{className:"text-sky-300/90",children:"Passt etwas nicht?"})," Schreib hin, was anders werden soll — die Box arbeitet es ein und lässt den Rest stehen. Beliebig oft wiederholbar."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:y,onChange:u=>l(u.target.value),onKeyDown:u=>{u.key==="Enter"&&y.trim().length>=3&&!h&&N("/api/ideen/nachschaerfen",{id:r,hinweis:y},"runde")},placeholder:"z. B. „Punkt 3: kein WebSocket, das ist mir zu fragil — nimm Polling“",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-sky-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>N("/api/ideen/nachschaerfen",{id:r,hinweis:y},"runde"),disabled:h||y.trim().length<3,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-sky-500/40 bg-sky-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-sky-300 transition-all hover:bg-sky-500/20 cursor-pointer disabled:opacity-50",children:[h?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(fe,{className:"h-3.5 w-3.5"}),"Nachschärfen"]})]})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx("b",{className:"text-violet-300/90",children:"Passt es so?"})," Dann macht die Box daraus ein startklares Repo — Konzept wird übernommen (nicht neu gedacht), dazu Roadmap, AGENTS.md & Co. Gebaut wird danach von dir in der Agentic IDE."]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Ziel"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:["lxc","docker"].map(u=>e.jsx("button",{onClick:()=>s(u),title:u==="lxc"?"Dienst in einem eigenen Proxmox-LXC (systemd, kein Docker) — wird automatisch mitgesichert.":"Natives Docker: Dockerfile + compose, portabel und pipeline-tauglich.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",k===u?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:u==="lxc"?"LXC":"Docker"},u))}),e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Aufwand"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:["simpel","gruendlich"].map(u=>e.jsx("button",{onClick:()=>g(u),title:u==="simpel"?"Konzept ist schon gehärtet — nur kurz auf die Bau-Sicht nachschärfen (empfohlen).":"Nochmal volle Kaskade über die Bau-Sicht: mehrere Rollen, Härtetests. Dauert entsprechend.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",m===u?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:u==="simpel"?"schlank":"gründlich"},u))}),e.jsxs("button",{onClick:()=>N("/api/ideen/weiterfuehren",{id:r,ziel:k,tiefe:m},"projekt"),disabled:h,className:"ml-auto flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[h?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ee,{className:"h-3.5 w-3.5"}),"Gefällt mir — Projekt daraus machen"]})]}),j&&e.jsx("p",{className:"text-[11px] text-red-400",children:j})]})}function He({id:r}){const[c,k]=d.useState(null),[s,m]=d.useState(!1),[g,h]=d.useState(0);d.useEffect(()=>{let o=!1;return m(!1),k(null),z(`/api/ideen/${r}/ergebnis`).then(i=>{o||k(i)}).catch(()=>{o||m(!0)}),()=>{o=!0}},[r,g]);const p=c?c.summary||c.result:"";return e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-emerald-500/25 bg-emerald-500/5 p-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-emerald-300",children:[e.jsx(Be,{className:"h-3 w-3"})," Ergebnis des Workers"]}),s?e.jsx("button",{type:"button",onClick:()=>h(o=>o+1),className:"text-[10px] text-red-400 underline decoration-dotted underline-offset-2 hover:text-red-300",children:"Ergebnis nicht ladbar — nochmal versuchen"}):c===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Wird geladen …"}):p?e.jsx("p",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:p}):e.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"Der Worker hat keine Abschluss-Zusammenfassung hinterlassen (ältere Karte oder Protokollverstoß)."})]})})}function et(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Ideen"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Schreib hin, was entstehen soll. Die Box liest mit und schlägt vor, wie es weitergeht — ändern kannst du das immer."})]}),e.jsx(_e,{})]})}export{et as IdeenView}; diff --git a/frontend/dist/assets/IdeenView-COUe_TK2.js b/frontend/dist/assets/IdeenView-COUe_TK2.js deleted file mode 100644 index 554e7f3..0000000 --- a/frontend/dist/assets/IdeenView-COUe_TK2.js +++ /dev/null @@ -1,35 +0,0 @@ -import{c as R,j as e,e as S,a4 as ve,u as Se,b as De,r as d,g as z,a8 as Ke,a0 as T,L as D,X as Q,a9 as xe,I,a5 as he,C as Ce,T as ze,a6 as Ee,aa as ge,q as Le,U as fe}from"./index-B1_ue-6-.js";import{S as Ae,H as U}from"./SectionLabel-Bm9VMRua.js";import{C as ee}from"./code-xml-CtSuST1m.js";import{L as Pe}from"./layers-PioAw_-7.js";import{C as X}from"./chevron-down-CxeBPXxe.js";import{R as We}from"./rotate-ccw-KIERrTyE.js";/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $e=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Re=R("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Be=R("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y=R("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const me=R("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oe=R("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function Te({text:r,className:c}){const k=(r||"").split(` -`),s=[];let m=[],p=null;const h=g=>{m.length&&(s.push(e.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:m},g)),m=[])};return k.forEach((g,o)=>{const i=`l${o}`;if(p!==null){g.trimEnd()==="```"?(s.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px] leading-relaxed text-foreground/85",children:p.join(` -`)},i)),p=null):p.push(g);return}if(g.trimStart().startsWith("```")){h(i),p=[];return}const j=g.trimEnd();if(!j.trim()){h(i);return}const w=j.match(/^(#{1,4})\s+(.*)$/);if(w){h(i);const N=w[1].length,u=N===1?"text-base font-bold mt-1 mb-2":N===2?"text-sm font-bold mt-4 mb-1.5":"text-xs font-bold mt-3 mb-1 uppercase tracking-wide text-muted-foreground";s.push(e.jsx("p",{className:S(u,"font-space text-foreground"),children:_(w[2],i)},i));return}const y=j.match(/^\s*[-*•]\s+(.*)$/);if(y){m.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:_(y[1],i)},i));return}const l=j.match(/^\s*\d+\.\s+(.*)$/);if(l){m.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:_(l[1],i)},i));return}h(i),s.push(e.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:_(j,i)},i))}),h("end"),p!==null&&s.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:p.join(` -`)},"code-end")),e.jsx("div",{className:S("max-w-3xl",c),children:s})}function _(r,c){return r.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((s,m)=>{const p=`${c}-${m}`;return/^\*\*[^*]+\*\*$/.test(s)?e.jsx("b",{className:"font-semibold text-foreground",children:s.slice(2,-2)},p):/^\*[^*]+\*$/.test(s)?e.jsx("i",{children:s.slice(1,-1)},p):/^`[^`]+`$/.test(s)?e.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-foreground/90",children:s.slice(1,-1)},p):e.jsx("span",{children:s},p)})}const Ie={triage:{label:"wird ausgearbeitet …",cls:"text-violet-300 border-violet-500/40 bg-violet-500/10",spin:!0},todo:{label:"wartet",cls:"text-muted-foreground border-border/60 bg-background/30"},scheduled:{label:"geplant",cls:"text-muted-foreground border-border/60 bg-background/30"},ready:{label:"gleich dran",cls:"text-sky-300/80 border-sky-500/30 bg-sky-500/5"},running:{label:"in Arbeit …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},review:{label:"im Review",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},blocked:{label:"hängt — braucht dich",cls:"text-red-300 border-red-500/40 bg-red-500/10"},done:{label:"fertig ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"}},Ve={box:{label:"BOX",icon:U,cls:"border-border/60 bg-background/40 text-muted-foreground",title:"Box-Welt: die Werkstatt baut das selbst. Das Ergebnis kommt als Patch-Vorschlag zurück — nichts geht ohne deinen Klick live."},idee:{label:"IDEE",icon:T,cls:"border-sky-500/40 bg-sky-500/10 text-sky-300",title:"Nur durchdacht: die Box hat die Produkt-Idee mit voller Denk-Kaskade zu einem Konzept ausgearbeitet. Kein Gerüst, kein Bau — du liest es und entscheidest, ob ein Projekt draus wird."},projekt:{label:"IDE",icon:ee,cls:"border-violet-500/40 bg-violet-500/10 text-violet-300",title:"IDE-Welt: die Box bereitet nur vor (Konzept + Repo + Doku, kein Code). Gebaut wird von dir in Zed."}},Ze={needs_input:"Die Box hat eine Frage:",capability:"Die Box kam hier nicht weiter:",transient:"Die Aufgabe hakt:"},be="mc_ideen_quote";function ke(){try{const r=JSON.parse(localStorage.getItem(be)||"{}");return{gesendet:Number(r.gesendet)||0,geaendert:Number(r.geaendert)||0}}catch{return{gesendet:0,geaendert:0}}}function pe(r){try{const c=ke();c[r]+=1,localStorage.setItem(be,JSON.stringify(c))}catch{}}function qe(){var ie,le;const{data:r,isLoading:c}=ve(),k=Se(),{showAlert:s,showConfirm:m,dialogElement:p}=De(),[h,g]=d.useState(""),[o,i]=d.useState("denken"),[j,w]=d.useState("schlank"),[y,l]=d.useState(!1),[N,u]=d.useState(!1),A=o!=="box",V=o==="repo",[K,je]=d.useState("lxc"),[G,te]=d.useState(!1),[v,E]=d.useState({}),[B,Ne]=d.useState(null),[H,we]=d.useState(null),[J,re]=d.useState({}),P=(r==null?void 0:r.items)??[],W=()=>k.invalidateQueries({queryKey:Le.ideen});d.useEffect(()=>{const t=h.trim();if(t.length<12){u(!1);return}let n=!1;const x=setTimeout(async()=>{try{const f=await z("/api/ideen/einordnen",{method:"POST",body:JSON.stringify({text:t})});if(n||!(f!=null&&f.ok))return;i(f.nur_denken?"denken":f.wer==="zed"?"repo":"box"),f.tiefe&&w(f.tiefe),u(!0)}catch{}},700);return()=>{n=!0,clearTimeout(x)}},[h]);const se=B!==null&&(((ie=r==null?void 0:r.items.find(t=>t.id===B))==null?void 0:ie.status)==="triage"||((le=r==null?void 0:r.items.find(t=>t.id===B))==null?void 0:le.status)==="running"),O=Ke(B??"",se);async function ne(){const t=h.trim();if(!(t.length<3||G)){te(!0);try{const n=t.length>160?t.slice(0,157)+"…":t;await z("/api/ideen",{method:"POST",body:JSON.stringify({titel:n,notiz:t.length>160?t:"",welt:A?"ide":"box",tiefe:V?j==="gruendlich"?"gruendlich":"simpel":"",ziel:V?K:"",art:o==="denken"?"idee":"projekt"})}),pe("gesendet"),g(""),u(!1),l(!1),W()}catch(n){s("Das hat nicht geklappt",String((n==null?void 0:n.message)||n))}finally{te(!1)}}}function ae(t,n,x){m(`${n} fertige Karte${n===1?"":"n"} wegräumen?`,`${x} verschwindet aus der Liste. Gelöscht wird nichts — die Karten wandern ins Archiv der Queue und bleiben dort lesbar. Laufende, hängende und wartende Karten bleiben unberührt.`,async()=>{var b;const f="arch:"+(t||"*");E(a=>({...a,[f]:!0}));try{const a=await z("/api/ideen/archivieren-alle",{method:"POST",body:JSON.stringify({projekt:t})});(b=a.fehlgeschlagen)!=null&&b.length&&s("Teilweise erledigt",`${a.archiviert} weggeräumt, ${a.fehlgeschlagen.length} nicht: `+a.fehlgeschlagen.map(L=>L.titel).join(", ")),W()}catch(a){s("Das hat nicht geklappt",String((a==null?void 0:a.message)||a))}finally{E(a=>({...a,[f]:!1}))}})}async function ye(t){E(n=>({...n,[t]:!0}));try{await z("/api/ideen/archivieren",{method:"POST",body:JSON.stringify({id:t})}),W()}catch(n){s("Das hat nicht geklappt",String((n==null?void 0:n.message)||n))}finally{E(n=>({...n,[t]:!1}))}}async function Z(t,n,x,f){E(b=>({...b,[t+n]:!0}));try{await z(x,{method:"POST",body:JSON.stringify(f)}),W()}catch(b){s("Das hat nicht geklappt",String((b==null?void 0:b.message)||b))}finally{E(b=>({...b,[t+n]:!1}))}}async function oe(t){const n=(J[t]||"").trim();if(!(n.length<1||v["ans:"+t])){E(x=>({...x,["ans:"+t]:!0}));try{await z("/api/ideen/antwort",{method:"POST",body:JSON.stringify({id:t,antwort:n})}),re(x=>({...x,[t]:""})),W()}catch(x){s("Das hat nicht geklappt",String((x==null?void 0:x.message)||x))}finally{E(x=>({...x,["ans:"+t]:!1}))}}}const q=t=>{var ce,ue;const n=Ie[t.status]??{label:t.status,cls:"text-muted-foreground border-border/60 bg-background/30"},x=B===t.id,f=t.status==="triage"||t.status==="running"||t.status==="done",b=t.status==="blocked",a=!!v["ans:"+t.id],L=t.status==="running"&&(t.puls_alter??0)>600,de=t.status==="todo"||t.status==="ready"||t.status==="scheduled";return e.jsxs("li",{className:S("flex flex-col gap-2 rounded-xl border bg-background/30 px-3 py-2",b?"border-red-500/30":L?"border-amber-500/40":"border-border/40"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:S("flex shrink-0 items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",n.cls),children:[n.spin&&e.jsx(D,{className:"h-3 w-3 animate-spin"}),n.label]}),L&&e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold text-amber-300",title:"Der Worker lebt, gibt aber kein Lebenszeichen mehr — vermutlich wartet er auf etwas, das nie kommt. „Neuer Versuch“ startet die Karte frisch.",children:[e.jsx(ze,{className:"h-3 w-3"})," ",Math.round((t.puls_alter??0)/60)," min ohne Regung"]}),(t.prio??0)!==0&&e.jsxs("span",{className:"shrink-0 rounded bg-background/50 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",title:"Priorität — höher kommt zuerst dran (bei gleicher Prio: Erstellzeit)",children:["P",t.prio]}),(()=>{const C=Ve[t.art||(t.welt==="ide"?"projekt":"box")];if(!C)return null;const M=C.icon;return e.jsxs("span",{className:S("flex shrink-0 items-center gap-1 rounded-lg border px-2 py-0.5 text-[10px] font-bold",C.cls),title:C.title,children:[e.jsx(M,{className:"h-3 w-3"})," ",C.label]})})(),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground",title:t.titel,children:t.titel}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(he,{className:"h-3 w-3"}),Ee(t.erstellt)]}),de&&e.jsxs("span",{className:"flex shrink-0 items-center",children:[e.jsx("button",{disabled:!!v["pr:"+t.id],onClick:()=>Z("pr:",t.id,"/api/ideen/prio",{id:t.id,richtung:"hoch"}),title:"Vorziehen (Prio +1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(Re,{className:"h-3.5 w-3.5"})}),e.jsx("button",{disabled:!!v["pr:"+t.id],onClick:()=>Z("pr:",t.id,"/api/ideen/prio",{id:t.id,richtung:"runter"}),title:"Zurückstellen (Prio −1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx($e,{className:"h-3.5 w-3.5"})})]}),(t.status==="running"||b)&&e.jsx("button",{disabled:!!v["rt:"+t.id],onClick:()=>m("Neuer Versuch?",t.status==="running"?`Der laufende Worker von '${t.titel.slice(0,60)}' wird beendet (samt gestarteter Test-Prozesse) und die Karte frisch gestartet. Bisheriger Zwischenstand im Workspace bleibt liegen.`:`Die Karte '${t.titel.slice(0,60)}' wird entsperrt und läuft weiter, sobald ein Platz frei ist.`,()=>Z("rt:",t.id,"/api/ideen/retry",{id:t.id})),title:"Neuer Versuch — Karte frisch starten",className:S("shrink-0 rounded-md p-1 transition-colors cursor-pointer disabled:opacity-50",L?"text-amber-300 hover:text-amber-200":"text-muted-foreground/60 hover:text-foreground"),children:v["rt:"+t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(We,{className:"h-3.5 w-3.5"})}),(t.status==="running"||de||t.status==="triage")&&e.jsx("button",{disabled:!!v["st:"+t.id],onClick:()=>m("Karte stoppen?",`'${t.titel.slice(0,60)}' wird angehalten${t.status==="running"?" und der laufende Worker beendet":""}. Sie bleibt als gestoppt im Board und kann jederzeit per „Neuer Versuch“ weiterlaufen.`,()=>Z("st:",t.id,"/api/ideen/stopp",{id:t.id})),title:"Stoppen — Karte anhalten",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-red-300 cursor-pointer disabled:opacity-50",children:v["st:"+t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Oe,{className:"h-3.5 w-3.5"})}),(t.status==="done"||b)&&e.jsx("button",{disabled:!!v[t.id],onClick:()=>ye(t.id),title:b?"Aufgeben und aus der Liste räumen (wandert ins Kanban-Archiv)":"Aus der Liste räumen (wandert ins Kanban-Archiv)",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:v[t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Q,{className:"h-3.5 w-3.5"})}),t.welt==="ide"&&(t.status==="running"||t.status==="done")&&e.jsxs("button",{onClick:()=>we(H===t.id?null:t.id),title:"Konzept ansehen (das ausgearbeitete KONZEPT.md)",className:S("flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[10px] font-bold transition-colors cursor-pointer",H===t.id?"text-violet-300":"text-violet-300/70 hover:text-violet-200"),children:[e.jsx(ge,{className:"h-3.5 w-3.5"})," Konzept"]}),f&&e.jsx("button",{onClick:()=>Ne(x?null:t.id),title:t.status==="done"?"Ergebnis anzeigen":"Worker-Log anzeigen",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer",children:x?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"})})]}),H===t.id&&e.jsx(Fe,{id:t.id,istIdee:t.art==="idee"&&t.status==="done",onWeiter:W}),t.status==="running"&&t.notiz&&e.jsxs("p",{className:"-mt-1 ml-1 text-[11px] italic leading-relaxed text-sky-200/80",title:"Jüngste Zwischenmeldung des Workers (Heartbeat)",children:["„",t.notiz,"“"]}),(t.status==="todo"||t.status==="scheduled"||t.status==="ready")&&(((ce=t.wartet_auf)==null?void 0:ce.length)??0)>0&&e.jsxs("p",{className:"-mt-1 ml-1 text-[10px] text-muted-foreground/70",children:["→ wartet auf: ",t.wartet_auf.join(" · ")]}),b&&e.jsxs("div",{className:"space-y-2 border-t border-red-500/20 pt-2",children:[e.jsxs("p",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-red-200/90",children:[e.jsx(xe,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-300"}),e.jsxs("span",{children:[e.jsx("b",{children:Ze[t.frage_kind||""]??"Die Aufgabe hängt und wartet auf dich:"})," ",t.frage?e.jsx("span",{className:"text-foreground/90",children:t.frage}):e.jsx("span",{className:"text-muted-foreground italic",children:"kein genauer Grund hinterlegt — antworte einfach mit einer Entscheidung, dann läuft sie weiter."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:J[t.id]||"",onChange:C=>re(M=>({...M,[t.id]:C.target.value})),onKeyDown:C=>{C.key==="Enter"&&oe(t.id)},placeholder:"Deine Antwort — die Box macht damit weiter",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>oe(t.id),disabled:a||(J[t.id]||"").trim().length<1,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[a?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(me,{className:"h-3.5 w-3.5"})," Antworten & weiter"]})]})]}),x&&f&&t.status!=="done"&&e.jsx("div",{className:"ml-2 -mt-1",children:e.jsx("div",{className:"rounded-lg border border-border/50 bg-background/50 p-2",children:se&&O.isLoading?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Log wird geladen …"}):O.error?e.jsx("p",{className:"text-[10px] text-red-400",children:"Log nicht ladbar"}):(ue=O.data)!=null&&ue.available&&O.data.lines.length>0?e.jsx("pre",{className:"max-h-64 overflow-auto font-mono text-[10px] leading-relaxed text-foreground/80 whitespace-pre-wrap",children:O.data.lines.join(` -`)}):e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Kein Log verfügbar"})})}),x&&t.status==="done"&&e.jsx(He,{id:t.id})]},t.id)};return r&&!r.available?null:e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Ae,{icon:T,children:(()=>{if(!r)return"Ideen-Queue";const t=x=>P.filter(f=>x.includes(f.status)).length,n=[t(["blocked"])>0?`${t(["blocked"])} braucht dich`:"",t(["running","triage","review"])>0?`${t(["running","triage","review"])} in Arbeit`:"",t(["todo","scheduled","ready"])>0?`${t(["todo","scheduled","ready"])} wartet`:"",t(["done"])>0?`${t(["done"])} fertig`:""].filter(Boolean);return n.length?n.join(" · "):"noch nichts in der Queue"})()}),(()=>{const t=P.filter(n=>n.status==="done").length;return t===0?null:e.jsxs("button",{disabled:!!v["arch:*"],onClick:()=>ae("",t,`Alle ${t} fertigen Karten`),title:"Räumt ALLE fertigen Karten weg — auch die in abgeschlossenen Projekt-Ketten. Laufende, hängende und wartende bleiben unberührt.",className:"flex shrink-0 items-center gap-1.5 rounded-lg border border-border/60 px-2.5 py-1 text-[11px] font-semibold text-muted-foreground transition-all hover:border-primary/40 hover:text-foreground disabled:opacity-50 cursor-pointer",children:[v["arch:*"]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),t," fertige wegräumen"]})})()]}),e.jsxs("div",{className:"mc-card p-4 space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:h,onChange:t=>{g(t.target.value),u(!1)},onKeyDown:t=>{t.key==="Enter"&&ne()},placeholder:"Was soll entstehen?",className:"h-10 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/50 px-3 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"}),e.jsxs("button",{onClick:ne,disabled:G||h.trim().length<3,className:"flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-primary/40 bg-primary/10 px-4 text-xs font-semibold text-primary transition-all hover:bg-primary/20 disabled:opacity-40 cursor-pointer",children:[G?e.jsx(D,{className:"h-4 w-4 animate-spin"}):e.jsx(me,{className:"h-4 w-4"}),"Los"]})]}),y?e.jsxs("div",{className:"space-y-3 rounded-xl border border-border/40 bg-background/20 p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-muted-foreground/70",children:"Wer baut das?"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsx(F,{aktiv:o!=="box",onWahl:()=>i(o==="box"?"denken":o),k:{id:"zed",icon:ee,titel:"Ich, in Zed",text:"Du bekommst Konzept und Repo — den Code schreibst du selbst."}}),e.jsx(F,{aktiv:o==="box",onWahl:()=>i("box"),k:{id:"box",icon:U,titel:"Die Box, allein",text:"Für dein Heimlabor. Das Ergebnis kommt als Patch-Vorschlag ins Auftragsbuch."}})]})]}),o!=="box"&&e.jsxs("div",{className:"border-l-2 border-primary/40 pl-3",children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-muted-foreground/70",children:"Und wie startest du?"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsx(F,{aktiv:o==="denken",onWahl:()=>i("denken"),k:{id:"denken",icon:T,titel:"Erst durchdenken",text:"Konzept zuerst — auf dein Ja wird ein Repo daraus."}}),e.jsx(F,{aktiv:o==="repo",onWahl:()=>i("repo"),k:{id:"repo",icon:Y,titel:"Direkt ein Repo",text:"Konzept und Gitea-Repo in einem Zug."}})]}),o==="repo"?e.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Wie gründlich?"}),e.jsx("div",{className:"flex rounded-lg border border-border/60 p-0.5",children:[["schlank","schlank"],["gruendlich","gründlich"]].map(([t,n])=>e.jsx("button",{onClick:()=>w(t),className:S("rounded px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",j===t?"bg-primary/15 text-primary":"text-muted-foreground/60 hover:text-foreground"),children:n},t))}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Läuft als"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:[["lxc","LXC"],["docker","Docker"]].map(([t,n])=>e.jsx("button",{onClick:()=>je(t),title:t==="lxc"?"Dienst in einem eigenen Proxmox-LXC (systemd, kein Docker). Wird vom Backup-Server mitgesichert.":"Natives Docker: Dockerfile + compose, portabel und pipeline-tauglich.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",K===t?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:n},t))})]})]}):e.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[10px] leading-relaxed text-muted-foreground/60",children:[e.jsx(xe,{className:"mt-px h-3 w-3 shrink-0"}),'Wie gründlich und wo es läuft, fragt die Box erst beim „gefällt mir" — dann weißt du mehr.']})]}),(()=>{const t=ke();return t.gesendet<3?null:e.jsxs("p",{className:"border-t border-border/30 pt-2 text-[10px] text-muted-foreground/50",children:["Du hast ",t.geaendert," von ",t.gesendet," Vorschlägen geändert. Wird das die Regel, bauen wir hier einen richtigen Schritt-für-Schritt-Assistenten."]})})()]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-border/40 bg-background/20 px-3 py-2.5 text-xs",children:[o==="box"?e.jsx(U,{className:"h-4 w-4 shrink-0 text-primary"}):o==="repo"?e.jsx(Y,{className:"h-4 w-4 shrink-0 text-primary"}):e.jsx(T,{className:"h-4 w-4 shrink-0 text-primary"}),!N&&e.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-wider text-muted-foreground/50",children:"Voreingestellt"}),e.jsx("span",{className:"text-muted-foreground",children:o==="box"?"Ich baue das selbst und lege dir das Ergebnis als Vorschlag hin.":o==="repo"?"Du baust selbst — ich lege dir Konzept und Repo an.":"Du baust selbst — ich arbeite erst ein Konzept aus."}),N&&e.jsx("span",{className:"shrink-0 rounded border border-primary/40 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold text-primary",children:"gelesen"}),e.jsx("button",{onClick:()=>{l(!0),pe("geaendert")},className:"ml-auto shrink-0 text-[11px] text-muted-foreground/60 underline underline-offset-2 transition-colors hover:text-foreground cursor-pointer",children:"anders"})]}),c&&e.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"})," Queue wird geladen …"]}),(r==null?void 0:r.fehler)&&e.jsx("p",{className:"text-xs text-amber-300",children:"Queue gerade nicht lesbar — neuer Versuch läuft."}),P.length>0&&e.jsxs("div",{className:"space-y-3",children:[((r==null?void 0:r.projekte)??[]).map(t=>e.jsx(_e,{projekt:t,karten:P.filter(n=>n.projekt===t.key),zeile:q,onArchivAlle:ae,raeumt:!!v["arch:"+t.key]},t.key)),(()=>{const t=new Set(((r==null?void 0:r.projekte)??[]).map(a=>a.key)),n=P.filter(a=>!a.projekt||!t.has(a.projekt));if(n.length===0)return null;const x=n.filter(a=>$[a.status]!==void 0).sort((a,L)=>$[a.status]-$[L.status]||(a.erstellt??0)-(L.erstellt??0)),f=n.filter(a=>["todo","scheduled"].includes(a.status)),b=n.filter(a=>a.status==="done");return e.jsxs("div",{className:"space-y-2",children:[x.length>0&&e.jsx("ul",{className:"space-y-1.5",children:x.map(a=>q(a))}),f.length>0&&e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 py-1 text-[11px] text-muted-foreground/70 hover:text-foreground",children:[e.jsx(I,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),e.jsx(he,{className:"h-3 w-3"})," Wartet (",f.length,")"]}),e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:f.map(a=>q(a))})]}),b.length>0&&e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 py-1 text-[11px] text-muted-foreground/70 hover:text-foreground",children:[e.jsx(I,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),e.jsx(Ce,{className:"h-3 w-3 text-emerald-400/70"})," Fertig (",b.length,")"]}),e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:b.map(a=>q(a))})]})]})})()]}),(r==null?void 0:r.available)&&!c&&P.length===0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground/70",children:"Noch nichts hier. Zum Beispiel:"}),["Ein kleines Werkzeug, das meine Fotos nach Aufnahmedatum in Ordner sortiert","Rippy soll die Untertitel-Spur automatisch auswählen statt zu fragen","Lohnt sich ein Dashboard für die Stromzähler, oder reicht Home Assistant?"].map(t=>e.jsxs("button",{onClick:()=>g(t),className:"flex w-full items-center gap-2 rounded-lg border border-border/40 bg-background/20 px-3 py-2 text-left text-xs text-muted-foreground transition-all hover:border-primary/40 hover:text-foreground cursor-pointer",children:[e.jsx(T,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/50"}),t]},t))]})]}),p]})}function F({k:r,aktiv:c,onWahl:k}){return e.jsxs("button",{onClick:k,className:S("rounded-xl border p-3 text-left transition-all cursor-pointer",c?"border-primary/60 bg-primary/5":"border-border/50 hover:border-border"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r.icon,{className:S("h-4 w-4 shrink-0",c?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"text-xs font-semibold text-foreground",children:r.titel})]}),e.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:r.text})]})}const $={blocked:0,running:1,review:2,ready:3,triage:4};function _e({projekt:r,karten:c,zeile:k,onArchivAlle:s,raeumt:m}){const[p,h]=d.useState(!1),[g,o]=d.useState(!1),i=c.filter(l=>$[l.status]!==void 0).sort((l,N)=>$[l.status]-$[N.status]||(l.erstellt??0)-(N.erstellt??0)),j=c.filter(l=>l.status==="todo"||l.status==="scheduled").sort((l,N)=>{var u,A;return((u=l.wartet_auf)!=null&&u.length?1:0)-((A=N.wartet_auf)!=null&&A.length?1:0)||(l.erstellt??0)-(N.erstellt??0)}),w=c.filter(l=>l.status==="done").sort((l,N)=>(N.fertig??0)-(l.fertig??0)),y=r.gesamt>0?Math.round(r.fertig/r.gesamt*100):0;return e.jsxs("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/20 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Pe,{className:"h-4 w-4 shrink-0 text-primary/70"}),e.jsx("p",{className:"min-w-0 flex-1 truncate text-xs font-semibold text-foreground",title:r.titel,children:r.titel}),e.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[r.fertig," von ",r.gesamt," fertig"]})]}),e.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-background/60",title:`${y}%`,children:e.jsx("div",{className:"h-1 rounded-full bg-primary/70 transition-all",style:{width:`${y}%`}})}),i.length>0&&e.jsx("ul",{className:"space-y-1.5",children:i.map(l=>k(l))}),j.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>h(l=>!l),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[p?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"}),j.length," Karte",j.length===1?"":"n"," in der Kette — laufen automatisch der Reihe nach"]}),p&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:j.map(l=>k(l))})]}),w.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>o(l=>!l),className:"flex items-center gap-1.5 text-[11px] font-semibold text-emerald-300/70 hover:text-emerald-300 transition-colors cursor-pointer",children:[g?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(I,{className:"h-3.5 w-3.5"}),w.length," fertig"]}),s&&e.jsxs("button",{disabled:m,onClick:()=>s(r.key,w.length,`„${r.titel}"`),title:"Räumt die fertigen Karten dieser Kette weg (Archiv, nichts wird gelöscht).",className:"flex items-center gap-1 text-[11px] text-muted-foreground/60 transition-colors hover:text-foreground disabled:opacity-50 cursor-pointer",children:[m?e.jsx(D,{className:"h-3 w-3 animate-spin"}):e.jsx(Q,{className:"h-3 w-3"}),"wegräumen"]})]}),g&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:w.map(l=>k(l))})]})]})}function Fe({id:r,istIdee:c,onWeiter:k}){const[s,m]=d.useState(null),[p,h]=d.useState(!1),[g,o]=d.useState(0);return d.useEffect(()=>{let i=!1;return m(null),h(!1),z(`/api/ideen/${r}/konzept`).then(j=>{i||m(j)}).catch(()=>{i||h(!0)}),()=>{i=!0}},[r,g]),e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-violet-500/25 bg-violet-500/[0.04] p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-violet-300",children:[e.jsx(ge,{className:"h-3 w-3"})," Konzept"]}),(s==null?void 0:s.repo)&&e.jsxs("a",{href:`https://git.tobisniceshomelab.ddnsfree.com/${s.repo}`,className:"flex items-center gap-1 text-[10px] text-violet-300/70 hover:text-violet-200",children:[e.jsx(Y,{className:"h-3 w-3"})," ",s.repo]}),!(s!=null&&s.repo)&&(s==null?void 0:s.quelle)==="datei"&&e.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/70",title:"Der Worker hat kein Repo angelegt — das Konzept liegt als Datei auf der Box.",children:s.pfad}),e.jsx("button",{onClick:()=>o(i=>i+1),title:"Neu laden",className:"ml-auto rounded p-0.5 text-muted-foreground/50 hover:text-foreground cursor-pointer",children:e.jsx(fe,{className:"h-3 w-3"})})]}),p?e.jsx("p",{className:"text-[11px] text-red-400",children:"Konzept nicht ladbar — später nochmal versuchen."}):s===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Konzept wird geladen …"}):s.konzept?e.jsx("div",{className:"max-h-[28rem] overflow-y-auto pr-1",children:e.jsx(Te,{text:s.konzept})}):e.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:s.error||"Noch kein Konzept — das Projekt wird gerade vorbereitet."}),c&&(s==null?void 0:s.konzept)&&e.jsx(Ge,{id:r,onFertig:k})]})})}function Ge({id:r,onFertig:c}){const[k,s]=d.useState("lxc"),[m,p]=d.useState("simpel"),[h,g]=d.useState(!1),[o,i]=d.useState(null),[j,w]=d.useState(""),[y,l]=d.useState(""),N=async(u,A,V)=>{g(!0),w("");try{const K=await z(u,{method:"POST",body:JSON.stringify(A)});i({id:K.id,art:V}),c==null||c()}catch(K){w(String((K==null?void 0:K.message)||K))}finally{g(!1)}};return o?e.jsx("p",{className:"mt-3 border-t border-violet-500/20 pt-2 text-[11px] text-emerald-300",children:o.art==="projekt"?e.jsxs(e.Fragment,{children:["Projekt-Karte ",e.jsx("span",{className:"font-mono",children:o.id})," ist angelegt — die Box bereitet das Repo vor (Konzept übernimmt sie, sie denkt es nicht neu). Danach öffnest du es in Zed."]}):e.jsxs(e.Fragment,{children:["Überarbeitung ",e.jsx("span",{className:"font-mono",children:o.id}),' läuft — die Box arbeitet deine Rückmeldung ein und schreibt die neue Fassung an dieselbe Stelle. Danach hier wieder „Konzept" öffnen.']})}):e.jsxs("div",{className:"mt-3 space-y-3 border-t border-violet-500/20 pt-2.5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx("b",{className:"text-sky-300/90",children:"Passt etwas nicht?"})," Schreib hin, was anders werden soll — die Box arbeitet es ein und lässt den Rest stehen. Beliebig oft wiederholbar."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:y,onChange:u=>l(u.target.value),onKeyDown:u=>{u.key==="Enter"&&y.trim().length>=3&&!h&&N("/api/ideen/nachschaerfen",{id:r,hinweis:y},"runde")},placeholder:"z. B. „Punkt 3: kein WebSocket, das ist mir zu fragil — nimm Polling“",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-sky-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>N("/api/ideen/nachschaerfen",{id:r,hinweis:y},"runde"),disabled:h||y.trim().length<3,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-sky-500/40 bg-sky-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-sky-300 transition-all hover:bg-sky-500/20 cursor-pointer disabled:opacity-50",children:[h?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(fe,{className:"h-3.5 w-3.5"}),"Nachschärfen"]})]})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx("b",{className:"text-violet-300/90",children:"Passt es so?"})," Dann macht die Box daraus ein startklares Repo — Konzept wird übernommen (nicht neu gedacht), dazu Roadmap, AGENTS.md & Co. Gebaut wird danach von dir in Zed."]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Ziel"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:["lxc","docker"].map(u=>e.jsx("button",{onClick:()=>s(u),title:u==="lxc"?"Dienst in einem eigenen Proxmox-LXC (systemd, kein Docker) — wird automatisch mitgesichert.":"Natives Docker: Dockerfile + compose, portabel und pipeline-tauglich.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",k===u?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:u==="lxc"?"LXC":"Docker"},u))}),e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Aufwand"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:["simpel","gruendlich"].map(u=>e.jsx("button",{onClick:()=>p(u),title:u==="simpel"?"Konzept ist schon gehärtet — nur kurz auf die Bau-Sicht nachschärfen (empfohlen).":"Nochmal volle Kaskade über die Bau-Sicht: mehrere Rollen, Härtetests. Dauert entsprechend.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",m===u?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:u==="simpel"?"schlank":"gründlich"},u))}),e.jsxs("button",{onClick:()=>N("/api/ideen/weiterfuehren",{id:r,ziel:k,tiefe:m},"projekt"),disabled:h,className:"ml-auto flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[h?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ee,{className:"h-3.5 w-3.5"}),"Gefällt mir — Projekt daraus machen"]})]}),j&&e.jsx("p",{className:"text-[11px] text-red-400",children:j})]})}function He({id:r}){const[c,k]=d.useState(null),[s,m]=d.useState(!1),[p,h]=d.useState(0);d.useEffect(()=>{let o=!1;return m(!1),k(null),z(`/api/ideen/${r}/ergebnis`).then(i=>{o||k(i)}).catch(()=>{o||m(!0)}),()=>{o=!0}},[r,p]);const g=c?c.summary||c.result:"";return e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-emerald-500/25 bg-emerald-500/5 p-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-emerald-300",children:[e.jsx(Be,{className:"h-3 w-3"})," Ergebnis des Workers"]}),s?e.jsx("button",{type:"button",onClick:()=>h(o=>o+1),className:"text-[10px] text-red-400 underline decoration-dotted underline-offset-2 hover:text-red-300",children:"Ergebnis nicht ladbar — nochmal versuchen"}):c===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Wird geladen …"}):g?e.jsx("p",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:g}):e.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"Der Worker hat keine Abschluss-Zusammenfassung hinterlassen (ältere Karte oder Protokollverstoß)."})]})})}function et(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Ideen"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Schreib hin, was entstehen soll. Die Box liest mit und schlägt vor, wie es weitergeht — ändern kannst du das immer."})]}),e.jsx(qe,{})]})}export{et as IdeenView}; diff --git a/frontend/dist/assets/KonsoleView-Liu9bAm4.js b/frontend/dist/assets/KonsoleView-BJCYPWry.js similarity index 98% rename from frontend/dist/assets/KonsoleView-Liu9bAm4.js rename to frontend/dist/assets/KonsoleView-BJCYPWry.js index 601c162..db6ba44 100644 --- a/frontend/dist/assets/KonsoleView-Liu9bAm4.js +++ b/frontend/dist/assets/KonsoleView-BJCYPWry.js @@ -1 +1 @@ -import{K as b,u as f,N as h,r as d,j as e,e as c,M as g,T as p,U as j,V as N,g as v,Y as w,q as x}from"./index-B1_ue-6-.js";function y(){const{data:s}=b(),m=f(),r=s!=null&&s.box_console_url?h(s.box_console_url):void 0,a=s==null?void 0:s.box_console_reachable,[l,o]=d.useState(!1),[i,n]=d.useState("");async function u(){o(!0),n("");try{const t=await v("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:"box-console"})});n(t.ok?"Neu gestartet — einen Moment, dann lädt das Terminal.":`Fehlgeschlagen: ${t.err||"Unbekannter Fehler"}`),w(m,x.agentStatus,x.services)}catch(t){n(`Fehlgeschlagen: ${(t==null?void 0:t.message)||t}`)}finally{o(!1)}}return e.jsxs("div",{className:"flex h-full flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Konsole"}),e.jsx("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Direkte Shell auf der Box — wie ein SSH-Fenster, mitten im Browser."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[e.jsx("span",{className:c("h-2 w-2 rounded-full",a?"bg-emerald-500 animate-pulse":"bg-amber-500")}),a?"online":"offline"]}),r&&e.jsxs("a",{href:r,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[e.jsx(g,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),r?e.jsxs("div",{className:"relative min-h-[58vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[a===!1&&e.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[e.jsx(p,{className:"h-8 w-8 text-amber-400"}),e.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Konsole nicht erreichbar"}),e.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der Terminal-Dienst (",e.jsx("code",{className:"font-mono text-primary",children:"box-console"}),") läuft gerade nicht."]}),e.jsxs("button",{onClick:u,disabled:l,className:"flex h-9 items-center gap-1.5 rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 text-[11px] font-bold uppercase tracking-wide text-amber-300 transition-all hover:bg-amber-500/20 cursor-pointer disabled:opacity-50",children:[e.jsx(j,{className:c("h-3.5 w-3.5",l&&"animate-spin")})," Dienst neu starten"]}),i&&e.jsx("p",{className:"max-w-sm text-[11px] text-muted-foreground",children:i})]}),e.jsx("iframe",{src:r,title:"Box-Konsole",className:"h-full w-full border-0",style:{minHeight:"58vh"}})]}):e.jsxs("div",{className:"flex min-h-[58vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[e.jsx(N,{className:"mr-2 h-4 w-4"})," Lade Konsole…"]})]})}export{y as KonsoleView}; +import{K as b,u as f,N as h,r as d,j as e,e as c,M as g,T as p,U as j,V as N,g as v,Y as w,q as x}from"./index-CUuKs_1x.js";function y(){const{data:s}=b(),m=f(),r=s!=null&&s.box_console_url?h(s.box_console_url):void 0,a=s==null?void 0:s.box_console_reachable,[l,o]=d.useState(!1),[i,n]=d.useState("");async function u(){o(!0),n("");try{const t=await v("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:"box-console"})});n(t.ok?"Neu gestartet — einen Moment, dann lädt das Terminal.":`Fehlgeschlagen: ${t.err||"Unbekannter Fehler"}`),w(m,x.agentStatus,x.services)}catch(t){n(`Fehlgeschlagen: ${(t==null?void 0:t.message)||t}`)}finally{o(!1)}}return e.jsxs("div",{className:"flex h-full flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Konsole"}),e.jsx("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Direkte Shell auf der Box — wie ein SSH-Fenster, mitten im Browser."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[e.jsx("span",{className:c("h-2 w-2 rounded-full",a?"bg-emerald-500 animate-pulse":"bg-amber-500")}),a?"online":"offline"]}),r&&e.jsxs("a",{href:r,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[e.jsx(g,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),r?e.jsxs("div",{className:"relative min-h-[58vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[a===!1&&e.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[e.jsx(p,{className:"h-8 w-8 text-amber-400"}),e.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Konsole nicht erreichbar"}),e.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der Terminal-Dienst (",e.jsx("code",{className:"font-mono text-primary",children:"box-console"}),") läuft gerade nicht."]}),e.jsxs("button",{onClick:u,disabled:l,className:"flex h-9 items-center gap-1.5 rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 text-[11px] font-bold uppercase tracking-wide text-amber-300 transition-all hover:bg-amber-500/20 cursor-pointer disabled:opacity-50",children:[e.jsx(j,{className:c("h-3.5 w-3.5",l&&"animate-spin")})," Dienst neu starten"]}),i&&e.jsx("p",{className:"max-w-sm text-[11px] text-muted-foreground",children:i})]}),e.jsx("iframe",{src:r,title:"Box-Konsole",className:"h-full w-full border-0",style:{minHeight:"58vh"}})]}):e.jsxs("div",{className:"flex min-h-[58vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[e.jsx(N,{className:"mr-2 h-4 w-4"})," Lade Konsole…"]})]})}export{y as KonsoleView}; diff --git a/frontend/dist/assets/ModelsView-B2TpOTbs.js b/frontend/dist/assets/ModelsView-vX0ckGpG.js similarity index 99% rename from frontend/dist/assets/ModelsView-B2TpOTbs.js rename to frontend/dist/assets/ModelsView-vX0ckGpG.js index bcf17c5..7615863 100644 --- a/frontend/dist/assets/ModelsView-B2TpOTbs.js +++ b/frontend/dist/assets/ModelsView-vX0ckGpG.js @@ -1,4 +1,4 @@ -import{c as E,u as oe,a as Fe,b as ge,j as e,f as ue,d as Re,e as w,g as K,q as T,h as Ie,r as N,C as Y,L as Pe,i as Te,B as le,k as Oe,E as Be,l as de,m as $e,n as Ge,o as He,p as ee,X as pe,H as fe,T as re,s as Qe,t as Ue,v as V,w as Ve,S as ye,x as We,P as Ze,y as Je,z as Xe,A as Ye}from"./index-B1_ue-6-.js";import{C as et}from"./code-xml-CtSuST1m.js";import{R as tt}from"./rotate-ccw-KIERrTyE.js";import{C as he,Z as ie,L as rt,a as st}from"./zap-BxCGzT3u.js";import{C as De}from"./chevron-down-CxeBPXxe.js";import{L as nt}from"./layers-PioAw_-7.js";/** +import{c as E,u as oe,a as Fe,b as ge,j as e,f as ue,d as Re,e as w,g as K,q as T,h as Ie,r as N,C as Y,L as Pe,i as Te,B as le,k as Oe,E as Be,l as de,m as $e,n as Ge,o as He,p as ee,X as pe,H as fe,T as re,s as Qe,t as Ue,v as V,w as Ve,S as ye,x as We,P as Ze,y as Je,z as Xe,A as Ye}from"./index-CUuKs_1x.js";import{C as et}from"./code-xml-DlqRSqmr.js";import{R as tt}from"./rotate-ccw-BtnOKhJQ.js";import{C as he,Z as ie,L as rt,a as st}from"./zap-iWjc7Axa.js";import{C as De}from"./chevron-down-MK8qZkE9.js";import{L as nt}from"./layers-CjyCNjIs.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/SectionLabel-Bm9VMRua.js b/frontend/dist/assets/SectionLabel-SQgndpwc.js similarity index 93% rename from frontend/dist/assets/SectionLabel-Bm9VMRua.js rename to frontend/dist/assets/SectionLabel-SQgndpwc.js index 8f00e5f..fe89ff7 100644 --- a/frontend/dist/assets/SectionLabel-Bm9VMRua.js +++ b/frontend/dist/assets/SectionLabel-SQgndpwc.js @@ -1,4 +1,4 @@ -import{c as s,j as e}from"./index-B1_ue-6-.js";/** +import{c as s,j as e}from"./index-CUuKs_1x.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/WissenView-0h5kZV64.js b/frontend/dist/assets/WissenView-DgtrXx57.js similarity index 99% rename from frontend/dist/assets/WissenView-0h5kZV64.js rename to frontend/dist/assets/WissenView-DgtrXx57.js index 47906e1..f1caf38 100644 --- a/frontend/dist/assets/WissenView-0h5kZV64.js +++ b/frontend/dist/assets/WissenView-DgtrXx57.js @@ -1,4 +1,4 @@ -var to=Object.defineProperty;var eo=(e,n,r)=>n in e?to(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var Bn=(e,n,r)=>eo(e,typeof n!="symbol"?n+"":n,r);import{ag as Ft,r as W,ah as no,ai as Xn,aj as Yn,ak as ro,al as io,am as Zn,an as Kn,ao as oo,j as $,U as ao,ap as so,aq as uo,g as lo,e as Ae,L as Ke,S as co,aa as fo,a2 as ho,ar as po}from"./index-B1_ue-6-.js";import{F as go}from"./folder-open-BJ80fZwG.js";function yo(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var Qn=180/Math.PI,fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yr(e,n,r,i,o,a){var s,u,c;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(c=e*r+n*i)&&(r-=e*c,i-=n*c),(u=Math.sqrt(r*r+i*i))&&(r/=u,i/=u,c/=u),e*i180?f+=360:f-l>180&&(l+=360),d.push({i:h.push(o(h)+"rotate(",null,i)-2,x:Ft(l,f)})):f&&h.push(o(h)+"rotate("+f+i)}function u(l,f,h,d){l!==f?d.push({i:h.push(o(h)+"skewX(",null,i)-2,x:Ft(l,f)}):f&&h.push(o(h)+"skewX("+f+i)}function c(l,f,h,d,p,y){if(l!==h||f!==d){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:Ft(l,h)},{i:x-2,x:Ft(f,d)})}else(h!==1||d!==1)&&p.push(o(p)+"scale("+h+","+d+")")}return function(l,f){var h=[],d=[];return l=e(l),f=e(f),a(l.translateX,l.translateY,f.translateX,f.translateY,h,d),s(l.rotate,f.rotate,h,d),u(l.skewX,f.skewX,h,d),c(l.scaleX,l.scaleY,f.scaleX,f.scaleY,h,d),l=f=null,function(p){for(var y=-1,x=d.length,m;++ye.length)&&(n=e.length);for(var r=0,i=new Array(n);rn in e?to(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var Bn=(e,n,r)=>eo(e,typeof n!="symbol"?n+"":n,r);import{ag as Ft,r as W,ah as no,ai as Xn,aj as Yn,ak as ro,al as io,am as Zn,an as Kn,ao as oo,j as $,U as ao,ap as so,aq as uo,g as lo,e as Ae,L as Ke,S as co,aa as fo,a2 as ho,ar as po}from"./index-CUuKs_1x.js";import{F as go}from"./folder-open-CbSQGCoL.js";function yo(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var Qn=180/Math.PI,fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yr(e,n,r,i,o,a){var s,u,c;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(c=e*r+n*i)&&(r-=e*c,i-=n*c),(u=Math.sqrt(r*r+i*i))&&(r/=u,i/=u,c/=u),e*i180?f+=360:f-l>180&&(l+=360),d.push({i:h.push(o(h)+"rotate(",null,i)-2,x:Ft(l,f)})):f&&h.push(o(h)+"rotate("+f+i)}function u(l,f,h,d){l!==f?d.push({i:h.push(o(h)+"skewX(",null,i)-2,x:Ft(l,f)}):f&&h.push(o(h)+"skewX("+f+i)}function c(l,f,h,d,p,y){if(l!==h||f!==d){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:Ft(l,h)},{i:x-2,x:Ft(f,d)})}else(h!==1||d!==1)&&p.push(o(p)+"scale("+h+","+d+")")}return function(l,f){var h=[],d=[];return l=e(l),f=e(f),a(l.translateX,l.translateY,f.translateX,f.translateY,h,d),s(l.rotate,f.rotate,h,d),u(l.skewX,f.skewX,h,d),c(l.scaleX,l.scaleY,f.scaleX,f.scaleY,h,d),l=f=null,function(p){for(var y=-1,x=d.length,m;++ye.length)&&(n=e.length);for(var r=0,i=new Array(n);ra,methodNames:i=[],initPropNames:o=[]}={}){return W.forwardRef((a,s)=>{const u=W.useRef(),c=W.useMemo(()=>{const h=Object.fromEntries(o.filter(d=>a.hasOwnProperty(d)).map(d=>[d,a[d]]));return e(h)},[]);er(()=>{c(r(u.current))},W.useLayoutEffect),er(()=>c._destructor instanceof Function?c._destructor:void 0);const l=W.useCallback((h,...d)=>c[h]instanceof Function?c[h](...d):void 0,[c]),f=W.useRef({});return Object.keys(jo(a,[...i,...o])).filter(h=>f.current[h]!==a[h]).forEach(h=>l(h,a[h])),f.current=a,W.useImperativeHandle(s,()=>Object.fromEntries(i.map(h=>[h,(...d)=>l(h,...d)])),[l]),no.createElement(n,{ref:u})})}function er(e,n=W.useEffect){const r=W.useRef(),i=W.useRef(!1),o=W.useRef(!1),[a,s]=W.useState(0);i.current&&(o.current=!0),n(()=>(i.current||(r.current=e(),i.current=!0),s(u=>u+1),()=>{o.current&&(r.current&&r.current(),r.current=void 0,i.current=!1,o.current=!1)}),[])}var dn="http://www.w3.org/1999/xhtml";const nr={svg:"http://www.w3.org/2000/svg",xhtml:dn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function We(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),nr.hasOwnProperty(n)?{space:nr[n],local:e}:e}function Io(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===dn&&n.documentElement.namespaceURI===dn?n.createElement(e):n.createElementNS(r,e)}}function $o(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qr(e){var n=We(e);return(n.local?$o:Io)(n)}function Lo(){}function Tn(e){return e==null?Lo:function(){return this.querySelector(e)}}function Fo(e){typeof e!="function"&&(e=Tn(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o=w&&(w=k+1);!(v=m[w])&&++w=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function fa(e){e||(e=ha);function n(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;an?1:e>=n?0:NaN}function da(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pa(){return Array.from(this)}function ga(){for(var e=this._groups,n=0,r=e.length;n1?this.each((n==null?Sa:typeof n=="function"?Ta:Ma)(e,n,r??"")):Bt(this.node(),e)}function Bt(e,n){return e.style.getPropertyValue(n)||ri(e).getComputedStyle(e,null).getPropertyValue(n)}function Oa(e){return function(){delete this[e]}}function Ea(e,n){return function(){this[e]=n}}function za(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Na(e,n){return arguments.length>1?this.each((n==null?Oa:typeof n=="function"?za:Ea)(e,n)):this.node()[e]}function ii(e){return e.trim().split(/^|\s+/)}function Pn(e){return e.classList||new oi(e)}function oi(e){this._node=e,this._names=ii(e.getAttribute("class")||"")}oi.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ai(e,n){for(var r=Pn(e),i=-1,o=n.length;++i=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function ss(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,a;r{}};function ve(){for(var e=0,n=arguments.length,r={},i;e=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Se.prototype=ve.prototype={constructor:Se,on:function(e,n){var r=this._,i=_s(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a0)for(var r=new Array(o),i=0,o,a;i()=>e;function pn(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:u,dx:c,dy:l,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:f}})}pn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xs(e){return!e.ctrlKey&&!e.button}function bs(){return this.parentNode}function ws(e,n){return n??{x:e.x,y:e.y}}function ks(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cs(){var e=xs,n=bs,r=ws,i=ks,o={},a=ve("start","drag","end"),s=0,u,c,l,f,h=0;function d(_){_.on("mousedown.drag",p).filter(i).on("touchstart.drag",m).on("touchmove.drag",g,ms).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,v){if(!(f||!e.call(this,_,v))){var A=w(this,n.call(this,_,v),_,v,"mouse");A&&(pt(_.view).on("mousemove.drag",y,pe).on("mouseup.drag",x,pe),ci(_.view),Qe(_),l=!1,u=_.clientX,c=_.clientY,A("start",_))}}function y(_){if(Vt(_),!l){var v=_.clientX-u,A=_.clientY-c;l=v*v+A*A>h}o.mouse("drag",_)}function x(_){pt(_.view).on("mousemove.drag mouseup.drag",null),fi(_.view,l),Vt(_),o.mouse("end",_)}function m(_,v){if(e.call(this,_,v)){var A=_.changedTouches,M=n.call(this,_,v),T=A.length,R,P;for(R=0;R=0&&e._call.call(void 0,n),e=e._next;--Xt}function ir(){Ht=(Re=ge.now())+Ge,Xt=ae=0;try{Ss()}finally{Xt=0,Ts(),Ht=0}}function Ms(){var e=ge.now(),n=e-Re;n>hi&&(Ge-=n,Re=e)}function Ts(){for(var e,n=Ne,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Ne=r);se=e,gn(i)}function gn(e){if(!Xt){ae&&(ae=clearTimeout(ae));var n=e-Ht;n>24?(e<1/0&&(ae=setTimeout(ir,e-ge.now()-Ge)),Qt&&(Qt=clearInterval(Qt))):(Qt||(Re=ge.now(),Qt=setInterval(Ms,hi)),Xt=1,di(ir))}}function or(e,n,r){var i=new je;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var Ps=ve("start","end","cancel","interrupt"),Os=[],pi=0,ar=1,yn=2,Me=3,sr=4,_n=5,Te=6;function Ve(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Es(e,r,{name:n,index:i,group:o,on:Ps,tween:Os,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:pi})}function zn(e,n){var r=vt(e,n);if(r.state>pi)throw new Error("too late; already scheduled");return r}function Ct(e,n){var r=vt(e,n);if(r.state>Me)throw new Error("too late; already running");return r}function vt(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function Es(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=En(a,0,r.time);function a(l){r.state=ar,r.timer.restart(s,r.delay,r.time),r.delay<=l&&s(l-r.delay)}function s(l){var f,h,d,p;if(r.state!==ar)return c();for(f in i)if(p=i[f],p.name===r.name){if(p.state===Me)return or(s);p.state===sr?(p.state=Te,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[f]):+fyn&&i.state<_n,i.state=Te,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function zs(e){return this.each(function(){Pe(this,e)})}function Ns(e,n){var r,i;return function(){var o=Ct(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,u=i.length;s=0&&(n=n.slice(0,r)),!n||n==="start"})}function su(e,n,r){var i,o,a=au(n)?zn:Ct;return function(){var s=a(this,e),u=s.on;u!==i&&(o=(i=u).copy()).on(n,r),s.on=o}}function uu(e,n){var r=this._id;return arguments.length<2?vt(this.node(),r).on.on(e):this.each(su(r,e,n))}function lu(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function cu(){return this.on("end.remove",lu(this._id))}function fu(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Tn(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s()=>e;function Du(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Et(e,n,r){this.k=e,this.x=n,this.y=r}Et.prototype={constructor:Et,scale:function(e){return e===1?this:new Et(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Et(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Rn=new Et(1,0,0);mt.prototype=Et.prototype;function mt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Rn;return e.__zoom}function Je(e){e.stopImmediatePropagation()}function Jt(e){e.preventDefault(),e.stopImmediatePropagation()}function Iu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $u(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ur(){return this.__zoom||Rn}function Lu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Fu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Uu(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function Hu(){var e=Iu,n=$u,r=Uu,i=Lu,o=Fu,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,c=Co,l=ve("start","zoom","end"),f,h,d,p=500,y=150,x=0,m=10;function g(S){S.property("__zoom",ur).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",P).filter(o).on("touchstart.zoom",N).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(S,j,E,C){var O=S.selection?S.selection():S;O.property("__zoom",ur),S!==O?v(S,j,E,C):O.interrupt().each(function(){A(this,arguments).event(C).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(S,j,E,C){g.scaleTo(S,function(){var O=this.__zoom.k,I=typeof j=="function"?j.apply(this,arguments):j;return O*I},E,C)},g.scaleTo=function(S,j,E,C){g.transform(S,function(){var O=n.apply(this,arguments),I=this.__zoom,L=E==null?_(O):typeof E=="function"?E.apply(this,arguments):E,H=I.invert(L),F=typeof j=="function"?j.apply(this,arguments):j;return r(w(k(I,F),L,H),O,s)},E,C)},g.translateBy=function(S,j,E,C){g.transform(S,function(){return r(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof E=="function"?E.apply(this,arguments):E),n.apply(this,arguments),s)},null,C)},g.translateTo=function(S,j,E,C,O){g.transform(S,function(){var I=n.apply(this,arguments),L=this.__zoom,H=C==null?_(I):typeof C=="function"?C.apply(this,arguments):C;return r(Rn.translate(H[0],H[1]).scale(L.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof E=="function"?-E.apply(this,arguments):-E),I,s)},C,O)};function k(S,j){return j=Math.max(a[0],Math.min(a[1],j)),j===S.k?S:new Et(j,S.x,S.y)}function w(S,j,E){var C=j[0]-E[0]*S.k,O=j[1]-E[1]*S.k;return C===S.x&&O===S.y?S:new Et(S.k,C,O)}function _(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function v(S,j,E,C){S.on("start.zoom",function(){A(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(C).end()}).tween("zoom",function(){var O=this,I=arguments,L=A(O,I).event(C),H=n.apply(O,I),F=E==null?_(H):typeof E=="function"?E.apply(O,I):E,G=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),V=O.__zoom,X=typeof j=="function"?j.apply(O,I):j,tt=c(V.invert(F).concat(G/V.k),X.invert(F).concat(G/X.k));return function(Z){if(Z===1)Z=X;else{var st=tt(Z),et=G/st[2];Z=new Et(et,F[0]-st[0]*et,F[1]-st[1]*et)}L.zoom(null,Z)}})}function A(S,j,E){return!E&&S.__zooming||new M(S,j)}function M(S,j){this.that=S,this.args=j,this.active=0,this.sourceEvent=null,this.extent=n.apply(S,j),this.taps=0}M.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,j){return this.mouse&&S!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var j=pt(this.that).datum();l.call(S,this.that,new Du(S,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:l}),j)}};function T(S,...j){if(!e.apply(this,arguments))return;var E=A(this,j).event(S),C=this.__zoom,O=Math.max(a[0],Math.min(a[1],C.k*Math.pow(2,i.apply(this,arguments)))),I=xt(S);if(E.wheel)(E.mouse[0][0]!==I[0]||E.mouse[0][1]!==I[1])&&(E.mouse[1]=C.invert(E.mouse[0]=I)),clearTimeout(E.wheel);else{if(C.k===O)return;E.mouse=[I,C.invert(I)],Pe(this),E.start()}Jt(S),E.wheel=setTimeout(L,y),E.zoom("mouse",r(w(k(C,O),E.mouse[0],E.mouse[1]),E.extent,s));function L(){E.wheel=null,E.end()}}function R(S,...j){if(d||!e.apply(this,arguments))return;var E=S.currentTarget,C=A(this,j,!0).event(S),O=pt(S.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",G,!0),I=xt(S,E),L=S.clientX,H=S.clientY;ci(S.view),Je(S),C.mouse=[I,this.__zoom.invert(I)],Pe(this),C.start();function F(V){if(Jt(V),!C.moved){var X=V.clientX-L,tt=V.clientY-H;C.moved=X*X+tt*tt>x}C.event(V).zoom("mouse",r(w(C.that.__zoom,C.mouse[0]=xt(V,E),C.mouse[1]),C.extent,s))}function G(V){O.on("mousemove.zoom mouseup.zoom",null),fi(V.view,C.moved),Jt(V),C.event(V).end()}}function P(S,...j){if(e.apply(this,arguments)){var E=this.__zoom,C=xt(S.changedTouches?S.changedTouches[0]:S,this),O=E.invert(C),I=E.k*(S.shiftKey?.5:2),L=r(w(k(E,I),C,O),n.apply(this,j),s);Jt(S),u>0?pt(this).transition().duration(u).call(v,L,C,S):pt(this).call(g.transform,L,C,S)}}function N(S,...j){if(e.apply(this,arguments)){var E=S.touches,C=E.length,O=A(this,j,S.changedTouches.length===C).event(S),I,L,H,F;for(Je(S),L=0;L=n||M<0||h&&T>=a}function g(){var A=tn();if(m(A))return k(A);u=setTimeout(g,x(A))}function k(A){return u=void 0,d&&i?p(A):(i=o=void 0,s)}function w(){u!==void 0&&clearTimeout(u),l=0,i=c=o=u=void 0}function _(){return u===void 0?s:k(tn())}function v(){var A=tn(),M=m(A);if(i=arguments,o=this,c=A,M){if(u===void 0)return y(c);if(h)return clearTimeout(u),u=setTimeout(g,n),p(c)}return u===void 0&&(u=setTimeout(g,n)),s}return v.cancel=w,v.flush=_,v}var pl="Expected a function";function gl(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(pl);return Ie(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),xi(e,n,{leading:i,maxWait:n,trailing:o})}var Ut=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ut.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Ut.Bounce.In(e*2)*.5:Ut.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),ue=function(){return performance.now()},bi=(function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,r){n===void 0&&(n=ue()),r===void 0&&(r=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?a(e[r],e[r-1],r-i):a(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},wi=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),mn=new bi,hr=(function(){function e(n,r){r===void 0&&(r=mn),this._object=n,this._group=r,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ut.Linear.None,this._interpolationFunction=vn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=wi.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=ue()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var a in this._valuesEnd)o[a]=this._valuesEnd[a];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,a){for(var s in i){var u=n[s],c=Array.isArray(u),l=c?"array":typeof u,f=!c&&Array.isArray(i[s]);if(!(l==="undefined"||l==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var d=[u],p=0,y=h.length;p"u"||a)&&(r[s]=u),c||(r[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=ue()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=ue()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;ns)return!1;r&&this.start(n,!0)}if(this._goToEnd=!1,nl)return 1;var m=Math.trunc(u/c),g=u-m*c,k=Math.min(g/i._duration,1);return k===0&&u===i._duration?1:k},h=f(),d=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||u>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((u-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var y=0,x=this._chainedTweens.length;ye.length)&&(n=e.length);for(var r=0,i=Array(n);r=0,a=!r&&o&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return a?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(Rl,arguments)},brighten:function(){return this._applyModification(jl,arguments)},darken:function(){return this._applyModification(Dl,arguments)},desaturate:function(){return this._applyModification(El,arguments)},saturate:function(){return this._applyModification(zl,arguments)},greyscale:function(){return this._applyModification(Nl,arguments)},spin:function(){return this._applyModification(Il,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Fl,arguments)},complement:function(){return this._applyCombination($l,arguments)},monochromatic:function(){return this._applyCombination(Ul,arguments)},splitcomplement:function(){return this._applyCombination(Ll,arguments)},triad:function(){return this._applyCombination(vr,[3])},tetrad:function(){return this._applyCombination(vr,[4])}};q.fromRatio=function(e,n){if($e(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=le(e[i]));e=r}return q(e,n)};function Sl(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,a=null,s=!1,u=!1;return typeof e=="string"&&(e=Vl(e)),$e(e)=="object"&&(Mt(e.r)&&Mt(e.g)&&Mt(e.b)?(n=Ml(e.r,e.g,e.b),s=!0,u=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Mt(e.h)&&Mt(e.s)&&Mt(e.v)?(i=le(e.s),o=le(e.v),n=Pl(e.h,i,o),s=!0,u="hsv"):Mt(e.h)&&Mt(e.s)&&Mt(e.l)&&(i=le(e.s),a=le(e.l),n=Tl(e.h,i,a),s=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=ki(r),{ok:s,format:e.format||u,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Ml(e,n,r){return{r:Q(e,255)*255,g:Q(n,255)*255,b:Q(r,255)*255}}function pr(e,n,r){e=Q(e,255),n=Q(n,255),r=Q(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=(i+o)/2;if(i==o)a=s=0;else{var c=i-o;switch(s=u>.5?c/(2-i-o):c/(i+o),i){case e:a=(n-r)/c+(n1&&(h-=1),h<1/6?l+(f-l)*6*h:h<1/2?f:h<2/3?l+(f-l)*(2/3-h)*6:l}if(n===0)i=o=a=r;else{var u=r<.5?r*(1+n):r+n-r*n,c=2*r-u;i=s(c,u,e+1/3),o=s(c,u,e),a=s(c,u,e-1/3)}return{r:i*255,g:o*255,b:a*255}}function gr(e,n,r){e=Q(e,255),n=Q(n,255),r=Q(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=i,c=i-o;if(s=i===0?0:c/i,i==o)a=0;else{switch(i){case e:a=(n-r)/c+(n>1)+720)%360;--n;)i.h=(i.h+o)%360,a.push(q(i));return a}function Ul(e,n){n=n||6;for(var r=q(e).toHsv(),i=r.h,o=r.s,a=r.v,s=[],u=1/n;n--;)s.push(q({h:i,s:o,v:a})),a=(a+u)%1;return s}q.mix=function(e,n,r){r=r===0?0:r||50;var i=q(e).toRgb(),o=q(n).toRgb(),a=r/100,s={r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a};return q(s)};q.readability=function(e,n){var r=q(e),i=q(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};q.isReadable=function(e,n,r){var i=q.readability(e,n),o,a;switch(a=!1,o=Bl(r),o.level+o.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7;break}return a};q.mostReadable=function(e,n,r){var i=null,o=0,a,s,u,c;r=r||{},s=r.includeFallbackColors,u=r.level,c=r.size;for(var l=0;lo&&(o=a,i=q(n[l]));return q.isReadable(e,i,{level:u,size:c})||!s?i:(r.includeFallbackColors=!1,q.mostReadable(e,["#fff","#000"],r))};var xn=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Hl=q.hexNames=ql(xn);function ql(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function ki(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Q(e,n){Wl(e)&&(e="100%");var r=Gl(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function Be(e){return Math.min(1,Math.max(0,e))}function ct(e){return parseInt(e,16)}function Wl(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Gl(e){return typeof e=="string"&&e.indexOf("%")!=-1}function _t(e){return e.length==1?"0"+e:""+e}function le(e){return e<=1&&(e=e*100+"%"),e}function Ci(e){return Math.round(parseFloat(e)*255).toString(16)}function mr(e){return ct(e)/255}var yt=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Mt(e){return!!yt.CSS_UNIT.exec(e)}function Vl(e){e=e.replace(Cl,"").replace(Al,"").toLowerCase();var n=!1;if(xn[e])e=xn[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=yt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=yt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=yt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=yt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=yt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=yt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=yt.hex8.exec(e))?{r:ct(r[1]),g:ct(r[2]),b:ct(r[3]),a:mr(r[4]),format:n?"name":"hex8"}:(r=yt.hex6.exec(e))?{r:ct(r[1]),g:ct(r[2]),b:ct(r[3]),format:n?"name":"hex"}:(r=yt.hex4.exec(e))?{r:ct(r[1]+""+r[1]),g:ct(r[2]+""+r[2]),b:ct(r[3]+""+r[3]),a:mr(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=yt.hex3.exec(e))?{r:ct(r[1]+""+r[1]),g:ct(r[2]+""+r[2]),b:ct(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function Bl(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function bn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);ri.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelsView-vX0ckGpG.js","assets/code-xml-DlqRSqmr.js","assets/rotate-ccw-BtnOKhJQ.js","assets/zap-iWjc7Axa.js","assets/chevron-down-MK8qZkE9.js","assets/layers-CjyCNjIs.js","assets/ConnectView-nzWBlbXD.js","assets/folder-open-CbSQGCoL.js","assets/GuideView-D3weMCzU.js","assets/AuftragsbuchView-C2dG-lAH.js","assets/SectionLabel-SQgndpwc.js","assets/IdeenView-BpB3-RwB.js","assets/ChronikView-BB9XGeGn.js","assets/WissenView-DgtrXx57.js"])))=>i.map(i=>d[i]); var KI=Object.defineProperty;var b1=e=>{throw TypeError(e)};var VI=(e,t,r)=>t in e?KI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xs=(e,t,r)=>VI(e,typeof t!="symbol"?t+"":t,r),mm=(e,t,r)=>t.has(e)||b1("Cannot "+r);var $=(e,t,r)=>(mm(e,t,"read from private field"),r?r.call(e):t.get(e)),Ce=(e,t,r)=>t.has(e)?b1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),pe=(e,t,r,n)=>(mm(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Le=(e,t,r)=>(mm(e,t,"access private method"),r);var Hc=(e,t,r,n)=>({set _(i){pe(e,t,i,r)},get _(){return $(e,t,n)}});function qI(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function Ty(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vm={exports:{}},bs={},ym={exports:{}},$e={};/** * @license React * react.production.min.js @@ -432,4 +432,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bY(e,t){if(e){if(typeof e=="string")return lP(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?lP(e,t):void 0}}function lP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var s=n.getBoundingClientRect(),u=s.width/n.offsetWidth;Fe(u)&&u!==o&&e(qL(u))}},[n,e,o]),i}function sP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function EY(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(RW(),null);function Sf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var MY=g.forwardRef((e,t)=>{var r,n,i=g.useRef(null),o=g.useState({containerWidth:Sf((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Sf((n=e.style)===null||n===void 0?void 0:n.height)}),s=wf(o,2),u=s[0],d=s[1],f=g.useCallback((m,v)=>{d(x=>{var k=Math.round(m),S=Math.round(v);return x.containerWidth===k&&x.containerHeight===S?x:{containerWidth:k,containerHeight:S}})},[]),h=g.useCallback(m=>{if(typeof t=="function"&&t(m),i.current!=null&&(i.current.disconnect(),i.current=null),m!=null&&typeof ResizeObserver<"u"){var v=m.getBoundingClientRect(),x=v.width,k=v.height;f(x,k);var S=P=>{var O=P[0];if(O!=null){var j=O.contentRect,_=j.width,N=j.height;f(_,N)}},E=new ResizeObserver(S);E.observe(m),i.current=E}},[t,f]);return g.useEffect(()=>()=>{var m=i.current;m!=null&&m.disconnect()},[f]),g.createElement(g.Fragment,null,g.createElement(ku,{width:u.containerWidth,height:u.containerHeight}),g.createElement("div",Zi({ref:h},e)))}),TY=g.forwardRef((e,t)=>{var r=e.width,n=e.height,i=g.useState({containerWidth:Sf(r),containerHeight:Sf(n)}),o=wf(i,2),s=o[0],u=o[1],d=g.useCallback((h,m)=>{u(v=>{var x=Math.round(h),k=Math.round(m);return v.containerWidth===x&&v.containerHeight===k?v:{containerWidth:x,containerHeight:k}})},[]),f=g.useCallback(h=>{if(typeof t=="function"&&t(h),h!=null){var m=h.getBoundingClientRect(),v=m.width,x=m.height;d(v,x)}},[t,d]);return g.createElement(g.Fragment,null,g.createElement(ku,{width:s.containerWidth,height:s.containerHeight}),g.createElement("div",Zi({ref:f},e)))}),DY=g.forwardRef((e,t)=>{var r=e.width,n=e.height;return g.createElement(g.Fragment,null,g.createElement(ku,{width:r,height:n}),g.createElement("div",Zi({ref:t},e)))}),RY=g.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?g.createElement(TY,Zi({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?g.createElement(DY,Zi({},e,{width:r,height:n,ref:t})):g.createElement(g.Fragment,null,g.createElement(ku,{width:r,height:n}),g.createElement("div",Zi({ref:t},e)))});function $Y(e){return e?MY:RY}var LY=g.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,o=e.onClick,s=e.onContextMenu,u=e.onDoubleClick,d=e.onMouseDown,f=e.onMouseEnter,h=e.onMouseLeave,m=e.onMouseMove,v=e.onMouseUp,x=e.onTouchEnd,k=e.onTouchMove,S=e.onTouchStart,E=e.style,P=e.width,O=e.responsive,j=e.dispatchTouchEvents,_=j===void 0?!0:j,N=g.useRef(null),C=xt(),D=g.useState(null),F=wf(D,2),z=F[0],q=F[1],X=g.useState(null),B=wf(X,2),ue=B[0],Y=B[1],le=kY(),fe=dg(),de=(fe==null?void 0:fe.width)>0?fe.width:P,K=(fe==null?void 0:fe.height)>0?fe.height:i,ie=g.useCallback(Ee=>{le(Ee),typeof t=="function"&&t(Ee),q(Ee),Y(Ee),Ee!=null&&(N.current=Ee)},[le,t,q,Y]),Q=g.useCallback(Ee=>{C(Nj(Ee)),C(Rr({handler:o,reactEvent:Ee}))},[C,o]),R=g.useCallback(Ee=>{C(jy(Ee)),C(Rr({handler:f,reactEvent:Ee}))},[C,f]),M=g.useCallback(Ee=>{C(g_()),C(Rr({handler:h,reactEvent:Ee}))},[C,h]),J=g.useCallback(Ee=>{C(jy(Ee)),C(Rr({handler:m,reactEvent:Ee}))},[C,m]),se=g.useCallback(()=>{C($j())},[C]),te=g.useCallback(()=>{C(Lj())},[C]),ce=g.useCallback(Ee=>{C(Rj(Ee.key))},[C]),ye=g.useCallback(Ee=>{C(Rr({handler:s,reactEvent:Ee}))},[C,s]),_e=g.useCallback(Ee=>{C(Rr({handler:u,reactEvent:Ee}))},[C,u]),Z=g.useCallback(Ee=>{C(Rr({handler:d,reactEvent:Ee}))},[C,d]),we=g.useCallback(Ee=>{C(Rr({handler:v,reactEvent:Ee}))},[C,v]),Pe=g.useCallback(Ee=>{C(Rr({handler:S,reactEvent:Ee}))},[C,S]),ne=g.useCallback(Ee=>{_&&C(Bj(Ee)),C(Rr({handler:k,reactEvent:Ee}))},[C,_,k]),lt=g.useCallback(Ee=>{C(Rr({handler:x,reactEvent:Ee}))},[C,x]),Re=$Y(O);return g.createElement(F_.Provider,{value:z},g.createElement(Z3.Provider,{value:ue},g.createElement(Re,{width:de??(E==null?void 0:E.width),height:K??(E==null?void 0:E.height),className:Qe("recharts-wrapper",n),style:EY({position:"relative",cursor:"default",width:de,height:K},E),onClick:Q,onContextMenu:ye,onDoubleClick:_e,onFocus:se,onBlur:te,onKeyDown:ce,onMouseDown:Z,onMouseEnter:R,onMouseLeave:M,onMouseMove:J,onMouseUp:we,onTouchEnd:lt,onTouchMove:ne,onTouchStart:Pe,ref:ie},g.createElement(IY,null),r)))}),zY=["width","height","responsive","children","className","style","compact","title","desc"];function FY(e,t){if(e==null)return{};var r,n,i=BY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,o=e.children,s=e.className,u=e.style,d=e.compact,f=e.title,h=e.desc,m=FY(e,zY),v=on(m);return d?g.createElement(g.Fragment,null,g.createElement(ku,{width:r,height:n}),g.createElement(oP,{otherAttributes:v,title:f,desc:h},o)):g.createElement(LY,{className:s,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},g.createElement(oP,{otherAttributes:v,title:f,desc:h,ref:t},g.createElement(UV,null,o)))});function Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;tg.createElement(YY,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:QY,tooltipPayloadSearcher:bW,categoricalChartProps:e,ref:t}));const ZY="rgba(130,130,150,0.14)",dv="rgba(130,130,150,0.85)";function JY(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function Kj(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function eQ({active:e,payload:t,unit:r,label:n}){return!e||!(t!=null&&t.length)?null:w.jsxs("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:[Number.isFinite(n)&&w.jsx("div",{className:"mb-1 border-b border-border/40 pb-1 font-mono text-[10px] text-muted-foreground/80",children:new Date(n).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),w.jsx("div",{className:"space-y-1",children:t.map(i=>w.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[w.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:i.color}}),w.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:i.name}),w.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:Kj(i.value,r)})]},i.dataKey))})]})}function Vj({data:e,series:t,unit:r="%",yMode:n="percent",height:i=176,showTime:o=!1}){var h,m;const s=e.reduce((v,x)=>t.reduce((k,S)=>Math.max(k,Number(x[S.key])||0),v),0),u=n==="percent"?Math.min(100,Math.max(25,Math.ceil(s*1.2/25)*25)):Math.max(JY(s*1.15),10),d=e.length>1?Number((h=e[e.length-1])==null?void 0:h.t)-Number((m=e[0])==null?void 0:m.t):0,f=v=>new Date(v).toLocaleTimeString("de-DE",d<=10*6e4?{hour:"2-digit",minute:"2-digit",second:"2-digit"}:{hour:"2-digit",minute:"2-digit"});return w.jsx("div",{style:{height:i},className:"w-full",children:w.jsx(H4,{width:"100%",height:"100%",children:w.jsxs(XY,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[w.jsx("defs",{children:t.map(v=>w.jsxs("linearGradient",{id:`grad-${v.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[w.jsx("stop",{offset:"0%",stopColor:v.color,stopOpacity:.22}),w.jsx("stop",{offset:"100%",stopColor:v.color,stopOpacity:0})]},v.key))}),w.jsx(yj,{vertical:!1,stroke:ZY}),o?w.jsx(Oy,{dataKey:"t",type:"number",domain:["dataMin","dataMax"],tickFormatter:f,tickCount:5,minTickGap:40,interval:"preserveStartEnd",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:dv},height:18}):w.jsx(Oy,{dataKey:"t",hide:!0}),w.jsx(jj,{domain:[0,u],ticks:[0,u/2,u],tickFormatter:v=>Kj(v,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:dv}}),w.jsx(YW,{content:w.jsx(eQ,{unit:r}),cursor:{stroke:dv,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(v=>w.jsx(Cj,{type:"monotone",dataKey:v.key,name:v.label,stroke:v.color,strokeWidth:2,fill:`url(#grad-${v.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},v.key))]})})})}const qj={"1h":60,"24h":1440},dP={live:"Live","1h":"1 h","24h":"24 h"};function Gj({value:e,onChange:t}){return w.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:Object.keys(dP).map(r=>w.jsx("button",{onClick:()=>t(r),className:De("rounded-md px-2 py-0.5 text-[9px] font-bold uppercase tracking-wide transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:dP[r]},r))})}const tQ=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function rQ(){var h,m,v,x;const{sys:e,hist:t}=B3(),[r,n]=g.useState("live"),i=NA(r==="live"?60:qj[r],r!=="live"),o=g.useMemo(()=>{var k;return r==="live"?t:(((k=i.data)==null?void 0:k.points)??[]).map(S=>({t:S.t*1e3,cpu:S.cpu,ram:S.ram,gpu:S.gpu,disk:S.disk}))},[r,t,i.data]),s=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),u=tQ.filter(k=>k.key!=="gpu"||s),d={cpu:(h=e==null?void 0:e.cpu)==null?void 0:h.percent,ram:(m=e==null?void 0:e.ram)==null?void 0:m.percent,gpu:s?e.gpu.busy_percent:null,disk:(v=e==null?void 0:e.disk)==null?void 0:v.percent},f={cpu:(x=e==null?void 0:e.cpu)!=null&&x.cores?`${e.cpu.cores} Cores`:"",ram:e?`${No(e.ram.used)}/${No(e.ram.total)} GB`:"",gpu:s?`${No(e.gpu.gtt_used)}/${No(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${No(e.disk.used)}/${No(e.disk.total)} GB`:""};return w.jsxs("div",{className:"flex flex-col justify-between mc-card p-5",children:[w.jsxs("div",{children:[w.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[w.jsx(FP,{className:"h-4.5 w-4.5 text-primary"}),w.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),r==="live"&&w.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[w.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]}),w.jsx("div",{className:"ml-auto",children:w.jsx(Gj,{value:r,onChange:n})})]}),e?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:u.map(k=>w.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[w.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:k.color}}),w.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:k.label}),w.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(d[k.key]??0),"%"]}),f[k.key]&&w.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:f[k.key]})]},k.key))}),r!=="live"&&o.length===0&&w.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:i.isLoading?"Verlauf wird geladen …":"Noch kein Verlauf — der Sammler baut die Historie gerade erst auf."}),(r==="live"||o.length>0)&&w.jsx(Vj,{data:o,series:u,unit:"%",yMode:"percent",height:176,showTime:!0})]}):w.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&w.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&w.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&w.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}const bl=[{key:"stt_ms",label:"STT",color:"#f59e0b"},{key:"vision_ms",label:"Sehen",color:"#a78bfa"},{key:"hirn_ms",label:"Hirn",color:"#2dd4bf"},{key:"gen_ms",label:"Antwort",color:"#60a5fa"}],_a=e=>e==null?"–":`${(e/1e3).toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})} s`;function nQ(e){const t=Math.max(0,Date.now()/1e3-e);return t<60?`vor ${Math.round(t)} s`:t<3600?`vor ${Math.round(t/60)} min`:`vor ${Math.round(t/3600)} h`}function Iy(e){return bl.reduce((t,r)=>t+(e[r.key]??0),0)}function iQ(e){let t=null;for(const r of bl){const n=e[r.key];n!=null&&(t==null||n>t.ms)&&(t={label:r.label,color:r.color,ms:n})}return t}function aQ({t:e,scale:t}){const r=bl.map(n=>`${n.label} ${_a(e[n.key])}`).join(" · ")+(e.mem0_ms!=null?` (davon Mem0 ${_a(e.mem0_ms)})`:"");return w.jsxs("div",{className:"flex items-center gap-2.5",children:[w.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[10px] text-muted-foreground/60",children:nQ(e.ts)}),w.jsxs("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-muted/25",title:r,children:[w.jsx("div",{className:"absolute inset-0 flex",children:bl.map(n=>{const i=e[n.key];return!i||i<=0?null:w.jsx("div",{style:{width:`${i/t*100}%`,background:n.color},className:"h-full first:rounded-l-sm"},n.key)})}),e.error&&w.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-rose-500/15 text-[10px] font-semibold text-rose-300",children:"Fehler"})]}),w.jsx("span",{className:"w-12 shrink-0 text-right font-mono text-[11px] font-semibold tabular-nums text-foreground",children:e.error?"–":_a(Iy(e))})]})}function oQ(){const{data:e}=b3(12),t=e??[],r=Math.max(1,...t.map(o=>Iy(o))),n=t[0],i=n?iQ(n):null;return w.jsxs("div",{className:"mc-card p-5",children:[w.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[w.jsxs("div",{children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx(aT,{className:"h-4.5 w-4.5 text-primary"}),w.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Latenz je Turn"}),w.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[w.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),n?w.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[w.jsx("span",{className:`font-space text-3xl font-bold tracking-tight tabular-nums ${n.error?"text-rose-400":"text-foreground"}`,children:n.error?"Fehler":_a(Iy(n))}),w.jsxs("span",{className:"text-xs text-muted-foreground",children:["letzter Turn",!n.error&&i&&w.jsxs(w.Fragment,{children:[" · Täter: ",w.jsx("span",{style:{color:i.color},className:"font-semibold",children:i.label})," ",_a(i.ms)]})]})]}):w.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Noch kein Voice-Turn aufgezeichnet."}),n&&!n.error&&w.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-muted-foreground/70",children:[bl.filter(o=>n[o.key]!=null).map(o=>`${o.label} ${_a(n[o.key])}`).join(" · "),n.mem0_ms!=null&&w.jsxs("span",{className:"text-muted-foreground/50",children:[" · davon Mem0 ",_a(n.mem0_ms)]})]})]}),w.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1 pt-1",children:bl.map(o=>w.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:o.color}}),w.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o.label})]},o.key))})]}),t.length>0?w.jsx("div",{className:"space-y-1.5",children:t.map(o=>w.jsx(aQ,{t:o,scale:r},o.id))}):w.jsx("div",{className:"flex h-[120px] items-center justify-center px-6 text-center text-xs text-muted-foreground",children:"Sprich einmal mit Lucy — dann erscheint hier der Zeit-Wasserfall pro Turn, damit man den einen Hänger sofort sieht."}),w.jsx("div",{className:"mt-3 border-t border-border/30 pt-2 text-[10px] leading-relaxed text-muted-foreground/70",children:'„Hirn" = Zeit bis zum ersten Wort (Agent + Mem0-Suche + Modell); Tool-Runden stecken in „Antwort". Reine Telegram-Turns laufen an MC2 vorbei und erscheinen hier nicht.'})]})}const fP=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function lQ(){const{data:e}=MA(),t=R3(),[r,n]=g.useState("live"),i=NA(r==="live"?60:qj[r],r!=="live"),o=g.useMemo(()=>{var h;if(r==="live")return t;const d=((h=i.data)==null?void 0:h.points)??[],f=[];for(let m=1;mw.jsxs("div",{className:"flex items-center gap-1.5",children:[w.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:d.color}}),w.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:d.label}),w.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((s==null?void 0:s[d.key])??0)})]},d.key))})]})]}),r!=="live"&&o.length===0?w.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:i.isLoading?"Verlauf wird geladen …":"Noch kein Verlauf — der Sammler baut die Historie gerade erst auf."}):e?w.jsx(Vj,{data:o,series:fP,unit:" tok/s",yMode:"auto",height:150,showTime:!0}):w.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),w.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}const kf=e=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:e}}));function sQ({onNavigate:e}){var Y,le,fe,de;const{data:t}=IA(),{data:r}=Qy(),{data:n}=TA(),{data:i}=S3(),{data:o}=k3(),{data:s}=y3(),{data:u}=g3(),d=L3(),{showAlert:f,dialogElement:h}=_A(),m=Pf(),[v,x]=g.useState({});async function k(K,ie){x(Q=>({...Q,[K]:!0}));try{if(ie.kind==="loadModel")await Te(`/api/models/${encodeURIComponent(ie.model)}/load`,{method:"POST"});else{const Q=await Te("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:ie.service})});Q.ok||f("Reparatur nicht ganz geklappt",(Q.err||"Unbekannter Fehler")+(ie.needsSudo?` -Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}m.invalidateQueries({queryKey:ze.health}),m.invalidateQueries({queryKey:ze.services}),m.invalidateQueries({queryKey:ze.models})}catch(Q){f("Reparatur fehlgeschlagen",String((Q==null?void 0:Q.message)||Q))}finally{x(Q=>({...Q,[K]:!1}))}}const S=((Y=t==null?void 0:t.running)==null?void 0:Y.length)??0,E=(r==null?void 0:r.services.filter(K=>K.ok).length)??0,P=(r==null?void 0:r.services.length)??0,O=P-E,j=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((le=n==null?void 0:n.components)==null?void 0:le.filter(K=>K.update===!0).length)??0),_=s!=null&&s.available?s.open_count:0,N=u!=null&&u.available?u.items.filter(K=>K.status==="blocked").length:0,C=o?[o.gateway,o.memory,o.desktop_gateway]:[],D=C.filter(K=>K==null?void 0:K.ok).length,F=o?o.gateway.ok?o.memory.ok?o.desktop_gateway.ok?"":"Desktop-Gateway":"Gedächtnis-Leitung":"Modell-Leitung":"",z=(fe=t==null?void 0:t.models)==null?void 0:fe.find(K=>K.role==="hermes"),q=z!=null&&z.name?(de=z.name.split("/").pop())==null?void 0:de.replace(/\.gguf$/i,""):"",X=r==null?void 0:r.services.filter(K=>!K.ok).map(K=>K.name).join(", "),B=n?[n.os>0&&"OS",n.engine>0&&"Engine",n.swap>0&&"Swap",n.models>0&&"Modelle"].filter(Boolean):[],ue=B.length>0?B.join(" + "):"";return w.jsxs("div",{className:"space-y-6",children:[w.jsxs("div",{children:[w.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),w.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),w.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 items-start",children:[w.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[w.jsx(uQ,{verdict:d.verdict,memory:d.memory,warns:d.warns,problems:d.problems}),w.jsxs("section",{children:[w.jsx(fv,{children:"Leistung"}),w.jsx("div",{className:"grid gap-4 md:grid-cols-1",children:w.jsx(rQ,{})}),w.jsx("div",{className:"mt-4",children:w.jsx(oQ,{})}),w.jsx("div",{className:"mt-4",children:w.jsx(lQ,{})})]}),w.jsxs("section",{children:[w.jsx(fv,{children:"Bereiche"}),w.jsxs("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-3",children:[w.jsx(As,{icon:Fy,title:"Auftragsbuch",value:s!=null&&s.available?_:"—",unit:_===1?"Vorschlag":"Vorschläge",tone:s?N>0||_>0?"warn":"ok":"loading",hint:N>0?`${N} Karte${N===1?"":"n"} wartet auf deine Antwort`:_>0?`${_} offene Patches`:"Keine ausstehenden Vorschläge",onClick:()=>e("auftraege")}),w.jsx(As,{icon:LP,title:"Modelle",value:S,unit:"warm",tone:S>0?"ok":"muted",hint:q?`Hirn: ${q}`:"Kein Hermes-Modell geladen",onClick:()=>e("models")}),w.jsx(As,{icon:Of,title:"Dienste",value:r?`${E}/${P}`:"…",unit:"laufen",tone:r?O>0?"warn":"ok":"loading",hint:X?`Ausfall: ${X}`:"Alle Dienste online",onClick:()=>kf("maintenance")}),w.jsx(As,{icon:Wy,title:"Updates",value:n?j>0?j:"0":"…",unit:j>0?"bereit":"aktuell",tone:n?j>0?"warn":"ok":"loading",hint:j>0?`Verfügbar: ${ue}`:"Alles auf dem neuesten Stand",onClick:()=>kf("maintenance")}),w.jsx(As,{icon:Uy,title:"Verbinden",value:o?`${D}/${C.length}`:"…",unit:"Leitungen",tone:o?D===C.length?"ok":"warn":"loading",hint:F?`Gestört: ${F}`:"Hermes Desktop & IDEs bereit",onClick:()=>e("connect")})]})]})]}),w.jsxs("div",{className:"space-y-6",children:[w.jsx(cQ,{problems:d.problems,pendingCount:j,openAuftraege:_,blockedIdeen:N,busy:v,onRepair:k,onNavigate:e}),w.jsxs("section",{children:[w.jsx(fv,{children:"Werkzeuge & Diagnose"}),w.jsx(dQ,{agent:i,svcErrors:O,onNavigate:e})]})]})]}),h]})}function fv({children:e}){return w.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function uQ({verdict:e,memory:t,warns:r,problems:n}){const i=r.length?`${r[0].label}: ${r[0].detail}${r.length>1?` (+${r.length-1} weitere)`:""}`:t.status==="full"?t.text:"Nichts Schlimmes — nur ein Hinweis.",o=n.length?`${n[0].label}: ${n[0].detail}${n.length>1?` (+${n.length-1} weitere)`:""}`:"Ein wichtiger Dienst hakt.",s={loading:{ring:"border-border/60 bg-card/45",icon:By,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:sT,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Gs,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:i},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Gs,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:o}}[e],u=s.icon,d={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],f={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return w.jsxs("div",{className:De("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between h-full",s.ring),children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:w.jsx(u,{className:De("h-6 w-6",s.iconCls)})}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:s.title}),w.jsx("p",{className:"text-xs text-muted-foreground",children:s.sub})]})]}),w.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[w.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[w.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[w.jsx(lT,{className:"h-3.5 w-3.5"})," Speicher"]}),w.jsx("span",{className:De("font-mono font-bold",d),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(1)} / ${t.totalGb.toFixed(1)} GB`})]}),w.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:w.jsx("div",{className:De("h-full rounded-full transition-all duration-500",f),style:{width:`${t.pct}%`}})})]})]})}function cQ({problems:e,pendingCount:t,openAuftraege:r,blockedIdeen:n,busy:i,onRepair:o,onNavigate:s}){const u=t>0,d=r>0,f=n>0,h=e.length===0&&!u&&!d&&!f;return w.jsx("div",{className:"h-full flex flex-col justify-between",children:h?w.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4 h-full",children:[w.jsx(XM,{className:"h-5 w-5 shrink-0 text-emerald-400"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):w.jsxs("div",{className:"space-y-2 h-full flex flex-col justify-center",children:[e.map(m=>w.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[w.jsxs("div",{className:"flex min-w-0 items-center gap-3 w-full",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:w.jsx(m.icon,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("p",{className:"text-sm font-bold text-foreground",children:m.label}),w.jsx("p",{className:"truncate text-xs text-muted-foreground",children:m.detail})]})]}),m.repair&&w.jsxs("button",{onClick:()=>m.repair&&o(m.id,m.repair),disabled:!!i[m.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60 w-full sm:w-auto justify-center",children:[i[m.id]?w.jsx(By,{className:"h-3.5 w-3.5 animate-spin"}):w.jsx(kT,{className:"h-3.5 w-3.5"}),m.repair.label]})]},m.id)),f&&w.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-red-500/30 bg-red-500/5 p-4 text-left transition-all hover:bg-red-500/10 cursor-pointer",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:w.jsx(zP,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{children:[w.jsxs("p",{className:"text-sm font-bold text-foreground",children:[n," Karte",n===1?"":"n"," braucht deine Antwort"]}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Die Box hängt an einer Frage und wartet auf dich."})]})]}),w.jsx(Bs,{className:"h-4 w-4 shrink-0 text-red-300/70"})]}),d&&w.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-primary/30 bg-primary/5 p-4 text-left transition-all hover:bg-primary/10 cursor-pointer",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/30 bg-background/30 text-primary",children:w.jsx(Fy,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{children:[w.jsxs("p",{className:"text-sm font-bold text-foreground",children:[r," Vorschl",r===1?"ag":"äge"," im Auftragsbuch"]}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Annehmen oder ablehnen."})]})]}),w.jsx(Bs,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),u&&w.jsxs("button",{onClick:()=>kf("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:w.jsx(Wy,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{children:[w.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden."})]})]}),w.jsx(Bs,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})})}function dQ({agent:e,svcErrors:t,onNavigate:r}){const n=[{label:"Hermes Agent",status:e?e.gateway_reachable?"Bereit":"Offline":"…",tone:e?e.gateway_reachable?"ok":"alert":"loading",action:()=>r("agent")},{label:"Konsole (Box-Shell)",status:e?e.box_console_reachable?"Bereit":"Offline":"…",tone:e?e.box_console_reachable?"ok":"warn":"loading",action:()=>r("konsole")},{label:"Systemlogs & Diagnose",status:t>0?`${t} Fehler`:"Keine Fehler",tone:t>0?"alert":"ok",action:()=>kf("logs")},{label:"Wissens-Vault",status:"Öffnen",tone:"muted",action:()=>r("wissen")},{label:"Chronik & Zeitmaschine",status:"Öffnen",tone:"muted",action:()=>r("chronik")}];return w.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/30 p-4 space-y-3 shadow-sm",children:w.jsx("div",{className:"divide-y divide-border/20",children:n.map((i,o)=>{const s={loading:"bg-muted-foreground/45 animate-pulse",ok:"bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.4)]",warn:"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.4)]",alert:"bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.4)]",muted:"bg-muted-foreground/30"}[i.tone];return w.jsxs("button",{onClick:i.action,className:"w-full py-2.5 px-1.5 flex items-center justify-between text-left hover:bg-card/45 rounded-lg transition-all group cursor-pointer text-xs",children:[w.jsx("span",{className:"text-muted-foreground group-hover:text-foreground transition-colors font-medium",children:i.label}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:De("text-[10px] font-semibold font-mono",i.tone==="ok"?"text-emerald-400":i.tone==="warn"?"text-amber-400":i.tone==="alert"?"text-red-400":"text-muted-foreground/60"),children:i.status}),w.jsx("span",{className:De("h-1.5 w-1.5 rounded-full",s)})]})]},o)})})})}const fQ=g.lazy(()=>ii(()=>import("./ModelsView-B2TpOTbs.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ModelsView}))),hQ=g.lazy(()=>ii(()=>import("./ConnectView-BMtGTagE.js"),__vite__mapDeps([6,4,7])).then(e=>({default:e.ConnectView}))),pQ=g.lazy(()=>ii(()=>import("./AgentView-C4FGklqQ.js"),[]).then(e=>({default:e.AgentView}))),mQ=g.lazy(()=>ii(()=>import("./KonsoleView-Liu9bAm4.js"),[]).then(e=>({default:e.KonsoleView}))),vQ=g.lazy(()=>ii(()=>import("./GuideView-CYIumbOa.js"),__vite__mapDeps([8,3,5])).then(e=>({default:e.GuideView}))),yQ=g.lazy(()=>ii(()=>import("./AuftragsbuchView-Czf9cRFv.js"),__vite__mapDeps([9,10,4])).then(e=>({default:e.AuftragsbuchView}))),gQ=g.lazy(()=>ii(()=>import("./IdeenView-COUe_TK2.js"),__vite__mapDeps([11,10,1,5,4,2])).then(e=>({default:e.IdeenView}))),xQ=g.lazy(()=>ii(()=>import("./ChronikView-Dk5QIymr.js"),__vite__mapDeps([12,2])).then(e=>({default:e.ChronikView}))),bQ=g.lazy(()=>ii(()=>import("./WissenView-0h5kZV64.js"),__vite__mapDeps([13,7])).then(e=>({default:e.WissenView})));function wQ(){return w.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:w.jsx(By,{className:"h-5 w-5 animate-spin","aria-label":"Lädt …"})})}const SQ=/Mac|iPhone|iPad/.test(navigator.platform);function kQ(){$3(),v3();const[e,t]=g.useState(()=>{const S=window.location.hash.slice(1);return Ko.some(E=>E.id===S)?S:"dashboard"}),r=g.useCallback(S=>{window.location.hash.slice(1)===S?t(S):window.location.hash=S},[]),[n,i]=g.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,s]=g.useState(!1),[u,d]=g.useState(!1),[f,h]=g.useState("maintenance"),{data:m,isError:v}=jA(),{data:x}=Df();g.useEffect(()=>{document.documentElement.classList.add("dark")},[]),g.useEffect(()=>{const S=E=>{var O;h(((O=E.detail)==null?void 0:O.tab)||"maintenance"),d(!0)};return window.addEventListener("open-system-drawer",S),()=>window.removeEventListener("open-system-drawer",S)},[]),g.useEffect(()=>{const S=E=>{var O;const P=(O=E.detail)==null?void 0:O.view;P&&r(P)};return window.addEventListener("mc-navigate",S),()=>window.removeEventListener("mc-navigate",S)},[r]),g.useEffect(()=>{const S=()=>{const E=window.location.hash.slice(1);Ko.some(P=>P.id===E)&&t(E)};return window.addEventListener("hashchange",S),()=>window.removeEventListener("hashchange",S)},[]),g.useEffect(()=>{s(!1)},[e]);const k=Ko.find(S=>S.id===e);return w.jsxs("div",{className:"flex h-full relative",children:[w.jsx("div",{className:"fixed inset-0 -z-50 pointer-events-none",style:{backgroundColor:"hsl(224,30%,6%)",backgroundImage:["radial-gradient(45% 40% at 12% 8%, hsl(172 72% 50% / 0.10), transparent 70%)","radial-gradient(50% 45% at 88% 92%, hsl(270 70% 60% / 0.10), transparent 70%)","radial-gradient(40% 35% at 75% 30%, hsl(239 70% 62% / 0.07), transparent 70%)"].join(", ")}}),w.jsx(NR,{onNavigate:r}),w.jsx(I3,{open:u,onClose:()=>d(!1),defaultTab:f}),w.jsx("aside",{className:De("hidden md:flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:w.jsx(hP,{collapsed:n,onToggleCollapse:()=>{i(S=>{const E=!S;return localStorage.setItem("mc_sidebar_collapsed",E.toString()),E})},view:e,health:m,backendDown:v,sysStatus:x})}),w.jsxs("div",{className:De("md:hidden fixed inset-0 z-50 transition-opacity duration-200",o?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":!o,children:[w.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>s(!1)}),w.jsx("aside",{className:De("absolute inset-y-0 left-0 flex w-72 max-w-[85vw] flex-col border-r border-border/40 bg-[hsl(224,28%,8%)] transition-transform duration-300 ease-in-out",o?"translate-x-0":"-translate-x-full"),children:w.jsx(hP,{collapsed:!1,onClose:()=>s(!1),view:e,health:m,backendDown:v,sysStatus:x})})]}),w.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between gap-3 border-b border-border/40 px-4 md:px-6 bg-card/20 backdrop-blur-sm",children:[w.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[w.jsx("button",{onClick:()=>s(!0),className:"md:hidden p-1.5 -ml-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation öffnen",children:w.jsx(pT,{className:"h-5 w-5","aria-hidden":"true"})}),w.jsx("div",{className:"truncate text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:k.hint})]}),w.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[w.jsx(h3,{}),w.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"hidden sm:flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),w.jsxs("button",{onClick:()=>{const S=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(S)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[w.jsx(rT,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"hidden sm:inline",children:"Suchen"}),w.jsx("kbd",{className:"hidden sm:inline rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:SQ?"⌘K":"Strg+K"})]})]})]}),w.jsx("main",{className:"flex-1 overflow-y-auto p-4 md:p-6 scrollbar-thin",children:w.jsxs(g.Suspense,{fallback:w.jsx(wQ,{}),children:[e==="dashboard"&&w.jsx(sQ,{onNavigate:S=>r(S)}),e==="ideen"&&w.jsx(gQ,{}),e==="auftraege"&&w.jsx(yQ,{}),e==="models"&&w.jsx(fQ,{}),e==="connect"&&w.jsx(hQ,{}),e==="wissen"&&w.jsx(bQ,{}),e==="chronik"&&w.jsx(xQ,{}),e==="agent"&&w.jsx(pQ,{}),e==="konsole"&&w.jsx(mQ,{}),e==="guide"&&w.jsx(vQ,{})]})})]})]})}function hP({collapsed:e,onToggleCollapse:t,onClose:r,view:n,health:i,backendDown:o,sysStatus:s}){var u,d,f,h,m;return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:De("flex items-center py-4 border-b border-border/40 shrink-0",e?"flex-col gap-3 px-2":"justify-between px-5"),children:[w.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[w.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!e&&w.jsxs("div",{className:"leading-tight",children:[w.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),w.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),t&&w.jsx("button",{onClick:t,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":e?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:e?"Maximieren":"Minimieren",children:e?w.jsx(Bs,{className:"h-4 w-4","aria-hidden":"true"}):w.jsx(ZM,{className:"h-4 w-4","aria-hidden":"true"})}),r&&w.jsx("button",{onClick:r,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation schließen",children:w.jsx(Cf,{className:"h-4 w-4","aria-hidden":"true"})})]}),w.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:(()=>{let v=null;return Ko.map(x=>{const k=x.group!==v;return v=x.group,w.jsxs("div",{className:"space-y-1",children:[k&&(e?v!==Ko[0].group&&w.jsx("div",{className:"my-3 border-t border-border/30"}):w.jsx("div",{className:"mt-5 mb-1.5 px-3 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/40 first:mt-0 select-none",children:x.group})),w.jsxs("a",{href:`#${x.id}`,onClick:r,"aria-current":n===x.id?"page":void 0,className:De("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",e?"justify-center p-2.5":"gap-3 px-3 py-2",n===x.id?e?"nav-active-collapsed":"nav-active":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:e?x.label:void 0,"aria-label":e?x.label:void 0,children:[w.jsx(x.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!e&&w.jsx("span",{className:"truncate",children:x.label})]})]},x.id)})})()}),w.jsx("div",{className:De("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",e?"px-2 text-center":"px-5"),children:e?w.jsx("div",{className:"flex justify-center",children:w.jsx("span",{className:De("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",o||!i?"bg-red-500":i.engine_reachable?i.brain&&!i.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500"),title:o?"Zentrale antwortet nicht — Anzeigen evtl. veraltet":i?i.engine_reachable?i.brain&&!i.brain.ready?`Hirn offline (${i.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):w.jsxs("div",{className:"space-y-2 text-left",children:[o?w.jsxs("span",{className:"flex items-center gap-2 text-red-400",children:[w.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),w.jsx("span",{className:"truncate",children:"Zentrale antwortet nicht"})]}):i?w.jsxs(w.Fragment,{children:[w.jsxs("span",{className:"flex items-center gap-2",children:[w.jsx("span",{className:De("h-2 w-2 rounded-full animate-pulse",i.engine_reachable?"bg-emerald-500":"bg-amber-500")}),w.jsxs("span",{className:"truncate",children:["Engine ",i.engine_reachable?"online":"offline"]})]}),i.brain&&!i.brain.ready&&w.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${i.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[w.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),w.jsxs("span",{className:"truncate",children:["Hirn offline",i.brain.model?` (${i.brain.model})`:""]})]})]}):w.jsxs("span",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",w.jsx("span",{className:"truncate",children:"Backend offline"})]}),(s==null?void 0:s.versions)&&w.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[w.jsxs("div",{className:"truncate",title:s.versions.mc2?`${s.versions.mc2.branch}-${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""} (${s.versions.mc2.date})`:"nicht gefunden",children:[w.jsx("strong",{children:"MC2:"})," ",s.versions.mc2?`${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""}`:"—"]}),w.jsxs("div",{className:"truncate",title:((u=s.versions.engine)==null?void 0:u.type)==="git"?`${s.versions.engine.branch}-${s.versions.engine.hash}${s.versions.engine.dirty?"*":""} (${s.versions.engine.date})`:((d=s.versions.engine)==null?void 0:d.version_text)||"unbekannt",children:[w.jsx("strong",{children:"Engine:"})," ",((f=s.versions.engine)==null?void 0:f.type)==="git"?`${s.versions.engine.hash}${s.versions.engine.dirty?"*":""}`:((m=(h=s.versions.engine)==null?void 0:h.version_text)==null?void 0:m.split(" ").pop())||"—"]}),w.jsxs("div",{className:"truncate",title:s.versions.hermes_agent?`${s.versions.hermes_agent.branch}-${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""} (${s.versions.hermes_agent.date})`:"nicht gefunden",children:[w.jsx("strong",{children:"Hermes Agent:"})," ",s.versions.hermes_agent?`${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]})}class EQ extends Dy.Component{constructor(){super(...arguments);xs(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?w.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:w.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[w.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),w.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),w.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const PQ=new CM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});rM.createRoot(document.getElementById("root")).render(w.jsx(Dy.StrictMode,{children:w.jsx(EQ,{children:w.jsx(_M,{client:PQ,children:w.jsx(kQ,{})})})}));export{Uy as $,TA as A,YM as B,XM as C,zQ as D,Ov as E,k3 as F,B1 as G,lT as H,Bs as I,JM as J,S3 as K,By as L,nT as M,OQ as N,Af as O,vT as P,VM as Q,Hy as R,yT as S,Gs as T,Ho as U,wT as V,kT as W,Cf as X,Es as Y,Of as Z,LP as _,w3 as a,hT as a0,aT as a1,bT as a2,y3 as a3,g3 as a4,eT as a5,WQ as a6,Fy as a7,jQ as a8,zP as a9,iT as aa,NQ as ab,uT as ac,Wy as ad,sT as ae,x3 as af,rf as ag,Dy as ah,su as ai,bk as aj,A8 as ak,Ng as al,dk as am,ck as an,Ty as ao,IQ as ap,MQ as aq,fT as ar,_A as b,je as c,BQ as d,De as e,Nm as f,Te as g,DQ as h,_Q as i,w as j,qM as k,IA as l,TQ as m,Df as n,RQ as o,FQ as p,ze as q,g as r,CQ as s,LQ as t,Pf as u,No as v,TR as w,FP as x,UQ as y,$Q as z}; +Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}m.invalidateQueries({queryKey:ze.health}),m.invalidateQueries({queryKey:ze.services}),m.invalidateQueries({queryKey:ze.models})}catch(Q){f("Reparatur fehlgeschlagen",String((Q==null?void 0:Q.message)||Q))}finally{x(Q=>({...Q,[K]:!1}))}}const S=((Y=t==null?void 0:t.running)==null?void 0:Y.length)??0,E=(r==null?void 0:r.services.filter(K=>K.ok).length)??0,P=(r==null?void 0:r.services.length)??0,O=P-E,j=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((le=n==null?void 0:n.components)==null?void 0:le.filter(K=>K.update===!0).length)??0),_=s!=null&&s.available?s.open_count:0,N=u!=null&&u.available?u.items.filter(K=>K.status==="blocked").length:0,C=o?[o.gateway,o.memory,o.desktop_gateway]:[],D=C.filter(K=>K==null?void 0:K.ok).length,F=o?o.gateway.ok?o.memory.ok?o.desktop_gateway.ok?"":"Desktop-Gateway":"Gedächtnis-Leitung":"Modell-Leitung":"",z=(fe=t==null?void 0:t.models)==null?void 0:fe.find(K=>K.role==="hermes"),q=z!=null&&z.name?(de=z.name.split("/").pop())==null?void 0:de.replace(/\.gguf$/i,""):"",X=r==null?void 0:r.services.filter(K=>!K.ok).map(K=>K.name).join(", "),B=n?[n.os>0&&"OS",n.engine>0&&"Engine",n.swap>0&&"Swap",n.models>0&&"Modelle"].filter(Boolean):[],ue=B.length>0?B.join(" + "):"";return w.jsxs("div",{className:"space-y-6",children:[w.jsxs("div",{children:[w.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),w.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),w.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 items-start",children:[w.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[w.jsx(uQ,{verdict:d.verdict,memory:d.memory,warns:d.warns,problems:d.problems}),w.jsxs("section",{children:[w.jsx(fv,{children:"Leistung"}),w.jsx("div",{className:"grid gap-4 md:grid-cols-1",children:w.jsx(rQ,{})}),w.jsx("div",{className:"mt-4",children:w.jsx(oQ,{})}),w.jsx("div",{className:"mt-4",children:w.jsx(lQ,{})})]}),w.jsxs("section",{children:[w.jsx(fv,{children:"Bereiche"}),w.jsxs("div",{className:"grid gap-4 grid-cols-2 md:grid-cols-3",children:[w.jsx(As,{icon:Fy,title:"Auftragsbuch",value:s!=null&&s.available?_:"—",unit:_===1?"Vorschlag":"Vorschläge",tone:s?N>0||_>0?"warn":"ok":"loading",hint:N>0?`${N} Karte${N===1?"":"n"} wartet auf deine Antwort`:_>0?`${_} offene Patches`:"Keine ausstehenden Vorschläge",onClick:()=>e("auftraege")}),w.jsx(As,{icon:LP,title:"Modelle",value:S,unit:"warm",tone:S>0?"ok":"muted",hint:q?`Hirn: ${q}`:"Kein Hermes-Modell geladen",onClick:()=>e("models")}),w.jsx(As,{icon:Of,title:"Dienste",value:r?`${E}/${P}`:"…",unit:"laufen",tone:r?O>0?"warn":"ok":"loading",hint:X?`Ausfall: ${X}`:"Alle Dienste online",onClick:()=>kf("maintenance")}),w.jsx(As,{icon:Wy,title:"Updates",value:n?j>0?j:"0":"…",unit:j>0?"bereit":"aktuell",tone:n?j>0?"warn":"ok":"loading",hint:j>0?`Verfügbar: ${ue}`:"Alles auf dem neuesten Stand",onClick:()=>kf("maintenance")}),w.jsx(As,{icon:Uy,title:"Verbinden",value:o?`${D}/${C.length}`:"…",unit:"Leitungen",tone:o?D===C.length?"ok":"warn":"loading",hint:F?`Gestört: ${F}`:"Hermes Desktop & IDEs bereit",onClick:()=>e("connect")})]})]})]}),w.jsxs("div",{className:"space-y-6",children:[w.jsx(cQ,{problems:d.problems,pendingCount:j,openAuftraege:_,blockedIdeen:N,busy:v,onRepair:k,onNavigate:e}),w.jsxs("section",{children:[w.jsx(fv,{children:"Werkzeuge & Diagnose"}),w.jsx(dQ,{agent:i,svcErrors:O,onNavigate:e})]})]})]}),h]})}function fv({children:e}){return w.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function uQ({verdict:e,memory:t,warns:r,problems:n}){const i=r.length?`${r[0].label}: ${r[0].detail}${r.length>1?` (+${r.length-1} weitere)`:""}`:t.status==="full"?t.text:"Nichts Schlimmes — nur ein Hinweis.",o=n.length?`${n[0].label}: ${n[0].detail}${n.length>1?` (+${n.length-1} weitere)`:""}`:"Ein wichtiger Dienst hakt.",s={loading:{ring:"border-border/60 bg-card/45",icon:By,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:sT,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:Gs,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:i},problem:{ring:"border-red-500/50 bg-red-500/5",icon:Gs,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:o}}[e],u=s.icon,d={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],f={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return w.jsxs("div",{className:De("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between h-full",s.ring),children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:w.jsx(u,{className:De("h-6 w-6",s.iconCls)})}),w.jsxs("div",{className:"min-w-0",children:[w.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:s.title}),w.jsx("p",{className:"text-xs text-muted-foreground",children:s.sub})]})]}),w.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[w.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[w.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[w.jsx(lT,{className:"h-3.5 w-3.5"})," Speicher"]}),w.jsx("span",{className:De("font-mono font-bold",d),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(1)} / ${t.totalGb.toFixed(1)} GB`})]}),w.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:w.jsx("div",{className:De("h-full rounded-full transition-all duration-500",f),style:{width:`${t.pct}%`}})})]})]})}function cQ({problems:e,pendingCount:t,openAuftraege:r,blockedIdeen:n,busy:i,onRepair:o,onNavigate:s}){const u=t>0,d=r>0,f=n>0,h=e.length===0&&!u&&!d&&!f;return w.jsx("div",{className:"h-full flex flex-col justify-between",children:h?w.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4 h-full",children:[w.jsx(XM,{className:"h-5 w-5 shrink-0 text-emerald-400"}),w.jsxs("div",{children:[w.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):w.jsxs("div",{className:"space-y-2 h-full flex flex-col justify-center",children:[e.map(m=>w.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[w.jsxs("div",{className:"flex min-w-0 items-center gap-3 w-full",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:w.jsx(m.icon,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsx("p",{className:"text-sm font-bold text-foreground",children:m.label}),w.jsx("p",{className:"truncate text-xs text-muted-foreground",children:m.detail})]})]}),m.repair&&w.jsxs("button",{onClick:()=>m.repair&&o(m.id,m.repair),disabled:!!i[m.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60 w-full sm:w-auto justify-center",children:[i[m.id]?w.jsx(By,{className:"h-3.5 w-3.5 animate-spin"}):w.jsx(kT,{className:"h-3.5 w-3.5"}),m.repair.label]})]},m.id)),f&&w.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-red-500/30 bg-red-500/5 p-4 text-left transition-all hover:bg-red-500/10 cursor-pointer",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:w.jsx(zP,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{children:[w.jsxs("p",{className:"text-sm font-bold text-foreground",children:[n," Karte",n===1?"":"n"," braucht deine Antwort"]}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Die Box hängt an einer Frage und wartet auf dich."})]})]}),w.jsx(Bs,{className:"h-4 w-4 shrink-0 text-red-300/70"})]}),d&&w.jsxs("button",{onClick:()=>s("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-primary/30 bg-primary/5 p-4 text-left transition-all hover:bg-primary/10 cursor-pointer",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/30 bg-background/30 text-primary",children:w.jsx(Fy,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{children:[w.jsxs("p",{className:"text-sm font-bold text-foreground",children:[r," Vorschl",r===1?"ag":"äge"," im Auftragsbuch"]}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Annehmen oder ablehnen."})]})]}),w.jsx(Bs,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),u&&w.jsxs("button",{onClick:()=>kf("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[w.jsxs("div",{className:"flex items-center gap-3",children:[w.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:w.jsx(Wy,{className:"h-4.5 w-4.5"})}),w.jsxs("div",{children:[w.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),w.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden."})]})]}),w.jsx(Bs,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})})}function dQ({agent:e,svcErrors:t,onNavigate:r}){const n=[{label:"Hermes Agent",status:e?e.gateway_reachable?"Bereit":"Offline":"…",tone:e?e.gateway_reachable?"ok":"alert":"loading",action:()=>r("agent")},{label:"Konsole (Box-Shell)",status:e?e.box_console_reachable?"Bereit":"Offline":"…",tone:e?e.box_console_reachable?"ok":"warn":"loading",action:()=>r("konsole")},{label:"Systemlogs & Diagnose",status:t>0?`${t} Fehler`:"Keine Fehler",tone:t>0?"alert":"ok",action:()=>kf("logs")},{label:"Wissens-Vault",status:"Öffnen",tone:"muted",action:()=>r("wissen")},{label:"Chronik & Zeitmaschine",status:"Öffnen",tone:"muted",action:()=>r("chronik")}];return w.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/30 p-4 space-y-3 shadow-sm",children:w.jsx("div",{className:"divide-y divide-border/20",children:n.map((i,o)=>{const s={loading:"bg-muted-foreground/45 animate-pulse",ok:"bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.4)]",warn:"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.4)]",alert:"bg-red-500 shadow-[0_0_8px_rgba(239,68,68,0.4)]",muted:"bg-muted-foreground/30"}[i.tone];return w.jsxs("button",{onClick:i.action,className:"w-full py-2.5 px-1.5 flex items-center justify-between text-left hover:bg-card/45 rounded-lg transition-all group cursor-pointer text-xs",children:[w.jsx("span",{className:"text-muted-foreground group-hover:text-foreground transition-colors font-medium",children:i.label}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:De("text-[10px] font-semibold font-mono",i.tone==="ok"?"text-emerald-400":i.tone==="warn"?"text-amber-400":i.tone==="alert"?"text-red-400":"text-muted-foreground/60"),children:i.status}),w.jsx("span",{className:De("h-1.5 w-1.5 rounded-full",s)})]})]},o)})})})}const fQ=g.lazy(()=>ii(()=>import("./ModelsView-vX0ckGpG.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>({default:e.ModelsView}))),hQ=g.lazy(()=>ii(()=>import("./ConnectView-nzWBlbXD.js"),__vite__mapDeps([6,4,7])).then(e=>({default:e.ConnectView}))),pQ=g.lazy(()=>ii(()=>import("./AgentView-LlJDd33l.js"),[]).then(e=>({default:e.AgentView}))),mQ=g.lazy(()=>ii(()=>import("./KonsoleView-BJCYPWry.js"),[]).then(e=>({default:e.KonsoleView}))),vQ=g.lazy(()=>ii(()=>import("./GuideView-D3weMCzU.js"),__vite__mapDeps([8,3,5])).then(e=>({default:e.GuideView}))),yQ=g.lazy(()=>ii(()=>import("./AuftragsbuchView-C2dG-lAH.js"),__vite__mapDeps([9,10,4])).then(e=>({default:e.AuftragsbuchView}))),gQ=g.lazy(()=>ii(()=>import("./IdeenView-BpB3-RwB.js"),__vite__mapDeps([11,10,1,5,4,2])).then(e=>({default:e.IdeenView}))),xQ=g.lazy(()=>ii(()=>import("./ChronikView-BB9XGeGn.js"),__vite__mapDeps([12,2])).then(e=>({default:e.ChronikView}))),bQ=g.lazy(()=>ii(()=>import("./WissenView-DgtrXx57.js"),__vite__mapDeps([13,7])).then(e=>({default:e.WissenView})));function wQ(){return w.jsx("div",{className:"flex h-64 items-center justify-center text-muted-foreground",children:w.jsx(By,{className:"h-5 w-5 animate-spin","aria-label":"Lädt …"})})}const SQ=/Mac|iPhone|iPad/.test(navigator.platform);function kQ(){$3(),v3();const[e,t]=g.useState(()=>{const S=window.location.hash.slice(1);return Ko.some(E=>E.id===S)?S:"dashboard"}),r=g.useCallback(S=>{window.location.hash.slice(1)===S?t(S):window.location.hash=S},[]),[n,i]=g.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,s]=g.useState(!1),[u,d]=g.useState(!1),[f,h]=g.useState("maintenance"),{data:m,isError:v}=jA(),{data:x}=Df();g.useEffect(()=>{document.documentElement.classList.add("dark")},[]),g.useEffect(()=>{const S=E=>{var O;h(((O=E.detail)==null?void 0:O.tab)||"maintenance"),d(!0)};return window.addEventListener("open-system-drawer",S),()=>window.removeEventListener("open-system-drawer",S)},[]),g.useEffect(()=>{const S=E=>{var O;const P=(O=E.detail)==null?void 0:O.view;P&&r(P)};return window.addEventListener("mc-navigate",S),()=>window.removeEventListener("mc-navigate",S)},[r]),g.useEffect(()=>{const S=()=>{const E=window.location.hash.slice(1);Ko.some(P=>P.id===E)&&t(E)};return window.addEventListener("hashchange",S),()=>window.removeEventListener("hashchange",S)},[]),g.useEffect(()=>{s(!1)},[e]);const k=Ko.find(S=>S.id===e);return w.jsxs("div",{className:"flex h-full relative",children:[w.jsx("div",{className:"fixed inset-0 -z-50 pointer-events-none",style:{backgroundColor:"hsl(224,30%,6%)",backgroundImage:["radial-gradient(45% 40% at 12% 8%, hsl(172 72% 50% / 0.10), transparent 70%)","radial-gradient(50% 45% at 88% 92%, hsl(270 70% 60% / 0.10), transparent 70%)","radial-gradient(40% 35% at 75% 30%, hsl(239 70% 62% / 0.07), transparent 70%)"].join(", ")}}),w.jsx(NR,{onNavigate:r}),w.jsx(I3,{open:u,onClose:()=>d(!1),defaultTab:f}),w.jsx("aside",{className:De("hidden md:flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:w.jsx(hP,{collapsed:n,onToggleCollapse:()=>{i(S=>{const E=!S;return localStorage.setItem("mc_sidebar_collapsed",E.toString()),E})},view:e,health:m,backendDown:v,sysStatus:x})}),w.jsxs("div",{className:De("md:hidden fixed inset-0 z-50 transition-opacity duration-200",o?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":!o,children:[w.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:()=>s(!1)}),w.jsx("aside",{className:De("absolute inset-y-0 left-0 flex w-72 max-w-[85vw] flex-col border-r border-border/40 bg-[hsl(224,28%,8%)] transition-transform duration-300 ease-in-out",o?"translate-x-0":"-translate-x-full"),children:w.jsx(hP,{collapsed:!1,onClose:()=>s(!1),view:e,health:m,backendDown:v,sysStatus:x})})]}),w.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between gap-3 border-b border-border/40 px-4 md:px-6 bg-card/20 backdrop-blur-sm",children:[w.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[w.jsx("button",{onClick:()=>s(!0),className:"md:hidden p-1.5 -ml-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation öffnen",children:w.jsx(pT,{className:"h-5 w-5","aria-hidden":"true"})}),w.jsx("div",{className:"truncate text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:k.hint})]}),w.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[w.jsx(h3,{}),w.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"hidden sm:flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),w.jsxs("button",{onClick:()=>{const S=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(S)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[w.jsx(rT,{className:"h-3.5 w-3.5"}),w.jsx("span",{className:"hidden sm:inline",children:"Suchen"}),w.jsx("kbd",{className:"hidden sm:inline rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:SQ?"⌘K":"Strg+K"})]})]})]}),w.jsx("main",{className:"flex-1 overflow-y-auto p-4 md:p-6 scrollbar-thin",children:w.jsxs(g.Suspense,{fallback:w.jsx(wQ,{}),children:[e==="dashboard"&&w.jsx(sQ,{onNavigate:S=>r(S)}),e==="ideen"&&w.jsx(gQ,{}),e==="auftraege"&&w.jsx(yQ,{}),e==="models"&&w.jsx(fQ,{}),e==="connect"&&w.jsx(hQ,{}),e==="wissen"&&w.jsx(bQ,{}),e==="chronik"&&w.jsx(xQ,{}),e==="agent"&&w.jsx(pQ,{}),e==="konsole"&&w.jsx(mQ,{}),e==="guide"&&w.jsx(vQ,{})]})})]})]})}function hP({collapsed:e,onToggleCollapse:t,onClose:r,view:n,health:i,backendDown:o,sysStatus:s}){var u,d,f,h,m;return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:De("flex items-center py-4 border-b border-border/40 shrink-0",e?"flex-col gap-3 px-2":"justify-between px-5"),children:[w.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[w.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!e&&w.jsxs("div",{className:"leading-tight",children:[w.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),w.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),t&&w.jsx("button",{onClick:t,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":e?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:e?"Maximieren":"Minimieren",children:e?w.jsx(Bs,{className:"h-4 w-4","aria-hidden":"true"}):w.jsx(ZM,{className:"h-4 w-4","aria-hidden":"true"})}),r&&w.jsx("button",{onClick:r,className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":"Navigation schließen",children:w.jsx(Cf,{className:"h-4 w-4","aria-hidden":"true"})})]}),w.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:(()=>{let v=null;return Ko.map(x=>{const k=x.group!==v;return v=x.group,w.jsxs("div",{className:"space-y-1",children:[k&&(e?v!==Ko[0].group&&w.jsx("div",{className:"my-3 border-t border-border/30"}):w.jsx("div",{className:"mt-5 mb-1.5 px-3 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/40 first:mt-0 select-none",children:x.group})),w.jsxs("a",{href:`#${x.id}`,onClick:r,"aria-current":n===x.id?"page":void 0,className:De("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",e?"justify-center p-2.5":"gap-3 px-3 py-2",n===x.id?e?"nav-active-collapsed":"nav-active":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:e?x.label:void 0,"aria-label":e?x.label:void 0,children:[w.jsx(x.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!e&&w.jsx("span",{className:"truncate",children:x.label})]})]},x.id)})})()}),w.jsx("div",{className:De("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",e?"px-2 text-center":"px-5"),children:e?w.jsx("div",{className:"flex justify-center",children:w.jsx("span",{className:De("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",o||!i?"bg-red-500":i.engine_reachable?i.brain&&!i.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500"),title:o?"Zentrale antwortet nicht — Anzeigen evtl. veraltet":i?i.engine_reachable?i.brain&&!i.brain.ready?`Hirn offline (${i.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):w.jsxs("div",{className:"space-y-2 text-left",children:[o?w.jsxs("span",{className:"flex items-center gap-2 text-red-400",children:[w.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500 animate-pulse"}),w.jsx("span",{className:"truncate",children:"Zentrale antwortet nicht"})]}):i?w.jsxs(w.Fragment,{children:[w.jsxs("span",{className:"flex items-center gap-2",children:[w.jsx("span",{className:De("h-2 w-2 rounded-full animate-pulse",i.engine_reachable?"bg-emerald-500":"bg-amber-500")}),w.jsxs("span",{className:"truncate",children:["Engine ",i.engine_reachable?"online":"offline"]})]}),i.brain&&!i.brain.ready&&w.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${i.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[w.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),w.jsxs("span",{className:"truncate",children:["Hirn offline",i.brain.model?` (${i.brain.model})`:""]})]})]}):w.jsxs("span",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",w.jsx("span",{className:"truncate",children:"Backend offline"})]}),(s==null?void 0:s.versions)&&w.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[w.jsxs("div",{className:"truncate",title:s.versions.mc2?`${s.versions.mc2.branch}-${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""} (${s.versions.mc2.date})`:"nicht gefunden",children:[w.jsx("strong",{children:"MC2:"})," ",s.versions.mc2?`${s.versions.mc2.hash}${s.versions.mc2.dirty?"*":""}`:"—"]}),w.jsxs("div",{className:"truncate",title:((u=s.versions.engine)==null?void 0:u.type)==="git"?`${s.versions.engine.branch}-${s.versions.engine.hash}${s.versions.engine.dirty?"*":""} (${s.versions.engine.date})`:((d=s.versions.engine)==null?void 0:d.version_text)||"unbekannt",children:[w.jsx("strong",{children:"Engine:"})," ",((f=s.versions.engine)==null?void 0:f.type)==="git"?`${s.versions.engine.hash}${s.versions.engine.dirty?"*":""}`:((m=(h=s.versions.engine)==null?void 0:h.version_text)==null?void 0:m.split(" ").pop())||"—"]}),w.jsxs("div",{className:"truncate",title:s.versions.hermes_agent?`${s.versions.hermes_agent.branch}-${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""} (${s.versions.hermes_agent.date})`:"nicht gefunden",children:[w.jsx("strong",{children:"Hermes Agent:"})," ",s.versions.hermes_agent?`${s.versions.hermes_agent.hash}${s.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]})}class EQ extends Dy.Component{constructor(){super(...arguments);xs(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?w.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:w.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[w.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),w.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),w.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const PQ=new CM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});rM.createRoot(document.getElementById("root")).render(w.jsx(Dy.StrictMode,{children:w.jsx(EQ,{children:w.jsx(_M,{client:PQ,children:w.jsx(kQ,{})})})}));export{Uy as $,TA as A,YM as B,XM as C,zQ as D,Ov as E,k3 as F,B1 as G,lT as H,Bs as I,JM as J,S3 as K,By as L,nT as M,OQ as N,Af as O,vT as P,VM as Q,Hy as R,yT as S,Gs as T,Ho as U,wT as V,kT as W,Cf as X,Es as Y,Of as Z,LP as _,w3 as a,hT as a0,aT as a1,bT as a2,y3 as a3,g3 as a4,eT as a5,WQ as a6,Fy as a7,jQ as a8,zP as a9,iT as aa,NQ as ab,uT as ac,Wy as ad,sT as ae,x3 as af,rf as ag,Dy as ah,su as ai,bk as aj,A8 as ak,Ng as al,dk as am,ck as an,Ty as ao,IQ as ap,MQ as aq,fT as ar,_A as b,je as c,BQ as d,De as e,Nm as f,Te as g,DQ as h,_Q as i,w as j,qM as k,IA as l,TQ as m,Df as n,RQ as o,FQ as p,ze as q,g as r,CQ as s,LQ as t,Pf as u,No as v,TR as w,FP as x,UQ as y,$Q as z}; diff --git a/frontend/dist/assets/layers-PioAw_-7.js b/frontend/dist/assets/layers-CjyCNjIs.js similarity index 91% rename from frontend/dist/assets/layers-PioAw_-7.js rename to frontend/dist/assets/layers-CjyCNjIs.js index a67f3d8..9e2fe04 100644 --- a/frontend/dist/assets/layers-PioAw_-7.js +++ b/frontend/dist/assets/layers-CjyCNjIs.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-B1_ue-6-.js";/** +import{c as a}from"./index-CUuKs_1x.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/rotate-ccw-KIERrTyE.js b/frontend/dist/assets/rotate-ccw-BtnOKhJQ.js similarity index 88% rename from frontend/dist/assets/rotate-ccw-KIERrTyE.js rename to frontend/dist/assets/rotate-ccw-BtnOKhJQ.js index f41b539..3cccd79 100644 --- a/frontend/dist/assets/rotate-ccw-KIERrTyE.js +++ b/frontend/dist/assets/rotate-ccw-BtnOKhJQ.js @@ -1,4 +1,4 @@ -import{c as t}from"./index-B1_ue-6-.js";/** +import{c as t}from"./index-CUuKs_1x.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/zap-BxCGzT3u.js b/frontend/dist/assets/zap-iWjc7Axa.js similarity index 96% rename from frontend/dist/assets/zap-BxCGzT3u.js rename to frontend/dist/assets/zap-iWjc7Axa.js index d01c718..dc9808f 100644 --- a/frontend/dist/assets/zap-BxCGzT3u.js +++ b/frontend/dist/assets/zap-iWjc7Axa.js @@ -1,4 +1,4 @@ -import{c as a}from"./index-B1_ue-6-.js";/** +import{c as a}from"./index-CUuKs_1x.js";/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 8435423..49cfc0e 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,7 +7,7 @@ Mission Control 2.0 - + diff --git a/frontend/src/views/IdeenView.tsx b/frontend/src/views/IdeenView.tsx index 11b1cc5..10ab1ac 100644 --- a/frontend/src/views/IdeenView.tsx +++ b/frontend/src/views/IdeenView.tsx @@ -17,7 +17,7 @@ import { SectionLabel } from "@/components/ui/SectionLabel" // die MEHRHEIT einer Seite, die nach etwas anderem benannt war. Die beiden laufen in // entgegengesetzte Richtungen: Auftragsbuch = die Box schlaegt DIR vor (Eingang), // Ideen = DU beauftragst die Box (Ausgang). Seit dem Umbau ist dieser Weg der -// Haupteingang des Systems (Idee -> Konzept -> Repo -> Zed) und gehoert nach vorn. +// Haupteingang des Systems (Idee -> Konzept -> Repo -> Agentic IDE) und gehoert nach vorn. // ── Ideen-Queue (natives Hermes-Kanban) ────────────────────────────────────── // Eine Queue, drei Türen (Zentrale/Telegram/Lucy). Idee rein → die Box arbeitet sie @@ -51,7 +51,7 @@ const ART_UI: Record("denken") const [tiefe, setTiefe] = useState<"schlank" | "gruendlich">("schlank") // Zugeklappt statt Assistent (26.07.2026): der Entscheidungsbaum EXISTIERT — Wer baut das?, - // und nur im Zed-Ast: wie startest du? — aber du läufst ihn nur, wenn die Einordnung + // und nur im IDE-Ast: wie startest du? — aber du läufst ihn nur, wenn die Einordnung // danebenlag. Im Normalfall steht da eine Zeile und du drückst Enter. const [offen, setOffen] = useState(false) // Hat die Box den Text wirklich gelesen? Steuert nur das Etikett „gelesen" in der @@ -131,12 +131,12 @@ function IdeenSection() { let verworfen = false const timer = setTimeout(async () => { try { - const r = await api<{ ok: boolean; wer?: "box" | "zed"; tiefe?: "schlank" | "gruendlich"; nur_denken?: boolean }>( + const r = await api<{ ok: boolean; wer?: "box" | "ide"; tiefe?: "schlank" | "gruendlich"; nur_denken?: boolean }>( "/api/ideen/einordnen", { method: "POST", body: JSON.stringify({ text: t }) }) if (verworfen || !r?.ok) return // Die drei Karten aus der Einordnung ableiten: eine Frage („lohnt sich…?") wird zum // Durchdenken, ein eigenständiges Programm zum Repo, alles am Heimlabor zur Box. - setModus(r.nur_denken ? "denken" : r.wer === "zed" ? "repo" : "box") + setModus(r.nur_denken ? "denken" : r.wer === "ide" ? "repo" : "box") if (r.tiefe) setTiefe(r.tiefe) setVorgeschlagen(true) } catch { /* stumm — die Voreinstellung bleibt einfach stehen */ } @@ -500,7 +500,7 @@ function IdeenSection() { {/* ZUGEKLAPPT STATT ASSISTENT. Der Entscheidungsbaum ist derselbe, den ein Wizard - abfragen wuerde — Wer baut das?, und NUR im Zed-Ast: wie startest du? Nur laeufst + abfragen wuerde — Wer baut das?, und NUR im IDE-Ast: wie startest du? Nur laeufst du ihn erst, wenn die Einordnung danebenlag. Ein Assistent wuerde dich fragen, was die Box in ~500 ms schon weiss; das hier fragt nur im Zweifelsfall. IMMER sichtbar (26.07., User-Befund): vorher hing der ganze Block an @@ -516,7 +516,7 @@ function IdeenSection() {
setModus(modus === "box" ? "denken" : modus)} - k={{ id: "zed", icon: Code2, titel: "Ich, in Zed", + k={{ id: "ide", icon: Code2, titel: "Ich, in der Agentic IDE", text: "Du bekommst Konzept und Repo — den Code schreibst du selbst." }} /> setModus("box")} @@ -525,7 +525,7 @@ function IdeenSection() {
- {/* Die zweite Frage gibt es NUR im Zed-Ast — eingerückt, damit die Verschachtelung + {/* Die zweite Frage gibt es NUR im IDE-Ast — eingerückt, damit die Verschachtelung sichtbar ist. Bei „die Box" folgt keine Rückfrage: dann geht es direkt los. */} {modus !== "box" && (
@@ -880,7 +880,7 @@ function WeiterLeiste({ id, onFertig }: { id: string; onFertig?: () => void }) {

{neu.art === "projekt" ? ( <>Projekt-Karte {neu.id} ist angelegt — die Box bereitet - das Repo vor (Konzept übernimmt sie, sie denkt es nicht neu). Danach öffnest du es in Zed. + das Repo vor (Konzept übernimmt sie, sie denkt es nicht neu). Danach öffnest du es in der Agentic IDE. ) : ( <>Überarbeitung {neu.id} läuft — die Box arbeitet deine Rückmeldung ein und schreibt die neue Fassung an dieselbe Stelle. Danach hier wieder @@ -917,7 +917,7 @@ function WeiterLeiste({ id, onFertig }: { id: string; onFertig?: () => void }) {

Passt es so? Dann macht die Box daraus ein startklares Repo — Konzept wird übernommen (nicht neu gedacht), dazu Roadmap, AGENTS.md & Co. - Gebaut wird danach von dir in Zed. + Gebaut wird danach von dir in der Agentic IDE.

Ziel