apteva 0.4.44 → 0.4.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/{ActivityPage.c48n83h2.js → ActivityPage.sw9p594m.js} +1 -1
  2. package/dist/{ApiDocsPage.yzcxx5ax.js → ApiDocsPage.90e03bz7.js} +1 -1
  3. package/dist/App.0ws87fpx.js +53 -0
  4. package/dist/App.3vnrera5.js +4 -0
  5. package/dist/App.94x6mh7f.js +20 -0
  6. package/dist/{App.qzbx5wtj.js → App.9sryp183.js} +1 -1
  7. package/dist/App.d9tny4t0.js +221 -0
  8. package/dist/{App.r5serxkt.js → App.jhb45d7r.js} +1 -1
  9. package/dist/App.p7jjw1zf.js +4 -0
  10. package/dist/App.pfbdzrhh.js +4 -0
  11. package/dist/App.stgng5bx.js +13 -0
  12. package/dist/{App.152mbs1r.js → App.tm3k7h4b.js} +1 -1
  13. package/dist/App.vkg121c6.js +4 -0
  14. package/dist/App.wghtdzsk.js +1 -0
  15. package/dist/App.xf7wsckg.js +4 -0
  16. package/dist/App.xva0tfzh.js +4 -0
  17. package/dist/App.ysxy7akk.js +61 -0
  18. package/dist/App.yzkh4gq2.js +4 -0
  19. package/dist/ConnectionsPage.q5f9fd37.js +3 -0
  20. package/dist/McpPage.f3ccrezb.js +3 -0
  21. package/dist/SettingsPage.3sqx6wm4.js +3 -0
  22. package/dist/SkillsPage.whxnez67.js +3 -0
  23. package/dist/TasksPage.zp4jfevw.js +3 -0
  24. package/dist/TelemetryPage.a9fmxq87.js +3 -0
  25. package/dist/TestsPage.18krj0d1.js +3 -0
  26. package/dist/ThreadsPage.nnphgy98.js +3 -0
  27. package/dist/apteva-kit.css +1 -1
  28. package/dist/index.html +1 -1
  29. package/dist/styles.css +1 -1
  30. package/package.json +5 -4
  31. package/src/db.ts +42 -4
  32. package/src/providers.ts +14 -9
  33. package/src/routes/api/agent-utils.ts +25 -3
  34. package/src/routes/api/telemetry.ts +20 -2
  35. package/src/server.ts +52 -1
  36. package/src/web/App.tsx +1 -1
  37. package/src/web/components/agents/AgentCard.tsx +9 -7
  38. package/src/web/components/agents/AgentPanel.tsx +205 -44
  39. package/src/web/components/agents/CreateAgentModal.tsx +5 -5
  40. package/src/web/components/auth/LoginPage.tsx +2 -2
  41. package/src/web/components/common/LoadingSpinner.tsx +1 -1
  42. package/src/web/components/common/Modal.tsx +6 -6
  43. package/src/web/components/common/Select.tsx +2 -2
  44. package/src/web/components/connections/ConnectionsPage.tsx +1 -1
  45. package/src/web/components/connections/IntegrationsTab.tsx +3 -3
  46. package/src/web/components/connections/OverviewTab.tsx +3 -3
  47. package/src/web/components/connections/TriggersTab.tsx +8 -8
  48. package/src/web/components/dashboard/Dashboard.tsx +2 -2
  49. package/src/web/components/layout/Header.tsx +3 -3
  50. package/src/web/components/layout/Sidebar.tsx +3 -2
  51. package/src/web/components/mcp/McpPage.tsx +13 -13
  52. package/src/web/components/onboarding/OnboardingWizard.tsx +2 -2
  53. package/src/web/components/settings/SettingsPage.tsx +55 -22
  54. package/src/web/components/skills/SkillsPage.tsx +7 -7
  55. package/src/web/components/tasks/TasksPage.tsx +212 -36
  56. package/src/web/components/telemetry/TelemetryPage.tsx +278 -9
  57. package/src/web/components/tests/TestsPage.tsx +2 -2
  58. package/src/web/components/threads/ThreadsPage.tsx +2 -2
  59. package/src/web/context/ThemeContext.tsx +31 -10
  60. package/src/web/index.html +1 -6
  61. package/src/web/styles.css +47 -0
  62. package/src/web/themes.ts +68 -5
  63. package/dist/App.09yb8t0b.js +0 -1
  64. package/dist/App.3a67nx9w.js +0 -4
  65. package/dist/App.9epx6785.js +0 -4
  66. package/dist/App.d8955awp.js +0 -4
  67. package/dist/App.drwb57jq.js +0 -4
  68. package/dist/App.gssbmajb.js +0 -4
  69. package/dist/App.qw70pc29.js +0 -53
  70. package/dist/App.tpmp9020.js +0 -20
  71. package/dist/App.v2wb4d7d.js +0 -61
  72. package/dist/App.vxmaaj0m.js +0 -13
  73. package/dist/App.w4p2tda9.js +0 -4
  74. package/dist/App.wv2ng55q.js +0 -221
  75. package/dist/App.yncnrn0f.js +0 -4
  76. package/dist/ConnectionsPage.k6cspyqq.js +0 -3
  77. package/dist/McpPage.cdxm48xj.js +0 -3
  78. package/dist/SettingsPage.evpv7c2y.js +0 -3
  79. package/dist/SkillsPage.pvzp6c1a.js +0 -3
  80. package/dist/TasksPage.6jnvbpsy.js +0 -3
  81. package/dist/TelemetryPage.t7vk24zc.js +0 -3
  82. package/dist/TestsPage.5x6658aa.js +0 -3
  83. package/dist/ThreadsPage.3fvhtevh.js +0 -3
@@ -1,10 +1,12 @@
1
1
  import React, { createContext, useContext, useState, useEffect, useCallback, useMemo, type ReactNode } from "react";
2
- import { themes, resolveTheme, type ThemeMode, type Theme } from "../themes";
2
+ import { themes, resolveTheme, type ThemeMode, type ThemeStyle, type Theme } from "../themes";
3
3
 
4
4
  interface ThemeContextValue {
5
5
  mode: ThemeMode;
6
+ style: ThemeStyle;
6
7
  theme: Theme; // resolved theme
7
8
  setMode: (mode: ThemeMode) => void;
9
+ setStyle: (style: ThemeStyle) => void;
8
10
  }
9
11
 
10
12
  const ThemeContext = createContext<ThemeContextValue | null>(null);
@@ -17,30 +19,44 @@ export function useTheme(): ThemeContextValue {
17
19
  return context;
18
20
  }
19
21
 
20
- const STORAGE_KEY = "apteva_theme_mode";
22
+ const MODE_KEY = "apteva_theme_mode";
23
+ const STYLE_KEY = "apteva_theme_style";
21
24
 
22
25
  function getSystemPrefersDark(): boolean {
23
26
  if (typeof window === "undefined") return true;
24
27
  return window.matchMedia("(prefers-color-scheme: dark)").matches;
25
28
  }
26
29
 
27
- function applyTheme(theme: Theme) {
30
+ function applyTheme(theme: Theme, style: ThemeStyle) {
28
31
  const root = document.documentElement;
29
32
  for (const [key, value] of Object.entries(theme.colors)) {
30
33
  root.style.setProperty(key, value);
31
34
  }
32
35
  root.setAttribute("data-theme", theme.id);
36
+ root.setAttribute("data-style", style);
37
+ // Set font directly as inline style — CSS variable alone gets overridden by Tailwind base
38
+ document.body.style.fontFamily = style === "professional"
39
+ ? "'Inter', system-ui, -apple-system, sans-serif"
40
+ : "'JetBrains Mono', monospace";
33
41
  }
34
42
 
35
43
  export function ThemeProvider({ children }: { children: ReactNode }) {
36
44
  const [mode, setModeState] = useState<ThemeMode>(() => {
37
45
  if (typeof window !== "undefined") {
38
- const stored = localStorage.getItem(STORAGE_KEY);
46
+ const stored = localStorage.getItem(MODE_KEY);
39
47
  if (stored === "dark" || stored === "light" || stored === "auto") return stored;
40
48
  }
41
49
  return "auto";
42
50
  });
43
51
 
52
+ const [style, setStyleState] = useState<ThemeStyle>(() => {
53
+ if (typeof window !== "undefined") {
54
+ const stored = localStorage.getItem(STYLE_KEY);
55
+ if (stored === "classic" || stored === "professional") return stored;
56
+ }
57
+ return "classic";
58
+ });
59
+
44
60
  const [prefersDark, setPrefersDark] = useState(getSystemPrefersDark);
45
61
 
46
62
  // Listen for system theme changes
@@ -51,19 +67,24 @@ export function ThemeProvider({ children }: { children: ReactNode }) {
51
67
  return () => mq.removeEventListener("change", handler);
52
68
  }, []);
53
69
 
54
- const theme = useMemo(() => resolveTheme(mode, prefersDark), [mode, prefersDark]);
70
+ const theme = useMemo(() => resolveTheme(mode, style, prefersDark), [mode, style, prefersDark]);
55
71
 
56
- // Apply CSS variables whenever theme changes
72
+ // Apply CSS variables + style attribute whenever theme or style changes
57
73
  useEffect(() => {
58
- applyTheme(theme);
59
- }, [theme]);
74
+ applyTheme(theme, style);
75
+ }, [theme, style]);
60
76
 
61
77
  const setMode = useCallback((newMode: ThemeMode) => {
62
78
  setModeState(newMode);
63
- localStorage.setItem(STORAGE_KEY, newMode);
79
+ localStorage.setItem(MODE_KEY, newMode);
80
+ }, []);
81
+
82
+ const setStyle = useCallback((newStyle: ThemeStyle) => {
83
+ setStyleState(newStyle);
84
+ localStorage.setItem(STYLE_KEY, newStyle);
64
85
  }, []);
65
86
 
66
- const value = useMemo(() => ({ mode, theme, setMode }), [mode, theme, setMode]);
87
+ const value = useMemo(() => ({ mode, style, theme, setMode, setStyle }), [mode, style, theme, setMode, setStyle]);
67
88
 
68
89
  return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;
69
90
  }
@@ -6,13 +6,8 @@
6
6
  <title>Apteva</title>
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com">
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
9
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
10
10
  <link rel="stylesheet" href="./styles.css">
11
- <style>
12
- body {
13
- font-family: 'JetBrains Mono', monospace;
14
- }
15
- </style>
16
11
  </head>
17
12
  <body>
18
13
  <div id="root"></div>
@@ -2,9 +2,56 @@
2
2
  @tailwind components;
3
3
  @tailwind utilities;
4
4
 
