@helpai/elements 0.13.0 → 0.14.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/configurator.mjs +120 -84
- package/elements-web-component.esm.js +25 -25
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +27 -27
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +27 -27
- package/elements.esm.js.map +4 -4
- package/elements.js +25 -25
- package/elements.js.map +4 -4
- package/index.d.ts +101 -38
- package/index.mjs +772 -572
- package/package.json +1 -1
- package/schema.d.ts +166 -76
- package/schema.json +673 -407
- package/schema.mjs +124 -85
- package/style.css +1 -1
- package/web-component.mjs +768 -569
package/index.mjs
CHANGED
|
@@ -6,8 +6,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6
6
|
import { h, render } from "preact";
|
|
7
7
|
|
|
8
8
|
// src/ui/app.tsx
|
|
9
|
-
import { useCallback as useCallback6, useEffect as useEffect17, useMemo as useMemo3, useRef as
|
|
10
|
-
import { useSignal as useSignal2 } from "@preact/signals";
|
|
9
|
+
import { useCallback as useCallback6, useEffect as useEffect17, useMemo as useMemo3, useRef as useRef9, useState as useState13 } from "preact/hooks";
|
|
10
|
+
import { useComputed as useComputed7, useSignal as useSignal2 } from "@preact/signals";
|
|
11
11
|
|
|
12
12
|
// src/core/brand.ts
|
|
13
13
|
var BRAND = {
|
|
@@ -106,9 +106,10 @@ var STRINGS_EN = {
|
|
|
106
106
|
newsLoading: "Loading news\u2026",
|
|
107
107
|
newsBack: "Back to news",
|
|
108
108
|
newsPublishedAt: "Published {date}",
|
|
109
|
-
// ── Forms + human-in-the-loop (
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
// ── Forms + human-in-the-loop (forms / ask-input / approval) ────
|
|
110
|
+
formSubmit: "Submit",
|
|
111
|
+
formSkip: "Skip for now",
|
|
112
|
+
formDismiss: "Dismiss",
|
|
112
113
|
formRequired: "This field is required",
|
|
113
114
|
formInvalidEmail: "Enter a valid email address",
|
|
114
115
|
formInvalidTel: "Enter a valid phone number",
|
|
@@ -211,9 +212,10 @@ var STRINGS_FR = {
|
|
|
211
212
|
newsLoading: "Chargement des actualit\xE9s\u2026",
|
|
212
213
|
newsBack: "Retour aux actualit\xE9s",
|
|
213
214
|
newsPublishedAt: "Publi\xE9 le {date}",
|
|
214
|
-
// ── Forms + human-in-the-loop (
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
// ── Forms + human-in-the-loop (forms / ask-input / approval) ────
|
|
216
|
+
formSubmit: "Envoyer",
|
|
217
|
+
formSkip: "Ignorer pour l'instant",
|
|
218
|
+
formDismiss: "Fermer",
|
|
217
219
|
formRequired: "Ce champ est obligatoire",
|
|
218
220
|
formInvalidEmail: "Saisissez une adresse e-mail valide",
|
|
219
221
|
formInvalidTel: "Saisissez un num\xE9ro de t\xE9l\xE9phone valide",
|
|
@@ -450,11 +452,11 @@ var DEFAULT_FEATURES = {
|
|
|
450
452
|
voice: "local",
|
|
451
453
|
humanInLoop: true
|
|
452
454
|
};
|
|
453
|
-
var
|
|
455
|
+
var DEFAULT_FORMS = { list: [], byTrigger: {} };
|
|
454
456
|
var DEFAULT_ENDPOINTS = {
|
|
455
457
|
upload: "/ai/agent/upload-file",
|
|
456
458
|
transcribe: "/ai/agent/transcribe-audio",
|
|
457
|
-
|
|
459
|
+
submitForm: "/ai/agent/submit-form"
|
|
458
460
|
};
|
|
459
461
|
var DEFAULT_LAUNCHER = {
|
|
460
462
|
variant: "circle",
|
|
@@ -519,11 +521,11 @@ function resolveOptions(rawOpts) {
|
|
|
519
521
|
humanInLoop: opts.features?.humanInLoop ?? DEFAULT_FEATURES.humanInLoop,
|
|
520
522
|
tools: opts.features?.tools
|
|
521
523
|
},
|
|
522
|
-
|
|
524
|
+
forms: resolveForms(opts.forms),
|
|
523
525
|
endpoints: {
|
|
524
526
|
upload: opts.endpoints?.upload ?? DEFAULT_ENDPOINTS.upload,
|
|
525
527
|
transcribe: opts.endpoints?.transcribe ?? DEFAULT_ENDPOINTS.transcribe,
|
|
526
|
-
|
|
528
|
+
submitForm: opts.endpoints?.submitForm ?? DEFAULT_ENDPOINTS.submitForm
|
|
527
529
|
},
|
|
528
530
|
attachments: {
|
|
529
531
|
accept: opts.composer?.attachments?.accept ?? DEFAULT_ATTACHMENTS.accept,
|
|
@@ -622,17 +624,57 @@ function resolveModules(overrides) {
|
|
|
622
624
|
const byId = Object.fromEntries(list.map((m) => [m.id, m]));
|
|
623
625
|
return { list, byId };
|
|
624
626
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
return
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
627
|
+
var BLOCKABLE_KINDS = /* @__PURE__ */ new Set(["pre-chat", "after-messages"]);
|
|
628
|
+
function resolveForms(overrides) {
|
|
629
|
+
var _a;
|
|
630
|
+
if (!overrides?.length) return DEFAULT_FORMS;
|
|
631
|
+
const list = [];
|
|
632
|
+
const seen = /* @__PURE__ */ new Set();
|
|
633
|
+
for (const def of overrides) {
|
|
634
|
+
if (!def?.id || seen.has(def.id)) continue;
|
|
635
|
+
const fields = (def.fields ?? []).filter((f) => Boolean(f && f.name && f.label && f.type));
|
|
636
|
+
const triggers = (Array.isArray(def.on) ? def.on : [def.on]).map(parseTrigger).filter((t) => t !== null);
|
|
637
|
+
if (fields.length === 0 || triggers.length === 0) continue;
|
|
638
|
+
seen.add(def.id);
|
|
639
|
+
const blockable = triggers.some((t) => BLOCKABLE_KINDS.has(t.kind));
|
|
640
|
+
list.push({
|
|
641
|
+
id: def.id,
|
|
642
|
+
triggers,
|
|
643
|
+
when: def.when,
|
|
644
|
+
fields,
|
|
645
|
+
title: def.title,
|
|
646
|
+
description: def.description,
|
|
647
|
+
submitLabel: def.submitLabel,
|
|
648
|
+
skippable: def.skippable ?? false,
|
|
649
|
+
blocking: (def.blocking ?? false) && blockable,
|
|
650
|
+
frequency: def.frequency ?? "once",
|
|
651
|
+
mirrorToContext: def.mirrorToContext ?? true
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
const byTrigger = {};
|
|
655
|
+
for (const form of list) {
|
|
656
|
+
for (const t of form.triggers) (byTrigger[_a = t.kind] ?? (byTrigger[_a] = [])).push(form);
|
|
657
|
+
}
|
|
658
|
+
return { list, byTrigger };
|
|
659
|
+
}
|
|
660
|
+
function parseTrigger(raw) {
|
|
661
|
+
if (typeof raw !== "string") return null;
|
|
662
|
+
if (raw === "pre-chat" || raw === "conversation-closed" || raw === "panel-close" || raw === "manual") {
|
|
663
|
+
return { kind: raw };
|
|
664
|
+
}
|
|
665
|
+
const [head, param] = raw.split(":", 2);
|
|
666
|
+
if (head === "after-messages") {
|
|
667
|
+
const n = Number(param);
|
|
668
|
+
return Number.isFinite(n) && n > 0 ? { kind: "after-messages", param: n } : null;
|
|
669
|
+
}
|
|
670
|
+
if (head === "idle") {
|
|
671
|
+
const n = Number(param);
|
|
672
|
+
return Number.isFinite(n) && n > 0 ? { kind: "idle", param: n } : null;
|
|
673
|
+
}
|
|
674
|
+
if (head === "page-area") {
|
|
675
|
+
return param ? { kind: "page-area", param } : null;
|
|
676
|
+
}
|
|
677
|
+
return null;
|
|
636
678
|
}
|
|
637
679
|
function resolveLauncher(overrides) {
|
|
638
680
|
const callout = overrides?.callout?.text ? {
|
|
@@ -679,7 +721,6 @@ var SECTION_KEYS = [
|
|
|
679
721
|
"i18n",
|
|
680
722
|
"footer",
|
|
681
723
|
"features",
|
|
682
|
-
"intake",
|
|
683
724
|
"endpoints"
|
|
684
725
|
];
|
|
685
726
|
function mergeServerConfig(user, server) {
|
|
@@ -697,6 +738,7 @@ function mergeServerConfig(user, server) {
|
|
|
697
738
|
out[key] = mergeLeaves(sv, uv);
|
|
698
739
|
}
|
|
699
740
|
if (server.modules !== void 0 && user.modules === void 0) out.modules = server.modules;
|
|
741
|
+
if (server.forms !== void 0 && user.forms === void 0) out.forms = server.forms;
|
|
700
742
|
const userI18n = user.i18n;
|
|
701
743
|
const serverI18n = server.i18n;
|
|
702
744
|
if (userI18n || serverI18n) {
|
|
@@ -847,14 +889,14 @@ function isBlocksConfigShape(raw) {
|
|
|
847
889
|
function commandEventName(cmd) {
|
|
848
890
|
return `${BRAND.cssPrefix}:${cmd}`;
|
|
849
891
|
}
|
|
850
|
-
function dispatchHostCommand(host, cmd) {
|
|
851
|
-
host.dispatchEvent(new CustomEvent(commandEventName(cmd)));
|
|
892
|
+
function dispatchHostCommand(host, cmd, detail) {
|
|
893
|
+
host.dispatchEvent(new CustomEvent(commandEventName(cmd), { detail }));
|
|
852
894
|
}
|
|
853
895
|
function bindHostCommands(host, handlers) {
|
|
854
896
|
const entries2 = Object.entries(handlers);
|
|
855
897
|
const wrapped = entries2.map(([cmd, fn]) => {
|
|
856
898
|
const event = commandEventName(cmd);
|
|
857
|
-
const listener = () => fn();
|
|
899
|
+
const listener = (e) => fn(e.detail);
|
|
858
900
|
host.addEventListener(event, listener);
|
|
859
901
|
return [event, listener];
|
|
860
902
|
});
|
|
@@ -870,7 +912,7 @@ var tokens_default = ':host{--__P__-accent: __BRAND_ACCENT__;--__P__-accent-text
|
|
|
870
912
|
var reset_default = '*,*:before,*:after{box-sizing:border-box;margin:0;padding:0;border:0}button{font:inherit;color:inherit;background:none;cursor:pointer;-webkit-appearance:none;appearance:none;line-height:1}button:focus-visible,[tabindex]:focus-visible,textarea:focus-visible,input:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}textarea,input{font:inherit;color:inherit;background:none;border:0;outline:0;resize:none}a{color:var(--__P__-accent);text-decoration:underline;text-underline-offset:2px}img,svg{display:block;max-width:100%}ul,ol{list-style:none}.__P__-app{display:block;width:100%;height:100%;font-family:var(--__P__-font);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-feature-settings:"cv11","ss01","ss03"}.__P__-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n';
|
|
871
913
|
|
|
872
914
|
// src/styles/panel.css
|
|
873
|
-
var panel_default = '.__P__-anchor{right:16px;bottom:16px}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:14px}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:14px;background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:#ffffff26}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:14px;font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-left:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:14px;font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;right:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px;scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-date-divider{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;margin:var(--__P__-space-1) 0;pointer-events:none}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:14px;word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-bottom-right-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:11px;line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-left:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-left:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:12.5px;padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-left:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-radius:0 var(--__P__-radius-sm) var(--__P__-radius-sm) 0;color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:left}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-left:var(--__P__-space-3);border-left:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-tool-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2);margin-top:6px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:14px;line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:16px}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 10px;border-radius:var(--__P__-radius-sm);background:var(--__P__-danger-bg);color:var(--__P__-danger-text);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error button{color:inherit;text-decoration:underline;font-size:var(--__P__-text-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:14px;text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-2)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:12px 8px 6px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-item{all:unset;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:var(--__P__-radius-md);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-title{font-size:14px;font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-preview{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-item[data-closed=true] .__P__-history-title:after{content:"\\2022";margin-left:var(--__P__-space-2);opacity:.5}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:11px;line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:11px;letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;right:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-help-card .__P__-list-row:hover{background:var(--__P__-hover)}.__P__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:10px;font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:14px;font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:2px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;color:color-mix(in srgb,var(--__P__-on-accent) 88%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-left:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-left:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:left;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:14px}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:14px}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:left}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:14px}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:14px;color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:left;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-bg-elevated)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:left;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-tags{display:flex;gap:6px;flex-wrap:wrap}.__P__-news-tag{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);padding:2px 8px;border-radius:999px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;right:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-field{display:flex;flex-direction:column;gap:4px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;box-sizing:border-box;padding:var(--__P__-space-2) var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:6px}.__P__-choice{display:flex;align-items:flex-start;gap:8px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:2px}.__P__-form-submit,.__P__-tool-approve{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled),.__P__-tool-approve:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip,.__P__-tool-reject{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled),.__P__-tool-reject:hover:not(:disabled){background:var(--__P__-bg-elevated)}.__P__-intake{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4) var(--__P__-space-4);border-top:1px solid var(--__P__-border);overflow-y:auto}.__P__-intake-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-intake-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-ask-input,.__P__-tool-approval{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:6px;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-tool-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-badge{padding:2px 8px;border-radius:999px;background:var(--__P__-warning, #f59e0b);color:#1a1206;font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-title{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}.__P__-tool-question{margin:0;font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-tool-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-args{margin:0;padding:var(--__P__-space-2);max-height:160px;overflow:auto;border-radius:var(--__P__-radius-sm);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);white-space:pre-wrap;word-break:break-word}.__P__-tool-stale-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-tool-decided{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-decided-label{padding:2px 8px;border-radius:999px;background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-decided-label[data-approved=true]{color:var(--__P__-success, #16a34a);border-color:var(--__P__-success, #16a34a)}.__P__-tool-decided-label[data-approved=false]{color:var(--__P__-danger);border-color:var(--__P__-danger)}.__P__-tool-decided-value{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}\n';
|
|
915
|
+
var panel_default = '.__P__-anchor{right:16px;bottom:16px}:host([data-position="bottom-left"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{right:auto;left:16px}:host([data-position="top-right"]) .__P__-anchor,:host([data-position="top-left"]) .__P__-anchor{bottom:auto;top:16px}.__P__-anchor{position:fixed;display:flex;flex-direction:column;align-items:flex-end;gap:var(--__P__-space-3);pointer-events:none}.__P__-anchor{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=sm]{--__P__-fab-size: 44px}.__P__-anchor[data-launcher-size=md]{--__P__-fab-size: 56px}.__P__-anchor[data-launcher-size=lg]{--__P__-fab-size: 68px}.__P__-anchor>*{pointer-events:auto}.__P__-fab[data-size=sm]{--__P__-fab-size: 44px;font-size:var(--__P__-text-sm)}.__P__-fab[data-size=md]{--__P__-fab-size: 56px;font-size:14px}.__P__-fab[data-size=lg]{--__P__-fab-size: 68px;font-size:var(--__P__-text-base)}.__P__-fab{display:inline-flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);color:var(--__P__-accent-text);background:var(--__P__-accent);box-shadow:var(--__P__-shadow-fab);font-weight:600;line-height:1;transform-origin:bottom right;animation:__P__-fab-in var(--__P__-dur-base) var(--__P__-ease) both;transition:transform var(--__P__-dur-base) var(--__P__-ease),opacity var(--__P__-dur-base) var(--__P__-ease),box-shadow var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab:hover{transform:translateY(-2px)}.__P__-fab:active{transform:translateY(0)}.__P__-fab:focus-visible{outline:2px solid var(--__P__-on-accent);outline-offset:3px}.__P__-fab svg{width:24px;height:24px;flex-shrink:0}@keyframes __P__-fab-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}.__P__-fab[data-leaving]{position:absolute;right:0;bottom:0;animation:__P__-fab-out var(--__P__-dur-quick) var(--__P__-ease) forwards;pointer-events:none}:host([data-position^="top-"]) .__P__-fab[data-leaving]{bottom:auto;top:0}:host([data-position$="-left"]) .__P__-fab[data-leaving]{right:auto;left:0}@keyframes __P__-fab-out{0%{opacity:1;transform:none}to{opacity:0;transform:scale(.85)}}.__P__-fab[data-variant=circle]{width:var(--__P__-fab-size);height:var(--__P__-fab-size);border-radius:999px}.__P__-fab[data-variant=circle] .__P__-fab-label{display:none}.__P__-fab[data-variant=pill]{height:var(--__P__-fab-size);padding:0 18px 0 16px;border-radius:999px}.__P__-fab[data-variant=bar]{height:var(--__P__-fab-size);padding:0 22px;border-radius:var(--__P__-radius)}.__P__-fab[data-variant=minimal]{height:var(--__P__-fab-size);padding:0 var(--__P__-space-4);border-radius:999px;background:transparent;color:var(--__P__-accent);box-shadow:none;border:1px solid currentColor}.__P__-fab[data-variant=minimal]:hover{background:color-mix(in srgb,var(--__P__-accent) 12%,transparent)}.__P__-callout{--__P__-callout-fab-h: var(--__P__-fab-size, 56px);--__P__-callout-gap: clamp(12px, calc(var(--__P__-callout-fab-h) * .25), 22px);--__P__-callout-nudge-direction: -1;position:absolute;display:inline-flex;align-items:center;gap:var(--__P__-space-2);padding:10px 14px;background:var(--__P__-fg);color:var(--__P__-bg);border-radius:999px;font-size:var(--__P__-text-sm);font-weight:600;line-height:1.2;box-shadow:0 10px 30px -8px #00000059;pointer-events:auto;animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease);z-index:1;max-width:240px;white-space:nowrap}.__P__-callout[data-position=left]{right:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%)}.__P__-callout[data-position=right]{left:calc(100% + var(--__P__-callout-gap));bottom:calc(var(--__P__-callout-fab-h) / 2);transform:translateY(50%);--__P__-callout-nudge-direction: 1}.__P__-callout[data-position=top]{bottom:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-position=bottom]{top:calc(100% + var(--__P__-callout-gap));right:0;max-width:min(280px,calc(100vw - 32px))}:host([data-position$="-left"]) .__P__-callout[data-position=top],:host([data-position$="-left"]) .__P__-callout[data-position=bottom]{right:auto;left:0}.__P__-callout[data-shape=bubble]{border-radius:var(--__P__-radius-md);white-space:normal;width:max-content;max-width:min(280px,calc(100vw - 32px))}.__P__-callout[data-shape=callout]{padding:12px 18px;font-size:14px;background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-callout:after{content:"";position:absolute;width:12px;height:12px;background:inherit;border-radius:2px;transform:rotate(45deg)}.__P__-callout[data-position=left]:after{right:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=right]:after{left:-5px;top:50%;margin-top:-6px}.__P__-callout[data-position=top]:after{bottom:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-position=bottom]:after{top:-5px;right:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}:host([data-position$="-left"]) .__P__-callout[data-position=top]:after,:host([data-position$="-left"]) .__P__-callout[data-position=bottom]:after{right:auto;left:calc(var(--__P__-fab-size, 56px) / 2 - 6px)}.__P__-callout[data-animated]{animation:__P__-callout-in var(--__P__-dur-slow) var(--__P__-ease),__P__-callout-nudge 1.6s var(--__P__-ease-in-out) var(--__P__-dur-slow) infinite}@keyframes __P__-callout-in{0%{opacity:0}to{opacity:1}}@keyframes __P__-callout-nudge{0%,to{margin-left:0;margin-right:0}50%{margin-left:calc(6px * var(--__P__-callout-nudge-direction));margin-right:calc(-6px * var(--__P__-callout-nudge-direction))}}@media(prefers-reduced-motion:reduce){.__P__-callout[data-animated]{animation:__P__-callout-in 1ms var(--__P__-ease)}.__P__-icon-btn[data-recording=true],.__P__-typing span{animation:none}}.__P__-callout-close{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;color:inherit;opacity:.7;cursor:pointer}.__P__-callout-close:hover{opacity:1;background:#ffffff26}.__P__-callout-close svg{width:12px;height:12px}.__P__-panel{width:var(--__P__-panel-w);height:var(--__P__-panel-h);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);background:var(--__P__-bg);color:var(--__P__-fg);border-radius:var(--__P__-radius-lg);box-shadow:var(--__P__-shadow-panel);display:flex;flex-direction:column;overflow:hidden;transform-origin:bottom right;animation:__P__-panel-in var(--__P__-dur-slow) var(--__P__-ease);border:1px solid var(--__P__-border)}:host([data-mode="open"]) .__P__-panel{width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));min-width:var(--__P__-resize-min-w, auto);min-height:var(--__P__-resize-min-h, auto);max-width:var(--__P__-resize-max-w, calc(100vw - 32px) );max-height:var(--__P__-resize-max-h, calc(100dvh - 32px) )}@keyframes __P__-panel-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}:host([data-mode="expanded"]) .__P__-panel{width:var(--__P__-expanded-w, 640px);height:var(--__P__-expanded-h, 820px);max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px)}:host([data-mode="fullscreen"]){z-index:var(--__P__-z-panel)!important}:host([data-mode="fullscreen"]) .__P__-anchor{inset:0;align-items:stretch;padding:0}:host([data-mode="fullscreen"]) .__P__-panel{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:0}:host([data-mode="fullscreen"]) .__P__-fab{display:none}:host([data-mode="inline"]) .__P__-anchor,:host([data-mode="standalone"]) .__P__-anchor{position:static;inset:auto;padding:0;align-items:stretch;width:100%;height:100%;min-height:0}:host([data-mode="inline"]) .__P__-panel,:host([data-mode="standalone"]) .__P__-panel{width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;animation:none}:host([data-mode="inline"]) .__P__-fab,:host([data-mode="standalone"]) .__P__-fab{display:none}:host([data-mode="inline"]){min-height:320px}:host([data-mode="inline"]) .__P__-panel{border-radius:var(--__P__-radius)}:host([data-mode="standalone"]) .__P__-panel{border-radius:0;border:0;box-shadow:none}:host([data-mode="modal"]){position:fixed!important;inset:0!important;z-index:var(--__P__-z-panel)!important;display:block!important;width:100vw;height:100dvh;background:var(--__P__-modal-backdrop, var(--__P__-backdrop));animation:__P__-backdrop-in var(--__P__-dur-base) var(--__P__-ease) both;--__P__-panel-w: min(960px, 92vw);--__P__-panel-h: min(720px, 88dvh)}:host([data-mode="modal"]) .__P__-anchor{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:var(--__P__-space-6);pointer-events:none}:host([data-mode="modal"]) .__P__-panel{pointer-events:auto;width:var(--__P__-widget-w, var(--__P__-panel-w));height:var(--__P__-widget-h, var(--__P__-panel-h));max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);min-width:0;min-height:0;border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-panel);animation:__P__-modal-in var(--__P__-dur-base) var(--__P__-ease);translate:var(--__P__-modal-dx, 0px) var(--__P__-modal-dy, 0px)}:host([data-mode="modal"]) .__P__-header,:host([data-mode="modal"]) .__P__-back-header,:host([data-mode="modal"]) .__P__-home-hero{cursor:grab;touch-action:none}:host([data-mode="modal"]) .__P__-panel[data-dragging]{cursor:grabbing;user-select:none}:host([data-mode="modal"]) .__P__-panel[data-dragging] *{cursor:grabbing}:host([data-mode="modal"]) .__P__-fab{display:none}@keyframes __P__-backdrop-in{0%{background:#0000}to{background:var(--__P__-modal-backdrop, var(--__P__-backdrop))}}@keyframes __P__-modal-in{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}:host([data-mode="drawer"]){--__P__-panel-w: min(440px, calc(100vw - 32px) );--__P__-panel-h: 100dvh}:host([data-mode="drawer"]) .__P__-anchor{position:fixed;--__P__-inset-x: var(--__P__-panel-inset, 12px);--__P__-inset-y: var(--__P__-panel-inset, 3dvh);top:var(--__P__-inset-y);bottom:auto;right:var(--__P__-inset-x);left:auto;width:min(var(--__P__-widget-w, var(--__P__-panel-w)),calc(100vw - var(--__P__-inset-x) * 2));height:min(var(--__P__-widget-h, var(--__P__-panel-h)),calc(100dvh - var(--__P__-inset-y) * 2));padding:0;display:block;pointer-events:auto}:host([data-mode="drawer"][data-position$="-left"]) .__P__-anchor{right:auto;left:var(--__P__-inset-x)}:host([data-mode="drawer"][data-position^="bottom-"]) .__P__-anchor{top:auto;bottom:var(--__P__-inset-y)}:host([data-mode="drawer"]) .__P__-panel{width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;border-radius:var(--__P__-radius, 12px);border:1px solid var(--__P__-border);box-shadow:-8px 16px 32px -12px #00000038;animation:__P__-drawer-in var(--__P__-dur-base) var(--__P__-ease)}:host([data-mode="drawer"][data-position$="-left"]) .__P__-panel{box-shadow:8px 16px 32px -12px #00000038;animation:__P__-drawer-in-left var(--__P__-dur-base) var(--__P__-ease)}.__P__-fab[data-edge-tab]{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-2);position:fixed;top:50%;height:140px;width:auto;min-width:0;padding:10px 8px;writing-mode:vertical-rl;text-orientation:mixed;transform:translateY(-50%);transform-origin:center;animation:__P__-edge-tab-in var(--__P__-dur-base) var(--__P__-ease) both}.__P__-fab[data-edge-tab] svg{writing-mode:horizontal-tb}.__P__-fab[data-edge-tab]:hover{transform:translateY(-50%) scale(1.03)}.__P__-fab[data-edge-tab]:active{transform:translateY(-50%) scale(.97)}:host([data-position$="-right"]) .__P__-fab[data-edge-tab]{right:0;left:auto;border-radius:12px 0 0 12px;box-shadow:-6px 0 18px -8px #0000004d}:host([data-position$="-left"]) .__P__-fab[data-edge-tab]{left:0;right:auto;border-radius:0 12px 12px 0;box-shadow:6px 0 18px -8px #0000004d}.__P__-fab[data-edge-tab][data-leaving]{position:fixed;top:50%;bottom:auto;animation:__P__-edge-tab-out var(--__P__-dur-quick) var(--__P__-ease) forwards}@keyframes __P__-edge-tab-in{0%{opacity:0;transform:translateY(-50%) scale(.9)}to{opacity:1;transform:translateY(-50%) scale(1)}}@keyframes __P__-edge-tab-out{0%{opacity:1;transform:translateY(-50%) scale(1)}to{opacity:0;transform:translateY(-50%) scale(.85)}}@keyframes __P__-drawer-in{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes __P__-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){:host([data-mode="drawer"]) .__P__-panel,.__P__-fab[data-edge-tab]{animation:none}}.__P__-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);background:var(--__P__-bg)}.__P__-header h1{font-size:14px;font-weight:600;flex:1;letter-spacing:-.01em}.__P__-header-actions{margin-left:auto;display:flex;align-items:center;gap:var(--__P__-space-1);flex-shrink:0}.__P__-agent{flex:1;display:inline-flex;align-items:center;gap:10px;min-width:0}.__P__-agent-avatar{position:relative;width:32px;height:32px;border-radius:999px;background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:var(--__P__-text-xs);overflow:hidden;flex-shrink:0}.__P__-agent-avatar img{width:100%;height:100%;object-fit:cover}.__P__-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:999px;border:2px solid var(--__P__-bg);background:var(--__P__-neutral)}.__P__-agent-avatar[data-status=online]:after{background:var(--__P__-success)}.__P__-agent-avatar[data-status=away]:after{background:var(--__P__-warning)}.__P__-agent-avatar[data-status=offline]:after{background:var(--__P__-neutral)}.__P__-agent-meta{display:flex;flex-direction:column;line-height:1.15;min-width:0}.__P__-agent-meta strong{font-size:14px;font-weight:600;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-agent-meta span{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-suggestions{display:flex;flex-wrap:nowrap;gap:var(--__P__-space-2);padding:6px 14px 10px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x proximity;scrollbar-width:none;-ms-overflow-style:none;min-width:0}.__P__-suggestions::-webkit-scrollbar{display:none}.__P__-suggestions:before,.__P__-suggestions:after{content:"";flex:1 1 0;min-width:0}.__P__-suggestion{flex:0 0 auto;scroll-snap-align:center;padding:7px 14px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg);font-size:var(--__P__-text-sm);font-weight:500;white-space:nowrap;transition:background var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-suggestion:hover{border-color:var(--__P__-accent);color:var(--__P__-accent);transform:translateY(-1px)}.__P__-suggestion:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px;border-color:var(--__P__-accent)}.__P__-suggestion:active{transform:translateY(0)}.__P__-icon-btn{width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);transition:background var(--__P__-dur-quick) var(--__P__-ease),color var(--__P__-dur-quick) var(--__P__-ease)}.__P__-icon-btn:hover{background:var(--__P__-bg-elevated);color:var(--__P__-fg)}.__P__-icon-btn:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-icon-btn:active{background:var(--__P__-border)}.__P__-icon-btn:disabled{opacity:.45;cursor:not-allowed}.__P__-icon-btn:before{content:"";position:absolute;inset:-6px}.__P__-icon-btn{position:relative}.__P__-icon-btn svg{width:18px;height:18px}.__P__-icon-btn[data-recording=true]{color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);animation:__P__-pulse 1.2s var(--__P__-ease) infinite}@keyframes __P__-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--__P__-accent) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--__P__-accent) 0%,transparent)}}.__P__-list-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.__P__-jump{position:absolute;right:14px;bottom:14px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);color:var(--__P__-fg);box-shadow:var(--__P__-shadow-panel);cursor:pointer;opacity:.85;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease);animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-jump:hover{opacity:1}.__P__-jump:active{transform:translateY(1px)}.__P__-jump svg{width:18px;height:18px}.__P__-list{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-4);padding-bottom:var(--__P__-space-8);display:flex;flex-direction:column;gap:14px;scrollbar-width:thin;scrollbar-color:var(--__P__-border-strong) transparent;scrollbar-gutter:stable}.__P__-list::-webkit-scrollbar{width:8px}.__P__-list::-webkit-scrollbar-thumb{background:var(--__P__-border-strong);border-radius:8px}.__P__-date-divider{position:sticky;top:var(--__P__-space-2);z-index:2;display:flex;justify-content:center;margin:var(--__P__-space-1) 0;pointer-events:none}.__P__-date-pill{padding:3px 10px;border-radius:999px;font-size:11px;font-weight:600;color:var(--__P__-fg-muted);background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);box-shadow:var(--__P__-shadow-card);opacity:0;pointer-events:none;transition:opacity var(--__P__-dur-base) var(--__P__-ease)}.__P__-list[data-scrolling=true] .__P__-date-pill{opacity:1;pointer-events:auto}@media(prefers-reduced-motion:reduce){.__P__-date-pill{transition:none}}.__P__-bubble-row{display:flex}.__P__-bubble-row[data-role=user]{justify-content:flex-end}.__P__-bubble-row[data-role=assistant]{justify-content:flex-start}.__P__-bubble{max-width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);line-height:1.6;font-size:14px;word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 2px #0000000a,0 1px 8px -4px #0000000f;animation:__P__-bubble-in var(--__P__-dur-base) var(--__P__-ease)}.__P__-bubble ::selection{background:color-mix(in srgb,var(--__P__-accent) 30%,transparent)}.__P__-bubble-row[data-role=user] .__P__-bubble ::selection{background:#fff6;color:var(--__P__-bubble-user-text)}@keyframes __P__-bubble-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.__P__-bubble-row[data-role=user] .__P__-bubble{background:var(--__P__-bubble-user);color:var(--__P__-bubble-user-text);border-bottom-right-radius:5px}.__P__-bubble-row[data-role=assistant] .__P__-bubble{background:var(--__P__-bubble-assistant);color:var(--__P__-bubble-assistant-text);border-bottom-left-radius:5px}.__P__-bubble-col{display:flex;flex-direction:column;max-width:85%;min-width:0}.__P__-bubble-row[data-role=user] .__P__-bubble-col{align-items:flex-end}.__P__-bubble-row[data-role=assistant] .__P__-bubble-col{align-items:flex-start}.__P__-bubble-time{margin-top:3px;padding:0 4px;font-size:11px;line-height:1;color:var(--__P__-fg-muted);user-select:none}.__P__-md>*:first-child{margin-top:0}.__P__-md>*:last-child{margin-bottom:0}.__P__-md p{margin:10px 0}.__P__-md h1,.__P__-md h2,.__P__-md h3,.__P__-md h4,.__P__-md h5,.__P__-md h6{margin:18px 0 8px;line-height:1.3;letter-spacing:-.01em;font-weight:700}.__P__-md h1{font-size:1.4em}.__P__-md h2{font-size:1.22em}.__P__-md h3{font-size:1.08em}.__P__-md h4,.__P__-md h5,.__P__-md h6{font-size:1em}.__P__-md>h1:first-child,.__P__-md>h2:first-child,.__P__-md>h3:first-child,.__P__-md>h4:first-child,.__P__-md>h5:first-child,.__P__-md>h6:first-child{margin-top:0}.__P__-md ul,.__P__-md ol{padding-left:1.5em;margin:10px 0}.__P__-md ul{list-style:disc}.__P__-md ol{list-style:decimal}.__P__-md li{margin:6px 0;padding-left:2px}.__P__-md li::marker{color:var(--__P__-fg-muted)}.__P__-md li>p{margin:6px 0}.__P__-md li>ul,.__P__-md li>ol{margin:6px 0}.__P__-md strong,.__P__-md b{font-weight:650;letter-spacing:-.005em}.__P__-md em,.__P__-md i{font-style:italic}.__P__-md code{font-family:var(--__P__-font-mono);font-size:.86em;padding:1px 6px;border-radius:5px;background:color-mix(in srgb,var(--__P__-accent) 10%,transparent);color:var(--__P__-fg);border:1px solid color-mix(in srgb,var(--__P__-accent) 16%,transparent)}.__P__-md pre{font-family:var(--__P__-font-mono);font-size:12.5px;padding:12px 14px;border-radius:var(--__P__-radius-sm);background:#7f7f7f1f;overflow-x:auto;margin:var(--__P__-space-3) 0;line-height:1.5}.__P__-md pre code{padding:0;background:none}.__P__-md a{color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.__P__-md a:hover{text-decoration-thickness:2px}.__P__-md blockquote{margin:14px 0;padding:6px 14px;border-left:3px solid color-mix(in srgb,var(--__P__-accent) 50%,transparent);background:color-mix(in srgb,var(--__P__-accent) 5%,transparent);border-radius:0 var(--__P__-radius-sm) var(--__P__-radius-sm) 0;color:var(--__P__-fg-muted)}.__P__-md blockquote>:first-child{margin-top:0}.__P__-md blockquote>:last-child{margin-bottom:0}.__P__-md hr{border:0;height:1px;background:color-mix(in srgb,currentColor 18%,transparent);margin:var(--__P__-space-4) 0}.__P__-md table{border-collapse:collapse;margin:var(--__P__-space-3) 0;font-size:.95em;display:block;overflow-x:auto;max-width:100%;font-variant-numeric:tabular-nums}.__P__-md th,.__P__-md td{padding:6px 10px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent);text-align:left}.__P__-md th{font-weight:700;background:color-mix(in srgb,currentColor 6%,transparent)}.__P__-md h1+ul,.__P__-md h1+ol,.__P__-md h2+ul,.__P__-md h2+ol,.__P__-md h3+ul,.__P__-md h3+ol,.__P__-md h4+ul,.__P__-md h4+ol{margin-top:var(--__P__-space-1)}.__P__-loading{display:inline-flex;align-items:center;gap:var(--__P__-space-2);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-loading-spinner{width:14px;height:14px;border-radius:999px;border:2px solid currentColor;border-top-color:transparent;animation:__P__-spin .8s linear infinite}@keyframes __P__-spin{to{transform:rotate(1turn)}}.__P__-typing{display:inline-flex;gap:var(--__P__-space-1);padding:var(--__P__-space-1) 0}.__P__-typing span{width:5px;height:5px;border-radius:999px;background:currentColor;opacity:.4;animation:__P__-blink 1.2s var(--__P__-ease) infinite}.__P__-typing span:nth-child(2){animation-delay:.2s}.__P__-typing span:nth-child(3){animation-delay:.4s}@keyframes __P__-blink{0%,80%,to{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.__P__-reasoning{margin:var(--__P__-space-1) 0 var(--__P__-space-2);padding-left:var(--__P__-space-3);border-left:2px solid var(--__P__-border-strong)}.__P__-reasoning-summary{display:inline-flex;align-items:center;gap:var(--__P__-space-1);cursor:pointer;list-style:none;user-select:none;color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-reasoning-summary::-webkit-details-marker{display:none}.__P__-reasoning-summary:before{content:"";width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);opacity:.7;transition:transform var(--__P__-dur-quick) var(--__P__-ease)}.__P__-reasoning[open] .__P__-reasoning-summary:before{transform:rotate(45deg)}.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:__P__-reasoning-pulse 1.4s var(--__P__-ease) infinite}@keyframes __P__-reasoning-pulse{0%,to{opacity:.5}50%{opacity:1}}@media(prefers-reduced-motion:reduce){.__P__-reasoning[data-active=true] .__P__-reasoning-label{animation:none}}.__P__-reasoning-body{margin-top:var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm)}.__P__-reasoning-body>:first-child{margin-top:0}.__P__-reasoning-body>:last-child{margin-bottom:0}.__P__-tool-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2);margin-top:6px;border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs)}.__P__-composer{border-top:1px solid var(--__P__-border);padding:10px 12px;background:var(--__P__-bg);display:flex;flex-direction:column;gap:var(--__P__-space-2)}.__P__-composer-row{display:flex;align-items:flex-end;gap:6px}.__P__-textarea{flex:1;height:40px;max-height:160px;padding:10px 12px;border-radius:var(--__P__-radius);background:var(--__P__-bg-elevated);border:1px solid transparent;font-size:14px;line-height:1.4;transition:height var(--__P__-dur-quick) var(--__P__-ease),border-color var(--__P__-dur-quick) var(--__P__-ease),box-shadow var(--__P__-dur-quick) var(--__P__-ease)}.__P__-textarea:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:1px;border-color:var(--__P__-focus)}@media(pointer:coarse){.__P__-textarea,.__P__-home-search-input{font-size:16px}.__P__-textarea{height:44px}}.__P__-send{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;transition:opacity var(--__P__-dur-quick) var(--__P__-ease),transform var(--__P__-dur-quick) var(--__P__-ease),background var(--__P__-dur-quick) var(--__P__-ease)}.__P__-send[data-shape=circle]{border-radius:999px}.__P__-send[data-shape=square]{border-radius:var(--__P__-radius-sm)}.__P__-send[data-shape=pill]{width:auto;padding:0 18px;border-radius:999px}.__P__-send[data-variant=filled]{background:var(--__P__-accent);color:var(--__P__-accent-text)}.__P__-send[data-variant=outline]{background:transparent;color:var(--__P__-accent);border-color:var(--__P__-accent)}.__P__-send[data-variant=outline]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 10%,transparent)}.__P__-send[data-variant=ghost]{background:transparent;color:var(--__P__-accent)}.__P__-send[data-variant=ghost]:not(:disabled):hover{background:color-mix(in srgb,var(--__P__-accent) 8%,transparent)}.__P__-send:disabled{opacity:.4;cursor:not-allowed}.__P__-send:not(:disabled):hover{transform:translateY(-1px)}.__P__-send:not(:disabled):active{transform:translateY(0)}.__P__-send:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-send svg{width:18px;height:18px}.__P__-composer-actions{display:flex;gap:var(--__P__-space-1);flex-wrap:wrap}.__P__-attachments{display:flex;flex-wrap:wrap;gap:6px}.__P__-attachment-chip{display:inline-flex;align-items:center;gap:6px;padding:var(--__P__-space-1) var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-1);border-radius:999px;background:var(--__P__-bg-elevated);border:1px solid var(--__P__-border);font-size:var(--__P__-text-xs);max-width:200px}.__P__-attachment-thumb{width:24px;height:24px;border-radius:999px;object-fit:cover;background:var(--__P__-border)}.__P__-attachment-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-attachment-remove{width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted)}.__P__-attachment-remove:hover{background:var(--__P__-border);color:var(--__P__-fg)}.__P__-dropzone{position:absolute;inset:8px;border:2px dashed var(--__P__-accent);border-radius:var(--__P__-radius);background:color-mix(in srgb,var(--__P__-accent) 8%,transparent);display:flex;align-items:center;justify-content:center;font-weight:600;color:var(--__P__-accent);pointer-events:none;z-index:10;animation:__P__-fade-in var(--__P__-dur-quick) var(--__P__-ease)}@keyframes __P__-fade-in{0%{opacity:0}to{opacity:1}}.__P__-error{margin-top:var(--__P__-space-1);padding:8px 10px;border-radius:var(--__P__-radius-sm);background:var(--__P__-danger-bg);color:var(--__P__-danger-text);font-size:var(--__P__-text-sm);display:flex;align-items:center;gap:var(--__P__-space-2)}.__P__-error button{color:inherit;text-decoration:underline;font-size:var(--__P__-text-sm)}.__P__-history{flex:1;overflow-y:auto;padding:var(--__P__-space-2) var(--__P__-space-1) var(--__P__-space-3)}.__P__-history-footer{flex:none;padding:var(--__P__-space-2) var(--__P__-space-3) var(--__P__-space-3);border-top:1px solid var(--__P__-border);background:var(--__P__-surface)}.__P__-history-new{width:100%;display:flex;align-items:center;justify-content:center;gap:var(--__P__-space-2);padding:var(--__P__-space-2) var(--__P__-space-3);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-on-accent);cursor:pointer;font-size:var(--__P__-text-sm);font-weight:600;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-history-new svg{width:16px;height:16px}.__P__-history-new:hover{filter:brightness(1.08)}.__P__-history-new:active{transform:translateY(1px)}.__P__-history-new:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-history-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 16px;color:var(--__P__-fg-muted);font-size:14px;text-align:center}.__P__-history-group{display:flex;flex-direction:column;padding:0 var(--__P__-space-2)}.__P__-history-heading{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-fg-muted);padding:12px 8px 6px;text-transform:uppercase;letter-spacing:.04em}.__P__-history-item{all:unset;display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-radius:var(--__P__-radius-md);cursor:pointer;transition:background var(--__P__-dur-base) var(--__P__-ease)}.__P__-history-item:hover{background:var(--__P__-bg-elevated)}.__P__-history-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-history-title{font-size:14px;font-weight:500;color:var(--__P__-fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-preview{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-history-item[data-closed=true] .__P__-history-title:after{content:"\\2022";margin-left:var(--__P__-space-2);opacity:.5}.__P__-list-loading{margin:auto;padding:var(--__P__-space-6) var(--__P__-space-4);color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);text-align:center}.__P__-readonly-banner{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 12px;margin:0 var(--__P__-space-3) var(--__P__-space-3);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated);color:var(--__P__-fg-muted);text-align:center;font-size:var(--__P__-text-sm)}.__P__-readonly-label{line-height:1.4}.__P__-readonly-cta{appearance:none;border:0;cursor:pointer;padding:var(--__P__-space-2) var(--__P__-space-4);border-radius:999px;background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-readonly-cta:hover,.__P__-readonly-cta:focus-visible{filter:brightness(1.1)}.__P__-readonly-cta:focus-visible{outline:2px solid var(--__P__-accent);outline-offset:2px}.__P__-composer-footer{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:10px 16px;margin:0 var(--__P__-space-3);border-top:1px solid var(--__P__-border);text-align:center;font-size:11px;line-height:1.4;color:var(--__P__-fg-muted)}.__P__-disclaimer{max-width:320px;margin:0 auto;opacity:.9;letter-spacing:.01em}.__P__-poweredby{display:inline-flex;align-items:center;justify-content:center;gap:6px;color:inherit;text-decoration:none;opacity:.7;transition:opacity var(--__P__-dur-base) var(--__P__-ease);font-size:11px;letter-spacing:.02em}.__P__-poweredby:hover{opacity:1}.__P__-poweredby-logo{height:12px;width:auto;display:inline-block;vertical-align:middle}.__P__-poweredby-bar{flex:none;display:flex;align-items:center;justify-content:center;padding:6px 16px;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated)}.__P__-menu-wrap{position:relative;display:inline-flex}.__P__-menu{position:absolute;top:100%;right:0;margin-top:6px;min-width:200px;padding:6px;background:var(--__P__-bg);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);box-shadow:var(--__P__-shadow-panel);z-index:10;display:flex;flex-direction:column;gap:2px;animation:__P__-menu-in var(--__P__-dur-base) var(--__P__-ease)}@media(prefers-reduced-motion:reduce){.__P__-menu{animation:none}}@keyframes __P__-menu-in{0%{opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right}to{opacity:1;transform:none}}.__P__-menu-item{all:unset;display:flex;align-items:center;gap:10px;padding:8px 10px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);border-radius:var(--__P__-radius-sm);cursor:pointer;user-select:none}.__P__-menu-item:hover{background:var(--__P__-bg-elevated)}.__P__-menu-item:focus-visible{background:var(--__P__-bg-elevated);outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-menu-item[disabled]{opacity:.45;cursor:not-allowed}.__P__-menu-icon{display:inline-flex;width:16px;height:16px;color:var(--__P__-fg-muted)}.__P__-menu-icon svg{width:16px;height:16px}.__P__-menu-label{flex:1}.__P__-menu-check{display:inline-flex;color:var(--__P__-accent)}.__P__-menu-check svg{width:14px;height:14px}.__P__-resize-grip{position:absolute;width:18px;height:18px;display:flex;align-items:center;justify-content:center;color:var(--__P__-fg-muted);opacity:.45;transition:opacity var(--__P__-dur-base) var(--__P__-ease);z-index:2;touch-action:none;user-select:none}.__P__-resize-grip:hover,.__P__-resize-grip:focus-visible{opacity:1}.__P__-resize-grip svg{width:10px;height:10px}.__P__-resize-grip--bottom-left{bottom:2px;left:2px;cursor:nesw-resize;transform:scaleX(-1)}.__P__-resize-grip--bottom-right{bottom:2px;right:2px;cursor:nwse-resize}.__P__-resize-grip--top-left{top:2px;left:2px;cursor:nwse-resize;transform:rotate(180deg)}.__P__-resize-grip--top-right{top:2px;right:2px;cursor:nesw-resize;transform:scaleY(-1)}:host(:not([data-mode="open"])) .__P__-resize-grip{display:none}.__P__-messenger{display:flex;flex-direction:column;overflow:hidden}.__P__-messenger-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.__P__-module{display:flex;flex-direction:column;height:100%;min-height:0}.__P__-module-scroll{flex:1;min-height:0;overflow-y:auto;padding:var(--__P__-space-3);display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-home{background:radial-gradient(125% 65% at 88% 0%,color-mix(in srgb,#fff 16%,transparent),transparent 55%),linear-gradient(180deg,var(--__P__-accent) 0%,var(--__P__-accent) 22%,color-mix(in srgb,var(--__P__-accent) 28%,var(--__P__-surface)) 44%,var(--__P__-surface) 70%);border-radius:var(--__P__-radius-lg) var(--__P__-radius-lg) 0 0}.__P__-home-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;background:transparent}.__P__-home-cards{display:flex;flex-direction:column;gap:var(--__P__-space-3);padding:4px 14px 16px}.__P__-module-pad{padding:var(--__P__-space-3) var(--__P__-space-3) 0}.__P__-module-empty{display:flex;flex-direction:column;align-items:center;gap:var(--__P__-space-3);padding:var(--__P__-space-8) var(--__P__-space-4);text-align:center;color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-module-retry{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border-strong);border-radius:var(--__P__-radius-sm);color:var(--__P__-fg);font-weight:600;cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-module-retry:hover{background:var(--__P__-hover);border-color:var(--__P__-accent)}.__P__-module-retry:active{background:var(--__P__-border)}.__P__-module-retry:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-help-list{flex:1;min-height:0;overflow-y:auto;padding-bottom:var(--__P__-space-3)}.__P__-help-group{display:flex;flex-direction:column}.__P__-help-section-title{position:sticky;top:0;z-index:1;margin:0;padding:var(--__P__-space-3) var(--__P__-space-5) var(--__P__-space-2);font-size:var(--__P__-text-xs);font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--__P__-fg-muted);background:var(--__P__-bg)}.__P__-help-card{margin:0 var(--__P__-space-3) var(--__P__-space-3);background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden}.__P__-help-card .__P__-list-row{border-bottom:0;border-radius:0}.__P__-help-card .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-help-card .__P__-list-row:hover{background:var(--__P__-hover)}.__P__-module-cta{padding:var(--__P__-space-3);border-top:1px solid var(--__P__-border)}.__P__-tabbar{display:flex;border-top:1px solid var(--__P__-border);background:var(--__P__-bg-elevated);flex-shrink:0}.__P__-tab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--__P__-space-1);min-height:48px;padding:var(--__P__-space-2) var(--__P__-space-1);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600;transition:color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-tab:hover{color:var(--__P__-fg)}.__P__-tab[aria-selected=true]{color:var(--__P__-accent)}.__P__-tab:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-tab:active{background:var(--__P__-hover)}.__P__-tab-icon{position:relative;display:inline-flex}.__P__-tab-icon svg{width:22px;height:22px}.__P__-tab-badge{position:absolute;top:-4px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:var(--__P__-accent);color:var(--__P__-on-accent);font-size:10px;font-weight:600;line-height:1}.__P__-home-hero{flex-shrink:0;padding:var(--__P__-space-5) var(--__P__-space-5) var(--__P__-space-3);color:var(--__P__-on-accent);--__P__-focus: var(--__P__-on-accent)}.__P__-home-hero-top{display:flex;align-items:center;justify-content:space-between;gap:var(--__P__-space-3);min-height:32px}.__P__-home-brand{font-size:14px;font-weight:600;letter-spacing:.01em;color:color-mix(in srgb,#fff 82%,transparent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.__P__-home-brand-spacer{flex:1}.__P__-home-hero-actions{display:flex;align-items:center;gap:var(--__P__-space-2);flex-shrink:0}.__P__-home-hero-actions .__P__-icon-btn{color:#fff}.__P__-home-greeting{margin:28px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;overflow-wrap:anywhere}.__P__-home-lead{margin:2px 0 0;font-family:var(--__P__-font-display);font-size:var(--__P__-text-2xl);font-weight:800;line-height:1.18;letter-spacing:-.01em;color:color-mix(in srgb,var(--__P__-on-accent) 88%,transparent);overflow-wrap:anywhere}.__P__-home-avatars{display:flex}.__P__-home-avatar{width:30px;height:30px;border-radius:999px;overflow:hidden;margin-left:-10px;border:2px solid color-mix(in srgb,#fff 92%,transparent);box-shadow:0 1px 3px #0000002e;background:var(--__P__-surface);display:inline-flex;align-items:center;justify-content:center;font-size:var(--__P__-text-xs);font-weight:700;color:var(--__P__-fg)}.__P__-home-avatar:first-child{margin-left:0}.__P__-home-avatar img{width:100%;height:100%;object-fit:cover}.__P__-home-content{background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);box-shadow:var(--__P__-shadow-card);overflow:hidden}.__P__-home-content-title{padding:var(--__P__-space-4) var(--__P__-space-4) var(--__P__-space-3);font-size:var(--__P__-text-sm);font-weight:700}.__P__-home-content-list{display:flex;flex-direction:column;padding:0 var(--__P__-space-2) var(--__P__-space-2)}.__P__-home-content-list .__P__-list-row+.__P__-list-row{border-top:1px solid var(--__P__-border)}.__P__-home-card{display:block;width:100%;text-align:left;background:var(--__P__-surface);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);padding:var(--__P__-space-4);box-shadow:var(--__P__-shadow-card)}.__P__-home-card[data-interactive=true]{cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-home-card[data-interactive=true]:hover{background:var(--__P__-bg-elevated)}.__P__-home-card[data-interactive=true]:active{transform:translateY(1px)}.__P__-home-card[data-interactive=true]:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-recent-row{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-recent-avatar{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;flex-shrink:0;border-radius:999px;background:color-mix(in oklch,var(--__P__-accent) 14%,transparent);color:var(--__P__-accent)}.__P__-home-recent-avatar svg{width:20px;height:20px}.__P__-home-recent-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}.__P__-home-recent-title{font-weight:600;font-size:14px}.__P__-home-recent-preview{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.__P__-home-recent-at{color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);flex-shrink:0}.__P__-home-recent-dot{width:8px;height:8px;border-radius:999px;background:var(--__P__-accent);flex-shrink:0}.__P__-home-recent-row[data-unread=true] .__P__-home-recent-title{font-weight:700}.__P__-home-status{display:flex;align-items:center;gap:var(--__P__-space-3)}.__P__-home-status-icon svg{width:22px;height:22px;color:var(--__P__-success)}.__P__-home-status[data-level=degraded] .__P__-home-status-icon svg{color:var(--__P__-warning)}.__P__-home-status[data-level=down] .__P__-home-status-icon svg{color:var(--__P__-danger)}.__P__-home-status-text{font-weight:600;font-size:14px}.__P__-home-search{display:flex;align-items:center;gap:var(--__P__-space-2);width:100%;padding:var(--__P__-space-3) var(--__P__-space-4);border-radius:var(--__P__-radius);border:1px solid var(--__P__-border);background:var(--__P__-surface);text-align:left}.__P__-home-search[data-input=true]{background:var(--__P__-bg-elevated)}.__P__-home-search:hover{border-color:var(--__P__-border-strong)}.__P__-home-search:focus-visible,.__P__-home-search:focus-within{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-home-search-text{flex:1;color:var(--__P__-fg-muted);font-size:14px}.__P__-home-search-input{flex:1;border:0;background:transparent;font-size:14px;color:var(--__P__-fg);outline:none}.__P__-home-search-icon svg{width:18px;height:18px;color:var(--__P__-accent)}.__P__-list-row{display:flex;align-items:center;gap:var(--__P__-space-3);width:100%;min-height:44px;text-align:left;padding:var(--__P__-space-3) var(--__P__-space-2);border-radius:var(--__P__-radius-sm)}.__P__-list-row:hover{background:var(--__P__-bg-elevated)}.__P__-list-row:active{background:var(--__P__-border)}.__P__-list-row:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:-2px}.__P__-list-row-body{display:flex;flex-direction:column;min-width:0;flex:1}.__P__-list-row-title{font-weight:600;font-size:var(--__P__-text-md);line-height:1.35}.__P__-list-row-sub{color:var(--__P__-fg-muted);font-size:var(--__P__-text-sm);margin-top:var(--__P__-space-1);line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-list-row-chevron svg{width:18px;height:18px;color:var(--__P__-accent);flex-shrink:0}.__P__-back-header{display:flex;align-items:center;gap:var(--__P__-space-2);padding:10px 12px;border-bottom:1px solid var(--__P__-border);flex-shrink:0}.__P__-back-title{flex:1;text-align:center;font-size:var(--__P__-text-md);font-weight:700;margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.__P__-back-spacer{width:32px;height:1px}.__P__-content{display:flex;flex-direction:column;gap:14px;width:100%;max-width:68ch;margin:0 auto}.__P__-content-hero{width:100%;border-radius:var(--__P__-radius)}.__P__-content-subtitle{color:var(--__P__-fg-muted);margin:0}.__P__-content-frame{flex:1;min-height:0;width:100%;border:0;background:#fff}.__P__-news-list{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-news-card{display:block;width:100%;text-align:left;border:1px solid var(--__P__-border);border-radius:var(--__P__-radius);overflow:hidden;background:var(--__P__-surface)}.__P__-news-card{transition:background var(--__P__-dur-quick) var(--__P__-ease-out),transform var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-news-card:hover{background:var(--__P__-bg-elevated)}.__P__-news-card:active{transform:translateY(1px)}.__P__-news-card:focus-visible{outline:2px solid var(--__P__-focus);outline-offset:2px}.__P__-news-hero{width:100%;display:block}.__P__-news-body{display:flex;flex-direction:column;gap:6px;padding:14px 16px}.__P__-news-tags{display:flex;gap:6px;flex-wrap:wrap}.__P__-news-tag{font-size:var(--__P__-text-xs);font-weight:600;color:var(--__P__-accent);background:color-mix(in srgb,var(--__P__-accent) 12%,transparent);padding:2px 8px;border-radius:999px}.__P__-news-title{font-weight:700;font-size:var(--__P__-text-md)}.__P__-news-summary{color:var(--__P__-fg-muted);font-size:14px;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.__P__-modules-empty{display:flex;align-items:center;justify-content:center;position:relative}.__P__-modules-empty-close{position:absolute;top:12px;right:12px}.__P__-modules-empty-text{color:var(--__P__-fg-muted);font-size:var(--__P__-text-base)}.__P__-form{display:flex;flex-direction:column;gap:var(--__P__-space-3)}.__P__-field{display:flex;flex-direction:column;gap:4px}.__P__-field-label{font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-field-req{color:var(--__P__-danger)}.__P__-field-input{width:100%;box-sizing:border-box;padding:var(--__P__-space-2) var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg);color:var(--__P__-fg);font:inherit;font-size:var(--__P__-text-sm);resize:vertical;transition:border-color var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-field-input:focus-visible{outline:none;border-color:var(--__P__-accent)}.__P__-field[data-invalid=true] .__P__-field-input{border-color:var(--__P__-danger)}.__P__-field-hint{font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-field-error{font-size:var(--__P__-text-xs);color:var(--__P__-danger)}.__P__-field-choices{display:flex;flex-direction:column;gap:6px}.__P__-choice{display:flex;align-items:flex-start;gap:8px;font-size:var(--__P__-text-sm);color:var(--__P__-fg);cursor:pointer}.__P__-choice input{margin-top:2px;accent-color:var(--__P__-accent)}.__P__-form-actions{display:flex;justify-content:flex-end;gap:var(--__P__-space-2);margin-top:2px}.__P__-form-submit,.__P__-tool-approve{padding:var(--__P__-space-2) var(--__P__-space-4);border:none;border-radius:var(--__P__-radius-md);background:var(--__P__-accent);color:var(--__P__-accent-text, #fff);font:inherit;font-weight:600;font-size:var(--__P__-text-sm);cursor:pointer;transition:filter var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-submit:hover:not(:disabled),.__P__-tool-approve:hover:not(:disabled){filter:brightness(1.06)}.__P__-form-submit:disabled{opacity:.6;cursor:default}.__P__-form-skip,.__P__-tool-reject{padding:var(--__P__-space-2) var(--__P__-space-4);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:transparent;color:var(--__P__-fg-muted);font:inherit;font-size:var(--__P__-text-sm);cursor:pointer;transition:background var(--__P__-dur-quick) var(--__P__-ease-out)}.__P__-form-skip:hover:not(:disabled),.__P__-tool-reject:hover:not(:disabled){background:var(--__P__-bg-elevated)}.__P__-form-gate{display:flex;flex-direction:column;gap:var(--__P__-space-2);padding:var(--__P__-space-3) var(--__P__-space-4) var(--__P__-space-4);border-top:1px solid var(--__P__-border);overflow-y:auto}.__P__-form-gate-title{margin:0;font-size:var(--__P__-text-base);font-weight:700;color:var(--__P__-fg)}.__P__-form-gate-desc{margin:0 0 var(--__P__-space-1);font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-form-card{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin:var(--__P__-space-2) 0;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-form-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.__P__-form-card-title{font-size:var(--__P__-text-sm);font-weight:700;color:var(--__P__-fg)}.__P__-form-card-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-ask-input,.__P__-tool-approval{display:flex;flex-direction:column;gap:var(--__P__-space-2);margin-top:6px;padding:var(--__P__-space-3);border:1px solid var(--__P__-border);border-radius:var(--__P__-radius-md);background:var(--__P__-bg-elevated)}.__P__-tool-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-badge{padding:2px 8px;border-radius:999px;background:var(--__P__-warning, #f59e0b);color:#1a1206;font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-title{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}.__P__-tool-question{margin:0;font-size:var(--__P__-text-sm);font-weight:600;color:var(--__P__-fg)}.__P__-tool-desc{margin:0;font-size:var(--__P__-text-sm);color:var(--__P__-fg-muted)}.__P__-tool-args{margin:0;padding:var(--__P__-space-2);max-height:160px;overflow:auto;border-radius:var(--__P__-radius-sm);background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);white-space:pre-wrap;word-break:break-word}.__P__-tool-stale-note{margin:0;font-size:var(--__P__-text-xs);color:var(--__P__-fg-muted)}.__P__-tool-decided{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}.__P__-tool-decided-label{padding:2px 8px;border-radius:999px;background:var(--__P__-bg);border:1px solid var(--__P__-border);color:var(--__P__-fg-muted);font-size:var(--__P__-text-xs);font-weight:600}.__P__-tool-decided-label[data-approved=true]{color:var(--__P__-success, #16a34a);border-color:var(--__P__-success, #16a34a)}.__P__-tool-decided-label[data-approved=false]{color:var(--__P__-danger);border-color:var(--__P__-danger)}.__P__-tool-decided-value{font-size:var(--__P__-text-sm);color:var(--__P__-fg)}\n';
|
|
874
916
|
|
|
875
917
|
// src/styles/standalone.css
|
|
876
918
|
var standalone_default = ".__P__-standalone-page{margin:0;height:100vh;background:var(--__P__-bg, #fff);display:grid;place-items:stretch}\n";
|
|
@@ -958,22 +1000,22 @@ function attachAdoptedSheet(shadow, doc) {
|
|
|
958
1000
|
}
|
|
959
1001
|
}
|
|
960
1002
|
function applyThemeOverrides(host, overrides) {
|
|
961
|
-
const
|
|
962
|
-
if (overrides.accent) host.style.setProperty(`--${
|
|
963
|
-
if (overrides.accentText) host.style.setProperty(`--${
|
|
964
|
-
if (overrides.radius) host.style.setProperty(`--${
|
|
965
|
-
if (overrides.fontFamily) host.style.setProperty(`--${
|
|
1003
|
+
const p34 = BRAND.cssPrefix;
|
|
1004
|
+
if (overrides.accent) host.style.setProperty(`--${p34}-accent`, overrides.accent);
|
|
1005
|
+
if (overrides.accentText) host.style.setProperty(`--${p34}-accent-text`, overrides.accentText);
|
|
1006
|
+
if (overrides.radius) host.style.setProperty(`--${p34}-radius`, overrides.radius);
|
|
1007
|
+
if (overrides.fontFamily) host.style.setProperty(`--${p34}-font`, overrides.fontFamily);
|
|
966
1008
|
}
|
|
967
1009
|
function applyThemeMode(host, mode) {
|
|
968
1010
|
host.dataset.theme = mode;
|
|
969
1011
|
}
|
|
970
1012
|
function applySize(host, size) {
|
|
971
|
-
const
|
|
972
|
-
if (size.width !== void 0) host.style.setProperty(`--${
|
|
973
|
-
if (size.height !== void 0) host.style.setProperty(`--${
|
|
974
|
-
if (size.expanded?.width !== void 0) host.style.setProperty(`--${
|
|
975
|
-
if (size.expanded?.height !== void 0) host.style.setProperty(`--${
|
|
976
|
-
if (size.inset !== void 0) host.style.setProperty(`--${
|
|
1013
|
+
const p34 = BRAND.cssPrefix;
|
|
1014
|
+
if (size.width !== void 0) host.style.setProperty(`--${p34}-panel-w`, size.width);
|
|
1015
|
+
if (size.height !== void 0) host.style.setProperty(`--${p34}-panel-h`, size.height);
|
|
1016
|
+
if (size.expanded?.width !== void 0) host.style.setProperty(`--${p34}-expanded-w`, size.expanded.width);
|
|
1017
|
+
if (size.expanded?.height !== void 0) host.style.setProperty(`--${p34}-expanded-h`, size.expanded.height);
|
|
1018
|
+
if (size.inset !== void 0) host.style.setProperty(`--${p34}-panel-inset`, size.inset);
|
|
977
1019
|
}
|
|
978
1020
|
function applyPosition(host, pos) {
|
|
979
1021
|
host.dataset.position = pos;
|
|
@@ -1075,7 +1117,7 @@ var StreamError = class extends Error {
|
|
|
1075
1117
|
|
|
1076
1118
|
// src/stream/parser.ts
|
|
1077
1119
|
var log3 = logger.scope("parser");
|
|
1078
|
-
async function* parseChatStream(response,
|
|
1120
|
+
async function* parseChatStream(response, signal7) {
|
|
1079
1121
|
if (!response.ok) {
|
|
1080
1122
|
const text = await response.text().catch(() => "");
|
|
1081
1123
|
throw new StreamError(`server responded ${response.status}: ${text.slice(0, 200)}`, "server", response.status);
|
|
@@ -1085,7 +1127,7 @@ async function* parseChatStream(response, signal6) {
|
|
|
1085
1127
|
let buffer = "";
|
|
1086
1128
|
try {
|
|
1087
1129
|
while (true) {
|
|
1088
|
-
if (
|
|
1130
|
+
if (signal7.aborted) throw new DOMException("aborted", "AbortError");
|
|
1089
1131
|
const { done, value } = await reader.read();
|
|
1090
1132
|
if (done) {
|
|
1091
1133
|
const trailing = buffer.trim();
|
|
@@ -1144,11 +1186,11 @@ function toBase64Url(json) {
|
|
|
1144
1186
|
var nonEmpty = (ctx) => ctx && Object.keys(ctx).length > 0 ? ctx : void 0;
|
|
1145
1187
|
function encodeContext(user, page) {
|
|
1146
1188
|
const u = nonEmpty(user);
|
|
1147
|
-
const
|
|
1148
|
-
if (!u && !
|
|
1189
|
+
const p34 = nonEmpty(page);
|
|
1190
|
+
if (!u && !p34) return void 0;
|
|
1149
1191
|
const envelope = {};
|
|
1150
1192
|
if (u) envelope.user = u;
|
|
1151
|
-
if (
|
|
1193
|
+
if (p34) envelope.page = p34;
|
|
1152
1194
|
return toBase64Url(JSON.stringify(envelope));
|
|
1153
1195
|
}
|
|
1154
1196
|
|
|
@@ -1189,13 +1231,12 @@ var DEFAULT_PATHS = {
|
|
|
1189
1231
|
/** All widget content via one filtered endpoint. `GET /ai/agent/content?tags=…`. */
|
|
1190
1232
|
content: "/ai/agent/content",
|
|
1191
1233
|
/**
|
|
1192
|
-
*
|
|
1193
|
-
* skipped? }` → record the
|
|
1194
|
-
*
|
|
1195
|
-
* Overridable via `endpoints.
|
|
1196
|
-
* is ignored.
|
|
1234
|
+
* Form submission (the event-driven forms engine). POST `{ visitorId,
|
|
1235
|
+
* sessionId, formId, trigger, values, skipped? }` → record the form's answers
|
|
1236
|
+
* immediately, keyed by the same visitor + session as the conversation.
|
|
1237
|
+
* Overridable via `endpoints.submitForm`. Fire-and-forget; 404 is ignored.
|
|
1197
1238
|
*/
|
|
1198
|
-
|
|
1239
|
+
submitForm: "/ai/agent/submit-form"
|
|
1199
1240
|
};
|
|
1200
1241
|
var CONTEXT_PARAM = "context";
|
|
1201
1242
|
function buildSendMessageRequest(params) {
|
|
@@ -1219,8 +1260,8 @@ function buildSendMessageRequest(params) {
|
|
|
1219
1260
|
if (Object.keys(data).length > 0) body.data = data;
|
|
1220
1261
|
return body;
|
|
1221
1262
|
}
|
|
1222
|
-
function isResolvedToolPart(
|
|
1223
|
-
return
|
|
1263
|
+
function isResolvedToolPart(p34) {
|
|
1264
|
+
return p34.state === "output" || p34.state === "error" || p34.approval?.approved !== void 0;
|
|
1224
1265
|
}
|
|
1225
1266
|
function normalizeToolRef(ref) {
|
|
1226
1267
|
if (typeof ref === "string") return ref ? { code: ref } : null;
|
|
@@ -1228,24 +1269,24 @@ function normalizeToolRef(ref) {
|
|
|
1228
1269
|
}
|
|
1229
1270
|
function messageToWireParts(m) {
|
|
1230
1271
|
const out = [];
|
|
1231
|
-
for (const
|
|
1232
|
-
if (
|
|
1233
|
-
out.push({ text:
|
|
1272
|
+
for (const p34 of m.parts) {
|
|
1273
|
+
if (p34.kind === "text" && p34.text) {
|
|
1274
|
+
out.push({ text: p34.text, type: "text" });
|
|
1234
1275
|
}
|
|
1235
|
-
if (
|
|
1236
|
-
out.push({ mediaType:
|
|
1276
|
+
if (p34.kind === "file" && p34.url) {
|
|
1277
|
+
out.push({ mediaType: p34.mediaType, type: "file", url: p34.url });
|
|
1237
1278
|
}
|
|
1238
|
-
if (
|
|
1279
|
+
if (p34.kind === "tool" && isResolvedToolPart(p34)) {
|
|
1239
1280
|
const part = {
|
|
1240
1281
|
type: "tool",
|
|
1241
|
-
toolCallId:
|
|
1242
|
-
toolName:
|
|
1243
|
-
state:
|
|
1282
|
+
toolCallId: p34.toolCallId,
|
|
1283
|
+
toolName: p34.toolName,
|
|
1284
|
+
state: p34.state
|
|
1244
1285
|
};
|
|
1245
|
-
if (
|
|
1246
|
-
if (
|
|
1247
|
-
if (
|
|
1248
|
-
if (
|
|
1286
|
+
if (p34.input !== void 0) part.input = p34.input;
|
|
1287
|
+
if (p34.output !== void 0) part.output = p34.output;
|
|
1288
|
+
if (p34.error !== void 0) part.errorText = p34.error;
|
|
1289
|
+
if (p34.approval && p34.approval.approved !== void 0) part.approval = p34.approval;
|
|
1249
1290
|
out.push(part);
|
|
1250
1291
|
}
|
|
1251
1292
|
}
|
|
@@ -1279,15 +1320,15 @@ function retryAfterMs(headers) {
|
|
|
1279
1320
|
const ms = Number.isFinite(secs) ? secs * 1e3 : Date.parse(raw) - Date.now();
|
|
1280
1321
|
return Number.isFinite(ms) && ms >= 0 ? Math.min(ms, 3e4) : null;
|
|
1281
1322
|
}
|
|
1282
|
-
function sleep(ms,
|
|
1323
|
+
function sleep(ms, signal7) {
|
|
1283
1324
|
return new Promise((resolve) => {
|
|
1284
|
-
if (
|
|
1325
|
+
if (signal7?.aborted) return resolve();
|
|
1285
1326
|
const id = setTimeout(done, ms);
|
|
1286
1327
|
const onAbort = () => done();
|
|
1287
|
-
|
|
1328
|
+
signal7?.addEventListener("abort", onAbort, { once: true });
|
|
1288
1329
|
function done() {
|
|
1289
1330
|
clearTimeout(id);
|
|
1290
|
-
|
|
1331
|
+
signal7?.removeEventListener("abort", onAbort);
|
|
1291
1332
|
resolve();
|
|
1292
1333
|
}
|
|
1293
1334
|
});
|
|
@@ -1493,23 +1534,22 @@ var AgentTransport = class {
|
|
|
1493
1534
|
get transcribePath() {
|
|
1494
1535
|
return this.opts.endpoints?.transcribe ?? "/ai/agent/transcribe-audio";
|
|
1495
1536
|
}
|
|
1496
|
-
get
|
|
1497
|
-
return this.opts.endpoints?.
|
|
1537
|
+
get submitFormPath() {
|
|
1538
|
+
return this.opts.endpoints?.submitForm ?? DEFAULT_PATHS.submitForm;
|
|
1498
1539
|
}
|
|
1499
1540
|
/**
|
|
1500
|
-
* Record a completed
|
|
1501
|
-
* captured even if the visitor never sends a message. `sessionId
|
|
1502
|
-
*
|
|
1503
|
-
* ride the envelope. A failure (e.g. 404 on a backend
|
|
1504
|
-
* the endpoint) is non-fatal
|
|
1505
|
-
* `userContext` on the next message, so callers don't await this.
|
|
1541
|
+
* Record a completed form (intake, CSAT, claim, …). Fire-and-forget — the
|
|
1542
|
+
* record is captured even if the visitor never sends a message. `sessionId`,
|
|
1543
|
+
* `formId`, and `trigger` are explicit so the backend can tie + route;
|
|
1544
|
+
* `visitorId` + context ride the envelope. A failure (e.g. 404 on a backend
|
|
1545
|
+
* that doesn't implement the endpoint) is non-fatal, so callers don't await.
|
|
1506
1546
|
*/
|
|
1507
|
-
async
|
|
1508
|
-
log4.debug("
|
|
1547
|
+
async submitForm(body) {
|
|
1548
|
+
log4.debug("submitForm \u2192", { formId: body.formId, trigger: body.trigger, fields: Object.keys(body.values).length });
|
|
1509
1549
|
try {
|
|
1510
|
-
await this.postJson(this.
|
|
1550
|
+
await this.postJson(this.submitFormPath, body, "submitForm");
|
|
1511
1551
|
} catch (err) {
|
|
1512
|
-
log4.debug("
|
|
1552
|
+
log4.debug("submitForm failed (non-fatal)", { err });
|
|
1513
1553
|
}
|
|
1514
1554
|
}
|
|
1515
1555
|
sendMessage(body) {
|
|
@@ -1649,7 +1689,7 @@ var AgentTransport = class {
|
|
|
1649
1689
|
}).catch((err) => log4.debug("cancel POST failed (non-fatal)", { err }));
|
|
1650
1690
|
}
|
|
1651
1691
|
// ---- Low-level fetch helpers ------------------------------------------
|
|
1652
|
-
async *openMessageStream(body,
|
|
1692
|
+
async *openMessageStream(body, signal7) {
|
|
1653
1693
|
const res = await this.fetchImpl(this.url(DEFAULT_PATHS.streamMessage), {
|
|
1654
1694
|
method: "POST",
|
|
1655
1695
|
credentials: "omit",
|
|
@@ -1659,9 +1699,9 @@ var AgentTransport = class {
|
|
|
1659
1699
|
...this.opts.auth.headers()
|
|
1660
1700
|
},
|
|
1661
1701
|
body: JSON.stringify(this.withEnvelope(body)),
|
|
1662
|
-
signal:
|
|
1702
|
+
signal: signal7
|
|
1663
1703
|
});
|
|
1664
|
-
yield* parseChatStream(res,
|
|
1704
|
+
yield* parseChatStream(res, signal7);
|
|
1665
1705
|
}
|
|
1666
1706
|
/**
|
|
1667
1707
|
* Resume URL: `GET /stream-resume` with the envelope (visitorId / sessionId /
|
|
@@ -1839,7 +1879,7 @@ function fromWireMessage(w) {
|
|
|
1839
1879
|
};
|
|
1840
1880
|
}
|
|
1841
1881
|
return null;
|
|
1842
|
-
}).filter((
|
|
1882
|
+
}).filter((p34) => p34 !== null);
|
|
1843
1883
|
return {
|
|
1844
1884
|
id: w.id,
|
|
1845
1885
|
role: w.role,
|
|
@@ -1869,43 +1909,43 @@ function assistantText(m) {
|
|
|
1869
1909
|
}
|
|
1870
1910
|
return out;
|
|
1871
1911
|
}
|
|
1872
|
-
function partToReactive(
|
|
1873
|
-
if (
|
|
1874
|
-
return { kind:
|
|
1912
|
+
function partToReactive(p34) {
|
|
1913
|
+
if (p34.kind === "text" || p34.kind === "reasoning") {
|
|
1914
|
+
return { kind: p34.kind, id: p34.id, textSig: signal(p34.text), doneSig: signal(p34.done) };
|
|
1875
1915
|
}
|
|
1876
|
-
if (
|
|
1916
|
+
if (p34.kind === "tool") {
|
|
1877
1917
|
return {
|
|
1878
1918
|
kind: "tool",
|
|
1879
|
-
toolCallId:
|
|
1880
|
-
toolName:
|
|
1881
|
-
inputPartialSig: signal(
|
|
1882
|
-
inputSig: signal(
|
|
1883
|
-
outputSig: signal(
|
|
1884
|
-
errorSig: signal(
|
|
1885
|
-
stateSig: signal(
|
|
1886
|
-
approvalSig: signal(
|
|
1919
|
+
toolCallId: p34.toolCallId,
|
|
1920
|
+
toolName: p34.toolName,
|
|
1921
|
+
inputPartialSig: signal(p34.inputPartial),
|
|
1922
|
+
inputSig: signal(p34.input),
|
|
1923
|
+
outputSig: signal(p34.output),
|
|
1924
|
+
errorSig: signal(p34.error),
|
|
1925
|
+
stateSig: signal(p34.state),
|
|
1926
|
+
approvalSig: signal(p34.approval)
|
|
1887
1927
|
};
|
|
1888
1928
|
}
|
|
1889
|
-
return
|
|
1929
|
+
return p34;
|
|
1890
1930
|
}
|
|
1891
|
-
function partFromReactive(
|
|
1892
|
-
if (
|
|
1893
|
-
return { kind:
|
|
1931
|
+
function partFromReactive(p34) {
|
|
1932
|
+
if (p34.kind === "text" || p34.kind === "reasoning") {
|
|
1933
|
+
return { kind: p34.kind, id: p34.id, text: p34.textSig.value, done: p34.doneSig.value };
|
|
1894
1934
|
}
|
|
1895
|
-
if (
|
|
1935
|
+
if (p34.kind === "tool") {
|
|
1896
1936
|
return {
|
|
1897
1937
|
kind: "tool",
|
|
1898
|
-
toolCallId:
|
|
1899
|
-
toolName:
|
|
1900
|
-
inputPartial:
|
|
1901
|
-
input:
|
|
1902
|
-
output:
|
|
1903
|
-
error:
|
|
1904
|
-
state:
|
|
1905
|
-
approval:
|
|
1938
|
+
toolCallId: p34.toolCallId,
|
|
1939
|
+
toolName: p34.toolName,
|
|
1940
|
+
inputPartial: p34.inputPartialSig.value,
|
|
1941
|
+
input: p34.inputSig.value,
|
|
1942
|
+
output: p34.outputSig.value,
|
|
1943
|
+
error: p34.errorSig.value,
|
|
1944
|
+
state: p34.stateSig.value,
|
|
1945
|
+
approval: p34.approvalSig.value
|
|
1906
1946
|
};
|
|
1907
1947
|
}
|
|
1908
|
-
return
|
|
1948
|
+
return p34;
|
|
1909
1949
|
}
|
|
1910
1950
|
|
|
1911
1951
|
// src/stream/reducer.ts
|
|
@@ -1914,9 +1954,7 @@ import { signal as signal2 } from "@preact/signals";
|
|
|
1914
1954
|
// src/stream/constants.ts
|
|
1915
1955
|
var ASK_USER_INPUT_TOOL = "tool:ask-user-input";
|
|
1916
1956
|
function isAskUserInputTool(toolName) {
|
|
1917
|
-
|
|
1918
|
-
const t = toolName.toLowerCase();
|
|
1919
|
-
return t === ASK_USER_INPUT_TOOL || t === "ask-user-input" || t === "ask_user_input";
|
|
1957
|
+
return toolName === ASK_USER_INPUT_TOOL;
|
|
1920
1958
|
}
|
|
1921
1959
|
var TRIGGER = {
|
|
1922
1960
|
submitMessage: "submit-message",
|
|
@@ -1962,8 +2000,8 @@ var StreamReducer = class {
|
|
|
1962
2000
|
ensureTextPart(m, "text", chunk.id);
|
|
1963
2001
|
return;
|
|
1964
2002
|
case "text-delta": {
|
|
1965
|
-
const
|
|
1966
|
-
|
|
2003
|
+
const p34 = ensureTextPart(m, "text", chunk.id);
|
|
2004
|
+
p34.textSig.value += chunk.delta;
|
|
1967
2005
|
return;
|
|
1968
2006
|
}
|
|
1969
2007
|
case "text-end":
|
|
@@ -1973,8 +2011,8 @@ var StreamReducer = class {
|
|
|
1973
2011
|
ensureTextPart(m, "reasoning", chunk.id).doneSig.value = false;
|
|
1974
2012
|
return;
|
|
1975
2013
|
case "reasoning-delta": {
|
|
1976
|
-
const
|
|
1977
|
-
|
|
2014
|
+
const p34 = ensureTextPart(m, "reasoning", chunk.id);
|
|
2015
|
+
p34.textSig.value += chunk.delta;
|
|
1978
2016
|
return;
|
|
1979
2017
|
}
|
|
1980
2018
|
case "reasoning-end":
|
|
@@ -1993,7 +2031,7 @@ var StreamReducer = class {
|
|
|
1993
2031
|
return;
|
|
1994
2032
|
case "source-url": {
|
|
1995
2033
|
const parts = m.partsSig.value;
|
|
1996
|
-
if (parts.some((
|
|
2034
|
+
if (parts.some((p34) => p34.kind === "source" && p34.sourceId === chunk.sourceId)) return;
|
|
1997
2035
|
appendPart(m, { kind: "source", sourceId: chunk.sourceId, url: chunk.url, title: chunk.title });
|
|
1998
2036
|
return;
|
|
1999
2037
|
}
|
|
@@ -2017,14 +2055,14 @@ var StreamReducer = class {
|
|
|
2017
2055
|
}
|
|
2018
2056
|
};
|
|
2019
2057
|
function ensureTextPart(m, kind, id) {
|
|
2020
|
-
const existing = m.partsSig.value.find((
|
|
2058
|
+
const existing = m.partsSig.value.find((p34) => p34.kind === kind && p34.id === id);
|
|
2021
2059
|
if (existing) return existing;
|
|
2022
2060
|
const part = { kind, id, textSig: signal2(""), doneSig: signal2(false) };
|
|
2023
2061
|
appendPart(m, part);
|
|
2024
2062
|
return part;
|
|
2025
2063
|
}
|
|
2026
2064
|
function ensureToolPart(m, toolCallId, toolName) {
|
|
2027
|
-
const existing = m.partsSig.value.find((
|
|
2065
|
+
const existing = m.partsSig.value.find((p34) => p34.kind === "tool" && p34.toolCallId === toolCallId);
|
|
2028
2066
|
if (existing) return existing;
|
|
2029
2067
|
const part = {
|
|
2030
2068
|
kind: "tool",
|
|
@@ -2049,32 +2087,32 @@ function applyTool(m, chunk) {
|
|
|
2049
2087
|
ensureToolPart(m, chunk.toolCallId, chunk.toolName);
|
|
2050
2088
|
return;
|
|
2051
2089
|
case "tool-input-delta": {
|
|
2052
|
-
const
|
|
2053
|
-
|
|
2090
|
+
const p34 = ensureToolPart(m, chunk.toolCallId);
|
|
2091
|
+
p34.inputPartialSig.value += chunk.delta;
|
|
2054
2092
|
return;
|
|
2055
2093
|
}
|
|
2056
2094
|
case "tool-input-available": {
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2059
|
-
|
|
2095
|
+
const p34 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
|
|
2096
|
+
p34.inputSig.value = chunk.input;
|
|
2097
|
+
p34.stateSig.value = isAskUserInputTool(p34.toolName) ? "awaiting-input" : "awaiting";
|
|
2060
2098
|
return;
|
|
2061
2099
|
}
|
|
2062
2100
|
case "tool-approval-request": {
|
|
2063
|
-
const
|
|
2064
|
-
|
|
2065
|
-
|
|
2101
|
+
const p34 = ensureToolPart(m, chunk.toolCallId, chunk.toolName);
|
|
2102
|
+
p34.approvalSig.value = { id: chunk.approvalId };
|
|
2103
|
+
p34.stateSig.value = "awaiting-approval";
|
|
2066
2104
|
return;
|
|
2067
2105
|
}
|
|
2068
2106
|
case "tool-output-available": {
|
|
2069
|
-
const
|
|
2070
|
-
|
|
2071
|
-
|
|
2107
|
+
const p34 = ensureToolPart(m, chunk.toolCallId);
|
|
2108
|
+
p34.outputSig.value = chunk.output;
|
|
2109
|
+
p34.stateSig.value = "output";
|
|
2072
2110
|
return;
|
|
2073
2111
|
}
|
|
2074
2112
|
case "tool-output-error": {
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2077
|
-
|
|
2113
|
+
const p34 = ensureToolPart(m, chunk.toolCallId);
|
|
2114
|
+
p34.errorSig.value = chunk.errorText;
|
|
2115
|
+
p34.stateSig.value = "error";
|
|
2078
2116
|
return;
|
|
2079
2117
|
}
|
|
2080
2118
|
default:
|
|
@@ -2094,7 +2132,7 @@ function createPersistence(widgetId, storage = defaultStorage) {
|
|
|
2094
2132
|
const KEY_CALLOUT_DISMISSED = `${prefix}.calloutDismissed`;
|
|
2095
2133
|
const KEY_SIDEBAR_COLLAPSED = `${prefix}.sidebarCollapsed`;
|
|
2096
2134
|
const KEY_ACTIVE_MODULE = `${prefix}.activeModule`;
|
|
2097
|
-
const
|
|
2135
|
+
const KEY_FORMS_DONE = `${prefix}.formsDone`;
|
|
2098
2136
|
const persistence = {
|
|
2099
2137
|
getVisitorId() {
|
|
2100
2138
|
const existing = storage.get(KEY_VISITOR);
|
|
@@ -2177,22 +2215,24 @@ function createPersistence(widgetId, storage = defaultStorage) {
|
|
|
2177
2215
|
saveActiveModule(id) {
|
|
2178
2216
|
storage.set(KEY_ACTIVE_MODULE, id);
|
|
2179
2217
|
},
|
|
2180
|
-
|
|
2181
|
-
const raw = storage.get(
|
|
2182
|
-
if (!raw) return
|
|
2218
|
+
loadFormsDone() {
|
|
2219
|
+
const raw = storage.get(KEY_FORMS_DONE);
|
|
2220
|
+
if (!raw) return {};
|
|
2183
2221
|
try {
|
|
2184
2222
|
const parsed = JSON.parse(raw);
|
|
2185
|
-
return isPlainObject2(parsed) ? parsed :
|
|
2223
|
+
return isPlainObject2(parsed) ? parsed : {};
|
|
2186
2224
|
} catch (error) {
|
|
2187
|
-
log6.warn("
|
|
2188
|
-
return
|
|
2225
|
+
log6.warn("loadFormsDone parse failed", { error });
|
|
2226
|
+
return {};
|
|
2189
2227
|
}
|
|
2190
2228
|
},
|
|
2191
|
-
|
|
2229
|
+
saveFormDone(id) {
|
|
2192
2230
|
try {
|
|
2193
|
-
|
|
2231
|
+
const done = persistence.loadFormsDone();
|
|
2232
|
+
done[id] = Date.now();
|
|
2233
|
+
storage.set(KEY_FORMS_DONE, JSON.stringify(done));
|
|
2194
2234
|
} catch (error) {
|
|
2195
|
-
log6.warn("
|
|
2235
|
+
log6.warn("saveFormDone serialise failed", { error });
|
|
2196
2236
|
}
|
|
2197
2237
|
},
|
|
2198
2238
|
clearSession() {
|
|
@@ -2737,13 +2777,17 @@ var TID = {
|
|
|
2737
2777
|
helpArticle: `${p2}-help-article`,
|
|
2738
2778
|
/** News list item — suffix `-{id}`. */
|
|
2739
2779
|
newsItem: `${p2}-news-item`,
|
|
2740
|
-
// ── Forms + human-in-the-loop (
|
|
2741
|
-
/**
|
|
2742
|
-
|
|
2743
|
-
/**
|
|
2744
|
-
|
|
2745
|
-
/**
|
|
2746
|
-
|
|
2780
|
+
// ── Forms + human-in-the-loop (forms / ask-input / approval) ─────
|
|
2781
|
+
/** Blocking form gate root (replaces the composer). */
|
|
2782
|
+
formGate: `${p2}-form-gate`,
|
|
2783
|
+
/** Inline form card root (in the transcript). */
|
|
2784
|
+
formCard: `${p2}-form-card`,
|
|
2785
|
+
/** Form submit button. */
|
|
2786
|
+
formSubmit: `${p2}-form-submit`,
|
|
2787
|
+
/** Form skip button (blocking gate, when `skippable`). */
|
|
2788
|
+
formSkip: `${p2}-form-skip`,
|
|
2789
|
+
/** Inline form-card dismiss button. */
|
|
2790
|
+
formDismiss: `${p2}-form-dismiss`,
|
|
2747
2791
|
/** A single form field control — suffix `-{name}` at the JSX site. */
|
|
2748
2792
|
formField: `${p2}-form-field`,
|
|
2749
2793
|
/** Ask-input tool root (inline form in a message bubble). */
|
|
@@ -2870,24 +2914,24 @@ import { useCallback as useCallback2, useEffect as useEffect10, useRef as useRef
|
|
|
2870
2914
|
import { useEffect as useEffect2, useRef } from "preact/hooks";
|
|
2871
2915
|
import { jsx as jsx3 } from "preact/jsx-runtime";
|
|
2872
2916
|
function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, strings }) {
|
|
2873
|
-
const
|
|
2917
|
+
const p34 = BRAND.cssPrefix;
|
|
2874
2918
|
const dragRef = useRef(null);
|
|
2875
2919
|
useEffect2(() => {
|
|
2876
2920
|
if (!panelEl) return;
|
|
2877
2921
|
const style = panelEl.style;
|
|
2878
|
-
if (resize.minWidth) style.setProperty(`--${
|
|
2879
|
-
if (resize.maxWidth) style.setProperty(`--${
|
|
2880
|
-
if (resize.minHeight) style.setProperty(`--${
|
|
2881
|
-
if (resize.maxHeight) style.setProperty(`--${
|
|
2922
|
+
if (resize.minWidth) style.setProperty(`--${p34}-resize-min-w`, resize.minWidth);
|
|
2923
|
+
if (resize.maxWidth) style.setProperty(`--${p34}-resize-max-w`, resize.maxWidth);
|
|
2924
|
+
if (resize.minHeight) style.setProperty(`--${p34}-resize-min-h`, resize.minHeight);
|
|
2925
|
+
if (resize.maxHeight) style.setProperty(`--${p34}-resize-max-h`, resize.maxHeight);
|
|
2882
2926
|
if (initialSize) {
|
|
2883
|
-
style.setProperty(`--${
|
|
2884
|
-
style.setProperty(`--${
|
|
2927
|
+
style.setProperty(`--${p34}-widget-w`, `${initialSize.width}px`);
|
|
2928
|
+
style.setProperty(`--${p34}-widget-h`, `${initialSize.height}px`);
|
|
2885
2929
|
}
|
|
2886
|
-
}, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight,
|
|
2930
|
+
}, [panelEl, resize.minWidth, resize.maxWidth, resize.minHeight, resize.maxHeight, p34, initialSize]);
|
|
2887
2931
|
if (!panelEl) return null;
|
|
2888
2932
|
const isTop = position.startsWith("top-");
|
|
2889
2933
|
const isRight = position.endsWith("-right");
|
|
2890
|
-
const cornerClass = `${
|
|
2934
|
+
const cornerClass = `${p34}-resize-grip ${p34}-resize-grip--${isTop ? "bottom" : "top"}-${isRight ? "left" : "right"}`;
|
|
2891
2935
|
const onPointerDown = (e) => {
|
|
2892
2936
|
if (!panelEl) return;
|
|
2893
2937
|
const target = e.currentTarget;
|
|
@@ -2911,8 +2955,8 @@ function ResizeGrip({ panelEl, resize, position, initialSize, onSizeChange, stri
|
|
|
2911
2955
|
if (!d || e.pointerId !== d.pointerId || !panelEl) return;
|
|
2912
2956
|
const dx = (e.clientX - d.startX) * d.dirX;
|
|
2913
2957
|
const dy = (e.clientY - d.startY) * d.dirY;
|
|
2914
|
-
panelEl.style.setProperty(`--${
|
|
2915
|
-
panelEl.style.setProperty(`--${
|
|
2958
|
+
panelEl.style.setProperty(`--${p34}-widget-w`, `${d.startW + dx}px`);
|
|
2959
|
+
panelEl.style.setProperty(`--${p34}-widget-h`, `${d.startH + dy}px`);
|
|
2916
2960
|
};
|
|
2917
2961
|
const onPointerUp = (e) => {
|
|
2918
2962
|
const d = dragRef.current;
|
|
@@ -3647,20 +3691,20 @@ function usePopoverMenu({ itemCount, initialFocusIndex }) {
|
|
|
3647
3691
|
// src/ui/overflow-menu.tsx
|
|
3648
3692
|
import { jsx as jsx8, jsxs as jsxs6 } from "preact/jsx-runtime";
|
|
3649
3693
|
function OverflowMenu({ items, triggerLabel }) {
|
|
3650
|
-
const
|
|
3694
|
+
const p34 = BRAND.cssPrefix;
|
|
3651
3695
|
const menu = usePopoverMenu({ itemCount: items.length });
|
|
3652
3696
|
const handleSelect = (item) => {
|
|
3653
3697
|
if (item.disabled) return;
|
|
3654
3698
|
item.onSelect();
|
|
3655
3699
|
if (!item.keepOpen) menu.close();
|
|
3656
3700
|
};
|
|
3657
|
-
return /* @__PURE__ */ jsxs6("div", { class: `${
|
|
3701
|
+
return /* @__PURE__ */ jsxs6("div", { class: `${p34}-menu-wrap`, children: [
|
|
3658
3702
|
/* @__PURE__ */ jsx8(
|
|
3659
3703
|
"button",
|
|
3660
3704
|
{
|
|
3661
3705
|
ref: menu.triggerRef,
|
|
3662
3706
|
type: "button",
|
|
3663
|
-
class: `${
|
|
3707
|
+
class: `${p34}-icon-btn`,
|
|
3664
3708
|
"aria-label": triggerLabel,
|
|
3665
3709
|
"aria-haspopup": "menu",
|
|
3666
3710
|
"aria-expanded": menu.open,
|
|
@@ -3674,7 +3718,7 @@ function OverflowMenu({ items, triggerLabel }) {
|
|
|
3674
3718
|
"div",
|
|
3675
3719
|
{
|
|
3676
3720
|
ref: menu.menuRef,
|
|
3677
|
-
class: `${
|
|
3721
|
+
class: `${p34}-menu`,
|
|
3678
3722
|
role: "menu",
|
|
3679
3723
|
"aria-label": triggerLabel,
|
|
3680
3724
|
onKeyDown: menu.onMenuKey,
|
|
@@ -3684,15 +3728,15 @@ function OverflowMenu({ items, triggerLabel }) {
|
|
|
3684
3728
|
{
|
|
3685
3729
|
type: "button",
|
|
3686
3730
|
role: "menuitem",
|
|
3687
|
-
class: `${
|
|
3731
|
+
class: `${p34}-menu-item`,
|
|
3688
3732
|
"aria-pressed": item.type === "switch" ? item.on : void 0,
|
|
3689
3733
|
disabled: item.disabled,
|
|
3690
3734
|
lang: item.lang,
|
|
3691
3735
|
onClick: () => handleSelect(item),
|
|
3692
3736
|
children: [
|
|
3693
|
-
item.icon ? /* @__PURE__ */ jsx8("span", { class: `${
|
|
3694
|
-
/* @__PURE__ */ jsx8("span", { class: `${
|
|
3695
|
-
item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${
|
|
3737
|
+
item.icon ? /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-icon`, children: item.icon }) : null,
|
|
3738
|
+
/* @__PURE__ */ jsx8("span", { class: `${p34}-menu-label`, children: item.label }),
|
|
3739
|
+
item.type === "switch" && item.on ? /* @__PURE__ */ jsx8("span", { class: `${p34}-menu-check`, "aria-hidden": "true", children: /* @__PURE__ */ jsx8(CheckIcon, {}) }) : null
|
|
3696
3740
|
]
|
|
3697
3741
|
},
|
|
3698
3742
|
item.id
|
|
@@ -4108,7 +4152,17 @@ function renderControl(args) {
|
|
|
4108
4152
|
}
|
|
4109
4153
|
}
|
|
4110
4154
|
function inputType(type) {
|
|
4111
|
-
|
|
4155
|
+
switch (type) {
|
|
4156
|
+
case "number":
|
|
4157
|
+
case "email":
|
|
4158
|
+
case "tel":
|
|
4159
|
+
case "url":
|
|
4160
|
+
case "date":
|
|
4161
|
+
case "time":
|
|
4162
|
+
return type;
|
|
4163
|
+
default:
|
|
4164
|
+
return "text";
|
|
4165
|
+
}
|
|
4112
4166
|
}
|
|
4113
4167
|
function seedValues(fields) {
|
|
4114
4168
|
const out = {};
|
|
@@ -4133,24 +4187,24 @@ function resolveValues(fields, values, other) {
|
|
|
4133
4187
|
return out;
|
|
4134
4188
|
}
|
|
4135
4189
|
|
|
4136
|
-
// src/ui/
|
|
4190
|
+
// src/ui/form/form-gate.tsx
|
|
4137
4191
|
import { jsx as jsx11, jsxs as jsxs9 } from "preact/jsx-runtime";
|
|
4138
4192
|
var p11 = BRAND.cssPrefix;
|
|
4139
|
-
function
|
|
4140
|
-
return /* @__PURE__ */ jsxs9("div", { class: `${p11}-
|
|
4141
|
-
|
|
4142
|
-
|
|
4193
|
+
function FormGate({ form, strings, onSubmit, onSkip }) {
|
|
4194
|
+
return /* @__PURE__ */ jsxs9("div", { class: `${p11}-form-gate`, "data-testid": TID.formGate, children: [
|
|
4195
|
+
form.title ? /* @__PURE__ */ jsx11("h3", { class: `${p11}-form-gate-title`, children: form.title }) : null,
|
|
4196
|
+
form.description ? /* @__PURE__ */ jsx11("p", { class: `${p11}-form-gate-desc`, children: form.description }) : null,
|
|
4143
4197
|
/* @__PURE__ */ jsx11(
|
|
4144
4198
|
DynamicForm,
|
|
4145
4199
|
{
|
|
4146
|
-
fields:
|
|
4200
|
+
fields: form.fields,
|
|
4147
4201
|
strings,
|
|
4148
|
-
submitLabel:
|
|
4149
|
-
onSubmit
|
|
4150
|
-
skipLabel:
|
|
4151
|
-
onSkip:
|
|
4152
|
-
submitTestId: TID.
|
|
4153
|
-
skipTestId: TID.
|
|
4202
|
+
submitLabel: form.submitLabel ?? strings.formSubmit,
|
|
4203
|
+
onSubmit,
|
|
4204
|
+
skipLabel: form.skippable ? strings.formSkip : void 0,
|
|
4205
|
+
onSkip: form.skippable ? onSkip : void 0,
|
|
4206
|
+
submitTestId: TID.formSubmit,
|
|
4207
|
+
skipTestId: TID.formSkip
|
|
4154
4208
|
}
|
|
4155
4209
|
)
|
|
4156
4210
|
] });
|
|
@@ -4160,6 +4214,40 @@ function IntakeGate({ intake, strings, onComplete }) {
|
|
|
4160
4214
|
import { useEffect as useEffect8, useLayoutEffect, useRef as useRef5, useState as useState6 } from "preact/hooks";
|
|
4161
4215
|
import { useComputed as useComputed5 } from "@preact/signals";
|
|
4162
4216
|
|
|
4217
|
+
// src/ui/form/form-card.tsx
|
|
4218
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "preact/jsx-runtime";
|
|
4219
|
+
var p12 = BRAND.cssPrefix;
|
|
4220
|
+
function FormCard({ form, strings, onSubmit, onSkip }) {
|
|
4221
|
+
return /* @__PURE__ */ jsxs10("div", { class: `${p12}-form-card`, "data-testid": TID.formCard, children: [
|
|
4222
|
+
/* @__PURE__ */ jsxs10("div", { class: `${p12}-form-card-head`, children: [
|
|
4223
|
+
form.title ? /* @__PURE__ */ jsx12("strong", { class: `${p12}-form-card-title`, children: form.title }) : /* @__PURE__ */ jsx12("span", {}),
|
|
4224
|
+
/* @__PURE__ */ jsx12(
|
|
4225
|
+
"button",
|
|
4226
|
+
{
|
|
4227
|
+
type: "button",
|
|
4228
|
+
class: `${p12}-icon-btn`,
|
|
4229
|
+
onClick: onSkip,
|
|
4230
|
+
"aria-label": strings.formDismiss,
|
|
4231
|
+
title: strings.formDismiss,
|
|
4232
|
+
"data-testid": TID.formDismiss,
|
|
4233
|
+
children: /* @__PURE__ */ jsx12(CloseIcon, {})
|
|
4234
|
+
}
|
|
4235
|
+
)
|
|
4236
|
+
] }),
|
|
4237
|
+
form.description ? /* @__PURE__ */ jsx12("p", { class: `${p12}-form-card-desc`, children: form.description }) : null,
|
|
4238
|
+
/* @__PURE__ */ jsx12(
|
|
4239
|
+
DynamicForm,
|
|
4240
|
+
{
|
|
4241
|
+
fields: form.fields,
|
|
4242
|
+
strings,
|
|
4243
|
+
submitLabel: form.submitLabel ?? strings.formSubmit,
|
|
4244
|
+
onSubmit,
|
|
4245
|
+
submitTestId: TID.formSubmit
|
|
4246
|
+
}
|
|
4247
|
+
)
|
|
4248
|
+
] });
|
|
4249
|
+
}
|
|
4250
|
+
|
|
4163
4251
|
// src/ui/message-bubble.tsx
|
|
4164
4252
|
import { useComputed as useComputed4 } from "@preact/signals";
|
|
4165
4253
|
|
|
@@ -4167,7 +4255,7 @@ import { useComputed as useComputed4 } from "@preact/signals";
|
|
|
4167
4255
|
import { useEffect as useEffect7, useMemo, useRef as useRef4 } from "preact/hooks";
|
|
4168
4256
|
import { effect, signal as signal4 } from "@preact/signals";
|
|
4169
4257
|
import * as smd from "streaming-markdown";
|
|
4170
|
-
import { jsx as
|
|
4258
|
+
import { jsx as jsx13 } from "preact/jsx-runtime";
|
|
4171
4259
|
function MarkdownView({ textSig, doneSig }) {
|
|
4172
4260
|
const ref = useRef4(null);
|
|
4173
4261
|
useEffect7(() => {
|
|
@@ -4217,12 +4305,12 @@ function MarkdownView({ textSig, doneSig }) {
|
|
|
4217
4305
|
el.removeEventListener("click", onClick);
|
|
4218
4306
|
};
|
|
4219
4307
|
}, [textSig, doneSig]);
|
|
4220
|
-
return /* @__PURE__ */
|
|
4308
|
+
return /* @__PURE__ */ jsx13("div", { ref });
|
|
4221
4309
|
}
|
|
4222
4310
|
function StaticMarkdown({ text }) {
|
|
4223
4311
|
const textSig = useMemo(() => signal4(text), [text]);
|
|
4224
4312
|
const doneSig = useMemo(() => signal4(true), []);
|
|
4225
|
-
return /* @__PURE__ */
|
|
4313
|
+
return /* @__PURE__ */ jsx13(MarkdownView, { textSig, doneSig });
|
|
4226
4314
|
}
|
|
4227
4315
|
function hardenLink(a) {
|
|
4228
4316
|
const href = a.getAttribute("href") ?? "";
|
|
@@ -4236,8 +4324,8 @@ function hardenLink(a) {
|
|
|
4236
4324
|
|
|
4237
4325
|
// src/ui/tool-approval.tsx
|
|
4238
4326
|
import { useComputed as useComputed2, useSignal } from "@preact/signals";
|
|
4239
|
-
import { Fragment, jsx as
|
|
4240
|
-
var
|
|
4327
|
+
import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "preact/jsx-runtime";
|
|
4328
|
+
var p13 = BRAND.cssPrefix;
|
|
4241
4329
|
function ToolApproval({ part, strings, active, onDecision }) {
|
|
4242
4330
|
const approval = useComputed2(() => part.approvalSig.value);
|
|
4243
4331
|
const input = useComputed2(() => part.inputSig.value);
|
|
@@ -4245,23 +4333,24 @@ function ToolApproval({ part, strings, active, onDecision }) {
|
|
|
4245
4333
|
const decided = approval.value?.approved !== void 0;
|
|
4246
4334
|
if (decided) {
|
|
4247
4335
|
const ap = approval.value;
|
|
4248
|
-
return /* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4251
|
-
ap?.reason ? /* @__PURE__ */
|
|
4336
|
+
return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval ${p13}-tool-decided`, "data-testid": TID.toolDecision, children: [
|
|
4337
|
+
/* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-label`, "data-approved": ap?.approved ? "true" : "false", children: ap?.approved ? strings.approved : strings.rejected }),
|
|
4338
|
+
/* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: part.toolName }),
|
|
4339
|
+
ap?.reason ? /* @__PURE__ */ jsx14("span", { class: `${p13}-tool-decided-value`, children: ap.reason }) : null
|
|
4252
4340
|
] });
|
|
4253
4341
|
}
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
/* @__PURE__ */
|
|
4342
|
+
const args = summarizeInput(input.value);
|
|
4343
|
+
return /* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-approval`, "data-testid": TID.toolApproval, children: [
|
|
4344
|
+
/* @__PURE__ */ jsxs11("div", { class: `${p13}-tool-head`, children: [
|
|
4345
|
+
/* @__PURE__ */ jsx14("span", { class: `${p13}-tool-badge`, children: strings.approvalRequired }),
|
|
4346
|
+
/* @__PURE__ */ jsx14("strong", { class: `${p13}-tool-title`, children: part.toolName })
|
|
4258
4347
|
] }),
|
|
4259
|
-
|
|
4260
|
-
active ? /* @__PURE__ */
|
|
4261
|
-
/* @__PURE__ */
|
|
4348
|
+
args ? /* @__PURE__ */ jsx14("pre", { class: `${p13}-tool-args`, children: args }) : null,
|
|
4349
|
+
active ? /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
4350
|
+
/* @__PURE__ */ jsx14(
|
|
4262
4351
|
"input",
|
|
4263
4352
|
{
|
|
4264
|
-
class: `${
|
|
4353
|
+
class: `${p13}-field-input`,
|
|
4265
4354
|
value: reason.value,
|
|
4266
4355
|
placeholder: strings.approvalReason,
|
|
4267
4356
|
onInput: (e) => {
|
|
@@ -4269,29 +4358,29 @@ function ToolApproval({ part, strings, active, onDecision }) {
|
|
|
4269
4358
|
}
|
|
4270
4359
|
}
|
|
4271
4360
|
),
|
|
4272
|
-
/* @__PURE__ */
|
|
4273
|
-
/* @__PURE__ */
|
|
4361
|
+
/* @__PURE__ */ jsxs11("div", { class: `${p13}-form-actions`, children: [
|
|
4362
|
+
/* @__PURE__ */ jsx14(
|
|
4274
4363
|
"button",
|
|
4275
4364
|
{
|
|
4276
4365
|
type: "button",
|
|
4277
|
-
class: `${
|
|
4366
|
+
class: `${p13}-tool-reject`,
|
|
4278
4367
|
onClick: () => onDecision(part.toolCallId, false, reason.value.trim() || void 0),
|
|
4279
4368
|
"data-testid": TID.toolReject,
|
|
4280
4369
|
children: strings.reject
|
|
4281
4370
|
}
|
|
4282
4371
|
),
|
|
4283
|
-
/* @__PURE__ */
|
|
4372
|
+
/* @__PURE__ */ jsx14(
|
|
4284
4373
|
"button",
|
|
4285
4374
|
{
|
|
4286
4375
|
type: "button",
|
|
4287
|
-
class: `${
|
|
4376
|
+
class: `${p13}-tool-approve`,
|
|
4288
4377
|
onClick: () => onDecision(part.toolCallId, true, reason.value.trim() || void 0),
|
|
4289
4378
|
"data-testid": TID.toolApprove,
|
|
4290
4379
|
children: strings.approve
|
|
4291
4380
|
}
|
|
4292
4381
|
)
|
|
4293
4382
|
] })
|
|
4294
|
-
] }) : /* @__PURE__ */
|
|
4383
|
+
] }) : /* @__PURE__ */ jsx14("p", { class: `${p13}-tool-stale-note`, children: strings.stepNoLongerActive })
|
|
4295
4384
|
] });
|
|
4296
4385
|
}
|
|
4297
4386
|
function summarizeInput(input) {
|
|
@@ -4362,52 +4451,52 @@ function num(v) {
|
|
|
4362
4451
|
}
|
|
4363
4452
|
|
|
4364
4453
|
// src/ui/tool-ask-input.tsx
|
|
4365
|
-
import { jsx as
|
|
4366
|
-
var
|
|
4454
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "preact/jsx-runtime";
|
|
4455
|
+
var p14 = BRAND.cssPrefix;
|
|
4367
4456
|
function ToolAskInput({ part, strings, active, onSubmit }) {
|
|
4368
4457
|
const state = useComputed3(() => part.stateSig.value);
|
|
4369
4458
|
const request = useComputed3(() => parseAskUserInput(part.inputSig.value));
|
|
4370
4459
|
const decided = state.value === "output" || state.value === "error";
|
|
4371
4460
|
if (decided) {
|
|
4372
|
-
return /* @__PURE__ */
|
|
4461
|
+
return /* @__PURE__ */ jsx15(DecidedSummary, { part, strings });
|
|
4373
4462
|
}
|
|
4374
4463
|
if (!active) {
|
|
4375
|
-
return /* @__PURE__ */
|
|
4376
|
-
/* @__PURE__ */
|
|
4377
|
-
/* @__PURE__ */
|
|
4464
|
+
return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-stale`, "data-testid": TID.toolAskInput, children: [
|
|
4465
|
+
/* @__PURE__ */ jsx15(Header, { strings, title: request.value.title ?? request.value.question }),
|
|
4466
|
+
/* @__PURE__ */ jsx15("p", { class: `${p14}-tool-stale-note`, children: strings.stepNoLongerActive })
|
|
4378
4467
|
] });
|
|
4379
4468
|
}
|
|
4380
4469
|
const req = request.value;
|
|
4381
|
-
const
|
|
4382
|
-
return /* @__PURE__ */
|
|
4383
|
-
/* @__PURE__ */
|
|
4384
|
-
req.description ? /* @__PURE__ */
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
/* @__PURE__ */
|
|
4470
|
+
const isConfirmation = req.responseType === "confirmation";
|
|
4471
|
+
return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input`, "data-testid": TID.toolAskInput, children: [
|
|
4472
|
+
/* @__PURE__ */ jsx15(Header, { strings, title: req.title }),
|
|
4473
|
+
req.description ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-desc`, children: req.description }) : null,
|
|
4474
|
+
isConfirmation ? /* @__PURE__ */ jsx15("p", { class: `${p14}-tool-question`, children: req.question }) : null,
|
|
4475
|
+
isConfirmation ? /* @__PURE__ */ jsxs12("div", { class: `${p14}-form-actions`, children: [
|
|
4476
|
+
/* @__PURE__ */ jsx15(
|
|
4388
4477
|
"button",
|
|
4389
4478
|
{
|
|
4390
4479
|
type: "button",
|
|
4391
|
-
class: `${
|
|
4480
|
+
class: `${p14}-form-skip`,
|
|
4392
4481
|
onClick: () => onSubmit(part.toolCallId, { confirmed: false }),
|
|
4393
4482
|
"data-testid": TID.toolInputSkip,
|
|
4394
4483
|
children: strings.reject
|
|
4395
4484
|
}
|
|
4396
4485
|
),
|
|
4397
|
-
/* @__PURE__ */
|
|
4486
|
+
/* @__PURE__ */ jsx15(
|
|
4398
4487
|
"button",
|
|
4399
4488
|
{
|
|
4400
4489
|
type: "button",
|
|
4401
|
-
class: `${
|
|
4490
|
+
class: `${p14}-form-submit`,
|
|
4402
4491
|
onClick: () => onSubmit(part.toolCallId, { confirmed: true }),
|
|
4403
4492
|
"data-testid": TID.toolInputSubmit,
|
|
4404
4493
|
children: strings.approve
|
|
4405
4494
|
}
|
|
4406
4495
|
)
|
|
4407
|
-
] }) : /* @__PURE__ */
|
|
4496
|
+
] }) : /* @__PURE__ */ jsx15(
|
|
4408
4497
|
DynamicForm,
|
|
4409
4498
|
{
|
|
4410
|
-
fields,
|
|
4499
|
+
fields: askInputToFields(req),
|
|
4411
4500
|
strings,
|
|
4412
4501
|
submitLabel: strings.inputSubmit,
|
|
4413
4502
|
onSubmit: (values) => onSubmit(part.toolCallId, values),
|
|
@@ -4420,17 +4509,17 @@ function ToolAskInput({ part, strings, active, onSubmit }) {
|
|
|
4420
4509
|
] });
|
|
4421
4510
|
}
|
|
4422
4511
|
function Header({ strings, title }) {
|
|
4423
|
-
return /* @__PURE__ */
|
|
4424
|
-
/* @__PURE__ */
|
|
4425
|
-
title ? /* @__PURE__ */
|
|
4512
|
+
return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-head`, children: [
|
|
4513
|
+
/* @__PURE__ */ jsx15("span", { class: `${p14}-tool-badge`, children: strings.inputRequired }),
|
|
4514
|
+
title ? /* @__PURE__ */ jsx15("strong", { class: `${p14}-tool-title`, children: title }) : null
|
|
4426
4515
|
] });
|
|
4427
4516
|
}
|
|
4428
4517
|
function DecidedSummary({ part, strings }) {
|
|
4429
4518
|
const output = useComputed3(() => part.outputSig.value);
|
|
4430
4519
|
const text = summarizeOutput(output.value) || strings.inputSubmitted;
|
|
4431
|
-
return /* @__PURE__ */
|
|
4432
|
-
/* @__PURE__ */
|
|
4433
|
-
/* @__PURE__ */
|
|
4520
|
+
return /* @__PURE__ */ jsxs12("div", { class: `${p14}-tool-ask-input ${p14}-tool-decided`, "data-testid": TID.toolDecision, children: [
|
|
4521
|
+
/* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-label`, children: strings.inputSubmitted }),
|
|
4522
|
+
/* @__PURE__ */ jsx15("span", { class: `${p14}-tool-decided-value`, children: text })
|
|
4434
4523
|
] });
|
|
4435
4524
|
}
|
|
4436
4525
|
function summarizeOutput(output) {
|
|
@@ -4445,21 +4534,21 @@ function summarizeOutput(output) {
|
|
|
4445
4534
|
}
|
|
4446
4535
|
|
|
4447
4536
|
// src/ui/tool-chip.tsx
|
|
4448
|
-
import { jsx as
|
|
4537
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "preact/jsx-runtime";
|
|
4449
4538
|
function ToolChip({ part, strings }) {
|
|
4450
|
-
const
|
|
4451
|
-
return /* @__PURE__ */
|
|
4452
|
-
/* @__PURE__ */
|
|
4539
|
+
const p34 = BRAND.cssPrefix;
|
|
4540
|
+
return /* @__PURE__ */ jsxs13("span", { class: `${p34}-tool-chip`, role: "status", children: [
|
|
4541
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
4453
4542
|
strings.usedTool,
|
|
4454
4543
|
":"
|
|
4455
4544
|
] }),
|
|
4456
|
-
/* @__PURE__ */
|
|
4545
|
+
/* @__PURE__ */ jsx16("strong", { children: part.toolName })
|
|
4457
4546
|
] });
|
|
4458
4547
|
}
|
|
4459
4548
|
|
|
4460
4549
|
// src/ui/message-bubble.tsx
|
|
4461
|
-
import { jsx as
|
|
4462
|
-
var
|
|
4550
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "preact/jsx-runtime";
|
|
4551
|
+
var p15 = BRAND.cssPrefix;
|
|
4463
4552
|
function MessageBubble({
|
|
4464
4553
|
message,
|
|
4465
4554
|
strings,
|
|
@@ -4482,9 +4571,9 @@ function MessageBubble({
|
|
|
4482
4571
|
const working = streaming && !hasAnswerText.value;
|
|
4483
4572
|
const showStreamDots = streaming && !bufferedHold && !(reasoningVisible.value && working);
|
|
4484
4573
|
const stamp = formatStamp(message.createdAt);
|
|
4485
|
-
return /* @__PURE__ */
|
|
4486
|
-
/* @__PURE__ */
|
|
4487
|
-
bufferedHold ? /* @__PURE__ */
|
|
4574
|
+
return /* @__PURE__ */ jsx17("div", { class: `${p15}-bubble-row`, "data-role": message.role, "data-testid": tid(TID.messageBubble, message.id), children: /* @__PURE__ */ jsxs14("div", { class: `${p15}-bubble-col`, children: [
|
|
4575
|
+
/* @__PURE__ */ jsxs14("div", { class: `${p15}-bubble`, children: [
|
|
4576
|
+
bufferedHold ? /* @__PURE__ */ jsx17(LoadingSpinner, { label: strings.loading }) : partList.map((part) => /* @__PURE__ */ jsx17(
|
|
4488
4577
|
PartView,
|
|
4489
4578
|
{
|
|
4490
4579
|
part,
|
|
@@ -4497,10 +4586,10 @@ function MessageBubble({
|
|
|
4497
4586
|
},
|
|
4498
4587
|
partKey(part)
|
|
4499
4588
|
)),
|
|
4500
|
-
showStreamDots && /* @__PURE__ */
|
|
4501
|
-
message.status === "error" && message.errorText ? /* @__PURE__ */
|
|
4589
|
+
showStreamDots && /* @__PURE__ */ jsx17(TypingDots, {}),
|
|
4590
|
+
message.status === "error" && message.errorText ? /* @__PURE__ */ jsx17("div", { class: `${p15}-error`, role: "alert", children: /* @__PURE__ */ jsx17("span", { children: message.errorText }) }) : null
|
|
4502
4591
|
] }),
|
|
4503
|
-
stamp ? /* @__PURE__ */
|
|
4592
|
+
stamp ? /* @__PURE__ */ jsx17("time", { class: `${p15}-bubble-time`, dateTime: stamp.iso, title: stamp.full, children: stamp.short }) : null
|
|
4504
4593
|
] }) });
|
|
4505
4594
|
}
|
|
4506
4595
|
function formatStamp(createdAt) {
|
|
@@ -4527,11 +4616,11 @@ function PartView({
|
|
|
4527
4616
|
}) {
|
|
4528
4617
|
switch (part.kind) {
|
|
4529
4618
|
case "text":
|
|
4530
|
-
return /* @__PURE__ */
|
|
4619
|
+
return /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig });
|
|
4531
4620
|
case "reasoning":
|
|
4532
|
-
return showReasoning ? /* @__PURE__ */
|
|
4621
|
+
return showReasoning ? /* @__PURE__ */ jsx17(ReasoningView, { part, active, strings }) : null;
|
|
4533
4622
|
case "tool":
|
|
4534
|
-
return /* @__PURE__ */
|
|
4623
|
+
return /* @__PURE__ */ jsx17(
|
|
4535
4624
|
ToolPartView,
|
|
4536
4625
|
{
|
|
4537
4626
|
part,
|
|
@@ -4543,9 +4632,9 @@ function PartView({
|
|
|
4543
4632
|
);
|
|
4544
4633
|
case "file":
|
|
4545
4634
|
if (part.mediaType.startsWith("image/")) {
|
|
4546
|
-
return /* @__PURE__ */
|
|
4635
|
+
return /* @__PURE__ */ jsx17("img", { src: part.url, alt: "", loading: "lazy" });
|
|
4547
4636
|
}
|
|
4548
|
-
return /* @__PURE__ */
|
|
4637
|
+
return /* @__PURE__ */ jsx17("a", { href: part.url, target: "_blank", rel: "noreferrer noopener", children: part.url });
|
|
4549
4638
|
case "source":
|
|
4550
4639
|
return null;
|
|
4551
4640
|
}
|
|
@@ -4561,22 +4650,22 @@ function ToolPartView({
|
|
|
4561
4650
|
const hasApproval = useComputed4(() => part.approvalSig.value !== void 0);
|
|
4562
4651
|
if (tool?.humanInLoop) {
|
|
4563
4652
|
if (hasApproval.value || state.value === "awaiting-approval") {
|
|
4564
|
-
return /* @__PURE__ */
|
|
4653
|
+
return /* @__PURE__ */ jsx17(ToolApproval, { part, strings, active: interactive, onDecision: tool.onDecision });
|
|
4565
4654
|
}
|
|
4566
4655
|
if (isAskUserInputTool(part.toolName) || state.value === "awaiting-input") {
|
|
4567
|
-
return /* @__PURE__ */
|
|
4656
|
+
return /* @__PURE__ */ jsx17(ToolAskInput, { part, strings, active: interactive, onSubmit: tool.onResult });
|
|
4568
4657
|
}
|
|
4569
4658
|
}
|
|
4570
|
-
return showToolCalls ? /* @__PURE__ */
|
|
4659
|
+
return showToolCalls ? /* @__PURE__ */ jsx17(ToolChip, { part, strings }) : null;
|
|
4571
4660
|
}
|
|
4572
4661
|
function ReasoningView({
|
|
4573
4662
|
part,
|
|
4574
4663
|
active,
|
|
4575
4664
|
strings
|
|
4576
4665
|
}) {
|
|
4577
|
-
return /* @__PURE__ */
|
|
4578
|
-
/* @__PURE__ */
|
|
4579
|
-
/* @__PURE__ */
|
|
4666
|
+
return /* @__PURE__ */ jsxs14("details", { class: `${p15}-reasoning`, open: active, "data-active": active ? "true" : void 0, children: [
|
|
4667
|
+
/* @__PURE__ */ jsx17("summary", { class: `${p15}-reasoning-summary`, children: /* @__PURE__ */ jsx17("span", { class: `${p15}-reasoning-label`, children: active ? strings.thinking : strings.thoughts }) }),
|
|
4668
|
+
/* @__PURE__ */ jsx17("div", { class: `${p15}-reasoning-body`, children: /* @__PURE__ */ jsx17(MarkdownView, { textSig: part.textSig, doneSig: part.doneSig }) })
|
|
4580
4669
|
] });
|
|
4581
4670
|
}
|
|
4582
4671
|
function partKey(part) {
|
|
@@ -4593,22 +4682,22 @@ function partKey(part) {
|
|
|
4593
4682
|
}
|
|
4594
4683
|
}
|
|
4595
4684
|
function TypingDots() {
|
|
4596
|
-
return /* @__PURE__ */
|
|
4597
|
-
/* @__PURE__ */
|
|
4598
|
-
/* @__PURE__ */
|
|
4599
|
-
/* @__PURE__ */
|
|
4685
|
+
return /* @__PURE__ */ jsxs14("span", { class: `${p15}-typing`, "aria-hidden": "true", children: [
|
|
4686
|
+
/* @__PURE__ */ jsx17("span", {}),
|
|
4687
|
+
/* @__PURE__ */ jsx17("span", {}),
|
|
4688
|
+
/* @__PURE__ */ jsx17("span", {})
|
|
4600
4689
|
] });
|
|
4601
4690
|
}
|
|
4602
4691
|
function LoadingSpinner({ label }) {
|
|
4603
|
-
return /* @__PURE__ */
|
|
4604
|
-
/* @__PURE__ */
|
|
4605
|
-
/* @__PURE__ */
|
|
4692
|
+
return /* @__PURE__ */ jsxs14("span", { class: `${p15}-loading`, role: "status", children: [
|
|
4693
|
+
/* @__PURE__ */ jsx17("span", { class: `${p15}-loading-spinner`, "aria-hidden": "true" }),
|
|
4694
|
+
/* @__PURE__ */ jsx17("span", { class: `${p15}-loading-label`, children: label })
|
|
4606
4695
|
] });
|
|
4607
4696
|
}
|
|
4608
4697
|
|
|
4609
4698
|
// src/ui/message-list.tsx
|
|
4610
|
-
import { jsx as
|
|
4611
|
-
var
|
|
4699
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "preact/jsx-runtime";
|
|
4700
|
+
var p16 = BRAND.cssPrefix;
|
|
4612
4701
|
var STICK_THRESHOLD = 120;
|
|
4613
4702
|
var DIVIDER_IDLE_MS = 1200;
|
|
4614
4703
|
function MessageList({
|
|
@@ -4619,7 +4708,10 @@ function MessageList({
|
|
|
4619
4708
|
showToolCalls,
|
|
4620
4709
|
loading,
|
|
4621
4710
|
idle,
|
|
4622
|
-
tool
|
|
4711
|
+
tool,
|
|
4712
|
+
inlineForm,
|
|
4713
|
+
onFormSubmit,
|
|
4714
|
+
onFormSkip
|
|
4623
4715
|
}) {
|
|
4624
4716
|
const ref = useRef5(null);
|
|
4625
4717
|
const messages = useComputed5(() => messagesSig.value);
|
|
@@ -4704,12 +4796,12 @@ function MessageList({
|
|
|
4704
4796
|
const day = dayKey(m.createdAt);
|
|
4705
4797
|
if (day && day !== prevDay) {
|
|
4706
4798
|
rows.push(
|
|
4707
|
-
/* @__PURE__ */
|
|
4799
|
+
/* @__PURE__ */ jsx18("div", { class: `${p16}-date-divider`, children: /* @__PURE__ */ jsx18("span", { class: `${p16}-date-pill`, title: fullDate(m.createdAt), children: dayLabel(m.createdAt, strings) }) }, `day:${day}`)
|
|
4708
4800
|
);
|
|
4709
4801
|
prevDay = day;
|
|
4710
4802
|
}
|
|
4711
4803
|
rows.push(
|
|
4712
|
-
/* @__PURE__ */
|
|
4804
|
+
/* @__PURE__ */ jsx18(
|
|
4713
4805
|
MessageBubble,
|
|
4714
4806
|
{
|
|
4715
4807
|
message: m,
|
|
@@ -4724,32 +4816,33 @@ function MessageList({
|
|
|
4724
4816
|
)
|
|
4725
4817
|
);
|
|
4726
4818
|
}
|
|
4727
|
-
return /* @__PURE__ */
|
|
4728
|
-
/* @__PURE__ */
|
|
4819
|
+
return /* @__PURE__ */ jsxs15("div", { class: `${p16}-list-wrap`, children: [
|
|
4820
|
+
/* @__PURE__ */ jsxs15(
|
|
4729
4821
|
"div",
|
|
4730
4822
|
{
|
|
4731
4823
|
ref,
|
|
4732
|
-
class: `${
|
|
4824
|
+
class: `${p16}-list`,
|
|
4733
4825
|
role: "log",
|
|
4734
4826
|
"aria-live": "polite",
|
|
4735
4827
|
"aria-relevant": "additions text",
|
|
4736
4828
|
"data-scrolling": scrolling ? "true" : void 0,
|
|
4737
4829
|
children: [
|
|
4738
|
-
loading && messages.value.length === 0 ? /* @__PURE__ */
|
|
4739
|
-
rows
|
|
4830
|
+
loading && messages.value.length === 0 ? /* @__PURE__ */ jsx18("div", { class: `${p16}-list-loading`, role: "status", children: strings.messagesLoading }) : null,
|
|
4831
|
+
rows,
|
|
4832
|
+
inlineForm && onFormSubmit && onFormSkip ? /* @__PURE__ */ jsx18(FormCard, { form: inlineForm, strings, onSubmit: onFormSubmit, onSkip: onFormSkip }) : null
|
|
4740
4833
|
]
|
|
4741
4834
|
}
|
|
4742
4835
|
),
|
|
4743
|
-
showJump ? /* @__PURE__ */
|
|
4836
|
+
showJump ? /* @__PURE__ */ jsx18(
|
|
4744
4837
|
"button",
|
|
4745
4838
|
{
|
|
4746
4839
|
type: "button",
|
|
4747
|
-
class: `${
|
|
4840
|
+
class: `${p16}-jump`,
|
|
4748
4841
|
onClick: jumpToBottom,
|
|
4749
4842
|
"aria-label": strings.scrollToBottom,
|
|
4750
4843
|
title: strings.scrollToBottom,
|
|
4751
4844
|
"data-testid": TID.scrollToBottom,
|
|
4752
|
-
children: /* @__PURE__ */
|
|
4845
|
+
children: /* @__PURE__ */ jsx18(ChevronDownIcon, {})
|
|
4753
4846
|
}
|
|
4754
4847
|
) : null
|
|
4755
4848
|
] });
|
|
@@ -4808,7 +4901,7 @@ function startOfDay(ms) {
|
|
|
4808
4901
|
}
|
|
4809
4902
|
|
|
4810
4903
|
// src/ui/conversation-list.tsx
|
|
4811
|
-
import { Fragment as Fragment2, jsx as
|
|
4904
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs16 } from "preact/jsx-runtime";
|
|
4812
4905
|
var log11 = logger.scope("history");
|
|
4813
4906
|
var BUCKET_TO_STRING = {
|
|
4814
4907
|
today: "dateToday",
|
|
@@ -4817,7 +4910,7 @@ var BUCKET_TO_STRING = {
|
|
|
4817
4910
|
older: "dateOlder"
|
|
4818
4911
|
};
|
|
4819
4912
|
function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }) {
|
|
4820
|
-
const
|
|
4913
|
+
const p34 = BRAND.cssPrefix;
|
|
4821
4914
|
const [state, setState] = useState7("loading");
|
|
4822
4915
|
const [sessions, setChats] = useState7([]);
|
|
4823
4916
|
useEffect9(() => {
|
|
@@ -4835,38 +4928,38 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
4835
4928
|
cancelled = true;
|
|
4836
4929
|
};
|
|
4837
4930
|
}, [transport, visitorId]);
|
|
4838
|
-
const newChatButton = onNewChat ? /* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4931
|
+
const newChatButton = onNewChat ? /* @__PURE__ */ jsx19("div", { class: `${p34}-history-footer`, children: /* @__PURE__ */ jsxs16("button", { type: "button", class: `${p34}-history-new`, onClick: onNewChat, "data-testid": TID.sidebarNewChat, children: [
|
|
4932
|
+
/* @__PURE__ */ jsx19(PlusIcon, {}),
|
|
4840
4933
|
strings.historyNewChat
|
|
4841
4934
|
] }) }) : null;
|
|
4842
4935
|
if (state === "loading") {
|
|
4843
|
-
return /* @__PURE__ */
|
|
4844
|
-
/* @__PURE__ */
|
|
4936
|
+
return /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
4937
|
+
/* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyLoading }),
|
|
4845
4938
|
newChatButton
|
|
4846
4939
|
] });
|
|
4847
4940
|
}
|
|
4848
4941
|
if (state === "error" || sessions.length === 0) {
|
|
4849
|
-
return /* @__PURE__ */
|
|
4850
|
-
/* @__PURE__ */
|
|
4942
|
+
return /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
4943
|
+
/* @__PURE__ */ jsx19("div", { class: `${p34}-history-empty`, children: strings.historyEmpty }),
|
|
4851
4944
|
newChatButton
|
|
4852
4945
|
] });
|
|
4853
4946
|
}
|
|
4854
4947
|
const groups = groupByBucket(Date.now(), sessions);
|
|
4855
|
-
return /* @__PURE__ */
|
|
4856
|
-
/* @__PURE__ */
|
|
4857
|
-
/* @__PURE__ */
|
|
4858
|
-
group.sessions.map((chat) => /* @__PURE__ */
|
|
4948
|
+
return /* @__PURE__ */ jsxs16(Fragment2, { children: [
|
|
4949
|
+
/* @__PURE__ */ jsx19("div", { class: `${p34}-history`, role: "list", children: groups.map((group) => /* @__PURE__ */ jsxs16("div", { class: `${p34}-history-group`, children: [
|
|
4950
|
+
/* @__PURE__ */ jsx19("div", { class: `${p34}-history-heading`, children: strings[BUCKET_TO_STRING[group.bucket]] }),
|
|
4951
|
+
group.sessions.map((chat) => /* @__PURE__ */ jsxs16(
|
|
4859
4952
|
"button",
|
|
4860
4953
|
{
|
|
4861
4954
|
type: "button",
|
|
4862
4955
|
role: "listitem",
|
|
4863
|
-
class: `${
|
|
4956
|
+
class: `${p34}-history-item`,
|
|
4864
4957
|
onClick: () => onSelect(chat),
|
|
4865
4958
|
"data-closed": chat.canContinue ? void 0 : "true",
|
|
4866
4959
|
"data-testid": tid(TID.historyItem, chat.sessionId),
|
|
4867
4960
|
children: [
|
|
4868
|
-
/* @__PURE__ */
|
|
4869
|
-
chat.preview ? /* @__PURE__ */
|
|
4961
|
+
/* @__PURE__ */ jsx19("span", { class: `${p34}-history-title`, children: chat.title }),
|
|
4962
|
+
chat.preview ? /* @__PURE__ */ jsx19("span", { class: `${p34}-history-preview`, children: chat.preview }) : null
|
|
4870
4963
|
]
|
|
4871
4964
|
},
|
|
4872
4965
|
chat.sessionId
|
|
@@ -4877,21 +4970,21 @@ function ConversationList({ transport, strings, visitorId, onSelect, onNewChat }
|
|
|
4877
4970
|
}
|
|
4878
4971
|
|
|
4879
4972
|
// src/ui/chat-history-pane.tsx
|
|
4880
|
-
import { jsx as
|
|
4973
|
+
import { jsx as jsx20 } from "preact/jsx-runtime";
|
|
4881
4974
|
function ChatHistoryPane(props2) {
|
|
4882
|
-
return /* @__PURE__ */
|
|
4975
|
+
return /* @__PURE__ */ jsx20(ConversationList, { ...props2 });
|
|
4883
4976
|
}
|
|
4884
4977
|
|
|
4885
4978
|
// src/ui/suggestions.tsx
|
|
4886
|
-
import { jsx as
|
|
4887
|
-
var
|
|
4979
|
+
import { jsx as jsx21 } from "preact/jsx-runtime";
|
|
4980
|
+
var p17 = BRAND.cssPrefix;
|
|
4888
4981
|
function Suggestions({ suggestions, onPick }) {
|
|
4889
4982
|
if (suggestions.length === 0) return null;
|
|
4890
|
-
return /* @__PURE__ */
|
|
4983
|
+
return /* @__PURE__ */ jsx21("div", { class: `${p17}-suggestions`, role: "group", "aria-label": "Suggested replies", children: suggestions.map((s, i) => /* @__PURE__ */ jsx21(
|
|
4891
4984
|
"button",
|
|
4892
4985
|
{
|
|
4893
4986
|
type: "button",
|
|
4894
|
-
class: `${
|
|
4987
|
+
class: `${p17}-suggestion`,
|
|
4895
4988
|
onClick: () => onPick(s),
|
|
4896
4989
|
"data-testid": tid(TID.suggestion, i),
|
|
4897
4990
|
children: s.label
|
|
@@ -4901,8 +4994,8 @@ function Suggestions({ suggestions, onPick }) {
|
|
|
4901
4994
|
}
|
|
4902
4995
|
|
|
4903
4996
|
// src/ui/panel.tsx
|
|
4904
|
-
import { Fragment as Fragment3, jsx as
|
|
4905
|
-
var
|
|
4997
|
+
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs17 } from "preact/jsx-runtime";
|
|
4998
|
+
var p18 = BRAND.cssPrefix;
|
|
4906
4999
|
function Panel(props2) {
|
|
4907
5000
|
const { options, onClose } = props2;
|
|
4908
5001
|
const s = options.strings;
|
|
@@ -4926,18 +5019,18 @@ function Panel(props2) {
|
|
|
4926
5019
|
}, []);
|
|
4927
5020
|
const { visible: dragOver } = useFileDrop({ containerRef, onDrop: onDropItems });
|
|
4928
5021
|
useDragMove(containerRef.current, options.mode === "modal");
|
|
4929
|
-
return /* @__PURE__ */
|
|
5022
|
+
return /* @__PURE__ */ jsxs17(
|
|
4930
5023
|
"div",
|
|
4931
5024
|
{
|
|
4932
5025
|
ref: containerRef,
|
|
4933
|
-
class: `${
|
|
5026
|
+
class: `${p18}-panel`,
|
|
4934
5027
|
role: "dialog",
|
|
4935
5028
|
"aria-modal": "false",
|
|
4936
5029
|
"aria-label": s.panelTitle,
|
|
4937
5030
|
style: { position: "relative" },
|
|
4938
5031
|
"data-testid": TID.panel,
|
|
4939
5032
|
children: [
|
|
4940
|
-
/* @__PURE__ */
|
|
5033
|
+
/* @__PURE__ */ jsx22(
|
|
4941
5034
|
PanelContent,
|
|
4942
5035
|
{
|
|
4943
5036
|
...props2,
|
|
@@ -4946,7 +5039,7 @@ function Panel(props2) {
|
|
|
4946
5039
|
composerAttachApiRef
|
|
4947
5040
|
}
|
|
4948
5041
|
),
|
|
4949
|
-
/* @__PURE__ */
|
|
5042
|
+
/* @__PURE__ */ jsx22(PoweredByBar, { poweredBy: props2.options.poweredBy })
|
|
4950
5043
|
]
|
|
4951
5044
|
}
|
|
4952
5045
|
);
|
|
@@ -4977,8 +5070,10 @@ function PanelContent(props2) {
|
|
|
4977
5070
|
onSend,
|
|
4978
5071
|
onStop,
|
|
4979
5072
|
onSuggestion,
|
|
4980
|
-
|
|
4981
|
-
|
|
5073
|
+
blockingForm,
|
|
5074
|
+
inlineForm,
|
|
5075
|
+
onFormSubmit,
|
|
5076
|
+
onFormSkip,
|
|
4982
5077
|
tool,
|
|
4983
5078
|
containerEl,
|
|
4984
5079
|
dragOver,
|
|
@@ -4986,12 +5081,12 @@ function PanelContent(props2) {
|
|
|
4986
5081
|
} = props2;
|
|
4987
5082
|
const s = options.strings;
|
|
4988
5083
|
let composerArea;
|
|
4989
|
-
if (
|
|
4990
|
-
composerArea = /* @__PURE__ */
|
|
5084
|
+
if (blockingForm) {
|
|
5085
|
+
composerArea = /* @__PURE__ */ jsx22(FormGate, { form: blockingForm, strings: s, onSubmit: onFormSubmit, onSkip: onFormSkip });
|
|
4991
5086
|
} else if (canSend) {
|
|
4992
|
-
composerArea = /* @__PURE__ */
|
|
4993
|
-
/* @__PURE__ */
|
|
4994
|
-
/* @__PURE__ */
|
|
5087
|
+
composerArea = /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5088
|
+
/* @__PURE__ */ jsx22(Suggestions, { suggestions, onPick: onSuggestion }),
|
|
5089
|
+
/* @__PURE__ */ jsx22(
|
|
4995
5090
|
Composer,
|
|
4996
5091
|
{
|
|
4997
5092
|
options,
|
|
@@ -5006,10 +5101,10 @@ function PanelContent(props2) {
|
|
|
5006
5101
|
)
|
|
5007
5102
|
] });
|
|
5008
5103
|
} else {
|
|
5009
|
-
composerArea = /* @__PURE__ */
|
|
5104
|
+
composerArea = /* @__PURE__ */ jsx22(ReadOnlyBanner, { label: s.chatClosed, ctaLabel: s.startNewConversation, onNewChat: onClear });
|
|
5010
5105
|
}
|
|
5011
|
-
return /* @__PURE__ */
|
|
5012
|
-
view === "history" ? /* @__PURE__ */
|
|
5106
|
+
return /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5107
|
+
view === "history" ? /* @__PURE__ */ jsx22(
|
|
5013
5108
|
HistoryHeader,
|
|
5014
5109
|
{
|
|
5015
5110
|
strings: s,
|
|
@@ -5017,22 +5112,22 @@ function PanelContent(props2) {
|
|
|
5017
5112
|
onClose,
|
|
5018
5113
|
showClose: canShowClose(options.mode, panelSize, options.actions)
|
|
5019
5114
|
}
|
|
5020
|
-
) : /* @__PURE__ */
|
|
5021
|
-
onBack ? /* @__PURE__ */
|
|
5115
|
+
) : /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, "data-testid": TID.panelHeader, children: [
|
|
5116
|
+
onBack ? /* @__PURE__ */ jsx22(
|
|
5022
5117
|
"button",
|
|
5023
5118
|
{
|
|
5024
5119
|
type: "button",
|
|
5025
|
-
class: `${
|
|
5120
|
+
class: `${p18}-icon-btn`,
|
|
5026
5121
|
onClick: onBack,
|
|
5027
5122
|
"aria-label": s.moduleBack,
|
|
5028
5123
|
title: s.moduleBack,
|
|
5029
|
-
children: /* @__PURE__ */
|
|
5124
|
+
children: /* @__PURE__ */ jsx22(BackIcon, {})
|
|
5030
5125
|
}
|
|
5031
5126
|
) : null,
|
|
5032
|
-
agent ? /* @__PURE__ */
|
|
5033
|
-
/* @__PURE__ */
|
|
5127
|
+
agent ? /* @__PURE__ */ jsx22(AgentBadge, { agent }) : /* @__PURE__ */ jsx22("h1", { children: s.panelTitle }),
|
|
5128
|
+
/* @__PURE__ */ jsx22(HeaderActions, { panelProps: props2, variant: "chat" })
|
|
5034
5129
|
] }),
|
|
5035
|
-
view === "history" ? /* @__PURE__ */
|
|
5130
|
+
view === "history" ? /* @__PURE__ */ jsx22(
|
|
5036
5131
|
ChatHistoryPane,
|
|
5037
5132
|
{
|
|
5038
5133
|
transport,
|
|
@@ -5041,9 +5136,9 @@ function PanelContent(props2) {
|
|
|
5041
5136
|
onSelect: (chat) => onSelectHistoryChat(chat.sessionId),
|
|
5042
5137
|
onNewChat
|
|
5043
5138
|
}
|
|
5044
|
-
) : /* @__PURE__ */
|
|
5045
|
-
/* @__PURE__ */
|
|
5046
|
-
/* @__PURE__ */
|
|
5139
|
+
) : /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5140
|
+
/* @__PURE__ */ jsx22(DropZone, { visible: dragOver, strings: s }),
|
|
5141
|
+
/* @__PURE__ */ jsx22(
|
|
5047
5142
|
MessageList,
|
|
5048
5143
|
{
|
|
5049
5144
|
messagesSig,
|
|
@@ -5053,13 +5148,16 @@ function PanelContent(props2) {
|
|
|
5053
5148
|
showToolCalls: options.showToolCalls,
|
|
5054
5149
|
loading: loadingMessages,
|
|
5055
5150
|
idle: !isStreaming,
|
|
5056
|
-
tool
|
|
5151
|
+
tool,
|
|
5152
|
+
inlineForm,
|
|
5153
|
+
onFormSubmit,
|
|
5154
|
+
onFormSkip
|
|
5057
5155
|
}
|
|
5058
5156
|
),
|
|
5059
5157
|
composerArea,
|
|
5060
|
-
/* @__PURE__ */
|
|
5158
|
+
/* @__PURE__ */ jsx22(ComposerFooter, { disclaimer: options.composerDisclaimer })
|
|
5061
5159
|
] }),
|
|
5062
|
-
options.size.resize?.enabled ? /* @__PURE__ */
|
|
5160
|
+
options.size.resize?.enabled ? /* @__PURE__ */ jsx22(
|
|
5063
5161
|
ResizeGrip,
|
|
5064
5162
|
{
|
|
5065
5163
|
panelEl: containerEl,
|
|
@@ -5078,86 +5176,157 @@ function HistoryHeader({
|
|
|
5078
5176
|
onClose,
|
|
5079
5177
|
showClose
|
|
5080
5178
|
}) {
|
|
5081
|
-
return /* @__PURE__ */
|
|
5082
|
-
/* @__PURE__ */
|
|
5179
|
+
return /* @__PURE__ */ jsxs17("header", { class: `${p18}-header`, children: [
|
|
5180
|
+
/* @__PURE__ */ jsx22(
|
|
5083
5181
|
"button",
|
|
5084
5182
|
{
|
|
5085
5183
|
type: "button",
|
|
5086
|
-
class: `${
|
|
5184
|
+
class: `${p18}-icon-btn`,
|
|
5087
5185
|
onClick: onBack,
|
|
5088
5186
|
"aria-label": strings.historyBack,
|
|
5089
5187
|
title: strings.historyBack,
|
|
5090
|
-
children: /* @__PURE__ */
|
|
5188
|
+
children: /* @__PURE__ */ jsx22(BackIcon, {})
|
|
5091
5189
|
}
|
|
5092
5190
|
),
|
|
5093
|
-
/* @__PURE__ */
|
|
5094
|
-
showClose ? /* @__PURE__ */
|
|
5191
|
+
/* @__PURE__ */ jsx22("h1", { children: strings.historyTitle }),
|
|
5192
|
+
showClose ? /* @__PURE__ */ jsx22(
|
|
5095
5193
|
"button",
|
|
5096
5194
|
{
|
|
5097
5195
|
type: "button",
|
|
5098
|
-
class: `${
|
|
5196
|
+
class: `${p18}-icon-btn`,
|
|
5099
5197
|
onClick: onClose,
|
|
5100
5198
|
"aria-label": strings.close,
|
|
5101
5199
|
title: strings.close,
|
|
5102
|
-
children: /* @__PURE__ */
|
|
5200
|
+
children: /* @__PURE__ */ jsx22(CloseIcon, {})
|
|
5103
5201
|
}
|
|
5104
5202
|
) : null
|
|
5105
5203
|
] });
|
|
5106
5204
|
}
|
|
5107
5205
|
function ReadOnlyBanner({ label, ctaLabel, onNewChat }) {
|
|
5108
|
-
return /* @__PURE__ */
|
|
5109
|
-
/* @__PURE__ */
|
|
5110
|
-
/* @__PURE__ */
|
|
5206
|
+
return /* @__PURE__ */ jsxs17("div", { class: `${p18}-readonly-banner`, role: "note", children: [
|
|
5207
|
+
/* @__PURE__ */ jsx22("span", { class: `${p18}-readonly-label`, children: label }),
|
|
5208
|
+
/* @__PURE__ */ jsx22("button", { type: "button", class: `${p18}-readonly-cta`, onClick: onNewChat, children: ctaLabel })
|
|
5111
5209
|
] });
|
|
5112
5210
|
}
|
|
5113
5211
|
function ComposerFooter({ disclaimer }) {
|
|
5114
5212
|
if (!disclaimer) return null;
|
|
5115
|
-
return /* @__PURE__ */
|
|
5213
|
+
return /* @__PURE__ */ jsx22("div", { class: `${p18}-composer-footer`, children: /* @__PURE__ */ jsx22("div", { class: `${p18}-disclaimer`, children: disclaimer }) });
|
|
5116
5214
|
}
|
|
5117
5215
|
function PoweredByBar({ poweredBy }) {
|
|
5118
5216
|
if (!poweredBy) return null;
|
|
5119
|
-
return /* @__PURE__ */
|
|
5217
|
+
return /* @__PURE__ */ jsx22("div", { class: `${p18}-poweredby-bar`, children: /* @__PURE__ */ jsx22(PoweredBy, { logoUrl: poweredBy.logoUrl, text: poweredBy.text, href: poweredBy.href }) });
|
|
5120
5218
|
}
|
|
5121
5219
|
function PoweredBy({ logoUrl, text, href }) {
|
|
5122
|
-
const inner = /* @__PURE__ */
|
|
5123
|
-
logoUrl ? /* @__PURE__ */
|
|
5124
|
-
text ? /* @__PURE__ */
|
|
5220
|
+
const inner = /* @__PURE__ */ jsxs17(Fragment3, { children: [
|
|
5221
|
+
logoUrl ? /* @__PURE__ */ jsx22("img", { class: `${p18}-poweredby-logo`, src: logoUrl, alt: "", loading: "lazy" }) : null,
|
|
5222
|
+
text ? /* @__PURE__ */ jsx22("span", { children: text }) : null
|
|
5125
5223
|
] });
|
|
5126
5224
|
if (href) {
|
|
5127
|
-
return /* @__PURE__ */
|
|
5225
|
+
return /* @__PURE__ */ jsx22("a", { class: `${p18}-poweredby`, href, target: "_blank", rel: "noopener noreferrer", children: inner });
|
|
5226
|
+
}
|
|
5227
|
+
return /* @__PURE__ */ jsx22("span", { class: `${p18}-poweredby`, children: inner });
|
|
5228
|
+
}
|
|
5229
|
+
|
|
5230
|
+
// src/ui/form/form-controller.ts
|
|
5231
|
+
import { signal as signal5 } from "@preact/signals";
|
|
5232
|
+
import { useRef as useRef7 } from "preact/hooks";
|
|
5233
|
+
function useForms(deps) {
|
|
5234
|
+
const depsRef = useRef7(deps);
|
|
5235
|
+
depsRef.current = deps;
|
|
5236
|
+
const ctrlRef = useRef7(null);
|
|
5237
|
+
ctrlRef.current ?? (ctrlRef.current = createController(depsRef));
|
|
5238
|
+
return ctrlRef.current;
|
|
5239
|
+
}
|
|
5240
|
+
function createController(depsRef) {
|
|
5241
|
+
const activeForm = signal5(null);
|
|
5242
|
+
const sessionDone = /* @__PURE__ */ new Set();
|
|
5243
|
+
const isDone = (form) => {
|
|
5244
|
+
if (form.frequency === "always") return false;
|
|
5245
|
+
if (form.frequency === "session") return sessionDone.has(form.id);
|
|
5246
|
+
return form.id in depsRef.current.persistence.loadFormsDone();
|
|
5247
|
+
};
|
|
5248
|
+
const fire = (kind, param) => {
|
|
5249
|
+
if (activeForm.value) return;
|
|
5250
|
+
const d = depsRef.current;
|
|
5251
|
+
if (kind === "manual") {
|
|
5252
|
+
const form = d.forms.list.find((f) => f.id === param);
|
|
5253
|
+
if (form) activeForm.value = { form, trigger: "manual" };
|
|
5254
|
+
return;
|
|
5255
|
+
}
|
|
5256
|
+
for (const form of d.forms.byTrigger[kind] ?? []) {
|
|
5257
|
+
const t = form.triggers.find((tr) => tr.kind === kind);
|
|
5258
|
+
if (!t || !triggerMatches(t, d) || isDone(form) || !whenPasses(form, d)) continue;
|
|
5259
|
+
activeForm.value = { form, trigger: kind };
|
|
5260
|
+
return;
|
|
5261
|
+
}
|
|
5262
|
+
};
|
|
5263
|
+
const finish = (values, skipped) => {
|
|
5264
|
+
const active = activeForm.value;
|
|
5265
|
+
if (!active) return;
|
|
5266
|
+
activeForm.value = null;
|
|
5267
|
+
const { form, trigger } = active;
|
|
5268
|
+
if (form.frequency === "session") sessionDone.add(form.id);
|
|
5269
|
+
else if (form.frequency !== "always") depsRef.current.persistence.saveFormDone(form.id);
|
|
5270
|
+
depsRef.current.onComplete(form, trigger, values, skipped);
|
|
5271
|
+
};
|
|
5272
|
+
return {
|
|
5273
|
+
activeForm,
|
|
5274
|
+
fire,
|
|
5275
|
+
complete: (values) => finish(values, false),
|
|
5276
|
+
skip: () => finish({}, true)
|
|
5277
|
+
};
|
|
5278
|
+
}
|
|
5279
|
+
function triggerMatches(t, d) {
|
|
5280
|
+
if (t.kind === "after-messages") return d.messageCount() >= Number(t.param ?? 0);
|
|
5281
|
+
if (t.kind === "page-area") return d.pageArea() === t.param;
|
|
5282
|
+
return true;
|
|
5283
|
+
}
|
|
5284
|
+
function whenPasses(form, d) {
|
|
5285
|
+
const w = form.when;
|
|
5286
|
+
if (!w) return true;
|
|
5287
|
+
if (w.missingContext?.length) {
|
|
5288
|
+
const ctx = d.userContext() ?? {};
|
|
5289
|
+
if (w.missingContext.some((key) => ctx[key] !== void 0 && ctx[key] !== "")) return false;
|
|
5290
|
+
}
|
|
5291
|
+
if (w.pageArea) {
|
|
5292
|
+
const areas = Array.isArray(w.pageArea) ? w.pageArea : [w.pageArea];
|
|
5293
|
+
if (!areas.includes(d.pageArea() ?? "")) return false;
|
|
5128
5294
|
}
|
|
5129
|
-
|
|
5295
|
+
const count = d.messageCount();
|
|
5296
|
+
if (w.minMessages != null && count < w.minMessages) return false;
|
|
5297
|
+
if (w.maxMessages != null && count > w.maxMessages) return false;
|
|
5298
|
+
return true;
|
|
5130
5299
|
}
|
|
5131
5300
|
|
|
5132
5301
|
// src/ui/sidebar.tsx
|
|
5133
|
-
import { Fragment as Fragment4, jsx as
|
|
5302
|
+
import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs18 } from "preact/jsx-runtime";
|
|
5134
5303
|
function Sidebar(props2) {
|
|
5135
|
-
const
|
|
5304
|
+
const p34 = BRAND.cssPrefix;
|
|
5136
5305
|
const { site, blocks, strings, collapsed } = props2;
|
|
5137
5306
|
const navigation = blocks?.navigation ?? [];
|
|
5138
5307
|
const linkCards = blocks?.linkCards ?? [];
|
|
5139
5308
|
const toggleLabel = collapsed ? strings.expandSidebar : strings.collapseSidebar;
|
|
5140
|
-
return /* @__PURE__ */
|
|
5141
|
-
/* @__PURE__ */
|
|
5142
|
-
/* @__PURE__ */
|
|
5143
|
-
/* @__PURE__ */
|
|
5309
|
+
return /* @__PURE__ */ jsxs18("aside", { class: `${p34}-sidebar`, "data-collapsed": collapsed ? "true" : "false", "data-testid": TID.sidebar, children: [
|
|
5310
|
+
/* @__PURE__ */ jsxs18("div", { class: `${p34}-sidebar-header`, children: [
|
|
5311
|
+
/* @__PURE__ */ jsx23(SidebarBrand, { site }),
|
|
5312
|
+
/* @__PURE__ */ jsx23(
|
|
5144
5313
|
"button",
|
|
5145
5314
|
{
|
|
5146
5315
|
type: "button",
|
|
5147
|
-
class: `${
|
|
5316
|
+
class: `${p34}-sidebar-toggle`,
|
|
5148
5317
|
"aria-label": toggleLabel,
|
|
5149
5318
|
"aria-expanded": collapsed ? "false" : "true",
|
|
5150
5319
|
title: toggleLabel,
|
|
5151
5320
|
onClick: props2.onToggleCollapsed,
|
|
5152
5321
|
"data-testid": TID.sidebarToggle,
|
|
5153
|
-
children: /* @__PURE__ */
|
|
5322
|
+
children: /* @__PURE__ */ jsx23(SidebarToggleIcon, { collapsed })
|
|
5154
5323
|
}
|
|
5155
5324
|
)
|
|
5156
5325
|
] }),
|
|
5157
|
-
collapsed ? null : /* @__PURE__ */
|
|
5158
|
-
navigation.length > 0 ? /* @__PURE__ */
|
|
5159
|
-
linkCards.length > 0 ? /* @__PURE__ */
|
|
5160
|
-
props2.showConversations ? /* @__PURE__ */
|
|
5326
|
+
collapsed ? null : /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
5327
|
+
navigation.length > 0 ? /* @__PURE__ */ jsx23("nav", { class: `${p34}-sidebar-section`, "data-section": "navigation", children: /* @__PURE__ */ jsx23(SidebarNav, { items: navigation }) }) : null,
|
|
5328
|
+
linkCards.length > 0 ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-section`, "data-section": "link-cards", children: /* @__PURE__ */ jsx23(SidebarCards, { items: linkCards }) }) : null,
|
|
5329
|
+
props2.showConversations ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-conversations`, children: /* @__PURE__ */ jsx23(
|
|
5161
5330
|
ConversationList,
|
|
5162
5331
|
{
|
|
5163
5332
|
transport: props2.transport,
|
|
@@ -5171,18 +5340,18 @@ function Sidebar(props2) {
|
|
|
5171
5340
|
] });
|
|
5172
5341
|
}
|
|
5173
5342
|
function SidebarBrand({ site }) {
|
|
5174
|
-
const
|
|
5343
|
+
const p34 = BRAND.cssPrefix;
|
|
5175
5344
|
if (site?.logo?.url) {
|
|
5176
5345
|
const alt = site.logo.alt ?? site.title ?? "Logo";
|
|
5177
|
-
return /* @__PURE__ */
|
|
5178
|
-
site.logoDark?.url ? /* @__PURE__ */
|
|
5179
|
-
/* @__PURE__ */
|
|
5346
|
+
return /* @__PURE__ */ jsxs18("picture", { children: [
|
|
5347
|
+
site.logoDark?.url ? /* @__PURE__ */ jsx23("source", { srcset: site.logoDark.url, media: "(prefers-color-scheme: dark)" }) : null,
|
|
5348
|
+
/* @__PURE__ */ jsx23("img", { class: `${p34}-sidebar-logo`, src: site.logo.url, alt })
|
|
5180
5349
|
] });
|
|
5181
5350
|
}
|
|
5182
|
-
return /* @__PURE__ */
|
|
5351
|
+
return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-title`, children: site?.title ?? BRAND.name });
|
|
5183
5352
|
}
|
|
5184
5353
|
function SidebarToggleIcon({ collapsed }) {
|
|
5185
|
-
return /* @__PURE__ */
|
|
5354
|
+
return /* @__PURE__ */ jsx23(
|
|
5186
5355
|
"svg",
|
|
5187
5356
|
{
|
|
5188
5357
|
width: "16",
|
|
@@ -5192,38 +5361,38 @@ function SidebarToggleIcon({ collapsed }) {
|
|
|
5192
5361
|
stroke: "currentColor",
|
|
5193
5362
|
"stroke-width": "2",
|
|
5194
5363
|
"aria-hidden": "true",
|
|
5195
|
-
children: collapsed ? /* @__PURE__ */
|
|
5364
|
+
children: collapsed ? /* @__PURE__ */ jsx23("polyline", { points: "9 6 15 12 9 18" }) : /* @__PURE__ */ jsx23("polyline", { points: "15 6 9 12 15 18" })
|
|
5196
5365
|
}
|
|
5197
5366
|
);
|
|
5198
5367
|
}
|
|
5199
5368
|
function SidebarNav({ items }) {
|
|
5200
|
-
const
|
|
5201
|
-
return /* @__PURE__ */
|
|
5369
|
+
const p34 = BRAND.cssPrefix;
|
|
5370
|
+
return /* @__PURE__ */ jsx23("ul", { class: `${p34}-sidebar-nav`, children: items.map((item) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsxs18(
|
|
5202
5371
|
"a",
|
|
5203
5372
|
{
|
|
5204
|
-
class: `${
|
|
5373
|
+
class: `${p34}-sidebar-nav-item`,
|
|
5205
5374
|
href: item.href,
|
|
5206
5375
|
target: item.href ? "_blank" : void 0,
|
|
5207
5376
|
rel: item.href ? "noreferrer" : void 0,
|
|
5208
5377
|
children: [
|
|
5209
|
-
item.icon ? /* @__PURE__ */
|
|
5210
|
-
/* @__PURE__ */
|
|
5378
|
+
item.icon ? /* @__PURE__ */ jsx23("span", { class: `${p34}-sidebar-nav-icon`, "data-icon": item.icon }) : null,
|
|
5379
|
+
/* @__PURE__ */ jsx23("span", { class: `${p34}-sidebar-nav-label`, children: item.label })
|
|
5211
5380
|
]
|
|
5212
5381
|
}
|
|
5213
5382
|
) }, item.id ?? item.label)) });
|
|
5214
5383
|
}
|
|
5215
5384
|
function SidebarCards({ items }) {
|
|
5216
|
-
const
|
|
5217
|
-
return /* @__PURE__ */
|
|
5385
|
+
const p34 = BRAND.cssPrefix;
|
|
5386
|
+
return /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-cards`, children: items.map((item) => /* @__PURE__ */ jsxs18(
|
|
5218
5387
|
"a",
|
|
5219
5388
|
{
|
|
5220
|
-
class: `${
|
|
5389
|
+
class: `${p34}-sidebar-card`,
|
|
5221
5390
|
href: item.href,
|
|
5222
5391
|
target: item.href ? "_blank" : void 0,
|
|
5223
5392
|
rel: item.href ? "noreferrer" : void 0,
|
|
5224
5393
|
children: [
|
|
5225
|
-
/* @__PURE__ */
|
|
5226
|
-
item.description ? /* @__PURE__ */
|
|
5394
|
+
/* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-card-label`, children: item.label }),
|
|
5395
|
+
item.description ? /* @__PURE__ */ jsx23("div", { class: `${p34}-sidebar-card-desc`, children: item.description }) : null
|
|
5227
5396
|
]
|
|
5228
5397
|
},
|
|
5229
5398
|
item.id ?? item.label
|
|
@@ -5231,11 +5400,11 @@ function SidebarCards({ items }) {
|
|
|
5231
5400
|
}
|
|
5232
5401
|
|
|
5233
5402
|
// src/ui/page-shell.tsx
|
|
5234
|
-
import { jsx as
|
|
5235
|
-
var
|
|
5403
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "preact/jsx-runtime";
|
|
5404
|
+
var p19 = BRAND.cssPrefix;
|
|
5236
5405
|
function PageShell(props2) {
|
|
5237
|
-
return /* @__PURE__ */
|
|
5238
|
-
/* @__PURE__ */
|
|
5406
|
+
return /* @__PURE__ */ jsxs19("main", { class: `${p19}-page-shell`, "data-sidebar-collapsed": props2.sidebarCollapsed ? "true" : "false", children: [
|
|
5407
|
+
/* @__PURE__ */ jsx24(
|
|
5239
5408
|
Sidebar,
|
|
5240
5409
|
{
|
|
5241
5410
|
site: props2.site,
|
|
@@ -5250,15 +5419,15 @@ function PageShell(props2) {
|
|
|
5250
5419
|
onToggleCollapsed: props2.onToggleSidebarCollapsed
|
|
5251
5420
|
}
|
|
5252
5421
|
),
|
|
5253
|
-
/* @__PURE__ */
|
|
5422
|
+
/* @__PURE__ */ jsx24("section", { class: `${p19}-page-chat`, "aria-label": "Chat", children: props2.children })
|
|
5254
5423
|
] });
|
|
5255
5424
|
}
|
|
5256
5425
|
|
|
5257
5426
|
// src/ui/home-nav.ts
|
|
5258
|
-
import { signal as
|
|
5427
|
+
import { signal as signal6 } from "@preact/signals";
|
|
5259
5428
|
var emptyStacks = (tabs) => Object.fromEntries(tabs.map((t) => [t, []]));
|
|
5260
5429
|
function createHomeNav(initialTab, tabs, onSwitch) {
|
|
5261
|
-
const sig =
|
|
5430
|
+
const sig = signal6({ activeTab: initialTab, stacks: emptyStacks(tabs) });
|
|
5262
5431
|
return {
|
|
5263
5432
|
sig,
|
|
5264
5433
|
switchTab(tab) {
|
|
@@ -5287,7 +5456,7 @@ var topScreen = (s) => activeStack(s).at(-1);
|
|
|
5287
5456
|
var atTabRoot = (s) => activeStack(s).length === 0;
|
|
5288
5457
|
|
|
5289
5458
|
// src/ui/messenger-home.tsx
|
|
5290
|
-
import { useCallback as useCallback4, useEffect as useEffect15, useRef as
|
|
5459
|
+
import { useCallback as useCallback4, useEffect as useEffect15, useRef as useRef8 } from "preact/hooks";
|
|
5291
5460
|
import { useComputed as useComputed6 } from "@preact/signals";
|
|
5292
5461
|
|
|
5293
5462
|
// src/ui/modules/messages.tsx
|
|
@@ -5300,80 +5469,80 @@ var chatLayout = {
|
|
|
5300
5469
|
import { useEffect as useEffect11, useMemo as useMemo2, useState as useState8 } from "preact/hooks";
|
|
5301
5470
|
|
|
5302
5471
|
// src/ui/back-header.tsx
|
|
5303
|
-
import { jsx as
|
|
5304
|
-
var
|
|
5472
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "preact/jsx-runtime";
|
|
5473
|
+
var p20 = BRAND.cssPrefix;
|
|
5305
5474
|
function TitleBar({ title, actions }) {
|
|
5306
|
-
return /* @__PURE__ */
|
|
5307
|
-
/* @__PURE__ */
|
|
5308
|
-
/* @__PURE__ */
|
|
5309
|
-
actions ?? /* @__PURE__ */
|
|
5475
|
+
return /* @__PURE__ */ jsxs20("header", { class: `${p20}-back-header`, "data-variant": "title", children: [
|
|
5476
|
+
/* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" }),
|
|
5477
|
+
/* @__PURE__ */ jsx25("h1", { class: `${p20}-back-title`, children: title }),
|
|
5478
|
+
actions ?? /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" })
|
|
5310
5479
|
] });
|
|
5311
5480
|
}
|
|
5312
5481
|
function BackHeader({ title, backLabel, onBack, actions, testid }) {
|
|
5313
|
-
return /* @__PURE__ */
|
|
5314
|
-
/* @__PURE__ */
|
|
5315
|
-
/* @__PURE__ */
|
|
5316
|
-
actions ?? /* @__PURE__ */
|
|
5482
|
+
return /* @__PURE__ */ jsxs20("header", { class: `${p20}-back-header`, "data-testid": testid, children: [
|
|
5483
|
+
/* @__PURE__ */ jsx25("button", { type: "button", class: `${p20}-icon-btn`, onClick: onBack, "aria-label": backLabel, title: backLabel, children: /* @__PURE__ */ jsx25(BackIcon, {}) }),
|
|
5484
|
+
/* @__PURE__ */ jsx25("h1", { class: `${p20}-back-title`, children: title }),
|
|
5485
|
+
actions ?? /* @__PURE__ */ jsx25("span", { class: `${p20}-back-spacer`, "aria-hidden": "true" })
|
|
5317
5486
|
] });
|
|
5318
5487
|
}
|
|
5319
5488
|
|
|
5320
5489
|
// src/ui/home-search.tsx
|
|
5321
|
-
import { jsx as
|
|
5322
|
-
var
|
|
5490
|
+
import { jsx as jsx26, jsxs as jsxs21 } from "preact/jsx-runtime";
|
|
5491
|
+
var p21 = BRAND.cssPrefix;
|
|
5323
5492
|
function HomeSearchButton({ placeholder, onActivate }) {
|
|
5324
|
-
return /* @__PURE__ */
|
|
5325
|
-
/* @__PURE__ */
|
|
5326
|
-
/* @__PURE__ */
|
|
5493
|
+
return /* @__PURE__ */ jsxs21("button", { type: "button", class: `${p21}-home-search`, onClick: onActivate, "data-testid": TID.homeSearch, children: [
|
|
5494
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-text`, children: placeholder }),
|
|
5495
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(SearchIcon, {}) })
|
|
5327
5496
|
] });
|
|
5328
5497
|
}
|
|
5329
5498
|
function HelpSearchInput({ placeholder, value, onInput }) {
|
|
5330
|
-
return /* @__PURE__ */
|
|
5331
|
-
/* @__PURE__ */
|
|
5499
|
+
return /* @__PURE__ */ jsxs21("div", { class: `${p21}-home-search`, "data-input": "true", children: [
|
|
5500
|
+
/* @__PURE__ */ jsx26(
|
|
5332
5501
|
"input",
|
|
5333
5502
|
{
|
|
5334
5503
|
type: "search",
|
|
5335
|
-
class: `${
|
|
5504
|
+
class: `${p21}-home-search-input`,
|
|
5336
5505
|
placeholder,
|
|
5337
5506
|
value,
|
|
5338
5507
|
onInput: (e) => onInput(e.currentTarget.value),
|
|
5339
5508
|
"data-testid": TID.helpSearch
|
|
5340
5509
|
}
|
|
5341
5510
|
),
|
|
5342
|
-
/* @__PURE__ */
|
|
5511
|
+
/* @__PURE__ */ jsx26("span", { class: `${p21}-home-search-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx26(SearchIcon, {}) })
|
|
5343
5512
|
] });
|
|
5344
5513
|
}
|
|
5345
5514
|
|
|
5346
5515
|
// src/ui/list-row.tsx
|
|
5347
|
-
import { jsx as
|
|
5348
|
-
var
|
|
5516
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "preact/jsx-runtime";
|
|
5517
|
+
var p22 = BRAND.cssPrefix;
|
|
5349
5518
|
function ListRow({ title, subtitle, onClick, testid }) {
|
|
5350
|
-
return /* @__PURE__ */
|
|
5351
|
-
/* @__PURE__ */
|
|
5352
|
-
/* @__PURE__ */
|
|
5353
|
-
subtitle ? /* @__PURE__ */
|
|
5519
|
+
return /* @__PURE__ */ jsxs22("button", { type: "button", class: `${p22}-list-row`, onClick, "data-testid": testid, children: [
|
|
5520
|
+
/* @__PURE__ */ jsxs22("span", { class: `${p22}-list-row-body`, children: [
|
|
5521
|
+
/* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-title`, children: title }),
|
|
5522
|
+
subtitle ? /* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-sub`, children: subtitle }) : null
|
|
5354
5523
|
] }),
|
|
5355
|
-
/* @__PURE__ */
|
|
5524
|
+
/* @__PURE__ */ jsx27("span", { class: `${p22}-list-row-chevron`, "aria-hidden": "true", children: /* @__PURE__ */ jsx27(ChevronRightIcon, {}) })
|
|
5356
5525
|
] });
|
|
5357
5526
|
}
|
|
5358
5527
|
|
|
5359
5528
|
// src/ui/module-state.tsx
|
|
5360
|
-
import { jsx as
|
|
5361
|
-
var
|
|
5529
|
+
import { jsx as jsx28, jsxs as jsxs23 } from "preact/jsx-runtime";
|
|
5530
|
+
var p23 = BRAND.cssPrefix;
|
|
5362
5531
|
function ModuleState({
|
|
5363
5532
|
tone = "info",
|
|
5364
5533
|
message,
|
|
5365
5534
|
onRetry,
|
|
5366
5535
|
strings
|
|
5367
5536
|
}) {
|
|
5368
|
-
return /* @__PURE__ */
|
|
5369
|
-
/* @__PURE__ */
|
|
5370
|
-
onRetry ? /* @__PURE__ */
|
|
5537
|
+
return /* @__PURE__ */ jsxs23("div", { class: `${p23}-module-empty`, role: tone === "error" ? "alert" : "status", "aria-live": "polite", children: [
|
|
5538
|
+
/* @__PURE__ */ jsx28("span", { children: message }),
|
|
5539
|
+
onRetry ? /* @__PURE__ */ jsx28("button", { type: "button", class: `${p23}-module-retry`, onClick: onRetry, children: strings.errorRetry }) : null
|
|
5371
5540
|
] });
|
|
5372
5541
|
}
|
|
5373
5542
|
|
|
5374
5543
|
// src/ui/modules/help.tsx
|
|
5375
|
-
import { jsx as
|
|
5376
|
-
var
|
|
5544
|
+
import { jsx as jsx29, jsxs as jsxs24 } from "preact/jsx-runtime";
|
|
5545
|
+
var p24 = BRAND.cssPrefix;
|
|
5377
5546
|
var log12 = logger.scope("help");
|
|
5378
5547
|
var openArticle = (nav, a) => a.url ? nav.push({ kind: "iframe", url: a.url, title: a.title }) : nav.push({ kind: "content", id: a.id, title: a.title });
|
|
5379
5548
|
function groupByCategory(items) {
|
|
@@ -5402,7 +5571,7 @@ function fuzzySearch(items, query) {
|
|
|
5402
5571
|
return items.map((item) => ({ item, score: Math.max(fuzzyScore(q, item.title) * 2, fuzzyScore(q, item.description ?? "")) })).filter((r) => r.score > 0).toSorted((a, b) => b.score - a.score).map((r) => r.item);
|
|
5403
5572
|
}
|
|
5404
5573
|
function ArticleRow({ article, nav }) {
|
|
5405
|
-
return /* @__PURE__ */
|
|
5574
|
+
return /* @__PURE__ */ jsx29(
|
|
5406
5575
|
ListRow,
|
|
5407
5576
|
{
|
|
5408
5577
|
title: article.title,
|
|
@@ -5439,46 +5608,46 @@ function HelpRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5439
5608
|
const results = useMemo2(() => fuzzySearch(items, query), [items, query]);
|
|
5440
5609
|
function renderBody() {
|
|
5441
5610
|
if (query.trim().length > 0) {
|
|
5442
|
-
if (results.length === 0) return /* @__PURE__ */
|
|
5443
|
-
return /* @__PURE__ */
|
|
5611
|
+
if (results.length === 0) return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpSearchEmpty, strings });
|
|
5612
|
+
return /* @__PURE__ */ jsx29("div", { class: `${p24}-help-card`, children: results.map((a) => /* @__PURE__ */ jsx29(ArticleRow, { article: a, nav }, a.id)) });
|
|
5444
5613
|
}
|
|
5445
|
-
if (state === "loading") return /* @__PURE__ */
|
|
5614
|
+
if (state === "loading") return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpLoading, strings });
|
|
5446
5615
|
if (state === "error") {
|
|
5447
|
-
return /* @__PURE__ */
|
|
5616
|
+
return /* @__PURE__ */ jsx29(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
5448
5617
|
}
|
|
5449
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
5450
|
-
return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */
|
|
5451
|
-
category ? /* @__PURE__ */
|
|
5452
|
-
/* @__PURE__ */
|
|
5618
|
+
if (items.length === 0) return /* @__PURE__ */ jsx29(ModuleState, { message: strings.helpEmpty, strings });
|
|
5619
|
+
return groupByCategory(items).map(([category, rows]) => /* @__PURE__ */ jsxs24("section", { class: `${p24}-help-group`, children: [
|
|
5620
|
+
category ? /* @__PURE__ */ jsx29("h2", { class: `${p24}-help-section-title`, children: category }) : null,
|
|
5621
|
+
/* @__PURE__ */ jsx29("div", { class: `${p24}-help-card`, children: rows.map((a) => /* @__PURE__ */ jsx29(ArticleRow, { article: a, nav }, a.id)) })
|
|
5453
5622
|
] }, category));
|
|
5454
5623
|
}
|
|
5455
|
-
return /* @__PURE__ */
|
|
5456
|
-
/* @__PURE__ */
|
|
5457
|
-
/* @__PURE__ */
|
|
5458
|
-
/* @__PURE__ */
|
|
5624
|
+
return /* @__PURE__ */ jsxs24("div", { class: `${p24}-module`, children: [
|
|
5625
|
+
/* @__PURE__ */ jsx29(TitleBar, { title: strings.helpTitle, actions: /* @__PURE__ */ jsx29(HeaderActions, { panelProps, variant: "plain" }) }),
|
|
5626
|
+
/* @__PURE__ */ jsx29("div", { class: `${p24}-module-pad`, children: /* @__PURE__ */ jsx29(HelpSearchInput, { placeholder: strings.helpSearchPlaceholder, value: query, onInput: setQuery }) }),
|
|
5627
|
+
/* @__PURE__ */ jsx29("div", { class: `${p24}-help-list`, children: renderBody() })
|
|
5459
5628
|
] });
|
|
5460
5629
|
}
|
|
5461
5630
|
var helpLayout = {
|
|
5462
5631
|
Icon: HelpIcon,
|
|
5463
|
-
Root: (props2) => /* @__PURE__ */
|
|
5632
|
+
Root: (props2) => /* @__PURE__ */ jsx29(HelpRoot, { ...props2 })
|
|
5464
5633
|
};
|
|
5465
5634
|
|
|
5466
5635
|
// src/ui/modules/home.tsx
|
|
5467
5636
|
import { useEffect as useEffect12, useState as useState9 } from "preact/hooks";
|
|
5468
5637
|
|
|
5469
5638
|
// src/ui/home-card.tsx
|
|
5470
|
-
import { jsx as
|
|
5471
|
-
var
|
|
5639
|
+
import { jsx as jsx30 } from "preact/jsx-runtime";
|
|
5640
|
+
var p25 = BRAND.cssPrefix;
|
|
5472
5641
|
function HomeCard({ onClick, children, testid }) {
|
|
5473
5642
|
if (onClick) {
|
|
5474
|
-
return /* @__PURE__ */
|
|
5643
|
+
return /* @__PURE__ */ jsx30("button", { type: "button", class: `${p25}-home-card`, "data-interactive": "true", onClick, "data-testid": testid, children });
|
|
5475
5644
|
}
|
|
5476
|
-
return /* @__PURE__ */
|
|
5645
|
+
return /* @__PURE__ */ jsx30("div", { class: `${p25}-home-card`, "data-testid": testid, children });
|
|
5477
5646
|
}
|
|
5478
5647
|
|
|
5479
5648
|
// src/ui/modules/home.tsx
|
|
5480
|
-
import { Fragment as Fragment5, jsx as
|
|
5481
|
-
var
|
|
5649
|
+
import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs25 } from "preact/jsx-runtime";
|
|
5650
|
+
var p26 = BRAND.cssPrefix;
|
|
5482
5651
|
var log13 = logger.scope("home");
|
|
5483
5652
|
function resolveGreeting(props2) {
|
|
5484
5653
|
const name = props2.options.userContext?.name;
|
|
@@ -5515,49 +5684,49 @@ function HomeRoot(props2) {
|
|
|
5515
5684
|
const avatars = config.userAvatars ?? [];
|
|
5516
5685
|
const status = config.status;
|
|
5517
5686
|
const contentTitle = config.contentBlockTitle ? moduleLabel(strings, config.contentBlockTitle) : strings.homeContentTitle;
|
|
5518
|
-
return /* @__PURE__ */
|
|
5519
|
-
/* @__PURE__ */
|
|
5520
|
-
/* @__PURE__ */
|
|
5521
|
-
config.brandName ? /* @__PURE__ */
|
|
5522
|
-
/* @__PURE__ */
|
|
5523
|
-
avatars.length > 0 ? /* @__PURE__ */
|
|
5524
|
-
/* @__PURE__ */
|
|
5687
|
+
return /* @__PURE__ */ jsx31("div", { class: `${p26}-module ${p26}-home`, "data-testid": TID.homeView, children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-scroll`, children: [
|
|
5688
|
+
/* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero`, children: [
|
|
5689
|
+
/* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero-top`, children: [
|
|
5690
|
+
config.brandName ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-brand`, "data-testid": TID.homeBrand, children: config.brandName }) : /* @__PURE__ */ jsx31("span", { class: `${p26}-home-brand-spacer`, "aria-hidden": "true" }),
|
|
5691
|
+
/* @__PURE__ */ jsxs25("div", { class: `${p26}-home-hero-actions`, children: [
|
|
5692
|
+
avatars.length > 0 ? /* @__PURE__ */ jsx31("div", { class: `${p26}-home-avatars`, children: avatars.map((a) => /* @__PURE__ */ jsx31("span", { class: `${p26}-home-avatar`, title: a.role ? `${a.name} \xB7 ${a.role}` : a.name, children: a.avatar ? /* @__PURE__ */ jsx31("img", { src: a.avatar, alt: "", loading: "lazy" }) : /* @__PURE__ */ jsx31("span", { children: initials(a.name) }) }, a.name)) }) : null,
|
|
5693
|
+
/* @__PURE__ */ jsx31(HeaderActions, { panelProps, variant: "plain" })
|
|
5525
5694
|
] })
|
|
5526
5695
|
] }),
|
|
5527
|
-
config.showGreeting !== false ? /* @__PURE__ */
|
|
5528
|
-
/* @__PURE__ */
|
|
5529
|
-
greeting.subtitle ? /* @__PURE__ */
|
|
5696
|
+
config.showGreeting !== false ? /* @__PURE__ */ jsxs25(Fragment5, { children: [
|
|
5697
|
+
/* @__PURE__ */ jsx31("h1", { class: `${p26}-home-greeting`, "data-testid": TID.homeGreeting, children: greeting.title }),
|
|
5698
|
+
greeting.subtitle ? /* @__PURE__ */ jsx31("p", { class: `${p26}-home-lead`, children: greeting.subtitle }) : null
|
|
5530
5699
|
] }) : null
|
|
5531
5700
|
] }),
|
|
5532
|
-
/* @__PURE__ */
|
|
5533
|
-
config.showSearchBar !== false ? /* @__PURE__ */
|
|
5701
|
+
/* @__PURE__ */ jsxs25("div", { class: `${p26}-home-cards`, children: [
|
|
5702
|
+
config.showSearchBar !== false ? /* @__PURE__ */ jsx31(
|
|
5534
5703
|
HomeSearchButton,
|
|
5535
5704
|
{
|
|
5536
5705
|
placeholder: strings.homeSearchPlaceholder,
|
|
5537
5706
|
onActivate: () => nav.switchToLayout("help")
|
|
5538
5707
|
}
|
|
5539
5708
|
) : null,
|
|
5540
|
-
recent ? /* @__PURE__ */
|
|
5541
|
-
/* @__PURE__ */
|
|
5542
|
-
/* @__PURE__ */
|
|
5543
|
-
/* @__PURE__ */
|
|
5544
|
-
recent.preview ? /* @__PURE__ */
|
|
5709
|
+
recent ? /* @__PURE__ */ jsx31(HomeCard, { onClick: () => nav.selectSession(recent.sessionId), testid: TID.homeRecent, children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-recent-row`, "data-unread": (recent.unreadCount ?? 0) > 0 ? "true" : void 0, children: [
|
|
5710
|
+
/* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-avatar`, "aria-hidden": "true", children: /* @__PURE__ */ jsx31(BubblesIcon, {}) }),
|
|
5711
|
+
/* @__PURE__ */ jsxs25("span", { class: `${p26}-home-recent-body`, children: [
|
|
5712
|
+
/* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-title`, children: recent.title }),
|
|
5713
|
+
recent.preview ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-preview`, children: recent.preview }) : null
|
|
5545
5714
|
] }),
|
|
5546
|
-
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */
|
|
5715
|
+
(recent.unreadCount ?? 0) > 0 ? /* @__PURE__ */ jsx31("span", { class: `${p26}-home-recent-dot`, "aria-label": "Unread" }) : null
|
|
5547
5716
|
] }) }) : null,
|
|
5548
|
-
status ? /* @__PURE__ */
|
|
5717
|
+
status ? /* @__PURE__ */ jsx31(
|
|
5549
5718
|
HomeCard,
|
|
5550
5719
|
{
|
|
5551
5720
|
onClick: status.url ? () => nav.push({ kind: "iframe", url: status.url, title: status.text }) : void 0,
|
|
5552
|
-
children: /* @__PURE__ */
|
|
5553
|
-
/* @__PURE__ */
|
|
5554
|
-
/* @__PURE__ */
|
|
5721
|
+
children: /* @__PURE__ */ jsxs25("div", { class: `${p26}-home-status`, "data-level": status.level ?? "operational", children: [
|
|
5722
|
+
/* @__PURE__ */ jsx31("span", { class: `${p26}-home-status-icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx31(StatusOkIcon, {}) }),
|
|
5723
|
+
/* @__PURE__ */ jsx31("span", { class: `${p26}-home-status-text`, children: status.text })
|
|
5555
5724
|
] })
|
|
5556
5725
|
}
|
|
5557
5726
|
) : null,
|
|
5558
|
-
content.length > 0 ? /* @__PURE__ */
|
|
5559
|
-
/* @__PURE__ */
|
|
5560
|
-
/* @__PURE__ */
|
|
5727
|
+
content.length > 0 ? /* @__PURE__ */ jsxs25("section", { class: `${p26}-home-content`, children: [
|
|
5728
|
+
/* @__PURE__ */ jsx31("div", { class: `${p26}-home-content-title`, children: contentTitle }),
|
|
5729
|
+
/* @__PURE__ */ jsx31("div", { class: `${p26}-home-content-list`, children: content.map((item) => /* @__PURE__ */ jsx31(
|
|
5561
5730
|
ListRow,
|
|
5562
5731
|
{
|
|
5563
5732
|
title: item.title,
|
|
@@ -5573,13 +5742,13 @@ function HomeRoot(props2) {
|
|
|
5573
5742
|
}
|
|
5574
5743
|
var homeLayout = {
|
|
5575
5744
|
Icon: HomeIcon,
|
|
5576
|
-
Root: (props2) => /* @__PURE__ */
|
|
5745
|
+
Root: (props2) => /* @__PURE__ */ jsx31(HomeRoot, { ...props2 })
|
|
5577
5746
|
};
|
|
5578
5747
|
|
|
5579
5748
|
// src/ui/modules/news.tsx
|
|
5580
5749
|
import { useEffect as useEffect13, useState as useState10 } from "preact/hooks";
|
|
5581
|
-
import { jsx as
|
|
5582
|
-
var
|
|
5750
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "preact/jsx-runtime";
|
|
5751
|
+
var p27 = BRAND.cssPrefix;
|
|
5583
5752
|
var log14 = logger.scope("news");
|
|
5584
5753
|
function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
5585
5754
|
const tags = config.contentTags;
|
|
@@ -5605,38 +5774,38 @@ function NewsRoot({ transport, strings, config, nav, panelProps }) {
|
|
|
5605
5774
|
};
|
|
5606
5775
|
}, [transport, tags, reloadKey]);
|
|
5607
5776
|
function renderBody() {
|
|
5608
|
-
if (state === "loading") return /* @__PURE__ */
|
|
5777
|
+
if (state === "loading") return /* @__PURE__ */ jsx32(ModuleState, { message: strings.newsLoading, strings });
|
|
5609
5778
|
if (state === "error") {
|
|
5610
|
-
return /* @__PURE__ */
|
|
5779
|
+
return /* @__PURE__ */ jsx32(ModuleState, { tone: "error", message: errorMsg, onRetry: () => setReloadKey((k) => k + 1), strings });
|
|
5611
5780
|
}
|
|
5612
|
-
if (items.length === 0) return /* @__PURE__ */
|
|
5613
|
-
return /* @__PURE__ */
|
|
5781
|
+
if (items.length === 0) return /* @__PURE__ */ jsx32(ModuleState, { message: strings.newsEmpty, strings });
|
|
5782
|
+
return /* @__PURE__ */ jsx32("div", { class: `${p27}-news-list`, children: items.map((item) => /* @__PURE__ */ jsxs26(
|
|
5614
5783
|
"button",
|
|
5615
5784
|
{
|
|
5616
5785
|
type: "button",
|
|
5617
|
-
class: `${
|
|
5786
|
+
class: `${p27}-news-card`,
|
|
5618
5787
|
onClick: () => nav.push({ kind: "content", id: item.id, title: item.title }),
|
|
5619
5788
|
"data-testid": tid(TID.newsItem, item.id),
|
|
5620
5789
|
children: [
|
|
5621
|
-
item.image ? /* @__PURE__ */
|
|
5622
|
-
/* @__PURE__ */
|
|
5623
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
5624
|
-
/* @__PURE__ */
|
|
5625
|
-
item.description ? /* @__PURE__ */
|
|
5790
|
+
item.image ? /* @__PURE__ */ jsx32("img", { class: `${p27}-news-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
|
|
5791
|
+
/* @__PURE__ */ jsxs26("span", { class: `${p27}-news-body`, children: [
|
|
5792
|
+
item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx32("span", { class: `${p27}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx32("span", { class: `${p27}-news-tag`, children: t }, t)) }) : null,
|
|
5793
|
+
/* @__PURE__ */ jsx32("span", { class: `${p27}-news-title`, children: item.title }),
|
|
5794
|
+
item.description ? /* @__PURE__ */ jsx32("span", { class: `${p27}-news-summary`, children: item.description }) : null
|
|
5626
5795
|
] })
|
|
5627
5796
|
]
|
|
5628
5797
|
},
|
|
5629
5798
|
item.id
|
|
5630
5799
|
)) });
|
|
5631
5800
|
}
|
|
5632
|
-
return /* @__PURE__ */
|
|
5633
|
-
/* @__PURE__ */
|
|
5634
|
-
/* @__PURE__ */
|
|
5801
|
+
return /* @__PURE__ */ jsxs26("div", { class: `${p27}-module`, children: [
|
|
5802
|
+
/* @__PURE__ */ jsx32(TitleBar, { title: strings.newsTitle, actions: /* @__PURE__ */ jsx32(HeaderActions, { panelProps, variant: "plain" }) }),
|
|
5803
|
+
/* @__PURE__ */ jsx32("div", { class: `${p27}-module-scroll`, children: renderBody() })
|
|
5635
5804
|
] });
|
|
5636
5805
|
}
|
|
5637
5806
|
var newsLayout = {
|
|
5638
5807
|
Icon: NewsIcon,
|
|
5639
|
-
Root: (props2) => /* @__PURE__ */
|
|
5808
|
+
Root: (props2) => /* @__PURE__ */ jsx32(NewsRoot, { ...props2 })
|
|
5640
5809
|
};
|
|
5641
5810
|
|
|
5642
5811
|
// src/ui/modules/registry.ts
|
|
@@ -5648,28 +5817,28 @@ var LAYOUTS = {
|
|
|
5648
5817
|
};
|
|
5649
5818
|
|
|
5650
5819
|
// src/ui/home-tab-bar.tsx
|
|
5651
|
-
import { jsx as
|
|
5652
|
-
var
|
|
5820
|
+
import { jsx as jsx33, jsxs as jsxs27 } from "preact/jsx-runtime";
|
|
5821
|
+
var p28 = BRAND.cssPrefix;
|
|
5653
5822
|
function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
5654
|
-
return /* @__PURE__ */
|
|
5823
|
+
return /* @__PURE__ */ jsx33("nav", { class: `${p28}-tabbar`, role: "tablist", "aria-label": strings.panelTitle, children: modules.map((m) => {
|
|
5655
5824
|
const Icon = LAYOUTS[m.layout].Icon;
|
|
5656
5825
|
const selected = m.id === activeTab;
|
|
5657
5826
|
const badge = m.layout === "chat" && unreadCount > 0 ? unreadCount > 9 ? "9+" : String(unreadCount) : null;
|
|
5658
|
-
return /* @__PURE__ */
|
|
5827
|
+
return /* @__PURE__ */ jsxs27(
|
|
5659
5828
|
"button",
|
|
5660
5829
|
{
|
|
5661
5830
|
type: "button",
|
|
5662
5831
|
role: "tab",
|
|
5663
5832
|
"aria-selected": selected,
|
|
5664
|
-
class: `${
|
|
5833
|
+
class: `${p28}-tab`,
|
|
5665
5834
|
onClick: () => onSelect(m.id),
|
|
5666
5835
|
"data-testid": tid(TID.tab, m.id),
|
|
5667
5836
|
children: [
|
|
5668
|
-
/* @__PURE__ */
|
|
5669
|
-
/* @__PURE__ */
|
|
5670
|
-
badge ? /* @__PURE__ */
|
|
5837
|
+
/* @__PURE__ */ jsxs27("span", { class: `${p28}-tab-icon`, "aria-hidden": "true", children: [
|
|
5838
|
+
/* @__PURE__ */ jsx33(Icon, {}),
|
|
5839
|
+
badge ? /* @__PURE__ */ jsx33("span", { class: `${p28}-tab-badge`, "data-testid": TID.tabBadge, children: badge }) : null
|
|
5671
5840
|
] }),
|
|
5672
|
-
/* @__PURE__ */
|
|
5841
|
+
/* @__PURE__ */ jsx33("span", { class: `${p28}-tab-label`, children: moduleLabel(strings, m.label) })
|
|
5673
5842
|
]
|
|
5674
5843
|
},
|
|
5675
5844
|
m.id
|
|
@@ -5678,12 +5847,12 @@ function HomeTabBar({ modules, activeTab, strings, unreadCount, onSelect }) {
|
|
|
5678
5847
|
}
|
|
5679
5848
|
|
|
5680
5849
|
// src/ui/iframe-view.tsx
|
|
5681
|
-
import { jsx as
|
|
5682
|
-
var
|
|
5850
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "preact/jsx-runtime";
|
|
5851
|
+
var p29 = BRAND.cssPrefix;
|
|
5683
5852
|
var SANDBOX = "allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads";
|
|
5684
5853
|
function IframeView({ url, title, strings, onBack, actions }) {
|
|
5685
|
-
return /* @__PURE__ */
|
|
5686
|
-
/* @__PURE__ */
|
|
5854
|
+
return /* @__PURE__ */ jsxs28("div", { class: `${p29}-module`, children: [
|
|
5855
|
+
/* @__PURE__ */ jsx34(
|
|
5687
5856
|
BackHeader,
|
|
5688
5857
|
{
|
|
5689
5858
|
title: title || strings.moduleBack,
|
|
@@ -5692,10 +5861,10 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
5692
5861
|
actions
|
|
5693
5862
|
}
|
|
5694
5863
|
),
|
|
5695
|
-
/* @__PURE__ */
|
|
5864
|
+
/* @__PURE__ */ jsx34(
|
|
5696
5865
|
"iframe",
|
|
5697
5866
|
{
|
|
5698
|
-
class: `${
|
|
5867
|
+
class: `${p29}-content-frame`,
|
|
5699
5868
|
src: url,
|
|
5700
5869
|
title: title || "content",
|
|
5701
5870
|
sandbox: SANDBOX,
|
|
@@ -5709,8 +5878,8 @@ function IframeView({ url, title, strings, onBack, actions }) {
|
|
|
5709
5878
|
|
|
5710
5879
|
// src/ui/content-view.tsx
|
|
5711
5880
|
import { useCallback as useCallback3, useEffect as useEffect14, useState as useState11 } from "preact/hooks";
|
|
5712
|
-
import { jsx as
|
|
5713
|
-
var
|
|
5881
|
+
import { jsx as jsx35, jsxs as jsxs29 } from "preact/jsx-runtime";
|
|
5882
|
+
var p30 = BRAND.cssPrefix;
|
|
5714
5883
|
var log15 = logger.scope("content");
|
|
5715
5884
|
function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
5716
5885
|
const [item, setItem] = useState11(null);
|
|
@@ -5738,17 +5907,17 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
|
5738
5907
|
};
|
|
5739
5908
|
}, [transport, id, reloadKey]);
|
|
5740
5909
|
function renderBody() {
|
|
5741
|
-
if (failed) return /* @__PURE__ */
|
|
5742
|
-
if (item === null) return /* @__PURE__ */
|
|
5743
|
-
return /* @__PURE__ */
|
|
5744
|
-
item.image ? /* @__PURE__ */
|
|
5745
|
-
item.description ? /* @__PURE__ */
|
|
5746
|
-
item.tags && item.tags.length > 0 ? /* @__PURE__ */
|
|
5747
|
-
/* @__PURE__ */
|
|
5910
|
+
if (failed) return /* @__PURE__ */ jsx35(ModuleState, { tone: "error", message: strings.errorGeneric, onRetry: retry, strings });
|
|
5911
|
+
if (item === null) return /* @__PURE__ */ jsx35(ModuleState, { message: strings.contentLoading, strings });
|
|
5912
|
+
return /* @__PURE__ */ jsxs29("article", { class: `${p30}-content`, "data-testid": TID.contentView, children: [
|
|
5913
|
+
item.image ? /* @__PURE__ */ jsx35("img", { class: `${p30}-content-hero`, src: item.image, alt: "", loading: "lazy" }) : null,
|
|
5914
|
+
item.description ? /* @__PURE__ */ jsx35("p", { class: `${p30}-content-subtitle`, children: item.description }) : null,
|
|
5915
|
+
item.tags && item.tags.length > 0 ? /* @__PURE__ */ jsx35("span", { class: `${p30}-news-tags`, children: item.tags.map((t) => /* @__PURE__ */ jsx35("span", { class: `${p30}-news-tag`, children: t }, t)) }) : null,
|
|
5916
|
+
/* @__PURE__ */ jsx35(StaticMarkdown, { text: item.content ?? "" })
|
|
5748
5917
|
] });
|
|
5749
5918
|
}
|
|
5750
|
-
return /* @__PURE__ */
|
|
5751
|
-
/* @__PURE__ */
|
|
5919
|
+
return /* @__PURE__ */ jsxs29("div", { class: `${p30}-module`, children: [
|
|
5920
|
+
/* @__PURE__ */ jsx35(
|
|
5752
5921
|
BackHeader,
|
|
5753
5922
|
{
|
|
5754
5923
|
title: item?.title || title || strings.moduleBack,
|
|
@@ -5758,13 +5927,13 @@ function ContentView({ id, title, transport, strings, onBack, actions }) {
|
|
|
5758
5927
|
testid: TID.backHeader
|
|
5759
5928
|
}
|
|
5760
5929
|
),
|
|
5761
|
-
/* @__PURE__ */
|
|
5930
|
+
/* @__PURE__ */ jsx35("div", { class: `${p30}-module-scroll`, "data-testid": TID.contentScroll, children: renderBody() })
|
|
5762
5931
|
] });
|
|
5763
5932
|
}
|
|
5764
5933
|
|
|
5765
5934
|
// src/ui/messenger-home.tsx
|
|
5766
|
-
import { jsx as
|
|
5767
|
-
var
|
|
5935
|
+
import { jsx as jsx36, jsxs as jsxs30 } from "preact/jsx-runtime";
|
|
5936
|
+
var p31 = BRAND.cssPrefix;
|
|
5768
5937
|
function MessengerHome({
|
|
5769
5938
|
panelProps,
|
|
5770
5939
|
enabledModules,
|
|
@@ -5776,7 +5945,7 @@ function MessengerHome({
|
|
|
5776
5945
|
}) {
|
|
5777
5946
|
const options = panelProps.options;
|
|
5778
5947
|
const strings = options.strings;
|
|
5779
|
-
const containerRef =
|
|
5948
|
+
const containerRef = useRef8(null);
|
|
5780
5949
|
useEffect15(() => {
|
|
5781
5950
|
const el = containerRef.current;
|
|
5782
5951
|
if (!el) return;
|
|
@@ -5790,7 +5959,7 @@ function MessengerHome({
|
|
|
5790
5959
|
el.removeEventListener("keydown", onKey);
|
|
5791
5960
|
};
|
|
5792
5961
|
}, [panelProps.onClose]);
|
|
5793
|
-
const composerAttachApiRef =
|
|
5962
|
+
const composerAttachApiRef = useRef8(null);
|
|
5794
5963
|
const onDropItems = useCallback4((items) => {
|
|
5795
5964
|
composerAttachApiRef.current?.attachFromDrop(items);
|
|
5796
5965
|
}, []);
|
|
@@ -5801,7 +5970,7 @@ function MessengerHome({
|
|
|
5801
5970
|
const activeModule = options.modules.byId[navState.activeTab];
|
|
5802
5971
|
const isReader = top?.kind === "iframe" || top?.kind === "content";
|
|
5803
5972
|
const showTabBar = enabledModules.length > 1 && (atTabRoot(navState) || !isReader);
|
|
5804
|
-
const savedSize =
|
|
5973
|
+
const savedSize = useRef8(null);
|
|
5805
5974
|
useEffect15(() => {
|
|
5806
5975
|
if (isReader && savedSize.current === null) {
|
|
5807
5976
|
savedSize.current = panelProps.panelSize;
|
|
@@ -5832,12 +6001,12 @@ function MessengerHome({
|
|
|
5832
6001
|
nav: moduleNav,
|
|
5833
6002
|
panelProps
|
|
5834
6003
|
});
|
|
5835
|
-
const plainActions = /* @__PURE__ */
|
|
6004
|
+
const plainActions = /* @__PURE__ */ jsx36(HeaderActions, { panelProps, variant: "plain" });
|
|
5836
6005
|
let body;
|
|
5837
6006
|
if (top?.kind === "iframe") {
|
|
5838
|
-
body = /* @__PURE__ */
|
|
6007
|
+
body = /* @__PURE__ */ jsx36(IframeView, { url: top.url, title: top.title, strings, onBack: nav.pop, actions: plainActions });
|
|
5839
6008
|
} else if (top?.kind === "content") {
|
|
5840
|
-
body = /* @__PURE__ */
|
|
6009
|
+
body = /* @__PURE__ */ jsx36(
|
|
5841
6010
|
ContentView,
|
|
5842
6011
|
{
|
|
5843
6012
|
id: top.id,
|
|
@@ -5849,7 +6018,7 @@ function MessengerHome({
|
|
|
5849
6018
|
}
|
|
5850
6019
|
);
|
|
5851
6020
|
} else if (activeModule?.layout === "chat") {
|
|
5852
|
-
body = /* @__PURE__ */
|
|
6021
|
+
body = /* @__PURE__ */ jsx36(
|
|
5853
6022
|
PanelContent,
|
|
5854
6023
|
{
|
|
5855
6024
|
...panelProps,
|
|
@@ -5860,23 +6029,23 @@ function MessengerHome({
|
|
|
5860
6029
|
);
|
|
5861
6030
|
} else if (activeModule) {
|
|
5862
6031
|
const Root = LAYOUTS[activeModule.layout].Root;
|
|
5863
|
-
body = Root ? /* @__PURE__ */
|
|
6032
|
+
body = Root ? /* @__PURE__ */ jsx36(Root, { ...screenProps(activeModule) }, activeModule.id) : null;
|
|
5864
6033
|
} else {
|
|
5865
6034
|
body = null;
|
|
5866
6035
|
}
|
|
5867
|
-
return /* @__PURE__ */
|
|
6036
|
+
return /* @__PURE__ */ jsxs30(
|
|
5868
6037
|
"div",
|
|
5869
6038
|
{
|
|
5870
6039
|
ref: containerRef,
|
|
5871
|
-
class: `${
|
|
6040
|
+
class: `${p31}-panel ${p31}-messenger`,
|
|
5872
6041
|
role: "dialog",
|
|
5873
6042
|
"aria-modal": "false",
|
|
5874
6043
|
"aria-label": strings.panelTitle,
|
|
5875
6044
|
style: { position: "relative" },
|
|
5876
6045
|
"data-testid": TID.messengerHome,
|
|
5877
6046
|
children: [
|
|
5878
|
-
/* @__PURE__ */
|
|
5879
|
-
showTabBar ? /* @__PURE__ */
|
|
6047
|
+
/* @__PURE__ */ jsx36("div", { class: `${p31}-messenger-body`, children: body }),
|
|
6048
|
+
showTabBar ? /* @__PURE__ */ jsx36(
|
|
5880
6049
|
HomeTabBar,
|
|
5881
6050
|
{
|
|
5882
6051
|
modules: enabledModules,
|
|
@@ -5886,8 +6055,8 @@ function MessengerHome({
|
|
|
5886
6055
|
onSelect: nav.switchTab
|
|
5887
6056
|
}
|
|
5888
6057
|
) : null,
|
|
5889
|
-
/* @__PURE__ */
|
|
5890
|
-
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */
|
|
6058
|
+
/* @__PURE__ */ jsx36(PoweredByBar, { poweredBy: options.poweredBy }),
|
|
6059
|
+
options.size.resize?.enabled && !(activeModule?.layout === "chat" && !top) ? /* @__PURE__ */ jsx36(
|
|
5891
6060
|
ResizeGrip,
|
|
5892
6061
|
{
|
|
5893
6062
|
panelEl: containerRef.current,
|
|
@@ -5904,29 +6073,29 @@ function MessengerHome({
|
|
|
5904
6073
|
}
|
|
5905
6074
|
|
|
5906
6075
|
// src/ui/modules-empty.tsx
|
|
5907
|
-
import { jsx as
|
|
5908
|
-
var
|
|
6076
|
+
import { jsx as jsx37, jsxs as jsxs31 } from "preact/jsx-runtime";
|
|
6077
|
+
var p32 = BRAND.cssPrefix;
|
|
5909
6078
|
function ModulesEmpty({ strings, onClose }) {
|
|
5910
|
-
return /* @__PURE__ */
|
|
6079
|
+
return /* @__PURE__ */ jsxs31(
|
|
5911
6080
|
"div",
|
|
5912
6081
|
{
|
|
5913
|
-
class: `${
|
|
6082
|
+
class: `${p32}-panel ${p32}-modules-empty`,
|
|
5914
6083
|
role: "dialog",
|
|
5915
6084
|
"aria-label": strings.panelTitle,
|
|
5916
6085
|
"data-testid": TID.modulesEmpty,
|
|
5917
6086
|
children: [
|
|
5918
|
-
onClose ? /* @__PURE__ */
|
|
6087
|
+
onClose ? /* @__PURE__ */ jsx37(
|
|
5919
6088
|
"button",
|
|
5920
6089
|
{
|
|
5921
6090
|
type: "button",
|
|
5922
|
-
class: `${
|
|
6091
|
+
class: `${p32}-icon-btn ${p32}-modules-empty-close`,
|
|
5923
6092
|
onClick: onClose,
|
|
5924
6093
|
"aria-label": strings.close,
|
|
5925
6094
|
title: strings.close,
|
|
5926
|
-
children: /* @__PURE__ */
|
|
6095
|
+
children: /* @__PURE__ */ jsx37(CloseIcon, {})
|
|
5927
6096
|
}
|
|
5928
6097
|
) : null,
|
|
5929
|
-
/* @__PURE__ */
|
|
6098
|
+
/* @__PURE__ */ jsx37("p", { class: `${p32}-modules-empty-text`, children: strings.modulesEmpty })
|
|
5930
6099
|
]
|
|
5931
6100
|
}
|
|
5932
6101
|
);
|
|
@@ -5997,9 +6166,9 @@ function useLauncherCallout({ callout, persistence }) {
|
|
|
5997
6166
|
}
|
|
5998
6167
|
|
|
5999
6168
|
// src/ui/app.tsx
|
|
6000
|
-
import { jsx as
|
|
6169
|
+
import { jsx as jsx38, jsxs as jsxs32 } from "preact/jsx-runtime";
|
|
6001
6170
|
var log16 = logger.scope("app");
|
|
6002
|
-
var
|
|
6171
|
+
var p33 = BRAND.cssPrefix;
|
|
6003
6172
|
function App({ options, hostElement, bus }) {
|
|
6004
6173
|
const [persistence] = useState13(() => createPersistence(options.widgetId, options.storage));
|
|
6005
6174
|
const [visitorId, setVisitorId] = useState13(() => persistence.getVisitorId());
|
|
@@ -6022,21 +6191,21 @@ function App({ options, hostElement, bus }) {
|
|
|
6022
6191
|
function chatTabId() {
|
|
6023
6192
|
return options.modules.list.find((m) => m.layout === "chat")?.id;
|
|
6024
6193
|
}
|
|
6025
|
-
const homeNavRef =
|
|
6194
|
+
const homeNavRef = useRef9();
|
|
6026
6195
|
if (!homeNavRef.current) {
|
|
6027
6196
|
const ids = options.modules.list.map((m) => m.id);
|
|
6028
6197
|
homeNavRef.current = createHomeNav(landingTab(), ids, (tab) => persistence.saveActiveModule(tab));
|
|
6029
6198
|
}
|
|
6030
6199
|
const homeNav = homeNavRef.current;
|
|
6031
|
-
const chatTabIdRef =
|
|
6200
|
+
const chatTabIdRef = useRef9(void 0);
|
|
6032
6201
|
chatTabIdRef.current = chatTabId();
|
|
6033
6202
|
const [sessionReady, setSessionReady] = useState13(false);
|
|
6034
6203
|
const isInlineLike = options.mode === "standalone" || options.mode === "inline";
|
|
6035
|
-
const initialPanelRef =
|
|
6204
|
+
const initialPanelRef = useRef9(
|
|
6036
6205
|
resolveInitialPanelState(options, currentViewportWidth(), persistence.loadPanelOpen(), persistence.loadPanelSize())
|
|
6037
6206
|
);
|
|
6038
6207
|
const [isOpen, setIsOpen] = useState13(initialPanelRef.current.panelOpen);
|
|
6039
|
-
const initialPanelApplied =
|
|
6208
|
+
const initialPanelApplied = useRef9(false);
|
|
6040
6209
|
const [launcherLeaving, setLauncherLeaving] = useState13(false);
|
|
6041
6210
|
const { dismissed: calloutDismissed, dismissCallout: dismissCalloutRaw } = useLauncherCallout({
|
|
6042
6211
|
callout: options.launcher.callout,
|
|
@@ -6049,18 +6218,18 @@ function App({ options, hostElement, bus }) {
|
|
|
6049
6218
|
dismissCalloutRaw();
|
|
6050
6219
|
}, [bus, dismissCalloutRaw]);
|
|
6051
6220
|
const [panelSize, setPanelSize] = useState13(initialPanelRef.current.panelSize);
|
|
6052
|
-
const initialSizeApplied =
|
|
6221
|
+
const initialSizeApplied = useRef9(false);
|
|
6053
6222
|
const [view, setView] = useState13("chat");
|
|
6054
6223
|
const [canSend, setCanSend] = useState13(true);
|
|
6055
6224
|
const [streaming, setStreaming] = useState13(false);
|
|
6056
6225
|
const [agent, setAgent] = useState13(null);
|
|
6057
6226
|
const [suggestions, setSuggestions] = useState13([]);
|
|
6058
6227
|
const [activeCancel, setActiveCancel] = useState13(null);
|
|
6059
|
-
const welcomeAbortRef =
|
|
6228
|
+
const welcomeAbortRef = useRef9(null);
|
|
6060
6229
|
const [parsedSite, setParsedSite] = useState13(void 0);
|
|
6061
6230
|
const [parsedBlocks, setParsedBlocks] = useState13(void 0);
|
|
6062
6231
|
const [sidebarCollapsed, setSidebarCollapsed] = useState13(() => persistence.loadSidebarCollapsed() ?? false);
|
|
6063
|
-
const [
|
|
6232
|
+
const [formContext, setFormContext] = useState13({});
|
|
6064
6233
|
const [transport] = useState13(
|
|
6065
6234
|
() => new AgentTransport({
|
|
6066
6235
|
baseUrl: options.baseUrl,
|
|
@@ -6121,9 +6290,9 @@ function App({ options, hostElement, bus }) {
|
|
|
6121
6290
|
setIsOpen(state.panelOpen);
|
|
6122
6291
|
setPanelSize(state.panelSize);
|
|
6123
6292
|
}, [sessionReady, options, persistence]);
|
|
6124
|
-
const homeNavSeeded =
|
|
6125
|
-
const resumeActiveRef =
|
|
6126
|
-
const resumeBubbleRef =
|
|
6293
|
+
const homeNavSeeded = useRef9(false);
|
|
6294
|
+
const resumeActiveRef = useRef9(false);
|
|
6295
|
+
const resumeBubbleRef = useRef9(null);
|
|
6127
6296
|
useEffect17(() => {
|
|
6128
6297
|
if (!sessionReady || homeNavSeeded.current) return;
|
|
6129
6298
|
homeNavSeeded.current = true;
|
|
@@ -6151,7 +6320,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6151
6320
|
},
|
|
6152
6321
|
[messagesSig, options.welcome]
|
|
6153
6322
|
);
|
|
6154
|
-
const connectGenRef =
|
|
6323
|
+
const connectGenRef = useRef9(0);
|
|
6155
6324
|
const runStartSession = useCallback6(
|
|
6156
6325
|
async ({ newConversation }) => {
|
|
6157
6326
|
const myGen = ++connectGenRef.current;
|
|
@@ -6243,11 +6412,11 @@ function App({ options, hostElement, bus }) {
|
|
|
6243
6412
|
);
|
|
6244
6413
|
const userSig = JSON.stringify(options.userContext ?? null);
|
|
6245
6414
|
const pageSig = JSON.stringify(options.pageContext ?? null);
|
|
6246
|
-
const
|
|
6415
|
+
const formCtxSig = JSON.stringify(formContext);
|
|
6247
6416
|
useEffect17(() => {
|
|
6248
|
-
const merged =
|
|
6417
|
+
const merged = Object.keys(formContext).length ? { ...formContext, ...options.userContext } : options.userContext;
|
|
6249
6418
|
transport.setContext(merged, toWirePageContext(options.pageContext));
|
|
6250
|
-
}, [transport, userSig, pageSig,
|
|
6419
|
+
}, [transport, userSig, pageSig, formCtxSig]);
|
|
6251
6420
|
const runResume = useCallback6(
|
|
6252
6421
|
async (handle) => {
|
|
6253
6422
|
let bubble = null;
|
|
@@ -6306,7 +6475,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6306
6475
|
resume?.cancel();
|
|
6307
6476
|
};
|
|
6308
6477
|
}, []);
|
|
6309
|
-
const lastUserSig =
|
|
6478
|
+
const lastUserSig = useRef9(userSig);
|
|
6310
6479
|
useEffect17(() => {
|
|
6311
6480
|
if (!sessionReady || lastUserSig.current === userSig) return;
|
|
6312
6481
|
lastUserSig.current = userSig;
|
|
@@ -6429,25 +6598,48 @@ function App({ options, hostElement, bus }) {
|
|
|
6429
6598
|
() => ({ humanInLoop: options.features.humanInLoop, onResult: handleToolResult, onDecision: handleToolDecision }),
|
|
6430
6599
|
[options.features.humanInLoop, handleToolResult, handleToolDecision]
|
|
6431
6600
|
);
|
|
6432
|
-
const
|
|
6433
|
-
const
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6601
|
+
const userMessageCount = () => messagesSig.value.reduce((n, m) => n + (m.role === "user" ? 1 : 0), 0);
|
|
6602
|
+
const forms = useForms({
|
|
6603
|
+
forms: options.forms,
|
|
6604
|
+
persistence,
|
|
6605
|
+
userContext: () => options.userContext,
|
|
6606
|
+
messageCount: userMessageCount,
|
|
6607
|
+
pageArea: () => options.pageContext?.area ? String(options.pageContext.area) : void 0,
|
|
6608
|
+
onComplete: (form, trigger, values, skipped) => {
|
|
6609
|
+
log16.info("formSubmit", { formId: form.id, trigger, skipped });
|
|
6610
|
+
bus.emit("formSubmit", { formId: form.id, values, skipped });
|
|
6611
|
+
if (skipped || Object.keys(values).length === 0) return;
|
|
6441
6612
|
const activeSessionId = sessionIdSig.value ?? uuid7();
|
|
6442
6613
|
if (!sessionIdSig.value) {
|
|
6443
6614
|
sessionIdSig.value = activeSessionId;
|
|
6444
6615
|
persistence.saveSessionId(activeSessionId);
|
|
6445
6616
|
transport.primeIdentity(void 0, activeSessionId);
|
|
6446
6617
|
}
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
);
|
|
6618
|
+
if (form.mirrorToContext) setFormContext((prev) => ({ ...prev, ...values }));
|
|
6619
|
+
void transport.submitForm({ formId: form.id, sessionId: activeSessionId, trigger, values });
|
|
6620
|
+
}
|
|
6621
|
+
});
|
|
6622
|
+
const activeForm = useComputed7(() => forms.activeForm.value);
|
|
6623
|
+
const pageArea = options.pageContext?.area ? String(options.pageContext.area) : void 0;
|
|
6624
|
+
const msgCount = useComputed7(() => messagesSig.value.length);
|
|
6625
|
+
useEffect17(() => {
|
|
6626
|
+
if (sessionReady) forms.fire("pre-chat");
|
|
6627
|
+
}, [sessionReady, forms]);
|
|
6628
|
+
useEffect17(() => {
|
|
6629
|
+
if (!canSend) forms.fire("conversation-closed");
|
|
6630
|
+
}, [canSend, forms]);
|
|
6631
|
+
useEffect17(() => {
|
|
6632
|
+
if (pageArea) forms.fire("page-area");
|
|
6633
|
+
}, [pageArea, forms]);
|
|
6634
|
+
const idleMs = useMemo3(() => {
|
|
6635
|
+
const secs = options.forms.list.flatMap((f) => f.triggers).filter((t) => t.kind === "idle").map((t) => Number(t.param));
|
|
6636
|
+
return secs.length ? Math.min(...secs) * 1e3 : 0;
|
|
6637
|
+
}, [options.forms]);
|
|
6638
|
+
useEffect17(() => {
|
|
6639
|
+
if (!idleMs || !isOpen) return;
|
|
6640
|
+
const id = setTimeout(() => forms.fire("idle"), idleMs);
|
|
6641
|
+
return () => clearTimeout(id);
|
|
6642
|
+
}, [idleMs, isOpen, forms, msgCount.value]);
|
|
6451
6643
|
const handleSend = useCallback6(
|
|
6452
6644
|
async (text, attachments) => {
|
|
6453
6645
|
log16.info("send", { textLen: text.length, attachments: attachments.length, streaming });
|
|
@@ -6467,8 +6659,9 @@ function App({ options, hostElement, bus }) {
|
|
|
6467
6659
|
reducer.attach(assistantMsg);
|
|
6468
6660
|
emitMessage(bus, options, "user", text);
|
|
6469
6661
|
await streamAssistant(assistantMsg, TRIGGER.submitMessage);
|
|
6662
|
+
forms.fire("after-messages");
|
|
6470
6663
|
},
|
|
6471
|
-
[streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant]
|
|
6664
|
+
[streaming, transport, bus, options, suggestions.length, messagesSig, reducer, streamAssistant, forms]
|
|
6472
6665
|
);
|
|
6473
6666
|
const handleStop = useCallback6(() => {
|
|
6474
6667
|
log16.info("stop");
|
|
@@ -6489,18 +6682,19 @@ function App({ options, hostElement, bus }) {
|
|
|
6489
6682
|
return;
|
|
6490
6683
|
}
|
|
6491
6684
|
log16.info("close \u2192 panel closed", { mode: options.mode });
|
|
6685
|
+
forms.fire("panel-close");
|
|
6492
6686
|
setIsOpen(false);
|
|
6493
6687
|
persistence.savePanelOpen(false);
|
|
6494
6688
|
bus.emit("close", void 0);
|
|
6495
6689
|
options.onClose?.();
|
|
6496
|
-
}, [bus, options, persistence, panelSize]);
|
|
6690
|
+
}, [bus, options, persistence, panelSize, forms]);
|
|
6497
6691
|
const refreshUnread = useCallback6(() => {
|
|
6498
6692
|
if (!options.modules.list.some((m) => m.layout === "chat")) return;
|
|
6499
6693
|
transport.listSessions({ limit: 50 }).then((res) => {
|
|
6500
6694
|
unreadCountSig.value = res.sessions.reduce((sum, c) => sum + (c.unreadCount ?? 0), 0);
|
|
6501
6695
|
}).catch((err) => log16.debug("refreshUnread failed (non-fatal)", { err }));
|
|
6502
6696
|
}, [transport, options.modules, unreadCountSig]);
|
|
6503
|
-
const unreadSeeded =
|
|
6697
|
+
const unreadSeeded = useRef9(false);
|
|
6504
6698
|
useEffect17(() => {
|
|
6505
6699
|
if (!sessionReady || unreadSeeded.current) return;
|
|
6506
6700
|
unreadSeeded.current = true;
|
|
@@ -6631,10 +6825,11 @@ function App({ options, hostElement, bus }) {
|
|
|
6631
6825
|
close: handleClose,
|
|
6632
6826
|
expand: handleExpand,
|
|
6633
6827
|
fullscreen: handleFullscreen,
|
|
6634
|
-
popout: handlePopOut
|
|
6828
|
+
popout: handlePopOut,
|
|
6829
|
+
openForm: (id) => forms.fire("manual", typeof id === "string" ? id : void 0)
|
|
6635
6830
|
});
|
|
6636
6831
|
return unsub;
|
|
6637
|
-
}, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut]);
|
|
6832
|
+
}, [hostElement, handleOpen, handleClose, handleExpand, handleFullscreen, handlePopOut, forms]);
|
|
6638
6833
|
const effectiveOptions = useMemo3(
|
|
6639
6834
|
() => applyOptionOverrides(options, activeLocale, activeThemeMode),
|
|
6640
6835
|
[options, activeLocale, activeThemeMode]
|
|
@@ -6673,8 +6868,12 @@ function App({ options, hostElement, bus }) {
|
|
|
6673
6868
|
bus.emit("suggestion", { text });
|
|
6674
6869
|
void handleSend(text, []);
|
|
6675
6870
|
},
|
|
6676
|
-
|
|
6677
|
-
|
|
6871
|
+
// Active form: a blocking one replaces the composer (gate); a non-blocking
|
|
6872
|
+
// one renders inline at the end of the transcript (card).
|
|
6873
|
+
blockingForm: activeForm.value?.form.blocking ? activeForm.value.form : null,
|
|
6874
|
+
inlineForm: activeForm.value && !activeForm.value.form.blocking ? activeForm.value.form : null,
|
|
6875
|
+
onFormSubmit: forms.complete,
|
|
6876
|
+
onFormSkip: forms.skip,
|
|
6678
6877
|
tool: toolInteraction
|
|
6679
6878
|
};
|
|
6680
6879
|
const onSelectSession = (sessionId) => {
|
|
@@ -6687,12 +6886,12 @@ function App({ options, hostElement, bus }) {
|
|
|
6687
6886
|
const renderSurface = (size) => {
|
|
6688
6887
|
const closeable = isActionVisible("close", effectiveOptions.mode, size);
|
|
6689
6888
|
if (enabledModules.length === 0) {
|
|
6690
|
-
return /* @__PURE__ */
|
|
6889
|
+
return /* @__PURE__ */ jsx38(ModulesEmpty, { strings: effectiveOptions.strings, onClose: closeable ? handleClose : void 0 });
|
|
6691
6890
|
}
|
|
6692
6891
|
if (enabledModules.length === 1 && enabledModules[0]?.layout === "chat") {
|
|
6693
|
-
return /* @__PURE__ */
|
|
6892
|
+
return /* @__PURE__ */ jsx38(Panel, { ...panelProps, panelSize: size });
|
|
6694
6893
|
}
|
|
6695
|
-
return /* @__PURE__ */
|
|
6894
|
+
return /* @__PURE__ */ jsx38(
|
|
6696
6895
|
MessengerHome,
|
|
6697
6896
|
{
|
|
6698
6897
|
panelProps: { ...panelProps, panelSize: size, onClose: closeable ? handleClose : void 0 },
|
|
@@ -6710,7 +6909,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6710
6909
|
void handleSelectHistoryChat(chat.sessionId);
|
|
6711
6910
|
};
|
|
6712
6911
|
const messagesEnabled = enabledModules.some((m) => m.layout === "chat");
|
|
6713
|
-
return /* @__PURE__ */
|
|
6912
|
+
return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: /* @__PURE__ */ jsx38(
|
|
6714
6913
|
PageShell,
|
|
6715
6914
|
{
|
|
6716
6915
|
site: parsedSite,
|
|
@@ -6729,15 +6928,15 @@ function App({ options, hostElement, bus }) {
|
|
|
6729
6928
|
}
|
|
6730
6929
|
if (isInlineLike) {
|
|
6731
6930
|
const inlineSize = options.mode === "standalone" ? "fullscreen" : panelSize;
|
|
6732
|
-
return /* @__PURE__ */
|
|
6931
|
+
return /* @__PURE__ */ jsx38("div", { class: `${p33}-anchor`, children: renderSurface(inlineSize) });
|
|
6733
6932
|
}
|
|
6734
6933
|
const drawerEdgeTab = options.mode === "drawer";
|
|
6735
6934
|
const triggerOwnedByPage = options.mode === "modal";
|
|
6736
6935
|
const launcherVisible = !triggerOwnedByPage && !options.launcher.hidden && (!isOpen || launcherLeaving);
|
|
6737
6936
|
const calloutToRender = launcherVisible && !launcherLeaving && !calloutDismissed && !drawerEdgeTab ? effectiveOptions.launcher.callout : null;
|
|
6738
|
-
return /* @__PURE__ */
|
|
6937
|
+
return /* @__PURE__ */ jsxs32("div", { class: `${p33}-anchor`, "data-launcher-size": effectiveOptions.launcher.size, children: [
|
|
6739
6938
|
isOpen ? renderSurface(panelSize) : null,
|
|
6740
|
-
launcherVisible ? /* @__PURE__ */
|
|
6939
|
+
launcherVisible ? /* @__PURE__ */ jsx38(
|
|
6741
6940
|
Launcher,
|
|
6742
6941
|
{
|
|
6743
6942
|
onToggle: handleOpen,
|
|
@@ -6747,7 +6946,7 @@ function App({ options, hostElement, bus }) {
|
|
|
6747
6946
|
edgeTab: drawerEdgeTab
|
|
6748
6947
|
}
|
|
6749
6948
|
) : null,
|
|
6750
|
-
calloutToRender ? /* @__PURE__ */
|
|
6949
|
+
calloutToRender ? /* @__PURE__ */ jsx38(
|
|
6751
6950
|
LauncherCallout,
|
|
6752
6951
|
{
|
|
6753
6952
|
callout: calloutToRender,
|
|
@@ -6947,7 +7146,7 @@ var EVENT_NAMES = [
|
|
|
6947
7146
|
"suggestion",
|
|
6948
7147
|
"toggleHistory",
|
|
6949
7148
|
// Forms + human-in-the-loop
|
|
6950
|
-
"
|
|
7149
|
+
"formSubmit",
|
|
6951
7150
|
"toolResult",
|
|
6952
7151
|
"toolDecision",
|
|
6953
7152
|
// Composer / attachments / voice
|
|
@@ -7044,6 +7243,7 @@ function mount(opts) {
|
|
|
7044
7243
|
close: () => dispatchHostCommand(host, "close"),
|
|
7045
7244
|
expand: () => dispatchHostCommand(host, "expand"),
|
|
7046
7245
|
popOut: () => dispatchHostCommand(host, "popout"),
|
|
7246
|
+
openForm: (id) => dispatchHostCommand(host, "openForm", id),
|
|
7047
7247
|
on: (name, fn) => bus.on(name, fn),
|
|
7048
7248
|
update: (patch) => {
|
|
7049
7249
|
log20.debug("update", { patch });
|