@rubytech/taskmaster 1.0.45 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/defaults.js +3 -3
- package/dist/browser/routes/screencast.js +4 -0
- package/dist/browser/screencast.js +17 -0
- package/dist/build-info.json +3 -3
- package/dist/commands/uninstall.js +3 -0
- package/dist/control-ui/assets/index-CBnatXwP.css +1 -0
- package/dist/control-ui/assets/{index-BKYdwFD8.js → index-DLaLQGyo.js} +2 -2
- package/dist/control-ui/assets/index-DLaLQGyo.js.map +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/gateway/server-methods/browser-screencast.js +5 -0
- package/package.json +1 -1
- package/dist/control-ui/assets/index-BKYdwFD8.js.map +0 -1
- package/dist/control-ui/assets/index-BjsEHhKc.css +0 -1
package/dist/agents/defaults.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Defaults for agent metadata when upstream does not supply them.
|
|
2
2
|
// Model id uses pi-ai's built-in Anthropic catalog.
|
|
3
3
|
export const DEFAULT_PROVIDER = "anthropic";
|
|
4
|
-
export const DEFAULT_MODEL = "claude-
|
|
5
|
-
// Context window:
|
|
6
|
-
export const DEFAULT_CONTEXT_TOKENS =
|
|
4
|
+
export const DEFAULT_MODEL = "claude-sonnet-4-5";
|
|
5
|
+
// Context window: Sonnet 4.5 supports 200k tokens.
|
|
6
|
+
export const DEFAULT_CONTEXT_TOKENS = 200_000;
|
|
@@ -76,6 +76,10 @@ export function registerBrowserScreencastRoutes(app, ctx) {
|
|
|
76
76
|
maxWidth,
|
|
77
77
|
maxHeight,
|
|
78
78
|
onFrame: (frame) => {
|
|
79
|
+
const listenerCount = frameListeners.size;
|
|
80
|
+
if (listenerCount === 0) {
|
|
81
|
+
log.warn("frame received but no listeners registered");
|
|
82
|
+
}
|
|
79
83
|
for (const listener of frameListeners.values()) {
|
|
80
84
|
try {
|
|
81
85
|
listener({ data: frame.data, metadata: frame.metadata });
|
|
@@ -53,6 +53,7 @@ export async function startScreencast(opts) {
|
|
|
53
53
|
}, 100);
|
|
54
54
|
},
|
|
55
55
|
};
|
|
56
|
+
let frameCount = 0;
|
|
56
57
|
ws.on("message", (raw) => {
|
|
57
58
|
try {
|
|
58
59
|
const msg = JSON.parse(rawDataToString(raw));
|
|
@@ -72,7 +73,11 @@ export async function startScreencast(opts) {
|
|
|
72
73
|
}
|
|
73
74
|
// Handle screencast frame events
|
|
74
75
|
if (msg.method === "Page.screencastFrame") {
|
|
76
|
+
frameCount++;
|
|
75
77
|
const params = msg.params;
|
|
78
|
+
if (frameCount <= 3 || frameCount % 100 === 0) {
|
|
79
|
+
log.info(`frame #${frameCount}: dataLen=${params?.data?.length ?? 0} hasMeta=${!!params?.metadata}`);
|
|
80
|
+
}
|
|
76
81
|
if (params?.data && params.metadata) {
|
|
77
82
|
// Acknowledge the frame to request the next one
|
|
78
83
|
send("Page.screencastFrameAck", {
|
|
@@ -85,6 +90,12 @@ export async function startScreencast(opts) {
|
|
|
85
90
|
});
|
|
86
91
|
}
|
|
87
92
|
}
|
|
93
|
+
else if (msg.method) {
|
|
94
|
+
// Log other CDP events (first few only) for debugging
|
|
95
|
+
if (frameCount === 0) {
|
|
96
|
+
log.debug(`CDP event: ${msg.method}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
88
99
|
}
|
|
89
100
|
catch {
|
|
90
101
|
// ignore parse errors
|
|
@@ -120,6 +131,12 @@ export async function startScreencast(opts) {
|
|
|
120
131
|
});
|
|
121
132
|
session.active = true;
|
|
122
133
|
log.info(`screencast active: ${id}`);
|
|
134
|
+
// Warn if no frames arrive within 5 seconds — helps diagnose CDP/compositor issues
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
if (session.active && frameCount === 0) {
|
|
137
|
+
log.warn(`no frames received after 5s — CDP may not support screencast on this platform (headless? no display? software rendering?)`);
|
|
138
|
+
}
|
|
139
|
+
}, 5000);
|
|
123
140
|
return session;
|
|
124
141
|
}
|
|
125
142
|
/**
|
package/dist/build-info.json
CHANGED
|
@@ -204,6 +204,9 @@ export async function uninstallCommand(runtime, opts) {
|
|
|
204
204
|
if (!oauthInsideState) {
|
|
205
205
|
await removePath(oauthDir, runtime, { dryRun, label: oauthDir });
|
|
206
206
|
}
|
|
207
|
+
// Remove gateway log files
|
|
208
|
+
const { DEFAULT_LOG_DIR } = await import("../logging/logger.js");
|
|
209
|
+
await removePath(DEFAULT_LOG_DIR, runtime, { dryRun, label: DEFAULT_LOG_DIR });
|
|
207
210
|
}
|
|
208
211
|
if (scopes.has("workspace")) {
|
|
209
212
|
for (const workspace of workspaceDirs) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap";:root{--bg: #12141a;--bg-accent: #14161d;--bg-elevated: #1a1d25;--bg-hover: #262a35;--bg-muted: #262a35;--card: #181b22;--card-foreground: #f4f4f5;--card-highlight: rgba(255, 255, 255, .05);--popover: #181b22;--popover-foreground: #f4f4f5;--panel: #12141a;--panel-strong: #1a1d25;--panel-hover: #262a35;--chrome: rgba(18, 20, 26, .95);--chrome-strong: rgba(18, 20, 26, .98);--text: #e4e4e7;--text-strong: #fafafa;--chat-text: #e4e4e7;--muted: #71717a;--muted-strong: #52525b;--muted-foreground: #71717a;--border: #27272a;--border-strong: #3f3f46;--border-hover: #52525b;--input: #27272a;--ring: rgba(255, 255, 255, .2);--accent: #00d4ff;--accent-hover: #33dfff;--accent-muted: #00d4ff;--accent-subtle: rgba(0, 212, 255, .15);--accent-foreground: #fafafa;--accent-glow: rgba(0, 212, 255, .25);--primary: #00d4ff;--primary-foreground: #111111;--secondary: #1e2028;--secondary-foreground: #f4f4f5;--accent-2: #14b8a6;--accent-2-muted: rgba(20, 184, 166, .7);--accent-2-subtle: rgba(20, 184, 166, .15);--ok: #22c55e;--ok-muted: rgba(34, 197, 94, .75);--ok-subtle: rgba(34, 197, 94, .12);--destructive: #ef4444;--destructive-foreground: #fafafa;--warn: #f59e0b;--warn-muted: rgba(245, 158, 11, .75);--warn-subtle: rgba(245, 158, 11, .12);--danger: #ef4444;--danger-muted: rgba(239, 68, 68, .75);--danger-subtle: rgba(239, 68, 68, .12);--info: #3b82f6;--focus: rgba(0, 212, 255, .25);--focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring);--focus-glow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring), 0 0 20px var(--accent-glow);--grid-line: rgba(255, 255, 255, .04);--theme-switch-x: 50%;--theme-switch-y: 50%;--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "DejaVu Sans", sans-serif;--font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "DejaVu Sans", sans-serif;--shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);--shadow-md: 0 4px 12px rgba(0, 0, 0, .25), 0 0 0 1px rgba(255, 255, 255, .03);--shadow-lg: 0 12px 28px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .03);--shadow-xl: 0 24px 48px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .03);--shadow-glow: 0 0 30px var(--accent-glow);--radius-sm: 6px;--radius-md: 8px;--radius-lg: 12px;--radius-xl: 16px;--radius-full: 9999px;--radius: 8px;--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-in-out: cubic-bezier(.4, 0, .2, 1);--ease-spring: cubic-bezier(.34, 1.56, .64, 1);--duration-fast: .12s;--duration-normal: .2s;--duration-slow: .35s;color-scheme:dark}:root[data-theme=light]{--bg: #fafafa;--bg-accent: #f5f5f5;--bg-elevated: #ffffff;--bg-hover: #f0f0f0;--bg-muted: #f0f0f0;--bg-content: #f5f5f5;--card: #ffffff;--card-foreground: #18181b;--card-highlight: rgba(0, 0, 0, .03);--popover: #ffffff;--popover-foreground: #18181b;--panel: #fafafa;--panel-strong: #f5f5f5;--panel-hover: #ebebeb;--chrome: rgba(250, 250, 250, .95);--chrome-strong: rgba(250, 250, 250, .98);--text: #3f3f46;--text-strong: #18181b;--chat-text: #3f3f46;--muted: #71717a;--muted-strong: #52525b;--muted-foreground: #71717a;--border: #e4e4e7;--border-strong: #d4d4d8;--border-hover: #a1a1aa;--input: #e4e4e7;--accent: #0891b2;--accent-hover: #06b6d4;--accent-muted: #0891b2;--accent-subtle: rgba(8, 145, 178, .12);--accent-foreground: #ffffff;--accent-glow: rgba(8, 145, 178, .15);--primary: #0891b2;--primary-foreground: #ffffff;--secondary: #f4f4f5;--secondary-foreground: #3f3f46;--accent-2: #0d9488;--accent-2-muted: rgba(13, 148, 136, .75);--accent-2-subtle: rgba(13, 148, 136, .12);--ok: #16a34a;--ok-muted: rgba(22, 163, 74, .75);--ok-subtle: rgba(22, 163, 74, .1);--destructive: #dc2626;--destructive-foreground: #fafafa;--warn: #d97706;--warn-muted: rgba(217, 119, 6, .75);--warn-subtle: rgba(217, 119, 6, .1);--danger: #dc2626;--danger-muted: rgba(220, 38, 38, .75);--danger-subtle: rgba(220, 38, 38, .1);--info: #2563eb;--focus: rgba(8, 145, 178, .2);--focus-glow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring), 0 0 16px var(--accent-glow);--grid-line: rgba(0, 0, 0, .05);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);--shadow-md: 0 4px 12px rgba(0, 0, 0, .08), 0 0 0 1px rgba(0, 0, 0, .04);--shadow-lg: 0 12px 28px rgba(0, 0, 0, .12), 0 0 0 1px rgba(0, 0, 0, .04);--shadow-xl: 0 24px 48px rgba(0, 0, 0, .15), 0 0 0 1px rgba(0, 0, 0, .04);--shadow-glow: 0 0 24px var(--accent-glow);color-scheme:light}*{box-sizing:border-box}html,body{height:100%}body{margin:0;font:400 14px/1.55 var(--font-body);letter-spacing:-.02em;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@keyframes theme-circle-transition{0%{clip-path:circle(0% at var(--theme-switch-x, 50%) var(--theme-switch-y, 50%))}to{clip-path:circle(150% at var(--theme-switch-x, 50%) var(--theme-switch-y, 50%))}}html.theme-transition{view-transition-name:theme}html.theme-transition::view-transition-old(theme){mix-blend-mode:normal;animation:none;z-index:1}html.theme-transition::view-transition-new(theme){mix-blend-mode:normal;z-index:2;animation:theme-circle-transition .4s var(--ease-out) forwards}@media(prefers-reduced-motion:reduce){html.theme-transition::view-transition-old(theme),html.theme-transition::view-transition-new(theme){animation:none!important}}taskmaster-app{display:block;position:relative;z-index:1;min-height:100vh}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}button,input,textarea,select{font:inherit;color:inherit}::selection{background:var(--accent-subtle);color:var(--text-strong)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:var(--radius-full)}::-webkit-scrollbar-thumb:hover{background:var(--border-strong)}@keyframes rise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes dashboard-enter{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}@keyframes pulse-subtle{0%,to{opacity:1}50%{opacity:.7}}@keyframes glow-pulse{0%,to{box-shadow:0 0 #00d4ff00}50%{box-shadow:0 0 20px var(--accent-glow)}}.stagger-1{animation-delay:0ms}.stagger-2{animation-delay:50ms}.stagger-3{animation-delay:.1s}.stagger-4{animation-delay:.15s}.stagger-5{animation-delay:.2s}.stagger-6{animation-delay:.25s}:focus-visible{outline:none;box-shadow:var(--focus-ring)}.grid{display:grid;gap:20px}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.stat-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.note-grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.row{display:flex;gap:12px;align-items:center}.stack{display:grid;gap:12px;grid-template-columns:minmax(0,1fr)}.filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center}@media(max-width:1100px){.grid-cols-2,.grid-cols-3,.table-head,.table-row,.list-item{grid-template-columns:1fr}}@media(max-width:600px){.card{padding:12px;border-radius:var(--radius-md)}.card-title{font-size:13px}.stat-grid{gap:8px;grid-template-columns:repeat(2,1fr)}.stat{padding:10px;border-radius:var(--radius-md)}.stat-label{font-size:11px}.stat-value{font-size:18px}.note-grid{grid-template-columns:1fr;gap:8px}.form-grid{grid-template-columns:1fr;gap:10px}.field input,.field textarea,.field select{padding:8px 10px;border-radius:var(--radius-md);font-size:14px}.btn{padding:8px 12px;font-size:12px}.pill{padding:4px 10px;font-size:12px}.chat-header{flex-direction:column;align-items:stretch;gap:8px}.chat-header__left{flex-direction:column;align-items:stretch}.chat-header__right{justify-content:space-between}.chat-session{min-width:unset;width:100%}.chat-thread{margin-top:8px;padding:12px 8px}.chat-msg{max-width:90%}.chat-bubble{padding:8px 12px;border-radius:var(--radius-md)}.chat-compose{gap:8px}.chat-compose__field textarea{min-height:60px;padding:8px 10px;border-radius:var(--radius-md);font-size:14px}.log-stream{border-radius:var(--radius-md);max-height:380px}.log-row{grid-template-columns:1fr;gap:4px;padding:8px}.log-time{font-size:10px}.log-level{font-size:9px}.log-subsystem{font-size:11px}.log-message{font-size:12px}.list-item{padding:10px;border-radius:var(--radius-md)}.list-title{font-size:13px}.list-sub{font-size:11px}.code-block{padding:8px;border-radius:var(--radius-md);font-size:11px}.theme-toggle{--theme-item: 24px;--theme-gap: 2px;--theme-pad: 3px}.theme-icon{width:12px;height:12px}}@media(max-width:400px){.card{padding:10px}.stat{padding:8px}.stat-value{font-size:16px}.chat-bubble{padding:8px 10px}.chat-compose__field textarea{min-height:52px;padding:8px 10px;font-size:13px}.btn{padding:6px 10px;font-size:11px}.theme-toggle{--theme-item: 22px;--theme-gap: 2px;--theme-pad: 2px}.theme-icon{width:11px;height:11px}}.chat{position:relative;display:flex;flex-direction:column;flex:1 1 0;height:100%;min-height:0;overflow:hidden;background:transparent!important;border:none!important;box-shadow:none!important}.chat--dragover{outline:2px dashed var(--accent)!important;outline-offset:-2px;background:var(--accent-subtle)!important}.chat-header{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:nowrap;flex-shrink:0;padding-bottom:12px;margin-bottom:12px;background:transparent}.chat-header__left{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0}.chat-session{min-width:180px}.chat-thread{flex:1 1 0;overflow-y:auto;overflow-x:hidden;padding:12px 4px;margin:0 -4px;min-height:0;border-radius:12px;background:transparent}.chat-scroll-bottom{position:absolute;bottom:8px;left:50%;transform:translate(-50%);z-index:5;width:36px;height:36px;border-radius:50%;border:1px solid var(--border);background:var(--card);color:var(--muted);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;box-shadow:0 2px 8px #0000004d;transition:color .15s ease-out,background .15s ease-out,border-color .15s ease-out;animation:scroll-btn-enter .4s cubic-bezier(.34,1.56,.64,1)}@keyframes scroll-btn-enter{0%{opacity:0;transform:translate(-50%) translateY(8px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.chat-scroll-bottom:hover{color:var(--text);background:var(--panel-strong);border-color:var(--border-strong, var(--border))}.chat-scroll-bottom svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;animation:chevron-bounce 2s ease-in-out infinite}@keyframes chevron-bounce{0%,to{transform:translateY(0)}50%{transform:translateY(3px)}}:root[data-theme=light] .chat-scroll-bottom{background:#fff;box-shadow:0 2px 8px #0000001f}:root[data-theme=light] .chat-scroll-bottom:hover{background:#f5f5f5}.chat-focus-exit{position:absolute;top:12px;right:12px;z-index:100;width:32px;height:32px;border-radius:50%;border:1px solid var(--border);background:var(--panel);color:var(--muted);font-size:20px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s ease-out,color .15s ease-out,border-color .15s ease-out;box-shadow:0 4px 12px #0003}.chat-focus-exit:hover{background:var(--panel-strong);color:var(--text);border-color:var(--accent)}.chat-focus-exit svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.chat-compose{position:sticky;bottom:0;flex-shrink:0;display:flex;flex-direction:column;gap:12px;margin-top:auto;padding:12px 4px 16px;background:linear-gradient(to bottom,transparent,var(--bg) 20%);z-index:10}.chat-attachments{display:inline-flex;flex-wrap:wrap;gap:8px;width:fit-content;max-width:100%;align-self:flex-start}.chat-attachment{position:relative;width:80px;height:80px;border-radius:6px;overflow:hidden;border:1px solid var(--border);background:var(--bg)}.chat-attachment__img{width:100%;height:100%;object-fit:contain}.chat-attachment__remove{position:absolute;top:4px;right:4px;width:20px;height:20px;border-radius:50%;border:none;background:#000000b3;color:#fff;font-size:12px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity .15s ease-out}.chat-attachment:hover .chat-attachment__remove{opacity:1}.chat-attachment__remove:hover{background:#dc2626e6}.chat-attachment__remove svg{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:2px}.chat-attachment--file{width:auto;height:auto;display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:8px;background:var(--panel);border:1px solid var(--border);max-width:220px}.chat-attachment__icon{flex-shrink:0;display:flex;color:var(--muted)}.chat-attachment__icon svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.chat-attachment__name{font-size:13px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.chat-attachment__remove--file{position:static;opacity:.6;flex-shrink:0;width:24px;height:24px;border-radius:50%;border:none;background:#ffffff14;color:var(--muted);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity .15s ease-out,color .15s ease-out,background .15s ease-out}.chat-attachment__remove--file:hover{opacity:1;color:var(--danger, #dc2626);background:#dc262626}.chat-attachment__remove--file svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2.5px}:root[data-theme=light] .chat-attachment{border-color:#10182826;background:#fff}:root[data-theme=light] .chat-attachment__remove{background:#0009}.chat-message-images{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}.chat-message-image{max-width:300px;max-height:200px;border-radius:8px;object-fit:contain;cursor:pointer;transition:transform .15s ease-out}.chat-message-image:hover{transform:scale(1.02)}.chat-group.user .chat-message-images{justify-content:flex-end}.chat-compose__row{display:flex;align-items:stretch;gap:12px;flex:1}:root[data-theme=light] .chat-compose{background:linear-gradient(to bottom,transparent,var(--bg-content) 20%)}.chat-compose__field{flex:1 1 auto;min-width:0;display:flex;align-items:stretch}.chat-compose__field>span{display:none}.chat-compose .chat-compose__field textarea{width:100%;height:44px;min-height:44px;max-height:150px;padding:11px 16px;border-radius:8px;resize:none;overflow-y:hidden;white-space:pre-wrap;font-family:var(--font-body);font-size:15px;line-height:1.45;outline:none}.chat-compose .chat-compose__field textarea:focus,.chat-compose .chat-compose__field textarea:focus-visible,.field.chat-compose__field textarea:focus,.field.chat-compose__field textarea:focus-visible{outline:none!important;box-shadow:none!important;border-color:var(--border)}.chat-compose__field textarea:disabled{opacity:.7;cursor:not-allowed}.chat-compose__emoji{flex-shrink:0;align-self:flex-end;width:40px;height:40px;min-width:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;color:var(--muted);cursor:pointer;transition:color .15s ease-out}.chat-compose__emoji:hover{color:var(--text)}.chat-compose__emoji.active{color:var(--accent)}.chat-compose__emoji svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.emoji-picker-popup{position:absolute;bottom:100%;left:0;margin-bottom:8px;z-index:50;border-radius:var(--radius-lg, 12px);overflow:hidden;box-shadow:0 4px 24px #0006;display:none}.emoji-picker-popup.active{display:block}emoji-picker{--background: var(--card);--border-color: var(--border);--indicator-color: var(--accent);--input-border-color: var(--border);--input-font-color: var(--text);--input-placeholder-color: var(--muted);--outline-color: var(--accent);--category-font-color: var(--muted);--button-active-background: var(--panel-strong);--button-hover-background: var(--panel);--num-columns: 8;height:320px}.chat-compose__send{flex-shrink:0;align-self:flex-end;width:40px;height:40px;min-width:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;padding:0;border:none;cursor:pointer;transition:background .15s ease-out,opacity .15s ease-out}.chat-compose__send.primary{background:var(--accent);color:#fff}.chat-compose__send.primary:hover:not(:disabled){background:var(--accent-strong, var(--accent));opacity:.9}.chat-compose__send.primary:disabled{opacity:.4;cursor:not-allowed}.chat-compose__send:not(.primary){background:var(--panel-strong);color:var(--muted)}.chat-compose__send:not(.primary):hover{color:var(--text)}.chat-compose__send svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.chat-compose__actions{flex-shrink:0;display:flex;align-items:stretch;gap:8px}.chat-compose .chat-compose__actions .btn{padding:0 16px;font-size:13px;height:40px;min-height:40px;max-height:40px;line-height:1;white-space:nowrap;box-sizing:border-box}.chat-controls{display:flex;align-items:center;justify-content:flex-start;gap:12px;flex-wrap:wrap}.chat-controls__session{min-width:140px}.chat-controls__thinking{display:flex;align-items:center;gap:6px;font-size:13px}.btn--icon{padding:8px!important;min-width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);background:#ffffff0f}.chat-controls__separator{color:#fff6;font-size:18px;margin:0 8px;font-weight:300}:root[data-theme=light] .chat-controls__separator{color:#1018284d}.btn--icon:hover{background:#ffffff1f;border-color:#fff3}:root[data-theme=light] .btn--icon{background:#fff;border-color:var(--border);box-shadow:0 1px 2px #1018280d;color:var(--muted)}:root[data-theme=light] .btn--icon:hover{background:#fff;border-color:var(--border-strong);color:var(--text)}.btn--icon svg{display:block;width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.chat-controls__session select{padding:6px 10px;font-size:13px}.chat-controls__thinking{display:flex;align-items:center;gap:4px;font-size:12px;padding:4px 10px;background:#ffffff0a;border-radius:6px;border:1px solid var(--border)}:root[data-theme=light] .chat-controls__thinking{background:#ffffffe6;border-color:#10182826}@media(max-width:640px){.chat-session{min-width:140px}.chat-compose{grid-template-columns:1fr}.chat-controls{flex-wrap:wrap;gap:8px}.chat-controls__session{min-width:120px}}.chat-model-bar{position:relative;display:flex;align-items:center;gap:8px;padding:6px 0 2px}.chat-model-bar__select{position:relative}.chat-model-bar__dropdown{-moz-appearance:none;appearance:none;-webkit-appearance:none;background:transparent;border:1px solid var(--border);border-radius:6px;color:var(--muted);font-size:12px;padding:4px 22px 4px 8px;cursor:pointer;outline:none;transition:color .15s,border-color .15s;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' fill='none' stroke-width='1.2'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center}.chat-model-bar__dropdown:hover,.chat-model-bar__dropdown:focus{color:var(--text);border-color:var(--border-strong, var(--border))}.chat-model-bar__dropdown option{background:var(--card);color:var(--text)}:root[data-theme=light] .chat-model-bar__dropdown{border-color:var(--border);color:var(--muted);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' fill='none' stroke-width='1.2'/%3E%3C/svg%3E")}:root[data-theme=light] .chat-model-bar__dropdown:hover,:root[data-theme=light] .chat-model-bar__dropdown:focus{color:var(--text);border-color:var(--border-strong, var(--border))}:root[data-theme=light] .chat-model-bar__dropdown option{background:#fff;color:var(--text)}.chat-model-bar__dropdown:focus,.chat-model-bar__dropdown:focus-visible{outline:none;box-shadow:none}.chat-model-bar__settings-btn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;background:transparent;color:var(--muted);cursor:pointer;border-radius:4px;padding:0;transition:color .15s,background .15s}.chat-model-bar__settings-btn:hover{color:var(--text);background:#ffffff14}.chat-model-bar__settings-btn:focus,.chat-model-bar__settings-btn:focus-visible{outline:none;box-shadow:none}:root[data-theme=light] .chat-model-bar__settings-btn:hover{background:#0000000f}.chat-model-bar__settings-btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.chat-settings-menu{display:none;position:absolute;bottom:calc(100% + 4px);right:0;z-index:60;min-width:180px;padding:6px 0;background:var(--card);border:1px solid var(--border);border-radius:8px;box-shadow:0 4px 16px #0000004d}.chat-settings-menu.active{display:block}.chat-settings-menu__item{display:flex;align-items:center;gap:8px;padding:8px 12px;cursor:pointer;font-size:13px;color:var(--text);transition:background .1s}.chat-settings-menu__item:hover{background:#ffffff0f}:root[data-theme=light] .chat-settings-menu__item:hover{background:#0000000a}.chat-settings-menu__item input[type=checkbox]{accent-color:var(--accent);width:15px;height:15px;cursor:pointer;flex-shrink:0}.chat-settings-menu__hint{margin-left:auto;font-size:11px;color:var(--muted)}:root[data-theme=light] .chat-settings-menu{background:#fff;box-shadow:0 4px 16px #0000001f}.chat-thinking{margin-bottom:10px;padding:10px 12px;border-radius:10px;border:1px dashed rgba(255,255,255,.18);background:#ffffff0a;color:var(--muted);font-size:12px;line-height:1.4}:root[data-theme=light] .chat-thinking{border-color:#10182840;background:#1018280a}.chat-text{font-size:14px;line-height:1.5;word-wrap:break-word;overflow-wrap:break-word}.chat-text :where(p+p,p+ul,p+ol,p+pre,p+blockquote){margin-top:.75em}.chat-text :where(ul,ol){padding-left:1.5em}.chat-text :where(a){color:var(--accent);text-decoration:underline;text-underline-offset:2px}.chat-text :where(a:hover){opacity:.8}.chat-text :where(:not(pre)>code){background:#00000026;padding:.15em .4em;border-radius:4px}.chat-text :where(pre){background:#00000026;border-radius:6px;padding:10px 12px;overflow-x:auto}.chat-text :where(pre code){background:none;padding:0}.chat-text :where(blockquote){border-left:3px solid var(--border-strong);margin-left:0;color:var(--muted);background:#ffffff05;padding:8px 12px;border-radius:0 var(--radius-sm) var(--radius-sm) 0}.chat-text :where(blockquote blockquote){margin-top:8px;border-left-color:var(--border-hover);background:#ffffff08}.chat-text :where(blockquote blockquote blockquote){border-left-color:var(--muted-strong);background:#ffffff0a}:root[data-theme=light] .chat-text :where(blockquote){background:#00000008}:root[data-theme=light] .chat-text :where(blockquote blockquote){background:#0000000d}:root[data-theme=light] .chat-text :where(blockquote blockquote blockquote){background:#0000000a}:root[data-theme=light] .chat-text :where(:not(pre)>code){background:#00000014;border:1px solid rgba(0,0,0,.1)}:root[data-theme=light] .chat-text :where(pre){background:#0000000d;border:1px solid rgba(0,0,0,.1)}.chat-text :where(hr){border:none;border-top:1px solid var(--border);margin:1em 0}.chat-group{display:flex;gap:12px;align-items:flex-start;margin-bottom:16px;margin-left:44px;margin-right:44px}.chat-group.user{flex-direction:row-reverse;justify-content:flex-start}.chat-group-messages{display:flex;flex-direction:column;gap:2px;max-width:100%}.chat-group.user .chat-group-messages{align-items:flex-end;max-width:85%}.chat-group.user .chat-group-footer{justify-content:flex-end}.chat-group-footer{display:flex;gap:8px;align-items:baseline;margin-top:6px}.chat-sender-name{font-weight:500;font-size:12px;color:var(--muted)}.chat-group-timestamp{font-size:11px;color:var(--muted);opacity:.7}.chat-avatar{width:40px;height:40px;border-radius:8px;background:var(--panel-strong);display:grid;place-items:center;font-weight:600;font-size:14px;flex-shrink:0;align-self:flex-end;margin-bottom:4px}.chat-avatar.user{background:var(--accent-subtle);color:var(--accent)}.chat-avatar.assistant,.chat-avatar.other,.chat-avatar.tool{background:var(--secondary);color:var(--muted)}img.chat-avatar{display:block;object-fit:cover;object-position:center}.chat-bubble{position:relative;display:inline-block;border:1px solid transparent;background:var(--card);border-radius:var(--radius-lg);padding:10px 14px;box-shadow:none;transition:background .15s ease-out,border-color .15s ease-out;max-width:100%;word-wrap:break-word}.chat-copy-btn{position:absolute;top:6px;border:1px solid var(--border);background:var(--bg);color:var(--muted);border-radius:var(--radius-md);padding:4px 6px;font-size:14px;line-height:1;cursor:pointer;opacity:.5;transition:opacity .12s ease-out,background .12s ease-out}.chat-group.assistant .chat-copy-btn,.chat-group.other .chat-copy-btn{left:-40px}.chat-group.user .chat-copy-btn{right:-40px}.chat-copy-btn__icon{display:inline-flex;width:14px;height:14px;position:relative}.chat-copy-btn__icon svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.chat-copy-btn__icon-copy,.chat-copy-btn__icon-check{position:absolute;top:0;left:0;transition:opacity .15s ease}.chat-copy-btn__icon-check,.chat-copy-btn[data-copied="1"] .chat-copy-btn__icon-copy{opacity:0}.chat-copy-btn[data-copied="1"] .chat-copy-btn__icon-check{opacity:1}.chat-copy-btn:hover{opacity:1;background:var(--bg-hover)}.chat-copy-btn[data-copying="1"]{opacity:.3;pointer-events:none}.chat-copy-btn[data-error="1"]{opacity:1;pointer-events:auto;border-color:var(--danger-subtle);background:var(--danger-subtle);color:var(--danger)}.chat-copy-btn[data-copied="1"]{opacity:1;pointer-events:auto;border-color:var(--ok-subtle);background:var(--ok-subtle);color:var(--ok)}.chat-copy-btn:focus-visible{opacity:1;pointer-events:auto;outline:2px solid var(--accent);outline-offset:2px}.chat-group.assistant .chat-bubble,.chat-group.other .chat-bubble{display:block;background:transparent;border-color:transparent;padding:4px 0;box-shadow:none}.chat-group.assistant .chat-bubble:hover,.chat-group.other .chat-bubble:hover{background:transparent}:root[data-theme=light] .chat-group.assistant .chat-bubble,:root[data-theme=light] .chat-group.other .chat-bubble{background:transparent;border-color:transparent;box-shadow:none}.chat-group.user .chat-bubble{background:var(--accent-subtle);border-color:transparent}:root[data-theme=light] .chat-group.user .chat-bubble{border-color:#ea580c33;background:#fb923c1f}.chat-bubble.streaming{border-left:2px solid var(--accent);padding-left:12px;animation:pulsing-accent 1.5s ease-out infinite}@keyframes pulsing-accent{0%,to{border-left-color:var(--accent);opacity:1}50%{border-left-color:var(--accent);opacity:.4}}.chat-bubble.fade-in{animation:fade-in .2s ease-out}@keyframes fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.chat-tool-card{border:1px solid var(--border);border-radius:8px;padding:12px;margin-top:8px;background:var(--card);box-shadow:inset 0 1px 0 var(--card-highlight);transition:border-color .15s ease-out,background .15s ease-out;max-height:120px;overflow:hidden}.chat-tool-card:hover{border-color:var(--border-strong);background:var(--bg-hover)}.chat-tool-card:first-child{margin-top:0}.chat-tool-card--clickable{cursor:pointer}.chat-tool-card--clickable:focus{outline:2px solid var(--accent);outline-offset:2px}.chat-tool-card__header{display:flex;justify-content:space-between;align-items:center;gap:8px}.chat-tool-card__title{display:inline-flex;align-items:center;gap:6px;font-weight:600;font-size:13px;line-height:1.2}.chat-tool-card__icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;flex-shrink:0}.chat-tool-card__icon svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.chat-tool-card__action{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--accent);opacity:.8;transition:opacity .15s ease-out}.chat-tool-card__action svg{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.chat-tool-card--clickable:hover .chat-tool-card__action{opacity:1}.chat-tool-card__status{display:inline-flex;align-items:center;color:var(--ok)}.chat-tool-card__status svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.chat-tool-card__status-text{font-size:11px;margin-top:4px}.chat-tool-card__detail{font-size:12px;color:var(--muted);margin-top:4px}.chat-tool-card__preview{font-size:11px;color:var(--muted);margin-top:8px;padding:8px 10px;background:var(--secondary);border-radius:var(--radius-md);white-space:pre-wrap;overflow:hidden;max-height:44px;line-height:1.4;border:1px solid var(--border)}.chat-tool-card--clickable:hover .chat-tool-card__preview{background:var(--bg-hover);border-color:var(--border-strong)}.chat-tool-card__inline{font-size:11px;color:var(--text);margin-top:6px;padding:6px 8px;background:var(--secondary);border-radius:var(--radius-sm);white-space:pre-wrap;word-break:break-word}.chat-reading-indicator{background:transparent;border:1px solid var(--border);padding:12px;display:inline-flex}.chat-reading-indicator__dots{display:flex;gap:6px;align-items:center}.chat-reading-indicator__dots span{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:reading-pulse 1.4s ease-in-out infinite}.chat-reading-indicator__dots span:nth-child(1){animation-delay:0s}.chat-reading-indicator__dots span:nth-child(2){animation-delay:.2s}.chat-reading-indicator__dots span:nth-child(3){animation-delay:.4s}@keyframes reading-pulse{0%,60%,to{opacity:.3;transform:scale(.8)}30%{opacity:1;transform:scale(1)}}.chat-split-container{display:flex;gap:0;flex:1;min-height:0;height:100%}.chat-main{position:relative;min-width:400px;display:flex;flex-direction:column;overflow:hidden;transition:flex .25s ease-out}.chat-sidebar{flex:1;min-width:300px;border-left:1px solid var(--border);display:flex;flex-direction:column;overflow:hidden;animation:slide-in .2s ease-out}@keyframes slide-in{0%{opacity:0;transform:translate(20px)}to{opacity:1;transform:translate(0)}}.sidebar-panel{display:flex;flex-direction:column;height:100%;background:var(--panel)}.sidebar-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border);flex-shrink:0;position:sticky;top:0;z-index:10;background:var(--panel)}.sidebar-header .btn{padding:4px 8px;font-size:14px;min-width:auto;line-height:1}.sidebar-title{font-weight:600;font-size:14px}.sidebar-content{flex:1;overflow:auto;padding:16px}.sidebar-markdown{font-size:14px;line-height:1.5}.sidebar-markdown pre{background:#0000001f;border-radius:4px;padding:12px;overflow-x:auto}.sidebar-markdown code{font-family:var(--mono);font-size:13px}@media(max-width:768px){.chat-split-container--open{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000}.chat-split-container--open .chat-main{display:none}.chat-split-container--open .chat-sidebar{width:100%;min-width:0;border-left:none}}.card{border:1px solid var(--border);background:var(--card);border-radius:var(--radius-lg);padding:20px;animation:rise .35s var(--ease-out) backwards;transition:border-color var(--duration-normal) var(--ease-out),box-shadow var(--duration-normal) var(--ease-out),transform var(--duration-normal) var(--ease-out);box-shadow:var(--shadow-sm),inset 0 1px 0 var(--card-highlight)}.card:hover{border-color:var(--border-strong);box-shadow:var(--shadow-md),inset 0 1px 0 var(--card-highlight)}.card-title{font-size:15px;font-weight:600;letter-spacing:-.02em;color:var(--text-strong)}.card-sub{color:var(--muted);font-size:13px;margin-top:6px;line-height:1.5}.stat{background:var(--card);border-radius:var(--radius-md);padding:14px 16px;border:1px solid var(--border);transition:border-color var(--duration-normal) var(--ease-out),box-shadow var(--duration-normal) var(--ease-out);box-shadow:inset 0 1px 0 var(--card-highlight)}.stat:hover{border-color:var(--border-strong);box-shadow:var(--shadow-sm),inset 0 1px 0 var(--card-highlight)}.stat-label{color:var(--muted);font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.04em}.stat-value{font-size:24px;font-weight:700;margin-top:6px;letter-spacing:-.03em;line-height:1.1}.stat-value.ok{color:var(--ok)}.stat-value.warn{color:var(--warn)}.stat-card{display:grid;gap:6px}.note-title{font-weight:600;letter-spacing:-.01em}.status-list{display:grid;gap:8px}.status-list div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--border)}.status-list div:last-child{border-bottom:none}.account-count{margin-top:10px;font-size:12px;font-weight:500;color:var(--muted)}.account-card-list{margin-top:16px;display:grid;gap:12px}.account-card{border:1px solid var(--border);border-radius:var(--radius-md);padding:12px;background:var(--bg-elevated);transition:border-color var(--duration-fast) ease}.account-card:hover{border-color:var(--border-strong)}.account-card-header{display:flex;justify-content:space-between;align-items:baseline;gap:12px}.account-card-title{font-weight:500}.account-card-id{font-family:var(--mono);font-size:12px;color:var(--muted)}.account-card-status{margin-top:10px;font-size:13px}.account-card-status div{padding:4px 0}.account-card-error{margin-top:8px;color:var(--danger);font-size:12px}.badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:500;line-height:1.4}.badge-baileys{background:#25d36626;color:#25d366}.badge-cloud{background:#007aff26;color:#007aff}.label{color:var(--muted);font-size:12px;font-weight:500}.pill{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);padding:6px 12px;border-radius:var(--radius-full);background:var(--secondary);font-size:13px;font-weight:500;transition:border-color var(--duration-fast) ease}.pill:hover{border-color:var(--border-strong)}.pill.danger{border-color:var(--danger-subtle);background:var(--danger-subtle);color:var(--danger)}.theme-toggle{--theme-item: 28px;--theme-gap: 2px;--theme-pad: 4px;position:relative}.theme-toggle__track{position:relative;display:grid;grid-template-columns:repeat(3,var(--theme-item));gap:var(--theme-gap);padding:var(--theme-pad);border-radius:var(--radius-full);border:1px solid var(--border);background:var(--secondary)}.theme-toggle__indicator{position:absolute;top:50%;left:var(--theme-pad);width:var(--theme-item);height:var(--theme-item);border-radius:var(--radius-full);transform:translateY(-50%) translate(calc(var(--theme-index, 0) * (var(--theme-item) + var(--theme-gap))));background:var(--accent);transition:transform var(--duration-normal) var(--ease-out);z-index:0}.theme-toggle__button{height:var(--theme-item);width:var(--theme-item);display:grid;place-items:center;border:0;border-radius:var(--radius-full);background:transparent;color:var(--muted);cursor:pointer;position:relative;z-index:1;transition:color var(--duration-fast) ease}.theme-toggle__button:hover{color:var(--text)}.theme-toggle__button.active{color:var(--accent-foreground)}.theme-toggle__button.active .theme-icon{stroke:var(--accent-foreground)}.theme-icon{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.statusDot{width:8px;height:8px;border-radius:var(--radius-full);background:var(--danger);box-shadow:0 0 8px #ef444480;animation:pulse-subtle 2s ease-in-out infinite}.statusDot.ok{background:var(--ok);box-shadow:0 0 8px #22c55e80;animation:none}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--border);background:var(--bg-elevated);padding:9px 16px;border-radius:var(--radius-md);font-size:13px;font-weight:500;letter-spacing:-.01em;cursor:pointer;transition:border-color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.btn:hover{background:var(--bg-hover);border-color:var(--border-strong);transform:translateY(-1px);box-shadow:var(--shadow-sm)}.btn:active{background:var(--secondary);transform:translateY(0);box-shadow:none}.btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.btn.primary{border-color:var(--accent);background:var(--accent);color:var(--primary-foreground);box-shadow:0 1px 2px #0003}.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);box-shadow:var(--shadow-md),0 0 20px var(--accent-glow)}.btn-kbd{display:inline-flex;align-items:center;justify-content:center;margin-left:6px;padding:2px 5px;font-family:var(--mono);font-size:11px;font-weight:500;line-height:1;border-radius:4px;background:#ffffff26;color:inherit;opacity:.8}.btn.primary .btn-kbd{background:#fff3}:root[data-theme=light] .btn-kbd{background:#00000014}:root[data-theme=light] .btn.primary .btn-kbd{background:#ffffff40}.btn.active{border-color:var(--accent);background:var(--accent-subtle);color:var(--accent)}.btn.danger{border-color:transparent;background:var(--danger-subtle);color:var(--danger)}.btn.danger:hover{background:#ef444426}.btn--sm{padding:6px 10px;font-size:12px}.btn:disabled{opacity:.5;cursor:not-allowed}.field{display:grid;gap:6px}.field.full{grid-column:1 / -1}.field span{color:var(--muted);font-size:13px;font-weight:500}.field input,.field textarea,.field select{border:1px solid var(--input);background:var(--card);border-radius:var(--radius-md);padding:8px 12px;outline:none;box-shadow:inset 0 1px 0 var(--card-highlight);transition:border-color var(--duration-fast) ease,box-shadow var(--duration-fast) ease}.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--ring);box-shadow:var(--focus-ring)}.field select{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding-right:36px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;cursor:pointer}.field textarea{font-family:var(--mono);min-height:160px;resize:vertical;white-space:pre;line-height:1.5}.field.checkbox{grid-template-columns:auto 1fr;align-items:center}.config-form .field.checkbox{grid-template-columns:18px minmax(0,1fr);column-gap:10px}.config-form .field.checkbox input[type=checkbox]{margin:0;width:16px;height:16px;accent-color:var(--accent)}.form-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}:root[data-theme=light] .field input,:root[data-theme=light] .field textarea,:root[data-theme=light] .field select{background:var(--card);border-color:var(--input)}:root[data-theme=light] .btn{background:var(--bg);border-color:var(--input)}:root[data-theme=light] .btn:hover{background:var(--bg-hover)}:root[data-theme=light] .btn.primary{background:var(--accent);border-color:var(--accent)}.muted{color:var(--muted)}.mono{font-family:var(--mono)}.callout{padding:14px 16px;border-radius:var(--radius-md);background:var(--secondary);border:1px solid var(--border);font-size:13px;line-height:1.5;position:relative}.callout.danger{border-color:#ef444440;background:linear-gradient(135deg,#ef444414,#ef44440a);color:var(--danger)}.callout.info{border-color:#3b82f640;background:linear-gradient(135deg,#3b82f614,#3b82f60a);color:var(--info)}.callout.success{border-color:#22c55e40;background:linear-gradient(135deg,#22c55e14,#22c55e0a);color:var(--ok)}.compaction-indicator{font-size:13px;padding:10px 12px;margin-bottom:8px;animation:fade-in .2s var(--ease-out)}.compaction-indicator--active{animation:compaction-pulse 1.5s ease-in-out infinite}.compaction-indicator--complete{animation:fade-in .2s var(--ease-out)}@keyframes compaction-pulse{0%,to{opacity:.7}50%{opacity:1}}.code-block{font-family:var(--mono);font-size:13px;line-height:1.5;background:var(--secondary);padding:12px;border-radius:var(--radius-md);border:1px solid var(--border);max-height:360px;overflow:auto;max-width:100%}:root[data-theme=light] .code-block,:root[data-theme=light] .list-item,:root[data-theme=light] .table-row,:root[data-theme=light] .chip{background:var(--bg)}.list{display:grid;gap:8px;container-type:inline-size}.list-item{display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,260px);gap:16px;align-items:start;border:1px solid var(--border);border-radius:var(--radius-md);padding:12px;background:var(--card);transition:border-color var(--duration-fast) ease}.list-item-clickable{cursor:pointer}.list-item-clickable:hover{border-color:var(--border-strong)}.list-item-selected{border-color:var(--accent);box-shadow:var(--focus-ring)}.list-main{display:grid;gap:4px;min-width:0}.list-title{font-weight:500}.list-sub{color:var(--muted);font-size:12px}.list-meta{text-align:right;color:var(--muted);font-size:12px;display:grid;gap:4px;min-width:200px}.list-meta .btn{padding:6px 10px}.list-meta .field input,.list-meta .field textarea,.list-meta .field select{width:100%}@container (max-width: 560px){.list-item{grid-template-columns:1fr}.list-meta{min-width:0;text-align:left}}.chip-row{display:flex;flex-wrap:wrap;gap:8px}.chip{font-size:12px;font-weight:500;border:1px solid var(--border);border-radius:var(--radius-full);padding:5px 12px;color:var(--muted);background:var(--secondary);transition:border-color var(--duration-fast) var(--ease-out),background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out)}.chip:hover{border-color:var(--border-strong);transform:translateY(-1px)}.chip input{margin-right:6px}.chip-ok{color:var(--ok);border-color:#22c55e4d;background:var(--ok-subtle)}.chip-warn{color:var(--warn);border-color:#f59e0b4d;background:var(--warn-subtle)}.table{display:grid;gap:6px}.table-head,.table-row{display:grid;grid-template-columns:1.4fr 1fr .8fr .7fr .8fr .8fr .8fr .8fr .6fr;gap:12px;align-items:center}.table-head{font-size:12px;font-weight:500;color:var(--muted);padding:0 12px}.table-row{border:1px solid var(--border);padding:10px 12px;border-radius:var(--radius-md);background:var(--card);transition:border-color var(--duration-fast) ease}.table-row:hover{border-color:var(--border-strong)}.session-link{text-decoration:none;color:var(--accent);font-weight:500}.session-link:hover{text-decoration:underline}.log-stream{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--card);max-height:500px;overflow:auto;container-type:inline-size}.log-row{display:flex;flex-direction:column;gap:4px;padding:8px 12px;border-bottom:1px solid var(--border);font-size:12px;transition:background var(--duration-fast) ease}.log-row:hover{background:var(--bg-hover)}.log-row:last-child{border-bottom:none}.log-row-header{display:flex;align-items:center;gap:8px}.log-time{color:var(--muted);font-family:var(--mono)}.log-level{font-size:11px;font-weight:500;border:1px solid var(--border);border-radius:var(--radius-sm);padding:2px 6px;width:fit-content}.log-level.trace,.log-level.debug{color:var(--muted)}.log-level.info{color:var(--info);border-color:#3b82f64d}.log-level.warn{color:var(--warn);border-color:var(--warn-subtle)}.log-level.error,.log-level.fatal{color:var(--danger);border-color:var(--danger-subtle)}.log-chip.trace,.log-chip.debug{color:var(--muted)}.log-chip.info{color:var(--info);border-color:#3b82f64d}.log-chip.warn{color:var(--warn);border-color:var(--warn-subtle)}.log-chip.error,.log-chip.fatal{color:var(--danger);border-color:var(--danger-subtle)}.log-subsystem{color:var(--muted);font-family:var(--mono)}.log-message{white-space:pre-wrap;word-break:break-word;font-family:var(--mono)}@container (max-width: 620px){.log-subsystem{display:none}.log-row-header{flex-wrap:wrap}}.session-log-type{font-size:11px;font-weight:500;border:1px solid var(--border);border-radius:var(--radius-sm);padding:2px 6px;width:fit-content}.session-log-type.user{color:var(--success);border-color:var(--success-subtle)}.session-log-type.assistant{color:var(--info);border-color:#3b82f64d}.session-log-type.tool{color:var(--warn);border-color:var(--warn-subtle)}.session-log-type.thinking{color:var(--muted);border-color:var(--border)}.session-log-type.error{color:var(--danger);border-color:var(--danger-subtle)}.session-log-type.system{color:var(--muted);border-color:var(--border)}.session-log-chip.user{color:var(--success);border-color:var(--success-subtle)}.session-log-chip.assistant{color:var(--info);border-color:#3b82f64d}.session-log-chip.tool{color:var(--warn);border-color:var(--warn-subtle)}.session-log-chip.thinking{color:var(--muted)}.session-log-chip.error{color:var(--danger);border-color:var(--danger-subtle)}.session-label{color:var(--muted);font-family:var(--mono)}.session-tool,.session-model{color:var(--muted);font-family:var(--mono);font-size:11px}.chat{display:flex;flex-direction:column;min-height:0}.shell--chat .chat{flex:1}.chat-header{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap}.chat-header__left{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;min-width:0}.chat-header__right{display:flex;align-items:center;gap:8px}.chat-session{min-width:240px}.chat-thread{margin-top:16px;display:flex;flex-direction:column;gap:12px;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:16px 12px;min-width:0;border-radius:0;border:none;background:transparent}.chat-queue{margin-top:12px;padding:12px;border-radius:var(--radius-lg);border:1px solid var(--border);background:var(--card);display:grid;gap:8px}.chat-queue__title{font-family:var(--mono);font-size:12px;font-weight:500;color:var(--muted)}.chat-queue__list{display:grid;gap:8px}.chat-queue__item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:12px;padding:10px 12px;border-radius:var(--radius-md);border:1px dashed var(--border-strong);background:var(--secondary)}.chat-queue__text{color:var(--chat-text);font-size:13px;line-height:1.45;white-space:pre-wrap;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.chat-queue__remove{align-self:start;padding:4px 10px;font-size:12px;line-height:1}.chat-line{display:flex}.chat-line.user{justify-content:flex-end}.chat-line.assistant,.chat-line.other{justify-content:flex-start}.chat-msg{display:grid;gap:6px;max-width:min(700px,82%)}.chat-line.user .chat-msg{justify-items:end}.chat-bubble{border:1px solid transparent;background:var(--card);border-radius:var(--radius-lg);padding:10px 14px;min-width:0}:root[data-theme=light] .chat-bubble{border-color:var(--border);background:var(--bg)}.chat-line.user .chat-bubble{border-color:transparent;background:var(--accent-subtle)}:root[data-theme=light] .chat-line.user .chat-bubble{border-color:#ea580c33;background:#fb923c1f}.chat-line.assistant .chat-bubble{border-color:transparent;background:var(--secondary)}:root[data-theme=light] .chat-line.assistant .chat-bubble{border-color:var(--border);background:var(--bg-muted)}@keyframes chatStreamPulse{0%,to{border-color:var(--border)}50%{border-color:var(--accent)}}.chat-bubble.streaming{animation:chatStreamPulse 1.5s ease-in-out infinite}@media(prefers-reduced-motion:reduce){.chat-bubble.streaming{animation:none;border-color:var(--accent)}}.chat-bubble.chat-reading-indicator{width:fit-content;padding:10px 16px}.chat-reading-indicator__dots{display:inline-flex;align-items:center;gap:4px;height:12px}.chat-reading-indicator__dots>span{display:inline-block;width:6px;height:6px;border-radius:var(--radius-full);background:var(--muted);opacity:.6;transform:translateY(0);animation:chatReadingDot 1.2s ease-in-out infinite;will-change:transform,opacity}.chat-reading-indicator__dots>span:nth-child(2){animation-delay:.15s}.chat-reading-indicator__dots>span:nth-child(3){animation-delay:.3s}@keyframes chatReadingDot{0%,80%,to{opacity:.4;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}@media(prefers-reduced-motion:reduce){.chat-reading-indicator__dots>span{animation:none;opacity:.6}}.chat-text{overflow-wrap:anywhere;word-break:break-word;color:var(--chat-text);line-height:1.5}.chat-text :where(p,ul,ol,pre,blockquote,table){margin:0}.chat-text :where(p+p,p+ul,p+ol,p+pre,p+blockquote,p+table){margin-top:.75em}.chat-text :where(ul,ol){padding-left:1.2em}.chat-text :where(li+li){margin-top:.25em}.chat-text :where(a){color:var(--accent)}.chat-text :where(a:hover){text-decoration:underline}.chat-text :where(blockquote){border-left:2px solid var(--border-strong);padding-left:12px;color:var(--muted)}.chat-text :where(hr){border:0;border-top:1px solid var(--border);margin:1em 0}.chat-text :where(code){font-family:var(--mono);font-size:.9em}.chat-text :where(:not(pre)>code){padding:.15em .35em;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--secondary)}:root[data-theme=light] .chat-text :where(:not(pre)>code){background:var(--bg-muted)}.chat-text :where(pre){margin-top:.75em;padding:10px 12px;border-radius:var(--radius-md);border:1px solid var(--border);background:var(--secondary);overflow:auto}:root[data-theme=light] .chat-text :where(pre){background:var(--bg-muted)}.chat-text :where(pre code){font-size:12px;white-space:pre}.chat-text :where(table){margin-top:.75em;border-collapse:collapse;width:100%;font-size:13px}.chat-text :where(th,td){border:1px solid var(--border);padding:6px 10px;vertical-align:top}.chat-text :where(th){font-family:var(--mono);font-weight:500;color:var(--muted);background:var(--secondary)}.chat-tool-card{margin-top:8px;padding:10px 12px;border-radius:var(--radius-md);border:1px solid var(--border);background:var(--secondary);display:grid;gap:4px}:root[data-theme=light] .chat-tool-card{background:var(--bg-muted)}.chat-tool-card__title{font-family:var(--mono);font-size:12px;font-weight:500;color:var(--text)}.chat-tool-card__detail{font-family:var(--mono);font-size:11px;color:var(--muted)}.chat-tool-card__details{margin-top:6px}.chat-tool-card__summary{font-family:var(--mono);font-size:11px;color:var(--muted);cursor:pointer;list-style:none;display:inline-flex;align-items:center;gap:6px}.chat-tool-card__summary::-webkit-details-marker{display:none}.chat-tool-card__summary-meta{color:var(--muted);opacity:.7}.chat-tool-card__details[open] .chat-tool-card__summary{color:var(--text)}.chat-tool-card__output{margin-top:8px;font-family:var(--mono);font-size:11px;line-height:1.5;white-space:pre-wrap;color:var(--chat-text);padding:8px 10px;border-radius:var(--radius-md);border:1px solid var(--border);background:var(--card)}:root[data-theme=light] .chat-tool-card__output{background:var(--bg)}.chat-stamp{font-size:11px;color:var(--muted)}.chat-line.user .chat-stamp{text-align:right}.chat-compose{margin-top:12px;display:flex;flex-direction:column;gap:10px}.shell--chat .chat-compose{position:sticky;bottom:0;z-index:5;margin-top:0;padding-top:12px;background:linear-gradient(180deg,transparent 0%,var(--bg) 40%)}.shell--chat-focus .chat-compose{bottom:calc(var(--shell-pad) + 8px);padding-bottom:calc(12px + env(safe-area-inset-bottom,0px));border-bottom-left-radius:var(--radius-lg);border-bottom-right-radius:var(--radius-lg)}.chat-compose__field{gap:4px}.chat-compose__field textarea{min-height:72px;padding:10px 14px;border-radius:var(--radius-lg);resize:vertical;white-space:pre-wrap;font-family:var(--font-body);line-height:1.5;border:1px solid var(--input);background:var(--card);box-shadow:inset 0 1px 0 var(--card-highlight);transition:border-color var(--duration-fast) ease,box-shadow var(--duration-fast) ease}.chat-compose__field textarea:focus{border-color:var(--ring);box-shadow:var(--focus-ring)}.chat-compose__field textarea:disabled{opacity:.5;cursor:not-allowed}.chat-compose__actions{justify-content:flex-end;align-self:end}@media(max-width:900px){.chat-session{min-width:180px}.chat-compose{grid-template-columns:1fr}}.qr-wrap{margin-top:16px;border-radius:var(--radius-md);background:var(--card);border:1px dashed var(--border-strong);padding:16px;display:inline-flex}.qr-wrap img{width:160px;height:160px;border-radius:var(--radius-sm);image-rendering:pixelated}.exec-approval-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000c;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:24px;z-index:200}.exec-approval-card{width:min(540px,100%);background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;animation:scale-in .2s var(--ease-out)}.exec-approval-header{display:flex;align-items:center;justify-content:space-between;gap:16px}.exec-approval-title{font-size:14px;font-weight:600}.exec-approval-sub{color:var(--muted);font-size:13px;margin-top:4px}.exec-approval-queue{font-size:11px;font-weight:500;color:var(--muted);border:1px solid var(--border);border-radius:var(--radius-full);padding:4px 10px}.exec-approval-command{margin-top:12px;padding:10px 12px;background:var(--secondary);border:1px solid var(--border);border-radius:var(--radius-md);word-break:break-word;white-space:pre-wrap;font-family:var(--mono);font-size:13px}.exec-approval-meta{margin-top:12px;display:grid;gap:6px;font-size:13px;color:var(--muted)}.exec-approval-meta-row{display:flex;justify-content:space-between;gap:12px}.exec-approval-meta-row span:last-child{color:var(--text);font-family:var(--mono)}.exec-approval-error{margin-top:10px;font-size:13px;color:var(--danger)}.exec-approval-actions{margin-top:16px;display:flex;flex-wrap:wrap;gap:8px}.event-status-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:20px}.event-status-bar__info{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted);flex-wrap:wrap}.event-status-bar__info .statusDot{flex-shrink:0}.event-status-bar__sep{color:var(--border-strong);-webkit-user-select:none;user-select:none}.event-grid{display:grid;gap:12px;grid-template-columns:repeat(2,1fr)}@media(max-width:600px){.event-grid{grid-template-columns:1fr}}.event-card{border:1px solid var(--border);background:var(--card);border-radius:var(--radius-md);padding:14px;cursor:pointer;transition:border-color var(--duration-fast) ease,box-shadow var(--duration-fast) ease,transform var(--duration-fast) ease;box-shadow:var(--shadow-sm),inset 0 1px 0 var(--card-highlight);display:flex;flex-direction:column;gap:8px}.event-card:hover{border-color:var(--border-strong);box-shadow:var(--shadow-md),inset 0 1px 0 var(--card-highlight);transform:translateY(-1px)}.event-card.disabled{opacity:.6}.event-card__header{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.event-card__name{font-weight:500;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.event-card__schedule{color:var(--muted);font-size:12px;line-height:1.4}.event-card__agent{color:var(--muted);font-size:11px;font-family:var(--mono)}.event-card__footer{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:auto}.event-card__status{display:flex;align-items:center;gap:6px}.event-card__actions{display:flex;align-items:center;gap:4px}.event-card__actions .btn-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid transparent;border-radius:var(--radius-sm);background:transparent;color:var(--muted);cursor:pointer;transition:color var(--duration-fast) ease,background var(--duration-fast) ease,border-color var(--duration-fast) ease}.event-card__actions .btn-icon:hover{color:var(--text);background:var(--bg-hover);border-color:var(--border)}.event-card__actions .btn-icon.danger:hover{color:var(--danger);background:var(--danger-subtle);border-color:var(--danger-subtle)}.event-card__actions .btn-icon svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.event-modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000b3;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:20px;z-index:200;animation:fade-in .15s var(--ease-out)}.event-modal-overlay *:focus,.event-modal-overlay *:focus-visible{outline:none!important;box-shadow:none}.event-modal{width:min(560px,100%);max-height:calc(100vh - 40px);overflow-y:auto;background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:24px;box-shadow:var(--shadow-xl);animation:scale-in .2s var(--ease-out)}.event-modal__header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.event-modal__title{font-size:16px;font-weight:600;letter-spacing:-.02em}.event-modal__close{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--border);border-radius:var(--radius-sm);background:transparent;color:var(--muted);cursor:pointer;transition:color var(--duration-fast) ease,background var(--duration-fast) ease;flex-shrink:0}.event-modal__close:hover{color:var(--text);background:var(--bg-hover)}.event-modal__close svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round}.event-detail-section{margin-top:16px;padding-top:16px;border-top:1px solid var(--border)}.event-detail-section:first-of-type{margin-top:0;padding-top:0;border-top:none}.event-detail-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:6px 0}.event-detail-label{color:var(--muted);font-size:13px;font-weight:500;flex-shrink:0}.event-detail-value{font-size:13px;text-align:right;word-break:break-word}.config-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:0;height:calc(100vh - 160px);margin:-16px;border-radius:var(--radius-xl);overflow:hidden;border:1px solid var(--border);background:var(--panel)}.config-sidebar{display:flex;flex-direction:column;background:var(--bg-accent);border-right:1px solid var(--border);min-height:0;overflow:hidden}:root[data-theme=light] .config-sidebar{background:var(--bg-hover)}.config-sidebar__header{display:flex;align-items:center;justify-content:space-between;padding:18px;border-bottom:1px solid var(--border)}.config-sidebar__title{font-weight:600;font-size:14px;letter-spacing:-.01em}.config-sidebar__footer{margin-top:auto;padding:14px;border-top:1px solid var(--border)}.config-search{position:relative;padding:14px;border-bottom:1px solid var(--border)}.config-search__icon{position:absolute;left:28px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--muted);pointer-events:none}.config-search__input{width:100%;padding:11px 36px 11px 42px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-elevated);font-size:13px;outline:none;transition:border-color var(--duration-fast) ease,box-shadow var(--duration-fast) ease,background var(--duration-fast) ease}.config-search__input::placeholder{color:var(--muted)}.config-search__input:focus{border-color:var(--accent);box-shadow:var(--focus-ring);background:var(--bg-hover)}:root[data-theme=light] .config-search__input{background:#fff}:root[data-theme=light] .config-search__input:focus{background:#fff}.config-search__clear{position:absolute;right:22px;top:50%;transform:translateY(-50%);width:22px;height:22px;border:none;border-radius:var(--radius-full);background:var(--bg-hover);color:var(--muted);font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background var(--duration-fast) ease,color var(--duration-fast) ease}.config-search__clear:hover{background:var(--border-strong);color:var(--text)}.config-nav{flex:1;overflow-y:auto;padding:10px}.config-nav__item{display:flex;align-items:center;gap:12px;width:100%;padding:11px 14px;border:none;border-radius:var(--radius-md);background:transparent;color:var(--muted);font-size:13px;font-weight:500;text-align:left;cursor:pointer;transition:background var(--duration-fast) ease,color var(--duration-fast) ease}.config-nav__item:hover{background:var(--bg-hover);color:var(--text)}:root[data-theme=light] .config-nav__item:hover{background:#0000000a}.config-nav__item.active{background:var(--accent-subtle);color:var(--accent)}.config-nav__icon{width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:15px;opacity:.7}.config-nav__item:hover .config-nav__icon,.config-nav__item.active .config-nav__icon{opacity:1}.config-nav__icon svg{width:18px;height:18px;stroke:currentColor;fill:none}.config-nav__label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-mode-toggle{display:flex;padding:4px;background:var(--bg-elevated);border-radius:var(--radius-md);border:1px solid var(--border)}:root[data-theme=light] .config-mode-toggle{background:#fff}.config-mode-toggle__btn{flex:1;padding:9px 14px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--muted);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--duration-fast) ease,color var(--duration-fast) ease,box-shadow var(--duration-fast) ease}.config-mode-toggle__btn:hover{color:var(--text)}.config-mode-toggle__btn.active{background:var(--accent);color:#fff;box-shadow:var(--shadow-sm)}.config-main{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--panel);overflow:hidden}.config-actions{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 22px;background:var(--bg-accent);border-bottom:1px solid var(--border)}:root[data-theme=light] .config-actions{background:var(--bg-hover)}.config-actions__left,.config-actions__right{display:flex;align-items:center;gap:10px}.config-changes-badge{padding:6px 14px;border-radius:var(--radius-full);background:var(--accent-subtle);border:1px solid rgba(255,77,77,.3);color:var(--accent);font-size:12px;font-weight:600}.config-status{font-size:13px;color:var(--muted)}.config-diff{margin:18px 22px 0;border:1px solid rgba(255,77,77,.25);border-radius:var(--radius-lg);background:var(--accent-subtle);overflow:hidden}.config-diff__summary{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;cursor:pointer;font-size:13px;font-weight:600;color:var(--accent);list-style:none}.config-diff__summary::-webkit-details-marker{display:none}.config-diff__chevron{width:16px;height:16px;transition:transform var(--duration-normal) var(--ease-out)}.config-diff__chevron svg{width:100%;height:100%}.config-diff[open] .config-diff__chevron{transform:rotate(180deg)}.config-diff__content{padding:0 18px 18px;display:grid;gap:10px}.config-diff__item{display:flex;align-items:baseline;gap:14px;padding:10px 14px;border-radius:var(--radius-md);background:var(--bg-elevated);font-size:12px;font-family:var(--mono)}:root[data-theme=light] .config-diff__item{background:#fff}.config-diff__path{font-weight:600;color:var(--text);flex-shrink:0}.config-diff__values{display:flex;align-items:baseline;gap:10px;min-width:0;flex-wrap:wrap}.config-diff__from{color:var(--danger);opacity:.85}.config-diff__arrow{color:var(--muted)}.config-diff__to{color:var(--ok)}.config-section-hero{display:flex;align-items:center;gap:16px;padding:16px 22px;border-bottom:1px solid var(--border);background:var(--bg-accent)}:root[data-theme=light] .config-section-hero{background:var(--bg-hover)}.config-section-hero__icon{width:30px;height:30px;color:var(--accent);display:flex;align-items:center;justify-content:center}.config-section-hero__icon svg{width:100%;height:100%;stroke:currentColor;fill:none}.config-section-hero__text{display:grid;gap:3px;min-width:0}.config-section-hero__title{font-size:16px;font-weight:600;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-section-hero__desc{font-size:13px;color:var(--muted)}.config-subnav{display:flex;gap:8px;padding:12px 22px 14px;border-bottom:1px solid var(--border);background:var(--bg-accent);overflow-x:auto}:root[data-theme=light] .config-subnav{background:var(--bg-hover)}.config-subnav__item{border:1px solid transparent;border-radius:var(--radius-full);padding:7px 14px;font-size:12px;font-weight:600;color:var(--muted);background:var(--bg-elevated);cursor:pointer;transition:background var(--duration-fast) ease,color var(--duration-fast) ease,border-color var(--duration-fast) ease;white-space:nowrap}:root[data-theme=light] .config-subnav__item{background:#fff}.config-subnav__item:hover{color:var(--text);border-color:var(--border)}.config-subnav__item.active{color:var(--accent);border-color:#ff4d4d66;background:var(--accent-subtle)}.config-content{flex:1;overflow-y:auto;padding:22px}.config-raw-field textarea{min-height:500px;font-family:var(--mono);font-size:13px;line-height:1.55}.config-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:80px 24px;color:var(--muted)}.config-loading__spinner{width:40px;height:40px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:var(--radius-full);animation:spin .75s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.config-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:80px 24px;text-align:center}.config-empty__icon{font-size:56px;opacity:.35}.config-empty__text{color:var(--muted);font-size:15px}.config-form--modern{display:grid;gap:26px}.config-section-card{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-elevated);overflow:hidden;transition:border-color var(--duration-fast) ease}.config-section-card:hover{border-color:var(--border-strong)}:root[data-theme=light] .config-section-card{background:#fff}.config-section-card__header{display:flex;align-items:flex-start;gap:16px;padding:20px 22px;background:var(--bg-accent);border-bottom:1px solid var(--border)}:root[data-theme=light] .config-section-card__header{background:var(--bg-hover)}.config-section-card__icon{width:34px;height:34px;color:var(--accent);flex-shrink:0}.config-section-card__icon svg{width:100%;height:100%}.config-section-card__titles{flex:1;min-width:0}.config-section-card__title{margin:0;font-size:17px;font-weight:600;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-section-card__desc{margin:5px 0 0;font-size:13px;color:var(--muted);line-height:1.45}.config-section-card__content{padding:22px}.cfg-fields{display:grid;gap:22px}.cfg-field{display:grid;gap:8px}.cfg-field--error{padding:14px;border-radius:var(--radius-md);background:var(--danger-subtle);border:1px solid rgba(239,68,68,.3)}.cfg-field__label{font-size:13px;font-weight:600;color:var(--text)}.cfg-field__help{font-size:12px;color:var(--muted);line-height:1.45}.cfg-field__error{font-size:12px;color:var(--danger)}.cfg-input-wrap{display:flex;gap:10px}.cfg-input{flex:1;padding:11px 14px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--bg-accent);font-size:14px;outline:none;transition:border-color var(--duration-fast) ease,box-shadow var(--duration-fast) ease,background var(--duration-fast) ease}.cfg-input::placeholder{color:var(--muted);opacity:.7}.cfg-input:focus{border-color:var(--accent);box-shadow:var(--focus-ring);background:var(--bg-hover)}:root[data-theme=light] .cfg-input{background:#fff}:root[data-theme=light] .cfg-input:focus{background:#fff}.cfg-input--sm{padding:9px 12px;font-size:13px}.cfg-input__reset{padding:10px 14px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-elevated);color:var(--muted);font-size:14px;cursor:pointer;transition:background var(--duration-fast) ease,color var(--duration-fast) ease}.cfg-input__reset:hover:not(:disabled){background:var(--bg-hover);color:var(--text)}.cfg-input__reset:disabled{opacity:.5;cursor:not-allowed}.cfg-textarea{width:100%;padding:12px 14px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background:var(--bg-accent);font-family:var(--mono);font-size:13px;line-height:1.55;resize:vertical;outline:none;transition:border-color var(--duration-fast) ease,box-shadow var(--duration-fast) ease}.cfg-textarea:focus{border-color:var(--accent);box-shadow:var(--focus-ring)}:root[data-theme=light] .cfg-textarea{background:#fff}.cfg-textarea--sm{padding:10px 12px;font-size:12px}.cfg-number{display:inline-flex;border:1px solid var(--border-strong);border-radius:var(--radius-md);overflow:hidden;background:var(--bg-accent)}:root[data-theme=light] .cfg-number{background:#fff}.cfg-number__btn{width:44px;border:none;background:var(--bg-elevated);color:var(--text);font-size:18px;font-weight:300;cursor:pointer;transition:background var(--duration-fast) ease}.cfg-number__btn:hover:not(:disabled){background:var(--bg-hover)}.cfg-number__btn:disabled{opacity:.4;cursor:not-allowed}:root[data-theme=light] .cfg-number__btn{background:var(--bg-hover)}:root[data-theme=light] .cfg-number__btn:hover:not(:disabled){background:var(--border)}.cfg-number__input{width:85px;padding:11px;border:none;border-left:1px solid var(--border);border-right:1px solid var(--border);background:transparent;font-size:14px;text-align:center;outline:none;-moz-appearance:textfield}.cfg-number__input::-webkit-outer-spin-button,.cfg-number__input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.cfg-select{padding:11px 40px 11px 14px;border:1px solid var(--border-strong);border-radius:var(--radius-md);background-color:var(--bg-accent);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;font-size:14px;cursor:pointer;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;transition:border-color var(--duration-fast) ease,box-shadow var(--duration-fast) ease}.cfg-select:focus{border-color:var(--accent);box-shadow:var(--focus-ring)}:root[data-theme=light] .cfg-select{background-color:#fff}.cfg-segmented{display:inline-flex;padding:4px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-accent)}:root[data-theme=light] .cfg-segmented{background:var(--bg-hover)}.cfg-segmented__btn{padding:9px 18px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--muted);font-size:13px;font-weight:500;cursor:pointer;transition:background var(--duration-fast) ease,color var(--duration-fast) ease,box-shadow var(--duration-fast) ease}.cfg-segmented__btn:hover:not(:disabled):not(.active){color:var(--text)}.cfg-segmented__btn.active{background:var(--accent);color:#fff;box-shadow:var(--shadow-sm)}.cfg-segmented__btn:disabled{opacity:.5;cursor:not-allowed}.cfg-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-accent);cursor:pointer;transition:background var(--duration-fast) ease,border-color var(--duration-fast) ease}.cfg-toggle-row:hover:not(.disabled){background:var(--bg-hover);border-color:var(--border-strong)}.cfg-toggle-row.disabled{opacity:.55;cursor:not-allowed}:root[data-theme=light] .cfg-toggle-row{background:#fff}:root[data-theme=light] .cfg-toggle-row:hover:not(.disabled){background:var(--bg-hover)}.cfg-toggle-row__content{flex:1;min-width:0}.cfg-toggle-row__label{display:block;font-size:14px;font-weight:500;color:var(--text)}.cfg-toggle-row__help{display:block;margin-top:3px;font-size:12px;color:var(--muted);line-height:1.45}.cfg-toggle{position:relative;flex-shrink:0}.cfg-toggle input{position:absolute;opacity:0;width:0;height:0}.cfg-toggle__track{display:block;width:50px;height:28px;background:var(--bg-elevated);border:1px solid var(--border-strong);border-radius:var(--radius-full);position:relative;transition:background var(--duration-normal) ease,border-color var(--duration-normal) ease}:root[data-theme=light] .cfg-toggle__track{background:var(--border)}.cfg-toggle__track:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;background:var(--text);border-radius:var(--radius-full);box-shadow:var(--shadow-sm);transition:transform var(--duration-normal) var(--ease-out),background var(--duration-normal) ease}.cfg-toggle input:checked+.cfg-toggle__track{background:var(--ok-subtle);border-color:#22c55e66}.cfg-toggle input:checked+.cfg-toggle__track:after{transform:translate(22px);background:var(--ok)}.cfg-toggle input:focus+.cfg-toggle__track{box-shadow:var(--focus-ring)}.cfg-object{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-accent);overflow:hidden}:root[data-theme=light] .cfg-object{background:#fff}.cfg-object__header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;cursor:pointer;list-style:none;transition:background var(--duration-fast) ease}.cfg-object__header:hover{background:var(--bg-hover)}.cfg-object__header::-webkit-details-marker{display:none}.cfg-object__title{font-size:14px;font-weight:600;color:var(--text)}.cfg-object__chevron{width:18px;height:18px;color:var(--muted);transition:transform var(--duration-normal) var(--ease-out)}.cfg-object__chevron svg{width:100%;height:100%}.cfg-object[open] .cfg-object__chevron{transform:rotate(180deg)}.cfg-object__help{padding:0 18px 14px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border)}.cfg-object__content{padding:18px;display:grid;gap:18px}.cfg-array{border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}.cfg-array__header{display:flex;align-items:center;gap:14px;padding:14px 18px;background:var(--bg-accent);border-bottom:1px solid var(--border)}:root[data-theme=light] .cfg-array__header{background:var(--bg-hover)}.cfg-array__label{flex:1;font-size:14px;font-weight:600;color:var(--text)}.cfg-array__count{font-size:12px;color:var(--muted);padding:4px 10px;background:var(--bg-elevated);border-radius:var(--radius-full)}:root[data-theme=light] .cfg-array__count{background:#fff}.cfg-array__add{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-elevated);color:var(--text);font-size:12px;font-weight:500;cursor:pointer;transition:background var(--duration-fast) ease}.cfg-array__add:hover:not(:disabled){background:var(--bg-hover)}.cfg-array__add:disabled{opacity:.5;cursor:not-allowed}.cfg-array__add-icon{width:14px;height:14px}.cfg-array__add-icon svg{width:100%;height:100%}.cfg-array__help{padding:12px 18px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border)}.cfg-array__empty{padding:36px 18px;text-align:center;color:var(--muted);font-size:13px}.cfg-array__items{display:grid;gap:1px;background:var(--border)}.cfg-array__item{background:var(--panel)}.cfg-array__item-header{display:flex;align-items:center;justify-content:space-between;padding:12px 18px;background:var(--bg-accent);border-bottom:1px solid var(--border)}:root[data-theme=light] .cfg-array__item-header{background:var(--bg-hover)}.cfg-array__item-index{font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.cfg-array__item-remove{width:30px;height:30px;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--radius-md);background:transparent;color:var(--muted);cursor:pointer;transition:background var(--duration-fast) ease,color var(--duration-fast) ease}.cfg-array__item-remove svg{width:16px;height:16px}.cfg-array__item-remove:hover:not(:disabled){background:var(--danger-subtle);color:var(--danger)}.cfg-array__item-remove:disabled{opacity:.4;cursor:not-allowed}.cfg-array__item-content{padding:18px}.cfg-map{border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}.cfg-map__header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 18px;background:var(--bg-accent);border-bottom:1px solid var(--border)}:root[data-theme=light] .cfg-map__header{background:var(--bg-hover)}.cfg-map__label{font-size:13px;font-weight:600;color:var(--muted)}.cfg-map__add{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-elevated);color:var(--text);font-size:12px;font-weight:500;cursor:pointer;transition:background var(--duration-fast) ease}.cfg-map__add:hover:not(:disabled){background:var(--bg-hover)}.cfg-map__add-icon{width:14px;height:14px}.cfg-map__add-icon svg{width:100%;height:100%}.cfg-map__empty{padding:28px 18px;text-align:center;color:var(--muted);font-size:13px}.cfg-map__items{display:grid;gap:10px;padding:14px}.cfg-map__item{display:grid;grid-template-columns:150px 1fr auto;gap:10px;align-items:start}.cfg-map__item-key,.cfg-map__item-value{min-width:0}.cfg-map__item-remove{width:34px;height:34px;display:flex;align-items:center;justify-content:center;border:none;border-radius:var(--radius-md);background:transparent;color:var(--muted);cursor:pointer;transition:background var(--duration-fast) ease,color var(--duration-fast) ease}.cfg-map__item-remove svg{width:16px;height:16px}.cfg-map__item-remove:hover:not(:disabled){background:var(--danger-subtle);color:var(--danger)}.pill--sm{padding:5px 12px;font-size:11px}.pill--ok{border-color:#22c55e59;color:var(--ok)}.pill--danger{border-color:#ef444459;color:var(--danger)}@media(max-width:768px){.config-layout{grid-template-columns:1fr}.config-sidebar{border-right:none;border-bottom:1px solid var(--border)}.config-sidebar__header{padding:14px 16px}.config-nav{display:flex;flex-wrap:nowrap;gap:6px;padding:10px 14px;overflow-x:auto;-webkit-overflow-scrolling:touch}.config-nav__item{flex:0 0 auto;padding:9px 14px;white-space:nowrap}.config-nav__label{display:inline}.config-sidebar__footer{display:none}.config-actions{flex-wrap:wrap;padding:14px 16px}.config-actions__left,.config-actions__right{width:100%;justify-content:center}.config-section-hero{padding:14px 16px}.config-subnav{padding:10px 16px 12px}.config-content{padding:18px}.config-section-card__header{padding:16px 18px}.config-section-card__content{padding:18px}.cfg-toggle-row{padding:14px 16px}.cfg-map__item{grid-template-columns:1fr;gap:10px}.cfg-map__item-remove{justify-self:end}}@media(max-width:480px){.config-nav__icon{width:26px;height:26px;font-size:17px}.config-nav__label{display:none}.config-section-card__icon{width:30px;height:30px}.config-section-card__title{font-size:16px}.cfg-segmented{flex-wrap:wrap}.cfg-segmented__btn{flex:1 0 auto;min-width:70px}}.setup-container{--tasker-black: #1a1a1a;--tasker-charcoal: #2d2d2d;--tasker-orange: var(--accent, #00d4ff);--tasker-orange-hover: var(--accent-hover, #00b8e0);--tasker-orange-glow: var(--accent-glow, rgba(0, 212, 255, .3));--tasker-white: #ffffff;--tasker-text-grey: #b0b0b0;--tasker-muted-grey: #888888;min-height:100vh;display:flex;align-items:flex-start;justify-content:center;background:linear-gradient(170deg,#1a1a1a,#111);padding:80px 20px 40px;position:relative;overflow-y:auto}.setup-container:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(rgba(255,107,0,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(255,107,0,.03) 1px,transparent 1px);background-size:60px 60px;pointer-events:none}.setup-card{background:var(--tasker-charcoal);border:1px solid rgba(255,255,255,.06);border-radius:16px;padding:32px 28px;text-align:center;max-width:420px;width:100%;box-shadow:0 24px 80px #00000080,0 0 0 1.5px #ffffff1a;position:relative;z-index:1;margin:auto 0}.setup-card h1{margin:0 0 12px;font-size:28px;font-weight:800;color:var(--tasker-white);letter-spacing:-.02em}.setup-card p{margin:0 0 24px;color:var(--tasker-text-grey);font-size:15px;line-height:1.6}.setup-qr{background:var(--tasker-white);padding:20px;border-radius:12px;display:inline-block;margin:24px 0;box-shadow:0 8px 32px #ff6b0024,0 0 60px #ff6b000f}.setup-qr img{display:block;width:256px;height:256px;image-rendering:pixelated}.setup-spinner{width:48px;height:48px;border:3px solid rgba(255,255,255,.1);border-top-color:var(--tasker-orange);border-radius:50%;animation:setup-spin .8s linear infinite;margin:0 auto 24px}@keyframes setup-spin{to{transform:rotate(360deg)}}.setup-success{border:2px solid var(--tasker-orange);box-shadow:0 0 40px #ff6b0026}.setup-success .setup-icon{width:72px;height:72px;background:var(--tasker-orange);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 24px;font-size:36px;color:var(--tasker-white);box-shadow:0 4px 20px var(--tasker-orange-glow)}.setup-waiting{color:var(--tasker-orange);font-weight:600;font-size:14px}.setup-error{color:#ef4444;background:#ef44441a;padding:12px 16px;border-radius:8px;border:1px solid rgba(239,68,68,.2)}.setup-hint{font-size:13px;color:var(--tasker-muted-grey);margin-top:8px}.setup-logo{height:72px;width:auto;margin-bottom:32px}.setup-steps{display:flex;justify-content:center;gap:32px;margin-bottom:32px}.setup-step{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--tasker-muted-grey)}.setup-step.active{color:var(--tasker-orange)}.setup-step.completed{color:var(--tasker-text-grey)}.setup-step-dot{width:12px;height:12px;border-radius:50%;border:2px solid currentColor;background:transparent}.setup-step.active .setup-step-dot{background:var(--tasker-orange);border-color:var(--tasker-orange);box-shadow:0 0 10px var(--tasker-orange-glow)}.setup-step.completed .setup-step-dot{background:var(--tasker-orange);border-color:var(--tasker-orange)}.setup-button{display:inline-block;padding:14px 28px;font-size:15px;font-weight:600;border-radius:10px;cursor:pointer;border:none;transition:all .2s ease;text-decoration:none;font-family:inherit}.setup-button.primary{background:var(--tasker-orange);color:var(--tasker-white);box-shadow:0 4px 14px var(--tasker-orange-glow)}.setup-button.primary:hover{background:var(--tasker-orange-hover);transform:translateY(-1px);box-shadow:0 6px 20px var(--tasker-orange-glow)}.setup-button:not(.primary){background:#ffffff1a;color:var(--tasker-white);border:1px solid rgba(255,255,255,.15)}.setup-button:not(.primary):hover{background:#ffffff26}.setup-button:disabled{opacity:.5;cursor:not-allowed;transform:none!important}.setup-divider{display:flex;align-items:center;margin:24px 0;color:var(--tasker-muted-grey);font-size:13px}.setup-divider:before,.setup-divider:after{content:"";flex:1;height:1px;background:#ffffff1a}.setup-divider span{padding:0 16px}.setup-code-input{display:flex;gap:12px;margin-top:16px}.setup-code-input input{flex:1;padding:14px 16px;font-size:15px;border-radius:10px;border:1px solid rgba(255,255,255,.15);background:#0000004d;color:var(--tasker-white);font-family:inherit;outline:none;transition:border-color .2s ease}.setup-code-input input:focus{border-color:#fff3}.setup-code-input input::placeholder{color:var(--tasker-muted-grey)}.setup-device-id{margin:16px 0 8px;padding:12px 16px;border-radius:10px;background:#0000004d;border:1px solid rgba(255,255,255,.1)}.setup-device-id-label{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--tasker-muted-grey);margin-bottom:4px}.setup-device-id-value{display:block;font-size:13px;font-family:SF Mono,Fira Code,Consolas,monospace;color:var(--tasker-orange);word-break:break-all;-webkit-user-select:all;user-select:all;cursor:text}.setup-device-id-copy{display:inline-block;margin-top:8px;background:#ffffff14;border:1px solid rgba(255,255,255,.15);border-radius:6px;color:var(--tasker-text-grey);font-size:11px;padding:4px 10px;cursor:pointer;transition:all .15s ease}.setup-device-id-copy:hover{background:#ffffff24;color:var(--tasker-white)}.setup-hint a.setup-link-danger{color:#ef4444;text-decoration:none;font-size:12px;opacity:.7;transition:opacity .15s ease}.setup-hint a.setup-link-danger:hover{color:#ef4444;opacity:1;text-decoration:underline}.setup-license-remove-confirm{margin-top:16px;padding:16px;border-radius:10px;background:#ef444414;border:1px solid rgba(239,68,68,.25)}.setup-license-remove-warning{font-size:14px;color:#ef4444;margin:0 0 14px;line-height:1.5}.setup-license-remove-actions{display:flex;gap:10px;justify-content:center}.setup-hint a{color:var(--tasker-orange);text-decoration:none}.setup-hint a:hover{text-decoration:underline}.setup-status-light{width:14px;height:14px;border-radius:50%;display:inline-block;flex-shrink:0;box-shadow:0 0 8px currentColor}.setup-status-row{display:flex;align-items:center;justify-content:center;gap:12px;font-size:22px;font-weight:700;color:var(--tasker-white);margin-bottom:16px}.setup-status-dashboard{display:flex;flex-direction:column;gap:8px;margin:16px 0;padding:12px;background:#0003;border-radius:12px;border:1px solid rgba(255,255,255,.08)}.setup-status-item{display:flex;align-items:center;gap:12px;padding:10px 14px;background:#0003;border-radius:8px}.setup-status-info{display:flex;flex-direction:column;align-items:flex-start;gap:2px;flex:1}.setup-status-info strong{font-size:15px;color:var(--tasker-white);font-weight:600}.setup-status-info span{font-size:13px;color:var(--tasker-text-grey)}.setup-model-select{background:#0000004d;color:var(--tasker-text-grey);border:1px solid rgba(255,255,255,.1);border-radius:4px;padding:3px 6px;font-size:12px;cursor:pointer;outline:none}.setup-model-select:focus,.setup-model-select:focus-visible{border-color:#fff3;box-shadow:none}.setup-link-btn{background:transparent;border:none;color:var(--accent, #00d4ff);font-size:13px;cursor:pointer;padding:4px 8px;border-radius:4px;transition:opacity .15s ease;white-space:nowrap}.setup-link-btn:hover{opacity:.8}.setup-link-btn:focus,.setup-link-btn:focus-visible{outline:none}.setup-status-action{background:transparent;border:1px solid rgba(255,255,255,.15);border-radius:6px;color:var(--tasker-text-grey);padding:8px;cursor:pointer;transition:all .15s ease;display:flex;align-items:center;justify-content:center}.setup-status-action svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.setup-status-action:hover:not(:disabled){background:#ffffff14;border-color:#ffffff40;color:var(--tasker-white)}.setup-status-action:disabled{opacity:.5;cursor:not-allowed}.setup-status-action.spinning svg{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.setup-success-message{font-size:18px;font-weight:600;color:#22c55e!important;margin-top:8px!important}.setup-warning{color:#eab308!important;background:#eab3081a;padding:12px 16px;border-radius:8px;border:1px solid rgba(234,179,8,.2);margin-bottom:16px}.setup-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:16px;padding-top:16px;border-top:1px solid rgba(255,255,255,.1)}.setup-button.secondary{background:transparent;color:var(--tasker-text-grey);border:1px solid rgba(255,255,255,.15)}.setup-button.secondary:hover{background:#ffffff0d;color:var(--tasker-white)}.setup-button.danger{background:transparent;color:#ef4444;border:1px solid rgba(239,68,68,.3)}.setup-button.danger:hover{background:#ef44441a}.setup-add-account{margin-top:12px;padding:16px;border-radius:8px;background:#ffffff0a;border:1px solid rgba(255,255,255,.08);text-align:left}.setup-add-account strong{font-size:14px;color:var(--tasker-white)}.setup-add-account-input{display:block;width:100%;margin-top:10px;padding:12px 14px;font-size:14px;border-radius:8px;border:1px solid rgba(255,255,255,.15);background:#0000004d;color:var(--tasker-white);font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .2s ease}.setup-add-account-input:focus{border-color:#fff3;outline:none}.setup-add-account-input::placeholder{color:var(--tasker-muted-grey)}.setup-add-account-actions{display:flex;gap:8px;margin-top:10px}.setup-add-account-actions .setup-button{padding:10px 20px;font-size:14px}.setup-page{min-height:100vh;background:linear-gradient(170deg,#1a1a1a,#111)}.setup-button.small{padding:8px 14px;font-size:13px}.sp-card{background:var(--tasker-charcoal);border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:24px;margin-top:24px}.sp-card-header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:8px}.sp-card-header h2{margin:0;font-size:18px;font-weight:600;color:var(--tasker-white)}.sp-form-row{display:flex;gap:12px;margin:16px 0}.sp-input{flex:1;padding:12px 14px;font-size:14px;border-radius:8px;border:1px solid rgba(255,255,255,.15);background:#0000004d;color:var(--tasker-white);font-family:inherit;outline:none;transition:border-color .2s ease}.sp-input:focus{border-color:#fff3}.sp-input::placeholder{color:var(--tasker-muted-grey)}.sp-input:disabled{opacity:.5}.sp-list{margin-top:16px;background:#0003;border:1px solid rgba(255,255,255,.08);border-radius:10px;overflow:hidden}.sp-list-empty{padding:24px;text-align:center;color:var(--tasker-muted-grey);font-size:14px}.sp-list-item{display:flex;align-items:center;gap:16px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.06)}.sp-list-item:last-child{border-bottom:none}.sp-list-item-main{flex:1;min-width:0}.sp-list-item-title{font-size:15px;font-weight:500;color:var(--tasker-white);font-family:SF Mono,Fira Code,monospace}.sp-list-item-sub{font-size:13px;color:var(--tasker-muted-grey);margin-top:2px}.sp-callout{margin-top:20px;padding:14px 16px;background:#0003;border:1px solid rgba(255,255,255,.08);border-radius:8px;font-size:13px;line-height:1.5;color:var(--tasker-text-grey)}.sp-callout code{background:#ffffff1a;padding:2px 6px;border-radius:4px;font-family:SF Mono,Fira Code,monospace;font-size:12px;color:var(--tasker-orange)}.sp-error{color:#ef4444;background:#ef44441a;padding:12px 16px;border-radius:8px;border:1px solid rgba(239,68,68,.2);font-size:14px}.sp-card-wide{max-width:720px}.sp-toolbar{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.sp-search-bar{display:flex;gap:8px;align-items:center;margin-top:12px}.sp-search-input{flex:1;padding:8px 12px;font-size:14px;background:#ffffff0d;border:1px solid rgba(255,255,255,.15);border-radius:6px;color:var(--tasker-white);outline:none}.sp-search-input::placeholder{color:var(--tasker-muted-grey)}.sp-search-agent-select{padding:8px 12px;font-size:13px;background:#ffffff0d;border:1px solid rgba(255,255,255,.15);border-radius:6px;color:var(--tasker-white);outline:none;min-width:140px}.sp-search-results{display:flex;flex-direction:column;gap:2px;margin-top:16px;background:#0003;border:1px solid rgba(255,255,255,.08);border-radius:10px;max-height:400px;overflow-y:auto;text-align:left}.sp-search-result{padding:10px 12px;cursor:pointer;border-bottom:1px solid rgba(255,255,255,.04)}.sp-search-result:last-child{border-bottom:none}.sp-search-result:hover{background:#ffffff0a}.sp-search-result.selected{background:#00d4ff14}.sp-search-result-header{display:flex;justify-content:space-between;align-items:center;gap:12px}.sp-search-result-path{font-size:13px;font-weight:600;color:var(--tasker-white);word-break:break-all}.sp-search-result-score{font-size:12px;font-weight:600;color:var(--tasker-orange);white-space:nowrap}.sp-search-result-meta{font-size:12px;color:var(--tasker-muted-grey);margin-top:2px}.sp-search-result-snippet{font-size:12px;color:var(--tasker-text-grey);margin:6px 0 0;white-space:pre-wrap;word-break:break-word;max-height:80px;overflow:hidden;line-height:1.4}.sp-file-tree{margin-top:16px;background:#0003;border:1px solid rgba(255,255,255,.08);border-radius:10px;max-height:340px;overflow-y:auto;text-align:left}.sp-tree-item{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:14px;color:var(--tasker-text-grey);cursor:pointer;transition:background .12s ease;border-bottom:1px solid rgba(255,255,255,.04);-webkit-user-select:none;user-select:none}.sp-tree-item:last-child{border-bottom:none}.sp-tree-item:hover{background:#ffffff0a}.sp-tree-item.selected{background:#00d4ff14;color:var(--tasker-white)}.sp-tree-dir{color:var(--tasker-white);font-weight:500}.sp-tree-chevron{width:16px;text-align:center;font-size:13px;color:var(--tasker-muted-grey);flex-shrink:0}.sp-tree-icon{flex-shrink:0;display:flex;align-items:center}.sp-tree-icon svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.sp-tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sp-tree-size{font-size:12px;color:var(--tasker-muted-grey);flex-shrink:0;margin-left:auto}.sp-badge{font-size:10px;padding:1px 6px;border-radius:4px;background:#ffffff14;color:var(--tasker-muted-grey);flex-shrink:0}.sp-tree-file[draggable=true]{cursor:grab}.sp-tree-file[draggable=true]:active{cursor:grabbing}.sp-drop-target{background:#00d4ff14!important;outline:2px dashed var(--tasker-orange);outline-offset:-2px}.sp-bulk-actions{margin-top:12px;display:flex;align-items:center;gap:12px;padding:10px 16px;background:#0003;border:1px solid rgba(255,255,255,.08);border-radius:10px}.sp-file-preview{margin-top:16px;background:#0003;border:1px solid rgba(255,255,255,.08);border-radius:10px;overflow:hidden;text-align:left}.sp-file-preview-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.06)}.sp-file-preview-header strong{color:var(--tasker-white);font-size:14px}.sp-file-preview-meta{font-size:12px;color:var(--tasker-muted-grey);margin-top:2px}.sp-file-actions{display:flex;gap:8px;flex-shrink:0}.sp-file-preview-body{padding:16px;max-height:300px;overflow:auto}.sp-file-code{font-family:SF Mono,Fira Code,Cascadia Code,monospace;font-size:13px;line-height:1.5;color:var(--tasker-text-grey);white-space:pre-wrap;word-break:break-all;margin:0}.sp-canvas-area{text-align:center}.sp-canvas-wrap{position:relative;display:inline-block;border:1px solid rgba(255,255,255,.08);border-radius:10px;overflow:hidden;background:#000}.sp-canvas-wrap.sp-input-active{border-color:var(--tasker-orange);box-shadow:0 0 16px var(--tasker-orange-glow)}.sp-canvas{display:block;max-width:100%;height:auto;cursor:default}.sp-canvas-wrap.sp-input-active .sp-canvas{cursor:crosshair}.sp-canvas-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:60px 24px;background:#0003;border:1px solid rgba(255,255,255,.08);border-radius:10px}.sp-canvas-placeholder p{margin:0;font-size:14px;color:var(--tasker-muted-grey)}.sp-canvas-placeholder-icon{color:var(--tasker-muted-grey);opacity:.5}.sp-canvas-placeholder-icon svg{width:48px;height:48px;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.sp-page-nav{display:flex;justify-content:center;gap:24px;margin-top:24px;padding-top:16px;border-top:1px solid rgba(255,255,255,.08)}.sp-page-nav a,.sp-page-nav-fixed a,.setup-header-nav a{color:var(--tasker-muted-grey);text-decoration:none;font-size:13px;transition:color .15s ease}.sp-page-nav a:hover,.sp-page-nav-fixed a:hover,.setup-header-nav a:hover{color:var(--tasker-orange)}.sp-page-nav-current{font-size:13px;color:var(--tasker-white);font-weight:600}.setup-header{position:fixed;top:0;left:0;right:0;background:#1a1a1aeb;border-bottom:1px solid rgba(255,255,255,.08);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);z-index:10}.setup-header-inner{position:relative;z-index:11;display:flex;align-items:center;justify-content:space-between;max-width:1060px;margin:0 auto;padding:10px 20px}.setup-header-logo{height:28px;width:auto}.setup-header-nav{display:flex;gap:20px;align-items:center;margin-left:24px}.setup-header-nav a{color:var(--tasker-muted-grey);text-decoration:none;font-size:13px}.setup-header-nav a:hover{color:var(--tasker-orange)}.setup-header-nav .sp-page-nav-current{color:var(--tasker-white)}.setup-header-right{display:flex;align-items:center;gap:12px;margin-left:auto}.nav-logout-btn{background:none;border:1px solid rgba(255,255,255,.15);color:#fff9;cursor:pointer;padding:6px 8px;border-radius:6px;display:flex;align-items:center;transition:color .2s,border-color .2s}.nav-logout-btn:hover{color:#fff;border-color:#ffffff4d}.nav-audit-btn{background:none;border:1px solid rgba(255,170,0,.3);color:#fa0;cursor:pointer;padding:6px 8px;border-radius:6px;display:flex;align-items:center;gap:4px;transition:color .2s,border-color .2s;position:relative}.nav-audit-btn:hover{color:#fc4;border-color:#ffaa0080}.nav-audit-badge{font-size:11px;font-weight:600;min-width:16px;text-align:center}.audit-modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;z-index:100;display:flex;align-items:center;justify-content:center;padding:20px}.audit-modal-card{background:var(--tasker-charcoal, #2d2d2d);border:1px solid rgba(255,255,255,.1);border-radius:12px;padding:24px;max-width:520px;width:100%;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 24px 80px #00000080}.audit-modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.audit-modal-header h3{margin:0;font-size:16px;font-weight:600;color:var(--tasker-white, #fff)}.audit-modal-close{background:none;border:none;color:#ffffff80;font-size:22px;cursor:pointer;padding:0 4px;line-height:1}.audit-modal-close:hover{color:#fff}.audit-modal-desc{font-size:13px;color:var(--tasker-muted-grey, #888);margin:0 0 16px;line-height:1.4}.audit-modal-empty{font-size:13px;color:var(--tasker-muted-grey, #888);text-align:center;padding:20px 0}.audit-modal-list{overflow-y:auto;max-height:50vh;display:flex;flex-direction:column;gap:8px;margin-bottom:16px}.audit-modal-entry{padding:8px 10px;background:#ffffff08;border-radius:6px;border:1px solid rgba(255,255,255,.06)}.audit-modal-entry-path{display:flex;align-items:center;gap:8px;margin-bottom:4px}.audit-modal-folder{font-size:10px;font-weight:600;text-transform:uppercase;padding:2px 6px;border-radius:3px;flex-shrink:0}.audit-modal-folder--shared{background:#ffaa0026;color:#fa0}.audit-modal-folder--public{background:#ff505026;color:#ff5050}.audit-modal-path-link{font-size:13px;color:var(--tasker-white, #fff);text-decoration:none;word-break:break-all}.audit-modal-path-link:hover{text-decoration:underline}.audit-modal-entry-meta{font-size:11px;color:var(--tasker-muted-grey, #888);display:flex;gap:8px}.audit-modal-agent{background:#ffffff0f;padding:0 5px;border-radius:3px}.audit-modal-clear{width:100%;margin-top:4px}.sp-workspace-selector{-moz-appearance:none;appearance:none;-webkit-appearance:none;background:#ffffff14;color:var(--tasker-white);border:1px solid rgba(255,255,255,.15);border-radius:6px;padding:5px 28px 5px 10px;font-size:13px;font-family:inherit;cursor:pointer;outline:none;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;background-size:10px;transition:border-color .15s}.sp-workspace-selector:hover{border-color:#ffffff4d}.sp-workspace-selector:focus,.sp-workspace-selector:focus-visible,.sp-workspace-selector:focus-within{border-color:#ffffff4d;outline:none!important;outline-color:transparent!important;box-shadow:none!important;-webkit-focus-ring-color:transparent}.sp-workspace-selector option{background:#1e1e2e;color:var(--tasker-white)}.nav-burger-checkbox{display:none}.nav-burger-button{display:none;cursor:pointer;padding:8px;margin:-8px;-webkit-tap-highlight-color:transparent}.nav-burger-icon{display:block;width:20px;height:2px;background:#fff;border-radius:1px;position:relative;transition:background .2s}.nav-burger-icon:before,.nav-burger-icon:after{content:"";display:block;width:20px;height:2px;background:#fff;border-radius:1px;position:absolute;left:0;transition:transform .25s ease,top .25s ease}.nav-burger-icon:before{top:-6px}.nav-burger-icon:after{top:6px}.nav-burger-checkbox:checked~.setup-header-inner .nav-burger-icon{background:transparent}.nav-burger-checkbox:checked~.setup-header-inner .nav-burger-icon:before{top:0;transform:rotate(45deg)}.nav-burger-checkbox:checked~.setup-header-inner .nav-burger-icon:after{top:0;transform:rotate(-45deg)}.setup-header-dropdown{position:relative;z-index:11;display:none;flex-direction:column;gap:4px;padding:8px 20px 16px;max-width:1060px;margin:0 auto}.setup-header-dropdown a,.setup-header-dropdown .sp-page-nav-current{display:block;padding:10px 0;font-size:14px;border-bottom:1px solid rgba(255,255,255,.06)}.setup-header-dropdown a{color:#888;text-decoration:none}.setup-header-dropdown a:hover{color:var(--accent, #00d4ff)}.setup-header-dropdown .sp-page-nav-current{color:#fff;font-weight:600}.nav-selector-inline{display:inline-flex}.nav-selector-mobile{display:none}@media(max-width:768px){.setup-header-nav,.nav-selector-inline{display:none}.nav-selector-mobile{display:block;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.06)}.nav-selector-mobile .sp-workspace-selector{width:100%;max-width:none}.nav-burger-button{display:block}.nav-burger-checkbox:checked~.setup-header-inner+.setup-header-dropdown{display:flex}}.setup-container--full{padding-top:88px;padding-bottom:0;min-height:100vh;align-items:stretch}.chat-viewport{width:100%;max-width:900px;flex:1;display:flex;flex-direction:column;min-height:0;margin:0 auto;padding:0 16px;text-align:left}.chat-viewport>.card.chat{border:none;background:transparent;padding:0;box-shadow:none;animation:none}.chat-viewport>.card.chat:hover{border-color:transparent;box-shadow:none}.chat-page{padding-bottom:0}.sp-card-advanced{max-width:1060px;width:100%;text-align:left;z-index:auto}.sp-card-advanced .table{overflow-x:auto}.sp-tabs{display:flex;gap:4px;margin-bottom:20px;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:12px}.sp-tab{padding:8px 16px;border:none;background:transparent;color:var(--tasker-muted-grey);font-size:14px;font-weight:500;cursor:pointer;border-radius:6px 6px 0 0;transition:color .15s ease,background .15s ease}.sp-tab:hover{color:var(--tasker-white);background:#ffffff0d}.sp-tab.active{color:var(--tasker-orange);border-bottom:2px solid var(--tasker-orange)}.setup-info-btn{background:transparent;border:1px solid rgba(255,255,255,.12);border-radius:50%;color:var(--tasker-muted-grey);width:22px;height:22px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:all .15s ease;flex-shrink:0;padding:0}.setup-info-btn:hover{background:#ffffff14;border-color:#ffffff40;color:var(--tasker-white)}.setup-info-btn svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.setup-info-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;z-index:100;display:flex;align-items:center;justify-content:center;padding:20px}.setup-info-card{background:var(--tasker-charcoal, #2d2d2d);border:1px solid rgba(255,255,255,.1);border-radius:12px;padding:24px;max-width:380px;width:100%;box-shadow:0 24px 80px #00000080}.setup-info-card h3{margin:0 0 16px;font-size:16px;font-weight:600;color:var(--tasker-white, #fff)}.setup-info-row{display:flex;justify-content:space-between;align-items:baseline;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.06);gap:12px}.setup-info-row:last-of-type{border-bottom:none}.setup-info-label{font-size:13px;color:var(--tasker-muted-grey, #888);flex-shrink:0}.setup-info-value{font-size:13px;color:var(--tasker-white, #fff);text-align:right;word-break:break-all}@media(max-width:480px){.setup-card{padding:32px 24px}.setup-qr img{width:200px;height:200px}.setup-card h1{font-size:24px}.setup-steps{gap:16px}.setup-step-label{display:none}.setup-code-input{flex-direction:column}}.setup-container,.setup-page,.login-overlay,.setup-info-overlay{--ring: transparent;--focus-ring: none}.setup-container *:focus,.setup-container *:focus-visible,.setup-page *:focus,.setup-page *:focus-visible,.login-overlay *:focus,.login-overlay *:focus-visible,.setup-info-overlay *:focus,.setup-info-overlay *:focus-visible{outline:none!important;box-shadow:none!important}.login-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:10000;display:flex;align-items:center;justify-content:center;background:#111}.login-card{display:flex;flex-direction:column;align-items:center;padding:48px 40px;max-width:360px;width:100%}.login-logo{width:56px;height:56px;margin-bottom:16px}.login-title{color:#fff;font-size:22px;font-weight:600;margin:0 0 4px}.login-subtitle{color:#888;font-size:14px;margin:0 0 28px;text-align:center}.login-form{display:flex;flex-direction:column;gap:12px;width:100%}.login-pin-input{width:100%;padding:14px 16px;font-size:20px;letter-spacing:8px;text-align:center;background:#1a1a1a;border:1px solid #333333;border-radius:8px;color:#fff;outline:none;transition:border-color .2s;box-sizing:border-box}.login-pin-input:focus{border-color:#555}.login-pin-input::placeholder{font-size:14px;letter-spacing:normal;color:#555}.login-error{color:#f44;font-size:13px;text-align:center;margin:0}.login-submit{width:100%;padding:14px;font-size:16px;font-weight:600;color:#000;background:var(--accent, #00d4ff);border:none;border-radius:8px;cursor:pointer;transition:opacity .2s}.login-submit:hover{opacity:.9}.login-submit:disabled{opacity:.5;cursor:not-allowed}.login-spinner{display:inline-block;width:18px;height:18px;border:2px solid rgba(0,0,0,.2);border-top-color:#000;border-radius:50%;animation:setup-spin .8s linear infinite;vertical-align:middle}.setup-button .login-spinner{border-color:#fff3;border-top-color:#fff}.login-account-select{width:100%;padding:12px 14px;font-size:15px;background:#1a1a1a;border:1px solid #333333;border-radius:8px;color:#fff;outline:none;cursor:pointer;-moz-appearance:none;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;background-size:10px;transition:border-color .2s;box-sizing:border-box}.login-account-select:focus{border-color:#555}.login-account-select option{background:#1a1a1a;color:#fff}.login-success{color:#22c55e;font-size:13px;text-align:center;margin:0}.login-link{color:var(--accent, #00d4ff);text-decoration:none;cursor:pointer}.login-link:hover{text-decoration:underline}.login-hint{color:#666;font-size:12px;text-align:center;margin:20px 0 0;line-height:1.5}.setup-apikey-list{padding:8px 0 16px;display:flex;flex-direction:column;gap:12px;max-height:calc(100vh - 200px);overflow-y:auto;-webkit-overflow-scrolling:touch}.setup-apikey-row{display:flex;flex-direction:column;gap:6px;padding:10px 12px;background:#ffffff08;border-radius:6px}.setup-apikey-info{display:flex;align-items:center;gap:8px}.setup-apikey-info strong{font-size:.9rem;color:#fff}.setup-apikey-category{font-size:.75rem;color:var(--tasker-muted-grey);background:#ffffff0f;padding:2px 8px;border-radius:3px}.setup-apikey-input{display:flex;align-items:center;gap:6px}.setup-apikey-input input{flex:1;min-width:0;background:#0000004d;border:1px solid rgba(255,255,255,.1);border-radius:4px;color:#fff;font-size:.85rem;padding:6px 10px;outline:none}.setup-apikey-input input:focus{border-color:#fff3}.setup-apikey-input input::placeholder{color:#555}.setup-apikey-save{padding:6px 10px;font-size:.8rem;min-width:50px}.setup-apikey-badge{font-size:.75rem;padding:2px 8px;border-radius:3px;white-space:nowrap}.setup-apikey-badge.saving{color:var(--tasker-text-grey, #999)}.setup-apikey-badge.saved{color:#22c55e;background:#22c55e1a}.setup-apikey-badge.removed{color:#eab308;background:#eab3081a}.setup-apikey-icon-btn{background:none;border:none;cursor:pointer;padding:4px;color:#ffffff59;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:color .15s}.setup-apikey-icon-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.setup-apikey-icon-btn:hover{color:#ffffffb3}.setup-apikey-icon-btn.active{color:var(--tasker-orange)}.setup-apikey-icon-btn.danger:hover{color:#ef4444}.setup-apikey-advanced{margin-top:4px;border-top:1px solid rgba(255,255,255,.06);padding-top:4px}.setup-apikey-advanced summary{cursor:pointer;font-size:12px;color:#ffffff73;padding:6px 0;-webkit-user-select:none;user-select:none}.setup-apikey-advanced summary:hover{color:#ffffffa6}.setup-update-progress{margin:12px 0 4px;padding:10px 12px;background:#ffffff08;border:1px solid rgba(255,255,255,.08);border-radius:8px;font-size:13px;line-height:1.5;max-height:300px;overflow-y:auto}.setup-update-step{display:flex;align-items:center;gap:8px;padding:2px 0;color:#ffffff80}.setup-update-step.done{color:#ffffffb3}.setup-update-step.failed{color:#ef4444}.setup-update-step.running{color:var(--tasker-white)}.setup-update-step-icon{width:16px;text-align:center;flex-shrink:0}.setup-update-check{color:#22c55e}.setup-update-cross{color:#ef4444}.setup-update-spinner{display:inline-block;width:12px;height:12px;border:2px solid rgba(255,255,255,.2);border-top-color:var(--tasker-white);border-radius:50%;animation:spin .8s linear infinite}.setup-update-step-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.setup-update-step-time{color:#ffffff59;font-size:12px;flex-shrink:0}.setup-update-status{margin-top:6px;padding-top:6px;border-top:1px solid rgba(255,255,255,.06);color:#fff9;font-size:12px}.customers-search{display:flex;gap:12px;align-items:stretch}.customers-search input{flex:1;padding:10px 14px;font-size:14px;border-radius:8px;border:1px solid rgba(255,255,255,.15);background:#0000004d;color:var(--tasker-white);font-family:inherit}.customers-search input::placeholder{color:#ffffff59}.customers-record{border:1px solid rgba(255,255,255,.08);border-radius:8px;margin-bottom:8px;overflow:hidden}.customers-record-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;cursor:pointer;transition:background .15s}.customers-record-header:hover{background:#ffffff0a}.customers-record-info{min-width:0;overflow:hidden}.customers-record-name{font-weight:600;color:var(--tasker-white);font-size:14px}.customers-record-phone{font-size:13px;color:#ffffff80;margin-left:8px}.customers-record-meta{font-size:12px;color:#ffffff59}.customers-record-fields{padding:0 16px 16px;border-top:1px solid rgba(255,255,255,.06)}.customers-field-row{display:flex;gap:8px;align-items:center;margin-top:8px}.customers-field-row input{padding:8px 12px;font-size:13px;border-radius:6px;border:1px solid rgba(255,255,255,.12);background:#0000004d;color:var(--tasker-white);font-family:inherit}.customers-field-row .field-key{width:140px;flex-shrink:0}.customers-field-row .field-value{flex:1}.customers-field-row .field-delete{padding:6px 10px;font-size:12px;flex-shrink:0}.customers-record-actions{display:flex;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid rgba(255,255,255,.06)}.customers-add-form{display:flex;flex-direction:column;gap:12px;padding:16px;background:#0003;border-radius:8px;margin-top:16px}.customers-add-form input{padding:10px 14px;font-size:14px;border-radius:8px;border:1px solid rgba(255,255,255,.15);background:#0000004d;color:var(--tasker-white);font-family:inherit}.customers-add-form input::placeholder{color:#ffffff59}.customers-add-form-buttons{display:flex;gap:8px}.customers-empty{text-align:center;color:#fff6;padding:32px 16px;font-size:14px}@media(max-width:520px){.customers-record-header{flex-direction:column;align-items:flex-start;gap:4px;padding:10px 12px}.customers-record-phone{margin-left:0;font-size:12px}.customers-record-meta{font-size:11px}.customers-field-row{flex-wrap:wrap}.customers-field-row .field-key{width:100%;flex-shrink:1}.customers-field-row .field-value{flex:1;min-width:0}.customers-record-fields{padding:0 12px 12px}.customers-record-actions{flex-wrap:wrap}.customers-search{flex-direction:column}.sp-toolbar{flex-wrap:wrap}}
|
|
@@ -2954,7 +2954,7 @@ ${a.text}`:l.join(", "):a.text;t.push({kind:"message",key:`queue:${a.id}`,messag
|
|
|
2954
2954
|
`}
|
|
2955
2955
|
</div>
|
|
2956
2956
|
</div>
|
|
2957
|
-
`}const Pv={trace:!0,debug:!0,info:!0,warn:!0,error:!0,fatal:!0},Rv={name:"",description:"",agentId:"",enabled:!0,scheduleKind:"every",scheduleAt:"",everyAmount:"30",everyUnit:"minutes",cronExpr:"0 7 * * *",cronTz:"",sessionTarget:"main",wakeMode:"next-heartbeat",payloadKind:"systemEvent",payloadText:"",deliver:!1,channel:"last",to:"",timeoutSeconds:"",postToMainPrefix:""};async function Iv(e){if(!(!e.client||!e.connected)&&!e.agentsLoading){e.agentsLoading=!0,e.agentsError=null;try{const t=await e.client.request("agents.list",{});t&&(e.agentsList=t)}catch(t){e.agentsError=String(t)}finally{e.agentsLoading=!1}}}async function hn(e){if(!(!e.client||!e.connected)&&!e.workspacesLoading){e.workspacesLoading=!0,e.workspacesError=null;try{const t=await e.client.request("workspaces.list",{});e.workspaces=t.workspaces}catch(t){e.workspacesError=String(t)}finally{e.workspacesLoading=!1}}}async function Nv(e,t){var s,i;if(!e.client||!e.connected||e.workspaceSaving)return;const n=t.name.trim();if(!n){e.workspacesError="Account name is required.";return}e.workspaceSaving=!0,e.workspacesError=null;try{const r=await e.client.request("config.get",{});e.configSnapshot=r;const o=r.hash;if(!o){e.workspacesError="Config hash missing; reload and retry.";return}const a={name:n,baseHash:o,whatsappAccountName:n};(s=t.workspacePath)!=null&&s.trim()&&(a.workspaceDir=t.workspacePath.trim());const l=await e.client.request("workspaces.create",a);e.addingWorkspace=!1,e.newWorkspaceName="",e.newWorkspacePath="",await hn(e),(i=t.onCreated)==null||i.call(t,l)}catch(r){e.workspacesError=String(r)}finally{e.workspaceSaving=!1}}async function Dv(e,t){if(!(!e.client||!e.connected)&&!e.workspaceSaving){e.workspaceSaving=!0,e.workspacesError=null;try{const n=await e.client.request("config.get",{});e.configSnapshot=n;const s=n.hash;if(!s){e.workspacesError="Config hash missing; reload and retry.";return}await e.client.request("workspaces.remove",{name:t,baseHash:s}),e.workspaceRemoveConfirm=null,await hn(e)}catch(n){e.workspacesError=String(n)}finally{e.workspaceSaving=!1}}}async function Ov(e,t,n){if(!(!e.client||!e.connected)){e.workspacesError=null;try{const s=await e.client.request("config.get",{});e.configSnapshot=s;const i=s.hash;if(!i){e.workspacesError="Config hash missing; reload and retry.";return}await e.client.request("workspaces.rename",{name:t,displayName:n,baseHash:i}),await hn(e)}catch(s){e.workspacesError=String(s)}}}const Fn=Object.freeze(Object.defineProperty({__proto__:null,createWorkspace:Nv,loadWorkspaces:hn,removeWorkspace:Dv,renameWorkspace:Ov},Symbol.toStringTag,{value:"Module"})),jc={WEBCHAT_UI:"webchat-ui",CONTROL_UI:"taskmaster-control-ui",SETUP_UI:"setup-ui",WEBCHAT:"webchat",CLI:"cli",GATEWAY_CLIENT:"gateway-client",MACOS_APP:"taskmaster-macos",IOS_APP:"taskmaster-ios",ANDROID_APP:"taskmaster-android",NODE_HOST:"node-host",TEST:"test",FINGERPRINT:"fingerprint",PROBE:"taskmaster-probe"},Ra=jc,Wi={WEBCHAT:"webchat",CLI:"cli",UI:"ui",BACKEND:"backend",NODE:"node",PROBE:"probe",TEST:"test"};new Set(Object.values(jc));new Set(Object.values(Wi));function Bv(e){const t=e.version??(e.nonce?"v2":"v1"),n=e.scopes.join(","),s=e.token??"",i=[t,e.deviceId,e.clientId,e.clientMode,e.role,n,String(e.signedAtMs),s];return t==="v2"&&i.push(e.nonce??""),i.join("|")}const Fv=4008;class Uv{constructor(t){this.opts=t,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.backoffMs=800}start(){this.closed=!1,this.connect()}stop(){var t;this.closed=!0,(t=this.ws)==null||t.close(),this.ws=null,this.flushPending(new Error("gateway client stopped"))}get connected(){var t;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN}connect(){this.closed||(this.ws=new WebSocket(this.opts.url),this.ws.onopen=()=>this.queueConnect(),this.ws.onmessage=t=>this.handleMessage(String(t.data??"")),this.ws.onclose=t=>{var s,i;const n=String(t.reason??"");this.ws=null,this.flushPending(new Error(`gateway closed (${t.code}): ${n}`)),(i=(s=this.opts).onClose)==null||i.call(s,{code:t.code,reason:n}),this.scheduleReconnect()},this.ws.onerror=()=>{})}scheduleReconnect(){if(this.closed)return;const t=this.backoffMs;this.backoffMs=Math.min(this.backoffMs*1.7,15e3),window.setTimeout(()=>this.connect(),t)}flushPending(t){for(const[,n]of this.pending)n.reject(t);this.pending.clear()}async sendConnect(){var u;if(this.connectSent)return;this.connectSent=!0,this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null);const t=typeof crypto<"u"&&!!crypto.subtle,n=["operator.admin","operator.approvals","operator.pairing"],s="operator";let i=null,r=!1,o=this.opts.token;if(t){i=await rp();const p=(u=lp({deviceId:i.deviceId,role:s}))==null?void 0:u.token;o=p??this.opts.token,r=!!(p&&this.opts.token)}const a=o||this.opts.password?{token:o,password:this.opts.password}:void 0;let l;if(t&&i){const p=Date.now(),d=this.connectNonce??void 0,f=Bv({deviceId:i.deviceId,clientId:this.opts.clientName??Ra.CONTROL_UI,clientMode:this.opts.mode??Wi.WEBCHAT,role:s,scopes:n,signedAtMs:p,token:o??null,nonce:d}),b=await op(i.privateKey,f);l={id:i.deviceId,publicKey:i.publicKey,signature:b,signedAt:p,nonce:d}}const c={minProtocol:3,maxProtocol:3,client:{id:this.opts.clientName??Ra.CONTROL_UI,version:this.opts.clientVersion??"dev",platform:this.opts.platform??navigator.platform??"web",mode:this.opts.mode??Wi.WEBCHAT,instanceId:this.opts.instanceId},role:s,scopes:n,device:l,caps:[],auth:a,userAgent:navigator.userAgent,locale:navigator.language};this.request("connect",c).then(p=>{var d,f,b;(d=p==null?void 0:p.auth)!=null&&d.deviceToken&&i&&cp({deviceId:i.deviceId,role:p.auth.role??s,token:p.auth.deviceToken,scopes:p.auth.scopes??[]}),this.backoffMs=800,(b=(f=this.opts).onHello)==null||b.call(f,p)}).catch(()=>{var p;r&&i&&up({deviceId:i.deviceId,role:s}),(p=this.ws)==null||p.close(Fv,"connect failed")})}handleMessage(t){var i,r,o,a,l;let n;try{n=JSON.parse(t)}catch{return}const s=n;if(s.type==="event"){const c=n;if(c.event==="connect.challenge"){const p=c.payload,d=p&&typeof p.nonce=="string"?p.nonce:null;d&&(this.connectNonce=d,this.sendConnect());return}const u=typeof c.seq=="number"?c.seq:null;u!==null&&(this.lastSeq!==null&&u>this.lastSeq+1&&((r=(i=this.opts).onGap)==null||r.call(i,{expected:this.lastSeq+1,received:u})),this.lastSeq=u);try{(a=(o=this.opts).onEvent)==null||a.call(o,c)}catch(p){console.error("[gateway] event handler error:",p)}return}if(s.type==="res"){const c=n,u=this.pending.get(c.id);if(!u)return;this.pending.delete(c.id),c.ok?u.resolve(c.payload):u.reject(new Error(((l=c.error)==null?void 0:l.message)??"request failed"));return}}request(t,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return Promise.reject(new Error("gateway not connected"));const s=Gi(),i={type:"req",id:s,method:t,params:n},r=new Promise((o,a)=>{this.pending.set(s,{resolve:l=>o(l),reject:a})});return this.ws.send(JSON.stringify(i)),r}queueConnect(){this.connectNonce=null,this.connectSent=!1,this.connectTimer!==null&&window.clearTimeout(this.connectTimer),this.connectTimer=window.setTimeout(()=>{this.sendConnect()},750)}}function Ki(e){return typeof e=="object"&&e!==null}function Wv(e){if(!Ki(e))return null;const t=typeof e.id=="string"?e.id.trim():"",n=e.request;if(!t||!Ki(n))return null;const s=typeof n.command=="string"?n.command.trim():"";if(!s)return null;const i=typeof e.createdAtMs=="number"?e.createdAtMs:0,r=typeof e.expiresAtMs=="number"?e.expiresAtMs:0;return!i||!r?null:{id:t,request:{command:s,cwd:typeof n.cwd=="string"?n.cwd:null,host:typeof n.host=="string"?n.host:null,security:typeof n.security=="string"?n.security:null,ask:typeof n.ask=="string"?n.ask:null,agentId:typeof n.agentId=="string"?n.agentId:null,resolvedPath:typeof n.resolvedPath=="string"?n.resolvedPath:null,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:null},createdAtMs:i,expiresAtMs:r}}function Kv(e){if(!Ki(e))return null;const t=typeof e.id=="string"?e.id.trim():"";return t?{id:t,decision:typeof e.decision=="string"?e.decision:null,resolvedBy:typeof e.resolvedBy=="string"?e.resolvedBy:null,ts:typeof e.ts=="number"?e.ts:null}:null}function Hc(e){const t=Date.now();return e.filter(n=>n.expiresAtMs>t)}function zv(e,t){const n=Hc(e).filter(s=>s.id!==t.id);return n.push(t),n}function Ia(e,t){return Hc(e).filter(n=>n.id!==t)}async function qc(e,t){if(!e.client||!e.connected)return;const n=e.sessionKey.trim(),s=n?{sessionKey:n}:{};try{const i=await e.client.request("agent.identity.get",s);if(!i)return;const r=mi(i);e.assistantName=r.name,e.assistantAvatar=r.avatar,e.assistantAgentId=r.agentId??null}catch{}}const cs="taskmaster_update_pending";async function Gc(e){var t,n;if(!(!e.client||!e.connected)&&!e.updateChecking){e.updateChecking=!0,e.updateMessage=null,(t=e.requestUpdate)==null||t.call(e);try{const s=await e.client.request("update.status",{});e.currentVersion=s.current,e.latestVersion=s.latest,e.updateAvailable=s.updateAvailable,e.updateMessage=s.updateAvailable?`v${s.latest} available`:"Up to date"}catch(s){e.updateMessage=`Check failed: ${String(s)}`,e.updateAvailable=null}finally{e.updateChecking=!1,(n=e.requestUpdate)==null||n.call(e)}}}async function jv(e){var t,n,s,i;if(!(!e.client||e.updateRunning)){e.updateRunning=!0,e.updateMessage="Starting update...",e.updateProgressSteps=[],e.updateLastResult=null,(t=e.requestUpdate)==null||t.call(e);try{localStorage.setItem(cs,String(Date.now()))}catch{}try{const r=await e.client.request("update.run",{restartDelayMs:2e3,note:"Update from setup page"});if(r.ok&&r.result.status==="ok")e.updateMessage="Updated — restarting gateway...",(n=e.requestUpdate)==null||n.call(e);else if(r.ok&&r.result.status==="skipped")nn(),e.updateMessage=r.result.reason||"Update skipped",e.updateRunning=!1,(s=e.requestUpdate)==null||s.call(e);else throw nn(),new Error(r.result.reason||"Update failed")}catch(r){nn(),e.updateMessage=`Update failed: ${String(r)}`,e.updateRunning=!1,e.updateProgressSteps=[],(i=e.requestUpdate)==null||i.call(e)}}}function Hv(e,t){var s,i,r;const n=t.phase;if(n==="step-start"){const o=t.name,a=t.index,l=t.total;e.updateMessage=`Updating: ${o} (${a+1}/${l})`;const c=e.updateProgressSteps.find(u=>u.index===a);c?(c.status="running",c.name=o):e.updateProgressSteps=[...e.updateProgressSteps,{name:o,index:a,total:l,status:"running"}],(s=e.requestUpdate)==null||s.call(e)}else if(n==="step-done"){const o=t.name,a=t.index,l=t.total,c=t.ok,u=t.durationMs,p=e.updateProgressSteps.find(d=>d.index===a);p?(p.status=c?"done":"failed",p.durationMs=u):e.updateProgressSteps=[...e.updateProgressSteps,{name:o,index:a,total:l,status:c?"done":"failed",durationMs:u}],e.updateMessage=c?`Updating: ${o} done (${a+1}/${l})`:`Update step failed: ${o}`,(i=e.requestUpdate)==null||i.call(e)}else if(n==="complete"){if(t.status==="ok")e.updateMessage="Update complete — restarting gateway...";else{const a=t.reason;e.updateMessage=a?`Update failed: ${a}`:"Update failed",e.updateRunning=!1,nn()}(r=e.requestUpdate)==null||r.call(e)}}async function qv(e){var n,s,i,r;if(!e.client||!e.connected)return;const t=Vv();nn();try{const o=await e.client.request("update.lastResult",{});if(!o.ok||!o.result)return;const a=5*6e4,l=Date.now()-o.result.ts<a;if(!t&&!l)return;e.updateLastResult=o.result;const c=(n=o.result.after)==null?void 0:n.version;if(o.result.status==="ok"&&c&&(e.currentVersion=c),e.updateAvailable=!1,o.result.status==="ok"){const u=(s=o.result.before)==null?void 0:s.version,p=c??o.result.currentVersion;e.updateMessage=u?`Updated: v${u} → v${p}`:`Updated to v${p}`}else{const u=o.result.reason??((i=o.result.failedStep)==null?void 0:i.name)??"unknown error";e.updateMessage=`Update failed: ${u}`}}catch{}finally{e.updateRunning=!1,e.updateProgressSteps=[],(r=e.requestUpdate)==null||r.call(e)}}function Gv(e){var t;e.updateLastResult=null,(t=e.requestUpdate)==null||t.call(e)}function Vv(){try{const e=localStorage.getItem(cs);return e?Date.now()-Number(e)>30*6e4?(localStorage.removeItem(cs),!1):!0:!1}catch{return!1}}function nn(){try{localStorage.removeItem(cs)}catch{}}function hi(e,t){var a,l,c;const n=(e??"").trim(),s=(a=t.mainSessionKey)==null?void 0:a.trim();if(!s)return n;if(!n)return s;const i=((l=t.mainKey)==null?void 0:l.trim())||"main",r=(c=t.defaultAgentId)==null?void 0:c.trim();return n==="main"||n===i||r&&(n===`agent:${r}:main`||n===`agent:${r}:${i}`)?s:n}function Qv(e,t){if(!(t!=null&&t.mainSessionKey))return;const n=hi(e.sessionKey,t),s=hi(e.settings.sessionKey,t),i=hi(e.settings.lastActiveSessionKey,t),r=n||s||e.sessionKey,o={...e.settings,sessionKey:s||r,lastActiveSessionKey:i||r},a=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;r!==e.sessionKey&&(e.sessionKey=r),a&&Be(e,o)}function _e(e){var s;e.lastError=null,e.hello=null,e.connected=!1,e.execApprovalQueue=[],e.execApprovalError=null;const n=e.setup||e.filesPage||e.browserPage||e.chatPage||e.adminsPage||e.customersPage||e.advancedPage?"setup-ui":"taskmaster-control-ui";(s=e.client)==null||s.stop(),e.client=new Uv({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:n,mode:"webchat",onHello:i=>{e.connected=!0,e.lastError=null,e.hello=i,ns()&&(yr(),e.uninstallDone=!1),Zv(e,i),e.handleAccessCheck(),qv(e).then(()=>{Gc(e)}),qc(e),Iv(e),(e.chatPage||e.setup)&&Jv(e),ir(e,{quiet:!0}),sr(e,{quiet:!0}),hn(e).then(()=>{e.initWorkspaceSelection()}),e.setup&&(Ae(e),eb(e)),hr(e)},onClose:({code:i,reason:r})=>{e.connected=!1,i!==1012&&(e.lastError=`disconnected (${i}): ${r||"no reason"}`)},onEvent:i=>Yv(e,i),onGap:({expected:i,received:r})=>{e.lastError=`event gap detected (expected seq ${i}, got ${r}); refresh recommended`}}),e.client.start()}function Yv(e,t){try{Xv(e,t)}catch(n){console.error("[gateway] handleGatewayEvent error:",t.event,n)}}function Xv(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),e.tab==="debug"&&(e.eventLog=e.eventLogBuffer),t.event==="agent"){if(e.onboarding)return;pd(e,t.payload);return}if(t.event==="chat"){const n=t.payload;n!=null&&n.sessionKey&&Rl(e,n.sessionKey);const s=tl(e,n);(s==="final"||s==="error"||s==="aborted")&&(Qi(e),sh(e)),s==="final"&&Me(e);return}if(t.event==="presence"){const n=t.payload;n!=null&&n.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event==="cron"&&e.tab==="cron"&&fr(e),(t.event==="device.pair.requested"||t.event==="device.pair.resolved")&&sr(e,{quiet:!0}),t.event==="exec.approval.requested"){const n=Wv(t.payload);if(n){e.execApprovalQueue=zv(e.execApprovalQueue,n),e.execApprovalError=null;const s=Math.max(0,n.expiresAtMs-Date.now()+500);window.setTimeout(()=>{e.execApprovalQueue=Ia(e.execApprovalQueue,n.id)},s)}return}if(t.event==="browser.screencast.frame"){pv(e,t.payload);return}if(t.event==="browser.handoff"){hv(e,t.payload),e.browserPage||(window.location.href="/browser");return}if(t.event==="browser.handoff.resolved"){fv(e);return}if(t.event==="exec.approval.resolved"){const n=Kv(t.payload);n&&(e.execApprovalQueue=Ia(e.execApprovalQueue,n.id));return}if(t.event==="update.progress"){Hv(e,t.payload);return}}function Zv(e,t){const n=t.snapshot;n!=null&&n.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n!=null&&n.health&&(e.debugHealth=n.health),n!=null&&n.sessionDefaults&&Qv(e,n.sessionDefaults)}async function Jv(e){if(!(!e.client||!e.connected))try{const t=await e.client.request("models.list",{});Array.isArray(t==null?void 0:t.models)&&(e.chatModelCatalog=t.models)}catch{}}async function eb(e){if(!(!e.client||!e.connected))try{e.apiKeyProviders=await Ui(e.client)}catch{}}function tb(e){e.basePath=Hp();const t=We();if(ch(t.accentColor),window.scrollTo(0,0),Bp(e),e.setup){document.title=`${t.name} Setup`,_e(e);return}if(e.filesPage){document.title=`${t.name} Files`,Up(e),_e(e);return}if(e.browserPage){document.title=`${t.name} Browser`,_e(e);return}if(e.adminsPage){document.title=`${t.name} Admins`,_e(e);return}if(e.customersPage){document.title=`${t.name} Customers`,_e(e);return}if(e.chatPage){document.title=`${t.name} Chat`,_e(e);return}if(e.advancedPage){document.title=`${t.name} Advanced`,_e(e);return}Qp(e,!0),qp(e),Gp(e),window.addEventListener("popstate",e.popStateHandler),Kp(e),_e(e),Dp(e),e.tab==="logs"&&(e.logsSubTab==="session"?cr(e):ar(e)),e.tab==="debug"&&dr(e)}function nb(e){bd(e)}function sb(e){var t;window.removeEventListener("popstate",e.popStateHandler),Op(e),lr(e),ur(e),pr(e),Fp(e),Wp(e),Vp(e),(t=e.topbarObserver)==null||t.disconnect(),e.topbarObserver=null}function ib(e,t){if(e.filesPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleFilesLoad&&e.handleFilesLoad(),e.adminsPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleAdminsLoad&&e.handleAdminsLoad(),e.customersPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleCustomersLoad&&e.handleCustomersLoad(),e.chatPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleChatLoad&&e.handleChatLoad(),e.advancedPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleAdvancedLoad&&e.handleAdvancedLoad(),e.setup&&e.connected){const n=t.has("connected")&&t.get("connected")===!1;n&&e.handleLicenseStatusCheck&&e.licenseValid===null&&!e.licenseBusy&&e.handleLicenseStatusCheck(),n&&e.handleUpdateCheck&&e.handleUpdateCheck();const s=t.has("setupStep")&&e.setupStep==="auth";(n||s)&&e.setupStep==="auth"&&(e.authConnected===!0?e.setupStep="whatsapp":e.handleAuthStatusCheck&&e.authConnected===null&&!e.authBusy&&e.handleAuthStatusCheck()),e.setupStep==="whatsapp"&&t.has("setupStep")&&e.client&&!e.channelsLoading&&(e.channelsLoading=!0,e.client.request("channels.status",{probe:!0,timeoutMs:8e3}).then(r=>{e.channelsSnapshot=r,e.channelsLoading=!1}).catch(()=>{e.channelsLoading=!1})),t.has("whatsappLoginConnected")&&e.whatsappLoginConnected===!0&&e.client&&!e.channelsLoading&&(e.channelsLoading=!0,e.client.request("channels.status",{probe:!0,timeoutMs:8e3}).then(i=>{e.channelsSnapshot=i,e.channelsLoading=!1}).catch(()=>{e.channelsLoading=!1}))}if(e.tab==="chat"&&!e.advancedPage&&(t.has("chatMessages")||t.has("chatToolMessages")||t.has("chatStream")||t.has("chatLoading")||t.has("tab"))){const n=t.has("tab"),s=t.has("chatLoading")&&t.get("chatLoading")===!0&&e.chatLoading===!1;ln(e,n||s||!e.chatHasAutoScrolled)}e.tab==="logs"&&!e.advancedPage&&(t.has("logsEntries")||t.has("logsAutoFollow")||t.has("tab"))&&e.logsAutoFollow&&e.logsAtBottom&&nl(e,t.has("tab")||t.has("logsAutoFollow"))}function rb(e){const t={name:(e==null?void 0:e.name)??"",displayName:(e==null?void 0:e.displayName)??"",about:(e==null?void 0:e.about)??"",picture:(e==null?void 0:e.picture)??"",banner:(e==null?void 0:e.banner)??"",website:(e==null?void 0:e.website)??"",nip05:(e==null?void 0:e.nip05)??"",lud16:(e==null?void 0:e.lud16)??""};return{values:t,original:{...t},saving:!1,importing:!1,error:null,success:null,fieldErrors:{},showAdvanced:!!(e!=null&&e.banner||e!=null&&e.website||e!=null&&e.nip05||e!=null&&e.lud16)}}async function ob(e,t,n){await Yi(e,t,n),await q(e,!0)}async function ab(e,t){await rl(e,t),await q(e,!0)}async function lb(e,t){await ol(e,t),await q(e,!0)}async function cb(e,t){await al(e,t)}async function ub(e,t){await ll(e,t)}async function db(e){await Sd(e),await Ae(e),await q(e,!0)}async function pb(e){await Ae(e),await q(e,!0)}function hb(e){if(!Array.isArray(e))return{};const t={};for(const n of e){if(typeof n!="string")continue;const[s,...i]=n.split(":");if(!s||i.length===0)continue;const r=s.trim(),o=i.join(":").trim();r&&o&&(t[r]=o)}return t}function Vc(e){var n,s,i;return((i=(((s=(n=e.channelsSnapshot)==null?void 0:n.channelAccounts)==null?void 0:s.nostr)??[])[0])==null?void 0:i.accountId)??e.nostrProfileAccountId??"default"}function Qc(e,t=""){return`/api/channels/nostr/${encodeURIComponent(e)}/profile${t}`}function fb(e,t,n){e.nostrProfileAccountId=t,e.nostrProfileFormState=rb(n??void 0)}function gb(e){e.nostrProfileFormState=null,e.nostrProfileAccountId=null}function mb(e,t,n){const s=e.nostrProfileFormState;s&&(e.nostrProfileFormState={...s,values:{...s.values,[t]:n},fieldErrors:{...s.fieldErrors,[t]:""}})}function yb(e){const t=e.nostrProfileFormState;t&&(e.nostrProfileFormState={...t,showAdvanced:!t.showAdvanced})}async function vb(e){const t=e.nostrProfileFormState;if(!t||t.saving)return;const n=Vc(e);e.nostrProfileFormState={...t,saving:!0,error:null,success:null,fieldErrors:{}};try{const s=await fetch(Qc(n),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.values)}),i=await s.json().catch(()=>null);if(!s.ok||(i==null?void 0:i.ok)===!1||!i){const r=(i==null?void 0:i.error)??`Profile update failed (${s.status})`;e.nostrProfileFormState={...t,saving:!1,error:r,success:null,fieldErrors:hb(i==null?void 0:i.details)};return}if(!i.persisted){e.nostrProfileFormState={...t,saving:!1,error:"Profile publish failed on all relays.",success:null};return}e.nostrProfileFormState={...t,saving:!1,error:null,success:"Profile published to relays.",fieldErrors:{},original:{...t.values}},await q(e,!0)}catch(s){e.nostrProfileFormState={...t,saving:!1,error:`Profile update failed: ${String(s)}`,success:null}}}async function bb(e){const t=e.nostrProfileFormState;if(!t||t.importing)return;const n=Vc(e);e.nostrProfileFormState={...t,importing:!0,error:null,success:null};try{const s=await fetch(Qc(n,"/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoMerge:!0})}),i=await s.json().catch(()=>null);if(!s.ok||(i==null?void 0:i.ok)===!1||!i){const l=(i==null?void 0:i.error)??`Profile import failed (${s.status})`;e.nostrProfileFormState={...t,importing:!1,error:l,success:null};return}const r=i.merged??i.imported??null,o=r?{...t.values,...r}:t.values,a=!!(o.banner||o.website||o.nip05||o.lud16);e.nostrProfileFormState={...t,importing:!1,values:o,error:null,success:i.saved?"Profile imported from relays. Review and publish.":"Profile imported. Review and publish.",showAdvanced:a},i.saved&&await q(e,!0)}catch(s){e.nostrProfileFormState={...t,importing:!1,error:`Profile import failed: ${String(s)}`,success:null}}}async function wb(e){if(e.client){e.authBusy=!0,e.authMessage=null;try{const t=await e.client.request("auth.status",{});e.authConnected=t.connected,e.authExpiresIn=t.expiresIn??null,e.authMessage=t.message??null,t.connected&&(e.setupStep="whatsapp")}catch(t){e.authConnected=!1,e.authMessage=t instanceof Error?t.message:"Failed to check auth status"}finally{e.authBusy=!1}}}async function kb(e){if(e.client){e.authBusy=!0,e.authMessage=null,e.authUrl=null,e.authConnected=null;try{const t=await e.client.request("auth.oauth.start",{provider:"anthropic"});e.authUrl=t.authUrl,e.authMessage=t.message??"Sign in with your Claude Pro account"}catch(t){e.authConnected=!1,e.authMessage=t instanceof Error?t.message:"Failed to start auth flow"}finally{e.authBusy=!1}}}async function Sb(e,t){if(e.client){e.authBusy=!0,e.authMessage="Verifying code...";try{await e.client.request("auth.oauth.code",{code:t});const n=await e.client.request("auth.oauth.wait",{timeoutMs:3e4});n.connected?(e.authConnected=!0,e.authMessage=n.message??"Connected to Claude!",e.authUrl=null,e.authCodeInput="",setTimeout(()=>{e.setupStep="whatsapp"},1500)):e.authMessage=n.message??"Still waiting for authorization..."}catch(n){e.authConnected=!1,e.authMessage=n instanceof Error?n.message:"Verification failed"}finally{e.authBusy=!1}}}function Ab(e,t){e.authCodeInput=t}function xb(e){e.setupStep="whatsapp"}async function $b(e){if(e.client){e.licenseBusy=!0,e.licenseMessage=null;try{const t=await e.client.request("license.status",{});e.licenseDeviceId=t.deviceId??null,e.licenseStoredKey=t.key??null,t.licensed?(e.licenseValid=!0,e.licenseTier=t.tier??null,e.setupStep="auth"):(e.licenseValid=null,e.setupStep="license")}catch(t){const n=t instanceof Error?t.message:String(t);n.includes("unknown method")?(e.licenseValid=!0,e.setupStep="auth"):(e.licenseValid=null,e.licenseMessage=n,e.setupStep="license")}finally{e.licenseBusy=!1}}}async function Eb(e){if(e.client&&e.licenseKey.trim()){e.licenseBusy=!0,e.licenseMessage=null,e.licenseValid=null;try{const t=await e.client.request("license.activate",{key:e.licenseKey.trim()});t.valid?(e.licenseValid=!0,e.licenseMessage=t.message??"License activated",e.licenseTier=t.tier??null,setTimeout(()=>{e.setupStep="auth"},1500)):(e.licenseValid=!1,e.licenseMessage=t.message??"Invalid license key")}catch(t){e.licenseValid=!1,e.licenseMessage=t instanceof Error?t.message:"Activation failed"}finally{e.licenseBusy=!1}}}async function Tb(e){if(e.client){e.licenseBusy=!0;try{await e.client.request("license.remove",{}),e.licenseValid=null,e.licenseKey="",e.licenseTier=null,e.licenseMessage=null,e.setupStep="license"}catch(t){e.licenseMessage=t instanceof Error?t.message:"Failed to remove license"}finally{e.licenseBusy=!1}}}function Cb(e,t){e.licenseKey=t}async function _b(e){var t,n;if(!(!e.client||!e.connected)&&!e.gatewayHealthLoading){e.gatewayHealthLoading=!0,(t=e.requestUpdate)==null||t.call(e);try{const s=await e.client.request("health",{probe:!0});e.gatewayHealthy=s.ok===!0,e.gatewayHealthMessage=s.ok?`Healthy${s.durationMs?` (${s.durationMs}ms)`:""}`:"Unhealthy"}catch(s){e.gatewayHealthy=!1,e.gatewayHealthMessage=`Error: ${String(s)}`}finally{e.gatewayHealthLoading=!1,(n=e.requestUpdate)==null||n.call(e)}}}async function Mb(e){var t,n,s;if(!(!e.client||e.gatewayRestartBusy)){e.gatewayRestartBusy=!0,e.gatewayHealthMessage="Restarting...",(t=e.requestUpdate)==null||t.call(e);try{const i=await e.client.request("gateway.restart",{reason:"Manual restart from setup page",delayMs:1e3});if(i.ok&&((n=i.restart)!=null&&n.ok))e.gatewayHealthMessage="Restarting...",setTimeout(()=>{window.location.reload()},3e3);else throw new Error("Restart not scheduled")}catch(i){e.gatewayHealthMessage=`Restart failed: ${String(i)}`,e.gatewayRestartBusy=!1,(s=e.requestUpdate)==null||s.call(e)}}}var Lb=Object.defineProperty,Pb=Object.getOwnPropertyDescriptor,m=(e,t,n,s)=>{for(var i=s>1?void 0:s?Pb(t,n):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(i=(s?o(t,n,i):o(i))||i);return s&&i&&Lb(t,n,i),i};const fi=Iu();function Rb(){if(!window.location.search)return!1;const t=new URLSearchParams(window.location.search).get("onboarding");if(!t)return!1;const n=t.trim().toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}function Ib(){const e=window.location.pathname;if(e==="/setup"||e.endsWith("/setup"))return!0;if(!window.location.search)return!1;const n=new URLSearchParams(window.location.search).get("setup");if(!n)return!1;const s=n.trim().toLowerCase();return s==="1"||s==="true"||s==="yes"||s==="on"}function Nb(){const e=window.location.pathname;return e==="/files"||e.endsWith("/files")}function Db(){const e=window.location.pathname;return e==="/browser"||e.endsWith("/browser")}function Ob(){const e=window.location.pathname;return e==="/admins"||e.endsWith("/admins")}function Bb(){const e=window.location.pathname;return e==="/customers"||e.endsWith("/customers")}function Fb(){const e=window.location.pathname;return e==="/chat"||e.endsWith("/chat")}function Ub(){const e=window.location.pathname;return e==="/advanced"||e.endsWith("/advanced")}let g=class extends kt{constructor(){super(...arguments),this.settings=Fs(),this.password="",this.tab="chat",this.onboarding=Rb(),this.setup=Ib(),this.filesPage=Nb(),this.browserPage=Db(),this.adminsPage=Ob(),this.customersPage=Bb(),this.chatPage=Fb(),this.advancedPage=Ub(),this.advancedTab="cron",this.connected=!1,this.accessState=Ic,this.theme=this.settings.theme??"system",this.themeResolved="dark",this.hello=null,this.lastError=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=fi.name,this.assistantAvatar=fi.avatar,this.assistantAgentId=fi.agentId??null,this.sessionKey=this.settings.sessionKey,this.chatLoading=!1,this.chatSending=!1,this.chatMessage="",this.chatMessages=[],this.chatToolMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.compactionStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatModelProvider=null,this.chatModel=null,this.chatModelCatalog=[],this.chatVerboseLevel=null,this.chatFillerEnabled=null,this.chatQueue=[],this.chatAttachments=[],this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget="gateway",this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.configLoading=!1,this.configRaw=`{
|
|
2957
|
+
`}const Pv={trace:!0,debug:!0,info:!0,warn:!0,error:!0,fatal:!0},Rv={name:"",description:"",agentId:"",enabled:!0,scheduleKind:"every",scheduleAt:"",everyAmount:"30",everyUnit:"minutes",cronExpr:"0 7 * * *",cronTz:"",sessionTarget:"main",wakeMode:"next-heartbeat",payloadKind:"systemEvent",payloadText:"",deliver:!1,channel:"last",to:"",timeoutSeconds:"",postToMainPrefix:""};async function Iv(e){if(!(!e.client||!e.connected)&&!e.agentsLoading){e.agentsLoading=!0,e.agentsError=null;try{const t=await e.client.request("agents.list",{});t&&(e.agentsList=t)}catch(t){e.agentsError=String(t)}finally{e.agentsLoading=!1}}}async function hn(e){if(!(!e.client||!e.connected)&&!e.workspacesLoading){e.workspacesLoading=!0,e.workspacesError=null;try{const t=await e.client.request("workspaces.list",{});e.workspaces=t.workspaces}catch(t){e.workspacesError=String(t)}finally{e.workspacesLoading=!1}}}async function Nv(e,t){var s,i;if(!e.client||!e.connected||e.workspaceSaving)return;const n=t.name.trim();if(!n){e.workspacesError="Account name is required.";return}e.workspaceSaving=!0,e.workspacesError=null;try{const r=await e.client.request("config.get",{});e.configSnapshot=r;const o=r.hash;if(!o){e.workspacesError="Config hash missing; reload and retry.";return}const a={name:n,baseHash:o,whatsappAccountName:n};(s=t.workspacePath)!=null&&s.trim()&&(a.workspaceDir=t.workspacePath.trim());const l=await e.client.request("workspaces.create",a);e.addingWorkspace=!1,e.newWorkspaceName="",e.newWorkspacePath="",await hn(e),(i=t.onCreated)==null||i.call(t,l)}catch(r){e.workspacesError=String(r)}finally{e.workspaceSaving=!1}}async function Dv(e,t){if(!(!e.client||!e.connected)&&!e.workspaceSaving){e.workspaceSaving=!0,e.workspacesError=null;try{const n=await e.client.request("config.get",{});e.configSnapshot=n;const s=n.hash;if(!s){e.workspacesError="Config hash missing; reload and retry.";return}await e.client.request("workspaces.remove",{name:t,baseHash:s}),e.workspaceRemoveConfirm=null,await hn(e)}catch(n){e.workspacesError=String(n)}finally{e.workspaceSaving=!1}}}async function Ov(e,t,n){if(!(!e.client||!e.connected)){e.workspacesError=null;try{const s=await e.client.request("config.get",{});e.configSnapshot=s;const i=s.hash;if(!i){e.workspacesError="Config hash missing; reload and retry.";return}await e.client.request("workspaces.rename",{name:t,displayName:n,baseHash:i}),await hn(e)}catch(s){e.workspacesError=String(s)}}}const Fn=Object.freeze(Object.defineProperty({__proto__:null,createWorkspace:Nv,loadWorkspaces:hn,removeWorkspace:Dv,renameWorkspace:Ov},Symbol.toStringTag,{value:"Module"})),jc={WEBCHAT_UI:"webchat-ui",CONTROL_UI:"taskmaster-control-ui",SETUP_UI:"setup-ui",WEBCHAT:"webchat",CLI:"cli",GATEWAY_CLIENT:"gateway-client",MACOS_APP:"taskmaster-macos",IOS_APP:"taskmaster-ios",ANDROID_APP:"taskmaster-android",NODE_HOST:"node-host",TEST:"test",FINGERPRINT:"fingerprint",PROBE:"taskmaster-probe"},Ra=jc,Wi={WEBCHAT:"webchat",CLI:"cli",UI:"ui",BACKEND:"backend",NODE:"node",PROBE:"probe",TEST:"test"};new Set(Object.values(jc));new Set(Object.values(Wi));function Bv(e){const t=e.version??(e.nonce?"v2":"v1"),n=e.scopes.join(","),s=e.token??"",i=[t,e.deviceId,e.clientId,e.clientMode,e.role,n,String(e.signedAtMs),s];return t==="v2"&&i.push(e.nonce??""),i.join("|")}const Fv=4008;class Uv{constructor(t){this.opts=t,this.ws=null,this.pending=new Map,this.closed=!1,this.lastSeq=null,this.connectNonce=null,this.connectSent=!1,this.connectTimer=null,this.backoffMs=800}start(){this.closed=!1,this.connect()}stop(){var t;this.closed=!0,(t=this.ws)==null||t.close(),this.ws=null,this.flushPending(new Error("gateway client stopped"))}get connected(){var t;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN}connect(){this.closed||(this.ws=new WebSocket(this.opts.url),this.ws.onopen=()=>this.queueConnect(),this.ws.onmessage=t=>this.handleMessage(String(t.data??"")),this.ws.onclose=t=>{var s,i;const n=String(t.reason??"");this.ws=null,this.flushPending(new Error(`gateway closed (${t.code}): ${n}`)),(i=(s=this.opts).onClose)==null||i.call(s,{code:t.code,reason:n}),this.scheduleReconnect()},this.ws.onerror=()=>{})}scheduleReconnect(){if(this.closed)return;const t=this.backoffMs;this.backoffMs=Math.min(this.backoffMs*1.7,15e3),window.setTimeout(()=>this.connect(),t)}flushPending(t){for(const[,n]of this.pending)n.reject(t);this.pending.clear()}async sendConnect(){var u;if(this.connectSent)return;this.connectSent=!0,this.connectTimer!==null&&(window.clearTimeout(this.connectTimer),this.connectTimer=null);const t=typeof crypto<"u"&&!!crypto.subtle,n=["operator.admin","operator.approvals","operator.pairing"],s="operator";let i=null,r=!1,o=this.opts.token;if(t){i=await rp();const p=(u=lp({deviceId:i.deviceId,role:s}))==null?void 0:u.token;o=p??this.opts.token,r=!!(p&&this.opts.token)}const a=o||this.opts.password?{token:o,password:this.opts.password}:void 0;let l;if(t&&i){const p=Date.now(),d=this.connectNonce??void 0,f=Bv({deviceId:i.deviceId,clientId:this.opts.clientName??Ra.CONTROL_UI,clientMode:this.opts.mode??Wi.WEBCHAT,role:s,scopes:n,signedAtMs:p,token:o??null,nonce:d}),b=await op(i.privateKey,f);l={id:i.deviceId,publicKey:i.publicKey,signature:b,signedAt:p,nonce:d}}const c={minProtocol:3,maxProtocol:3,client:{id:this.opts.clientName??Ra.CONTROL_UI,version:this.opts.clientVersion??"dev",platform:this.opts.platform??navigator.platform??"web",mode:this.opts.mode??Wi.WEBCHAT,instanceId:this.opts.instanceId},role:s,scopes:n,device:l,caps:[],auth:a,userAgent:navigator.userAgent,locale:navigator.language};this.request("connect",c).then(p=>{var d,f,b;(d=p==null?void 0:p.auth)!=null&&d.deviceToken&&i&&cp({deviceId:i.deviceId,role:p.auth.role??s,token:p.auth.deviceToken,scopes:p.auth.scopes??[]}),this.backoffMs=800,(b=(f=this.opts).onHello)==null||b.call(f,p)}).catch(()=>{var p;r&&i&&up({deviceId:i.deviceId,role:s}),(p=this.ws)==null||p.close(Fv,"connect failed")})}handleMessage(t){var i,r,o,a,l;let n;try{n=JSON.parse(t)}catch{return}const s=n;if(s.type==="event"){const c=n;if(c.event==="connect.challenge"){const p=c.payload,d=p&&typeof p.nonce=="string"?p.nonce:null;d&&(this.connectNonce=d,this.sendConnect());return}const u=typeof c.seq=="number"?c.seq:null;u!==null&&(this.lastSeq!==null&&u>this.lastSeq+1&&((r=(i=this.opts).onGap)==null||r.call(i,{expected:this.lastSeq+1,received:u})),this.lastSeq=u);try{(a=(o=this.opts).onEvent)==null||a.call(o,c)}catch(p){console.error("[gateway] event handler error:",p)}return}if(s.type==="res"){const c=n,u=this.pending.get(c.id);if(!u)return;this.pending.delete(c.id),c.ok?u.resolve(c.payload):u.reject(new Error(((l=c.error)==null?void 0:l.message)??"request failed"));return}}request(t,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return Promise.reject(new Error("gateway not connected"));const s=Gi(),i={type:"req",id:s,method:t,params:n},r=new Promise((o,a)=>{this.pending.set(s,{resolve:l=>o(l),reject:a})});return this.ws.send(JSON.stringify(i)),r}queueConnect(){this.connectNonce=null,this.connectSent=!1,this.connectTimer!==null&&window.clearTimeout(this.connectTimer),this.connectTimer=window.setTimeout(()=>{this.sendConnect()},750)}}function Ki(e){return typeof e=="object"&&e!==null}function Wv(e){if(!Ki(e))return null;const t=typeof e.id=="string"?e.id.trim():"",n=e.request;if(!t||!Ki(n))return null;const s=typeof n.command=="string"?n.command.trim():"";if(!s)return null;const i=typeof e.createdAtMs=="number"?e.createdAtMs:0,r=typeof e.expiresAtMs=="number"?e.expiresAtMs:0;return!i||!r?null:{id:t,request:{command:s,cwd:typeof n.cwd=="string"?n.cwd:null,host:typeof n.host=="string"?n.host:null,security:typeof n.security=="string"?n.security:null,ask:typeof n.ask=="string"?n.ask:null,agentId:typeof n.agentId=="string"?n.agentId:null,resolvedPath:typeof n.resolvedPath=="string"?n.resolvedPath:null,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:null},createdAtMs:i,expiresAtMs:r}}function Kv(e){if(!Ki(e))return null;const t=typeof e.id=="string"?e.id.trim():"";return t?{id:t,decision:typeof e.decision=="string"?e.decision:null,resolvedBy:typeof e.resolvedBy=="string"?e.resolvedBy:null,ts:typeof e.ts=="number"?e.ts:null}:null}function Hc(e){const t=Date.now();return e.filter(n=>n.expiresAtMs>t)}function zv(e,t){const n=Hc(e).filter(s=>s.id!==t.id);return n.push(t),n}function Ia(e,t){return Hc(e).filter(n=>n.id!==t)}async function qc(e,t){if(!e.client||!e.connected)return;const n=e.sessionKey.trim(),s=n?{sessionKey:n}:{};try{const i=await e.client.request("agent.identity.get",s);if(!i)return;const r=mi(i);e.assistantName=r.name,e.assistantAvatar=r.avatar,e.assistantAgentId=r.agentId??null}catch{}}const cs="taskmaster_update_pending";async function Gc(e){var t,n;if(!(!e.client||!e.connected)&&!e.updateChecking){e.updateChecking=!0,e.updateMessage=null,(t=e.requestUpdate)==null||t.call(e);try{const s=await e.client.request("update.status",{});e.currentVersion=s.current,e.latestVersion=s.latest,e.updateAvailable=s.updateAvailable,e.updateMessage=s.updateAvailable?`v${s.latest} available`:"Up to date"}catch(s){e.updateMessage=`Check failed: ${String(s)}`,e.updateAvailable=null}finally{e.updateChecking=!1,(n=e.requestUpdate)==null||n.call(e)}}}async function jv(e){var t,n,s,i;if(!(!e.client||e.updateRunning)){e.updateRunning=!0,e.updateMessage="Starting update...",e.updateProgressSteps=[],e.updateLastResult=null,(t=e.requestUpdate)==null||t.call(e);try{localStorage.setItem(cs,String(Date.now()))}catch{}try{const r=await e.client.request("update.run",{restartDelayMs:2e3,note:"Update from setup page"});if(r.ok&&r.result.status==="ok")e.updateMessage="Updated — restarting gateway...",(n=e.requestUpdate)==null||n.call(e);else if(r.ok&&r.result.status==="skipped")nn(),e.updateMessage=r.result.reason||"Update skipped",e.updateRunning=!1,(s=e.requestUpdate)==null||s.call(e);else throw nn(),new Error(r.result.reason||"Update failed")}catch(r){nn(),e.updateMessage=`Update failed: ${String(r)}`,e.updateRunning=!1,e.updateProgressSteps=[],(i=e.requestUpdate)==null||i.call(e)}}}function Hv(e,t){var s,i,r;const n=t.phase;if(n==="step-start"){const o=t.name,a=t.index,l=t.total;e.updateMessage=`Updating: ${o} (${a+1}/${l})`;const c=e.updateProgressSteps.find(u=>u.index===a);c?(c.status="running",c.name=o):e.updateProgressSteps=[...e.updateProgressSteps,{name:o,index:a,total:l,status:"running"}],(s=e.requestUpdate)==null||s.call(e)}else if(n==="step-done"){const o=t.name,a=t.index,l=t.total,c=t.ok,u=t.durationMs,p=e.updateProgressSteps.find(d=>d.index===a);p?(p.status=c?"done":"failed",p.durationMs=u):e.updateProgressSteps=[...e.updateProgressSteps,{name:o,index:a,total:l,status:c?"done":"failed",durationMs:u}],e.updateMessage=c?`Updating: ${o} done (${a+1}/${l})`:`Update step failed: ${o}`,(i=e.requestUpdate)==null||i.call(e)}else if(n==="complete"){if(t.status==="ok")e.updateMessage="Update complete — restarting gateway...";else{const a=t.reason;e.updateMessage=a?`Update failed: ${a}`:"Update failed",e.updateRunning=!1,nn()}(r=e.requestUpdate)==null||r.call(e)}}async function qv(e){var n,s,i,r;if(!e.client||!e.connected)return;const t=Vv();nn();try{const o=await e.client.request("update.lastResult",{});if(!o.ok||!o.result)return;const a=5*6e4,l=Date.now()-o.result.ts<a;if(!t&&!l)return;e.updateLastResult=o.result;const c=(n=o.result.after)==null?void 0:n.version;if(o.result.status==="ok"&&c&&(e.currentVersion=c),e.updateAvailable=!1,o.result.status==="ok"){const u=(s=o.result.before)==null?void 0:s.version,p=c??o.result.currentVersion;e.updateMessage=u?`Updated: v${u} → v${p}`:`Updated to v${p}`}else{const u=o.result.reason??((i=o.result.failedStep)==null?void 0:i.name)??"unknown error";e.updateMessage=`Update failed: ${u}`}}catch{}finally{e.updateRunning=!1,e.updateProgressSteps=[],(r=e.requestUpdate)==null||r.call(e)}}function Gv(e){var t;e.updateLastResult=null,(t=e.requestUpdate)==null||t.call(e)}function Vv(){try{const e=localStorage.getItem(cs);return e?Date.now()-Number(e)>30*6e4?(localStorage.removeItem(cs),!1):!0:!1}catch{return!1}}function nn(){try{localStorage.removeItem(cs)}catch{}}function hi(e,t){var a,l,c;const n=(e??"").trim(),s=(a=t.mainSessionKey)==null?void 0:a.trim();if(!s)return n;if(!n)return s;const i=((l=t.mainKey)==null?void 0:l.trim())||"main",r=(c=t.defaultAgentId)==null?void 0:c.trim();return n==="main"||n===i||r&&(n===`agent:${r}:main`||n===`agent:${r}:${i}`)?s:n}function Qv(e,t){if(!(t!=null&&t.mainSessionKey))return;const n=hi(e.sessionKey,t),s=hi(e.settings.sessionKey,t),i=hi(e.settings.lastActiveSessionKey,t),r=n||s||e.sessionKey,o={...e.settings,sessionKey:s||r,lastActiveSessionKey:i||r},a=o.sessionKey!==e.settings.sessionKey||o.lastActiveSessionKey!==e.settings.lastActiveSessionKey;r!==e.sessionKey&&(e.sessionKey=r),a&&Be(e,o)}function _e(e){var s;e.lastError=null,e.hello=null,e.connected=!1,e.execApprovalQueue=[],e.execApprovalError=null;const n=e.setup||e.filesPage||e.browserPage||e.chatPage||e.adminsPage||e.customersPage||e.advancedPage?"setup-ui":"taskmaster-control-ui";(s=e.client)==null||s.stop(),e.client=new Uv({url:e.settings.gatewayUrl,token:e.settings.token.trim()?e.settings.token:void 0,password:e.password.trim()?e.password:void 0,clientName:n,mode:"webchat",onHello:i=>{e.connected=!0,e.lastError=null,e.hello=i,ns()&&(yr(),e.uninstallDone=!1),Zv(e,i),e.handleAccessCheck(),qv(e).then(()=>{Gc(e)}),qc(e),Iv(e),(e.chatPage||e.setup)&&Jv(e),ir(e,{quiet:!0}),sr(e,{quiet:!0}),hn(e).then(()=>{e.initWorkspaceSelection()}),e.setup&&(Ae(e),eb(e)),hr(e)},onClose:({code:i,reason:r})=>{e.connected=!1,i!==1012&&(e.lastError=`disconnected (${i}): ${r||"no reason"}`)},onEvent:i=>Yv(e,i),onGap:({expected:i,received:r})=>{e.lastError=`event gap detected (expected seq ${i}, got ${r}); refresh recommended`}}),e.client.start()}function Yv(e,t){try{Xv(e,t)}catch(n){console.error("[gateway] handleGatewayEvent error:",t.event,n)}}function Xv(e,t){if(e.eventLogBuffer=[{ts:Date.now(),event:t.event,payload:t.payload},...e.eventLogBuffer].slice(0,250),e.tab==="debug"&&(e.eventLog=e.eventLogBuffer),t.event==="agent"){if(e.onboarding)return;pd(e,t.payload);return}if(t.event==="chat"){const n=t.payload;n!=null&&n.sessionKey&&Rl(e,n.sessionKey);const s=tl(e,n);(s==="final"||s==="error"||s==="aborted")&&(Qi(e),sh(e)),s==="final"&&Me(e);return}if(t.event==="presence"){const n=t.payload;n!=null&&n.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence,e.presenceError=null,e.presenceStatus=null);return}if(t.event==="cron"&&e.tab==="cron"&&fr(e),(t.event==="device.pair.requested"||t.event==="device.pair.resolved")&&sr(e,{quiet:!0}),t.event==="exec.approval.requested"){const n=Wv(t.payload);if(n){e.execApprovalQueue=zv(e.execApprovalQueue,n),e.execApprovalError=null;const s=Math.max(0,n.expiresAtMs-Date.now()+500);window.setTimeout(()=>{e.execApprovalQueue=Ia(e.execApprovalQueue,n.id)},s)}return}if(t.event==="browser.screencast.frame"){pv(e,t.payload);return}if(t.event==="browser.handoff"){hv(e,t.payload),e.browserPage||(window.location.href="/browser");return}if(t.event==="browser.handoff.resolved"){fv(e);return}if(t.event==="exec.approval.resolved"){const n=Kv(t.payload);n&&(e.execApprovalQueue=Ia(e.execApprovalQueue,n.id));return}if(t.event==="update.progress"){Hv(e,t.payload);return}}function Zv(e,t){const n=t.snapshot;n!=null&&n.presence&&Array.isArray(n.presence)&&(e.presenceEntries=n.presence),n!=null&&n.health&&(e.debugHealth=n.health),n!=null&&n.sessionDefaults&&Qv(e,n.sessionDefaults)}async function Jv(e){if(!(!e.client||!e.connected))try{const t=await e.client.request("models.list",{});Array.isArray(t==null?void 0:t.models)&&(e.chatModelCatalog=t.models)}catch{}}async function eb(e){if(!(!e.client||!e.connected))try{e.apiKeyProviders=await Ui(e.client)}catch{}}function tb(e){e.basePath=Hp();const t=We();if(ch(t.accentColor),window.scrollTo(0,0),Bp(e),e.setup){document.title=`${t.name} Setup`,_e(e);return}if(e.filesPage){document.title=`${t.name} Files`,Up(e),_e(e);return}if(e.browserPage){document.title=`${t.name} Browser`,_e(e);return}if(e.adminsPage){document.title=`${t.name} Admins`,_e(e);return}if(e.customersPage){document.title=`${t.name} Customers`,_e(e);return}if(e.chatPage){document.title=`${t.name} Chat`,_e(e);return}if(e.advancedPage){document.title=`${t.name} Advanced`,_e(e);return}Qp(e,!0),qp(e),Gp(e),window.addEventListener("popstate",e.popStateHandler),Kp(e),_e(e),Dp(e),e.tab==="logs"&&(e.logsSubTab==="session"?cr(e):ar(e)),e.tab==="debug"&&dr(e)}function nb(e){bd(e)}function sb(e){var t;window.removeEventListener("popstate",e.popStateHandler),Op(e),lr(e),ur(e),pr(e),Fp(e),Wp(e),Vp(e),(t=e.topbarObserver)==null||t.disconnect(),e.topbarObserver=null}function ib(e,t){if(e.filesPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleFilesLoad&&e.handleFilesLoad(),e.adminsPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleAdminsLoad&&e.handleAdminsLoad(),e.customersPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleCustomersLoad&&e.handleCustomersLoad(),e.chatPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleChatLoad&&e.handleChatLoad(),e.advancedPage&&e.connected&&t.has("connected")&&t.get("connected")===!1&&e.handleAdvancedLoad&&e.handleAdvancedLoad(),e.setup&&e.connected){const n=t.has("connected")&&t.get("connected")===!1;n&&e.handleLicenseStatusCheck&&e.licenseValid===null&&!e.licenseBusy&&e.handleLicenseStatusCheck(),n&&e.handleUpdateCheck&&e.handleUpdateCheck();const s=t.has("setupStep")&&e.setupStep==="auth";(n||s)&&e.setupStep==="auth"&&e.handleAuthStatusCheck&&e.authConnected===null&&!e.authBusy&&e.handleAuthStatusCheck(),e.setupStep==="whatsapp"&&t.has("setupStep")&&e.client&&!e.channelsLoading&&(e.channelsLoading=!0,e.client.request("channels.status",{probe:!0,timeoutMs:8e3}).then(r=>{e.channelsSnapshot=r,e.channelsLoading=!1}).catch(()=>{e.channelsLoading=!1})),t.has("whatsappLoginConnected")&&e.whatsappLoginConnected===!0&&e.client&&!e.channelsLoading&&(e.channelsLoading=!0,e.client.request("channels.status",{probe:!0,timeoutMs:8e3}).then(i=>{e.channelsSnapshot=i,e.channelsLoading=!1}).catch(()=>{e.channelsLoading=!1}))}if(e.tab==="chat"&&!e.advancedPage&&(t.has("chatMessages")||t.has("chatToolMessages")||t.has("chatStream")||t.has("chatLoading")||t.has("tab"))){const n=t.has("tab"),s=t.has("chatLoading")&&t.get("chatLoading")===!0&&e.chatLoading===!1;ln(e,n||s||!e.chatHasAutoScrolled)}e.tab==="logs"&&!e.advancedPage&&(t.has("logsEntries")||t.has("logsAutoFollow")||t.has("tab"))&&e.logsAutoFollow&&e.logsAtBottom&&nl(e,t.has("tab")||t.has("logsAutoFollow"))}function rb(e){const t={name:(e==null?void 0:e.name)??"",displayName:(e==null?void 0:e.displayName)??"",about:(e==null?void 0:e.about)??"",picture:(e==null?void 0:e.picture)??"",banner:(e==null?void 0:e.banner)??"",website:(e==null?void 0:e.website)??"",nip05:(e==null?void 0:e.nip05)??"",lud16:(e==null?void 0:e.lud16)??""};return{values:t,original:{...t},saving:!1,importing:!1,error:null,success:null,fieldErrors:{},showAdvanced:!!(e!=null&&e.banner||e!=null&&e.website||e!=null&&e.nip05||e!=null&&e.lud16)}}async function ob(e,t,n){await Yi(e,t,n),await q(e,!0)}async function ab(e,t){await rl(e,t),await q(e,!0)}async function lb(e,t){await ol(e,t),await q(e,!0)}async function cb(e,t){await al(e,t)}async function ub(e,t){await ll(e,t)}async function db(e){await Sd(e),await Ae(e),await q(e,!0)}async function pb(e){await Ae(e),await q(e,!0)}function hb(e){if(!Array.isArray(e))return{};const t={};for(const n of e){if(typeof n!="string")continue;const[s,...i]=n.split(":");if(!s||i.length===0)continue;const r=s.trim(),o=i.join(":").trim();r&&o&&(t[r]=o)}return t}function Vc(e){var n,s,i;return((i=(((s=(n=e.channelsSnapshot)==null?void 0:n.channelAccounts)==null?void 0:s.nostr)??[])[0])==null?void 0:i.accountId)??e.nostrProfileAccountId??"default"}function Qc(e,t=""){return`/api/channels/nostr/${encodeURIComponent(e)}/profile${t}`}function fb(e,t,n){e.nostrProfileAccountId=t,e.nostrProfileFormState=rb(n??void 0)}function gb(e){e.nostrProfileFormState=null,e.nostrProfileAccountId=null}function mb(e,t,n){const s=e.nostrProfileFormState;s&&(e.nostrProfileFormState={...s,values:{...s.values,[t]:n},fieldErrors:{...s.fieldErrors,[t]:""}})}function yb(e){const t=e.nostrProfileFormState;t&&(e.nostrProfileFormState={...t,showAdvanced:!t.showAdvanced})}async function vb(e){const t=e.nostrProfileFormState;if(!t||t.saving)return;const n=Vc(e);e.nostrProfileFormState={...t,saving:!0,error:null,success:null,fieldErrors:{}};try{const s=await fetch(Qc(n),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.values)}),i=await s.json().catch(()=>null);if(!s.ok||(i==null?void 0:i.ok)===!1||!i){const r=(i==null?void 0:i.error)??`Profile update failed (${s.status})`;e.nostrProfileFormState={...t,saving:!1,error:r,success:null,fieldErrors:hb(i==null?void 0:i.details)};return}if(!i.persisted){e.nostrProfileFormState={...t,saving:!1,error:"Profile publish failed on all relays.",success:null};return}e.nostrProfileFormState={...t,saving:!1,error:null,success:"Profile published to relays.",fieldErrors:{},original:{...t.values}},await q(e,!0)}catch(s){e.nostrProfileFormState={...t,saving:!1,error:`Profile update failed: ${String(s)}`,success:null}}}async function bb(e){const t=e.nostrProfileFormState;if(!t||t.importing)return;const n=Vc(e);e.nostrProfileFormState={...t,importing:!0,error:null,success:null};try{const s=await fetch(Qc(n,"/import"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoMerge:!0})}),i=await s.json().catch(()=>null);if(!s.ok||(i==null?void 0:i.ok)===!1||!i){const l=(i==null?void 0:i.error)??`Profile import failed (${s.status})`;e.nostrProfileFormState={...t,importing:!1,error:l,success:null};return}const r=i.merged??i.imported??null,o=r?{...t.values,...r}:t.values,a=!!(o.banner||o.website||o.nip05||o.lud16);e.nostrProfileFormState={...t,importing:!1,values:o,error:null,success:i.saved?"Profile imported from relays. Review and publish.":"Profile imported. Review and publish.",showAdvanced:a},i.saved&&await q(e,!0)}catch(s){e.nostrProfileFormState={...t,importing:!1,error:`Profile import failed: ${String(s)}`,success:null}}}async function wb(e){if(e.client){e.authBusy=!0,e.authMessage=null;try{const t=await e.client.request("auth.status",{});e.authConnected=t.connected,e.authExpiresIn=t.expiresIn??null,e.authMessage=t.message??null,t.connected&&(e.setupStep="whatsapp")}catch(t){e.authConnected=!1,e.authMessage=t instanceof Error?t.message:"Failed to check auth status"}finally{e.authBusy=!1}}}async function kb(e){if(e.client){e.authBusy=!0,e.authMessage=null,e.authUrl=null,e.authConnected=null;try{const t=await e.client.request("auth.oauth.start",{provider:"anthropic"});e.authUrl=t.authUrl,e.authMessage=t.message??"Sign in with your Claude Pro account"}catch(t){e.authConnected=!1,e.authMessage=t instanceof Error?t.message:"Failed to start auth flow"}finally{e.authBusy=!1}}}async function Sb(e,t){if(e.client){e.authBusy=!0,e.authMessage="Verifying code...";try{await e.client.request("auth.oauth.code",{code:t});const n=await e.client.request("auth.oauth.wait",{timeoutMs:3e4});n.connected?(e.authConnected=!0,e.authMessage=n.message??"Connected to Claude!",e.authUrl=null,e.authCodeInput=""):e.authMessage=n.message??"Still waiting for authorization..."}catch(n){e.authConnected=!1,e.authMessage=n instanceof Error?n.message:"Verification failed"}finally{e.authBusy=!1}}}function Ab(e,t){e.authCodeInput=t}function xb(e){e.setupStep="whatsapp"}async function $b(e){if(e.client){e.licenseBusy=!0,e.licenseMessage=null;try{const t=await e.client.request("license.status",{});e.licenseDeviceId=t.deviceId??null,e.licenseStoredKey=t.key??null,t.licensed?(e.licenseValid=!0,e.licenseTier=t.tier??null,e.setupStep="auth"):(e.licenseValid=null,e.setupStep="license")}catch(t){const n=t instanceof Error?t.message:String(t);n.includes("unknown method")?(e.licenseValid=!0,e.setupStep="auth"):(e.licenseValid=null,e.licenseMessage=n,e.setupStep="license")}finally{e.licenseBusy=!1}}}async function Eb(e){if(e.client&&e.licenseKey.trim()){e.licenseBusy=!0,e.licenseMessage=null,e.licenseValid=null;try{const t=await e.client.request("license.activate",{key:e.licenseKey.trim()});t.valid?(e.licenseValid=!0,e.licenseMessage=t.message??"License activated",e.licenseTier=t.tier??null,setTimeout(()=>{e.setupStep="auth"},1500)):(e.licenseValid=!1,e.licenseMessage=t.message??"Invalid license key")}catch(t){e.licenseValid=!1,e.licenseMessage=t instanceof Error?t.message:"Activation failed"}finally{e.licenseBusy=!1}}}async function Tb(e){if(e.client){e.licenseBusy=!0;try{await e.client.request("license.remove",{}),e.licenseValid=null,e.licenseKey="",e.licenseTier=null,e.licenseMessage=null,e.setupStep="license"}catch(t){e.licenseMessage=t instanceof Error?t.message:"Failed to remove license"}finally{e.licenseBusy=!1}}}function Cb(e,t){e.licenseKey=t}async function _b(e){var t,n;if(!(!e.client||!e.connected)&&!e.gatewayHealthLoading){e.gatewayHealthLoading=!0,(t=e.requestUpdate)==null||t.call(e);try{const s=await e.client.request("health",{probe:!0});e.gatewayHealthy=s.ok===!0,e.gatewayHealthMessage=s.ok?`Healthy${s.durationMs?` (${s.durationMs}ms)`:""}`:"Unhealthy"}catch(s){e.gatewayHealthy=!1,e.gatewayHealthMessage=`Error: ${String(s)}`}finally{e.gatewayHealthLoading=!1,(n=e.requestUpdate)==null||n.call(e)}}}async function Mb(e){var t,n,s;if(!(!e.client||e.gatewayRestartBusy)){e.gatewayRestartBusy=!0,e.gatewayHealthMessage="Restarting...",(t=e.requestUpdate)==null||t.call(e);try{const i=await e.client.request("gateway.restart",{reason:"Manual restart from setup page",delayMs:1e3});if(i.ok&&((n=i.restart)!=null&&n.ok))e.gatewayHealthMessage="Restarting...",setTimeout(()=>{window.location.reload()},3e3);else throw new Error("Restart not scheduled")}catch(i){e.gatewayHealthMessage=`Restart failed: ${String(i)}`,e.gatewayRestartBusy=!1,(s=e.requestUpdate)==null||s.call(e)}}}var Lb=Object.defineProperty,Pb=Object.getOwnPropertyDescriptor,m=(e,t,n,s)=>{for(var i=s>1?void 0:s?Pb(t,n):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(i=(s?o(t,n,i):o(i))||i);return s&&i&&Lb(t,n,i),i};const fi=Iu();function Rb(){if(!window.location.search)return!1;const t=new URLSearchParams(window.location.search).get("onboarding");if(!t)return!1;const n=t.trim().toLowerCase();return n==="1"||n==="true"||n==="yes"||n==="on"}function Ib(){const e=window.location.pathname;if(e==="/setup"||e.endsWith("/setup"))return!0;if(!window.location.search)return!1;const n=new URLSearchParams(window.location.search).get("setup");if(!n)return!1;const s=n.trim().toLowerCase();return s==="1"||s==="true"||s==="yes"||s==="on"}function Nb(){const e=window.location.pathname;return e==="/files"||e.endsWith("/files")}function Db(){const e=window.location.pathname;return e==="/browser"||e.endsWith("/browser")}function Ob(){const e=window.location.pathname;return e==="/admins"||e.endsWith("/admins")}function Bb(){const e=window.location.pathname;return e==="/customers"||e.endsWith("/customers")}function Fb(){const e=window.location.pathname;return e==="/chat"||e.endsWith("/chat")}function Ub(){const e=window.location.pathname;return e==="/advanced"||e.endsWith("/advanced")}let g=class extends kt{constructor(){super(...arguments),this.settings=Fs(),this.password="",this.tab="chat",this.onboarding=Rb(),this.setup=Ib(),this.filesPage=Nb(),this.browserPage=Db(),this.adminsPage=Ob(),this.customersPage=Bb(),this.chatPage=Fb(),this.advancedPage=Ub(),this.advancedTab="cron",this.connected=!1,this.accessState=Ic,this.theme=this.settings.theme??"system",this.themeResolved="dark",this.hello=null,this.lastError=null,this.eventLog=[],this.eventLogBuffer=[],this.toolStreamSyncTimer=null,this.sidebarCloseTimer=null,this.assistantName=fi.name,this.assistantAvatar=fi.avatar,this.assistantAgentId=fi.agentId??null,this.sessionKey=this.settings.sessionKey,this.chatLoading=!1,this.chatSending=!1,this.chatMessage="",this.chatMessages=[],this.chatToolMessages=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.compactionStatus=null,this.chatAvatarUrl=null,this.chatThinkingLevel=null,this.chatModelProvider=null,this.chatModel=null,this.chatModelCatalog=[],this.chatVerboseLevel=null,this.chatFillerEnabled=null,this.chatQueue=[],this.chatAttachments=[],this.sidebarOpen=!1,this.sidebarContent=null,this.sidebarError=null,this.splitRatio=this.settings.splitRatio,this.nodesLoading=!1,this.nodes=[],this.devicesLoading=!1,this.devicesError=null,this.devicesList=null,this.execApprovalsLoading=!1,this.execApprovalsSaving=!1,this.execApprovalsDirty=!1,this.execApprovalsSnapshot=null,this.execApprovalsForm=null,this.execApprovalsSelectedAgent=null,this.execApprovalsTarget="gateway",this.execApprovalsTargetNodeId=null,this.execApprovalQueue=[],this.execApprovalBusy=!1,this.execApprovalError=null,this.configLoading=!1,this.configRaw=`{
|
|
2958
2958
|
}
|
|
2959
2959
|
`,this.configRawOriginal="",this.configValid=null,this.configIssues=[],this.configSaving=!1,this.configApplying=!1,this.updateRunning=!1,this.applySessionKey=this.settings.lastActiveSessionKey,this.configSnapshot=null,this.configSchema=null,this.configSchemaVersion=null,this.configSchemaLoading=!1,this.configUiHints={},this.configForm=null,this.configFormOriginal=null,this.configFormDirty=!1,this.configFormMode="form",this.configSearchQuery="",this.configActiveSection=null,this.configActiveSubsection=null,this.channelsLoading=!1,this.channelsSnapshot=null,this.channelsError=null,this.channelsLastSuccess=null,this.whatsappLoginMessage=null,this.whatsappLoginQrDataUrl=null,this.whatsappLoginConnected=null,this.whatsappBusy=!1,this.whatsappActiveQrAccountId=null,this.whatsappPairedPhone=null,this.addingWhatsAppAccount=!1,this.newWhatsAppAccountName="",this.whatsappAccountError=null,this.whatsappAccountSaving=!1,this.whatsappSettingsOpen=!1,this.licenseKey="",this.licenseBusy=!1,this.licenseValid=null,this.licenseMessage=null,this.licenseTier=null,this.licenseDeviceId=null,this.licenseStoredKey=null,this.licenseRemoveConfirm=!1,this.authConnected=null,this.authBusy=!1,this.authMessage=null,this.authUrl=null,this.authCodeInput="",this.authExpiresIn=null,this.setupStep="license",this.gatewayHealthy=null,this.gatewayHealthLoading=!1,this.gatewayHealthMessage=null,this.gatewayRestartBusy=!1,this.updateAvailable=null,this.currentVersion=null,this.latestVersion=null,this.updateChecking=!1,this.updateMessage=null,this.updateProgressSteps=[],this.updateLastResult=null,this.uninstallConfirm=!1,this.uninstallBusy=!1,this.uninstallDone=!1,this.uninstallError=null,this.uninstallConfirmText="",this.nostrProfileFormState=null,this.nostrProfileAccountId=null,this.presenceLoading=!1,this.presenceEntries=[],this.presenceError=null,this.presenceStatus=null,this.agentsLoading=!1,this.agentsList=null,this.agentsError=null,this.sessionsLoading=!1,this.sessionsResult=null,this.sessionsError=null,this.cronLoading=!1,this.cronJobs=[],this.cronStatus=null,this.cronError=null,this.cronForm={...Rv},this.cronRunsJobId=null,this.cronRuns=[],this.cronBusy=!1,this.cronNewEventModal=!1,this.cronDetailJobId=null,this.browserScreencastActive=!1,this.browserScreencastFrame=null,this.browserScreencastMetadata=null,this.browserHandoffPending=!1,this.browserHandoffReason=null,this.browserHandoffId=null,this.browserInputMode=!1,this.browserLoading=!1,this.browserError=null,this.filesLoading=!1,this.filesTree=[],this.filesRoot="",this.filesError=null,this.filesSelectedPath=null,this.filesSelectedPaths=new Set,this.filesPreviewContent=null,this.filesPreviewLoading=!1,this.filesPreviewBinary=!1,this.filesPreviewSize=null,this.filesExpandedDirs=new Set,this.filesMessage=null,this.filesUploadBusy=!1,this.filesReindexBusy=!1,this.filesMemoryStatus=null,this.filesSearchQuery="",this.filesSearchResults=null,this.filesSearchLoading=!1,this.filesSearchAgentId=null,this.auditEntries=[],this.auditLoading=!1,this.auditModalOpen=!1,this.skillsLoading=!1,this.skillsReport=null,this.skillsError=null,this.skillsFilter="",this.skillEdits={},this.skillsBusyKey=null,this.skillMessages={},this.adminsLoading=!1,this.adminPhones=[],this.adminsError=null,this.adminsSaving=!1,this.adminsNewPhone="",this.customersLoading=!1,this.customersSaving=!1,this.customersRecords=[],this.customersError=null,this.customersSearchQuery="",this.customersEditingId=null,this.customersShowAddForm=!1,this.customersNewPhone="",this.customersNewName="",this.imessageEnableConfirm=!1,this.imessageEnabling=!1,this.infoModalOpen=null,this.workspaces=[],this.workspacesLoading=!1,this.workspacesError=null,this.selectedWorkspace=null,this.addingWorkspace=!1,this.newWorkspaceName="",this.newWorkspacePath="",this.newWorkspacePin="",this.accountPinModalOpen=!1,this.accountPinBusy=!1,this.accountPinError=null,this.accountPinSuccess=null,this.apiKeyProviders=[],this.apiKeyModalOpen=!1,this.apiKeyBusy=!1,this.apiKeyError=null,this.apiKeySuccess=null,this.apiKeySavingProvider=null,this.authApiKeyMode=!1,this.authApiKeyInput="",this.authApiKeyBusy=!1,this.authApiKeyError=null,this.pinChanging=null,this.pinChangeBusy=!1,this.pinChangeError=null,this.loginChangePinMode=!1,this.changePinBusy=!1,this.changePinError=null,this.changePinSuccess=null,this.workspaceSaving=!1,this.workspaceRemoveConfirm=null,this.renamingWorkspace=!1,this.renameWorkspaceName="",this.debugLoading=!1,this.debugStatus=null,this.debugHealth=null,this.debugModels=[],this.debugHeartbeat=null,this.debugCallMethod="",this.debugCallParams="{}",this.debugCallResult=null,this.debugCallError=null,this.logsLoading=!1,this.logsError=null,this.logsFile=null,this.logsEntries=[],this.logsFilterText="",this.logsLevelFilters={...Pv},this.logsAutoFollow=!0,this.logsTruncated=!1,this.logsCursor=null,this.logsLastFetchAt=null,this.logsLimit=500,this.logsMaxBytes=25e4,this.logsAtBottom=!0,this.logsSubTab="session",this.sessionLogsLoading=!1,this.sessionLogsError=null,this.sessionLogsEntries=[],this.sessionLogsFilterText="",this.sessionLogsTypeFilters={user:!0,assistant:!0,tool:!0,thinking:!0,error:!0,system:!0},this.sessionLogsAgentFilters={},this.sessionLogsAgents=[],this.sessionLogsAutoFollow=!0,this.sessionLogsFull=!1,this.sessionLogsCursors={},this.sessionLogsLastFetchAt=null,this.sessionLogsAtBottom=!0,this.client=null,this.chatScrollFrame=null,this.chatScrollTimeout=null,this.chatHasAutoScrolled=!1,this.chatUserNearBottom=!0,this.nodesPollInterval=null,this.logsPollInterval=null,this.sessionLogsPollInterval=null,this.debugPollInterval=null,this.auditPollInterval=null,this.logsScrollFrame=null,this.toolStreamById=new Map,this.toolStreamOrder=[],this.basePath="",this.popStateHandler=()=>Yp(this),this.themeMedia=null,this.themeMediaHandler=null,this.topbarObserver=null}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),tb(this)}firstUpdated(){nb(this)}disconnectedCallback(){sb(this),super.disconnectedCallback()}updated(e){ib(this,e)}connect(){_e(this)}handleChatScroll(e){hd(this,e)}handleLogsScroll(e){fd(this,e)}handleSessionLogsScroll(e){gd(this,e)}exportLogs(e,t){yd(e,t)}exportSessionLogs(e,t){vd(e,t)}resetToolStream(){Qi(this)}resetChatScroll(){md(this)}async loadAssistantIdentity(){await qc(this)}applySettings(e){Be(this,e)}setTab(e){zp(this,e)}setTheme(e,t){jp(this,e,t)}async loadOverview(){await Dl(this)}async loadCron(){var t;const e=this.getSelectedWorkspaceInfo();this.workspaceAgentIds=((t=e==null?void 0:e.agents)==null?void 0:t.map(n=>n.id))??void 0,this.cronForm={...this.cronForm,accountId:(e==null?void 0:e.whatsappAccountId)??void 0},await fr(this)}async handleAbortChat(){await Bl(this)}removeQueuedMessage(e){eh(this,e)}async handleSendChat(e,t){await th(this,e,t)}async handleWhatsAppStart(e,t){await ob(this,e,t)}async handleWhatsAppWait(e){await ab(this,e)}async handleWhatsAppLogout(e){await lb(this,e)}async handleAddWhatsAppAccount(e){await cb(this,e)}async handleRemoveWhatsAppAccount(e){await ub(this,e)}async handleAccessCheck(){await Ma(this)}async handlePinSubmit(e,t){await nv(this,e,t),this.accessState.authenticated&&this.accessState.workspace&&this.handleWorkspaceSelect(this.accessState.workspace)}async handleSetMasterPin(e){await sv(this,e)}async handleLogout(){await rv(this)}toggleChangePinMode(){this.loginChangePinMode=!this.loginChangePinMode,this.changePinError=null,this.changePinSuccess=null}async handleChangePin(e,t,n){if(this.client){this.changePinBusy=!0,this.changePinError=null,this.changePinSuccess=null;try{const s=await this.client.request("access.verify",{account:e,pin:t});if(!s.ok){this.changePinError=s.message??"Incorrect current PIN",this.changePinBusy=!1;return}e==="__master__"?await this.client.request("access.setMasterPin",{pin:n}):await this.client.request("access.setAccountPin",{workspace:e,pin:n}),this.changePinSuccess="PIN changed successfully",this.changePinBusy=!1,setTimeout(()=>{this.loginChangePinMode=!1,this.changePinSuccess=null},2e3)}catch{this.changePinError="Failed to change PIN",this.changePinBusy=!1}}}async handleAccountPinSave(e,t,n){if(this.client){this.accountPinBusy=!0,this.accountPinError=null,this.accountPinSuccess=null;try{if(t!==null){const s=await this.client.request("access.verify",{account:e,pin:t});if(!s.ok){this.accountPinError=s.message??"Incorrect current PIN",this.accountPinBusy=!1;return}}await this.client.request("access.setAccountPin",{workspace:e,pin:n}),this.accountPinSuccess="PIN saved",this.accountPinBusy=!1,await Ma(this),setTimeout(()=>{this.accountPinModalOpen=!1,this.accountPinSuccess=null,this.accountPinError=null},1500)}catch{this.accountPinError="Failed to save PIN",this.accountPinBusy=!1}}}async handleLicenseStatusCheck(){await $b(this)}async handleLicenseActivate(){await Eb(this)}async handleLicenseRemove(){await Tb(this)}handleLicenseKeyChange(e){Cb(this,e)}async handleAuthStatusCheck(){await wb(this)}async handleAuthStart(){await kb(this)}async handleAuthSubmitCode(e){await Sb(this,e)}handleAuthCodeChange(e){Ab(this,e)}handleSkipToWhatsApp(){xb(this)}async handleGatewayHealthCheck(){await _b(this)}async handleGatewayRestart(){await Mb(this)}async handleUpdateCheck(){await Gc(this)}async handleUpdateRun(){await jv(this)}handleUpdateDismissResult(){Gv(this)}handleUninstallConfirm(){this.uninstallConfirm=!0,this.uninstallConfirmText=""}handleUninstallCancel(){this.uninstallConfirm=!1,this.uninstallConfirmText="",this.uninstallError=null}handleUninstallConfirmTextChange(e){this.uninstallConfirmText=e}async handleUninstallRun(){const{runUninstall:e}=await pe(async()=>{const{runUninstall:t}=await Promise.resolve().then(()=>To);return{runUninstall:t}},void 0,import.meta.url);await e(this)}handleUninstallDismiss(){pe(async()=>{const{clearUninstallDone:e}=await Promise.resolve().then(()=>To);return{clearUninstallDone:e}},void 0,import.meta.url).then(({clearUninstallDone:e})=>{e()}),this.uninstallDone=!1,this.uninstallConfirm=!1,this.uninstallConfirmText=""}async loadAuditEntries(){await _l(this)}async clearAudit(){await $p(this),this.auditModalOpen=!1}handleFilesLoad(){var n;const e=this.getSelectedWorkspaceInfo();this.workspaceAgentIds=((n=e==null?void 0:e.agents)==null?void 0:n.map(s=>s.id))??void 0;const t=this.resolveFilesAgentId();dn(this,t),or(this,t)}handleAdminsLoad(){const e=this.resolveAdminAgentId();pe(async()=>{const{loadAdmins:t}=await Promise.resolve().then(()=>mv);return{loadAdmins:t}},void 0,import.meta.url).then(({loadAdmins:t})=>{t(this,e)})}resolveAdminAgentId(){const e=this.getSelectedWorkspaceInfo();if(!e)return;const t=e.agents.find(n=>n.id.endsWith("-admin")||n.id==="admin");return t==null?void 0:t.id}resolveFilesAgentId(){var t;const e=this.getSelectedWorkspaceInfo();if(e)return(t=e.agents[0])==null?void 0:t.id}handleChatLoad(){const e=this.resolveAdminAgentId();if(e){const t=`agent:${e}:main`;t!==this.sessionKey&&(this.sessionKey=t,this.chatMessages=[],this.chatStream=null,this.chatRunId=null,this.applySettings({...this.settings,sessionKey:t,lastActiveSessionKey:t}),this.loadAssistantIdentity())}pe(async()=>{const{loadChatHistory:t}=await Promise.resolve().then(()=>nd);return{loadChatHistory:t}},void 0,import.meta.url).then(({loadChatHistory:t})=>{t(this)})}handleAdvancedLoad(){this.loadCron()}async handleChannelConfigSave(){await db(this)}async handleChannelConfigReload(){await pb(this)}handleNostrProfileEdit(e,t){fb(this,e,t)}handleNostrProfileCancel(){gb(this)}handleNostrProfileFieldChange(e,t){mb(this,e,t)}async handleNostrProfileSave(){await vb(this)}async handleNostrProfileImport(){await bb(this)}handleNostrProfileToggleAdvanced(){yb(this)}async handleExecApprovalDecision(e){const t=this.execApprovalQueue[0];if(!(!t||!this.client||this.execApprovalBusy)){this.execApprovalBusy=!0,this.execApprovalError=null;try{await this.client.request("exec.approval.resolve",{id:t.id,decision:e}),this.execApprovalQueue=this.execApprovalQueue.filter(n=>n.id!==t.id)}catch(n){this.execApprovalError=`Exec approval failed: ${String(n)}`}finally{this.execApprovalBusy=!1}}}handleOpenSidebar(e){this.sidebarCloseTimer!=null&&(window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=null),this.sidebarContent=e,this.sidebarError=null,this.sidebarOpen=!0}handleCloseSidebar(){this.sidebarOpen=!1,this.sidebarCloseTimer!=null&&window.clearTimeout(this.sidebarCloseTimer),this.sidebarCloseTimer=window.setTimeout(()=>{this.sidebarOpen||(this.sidebarContent=null,this.sidebarError=null,this.sidebarCloseTimer=null)},200)}handleSplitRatioChange(e){const t=Math.max(.4,Math.min(.7,e));this.splitRatio=t,this.applySettings({...this.settings,splitRatio:t})}handleAdminsNewPhoneChange(e){this.adminsNewPhone=e,this.adminsError&&(this.adminsError=null)}handleCustomersLoad(){const e=this.selectedWorkspace??void 0;pe(async()=>{const{loadCustomers:t}=await Promise.resolve().then(()=>yv);return{loadCustomers:t}},void 0,import.meta.url).then(({loadCustomers:t})=>{t(this,e)})}handleCustomersNewPhoneChange(e){this.customersNewPhone=e,this.customersError&&(this.customersError=null)}handleCustomersNewNameChange(e){this.customersNewName=e,this.customersError&&(this.customersError=null)}async handleWorkspacesLoad(){const{loadWorkspaces:e}=await pe(async()=>{const{loadWorkspaces:t}=await Promise.resolve().then(()=>Fn);return{loadWorkspaces:t}},void 0,import.meta.url);await e(this)}async handleWorkspaceCreate(e,t){const{createWorkspace:n}=await pe(async()=>{const{createWorkspace:i}=await Promise.resolve().then(()=>Fn);return{createWorkspace:i}},void 0,import.meta.url),{loadChannels:s}=await pe(async()=>{const{loadChannels:i}=await Promise.resolve().then(()=>_d);return{loadChannels:i}},void 0,import.meta.url);await n(this,{name:e,workspacePath:t,onCreated:i=>{if(!i.whatsappAccountId)return;const r=i.whatsappAccountId;this.handleWorkspaceSelect(e),setTimeout(async()=>{try{await s(this,!0),await this.handleWhatsAppStart(!0,r),this.whatsappLoginQrDataUrl&&(await this.handleWhatsAppWait(r),await s(this,!0),await this.handleWorkspacesLoad())}catch{}this.requestUpdate()},3e3)}})}async handleWorkspaceRemove(e){const{removeWorkspace:t}=await pe(async()=>{const{removeWorkspace:n}=await Promise.resolve().then(()=>Fn);return{removeWorkspace:n}},void 0,import.meta.url);await t(this,e)}handleWorkspaceRenameStart(){const e=this.getSelectedWorkspaceInfo();this.renameWorkspaceName=(e==null?void 0:e.displayName)??(e==null?void 0:e.name)??"",this.renamingWorkspace=!0}handleWorkspaceRenameCancel(){this.renamingWorkspace=!1,this.renameWorkspaceName=""}async handleWorkspaceRename(e,t){const{renameWorkspace:n}=await pe(async()=>{const{renameWorkspace:s}=await Promise.resolve().then(()=>Fn);return{renameWorkspace:s}},void 0,import.meta.url);await n(this,e,t),this.renamingWorkspace=!1,this.renameWorkspaceName=""}handleWorkspaceSelect(e){this.selectedWorkspace=e,localStorage.setItem("taskmaster-selected-workspace",e),fo(e),this.settings=Fs(),this.chatMessage="",this.chatAttachments=[],this.chatStream=null,this.chatStreamStartedAt=null,this.chatRunId=null,this.chatQueue=[],this.lastError=null,this.reloadCurrentPageData()}getSelectedWorkspaceInfo(){return this.selectedWorkspace?this.workspaces.find(e=>e.name===this.selectedWorkspace)??null:null}reloadCurrentPageData(){this.loadAuditEntries(),this.adminsPage?this.handleAdminsLoad():this.customersPage?this.handleCustomersLoad():this.filesPage?this.handleFilesLoad():this.chatPage?this.handleChatLoad():this.advancedPage&&this.handleAdvancedLoad()}initWorkspaceSelection(){if(this.workspaces.length===0)return;const e=localStorage.getItem("taskmaster-selected-workspace"),t=e?this.workspaces.find(n=>n.name===e):null;if(t)this.selectedWorkspace=t.name;else{const n=this.workspaces.find(s=>s.isDefault)??this.workspaces[0];this.selectedWorkspace=n.name,localStorage.setItem("taskmaster-selected-workspace",n.name)}fo(this.selectedWorkspace),this.settings=Fs(),this.reloadCurrentPageData()}render(){return h`${_v(this)}${this.auditModalOpen?Lv(this.auditEntries,()=>this.clearAudit(),()=>{this.auditModalOpen=!1}):k}`}};m([y()],g.prototype,"settings",2);m([y()],g.prototype,"password",2);m([y()],g.prototype,"tab",2);m([y()],g.prototype,"onboarding",2);m([y()],g.prototype,"setup",2);m([y()],g.prototype,"filesPage",2);m([y()],g.prototype,"browserPage",2);m([y()],g.prototype,"adminsPage",2);m([y()],g.prototype,"customersPage",2);m([y()],g.prototype,"chatPage",2);m([y()],g.prototype,"advancedPage",2);m([y()],g.prototype,"advancedTab",2);m([y()],g.prototype,"connected",2);m([y()],g.prototype,"accessState",2);m([y()],g.prototype,"theme",2);m([y()],g.prototype,"themeResolved",2);m([y()],g.prototype,"hello",2);m([y()],g.prototype,"lastError",2);m([y()],g.prototype,"eventLog",2);m([y()],g.prototype,"assistantName",2);m([y()],g.prototype,"assistantAvatar",2);m([y()],g.prototype,"assistantAgentId",2);m([y()],g.prototype,"sessionKey",2);m([y()],g.prototype,"chatLoading",2);m([y()],g.prototype,"chatSending",2);m([y()],g.prototype,"chatMessage",2);m([y()],g.prototype,"chatMessages",2);m([y()],g.prototype,"chatToolMessages",2);m([y()],g.prototype,"chatStream",2);m([y()],g.prototype,"chatStreamStartedAt",2);m([y()],g.prototype,"chatRunId",2);m([y()],g.prototype,"compactionStatus",2);m([y()],g.prototype,"chatAvatarUrl",2);m([y()],g.prototype,"chatThinkingLevel",2);m([y()],g.prototype,"chatModelProvider",2);m([y()],g.prototype,"chatModel",2);m([y()],g.prototype,"chatModelCatalog",2);m([y()],g.prototype,"chatVerboseLevel",2);m([y()],g.prototype,"chatFillerEnabled",2);m([y()],g.prototype,"chatQueue",2);m([y()],g.prototype,"chatAttachments",2);m([y()],g.prototype,"sidebarOpen",2);m([y()],g.prototype,"sidebarContent",2);m([y()],g.prototype,"sidebarError",2);m([y()],g.prototype,"splitRatio",2);m([y()],g.prototype,"nodesLoading",2);m([y()],g.prototype,"nodes",2);m([y()],g.prototype,"devicesLoading",2);m([y()],g.prototype,"devicesError",2);m([y()],g.prototype,"devicesList",2);m([y()],g.prototype,"execApprovalsLoading",2);m([y()],g.prototype,"execApprovalsSaving",2);m([y()],g.prototype,"execApprovalsDirty",2);m([y()],g.prototype,"execApprovalsSnapshot",2);m([y()],g.prototype,"execApprovalsForm",2);m([y()],g.prototype,"execApprovalsSelectedAgent",2);m([y()],g.prototype,"execApprovalsTarget",2);m([y()],g.prototype,"execApprovalsTargetNodeId",2);m([y()],g.prototype,"execApprovalQueue",2);m([y()],g.prototype,"execApprovalBusy",2);m([y()],g.prototype,"execApprovalError",2);m([y()],g.prototype,"configLoading",2);m([y()],g.prototype,"configRaw",2);m([y()],g.prototype,"configRawOriginal",2);m([y()],g.prototype,"configValid",2);m([y()],g.prototype,"configIssues",2);m([y()],g.prototype,"configSaving",2);m([y()],g.prototype,"configApplying",2);m([y()],g.prototype,"updateRunning",2);m([y()],g.prototype,"applySessionKey",2);m([y()],g.prototype,"configSnapshot",2);m([y()],g.prototype,"configSchema",2);m([y()],g.prototype,"configSchemaVersion",2);m([y()],g.prototype,"configSchemaLoading",2);m([y()],g.prototype,"configUiHints",2);m([y()],g.prototype,"configForm",2);m([y()],g.prototype,"configFormOriginal",2);m([y()],g.prototype,"configFormDirty",2);m([y()],g.prototype,"configFormMode",2);m([y()],g.prototype,"configSearchQuery",2);m([y()],g.prototype,"configActiveSection",2);m([y()],g.prototype,"configActiveSubsection",2);m([y()],g.prototype,"channelsLoading",2);m([y()],g.prototype,"channelsSnapshot",2);m([y()],g.prototype,"channelsError",2);m([y()],g.prototype,"channelsLastSuccess",2);m([y()],g.prototype,"whatsappLoginMessage",2);m([y()],g.prototype,"whatsappLoginQrDataUrl",2);m([y()],g.prototype,"whatsappLoginConnected",2);m([y()],g.prototype,"whatsappBusy",2);m([y()],g.prototype,"whatsappActiveQrAccountId",2);m([y()],g.prototype,"whatsappPairedPhone",2);m([y()],g.prototype,"addingWhatsAppAccount",2);m([y()],g.prototype,"newWhatsAppAccountName",2);m([y()],g.prototype,"whatsappAccountError",2);m([y()],g.prototype,"whatsappAccountSaving",2);m([y()],g.prototype,"whatsappSettingsOpen",2);m([y()],g.prototype,"licenseKey",2);m([y()],g.prototype,"licenseBusy",2);m([y()],g.prototype,"licenseValid",2);m([y()],g.prototype,"licenseMessage",2);m([y()],g.prototype,"licenseTier",2);m([y()],g.prototype,"licenseDeviceId",2);m([y()],g.prototype,"licenseStoredKey",2);m([y()],g.prototype,"licenseRemoveConfirm",2);m([y()],g.prototype,"authConnected",2);m([y()],g.prototype,"authBusy",2);m([y()],g.prototype,"authMessage",2);m([y()],g.prototype,"authUrl",2);m([y()],g.prototype,"authCodeInput",2);m([y()],g.prototype,"authExpiresIn",2);m([y()],g.prototype,"setupStep",2);m([y()],g.prototype,"gatewayHealthy",2);m([y()],g.prototype,"gatewayHealthLoading",2);m([y()],g.prototype,"gatewayHealthMessage",2);m([y()],g.prototype,"gatewayRestartBusy",2);m([y()],g.prototype,"updateAvailable",2);m([y()],g.prototype,"currentVersion",2);m([y()],g.prototype,"latestVersion",2);m([y()],g.prototype,"updateChecking",2);m([y()],g.prototype,"updateMessage",2);m([y()],g.prototype,"updateProgressSteps",2);m([y()],g.prototype,"updateLastResult",2);m([y()],g.prototype,"uninstallConfirm",2);m([y()],g.prototype,"uninstallBusy",2);m([y()],g.prototype,"uninstallDone",2);m([y()],g.prototype,"uninstallError",2);m([y()],g.prototype,"uninstallConfirmText",2);m([y()],g.prototype,"nostrProfileFormState",2);m([y()],g.prototype,"nostrProfileAccountId",2);m([y()],g.prototype,"presenceLoading",2);m([y()],g.prototype,"presenceEntries",2);m([y()],g.prototype,"presenceError",2);m([y()],g.prototype,"presenceStatus",2);m([y()],g.prototype,"agentsLoading",2);m([y()],g.prototype,"agentsList",2);m([y()],g.prototype,"agentsError",2);m([y()],g.prototype,"sessionsLoading",2);m([y()],g.prototype,"sessionsResult",2);m([y()],g.prototype,"sessionsError",2);m([y()],g.prototype,"cronLoading",2);m([y()],g.prototype,"cronJobs",2);m([y()],g.prototype,"cronStatus",2);m([y()],g.prototype,"cronError",2);m([y()],g.prototype,"cronForm",2);m([y()],g.prototype,"cronRunsJobId",2);m([y()],g.prototype,"cronRuns",2);m([y()],g.prototype,"cronBusy",2);m([y()],g.prototype,"cronNewEventModal",2);m([y()],g.prototype,"cronDetailJobId",2);m([y()],g.prototype,"browserScreencastActive",2);m([y()],g.prototype,"browserScreencastFrame",2);m([y()],g.prototype,"browserScreencastMetadata",2);m([y()],g.prototype,"browserHandoffPending",2);m([y()],g.prototype,"browserHandoffReason",2);m([y()],g.prototype,"browserHandoffId",2);m([y()],g.prototype,"browserInputMode",2);m([y()],g.prototype,"browserLoading",2);m([y()],g.prototype,"browserError",2);m([y()],g.prototype,"filesLoading",2);m([y()],g.prototype,"filesTree",2);m([y()],g.prototype,"filesRoot",2);m([y()],g.prototype,"filesError",2);m([y()],g.prototype,"filesSelectedPath",2);m([y()],g.prototype,"filesSelectedPaths",2);m([y()],g.prototype,"filesPreviewContent",2);m([y()],g.prototype,"filesPreviewLoading",2);m([y()],g.prototype,"filesPreviewBinary",2);m([y()],g.prototype,"filesPreviewSize",2);m([y()],g.prototype,"filesExpandedDirs",2);m([y()],g.prototype,"filesMessage",2);m([y()],g.prototype,"filesUploadBusy",2);m([y()],g.prototype,"filesReindexBusy",2);m([y()],g.prototype,"filesMemoryStatus",2);m([y()],g.prototype,"filesSearchQuery",2);m([y()],g.prototype,"filesSearchResults",2);m([y()],g.prototype,"filesSearchLoading",2);m([y()],g.prototype,"filesSearchAgentId",2);m([y()],g.prototype,"auditEntries",2);m([y()],g.prototype,"auditLoading",2);m([y()],g.prototype,"auditModalOpen",2);m([y()],g.prototype,"skillsLoading",2);m([y()],g.prototype,"skillsReport",2);m([y()],g.prototype,"skillsError",2);m([y()],g.prototype,"skillsFilter",2);m([y()],g.prototype,"skillEdits",2);m([y()],g.prototype,"skillsBusyKey",2);m([y()],g.prototype,"skillMessages",2);m([y()],g.prototype,"adminsLoading",2);m([y()],g.prototype,"adminPhones",2);m([y()],g.prototype,"adminsError",2);m([y()],g.prototype,"adminsSaving",2);m([y()],g.prototype,"adminsNewPhone",2);m([y()],g.prototype,"customersLoading",2);m([y()],g.prototype,"customersSaving",2);m([y()],g.prototype,"customersRecords",2);m([y()],g.prototype,"customersError",2);m([y()],g.prototype,"customersSearchQuery",2);m([y()],g.prototype,"customersEditingId",2);m([y()],g.prototype,"customersShowAddForm",2);m([y()],g.prototype,"customersNewPhone",2);m([y()],g.prototype,"customersNewName",2);m([y()],g.prototype,"imessageEnableConfirm",2);m([y()],g.prototype,"imessageEnabling",2);m([y()],g.prototype,"infoModalOpen",2);m([y()],g.prototype,"workspaces",2);m([y()],g.prototype,"workspacesLoading",2);m([y()],g.prototype,"workspacesError",2);m([y()],g.prototype,"selectedWorkspace",2);m([y()],g.prototype,"addingWorkspace",2);m([y()],g.prototype,"newWorkspaceName",2);m([y()],g.prototype,"newWorkspacePath",2);m([y()],g.prototype,"newWorkspacePin",2);m([y()],g.prototype,"accountPinModalOpen",2);m([y()],g.prototype,"accountPinBusy",2);m([y()],g.prototype,"accountPinError",2);m([y()],g.prototype,"accountPinSuccess",2);m([y()],g.prototype,"apiKeyProviders",2);m([y()],g.prototype,"apiKeyModalOpen",2);m([y()],g.prototype,"apiKeyBusy",2);m([y()],g.prototype,"apiKeyError",2);m([y()],g.prototype,"apiKeySuccess",2);m([y()],g.prototype,"apiKeySavingProvider",2);m([y()],g.prototype,"authApiKeyMode",2);m([y()],g.prototype,"authApiKeyInput",2);m([y()],g.prototype,"authApiKeyBusy",2);m([y()],g.prototype,"authApiKeyError",2);m([y()],g.prototype,"pinChanging",2);m([y()],g.prototype,"pinChangeBusy",2);m([y()],g.prototype,"pinChangeError",2);m([y()],g.prototype,"loginChangePinMode",2);m([y()],g.prototype,"changePinBusy",2);m([y()],g.prototype,"changePinError",2);m([y()],g.prototype,"changePinSuccess",2);m([y()],g.prototype,"workspaceSaving",2);m([y()],g.prototype,"workspaceRemoveConfirm",2);m([y()],g.prototype,"renamingWorkspace",2);m([y()],g.prototype,"renameWorkspaceName",2);m([y()],g.prototype,"debugLoading",2);m([y()],g.prototype,"debugStatus",2);m([y()],g.prototype,"debugHealth",2);m([y()],g.prototype,"debugModels",2);m([y()],g.prototype,"debugHeartbeat",2);m([y()],g.prototype,"debugCallMethod",2);m([y()],g.prototype,"debugCallParams",2);m([y()],g.prototype,"debugCallResult",2);m([y()],g.prototype,"debugCallError",2);m([y()],g.prototype,"logsLoading",2);m([y()],g.prototype,"logsError",2);m([y()],g.prototype,"logsFile",2);m([y()],g.prototype,"logsEntries",2);m([y()],g.prototype,"logsFilterText",2);m([y()],g.prototype,"logsLevelFilters",2);m([y()],g.prototype,"logsAutoFollow",2);m([y()],g.prototype,"logsTruncated",2);m([y()],g.prototype,"logsCursor",2);m([y()],g.prototype,"logsLastFetchAt",2);m([y()],g.prototype,"logsLimit",2);m([y()],g.prototype,"logsMaxBytes",2);m([y()],g.prototype,"logsAtBottom",2);m([y()],g.prototype,"logsSubTab",2);m([y()],g.prototype,"sessionLogsLoading",2);m([y()],g.prototype,"sessionLogsError",2);m([y()],g.prototype,"sessionLogsEntries",2);m([y()],g.prototype,"sessionLogsFilterText",2);m([y()],g.prototype,"sessionLogsTypeFilters",2);m([y()],g.prototype,"sessionLogsAgentFilters",2);m([y()],g.prototype,"sessionLogsAgents",2);m([y()],g.prototype,"sessionLogsAutoFollow",2);m([y()],g.prototype,"sessionLogsFull",2);m([y()],g.prototype,"sessionLogsCursors",2);m([y()],g.prototype,"sessionLogsLastFetchAt",2);m([y()],g.prototype,"sessionLogsAtBottom",2);m([y()],g.prototype,"chatUserNearBottom",2);g=m([za("taskmaster-app")],g);
|
|
2960
|
-
//# sourceMappingURL=index-
|
|
2960
|
+
//# sourceMappingURL=index-DLaLQGyo.js.map
|