5
+ /* ── Style variables (classic vs professional) ── */
6
+ :root, [data-style="classic"] {
7
+ --font-family: 'JetBrains Mono', monospace;
8
+ --radius-card: 8px;
9
+ --radius-button: 6px;
10
+ --radius-badge: 4px;
11
+ --shadow-card: none;
12
+ --shadow-card-hover: none;
13
+ --border-card: 1px solid var(--color-border);
14
+ --spacing-card: 1rem;
15
+ }
16
+
17
+ [data-style="professional"] {
18
+ --font-family: 'Inter', system-ui, -apple-system, sans-serif;
19
+ --radius-card: 14px;
20
+ --radius-button: 10px;
21
+ --radius-badge: 8px;
22
+ --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
23
+ --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
24
+ --border-card: 1px solid var(--color-border);
25
+ --spacing-card: 1.25rem;
26
+ }
27
+
28
+ /* Dark professional gets stronger shadows */
29
+ [data-style="professional"][data-theme="professional-dark"] {
30
+ --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.12);
31
+ --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
32
+ }
33
+
34
+ /* ── Utility class for cards ── */
35
+ .card {
36
+ border-radius: var(--radius-card);
37
+ border: var(--border-card);
38
+ box-shadow: var(--shadow-card);
39
+ transition: box-shadow 0.2s ease;
40
+ }
41
+
42
+ .card:hover {
43
+ box-shadow: var(--shadow-card-hover);
44
+ }
45
+
46
+ /* ── Utility for buttons ── */
47
+ .btn {
48
+ border-radius: var(--radius-button);
49
+ }
50
+
5
51
  html, body {
6
52
  background-color: var(--color-bg, #0a0a0a);
7
53
  color: var(--color-text, #e0e0e0);
54
+ font-family: var(--font-family, 'JetBrains Mono', monospace);
8
55
  min-height: 100%;
9
56
  margin: 0;
10
57
  -webkit-font-smoothing: antialiased;
package/src/web/themes.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /** Theme system — extensible for future custom themes */
2
2
 
3
3
  export type ThemeMode = "auto" | "dark" | "light";
4
+ export type ThemeStyle = "classic" | "professional";
4
5
 
5
6
  export interface ThemeColors {
6
7
  "--color-bg": string;
@@ -30,6 +31,7 @@ export interface Theme {
30
31
  }
31
32
 
32
33
  export const themes: Record<string, Theme> = {
34
+ // ── Classic (terminal/hacker) ──────────────────────────
33
35
  dark: {
34
36
  id: "dark",
35
37
  name: "Dark",
@@ -88,12 +90,73 @@ export const themes: Record<string, Theme> = {
88
90
  "--color-scrollbar-hover": "#aaaaaa",
89
91
  },
90
92
  },
93
+
94
+ // ── Professional (enterprise/SaaS) ────────────────────
95
+ "professional-dark": {
96
+ id: "professional-dark",
97
+ name: "Professional Dark",
98
+ colors: {
99
+ "--color-bg": "#0f1117",
100
+ "--color-bg-secondary": "#131520",
101
+ "--color-surface": "#181a24",
102
+ "--color-surface-hover": "#1e2030",
103
+ "--color-surface-raised": "#232636",
104
+ "--color-border": "#252838",
105
+ "--color-border-light": "#2d3044",
106
+ "--color-text": "#d4d7e0",
107
+ "--color-text-secondary": "#8b8fa3",
108
+ "--color-text-muted": "#6b6f83",
109
+ "--color-text-faint": "#4e5266",
110
+ "--color-accent": "#7c3aed",
111
+ "--color-accent-hover": "#6d28d9",
112
+ "--color-accent-5": "rgba(124, 58, 237, 0.05)",
113
+ "--color-accent-10": "rgba(124, 58, 237, 0.1)",
114
+ "--color-accent-15": "rgba(124, 58, 237, 0.15)",
115
+ "--color-accent-20": "rgba(124, 58, 237, 0.2)",
116
+ "--color-accent-30": "rgba(124, 58, 237, 0.3)",
117
+ "--color-accent-70": "rgba(124, 58, 237, 0.7)",
118
+ "--color-selection-bg": "#7c3aed",
119
+ "--color-selection-text": "#ffffff",
120
+ "--color-scrollbar": "#2d3044",
121
+ "--color-scrollbar-hover": "#3d4058",
122
+ },
123
+ },
124
+ "professional-light": {
125
+ id: "professional-light",
126
+ name: "Professional Light",
127
+ colors: {
128
+ "--color-bg": "#f8f9fb",
129
+ "--color-bg-secondary": "#f0f2f5",
130
+ "--color-surface": "#ffffff",
131
+ "--color-surface-hover": "#f5f6f8",
132
+ "--color-surface-raised": "#eef0f4",
133
+ "--color-border": "#e2e4ea",
134
+ "--color-border-light": "#e8eaef",
135
+ "--color-text": "#1a1d2b",
136
+ "--color-text-secondary": "#4b5066",
137
+ "--color-text-muted": "#6b7088",
138
+ "--color-text-faint": "#9298ac",
139
+ "--color-accent": "#6d28d9",
140
+ "--color-accent-hover": "#5b21b6",
141
+ "--color-accent-5": "rgba(109, 40, 217, 0.05)",
142
+ "--color-accent-10": "rgba(109, 40, 217, 0.1)",
143
+ "--color-accent-15": "rgba(109, 40, 217, 0.15)",
144
+ "--color-accent-20": "rgba(109, 40, 217, 0.2)",
145
+ "--color-accent-30": "rgba(109, 40, 217, 0.3)",
146
+ "--color-accent-70": "rgba(109, 40, 217, 0.7)",
147
+ "--color-selection-bg": "#6d28d9",
148
+ "--color-selection-text": "#ffffff",
149
+ "--color-scrollbar": "#cdd0d8",
150
+ "--color-scrollbar-hover": "#b0b4c0",
151
+ },
152
+ },
91
153
  };
92
154
 
93
- /** Resolve the effective theme ID from a mode + system preference */
94
- export function resolveTheme(mode: ThemeMode, prefersDark: boolean): Theme {
95
- if (mode === "auto") {
96
- return prefersDark ? themes.dark : themes.light;
155
+ /** Resolve the effective theme from mode + style + system preference */
156
+ export function resolveTheme(mode: ThemeMode, style: ThemeStyle, prefersDark: boolean): Theme {
157
+ const isDark = mode === "auto" ? prefersDark : mode === "dark";
158
+ if (style === "professional") {
159
+ return isDark ? themes["professional-dark"] : themes["professional-light"];
97
160
  }
98
- return themes[mode] || themes.dark;
161
+ return isDark ? themes.dark : themes.light;
99
162
  }
@@ -1 +0,0 @@
1
- @layer components{@keyframes blink{0%,to{opacity:1}50%{opacity:0}}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.animate-slideUp{animation:.2s ease-out slideUp}.apteva-scrollbar-hidden{-ms-overflow-style:none;scrollbar-width:none}.apteva-scrollbar-hidden::-webkit-scrollbar{display:none}.apteva-md{white-space:pre-wrap!important;color:inherit!important;word-wrap:break-word!important;overflow-wrap:break-word!important;font-size:.875rem!important;line-height:1.625!important}.apteva-md-h2{all:unset!important;display:block!important;margin-top:.75rem!important;margin-bottom:.25rem!important;font-size:1.125rem!important;font-weight:600!important;line-height:1.3!important}.apteva-md-h3{all:unset!important;display:block!important;margin-top:.5rem!important;margin-bottom:.125rem!important;font-size:1rem!important;font-weight:600!important;line-height:1.3!important}.apteva-md-ul{all:unset!important;list-style-type:disc!important;list-style-position:outside!important;display:block!important;margin-top:.5rem!important;margin-bottom:.5rem!important;padding-left:1.5rem!important}.apteva-md-ol{all:unset!important;list-style-type:decimal!important;list-style-position:outside!important;display:block!important;margin-top:.5rem!important;margin-bottom:.5rem!important;padding-left:1.5rem!important}.apteva-md-li{all:unset!important;display:list-item!important;margin-bottom:.25rem!important;padding-left:.25rem!important}.apteva-tool-call{all:unset!important;display:flex!important;background-color:#8080801a!important;border:1px solid #80808033!important;border-radius:.5rem!important;align-items: center!important;gap:.5rem!important;margin:.5rem 0!important;padding:.5rem .75rem!important;font-size:.875rem!important}.apteva-tool-call-dot{all:unset!important;display:block!important;border-radius:50%!important;flex-shrink:0!important;width:.5rem!important;height:.5rem!important}.apteva-tool-call-dot-running{animation:1s infinite blink!important;background-color:#3b82f6!important}.apteva-tool-call-dot-completed{background-color:#22c55e!important}.apteva-tool-call-dot-error{background-color:#ef4444!important}.apteva-tool-call-name{all:unset!important;color:inherit!important;font-family:ui-monospace,monospace!important}.apteva-tool-call-status{all:unset!important;color:#808080cc!important;margin-left:auto!important}.apteva-tool-call-status-completed{color:#22c55e!important}.apteva-tool-call-status-error{color:#ef4444!important}.apteva-md-table-wrapper{overflow-x:auto!important;margin:.75rem 0!important}.apteva-md-table{border-collapse:collapse!important;width:100%!important;font-size:.8125rem!important;line-height:1.4!important}.apteva-md-th{text-align:left!important;white-space:nowrap!important;border-bottom:2px solid #8080804d!important;padding:.5rem .75rem!important;font-weight:600!important}.apteva-md-td{border-bottom:1px solid #80808026!important;padding:.5rem .75rem!important}.apteva-md-table tbody tr:hover{background-color:#8080800d!important}.apteva-md-table tbody tr:last-child .apteva-md-td{border-bottom:none!important}.apteva-md-img{display:block!important;border-radius:.5rem!important;max-width:100%!important;height:auto!important;margin:.5rem 0!important}.apteva-md-link{color:#3b82f6!important;text-underline-offset:2px!important;text-decoration:underline!important}.apteva-md-link:hover{color:#2563eb!important}.apteva-md-inline-code{background-color:#80808026!important;border-radius:.25rem!important;padding:.125rem .375rem!important;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace!important;font-size:.8125rem!important}.apteva-typing-indicator{display:inline-flex!important;align-items: center!important;gap:2px!important}.apteva-typing-indicator span{opacity:.4!important;animation:1.4s infinite both apteva-typing-blink!important;background-color:currentColor!important;border-radius:50%!important;width:6px!important;height:6px!important}.apteva-typing-indicator span:nth-child(2){animation-delay:.2s!important}.apteva-typing-indicator span:nth-child(3){animation-delay:.4s!important}@keyframes apteva-typing-blink{0%,80%,to{opacity:.4}40%{opacity:1}}.apteva-chat-header{all:unset!important;box-sizing:border-box!important;display:flex!important;justify-content:space-between!important;align-items: center!important;padding:.75rem 1rem!important}.apteva-chat-title{all:unset!important;color:#111827!important;display:block!important;font-size:1.125rem!important;font-weight:600!important;line-height:1.4!important}@media (prefers-color-scheme:dark){.apteva-chat-title{color:#fff!important}}.dark .apteva-chat-title{color:#fff!important}.apteva-chat-status{all:unset!important;display:block!important;margin-top:.125rem!important;font-size:.75rem!important;line-height:1.4!important}.apteva-chat-status-ready,.apteva-chat-status-thinking{color:#737373!important}.apteva-chat-status-tool{color:#3b82f6!important}@media (prefers-color-scheme:dark){.apteva-chat-status-ready,.apteva-chat-status-thinking{color:#525252!important}.apteva-chat-status-tool{color:#60a5fa!important}}.dark .apteva-chat-status-ready,.dark .apteva-chat-status-thinking{color:#525252!important}.dark .apteva-chat-status-tool{color:#60a5fa!important}.apteva-message-list{box-sizing:border-box!important;display:block!important;overflow-y:auto!important;flex:1!important;padding:1rem!important}.apteva-message-row-user{display:flex!important;justify-content:flex-end!important;margin-bottom:.75rem!important}.apteva-message-row-assistant{display:flex!important;justify-content:flex-start!important;margin-bottom:.75rem!important}.apteva-message-bubble{box-sizing:border-box!important;display:block!important;border-radius:1rem!important;max-width:95%!important;padding:.625rem 1rem!important;font-size:.875rem!important;line-height:1.5!important}.apteva-message-user{color:#fff!important;background-color:#2563eb!important;border-bottom-right-radius:.375rem!important}.apteva-message-assistant{color:#0a0a0a!important;background-color:#fafafa!important;border-bottom-left-radius:.375rem!important}@media (prefers-color-scheme:dark){.apteva-message-assistant{color:#fafafa!important;background-color:#262626!important}}.dark .apteva-message-assistant{color:#fafafa!important;background-color:#262626!important}.apteva-message-content-user,.apteva-message-content-assistant{display:block!important}.apteva-message-text{white-space:pre-wrap!important;color:inherit!important;display:block!important;font-size:.875rem!important;line-height:1.625!important}.apteva-message-widgets{display:block!important;margin-top:.5rem!important}.apteva-message-timestamp{display:block!important;margin-top:.375rem!important;font-size:.75rem!important}.apteva-message-timestamp-user{color:#bfdbfe!important}.apteva-message-timestamp-assistant,.apteva-welcome-empty{color:#737373!important}.apteva-welcome-icon{color:#a3a3a3!important}.apteva-welcome-title{color:#111827!important}.apteva-welcome-subtitle{color:#737373!important}.apteva-prompt-card{background-color:#fff!important;border-color:#e5e5e5!important}.apteva-prompt-card:hover{background-color:#fafafa!important;border-color:#93c5fd!important}.apteva-prompt-text{color:#111827!important}.apteva-prompt-desc{color:#737373!important}.apteva-prompt-icon{color:#a3a3a3!important}.group:hover .apteva-prompt-icon{color:#3b82f6!important}.apteva-prompt-icon-box{color:#737373!important;background-color:#f5f5f5!important}.group:hover .apteva-prompt-icon-box{color:#2563eb!important;background-color:#dbeafe!important}.apteva-prompt-chevron{color:#a3a3a3!important}.group:hover .apteva-prompt-chevron{color:#3b82f6!important}@media (prefers-color-scheme:dark){.apteva-welcome-empty{color:#a3a3a3!important}.apteva-welcome-icon{color:#525252!important}.apteva-welcome-title{color:#fff!important}.apteva-welcome-subtitle{color:#a3a3a3!important}.apteva-prompt-card{background-color:#262626!important;border-color:#404040!important}.apteva-prompt-card:hover{background-color:#1f1f1f!important;border-color:#3b82f6!important}.apteva-prompt-text{color:#fff!important}.apteva-prompt-desc{color:#a3a3a3!important}.apteva-prompt-icon{color:#525252!important}.group:hover .apteva-prompt-icon{color:#60a5fa!important}.apteva-prompt-icon-box{color:#a3a3a3!important;background-color:#404040!important}.group:hover .apteva-prompt-icon-box{color:#60a5fa!important;background-color:#3b82f626!important}.apteva-prompt-chevron{color:#525252!important}.group:hover .apteva-prompt-chevron{color:#60a5fa!important}}.dark .apteva-welcome-empty{color:#a3a3a3!important}.dark .apteva-welcome-icon{color:#525252!important}.dark .apteva-welcome-title{color:#fff!important}.dark .apteva-welcome-subtitle{color:#a3a3a3!important}.dark .apteva-prompt-card{background-color:#262626!important;border-color:#404040!important}.dark .apteva-prompt-card:hover{background-color:#1f1f1f!important;border-color:#3b82f6!important}.dark .apteva-prompt-text{color:#fff!important}.dark .apteva-prompt-desc{color:#a3a3a3!important}.dark .apteva-prompt-icon{color:#525252!important}.dark .group:hover .apteva-prompt-icon{color:#60a5fa!important}.dark .apteva-prompt-icon-box{color:#a3a3a3!important;background-color:#404040!important}.dark .group:hover .apteva-prompt-icon-box{color:#60a5fa!important;background-color:#3b82f626!important}.dark .apteva-prompt-chevron{color:#525252!important}.dark .group:hover .apteva-prompt-chevron{color:#60a5fa!important}.apteva-message-segmented{display:flex!important;flex-direction:column!important;gap:.5rem!important;width:95%!important;max-width:95%!important}.apteva-message-segmented .apteva-message-bubble{width:-moz-fit-content!important;width:fit-content!important;max-width:100%!important}.apteva-tool-call-standalone,.apteva-widget-standalone{display:block!important}.apteva-widget{--aw-bg:#fff;--aw-bg-subtle:#fafafa;--aw-bg-muted:#f5f5f5;--aw-bg-input:#fafafa;--aw-border:#e5e5e5;--aw-border-focus:#3b82f6;--aw-text:#171717;--aw-text-heading:#171717;--aw-text-body:#525252;--aw-text-muted:#737373;--aw-text-placeholder:#a3a3a3;--aw-text-on-primary:#fff;--aw-primary:#3b82f6;--aw-primary-hover:#2563eb;--aw-hover-bg:#fafafa;--aw-danger:#ef4444;color:var(--aw-text)!important;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important;font-size:.875rem!important;line-height:1.5!important}@media (prefers-color-scheme:dark){.apteva-widget{--aw-bg:#171717;--aw-bg-subtle:#1a1a1a;--aw-bg-muted:#262626;--aw-bg-input:#262626;--aw-border:#333;--aw-border-focus:#3b82f6;--aw-text:#fafafa;--aw-text-heading:#fff;--aw-text-body:#a3a3a3;--aw-text-muted:#737373;--aw-text-placeholder:#525252;--aw-primary:#3b82f6;--aw-primary-hover:#60a5fa;--aw-hover-bg:#262626;--aw-danger:#f87171}}.dark .apteva-widget,.apteva-widget.apteva-dark{--aw-bg:#171717;--aw-bg-subtle:#1a1a1a;--aw-bg-muted:#262626;--aw-bg-input:#262626;--aw-border:#333;--aw-border-focus:#3b82f6;--aw-text:#fafafa;--aw-text-heading:#fff;--aw-text-body:#a3a3a3;--aw-text-muted:#737373;--aw-text-placeholder:#525252;--aw-primary:#3b82f6;--aw-primary-hover:#60a5fa;--aw-hover-bg:#262626;--aw-danger:#f87171}.apteva-widget *,.apteva-widget :before,.apteva-widget :after{box-sizing:border-box!important}.apteva-widget h1,.apteva-widget h2,.apteva-widget h3,.apteva-widget h4,.apteva-widget p,.apteva-widget ul,.apteva-widget ol,.apteva-widget li,.apteva-widget figure,.apteva-widget figcaption,.apteva-widget table,.apteva-widget caption,.apteva-widget th,.apteva-widget td{font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;margin:0!important;padding:0!important}.apteva-widget input,.apteva-widget select,.apteva-widget textarea,.apteva-widget button{font-family:inherit!important;font-size:inherit!important;line-height:inherit!important}.apteva-widget table{border-collapse:collapse!important;border-spacing:0!important}.apteva-widget img{display:block!important;max-width:100%!important}.apteva-widget>div,.apteva-widget>form,.apteva-widget>figure{background-color:var(--aw-bg)!important;border-color:var(--aw-border)!important;color:var(--aw-text)!important}.apteva-widget h3,.apteva-widget h4{color:var(--aw-text-heading)!important}.apteva-widget p,.apteva-widget label{color:var(--aw-text-body)!important}.apteva-widget span{color:inherit!important}.apteva-widget input,.apteva-widget select,.apteva-widget textarea{background-color:var(--aw-bg-input)!important;border-color:var(--aw-border)!important;color:var(--aw-text)!important}.apteva-widget input::placeholder,.apteva-widget textarea::placeholder{color:var(--aw-text-placeholder)!important}.apteva-widget input:focus,.apteva-widget select:focus,.apteva-widget textarea:focus{border-color:var(--aw-border-focus)!important}.apteva-widget .apteva-kpi-value{color:var(--aw-text-heading)!important}.apteva-widget thead tr{background-color:var(--aw-bg-muted)!important}.apteva-widget th{color:var(--aw-text-heading)!important}.apteva-widget td{color:var(--aw-text-body)!important}.apteva-widget caption{background-color:var(--aw-bg-muted)!important;color:var(--aw-text-body)!important}.apteva-widget tbody tr{border-color:var(--aw-border)!important}.apteva-widget .apteva-list-item:hover{background-color:var(--aw-hover-bg)!important}.apteva-widget button[type=submit]{background-color:var(--aw-primary)!important;color:var(--aw-text-on-primary)!important}.apteva-widget button[type=submit]:hover{background-color:var(--aw-primary-hover)!important}.apteva-widget .apteva-file-drop{border-color:var(--aw-border)!important;background-color:var(--aw-bg-muted)!important;color:var(--aw-text-muted)!important}.apteva-widget .apteva-file-drop:hover{border-color:var(--aw-primary)!important;color:var(--aw-primary)!important}.apteva-widget .apteva-file-item-row{background-color:var(--aw-bg-muted)!important;color:var(--aw-text-body)!important}.apteva-widget .apteva-file-remove-btn{color:var(--aw-text-muted)!important}.apteva-widget .apteva-file-remove-btn:hover{color:var(--aw-danger)!important}.apteva-widget .apteva-select-trigger,.apteva-widget .apteva-datepicker-trigger{background-color:var(--aw-bg-input)!important;border-color:var(--aw-border)!important;color:var(--aw-text)!important;cursor:pointer!important}.apteva-widget .apteva-select-trigger:hover,.apteva-widget .apteva-datepicker-trigger:hover{border-color:var(--aw-text-muted)!important}.apteva-widget .apteva-select-placeholder{color:var(--aw-text-placeholder)!important}.apteva-widget .apteva-select-value,.apteva-widget .apteva-datepicker-value{color:var(--aw-text)!important}.apteva-widget .apteva-select-chevron{color:var(--aw-text-muted)!important}.apteva-widget .apteva-select-dropdown,.apteva-widget .apteva-datepicker-dropdown{background-color:var(--aw-bg)!important;border-color:var(--aw-border)!important}.apteva-widget .apteva-select-option{color:var(--aw-text)!important;background-color:#0000!important}.apteva-widget .apteva-select-option:hover{background-color:var(--aw-bg-muted)!important}.apteva-widget .apteva-select-option-active{background-color:var(--aw-primary)!important;color:var(--aw-text-on-primary)!important}.apteva-widget .apteva-select-option-active:hover{background-color:var(--aw-primary-hover)!important}.apteva-widget .apteva-datepicker-dropdown{min-width:280px!important}.apteva-widget .apteva-datepicker-header{background-color:var(--aw-bg-muted)!important;border-bottom:1px solid var(--aw-border)!important}.apteva-widget .apteva-datepicker-title{color:var(--aw-text-heading)!important}.apteva-widget .apteva-datepicker-nav{color:var(--aw-text-muted)!important;cursor:pointer!important;background-color:#0000!important;border:none!important}.apteva-widget .apteva-datepicker-nav:hover{color:var(--aw-text)!important;background-color:var(--aw-bg-muted)!important}.apteva-widget .apteva-datepicker-daylabel{color:var(--aw-text-muted)!important}.apteva-widget .apteva-datepicker-day{color:var(--aw-text)!important;cursor:pointer!important;background-color:#0000!important;border:none!important}.apteva-widget .apteva-datepicker-day:hover{background-color:var(--aw-bg-muted)!important}.apteva-widget .apteva-datepicker-day-selected{background-color:var(--aw-primary)!important;color:var(--aw-text-on-primary)!important}.apteva-widget .apteva-datepicker-day-selected:hover{background-color:var(--aw-primary-hover)!important}.apteva-widget .apteva-datepicker-day-today{text-underline-offset:2px!important;text-decoration:underline!important;font-weight:700!important}.apteva-widget .apteva-field-label,.apteva-widget .apteva-checkbox span{color:var(--aw-text-body)!important}.apteva-widget-skeleton{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important}.apteva-widget-skeleton *{box-sizing:border-box!important}@media (prefers-color-scheme:dark){.apteva-message-timestamp-assistant{color:#525252!important}}.dark .apteva-message-timestamp-assistant{color:#525252!important}.apteva-tool-card{box-sizing:border-box!important;display:flex!important;border-style:solid!important;border-width:1px!important;border-radius:.75rem!important;align-items: center!important;gap:.5rem!important;padding:.5rem .75rem!important;font-size:.875rem!important}.apteva-tool-card-running{color:#1d4ed8!important;background-color:#eff6ff!important;border-color:#bfdbfe!important}.apteva-tool-card-completed{color:#15803d!important;background-color:#f0fdf4!important;border-color:#bbf7d0!important}.apteva-tool-card-error{color:#b91c1c!important;background-color:#fef2f2!important;border-color:#fecaca!important}@media (prefers-color-scheme:dark){.apteva-tool-card-running{color:#60a5fa!important;background-color:#3b82f61a!important;border-color:#3b82f64d!important}.apteva-tool-card-completed{color:#4ade80!important;background-color:#22c55e1a!important;border-color:#22c55e4d!important}.apteva-tool-card-error{color:#f87171!important;background-color:#ef44441a!important;border-color:#ef44444d!important}}.dark .apteva-tool-card-running{color:#60a5fa!important;background-color:#3b82f61a!important;border-color:#3b82f64d!important}.dark .apteva-tool-card-completed{color:#4ade80!important;background-color:#22c55e1a!important;border-color:#22c55e4d!important}.dark .apteva-tool-card-error{color:#f87171!important;background-color:#ef44441a!important;border-color:#ef44444d!important}.apteva-tool-icon{flex-shrink:0!important;width:1rem!important;height:1rem!important}.apteva-tool-icon-spin{animation:1s linear infinite apteva-spin!important}.apteva-tool-spinner-track{opacity:.25!important}.apteva-tool-spinner-fill{opacity:.75!important}.apteva-tool-label{font-size:inherit!important}.apteva-tool-label strong{font-weight:600!important}@keyframes apteva-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.apteva-tool-card-preparing{color:#92400e!important;background-color:#fef3c7!important;border-color:#fcd34d!important}@media (prefers-color-scheme:dark){.apteva-tool-card-preparing{color:#fbbf24!important;background-color:#fbbf2426!important;border-color:#fbbf2466!important}}.dark .apteva-tool-card-preparing{color:#fbbf24!important;background-color:#fbbf2426!important;border-color:#fbbf2466!important}@keyframes apteva-pulse-glow{0%,to{box-shadow:0 0 #fbbf2400}50%{box-shadow:0 0 8px 2px #fbbf2480}}.apteva-tool-receiving{animation:.4s ease-in-out apteva-pulse-glow!important}.apteva-tool-status-text{opacity:.7!important;font-weight:400!important}.apteva-tool-char-count{opacity:.6!important;font-variant-numeric:tabular-nums!important;font-size:.85em!important;font-weight:400!important}.apteva-tool-dots{display:inline-flex!important;margin-left:1px!important}.apteva-tool-dots span{opacity:.3!important;animation:1.4s ease-in-out infinite apteva-dot-pulse!important}.apteva-tool-dots span:first-child{animation-delay:0s!important}.apteva-tool-dots span:nth-child(2){animation-delay:.2s!important}.apteva-tool-dots span:nth-child(3){animation-delay:.4s!important}@keyframes apteva-dot-pulse{0%,60%,to{opacity:.3}30%{opacity:1}}.apteva-tool-stream-separator{opacity:.5!important}.apteva-tool-stream-output{opacity:.85!important;white-space:nowrap!important;text-overflow:ellipsis!important;vertical-align:bottom!important;display:inline-block!important;overflow:hidden!important;max-width:300px!important;font-weight:400!important}.apteva-tool-inline{display:flex!important;align-items: center!important;gap:0!important;width:100%!important;padding:.25rem 0!important}.apteva-tool-inline-line{background-color:#d4d4d4!important;flex:1!important;height:1px!important}.apteva-tool-inline-content{display:flex!important;flex-shrink:0!important;align-items: center!important;gap:.375rem!important;padding:0 .75rem!important}.apteva-tool-inline-icon{color:#7c3aed!important;flex-shrink:0!important;width:.875rem!important;height:.875rem!important}.apteva-tool-inline-text{color:#9ca3af!important;white-space:nowrap!important;font-size:.8125rem!important}@media (prefers-color-scheme:dark){.apteva-tool-inline-line{background-color:#404040!important}.apteva-tool-inline-icon{color:#a78bfa!important}.apteva-tool-inline-text{color:#6b7280!important}}.dark .apteva-tool-inline-line{background-color:#404040!important}.dark .apteva-tool-inline-icon{color:#a78bfa!important}.dark .apteva-tool-inline-text{color:#6b7280!important}.apteva-tool-group{overflow:hidden!important;border:1px solid!important;border-radius:.5rem!important;font-size:.8125rem!important}.apteva-tool-group-running{color:#1d4ed8!important;background-color:#eff6ff!important;border-color:#bfdbfe!important}.apteva-tool-group-completed{color:#15803d!important;background-color:#f0fdf4!important;border-color:#bbf7d0!important}.apteva-tool-group-error{color:#b91c1c!important;background-color:#fef2f2!important;border-color:#fecaca!important}.apteva-tool-group-header{color:inherit!important;font:inherit!important;cursor:pointer!important;display:flex!important;background:0 0!important;border:none!important;justify-content:space-between!important;align-items: center!important;width:100%!important;padding:.375rem .625rem!important}.apteva-tool-group-header:hover{opacity:.8!important}.apteva-tool-group-header-left{display:flex!important;align-items: center!important;gap:.375rem!important}.apteva-tool-group-icon{flex-shrink:0!important}.apteva-tool-group-status{font-weight:600!important}.apteva-tool-group-chevron{opacity:.6!important;flex-shrink:0!important;transition:transform .2s!important}.apteva-tool-group-chevron-open{transform:rotate(180deg)!important}.apteva-tool-group-stream{opacity:.8!important;white-space:nowrap!important;text-overflow:ellipsis!important;overflow:hidden!important;padding:0 .625rem .375rem!important;font-size:.75rem!important}.apteva-tool-group-stream-name{margin-right:.25rem!important;font-weight:600!important}.apteva-tool-group-list{display:flex!important;border-top:1px solid #00000014!important;flex-direction:column!important;gap:.125rem!important;padding:.25rem .625rem .375rem!important}.apteva-tool-group-item{display:flex!important;align-items: center!important;gap:.375rem!important;padding:.125rem 0!important;font-size:.75rem!important}.apteva-tool-group-item-icon{flex-shrink:0!important}.apteva-tool-group-item-done{color:#16a34a!important}.apteva-tool-group-item-error{color:#dc2626!important}.apteva-tool-group-item-spinner{opacity:.6!important;animation:.8s linear infinite apteva-tool-spin!important;border:2px solid!important;border-top-color:#0000!important;border-radius:50%!important;width:10px!important;height:10px!important}.apteva-tool-group-item-name{font-weight:500!important}.apteva-tool-group-item-stream{opacity:.7!important;white-space:nowrap!important;text-overflow:ellipsis!important;overflow:hidden!important;flex:1!important;min-width:0!important}@keyframes apteva-tool-spin{to{transform:rotate(360deg)}}@media (prefers-color-scheme:dark){.apteva-tool-group-running{color:#60a5fa!important;background-color:#3b82f61a!important;border-color:#3b82f64d!important}.apteva-tool-group-completed{color:#4ade80!important;background-color:#22c55e1a!important;border-color:#22c55e4d!important}.apteva-tool-group-error{color:#f87171!important;background-color:#ef44441a!important;border-color:#ef44444d!important}.apteva-tool-group-list{border-top-color:#ffffff1a!important}.apteva-tool-group-item-done{color:#4ade80!important}.apteva-tool-group-item-error{color:#f87171!important}}.dark .apteva-tool-group-running{color:#60a5fa!important;background-color:#3b82f61a!important;border-color:#3b82f64d!important}.dark .apteva-tool-group-completed{color:#4ade80!important;background-color:#22c55e1a!important;border-color:#22c55e4d!important}.dark .apteva-tool-group-error{color:#f87171!important;background-color:#ef44441a!important;border-color:#ef44444d!important}.dark .apteva-tool-group-list{border-top-color:#ffffff1a!important}.dark .apteva-tool-group-item-done{color:#4ade80!important}.dark .apteva-tool-group-item-error{color:#f87171!important}.apteva-composer{display:grid!important;position:relative!important;background-color:#fff!important;border:2px solid #d4d4d4!important;border-radius:1rem!important;gap:.5rem .75rem!important;padding:.5rem .75rem!important;transition:all .3s!important}.apteva-composer textarea{color:#171717!important;background-color:#0000!important}.apteva-composer textarea::placeholder{color:#a3a3a3!important}button.apteva-composer-menu-btn{color:#404040!important;background:0 0!important;border:none!important}button.apteva-composer-menu-btn:hover{background-color:#f5f5f5!important}.apteva-composer-menu{background-color:#262626!important}.apteva-composer-menu-item{color:#fff!important;background-color:#0000!important}.apteva-composer-menu-item:hover{background-color:#404040!important}.apteva-composer-menu-item-border{border-top:1px solid #404040!important}.apteva-composer-send-btn{color:#404040!important;background-color:#fff!important;border:1px solid #d4d4d4!important}.apteva-composer-send-btn svg{stroke:currentColor!important}.apteva-composer-stop-btn{all:unset!important;box-sizing:border-box!important;cursor:pointer!important;color:#dc2626!important;display:flex!important;background-color:#fef2f2!important;border:1px solid #f87171!important;border-radius:.5rem!important;flex-shrink:0!important;justify-content:center!important;align-items: center!important;width:2rem!important;height:2rem!important;margin:0!important;padding:0!important;transition:background-color .15s!important}.apteva-composer-stop-btn:hover{background-color:#fee2e2!important}.apteva-composer-stop-btn svg{fill:currentColor!important;width:14px!important;height:14px!important}@media (prefers-color-scheme:dark){.apteva-composer{background-color:#171717!important;border-color:#404040!important}.apteva-composer textarea{color:#fafafa!important}.apteva-composer textarea::placeholder{color:#525252!important}button.apteva-composer-menu-btn{color:#d4d4d4!important;background:0 0!important}button.apteva-composer-menu-btn:hover{background-color:#262626!important}.apteva-composer-send-btn{color:#d4d4d4!important;background-color:#262626!important;border-color:#404040!important}.apteva-composer-stop-btn{color:#f87171!important;background-color:#7f1d1d4d!important;border-color:#f87171!important}.apteva-composer-stop-btn:hover{background-color:#7f1d1d80!important}}.dark .apteva-composer{background-color:#171717!important;border-color:#404040!important}.dark .apteva-composer textarea{color:#fafafa!important}.dark .apteva-composer textarea::placeholder{color:#525252!important}.dark button.apteva-composer-menu-btn{color:#d4d4d4!important;background:0 0!important}.dark button.apteva-composer-menu-btn:hover{background-color:#262626!important}.dark .apteva-composer-send-btn{color:#d4d4d4!important;background-color:#262626!important;border-color:#404040!important}.dark .apteva-composer-stop-btn{color:#f87171!important;background-color:#7f1d1d4d!important;border-color:#f87171!important}.dark .apteva-composer-stop-btn:hover{background-color:#7f1d1d80!important}.apteva-file-preview{display:flex!important;flex-wrap:wrap!important;gap:.5rem!important;margin-bottom:.5rem!important}.apteva-file-item{all:unset!important;box-sizing:border-box!important;display:flex!important;position:relative!important;background-color:#f5f5f5!important;border:1px solid #e5e5e5!important;border-radius:.5rem!important;align-items: center!important;gap:.5rem!important;padding:.5rem .75rem!important;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif!important}.apteva-file-item:hover .apteva-file-remove{opacity:1!important}.apteva-file-thumb{object-fit:cover!important;border-radius:.25rem!important;flex-shrink:0!important;width:2rem!important;height:2rem!important}.apteva-file-icon{color:#737373!important;display:flex!important;background-color:#e5e5e5!important;border-radius:.25rem!important;flex-shrink:0!important;justify-content:center!important;align-items: center!important;width:2rem!important;height:2rem!important}.apteva-file-icon svg{width:1rem!important;height:1rem!important}.apteva-file-info{display:flex!important;flex-direction:column!important;min-width:0!important}.apteva-file-name{color:#404040!important;text-overflow:ellipsis!important;white-space:nowrap!important;overflow:hidden!important;max-width:120px!important;font-size:.75rem!important;font-weight:500!important}.apteva-file-size{color:#737373!important;font-size:.75rem!important}.apteva-file-remove{all:unset!important;box-sizing:border-box!important;color:#fff!important;opacity:0!important;cursor:pointer!important;display:flex!important;position:absolute!important;background-color:#737373!important;border-radius:50%!important;justify-content:center!important;align-items: center!important;width:1.25rem!important;height:1.25rem!important;transition:opacity .15s,background-color .15s!important;top:-.375rem!important;right:-.375rem!important}.apteva-file-remove:hover{background-color:#ef4444!important}.apteva-file-remove svg{width:.75rem!important;height:.75rem!important}.apteva-file-error{all:unset!important;box-sizing:border-box!important;z-index:20!important;position:absolute!important;background-color:#fef2f2!important;border:1px solid #fecaca!important;border-radius:.5rem!important;margin-bottom:.5rem!important;padding:.75rem!important;bottom:100%!important;left:1rem!important;right:1rem!important}.apteva-file-error-content{color:#b91c1c!important;display:flex!important;align-items: center!important;gap:.5rem!important;font-size:.875rem!important}.apteva-file-error-content svg{flex-shrink:0!important;width:1rem!important;height:1rem!important}@media (prefers-color-scheme:dark){.apteva-file-item{background-color:#262626!important;border-color:#404040!important}.apteva-file-icon{color:#a3a3a3!important;background-color:#404040!important}.apteva-file-name{color:#d4d4d4!important}.apteva-file-size{color:#a3a3a3!important}.apteva-file-error{background-color:#7f1d1d4d!important;border-color:#f87171!important}.apteva-file-error-content{color:#fca5a5!important}}.dark .apteva-file-item{background-color:#262626!important;border-color:#404040!important}.dark .apteva-file-icon{color:#a3a3a3!important;background-color:#404040!important}.dark .apteva-file-name{color:#d4d4d4!important}.dark .apteva-file-size{color:#a3a3a3!important}.dark .apteva-file-error{background-color:#7f1d1d4d!important;border-color:#f87171!important}.dark .apteva-file-error-content{color:#fca5a5!important}.apteva-file-badges{display:flex!important;flex-shrink:0!important;align-items: center!important;gap:.25rem!important}.apteva-file-badge{all:unset!important;box-sizing:border-box!important;display:flex!important;position:relative!important;overflow:hidden!important;background-color:#f5f5f5!important;border-radius:.25rem!important;justify-content:center!important;align-items: center!important;width:1.5rem!important;height:1.5rem!important}.apteva-file-badge:hover .apteva-file-badge-remove{opacity:1!important}.apteva-file-badge-img{object-fit:cover!important;width:1.5rem!important;height:1.5rem!important}.apteva-file-badge-icon{color:#737373!important;font-size:.75rem!important}.apteva-file-badge-icon svg{width:1rem!important;height:1rem!important}.apteva-file-badge-remove{all:unset!important;box-sizing:border-box!important;opacity:0!important;cursor:pointer!important;display:flex!important;position:absolute!important;background-color:#00000080!important;justify-content:center!important;align-items: center!important;transition:opacity .15s!important;inset:0!important}.apteva-file-badge-remove svg{color:#fff!important;width:.75rem!important;height:.75rem!important}@media (prefers-color-scheme:dark){.apteva-file-badge{background-color:#262626!important}.apteva-file-badge-icon{color:#a3a3a3!important}}.dark .apteva-file-badge{background-color:#262626!important}.dark .apteva-file-badge-icon{color:#a3a3a3!important}.apteva-composer-textarea{-ms-overflow-style:none!important;scrollbar-width:none!important}.apteva-composer-textarea::-webkit-scrollbar{display:none!important}.apteva-composer-mic-btn{all:unset!important;box-sizing:border-box!important;cursor:pointer!important;color:#737373!important;display:flex!important;background-color:#0000!important;border-radius:.5rem!important;flex-shrink:0!important;justify-content:center!important;align-items: center!important;width:2rem!important;height:2rem!important;transition:all .15s!important}.apteva-composer-mic-btn:hover{color:#3b82f6!important;background-color:#3b82f614!important}.apteva-composer-mic-btn:disabled{opacity:.3!important;cursor:not-allowed!important}.apteva-composer-mic-btn svg{width:16px!important;height:16px!important}.apteva-composer-rec-dot{display:flex!important;justify-content:center!important;align-items: center!important;width:2rem!important;height:2rem!important}.apteva-composer-rec-dot span{animation:1.2s ease-in-out infinite apteva-rec-pulse!important;display:block!important;background-color:#ef4444!important;border-radius:50%!important;width:10px!important;height:10px!important}@keyframes apteva-rec-pulse{0%,to{opacity:1;transform:scale(1);box-shadow:0 0 #ef444466}50%{opacity:.8;transform:scale(1.15);box-shadow:0 0 8px 3px #ef44444d}}.apteva-composer-waveform{display:flex!important;overflow:hidden!important;align-items: center!important;gap:.75rem!important;height:32px!important}.apteva-composer-waveform-canvas{display:block!important;flex:1!important;min-width:0!important;height:32px!important}.apteva-composer-recording-timer{font-variant-numeric:tabular-nums!important;color:#ef4444!important;text-align:right!important;flex-shrink:0!important;min-width:3rem!important;font-size:.8125rem!important;font-weight:500!important}.apteva-transcript-flash{z-index:20!important;animation:.3s ease-out apteva-flash-in!important;position:absolute!important;background-color:#eff6ff!important;border:1px solid #bfdbfe!important;border-radius:.75rem!important;margin-bottom:.5rem!important;padding:.625rem 1rem!important;bottom:100%!important;left:1rem!important;right:1rem!important}.apteva-transcript-flash span{color:#1d4ed8!important;font-size:.875rem!important;font-style:italic!important}@keyframes apteva-flash-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media (prefers-color-scheme:dark){.apteva-composer-mic-btn{color:#a3a3a3!important}.apteva-composer-mic-btn:hover{color:#60a5fa!important;background-color:#60a5fa1a!important}.apteva-transcript-flash{background-color:#3b82f626!important;border-color:#3b82f64d!important}.apteva-transcript-flash span{color:#93c5fd!important}}.dark .apteva-composer-mic-btn{color:#a3a3a3!important}.dark .apteva-composer-mic-btn:hover{color:#60a5fa!important;background-color:#60a5fa1a!important}.dark .apteva-transcript-flash{background-color:#3b82f626!important;border-color:#3b82f64d!important}.dark .apteva-transcript-flash span{color:#93c5fd!important}.apteva-chat-terminal .apteva-composer-mic-btn{color:#666!important}.apteva-chat-terminal .apteva-composer-mic-btn:hover{color:#f97316!important;background-color:#f973161a!important}.apteva-chat{background-color:#fff!important}.apteva-chat-header{background-color:#fff!important;border-color:#e5e5e5!important}.apteva-message-list{background-color:#f5f5f5!important}@media (prefers-color-scheme:dark){.apteva-chat{background-color:#0a0a0a!important}.apteva-chat-header{background-color:#171717!important;border-color:#262626!important}.apteva-message-list{background-color:#0a0a0a!important}}.dark .apteva-chat,.apteva-chat.dark{background-color:#0a0a0a!important}.dark .apteva-chat-header,.apteva-chat.dark .apteva-chat-header{background-color:#171717!important;border-color:#262626!important}.dark .apteva-message-list,.apteva-chat.dark .apteva-message-list,.apteva-force-dark.apteva-chat{background-color:#0a0a0a!important}.apteva-chat.apteva-force-dark .apteva-chat-header{background-color:#171717!important;border-color:#262626!important}.apteva-chat.apteva-force-dark .apteva-chat-title{color:#fff!important}.apteva-chat.apteva-force-dark .apteva-chat-status-ready,.apteva-chat.apteva-force-dark .apteva-chat-status-thinking{color:#525252!important}.apteva-chat.apteva-force-dark .apteva-chat-status-tool{color:#60a5fa!important}.apteva-chat.apteva-force-dark .apteva-message-list{background-color:#0a0a0a!important}.apteva-chat.apteva-force-dark .apteva-message-assistant{color:#fafafa!important;background-color:#262626!important}.apteva-chat.apteva-force-dark .apteva-message-timestamp-assistant{color:#525252!important}.apteva-chat.apteva-force-dark .apteva-composer{background-color:#171717!important;border-color:#404040!important}.apteva-chat.apteva-force-dark .apteva-composer textarea{color:#fafafa!important}.apteva-chat.apteva-force-dark .apteva-composer textarea::placeholder{color:#525252!important}.apteva-chat.apteva-force-dark .apteva-composer-send-btn{color:#d4d4d4!important;background-color:#262626!important;border-color:#404040!important}.apteva-chat.apteva-force-dark .apteva-composer-stop-btn{color:#f87171!important;background-color:#7f1d1d4d!important;border-color:#f87171!important}.apteva-chat.apteva-force-dark button.apteva-composer-menu-btn{background:0 0!important}.apteva-chat.apteva-force-dark .apteva-composer-mic-btn{color:#a3a3a3!important}.apteva-chat.apteva-force-dark .apteva-composer-mic-btn:hover{color:#60a5fa!important;background-color:#60a5fa1a!important}.apteva-chat.apteva-force-dark .apteva-file-item{background-color:#262626!important;border-color:#404040!important}.apteva-chat.apteva-force-dark .apteva-file-icon{color:#a3a3a3!important;background-color:#404040!important}.apteva-chat.apteva-force-dark .apteva-file-name{color:#d4d4d4!important}.apteva-chat.apteva-force-dark .apteva-file-size{color:#a3a3a3!important}.apteva-chat.apteva-force-dark .apteva-transcript-flash{background-color:#3b82f626!important;border-color:#3b82f64d!important}.apteva-chat.apteva-force-dark .apteva-transcript-flash span{color:#93c5fd!important}.apteva-chat.apteva-force-dark .apteva-widget,.apteva-widget.apteva-force-dark{--aw-bg:#171717;--aw-bg-subtle:#1a1a1a;--aw-bg-muted:#262626;--aw-bg-input:#262626;--aw-border:#333;--aw-border-focus:#3b82f6;--aw-text:#fafafa;--aw-text-heading:#fff;--aw-text-body:#a3a3a3;--aw-text-muted:#737373;--aw-text-placeholder:#525252;--aw-primary:#3b82f6;--aw-primary-hover:#60a5fa;--aw-hover-bg:#262626;--aw-danger:#f87171}.apteva-chat.apteva-force-dark .apteva-tool-card-running{color:#60a5fa!important;background-color:#3b82f61a!important;border-color:#3b82f64d!important}.apteva-chat.apteva-force-dark .apteva-tool-card-completed{color:#4ade80!important;background-color:#22c55e1a!important;border-color:#22c55e4d!important}.apteva-chat.apteva-force-dark .apteva-tool-card-error{color:#f87171!important;background-color:#ef44441a!important;border-color:#ef44444d!important}.apteva-chat.apteva-force-dark .apteva-tool-card-preparing{color:#fbbf24!important;background-color:#fbbf2426!important;border-color:#fbbf2466!important}.apteva-chat.apteva-force-dark .apteva-tool-inline-line{background-color:#404040!important}.apteva-chat.apteva-force-dark .apteva-tool-inline-icon{color:#a78bfa!important}.apteva-chat.apteva-force-dark .apteva-tool-inline-text{color:#6b7280!important}.apteva-chat.apteva-force-dark .apteva-file-badge{background-color:#262626!important}.apteva-chat.apteva-force-dark .apteva-file-badge-icon,.apteva-chat.apteva-force-dark .apteva-welcome-empty{color:#a3a3a3!important}.apteva-chat.apteva-force-dark .apteva-welcome-icon{color:#525252!important}.apteva-chat.apteva-force-dark .apteva-welcome-title{color:#fff!important}.apteva-chat.apteva-force-dark .apteva-welcome-subtitle{color:#a3a3a3!important}.apteva-chat.apteva-force-dark .apteva-prompt-card{background-color:#262626!important;border-color:#404040!important}.apteva-chat.apteva-force-dark .apteva-prompt-card:hover{background-color:#1f1f1f!important;border-color:#3b82f6!important}.apteva-chat.apteva-force-dark .apteva-prompt-text{color:#fff!important}.apteva-chat.apteva-force-dark .apteva-prompt-desc{color:#a3a3a3!important}.apteva-chat.apteva-force-dark .apteva-prompt-icon-box{color:#a3a3a3!important;background-color:#404040!important}.apteva-chat.apteva-force-dark .group:hover .apteva-prompt-icon-box{color:#60a5fa!important;background-color:#3b82f626!important}.apteva-force-light.apteva-chat{background-color:#fff!important}.apteva-chat.apteva-force-light .apteva-chat-header{background-color:#fff!important;border-color:#e5e5e5!important}.apteva-chat.apteva-force-light .apteva-chat-title{color:#111827!important}.apteva-chat.apteva-force-light .apteva-chat-status-ready,.apteva-chat.apteva-force-light .apteva-chat-status-thinking{color:#737373!important}.apteva-chat.apteva-force-light .apteva-chat-status-tool{color:#3b82f6!important}.apteva-chat.apteva-force-light .apteva-message-list{background-color:#fff!important}.apteva-chat.apteva-force-light .apteva-message-user{color:#fff!important;background-color:#2563eb!important}.apteva-chat.apteva-force-light .apteva-message-assistant{color:#0a0a0a!important;background-color:#fff!important;border:1px solid #e5e7eb!important}.apteva-chat.apteva-force-light .apteva-message-timestamp-user{color:#bfdbfe!important}.apteva-chat.apteva-force-light .apteva-message-timestamp-assistant{color:#737373!important}.apteva-chat.apteva-force-light .apteva-composer{background-color:#fff!important;border-color:#d4d4d4!important}.apteva-chat.apteva-force-light .apteva-composer textarea{color:#171717!important}.apteva-chat.apteva-force-light .apteva-composer textarea::placeholder{color:#a3a3a3!important}.apteva-chat.apteva-force-light .apteva-composer-send-btn{color:#404040!important;background-color:#fff!important;border-color:#d4d4d4!important}.apteva-chat.apteva-force-light .apteva-composer-stop-btn{color:#dc2626!important;background-color:#fef2f2!important;border-color:#f87171!important}.apteva-chat.apteva-force-light button.apteva-composer-menu-btn{color:#404040!important;background:0 0!important}.apteva-chat.apteva-force-light button.apteva-composer-menu-btn:hover{background-color:#f5f5f5!important}.apteva-chat.apteva-force-light .apteva-composer-menu{background-color:#fff!important;border:1px solid #e5e5e5!important}.apteva-chat.apteva-force-light .apteva-composer-menu-item{color:#171717!important}.apteva-chat.apteva-force-light .apteva-composer-menu-item:hover{background-color:#f5f5f5!important}.apteva-chat.apteva-force-light .apteva-composer-menu-item-border{border-top-color:#e5e5e5!important}.apteva-chat.apteva-force-light .apteva-composer-mic-btn{color:#737373!important}.apteva-chat.apteva-force-light .apteva-composer-mic-btn:hover{color:#3b82f6!important;background-color:#3b82f614!important}.apteva-chat.apteva-force-light .apteva-file-item{background-color:#f5f5f5!important;border-color:#e5e5e5!important}.apteva-chat.apteva-force-light .apteva-file-icon{color:#737373!important;background-color:#e5e5e5!important}.apteva-chat.apteva-force-light .apteva-file-name{color:#404040!important}.apteva-chat.apteva-force-light .apteva-file-size{color:#737373!important}.apteva-chat.apteva-force-light .apteva-transcript-flash{background-color:#eff6ff!important;border-color:#bfdbfe!important}.apteva-chat.apteva-force-light .apteva-transcript-flash span{color:#1d4ed8!important}.apteva-chat.apteva-force-light .apteva-widget,.apteva-widget.apteva-force-light{--aw-bg:#fff;--aw-bg-subtle:#fafafa;--aw-bg-muted:#f5f5f5;--aw-bg-input:#fafafa;--aw-border:#e5e5e5;--aw-border-focus:#3b82f6;--aw-text:#171717;--aw-text-heading:#171717;--aw-text-body:#525252;--aw-text-muted:#737373;--aw-text-placeholder:#a3a3a3;--aw-primary:#3b82f6;--aw-primary-hover:#2563eb;--aw-hover-bg:#fafafa;--aw-danger:#ef4444}.apteva-chat.apteva-force-light .apteva-tool-card-running{color:#1d4ed8!important;background-color:#eff6ff!important;border-color:#bfdbfe!important}.apteva-chat.apteva-force-light .apteva-tool-card-completed{color:#15803d!important;background-color:#f0fdf4!important;border-color:#bbf7d0!important}.apteva-chat.apteva-force-light .apteva-tool-card-error{color:#b91c1c!important;background-color:#fef2f2!important;border-color:#fecaca!important}.apteva-chat.apteva-force-light .apteva-tool-card-preparing{color:#92400e!important;background-color:#fef3c7!important;border-color:#fcd34d!important}.apteva-chat.apteva-force-light .apteva-tool-inline-line{background-color:#d4d4d4!important}.apteva-chat.apteva-force-light .apteva-tool-inline-icon{color:#7c3aed!important}.apteva-chat.apteva-force-light .apteva-tool-inline-text{color:#9ca3af!important}.apteva-chat.apteva-force-light .apteva-file-badge{background-color:#f5f5f5!important}.apteva-chat.apteva-force-light .apteva-file-badge-icon,.apteva-chat.apteva-force-light .apteva-welcome-empty{color:#737373!important}.apteva-chat.apteva-force-light .apteva-welcome-icon{color:#a3a3a3!important}.apteva-chat.apteva-force-light .apteva-welcome-title{color:#111827!important}.apteva-chat.apteva-force-light .apteva-welcome-subtitle{color:#737373!important}.apteva-chat.apteva-force-light .apteva-prompt-card{background-color:#fff!important;border-color:#e5e5e5!important}.apteva-chat.apteva-force-light .apteva-prompt-card:hover{background-color:#fafafa!important;border-color:#93c5fd!important}.apteva-chat.apteva-force-light .apteva-prompt-text{color:#111827!important}.apteva-chat.apteva-force-light .apteva-prompt-desc{color:#737373!important}.apteva-chat.apteva-force-light .apteva-prompt-icon-box{color:#737373!important;background-color:#f5f5f5!important}.apteva-chat.apteva-force-light .group:hover .apteva-prompt-icon-box{color:#2563eb!important;background-color:#dbeafe!important}@keyframes apteva-slide-in{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes apteva-highlight-fade{0%{background-color:#3b82f626}to{background-color:#0000}}.apteva-list-item-new,.apteva-table-row-new{animation:.3s ease-out apteva-slide-in,.5s ease-out .3s apteva-highlight-fade!important}.apteva-table-row-new td{background-color:#3b82f61a!important}.apteva-list-streaming,.apteva-table-streaming{border-top:1px dashed #8080804d!important}@media (prefers-color-scheme:dark){.apteva-list-item-new,.apteva-table-row-new{animation:.3s ease-out apteva-slide-in,.5s ease-out .3s apteva-highlight-fade-dark!important}.apteva-table-row-new td{background-color:#3b82f626!important}}.dark .apteva-list-item-new,.dark .apteva-table-row-new{animation:.3s ease-out apteva-slide-in,.5s ease-out .3s apteva-highlight-fade-dark!important}.dark .apteva-table-row-new td{background-color:#3b82f626!important}@keyframes apteva-highlight-fade-dark{0%{background-color:#3b82f633}to{background-color:#0000}}.apteva-chat-minimal{background-color:#0000!important}.apteva-chat-minimal .apteva-chat-header{background-color:#0000!important;border:none!important}.apteva-chat-minimal .apteva-message-list{background-color:#0000!important}.apteva-chat-minimal .apteva-composer{background-color:#0000!important;border:1px solid #80808033!important}.apteva-chat-minimal .apteva-message-assistant{background-color:#80808014!important}.apteva-chat-minimal .apteva-message-user{color:inherit!important;background-color:#3b82f626!important}.apteva-chat-terminal{background-color:#0a0a0a!important;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace!important}.apteva-chat-terminal *{font-family:inherit!important}.apteva-chat-terminal .apteva-chat-header,.apteva-chat-terminal.apteva-force-dark .apteva-chat-header{background-color:#0a0a0a!important;border-color:#1a1a1a!important}.apteva-chat-terminal .apteva-chat-title,.apteva-chat-terminal.apteva-force-dark .apteva-chat-title{color:#e0e0e0!important;font-size:.875rem!important}.apteva-chat-terminal .apteva-chat-status,.apteva-chat-terminal.apteva-force-dark .apteva-chat-status{color:#666!important}.apteva-chat-terminal .apteva-chat-status-tool,.apteva-chat-terminal.apteva-force-dark .apteva-chat-status-tool{color:#f97316!important}.apteva-chat-terminal .apteva-message-list,.apteva-chat-terminal.apteva-force-dark .apteva-message-list{background-color:#0a0a0a!important}.apteva-chat-terminal .apteva-message-user,.apteva-chat-terminal.apteva-force-dark .apteva-message-user{color:#e0e0e0!important;background-color:#1a1a1a!important;border-radius:4px!important}.apteva-chat-terminal .apteva-message-assistant,.apteva-chat-terminal.apteva-force-dark .apteva-message-assistant{color:#e0e0e0!important;background-color:#111!important;border:1px solid #1a1a1a!important;border-radius:4px!important}.apteva-chat-terminal .apteva-message-timestamp,.apteva-chat-terminal.apteva-force-dark .apteva-message-timestamp-assistant{color:#444!important}.apteva-chat-terminal .apteva-message-timestamp-user{color:#666!important}.apteva-chat-terminal .apteva-composer,.apteva-chat-terminal.apteva-force-dark .apteva-composer{background-color:#111!important;border:1px solid #1a1a1a!important;border-radius:4px!important}.apteva-chat-terminal .apteva-composer textarea,.apteva-chat-terminal.apteva-force-dark .apteva-composer textarea{color:#e0e0e0!important}.apteva-chat-terminal .apteva-composer textarea::placeholder,.apteva-chat-terminal.apteva-force-dark .apteva-composer textarea::placeholder{color:#666!important}.apteva-chat-terminal .apteva-composer-send-btn,.apteva-chat-terminal.apteva-force-dark .apteva-composer-send-btn{color:#888!important;background-color:#1a1a1a!important;border-color:#333!important}.apteva-chat-terminal .apteva-composer-send-btn:hover{color:#f97316!important;border-color:#f97316!important}.apteva-chat-terminal .apteva-composer-stop-btn{color:#f97316!important;background-color:#f9731626!important;border-color:#f97316!important}.apteva-chat-terminal .apteva-composer-menu-btn{color:#666!important}.apteva-chat-terminal .apteva-composer-menu-btn:hover{color:#f97316!important;background-color:#1a1a1a!important}.apteva-chat-terminal .apteva-tool-card,.apteva-chat-terminal .apteva-tool-group{border-radius:4px!important}.apteva-chat-terminal .apteva-tool-card-running{color:#f97316!important;background-color:#f973161a!important;border-color:#f973164d!important}.apteva-chat-terminal .apteva-tool-card-completed{color:#4ade80!important;background-color:#22c55e1a!important;border-color:#22c55e4d!important}.apteva-chat-terminal .apteva-tool-card-preparing,.apteva-chat-terminal .apteva-tool-group-running{color:#f97316!important;background-color:#f973161a!important;border-color:#f973164d!important}.apteva-chat-terminal .apteva-tool-group-completed{color:#4ade80!important;background-color:#22c55e1a!important;border-color:#22c55e4d!important}.apteva-chat-terminal .apteva-tool-group-error{color:#f87171!important;background-color:#ef44441a!important;border-color:#ef44444d!important}.apteva-chat-terminal .apteva-tool-group-list{border-top-color:#ffffff1a!important}.apteva-chat-terminal .apteva-tool-group-item-done{color:#4ade80!important}.apteva-chat-terminal .apteva-tool-group-item-error{color:#f87171!important}.apteva-chat-terminal .apteva-md-link{color:#f97316!important}.apteva-chat-terminal .apteva-md-link:hover{color:#fb923c!important}.apteva-chat-terminal .apteva-md-inline-code{color:#3b82f6!important;background-color:#1a1a1a!important}}
@@ -1,4 +0,0 @@
1
- import{F as o,k as p,l as t}from"./App.qzbx5wtj.js";import{N as Xq,O as D}from"./App.9epx6785.js";import{U as E}from"./App.drwb57jq.js";import{$ as Zq,X as r,aa as zq,ja as V,ma as i,oa as Qq}from"./App.tpmp9020.js";var H=r(Zq(),1);var q=r(zq(),1);function bq(){let{projectsEnabled:z,metaAgentEnabled:Z}=i(),[J,B]=H.useState("general"),R=[{key:"general",label:"General"},{key:"providers",label:"Providers"},...z?[{key:"projects",label:"Projects"}]:[],...Z?[{key:"assistant",label:"Assistant"}]:[],{key:"channels",label:"Channels"},{key:"api-keys",label:"API Keys"},{key:"account",label:"Account"},{key:"updates",label:"Updates"},{key:"data",label:"Data"}];return q.jsxDEV("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[q.jsxDEV("div",{className:"md:hidden border-b border-[var(--color-border)] bg-[var(--color-bg)]",children:q.jsxDEV("div",{className:"flex overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:R.map((X)=>q.jsxDEV("button",{onClick:()=>B(X.key),className:`flex-shrink-0 px-4 py-3 text-sm font-medium border-b-2 transition ${J===X.key?"border-[var(--color-accent)] text-[var(--color-accent)]":"border-transparent text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]"}`,children:X.label},X.key,!1,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("div",{className:"hidden md:block w-48 border-r border-[var(--color-border)] p-4 flex-shrink-0",children:[q.jsxDEV("h2",{className:"text-sm font-medium text-[var(--color-text-muted)] uppercase tracking-wider mb-3",children:"Settings"},void 0,!1,void 0,this),q.jsxDEV("nav",{className:"space-y-1",children:R.map((X)=>q.jsxDEV($q,{label:X.label,active:J===X.key,onClick:()=>B(X.key)},X.key,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex-1 overflow-auto p-4 md:p-6",children:[J==="general"&&q.jsxDEV(Gq,{},void 0,!1,void 0,this),J==="providers"&&q.jsxDEV(Jq,{},void 0,!1,void 0,this),J==="projects"&&z&&q.jsxDEV(Wq,{},void 0,!1,void 0,this),J==="channels"&&q.jsxDEV(Rq,{},void 0,!1,void 0,this),J==="api-keys"&&q.jsxDEV(Nq,{},void 0,!1,void 0,this),J==="account"&&q.jsxDEV(Uq,{},void 0,!1,void 0,this),J==="updates"&&q.jsxDEV(Bq,{},void 0,!1,void 0,this),J==="data"&&q.jsxDEV(Oq,{},void 0,!1,void 0,this),J==="assistant"&&Z&&q.jsxDEV(Tq,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $q({label:z,active:Z,onClick:J}){return q.jsxDEV("button",{onClick:J,className:`w-full text-left px-3 py-2 rounded text-sm transition ${Z?"bg-[var(--color-surface-raised)] text-[var(--color-text)]":"text-[var(--color-text-muted)] hover:bg-[var(--color-surface)] hover:text-[var(--color-text-secondary)]"}`,children:z},void 0,!1,void 0,this)}function Gq(){let{authFetch:z}=V(),{mode:Z,setMode:J}=Qq(),[B,R]=H.useState(""),[X,U]=H.useState(!0),[L,O]=H.useState(!1),[W,M]=H.useState(null);H.useEffect(()=>{(async()=>{try{let b=await(await z("/api/settings/instance-url")).json();R(b.instance_url||"")}catch{}U(!1)})()},[]);let A=async()=>{O(!0),M(null);try{let $=await z("/api/settings/instance-url",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({instance_url:B})}),Q=await $.json();if($.ok)R(Q.instance_url||""),M({type:"success",text:"Instance URL saved"});else M({type:"error",text:Q.error||"Failed to save"})}catch{M({type:"error",text:"Failed to save"})}O(!1)};return q.jsxDEV("div",{className:"max-w-4xl w-full",children:[q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"General"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"Instance configuration and appearance."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4 mb-4",children:[q.jsxDEV("h3",{className:"font-medium mb-2",children:"Theme"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:"Choose your preferred color scheme. Auto follows your operating system setting."},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-3",children:[{value:"auto",label:"Auto",description:"Follow system preference"},{value:"dark",label:"Dark",description:"Dark background"},{value:"light",label:"Light",description:"Light background"}].map(($)=>q.jsxDEV("button",{onClick:()=>J($.value),className:`flex-1 max-w-[160px] px-4 py-3 rounded-lg border text-left transition ${Z===$.value?"border-[var(--color-accent)] bg-[var(--color-accent-10)]":"border-[var(--color-border-light)] bg-[var(--color-bg)] hover:border-[var(--color-scrollbar)]"}`,children:[q.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[q.jsxDEV("div",{className:`w-4 h-4 rounded-full border-2 flex items-center justify-center ${Z===$.value?"border-[var(--color-accent)]":"border-[var(--color-scrollbar)]"}`,children:Z===$.value&&q.jsxDEV("div",{className:"w-2 h-2 rounded-full bg-[var(--color-accent)]"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-sm font-medium",children:$.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] ml-6",children:$.description},void 0,!1,void 0,this)]},$.value,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4",children:[q.jsxDEV("h3",{className:"font-medium mb-2",children:"Instance URL"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:"The public HTTPS URL for this instance. Used for webhook callbacks from external services like Composio."},void 0,!1,void 0,this),X?q.jsxDEV("div",{className:"text-[var(--color-text-muted)] text-sm",children:"Loading..."},void 0,!1,void 0,this):q.jsxDEV("div",{className:"space-y-3 max-w-lg",children:[q.jsxDEV("input",{type:"text",value:B,onChange:($)=>R($.target.value),placeholder:"https://your-domain.com",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)] font-mono text-sm"},void 0,!1,void 0,this),W&&q.jsxDEV("div",{className:`p-3 rounded text-sm ${W.type==="success"?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:W.text},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:A,disabled:L,className:"px-4 py-2 bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black rounded text-sm font-medium transition",children:L?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Jq(){let{authFetch:z}=V(),{projects:Z,projectsEnabled:J}=i(),[B,R]=H.useState([]),[X,U]=H.useState(null),[L,O]=H.useState(""),[W,M]=H.useState(""),[A,T]=H.useState(!1),[$,Q]=H.useState(!1),[b,N]=H.useState(null),[w,K]=H.useState(null),{confirm:F,ConfirmDialog:g}=D(),C=async()=>{let P=await(await z("/api/providers")).json();R(P.providers||[])};H.useEffect(()=>{C()},[]);let S=async()=>{if(!X||!L)return;T(!0),N(null),K(null);let _=L;if(X==="browserbase"&&W)_=JSON.stringify({api_key:L,project_id:W});try{Q(!0);let u=await(await z(`/api/keys/${X}/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:_})})).json();if(Q(!1),!u.valid){N(u.error||"API key is invalid"),T(!1);return}let l=await z(`/api/keys/${X}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:_})}),h=await l.json();if(!l.ok)N(h.error||"Failed to save key");else{let d="API key saved!";if(h.restartedAgents&&h.restartedAgents.length>0){let m=h.restartedAgents.filter((x)=>x.success).length;if(h.restartedAgents.length-m===0)d+=` Restarted ${m} agent${m>1?"s":""} with new key.`;else d+=` Restarted ${m}/${h.restartedAgents.length} agents.`}K(d),O(""),M(""),U(null),C()}}catch(P){N("Failed to save key")}T(!1)},f=async(_)=>{if(!await F("Are you sure you want to remove this API key?",{confirmText:"Remove",title:"Remove API Key"}))return;await z(`/api/keys/${_}`,{method:"DELETE"}),C()},G=B.filter((_)=>_.type==="llm"),Y=B.filter((_)=>_.type==="integration"),k=B.filter((_)=>_.type==="browser"),y=G.filter((_)=>_.hasKey).length,c=Y.filter((_)=>_.hasKey).length,n=k.filter((_)=>_.hasKey).length;return H.useEffect(()=>{if(w&&!X){let _=setTimeout(()=>K(null),5000);return()=>clearTimeout(_)}},[w,X]),q.jsxDEV(q.Fragment,{children:[g,q.jsxDEV("div",{className:"space-y-10",children:[w&&!X&&q.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center justify-between",children:[q.jsxDEV("div",{className:"flex items-center gap-2 text-green-400",children:[q.jsxDEV(p,{className:"w-5 h-5"},void 0,!1,void 0,this),q.jsxDEV("span",{children:w},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>K(null),className:"text-green-400 hover:text-green-300",children:q.jsxDEV(t,{className:"w-4 h-4"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"AI Providers"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:["Manage your API keys for AI providers. ",y," of ",G.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:G.map((_)=>q.jsxDEV(Lq,{provider:_,isEditing:X===_.id,apiKey:L,saving:A,testing:$,error:X===_.id?b:null,success:X===_.id?w:null,onStartEdit:()=>{U(_.id),N(null),K(null)},onCancelEdit:()=>{U(null),O(""),N(null)},onApiKeyChange:O,onSave:S,onDelete:()=>f(_.id)},_.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("h2",{className:"text-xl font-semibold mb-1",children:"MCP Integrations"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:["Connect to MCP gateways for tool integrations. ",c," of ",Y.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:Y.map((_)=>q.jsxDEV(Hq,{provider:_,isEditing:X===_.id,apiKey:L,saving:A,testing:$,error:X===_.id?b:null,success:X===_.id?w:null,onStartEdit:()=>{U(_.id),N(null),K(null)},onCancelEdit:()=>{U(null),O(""),N(null)},onApiKeyChange:O,onSave:S,onDelete:()=>f(_.id),projectsEnabled:J,projects:Z,onRefresh:C},_.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("h2",{className:"text-xl font-semibold mb-1",children:"Browser Providers"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:["Configure browser environments for operator mode (computer use). ",n," of ",k.length," configured."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:k.map((_)=>q.jsxDEV(Hq,{provider:_,isEditing:X===_.id,apiKey:L,saving:A,testing:$,error:X===_.id?b:null,success:X===_.id?w:null,onStartEdit:()=>{U(_.id),N(null),K(null)},onCancelEdit:()=>{U(null),O(""),N(null)},onApiKeyChange:O,onSave:S,onDelete:()=>f(_.id),projectsEnabled:J,projects:Z,onRefresh:C},_.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var a=["#f97316","#6366f1","#22c55e","#ef4444","#3b82f6","#a855f7","#14b8a6","#f59e0b"];function Wq(){let{projects:z,createProject:Z,updateProject:J,deleteProject:B}=i(),[R,X]=H.useState(!1),[U,L]=H.useState(null),{confirm:O,ConfirmDialog:W}=D(),M=async(Q)=>{if(!await O("Are you sure you want to delete this project? Agents in this project will become unassigned.",{confirmText:"Delete",title:"Delete Project"}))return;await B(Q)},A=()=>{L(null),X(!0)},T=(Q)=>{L(Q),X(!0)},$=()=>{X(!1),L(null)};return q.jsxDEV(q.Fragment,{children:[W,q.jsxDEV("div",{className:"max-w-4xl w-full",children:[q.jsxDEV("div",{className:"mb-6 flex items-center justify-between gap-4",children:[q.jsxDEV("div",{children:[q.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Projects"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"Organize agents into projects for better management."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:A,className:"flex items-center gap-2 bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-black px-4 py-2 rounded font-medium transition flex-shrink-0",children:[q.jsxDEV(o,{className:"w-4 h-4"},void 0,!1,void 0,this),"New Project"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.length===0?q.jsxDEV("div",{className:"text-center py-12 text-[var(--color-text-muted)]",children:[q.jsxDEV("p",{className:"text-lg mb-2",children:"No projects yet"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm",children:"Create a project to organize your agents."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"space-y-3",children:z.map((Q)=>q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4 flex items-center gap-4",children:[q.jsxDEV("div",{className:"w-4 h-4 rounded-full flex-shrink-0",style:{backgroundColor:Q.color}},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex-1 min-w-0",children:[q.jsxDEV("h3",{className:"font-medium",children:Q.name},void 0,!1,void 0,this),Q.description&&q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] truncate",children:Q.description},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:[Q.agentCount," agent",Q.agentCount!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-2",children:[q.jsxDEV("button",{onClick:()=>T(Q),className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text)] px-2 py-1",children:"Edit"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:()=>M(Q.id),className:"text-sm text-red-400 hover:text-red-300 px-2 py-1",children:"Delete"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},Q.id,!0,void 0,this))},void 0,!1,void 0,this),R&&q.jsxDEV(_q,{project:U,onSave:async(Q)=>{if(U){let b=await J(U.id,Q);if(b)$();return!!b}else{let b=await Z(Q);if(b)$();return!!b}},onClose:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function _q({project:z,onSave:Z,onClose:J}){let[B,R]=H.useState(z?.name||""),[X,U]=H.useState(z?.description||""),[L,O]=H.useState(z?.color||a[Math.floor(Math.random()*a.length)]),[W,M]=H.useState(!1),[A,T]=H.useState(null),$=async()=>{if(!B.trim()){T("Name is required");return}M(!0),T(null);let Q=await Z({name:B,description:X||void 0,color:L});if(M(!1),!Q)T(z?"Failed to update project":"Failed to create project")};return q.jsxDEV(Xq,{onClose:J,children:[q.jsxDEV("h2",{className:"text-xl font-semibold mb-6",children:z?"Edit Project":"Create New Project"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"space-y-4",children:[q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Name"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"text",value:B,onChange:(Q)=>R(Q.target.value),className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]",placeholder:"My Project",autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Description (optional)"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"text",value:X,onChange:(Q)=>U(Q.target.value),className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]",placeholder:"A short description"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Color"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-3 flex-wrap",children:a.map((Q)=>q.jsxDEV("button",{type:"button",onClick:()=>O(Q),className:`w-10 h-10 rounded-full transition ${L===Q?"ring-2 ring-white ring-offset-2 ring-offset-[#111]":"hover:scale-110"}`,style:{backgroundColor:Q}},Q,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A&&q.jsxDEV("p",{className:"text-red-400 text-sm",children:A},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex gap-3 mt-6",children:[q.jsxDEV("button",{onClick:J,className:"flex-1 border border-[var(--color-border-light)] hover:border-[var(--color-accent)] hover:text-[var(--color-accent)] px-4 py-2 rounded font-medium transition",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:$,disabled:W||!B.trim(),className:"flex-1 bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black px-4 py-2 rounded font-medium transition",children:W?"Saving...":z?"Update":"Create"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Bq(){let{authFetch:z}=V(),[Z,J]=H.useState(null),[B,R]=H.useState(!1),[X,U]=H.useState(!1),[L,O]=H.useState(null),[W,M]=H.useState(null),[A,T]=H.useState(null),$=async()=>{R(!0),O(null);try{let w=await z("/api/version");if(!w.ok)throw Error("Failed to check for updates");let K=await w.json();J(K)}catch(w){O("Failed to check for updates")}R(!1)},Q=async()=>{U(!0),O(null),M(null);try{let K=await(await z("/api/version/update",{method:"POST"})).json();if(!K.success)O(K.error||"Update failed");else{let F=K.restarted?.length||0,g=F>0?` ${F} running agent${F>1?"s":""} restarted.`:"";M(`Agent binary updated to v${K.version}.${g}`),await $()}}catch(w){O("Failed to update agent")}U(!1)};H.useEffect(()=>{$()},[]);let b=(w,K)=>{navigator.clipboard.writeText(w),T(K),setTimeout(()=>T(null),2000)},N=Z?.apteva.updateAvailable||Z?.agent.updateAvailable;return q.jsxDEV("div",{className:"max-w-4xl w-full",children:[q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Updates"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"Check for new versions of apteva and the agent binary."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B&&!Z?q.jsxDEV("div",{className:"text-[var(--color-text-muted)]",children:"Checking version info..."},void 0,!1,void 0,this):L&&!Z?q.jsxDEV("div",{className:"text-red-400",children:L},void 0,!1,void 0,this):Z?.isDocker?q.jsxDEV("div",{className:"space-y-6",children:[q.jsxDEV("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4",children:[q.jsxDEV("div",{className:"flex items-center gap-2 text-blue-400 mb-2",children:[q.jsxDEV("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:q.jsxDEV("path",{d:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.186.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.186.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.186.186 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.186.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.185-.186H5.136a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("span",{className:"font-medium",children:"Docker Environment"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)]",children:"Updates are automatic when you pull a new image version."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-5",children:[q.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium text-lg",children:"Current Version"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)]",children:"apteva + agent binary"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"text-right",children:q.jsxDEV("div",{className:"text-xl font-mono",children:["v",Z.apteva.installed||"?"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N?q.jsxDEV("div",{className:"bg-[var(--color-accent-10)] border border-[var(--color-accent-30)] rounded-lg p-4",children:[q.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)] mb-3",children:["A newer version (v",Z.apteva.latest,") is available. To update:"]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"space-y-2",children:[q.jsxDEV("code",{className:"block bg-[var(--color-bg)] px-3 py-2 rounded font-mono text-sm text-[var(--color-text-secondary)]",children:"docker pull apteva/apteva:latest"},void 0,!1,void 0,this),q.jsxDEV("code",{className:"block bg-[var(--color-bg)] px-3 py-2 rounded font-mono text-sm text-[var(--color-text-secondary)]",children:"docker compose up -d"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>{navigator.clipboard.writeText("docker pull apteva/apteva:latest && docker compose up -d"),T("docker"),setTimeout(()=>T(null),2000)},className:"mt-3 px-3 py-1.5 bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] rounded text-sm",children:A==="docker"?"Copied!":"Copy commands"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[q.jsxDEV(p,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-faint)]",children:"Your data is stored in a Docker volume and persists across updates."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):Z?q.jsxDEV("div",{className:"space-y-6",children:[W&&q.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 text-green-400",children:W},void 0,!1,void 0,this),L&&q.jsxDEV("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-400",children:L},void 0,!1,void 0,this),q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-5",children:[q.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium text-lg",children:"apteva"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)]",children:"The app you're running"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"text-right",children:[q.jsxDEV("div",{className:"text-xl font-mono",children:["v",Z.apteva.installed||"?"]},void 0,!0,void 0,this),Z.apteva.updateAvailable&&q.jsxDEV("div",{className:"text-sm text-[var(--color-accent)]",children:["→ v",Z.apteva.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.apteva.updateAvailable?q.jsxDEV("div",{className:"bg-[var(--color-accent-10)] border border-[var(--color-accent-30)] rounded-lg p-4",children:[q.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)] mb-3",children:"Update by running:"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-2",children:[q.jsxDEV("code",{className:"flex-1 bg-[var(--color-bg)] px-3 py-2 rounded font-mono text-sm text-[var(--color-text-secondary)]",children:"npx apteva@latest"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:()=>b("npx apteva@latest","apteva"),className:"px-3 py-2 bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] rounded text-sm",children:A==="apteva"?"Copied!":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[q.jsxDEV(p,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-5",children:[q.jsxDEV("div",{className:"flex items-center justify-between mb-4",children:[q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium text-lg",children:"Agent Binary"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)]",children:"The Go binary that runs agents"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"text-right",children:[q.jsxDEV("div",{className:"text-xl font-mono",children:["v",Z.agent.installed||"?"]},void 0,!0,void 0,this),Z.agent.updateAvailable&&q.jsxDEV("div",{className:"text-sm text-[var(--color-accent)]",children:["→ v",Z.agent.latest]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.agent.updateAvailable?q.jsxDEV("div",{className:"bg-[var(--color-accent-10)] border border-[var(--color-accent-30)] rounded-lg p-4",children:[q.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)] mb-3",children:"A new version is available. Stop all agents before updating."},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-2",children:q.jsxDEV("button",{onClick:Q,disabled:X,className:"px-4 py-2 bg-[var(--color-accent)] text-black rounded font-medium text-sm disabled:opacity-50",children:X?"Updating...":"Update Agent"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 text-sm",children:[q.jsxDEV(p,{className:"w-4 h-4"},void 0,!1,void 0,this),"Up to date"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!N&&!W&&q.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 flex items-center gap-2 text-green-400",children:[q.jsxDEV(p,{className:"w-5 h-5"},void 0,!1,void 0,this),"Everything is up to date!"]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:$,disabled:B,className:"text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] disabled:opacity-50",children:B?"Checking...":"Check for updates"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)}function Lq({provider:z,isEditing:Z,apiKey:J,saving:B,testing:R,error:X,success:U,onStartEdit:L,onCancelEdit:O,onApiKeyChange:W,onSave:M,onDelete:A,extraField:T,onExtraFieldChange:$}){let Q=z.id==="ollama",b=z.id==="cdp",N=Q||b,w=z.type==="browser",K=z.id==="browserbase",[F,g]=H.default.useState(null),[C,S]=H.default.useState(!1),[f,G]=H.default.useState(null),Y=H.default.useCallback(()=>{fetch("/api/providers/ollama/status").then((y)=>y.json()).then((y)=>g({connected:y.connected,modelCount:y.modelCount,isDocker:y.isDocker})).catch(()=>g({connected:!1}))},[]);H.default.useEffect(()=>{if(Q)Y()},[Q,z.hasKey,Y]);let k=async()=>{S(!0),G(null);try{let c=await(await fetch("/api/providers/ollama/install",{method:"POST"})).json();if(c.success)G({success:!0,message:c.message}),Y();else G({success:!1,message:c.error||"Installation failed"})}catch{G({success:!1,message:"Failed to connect to server"})}finally{S(!1)}};return q.jsxDEV("div",{className:`bg-[var(--color-surface)] border rounded-lg p-4 ${z.hasKey?"border-green-500/20":"border-[var(--color-border)]"}`,children:[q.jsxDEV("div",{className:"flex items-start justify-between gap-2 mb-2",children:[q.jsxDEV("div",{className:"min-w-0",children:[q.jsxDEV("h3",{className:"font-medium",children:z.name},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] truncate",children:w?z.description||"Browser automation":z.type==="integration"?z.description||"MCP integration":Q?"Run models locally":`${z.models.length} models`},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.hasKey?q.jsxDEV("span",{className:`text-xs flex items-center gap-1 px-2 py-1 rounded whitespace-nowrap flex-shrink-0 ${Q&&F?F.connected?"text-green-400 bg-green-500/10":"text-yellow-400 bg-yellow-500/10":"text-green-400 bg-green-500/10"}`,children:Q&&F?F.connected?q.jsxDEV(q.Fragment,{children:[q.jsxDEV(p,{className:"w-3 h-3"},void 0,!1,void 0,this),F.modelCount," models"]},void 0,!0,void 0,this):q.jsxDEV(q.Fragment,{children:"Not running"},void 0,!1,void 0,this):N?q.jsxDEV(q.Fragment,{children:[q.jsxDEV(p,{className:"w-3 h-3"},void 0,!1,void 0,this),"Configured"]},void 0,!0,void 0,this):q.jsxDEV(q.Fragment,{children:[q.jsxDEV(p,{className:"w-3 h-3"},void 0,!1,void 0,this),z.keyHint]},void 0,!0,void 0,this)},void 0,!1,void 0,this):q.jsxDEV("span",{className:"text-[var(--color-text-muted)] text-xs bg-[var(--color-surface-raised)] px-2 py-1 rounded whitespace-nowrap flex-shrink-0",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[var(--color-border)]",children:Z?q.jsxDEV("div",{className:"space-y-3",children:[K?q.jsxDEV(q.Fragment,{children:[q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1",children:"API Key"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"password",value:J,onChange:(y)=>W(y.target.value),placeholder:z.hasKey?"Enter new API key...":"Enter API key...",autoFocus:!0,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-xs text-[var(--color-text-secondary)] mb-1",children:"Project ID"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"text",value:T||"",onChange:(y)=>$?.(y.target.value),placeholder:"Enter your Browserbase project ID...",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("input",{type:N?"text":"password",value:J,onChange:(y)=>W(y.target.value),placeholder:Q?"http://localhost:11434":b?"ws://localhost:9222":z.hasKey?"Enter new API key...":"Enter API key...",autoFocus:!0,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),N&&q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)]",children:b?"Enter the CDP URL of your browser (e.g., ws://localhost:9222)":"Enter your Ollama server URL. Default is http://localhost:11434"},void 0,!1,void 0,this),X&&q.jsxDEV("p",{className:"text-red-400 text-sm",children:X},void 0,!1,void 0,this),U&&q.jsxDEV("p",{className:"text-green-400 text-sm",children:U},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-2",children:[q.jsxDEV("button",{onClick:O,className:"flex-1 px-3 py-1.5 border border-[var(--color-border-light)] rounded text-sm hover:border-[var(--color-text-muted)]",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:M,disabled:!J||B,className:"flex-1 px-3 py-1.5 bg-[var(--color-accent)] text-black rounded text-sm font-medium disabled:opacity-50",children:R?"Validating...":B?"Saving...":N?"Connect":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):z.hasKey?q.jsxDEV("div",{children:[Q&&F&&!F.connected&&!F.isDocker&&q.jsxDEV("div",{className:"mb-3",children:[q.jsxDEV("button",{onClick:k,disabled:C,className:"w-full px-3 py-1.5 bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/30 rounded text-sm font-medium transition disabled:opacity-50 disabled:cursor-wait",children:C?"Starting Ollama...":"Start Ollama"},void 0,!1,void 0,this),f&&q.jsxDEV("p",{className:`text-xs mt-1.5 ${f.success?"text-green-400":"text-red-400"}`,children:f.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex items-center justify-between",children:[z.docsUrl?q.jsxDEV("a",{href:z.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:Q?"Ollama docs":"View docs"},void 0,!1,void 0,this):q.jsxDEV("span",{},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-3",children:[q.jsxDEV("button",{onClick:L,className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text)]",children:N?"Change URL":"Update key"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:A,className:"text-red-400 hover:text-red-300 text-sm",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{children:[Q&&!F?.isDocker&&q.jsxDEV("div",{className:"mb-3",children:[q.jsxDEV("button",{onClick:k,disabled:C,className:"w-full px-3 py-2 bg-[#3b82f6]/20 text-[#3b82f6] hover:bg-[#3b82f6]/30 rounded text-sm font-medium transition disabled:opacity-50 disabled:cursor-wait",children:C?"Installing Ollama...":F?.connected?"Ollama Running":"Install Ollama"},void 0,!1,void 0,this),f&&q.jsxDEV("p",{className:`text-xs mt-1.5 ${f.success?"text-green-400":"text-red-400"}`,children:f.message},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex items-center justify-between",children:[z.docsUrl?q.jsxDEV("a",{href:z.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:Q?"Manual install":w?"View docs":"Get API key"},void 0,!1,void 0,this):q.jsxDEV("span",{},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:L,className:"text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)]",children:N?"Configure":"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Hq({provider:z,isEditing:Z,apiKey:J,saving:B,testing:R,error:X,success:U,onStartEdit:L,onCancelEdit:O,onApiKeyChange:W,onSave:M,onDelete:A,projectsEnabled:T,projects:$,onRefresh:Q}){let{authFetch:b}=V(),[N,w]=H.useState([]),[K,F]=H.useState(""),[g,C]=H.useState(!1),[S,f]=H.useState(null),[G,Y]=H.useState(!1),[k,y]=H.useState(""),{confirm:c,ConfirmDialog:n}=D(),_=z.id==="browserbase",P=async()=>{try{let v=await(await b(`/api/keys/${z.id}`)).json();w(v.keys||[])}catch(I){console.error("Failed to fetch keys:",I)}};H.useEffect(()=>{if(T)P()},[z.id,T]),H.useEffect(()=>{if(Z)f(null)},[Z]);let u=async()=>{if(!J)return;Y(!0),f(null);let I=J;if(_&&k)I=JSON.stringify({api_key:J,project_id:k});try{let v=await b(`/api/keys/${z.id}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:I,project_id:K||null})}),qq=await v.json();if(v.ok)W(""),y(""),F(""),O(),P(),Q();else f(qq.error||"Failed to save key")}catch(v){console.error("Failed to save key:",v),f("Failed to save key")}Y(!1)},l=async(I,v)=>{if(!await c(`Are you sure you want to remove this API key${v?` (${v})`:""}?`,{confirmText:"Remove",title:"Remove API Key"}))return;try{await b(`/api/keys/by-id/${I}`,{method:"DELETE"}),P(),Q()}catch(Yq){console.error("Failed to delete key:",Yq)}},h=N.find((I)=>!I.project_id),d=N.filter((I)=>I.project_id),m=(I)=>$.find((v)=>v.id===I)?.name||"Unknown",j=(I)=>$.find((v)=>v.id===I)?.color||"#666";if(!T)return q.jsxDEV("div",{className:`bg-[var(--color-surface)] border rounded-lg p-4 ${z.hasKey?"border-[var(--color-accent-20)]":"border-[var(--color-border)]"}`,children:[q.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium",children:z.name},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)]",children:z.description||"MCP integration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.hasKey?q.jsxDEV("span",{className:"text-[var(--color-accent)] text-xs flex items-center gap-1 bg-[var(--color-accent-10)] px-2 py-1 rounded",children:[q.jsxDEV(p,{className:"w-3 h-3"},void 0,!1,void 0,this),z.keyHint]},void 0,!0,void 0,this):q.jsxDEV("span",{className:"text-[var(--color-text-muted)] text-xs bg-[var(--color-surface-raised)] px-2 py-1 rounded",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[var(--color-border)]",children:Z?q.jsxDEV("div",{className:"space-y-3",children:[q.jsxDEV("input",{type:s,value:J,onChange:(I)=>W(I.target.value),placeholder:z.hasKey?`Enter new ${x?"URL":"API key"}...`:e,autoFocus:!0,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),X&&q.jsxDEV("p",{className:"text-red-400 text-sm",children:X},void 0,!1,void 0,this),U&&q.jsxDEV("p",{className:"text-green-400 text-sm",children:U},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-2",children:[q.jsxDEV("button",{onClick:O,className:"flex-1 px-3 py-1.5 border border-[var(--color-border-light)] rounded text-sm hover:border-[var(--color-text-muted)]",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:M,disabled:!J||B,className:"flex-1 px-3 py-1.5 bg-[var(--color-accent)] text-black rounded text-sm font-medium disabled:opacity-50",children:R?"Validating...":B?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):z.hasKey?q.jsxDEV("div",{className:"flex items-center justify-between",children:[q.jsxDEV("a",{href:z.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"View docs"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-3",children:[q.jsxDEV("button",{onClick:L,className:"text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text)]",children:"Update key"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:A,className:"text-red-400 hover:text-red-300 text-sm",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"flex items-center justify-between",children:[q.jsxDEV("a",{href:z.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:"Get API key"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:L,className:"text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)]",children:"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let x=z.isLocal,s=x?"text":"password",e=x?z.id==="cdp"?"ws://localhost:9222":"http://localhost:11434":"Enter API key...";return q.jsxDEV(q.Fragment,{children:[n,q.jsxDEV("div",{className:`bg-[var(--color-surface)] border rounded-lg p-4 ${N.length>0?"border-[var(--color-accent-20)]":"border-[var(--color-border)]"}`,children:[q.jsxDEV("div",{className:"flex items-center justify-between mb-2",children:[q.jsxDEV("div",{children:[q.jsxDEV("h3",{className:"font-medium",children:z.name},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)]",children:z.description||"MCP integration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.length>0?q.jsxDEV("span",{className:"text-[var(--color-accent)] text-xs flex items-center gap-1 bg-[var(--color-accent-10)] px-2 py-1 rounded",children:[q.jsxDEV(p,{className:"w-3 h-3"},void 0,!1,void 0,this),N.length," key",N.length!==1?"s":""]},void 0,!0,void 0,this):q.jsxDEV("span",{className:"text-[var(--color-text-muted)] text-xs bg-[var(--color-surface-raised)] px-2 py-1 rounded",children:"Not configured"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),N.length>0&&q.jsxDEV("div",{className:"mt-3 space-y-2",children:[h&&q.jsxDEV("div",{className:"flex items-center justify-between text-sm bg-[var(--color-bg)] rounded px-3 py-2",children:[q.jsxDEV("div",{className:"flex items-center gap-2",children:[q.jsxDEV("span",{className:"text-[var(--color-text-secondary)]",children:"Global"},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-[var(--color-text-faint)]",children:"·"},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-[var(--color-text-muted)] font-mono text-xs",children:h.key_hint},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>l(h.id,"Global"),className:"text-red-400 hover:text-red-300 text-xs",children:"Remove"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),d.slice(0,g?void 0:2).map((I)=>q.jsxDEV("div",{className:"flex items-center justify-between text-sm bg-[var(--color-bg)] rounded px-3 py-2",children:[q.jsxDEV("div",{className:"flex items-center gap-2 min-w-0",children:[q.jsxDEV("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:j(I.project_id)}},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-[var(--color-text-secondary)] truncate",children:I.name||m(I.project_id)},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-[var(--color-text-faint)]",children:"·"},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-[var(--color-text-muted)] font-mono text-xs",children:I.key_hint},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>l(I.id,I.name||m(I.project_id)),className:"text-red-400 hover:text-red-300 text-xs flex-shrink-0 ml-2",children:"Remove"},void 0,!1,void 0,this)]},I.id,!0,void 0,this)),d.length>2&&!g&&q.jsxDEV("button",{onClick:()=>C(!0),className:"text-xs text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)] w-full text-center py-1",children:["Show ",d.length-2," more..."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"mt-3 pt-3 border-t border-[var(--color-border)]",children:Z?q.jsxDEV("div",{className:"space-y-3",children:[q.jsxDEV("input",{type:s,value:J,onChange:(I)=>W(I.target.value),placeholder:e,autoFocus:!0,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),_&&q.jsxDEV("input",{type:"text",value:k,onChange:(I)=>y(I.target.value),placeholder:"Browserbase Project ID (optional)",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)] text-sm"},void 0,!1,void 0,this),q.jsxDEV(E,{value:K,onChange:F,placeholder:"Global (all projects)",options:[{value:"",label:"Global (all projects)"},...$.map((I)=>({value:I.id,label:I.name}))]},void 0,!1,void 0,this),S&&q.jsxDEV("p",{className:"text-red-400 text-sm",children:S},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-2",children:[q.jsxDEV("button",{onClick:()=>{O(),F(""),f(null)},className:"flex-1 px-3 py-1.5 border border-[var(--color-border-light)] rounded text-sm hover:border-[var(--color-text-muted)]",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:u,disabled:!J||G,className:"flex-1 px-3 py-1.5 bg-[var(--color-accent)] text-black rounded text-sm font-medium disabled:opacity-50",children:G?"Saving...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"flex items-center justify-between",children:[q.jsxDEV("a",{href:z.docsUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#3b82f6] hover:underline",children:N.length>0?"View docs":"Get API key"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:L,className:"text-sm text-[var(--color-accent)] hover:text-[var(--color-accent-hover)]",children:"+ Add key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Nq(){let{authFetch:z}=V(),[Z,J]=H.useState([]),[B,R]=H.useState(!1),[X,U]=H.useState(""),[L,O]=H.useState("90"),[W,M]=H.useState(!1),[A,T]=H.useState(null),[$,Q]=H.useState(null),[b,N]=H.useState(!1),{confirm:w,ConfirmDialog:K}=D(),F=async()=>{try{let k=await(await z("/api/keys/personal")).json();J(k.keys||[])}catch{}};H.useEffect(()=>{F()},[]);let g=async()=>{if(!X.trim()){T("Name is required");return}M(!0),T(null);try{let Y=await z("/api/keys/personal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:X.trim(),expires_in_days:L?parseInt(L):null})}),k=await Y.json();if(!Y.ok)T(k.error||"Failed to create key");else Q(k.key),U(""),O("90"),F()}catch{T("Failed to create key")}M(!1)},C=async(Y,k)=>{if(!await w(`Delete API key "${k}"? This cannot be undone.`,{confirmText:"Delete",title:"Delete API Key"}))return;try{await z(`/api/keys/personal/${Y}`,{method:"DELETE"}),F()}catch{}},S=()=>{if($)navigator.clipboard.writeText($),N(!0),setTimeout(()=>N(!1),2000)},f=(Y)=>{if(!Y)return"Never";return new Date(Y).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},G=(Y)=>{if(!Y)return!1;return new Date(Y)<new Date};return q.jsxDEV(q.Fragment,{children:[K,q.jsxDEV("div",{className:"max-w-4xl w-full",children:[q.jsxDEV("div",{className:"mb-6 flex items-center justify-between gap-4",children:[q.jsxDEV("div",{children:[q.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"API Keys"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:["Create personal API keys for programmatic access. Use them with the ",q.jsxDEV("code",{className:"text-[var(--color-text-secondary)] bg-[var(--color-surface-raised)] px-1 rounded text-xs",children:"X-API-Key"},void 0,!1,void 0,this)," header."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!B&&!$&&q.jsxDEV("button",{onClick:()=>{R(!0),T(null)},className:"flex items-center gap-2 bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-black px-4 py-2 rounded font-medium transition flex-shrink-0",children:[q.jsxDEV(o,{className:"w-4 h-4"},void 0,!1,void 0,this),"New Key"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$&&q.jsxDEV("div",{className:"bg-green-500/10 border border-green-500/30 rounded-lg p-4 mb-6",children:[q.jsxDEV("div",{className:"flex items-center gap-2 text-green-400 mb-2",children:[q.jsxDEV(p,{className:"w-5 h-5"},void 0,!1,void 0,this),q.jsxDEV("span",{className:"font-medium",children:"API key created"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-secondary)] mb-3",children:"Copy this key now. You won't be able to see it again."},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-2",children:[q.jsxDEV("code",{className:"flex-1 bg-[var(--color-bg)] px-3 py-2 rounded font-mono text-sm text-[var(--color-text)] break-all select-all",children:$},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:S,className:"px-3 py-2 bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] rounded text-sm flex-shrink-0",children:b?"Copied!":"Copy"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>{Q(null),R(!1)},className:"mt-3 text-sm text-[var(--color-text-muted)] hover:text-[var(--color-text-secondary)]",children:"Done"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B&&!$&&q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4 mb-6",children:[q.jsxDEV("h3",{className:"font-medium mb-4",children:"Create new API key"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"space-y-4 max-w-md",children:[q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Name"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"text",value:X,onChange:(Y)=>U(Y.target.value),placeholder:"e.g. CI Pipeline, My Script",autoFocus:!0,className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Expiration"},void 0,!1,void 0,this),q.jsxDEV("select",{value:L,onChange:(Y)=>O(Y.target.value),className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]",children:[q.jsxDEV("option",{value:"30",children:"30 days"},void 0,!1,void 0,this),q.jsxDEV("option",{value:"90",children:"90 days"},void 0,!1,void 0,this),q.jsxDEV("option",{value:"180",children:"180 days"},void 0,!1,void 0,this),q.jsxDEV("option",{value:"365",children:"1 year"},void 0,!1,void 0,this),q.jsxDEV("option",{value:"",children:"No expiration"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),A&&q.jsxDEV("p",{className:"text-red-400 text-sm",children:A},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex gap-2",children:[q.jsxDEV("button",{onClick:()=>{R(!1),T(null),U("")},className:"flex-1 px-3 py-2 border border-[var(--color-border-light)] rounded text-sm hover:border-[var(--color-text-muted)]",children:"Cancel"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:g,disabled:W||!X.trim(),className:"flex-1 px-3 py-2 bg-[var(--color-accent)] text-black rounded text-sm font-medium disabled:opacity-50",children:W?"Creating...":"Create Key"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.length===0?q.jsxDEV("div",{className:"text-center py-12 text-[var(--color-text-muted)]",children:[q.jsxDEV("p",{className:"text-lg mb-2",children:"No API keys yet"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm",children:"Create an API key to access apteva programmatically."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"space-y-3",children:Z.map((Y)=>q.jsxDEV("div",{className:`bg-[var(--color-surface)] border rounded-lg p-4 flex items-center gap-4 ${!Y.is_active||G(Y.expires_at)?"border-[var(--color-border)] opacity-60":"border-[var(--color-border)]"}`,children:[q.jsxDEV("div",{className:"flex-1 min-w-0",children:[q.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[q.jsxDEV("h3",{className:"font-medium",children:Y.name},void 0,!1,void 0,this),!Y.is_active&&q.jsxDEV("span",{className:"text-xs text-red-400 bg-red-500/10 px-2 py-0.5 rounded",children:"Revoked"},void 0,!1,void 0,this),Y.is_active&&G(Y.expires_at)&&q.jsxDEV("span",{className:"text-xs text-yellow-400 bg-yellow-500/10 px-2 py-0.5 rounded",children:"Expired"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-3 text-sm text-[var(--color-text-muted)]",children:[q.jsxDEV("code",{className:"font-mono text-xs bg-[var(--color-bg)] px-2 py-0.5 rounded",children:[Y.prefix,"..."]},void 0,!0,void 0,this),q.jsxDEV("span",{children:["Created ",f(Y.created_at)]},void 0,!0,void 0,this),Y.expires_at&&q.jsxDEV("span",{children:["Expires ",f(Y.expires_at)]},void 0,!0,void 0,this),Y.last_used_at&&q.jsxDEV("span",{children:["Last used ",f(Y.last_used_at)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Y.is_active&&q.jsxDEV("button",{onClick:()=>C(Y.id,Y.name),className:"text-sm text-red-400 hover:text-red-300 px-2 py-1 flex-shrink-0",children:"Delete"},void 0,!1,void 0,this)]},Y.id,!0,void 0,this))},void 0,!1,void 0,this),Z.length>0&&q.jsxDEV("div",{className:"mt-6 bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4",children:[q.jsxDEV("h3",{className:"font-medium mb-2 text-sm",children:"Usage"},void 0,!1,void 0,this),q.jsxDEV("code",{className:"block bg-[var(--color-bg)] px-3 py-2 rounded font-mono text-xs text-[var(--color-text-secondary)]",children:'curl -H "X-API-Key: apt_..." http://localhost:4280/api/agents'},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Uq(){let{authFetch:z,user:Z}=V(),[J,B]=H.useState(""),[R,X]=H.useState(""),[U,L]=H.useState(""),[O,W]=H.useState(!1),[M,A]=H.useState(null),T=async()=>{if(!J||!R||!U){A({type:"error",text:"All fields are required"});return}if(R!==U){A({type:"error",text:"New passwords do not match"});return}if(R.length<8){A({type:"error",text:"Password must be at least 8 characters"});return}W(!0),A(null);try{let $=await z("/api/auth/password",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:J,newPassword:R})}),Q=await $.json();if($.ok)A({type:"success",text:"Password updated successfully"}),B(""),X(""),L("");else A({type:"error",text:Q.error||"Failed to update password"})}catch{A({type:"error",text:"Failed to update password"})}W(!1)};return q.jsxDEV("div",{className:"max-w-4xl w-full",children:[q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Account Settings"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"Manage your account and security."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z&&q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4 mb-6",children:[q.jsxDEV("h3",{className:"font-medium mb-3",children:"Profile"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"space-y-2 text-sm",children:[q.jsxDEV("div",{className:"flex justify-between",children:[q.jsxDEV("span",{className:"text-[var(--color-text-muted)]",children:"Username"},void 0,!1,void 0,this),q.jsxDEV("span",{children:Z.username},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Z.email&&q.jsxDEV("div",{className:"flex justify-between",children:[q.jsxDEV("span",{className:"text-[var(--color-text-muted)]",children:"Email"},void 0,!1,void 0,this),q.jsxDEV("span",{children:Z.email},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex justify-between",children:[q.jsxDEV("span",{className:"text-[var(--color-text-muted)]",children:"Role"},void 0,!1,void 0,this),q.jsxDEV("span",{className:"capitalize",children:Z.role},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4",children:[q.jsxDEV("h3",{className:"font-medium mb-4",children:"Change Password"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"space-y-4 max-w-md",children:[q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Current Password"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"password",value:J,onChange:($)=>B($.target.value),className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"New Password"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"password",value:R,onChange:($)=>X($.target.value),className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Confirm New Password"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"password",value:U,onChange:($)=>L($.target.value),className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),M&&q.jsxDEV("div",{className:`p-3 rounded text-sm ${M.type==="success"?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:M.text},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:T,disabled:O||!J||!R||!U,className:"px-4 py-2 bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 disabled:cursor-not-allowed text-black rounded text-sm font-medium transition",children:O?"Updating...":"Update Password"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Oq(){let{authFetch:z}=V(),[Z,J]=H.useState(!1),[B,R]=H.useState(null),[X,U]=H.useState(null),{confirm:L,ConfirmDialog:O}=D(),W=async()=>{try{let T=await(await z("/api/telemetry/stats")).json();U(T.stats?.total_events||0)}catch{U(null)}};H.useEffect(()=>{W()},[]);let M=async()=>{if(!await L("Are you sure you want to delete all telemetry data? This cannot be undone.",{confirmText:"Clear All",title:"Clear Telemetry Data"}))return;J(!0),R(null);try{let T=await z("/api/telemetry/clear",{method:"POST"}),$=await T.json();if(T.ok)R({type:"success",text:`Cleared ${$.deleted||0} telemetry events.`}),U(0);else R({type:"error",text:$.error||"Failed to clear telemetry"})}catch{R({type:"error",text:"Failed to clear telemetry"})}J(!1)};return q.jsxDEV(q.Fragment,{children:[O,q.jsxDEV("div",{className:"max-w-4xl w-full",children:[q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("h1",{className:"text-2xl font-semibold mb-1",children:"Data Management"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-[var(--color-text-muted)]",children:"Manage stored data and telemetry."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4",children:[q.jsxDEV("h3",{className:"font-medium mb-2",children:"Telemetry Data"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:X!==null?`${X.toLocaleString()} events stored`:"Loading..."},void 0,!1,void 0,this),B&&q.jsxDEV("div",{className:`mb-4 p-3 rounded text-sm ${B.type==="success"?"bg-green-500/10 text-green-400 border border-green-500/30":"bg-red-500/10 text-red-400 border border-red-500/30"}`,children:B.text},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:M,disabled:Z||X===0,className:"px-4 py-2 bg-red-500/20 text-red-400 hover:bg-red-500/30 disabled:opacity-50 disabled:cursor-not-allowed rounded text-sm font-medium transition",children:Z?"Clearing...":"Clear All Telemetry"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Rq(){let{authFetch:z}=V(),[Z,J]=H.useState([]),[B,R]=H.useState([]),[X,U]=H.useState(!0),[L,O]=H.useState(!1),[W,M]=H.useState({name:"",agent_id:"",botToken:""}),[A,T]=H.useState(!1),[$,Q]=H.useState(null),{confirm:b,ConfirmDialog:N}=D(),w=async()=>{try{let Y=await(await z("/api/channels")).json();J(Y.channels||[])}catch{}finally{U(!1)}},K=async()=>{try{let Y=await(await z("/api/agents")).json();R((Y.agents||[]).map((k)=>({id:k.id,name:k.name,status:k.status})))}catch{}};H.useEffect(()=>{w(),K()},[]);let F=async()=>{if(!W.name||!W.agent_id||!W.botToken)return;T(!0),Q(null);try{let G=await z("/api/channels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"telegram",name:W.name,agent_id:W.agent_id,config:{botToken:W.botToken}})});if(!G.ok){let Y=await G.json();Q(Y.error||"Failed to create channel")}else M({name:"",agent_id:"",botToken:""}),O(!1),await w()}catch(G){Q(G.message)}finally{T(!1)}},g=async(G)=>{let Y=G.status==="running"?"stop":"start";try{let k=await z(`/api/channels/${G.id}/${Y}`,{method:"POST"});if(!k.ok){let y=await k.json();Q(y.error||`Failed to ${Y} channel`)}await w()}catch{Q(`Failed to ${Y} channel`)}},C=async(G)=>{if(!await b(`Delete channel "${G.name}"?`,{confirmText:"Delete",title:"Delete Channel"}))return;try{await z(`/api/channels/${G.id}`,{method:"DELETE"}),await w()}catch{}},S={running:"bg-green-500/20 text-green-400",stopped:"bg-[var(--color-surface-raised)] text-[var(--color-text-muted)]",error:"bg-red-500/20 text-red-400"},f=(G)=>{return B.find((Y)=>Y.id===G)?.name||G};return q.jsxDEV(q.Fragment,{children:[N,q.jsxDEV("div",{className:"max-w-2xl",children:[q.jsxDEV("div",{className:"flex items-center justify-between mb-6",children:[q.jsxDEV("div",{children:[q.jsxDEV("h2",{className:"text-xl font-semibold mb-1",children:"Channels"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)]",children:"Connect agents to external messaging platforms"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:()=>O(!L),className:"flex items-center gap-2 bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] text-black px-3 py-1.5 rounded text-sm font-medium transition",children:[q.jsxDEV(o,{},void 0,!1,void 0,this)," Add Channel"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),$&&q.jsxDEV("div",{className:"mb-4 bg-red-500/10 text-red-400 border border-red-500/30 px-3 py-2 rounded text-sm flex items-center justify-between",children:[q.jsxDEV("span",{children:$},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:()=>Q(null),className:"text-red-400 hover:text-red-300 ml-2",children:q.jsxDEV(t,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),L&&q.jsxDEV("div",{className:"mb-6 bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4 space-y-3",children:[q.jsxDEV("h3",{className:"text-sm font-medium text-[var(--color-text-secondary)] mb-2",children:"New Telegram Channel"},void 0,!1,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-xs text-[var(--color-text-muted)] mb-1",children:"Channel Name"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"text",value:W.name,onChange:(G)=>M((Y)=>({...Y,name:G.target.value})),placeholder:"e.g. My Telegram Bot",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-xs text-[var(--color-text-muted)] mb-1",children:"Agent"},void 0,!1,void 0,this),q.jsxDEV(E,{value:W.agent_id,options:B.map((G)=>({value:G.id,label:G.name})),onChange:(G)=>M((Y)=>({...Y,agent_id:G})),placeholder:"Select an agent..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{children:[q.jsxDEV("label",{className:"block text-xs text-[var(--color-text-muted)] mb-1",children:"Bot Token"},void 0,!1,void 0,this),q.jsxDEV("input",{type:"password",value:W.botToken,onChange:(G)=>M((Y)=>({...Y,botToken:G.target.value})),placeholder:"From @BotFather on Telegram",className:"w-full bg-[var(--color-bg)] border border-[var(--color-border-light)] rounded px-3 py-2 text-sm focus:outline-none focus:border-[var(--color-accent)]"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-faint)] mt-1",children:["Create a bot via ",q.jsxDEV("a",{href:"https://t.me/BotFather",target:"_blank",className:"text-[var(--color-accent)] hover:underline",children:"@BotFather"},void 0,!1,void 0,this)," on Telegram to get a token."]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex gap-2 pt-1",children:[q.jsxDEV("button",{onClick:F,disabled:A||!W.name||!W.agent_id||!W.botToken,className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 text-black px-4 py-1.5 rounded text-sm font-medium transition",children:A?"Creating...":"Create"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:()=>{O(!1),M({name:"",agent_id:"",botToken:""})},className:"border border-[var(--color-border-light)] hover:border-[var(--color-scrollbar)] px-4 py-1.5 rounded text-sm transition",children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X?q.jsxDEV("p",{className:"text-[var(--color-text-muted)] text-sm",children:"Loading channels..."},void 0,!1,void 0,this):Z.length===0?q.jsxDEV("div",{className:"text-center py-12 text-[var(--color-text-muted)]",children:[q.jsxDEV("p",{className:"text-lg mb-2",children:"No channels configured"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm",children:"Add a Telegram channel to let users message your agents directly."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"space-y-3",children:Z.map((G)=>q.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg p-4",children:q.jsxDEV("div",{className:"flex items-start justify-between",children:[q.jsxDEV("div",{className:"flex-1 min-w-0",children:[q.jsxDEV("div",{className:"flex items-center gap-2 mb-1",children:[q.jsxDEV("h3",{className:"font-medium",children:G.name},void 0,!1,void 0,this),q.jsxDEV("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${S[G.status]||S.stopped}`,children:G.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)]",children:[G.type==="telegram"?"Telegram":G.type," → ",f(G.agent_id)]},void 0,!0,void 0,this),G.status==="error"&&G.error&&q.jsxDEV("p",{className:"text-xs text-red-400 mt-1",children:G.error},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-2 ml-4",children:[q.jsxDEV("button",{onClick:()=>g(G),className:`px-3 py-1 rounded text-xs font-medium transition ${G.status==="running"?"bg-[var(--color-accent-20)] text-[var(--color-accent)] hover:bg-[var(--color-accent-30)]":"bg-[#3b82f6]/20 text-[#3b82f6] hover:bg-[#3b82f6]/30"}`,children:G.status==="running"?"Stop":"Start"},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:()=>C(G),className:"text-[var(--color-text-muted)] hover:text-red-400 transition text-sm",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},G.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Tq(){let{authFetch:z}=V(),[Z,J]=H.useState([]),[B,R]=H.useState(""),[X,U]=H.useState(""),[L,O]=H.useState(""),[W,M]=H.useState("unknown"),[A,T]=H.useState(!0),[$,Q]=H.useState(!1),[b,N]=H.useState(null),[w,K]=H.useState(!1),[F,g]=H.useState(!1),[C,S]=H.useState(!1),[f,G]=H.useState({provider:"",model:"",systemPrompt:"",webSearch:!1,webFetch:!1});H.useEffect(()=>{(async()=>{try{let[u,l]=await Promise.all([z("/api/meta-agent/status"),z("/api/providers")]),h=await u.json(),d=await l.json();if(J((d.providers||[]).filter((m)=>m.type==="llm"&&m.hasKey)),h.agent){let m=h.agent;R(m.provider||""),U(m.model||""),O(m.systemPrompt||""),M(m.status||"stopped");let j=m.features?.builtinTools?.webSearch||!1,x=m.features?.builtinTools?.webFetch||!1;g(j),S(x),G({provider:m.provider||"",model:m.model||"",systemPrompt:m.systemPrompt||"",webSearch:j,webFetch:x})}}catch{N({type:"error",text:"Failed to load assistant config"})}finally{T(!1)}})()},[z]);let k=Z.find((P)=>P.id===B)?.models||[],y=(P)=>{R(P);let u=Z.find((h)=>h.id===P),l=u?.models.find((h)=>h.recommended)?.value||u?.models[0]?.value||"";U(l)},c=B!==f.provider||X!==f.model||L!==f.systemPrompt||F!==f.webSearch||C!==f.webFetch,n=async()=>{Q(!0),N(null);try{let P=await z("/api/agents/apteva-assistant",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:B,model:X,systemPrompt:L,features:{builtinTools:{webSearch:F,webFetch:C}}})});if(P.ok)G({provider:B,model:X,systemPrompt:L,webSearch:F,webFetch:C}),N({type:"success",text:"Assistant settings saved"}),setTimeout(()=>N(null),3000);else{let u=await P.json().catch(()=>({}));N({type:"error",text:u.error||"Failed to save"})}}catch{N({type:"error",text:"Failed to save settings"})}finally{Q(!1)}},_=async()=>{K(!0),N(null);try{let u=await z(W==="running"?"/api/meta-agent/stop":"/api/meta-agent/start",{method:"POST"});if(u.ok)M(W==="running"?"stopped":"running");else{let l=await u.json().catch(()=>({}));N({type:"error",text:l.error||"Failed to toggle assistant"})}}catch{N({type:"error",text:"Failed to toggle assistant"})}finally{K(!1)}};if(A)return q.jsxDEV("div",{className:"text-[var(--color-text-muted)]",children:"Loading assistant settings..."},void 0,!1,void 0,this);return q.jsxDEV("div",{className:"max-w-2xl",children:[q.jsxDEV("h2",{className:"text-lg font-medium mb-1",children:"Apteva Assistant"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mb-6",children:"Configure the built-in AI assistant that manages your agents and platform."},void 0,!1,void 0,this),b&&q.jsxDEV("div",{className:`mb-4 px-3 py-2 rounded text-sm ${b.type==="success"?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:b.text},void 0,!1,void 0,this),q.jsxDEV("div",{className:"mb-6 flex items-center gap-3",children:[q.jsxDEV("span",{className:"text-sm text-[var(--color-text-muted)]",children:"Status:"},void 0,!1,void 0,this),q.jsxDEV("span",{className:`px-2 py-1 rounded text-xs font-medium ${W==="running"?"bg-[#3b82f6]/20 text-[#3b82f6]":"bg-[var(--color-surface-raised)] text-[var(--color-text-muted)]"}`,children:W},void 0,!1,void 0,this),q.jsxDEV("button",{onClick:_,disabled:w,className:`px-3 py-1.5 rounded text-sm font-medium transition ${W==="running"?"bg-[var(--color-accent-20)] text-[var(--color-accent)] hover:bg-[var(--color-accent-30)]":"bg-[#3b82f6]/20 text-[#3b82f6] hover:bg-[#3b82f6]/30"} disabled:opacity-50`,children:w?"...":W==="running"?"Stop":"Start"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"mb-4",children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Provider"},void 0,!1,void 0,this),q.jsxDEV(E,{value:B,onChange:y,options:Z.map((P)=>({value:P.id,label:P.name})),placeholder:"Select provider..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"mb-4",children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Model"},void 0,!1,void 0,this),q.jsxDEV(E,{value:X,onChange:U,options:k.map((P)=>({value:P.value,label:P.label,recommended:P.recommended})),placeholder:"Select model..."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),B==="anthropic"&&q.jsxDEV("div",{className:"mb-4",children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"Built-in Tools"},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[q.jsxDEV("button",{type:"button",onClick:()=>g(!F),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${F?"border-[var(--color-accent)] bg-[var(--color-accent-10)] text-[var(--color-accent)]":"border-[var(--color-border-light)] hover:border-[var(--color-border-light)] text-[var(--color-text-secondary)]"}`,children:[q.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:q.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-sm",children:"Web Search"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{type:"button",onClick:()=>S(!C),className:`flex items-center gap-2 px-3 py-2 rounded border transition ${C?"border-[var(--color-accent)] bg-[var(--color-accent-10)] text-[var(--color-accent)]":"border-[var(--color-border-light)] hover:border-[var(--color-border-light)] text-[var(--color-text-secondary)]"}`,children:[q.jsxDEV("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:q.jsxDEV("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-sm",children:"Web Fetch"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("p",{className:"text-xs text-[var(--color-text-faint)] mt-2",children:"Provider-native tools for real-time web access"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"mb-6",children:[q.jsxDEV("label",{className:"block text-sm text-[var(--color-text-muted)] mb-1",children:"System Prompt"},void 0,!1,void 0,this),q.jsxDEV("textarea",{value:L,onChange:(P)=>O(P.target.value),rows:12,className:"w-full bg-[var(--color-surface)] border border-[var(--color-border)] rounded px-3 py-2 text-sm font-mono focus:outline-none focus:border-[var(--color-accent)] resize-y"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("button",{onClick:n,disabled:!c||$,className:"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 disabled:cursor-not-allowed text-black px-4 py-2 rounded font-medium transition",children:$?"Saving...":"Save Changes"},void 0,!1,void 0,this),W==="running"&&c&&q.jsxDEV("p",{className:"text-xs text-[var(--color-text-muted)] mt-2",children:"Changes will be applied to the running assistant"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
- export{bq as c};
3
-
4
- //# debugId=9B09F54B145CF38164756E2164756E21
@@ -1,4 +0,0 @@
1
- import{$ as P,X as L,aa as N}from"./App.tpmp9020.js";var z=L(P(),1),w=L(N(),1);function U({children:q,onClose:y}){return w.jsxDEV("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4",children:w.jsxDEV("div",{className:"bg-[var(--color-surface)] rounded p-6 w-full max-w-xl lg:max-w-2xl border border-[var(--color-border)] max-h-[90vh] overflow-y-auto",children:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function Q({title:q,message:y,confirmText:F="Confirm",cancelText:B="Cancel",confirmVariant:G="danger",onConfirm:I,onCancel:J}){return w.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:w.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-sm",children:[q&&w.jsxDEV("h3",{className:"font-medium mb-2",children:q},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-sm text-[var(--color-text)] mb-4",children:y},void 0,!1,void 0,this),w.jsxDEV("div",{className:"flex gap-2",children:[w.jsxDEV("button",{onClick:J,className:"flex-1 text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:B},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:I,className:`flex-1 text-sm text-white px-4 py-2 rounded transition ${G==="danger"?"bg-red-500 hover:bg-red-600":"bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)]"}`,children:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function R({title:q,message:y,buttonText:F="OK",variant:B="info",onClose:G}){let I={error:"bg-red-500/20 text-red-400",success:"bg-green-500/20 text-green-400",info:"bg-blue-500/20 text-blue-400"},J={error:"✕",success:"✓",info:"ℹ"};return w.jsxDEV("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:w.jsxDEV("div",{className:"bg-[var(--color-surface)] border border-[var(--color-border-light)] rounded-lg p-6 w-full max-w-sm text-center",children:[w.jsxDEV("div",{className:`w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3 ${I[B]}`,children:w.jsxDEV("span",{className:"text-xl",children:J[B]},void 0,!1,void 0,this)},void 0,!1,void 0,this),q&&w.jsxDEV("h3",{className:"font-medium mb-2",children:q},void 0,!1,void 0,this),w.jsxDEV("p",{className:"text-sm text-[var(--color-text)] mb-4",children:y},void 0,!1,void 0,this),w.jsxDEV("button",{onClick:G,className:"w-full text-sm bg-[var(--color-surface-raised)] hover:bg-[var(--color-surface-raised)] border border-[var(--color-border-light)] px-4 py-2 rounded transition",children:F},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function W(){let[q,y]=z.useState(null),F=z.useCallback((J,K={})=>{return new Promise((O)=>{y({message:J,options:K,resolve:O})})},[]),B=z.useCallback(()=>{q?.resolve(!0),y(null)},[q]),G=z.useCallback(()=>{q?.resolve(!1),y(null)},[q]),I=q?w.jsxDEV(Q,{title:q.options.title,message:q.message,confirmText:q.options.confirmText,cancelText:q.options.cancelText,confirmVariant:q.options.confirmVariant,onConfirm:B,onCancel:G},void 0,!1,void 0,this):null;return{confirm:F,ConfirmDialog:I}}function X(){let[q,y]=z.useState(null),F=z.useCallback((I,J={})=>{return new Promise((K)=>{y({message:I,options:J,resolve:K})})},[]),B=z.useCallback(()=>{q?.resolve(),y(null)},[q]),G=q?w.jsxDEV(R,{title:q.options.title,message:q.message,buttonText:q.options.buttonText,variant:q.options.variant,onClose:B},void 0,!1,void 0,this):null;return{alert:F,AlertDialog:G}}
2
- export{U as N,W as O,X as P};
3
-
4
- //# debugId=0BB3361EB672849264756E2164756E21