@m6d/cortex-angular 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -0
- package/fesm2022/m6d-cortex-angular.mjs +2331 -1036
- package/package.json +1 -1
- package/theme.css +9 -0
- package/types/m6d-cortex-angular.d.ts +83 -3
|
@@ -24,7 +24,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
24
24
|
|
|
25
25
|
// dist/fesm2022/m6d-cortex-angular.mjs
|
|
26
26
|
import * as i0 from "@angular/core";
|
|
27
|
-
import { ChangeDetectionStrategy as ChangeDetectionStrategy2, Component, DestroyRef, EnvironmentInjector, Injectable, InjectionToken, Injector, NgZone, Pipe, ViewEncapsulation as ViewEncapsulation2, afterNextRender, computed, createEnvironmentInjector, effect, inject, input, output, runInInjectionContext, signal, untracked, viewChild } from "@angular/core";
|
|
27
|
+
import { ChangeDetectionStrategy as ChangeDetectionStrategy2, Component, DestroyRef, Directive, EnvironmentInjector, Injectable, InjectionToken, Injector, NgZone, Pipe, TemplateRef, ViewEncapsulation as ViewEncapsulation2, afterNextRender, afterRenderEffect, computed, contentChild, createEnvironmentInjector, effect, inject, input, output, runInInjectionContext, signal, untracked, viewChild } from "@angular/core";
|
|
28
28
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
29
29
|
|
|
30
30
|
// src/internal/wire/index.ts
|
|
@@ -44,6 +44,7 @@ function checkAttachmentPolicy(contentType, sizeBytes) {
|
|
|
44
44
|
return "size";
|
|
45
45
|
return "ok";
|
|
46
46
|
}
|
|
47
|
+
var STATEMENT_TOOLS = ["executeCode", "queryDataset", "describeDataset"];
|
|
47
48
|
function toUiMessage(message) {
|
|
48
49
|
return { ...message, role: message.role === "trigger" ? "user" : message.role };
|
|
49
50
|
}
|
|
@@ -168,157 +169,30 @@ function createCortexApiClient(getTransport) {
|
|
|
168
169
|
resolveUrl
|
|
169
170
|
};
|
|
170
171
|
}
|
|
171
|
-
// src/internal/client
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
complete: "translate_completed",
|
|
188
|
-
error: "translate_error"
|
|
189
|
-
};
|
|
190
|
-
function toolCallBadge(part) {
|
|
191
|
-
const { state, approval } = part;
|
|
192
|
-
return {
|
|
193
|
-
modifier: STATE_MODIFIERS[state],
|
|
194
|
-
labelKey: approval?.approved === false ? "translate_declined" : state === "approval-responded" && approval?.approved ? "translate_approved" : BADGE_LABEL_KEYS[state],
|
|
195
|
-
pulse: state === "awaiting-input" || state === "input-streaming" ? "default" : state === "approval-requested" ? "violet" : undefined
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
function toolCallOutputText(part) {
|
|
199
|
-
const output = part.output;
|
|
200
|
-
if (output === undefined || output === null)
|
|
201
|
-
return "";
|
|
202
|
-
if (typeof output === "string")
|
|
203
|
-
return output;
|
|
204
|
-
return JSON.stringify(output, null, 2);
|
|
205
|
-
}
|
|
206
|
-
var CODE_FIELDS = {
|
|
207
|
-
code: "javascript",
|
|
208
|
-
query: "cypher"
|
|
209
|
-
};
|
|
210
|
-
function splitToolCallInput(input) {
|
|
211
|
-
const record = input && typeof input === "object" ? input : null;
|
|
212
|
-
const codeSnippets = record ? Object.entries(CODE_FIELDS).flatMap(([key, lang]) => {
|
|
213
|
-
const value = record[key];
|
|
214
|
-
return typeof value === "string" ? [{ key, lang, value: value.replace(/\\n/g, `
|
|
215
|
-
`) }] : [];
|
|
216
|
-
}) : [];
|
|
217
|
-
let remainingInput = input;
|
|
218
|
-
if (record) {
|
|
219
|
-
const rest = Object.fromEntries(Object.entries(record).filter(([key]) => !Object.hasOwn(CODE_FIELDS, key)));
|
|
220
|
-
remainingInput = Object.keys(rest).length > 0 ? rest : null;
|
|
221
|
-
}
|
|
222
|
-
return {
|
|
223
|
-
codeSnippets,
|
|
224
|
-
remainingInput,
|
|
225
|
-
remainingInputText: remainingInput ? JSON.stringify(remainingInput, null, 2) : ""
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
var STATUS_COUNT = 10;
|
|
229
|
-
var ANIM_STATES = {
|
|
230
|
-
"awaiting-input": "starting",
|
|
231
|
-
"input-streaming": "starting",
|
|
232
|
-
"input-complete": "processing",
|
|
233
|
-
"approval-requested": "approval",
|
|
234
|
-
"approval-responded": "processing",
|
|
235
|
-
complete: "complete",
|
|
236
|
-
error: "error"
|
|
237
|
-
};
|
|
238
|
-
function stableIndex(id) {
|
|
239
|
-
let hash = 0;
|
|
240
|
-
for (let i = 0;i < id.length; i++) {
|
|
241
|
-
hash = hash * 31 + id.charCodeAt(i) | 0;
|
|
242
|
-
}
|
|
243
|
-
return Math.abs(hash) % STATUS_COUNT;
|
|
244
|
-
}
|
|
245
|
-
function toolCallStatement(part) {
|
|
246
|
-
const input = part.input;
|
|
247
|
-
if (!input || typeof input !== "object" || !("status" in input))
|
|
248
|
-
return;
|
|
249
|
-
const status = input.status;
|
|
250
|
-
return typeof status === "string" && status.trim() ? status.trim() : undefined;
|
|
251
|
-
}
|
|
252
|
-
function outputReportsFailure(part) {
|
|
253
|
-
let output = part.output;
|
|
254
|
-
if (typeof output === "string") {
|
|
255
|
-
try {
|
|
256
|
-
output = JSON.parse(output);
|
|
257
|
-
} catch {
|
|
258
|
-
return false;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return !!output && typeof output === "object" && "error" in output && output.error === true;
|
|
262
|
-
}
|
|
263
|
-
function toolCallRowCount(part) {
|
|
264
|
-
const output = part.output;
|
|
265
|
-
if (!output || typeof output !== "object" || !("rowCount" in output))
|
|
266
|
-
return;
|
|
267
|
-
return typeof output.rowCount === "number" ? output.rowCount : undefined;
|
|
268
|
-
}
|
|
269
|
-
function pooledTitleKey(part, state, declined) {
|
|
270
|
-
if (declined)
|
|
271
|
-
return "translate_declined";
|
|
272
|
-
if (state === "error")
|
|
273
|
-
return "translate_tool_error";
|
|
274
|
-
if (state === "approval")
|
|
275
|
-
return "translate_needs_approval";
|
|
276
|
-
const family = part.name === "readAttachment" ? "attachment" : "tool";
|
|
277
|
-
const variant = family === "tool" ? `_${stableIndex(part.id)}` : "";
|
|
278
|
-
return `translate_${family}_${state === "complete" ? "done" : "status"}${variant}`;
|
|
279
|
-
}
|
|
280
|
-
function toolCallAnimation(part) {
|
|
281
|
-
const declined = part.approval?.approved === false;
|
|
282
|
-
const failed = declined || part.state === "complete" && outputReportsFailure(part);
|
|
283
|
-
const state = failed ? "error" : ANIM_STATES[part.state] ?? "processing";
|
|
172
|
+
// src/internal/client-tools/index.ts
|
|
173
|
+
var CLIENT_TOOL_MESSAGE_TYPE = "cortex:client-tool";
|
|
174
|
+
var CLIENT_TOOL_STATUSES = ["completed", "cancelled", "failed"];
|
|
175
|
+
var REQUEST_LOCATION_TOOL = "requestLocation";
|
|
176
|
+
function parseClientToolHandshake(data, origin, embedOrigin) {
|
|
177
|
+
if (origin !== embedOrigin)
|
|
178
|
+
return null;
|
|
179
|
+
if (typeof data !== "object" || data === null)
|
|
180
|
+
return null;
|
|
181
|
+
const message = data;
|
|
182
|
+
if (message["type"] !== CLIENT_TOOL_MESSAGE_TYPE)
|
|
183
|
+
return null;
|
|
184
|
+
const status = CLIENT_TOOL_STATUSES.find((known) => known === message["status"]);
|
|
185
|
+
if (!status)
|
|
186
|
+
return null;
|
|
187
|
+
const reference = message["reference"];
|
|
284
188
|
return {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
statement: toolCallStatement(part),
|
|
290
|
-
rowCount: state === "complete" ? toolCallRowCount(part) : undefined
|
|
189
|
+
type: CLIENT_TOOL_MESSAGE_TYPE,
|
|
190
|
+
status,
|
|
191
|
+
...typeof reference === "string" ? { reference } : {},
|
|
192
|
+
...message["result"] !== undefined ? { result: message["result"] } : {}
|
|
291
193
|
};
|
|
292
194
|
}
|
|
293
|
-
function approvalPrompt(part, locale) {
|
|
294
|
-
const metadata = part.metadata;
|
|
295
|
-
if (!metadata || typeof metadata !== "object" || !("cortex" in metadata))
|
|
296
|
-
return;
|
|
297
|
-
const cortex = metadata.cortex;
|
|
298
|
-
return cortex?.approval?.[locale] || undefined;
|
|
299
|
-
}
|
|
300
|
-
function activityLabelKeys(activity) {
|
|
301
|
-
return Array.from({ length: STATUS_COUNT }, (_, index) => `translate_${activity}_${index}`);
|
|
302
|
-
}
|
|
303
|
-
function visibleMessageParts(parts, options) {
|
|
304
|
-
return parts.filter((part, index) => {
|
|
305
|
-
if (part.type === "tool-result")
|
|
306
|
-
return false;
|
|
307
|
-
if (options.debugMode)
|
|
308
|
-
return true;
|
|
309
|
-
if (options.fold?.get(part)?.kind === "hidden")
|
|
310
|
-
return false;
|
|
311
|
-
if (part.type === "text" && !part.content.trim())
|
|
312
|
-
return false;
|
|
313
|
-
const isLast = index === parts.length - 1;
|
|
314
|
-
return part.type !== "thinking" || options.isStreaming && isLast;
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
function messageCopyText(parts) {
|
|
318
|
-
return parts.filter((part) => part.type === "text").map((part) => part.content).join(`
|
|
319
195
|
|
|
320
|
-
`);
|
|
321
|
-
}
|
|
322
196
|
// src/internal/client/src/chat/pending-tool-calls.ts
|
|
323
197
|
var SETTLED_STATES = new Set(["complete", "error"]);
|
|
324
198
|
function isSettledToolState(state) {
|
|
@@ -345,97 +219,624 @@ function newestAssistantMessage(messages) {
|
|
|
345
219
|
}
|
|
346
220
|
return;
|
|
347
221
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
222
|
+
// src/internal/client/src/i18n/ar.json
|
|
223
|
+
var ar_default = {
|
|
224
|
+
translate_history: "السجل",
|
|
225
|
+
translate_back: "رجوع",
|
|
226
|
+
translate_greeting: "بماذا يمكنني مساعدتك اليوم؟",
|
|
227
|
+
translate_n_conversations: "{{count}} محادثات",
|
|
228
|
+
translate_one_conversation: "محادثة واحدة",
|
|
229
|
+
translate_no_threads_yet: "لا توجد محادثات بعد",
|
|
230
|
+
translate_start_a_new_conversation: "ابدأ محادثة جديدة",
|
|
231
|
+
translate_untitled: "بدون عنوان",
|
|
232
|
+
translate_new_chat: "محادثة جديدة",
|
|
233
|
+
translate_normal: "عادي",
|
|
234
|
+
translate_debug: "تصحيح",
|
|
235
|
+
translate_type_a_message: "اكتب رسالة...",
|
|
236
|
+
translate_completed: "مكتمل",
|
|
237
|
+
translate_attach_files: "إرفاق ملفات",
|
|
238
|
+
translate_drop_files_here: "أفلت ملفاتك هنا...",
|
|
239
|
+
translate_remove_attachment: "إزالة المرفق",
|
|
240
|
+
translate_attachment_rejected: "لا يمكن إرفاق هذا الملف",
|
|
241
|
+
translate_attachment_caption: "من فضلك اطّلع على الملفات المرفقة.",
|
|
242
|
+
translate_download: "تنزيل",
|
|
243
|
+
translate_tool_status_0: "جارٍ جلب البيانات…",
|
|
244
|
+
translate_tool_status_1: "جارٍ تحليل المعلومات…",
|
|
245
|
+
translate_tool_status_2: "جارٍ معالجة الطلب…",
|
|
246
|
+
translate_tool_status_3: "جارٍ تجميع النتائج…",
|
|
247
|
+
translate_tool_status_4: "جارٍ تحضير الرد…",
|
|
248
|
+
translate_tool_status_5: "جارٍ البحث…",
|
|
249
|
+
translate_tool_status_6: "جارٍ فحص السجلات…",
|
|
250
|
+
translate_tool_status_7: "جارٍ مراجعة التفاصيل…",
|
|
251
|
+
translate_tool_status_8: "جارٍ إجراء الحسابات…",
|
|
252
|
+
translate_tool_status_9: "جارٍ سحب المعلومات…",
|
|
253
|
+
translate_tool_done_0: "تم جلب البيانات بنجاح",
|
|
254
|
+
translate_tool_done_1: "تم التحليل بنجاح",
|
|
255
|
+
translate_tool_done_2: "تمت معالجة الطلب بنجاح",
|
|
256
|
+
translate_tool_done_3: "تم تجميع النتائج بنجاح",
|
|
257
|
+
translate_tool_done_4: "تم تحضير الرد بنجاح",
|
|
258
|
+
translate_tool_done_5: "تم البحث بنجاح",
|
|
259
|
+
translate_tool_done_6: "تم فحص السجلات بنجاح",
|
|
260
|
+
translate_tool_done_7: "تمت المراجعة بنجاح",
|
|
261
|
+
translate_tool_done_8: "تمت الحسابات بنجاح",
|
|
262
|
+
translate_tool_done_9: "تم استرجاع المعلومات بنجاح",
|
|
263
|
+
translate_rows_read: "{{count}} صفوف",
|
|
264
|
+
translate_one_more_step: "وخطوة أخرى",
|
|
265
|
+
translate_n_more_steps: "و{{count}} خطوات أخرى",
|
|
266
|
+
translate_tool_error: "حدث خطأ",
|
|
267
|
+
translate_attachment_status: "جارٍ قراءة الملف المرفق…",
|
|
268
|
+
translate_attachment_done: "تمت قراءة الملف المرفق",
|
|
269
|
+
translate_graph_0: "جارٍ استكشاف الروابط...",
|
|
270
|
+
translate_graph_1: "جارٍ رسم الخريطة...",
|
|
271
|
+
translate_graph_2: "جارٍ اكتشاف العلاقات...",
|
|
272
|
+
translate_graph_3: "جارٍ تتبع الروابط...",
|
|
273
|
+
translate_graph_4: "جارٍ التنقل في المعرفة...",
|
|
274
|
+
translate_graph_5: "جارٍ كشف الرؤى...",
|
|
275
|
+
translate_graph_6: "جارٍ ربط النقاط...",
|
|
276
|
+
translate_graph_7: "جارٍ تتبع المسار...",
|
|
277
|
+
translate_graph_8: "جارٍ تجميع الأجزاء...",
|
|
278
|
+
translate_graph_9: "جارٍ بناء الصورة...",
|
|
279
|
+
translate_code_0: "جارٍ حساب الأرقام...",
|
|
280
|
+
translate_code_1: "جارٍ معالجة البيانات...",
|
|
281
|
+
translate_code_2: "جارٍ تنفيذ طلبك...",
|
|
282
|
+
translate_code_3: "جارٍ تحليل الأرقام...",
|
|
283
|
+
translate_code_4: "جارٍ تجميع كل شيء...",
|
|
284
|
+
translate_code_5: "جارٍ تحليل النتائج...",
|
|
285
|
+
translate_code_6: "جارٍ العمل خلف الكواليس...",
|
|
286
|
+
translate_code_7: "جارٍ ترتيب التفاصيل...",
|
|
287
|
+
translate_code_8: "جارٍ تحضير إجابتك...",
|
|
288
|
+
translate_code_9: "أوشك على الانتهاء...",
|
|
289
|
+
translate_reasoning_0: "جارٍ التفكير...",
|
|
290
|
+
translate_reasoning_1: "جارٍ دراسة الخيارات...",
|
|
291
|
+
translate_reasoning_2: "جارٍ تقييم الاحتمالات...",
|
|
292
|
+
translate_reasoning_3: "جارٍ التأمل في هذا...",
|
|
293
|
+
translate_reasoning_4: "جارٍ إيجاد الحل...",
|
|
294
|
+
translate_reasoning_5: "جارٍ ترتيب الأفكار...",
|
|
295
|
+
translate_reasoning_6: "جارٍ التمعن في الأمر...",
|
|
296
|
+
translate_reasoning_7: "جارٍ إيجاد أفضل طريقة...",
|
|
297
|
+
translate_reasoning_8: "جارٍ تنظيم أفكاري...",
|
|
298
|
+
translate_reasoning_9: "أوشك على الانتهاء...",
|
|
299
|
+
translate_running: "قيد التنفيذ",
|
|
300
|
+
translate_aborted: "تم الإلغاء",
|
|
301
|
+
translate_input: "المدخلات",
|
|
302
|
+
translate_output: "المخرجات",
|
|
303
|
+
translate_calling: "جارٍ الاستدعاء",
|
|
304
|
+
translate_input_ready: "المدخلات جاهزة",
|
|
305
|
+
translate_needs_approval: "بحاجة إلى موافقة",
|
|
306
|
+
translate_approved: "تمت الموافقة",
|
|
307
|
+
translate_responded: "تم الرد",
|
|
308
|
+
translate_declined: "تم الرفض",
|
|
309
|
+
translate_approve: "موافقة",
|
|
310
|
+
translate_deny: "رفض",
|
|
311
|
+
translate_error: "خطأ",
|
|
312
|
+
translate_approval_requested: "طلب موافقة",
|
|
313
|
+
translate_approval_response: "رد الموافقة",
|
|
314
|
+
translate_waiting_for_approval: "في انتظار الموافقة لتنفيذ هذه الأداة.",
|
|
315
|
+
translate_tool_approved: "تمت الموافقة.",
|
|
316
|
+
translate_tool_response_received: "تم استلام الرد.",
|
|
317
|
+
translate_tokens: "رمز",
|
|
318
|
+
translate_fresh: "جديد",
|
|
319
|
+
translate_cache_read: "قراءة من الذاكرة",
|
|
320
|
+
translate_cache_write: "كتابة في الذاكرة",
|
|
321
|
+
translate_n_percent_cached: "{{percent}}٪ مخزّن مؤقتًا",
|
|
322
|
+
translate_text: "نص",
|
|
323
|
+
translate_reasoning: "الاستنتاج",
|
|
324
|
+
translate_read: "قراءة",
|
|
325
|
+
translate_write: "كتابة",
|
|
326
|
+
translate_total: "الإجمالي",
|
|
327
|
+
translate_request: "الطلب",
|
|
328
|
+
translate_response: "الرد",
|
|
329
|
+
translate_step_n: "الخطوة {{number}}",
|
|
330
|
+
translate_inspect_llm_requests: "فحص طلبات النموذج",
|
|
331
|
+
translate_loading: "جارٍ التحميل…",
|
|
332
|
+
translate_no_llm_requests: "لا توجد طلبات نموذج مسجّلة لهذه الرسالة.",
|
|
333
|
+
translate_unhandled_type: "نوع غير مدعوم:",
|
|
334
|
+
translate_client_tool_title: "أكمل هذه الخطوة للمتابعة",
|
|
335
|
+
translate_client_tool_loading: "جارٍ تجهيز خطوة آمنة...",
|
|
336
|
+
translate_client_tool_failed: "تعذّر تحميل هذه الخطوة",
|
|
337
|
+
translate_client_tool_retry: "حاول مرة أخرى",
|
|
338
|
+
translate_client_tool_cancel: "إلغاء",
|
|
339
|
+
translate_location_hint: "انقر على الخريطة لتثبيت الدبوس",
|
|
340
|
+
translate_location_locate: "استخدم موقعي",
|
|
341
|
+
translate_location_locating: "جارٍ تحديد موقعك",
|
|
342
|
+
translate_location_locate_failed: "موقعك غير متاح",
|
|
343
|
+
translate_location_map_failed: "تعذّر تحميل الخريطة",
|
|
344
|
+
translate_location_send_failed: "تعذّر الإرسال، حاول مرة أخرى",
|
|
345
|
+
translate_location_skip: "ليس الآن",
|
|
346
|
+
translate_location_send: "إرسال",
|
|
347
|
+
translate_location_shared: "تمت مشاركة الموقع",
|
|
348
|
+
translate_location_not_shared: "لم تتم مشاركة الموقع",
|
|
349
|
+
translate_trigger_fired: "تم التشغيل بواسطة",
|
|
350
|
+
translate_trigger_payload: "الحمولة",
|
|
351
|
+
translate_messages_disabled: "يعمل هذا الوكيل من مشغّلاته فقط.",
|
|
352
|
+
translate_streaming: "جارٍ البث",
|
|
353
|
+
translate_done: "تم",
|
|
354
|
+
translate_no_reasoning: "لا يوجد تفكير مسجّل.",
|
|
355
|
+
translate_copy: "نسخ إلى الحافظة",
|
|
356
|
+
translate_copied: "تم النسخ",
|
|
357
|
+
translate_media_pending_mermaid: "جارٍ رسم المخطط",
|
|
358
|
+
translate_media_pending_vega_lite: "جارٍ رسم الرسم البياني",
|
|
359
|
+
translate_media_pending_map: "جارٍ رسم الخريطة",
|
|
360
|
+
translate_media_cut_off: "انقطع هذا المقطع قبل اكتماله.",
|
|
361
|
+
translate_media_failed: "تعذر عرض هذا المقطع.",
|
|
362
|
+
translate_media_source: "المصدر",
|
|
363
|
+
translate_media_pending: "جارٍ الرسم",
|
|
364
|
+
translate_image_unavailable: "الصورة غير متاحة",
|
|
365
|
+
translate_image_unavailable_alt: "الصورة غير متاحة: {{alt}}",
|
|
366
|
+
translate_send: "إرسال",
|
|
367
|
+
translate_table_expand: "توسيع الجدول",
|
|
368
|
+
translate_table_export: "تصدير إلى Excel",
|
|
369
|
+
translate_close: "إغلاق",
|
|
370
|
+
translate_approval_needed: "بحاجة إلى موافقتك",
|
|
371
|
+
translate_approval_action: "تنفيذ {{tool}}",
|
|
372
|
+
translate_details: "التفاصيل",
|
|
373
|
+
translate_approved_failed: "تمت الموافقة لكنه فشل",
|
|
374
|
+
translate_empty_value: "(فارغ)",
|
|
375
|
+
translate_approval_cancelled: "لم يُتخذ قرار"
|
|
376
|
+
};
|
|
377
|
+
// src/internal/client/src/i18n/en.json
|
|
378
|
+
var en_default = {
|
|
379
|
+
translate_history: "History",
|
|
380
|
+
translate_back: "Back",
|
|
381
|
+
translate_greeting: "What can I help you with today?",
|
|
382
|
+
translate_n_conversations: "{{count}} conversations",
|
|
383
|
+
translate_one_conversation: "1 conversation",
|
|
384
|
+
translate_no_threads_yet: "No threads yet",
|
|
385
|
+
translate_start_a_new_conversation: "Start a new conversation",
|
|
386
|
+
translate_untitled: "Untitled",
|
|
387
|
+
translate_new_chat: "New Chat",
|
|
388
|
+
translate_normal: "Normal",
|
|
389
|
+
translate_debug: "Debug",
|
|
390
|
+
translate_type_a_message: "Type a message...",
|
|
391
|
+
translate_completed: "Completed",
|
|
392
|
+
translate_attach_files: "Attach files",
|
|
393
|
+
translate_drop_files_here: "Drop your files here...",
|
|
394
|
+
translate_remove_attachment: "Remove attachment",
|
|
395
|
+
translate_attachment_rejected: "This file cannot be attached",
|
|
396
|
+
translate_attachment_caption: "Please take a look at the attached files.",
|
|
397
|
+
translate_download: "Download",
|
|
398
|
+
translate_tool_status_0: "Fetching data...",
|
|
399
|
+
translate_tool_status_1: "Analyzing information...",
|
|
400
|
+
translate_tool_status_2: "Processing request...",
|
|
401
|
+
translate_tool_status_3: "Gathering results...",
|
|
402
|
+
translate_tool_status_4: "Preparing response...",
|
|
403
|
+
translate_tool_status_5: "Looking things up...",
|
|
404
|
+
translate_tool_status_6: "Checking records...",
|
|
405
|
+
translate_tool_status_7: "Reviewing details...",
|
|
406
|
+
translate_tool_status_8: "Running calculations...",
|
|
407
|
+
translate_tool_status_9: "Pulling information...",
|
|
408
|
+
translate_tool_done_0: "Data fetched successfully",
|
|
409
|
+
translate_tool_done_1: "Analysis completed successfully",
|
|
410
|
+
translate_tool_done_2: "Request processed successfully",
|
|
411
|
+
translate_tool_done_3: "Results gathered successfully",
|
|
412
|
+
translate_tool_done_4: "Response prepared successfully",
|
|
413
|
+
translate_tool_done_5: "Lookup completed successfully",
|
|
414
|
+
translate_tool_done_6: "Records checked successfully",
|
|
415
|
+
translate_tool_done_7: "Review completed successfully",
|
|
416
|
+
translate_tool_done_8: "Calculations completed successfully",
|
|
417
|
+
translate_tool_done_9: "Information retrieved successfully",
|
|
418
|
+
translate_rows_read: "{{count}} rows",
|
|
419
|
+
translate_one_more_step: "and 1 more step",
|
|
420
|
+
translate_n_more_steps: "and {{count}} more steps",
|
|
421
|
+
translate_tool_error: "Something went wrong",
|
|
422
|
+
translate_attachment_status: "Reading the attached file...",
|
|
423
|
+
translate_attachment_done: "Finished reading the file",
|
|
424
|
+
translate_graph_0: "Exploring connections...",
|
|
425
|
+
translate_graph_1: "Mapping out the links...",
|
|
426
|
+
translate_graph_2: "Discovering relationships...",
|
|
427
|
+
translate_graph_3: "Tracing the connections...",
|
|
428
|
+
translate_graph_4: "Navigating the knowledge...",
|
|
429
|
+
translate_graph_5: "Uncovering insights...",
|
|
430
|
+
translate_graph_6: "Connecting the dots...",
|
|
431
|
+
translate_graph_7: "Following the trail...",
|
|
432
|
+
translate_graph_8: "Piecing things together...",
|
|
433
|
+
translate_graph_9: "Building the picture...",
|
|
434
|
+
translate_code_0: "Running the numbers...",
|
|
435
|
+
translate_code_1: "Working through the data...",
|
|
436
|
+
translate_code_2: "Processing your request...",
|
|
437
|
+
translate_code_3: "Crunching the figures...",
|
|
438
|
+
translate_code_4: "Putting it all together...",
|
|
439
|
+
translate_code_5: "Analyzing the results...",
|
|
440
|
+
translate_code_6: "Working behind the scenes...",
|
|
441
|
+
translate_code_7: "Sorting through the details...",
|
|
442
|
+
translate_code_8: "Preparing your answer...",
|
|
443
|
+
translate_code_9: "Almost ready...",
|
|
444
|
+
translate_reasoning_0: "Thinking it through...",
|
|
445
|
+
translate_reasoning_1: "Considering the options...",
|
|
446
|
+
translate_reasoning_2: "Weighing the possibilities...",
|
|
447
|
+
translate_reasoning_3: "Reflecting on this...",
|
|
448
|
+
translate_reasoning_4: "Working it out...",
|
|
449
|
+
translate_reasoning_5: "Putting thoughts together...",
|
|
450
|
+
translate_reasoning_6: "Mulling it over...",
|
|
451
|
+
translate_reasoning_7: "Finding the best approach...",
|
|
452
|
+
translate_reasoning_8: "Organizing my thoughts...",
|
|
453
|
+
translate_reasoning_9: "Almost there...",
|
|
454
|
+
translate_running: "Running",
|
|
455
|
+
translate_aborted: "Aborted",
|
|
456
|
+
translate_input: "Input",
|
|
457
|
+
translate_output: "Output",
|
|
458
|
+
translate_calling: "Calling",
|
|
459
|
+
translate_input_ready: "Input ready",
|
|
460
|
+
translate_needs_approval: "Needs approval",
|
|
461
|
+
translate_approved: "Approved",
|
|
462
|
+
translate_responded: "Responded",
|
|
463
|
+
translate_declined: "Declined",
|
|
464
|
+
translate_approve: "Approve",
|
|
465
|
+
translate_deny: "Deny",
|
|
466
|
+
translate_error: "Error",
|
|
467
|
+
translate_approval_requested: "Approval requested",
|
|
468
|
+
translate_approval_response: "Approval response",
|
|
469
|
+
translate_waiting_for_approval: "Waiting for approval to execute this tool.",
|
|
470
|
+
translate_tool_approved: "Approved.",
|
|
471
|
+
translate_tool_response_received: "Response received.",
|
|
472
|
+
translate_tokens: "tokens",
|
|
473
|
+
translate_fresh: "Fresh",
|
|
474
|
+
translate_cache_read: "Cache read",
|
|
475
|
+
translate_cache_write: "Cache write",
|
|
476
|
+
translate_n_percent_cached: "{{percent}}% cached",
|
|
477
|
+
translate_text: "Text",
|
|
478
|
+
translate_reasoning: "Reasoning",
|
|
479
|
+
translate_read: "Read",
|
|
480
|
+
translate_write: "Write",
|
|
481
|
+
translate_total: "Total",
|
|
482
|
+
translate_request: "Request",
|
|
483
|
+
translate_response: "Response",
|
|
484
|
+
translate_step_n: "Step {{number}}",
|
|
485
|
+
translate_inspect_llm_requests: "Inspect LLM requests",
|
|
486
|
+
translate_loading: "loading…",
|
|
487
|
+
translate_no_llm_requests: "No LLM requests recorded for this message.",
|
|
488
|
+
translate_unhandled_type: "Unhandled type:",
|
|
489
|
+
translate_client_tool_title: "Complete this step to continue",
|
|
490
|
+
translate_client_tool_loading: "Preparing a secure step...",
|
|
491
|
+
translate_client_tool_failed: "This step could not be loaded",
|
|
492
|
+
translate_client_tool_retry: "Try again",
|
|
493
|
+
translate_client_tool_cancel: "Cancel",
|
|
494
|
+
translate_location_hint: "Tap the map to drop a pin",
|
|
495
|
+
translate_location_locate: "Use my location",
|
|
496
|
+
translate_location_locating: "Finding your location",
|
|
497
|
+
translate_location_locate_failed: "Your location is not available",
|
|
498
|
+
translate_location_map_failed: "The map could not be loaded",
|
|
499
|
+
translate_location_send_failed: "Could not send, try again",
|
|
500
|
+
translate_location_skip: "Not now",
|
|
501
|
+
translate_location_send: "Send",
|
|
502
|
+
translate_location_shared: "Location shared",
|
|
503
|
+
translate_location_not_shared: "Location not shared",
|
|
504
|
+
translate_trigger_fired: "Triggered by",
|
|
505
|
+
translate_trigger_payload: "Payload",
|
|
506
|
+
translate_messages_disabled: "This agent only runs from its triggers.",
|
|
507
|
+
translate_streaming: "Streaming",
|
|
508
|
+
translate_done: "Done",
|
|
509
|
+
translate_no_reasoning: "No reasoning provided.",
|
|
510
|
+
translate_copy: "Copy to clipboard",
|
|
511
|
+
translate_copied: "Copied",
|
|
512
|
+
translate_media_pending_mermaid: "Drawing diagram",
|
|
513
|
+
translate_media_pending_vega_lite: "Drawing chart",
|
|
514
|
+
translate_media_pending_map: "Drawing map",
|
|
515
|
+
translate_media_cut_off: "This block was cut off before it finished.",
|
|
516
|
+
translate_media_failed: "Could not render this block.",
|
|
517
|
+
translate_media_source: "Source",
|
|
518
|
+
translate_media_pending: "Drawing",
|
|
519
|
+
translate_image_unavailable: "Image unavailable",
|
|
520
|
+
translate_image_unavailable_alt: "Image unavailable: {{alt}}",
|
|
521
|
+
translate_send: "Send",
|
|
522
|
+
translate_table_expand: "Expand table",
|
|
523
|
+
translate_table_export: "Export to Excel",
|
|
524
|
+
translate_close: "Close",
|
|
525
|
+
translate_approval_needed: "Needs your approval",
|
|
526
|
+
translate_approval_action: "Run {{tool}}",
|
|
527
|
+
translate_details: "Details",
|
|
528
|
+
translate_approved_failed: "Approved, but it failed",
|
|
529
|
+
translate_empty_value: "(empty)",
|
|
530
|
+
translate_approval_cancelled: "Not decided"
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
// src/internal/client/src/i18n.ts
|
|
534
|
+
var translations = { en: en_default, ar: ar_default };
|
|
535
|
+
function resolveLocale(locale) {
|
|
536
|
+
return locale && LOCALES.includes(locale) ? locale : LOCALES[0];
|
|
537
|
+
}
|
|
538
|
+
function translate(locale, key, params) {
|
|
539
|
+
const value = translations[locale][key];
|
|
540
|
+
if (!params)
|
|
541
|
+
return value;
|
|
542
|
+
return value.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, name) => (name in params) ? String(params[name]) : match);
|
|
543
|
+
}
|
|
544
|
+
function pluralKey(count, one, other) {
|
|
545
|
+
return count === 1 ? one : other;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// src/internal/client/src/tools/tool-call-view.ts
|
|
549
|
+
var STATE_MODIFIERS = {
|
|
550
|
+
complete: "success",
|
|
551
|
+
error: "error",
|
|
552
|
+
"approval-requested": "approval",
|
|
553
|
+
"approval-responded": "approval",
|
|
554
|
+
"awaiting-input": "pending",
|
|
555
|
+
"input-streaming": "pending",
|
|
556
|
+
"input-complete": "pending"
|
|
557
|
+
};
|
|
558
|
+
var BADGE_LABEL_KEYS = {
|
|
559
|
+
"awaiting-input": "translate_calling",
|
|
560
|
+
"input-streaming": "translate_calling",
|
|
561
|
+
"input-complete": "translate_input_ready",
|
|
562
|
+
"approval-requested": "translate_needs_approval",
|
|
563
|
+
"approval-responded": "translate_responded",
|
|
564
|
+
complete: "translate_completed",
|
|
565
|
+
error: "translate_error"
|
|
566
|
+
};
|
|
567
|
+
function toolCallBadge(part) {
|
|
568
|
+
const { state, approval } = part;
|
|
569
|
+
return {
|
|
570
|
+
modifier: STATE_MODIFIERS[state],
|
|
571
|
+
labelKey: approval?.approved === false ? "translate_declined" : state === "approval-responded" && approval?.approved ? "translate_approved" : BADGE_LABEL_KEYS[state],
|
|
572
|
+
pulse: state === "awaiting-input" || state === "input-streaming" ? "default" : state === "approval-requested" ? "violet" : undefined
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
function toolCallOutputText(part) {
|
|
576
|
+
const output = part.output;
|
|
577
|
+
if (output === undefined || output === null)
|
|
578
|
+
return "";
|
|
579
|
+
if (typeof output === "string")
|
|
580
|
+
return output;
|
|
581
|
+
return JSON.stringify(output, null, 2);
|
|
582
|
+
}
|
|
583
|
+
var CODE_FIELDS = {
|
|
584
|
+
code: "javascript",
|
|
585
|
+
query: "cypher"
|
|
586
|
+
};
|
|
587
|
+
function splitToolCallInput(input) {
|
|
588
|
+
const record = input && typeof input === "object" ? input : null;
|
|
589
|
+
const codeSnippets = record ? Object.entries(CODE_FIELDS).flatMap(([key, lang]) => {
|
|
590
|
+
const value = record[key];
|
|
591
|
+
return typeof value === "string" ? [{ key, lang, value: value.replace(/\\n/g, `
|
|
592
|
+
`) }] : [];
|
|
593
|
+
}) : [];
|
|
594
|
+
let remainingInput = input;
|
|
595
|
+
if (record) {
|
|
596
|
+
const rest = Object.fromEntries(Object.entries(record).filter(([key]) => !Object.hasOwn(CODE_FIELDS, key)));
|
|
597
|
+
remainingInput = Object.keys(rest).length > 0 ? rest : null;
|
|
598
|
+
}
|
|
599
|
+
return {
|
|
600
|
+
codeSnippets,
|
|
601
|
+
remainingInput,
|
|
602
|
+
remainingInputText: remainingInput ? JSON.stringify(remainingInput, null, 2) : ""
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
var STATUS_COUNT = 10;
|
|
606
|
+
var ANIM_STATES = {
|
|
607
|
+
"awaiting-input": "starting",
|
|
608
|
+
"input-streaming": "starting",
|
|
609
|
+
"input-complete": "processing",
|
|
610
|
+
"approval-requested": "approval",
|
|
611
|
+
"approval-responded": "processing",
|
|
612
|
+
complete: "complete",
|
|
613
|
+
error: "error"
|
|
614
|
+
};
|
|
615
|
+
function stableIndex(id) {
|
|
616
|
+
let hash = 0;
|
|
617
|
+
for (let i = 0;i < id.length; i++) {
|
|
618
|
+
hash = hash * 31 + id.charCodeAt(i) | 0;
|
|
619
|
+
}
|
|
620
|
+
return Math.abs(hash) % STATUS_COUNT;
|
|
621
|
+
}
|
|
622
|
+
function toolCallStatement(part) {
|
|
623
|
+
if (!STATEMENT_TOOLS.some((name) => name === part.name))
|
|
624
|
+
return;
|
|
625
|
+
const input = part.input;
|
|
626
|
+
if (!input || typeof input !== "object" || !("status" in input))
|
|
627
|
+
return;
|
|
628
|
+
const status = input.status;
|
|
629
|
+
return typeof status === "string" && status.trim() ? status.trim() : undefined;
|
|
630
|
+
}
|
|
631
|
+
function outputReportsFailure(part) {
|
|
632
|
+
let output = part.output;
|
|
633
|
+
if (typeof output === "string") {
|
|
634
|
+
try {
|
|
635
|
+
output = JSON.parse(output);
|
|
636
|
+
} catch {
|
|
637
|
+
return false;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return !!output && typeof output === "object" && "error" in output && output.error === true;
|
|
641
|
+
}
|
|
642
|
+
function toolCallRowCount(part) {
|
|
643
|
+
const output = part.output;
|
|
644
|
+
if (!output || typeof output !== "object" || !("rowCount" in output))
|
|
645
|
+
return;
|
|
646
|
+
return typeof output.rowCount === "number" ? output.rowCount : undefined;
|
|
647
|
+
}
|
|
648
|
+
function pooledTitleKey(part, state, declined) {
|
|
649
|
+
if (declined)
|
|
650
|
+
return "translate_declined";
|
|
651
|
+
if (state === "error")
|
|
652
|
+
return "translate_tool_error";
|
|
653
|
+
if (state === "approval")
|
|
654
|
+
return "translate_needs_approval";
|
|
655
|
+
const family = part.name === "readAttachment" ? "attachment" : "tool";
|
|
656
|
+
const variant = family === "tool" ? `_${stableIndex(part.id)}` : "";
|
|
657
|
+
return `translate_${family}_${state === "complete" ? "done" : "status"}${variant}`;
|
|
658
|
+
}
|
|
659
|
+
function toolCallAnimation(part) {
|
|
660
|
+
const declined = part.approval?.approved === false;
|
|
661
|
+
const failed = declined || part.state === "complete" && outputReportsFailure(part);
|
|
662
|
+
const state = failed ? "error" : ANIM_STATES[part.state] ?? "processing";
|
|
663
|
+
return {
|
|
664
|
+
state,
|
|
665
|
+
active: state === "starting" || state === "processing",
|
|
666
|
+
gated: part.approval !== undefined || part.state === "approval-requested",
|
|
667
|
+
titleKey: pooledTitleKey(part, state, declined),
|
|
668
|
+
statement: toolCallStatement(part),
|
|
669
|
+
rowCount: state === "complete" ? toolCallRowCount(part) : undefined
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
function approvalPrompt(part, locale) {
|
|
673
|
+
const metadata = part.metadata;
|
|
674
|
+
if (!metadata || typeof metadata !== "object" || !("cortex" in metadata))
|
|
675
|
+
return;
|
|
676
|
+
const cortex = metadata.cortex;
|
|
677
|
+
return cortex?.approval?.[locale] || undefined;
|
|
678
|
+
}
|
|
679
|
+
function approvalCard(part, locale) {
|
|
680
|
+
const approved = part.approval?.approved;
|
|
681
|
+
const { state } = toolCallAnimation(part);
|
|
682
|
+
const decision = approved === undefined ? part.state === "approval-requested" ? "pending" : "cancelled" : !approved ? "declined" : state === "error" ? "failed" : "approved";
|
|
683
|
+
return {
|
|
684
|
+
sentence: approvalPrompt(part, locale) ?? translate(locale, "translate_approval_action", { tool: wordsOf(part.name) }),
|
|
685
|
+
rows: inputRows(part.input, locale),
|
|
686
|
+
decision,
|
|
687
|
+
decisionKey: DECISION_KEYS[decision]
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
var DECISION_KEYS = {
|
|
691
|
+
pending: undefined,
|
|
692
|
+
approved: "translate_approved",
|
|
693
|
+
declined: "translate_declined",
|
|
694
|
+
failed: "translate_approved_failed",
|
|
695
|
+
cancelled: "translate_approval_cancelled"
|
|
696
|
+
};
|
|
697
|
+
function wordsOf(name) {
|
|
698
|
+
const words = name.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_\-.]+/g, " ").trim().toLowerCase();
|
|
699
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
700
|
+
}
|
|
701
|
+
function inputRows(input, locale) {
|
|
702
|
+
if (!input || typeof input !== "object" || Array.isArray(input))
|
|
703
|
+
return [];
|
|
704
|
+
return Object.entries(input).filter(([, value]) => value !== undefined).map(([key, value]) => ({
|
|
705
|
+
key,
|
|
706
|
+
label: wordsOf(key),
|
|
707
|
+
value: value === null || value === "" ? translate(locale, "translate_empty_value") : typeof value === "string" ? value : typeof value === "number" || typeof value === "boolean" ? String(value) : JSON.stringify(value)
|
|
708
|
+
}));
|
|
709
|
+
}
|
|
710
|
+
function activityLabelKeys(activity) {
|
|
711
|
+
return Array.from({ length: STATUS_COUNT }, (_, index) => `translate_${activity}_${index}`);
|
|
712
|
+
}
|
|
713
|
+
function visibleMessageParts(parts, options) {
|
|
714
|
+
return parts.filter((part, index) => {
|
|
715
|
+
if (part.type === "tool-result")
|
|
716
|
+
return false;
|
|
717
|
+
if (options.debugMode)
|
|
718
|
+
return true;
|
|
719
|
+
if (part.type === "text" && !part.content.trim())
|
|
720
|
+
return false;
|
|
721
|
+
const isLast = index === parts.length - 1;
|
|
722
|
+
return part.type !== "thinking" || options.isStreaming && isLast;
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
function messageCopyText(parts) {
|
|
726
|
+
return parts.filter((part) => part.type === "text").map((part) => part.content).join(`
|
|
727
|
+
|
|
728
|
+
`);
|
|
729
|
+
}
|
|
730
|
+
function drawsAsLine(part, hostTools) {
|
|
731
|
+
if (hostTools && part.name in hostTools)
|
|
732
|
+
return false;
|
|
733
|
+
return part.name !== REQUEST_LOCATION_TOOL || !isSettledToolState(part.state);
|
|
734
|
+
}
|
|
735
|
+
function isFrontierPart(part, options) {
|
|
736
|
+
if (part.type !== "tool-call")
|
|
737
|
+
return true;
|
|
738
|
+
return !isSettledToolState(part.state) && !part.approval && options.foldable(part);
|
|
739
|
+
}
|
|
740
|
+
function workingFrontier(messages, options) {
|
|
741
|
+
const message = streamingMessage(messages);
|
|
742
|
+
if (!message)
|
|
743
|
+
return;
|
|
744
|
+
const parts = visibleMessageParts(message.parts, { debugMode: false, isStreaming: true });
|
|
745
|
+
const last = parts.at(-1);
|
|
746
|
+
if (last && isFrontierPart(last, options))
|
|
747
|
+
return last;
|
|
748
|
+
return parts.filter((part) => part.type === "tool-call" && isFrontierPart(part, options)).at(-1);
|
|
749
|
+
}
|
|
750
|
+
// src/internal/client/src/tools/tool-call-folds.ts
|
|
751
|
+
function toolCallFolder() {
|
|
752
|
+
let previous = new Map;
|
|
753
|
+
return (messages, options) => {
|
|
754
|
+
const next = new Map;
|
|
755
|
+
for (const [messageId, fold] of computeFolds(messages, options)) {
|
|
756
|
+
const before = previous.get(messageId);
|
|
757
|
+
next.set(messageId, before && sameFold(before, fold) ? before : fold);
|
|
758
|
+
}
|
|
759
|
+
previous = next;
|
|
760
|
+
return next;
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
function computeFolds(messages, options) {
|
|
764
|
+
const folds = new Map;
|
|
765
|
+
if (options.debugMode)
|
|
766
|
+
return folds;
|
|
767
|
+
const turnOpen = options.agentWorking || unansweredToolCalls(messages).length > 0;
|
|
768
|
+
const settledMessages = turnOpen ? finishedTurns(messages) : messages;
|
|
769
|
+
let run = [];
|
|
770
|
+
function close() {
|
|
771
|
+
const runId = run[0]?.part.id;
|
|
772
|
+
if (run.length > 1 && runId && !options.opened.has(runId)) {
|
|
773
|
+
for (const [index, { messageId, part }] of run.entries()) {
|
|
774
|
+
const fold = folds.get(messageId) ?? new Map;
|
|
775
|
+
folds.set(messageId, fold);
|
|
776
|
+
const last = index === run.length - 1;
|
|
777
|
+
fold.set(part, last ? { kind: "more", count: run.length - 1, runId } : { kind: "hidden" });
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
run = [];
|
|
781
|
+
}
|
|
782
|
+
for (const message of settledMessages) {
|
|
783
|
+
if (message.role !== "assistant") {
|
|
784
|
+
close();
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
787
|
+
const parts = visibleMessageParts(message.parts, { debugMode: false, isStreaming: false });
|
|
788
|
+
for (const part of parts) {
|
|
789
|
+
if (part.type === "tool-call" && isSettledToolState(part.state) && options.foldable(part)) {
|
|
790
|
+
run.push({ messageId: message.id, part });
|
|
791
|
+
} else {
|
|
792
|
+
close();
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
close();
|
|
797
|
+
return folds;
|
|
798
|
+
}
|
|
799
|
+
function finishedTurns(messages) {
|
|
800
|
+
const lastUser = messages.map((message) => message.role).lastIndexOf("user");
|
|
801
|
+
return lastUser < 0 ? [] : messages.slice(0, lastUser);
|
|
802
|
+
}
|
|
803
|
+
function sameFold(a, b) {
|
|
804
|
+
if (a.size !== b.size)
|
|
805
|
+
return false;
|
|
806
|
+
for (const [part, mark] of a) {
|
|
807
|
+
const other = b.get(part);
|
|
808
|
+
if (!other || other.kind !== mark.kind)
|
|
809
|
+
return false;
|
|
810
|
+
if (mark.kind === "more" && other.kind === "more") {
|
|
811
|
+
if (mark.count !== other.count || mark.runId !== other.runId)
|
|
812
|
+
return false;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return true;
|
|
816
|
+
}
|
|
817
|
+
// src/internal/client/src/chat/chat-connection.ts
|
|
818
|
+
import {
|
|
819
|
+
EventType
|
|
820
|
+
} from "@tanstack/ai";
|
|
821
|
+
import { fetchServerSentEvents } from "@tanstack/ai-client";
|
|
822
|
+
function newestUnsent(messages) {
|
|
823
|
+
for (let index = messages.length - 1;index >= 0; index -= 1) {
|
|
824
|
+
const message = messages[index];
|
|
825
|
+
const answersToolCall = "parts" in message && message.parts.some((part) => part.type === "tool-result" || part.type === "tool-call" && part.state === "approval-responded");
|
|
826
|
+
if (message.role === "user" || answersToolCall)
|
|
827
|
+
return messages.slice(index, index + 1);
|
|
828
|
+
}
|
|
829
|
+
return messages.slice(-1);
|
|
830
|
+
}
|
|
831
|
+
function toolAnswerOf(part) {
|
|
832
|
+
if (part.state === "approval-responded") {
|
|
833
|
+
const approved = part.approval?.approved;
|
|
834
|
+
if (approved === undefined)
|
|
835
|
+
return null;
|
|
836
|
+
return {
|
|
837
|
+
toolCallId: part.id,
|
|
838
|
+
output: null,
|
|
839
|
+
state: approved ? "approved" : "denied"
|
|
439
840
|
};
|
|
440
841
|
}
|
|
441
842
|
if (!isSettledToolState(part.state))
|
|
@@ -673,30 +1074,6 @@ function attachmentQueueFlags(items) {
|
|
|
673
1074
|
hasReady: items.some((item) => item.status === "ready")
|
|
674
1075
|
};
|
|
675
1076
|
}
|
|
676
|
-
// src/internal/client-tools/index.ts
|
|
677
|
-
var CLIENT_TOOL_MESSAGE_TYPE = "cortex:client-tool";
|
|
678
|
-
var CLIENT_TOOL_STATUSES = ["completed", "cancelled", "failed"];
|
|
679
|
-
var REQUEST_LOCATION_TOOL = "requestLocation";
|
|
680
|
-
function parseClientToolHandshake(data, origin, embedOrigin) {
|
|
681
|
-
if (origin !== embedOrigin)
|
|
682
|
-
return null;
|
|
683
|
-
if (typeof data !== "object" || data === null)
|
|
684
|
-
return null;
|
|
685
|
-
const message = data;
|
|
686
|
-
if (message["type"] !== CLIENT_TOOL_MESSAGE_TYPE)
|
|
687
|
-
return null;
|
|
688
|
-
const status = CLIENT_TOOL_STATUSES.find((known) => known === message["status"]);
|
|
689
|
-
if (!status)
|
|
690
|
-
return null;
|
|
691
|
-
const reference = message["reference"];
|
|
692
|
-
return {
|
|
693
|
-
type: CLIENT_TOOL_MESSAGE_TYPE,
|
|
694
|
-
status,
|
|
695
|
-
...typeof reference === "string" ? { reference } : {},
|
|
696
|
-
...message["result"] !== undefined ? { result: message["result"] } : {}
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
|
|
700
1077
|
// src/internal/client/src/tools/embed.ts
|
|
701
1078
|
function embedSandbox(embedUrl, pageOrigin, trustSameOrigin) {
|
|
702
1079
|
const base = "allow-scripts allow-forms allow-popups";
|
|
@@ -1176,7 +1553,7 @@ function renderMarkdown(value, fading = []) {
|
|
|
1176
1553
|
return "";
|
|
1177
1554
|
}
|
|
1178
1555
|
let html = marked.parse(value, { async: false });
|
|
1179
|
-
html = html.replace(/<table>/g, '<div style="overflow-x:auto"><table style="width:
|
|
1556
|
+
html = html.replace(/<table>/g, '<div style="overflow-x:auto"><table style="width:max-content">').replace(/<\/table>/g, "</table></div>").replace(/<(t[hd])([\s>])/g, '<$1 style="padding:0.5rem 1rem"$2');
|
|
1180
1557
|
if (fading.length)
|
|
1181
1558
|
html = wrapFadingTail(html, fading);
|
|
1182
1559
|
return DOMPurify.sanitize(html, { FORBID_TAGS: ["img", "picture", "source"] });
|
|
@@ -1227,6 +1604,9 @@ function splitTail(text, consumed, runs) {
|
|
|
1227
1604
|
pieces.unshift(document.createTextNode(text.slice(0, end)));
|
|
1228
1605
|
return pieces;
|
|
1229
1606
|
}
|
|
1607
|
+
// src/internal/client/src/content/message-segments.ts
|
|
1608
|
+
import { marked as marked2 } from "marked";
|
|
1609
|
+
|
|
1230
1610
|
// src/internal/markdown/index.ts
|
|
1231
1611
|
function fenceTracker() {
|
|
1232
1612
|
let fence = null;
|
|
@@ -1259,10 +1639,10 @@ function segmentMessageText(text, mediaLanguages) {
|
|
|
1259
1639
|
const segments = [];
|
|
1260
1640
|
let markdown = [];
|
|
1261
1641
|
let media = null;
|
|
1262
|
-
function flushMarkdown() {
|
|
1642
|
+
function flushMarkdown(final = false) {
|
|
1263
1643
|
if (markdown.length)
|
|
1264
|
-
segments.push(
|
|
1265
|
-
`)
|
|
1644
|
+
segments.push(...splitTables(markdown.join(`
|
|
1645
|
+
`), final));
|
|
1266
1646
|
markdown = [];
|
|
1267
1647
|
}
|
|
1268
1648
|
function closeMedia(closed) {
|
|
@@ -1297,7 +1677,7 @@ function segmentMessageText(text, mediaLanguages) {
|
|
|
1297
1677
|
segments.push(opener);
|
|
1298
1678
|
}
|
|
1299
1679
|
closeMedia(false);
|
|
1300
|
-
flushMarkdown();
|
|
1680
|
+
flushMarkdown(true);
|
|
1301
1681
|
return segments;
|
|
1302
1682
|
}
|
|
1303
1683
|
function classifyLine(line, state, mediaLanguages) {
|
|
@@ -1313,6 +1693,170 @@ function classifyLine(line, state, mediaLanguages) {
|
|
|
1313
1693
|
id: (attachment[2] ?? "").toLowerCase()
|
|
1314
1694
|
} : undefined;
|
|
1315
1695
|
}
|
|
1696
|
+
function splitTables(text, final) {
|
|
1697
|
+
const tokens = marked2.lexer(text);
|
|
1698
|
+
if (!tokens.some((token) => token.type === "table"))
|
|
1699
|
+
return [{ kind: "markdown", text }];
|
|
1700
|
+
const found = [];
|
|
1701
|
+
marked2.walkTokens(tokens, (token) => {
|
|
1702
|
+
if (token.type === "def")
|
|
1703
|
+
found.push(token.raw.trim());
|
|
1704
|
+
});
|
|
1705
|
+
const definitions = found.join(`
|
|
1706
|
+
`);
|
|
1707
|
+
const withDefinitions = (piece) => definitions ? `${definitions}
|
|
1708
|
+
|
|
1709
|
+
${piece}` : piece;
|
|
1710
|
+
const pieces = [];
|
|
1711
|
+
let prose = "";
|
|
1712
|
+
function pushProse() {
|
|
1713
|
+
if (prose.trim())
|
|
1714
|
+
pieces.push({ kind: "markdown", text: withDefinitions(prose) });
|
|
1715
|
+
prose = "";
|
|
1716
|
+
}
|
|
1717
|
+
const blocks = tokens.filter((token) => token.type !== "def");
|
|
1718
|
+
for (const [index, token] of blocks.entries()) {
|
|
1719
|
+
if (token.type !== "table") {
|
|
1720
|
+
prose += token.raw;
|
|
1721
|
+
continue;
|
|
1722
|
+
}
|
|
1723
|
+
pushProse();
|
|
1724
|
+
const rest = blocks.slice(index + 1).some((next) => next.raw.trim() !== "");
|
|
1725
|
+
pieces.push({
|
|
1726
|
+
kind: "table",
|
|
1727
|
+
text: withDefinitions(token.raw.trimEnd()),
|
|
1728
|
+
closed: rest || !final
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
pushProse();
|
|
1732
|
+
return pieces;
|
|
1733
|
+
}
|
|
1734
|
+
// src/internal/client/src/content/xlsx.ts
|
|
1735
|
+
var NUMBER = /^-?(?:0|[1-9]\d*)(?:\.\d*[1-9])?$/;
|
|
1736
|
+
function isExactNumber(value) {
|
|
1737
|
+
return NUMBER.test(value) && value !== "-0" && value.replace(/[-.]/g, "").replace(/^0/, "").length <= 15;
|
|
1738
|
+
}
|
|
1739
|
+
var MAX_CELL_LENGTH = 32767;
|
|
1740
|
+
var encoder = new TextEncoder;
|
|
1741
|
+
function tableRows(table) {
|
|
1742
|
+
return Array.from(table.rows, (row) => Array.from(row.cells, cellText));
|
|
1743
|
+
}
|
|
1744
|
+
function cellText(cell) {
|
|
1745
|
+
const copy = cell.cloneNode(true);
|
|
1746
|
+
if (copy instanceof Element)
|
|
1747
|
+
copy.querySelectorAll("br").forEach((br) => br.replaceWith(`
|
|
1748
|
+
`));
|
|
1749
|
+
return (copy.textContent ?? "").trim();
|
|
1750
|
+
}
|
|
1751
|
+
function tableToXlsx(rows) {
|
|
1752
|
+
return new Blob([zip(workbookParts(rows))], {
|
|
1753
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
function escapeXml(text) {
|
|
1757
|
+
return text.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\ufffe\uffff]/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/_(x[0-9a-f]{4}_)/gi, "_x005F_$1");
|
|
1758
|
+
}
|
|
1759
|
+
function columnName(index) {
|
|
1760
|
+
let name = "";
|
|
1761
|
+
for (let n = index + 1;n > 0; n = Math.floor((n - 1) / 26)) {
|
|
1762
|
+
name = String.fromCharCode(65 + (n - 1) % 26) + name;
|
|
1763
|
+
}
|
|
1764
|
+
return name;
|
|
1765
|
+
}
|
|
1766
|
+
function sheetXml(rows) {
|
|
1767
|
+
const body = rows.map((row, r) => {
|
|
1768
|
+
const cells = row.map((value, c) => {
|
|
1769
|
+
const ref = `${columnName(c)}${r + 1}`;
|
|
1770
|
+
const style = r === 0 ? ' s="1"' : "";
|
|
1771
|
+
return r > 0 && isExactNumber(value) ? `<c r="${ref}"${style}><v>${value}</v></c>` : `<c r="${ref}"${style} t="inlineStr"><is><t xml:space="preserve">${escapeXml(value.slice(0, MAX_CELL_LENGTH))}</t></is></c>`;
|
|
1772
|
+
}).join("");
|
|
1773
|
+
return `<row r="${r + 1}">${cells}</row>`;
|
|
1774
|
+
}).join("");
|
|
1775
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetData>${body}</sheetData></worksheet>`;
|
|
1776
|
+
}
|
|
1777
|
+
function workbookParts(rows) {
|
|
1778
|
+
return [
|
|
1779
|
+
{
|
|
1780
|
+
name: "[Content_Types].xml",
|
|
1781
|
+
text: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>'
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
name: "_rels/.rels",
|
|
1785
|
+
text: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>'
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
name: "xl/workbook.xml",
|
|
1789
|
+
text: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets></workbook>'
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
name: "xl/_rels/workbook.xml.rels",
|
|
1793
|
+
text: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>'
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
name: "xl/styles.xml",
|
|
1797
|
+
text: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fonts count="2"><font><sz val="11"/><name val="Calibri"/></font><font><b/><sz val="11"/><name val="Calibri"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border/></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="2"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/><xf numFmtId="0" fontId="1" fillId="0" borderId="0" xfId="0" applyFont="1"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>'
|
|
1798
|
+
},
|
|
1799
|
+
{ name: "xl/worksheets/sheet1.xml", text: sheetXml(rows) }
|
|
1800
|
+
];
|
|
1801
|
+
}
|
|
1802
|
+
var CRC_TABLE = Array.from({ length: 256 }, (_, n) => {
|
|
1803
|
+
let c = n;
|
|
1804
|
+
for (let k = 0;k < 8; k++)
|
|
1805
|
+
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
1806
|
+
return c >>> 0;
|
|
1807
|
+
});
|
|
1808
|
+
function crc32(bytes) {
|
|
1809
|
+
let crc = 4294967295;
|
|
1810
|
+
for (const byte of bytes)
|
|
1811
|
+
crc = (CRC_TABLE[(crc ^ byte) & 255] ?? 0) ^ crc >>> 8;
|
|
1812
|
+
return (crc ^ 4294967295) >>> 0;
|
|
1813
|
+
}
|
|
1814
|
+
function zip(parts) {
|
|
1815
|
+
const chunks = [];
|
|
1816
|
+
const central = [];
|
|
1817
|
+
let offset = 0;
|
|
1818
|
+
for (const part of parts) {
|
|
1819
|
+
const name = encoder.encode(part.name);
|
|
1820
|
+
const data = encoder.encode(part.text);
|
|
1821
|
+
const crc = crc32(data);
|
|
1822
|
+
const local = new DataView(new ArrayBuffer(30));
|
|
1823
|
+
local.setUint32(0, 67324752, true);
|
|
1824
|
+
local.setUint16(4, 20, true);
|
|
1825
|
+
local.setUint16(6, 2048, true);
|
|
1826
|
+
local.setUint32(14, crc, true);
|
|
1827
|
+
local.setUint32(18, data.length, true);
|
|
1828
|
+
local.setUint32(22, data.length, true);
|
|
1829
|
+
local.setUint16(26, name.length, true);
|
|
1830
|
+
chunks.push(new Uint8Array(local.buffer), name, data);
|
|
1831
|
+
const entry = new DataView(new ArrayBuffer(46));
|
|
1832
|
+
entry.setUint32(0, 33639248, true);
|
|
1833
|
+
entry.setUint16(4, 20, true);
|
|
1834
|
+
entry.setUint16(6, 20, true);
|
|
1835
|
+
entry.setUint16(8, 2048, true);
|
|
1836
|
+
entry.setUint32(16, crc, true);
|
|
1837
|
+
entry.setUint32(20, data.length, true);
|
|
1838
|
+
entry.setUint32(24, data.length, true);
|
|
1839
|
+
entry.setUint16(28, name.length, true);
|
|
1840
|
+
entry.setUint32(42, offset, true);
|
|
1841
|
+
central.push(new Uint8Array(entry.buffer), name);
|
|
1842
|
+
offset += 30 + name.length + data.length;
|
|
1843
|
+
}
|
|
1844
|
+
const centralSize = central.reduce((size, chunk) => size + chunk.length, 0);
|
|
1845
|
+
const end = new DataView(new ArrayBuffer(22));
|
|
1846
|
+
end.setUint32(0, 101010256, true);
|
|
1847
|
+
end.setUint16(8, parts.length, true);
|
|
1848
|
+
end.setUint16(10, parts.length, true);
|
|
1849
|
+
end.setUint32(12, centralSize, true);
|
|
1850
|
+
end.setUint32(16, offset, true);
|
|
1851
|
+
const all = [...chunks, ...central, new Uint8Array(end.buffer)];
|
|
1852
|
+
const out = new Uint8Array(all.reduce((size, chunk) => size + chunk.length, 0));
|
|
1853
|
+
let at = 0;
|
|
1854
|
+
for (const chunk of all) {
|
|
1855
|
+
out.set(chunk, at);
|
|
1856
|
+
at += chunk.length;
|
|
1857
|
+
}
|
|
1858
|
+
return out;
|
|
1859
|
+
}
|
|
1316
1860
|
// src/internal/charts/chart-spec.ts
|
|
1317
1861
|
var MAX_CHART_ROWS = 200;
|
|
1318
1862
|
var MAX_CHART_SIZE = 4000;
|
|
@@ -1433,544 +1977,231 @@ var IMAGE_FUNCTION = new RegExp(String.raw`\b(url|${OTHER_IMAGE_FUNCTION_NAMES})
|
|
|
1433
1977
|
var OTHER_IMAGE_FUNCTION = new RegExp(String.raw`\b(${OTHER_IMAGE_FUNCTION_NAMES})\(`, "i");
|
|
1434
1978
|
var OTHER_IMAGE_FUNCTION_GLOBAL = new RegExp(String.raw`\b(${OTHER_IMAGE_FUNCTION_NAMES})\([^)]*\)`, "gi");
|
|
1435
1979
|
var CSS_ESCAPE = /\\([0-9a-f]{1,6})\s?|\\(.)/gi;
|
|
1436
|
-
function decodeCssEscapes(text) {
|
|
1437
|
-
return text.replace(CSS_ESCAPE, (_, hex, literal) => {
|
|
1438
|
-
if (!hex)
|
|
1439
|
-
return literal ?? "";
|
|
1440
|
-
const code = parseInt(hex, 16);
|
|
1441
|
-
const invalid = code === 0 || code >= 55296 && code <= 57343 || code > 1114111;
|
|
1442
|
-
return String.fromCodePoint(invalid ? 65533 : code);
|
|
1443
|
-
});
|
|
1444
|
-
}
|
|
1445
|
-
function urlTarget(argument) {
|
|
1446
|
-
return argument.trim().replace(/^(['"])(.*)\1$/s, "$2").trim();
|
|
1447
|
-
}
|
|
1448
|
-
function externalResourceIn(value) {
|
|
1449
|
-
if (value.includes("\\") || OTHER_IMAGE_FUNCTION.test(value))
|
|
1450
|
-
return true;
|
|
1451
|
-
for (const [, argument] of value.matchAll(URL_FUNCTION)) {
|
|
1452
|
-
if (!urlTarget(argument ?? "").startsWith("#"))
|
|
1453
|
-
return true;
|
|
1454
|
-
}
|
|
1455
|
-
return false;
|
|
1456
|
-
}
|
|
1457
|
-
function scrubStyleText(text) {
|
|
1458
|
-
return decodeCssEscapes(text).replace(OTHER_IMAGE_FUNCTION_GLOBAL, "none").replace(URL_FUNCTION, (match, argument) => urlTarget(argument).startsWith("#") ? match : "none");
|
|
1459
|
-
}
|
|
1460
|
-
// src/internal/client/src/content/media-blocks.ts
|
|
1461
|
-
var builtIn = {
|
|
1462
|
-
async mermaid(host, source, { scheme }) {
|
|
1463
|
-
const [{ default: mermaid }, { default: DOMPurify2 }] = await Promise.all([
|
|
1464
|
-
import("mermaid"),
|
|
1465
|
-
import("dompurify")
|
|
1466
|
-
]);
|
|
1467
|
-
if (IMAGE_FUNCTION.test(source) || source.includes("\\")) {
|
|
1468
|
-
throw new Error("Diagrams may not reference URLs.");
|
|
1469
|
-
}
|
|
1470
|
-
if (/%%\{/.test(source))
|
|
1471
|
-
throw new Error("Diagrams may not carry init directives.");
|
|
1472
|
-
if (/^\s*---\s*$/m.test(source))
|
|
1473
|
-
throw new Error("Diagrams may not carry frontmatter.");
|
|
1474
|
-
if (/\bimg\s*:/.test(source))
|
|
1475
|
-
throw new Error("Diagrams may not embed images.");
|
|
1476
|
-
const kind = diagramType(source);
|
|
1477
|
-
if (!DIAGRAM_TYPES.test(kind))
|
|
1478
|
-
throw new Error(`Unsupported diagram type: ${kind}`);
|
|
1479
|
-
const run = mermaidQueue.then(async () => {
|
|
1480
|
-
if (!mermaidReady) {
|
|
1481
|
-
mermaid.initialize({ startOnLoad: false, securityLevel: "strict", htmlLabels: false });
|
|
1482
|
-
mermaidReady = true;
|
|
1483
|
-
}
|
|
1484
|
-
const themed = `%%{init: {"theme": "${scheme === "dark" ? "dark" : "default"}"}}%%
|
|
1485
|
-
${source}`;
|
|
1486
|
-
await mermaid.parse(themed);
|
|
1487
|
-
return (await mermaid.render(`cortex-mermaid-${nextId()}`, themed, host)).svg;
|
|
1488
|
-
});
|
|
1489
|
-
mermaidQueue = run.catch(() => {
|
|
1490
|
-
return;
|
|
1491
|
-
});
|
|
1492
|
-
const svg = await run;
|
|
1493
|
-
const drawing = document.createElement("div");
|
|
1494
|
-
drawing.innerHTML = DOMPurify2.sanitize(svg, { USE_PROFILES: { svg: true, svgFilters: true } });
|
|
1495
|
-
stripExternalResources(drawing);
|
|
1496
|
-
host.replaceChildren(...drawing.childNodes);
|
|
1497
|
-
return () => {
|
|
1498
|
-
host.innerHTML = "";
|
|
1499
|
-
};
|
|
1500
|
-
},
|
|
1501
|
-
async "vega-lite"(host, source, { scheme }) {
|
|
1502
|
-
const spec = JSON.parse(source);
|
|
1503
|
-
const violation = chartSpecViolation(spec);
|
|
1504
|
-
if (violation)
|
|
1505
|
-
throw new Error(violation);
|
|
1506
|
-
const [{ default: embed }, vega] = await Promise.all([import("vega-embed"), import("vega")]);
|
|
1507
|
-
const refuse = () => Promise.reject(new Error("Charts may only use inline data."));
|
|
1508
|
-
const drawing = document.createElement("div");
|
|
1509
|
-
const result = await embed(drawing, spec, {
|
|
1510
|
-
actions: false,
|
|
1511
|
-
renderer: "svg",
|
|
1512
|
-
mode: "vega-lite",
|
|
1513
|
-
loader: { ...vega.loader(), load: refuse, sanitize: refuse },
|
|
1514
|
-
ast: true,
|
|
1515
|
-
...scheme === "dark" ? { theme: "dark" } : {},
|
|
1516
|
-
config: { background: "transparent" }
|
|
1517
|
-
});
|
|
1518
|
-
stripExternalResources(drawing);
|
|
1519
|
-
host.replaceChildren(drawing);
|
|
1520
|
-
return () => result.finalize();
|
|
1521
|
-
},
|
|
1522
|
-
async map(host, source) {
|
|
1523
|
-
const spec = parseMapSpec(JSON.parse(source));
|
|
1524
|
-
const { leaflet, map, dispose } = await mountMap(host, { ...spec, interactive: true });
|
|
1525
|
-
for (const marker of spec.markers) {
|
|
1526
|
-
const pin = leaflet.marker(marker.position).addTo(map);
|
|
1527
|
-
if (marker.label) {
|
|
1528
|
-
const label = document.createElement("span");
|
|
1529
|
-
label.textContent = marker.label;
|
|
1530
|
-
pin.bindTooltip(label);
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
return dispose;
|
|
1534
|
-
}
|
|
1535
|
-
};
|
|
1536
|
-
var PENDING_LABEL = {
|
|
1537
|
-
mermaid: "translate_media_pending_mermaid",
|
|
1538
|
-
"vega-lite": "translate_media_pending_vega_lite",
|
|
1539
|
-
map: "translate_media_pending_map"
|
|
1540
|
-
};
|
|
1541
|
-
function mediaPendingLabel(language) {
|
|
1542
|
-
return PENDING_LABEL[language] ?? "translate_media_pending";
|
|
1543
|
-
}
|
|
1544
|
-
function mediaLanguages(overrides) {
|
|
1545
|
-
return Object.keys({ ...builtIn, ...overrides });
|
|
1546
|
-
}
|
|
1547
|
-
function drawMediaBlock(host, options) {
|
|
1548
|
-
const { language, source, context, overrides, onError } = options;
|
|
1549
|
-
const slot = host.appendChild(document.createElement("div"));
|
|
1550
|
-
const renderer = overrides?.[language] ?? builtIn[language];
|
|
1551
|
-
let dispose;
|
|
1552
|
-
let cancelled = false;
|
|
1553
|
-
const drawn = renderer ? renderer(slot, source, context) : Promise.reject(new Error(`No renderer for ${language}.`));
|
|
1554
|
-
drawn.then((teardown) => {
|
|
1555
|
-
if (cancelled)
|
|
1556
|
-
teardown();
|
|
1557
|
-
else
|
|
1558
|
-
dispose = teardown;
|
|
1559
|
-
}, (reason) => {
|
|
1560
|
-
if (!cancelled)
|
|
1561
|
-
onError(reason instanceof Error ? reason.message : String(reason));
|
|
1562
|
-
});
|
|
1563
|
-
return () => {
|
|
1564
|
-
cancelled = true;
|
|
1565
|
-
dispose?.();
|
|
1566
|
-
slot.remove();
|
|
1567
|
-
};
|
|
1568
|
-
}
|
|
1569
|
-
var DIAGRAM_TYPES = /^(flowchart|graph|sequenceDiagram|stateDiagram(-v2)?|erDiagram|gantt|pie|classDiagram|journey|timeline|mindmap)$/;
|
|
1570
|
-
function diagramType(source) {
|
|
1571
|
-
const line = source.split(`
|
|
1572
|
-
`).find((candidate) => /\S/.test(candidate) && !/^\s*%%/.test(candidate));
|
|
1573
|
-
return /^\s*(\S+)/.exec(line ?? "")?.[1] ?? "";
|
|
1574
|
-
}
|
|
1575
|
-
var mermaidQueue = Promise.resolve();
|
|
1576
|
-
var mermaidReady = false;
|
|
1577
|
-
var counter = 0;
|
|
1578
|
-
function nextId() {
|
|
1579
|
-
counter += 1;
|
|
1580
|
-
return counter;
|
|
1581
|
-
}
|
|
1582
|
-
var RESOURCE_LINK_TAGS = new Set(["image", "use", "feImage"]);
|
|
1583
|
-
function stripExternalResources(root) {
|
|
1584
|
-
for (const element of [root, ...root.querySelectorAll("*")]) {
|
|
1585
|
-
for (const attribute of [...element.attributes]) {
|
|
1586
|
-
const loadsTarget = (attribute.name === "href" || attribute.name === "xlink:href") && RESOURCE_LINK_TAGS.has(element.tagName) && !attribute.value.trim().startsWith("#");
|
|
1587
|
-
if (loadsTarget || externalResourceIn(attribute.value)) {
|
|
1588
|
-
element.removeAttribute(attribute.name);
|
|
1589
|
-
}
|
|
1590
|
-
}
|
|
1591
|
-
if (element.tagName === "style" && element.textContent) {
|
|
1592
|
-
element.textContent = scrubStyleText(element.textContent);
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
function parseMapSpec(value) {
|
|
1597
|
-
if (!value || typeof value !== "object")
|
|
1598
|
-
throw new Error("A map needs a JSON object.");
|
|
1599
|
-
const spec = value;
|
|
1600
|
-
const zoom = spec["zoom"] ?? 10;
|
|
1601
|
-
if (typeof zoom !== "number" || zoom < 0 || zoom > 22)
|
|
1602
|
-
throw new Error("zoom must be 0 to 22.");
|
|
1603
|
-
const markers = spec["markers"] ?? [];
|
|
1604
|
-
if (!Array.isArray(markers))
|
|
1605
|
-
throw new Error("markers must be a list.");
|
|
1606
|
-
return {
|
|
1607
|
-
center: latLng(spec["center"], "center"),
|
|
1608
|
-
zoom,
|
|
1609
|
-
markers: markers.map((marker, index) => {
|
|
1610
|
-
const entry = marker ?? {};
|
|
1611
|
-
const label = entry["label"];
|
|
1612
|
-
return {
|
|
1613
|
-
position: latLng(entry["position"], `markers[${index}].position`),
|
|
1614
|
-
label: typeof label === "string" ? label : undefined
|
|
1615
|
-
};
|
|
1616
|
-
})
|
|
1617
|
-
};
|
|
1618
|
-
}
|
|
1619
|
-
function latLng(value, field) {
|
|
1620
|
-
const pair = Array.isArray(value) ? value : [];
|
|
1621
|
-
const [lat, lng] = pair;
|
|
1622
|
-
if (typeof lat !== "number" || typeof lng !== "number" || Math.abs(lat) > 90 || Math.abs(lng) > 180) {
|
|
1623
|
-
throw new Error(`${field} must be [latitude, longitude].`);
|
|
1624
|
-
}
|
|
1625
|
-
return { lat, lng };
|
|
1626
|
-
}
|
|
1627
|
-
// src/internal/client/src/color-scheme.ts
|
|
1628
|
-
function watchColorScheme(theme, onChange) {
|
|
1629
|
-
if (theme !== "system") {
|
|
1630
|
-
onChange(theme ?? "light");
|
|
1631
|
-
return () => {};
|
|
1632
|
-
}
|
|
1633
|
-
const query = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1634
|
-
const report = () => onChange(query.matches ? "dark" : "light");
|
|
1635
|
-
report();
|
|
1636
|
-
query.addEventListener("change", report);
|
|
1637
|
-
return () => query.removeEventListener("change", report);
|
|
1980
|
+
function decodeCssEscapes(text) {
|
|
1981
|
+
return text.replace(CSS_ESCAPE, (_, hex, literal) => {
|
|
1982
|
+
if (!hex)
|
|
1983
|
+
return literal ?? "";
|
|
1984
|
+
const code = parseInt(hex, 16);
|
|
1985
|
+
const invalid = code === 0 || code >= 55296 && code <= 57343 || code > 1114111;
|
|
1986
|
+
return String.fromCodePoint(invalid ? 65533 : code);
|
|
1987
|
+
});
|
|
1638
1988
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
import javascript from "highlight.js/lib/languages/javascript";
|
|
1642
|
-
import json from "highlight.js/lib/languages/json";
|
|
1643
|
-
import sql from "highlight.js/lib/languages/sql";
|
|
1644
|
-
var registered = false;
|
|
1645
|
-
function ensureLanguages() {
|
|
1646
|
-
if (registered)
|
|
1647
|
-
return;
|
|
1648
|
-
registered = true;
|
|
1649
|
-
hljs.registerLanguage("javascript", javascript);
|
|
1650
|
-
hljs.registerLanguage("json", json);
|
|
1651
|
-
hljs.registerLanguage("cypher", sql);
|
|
1989
|
+
function urlTarget(argument) {
|
|
1990
|
+
return argument.trim().replace(/^(['"])(.*)\1$/s, "$2").trim();
|
|
1652
1991
|
}
|
|
1653
|
-
function
|
|
1654
|
-
if (
|
|
1655
|
-
return
|
|
1656
|
-
|
|
1657
|
-
|
|
1992
|
+
function externalResourceIn(value) {
|
|
1993
|
+
if (value.includes("\\") || OTHER_IMAGE_FUNCTION.test(value))
|
|
1994
|
+
return true;
|
|
1995
|
+
for (const [, argument] of value.matchAll(URL_FUNCTION)) {
|
|
1996
|
+
if (!urlTarget(argument ?? "").startsWith("#"))
|
|
1997
|
+
return true;
|
|
1998
|
+
}
|
|
1999
|
+
return false;
|
|
1658
2000
|
}
|
|
1659
|
-
function
|
|
1660
|
-
return
|
|
2001
|
+
function scrubStyleText(text) {
|
|
2002
|
+
return decodeCssEscapes(text).replace(OTHER_IMAGE_FUNCTION_GLOBAL, "none").replace(URL_FUNCTION, (match, argument) => urlTarget(argument).startsWith("#") ? match : "none");
|
|
1661
2003
|
}
|
|
1662
|
-
// src/internal/client/src/
|
|
1663
|
-
var
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
translate_reasoning_6: "جارٍ التمعن في الأمر...",
|
|
1738
|
-
translate_reasoning_7: "جارٍ إيجاد أفضل طريقة...",
|
|
1739
|
-
translate_reasoning_8: "جارٍ تنظيم أفكاري...",
|
|
1740
|
-
translate_reasoning_9: "أوشك على الانتهاء...",
|
|
1741
|
-
translate_running: "قيد التنفيذ",
|
|
1742
|
-
translate_aborted: "تم الإلغاء",
|
|
1743
|
-
translate_input: "المدخلات",
|
|
1744
|
-
translate_output: "المخرجات",
|
|
1745
|
-
translate_calling: "جارٍ الاستدعاء",
|
|
1746
|
-
translate_input_ready: "المدخلات جاهزة",
|
|
1747
|
-
translate_needs_approval: "بحاجة إلى موافقة",
|
|
1748
|
-
translate_approved: "تمت الموافقة",
|
|
1749
|
-
translate_responded: "تم الرد",
|
|
1750
|
-
translate_declined: "تم الرفض",
|
|
1751
|
-
translate_approve: "موافقة",
|
|
1752
|
-
translate_deny: "رفض",
|
|
1753
|
-
translate_approval_prompt: "يريد المساعد تنفيذ إجراء. هل تسمح بذلك؟",
|
|
1754
|
-
translate_error: "خطأ",
|
|
1755
|
-
translate_approval_requested: "طلب موافقة",
|
|
1756
|
-
translate_approval_response: "رد الموافقة",
|
|
1757
|
-
translate_waiting_for_approval: "في انتظار الموافقة لتنفيذ هذه الأداة.",
|
|
1758
|
-
translate_tool_approved: "تمت الموافقة.",
|
|
1759
|
-
translate_tool_response_received: "تم استلام الرد.",
|
|
1760
|
-
translate_tokens: "رمز",
|
|
1761
|
-
translate_fresh: "جديد",
|
|
1762
|
-
translate_cache_read: "قراءة من الذاكرة",
|
|
1763
|
-
translate_cache_write: "كتابة في الذاكرة",
|
|
1764
|
-
translate_n_percent_cached: "{{percent}}٪ مخزّن مؤقتًا",
|
|
1765
|
-
translate_text: "نص",
|
|
1766
|
-
translate_reasoning: "الاستنتاج",
|
|
1767
|
-
translate_read: "قراءة",
|
|
1768
|
-
translate_write: "كتابة",
|
|
1769
|
-
translate_total: "الإجمالي",
|
|
1770
|
-
translate_request: "الطلب",
|
|
1771
|
-
translate_response: "الرد",
|
|
1772
|
-
translate_step_n: "الخطوة {{number}}",
|
|
1773
|
-
translate_inspect_llm_requests: "فحص طلبات النموذج",
|
|
1774
|
-
translate_loading: "جارٍ التحميل…",
|
|
1775
|
-
translate_no_llm_requests: "لا توجد طلبات نموذج مسجّلة لهذه الرسالة.",
|
|
1776
|
-
translate_unhandled_type: "نوع غير مدعوم:",
|
|
1777
|
-
translate_client_tool_title: "أكمل هذه الخطوة للمتابعة",
|
|
1778
|
-
translate_client_tool_loading: "جارٍ تجهيز خطوة آمنة...",
|
|
1779
|
-
translate_client_tool_failed: "تعذّر تحميل هذه الخطوة",
|
|
1780
|
-
translate_client_tool_retry: "حاول مرة أخرى",
|
|
1781
|
-
translate_client_tool_cancel: "إلغاء",
|
|
1782
|
-
translate_location_hint: "انقر على الخريطة لتثبيت الدبوس",
|
|
1783
|
-
translate_location_locate: "استخدم موقعي",
|
|
1784
|
-
translate_location_locating: "جارٍ تحديد موقعك",
|
|
1785
|
-
translate_location_locate_failed: "موقعك غير متاح",
|
|
1786
|
-
translate_location_map_failed: "تعذّر تحميل الخريطة",
|
|
1787
|
-
translate_location_send_failed: "تعذّر الإرسال، حاول مرة أخرى",
|
|
1788
|
-
translate_location_skip: "ليس الآن",
|
|
1789
|
-
translate_location_send: "إرسال",
|
|
1790
|
-
translate_location_shared: "تمت مشاركة الموقع",
|
|
1791
|
-
translate_location_not_shared: "لم تتم مشاركة الموقع",
|
|
1792
|
-
translate_trigger_fired: "تم التشغيل بواسطة",
|
|
1793
|
-
translate_trigger_payload: "الحمولة",
|
|
1794
|
-
translate_messages_disabled: "يعمل هذا الوكيل من مشغّلاته فقط.",
|
|
1795
|
-
translate_streaming: "جارٍ البث",
|
|
1796
|
-
translate_done: "تم",
|
|
1797
|
-
translate_no_reasoning: "لا يوجد تفكير مسجّل.",
|
|
1798
|
-
translate_copy: "نسخ إلى الحافظة",
|
|
1799
|
-
translate_copied: "تم النسخ",
|
|
1800
|
-
translate_media_pending_mermaid: "جارٍ رسم المخطط",
|
|
1801
|
-
translate_media_pending_vega_lite: "جارٍ رسم الرسم البياني",
|
|
1802
|
-
translate_media_pending_map: "جارٍ رسم الخريطة",
|
|
1803
|
-
translate_media_cut_off: "انقطع هذا المقطع قبل اكتماله.",
|
|
1804
|
-
translate_media_failed: "تعذر عرض هذا المقطع.",
|
|
1805
|
-
translate_media_source: "المصدر",
|
|
1806
|
-
translate_media_pending: "جارٍ الرسم",
|
|
1807
|
-
translate_image_unavailable: "الصورة غير متاحة",
|
|
1808
|
-
translate_image_unavailable_alt: "الصورة غير متاحة: {{alt}}",
|
|
1809
|
-
translate_send: "إرسال"
|
|
2004
|
+
// src/internal/client/src/content/media-blocks.ts
|
|
2005
|
+
var builtIn = {
|
|
2006
|
+
async mermaid(host, source, { scheme }) {
|
|
2007
|
+
const [{ default: mermaid }, { default: DOMPurify2 }] = await Promise.all([
|
|
2008
|
+
import("mermaid"),
|
|
2009
|
+
import("dompurify")
|
|
2010
|
+
]);
|
|
2011
|
+
if (IMAGE_FUNCTION.test(source) || source.includes("\\")) {
|
|
2012
|
+
throw new Error("Diagrams may not reference URLs.");
|
|
2013
|
+
}
|
|
2014
|
+
if (/%%\{/.test(source))
|
|
2015
|
+
throw new Error("Diagrams may not carry init directives.");
|
|
2016
|
+
if (/^\s*---\s*$/m.test(source))
|
|
2017
|
+
throw new Error("Diagrams may not carry frontmatter.");
|
|
2018
|
+
if (/\bimg\s*:/.test(source))
|
|
2019
|
+
throw new Error("Diagrams may not embed images.");
|
|
2020
|
+
const kind = diagramType(source);
|
|
2021
|
+
if (!DIAGRAM_TYPES.test(kind))
|
|
2022
|
+
throw new Error(`Unsupported diagram type: ${kind}`);
|
|
2023
|
+
const run = mermaidQueue.then(async () => {
|
|
2024
|
+
if (!mermaidReady) {
|
|
2025
|
+
mermaid.initialize({ startOnLoad: false, securityLevel: "strict", htmlLabels: false });
|
|
2026
|
+
mermaidReady = true;
|
|
2027
|
+
}
|
|
2028
|
+
const themed = `%%{init: {"theme": "${scheme === "dark" ? "dark" : "default"}"}}%%
|
|
2029
|
+
${source}`;
|
|
2030
|
+
await mermaid.parse(themed);
|
|
2031
|
+
return (await mermaid.render(`cortex-mermaid-${nextId()}`, themed, host)).svg;
|
|
2032
|
+
});
|
|
2033
|
+
mermaidQueue = run.catch(() => {
|
|
2034
|
+
return;
|
|
2035
|
+
});
|
|
2036
|
+
const svg = await run;
|
|
2037
|
+
const drawing = document.createElement("div");
|
|
2038
|
+
drawing.innerHTML = DOMPurify2.sanitize(svg, { USE_PROFILES: { svg: true, svgFilters: true } });
|
|
2039
|
+
stripExternalResources(drawing);
|
|
2040
|
+
host.replaceChildren(...drawing.childNodes);
|
|
2041
|
+
return () => {
|
|
2042
|
+
host.innerHTML = "";
|
|
2043
|
+
};
|
|
2044
|
+
},
|
|
2045
|
+
async "vega-lite"(host, source, { scheme }) {
|
|
2046
|
+
const spec = JSON.parse(source);
|
|
2047
|
+
const violation = chartSpecViolation(spec);
|
|
2048
|
+
if (violation)
|
|
2049
|
+
throw new Error(violation);
|
|
2050
|
+
const [{ default: embed }, vega] = await Promise.all([import("vega-embed"), import("vega")]);
|
|
2051
|
+
const refuse = () => Promise.reject(new Error("Charts may only use inline data."));
|
|
2052
|
+
const drawing = document.createElement("div");
|
|
2053
|
+
const result = await embed(drawing, spec, {
|
|
2054
|
+
actions: false,
|
|
2055
|
+
renderer: "svg",
|
|
2056
|
+
mode: "vega-lite",
|
|
2057
|
+
loader: { ...vega.loader(), load: refuse, sanitize: refuse },
|
|
2058
|
+
ast: true,
|
|
2059
|
+
...scheme === "dark" ? { theme: "dark" } : {},
|
|
2060
|
+
config: { background: "transparent" }
|
|
2061
|
+
});
|
|
2062
|
+
stripExternalResources(drawing);
|
|
2063
|
+
host.replaceChildren(drawing);
|
|
2064
|
+
return () => result.finalize();
|
|
2065
|
+
},
|
|
2066
|
+
async map(host, source) {
|
|
2067
|
+
const spec = parseMapSpec(JSON.parse(source));
|
|
2068
|
+
const { leaflet, map, dispose } = await mountMap(host, { ...spec, interactive: true });
|
|
2069
|
+
for (const marker of spec.markers) {
|
|
2070
|
+
const pin = leaflet.marker(marker.position).addTo(map);
|
|
2071
|
+
if (marker.label) {
|
|
2072
|
+
const label = document.createElement("span");
|
|
2073
|
+
label.textContent = marker.label;
|
|
2074
|
+
pin.bindTooltip(label);
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
return dispose;
|
|
2078
|
+
}
|
|
1810
2079
|
};
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
translate_back: "Back",
|
|
1816
|
-
translate_greeting: "What can I help you with today?",
|
|
1817
|
-
translate_n_conversations: "{{count}} conversations",
|
|
1818
|
-
translate_one_conversation: "1 conversation",
|
|
1819
|
-
translate_no_threads_yet: "No threads yet",
|
|
1820
|
-
translate_start_a_new_conversation: "Start a new conversation",
|
|
1821
|
-
translate_untitled: "Untitled",
|
|
1822
|
-
translate_new_chat: "New Chat",
|
|
1823
|
-
translate_normal: "Normal",
|
|
1824
|
-
translate_debug: "Debug",
|
|
1825
|
-
translate_type_a_message: "Type a message...",
|
|
1826
|
-
translate_thinking: "Thinking things through...",
|
|
1827
|
-
translate_completed: "Completed",
|
|
1828
|
-
translate_attach_files: "Attach files",
|
|
1829
|
-
translate_drop_files_here: "Drop your files here...",
|
|
1830
|
-
translate_remove_attachment: "Remove attachment",
|
|
1831
|
-
translate_attachment_rejected: "This file cannot be attached",
|
|
1832
|
-
translate_attachment_caption: "Please take a look at the attached files.",
|
|
1833
|
-
translate_download: "Download",
|
|
1834
|
-
translate_tool_status_0: "Fetching data...",
|
|
1835
|
-
translate_tool_status_1: "Analyzing information...",
|
|
1836
|
-
translate_tool_status_2: "Processing request...",
|
|
1837
|
-
translate_tool_status_3: "Gathering results...",
|
|
1838
|
-
translate_tool_status_4: "Preparing response...",
|
|
1839
|
-
translate_tool_status_5: "Looking things up...",
|
|
1840
|
-
translate_tool_status_6: "Checking records...",
|
|
1841
|
-
translate_tool_status_7: "Reviewing details...",
|
|
1842
|
-
translate_tool_status_8: "Running calculations...",
|
|
1843
|
-
translate_tool_status_9: "Pulling information...",
|
|
1844
|
-
translate_tool_done_0: "Data fetched successfully",
|
|
1845
|
-
translate_tool_done_1: "Analysis completed successfully",
|
|
1846
|
-
translate_tool_done_2: "Request processed successfully",
|
|
1847
|
-
translate_tool_done_3: "Results gathered successfully",
|
|
1848
|
-
translate_tool_done_4: "Response prepared successfully",
|
|
1849
|
-
translate_tool_done_5: "Lookup completed successfully",
|
|
1850
|
-
translate_tool_done_6: "Records checked successfully",
|
|
1851
|
-
translate_tool_done_7: "Review completed successfully",
|
|
1852
|
-
translate_tool_done_8: "Calculations completed successfully",
|
|
1853
|
-
translate_tool_done_9: "Information retrieved successfully",
|
|
1854
|
-
translate_rows_read: "{{count}} rows",
|
|
1855
|
-
translate_one_more_step: "and 1 more step",
|
|
1856
|
-
translate_n_more_steps: "and {{count}} more steps",
|
|
1857
|
-
translate_tool_error: "Something went wrong",
|
|
1858
|
-
translate_attachment_status: "Reading the attached file...",
|
|
1859
|
-
translate_attachment_done: "Finished reading the file",
|
|
1860
|
-
translate_graph_0: "Exploring connections...",
|
|
1861
|
-
translate_graph_1: "Mapping out the links...",
|
|
1862
|
-
translate_graph_2: "Discovering relationships...",
|
|
1863
|
-
translate_graph_3: "Tracing the connections...",
|
|
1864
|
-
translate_graph_4: "Navigating the knowledge...",
|
|
1865
|
-
translate_graph_5: "Uncovering insights...",
|
|
1866
|
-
translate_graph_6: "Connecting the dots...",
|
|
1867
|
-
translate_graph_7: "Following the trail...",
|
|
1868
|
-
translate_graph_8: "Piecing things together...",
|
|
1869
|
-
translate_graph_9: "Building the picture...",
|
|
1870
|
-
translate_code_0: "Running the numbers...",
|
|
1871
|
-
translate_code_1: "Working through the data...",
|
|
1872
|
-
translate_code_2: "Processing your request...",
|
|
1873
|
-
translate_code_3: "Crunching the figures...",
|
|
1874
|
-
translate_code_4: "Putting it all together...",
|
|
1875
|
-
translate_code_5: "Analyzing the results...",
|
|
1876
|
-
translate_code_6: "Working behind the scenes...",
|
|
1877
|
-
translate_code_7: "Sorting through the details...",
|
|
1878
|
-
translate_code_8: "Preparing your answer...",
|
|
1879
|
-
translate_code_9: "Almost ready...",
|
|
1880
|
-
translate_reasoning_0: "Thinking it through...",
|
|
1881
|
-
translate_reasoning_1: "Considering the options...",
|
|
1882
|
-
translate_reasoning_2: "Weighing the possibilities...",
|
|
1883
|
-
translate_reasoning_3: "Reflecting on this...",
|
|
1884
|
-
translate_reasoning_4: "Working it out...",
|
|
1885
|
-
translate_reasoning_5: "Putting thoughts together...",
|
|
1886
|
-
translate_reasoning_6: "Mulling it over...",
|
|
1887
|
-
translate_reasoning_7: "Finding the best approach...",
|
|
1888
|
-
translate_reasoning_8: "Organizing my thoughts...",
|
|
1889
|
-
translate_reasoning_9: "Almost there...",
|
|
1890
|
-
translate_running: "Running",
|
|
1891
|
-
translate_aborted: "Aborted",
|
|
1892
|
-
translate_input: "Input",
|
|
1893
|
-
translate_output: "Output",
|
|
1894
|
-
translate_calling: "Calling",
|
|
1895
|
-
translate_input_ready: "Input ready",
|
|
1896
|
-
translate_needs_approval: "Needs approval",
|
|
1897
|
-
translate_approved: "Approved",
|
|
1898
|
-
translate_responded: "Responded",
|
|
1899
|
-
translate_declined: "Declined",
|
|
1900
|
-
translate_approve: "Approve",
|
|
1901
|
-
translate_deny: "Deny",
|
|
1902
|
-
translate_approval_prompt: "The assistant wants to take an action. Allow it?",
|
|
1903
|
-
translate_error: "Error",
|
|
1904
|
-
translate_approval_requested: "Approval requested",
|
|
1905
|
-
translate_approval_response: "Approval response",
|
|
1906
|
-
translate_waiting_for_approval: "Waiting for approval to execute this tool.",
|
|
1907
|
-
translate_tool_approved: "Approved.",
|
|
1908
|
-
translate_tool_response_received: "Response received.",
|
|
1909
|
-
translate_tokens: "tokens",
|
|
1910
|
-
translate_fresh: "Fresh",
|
|
1911
|
-
translate_cache_read: "Cache read",
|
|
1912
|
-
translate_cache_write: "Cache write",
|
|
1913
|
-
translate_n_percent_cached: "{{percent}}% cached",
|
|
1914
|
-
translate_text: "Text",
|
|
1915
|
-
translate_reasoning: "Reasoning",
|
|
1916
|
-
translate_read: "Read",
|
|
1917
|
-
translate_write: "Write",
|
|
1918
|
-
translate_total: "Total",
|
|
1919
|
-
translate_request: "Request",
|
|
1920
|
-
translate_response: "Response",
|
|
1921
|
-
translate_step_n: "Step {{number}}",
|
|
1922
|
-
translate_inspect_llm_requests: "Inspect LLM requests",
|
|
1923
|
-
translate_loading: "loading…",
|
|
1924
|
-
translate_no_llm_requests: "No LLM requests recorded for this message.",
|
|
1925
|
-
translate_unhandled_type: "Unhandled type:",
|
|
1926
|
-
translate_client_tool_title: "Complete this step to continue",
|
|
1927
|
-
translate_client_tool_loading: "Preparing a secure step...",
|
|
1928
|
-
translate_client_tool_failed: "This step could not be loaded",
|
|
1929
|
-
translate_client_tool_retry: "Try again",
|
|
1930
|
-
translate_client_tool_cancel: "Cancel",
|
|
1931
|
-
translate_location_hint: "Tap the map to drop a pin",
|
|
1932
|
-
translate_location_locate: "Use my location",
|
|
1933
|
-
translate_location_locating: "Finding your location",
|
|
1934
|
-
translate_location_locate_failed: "Your location is not available",
|
|
1935
|
-
translate_location_map_failed: "The map could not be loaded",
|
|
1936
|
-
translate_location_send_failed: "Could not send, try again",
|
|
1937
|
-
translate_location_skip: "Not now",
|
|
1938
|
-
translate_location_send: "Send",
|
|
1939
|
-
translate_location_shared: "Location shared",
|
|
1940
|
-
translate_location_not_shared: "Location not shared",
|
|
1941
|
-
translate_trigger_fired: "Triggered by",
|
|
1942
|
-
translate_trigger_payload: "Payload",
|
|
1943
|
-
translate_messages_disabled: "This agent only runs from its triggers.",
|
|
1944
|
-
translate_streaming: "Streaming",
|
|
1945
|
-
translate_done: "Done",
|
|
1946
|
-
translate_no_reasoning: "No reasoning provided.",
|
|
1947
|
-
translate_copy: "Copy to clipboard",
|
|
1948
|
-
translate_copied: "Copied",
|
|
1949
|
-
translate_media_pending_mermaid: "Drawing diagram",
|
|
1950
|
-
translate_media_pending_vega_lite: "Drawing chart",
|
|
1951
|
-
translate_media_pending_map: "Drawing map",
|
|
1952
|
-
translate_media_cut_off: "This block was cut off before it finished.",
|
|
1953
|
-
translate_media_failed: "Could not render this block.",
|
|
1954
|
-
translate_media_source: "Source",
|
|
1955
|
-
translate_media_pending: "Drawing",
|
|
1956
|
-
translate_image_unavailable: "Image unavailable",
|
|
1957
|
-
translate_image_unavailable_alt: "Image unavailable: {{alt}}",
|
|
1958
|
-
translate_send: "Send"
|
|
2080
|
+
var PENDING_LABEL = {
|
|
2081
|
+
mermaid: "translate_media_pending_mermaid",
|
|
2082
|
+
"vega-lite": "translate_media_pending_vega_lite",
|
|
2083
|
+
map: "translate_media_pending_map"
|
|
1959
2084
|
};
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
function
|
|
1964
|
-
return
|
|
2085
|
+
function mediaPendingLabel(language) {
|
|
2086
|
+
return PENDING_LABEL[language] ?? "translate_media_pending";
|
|
2087
|
+
}
|
|
2088
|
+
function mediaLanguages(overrides) {
|
|
2089
|
+
return Object.keys({ ...builtIn, ...overrides });
|
|
2090
|
+
}
|
|
2091
|
+
function drawMediaBlock(host, options) {
|
|
2092
|
+
const { language, source, context, overrides, onError } = options;
|
|
2093
|
+
const slot = host.appendChild(document.createElement("div"));
|
|
2094
|
+
const renderer = overrides?.[language] ?? builtIn[language];
|
|
2095
|
+
let dispose;
|
|
2096
|
+
let cancelled = false;
|
|
2097
|
+
const drawn = renderer ? renderer(slot, source, context) : Promise.reject(new Error(`No renderer for ${language}.`));
|
|
2098
|
+
drawn.then((teardown) => {
|
|
2099
|
+
if (cancelled)
|
|
2100
|
+
teardown();
|
|
2101
|
+
else
|
|
2102
|
+
dispose = teardown;
|
|
2103
|
+
}, (reason) => {
|
|
2104
|
+
if (!cancelled)
|
|
2105
|
+
onError(reason instanceof Error ? reason.message : String(reason));
|
|
2106
|
+
});
|
|
2107
|
+
return () => {
|
|
2108
|
+
cancelled = true;
|
|
2109
|
+
dispose?.();
|
|
2110
|
+
slot.remove();
|
|
2111
|
+
};
|
|
2112
|
+
}
|
|
2113
|
+
var DIAGRAM_TYPES = /^(flowchart|graph|sequenceDiagram|stateDiagram(-v2)?|erDiagram|gantt|pie|classDiagram|journey|timeline|mindmap)$/;
|
|
2114
|
+
function diagramType(source) {
|
|
2115
|
+
const line = source.split(`
|
|
2116
|
+
`).find((candidate) => /\S/.test(candidate) && !/^\s*%%/.test(candidate));
|
|
2117
|
+
return /^\s*(\S+)/.exec(line ?? "")?.[1] ?? "";
|
|
2118
|
+
}
|
|
2119
|
+
var mermaidQueue = Promise.resolve();
|
|
2120
|
+
var mermaidReady = false;
|
|
2121
|
+
var counter = 0;
|
|
2122
|
+
function nextId() {
|
|
2123
|
+
counter += 1;
|
|
2124
|
+
return counter;
|
|
2125
|
+
}
|
|
2126
|
+
var RESOURCE_LINK_TAGS = new Set(["image", "use", "feImage"]);
|
|
2127
|
+
function stripExternalResources(root) {
|
|
2128
|
+
for (const element of [root, ...root.querySelectorAll("*")]) {
|
|
2129
|
+
for (const attribute of [...element.attributes]) {
|
|
2130
|
+
const loadsTarget = (attribute.name === "href" || attribute.name === "xlink:href") && RESOURCE_LINK_TAGS.has(element.tagName) && !attribute.value.trim().startsWith("#");
|
|
2131
|
+
if (loadsTarget || externalResourceIn(attribute.value)) {
|
|
2132
|
+
element.removeAttribute(attribute.name);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
if (element.tagName === "style" && element.textContent) {
|
|
2136
|
+
element.textContent = scrubStyleText(element.textContent);
|
|
2137
|
+
}
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
function parseMapSpec(value) {
|
|
2141
|
+
if (!value || typeof value !== "object")
|
|
2142
|
+
throw new Error("A map needs a JSON object.");
|
|
2143
|
+
const spec = value;
|
|
2144
|
+
const zoom = spec["zoom"] ?? 10;
|
|
2145
|
+
if (typeof zoom !== "number" || zoom < 0 || zoom > 22)
|
|
2146
|
+
throw new Error("zoom must be 0 to 22.");
|
|
2147
|
+
const markers = spec["markers"] ?? [];
|
|
2148
|
+
if (!Array.isArray(markers))
|
|
2149
|
+
throw new Error("markers must be a list.");
|
|
2150
|
+
return {
|
|
2151
|
+
center: latLng(spec["center"], "center"),
|
|
2152
|
+
zoom,
|
|
2153
|
+
markers: markers.map((marker, index) => {
|
|
2154
|
+
const entry = marker ?? {};
|
|
2155
|
+
const label = entry["label"];
|
|
2156
|
+
return {
|
|
2157
|
+
position: latLng(entry["position"], `markers[${index}].position`),
|
|
2158
|
+
label: typeof label === "string" ? label : undefined
|
|
2159
|
+
};
|
|
2160
|
+
})
|
|
2161
|
+
};
|
|
2162
|
+
}
|
|
2163
|
+
function latLng(value, field) {
|
|
2164
|
+
const pair = Array.isArray(value) ? value : [];
|
|
2165
|
+
const [lat, lng] = pair;
|
|
2166
|
+
if (typeof lat !== "number" || typeof lng !== "number" || Math.abs(lat) > 90 || Math.abs(lng) > 180) {
|
|
2167
|
+
throw new Error(`${field} must be [latitude, longitude].`);
|
|
2168
|
+
}
|
|
2169
|
+
return { lat, lng };
|
|
2170
|
+
}
|
|
2171
|
+
// src/internal/client/src/color-scheme.ts
|
|
2172
|
+
function watchColorScheme(theme, onChange) {
|
|
2173
|
+
if (theme !== "system") {
|
|
2174
|
+
onChange(theme ?? "light");
|
|
2175
|
+
return () => {};
|
|
2176
|
+
}
|
|
2177
|
+
const query = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2178
|
+
const report = () => onChange(query.matches ? "dark" : "light");
|
|
2179
|
+
report();
|
|
2180
|
+
query.addEventListener("change", report);
|
|
2181
|
+
return () => query.removeEventListener("change", report);
|
|
2182
|
+
}
|
|
2183
|
+
// src/internal/client/src/content/highlight.ts
|
|
2184
|
+
import hljs from "highlight.js/lib/core";
|
|
2185
|
+
import javascript from "highlight.js/lib/languages/javascript";
|
|
2186
|
+
import json from "highlight.js/lib/languages/json";
|
|
2187
|
+
import sql from "highlight.js/lib/languages/sql";
|
|
2188
|
+
var registered = false;
|
|
2189
|
+
function ensureLanguages() {
|
|
2190
|
+
if (registered)
|
|
2191
|
+
return;
|
|
2192
|
+
registered = true;
|
|
2193
|
+
hljs.registerLanguage("javascript", javascript);
|
|
2194
|
+
hljs.registerLanguage("json", json);
|
|
2195
|
+
hljs.registerLanguage("cypher", sql);
|
|
1965
2196
|
}
|
|
1966
|
-
function
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
return
|
|
2197
|
+
function highlightCode(code, lang) {
|
|
2198
|
+
if (!code)
|
|
2199
|
+
return "";
|
|
2200
|
+
ensureLanguages();
|
|
2201
|
+
return hljs.getLanguage(lang) ? hljs.highlight(code, { language: lang }).value : escapeHtml(code);
|
|
1971
2202
|
}
|
|
1972
|
-
function
|
|
1973
|
-
return
|
|
2203
|
+
function escapeHtml(str) {
|
|
2204
|
+
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1974
2205
|
}
|
|
1975
2206
|
// src/internal/client/src/format/deep-parse-json.ts
|
|
1976
2207
|
function deepParseJson(value) {
|
|
@@ -2100,8 +2331,10 @@ function saveBlob(blob, name) {
|
|
|
2100
2331
|
const link = document.createElement("a");
|
|
2101
2332
|
link.href = url;
|
|
2102
2333
|
link.download = name;
|
|
2334
|
+
document.body.append(link);
|
|
2103
2335
|
link.click();
|
|
2104
|
-
|
|
2336
|
+
link.remove();
|
|
2337
|
+
setTimeout(() => URL.revokeObjectURL(url), 40000);
|
|
2105
2338
|
}
|
|
2106
2339
|
// src/internal/client/src/content/stream-text-smoother.ts
|
|
2107
2340
|
class StreamTextSmoother {
|
|
@@ -2172,6 +2405,152 @@ class StreamTextSmoother {
|
|
|
2172
2405
|
}
|
|
2173
2406
|
}
|
|
2174
2407
|
}
|
|
2408
|
+
// src/internal/client/src/content/chat-motion.ts
|
|
2409
|
+
var SCREEN = ".cortex-widget__screen";
|
|
2410
|
+
var MESSAGE = ":scope > .cortex-message";
|
|
2411
|
+
var FRONTIER = ":scope > .cortex-working-thinking, :scope > .cortex-message > .cortex-message-parts > [data-cortex-frontier]";
|
|
2412
|
+
var SETTLING = "cortex-message-list__content--settling";
|
|
2413
|
+
var launches = new WeakMap;
|
|
2414
|
+
function captureLaunch(textarea, text) {
|
|
2415
|
+
const screen = textarea.closest(SCREEN);
|
|
2416
|
+
const list = screen?.querySelector(".cortex-message-list");
|
|
2417
|
+
if (!screen || !list || !textarea.value.trim())
|
|
2418
|
+
return;
|
|
2419
|
+
const style = getComputedStyle(textarea);
|
|
2420
|
+
const box = textarea.getBoundingClientRect();
|
|
2421
|
+
const inset = (side) => parseFloat(style[`padding${side}`]) + parseFloat(style[`border${side}Width`]);
|
|
2422
|
+
launches.set(screen, {
|
|
2423
|
+
text,
|
|
2424
|
+
textarea,
|
|
2425
|
+
from: new DOMRect(box.left + inset("Left"), box.top + inset("Top"), box.width - inset("Left") - inset("Right"), box.height - inset("Top") - inset("Bottom")),
|
|
2426
|
+
rtl: style.direction === "rtl",
|
|
2427
|
+
scrollTop: list.scrollTop
|
|
2428
|
+
});
|
|
2429
|
+
}
|
|
2430
|
+
function landSentMessage(content, text) {
|
|
2431
|
+
const screen = content.closest(SCREEN);
|
|
2432
|
+
const launch = screen ? launches.get(screen) : undefined;
|
|
2433
|
+
if (!screen || !launch)
|
|
2434
|
+
return;
|
|
2435
|
+
launches.delete(screen);
|
|
2436
|
+
const messages = content.querySelectorAll(MESSAGE);
|
|
2437
|
+
const bubble = messages[messages.length - 1]?.querySelector(".cortex-text-bubble--user");
|
|
2438
|
+
const list = content.closest(".cortex-message-list");
|
|
2439
|
+
if (!bubble || !list || launch.text !== text || !launch.textarea.isConnected)
|
|
2440
|
+
return;
|
|
2441
|
+
bubble.closest(".cortex-message-part")?.getAnimations().forEach((animation) => animation.finish());
|
|
2442
|
+
scrollToEnd(list);
|
|
2443
|
+
const to = bubble.getBoundingClientRect();
|
|
2444
|
+
const origin = screen.getBoundingClientRect();
|
|
2445
|
+
const style = getComputedStyle(bubble);
|
|
2446
|
+
const top = parseFloat(style.paddingTop) + parseFloat(style.borderTopWidth);
|
|
2447
|
+
const start = launch.rtl ? parseFloat(style.paddingRight) + parseFloat(style.borderRightWidth) : parseFloat(style.paddingLeft) + parseFloat(style.borderLeftWidth);
|
|
2448
|
+
const fromLeft = launch.rtl ? launch.from.right + start - to.width : launch.from.left - start;
|
|
2449
|
+
const slide = list.scrollTop - launch.scrollTop;
|
|
2450
|
+
if (slide) {
|
|
2451
|
+
content.style.setProperty("--cortex-slide", `${slide}px`);
|
|
2452
|
+
content.classList.remove(SETTLING);
|
|
2453
|
+
content.offsetWidth;
|
|
2454
|
+
content.classList.add(SETTLING);
|
|
2455
|
+
content.getAnimations()[0]?.finished.then(() => content.classList.remove(SETTLING), () => {
|
|
2456
|
+
return;
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
2459
|
+
const copy = bubble.cloneNode(true);
|
|
2460
|
+
copy.classList.add("cortex-send-flight");
|
|
2461
|
+
copy.setAttribute("aria-hidden", "true");
|
|
2462
|
+
Object.assign(copy.style, {
|
|
2463
|
+
left: `${to.left - origin.left}px`,
|
|
2464
|
+
top: `${to.top - origin.top}px`,
|
|
2465
|
+
width: `${to.width}px`
|
|
2466
|
+
});
|
|
2467
|
+
copy.style.setProperty("--cortex-fly-x", `${fromLeft - to.left}px`);
|
|
2468
|
+
copy.style.setProperty("--cortex-fly-y", `${launch.from.top - top - to.top}px`);
|
|
2469
|
+
bubble.style.visibility = "hidden";
|
|
2470
|
+
screen.append(copy);
|
|
2471
|
+
const pinned = list.scrollTop;
|
|
2472
|
+
const follow = () => {
|
|
2473
|
+
copy.style.top = `${to.top - origin.top - (list.scrollTop - pinned)}px`;
|
|
2474
|
+
};
|
|
2475
|
+
list.addEventListener("scroll", follow, { passive: true });
|
|
2476
|
+
settled(copy).then(() => {
|
|
2477
|
+
list.removeEventListener("scroll", follow);
|
|
2478
|
+
bubble.style.visibility = "";
|
|
2479
|
+
copy.remove();
|
|
2480
|
+
});
|
|
2481
|
+
}
|
|
2482
|
+
function scrollToEnd(list) {
|
|
2483
|
+
list.scrollTop = endScrollTop(list);
|
|
2484
|
+
}
|
|
2485
|
+
function distanceToEnd(list) {
|
|
2486
|
+
return endScrollTop(list) - list.scrollTop;
|
|
2487
|
+
}
|
|
2488
|
+
function endScrollTop(list) {
|
|
2489
|
+
const content = list.querySelector(".cortex-message-list__content");
|
|
2490
|
+
if (!content)
|
|
2491
|
+
return list.scrollHeight - list.clientHeight;
|
|
2492
|
+
const style = getComputedStyle(list);
|
|
2493
|
+
return content.offsetHeight + parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) - list.clientHeight;
|
|
2494
|
+
}
|
|
2495
|
+
function createWorkingAvatar(avatar) {
|
|
2496
|
+
let shown = false;
|
|
2497
|
+
const content = avatar.parentElement;
|
|
2498
|
+
const observer = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(place);
|
|
2499
|
+
observer?.observe(content);
|
|
2500
|
+
function place() {
|
|
2501
|
+
const target = content.querySelector(FRONTIER);
|
|
2502
|
+
if (!target)
|
|
2503
|
+
return false;
|
|
2504
|
+
avatar.style.setProperty("--cortex-avatar-y", `${firstLineCentre(target, content) - avatar.offsetHeight / 2}px`);
|
|
2505
|
+
return true;
|
|
2506
|
+
}
|
|
2507
|
+
return {
|
|
2508
|
+
sync(working) {
|
|
2509
|
+
if (working === shown) {
|
|
2510
|
+
if (working)
|
|
2511
|
+
place();
|
|
2512
|
+
return;
|
|
2513
|
+
}
|
|
2514
|
+
if (working) {
|
|
2515
|
+
if (!place())
|
|
2516
|
+
return;
|
|
2517
|
+
avatar.classList.remove("cortex-working-avatar--leaving");
|
|
2518
|
+
avatar.offsetWidth;
|
|
2519
|
+
avatar.classList.add("cortex-working-avatar--shown");
|
|
2520
|
+
shown = true;
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
shown = false;
|
|
2524
|
+
avatar.classList.add("cortex-working-avatar--leaving");
|
|
2525
|
+
settled(avatar, true).then(() => {
|
|
2526
|
+
if (shown)
|
|
2527
|
+
return;
|
|
2528
|
+
avatar.classList.remove("cortex-working-avatar--shown", "cortex-working-avatar--leaving");
|
|
2529
|
+
});
|
|
2530
|
+
},
|
|
2531
|
+
dispose() {
|
|
2532
|
+
observer?.disconnect();
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
}
|
|
2536
|
+
function firstLineCentre(target, content) {
|
|
2537
|
+
const bubble = target.querySelector(".cortex-text-bubble");
|
|
2538
|
+
if (!bubble)
|
|
2539
|
+
return offsetTopIn(target, content) + target.offsetHeight / 2;
|
|
2540
|
+
const style = getComputedStyle(bubble);
|
|
2541
|
+
return offsetTopIn(bubble, content) + parseFloat(style.paddingTop) + parseFloat(style.borderTopWidth) + parseFloat(style.lineHeight) / 2;
|
|
2542
|
+
}
|
|
2543
|
+
function offsetTopIn(element, ancestor) {
|
|
2544
|
+
let top = 0;
|
|
2545
|
+
for (let node = element;node instanceof HTMLElement && node !== ancestor; ) {
|
|
2546
|
+
top += node.offsetTop;
|
|
2547
|
+
node = node.offsetParent;
|
|
2548
|
+
}
|
|
2549
|
+
return top;
|
|
2550
|
+
}
|
|
2551
|
+
function settled(element, subtree = false) {
|
|
2552
|
+
return Promise.allSettled(element.getAnimations({ subtree }).map((animation) => animation.finished));
|
|
2553
|
+
}
|
|
2175
2554
|
// src/internal/client/src/chat/turn-lifecycle.ts
|
|
2176
2555
|
var MAX_REDELIVERIES = 2;
|
|
2177
2556
|
function createTurnLifecycle(options) {
|
|
@@ -2337,9 +2716,9 @@ function cachePercent(usage) {
|
|
|
2337
2716
|
return Math.round(usage.input.cacheRead / usage.input.total * 100);
|
|
2338
2717
|
}
|
|
2339
2718
|
// dist/fesm2022/m6d-cortex-angular.mjs
|
|
2719
|
+
import { DecimalPipe, NgComponentOutlet, NgTemplateOutlet } from "@angular/common";
|
|
2340
2720
|
import { Subject, defer, finalize, firstValueFrom, from, map, of, shareReplay, skip, switchMap, tap } from "rxjs";
|
|
2341
2721
|
import { injectChat } from "@tanstack/ai-angular";
|
|
2342
|
-
import { DecimalPipe, NgComponentOutlet, NgTemplateOutlet } from "@angular/common";
|
|
2343
2722
|
import { DomSanitizer } from "@angular/platform-browser";
|
|
2344
2723
|
var CORTEX_CONFIG = new InjectionToken("CORTEX_CONFIG");
|
|
2345
2724
|
var CORTEX_LOCALE = new InjectionToken("CORTEX_LOCALE");
|
|
@@ -3068,6 +3447,9 @@ var ChatComposerComponent = class ChatComposerComponent2 {
|
|
|
3068
3447
|
return;
|
|
3069
3448
|
const text = this.text().trim() || translate(this.locale(), "translate_attachment_caption");
|
|
3070
3449
|
const attachments = this.queue.store.consumeReady();
|
|
3450
|
+
const input2 = this.messageInput()?.nativeElement;
|
|
3451
|
+
if (input2)
|
|
3452
|
+
captureLaunch(input2, text);
|
|
3071
3453
|
this.text.set("");
|
|
3072
3454
|
this.chatService.send(text, attachments.map((attachment) => attachment.summary)).subscribe();
|
|
3073
3455
|
}
|
|
@@ -3322,6 +3704,7 @@ var ChatHeaderComponent = class ChatHeaderComponent2 {
|
|
|
3322
3704
|
toggleSidebar = output();
|
|
3323
3705
|
toggleDebug = output();
|
|
3324
3706
|
openHistory = output();
|
|
3707
|
+
newChat = output();
|
|
3325
3708
|
config = inject(CORTEX_CONFIG);
|
|
3326
3709
|
chatService = inject(CortexChatService);
|
|
3327
3710
|
locale = inject(CORTEX_LOCALE);
|
|
@@ -3350,7 +3733,8 @@ var ChatHeaderComponent = class ChatHeaderComponent2 {
|
|
|
3350
3733
|
outputs: {
|
|
3351
3734
|
toggleSidebar: "toggleSidebar",
|
|
3352
3735
|
toggleDebug: "toggleDebug",
|
|
3353
|
-
openHistory: "openHistory"
|
|
3736
|
+
openHistory: "openHistory",
|
|
3737
|
+
newChat: "newChat"
|
|
3354
3738
|
},
|
|
3355
3739
|
host: { classAttribute: "cortex-widget__chat-header" },
|
|
3356
3740
|
ngImport: i0,
|
|
@@ -3383,11 +3767,24 @@ var ChatHeaderComponent = class ChatHeaderComponent2 {
|
|
|
3383
3767
|
</button>
|
|
3384
3768
|
}
|
|
3385
3769
|
|
|
3770
|
+
<button
|
|
3771
|
+
type="button"
|
|
3772
|
+
(click)="newChat.emit()"
|
|
3773
|
+
[attr.aria-label]="'translate_new_chat' | translate"
|
|
3774
|
+
[title]="'translate_new_chat' | translate"
|
|
3775
|
+
class="cortex-widget__header-btn cortex-widget__new-btn"
|
|
3776
|
+
>
|
|
3777
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
3778
|
+
<path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
3779
|
+
</svg>
|
|
3780
|
+
</button>
|
|
3781
|
+
|
|
3386
3782
|
<button
|
|
3387
3783
|
type="button"
|
|
3388
3784
|
(click)="openHistory.emit()"
|
|
3389
3785
|
[attr.aria-label]="'translate_history' | translate"
|
|
3390
|
-
|
|
3786
|
+
[title]="'translate_history' | translate"
|
|
3787
|
+
class="cortex-widget__header-btn cortex-widget__history-btn"
|
|
3391
3788
|
>
|
|
3392
3789
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
3393
3790
|
<circle cx="8" cy="8" r="5.75" stroke="currentColor" stroke-width="1.3" />
|
|
@@ -3452,11 +3849,24 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3452
3849
|
</button>
|
|
3453
3850
|
}
|
|
3454
3851
|
|
|
3852
|
+
<button
|
|
3853
|
+
type="button"
|
|
3854
|
+
(click)="newChat.emit()"
|
|
3855
|
+
[attr.aria-label]="'translate_new_chat' | translate"
|
|
3856
|
+
[title]="'translate_new_chat' | translate"
|
|
3857
|
+
class="cortex-widget__header-btn cortex-widget__new-btn"
|
|
3858
|
+
>
|
|
3859
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
3860
|
+
<path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
3861
|
+
</svg>
|
|
3862
|
+
</button>
|
|
3863
|
+
|
|
3455
3864
|
<button
|
|
3456
3865
|
type="button"
|
|
3457
3866
|
(click)="openHistory.emit()"
|
|
3458
3867
|
[attr.aria-label]="'translate_history' | translate"
|
|
3459
|
-
|
|
3868
|
+
[title]="'translate_history' | translate"
|
|
3869
|
+
class="cortex-widget__header-btn cortex-widget__history-btn"
|
|
3460
3870
|
>
|
|
3461
3871
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
3462
3872
|
<circle cx="8" cy="8" r="5.75" stroke="currentColor" stroke-width="1.3" />
|
|
@@ -3492,6 +3902,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
3492
3902
|
openHistory: [{
|
|
3493
3903
|
type: i0.Output,
|
|
3494
3904
|
args: ["openHistory"]
|
|
3905
|
+
}],
|
|
3906
|
+
newChat: [{
|
|
3907
|
+
type: i0.Output,
|
|
3908
|
+
args: ["newChat"]
|
|
3495
3909
|
}]
|
|
3496
3910
|
}
|
|
3497
3911
|
});
|
|
@@ -5457,7 +5871,309 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5457
5871
|
type: i0.Input,
|
|
5458
5872
|
args: [{
|
|
5459
5873
|
isSignal: true,
|
|
5460
|
-
alias: "source",
|
|
5874
|
+
alias: "source",
|
|
5875
|
+
required: true
|
|
5876
|
+
}]
|
|
5877
|
+
}],
|
|
5878
|
+
closed: [{
|
|
5879
|
+
type: i0.Input,
|
|
5880
|
+
args: [{
|
|
5881
|
+
isSignal: true,
|
|
5882
|
+
alias: "closed",
|
|
5883
|
+
required: true
|
|
5884
|
+
}]
|
|
5885
|
+
}],
|
|
5886
|
+
streaming: [{
|
|
5887
|
+
type: i0.Input,
|
|
5888
|
+
args: [{
|
|
5889
|
+
isSignal: true,
|
|
5890
|
+
alias: "streaming",
|
|
5891
|
+
required: true
|
|
5892
|
+
}]
|
|
5893
|
+
}],
|
|
5894
|
+
debugMode: [{
|
|
5895
|
+
type: i0.Input,
|
|
5896
|
+
args: [{
|
|
5897
|
+
isSignal: true,
|
|
5898
|
+
alias: "debugMode",
|
|
5899
|
+
required: false
|
|
5900
|
+
}]
|
|
5901
|
+
}],
|
|
5902
|
+
host: [{
|
|
5903
|
+
type: i0.ViewChild,
|
|
5904
|
+
args: ["host", { isSignal: true }]
|
|
5905
|
+
}]
|
|
5906
|
+
}
|
|
5907
|
+
});
|
|
5908
|
+
var TableBlockComponent = class TableBlockComponent2 {
|
|
5909
|
+
markdown = input.required(...ngDevMode ? [{ debugName: "markdown" }] : []);
|
|
5910
|
+
closed = input.required(...ngDevMode ? [{ debugName: "closed" }] : []);
|
|
5911
|
+
expanded = signal(false, ...ngDevMode ? [{ debugName: "expanded" }] : []);
|
|
5912
|
+
frame = viewChild.required("frame", ...ngDevMode ? [{ debugName: "frame" }] : []);
|
|
5913
|
+
dialog = viewChild.required("dialog", ...ngDevMode ? [{ debugName: "dialog" }] : []);
|
|
5914
|
+
expand() {
|
|
5915
|
+
this.expanded.set(true);
|
|
5916
|
+
this.dialog().nativeElement.showModal();
|
|
5917
|
+
}
|
|
5918
|
+
close() {
|
|
5919
|
+
this.dialog().nativeElement.close();
|
|
5920
|
+
}
|
|
5921
|
+
export() {
|
|
5922
|
+
const table = this.frame().nativeElement.querySelector("table");
|
|
5923
|
+
if (table)
|
|
5924
|
+
saveBlob(tableToXlsx(tableRows(table)), "table.xlsx");
|
|
5925
|
+
}
|
|
5926
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
5927
|
+
minVersion: "12.0.0",
|
|
5928
|
+
version: "22.2.0",
|
|
5929
|
+
ngImport: i0,
|
|
5930
|
+
type: TableBlockComponent2,
|
|
5931
|
+
deps: [],
|
|
5932
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
5933
|
+
});
|
|
5934
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
5935
|
+
minVersion: "17.0.0",
|
|
5936
|
+
version: "22.2.0",
|
|
5937
|
+
type: TableBlockComponent2,
|
|
5938
|
+
isStandalone: true,
|
|
5939
|
+
selector: "cortex-table-block",
|
|
5940
|
+
inputs: {
|
|
5941
|
+
markdown: {
|
|
5942
|
+
classPropertyName: "markdown",
|
|
5943
|
+
publicName: "markdown",
|
|
5944
|
+
isSignal: true,
|
|
5945
|
+
isRequired: true,
|
|
5946
|
+
transformFunction: null
|
|
5947
|
+
},
|
|
5948
|
+
closed: {
|
|
5949
|
+
classPropertyName: "closed",
|
|
5950
|
+
publicName: "closed",
|
|
5951
|
+
isSignal: true,
|
|
5952
|
+
isRequired: true,
|
|
5953
|
+
transformFunction: null
|
|
5954
|
+
}
|
|
5955
|
+
},
|
|
5956
|
+
host: { classAttribute: "cortex-table-block" },
|
|
5957
|
+
viewQueries: [{
|
|
5958
|
+
propertyName: "frame",
|
|
5959
|
+
first: true,
|
|
5960
|
+
predicate: ["frame"],
|
|
5961
|
+
descendants: true,
|
|
5962
|
+
isSignal: true
|
|
5963
|
+
}, {
|
|
5964
|
+
propertyName: "dialog",
|
|
5965
|
+
first: true,
|
|
5966
|
+
predicate: ["dialog"],
|
|
5967
|
+
descendants: true,
|
|
5968
|
+
isSignal: true
|
|
5969
|
+
}],
|
|
5970
|
+
ngImport: i0,
|
|
5971
|
+
template: `<div class="cortex-table-block__actions">
|
|
5972
|
+
@if (closed()) {
|
|
5973
|
+
<button
|
|
5974
|
+
type="button"
|
|
5975
|
+
class="cortex-table-block__action"
|
|
5976
|
+
[attr.aria-label]="'translate_table_expand' | translate"
|
|
5977
|
+
[title]="'translate_table_expand' | translate"
|
|
5978
|
+
(click)="expand()"
|
|
5979
|
+
>
|
|
5980
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
5981
|
+
<path
|
|
5982
|
+
d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9"
|
|
5983
|
+
stroke="currentColor"
|
|
5984
|
+
stroke-width="1.3"
|
|
5985
|
+
stroke-linecap="round"
|
|
5986
|
+
stroke-linejoin="round"
|
|
5987
|
+
/>
|
|
5988
|
+
</svg>
|
|
5989
|
+
</button>
|
|
5990
|
+
<button
|
|
5991
|
+
type="button"
|
|
5992
|
+
class="cortex-table-block__action"
|
|
5993
|
+
[attr.aria-label]="'translate_table_export' | translate"
|
|
5994
|
+
[title]="'translate_table_export' | translate"
|
|
5995
|
+
(click)="export()"
|
|
5996
|
+
>
|
|
5997
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
5998
|
+
<path
|
|
5999
|
+
d="M8 2.5v7.5M5 7l3 3 3-3M2.75 11v1.25a1.25 1.25 0 0 0 1.25 1.25h8a1.25 1.25 0 0 0 1.25-1.25V11"
|
|
6000
|
+
stroke="currentColor"
|
|
6001
|
+
stroke-width="1.3"
|
|
6002
|
+
stroke-linecap="round"
|
|
6003
|
+
stroke-linejoin="round"
|
|
6004
|
+
/>
|
|
6005
|
+
</svg>
|
|
6006
|
+
</button>
|
|
6007
|
+
}
|
|
6008
|
+
</div>
|
|
6009
|
+
<div #frame [innerHTML]="markdown() | marked"></div>
|
|
6010
|
+
<!-- The dialog closes itself on Escape. -->
|
|
6011
|
+
<dialog
|
|
6012
|
+
#dialog
|
|
6013
|
+
class="cortex-table-block__dialog"
|
|
6014
|
+
[attr.aria-label]="'translate_table_expand' | translate"
|
|
6015
|
+
(close)="expanded.set(false)"
|
|
6016
|
+
>
|
|
6017
|
+
<div class="cortex-table-block__dialog-head">
|
|
6018
|
+
<button
|
|
6019
|
+
type="button"
|
|
6020
|
+
class="cortex-table-block__action"
|
|
6021
|
+
[attr.aria-label]="'translate_table_export' | translate"
|
|
6022
|
+
[title]="'translate_table_export' | translate"
|
|
6023
|
+
(click)="export()"
|
|
6024
|
+
>
|
|
6025
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
6026
|
+
<path
|
|
6027
|
+
d="M8 2.5v7.5M5 7l3 3 3-3M2.75 11v1.25a1.25 1.25 0 0 0 1.25 1.25h8a1.25 1.25 0 0 0 1.25-1.25V11"
|
|
6028
|
+
stroke="currentColor"
|
|
6029
|
+
stroke-width="1.3"
|
|
6030
|
+
stroke-linecap="round"
|
|
6031
|
+
stroke-linejoin="round"
|
|
6032
|
+
/>
|
|
6033
|
+
</svg>
|
|
6034
|
+
</button>
|
|
6035
|
+
<button
|
|
6036
|
+
type="button"
|
|
6037
|
+
class="cortex-table-block__action"
|
|
6038
|
+
[attr.aria-label]="'translate_close' | translate"
|
|
6039
|
+
[title]="'translate_close' | translate"
|
|
6040
|
+
(click)="close()"
|
|
6041
|
+
>
|
|
6042
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
6043
|
+
<path
|
|
6044
|
+
d="M4 4l8 8M12 4l-8 8"
|
|
6045
|
+
stroke="currentColor"
|
|
6046
|
+
stroke-width="1.4"
|
|
6047
|
+
stroke-linecap="round"
|
|
6048
|
+
/>
|
|
6049
|
+
</svg>
|
|
6050
|
+
</button>
|
|
6051
|
+
</div>
|
|
6052
|
+
@if (expanded()) {
|
|
6053
|
+
<div class="cortex-table-block__dialog-body" [innerHTML]="markdown() | marked"></div>
|
|
6054
|
+
}
|
|
6055
|
+
</dialog>
|
|
6056
|
+
`,
|
|
6057
|
+
dependencies: [{
|
|
6058
|
+
kind: "pipe",
|
|
6059
|
+
type: MarkedPipe,
|
|
6060
|
+
name: "marked"
|
|
6061
|
+
}, {
|
|
6062
|
+
kind: "pipe",
|
|
6063
|
+
type: TranslatePipe,
|
|
6064
|
+
name: "translate"
|
|
6065
|
+
}],
|
|
6066
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
6067
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
6068
|
+
});
|
|
6069
|
+
};
|
|
6070
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
6071
|
+
minVersion: "12.0.0",
|
|
6072
|
+
version: "22.2.0",
|
|
6073
|
+
ngImport: i0,
|
|
6074
|
+
type: TableBlockComponent,
|
|
6075
|
+
decorators: [{
|
|
6076
|
+
type: Component,
|
|
6077
|
+
args: [{
|
|
6078
|
+
selector: "cortex-table-block",
|
|
6079
|
+
changeDetection: ChangeDetectionStrategy2.OnPush,
|
|
6080
|
+
encapsulation: ViewEncapsulation2.None,
|
|
6081
|
+
imports: [MarkedPipe, TranslatePipe],
|
|
6082
|
+
host: { class: "cortex-table-block" },
|
|
6083
|
+
template: `<div class="cortex-table-block__actions">
|
|
6084
|
+
@if (closed()) {
|
|
6085
|
+
<button
|
|
6086
|
+
type="button"
|
|
6087
|
+
class="cortex-table-block__action"
|
|
6088
|
+
[attr.aria-label]="'translate_table_expand' | translate"
|
|
6089
|
+
[title]="'translate_table_expand' | translate"
|
|
6090
|
+
(click)="expand()"
|
|
6091
|
+
>
|
|
6092
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
6093
|
+
<path
|
|
6094
|
+
d="M9.5 2.5h4v4M6.5 13.5h-4v-4M13.5 2.5 9 7M2.5 13.5 7 9"
|
|
6095
|
+
stroke="currentColor"
|
|
6096
|
+
stroke-width="1.3"
|
|
6097
|
+
stroke-linecap="round"
|
|
6098
|
+
stroke-linejoin="round"
|
|
6099
|
+
/>
|
|
6100
|
+
</svg>
|
|
6101
|
+
</button>
|
|
6102
|
+
<button
|
|
6103
|
+
type="button"
|
|
6104
|
+
class="cortex-table-block__action"
|
|
6105
|
+
[attr.aria-label]="'translate_table_export' | translate"
|
|
6106
|
+
[title]="'translate_table_export' | translate"
|
|
6107
|
+
(click)="export()"
|
|
6108
|
+
>
|
|
6109
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
6110
|
+
<path
|
|
6111
|
+
d="M8 2.5v7.5M5 7l3 3 3-3M2.75 11v1.25a1.25 1.25 0 0 0 1.25 1.25h8a1.25 1.25 0 0 0 1.25-1.25V11"
|
|
6112
|
+
stroke="currentColor"
|
|
6113
|
+
stroke-width="1.3"
|
|
6114
|
+
stroke-linecap="round"
|
|
6115
|
+
stroke-linejoin="round"
|
|
6116
|
+
/>
|
|
6117
|
+
</svg>
|
|
6118
|
+
</button>
|
|
6119
|
+
}
|
|
6120
|
+
</div>
|
|
6121
|
+
<div #frame [innerHTML]="markdown() | marked"></div>
|
|
6122
|
+
<!-- The dialog closes itself on Escape. -->
|
|
6123
|
+
<dialog
|
|
6124
|
+
#dialog
|
|
6125
|
+
class="cortex-table-block__dialog"
|
|
6126
|
+
[attr.aria-label]="'translate_table_expand' | translate"
|
|
6127
|
+
(close)="expanded.set(false)"
|
|
6128
|
+
>
|
|
6129
|
+
<div class="cortex-table-block__dialog-head">
|
|
6130
|
+
<button
|
|
6131
|
+
type="button"
|
|
6132
|
+
class="cortex-table-block__action"
|
|
6133
|
+
[attr.aria-label]="'translate_table_export' | translate"
|
|
6134
|
+
[title]="'translate_table_export' | translate"
|
|
6135
|
+
(click)="export()"
|
|
6136
|
+
>
|
|
6137
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
6138
|
+
<path
|
|
6139
|
+
d="M8 2.5v7.5M5 7l3 3 3-3M2.75 11v1.25a1.25 1.25 0 0 0 1.25 1.25h8a1.25 1.25 0 0 0 1.25-1.25V11"
|
|
6140
|
+
stroke="currentColor"
|
|
6141
|
+
stroke-width="1.3"
|
|
6142
|
+
stroke-linecap="round"
|
|
6143
|
+
stroke-linejoin="round"
|
|
6144
|
+
/>
|
|
6145
|
+
</svg>
|
|
6146
|
+
</button>
|
|
6147
|
+
<button
|
|
6148
|
+
type="button"
|
|
6149
|
+
class="cortex-table-block__action"
|
|
6150
|
+
[attr.aria-label]="'translate_close' | translate"
|
|
6151
|
+
[title]="'translate_close' | translate"
|
|
6152
|
+
(click)="close()"
|
|
6153
|
+
>
|
|
6154
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
6155
|
+
<path
|
|
6156
|
+
d="M4 4l8 8M12 4l-8 8"
|
|
6157
|
+
stroke="currentColor"
|
|
6158
|
+
stroke-width="1.4"
|
|
6159
|
+
stroke-linecap="round"
|
|
6160
|
+
/>
|
|
6161
|
+
</svg>
|
|
6162
|
+
</button>
|
|
6163
|
+
</div>
|
|
6164
|
+
@if (expanded()) {
|
|
6165
|
+
<div class="cortex-table-block__dialog-body" [innerHTML]="markdown() | marked"></div>
|
|
6166
|
+
}
|
|
6167
|
+
</dialog>
|
|
6168
|
+
`
|
|
6169
|
+
}]
|
|
6170
|
+
}],
|
|
6171
|
+
propDecorators: {
|
|
6172
|
+
markdown: [{
|
|
6173
|
+
type: i0.Input,
|
|
6174
|
+
args: [{
|
|
6175
|
+
isSignal: true,
|
|
6176
|
+
alias: "markdown",
|
|
5461
6177
|
required: true
|
|
5462
6178
|
}]
|
|
5463
6179
|
}],
|
|
@@ -5469,25 +6185,13 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5469
6185
|
required: true
|
|
5470
6186
|
}]
|
|
5471
6187
|
}],
|
|
5472
|
-
|
|
5473
|
-
type: i0.
|
|
5474
|
-
args: [{
|
|
5475
|
-
isSignal: true,
|
|
5476
|
-
alias: "streaming",
|
|
5477
|
-
required: true
|
|
5478
|
-
}]
|
|
5479
|
-
}],
|
|
5480
|
-
debugMode: [{
|
|
5481
|
-
type: i0.Input,
|
|
5482
|
-
args: [{
|
|
5483
|
-
isSignal: true,
|
|
5484
|
-
alias: "debugMode",
|
|
5485
|
-
required: false
|
|
5486
|
-
}]
|
|
6188
|
+
frame: [{
|
|
6189
|
+
type: i0.ViewChild,
|
|
6190
|
+
args: ["frame", { isSignal: true }]
|
|
5487
6191
|
}],
|
|
5488
|
-
|
|
6192
|
+
dialog: [{
|
|
5489
6193
|
type: i0.ViewChild,
|
|
5490
|
-
args: ["
|
|
6194
|
+
args: ["dialog", { isSignal: true }]
|
|
5491
6195
|
}]
|
|
5492
6196
|
}
|
|
5493
6197
|
});
|
|
@@ -5625,6 +6329,10 @@ var MessageTextPartComponent = class MessageTextPartComponent2 {
|
|
|
5625
6329
|
[debugMode]="debugMode()"
|
|
5626
6330
|
/>
|
|
5627
6331
|
}
|
|
6332
|
+
@case ('table') {
|
|
6333
|
+
<!-- A table that ends the message closes when the message does. -->
|
|
6334
|
+
<cortex-table-block [markdown]="segment.text" [closed]="segment.closed || !arriving()" />
|
|
6335
|
+
}
|
|
5628
6336
|
@case ('attachment') {
|
|
5629
6337
|
<cortex-attachment-image
|
|
5630
6338
|
[id]="segment.id"
|
|
@@ -5660,6 +6368,12 @@ var MessageTextPartComponent = class MessageTextPartComponent2 {
|
|
|
5660
6368
|
"debugMode"
|
|
5661
6369
|
]
|
|
5662
6370
|
},
|
|
6371
|
+
{
|
|
6372
|
+
kind: "component",
|
|
6373
|
+
type: TableBlockComponent,
|
|
6374
|
+
selector: "cortex-table-block",
|
|
6375
|
+
inputs: ["markdown", "closed"]
|
|
6376
|
+
},
|
|
5663
6377
|
{
|
|
5664
6378
|
kind: "pipe",
|
|
5665
6379
|
type: MarkedPipe,
|
|
@@ -5684,7 +6398,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5684
6398
|
imports: [
|
|
5685
6399
|
AttachmentImageComponent,
|
|
5686
6400
|
MarkedPipe,
|
|
5687
|
-
MediaBlockComponent
|
|
6401
|
+
MediaBlockComponent,
|
|
6402
|
+
TableBlockComponent
|
|
5688
6403
|
],
|
|
5689
6404
|
template: `<div
|
|
5690
6405
|
class="cortex-text-part"
|
|
@@ -5710,6 +6425,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
5710
6425
|
[debugMode]="debugMode()"
|
|
5711
6426
|
/>
|
|
5712
6427
|
}
|
|
6428
|
+
@case ('table') {
|
|
6429
|
+
<!-- A table that ends the message closes when the message does. -->
|
|
6430
|
+
<cortex-table-block [markdown]="segment.text" [closed]="segment.closed || !arriving()" />
|
|
6431
|
+
}
|
|
5713
6432
|
@case ('attachment') {
|
|
5714
6433
|
<cortex-attachment-image
|
|
5715
6434
|
[id]="segment.id"
|
|
@@ -6661,6 +7380,295 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
6661
7380
|
}]
|
|
6662
7381
|
}] }
|
|
6663
7382
|
});
|
|
7383
|
+
var ApprovalCardComponent = class ApprovalCardComponent2 {
|
|
7384
|
+
toolCallPart = input.required(...ngDevMode ? [{ debugName: "toolCallPart" }] : []);
|
|
7385
|
+
asking = input.required(...ngDevMode ? [{ debugName: "asking" }] : []);
|
|
7386
|
+
locale = inject(CORTEX_LOCALE);
|
|
7387
|
+
chatService = inject(CortexChatService);
|
|
7388
|
+
card = computed(() => approvalCard(this.toolCallPart(), this.locale()), ...ngDevMode ? [{ debugName: "card" }] : []);
|
|
7389
|
+
outcome = computed(() => toolCallAnimation(this.toolCallPart()), ...ngDevMode ? [{ debugName: "outcome" }] : []);
|
|
7390
|
+
sentenceId = computed(() => `cortex-approval-${this.toolCallPart().id}`, ...ngDevMode ? [{ debugName: "sentenceId" }] : []);
|
|
7391
|
+
detailsOpen = signal(false, ...ngDevMode ? [{ debugName: "detailsOpen" }] : []);
|
|
7392
|
+
respond(approved) {
|
|
7393
|
+
this.chatService.respondToApproval(approvalIdOf(this.toolCallPart()), approved);
|
|
7394
|
+
}
|
|
7395
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7396
|
+
minVersion: "12.0.0",
|
|
7397
|
+
version: "22.2.0",
|
|
7398
|
+
ngImport: i0,
|
|
7399
|
+
type: ApprovalCardComponent2,
|
|
7400
|
+
deps: [],
|
|
7401
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
7402
|
+
});
|
|
7403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
7404
|
+
minVersion: "17.0.0",
|
|
7405
|
+
version: "22.2.0",
|
|
7406
|
+
type: ApprovalCardComponent2,
|
|
7407
|
+
isStandalone: true,
|
|
7408
|
+
selector: "cortex-approval-card",
|
|
7409
|
+
inputs: {
|
|
7410
|
+
toolCallPart: {
|
|
7411
|
+
classPropertyName: "toolCallPart",
|
|
7412
|
+
publicName: "toolCallPart",
|
|
7413
|
+
isSignal: true,
|
|
7414
|
+
isRequired: true,
|
|
7415
|
+
transformFunction: null
|
|
7416
|
+
},
|
|
7417
|
+
asking: {
|
|
7418
|
+
classPropertyName: "asking",
|
|
7419
|
+
publicName: "asking",
|
|
7420
|
+
isSignal: true,
|
|
7421
|
+
isRequired: true,
|
|
7422
|
+
transformFunction: null
|
|
7423
|
+
}
|
|
7424
|
+
},
|
|
7425
|
+
ngImport: i0,
|
|
7426
|
+
template: `@let view = card();
|
|
7427
|
+
@let pending = view.decision === 'pending';
|
|
7428
|
+
<div class="cortex-approval-card" [class.cortex-approval-card--asking]="pending">
|
|
7429
|
+
@if (pending) {
|
|
7430
|
+
<div class="cortex-approval-card__head">
|
|
7431
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
7432
|
+
<path
|
|
7433
|
+
d="M8 1.75 2.75 3.75v4c0 3 2.2 5.3 5.25 6.5 3.05-1.2 5.25-3.5 5.25-6.5v-4L8 1.75Z"
|
|
7434
|
+
stroke="currentColor"
|
|
7435
|
+
stroke-width="1.3"
|
|
7436
|
+
stroke-linejoin="round"
|
|
7437
|
+
/>
|
|
7438
|
+
</svg>
|
|
7439
|
+
{{ 'translate_approval_needed' | translate }}
|
|
7440
|
+
</div>
|
|
7441
|
+
<p class="cortex-approval-card__sentence" [id]="sentenceId()">{{ view.sentence }}</p>
|
|
7442
|
+
} @else {
|
|
7443
|
+
<div class="cortex-approval-card__line">
|
|
7444
|
+
<!-- The pill's glyph slot: a spinner while the approved call runs, then its outcome. -->
|
|
7445
|
+
<span class="cortex-tool-pill__icon" aria-hidden="true">
|
|
7446
|
+
<span
|
|
7447
|
+
class="cortex-tool-pill__spinner"
|
|
7448
|
+
[class.cortex-tool-pill__spinner--visible]="outcome().active"
|
|
7449
|
+
></span>
|
|
7450
|
+
<svg
|
|
7451
|
+
class="cortex-tool-pill__svg cortex-tool-pill__svg--check"
|
|
7452
|
+
[class.cortex-tool-pill__svg--visible]="outcome().state === 'complete'"
|
|
7453
|
+
viewBox="0 0 20 20"
|
|
7454
|
+
fill="none"
|
|
7455
|
+
>
|
|
7456
|
+
<path
|
|
7457
|
+
d="M5.5 10.5 L8.5 13.5 L14.5 7"
|
|
7458
|
+
stroke="currentColor"
|
|
7459
|
+
stroke-width="2"
|
|
7460
|
+
stroke-linecap="round"
|
|
7461
|
+
stroke-linejoin="round"
|
|
7462
|
+
/>
|
|
7463
|
+
</svg>
|
|
7464
|
+
<svg
|
|
7465
|
+
class="cortex-tool-pill__svg cortex-tool-pill__svg--error"
|
|
7466
|
+
[class.cortex-tool-pill__svg--visible]="outcome().state === 'error'"
|
|
7467
|
+
viewBox="0 0 20 20"
|
|
7468
|
+
fill="none"
|
|
7469
|
+
>
|
|
7470
|
+
<path
|
|
7471
|
+
d="M6.5 6.5 L13.5 13.5 M13.5 6.5 L6.5 13.5"
|
|
7472
|
+
stroke="currentColor"
|
|
7473
|
+
stroke-width="2"
|
|
7474
|
+
stroke-linecap="round"
|
|
7475
|
+
/>
|
|
7476
|
+
</svg>
|
|
7477
|
+
</span>
|
|
7478
|
+
@if (view.decisionKey; as key) {
|
|
7479
|
+
<span class="cortex-approval-card__decision">{{ key | translate }}</span>
|
|
7480
|
+
}
|
|
7481
|
+
<span class="cortex-approval-card__summary">{{ view.sentence }}</span>
|
|
7482
|
+
<button
|
|
7483
|
+
type="button"
|
|
7484
|
+
class="cortex-approval-card__details"
|
|
7485
|
+
[attr.aria-expanded]="detailsOpen()"
|
|
7486
|
+
(click)="detailsOpen.set(!detailsOpen())"
|
|
7487
|
+
>
|
|
7488
|
+
{{ 'translate_details' | translate }}
|
|
7489
|
+
</button>
|
|
7490
|
+
</div>
|
|
7491
|
+
<!-- The line cuts a long action short; Details shows all of it. -->
|
|
7492
|
+
@if (detailsOpen()) {
|
|
7493
|
+
<p class="cortex-approval-card__sentence cortex-approval-card__sentence--full">
|
|
7494
|
+
{{ view.sentence }}
|
|
7495
|
+
</p>
|
|
7496
|
+
}
|
|
7497
|
+
}
|
|
7498
|
+
@if (view.rows.length && (pending || detailsOpen())) {
|
|
7499
|
+
<dl class="cortex-approval-card__rows">
|
|
7500
|
+
@for (row of view.rows; track row.key) {
|
|
7501
|
+
<dt>{{ row.label }}</dt>
|
|
7502
|
+
<dd>{{ row.value }}</dd>
|
|
7503
|
+
}
|
|
7504
|
+
</dl>
|
|
7505
|
+
}
|
|
7506
|
+
@if (pending && asking()) {
|
|
7507
|
+
<div class="cortex-approval-card__foot">
|
|
7508
|
+
<button
|
|
7509
|
+
type="button"
|
|
7510
|
+
class="cortex-approval-card__button cortex-approval-card__button--approve"
|
|
7511
|
+
[attr.aria-describedby]="sentenceId()"
|
|
7512
|
+
(click)="respond(true)"
|
|
7513
|
+
>
|
|
7514
|
+
{{ 'translate_approve' | translate }}
|
|
7515
|
+
</button>
|
|
7516
|
+
<button
|
|
7517
|
+
type="button"
|
|
7518
|
+
class="cortex-approval-card__button"
|
|
7519
|
+
[attr.aria-describedby]="sentenceId()"
|
|
7520
|
+
(click)="respond(false)"
|
|
7521
|
+
>
|
|
7522
|
+
{{ 'translate_deny' | translate }}
|
|
7523
|
+
</button>
|
|
7524
|
+
</div>
|
|
7525
|
+
}
|
|
7526
|
+
</div>
|
|
7527
|
+
`,
|
|
7528
|
+
dependencies: [{
|
|
7529
|
+
kind: "pipe",
|
|
7530
|
+
type: TranslatePipe,
|
|
7531
|
+
name: "translate"
|
|
7532
|
+
}],
|
|
7533
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
7534
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
7535
|
+
});
|
|
7536
|
+
};
|
|
7537
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
7538
|
+
minVersion: "12.0.0",
|
|
7539
|
+
version: "22.2.0",
|
|
7540
|
+
ngImport: i0,
|
|
7541
|
+
type: ApprovalCardComponent,
|
|
7542
|
+
decorators: [{
|
|
7543
|
+
type: Component,
|
|
7544
|
+
args: [{
|
|
7545
|
+
selector: "cortex-approval-card",
|
|
7546
|
+
imports: [TranslatePipe],
|
|
7547
|
+
changeDetection: ChangeDetectionStrategy2.OnPush,
|
|
7548
|
+
encapsulation: ViewEncapsulation2.None,
|
|
7549
|
+
template: `@let view = card();
|
|
7550
|
+
@let pending = view.decision === 'pending';
|
|
7551
|
+
<div class="cortex-approval-card" [class.cortex-approval-card--asking]="pending">
|
|
7552
|
+
@if (pending) {
|
|
7553
|
+
<div class="cortex-approval-card__head">
|
|
7554
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
7555
|
+
<path
|
|
7556
|
+
d="M8 1.75 2.75 3.75v4c0 3 2.2 5.3 5.25 6.5 3.05-1.2 5.25-3.5 5.25-6.5v-4L8 1.75Z"
|
|
7557
|
+
stroke="currentColor"
|
|
7558
|
+
stroke-width="1.3"
|
|
7559
|
+
stroke-linejoin="round"
|
|
7560
|
+
/>
|
|
7561
|
+
</svg>
|
|
7562
|
+
{{ 'translate_approval_needed' | translate }}
|
|
7563
|
+
</div>
|
|
7564
|
+
<p class="cortex-approval-card__sentence" [id]="sentenceId()">{{ view.sentence }}</p>
|
|
7565
|
+
} @else {
|
|
7566
|
+
<div class="cortex-approval-card__line">
|
|
7567
|
+
<!-- The pill's glyph slot: a spinner while the approved call runs, then its outcome. -->
|
|
7568
|
+
<span class="cortex-tool-pill__icon" aria-hidden="true">
|
|
7569
|
+
<span
|
|
7570
|
+
class="cortex-tool-pill__spinner"
|
|
7571
|
+
[class.cortex-tool-pill__spinner--visible]="outcome().active"
|
|
7572
|
+
></span>
|
|
7573
|
+
<svg
|
|
7574
|
+
class="cortex-tool-pill__svg cortex-tool-pill__svg--check"
|
|
7575
|
+
[class.cortex-tool-pill__svg--visible]="outcome().state === 'complete'"
|
|
7576
|
+
viewBox="0 0 20 20"
|
|
7577
|
+
fill="none"
|
|
7578
|
+
>
|
|
7579
|
+
<path
|
|
7580
|
+
d="M5.5 10.5 L8.5 13.5 L14.5 7"
|
|
7581
|
+
stroke="currentColor"
|
|
7582
|
+
stroke-width="2"
|
|
7583
|
+
stroke-linecap="round"
|
|
7584
|
+
stroke-linejoin="round"
|
|
7585
|
+
/>
|
|
7586
|
+
</svg>
|
|
7587
|
+
<svg
|
|
7588
|
+
class="cortex-tool-pill__svg cortex-tool-pill__svg--error"
|
|
7589
|
+
[class.cortex-tool-pill__svg--visible]="outcome().state === 'error'"
|
|
7590
|
+
viewBox="0 0 20 20"
|
|
7591
|
+
fill="none"
|
|
7592
|
+
>
|
|
7593
|
+
<path
|
|
7594
|
+
d="M6.5 6.5 L13.5 13.5 M13.5 6.5 L6.5 13.5"
|
|
7595
|
+
stroke="currentColor"
|
|
7596
|
+
stroke-width="2"
|
|
7597
|
+
stroke-linecap="round"
|
|
7598
|
+
/>
|
|
7599
|
+
</svg>
|
|
7600
|
+
</span>
|
|
7601
|
+
@if (view.decisionKey; as key) {
|
|
7602
|
+
<span class="cortex-approval-card__decision">{{ key | translate }}</span>
|
|
7603
|
+
}
|
|
7604
|
+
<span class="cortex-approval-card__summary">{{ view.sentence }}</span>
|
|
7605
|
+
<button
|
|
7606
|
+
type="button"
|
|
7607
|
+
class="cortex-approval-card__details"
|
|
7608
|
+
[attr.aria-expanded]="detailsOpen()"
|
|
7609
|
+
(click)="detailsOpen.set(!detailsOpen())"
|
|
7610
|
+
>
|
|
7611
|
+
{{ 'translate_details' | translate }}
|
|
7612
|
+
</button>
|
|
7613
|
+
</div>
|
|
7614
|
+
<!-- The line cuts a long action short; Details shows all of it. -->
|
|
7615
|
+
@if (detailsOpen()) {
|
|
7616
|
+
<p class="cortex-approval-card__sentence cortex-approval-card__sentence--full">
|
|
7617
|
+
{{ view.sentence }}
|
|
7618
|
+
</p>
|
|
7619
|
+
}
|
|
7620
|
+
}
|
|
7621
|
+
@if (view.rows.length && (pending || detailsOpen())) {
|
|
7622
|
+
<dl class="cortex-approval-card__rows">
|
|
7623
|
+
@for (row of view.rows; track row.key) {
|
|
7624
|
+
<dt>{{ row.label }}</dt>
|
|
7625
|
+
<dd>{{ row.value }}</dd>
|
|
7626
|
+
}
|
|
7627
|
+
</dl>
|
|
7628
|
+
}
|
|
7629
|
+
@if (pending && asking()) {
|
|
7630
|
+
<div class="cortex-approval-card__foot">
|
|
7631
|
+
<button
|
|
7632
|
+
type="button"
|
|
7633
|
+
class="cortex-approval-card__button cortex-approval-card__button--approve"
|
|
7634
|
+
[attr.aria-describedby]="sentenceId()"
|
|
7635
|
+
(click)="respond(true)"
|
|
7636
|
+
>
|
|
7637
|
+
{{ 'translate_approve' | translate }}
|
|
7638
|
+
</button>
|
|
7639
|
+
<button
|
|
7640
|
+
type="button"
|
|
7641
|
+
class="cortex-approval-card__button"
|
|
7642
|
+
[attr.aria-describedby]="sentenceId()"
|
|
7643
|
+
(click)="respond(false)"
|
|
7644
|
+
>
|
|
7645
|
+
{{ 'translate_deny' | translate }}
|
|
7646
|
+
</button>
|
|
7647
|
+
</div>
|
|
7648
|
+
}
|
|
7649
|
+
</div>
|
|
7650
|
+
`
|
|
7651
|
+
}]
|
|
7652
|
+
}],
|
|
7653
|
+
propDecorators: {
|
|
7654
|
+
toolCallPart: [{
|
|
7655
|
+
type: i0.Input,
|
|
7656
|
+
args: [{
|
|
7657
|
+
isSignal: true,
|
|
7658
|
+
alias: "toolCallPart",
|
|
7659
|
+
required: true
|
|
7660
|
+
}]
|
|
7661
|
+
}],
|
|
7662
|
+
asking: [{
|
|
7663
|
+
type: i0.Input,
|
|
7664
|
+
args: [{
|
|
7665
|
+
isSignal: true,
|
|
7666
|
+
alias: "asking",
|
|
7667
|
+
required: true
|
|
7668
|
+
}]
|
|
7669
|
+
}]
|
|
7670
|
+
}
|
|
7671
|
+
});
|
|
6664
7672
|
var ClientToolEmbedComponent = class ClientToolEmbedComponent2 {
|
|
6665
7673
|
toolCallPart = input.required(...ngDevMode ? [{ debugName: "toolCallPart" }] : []);
|
|
6666
7674
|
fallback = output();
|
|
@@ -7435,10 +8443,6 @@ var MessageToolCallAnimatedComponent = class MessageToolCallAnimatedComponent2 {
|
|
|
7435
8443
|
owed = computed(() => this.toolCallPart().state === "input-complete" && !this.chatService.isAgentWorking(), ...ngDevMode ? [{ debugName: "owed" }] : []);
|
|
7436
8444
|
showClientTool = computed(() => !this.clientToolFallback() && this.owed(), ...ngDevMode ? [{ debugName: "showClientTool" }] : []);
|
|
7437
8445
|
approvalRequested = computed(() => this.toolCallPart().state === "approval-requested" && !this.chatService.isAgentWorking(), ...ngDevMode ? [{ debugName: "approvalRequested" }] : []);
|
|
7438
|
-
prompt = computed(() => approvalPrompt(this.toolCallPart(), this.locale()) ?? translate(this.locale(), "translate_approval_prompt"), ...ngDevMode ? [{ debugName: "prompt" }] : []);
|
|
7439
|
-
respond(approved) {
|
|
7440
|
-
this.chatService.respondToApproval(approvalIdOf(this.toolCallPart()), approved);
|
|
7441
|
-
}
|
|
7442
8446
|
animation = computed(() => toolCallAnimation(this.toolCallPart()), ...ngDevMode ? [{ debugName: "animation" }] : []);
|
|
7443
8447
|
animState = computed(() => this.animation().state, ...ngDevMode ? [{ debugName: "animState" }] : []);
|
|
7444
8448
|
gated = computed(() => this.animation().gated, ...ngDevMode ? [{ debugName: "gated" }] : []);
|
|
@@ -7490,21 +8494,15 @@ var MessageToolCallAnimatedComponent = class MessageToolCallAnimatedComponent2 {
|
|
|
7490
8494
|
[toolCallPart]="toolCallPart()"
|
|
7491
8495
|
(fallback)="clientToolFallback.set(true)"
|
|
7492
8496
|
/>
|
|
8497
|
+
} @else if (gated()) {
|
|
8498
|
+
<cortex-approval-card [toolCallPart]="toolCallPart()" [asking]="approvalRequested()" />
|
|
7493
8499
|
} @else {
|
|
7494
8500
|
@let state = animState();
|
|
7495
8501
|
@let active = isActive();
|
|
7496
|
-
@let asking = approvalRequested();
|
|
7497
8502
|
|
|
7498
|
-
<div
|
|
7499
|
-
class="cortex-tool-pill"
|
|
7500
|
-
[class.cortex-tool-pill--gated]="gated()"
|
|
7501
|
-
[class.cortex-tool-pill--asking]="asking"
|
|
7502
|
-
>
|
|
8503
|
+
<div class="cortex-tool-pill">
|
|
7503
8504
|
<!-- Spinner, then whichever glyph the call settled on -->
|
|
7504
8505
|
<span class="cortex-tool-pill__icon">
|
|
7505
|
-
@if (asking) {
|
|
7506
|
-
<span class="cortex-tool-pill__dot"></span>
|
|
7507
|
-
}
|
|
7508
8506
|
<span
|
|
7509
8507
|
class="cortex-tool-pill__spinner"
|
|
7510
8508
|
[class.cortex-tool-pill__spinner--visible]="active"
|
|
@@ -7543,9 +8541,7 @@ var MessageToolCallAnimatedComponent = class MessageToolCallAnimatedComponent2 {
|
|
|
7543
8541
|
[class.cortex-tool-pill__title--error]="state === 'error'"
|
|
7544
8542
|
[class.cortex-tool-pill__title--pending]="state === 'starting' && !!statement()"
|
|
7545
8543
|
>
|
|
7546
|
-
@if (
|
|
7547
|
-
{{ prompt() }}
|
|
7548
|
-
} @else if (statement(); as sentence) {
|
|
8544
|
+
@if (statement(); as sentence) {
|
|
7549
8545
|
{{ sentence }}
|
|
7550
8546
|
} @else {
|
|
7551
8547
|
{{ displayTitleKey() | translate }}
|
|
@@ -7554,20 +8550,6 @@ var MessageToolCallAnimatedComponent = class MessageToolCallAnimatedComponent2 {
|
|
|
7554
8550
|
@if (rowsLabel(); as label) {
|
|
7555
8551
|
<span class="cortex-tool-pill__meta">{{ label }}</span>
|
|
7556
8552
|
}
|
|
7557
|
-
@if (asking) {
|
|
7558
|
-
<span class="cortex-tool-pill__actions">
|
|
7559
|
-
<button
|
|
7560
|
-
type="button"
|
|
7561
|
-
class="cortex-tool-pill__action cortex-tool-pill__action--approve"
|
|
7562
|
-
(click)="respond(true)"
|
|
7563
|
-
>
|
|
7564
|
-
{{ 'translate_approve' | translate }}
|
|
7565
|
-
</button>
|
|
7566
|
-
<button type="button" class="cortex-tool-pill__action" (click)="respond(false)">
|
|
7567
|
-
{{ 'translate_deny' | translate }}
|
|
7568
|
-
</button>
|
|
7569
|
-
</span>
|
|
7570
|
-
}
|
|
7571
8553
|
</div>
|
|
7572
8554
|
}
|
|
7573
8555
|
`,
|
|
@@ -7586,6 +8568,12 @@ var MessageToolCallAnimatedComponent = class MessageToolCallAnimatedComponent2 {
|
|
|
7586
8568
|
],
|
|
7587
8569
|
exportAs: ["ngComponentOutlet"]
|
|
7588
8570
|
},
|
|
8571
|
+
{
|
|
8572
|
+
kind: "component",
|
|
8573
|
+
type: ApprovalCardComponent,
|
|
8574
|
+
selector: "cortex-approval-card",
|
|
8575
|
+
inputs: ["toolCallPart", "asking"]
|
|
8576
|
+
},
|
|
7589
8577
|
{
|
|
7590
8578
|
kind: "component",
|
|
7591
8579
|
type: ClientToolEmbedComponent,
|
|
@@ -7615,6 +8603,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7615
8603
|
imports: [
|
|
7616
8604
|
NgComponentOutlet,
|
|
7617
8605
|
TranslatePipe,
|
|
8606
|
+
ApprovalCardComponent,
|
|
7618
8607
|
ClientToolEmbedComponent
|
|
7619
8608
|
],
|
|
7620
8609
|
host: { class: "cortex-tool-call-animated" },
|
|
@@ -7629,21 +8618,15 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7629
8618
|
[toolCallPart]="toolCallPart()"
|
|
7630
8619
|
(fallback)="clientToolFallback.set(true)"
|
|
7631
8620
|
/>
|
|
8621
|
+
} @else if (gated()) {
|
|
8622
|
+
<cortex-approval-card [toolCallPart]="toolCallPart()" [asking]="approvalRequested()" />
|
|
7632
8623
|
} @else {
|
|
7633
8624
|
@let state = animState();
|
|
7634
8625
|
@let active = isActive();
|
|
7635
|
-
@let asking = approvalRequested();
|
|
7636
8626
|
|
|
7637
|
-
<div
|
|
7638
|
-
class="cortex-tool-pill"
|
|
7639
|
-
[class.cortex-tool-pill--gated]="gated()"
|
|
7640
|
-
[class.cortex-tool-pill--asking]="asking"
|
|
7641
|
-
>
|
|
8627
|
+
<div class="cortex-tool-pill">
|
|
7642
8628
|
<!-- Spinner, then whichever glyph the call settled on -->
|
|
7643
8629
|
<span class="cortex-tool-pill__icon">
|
|
7644
|
-
@if (asking) {
|
|
7645
|
-
<span class="cortex-tool-pill__dot"></span>
|
|
7646
|
-
}
|
|
7647
8630
|
<span
|
|
7648
8631
|
class="cortex-tool-pill__spinner"
|
|
7649
8632
|
[class.cortex-tool-pill__spinner--visible]="active"
|
|
@@ -7682,9 +8665,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7682
8665
|
[class.cortex-tool-pill__title--error]="state === 'error'"
|
|
7683
8666
|
[class.cortex-tool-pill__title--pending]="state === 'starting' && !!statement()"
|
|
7684
8667
|
>
|
|
7685
|
-
@if (
|
|
7686
|
-
{{ prompt() }}
|
|
7687
|
-
} @else if (statement(); as sentence) {
|
|
8668
|
+
@if (statement(); as sentence) {
|
|
7688
8669
|
{{ sentence }}
|
|
7689
8670
|
} @else {
|
|
7690
8671
|
{{ displayTitleKey() | translate }}
|
|
@@ -7693,20 +8674,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
7693
8674
|
@if (rowsLabel(); as label) {
|
|
7694
8675
|
<span class="cortex-tool-pill__meta">{{ label }}</span>
|
|
7695
8676
|
}
|
|
7696
|
-
@if (asking) {
|
|
7697
|
-
<span class="cortex-tool-pill__actions">
|
|
7698
|
-
<button
|
|
7699
|
-
type="button"
|
|
7700
|
-
class="cortex-tool-pill__action cortex-tool-pill__action--approve"
|
|
7701
|
-
(click)="respond(true)"
|
|
7702
|
-
>
|
|
7703
|
-
{{ 'translate_approve' | translate }}
|
|
7704
|
-
</button>
|
|
7705
|
-
<button type="button" class="cortex-tool-pill__action" (click)="respond(false)">
|
|
7706
|
-
{{ 'translate_deny' | translate }}
|
|
7707
|
-
</button>
|
|
7708
|
-
</span>
|
|
7709
|
-
}
|
|
7710
8677
|
</div>
|
|
7711
8678
|
}
|
|
7712
8679
|
`
|
|
@@ -7849,6 +8816,8 @@ var MessagePartComponent = class MessagePartComponent2 {
|
|
|
7849
8816
|
animate = input(false, ...ngDevMode ? [{ debugName: "animate" }] : []);
|
|
7850
8817
|
streaming = input(false, ...ngDevMode ? [{ debugName: "streaming" }] : []);
|
|
7851
8818
|
attachments = input([], ...ngDevMode ? [{ debugName: "attachments" }] : []);
|
|
8819
|
+
frontier = input(false, ...ngDevMode ? [{ debugName: "frontier" }] : []);
|
|
8820
|
+
folded = input(false, ...ngDevMode ? [{ debugName: "folded" }] : []);
|
|
7852
8821
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7853
8822
|
minVersion: "12.0.0",
|
|
7854
8823
|
version: "22.2.0",
|
|
@@ -7905,10 +8874,28 @@ var MessagePartComponent = class MessagePartComponent2 {
|
|
|
7905
8874
|
isSignal: true,
|
|
7906
8875
|
isRequired: false,
|
|
7907
8876
|
transformFunction: null
|
|
8877
|
+
},
|
|
8878
|
+
frontier: {
|
|
8879
|
+
classPropertyName: "frontier",
|
|
8880
|
+
publicName: "frontier",
|
|
8881
|
+
isSignal: true,
|
|
8882
|
+
isRequired: false,
|
|
8883
|
+
transformFunction: null
|
|
8884
|
+
},
|
|
8885
|
+
folded: {
|
|
8886
|
+
classPropertyName: "folded",
|
|
8887
|
+
publicName: "folded",
|
|
8888
|
+
isSignal: true,
|
|
8889
|
+
isRequired: false,
|
|
8890
|
+
transformFunction: null
|
|
7908
8891
|
}
|
|
7909
8892
|
},
|
|
7910
8893
|
host: {
|
|
7911
|
-
properties: {
|
|
8894
|
+
properties: {
|
|
8895
|
+
"class.cortex-message-part--animated": "animate()",
|
|
8896
|
+
"class.cortex-message-part--folded": "folded()",
|
|
8897
|
+
"attr.data-cortex-frontier": "frontier() ? '' : null"
|
|
8898
|
+
},
|
|
7912
8899
|
classAttribute: "cortex-message-part"
|
|
7913
8900
|
},
|
|
7914
8901
|
ngImport: i0,
|
|
@@ -8014,7 +9001,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
8014
9001
|
encapsulation: ViewEncapsulation2.None,
|
|
8015
9002
|
host: {
|
|
8016
9003
|
class: "cortex-message-part",
|
|
8017
|
-
"[class.cortex-message-part--animated]": "animate()"
|
|
9004
|
+
"[class.cortex-message-part--animated]": "animate()",
|
|
9005
|
+
"[class.cortex-message-part--folded]": "folded()",
|
|
9006
|
+
"[attr.data-cortex-frontier]": "frontier() ? '' : null"
|
|
8018
9007
|
},
|
|
8019
9008
|
template: `@let myPart = part();
|
|
8020
9009
|
|
|
@@ -8093,11 +9082,27 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
8093
9082
|
required: false
|
|
8094
9083
|
}]
|
|
8095
9084
|
}],
|
|
8096
|
-
attachments: [{
|
|
9085
|
+
attachments: [{
|
|
9086
|
+
type: i0.Input,
|
|
9087
|
+
args: [{
|
|
9088
|
+
isSignal: true,
|
|
9089
|
+
alias: "attachments",
|
|
9090
|
+
required: false
|
|
9091
|
+
}]
|
|
9092
|
+
}],
|
|
9093
|
+
frontier: [{
|
|
9094
|
+
type: i0.Input,
|
|
9095
|
+
args: [{
|
|
9096
|
+
isSignal: true,
|
|
9097
|
+
alias: "frontier",
|
|
9098
|
+
required: false
|
|
9099
|
+
}]
|
|
9100
|
+
}],
|
|
9101
|
+
folded: [{
|
|
8097
9102
|
type: i0.Input,
|
|
8098
9103
|
args: [{
|
|
8099
9104
|
isSignal: true,
|
|
8100
|
-
alias: "
|
|
9105
|
+
alias: "folded",
|
|
8101
9106
|
required: false
|
|
8102
9107
|
}]
|
|
8103
9108
|
}]
|
|
@@ -8436,6 +9441,7 @@ var MessageBodyComponent = class MessageBodyComponent2 {
|
|
|
8436
9441
|
animate = input.required(...ngDevMode ? [{ debugName: "animate" }] : []);
|
|
8437
9442
|
isStreaming = input.required(...ngDevMode ? [{ debugName: "isStreaming" }] : []);
|
|
8438
9443
|
fold = input(...ngDevMode ? [undefined, { debugName: "fold" }] : []);
|
|
9444
|
+
frontier = input(...ngDevMode ? [undefined, { debugName: "frontier" }] : []);
|
|
8439
9445
|
openRun = output();
|
|
8440
9446
|
locale = inject(CORTEX_LOCALE);
|
|
8441
9447
|
isAssistant = computed(() => this.message().role === "assistant", ...ngDevMode ? [{ debugName: "isAssistant" }] : []);
|
|
@@ -8446,10 +9452,11 @@ var MessageBodyComponent = class MessageBodyComponent2 {
|
|
|
8446
9452
|
createdAt = computed(() => this.metadata()?.createdAt, ...ngDevMode ? [{ debugName: "createdAt" }] : []);
|
|
8447
9453
|
actionsAfterPart = computed(() => {
|
|
8448
9454
|
const parts = this.parts();
|
|
8449
|
-
const
|
|
8450
|
-
|
|
9455
|
+
const drawn = parts.filter((part) => !this.folded(part));
|
|
9456
|
+
const lastText = drawn.filter((part) => part.type === "text").at(-1);
|
|
9457
|
+
if (!((this.isUser() || this.isAssistant()) && !this.isStreaming()) || !lastText)
|
|
8451
9458
|
return;
|
|
8452
|
-
return
|
|
9459
|
+
return lastText !== drawn.at(-1) ? parts.indexOf(lastText) : -1;
|
|
8453
9460
|
}, ...ngDevMode ? [{ debugName: "actionsAfterPart" }] : []);
|
|
8454
9461
|
keyedParts = computed(() => {
|
|
8455
9462
|
const source = this.message().parts;
|
|
@@ -8462,6 +9469,9 @@ var MessageBodyComponent = class MessageBodyComponent2 {
|
|
|
8462
9469
|
const at = this.createdAt();
|
|
8463
9470
|
return at ? timeLabel(at, this.locale()) : "";
|
|
8464
9471
|
}, ...ngDevMode ? [{ debugName: "sentAt" }] : []);
|
|
9472
|
+
folded(part) {
|
|
9473
|
+
return this.fold()?.get(part)?.kind === "hidden";
|
|
9474
|
+
}
|
|
8465
9475
|
foldedSteps(part) {
|
|
8466
9476
|
const mark = this.fold()?.get(part);
|
|
8467
9477
|
if (mark?.kind !== "more")
|
|
@@ -8538,6 +9548,13 @@ var MessageBodyComponent = class MessageBodyComponent2 {
|
|
|
8538
9548
|
isSignal: true,
|
|
8539
9549
|
isRequired: false,
|
|
8540
9550
|
transformFunction: null
|
|
9551
|
+
},
|
|
9552
|
+
frontier: {
|
|
9553
|
+
classPropertyName: "frontier",
|
|
9554
|
+
publicName: "frontier",
|
|
9555
|
+
isSignal: true,
|
|
9556
|
+
isRequired: false,
|
|
9557
|
+
transformFunction: null
|
|
8541
9558
|
}
|
|
8542
9559
|
},
|
|
8543
9560
|
outputs: { openRun: "openRun" },
|
|
@@ -8552,6 +9569,8 @@ var MessageBodyComponent = class MessageBodyComponent2 {
|
|
|
8552
9569
|
[animate]="animate()"
|
|
8553
9570
|
[streaming]="$index === streamingPartIndex()"
|
|
8554
9571
|
[attachments]="attachments()"
|
|
9572
|
+
[frontier]="part === frontier()"
|
|
9573
|
+
[folded]="folded(part)"
|
|
8555
9574
|
/>
|
|
8556
9575
|
@if (foldedSteps(part); as folded) {
|
|
8557
9576
|
<button
|
|
@@ -8637,7 +9656,9 @@ var MessageBodyComponent = class MessageBodyComponent2 {
|
|
|
8637
9656
|
"debugMode",
|
|
8638
9657
|
"animate",
|
|
8639
9658
|
"streaming",
|
|
8640
|
-
"attachments"
|
|
9659
|
+
"attachments",
|
|
9660
|
+
"frontier",
|
|
9661
|
+
"folded"
|
|
8641
9662
|
]
|
|
8642
9663
|
},
|
|
8643
9664
|
{
|
|
@@ -8697,6 +9718,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
8697
9718
|
[animate]="animate()"
|
|
8698
9719
|
[streaming]="$index === streamingPartIndex()"
|
|
8699
9720
|
[attachments]="attachments()"
|
|
9721
|
+
[frontier]="part === frontier()"
|
|
9722
|
+
[folded]="folded(part)"
|
|
8700
9723
|
/>
|
|
8701
9724
|
@if (foldedSteps(part); as folded) {
|
|
8702
9725
|
<button
|
|
@@ -8807,6 +9830,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
8807
9830
|
required: false
|
|
8808
9831
|
}]
|
|
8809
9832
|
}],
|
|
9833
|
+
frontier: [{
|
|
9834
|
+
type: i0.Input,
|
|
9835
|
+
args: [{
|
|
9836
|
+
isSignal: true,
|
|
9837
|
+
alias: "frontier",
|
|
9838
|
+
required: false
|
|
9839
|
+
}]
|
|
9840
|
+
}],
|
|
8810
9841
|
openRun: [{
|
|
8811
9842
|
type: i0.Output,
|
|
8812
9843
|
args: ["openRun"]
|
|
@@ -8947,6 +9978,8 @@ var MessageComponent = class MessageComponent2 {
|
|
|
8947
9978
|
debugMode = input(false, ...ngDevMode ? [{ debugName: "debugMode" }] : []);
|
|
8948
9979
|
animate = input(false, ...ngDevMode ? [{ debugName: "animate" }] : []);
|
|
8949
9980
|
fold = input(...ngDevMode ? [undefined, { debugName: "fold" }] : []);
|
|
9981
|
+
workingTurn = input(false, ...ngDevMode ? [{ debugName: "workingTurn" }] : []);
|
|
9982
|
+
frontier = input(...ngDevMode ? [undefined, { debugName: "frontier" }] : []);
|
|
8950
9983
|
openRun = output();
|
|
8951
9984
|
chatService = inject(CortexChatService);
|
|
8952
9985
|
isStreaming = computed(() => {
|
|
@@ -8957,8 +9990,7 @@ var MessageComponent = class MessageComponent2 {
|
|
|
8957
9990
|
metadata = computed(() => this.message().metadata, ...ngDevMode ? [{ debugName: "metadata" }] : []);
|
|
8958
9991
|
visibleParts = computed(() => visibleMessageParts(this.message().parts, {
|
|
8959
9992
|
debugMode: this.debugMode(),
|
|
8960
|
-
isStreaming: this.isStreaming()
|
|
8961
|
-
fold: this.fold()
|
|
9993
|
+
isStreaming: this.isStreaming()
|
|
8962
9994
|
}), ...ngDevMode ? [{ debugName: "visibleParts" }] : []);
|
|
8963
9995
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
8964
9996
|
minVersion: "12.0.0",
|
|
@@ -9002,10 +10034,27 @@ var MessageComponent = class MessageComponent2 {
|
|
|
9002
10034
|
isSignal: true,
|
|
9003
10035
|
isRequired: false,
|
|
9004
10036
|
transformFunction: null
|
|
10037
|
+
},
|
|
10038
|
+
workingTurn: {
|
|
10039
|
+
classPropertyName: "workingTurn",
|
|
10040
|
+
publicName: "workingTurn",
|
|
10041
|
+
isSignal: true,
|
|
10042
|
+
isRequired: false,
|
|
10043
|
+
transformFunction: null
|
|
10044
|
+
},
|
|
10045
|
+
frontier: {
|
|
10046
|
+
classPropertyName: "frontier",
|
|
10047
|
+
publicName: "frontier",
|
|
10048
|
+
isSignal: true,
|
|
10049
|
+
isRequired: false,
|
|
10050
|
+
transformFunction: null
|
|
9005
10051
|
}
|
|
9006
10052
|
},
|
|
9007
10053
|
outputs: { openRun: "openRun" },
|
|
9008
|
-
host: {
|
|
10054
|
+
host: {
|
|
10055
|
+
properties: { "class.cortex-message--working-turn": "workingTurn()" },
|
|
10056
|
+
classAttribute: "cortex-message"
|
|
10057
|
+
},
|
|
9009
10058
|
ngImport: i0,
|
|
9010
10059
|
template: `<!-- A firing's message reaches the SDK as a user turn; the envelope says what it really was. -->
|
|
9011
10060
|
@if (metadata()?.trigger; as firing) {
|
|
@@ -9019,6 +10068,7 @@ var MessageComponent = class MessageComponent2 {
|
|
|
9019
10068
|
[animate]="animate()"
|
|
9020
10069
|
[isStreaming]="isStreaming()"
|
|
9021
10070
|
[fold]="fold()"
|
|
10071
|
+
[frontier]="frontier()"
|
|
9022
10072
|
(openRun)="openRun.emit($event)"
|
|
9023
10073
|
/>
|
|
9024
10074
|
}
|
|
@@ -9034,7 +10084,8 @@ var MessageComponent = class MessageComponent2 {
|
|
|
9034
10084
|
"debugMode",
|
|
9035
10085
|
"animate",
|
|
9036
10086
|
"isStreaming",
|
|
9037
|
-
"fold"
|
|
10087
|
+
"fold",
|
|
10088
|
+
"frontier"
|
|
9038
10089
|
],
|
|
9039
10090
|
outputs: ["openRun"]
|
|
9040
10091
|
}, {
|
|
@@ -9059,7 +10110,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9059
10110
|
changeDetection: ChangeDetectionStrategy2.OnPush,
|
|
9060
10111
|
encapsulation: ViewEncapsulation2.None,
|
|
9061
10112
|
imports: [MessageBodyComponent, TriggerBlockComponent],
|
|
9062
|
-
host: {
|
|
10113
|
+
host: {
|
|
10114
|
+
class: "cortex-message",
|
|
10115
|
+
"[class.cortex-message--working-turn]": "workingTurn()"
|
|
10116
|
+
},
|
|
9063
10117
|
template: `<!-- A firing's message reaches the SDK as a user turn; the envelope says what it really was. -->
|
|
9064
10118
|
@if (metadata()?.trigger; as firing) {
|
|
9065
10119
|
<cortex-trigger-block [firing]="firing" [debugMode]="debugMode()" />
|
|
@@ -9072,6 +10126,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9072
10126
|
[animate]="animate()"
|
|
9073
10127
|
[isStreaming]="isStreaming()"
|
|
9074
10128
|
[fold]="fold()"
|
|
10129
|
+
[frontier]="frontier()"
|
|
9075
10130
|
(openRun)="openRun.emit($event)"
|
|
9076
10131
|
/>
|
|
9077
10132
|
}
|
|
@@ -9111,6 +10166,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9111
10166
|
required: false
|
|
9112
10167
|
}]
|
|
9113
10168
|
}],
|
|
10169
|
+
workingTurn: [{
|
|
10170
|
+
type: i0.Input,
|
|
10171
|
+
args: [{
|
|
10172
|
+
isSignal: true,
|
|
10173
|
+
alias: "workingTurn",
|
|
10174
|
+
required: false
|
|
10175
|
+
}]
|
|
10176
|
+
}],
|
|
10177
|
+
frontier: [{
|
|
10178
|
+
type: i0.Input,
|
|
10179
|
+
args: [{
|
|
10180
|
+
isSignal: true,
|
|
10181
|
+
alias: "frontier",
|
|
10182
|
+
required: false
|
|
10183
|
+
}]
|
|
10184
|
+
}],
|
|
9114
10185
|
openRun: [{
|
|
9115
10186
|
type: i0.Output,
|
|
9116
10187
|
args: ["openRun"]
|
|
@@ -9121,6 +10192,10 @@ var MessageListComponent = class MessageListComponent2 {
|
|
|
9121
10192
|
debugMode = input(false, ...ngDevMode ? [{ debugName: "debugMode" }] : []);
|
|
9122
10193
|
messagesContainer = viewChild("messagesContainer", ...ngDevMode ? [{ debugName: "messagesContainer" }] : []);
|
|
9123
10194
|
messagesContent = viewChild("messagesContent", ...ngDevMode ? [{ debugName: "messagesContent" }] : []);
|
|
10195
|
+
avatar = viewChild("avatar", ...ngDevMode ? [{ debugName: "avatar" }] : []);
|
|
10196
|
+
avatarController = signal(undefined, ...ngDevMode ? [{ debugName: "avatarController" }] : []);
|
|
10197
|
+
injector = inject(Injector);
|
|
10198
|
+
landedMessageId = undefined;
|
|
9124
10199
|
shouldScrollToBottom = true;
|
|
9125
10200
|
isNearBottom = true;
|
|
9126
10201
|
resizeObserver = undefined;
|
|
@@ -9130,24 +10205,45 @@ var MessageListComponent = class MessageListComponent2 {
|
|
|
9130
10205
|
config = inject(CORTEX_CONFIG);
|
|
9131
10206
|
openedRuns = signal(/* @__PURE__ */ new Set, ...ngDevMode ? [{ debugName: "openedRuns" }] : []);
|
|
9132
10207
|
fold = toolCallFolder();
|
|
9133
|
-
|
|
10208
|
+
foldable = computed(() => {
|
|
9134
10209
|
const customTools = this.config().toolComponents;
|
|
9135
|
-
return
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
10210
|
+
return (part) => drawsAsLine(part, customTools);
|
|
10211
|
+
}, ...ngDevMode ? [{ debugName: "foldable" }] : []);
|
|
10212
|
+
folds = computed(() => this.fold(this.chatService.messages(), {
|
|
10213
|
+
agentWorking: this.chatService.isAgentWorking(),
|
|
10214
|
+
debugMode: this.debugMode(),
|
|
10215
|
+
opened: this.openedRuns(),
|
|
10216
|
+
foldable: this.foldable()
|
|
10217
|
+
}), ...ngDevMode ? [{ debugName: "folds" }] : []);
|
|
10218
|
+
turnStart = computed(() => this.chatService.messages().map((message) => message.role).lastIndexOf("user"), ...ngDevMode ? [{ debugName: "turnStart" }] : []);
|
|
10219
|
+
workingTurn = computed(() => this.chatService.isAgentWorking() && !this.debugMode(), ...ngDevMode ? [{ debugName: "workingTurn" }] : []);
|
|
10220
|
+
frontier = computed(() => this.workingTurn() ? workingFrontier(this.chatService.messages(), { foldable: this.foldable() }) : undefined, ...ngDevMode ? [{ debugName: "frontier" }] : []);
|
|
10221
|
+
frontierMessageId = computed(() => this.frontier() ? streamingMessage(this.chatService.messages())?.id : undefined, ...ngDevMode ? [{ debugName: "frontierMessageId" }] : []);
|
|
10222
|
+
avatarKey = computed(() => [this.chatService.selectedThread()?.id], ...ngDevMode ? [{ debugName: "avatarKey" }] : []);
|
|
9142
10223
|
openRun(runId) {
|
|
9143
10224
|
this.openedRuns.update((opened) => new Set(opened).add(runId));
|
|
9144
10225
|
}
|
|
9145
10226
|
constructor() {
|
|
9146
10227
|
const destroyRef = inject(DestroyRef);
|
|
9147
10228
|
effect(() => {
|
|
9148
|
-
this.chatService.messages();
|
|
10229
|
+
const messages = this.chatService.messages();
|
|
9149
10230
|
if (this.shouldScrollToBottom)
|
|
9150
10231
|
this.scheduleScrollToBottom();
|
|
10232
|
+
this.landNewSend(messages.at(-1));
|
|
10233
|
+
});
|
|
10234
|
+
effect((onCleanup) => {
|
|
10235
|
+
const avatar = this.avatar()?.nativeElement;
|
|
10236
|
+
if (!avatar)
|
|
10237
|
+
return;
|
|
10238
|
+
const controller = createWorkingAvatar(avatar);
|
|
10239
|
+
this.avatarController.set(controller);
|
|
10240
|
+
onCleanup(() => controller.dispose());
|
|
10241
|
+
});
|
|
10242
|
+
afterRenderEffect(() => {
|
|
10243
|
+
const working = this.chatService.isAgentWorking();
|
|
10244
|
+
this.chatService.messages();
|
|
10245
|
+
this.frontier();
|
|
10246
|
+
this.avatarController()?.sync(working);
|
|
9151
10247
|
});
|
|
9152
10248
|
this.chatService.events$.pipe(takeUntilDestroyed(destroyRef)).subscribe((event) => {
|
|
9153
10249
|
if (event === "onThreadSelected") {
|
|
@@ -9167,17 +10263,30 @@ var MessageListComponent = class MessageListComponent2 {
|
|
|
9167
10263
|
this.scheduleScrollToBottom();
|
|
9168
10264
|
queueMicrotask(() => this.animateNewParts.set(true));
|
|
9169
10265
|
}
|
|
10266
|
+
landNewSend(message) {
|
|
10267
|
+
if (message?.role !== "user" || message.id === this.landedMessageId)
|
|
10268
|
+
return;
|
|
10269
|
+
this.landedMessageId = message.id;
|
|
10270
|
+
const text = message.parts.find((part) => part.type === "text")?.content;
|
|
10271
|
+
if (text === undefined)
|
|
10272
|
+
return;
|
|
10273
|
+
afterNextRender(() => {
|
|
10274
|
+
const content = this.messagesContent()?.nativeElement;
|
|
10275
|
+
if (content)
|
|
10276
|
+
landSentMessage(content, text);
|
|
10277
|
+
}, { injector: this.injector });
|
|
10278
|
+
}
|
|
9170
10279
|
onScroll() {
|
|
9171
10280
|
const el = this.messagesContainer()?.nativeElement;
|
|
9172
10281
|
if (!el)
|
|
9173
10282
|
return;
|
|
9174
|
-
this.isNearBottom = el
|
|
10283
|
+
this.isNearBottom = distanceToEnd(el) < 100;
|
|
9175
10284
|
}
|
|
9176
10285
|
scrollToBottom() {
|
|
9177
10286
|
const el = this.messagesContainer()?.nativeElement;
|
|
9178
10287
|
if (!el)
|
|
9179
10288
|
return false;
|
|
9180
|
-
el
|
|
10289
|
+
scrollToEnd(el);
|
|
9181
10290
|
this.isNearBottom = true;
|
|
9182
10291
|
return true;
|
|
9183
10292
|
}
|
|
@@ -9226,32 +10335,67 @@ var MessageListComponent = class MessageListComponent2 {
|
|
|
9226
10335
|
isRequired: false,
|
|
9227
10336
|
transformFunction: null
|
|
9228
10337
|
} },
|
|
9229
|
-
viewQueries: [
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
10338
|
+
viewQueries: [
|
|
10339
|
+
{
|
|
10340
|
+
propertyName: "messagesContainer",
|
|
10341
|
+
first: true,
|
|
10342
|
+
predicate: ["messagesContainer"],
|
|
10343
|
+
descendants: true,
|
|
10344
|
+
isSignal: true
|
|
10345
|
+
},
|
|
10346
|
+
{
|
|
10347
|
+
propertyName: "messagesContent",
|
|
10348
|
+
first: true,
|
|
10349
|
+
predicate: ["messagesContent"],
|
|
10350
|
+
descendants: true,
|
|
10351
|
+
isSignal: true
|
|
10352
|
+
},
|
|
10353
|
+
{
|
|
10354
|
+
propertyName: "avatar",
|
|
10355
|
+
first: true,
|
|
10356
|
+
predicate: ["avatar"],
|
|
10357
|
+
descendants: true,
|
|
10358
|
+
isSignal: true
|
|
10359
|
+
}
|
|
10360
|
+
],
|
|
9242
10361
|
ngImport: i0,
|
|
9243
10362
|
template: `<div class="cortex-message-list" #messagesContainer (scroll)="onScroll()">
|
|
9244
10363
|
<!-- The observed element: its height is the content's, free of the scroller's padding. -->
|
|
9245
10364
|
<div class="cortex-message-list__content" #messagesContent>
|
|
9246
|
-
@for (message of chatService.messages(); track message.id) {
|
|
10365
|
+
@for (message of chatService.messages(); track message.id; let index = $index) {
|
|
9247
10366
|
<cortex-message
|
|
9248
10367
|
[message]="message"
|
|
9249
10368
|
[debugMode]="debugMode()"
|
|
9250
10369
|
[animate]="animateNewParts()"
|
|
9251
10370
|
[fold]="folds().get(message.id)"
|
|
10371
|
+
[workingTurn]="workingTurn() && index > turnStart()"
|
|
10372
|
+
[frontier]="message.id === frontierMessageId() ? frontier() : undefined"
|
|
9252
10373
|
(openRun)="openRun($event)"
|
|
9253
10374
|
/>
|
|
9254
10375
|
}
|
|
10376
|
+
@if (chatService.isAgentWorking() && !frontier()) {
|
|
10377
|
+
<div class="cortex-working-thinking" data-cortex-frontier>
|
|
10378
|
+
<cortex-subtle-activity activity="reasoning" />
|
|
10379
|
+
</div>
|
|
10380
|
+
}
|
|
10381
|
+
@for (key of avatarKey(); track key) {
|
|
10382
|
+
<div #avatar class="cortex-working-avatar" aria-hidden="true">
|
|
10383
|
+
<svg
|
|
10384
|
+
viewBox="0 0 24 24"
|
|
10385
|
+
fill="none"
|
|
10386
|
+
stroke="currentColor"
|
|
10387
|
+
stroke-width="2"
|
|
10388
|
+
stroke-linecap="round"
|
|
10389
|
+
stroke-linejoin="round"
|
|
10390
|
+
>
|
|
10391
|
+
<path
|
|
10392
|
+
d="M9.94 15.5a2 2 0 0 0-1.44-1.44l-6.13-1.58a.5.5 0 0 1 0-.96L8.5 9.94A2 2 0 0 0 9.94 8.5l1.58-6.14a.5.5 0 0 1 .96 0l1.58 6.14a2 2 0 0 0 1.44 1.44l6.14 1.58a.5.5 0 0 1 0 .96l-6.14 1.58a2 2 0 0 0-1.44 1.44l-1.58 6.14a.5.5 0 0 1-.96 0z"
|
|
10393
|
+
/>
|
|
10394
|
+
<path d="M20 3v4M22 5h-4M4 17v2M5 18H3" />
|
|
10395
|
+
</svg>
|
|
10396
|
+
<span class="cortex-working-avatar__ring"></span>
|
|
10397
|
+
</div>
|
|
10398
|
+
}
|
|
9255
10399
|
</div>
|
|
9256
10400
|
</div>
|
|
9257
10401
|
`,
|
|
@@ -9263,9 +10407,16 @@ var MessageListComponent = class MessageListComponent2 {
|
|
|
9263
10407
|
"message",
|
|
9264
10408
|
"debugMode",
|
|
9265
10409
|
"animate",
|
|
9266
|
-
"fold"
|
|
10410
|
+
"fold",
|
|
10411
|
+
"workingTurn",
|
|
10412
|
+
"frontier"
|
|
9267
10413
|
],
|
|
9268
10414
|
outputs: ["openRun"]
|
|
10415
|
+
}, {
|
|
10416
|
+
kind: "component",
|
|
10417
|
+
type: SubtleActivityComponent,
|
|
10418
|
+
selector: "cortex-subtle-activity",
|
|
10419
|
+
inputs: ["activity"]
|
|
9269
10420
|
}],
|
|
9270
10421
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
9271
10422
|
encapsulation: i0.ViewEncapsulation.None
|
|
@@ -9282,19 +10433,44 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9282
10433
|
selector: "cortex-message-list",
|
|
9283
10434
|
changeDetection: ChangeDetectionStrategy2.OnPush,
|
|
9284
10435
|
encapsulation: ViewEncapsulation2.None,
|
|
9285
|
-
imports: [MessageComponent],
|
|
10436
|
+
imports: [MessageComponent, SubtleActivityComponent],
|
|
9286
10437
|
template: `<div class="cortex-message-list" #messagesContainer (scroll)="onScroll()">
|
|
9287
10438
|
<!-- The observed element: its height is the content's, free of the scroller's padding. -->
|
|
9288
10439
|
<div class="cortex-message-list__content" #messagesContent>
|
|
9289
|
-
@for (message of chatService.messages(); track message.id) {
|
|
10440
|
+
@for (message of chatService.messages(); track message.id; let index = $index) {
|
|
9290
10441
|
<cortex-message
|
|
9291
10442
|
[message]="message"
|
|
9292
10443
|
[debugMode]="debugMode()"
|
|
9293
10444
|
[animate]="animateNewParts()"
|
|
9294
10445
|
[fold]="folds().get(message.id)"
|
|
10446
|
+
[workingTurn]="workingTurn() && index > turnStart()"
|
|
10447
|
+
[frontier]="message.id === frontierMessageId() ? frontier() : undefined"
|
|
9295
10448
|
(openRun)="openRun($event)"
|
|
9296
10449
|
/>
|
|
9297
10450
|
}
|
|
10451
|
+
@if (chatService.isAgentWorking() && !frontier()) {
|
|
10452
|
+
<div class="cortex-working-thinking" data-cortex-frontier>
|
|
10453
|
+
<cortex-subtle-activity activity="reasoning" />
|
|
10454
|
+
</div>
|
|
10455
|
+
}
|
|
10456
|
+
@for (key of avatarKey(); track key) {
|
|
10457
|
+
<div #avatar class="cortex-working-avatar" aria-hidden="true">
|
|
10458
|
+
<svg
|
|
10459
|
+
viewBox="0 0 24 24"
|
|
10460
|
+
fill="none"
|
|
10461
|
+
stroke="currentColor"
|
|
10462
|
+
stroke-width="2"
|
|
10463
|
+
stroke-linecap="round"
|
|
10464
|
+
stroke-linejoin="round"
|
|
10465
|
+
>
|
|
10466
|
+
<path
|
|
10467
|
+
d="M9.94 15.5a2 2 0 0 0-1.44-1.44l-6.13-1.58a.5.5 0 0 1 0-.96L8.5 9.94A2 2 0 0 0 9.94 8.5l1.58-6.14a.5.5 0 0 1 .96 0l1.58 6.14a2 2 0 0 0 1.44 1.44l6.14 1.58a.5.5 0 0 1 0 .96l-6.14 1.58a2 2 0 0 0-1.44 1.44l-1.58 6.14a.5.5 0 0 1-.96 0z"
|
|
10468
|
+
/>
|
|
10469
|
+
<path d="M20 3v4M22 5h-4M4 17v2M5 18H3" />
|
|
10470
|
+
</svg>
|
|
10471
|
+
<span class="cortex-working-avatar__ring"></span>
|
|
10472
|
+
</div>
|
|
10473
|
+
}
|
|
9298
10474
|
</div>
|
|
9299
10475
|
</div>
|
|
9300
10476
|
`
|
|
@@ -9317,6 +10493,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9317
10493
|
messagesContent: [{
|
|
9318
10494
|
type: i0.ViewChild,
|
|
9319
10495
|
args: ["messagesContent", { isSignal: true }]
|
|
10496
|
+
}],
|
|
10497
|
+
avatar: [{
|
|
10498
|
+
type: i0.ViewChild,
|
|
10499
|
+
args: ["avatar", { isSignal: true }]
|
|
9320
10500
|
}]
|
|
9321
10501
|
}
|
|
9322
10502
|
});
|
|
@@ -9399,6 +10579,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9399
10579
|
}]
|
|
9400
10580
|
});
|
|
9401
10581
|
var ThreadListComponent = class ThreadListComponent2 {
|
|
10582
|
+
showHeader = input(true, ...ngDevMode ? [{ debugName: "showHeader" }] : []);
|
|
9402
10583
|
threadSelected = output();
|
|
9403
10584
|
newChatRequested = output();
|
|
9404
10585
|
backRequested = output();
|
|
@@ -9429,6 +10610,13 @@ var ThreadListComponent = class ThreadListComponent2 {
|
|
|
9429
10610
|
type: ThreadListComponent2,
|
|
9430
10611
|
isStandalone: true,
|
|
9431
10612
|
selector: "cortex-thread-list",
|
|
10613
|
+
inputs: { showHeader: {
|
|
10614
|
+
classPropertyName: "showHeader",
|
|
10615
|
+
publicName: "showHeader",
|
|
10616
|
+
isSignal: true,
|
|
10617
|
+
isRequired: false,
|
|
10618
|
+
transformFunction: null
|
|
10619
|
+
} },
|
|
9432
10620
|
outputs: {
|
|
9433
10621
|
threadSelected: "threadSelected",
|
|
9434
10622
|
newChatRequested: "newChatRequested",
|
|
@@ -9438,47 +10626,56 @@ var ThreadListComponent = class ThreadListComponent2 {
|
|
|
9438
10626
|
template: `@let threads = threadService.threads();
|
|
9439
10627
|
@let threadCount = threads?.length ?? 0;
|
|
9440
10628
|
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
(
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
height="14"
|
|
9452
|
-
viewBox="0 0 16 16"
|
|
9453
|
-
fill="none"
|
|
9454
|
-
aria-hidden="true"
|
|
9455
|
-
class="cortex-widget__back-icon"
|
|
10629
|
+
<!-- A host's own header arrives projected; the default stands in when there is none. -->
|
|
10630
|
+
<ng-content />
|
|
10631
|
+
@if (showHeader()) {
|
|
10632
|
+
<div class="cortex-widget__threads-header">
|
|
10633
|
+
<!-- Back to chat (helper mode; full mode hides it, the sidebar is always visible) -->
|
|
10634
|
+
<button
|
|
10635
|
+
type="button"
|
|
10636
|
+
(click)="backRequested.emit()"
|
|
10637
|
+
[attr.aria-label]="'translate_back' | translate"
|
|
10638
|
+
class="cortex-widget__header-btn cortex-widget__back-btn"
|
|
9456
10639
|
>
|
|
9457
|
-
<
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
10640
|
+
<svg
|
|
10641
|
+
width="14"
|
|
10642
|
+
height="14"
|
|
10643
|
+
viewBox="0 0 16 16"
|
|
10644
|
+
fill="none"
|
|
10645
|
+
aria-hidden="true"
|
|
10646
|
+
class="cortex-widget__back-icon"
|
|
10647
|
+
>
|
|
10648
|
+
<path
|
|
10649
|
+
d="M10 3L5 8l5 5"
|
|
10650
|
+
stroke="currentColor"
|
|
10651
|
+
stroke-width="1.5"
|
|
10652
|
+
stroke-linecap="round"
|
|
10653
|
+
stroke-linejoin="round"
|
|
10654
|
+
/>
|
|
10655
|
+
</svg>
|
|
10656
|
+
</button>
|
|
9466
10657
|
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
10658
|
+
<div>
|
|
10659
|
+
<h2 class="cortex-widget__threads-title">
|
|
10660
|
+
{{ 'translate_history' | translate }}
|
|
10661
|
+
</h2>
|
|
10662
|
+
<p class="cortex-widget__threads-count">
|
|
10663
|
+
{{ countKey(threadCount) | translate: { count: threadCount } }}
|
|
10664
|
+
</p>
|
|
10665
|
+
</div>
|
|
10666
|
+
<button
|
|
10667
|
+
type="button"
|
|
10668
|
+
(click)="newChatRequested.emit()"
|
|
10669
|
+
[attr.aria-label]="'translate_new_chat' | translate"
|
|
10670
|
+
[title]="'translate_new_chat' | translate"
|
|
10671
|
+
class="cortex-widget__header-btn cortex-widget__new-btn"
|
|
10672
|
+
>
|
|
10673
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
10674
|
+
<path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
10675
|
+
</svg>
|
|
10676
|
+
</button>
|
|
9474
10677
|
</div>
|
|
9475
|
-
|
|
9476
|
-
<svg width="12" height="12" viewBox="0 0 16 16" fill="none">
|
|
9477
|
-
<path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
9478
|
-
</svg>
|
|
9479
|
-
{{ 'translate_new' | translate }}
|
|
9480
|
-
</button>
|
|
9481
|
-
</div>
|
|
10678
|
+
}
|
|
9482
10679
|
|
|
9483
10680
|
<div class="cortex-widget__threads-list">
|
|
9484
10681
|
<!-- The loading, listed and empty states are siblings rather than an if/else
|
|
@@ -9636,47 +10833,56 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9636
10833
|
template: `@let threads = threadService.threads();
|
|
9637
10834
|
@let threadCount = threads?.length ?? 0;
|
|
9638
10835
|
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
(
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
height="14"
|
|
9650
|
-
viewBox="0 0 16 16"
|
|
9651
|
-
fill="none"
|
|
9652
|
-
aria-hidden="true"
|
|
9653
|
-
class="cortex-widget__back-icon"
|
|
10836
|
+
<!-- A host's own header arrives projected; the default stands in when there is none. -->
|
|
10837
|
+
<ng-content />
|
|
10838
|
+
@if (showHeader()) {
|
|
10839
|
+
<div class="cortex-widget__threads-header">
|
|
10840
|
+
<!-- Back to chat (helper mode; full mode hides it, the sidebar is always visible) -->
|
|
10841
|
+
<button
|
|
10842
|
+
type="button"
|
|
10843
|
+
(click)="backRequested.emit()"
|
|
10844
|
+
[attr.aria-label]="'translate_back' | translate"
|
|
10845
|
+
class="cortex-widget__header-btn cortex-widget__back-btn"
|
|
9654
10846
|
>
|
|
9655
|
-
<
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
10847
|
+
<svg
|
|
10848
|
+
width="14"
|
|
10849
|
+
height="14"
|
|
10850
|
+
viewBox="0 0 16 16"
|
|
10851
|
+
fill="none"
|
|
10852
|
+
aria-hidden="true"
|
|
10853
|
+
class="cortex-widget__back-icon"
|
|
10854
|
+
>
|
|
10855
|
+
<path
|
|
10856
|
+
d="M10 3L5 8l5 5"
|
|
10857
|
+
stroke="currentColor"
|
|
10858
|
+
stroke-width="1.5"
|
|
10859
|
+
stroke-linecap="round"
|
|
10860
|
+
stroke-linejoin="round"
|
|
10861
|
+
/>
|
|
10862
|
+
</svg>
|
|
10863
|
+
</button>
|
|
9664
10864
|
|
|
9665
|
-
|
|
9666
|
-
|
|
9667
|
-
|
|
9668
|
-
|
|
9669
|
-
|
|
9670
|
-
|
|
9671
|
-
|
|
10865
|
+
<div>
|
|
10866
|
+
<h2 class="cortex-widget__threads-title">
|
|
10867
|
+
{{ 'translate_history' | translate }}
|
|
10868
|
+
</h2>
|
|
10869
|
+
<p class="cortex-widget__threads-count">
|
|
10870
|
+
{{ countKey(threadCount) | translate: { count: threadCount } }}
|
|
10871
|
+
</p>
|
|
10872
|
+
</div>
|
|
10873
|
+
<button
|
|
10874
|
+
type="button"
|
|
10875
|
+
(click)="newChatRequested.emit()"
|
|
10876
|
+
[attr.aria-label]="'translate_new_chat' | translate"
|
|
10877
|
+
[title]="'translate_new_chat' | translate"
|
|
10878
|
+
class="cortex-widget__header-btn cortex-widget__new-btn"
|
|
10879
|
+
>
|
|
10880
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
10881
|
+
<path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" />
|
|
10882
|
+
</svg>
|
|
10883
|
+
</button>
|
|
9672
10884
|
</div>
|
|
9673
|
-
|
|
9674
|
-
<svg width="12" height="12" viewBox="0 0 16 16" fill="none">
|
|
9675
|
-
<path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
|
|
9676
|
-
</svg>
|
|
9677
|
-
{{ 'translate_new' | translate }}
|
|
9678
|
-
</button>
|
|
9679
|
-
</div>
|
|
10885
|
+
}
|
|
9680
10886
|
|
|
9681
10887
|
<div class="cortex-widget__threads-list">
|
|
9682
10888
|
<!-- The loading, listed and empty states are siblings rather than an if/else
|
|
@@ -9813,6 +11019,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9813
11019
|
}]
|
|
9814
11020
|
}],
|
|
9815
11021
|
propDecorators: {
|
|
11022
|
+
showHeader: [{
|
|
11023
|
+
type: i0.Input,
|
|
11024
|
+
args: [{
|
|
11025
|
+
isSignal: true,
|
|
11026
|
+
alias: "showHeader",
|
|
11027
|
+
required: false
|
|
11028
|
+
}]
|
|
11029
|
+
}],
|
|
9816
11030
|
threadSelected: [{
|
|
9817
11031
|
type: i0.Output,
|
|
9818
11032
|
args: ["threadSelected"]
|
|
@@ -9827,6 +11041,38 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
9827
11041
|
}]
|
|
9828
11042
|
}
|
|
9829
11043
|
});
|
|
11044
|
+
var CortexHeaderDirective = class CortexHeaderDirective2 {
|
|
11045
|
+
template = inject(TemplateRef);
|
|
11046
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
11047
|
+
return true;
|
|
11048
|
+
}
|
|
11049
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
11050
|
+
minVersion: "12.0.0",
|
|
11051
|
+
version: "22.2.0",
|
|
11052
|
+
ngImport: i0,
|
|
11053
|
+
type: CortexHeaderDirective2,
|
|
11054
|
+
deps: [],
|
|
11055
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
11056
|
+
});
|
|
11057
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
11058
|
+
minVersion: "14.0.0",
|
|
11059
|
+
version: "22.2.0",
|
|
11060
|
+
type: CortexHeaderDirective2,
|
|
11061
|
+
isStandalone: true,
|
|
11062
|
+
selector: "ng-template[cortexHeader]",
|
|
11063
|
+
ngImport: i0
|
|
11064
|
+
});
|
|
11065
|
+
};
|
|
11066
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
11067
|
+
minVersion: "12.0.0",
|
|
11068
|
+
version: "22.2.0",
|
|
11069
|
+
ngImport: i0,
|
|
11070
|
+
type: CortexHeaderDirective,
|
|
11071
|
+
decorators: [{
|
|
11072
|
+
type: Directive,
|
|
11073
|
+
args: [{ selector: "ng-template[cortexHeader]" }]
|
|
11074
|
+
}]
|
|
11075
|
+
});
|
|
9830
11076
|
var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
9831
11077
|
config = input.required(...ngDevMode ? [{ debugName: "config" }] : []);
|
|
9832
11078
|
debugMode = signal(false, ...ngDevMode ? [{ debugName: "debugMode" }] : []);
|
|
@@ -9834,6 +11080,9 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
9834
11080
|
sidebarOpen = signal(false, ...ngDevMode ? [{ debugName: "sidebarOpen" }] : []);
|
|
9835
11081
|
viewMode = computed(() => this.config().viewMode ?? "helper", ...ngDevMode ? [{ debugName: "viewMode" }] : []);
|
|
9836
11082
|
composer = viewChild(ChatComposerComponent, ...ngDevMode ? [{ debugName: "composer" }] : []);
|
|
11083
|
+
customHeader = contentChild(CortexHeaderDirective, ...ngDevMode ? [{ debugName: "customHeader" }] : []);
|
|
11084
|
+
chatHeader = computed(() => this.headerContext("chat"), ...ngDevMode ? [{ debugName: "chatHeader" }] : []);
|
|
11085
|
+
threadsHeader = computed(() => this.headerContext("threads"), ...ngDevMode ? [{ debugName: "threadsHeader" }] : []);
|
|
9837
11086
|
chatService;
|
|
9838
11087
|
queue;
|
|
9839
11088
|
injector = inject(Injector);
|
|
@@ -9863,6 +11112,23 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
9863
11112
|
});
|
|
9864
11113
|
});
|
|
9865
11114
|
}
|
|
11115
|
+
headerContext(screen) {
|
|
11116
|
+
return {
|
|
11117
|
+
screen,
|
|
11118
|
+
viewMode: this.viewMode(),
|
|
11119
|
+
title: this.chatService.selectedThread()?.title ?? null,
|
|
11120
|
+
agentName: localized(this.config().agentName, this.injector.get(CORTEX_LOCALE)()),
|
|
11121
|
+
isWorking: this.chatService.isAgentWorking(),
|
|
11122
|
+
debug: {
|
|
11123
|
+
shown: Boolean(this.config().showDebugButton),
|
|
11124
|
+
on: this.debugMode()
|
|
11125
|
+
},
|
|
11126
|
+
newChat: () => this.newChat(),
|
|
11127
|
+
openHistory: () => this.openHistory(),
|
|
11128
|
+
closeHistory: () => this.closeHistory(),
|
|
11129
|
+
toggleDebug: () => this.toggleDebugMode()
|
|
11130
|
+
};
|
|
11131
|
+
}
|
|
9866
11132
|
toggleSidebar() {
|
|
9867
11133
|
this.sidebarOpen.update((v) => !v);
|
|
9868
11134
|
}
|
|
@@ -9878,10 +11144,16 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
9878
11144
|
this.sidebarOpen.set(false);
|
|
9879
11145
|
}
|
|
9880
11146
|
openHistory() {
|
|
9881
|
-
this.
|
|
11147
|
+
if (this.viewMode() === "full")
|
|
11148
|
+
this.sidebarOpen.set(true);
|
|
11149
|
+
else
|
|
11150
|
+
this.screen.set("threads");
|
|
9882
11151
|
}
|
|
9883
11152
|
closeHistory() {
|
|
9884
|
-
this.
|
|
11153
|
+
if (this.viewMode() === "full")
|
|
11154
|
+
this.sidebarOpen.set(false);
|
|
11155
|
+
else
|
|
11156
|
+
this.screen.set("chat");
|
|
9885
11157
|
}
|
|
9886
11158
|
onWidgetDragOver(event) {
|
|
9887
11159
|
event.preventDefault();
|
|
@@ -9930,6 +11202,13 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
9930
11202
|
CortexWebSocketService,
|
|
9931
11203
|
AttachmentQueueService
|
|
9932
11204
|
],
|
|
11205
|
+
queries: [{
|
|
11206
|
+
propertyName: "customHeader",
|
|
11207
|
+
first: true,
|
|
11208
|
+
predicate: CortexHeaderDirective,
|
|
11209
|
+
descendants: true,
|
|
11210
|
+
isSignal: true
|
|
11211
|
+
}],
|
|
9933
11212
|
viewQueries: [{
|
|
9934
11213
|
propertyName: "composer",
|
|
9935
11214
|
first: true,
|
|
@@ -9952,19 +11231,29 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
9952
11231
|
(threadSelected)="selectThread($event)"
|
|
9953
11232
|
(newChatRequested)="newChat()"
|
|
9954
11233
|
(backRequested)="closeHistory()"
|
|
9955
|
-
|
|
11234
|
+
[showHeader]="!customHeader()"
|
|
11235
|
+
>
|
|
11236
|
+
@if (customHeader(); as header) {
|
|
11237
|
+
<ng-container *ngTemplateOutlet="header.template; context: { $implicit: threadsHeader() }" />
|
|
11238
|
+
}
|
|
11239
|
+
</cortex-thread-list>
|
|
9956
11240
|
|
|
9957
11241
|
<div
|
|
9958
11242
|
class="cortex-widget__screen"
|
|
9959
11243
|
[class.cortex-widget__screen--active]="screen() === 'chat'"
|
|
9960
11244
|
[class.cortex-widget__screen--right]="screen() !== 'chat'"
|
|
9961
11245
|
>
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
11246
|
+
@if (customHeader(); as header) {
|
|
11247
|
+
<ng-container *ngTemplateOutlet="header.template; context: { $implicit: chatHeader() }" />
|
|
11248
|
+
} @else {
|
|
11249
|
+
<cortex-chat-header
|
|
11250
|
+
[debugMode]="debugMode()"
|
|
11251
|
+
(toggleSidebar)="toggleSidebar()"
|
|
11252
|
+
(toggleDebug)="toggleDebugMode()"
|
|
11253
|
+
(openHistory)="openHistory()"
|
|
11254
|
+
(newChat)="newChat()"
|
|
11255
|
+
/>
|
|
11256
|
+
}
|
|
9968
11257
|
|
|
9969
11258
|
<!-- Blank-chat landing; the first send creates the thread, which swaps
|
|
9970
11259
|
this for the message list. -->
|
|
@@ -9976,17 +11265,6 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
9976
11265
|
<cortex-message-list class="cortex-widget__messages" [debugMode]="debugMode()" />
|
|
9977
11266
|
}
|
|
9978
11267
|
|
|
9979
|
-
@if (chatService.isAgentWorking() && !chatService.hasPendingToolCalls()) {
|
|
9980
|
-
<div class="cortex-widget__working">
|
|
9981
|
-
<div class="cortex-widget__working-dots">
|
|
9982
|
-
<span class="cortex-working-dot"></span>
|
|
9983
|
-
<span class="cortex-working-dot"></span>
|
|
9984
|
-
<span class="cortex-working-dot"></span>
|
|
9985
|
-
</div>
|
|
9986
|
-
<span class="cortex-widget__working-text">{{ 'translate_thinking' | translate }}</span>
|
|
9987
|
-
</div>
|
|
9988
|
-
}
|
|
9989
|
-
|
|
9990
11268
|
<!-- Chat input (inside the landing on a blank chat; hidden during pending tool calls) -->
|
|
9991
11269
|
@if (
|
|
9992
11270
|
chatService.selectedThread() &&
|
|
@@ -10007,7 +11285,7 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
10007
11285
|
<div class="cortex-widget__sidebar-backdrop" (click)="closeSidebar()"></div>
|
|
10008
11286
|
</div>
|
|
10009
11287
|
`,
|
|
10010
|
-
styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-surface: light-dark(#e8edf3, #111111);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer cortex-preflight{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{background:var(--cortex-color-surface-subtle);border-bottom-right-radius:0}.cortex-widget__msg-skel-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}@keyframes cortex-working-slide-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes cortex-dot-wave{0%,60%,to{transform:translateY(0) scale(1);opacity:.45}30%{transform:translateY(-5px) scale(1.2);opacity:1}}@keyframes cortex-working-shimmer{0%{background-position:-200% center}to{background-position:200% center}}.cortex-widget__working{flex-shrink:0;padding:.5rem 1rem;display:flex;align-items:center;gap:.5rem;animation:cortex-working-slide-in .25s ease-out both}.cortex-widget__working-dots{display:flex;align-items:center;gap:4px}.cortex-working-dot{display:block;width:6px;height:6px;border-radius:9999px;background:var(--cortex-color-success);animation:cortex-dot-wave 1.4s ease-in-out infinite}.cortex-working-dot:nth-child(2){animation-delay:.15s}.cortex-working-dot:nth-child(3){animation-delay:.3s}.cortex-widget__working-text{font-size:.75rem;font-weight:500;letter-spacing:.01em;color:var(--cortex-color-success)}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}.cortex-widget__container--full .cortex-widget__chat-title{font-size:.875rem}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem 2rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem 2rem 1.25rem}.cortex-widget__container--full .cortex-widget__working{padding:.5rem 2rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}.cortex-widget__container--full .cortex-widget__working{padding:.5rem 1rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__back-btn,.cortex-widget__history-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__back-btn:hover,.cortex-widget__history-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__input-area{width:100%;max-width:26rem;padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;transition:border-color .15s,background-color .15s}.cortex-widget__input-box--disabled{background:var(--cortex-color-surface-muted)}.cortex-widget__input-box--enabled{background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface))}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea{flex:1;background:transparent;resize:none;border:0;outline:none;font-size:var(--cortex-font-size);padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed;border:0}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-border);color:var(--cortex-color-text-muted)}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-chat-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:.9375rem;font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{width:100%;text-align:start;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong)}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;width:100%;padding:1rem}.cortex-message-list__content{display:flex;flex-direction:column;gap:.5rem}.cortex-message{min-width:0}.cortex-message:empty{display:none}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:block;min-width:0}.cortex-message-part:empty{display:none}.cortex-message-part--animated{animation:cortex-part-fade-in-up .2s cubic-bezier(.34,1.56,.64,1) both}@keyframes cortex-part-fade-in-up{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--assistant{align-items:flex-start}.cortex-text-part--user{align-items:flex-end}[dir=rtl] .cortex-text-part--assistant{align-items:flex-start}[dir=rtl] .cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{max-width:80%;min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size);line-height:1.625;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}[dir=rtl] .cortex-text-bubble--assistant{border-bottom-left-radius:calc(var(--cortex-radius) * 2);border-bottom-right-radius:0}.cortex-text-bubble--user{background:var(--cortex-color-user-surface);border-color:var(--cortex-color-user-border);border-bottom-right-radius:0}[dir=rtl] .cortex-text-bubble--user{border-bottom-right-radius:calc(var(--cortex-radius) * 2);border-bottom-left-radius:0}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface);border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-media-block{margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-tool-pill--gated{border:1px solid var(--cortex-color-border);border-radius:9999px;background:var(--cortex-color-surface-subtle);padding:.3rem .75rem .3rem .65rem;gap:.6rem}.cortex-tool-pill--asking{padding-inline-end:.3rem;flex-wrap:wrap}.cortex-tool-pill__dot{width:.5rem;height:.5rem;border-radius:9999px;background:var(--cortex-color-accent)}.cortex-tool-pill--gated .cortex-tool-pill__title{color:var(--cortex-color-text-heading);white-space:normal}.cortex-tool-pill__actions{display:flex;gap:.3rem;margin-inline-start:.25rem}.cortex-tool-pill__action{border:1px solid var(--cortex-color-border-strong);border-radius:9999px;background:none;padding:4px 11px;font:inherit;font-size:12.5px;color:var(--cortex-color-text-secondary);cursor:pointer}.cortex-tool-pill__action--approve{background:var(--cortex-color-accent);border-color:var(--cortex-color-accent);color:#fff}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}\n'],
|
|
11288
|
+
styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-surface: light-dark(#e8edf3, #111111);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer cortex-preflight{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{background:var(--cortex-color-surface-subtle);border-bottom-right-radius:0}.cortex-widget__msg-skel-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}@media(min-width:769px){.cortex-widget__container--full>.cortex-widget__screen:nth-child(2) .cortex-widget__new-btn{display:none}}.cortex-widget__container--full .cortex-widget__chat-title{font-size:var(--cortex-font-size-header, .875rem)}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem 2rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem 2rem 1.25rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__header-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__header-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, var(--cortex-font-size));font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__input-area{width:100%;max-width:26rem;padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface));transition:border-color .15s,background-color .15s}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea,.cortex-widget__textarea:focus,.cortex-widget__textarea:focus-visible,.cortex-widget__textarea:disabled{background:transparent;border:0;outline:none;box-shadow:none}.cortex-widget__textarea{flex:1;resize:none;font-size:var(--cortex-font-size-message, var(--cortex-font-size));padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size-message, var(--cortex-font-size)) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-send-empty, transparent);color:var(--cortex-color-send-empty-text, var(--cortex-color-text-muted))}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, .9375rem);font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{width:100%;text-align:start;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong)}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;overflow-x:hidden;width:100%;padding:1rem}.cortex-message-list__content{position:relative;display:flex;flex-direction:column;gap:.5rem}.cortex-message-list__content--settling{animation:cortex-content-settle .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-content-settle{0%{translate:0 var(--cortex-slide)}}.cortex-widget__screen>.cortex-send-flight{position:absolute;z-index:2;margin:0;max-width:none;pointer-events:none;animation:cortex-send-fade 80ms linear both,cortex-send-fly .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-send-fade{0%{opacity:0}}@keyframes cortex-send-fly{0%{translate:var(--cortex-fly-x) var(--cortex-fly-y)}}.cortex-working-thinking{padding-inline-start:2rem;--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-working-thinking{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}.cortex-working-avatar{position:absolute;top:0;inset-inline-start:0;z-index:1;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground);translate:0 var(--cortex-avatar-y, 0);visibility:hidden;pointer-events:none}.cortex-working-avatar svg{width:.875rem;height:.875rem}.cortex-working-avatar--shown{visibility:visible;transition:translate .42s cubic-bezier(.76,0,.24,1);animation:cortex-avatar-in .7s cubic-bezier(.16,1,.3,1) both}.cortex-working-avatar--leaving{animation:cortex-avatar-out .36s cubic-bezier(.5,0,.75,0) .12s both}.cortex-working-avatar__ring{position:absolute;inset:-.25rem;border-radius:9999px;border:1.5px solid color-mix(in oklab,var(--cortex-color-accent) 18%,transparent);border-top-color:var(--cortex-color-accent);border-right-color:color-mix(in oklab,var(--cortex-color-accent) 45%,transparent)}.cortex-working-avatar--shown .cortex-working-avatar__ring{animation:cortex-tool-spin 1s linear infinite}.cortex-working-avatar--leaving .cortex-working-avatar__ring{animation:cortex-avatar-ring-out .22s ease-out both}@keyframes cortex-avatar-in{0%{opacity:0;transform:translateY(2.5rem) scale(.7)}}@keyframes cortex-avatar-out{to{opacity:0;transform:scale(.4)}}@keyframes cortex-avatar-ring-out{to{opacity:0}}.cortex-message{min-width:0;transition:margin-block-start .42s cubic-bezier(.76,0,.24,1)}.cortex-message:empty{display:none}.cortex-message:has(.cortex-message-part--folded):not(:has(.cortex-message-part:not(.cortex-message-part--folded))){margin-block-start:-.5rem;transition-delay:.6s}.cortex-text-bubble--assistant,.cortex-subtle-activity,.cortex-tool-pill,.cortex-tool-pill .cortex-tool-pill__icon{transition:translate .42s cubic-bezier(.76,0,.24,1) .16s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity,.cortex-message--working-turn .cortex-tool-pill,.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{transition-delay:0s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity{translate:2rem}[dir=rtl] .cortex-message--working-turn .cortex-text-bubble--assistant,[dir=rtl] .cortex-message--working-turn .cortex-subtle-activity{translate:-2rem}.cortex-message--working-turn .cortex-tool-pill{translate:.875rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill{translate:-.875rem}.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:-.5rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:.5rem}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;min-width:0;transition:grid-template-rows .42s cubic-bezier(.76,0,.24,1),margin-block-end .42s cubic-bezier(.76,0,.24,1),opacity .3s ease,visibility 0s,overflow 0s .42s allow-discrete}.cortex-message-part>*{min-height:0}.cortex-message-part:empty{display:none}.cortex-message-part--folded{grid-template-rows:0fr;margin-block-end:-.5rem;opacity:0;overflow:clip;visibility:hidden;transition-delay:.6s,.6s,.6s,1.02s,0s}[data-cortex-frontier] .cortex-tool-pill__spinner{visibility:hidden}[data-cortex-frontier] .cortex-subtle-activity__dots{display:none}.cortex-message-part--animated{--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-message-part--animated{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}@keyframes cortex-part-reveal{0%{opacity:0;transform:translate(var(--cortex-reveal-from));filter:blur(5px);-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-start) 0;mask-position:var(--cortex-reveal-start) 0}40%{opacity:1}to{transform:none;filter:none;-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-end) 0;mask-position:var(--cortex-reveal-end) 0}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--assistant{align-items:flex-start}.cortex-text-part--user{align-items:flex-end}[dir=rtl] .cortex-text-part--assistant{align-items:flex-start}[dir=rtl] .cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{max-width:80%;min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size-message, var(--cortex-font-size));line-height:1.625;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}[dir=rtl] .cortex-text-bubble--assistant{border-bottom-left-radius:calc(var(--cortex-radius) * 2);border-bottom-right-radius:0}.cortex-text-bubble--user{background:var(--cortex-color-user-surface);border-color:var(--cortex-color-user-border);border-bottom-right-radius:0}[dir=rtl] .cortex-text-bubble--user{border-bottom-right-radius:calc(var(--cortex-radius) * 2);border-bottom-left-radius:0}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface);border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-media-block{margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block{display:block;margin:.5em 0 .75em}.cortex-table-block th{white-space:nowrap}.cortex-table-block td{max-width:20rem}.cortex-table-block table{margin:0}.cortex-table-block__actions{display:flex;justify-content:flex-end;gap:.125rem;min-height:1.75rem;margin-bottom:.25rem;opacity:0;transition:opacity .15s}.cortex-table-block:hover .cortex-table-block__actions,.cortex-table-block:focus-within .cortex-table-block__actions{opacity:1}@media(hover:none){.cortex-table-block__actions{opacity:1}}.cortex-table-block__action{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;width:1.75rem;height:1.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block__action:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-table-block__dialog{width:min(72rem,100vw - 2rem);max-width:none;max-height:calc(100vh - 2rem);margin:auto;padding:0;border:1px solid var(--cortex-color-border);border-radius:calc(var(--cortex-radius) * 1.5);background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 20px 50px #0003}.cortex-table-block__dialog[open]{display:flex;flex-direction:column}.cortex-table-block__dialog::backdrop{background:#0006}.cortex-table-block__dialog-head{display:flex;justify-content:flex-end;gap:.125rem;padding:.375rem;border-bottom:1px solid var(--cortex-color-border)}.cortex-table-block__dialog-body{overflow:auto;padding:0 1rem}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-approval-card{display:block;max-width:min(100%,28rem);margin:.25rem 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-approval-card--asking{border-color:color-mix(in oklab,var(--cortex-color-accent) 45%,var(--cortex-color-border));box-shadow:0 0 0 3px color-mix(in oklab,var(--cortex-color-accent) 10%,transparent)}.cortex-approval-card__head{display:flex;align-items:center;gap:.5rem;padding:.625rem .75rem 0;font-size:.75rem;font-weight:600;color:var(--cortex-color-accent)}.cortex-approval-card__sentence{margin:0;padding:.375rem .75rem .5rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-approval-card__sentence--full{padding-top:0;font-weight:400;color:var(--cortex-color-text-strong)}.cortex-approval-card__rows{display:grid;grid-template-columns:fit-content(40%) minmax(0,1fr);gap:.1875rem .75rem;margin:0;padding:0 .75rem .75rem;font-size:.78125rem}.cortex-approval-card__rows dt{color:var(--cortex-color-text-secondary);overflow-wrap:anywhere}.cortex-approval-card__rows dd{max-height:6rem;margin:0;overflow-y:auto;white-space:pre-wrap;color:var(--cortex-color-text-strong);overflow-wrap:anywhere}.cortex-approval-card__foot{display:flex;gap:.5rem;padding:.625rem .75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-approval-card__button{border:1px solid var(--cortex-color-border-strong);border-radius:calc(var(--cortex-radius) * .75);background:var(--cortex-color-surface);padding:.375rem .875rem;font:inherit;font-size:.8125rem;font-weight:500;color:var(--cortex-color-text-strong);cursor:pointer}.cortex-approval-card__button--approve{border-color:var(--cortex-color-accent);background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground)}.cortex-approval-card__line{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.8125rem;color:var(--cortex-color-text-secondary)}.cortex-approval-card__line .cortex-tool-pill__icon{flex-shrink:0}.cortex-approval-card__decision{font-weight:600;color:var(--cortex-color-text-strong)}.cortex-approval-card__summary{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-approval-card__details{flex-shrink:0;border:0;background:none;padding:0;font:inherit;font-size:.75rem;color:var(--cortex-color-text-secondary);text-decoration:underline;text-underline-offset:2px;cursor:pointer}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}}\n'],
|
|
10011
11289
|
dependencies: [
|
|
10012
11290
|
{
|
|
10013
11291
|
kind: "component",
|
|
@@ -10022,7 +11300,8 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
10022
11300
|
outputs: [
|
|
10023
11301
|
"toggleSidebar",
|
|
10024
11302
|
"toggleDebug",
|
|
10025
|
-
"openHistory"
|
|
11303
|
+
"openHistory",
|
|
11304
|
+
"newChat"
|
|
10026
11305
|
]
|
|
10027
11306
|
},
|
|
10028
11307
|
{
|
|
@@ -10042,10 +11321,21 @@ var CortexChatWidgetComponent = class CortexChatWidgetComponent2 {
|
|
|
10042
11321
|
type: MessagesSkeletonComponent,
|
|
10043
11322
|
selector: "cortex-messages-skeleton"
|
|
10044
11323
|
},
|
|
11324
|
+
{
|
|
11325
|
+
kind: "directive",
|
|
11326
|
+
type: NgTemplateOutlet,
|
|
11327
|
+
selector: "[ngTemplateOutlet]",
|
|
11328
|
+
inputs: [
|
|
11329
|
+
"ngTemplateOutletContext",
|
|
11330
|
+
"ngTemplateOutlet",
|
|
11331
|
+
"ngTemplateOutletInjector"
|
|
11332
|
+
]
|
|
11333
|
+
},
|
|
10045
11334
|
{
|
|
10046
11335
|
kind: "component",
|
|
10047
11336
|
type: ThreadListComponent,
|
|
10048
11337
|
selector: "cortex-thread-list",
|
|
11338
|
+
inputs: ["showHeader"],
|
|
10049
11339
|
outputs: [
|
|
10050
11340
|
"threadSelected",
|
|
10051
11341
|
"newChatRequested",
|
|
@@ -10077,6 +11367,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10077
11367
|
ChatLandingComponent,
|
|
10078
11368
|
MessageListComponent,
|
|
10079
11369
|
MessagesSkeletonComponent,
|
|
11370
|
+
NgTemplateOutlet,
|
|
10080
11371
|
ThreadListComponent,
|
|
10081
11372
|
TranslatePipe
|
|
10082
11373
|
],
|
|
@@ -10111,19 +11402,29 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10111
11402
|
(threadSelected)="selectThread($event)"
|
|
10112
11403
|
(newChatRequested)="newChat()"
|
|
10113
11404
|
(backRequested)="closeHistory()"
|
|
10114
|
-
|
|
11405
|
+
[showHeader]="!customHeader()"
|
|
11406
|
+
>
|
|
11407
|
+
@if (customHeader(); as header) {
|
|
11408
|
+
<ng-container *ngTemplateOutlet="header.template; context: { $implicit: threadsHeader() }" />
|
|
11409
|
+
}
|
|
11410
|
+
</cortex-thread-list>
|
|
10115
11411
|
|
|
10116
11412
|
<div
|
|
10117
11413
|
class="cortex-widget__screen"
|
|
10118
11414
|
[class.cortex-widget__screen--active]="screen() === 'chat'"
|
|
10119
11415
|
[class.cortex-widget__screen--right]="screen() !== 'chat'"
|
|
10120
11416
|
>
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
11417
|
+
@if (customHeader(); as header) {
|
|
11418
|
+
<ng-container *ngTemplateOutlet="header.template; context: { $implicit: chatHeader() }" />
|
|
11419
|
+
} @else {
|
|
11420
|
+
<cortex-chat-header
|
|
11421
|
+
[debugMode]="debugMode()"
|
|
11422
|
+
(toggleSidebar)="toggleSidebar()"
|
|
11423
|
+
(toggleDebug)="toggleDebugMode()"
|
|
11424
|
+
(openHistory)="openHistory()"
|
|
11425
|
+
(newChat)="newChat()"
|
|
11426
|
+
/>
|
|
11427
|
+
}
|
|
10127
11428
|
|
|
10128
11429
|
<!-- Blank-chat landing; the first send creates the thread, which swaps
|
|
10129
11430
|
this for the message list. -->
|
|
@@ -10135,17 +11436,6 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10135
11436
|
<cortex-message-list class="cortex-widget__messages" [debugMode]="debugMode()" />
|
|
10136
11437
|
}
|
|
10137
11438
|
|
|
10138
|
-
@if (chatService.isAgentWorking() && !chatService.hasPendingToolCalls()) {
|
|
10139
|
-
<div class="cortex-widget__working">
|
|
10140
|
-
<div class="cortex-widget__working-dots">
|
|
10141
|
-
<span class="cortex-working-dot"></span>
|
|
10142
|
-
<span class="cortex-working-dot"></span>
|
|
10143
|
-
<span class="cortex-working-dot"></span>
|
|
10144
|
-
</div>
|
|
10145
|
-
<span class="cortex-widget__working-text">{{ 'translate_thinking' | translate }}</span>
|
|
10146
|
-
</div>
|
|
10147
|
-
}
|
|
10148
|
-
|
|
10149
11439
|
<!-- Chat input (inside the landing on a blank chat; hidden during pending tool calls) -->
|
|
10150
11440
|
@if (
|
|
10151
11441
|
chatService.selectedThread() &&
|
|
@@ -10166,7 +11456,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10166
11456
|
<div class="cortex-widget__sidebar-backdrop" (click)="closeSidebar()"></div>
|
|
10167
11457
|
</div>
|
|
10168
11458
|
`,
|
|
10169
|
-
styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-surface: light-dark(#e8edf3, #111111);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer cortex-preflight{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{background:var(--cortex-color-surface-subtle);border-bottom-right-radius:0}.cortex-widget__msg-skel-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}@keyframes cortex-working-slide-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes cortex-dot-wave{0%,60%,to{transform:translateY(0) scale(1);opacity:.45}30%{transform:translateY(-5px) scale(1.2);opacity:1}}@keyframes cortex-working-shimmer{0%{background-position:-200% center}to{background-position:200% center}}.cortex-widget__working{flex-shrink:0;padding:.5rem 1rem;display:flex;align-items:center;gap:.5rem;animation:cortex-working-slide-in .25s ease-out both}.cortex-widget__working-dots{display:flex;align-items:center;gap:4px}.cortex-working-dot{display:block;width:6px;height:6px;border-radius:9999px;background:var(--cortex-color-success);animation:cortex-dot-wave 1.4s ease-in-out infinite}.cortex-working-dot:nth-child(2){animation-delay:.15s}.cortex-working-dot:nth-child(3){animation-delay:.3s}.cortex-widget__working-text{font-size:.75rem;font-weight:500;letter-spacing:.01em;color:var(--cortex-color-success)}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}.cortex-widget__container--full .cortex-widget__chat-title{font-size:.875rem}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem 2rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem 2rem 1.25rem}.cortex-widget__container--full .cortex-widget__working{padding:.5rem 2rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}.cortex-widget__container--full .cortex-widget__working{padding:.5rem 1rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__back-btn,.cortex-widget__history-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__back-btn:hover,.cortex-widget__history-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__input-area{width:100%;max-width:26rem;padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;transition:border-color .15s,background-color .15s}.cortex-widget__input-box--disabled{background:var(--cortex-color-surface-muted)}.cortex-widget__input-box--enabled{background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface))}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea{flex:1;background:transparent;resize:none;border:0;outline:none;font-size:var(--cortex-font-size);padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed;border:0}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-border);color:var(--cortex-color-text-muted)}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-chat-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:.9375rem;font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{width:100%;text-align:start;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong)}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;width:100%;padding:1rem}.cortex-message-list__content{display:flex;flex-direction:column;gap:.5rem}.cortex-message{min-width:0}.cortex-message:empty{display:none}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:block;min-width:0}.cortex-message-part:empty{display:none}.cortex-message-part--animated{animation:cortex-part-fade-in-up .2s cubic-bezier(.34,1.56,.64,1) both}@keyframes cortex-part-fade-in-up{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--assistant{align-items:flex-start}.cortex-text-part--user{align-items:flex-end}[dir=rtl] .cortex-text-part--assistant{align-items:flex-start}[dir=rtl] .cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{max-width:80%;min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size);line-height:1.625;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}[dir=rtl] .cortex-text-bubble--assistant{border-bottom-left-radius:calc(var(--cortex-radius) * 2);border-bottom-right-radius:0}.cortex-text-bubble--user{background:var(--cortex-color-user-surface);border-color:var(--cortex-color-user-border);border-bottom-right-radius:0}[dir=rtl] .cortex-text-bubble--user{border-bottom-right-radius:calc(var(--cortex-radius) * 2);border-bottom-left-radius:0}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface);border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-media-block{margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-tool-pill--gated{border:1px solid var(--cortex-color-border);border-radius:9999px;background:var(--cortex-color-surface-subtle);padding:.3rem .75rem .3rem .65rem;gap:.6rem}.cortex-tool-pill--asking{padding-inline-end:.3rem;flex-wrap:wrap}.cortex-tool-pill__dot{width:.5rem;height:.5rem;border-radius:9999px;background:var(--cortex-color-accent)}.cortex-tool-pill--gated .cortex-tool-pill__title{color:var(--cortex-color-text-heading);white-space:normal}.cortex-tool-pill__actions{display:flex;gap:.3rem;margin-inline-start:.25rem}.cortex-tool-pill__action{border:1px solid var(--cortex-color-border-strong);border-radius:9999px;background:none;padding:4px 11px;font:inherit;font-size:12.5px;color:var(--cortex-color-text-secondary);cursor:pointer}.cortex-tool-pill__action--approve{background:var(--cortex-color-accent);border-color:var(--cortex-color-accent);color:#fff}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}\n']
|
|
11459
|
+
styles: ['@charset "UTF-8";:root{--cortex-color-surface: light-dark(#ffffff, #0a0a0a);--cortex-color-surface-subtle: light-dark(#f8fafc, #141414);--cortex-color-surface-muted: light-dark(#f1f5f9, #1f1f1f);--cortex-color-border: light-dark(#e2e8f0, #2e2e2e);--cortex-color-border-strong: light-dark(#cbd5e1, #444444);--cortex-color-text-heading: light-dark(#1e293b, #fafafa);--cortex-color-text-strong: light-dark(#334155, #e5e5e5);--cortex-color-text: light-dark(#475569, #d4d4d4);--cortex-color-text-secondary: light-dark(#64748b, #a3a3a3);--cortex-color-text-muted: light-dark(#94a3b8, #737373);--cortex-color-primary: light-dark(#1e293b, #fafafa);--cortex-color-primary-foreground: light-dark(#ffffff, #0a0a0a);--cortex-color-accent: light-dark(#4f46e5, #818cf8);--cortex-color-accent-surface: light-dark(#e0e7ff, #312e81);--cortex-color-link: light-dark(#2563eb, #60a5fa);--cortex-color-hover: light-dark(rgba(0, 0, 0, .05), rgba(255, 255, 255, .06));--cortex-color-user-surface: var(--cortex-color-surface-subtle);--cortex-color-user-border: var(--cortex-color-border);--cortex-color-code-surface: light-dark(#e8edf3, #111111);--cortex-color-code-text: light-dark(#334155, #e5e5e5);--cortex-color-success: light-dark(#059669, #34d399);--cortex-color-success-surface: light-dark(#ecfdf5, #064e3b);--cortex-color-success-border: light-dark(#d1fae5, #065f46);--cortex-color-danger: light-dark(#dc2626, #f87171);--cortex-color-danger-surface: light-dark(#fef2f2, #450a0a);--cortex-color-danger-border: light-dark(#fecaca, #7f1d1d);--cortex-radius: .5rem;--cortex-font-mono: var( --default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace );--cortex-font-size: .8125rem}.cortex-widget{color-scheme:light}.cortex-widget[data-cortex-theme=dark]{color-scheme:dark}.cortex-widget[data-cortex-theme=system]{color-scheme:light dark}@layer cortex-preflight{:where(.cortex-widget),:where(.cortex-widget) *,:where(.cortex-widget) :before,:where(.cortex-widget) :after{box-sizing:border-box;margin:0;padding:0;border:0 solid}:where(.cortex-widget){tab-size:4}:where(.cortex-widget) hr{height:0;color:inherit;border-top-width:1px}:where(.cortex-widget) :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}:where(.cortex-widget) a{color:inherit;text-decoration:inherit}:where(.cortex-widget) :is(b,strong){font-weight:bolder}:where(.cortex-widget) :is(code,kbd,samp,pre){font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}:where(.cortex-widget) small{font-size:80%}:where(.cortex-widget) :is(sub,sup){font-size:75%;line-height:0;position:relative;vertical-align:baseline}:where(.cortex-widget) sub{bottom:-.25em}:where(.cortex-widget) sup{top:-.5em}:where(.cortex-widget) table{text-indent:0;border-color:inherit;border-collapse:collapse}:where(.cortex-widget) :is(ol,ul,menu){list-style:none}:where(.cortex-widget) :is(img,svg,video,canvas,audio,iframe,embed,object){display:block;vertical-align:middle}:where(.cortex-widget) :is(img,video){max-width:100%;height:auto}:where(.cortex-widget) :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(.cortex-widget) ::placeholder{opacity:1;color:color-mix(in oklab,currentcolor 50%,transparent)}:where(.cortex-widget) textarea{resize:vertical}}.cortex-widget .hljs{color:light-dark(#24292e,#c9d1d9);background:transparent}.cortex-widget .hljs-doctag,.cortex-widget .hljs-keyword,.cortex-widget .hljs-meta .hljs-keyword,.cortex-widget .hljs-template-tag,.cortex-widget .hljs-template-variable,.cortex-widget .hljs-type,.cortex-widget .hljs-variable.language_{color:light-dark(#d73a49,#ff7b72)}.cortex-widget .hljs-title,.cortex-widget .hljs-title.class_,.cortex-widget .hljs-title.class_.inherited__,.cortex-widget .hljs-title.function_{color:light-dark(#6f42c1,#d2a8ff)}.cortex-widget .hljs-attr,.cortex-widget .hljs-attribute,.cortex-widget .hljs-literal,.cortex-widget .hljs-meta,.cortex-widget .hljs-number,.cortex-widget .hljs-operator,.cortex-widget .hljs-selector-attr,.cortex-widget .hljs-selector-class,.cortex-widget .hljs-selector-id,.cortex-widget .hljs-variable{color:light-dark(#005cc5,#79c0ff)}.cortex-widget .hljs-meta .hljs-string,.cortex-widget .hljs-regexp,.cortex-widget .hljs-string{color:light-dark(#032f62,#a5d6ff)}.cortex-widget .hljs-built_in,.cortex-widget .hljs-symbol{color:light-dark(#e36209,#ffa657)}.cortex-widget .hljs-code,.cortex-widget .hljs-comment,.cortex-widget .hljs-formula{color:light-dark(#6a737d,#8b949e)}.cortex-widget .hljs-name,.cortex-widget .hljs-quote,.cortex-widget .hljs-selector-pseudo,.cortex-widget .hljs-selector-tag{color:light-dark(#22863a,#7ee787)}.cortex-widget .hljs-subst{color:light-dark(#24292e,#c9d1d9)}.cortex-widget .hljs-section{color:light-dark(#005cc5,#1f6feb);font-weight:700}.cortex-widget .hljs-bullet{color:light-dark(#735c0f,#f2cc60)}.cortex-widget .hljs-emphasis{font-style:italic}.cortex-widget .hljs-strong{font-weight:700}.cortex-widget .hljs-addition{color:light-dark(#22863a,#aff5b4);background-color:light-dark(#f0fff4,#033a16)}.cortex-widget .hljs-deletion{color:light-dark(#b31d28,#ffdcd7);background-color:light-dark(#ffeef0,#67060c)}.cortex-widget{display:block}.cortex-widget__container{width:100%;height:100%;position:relative;overflow:hidden}.cortex-widget__screen{position:absolute;inset:0;display:flex;flex-direction:column;transition:transform .3s ease-out}.cortex-widget__screen--active{transform:translate(0)}.cortex-widget__screen--left{transform:translate(-100%)}[dir=rtl] .cortex-widget__screen--left,.cortex-widget__screen--right{transform:translate(100%)}[dir=rtl] .cortex-widget__screen--right{transform:translate(-100%)}@keyframes cortex-skeleton-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}.cortex-skeleton{background:linear-gradient(90deg,var(--cortex-color-border) 0%,var(--cortex-color-surface-muted) 40%,var(--cortex-color-border) 80%);background-size:200% 100%;animation:cortex-skeleton-shimmer 1.8s ease-in-out infinite;border-radius:6px}.cortex-widget__messages-skeleton{flex:1;overflow:hidden;padding:1rem;display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel{width:100%;display:flex;flex-direction:column}.cortex-widget__msg-skel--user{align-items:flex-end}.cortex-widget__msg-skel--assistant{align-items:flex-start}.cortex-widget__msg-skel-bubble{max-width:80%;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);display:flex;flex-direction:column;gap:.5rem}.cortex-widget__msg-skel-bubble--user{background:var(--cortex-color-surface-subtle);border-bottom-right-radius:0}.cortex-widget__msg-skel-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}.cortex-widget__msg-skel-line{height:.75rem;max-width:100%}.cortex-widget__messages{flex:1;overflow:hidden}.cortex-widget__container--full{display:flex;flex-direction:row}.cortex-widget__container--full>.cortex-widget__screen{position:relative;inset:auto;transition:none}.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--active,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--left,.cortex-widget__container--full>.cortex-widget__screen.cortex-widget__screen--right{transform:none}.cortex-widget__container--full>.cortex-widget__screen:first-child{width:280px;min-width:280px;flex-shrink:0;border-right:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{border-right:0;border-left:1px solid var(--cortex-color-border)}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__back-btn,.cortex-widget__container--full .cortex-widget__history-btn{display:none}@media(min-width:769px){.cortex-widget__container--full>.cortex-widget__screen:nth-child(2) .cortex-widget__new-btn{display:none}}.cortex-widget__container--full .cortex-widget__chat-title{font-size:var(--cortex-font-size-header, .875rem)}.cortex-widget__container--full .cortex-widget__chat-header{background:var(--cortex-color-surface)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1.5rem 2rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem 2rem 1.25rem}@media(max-width:768px){.cortex-widget__container--full>.cortex-widget__screen:first-child{position:fixed;inset:0;width:280px;min-width:280px;z-index:110;transform:translate(-100%);transition:transform .28s cubic-bezier(.4,0,.2,1)}[dir=rtl] .cortex-widget__container--full>.cortex-widget__screen:first-child{transform:translate(100%);border-left:1px solid var(--cortex-color-border);border-right:0}.cortex-widget__container--full>.cortex-widget__screen:nth-child(2){flex:1;min-width:0}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-secondary)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:hover{color:var(--cortex-color-text-strong);background:var(--cortex-color-surface-muted)}.cortex-widget__container--full .cortex-widget__sidebar-toggle-btn:active{background:var(--cortex-color-border)}.cortex-widget__container--full .cortex-message-list,.cortex-widget__container--full .cortex-widget__messages-skeleton{padding:1rem}.cortex-widget__container--full .cortex-widget__input-area{padding:.75rem}}@media(max-width:768px){.cortex-widget__container--full.cortex-widget__container--sidebar-open>.cortex-widget__screen:first-child{transform:translate(0)}.cortex-widget__container--full.cortex-widget__container--sidebar-open .cortex-widget__sidebar-backdrop{display:block;position:fixed;inset:0;z-index:100;background:#0f172a59;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:cortex-sidebar-backdrop-in .2s ease-out both}}@keyframes cortex-sidebar-backdrop-in{0%{opacity:0}to{opacity:1}}.cortex-widget__chat-header{flex-shrink:0;height:3rem;padding:0 1rem;display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__header-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__header-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-surface-muted)}[dir=rtl] .cortex-widget__back-icon{transform:rotate(180deg)}.cortex-widget__chat-title-wrap{min-width:0;flex:1}.cortex-widget__chat-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, var(--cortex-font-size));font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__debug-btn{flex-shrink:0;font-size:.6875rem;font-weight:500;padding:.25rem .625rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__debug-btn--on{background:light-dark(#fef3c7,#78350f);color:light-dark(#d97706,#fbbf24)}.cortex-widget__debug-btn--on:hover{background:light-dark(#fde68a,#92400e)}.cortex-widget__debug-btn--off{background:var(--cortex-color-surface-muted);color:var(--cortex-color-text-muted)}.cortex-widget__debug-btn--off:hover{background:var(--cortex-color-border)}.cortex-widget__landing{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.25rem;text-align:center}.cortex-widget__landing .cortex-widget__input-area{width:100%;max-width:26rem;padding:1rem 0 0;border-top:0;background:transparent}.cortex-widget__landing-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent);display:flex;align-items:center;justify-content:center;margin-bottom:.875rem}[dir=rtl] .cortex-widget__landing-icon{transform:scaleX(-1)}.cortex-widget__landing-greeting{font-family:var(--cortex-font-display, inherit);font-size:1.0625rem;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading);margin:0}.cortex-widget__landing-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem;margin-top:.875rem}.cortex-widget__landing-chip{border:1px solid var(--cortex-color-border);border-radius:999px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);font-size:.75rem;font-weight:500;padding:.375rem .75rem;cursor:pointer;transition:border-color .15s,color .15s}.cortex-widget__landing-chip:hover{border-color:var(--cortex-color-accent);color:var(--cortex-color-accent)}.cortex-widget__landing-recent{width:100%;max-width:26rem;margin-top:1rem;display:flex;flex-direction:column}.cortex-widget__landing-recent-item{display:flex;align-items:center;gap:.75rem;padding:.4375rem .625rem;border:0;border-radius:calc(var(--cortex-radius) * .75);background:transparent;cursor:pointer;transition:background-color .15s}.cortex-widget__landing-recent-item:hover{background:var(--cortex-color-hover)}.cortex-widget__landing-recent-title{flex:1;min-width:0;text-align:start;font-size:var(--cortex-font-size);font-weight:500;color:var(--cortex-color-text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.cortex-widget__landing-recent-time{flex-shrink:0;font-size:.6875rem;color:var(--cortex-color-text-muted);margin:0}cortex-chat-composer,cortex-message-tool-call-outcome,cortex-llm-usage-chips{display:contents}.cortex-widget__input-area{flex-shrink:0;padding:.75rem;background:var(--cortex-color-surface);border-top:1px solid var(--cortex-color-border)}.cortex-widget__input-box{display:flex;align-items:flex-end;gap:.5rem;border-radius:calc(var(--cortex-radius) * 1.5);border:1px solid var(--cortex-color-border);padding:.375rem;background:color-mix(in oklab,var(--cortex-color-surface-subtle) 45%,var(--cortex-color-surface));transition:border-color .15s,background-color .15s}.cortex-widget__input-box--enabled:focus-within{border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface)}.cortex-widget__input-box--dragging{border-color:var(--cortex-color-text-heading);border-style:dashed;background:var(--cortex-color-surface-muted)}.cortex-widget__textarea,.cortex-widget__textarea:focus,.cortex-widget__textarea:focus-visible,.cortex-widget__textarea:disabled{background:transparent;border:0;outline:none;box-shadow:none}.cortex-widget__textarea{flex:1;resize:none;font-size:var(--cortex-font-size-message, var(--cortex-font-size));padding:.375rem .5rem;min-height:28px;max-height:calc(5.5 * var(--cortex-font-size-message, var(--cortex-font-size)) + .75rem);overflow-y:auto;line-height:1.375;color:var(--cortex-color-text-strong)}.cortex-widget__textarea::placeholder{color:var(--cortex-color-text-muted)}.cortex-widget__textarea--disabled{color:var(--cortex-color-text-muted);cursor:not-allowed}.cortex-widget__textarea:disabled{cursor:not-allowed}.cortex-widget__input-actions{flex-shrink:0;display:flex;align-items:center;gap:.375rem}@keyframes cortex-stop-pulse-ring{0%{opacity:.45;transform:scale(1)}50%{opacity:.15;transform:scale(1.12)}to{opacity:.45;transform:scale(1)}}@keyframes cortex-stop-fade-in{0%{opacity:0;transform:scale(.7)}to{opacity:1;transform:scale(1)}}.cortex-stop-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;background:var(--cortex-color-danger);color:#fff;border:0;animation:cortex-stop-fade-in .2s ease-out both;transition:background .15s ease}.cortex-stop-btn:hover{background:color-mix(in oklab,var(--cortex-color-danger) 85%,black)}.cortex-stop-btn:active{transform:scale(.92)}.cortex-stop-btn__ring{position:absolute;inset:0;border-radius:var(--cortex-radius);background:var(--cortex-color-danger);animation:cortex-stop-pulse-ring 2s ease-in-out infinite;pointer-events:none}.cortex-stop-btn__icon{position:relative;z-index:1}.cortex-widget__attach-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;color:var(--cortex-color-text-muted)}.cortex-widget__attach-btn:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-widget__file-input{display:none}.cortex-widget__send-btn{flex-shrink:0;width:2rem;height:2rem;border-radius:var(--cortex-radius);display:flex;align-items:center;justify-content:center;border:0;transition:background-color .15s;cursor:default}.cortex-widget__send-btn--empty{background:var(--cortex-color-send-empty, transparent);color:var(--cortex-color-send-empty-text, var(--cortex-color-text-muted))}.cortex-widget__send-btn--ready{background:var(--cortex-color-primary);color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-widget__send-btn--ready:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}[dir=rtl] .cortex-widget__send-icon{transform:rotate(180deg)}.cortex-widget__threads-header{flex-shrink:0;padding:1.25rem 1.25rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-widget__threads-header .cortex-widget__new-btn{margin-inline-start:auto}.cortex-widget__threads-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size-header, .9375rem);font-weight:600;color:var(--cortex-color-text-heading);letter-spacing:-.01em;margin:0}.cortex-widget__threads-count{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0}.cortex-widget__new-chat-btn{display:inline-flex;align-items:center;gap:.375rem;font-size:.75rem;font-weight:500;color:var(--cortex-color-primary-foreground);background:var(--cortex-color-primary);padding:.375rem .75rem;border-radius:calc(var(--cortex-radius) * .75);border:0;cursor:pointer;transition:background-color .15s}.cortex-widget__new-chat-btn:hover{background:color-mix(in oklab,var(--cortex-color-primary) 85%,var(--cortex-color-primary-foreground))}.cortex-widget__new-chat-btn:active{background:var(--cortex-color-primary)}.cortex-widget__new-chat-btn--empty-state{margin-top:.75rem}.cortex-widget__threads-list{flex:1;overflow-y:auto;padding:0 .75rem .75rem}.cortex-widget__thread-skeleton{display:flex;align-items:center;gap:.75rem;padding:.75rem;margin-bottom:.375rem;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface)}.cortex-widget__thread-skeleton-icon{flex-shrink:0;width:2rem;height:2rem}.cortex-widget__thread-skeleton-lines{flex:1;display:flex;flex-direction:column;gap:.375rem}.cortex-widget__thread-skeleton-line{height:.875rem}.cortex-widget__thread-item{width:100%;text-align:start;padding:.75rem;border-radius:var(--cortex-radius);display:flex;align-items:center;gap:.75rem;transition:background-color .15s,border-color .15s;cursor:pointer;margin-bottom:.375rem;border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface);color:var(--cortex-color-text)}.cortex-widget__thread-item:hover{background:var(--cortex-color-surface-muted);border-color:var(--cortex-color-border-strong)}.cortex-widget__thread-item:active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border))}.cortex-widget__thread-item--active{background:color-mix(in oklab,var(--cortex-color-surface-muted) 50%,var(--cortex-color-border));border-color:var(--cortex-color-border-strong);color:var(--cortex-color-text-heading)}.cortex-widget__thread-item--active:hover{background:var(--cortex-color-border)}.cortex-widget__thread-item--active:active{background:color-mix(in oklab,var(--cortex-color-border) 50%,var(--cortex-color-border-strong))}.cortex-widget__thread-icon{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;font-size:.6875rem;font-weight:600;background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}[dir=rtl] .cortex-widget__thread-icon{transform:scaleX(-1)}.cortex-widget__thread-icon--active{background:color-mix(in oklab,var(--cortex-color-accent-surface) 85%,var(--cortex-color-accent))}.cortex-widget__thread-info{min-width:0;flex:1}.cortex-widget__thread-title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-widget__thread-title{font-size:var(--cortex-font-size);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.25;margin:0;color:var(--cortex-color-text-strong)}.cortex-widget__thread-title--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-widget__thread-time{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.125rem;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-widget__thread-running{flex-shrink:0;display:inline-flex;align-items:center;gap:.3125rem;padding:.2rem .45rem;border-radius:999px;background:var(--cortex-color-success-surface);color:var(--cortex-color-success);font-size:.625rem;font-weight:700;letter-spacing:.02em;text-transform:uppercase}.cortex-widget__thread-running-dot{width:.375rem;height:.375rem;border-radius:999px;background:currentColor;box-shadow:0 0 .45rem currentColor;animation:cortex-thread-running-pulse 1.4s ease-in-out infinite}@keyframes cortex-thread-running-pulse{0%,to{opacity:.45;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.cortex-widget__thread-delete{flex-shrink:0;opacity:0;width:1.75rem;height:1.75rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:opacity .15s;background:transparent;border:0;color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-delete{opacity:1}.cortex-widget__thread-delete:hover{background:var(--cortex-color-border)}.cortex-widget__thread-delete--active{color:var(--cortex-color-text-secondary)}.cortex-widget__thread-delete--active:hover{color:var(--cortex-color-text)}.cortex-widget__thread-arrow{flex-shrink:0;transition:color .15s;color:var(--cortex-color-border-strong)}[dir=rtl] .cortex-widget__thread-arrow{transform:rotate(180deg)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow{color:var(--cortex-color-text-muted)}.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-muted)}.cortex-widget__thread-item:hover>.cortex-widget__thread-arrow--active{color:var(--cortex-color-text-secondary)}.cortex-widget__threads-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4rem 0;text-align:center}.cortex-widget__threads-empty-icon{width:2.5rem;height:2.5rem;border-radius:var(--cortex-radius);background:var(--cortex-color-accent-surface);display:flex;align-items:center;justify-content:center;margin-bottom:.75rem}.cortex-widget__threads-empty-svg{color:var(--cortex-color-accent)}.cortex-widget__threads-empty-title{font-family:var(--cortex-font-display, inherit);font-size:var(--cortex-font-size);color:var(--cortex-color-text-muted);font-weight:500;margin:0}.cortex-widget__threads-empty-subtitle{font-size:.6875rem;color:var(--cortex-color-text-muted);margin-top:.25rem;margin-bottom:0}.cortex-widget__sidebar-toggle-btn,.cortex-widget__sidebar-backdrop{display:none}.cortex-message-list{height:100%;overflow-y:auto;overflow-x:hidden;width:100%;padding:1rem}.cortex-message-list__content{position:relative;display:flex;flex-direction:column;gap:.5rem}.cortex-message-list__content--settling{animation:cortex-content-settle .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-content-settle{0%{translate:0 var(--cortex-slide)}}.cortex-widget__screen>.cortex-send-flight{position:absolute;z-index:2;margin:0;max-width:none;pointer-events:none;animation:cortex-send-fade 80ms linear both,cortex-send-fly .42s cubic-bezier(.76,0,.24,1) both}@keyframes cortex-send-fade{0%{opacity:0}}@keyframes cortex-send-fly{0%{translate:var(--cortex-fly-x) var(--cortex-fly-y)}}.cortex-working-thinking{padding-inline-start:2rem;--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-working-thinking{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}.cortex-working-avatar{position:absolute;top:0;inset-inline-start:0;z-index:1;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground);translate:0 var(--cortex-avatar-y, 0);visibility:hidden;pointer-events:none}.cortex-working-avatar svg{width:.875rem;height:.875rem}.cortex-working-avatar--shown{visibility:visible;transition:translate .42s cubic-bezier(.76,0,.24,1);animation:cortex-avatar-in .7s cubic-bezier(.16,1,.3,1) both}.cortex-working-avatar--leaving{animation:cortex-avatar-out .36s cubic-bezier(.5,0,.75,0) .12s both}.cortex-working-avatar__ring{position:absolute;inset:-.25rem;border-radius:9999px;border:1.5px solid color-mix(in oklab,var(--cortex-color-accent) 18%,transparent);border-top-color:var(--cortex-color-accent);border-right-color:color-mix(in oklab,var(--cortex-color-accent) 45%,transparent)}.cortex-working-avatar--shown .cortex-working-avatar__ring{animation:cortex-tool-spin 1s linear infinite}.cortex-working-avatar--leaving .cortex-working-avatar__ring{animation:cortex-avatar-ring-out .22s ease-out both}@keyframes cortex-avatar-in{0%{opacity:0;transform:translateY(2.5rem) scale(.7)}}@keyframes cortex-avatar-out{to{opacity:0;transform:scale(.4)}}@keyframes cortex-avatar-ring-out{to{opacity:0}}.cortex-message{min-width:0;transition:margin-block-start .42s cubic-bezier(.76,0,.24,1)}.cortex-message:empty{display:none}.cortex-message:has(.cortex-message-part--folded):not(:has(.cortex-message-part:not(.cortex-message-part--folded))){margin-block-start:-.5rem;transition-delay:.6s}.cortex-text-bubble--assistant,.cortex-subtle-activity,.cortex-tool-pill,.cortex-tool-pill .cortex-tool-pill__icon{transition:translate .42s cubic-bezier(.76,0,.24,1) .16s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity,.cortex-message--working-turn .cortex-tool-pill,.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{transition-delay:0s}.cortex-message--working-turn .cortex-text-bubble--assistant,.cortex-message--working-turn .cortex-subtle-activity{translate:2rem}[dir=rtl] .cortex-message--working-turn .cortex-text-bubble--assistant,[dir=rtl] .cortex-message--working-turn .cortex-subtle-activity{translate:-2rem}.cortex-message--working-turn .cortex-tool-pill{translate:.875rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill{translate:-.875rem}.cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:-.5rem}[dir=rtl] .cortex-message--working-turn .cortex-tool-pill .cortex-tool-pill__icon{translate:.5rem}.cortex-message-parts{width:100%;display:flex;flex-direction:column;gap:.5rem}.cortex-message-actions{display:flex;align-items:center;gap:.375rem;margin-top:-.25rem}.cortex-message-actions--user{justify-content:flex-end}.cortex-message-actions__time{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:0;transition:opacity .15s ease}.cortex-message-actions:not(:has(.cortex-copy-btn)) .cortex-message-actions__time{opacity:1}.cortex-message:hover .cortex-message-actions .cortex-copy-btn__button,.cortex-message:hover .cortex-message-actions .cortex-message-actions__time,.cortex-message-actions:focus-within .cortex-copy-btn__button,.cortex-message-actions:focus-within .cortex-message-actions__time{opacity:1}.cortex-message-debug-zone{display:flex;flex-direction:column;gap:.25rem;padding-top:.375rem;margin-top:.125rem;border-top:1px dashed var(--cortex-color-border)}.cortex-message-part{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;min-width:0;transition:grid-template-rows .42s cubic-bezier(.76,0,.24,1),margin-block-end .42s cubic-bezier(.76,0,.24,1),opacity .3s ease,visibility 0s,overflow 0s .42s allow-discrete}.cortex-message-part>*{min-height:0}.cortex-message-part:empty{display:none}.cortex-message-part--folded{grid-template-rows:0fr;margin-block-end:-.5rem;opacity:0;overflow:clip;visibility:hidden;transition-delay:.6s,.6s,.6s,1.02s,0s}[data-cortex-frontier] .cortex-tool-pill__spinner{visibility:hidden}[data-cortex-frontier] .cortex-subtle-activity__dots{display:none}.cortex-message-part--animated{--cortex-reveal-from: -1rem;--cortex-reveal-mask: linear-gradient(to right, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 100%;--cortex-reveal-end: 0%;animation:cortex-part-reveal .7s cubic-bezier(.22,1,.36,1) backwards}[dir=rtl] .cortex-message-part--animated{--cortex-reveal-from: 1rem;--cortex-reveal-mask: linear-gradient(to left, #000 40%, rgb(0 0 0 / .35) 60%);--cortex-reveal-start: 0%;--cortex-reveal-end: 100%}@keyframes cortex-part-reveal{0%{opacity:0;transform:translate(var(--cortex-reveal-from));filter:blur(5px);-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-start) 0;mask-position:var(--cortex-reveal-start) 0}40%{opacity:1}to{transform:none;filter:none;-webkit-mask-image:var(--cortex-reveal-mask);mask-image:var(--cortex-reveal-mask);-webkit-mask-size:300% 100%;mask-size:300% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:var(--cortex-reveal-end) 0;mask-position:var(--cortex-reveal-end) 0}}.cortex-unhandled-type{text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-text-part{width:100%;display:flex;flex-direction:column}.cortex-text-part--assistant{align-items:flex-start}.cortex-text-part--user{align-items:flex-end}[dir=rtl] .cortex-text-part--assistant{align-items:flex-start}[dir=rtl] .cortex-text-part--user{align-items:flex-end}.cortex-text-bubble{max-width:80%;min-width:0;overflow-wrap:anywhere;font-size:var(--cortex-font-size-message, var(--cortex-font-size));line-height:1.625;padding:1rem;border-radius:calc(var(--cortex-radius) * 2);border:1px solid var(--cortex-color-border);color:var(--cortex-color-text-strong)}.cortex-text-bubble--assistant{background:var(--cortex-color-surface-muted);border-bottom-left-radius:0}[dir=rtl] .cortex-text-bubble--assistant{border-bottom-left-radius:calc(var(--cortex-radius) * 2);border-bottom-right-radius:0}.cortex-text-bubble--user{background:var(--cortex-color-user-surface);border-color:var(--cortex-color-user-border);border-bottom-right-radius:0}[dir=rtl] .cortex-text-bubble--user{border-bottom-right-radius:calc(var(--cortex-radius) * 2);border-bottom-left-radius:0}.cortex-text-bubble h1,.cortex-text-bubble h2,.cortex-text-bubble h3,.cortex-text-bubble h4,.cortex-text-bubble h5,.cortex-text-bubble h6{margin-top:1.25em;margin-bottom:.5em;font-weight:600;line-height:1.3;color:var(--cortex-color-text-heading)}.cortex-text-bubble h1:first-child,.cortex-text-bubble h2:first-child,.cortex-text-bubble h3:first-child,.cortex-text-bubble h4:first-child,.cortex-text-bubble h5:first-child,.cortex-text-bubble h6:first-child{margin-top:0}.cortex-text-bubble h1{font-size:1.25em}.cortex-text-bubble h2{font-size:1.125em}.cortex-text-bubble h3{font-size:1em}.cortex-text-bubble p{margin-top:.75em;margin-bottom:.75em}.cortex-text-bubble p:first-child{margin-top:0}.cortex-text-bubble p:last-child{margin-bottom:0}.cortex-text-bubble ul,.cortex-text-bubble ol{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1.5em}.cortex-text-bubble ul{list-style-type:disc}.cortex-text-bubble ol{list-style-type:decimal}.cortex-text-bubble li{margin-top:.25em;margin-bottom:.25em}.cortex-text-bubble code{font-family:var(--cortex-font-mono);font-size:.875em;background:var(--cortex-color-border);padding:.125em .375em;border-radius:calc(var(--cortex-radius) * .5)}.cortex-text-bubble pre{margin-top:.75em;margin-bottom:.75em;padding:.75em 1em;background:var(--cortex-color-code-surface);border-radius:var(--cortex-radius);max-width:100%;overflow-x:auto;font-size:.8125em;line-height:1.6}.cortex-text-bubble pre code{background:transparent;padding:0;color:var(--cortex-color-code-text)}.cortex-text-bubble blockquote{margin-top:.75em;margin-bottom:.75em;padding-inline-start:1em;border-inline-start:3px solid var(--cortex-color-border-strong);color:var(--cortex-color-text-secondary);font-style:italic}.cortex-text-bubble a{color:var(--cortex-color-link);text-decoration:underline}.cortex-text-bubble a:hover{color:color-mix(in oklab,var(--cortex-color-link) 80%,var(--cortex-color-text-heading))}.cortex-text-bubble table{width:100%;border-collapse:collapse;margin-top:.75em;margin-bottom:.75em;font-size:.875em}.cortex-text-bubble th,.cortex-text-bubble td{border:1px solid var(--cortex-color-border);padding:.375em .75em;text-align:start}.cortex-text-bubble th{background:var(--cortex-color-surface-subtle);font-weight:600}.cortex-text-bubble hr{margin-top:1.5em;margin-bottom:1.5em;border:none;border-top:1px solid var(--cortex-color-border)}.cortex-text-bubble img{max-width:100%;height:auto;border-radius:calc(var(--cortex-radius) * .75)}.cortex-stream-fade{animation:cortex-stream-fade .3s ease-out}@keyframes cortex-stream-fade{0%{opacity:0}}.cortex-media-block{margin:.75em 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-media-block__head{display:flex}.cortex-media-block__head[hidden]{display:none}.cortex-media-block__head{align-items:center;justify-content:space-between;gap:.5rem;padding:.25rem .5rem .25rem .75rem;background:var(--cortex-color-surface-subtle);border-bottom:1px solid var(--cortex-color-border);font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-media-block__lang{font-family:var(--cortex-font-mono)}.cortex-media-block__pending{display:inline-flex;align-items:center;gap:.375rem}.cortex-media-block__pending:before{content:"";width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-media-block__actions{display:inline-flex;align-items:center;gap:.125rem}.cortex-media-block__action{background:transparent;border:0;padding:.125rem .375rem;border-radius:calc(var(--cortex-radius) * .5);font:inherit;color:inherit;cursor:pointer}.cortex-media-block__action:hover,.cortex-media-block__action[aria-pressed=true]{background:var(--cortex-color-hover);color:var(--cortex-color-text-strong)}.cortex-media-block__body{padding:.75rem}.cortex-media-block__body[hidden]{display:none}.cortex-media-block__body{min-height:6rem;overflow-x:auto}.cortex-media-block__body svg{display:block;max-width:100%;height:auto}.cortex-media-block__body--map{padding:0;height:18rem}.cortex-media-block__body--map>div{height:100%}.cortex-media-block__error{margin:0;font-size:.8125rem;color:var(--cortex-color-danger)}.cortex-media-block .cortex-media-block__source{margin:0;padding:.75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.5;white-space:pre;overflow-x:auto;color:var(--cortex-color-text)}.cortex-attachment-image{margin:.75em 0}.cortex-attachment-image img{display:block;max-width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border)}.cortex-attachment-image__caption{margin:.25rem 0 0;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block{display:block;margin:.5em 0 .75em}.cortex-table-block th{white-space:nowrap}.cortex-table-block td{max-width:20rem}.cortex-table-block table{margin:0}.cortex-table-block__actions{display:flex;justify-content:flex-end;gap:.125rem;min-height:1.75rem;margin-bottom:.25rem;opacity:0;transition:opacity .15s}.cortex-table-block:hover .cortex-table-block__actions,.cortex-table-block:focus-within .cortex-table-block__actions{opacity:1}@media(hover:none){.cortex-table-block__actions{opacity:1}}.cortex-table-block__action{flex-shrink:0;width:2rem;height:2rem;border-radius:calc(var(--cortex-radius) * .75);display:flex;align-items:center;justify-content:center;background:transparent;border:0;cursor:pointer;transition:color .15s,background-color .15s;width:1.75rem;height:1.75rem;color:var(--cortex-color-text-muted)}.cortex-table-block__action:hover{color:var(--cortex-color-text);background:var(--cortex-color-hover)}.cortex-table-block__dialog{width:min(72rem,100vw - 2rem);max-width:none;max-height:calc(100vh - 2rem);margin:auto;padding:0;border:1px solid var(--cortex-color-border);border-radius:calc(var(--cortex-radius) * 1.5);background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 20px 50px #0003}.cortex-table-block__dialog[open]{display:flex;flex-direction:column}.cortex-table-block__dialog::backdrop{background:#0006}.cortex-table-block__dialog-head{display:flex;justify-content:flex-end;gap:.125rem;padding:.375rem;border-bottom:1px solid var(--cortex-color-border)}.cortex-table-block__dialog-body{overflow:auto;padding:0 1rem}.cortex-reasoning-details{width:100%;border-radius:var(--cortex-radius);border:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-reasoning-details__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.75rem 1rem;display:flex;align-items:center;gap:.75rem}.cortex-reasoning-details__summary::-webkit-details-marker{display:none}.cortex-reasoning-details__header{display:flex;align-items:center;gap:.5rem;min-width:0;flex:1}.cortex-reasoning-details__icon{display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-accent-surface);color:var(--cortex-color-accent)}.cortex-reasoning-details__title-group{min-width:0}.cortex-reasoning-details__title-row{display:flex;align-items:center;gap:.5rem}.cortex-reasoning-details__title{font-weight:500;color:var(--cortex-color-text-strong);font-size:.875rem}.cortex-reasoning-details__badge{display:inline-flex;align-items:center;border-radius:calc(var(--cortex-radius) * .5);padding:.125rem .375rem;font-size:.6875rem;font-weight:500}.cortex-reasoning-details__badge--streaming{background:light-dark(#fef3c7,#78350f);color:light-dark(#b45309,#fcd34d)}.cortex-reasoning-details__badge--done{background:var(--cortex-color-success-border);color:var(--cortex-color-success)}.cortex-reasoning-details__chevron{margin-inline-start:auto;display:inline-flex;height:1.5rem;width:1.5rem;align-items:center;justify-content:center;border-radius:calc(var(--cortex-radius) * .5);color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary>.cortex-reasoning-details__chevron{transform:rotate(180deg)}.cortex-reasoning-details__body{padding:0 1rem 1rem}.cortex-reasoning-details__content{margin-top:.25rem;border-radius:calc(var(--cortex-radius) * .5);background:var(--cortex-color-surface);border:1px solid var(--cortex-color-border);padding:.75rem}.cortex-reasoning-details__pre{margin:0;white-space:pre-wrap;overflow-wrap:break-word;font-family:var(--cortex-font-mono);font-size:.75rem;line-height:1.625;color:var(--cortex-color-text-strong)}@keyframes cortex-aborted-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.cortex-aborted-flag{display:flex;align-items:center;gap:.625rem;padding:.25rem 0;animation:cortex-aborted-fade-in .3s ease-out both;-webkit-user-select:none;user-select:none}.cortex-aborted-flag__line{flex:1;height:1px;background:repeating-linear-gradient(90deg,#e2a36f 0px,#e2a36f 4px,transparent 4px,transparent 8px);opacity:.5}.cortex-aborted-flag__label{display:inline-flex;align-items:center;gap:.3125rem;font-family:var(--cortex-font-mono);font-size:.625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:light-dark(#c2824a,#e2a36f)}.cortex-aborted-flag__icon{color:light-dark(#c2824a,#e2a36f);flex-shrink:0}.cortex-trigger-block{display:inline-flex;width:fit-content;padding:.375rem .75rem;border-radius:999px;background:var(--cortex-color-accent-surface);color:var(--cortex-color-text-strong);font-size:.75rem}.cortex-trigger-block__head{display:flex;align-items:center;gap:.5rem}.cortex-trigger-block__icon{flex-shrink:0;color:var(--cortex-color-accent)}.cortex-trigger-block__name{font-family:var(--cortex-font-mono);font-weight:600}.cortex-trigger-block__time{color:var(--cortex-color-text-secondary);font-size:.6875rem}.cortex-trigger-block--debug{display:flex;flex-direction:column;width:auto;gap:.375rem;padding:.5rem .75rem;border:1px dashed var(--cortex-color-border-strong);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.6875rem}.cortex-trigger-block--debug .cortex-trigger-block__head{font-family:var(--cortex-font-mono);letter-spacing:.04em;text-transform:uppercase;color:var(--cortex-color-text-secondary)}.cortex-trigger-block--debug .cortex-trigger-block__name{color:var(--cortex-color-text-strong)}.cortex-trigger-block--debug .cortex-trigger-block__time{margin-inline-start:auto;font-size:inherit;text-transform:none;letter-spacing:0}.cortex-trigger-block__payload{font-size:.75rem}.cortex-trigger-block__payload>summary{cursor:pointer;color:var(--cortex-color-text-secondary);-webkit-user-select:none;user-select:none}.cortex-trigger-block__payload[open]>summary{margin-bottom:.25rem}.cortex-widget__messages-disabled{padding:.75rem 1rem;text-align:center;font-size:.75rem;color:var(--cortex-color-text-muted)}.cortex-message-attachments{display:flex;flex-wrap:wrap;gap:.375rem}.cortex-message-attachments--user{justify-content:flex-end}.cortex-message-attachment{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding:.25rem .5rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong);cursor:pointer;transition:background .15s}.cortex-message-attachment:hover{background:var(--cortex-color-surface-muted)}.cortex-message-attachment__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-message-attachment__icon,.cortex-message-attachment__dl-icon{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-debug-tool{--_accent: var(--cortex-color-border-strong);position:relative;width:100%;border-radius:10px;background:var(--cortex-color-surface-subtle);overflow:hidden}.cortex-debug-tool:before{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--_accent);z-index:1;transition:background .2s}.cortex-debug-tool[data-state=complete]{--_accent: var(--cortex-color-success)}.cortex-debug-tool[data-state=error]{--_accent: var(--cortex-color-danger)}.cortex-debug-tool[data-state=awaiting-input],.cortex-debug-tool[data-state=input-streaming],.cortex-debug-tool[data-state=input-complete]{--_accent: light-dark(#d97706, #fbbf24)}.cortex-debug-tool[data-state=approval-requested],.cortex-debug-tool[data-state=approval-responded]{--_accent: light-dark(#7c3aed, #a78bfa)}.cortex-debug-tool__summary{list-style:none;cursor:pointer;-webkit-user-select:none;user-select:none;padding:.625rem .875rem .625rem 1.125rem}.cortex-debug-tool__summary::-webkit-details-marker{display:none}.cortex-debug-tool__header{display:flex;align-items:flex-start;gap:.75rem}.cortex-debug-tool__meta{flex:1;min-width:0}.cortex-debug-tool__title-row{display:flex;align-items:center;gap:.5rem;min-width:0}.cortex-debug-tool__name{font-weight:600;font-size:.8125rem;color:var(--cortex-color-text-heading);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:-.01em}.cortex-debug-tool__id-row{margin-top:2px;font-size:.625rem;color:var(--cortex-color-text-muted);font-family:ui-monospace,SF Mono,Cascadia Code,monospace;word-break:break-all}.cortex-debug-tool__actions{display:flex;align-items:center;gap:.375rem;flex-shrink:0}.cortex-debug-tool__state{display:inline-flex;align-items:center;gap:5px;font-size:.6875rem;font-weight:500;padding:2px 8px;border-radius:4px;white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__state--success{color:var(--cortex-color-success);background:var(--cortex-color-success-surface)}.cortex-debug-tool__state--error{color:var(--cortex-color-danger);background:light-dark(#fef2f2,#450a0a)}.cortex-debug-tool__state--approval{color:light-dark(#7c3aed,#a78bfa);background:light-dark(#f5f3ff,#2e1065)}.cortex-debug-tool__state--pending{color:light-dark(#b45309,#fcd34d);background:light-dark(#fffbeb,#451a03)}.cortex-debug-tool__pulse{width:6px;height:6px;border-radius:50%;background:light-dark(#d97706,#fbbf24);animation:dbg-pulse 2s ease-in-out infinite}.cortex-debug-tool__pulse--violet{background:#8b5cf6}@keyframes dbg-pulse{0%,to{opacity:1}50%{opacity:.3}}.cortex-debug-tool__chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:4px;color:var(--cortex-color-text-muted);transition:transform .2s}details[open]>summary .cortex-debug-tool__chevron{transform:rotate(180deg)}.cortex-debug-tool__body{padding:0 .875rem .75rem 1.125rem}.cortex-debug-tool__section:not(:first-child){border-top:1px solid var(--cortex-color-border);padding-top:.625rem;margin-top:.625rem}.cortex-debug-tool__section-bar{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-debug-tool__section-label{font-size:.625rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-muted);font-family:system-ui,-apple-system,sans-serif}.cortex-debug-tool__section-label--success{color:var(--cortex-color-success)}.cortex-debug-tool__section-label--error{color:var(--cortex-color-danger)}.cortex-debug-tool__section-label--approval{color:light-dark(#7c3aed,#a78bfa)}.cortex-debug-tool__section-lang{font-size:.5625rem;color:var(--cortex-color-border-strong);font-family:ui-monospace,SF Mono,monospace;text-transform:lowercase}.cortex-debug-tool__pre{margin:0;max-height:20rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre;overflow-wrap:break-word}.cortex-debug-tool__tree{max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__error-pre{margin:0;max-height:16rem;overflow:auto;padding:.625rem .75rem;border-radius:6px;background:light-dark(#fef2f2,#450a0a);color:light-dark(#991b1b,#fca5a5);font-size:.75rem;line-height:1.3rem;font-family:ui-monospace,SF Mono,Cascadia Code,monospace;white-space:pre-wrap;word-break:break-word}.cortex-debug-tool__message{padding:.5rem .75rem;font-size:.75rem;color:var(--cortex-color-text-secondary);border-radius:6px;background:var(--cortex-color-surface)}.cortex-debug-tool__message--approval{color:light-dark(#5b21b6,#c4b5fd);background:light-dark(#faf5ff,#3b0764)}.cortex-debug-tool__section--success .cortex-debug-tool__tree{background:light-dark(#f0fdf4,#052e16)}.cortex-debug-tool__section--error .cortex-debug-tool__tree{background:light-dark(#fef2f2,#450a0a)}.cortex-tool-call-animated{display:block}.cortex-tool-pill{display:inline-flex;align-items:center;gap:.375rem;padding:.25rem 0;max-width:100%}.cortex-tool-pill__icon{position:relative;width:.75rem;height:.75rem;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--cortex-color-text-muted)}.cortex-tool-pill__spinner{position:absolute;width:.625rem;height:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;opacity:0;transition:opacity .2s}.cortex-tool-pill__spinner--visible{opacity:1;animation:cortex-tool-spin .8s linear infinite}@keyframes cortex-tool-spin{to{transform:rotate(360deg)}}.cortex-tool-pill__svg{position:absolute;width:.75rem;height:.75rem;opacity:0;transform:scale(.6);transition:opacity .2s,transform .2s}.cortex-tool-pill__svg--visible{opacity:1;transform:scale(1)}.cortex-tool-pill__svg--check{color:var(--cortex-color-success)}.cortex-tool-pill__svg--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title{font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .3s}.cortex-tool-pill__title--error{color:var(--cortex-color-danger)}.cortex-tool-pill__title--pending{color:var(--cortex-color-text-muted);opacity:.6}.cortex-tool-pill__meta{font-size:.6875rem;color:var(--cortex-color-text-muted);opacity:.8;white-space:nowrap;font-variant-numeric:tabular-nums}.cortex-approval-card{display:block;max-width:min(100%,28rem);margin:.25rem 0;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface);overflow:hidden}.cortex-approval-card--asking{border-color:color-mix(in oklab,var(--cortex-color-accent) 45%,var(--cortex-color-border));box-shadow:0 0 0 3px color-mix(in oklab,var(--cortex-color-accent) 10%,transparent)}.cortex-approval-card__head{display:flex;align-items:center;gap:.5rem;padding:.625rem .75rem 0;font-size:.75rem;font-weight:600;color:var(--cortex-color-accent)}.cortex-approval-card__sentence{margin:0;padding:.375rem .75rem .5rem;font-weight:600;color:var(--cortex-color-text-heading)}.cortex-approval-card__sentence--full{padding-top:0;font-weight:400;color:var(--cortex-color-text-strong)}.cortex-approval-card__rows{display:grid;grid-template-columns:fit-content(40%) minmax(0,1fr);gap:.1875rem .75rem;margin:0;padding:0 .75rem .75rem;font-size:.78125rem}.cortex-approval-card__rows dt{color:var(--cortex-color-text-secondary);overflow-wrap:anywhere}.cortex-approval-card__rows dd{max-height:6rem;margin:0;overflow-y:auto;white-space:pre-wrap;color:var(--cortex-color-text-strong);overflow-wrap:anywhere}.cortex-approval-card__foot{display:flex;gap:.5rem;padding:.625rem .75rem;border-top:1px solid var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-approval-card__button{border:1px solid var(--cortex-color-border-strong);border-radius:calc(var(--cortex-radius) * .75);background:var(--cortex-color-surface);padding:.375rem .875rem;font:inherit;font-size:.8125rem;font-weight:500;color:var(--cortex-color-text-strong);cursor:pointer}.cortex-approval-card__button--approve{border-color:var(--cortex-color-accent);background:var(--cortex-color-accent);color:var(--cortex-color-primary-foreground)}.cortex-approval-card__line{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.8125rem;color:var(--cortex-color-text-secondary)}.cortex-approval-card__line .cortex-tool-pill__icon{flex-shrink:0}.cortex-approval-card__decision{font-weight:600;color:var(--cortex-color-text-strong)}.cortex-approval-card__summary{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-approval-card__details{flex-shrink:0;border:0;background:none;padding:0;font:inherit;font-size:.75rem;color:var(--cortex-color-text-secondary);text-decoration:underline;text-underline-offset:2px;cursor:pointer}.cortex-tool-fold{display:block;align-self:flex-start;text-align:start;border:0;background:none;padding:0 0 .25rem;margin-block-start:-.625rem;margin-inline-start:1.125rem;font:inherit;font-size:.75rem;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-tool-fold:hover,.cortex-tool-fold:focus-visible{color:var(--cortex-color-text-secondary)}.cortex-client-tool-embed{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-client-tool-embed__bar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border-block-end:1px solid var(--cortex-color-border-strong);font-size:12px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__cancel{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-client-tool-embed__cancel:hover{color:var(--cortex-color-danger)}.cortex-client-tool-embed__frame{display:block;inline-size:100%;block-size:420px;border:0;background:var(--cortex-color-surface)}.cortex-client-tool-embed__status{display:flex;align-items:center;gap:8px;padding:20px 16px;font-size:13px;color:var(--cortex-color-text-muted)}.cortex-client-tool-embed__retry{border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:none;padding:4px 10px;font:inherit;font-size:12px;color:inherit;cursor:pointer}.cortex-client-tool-embed-dialog{border:0;padding:0;background:none;inline-size:min(560px,100vw - 48px);max-inline-size:none}.cortex-client-tool-embed-dialog::backdrop{background:#00000073}.cortex-client-tool-embed-dialog .cortex-client-tool-embed{inline-size:100%;max-inline-size:none;box-shadow:0 24px 64px #0000004d}.cortex-client-tool-embed-dialog .cortex-client-tool-embed__frame{block-size:min(70dvh,560px)}.cortex-location-input{border:1px solid var(--cortex-color-border-strong);border-radius:12px;background:var(--cortex-color-surface);overflow:hidden;max-inline-size:480px}.cortex-location-input--settled{display:flex;gap:10px;border-color:var(--cortex-color-border);background:var(--cortex-color-surface-subtle)}.cortex-location-input__map{position:relative;block-size:11rem;background:var(--cortex-color-surface-muted)}.cortex-location-input__map--still{flex:none;inline-size:120px;block-size:84px}.cortex-location-input__canvas{block-size:100%}.cortex-location-input__still-failed{display:flex;align-items:center;justify-content:center;block-size:100%;padding:0 8px;font-size:11px;text-align:center;color:var(--cortex-color-text-muted)}.cortex-location-input__locate{position:absolute;inset-inline-end:10px;inset-block-start:10px;z-index:1001;display:inline-flex;align-items:center;justify-content:center;inline-size:30px;block-size:30px;border:1px solid var(--cortex-color-border-strong);border-radius:8px;background:var(--cortex-color-surface);color:var(--cortex-color-text-strong);box-shadow:0 1px 3px #0003;cursor:pointer}.cortex-location-input__locate svg{inline-size:15px;block-size:15px}.cortex-location-input__locate:disabled{opacity:.45;cursor:default}.cortex-location-input__foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;border-block-start:1px solid var(--cortex-color-border-strong);font-size:12px}.cortex-location-input__hint{display:inline-flex;align-items:center;gap:6px;min-inline-size:0;color:var(--cortex-color-text-muted)}.cortex-location-input__hint--failed{color:var(--cortex-color-danger)}.cortex-location-input__spinner{inline-size:.625rem;block-size:.625rem;border:1.5px solid var(--cortex-color-border-strong);border-top-color:var(--cortex-color-text-muted);border-radius:9999px;animation:cortex-tool-spin .8s linear infinite}.cortex-location-input__coords{font-family:var(--cortex-font-mono);font-size:.75rem;color:var(--cortex-color-text-secondary);direction:ltr;unicode-bidi:isolate}.cortex-location-input__actions{display:flex;align-items:center;gap:8px}.cortex-location-input__skip{border:0;background:none;padding:2px 4px;font:inherit;color:var(--cortex-color-text-muted);cursor:pointer}.cortex-location-input__skip:hover{color:var(--cortex-color-danger)}.cortex-location-input__skip:disabled{opacity:.45;cursor:default}.cortex-location-input__send{border:1px solid var(--cortex-color-primary);border-radius:8px;background:var(--cortex-color-primary);padding:4px 10px;font:inherit;font-size:12px;color:var(--cortex-color-primary-foreground);cursor:pointer}.cortex-location-input__send:disabled{opacity:.45;cursor:default}.cortex-location-input__body{display:flex;flex-direction:column;justify-content:center;gap:2px;min-inline-size:0;padding-block:8px;padding-inline-end:12px}.cortex-location-input__title{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--cortex-color-text-strong)}.cortex-location-input__title svg{inline-size:13px;block-size:13px;color:var(--cortex-color-success)}.cortex-reasoning-animated{display:block}.cortex-subtle-activity{display:flex;align-items:center;gap:.375rem;padding:.25rem 0;width:fit-content}.cortex-subtle-activity__dots{display:flex;align-items:center;gap:3px}.cortex-subtle-activity__dot{width:3px;height:3px;border-radius:9999px;background:var(--cortex-color-accent);animation:cortex-subtle-dot-pulse 1.4s ease-in-out infinite}.cortex-subtle-activity__dot--d1{animation-delay:.2s}.cortex-subtle-activity__dot--d2{animation-delay:.4s}@keyframes cortex-subtle-dot-pulse{0%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1.3)}}.cortex-subtle-activity__label-mask{overflow:hidden;position:relative;height:1.1em}.cortex-subtle-activity__label{display:block;font-size:.75rem;color:var(--cortex-color-text-muted);white-space:nowrap;line-height:1.1em}.cortex-subtle-activity__label--idle,.cortex-subtle-activity__label--entering{opacity:1;transform:translateY(0);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--exiting{opacity:0;transform:translateY(-6px);transition:opacity .3s ease,transform .3s ease}.cortex-subtle-activity__label--enter-start{opacity:0;transform:translateY(6px);transition:none}.cortex-attachment-queue{display:flex;flex-wrap:wrap;gap:.375rem;margin-bottom:.5rem}.cortex-attachment-chip{display:inline-flex;align-items:center;gap:.375rem;max-width:14rem;padding-block:.25rem;padding-inline:.5rem .375rem;border:1px solid var(--cortex-color-border);border-radius:var(--cortex-radius);background:var(--cortex-color-surface-subtle);font-size:.75rem;color:var(--cortex-color-text-strong)}.cortex-attachment-chip--error{border-color:var(--cortex-color-danger-border);background:var(--cortex-color-danger-surface);color:var(--cortex-color-danger)}.cortex-attachment-chip__icon,.cortex-attachment-chip__spinner{flex-shrink:0;width:.875rem;height:.875rem;color:var(--cortex-color-text-muted)}.cortex-attachment-chip__spinner{animation:cortex-attachment-spin .8s linear infinite}.cortex-attachment-chip__spinner-track{opacity:.25}@keyframes cortex-attachment-spin{to{transform:rotate(360deg)}}.cortex-attachment-chip__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-attachment-chip__remove{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:1rem;height:1rem;padding:0;border:0;border-radius:3px;background:transparent;color:currentColor;opacity:.6;cursor:pointer}.cortex-attachment-chip__remove:hover{opacity:1;background:var(--cortex-color-hover)}.cortex-attachment-chip__remove svg{width:.75rem;height:.75rem}.cortex-token-usage{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-token-usage__summary{align-self:end}html[dir=ltr] .cortex-token-usage__summary{align-self:start}.cortex-token-usage__summary{display:inline-flex;align-items:center;gap:.625rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-token-usage__summary:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-token-usage__summary{flex-wrap:wrap;max-width:100%;text-align:start}.cortex-token-usage__total-number{font-weight:600;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__total-label{margin-inline-start:3px;color:var(--cortex-color-text-muted);font-weight:400;letter-spacing:.03em}.cortex-token-usage__model{color:var(--cortex-color-border-strong);font-weight:400;font-size:.5625rem;letter-spacing:.02em;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cortex-token-usage__pills{display:inline-flex;align-items:center;gap:.5rem}.cortex-token-usage__pill{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-muted)}.cortex-token-usage__dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.cortex-token-usage__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 2px #ea580c1a}.cortex-token-usage__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 2px #4f46e51a}.cortex-token-usage__cache-badge{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 6px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-token-usage--expanded .cortex-token-usage__chevron{transform:rotate(180deg)}.cortex-token-usage__details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-token-usage__details-inner{overflow:hidden}.cortex-token-usage--expanded .cortex-token-usage__details{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-token-usage__columns{display:grid;grid-template-columns:1fr 1fr;gap:1px;background:var(--cortex-color-border);border-radius:8px;overflow:hidden}.cortex-token-usage__col{background:var(--cortex-color-surface-subtle);padding:.5rem .625rem}.cortex-token-usage__col-header{display:flex;align-items:center;gap:.375rem;margin-bottom:.375rem}.cortex-token-usage__col-label{font-weight:600;font-size:.5625rem;text-transform:uppercase;letter-spacing:.06em;color:var(--cortex-color-text-secondary);font-family:system-ui,-apple-system,sans-serif}.cortex-token-usage__col-total{margin-inline-start:auto;font-weight:700;font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary)}.cortex-token-usage__rows{display:flex;flex-direction:column;gap:1px}.cortex-token-usage__row{display:flex;align-items:baseline;justify-content:space-between;padding:2px 0;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__row-label{color:var(--cortex-color-text-muted);font-size:.625rem}.cortex-token-usage__row-value{font-variant-numeric:tabular-nums;color:var(--cortex-color-text-secondary);font-weight:500}.cortex-token-usage__cache-bar-row{display:flex;align-items:center;gap:.5rem;margin-top:.5rem;padding-inline-start:calc(6px + .375rem)}.cortex-token-usage__cache-bar{flex:1;height:3px;border-radius:2px;background:var(--cortex-color-border);overflow:hidden}.cortex-token-usage__cache-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#10b981,var(--cortex-color-success));transition:width .4s cubic-bezier(.4,0,.2,1)}.cortex-token-usage__cache-label{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector{direction:ltr;display:flex;flex-direction:column;margin-top:.375rem;font-family:var(--cortex-font-mono);font-size:.6875rem;line-height:1.4;color:var(--cortex-color-text-muted);-webkit-user-select:none;user-select:none}html[dir=rtl] .cortex-llm-inspector__trigger{align-self:end}html[dir=ltr] .cortex-llm-inspector__trigger{align-self:start}.cortex-llm-inspector__trigger{display:inline-flex;align-items:center;gap:.5rem;padding:.3125rem .625rem;border:1px solid transparent;border-radius:6px;background:transparent;cursor:pointer;transition:background .15s ease,border-color .15s ease;font:inherit;color:inherit;letter-spacing:.01em}.cortex-llm-inspector__trigger:hover{background:var(--cortex-color-surface-subtle);border-color:var(--cortex-color-border)}.cortex-llm-inspector__icon{color:var(--cortex-color-text-muted);flex-shrink:0}.cortex-llm-inspector__loading{color:var(--cortex-color-border-strong);font-style:italic}.cortex-llm-inspector__badge{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;height:1.25rem;padding:0 .35rem;border-radius:9999px;background:var(--cortex-color-border);color:var(--cortex-color-text-secondary);font-size:.5625rem;font-weight:700}.cortex-llm-inspector__chevron{color:var(--cortex-color-border-strong);transition:transform .25s cubic-bezier(.4,0,.2,1);flex-shrink:0}.cortex-llm-inspector--open .cortex-llm-inspector__chevron{transform:rotate(180deg)}.cortex-llm-inspector__panel-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease,margin .2s ease;opacity:0;margin-top:0}.cortex-llm-inspector__panel-inner{overflow:hidden}.cortex-llm-inspector--open .cortex-llm-inspector__panel-wrapper{grid-template-rows:1fr;opacity:1;margin-top:.375rem}.cortex-llm-inspector__panel{display:flex;flex-direction:column;gap:.375rem}.cortex-llm-inspector__empty{padding:.625rem;color:var(--cortex-color-text-muted);font-style:italic}.cortex-llm-inspector__step{border-radius:8px;background:var(--cortex-color-surface-subtle);overflow:hidden;transition:box-shadow .2s ease}.cortex-llm-inspector__step--expanded{box-shadow:0 0 0 1px var(--cortex-color-border)}.cortex-llm-inspector__step-header{display:flex;align-items:center;gap:.5rem;width:100%;padding:.5rem .625rem;border:none;background:transparent;cursor:pointer;font:inherit;color:inherit;text-align:start;transition:background .15s ease}.cortex-llm-inspector__step-header:hover{background:#00000005}.cortex-llm-inspector__step-label{font-weight:600;color:var(--cortex-color-text-secondary);white-space:nowrap;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-metrics{display:inline-flex;align-items:center;gap:.625rem;margin-inline-start:auto;font-variant-numeric:tabular-nums}.cortex-llm-inspector__metric{display:inline-flex;align-items:center;gap:3px}.cortex-llm-inspector__dot{width:5px;height:5px;border-radius:50%;flex-shrink:0}.cortex-llm-inspector__dot--input{background:light-dark(#ea580c,#fb923c);box-shadow:0 0 0 1.5px #ea580c1f}.cortex-llm-inspector__dot--output{background:light-dark(#4f46e5,#818cf8);box-shadow:0 0 0 1.5px #4f46e51f}.cortex-llm-inspector__cache-pct{font-size:.5625rem;font-weight:600;color:var(--cortex-color-success);background:var(--cortex-color-success-surface);padding:1px 5px;border-radius:3px;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__step-chevron{color:var(--cortex-color-border-strong);transition:transform .2s ease;flex-shrink:0}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-chevron{transform:rotate(180deg)}.cortex-llm-inspector__step-body-wrapper{display:grid;grid-template-rows:0fr;transition:grid-template-rows .25s cubic-bezier(.4,0,.2,1),opacity .2s ease;opacity:0}.cortex-llm-inspector__step-body-inner{overflow:hidden}.cortex-llm-inspector__step--expanded .cortex-llm-inspector__step-body-wrapper{grid-template-rows:1fr;opacity:1}.cortex-llm-inspector__step-body{padding:0 .625rem .625rem;display:flex;flex-direction:column;gap:.5rem}.cortex-llm-inspector__usage-rows{display:flex;flex-direction:column;border-radius:6px;overflow:hidden;background:var(--cortex-color-border);gap:1px}.cortex-llm-inspector__usage-row{display:flex;align-items:baseline;gap:.5rem;padding:.375rem .625rem;background:var(--cortex-color-surface);flex-wrap:wrap}.cortex-llm-inspector__usage-row--total{background:light-dark(#fafbfc,#141414)}.cortex-llm-inspector__usage-lbl{font-size:.5625rem;text-transform:uppercase;letter-spacing:.05em;color:var(--cortex-color-text-muted);font-weight:600;width:3.25rem;flex-shrink:0;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__usage-val{font-variant-numeric:tabular-nums;font-weight:600;color:var(--cortex-color-text-secondary);min-width:3rem}.cortex-llm-inspector__usage-row--total .cortex-llm-inspector__usage-val{font-weight:700;color:var(--cortex-color-text-heading)}.cortex-llm-inspector__usage-detail{color:var(--cortex-color-border-strong);font-size:.5625rem;margin-inline-start:auto}.cortex-llm-inspector__tabs{display:flex;gap:0;border-bottom:1px solid var(--cortex-color-border)}.cortex-llm-inspector__tab{padding:.375rem .75rem;border:none;background:transparent;cursor:pointer;font:inherit;color:var(--cortex-color-text-muted);font-weight:500;position:relative;transition:color .15s ease;font-family:system-ui,-apple-system,sans-serif}.cortex-llm-inspector__tab:hover{color:var(--cortex-color-text-secondary)}.cortex-llm-inspector__tab--active{color:var(--cortex-color-text-heading);font-weight:600}.cortex-llm-inspector__tab--active:after{content:"";position:absolute;inset-inline:0;bottom:-1px;height:2px;background:var(--cortex-color-text-heading);border-radius:1px 1px 0 0}.cortex-llm-inspector__json-pane{position:relative;max-height:24rem;overflow:auto;padding:.625rem;background:var(--cortex-color-surface);border-radius:6px}.cortex-llm-inspector__json-copy{position:sticky;top:0;float:inline-end;z-index:1}.cortex-json-tree{display:block;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;line-height:1.25rem;-webkit-user-select:text;user-select:text;white-space:pre-wrap;word-break:break-word}.cortex-json-tree__indent{padding-inline-start:1.25em;border-inline-start:1px solid var(--cortex-color-border);margin-inline-start:.3em}.cortex-json-tree__line{position:relative}.cortex-json-tree__toggle{cursor:pointer;-webkit-user-select:none;user-select:none}.cortex-json-tree__toggle:hover .cortex-json-tree__arrow{color:var(--cortex-color-text)}.cortex-json-tree__arrow{display:inline-block;width:1em;text-align:center;color:var(--cortex-color-text-muted);font-size:.525rem;transition:transform .15s ease;vertical-align:middle}.cortex-json-tree__arrow--collapsed{transform:rotate(-90deg)}.cortex-json-tree__bracket{color:var(--cortex-color-text-secondary)}.cortex-json-tree__key{color:light-dark(#6366f1,#818cf8)}.cortex-json-tree__colon{color:var(--cortex-color-text-secondary)}.cortex-json-tree__comma{color:var(--cortex-color-text-muted)}.cortex-json-tree__string{color:var(--cortex-color-success)}.cortex-json-tree__number{color:light-dark(#2563eb,#60a5fa)}.cortex-json-tree__boolean{color:light-dark(#d97706,#fbbf24)}.cortex-json-tree__null{color:var(--cortex-color-text-muted);font-style:italic}.cortex-json-tree__collapsed-hint{display:inline-block;padding:0 .4em;margin:0 .15em;font-size:.625rem;line-height:1.5;color:var(--cortex-color-text-muted);background:var(--cortex-color-surface-subtle);border:1px solid var(--cortex-color-border);border-radius:3px;font-style:italic;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:middle}.cortex-json-tree__collapsed-hint:hover{color:var(--cortex-color-text-secondary);border-color:var(--cortex-color-border-strong);background:var(--cortex-color-surface-muted)}.cortex-copy-btn{display:inline-flex;align-items:center}.cortex-copy-btn__button{display:inline-flex;align-items:center;justify-content:center;width:1.375rem;height:1.375rem;padding:0;border:none;border-radius:3px;background:transparent;color:var(--cortex-color-text-muted);cursor:pointer;opacity:0;transition:opacity .15s ease,color .15s ease,background .15s ease}:hover>cortex-copy-button .cortex-copy-btn__button,:hover>.cortex-copy-btn .cortex-copy-btn__button,.cortex-copy-btn__button:hover,.cortex-copy-btn__button:focus-visible{opacity:1}.cortex-copy-btn__button:hover{background:var(--cortex-color-hover);color:var(--cortex-color-text)}.cortex-copy-btn__button--copied{opacity:1;color:var(--cortex-color-success);pointer-events:none}.cortex-copy-btn__button--copied:hover{color:var(--cortex-color-success);background:transparent}.cortex-copy-btn__icon{flex-shrink:0}.cortex-copy-btn__icon--check{animation:cortex-copy-pop .25s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes cortex-copy-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}@media(prefers-reduced-motion:reduce){.cortex-widget *,.cortex-widget *:before,.cortex-widget *:after{animation-duration:.01ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.01ms!important;transition-delay:0s!important}}\n']
|
|
10170
11460
|
}]
|
|
10171
11461
|
}],
|
|
10172
11462
|
propDecorators: {
|
|
@@ -10181,9 +11471,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
10181
11471
|
composer: [{
|
|
10182
11472
|
type: i0.ViewChild,
|
|
10183
11473
|
args: [i0.forwardRef(() => ChatComposerComponent), { isSignal: true }]
|
|
11474
|
+
}],
|
|
11475
|
+
customHeader: [{
|
|
11476
|
+
type: i0.ContentChild,
|
|
11477
|
+
args: [i0.forwardRef(() => CortexHeaderDirective), { isSignal: true }]
|
|
10184
11478
|
}]
|
|
10185
11479
|
}
|
|
10186
11480
|
});
|
|
10187
11481
|
export {
|
|
11482
|
+
CortexHeaderDirective,
|
|
10188
11483
|
CortexChatWidgetComponent
|
|
10189
11484
|
};
|