@kitn.ai/ui
Version:
Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.
655 lines (654 loc) • 24.5 kB
JavaScript
"use client";
import { forwardRef as w, useRef as x, useImperativeHandle as M, useLayoutEffect as y, createElement as O, useState as T, useCallback as k, useMemo as R } from "react";
const I = /* @__PURE__ */ new Set();
function A(t, r) {
!r || I.has(t) || typeof window > "u" || typeof customElements > "u" || (I.add(t), !customElements.get(t) && r());
}
function U() {
if (!(typeof window > "u" || typeof customElements > "u"))
return import("@kitn.ai/ui/elements");
}
function e(t, r, s, i) {
const l = Object.entries(s), d = w((o, n) => {
const a = x(null);
M(n, () => a.current, []);
const c = o, h = x({});
for (const u of Object.keys(s)) h.current[u] = c[u];
return y(() => {
const u = a.current;
if (!u) return;
const b = () => {
for (const g of r)
g in c && c[g] !== void 0 && (u[g] = c[g]);
};
b(), typeof customElements < "u" && !customElements.get(t) && customElements.whenDefined(t).then(b);
}), y(() => {
A(t, i);
}, []), y(() => {
const u = a.current;
if (!u) return;
const b = [];
for (const [g, f] of l) {
const v = (C) => {
const S = h.current[g];
typeof S == "function" && S(C);
};
u.addEventListener(f, v), b.push([f, v]);
}
return () => b.forEach(([g, f]) => u.removeEventListener(g, f));
}, []), O(
t,
{
ref: a,
className: c.className,
style: c.style,
id: c.id
},
// Light-DOM children pass straight through to the element (slots).
c.children ?? null
);
});
return d.displayName = t, d;
}
function E(t, r) {
return [...t, r];
}
function V(t, r, s) {
return t.map(
(i) => i.id === r ? typeof s == "function" ? s(i) : { ...i, ...s } : i
);
}
function D(t, r) {
return t.filter((s) => s.id !== r);
}
function F(t, r) {
return t.includes(r) ? t.slice() : [...t, r];
}
function L(t, r) {
return t.filter((s) => s !== r);
}
function B() {
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "kai-" + Math.random().toString(36).slice(2);
}
function P(t, r = {}) {
const s = r.id ?? B(), i = { id: s, role: "assistant", content: "", ...r };
t((o) => [...o, i]);
const l = (o) => t((n) => n.map((a) => a.id === s ? o(a) : a)), d = {
id: s,
appendText(o) {
return l((n) => ({ ...n, content: n.content + o })), d;
},
setText(o) {
return l((n) => ({ ...n, content: o })), d;
},
appendReasoning(o, n) {
return l((a) => {
var c, h;
return { ...a, reasoning: { text: (((c = a.reasoning) == null ? void 0 : c.text) ?? "") + o, label: n ?? ((h = a.reasoning) == null ? void 0 : h.label) } };
}), d;
},
setReasoning(o, n) {
return l((a) => {
var c;
return { ...a, reasoning: { text: o, label: n ?? ((c = a.reasoning) == null ? void 0 : c.label) } };
}), d;
},
upsertTool(o) {
return l((n) => {
const a = n.tools ? n.tools.slice() : [], c = o.toolCallId != null ? a.findIndex((h) => h.toolCallId === o.toolCallId) : a.findIndex((h) => h.type === o.type);
return c === -1 ? a.push(o) : a[c] = o, { ...n, tools: a };
}), d;
},
updateTool(o, n) {
return l((a) => ({ ...a, tools: (a.tools ?? []).map((c) => c.toolCallId === o ? { ...c, ...n } : c) })), d;
},
patch(o) {
return l((n) => ({ ...n, ...o })), d;
},
done(o) {
o && l((n) => ({ ...n, ...o }));
},
abort(o) {
o ? l((n) => ({ ...n, tools: (n.tools ?? []).map((a) => ({ ...a, state: "output-error", errorText: o })) })) : t((n) => n.filter((a) => a.id !== s));
}
};
return d;
}
function H(t, r) {
const s = {
id: t.id,
appendText(i) {
return t.appendText(i), s;
},
setText(i) {
return t.setText(i), s;
},
appendReasoning(i, l) {
return t.appendReasoning(i, l), s;
},
setReasoning(i, l) {
return t.setReasoning(i, l), s;
},
upsertTool(i) {
return t.upsertTool(i), s;
},
updateTool(i, l) {
return t.updateTool(i, l), s;
},
patch(i) {
return t.patch(i), s;
},
done(i) {
t.done(i), r();
},
abort(i) {
t.abort(i), r();
}
};
return s;
}
function W(t = {}) {
const [r, s] = T(() => [...t.initialMessages ?? []]), [i, l] = T(() => [...t.initialSuggestions ?? []]), [d, o] = T(!1), n = x(t.onSubmit);
n.current = t.onSubmit;
const a = k((m) => s(m), []), c = k((m) => a((p) => E(p, m)), [a]), h = k(
(m, p) => a((z) => V(z, m, p)),
[a]
), u = k((m) => a((p) => D(p, m)), [a]), b = k((m) => l((p) => F(p, m)), []), g = k((m) => l((p) => L(p, m)), []), f = k(() => l([]), []), v = k((m) => (o(!0), H(P(a, m), () => o(!1))), [a]), C = k(
(m) => {
var p;
(p = n.current) == null || p.call(n, m.detail);
},
[]
), S = R(
() => ({ messages: r, loading: d, suggestions: i, onSubmit: C }),
[r, d, i, C]
);
return {
messages: r,
setMessages: s,
suggestions: i,
setSuggestions: l,
loading: d,
append: c,
update: h,
remove: u,
addSuggestion: b,
removeSuggestion: g,
clearSuggestions: f,
streamAssistant: v,
bind: S
};
}
const j = /* @__PURE__ */ e(
"kai-agent-card",
["theme", "name", "active", "needsAttention", "status"],
{ onActivate: "kai-activate", onMenu: "kai-menu" },
() => import("@kitn.ai/ui/elements/agent-card")
), q = /* @__PURE__ */ e(
"kai-artifact",
["theme", "src", "files", "tab", "defaultTab", "activeFile", "sandbox", "iframeTitle", "maximized", "expandable", "openInTab", "noNav", "noReload", "noHome", "noPathField", "noTabs", "standalone", "readonlyPath", "displayUrl"],
{ onFileSelect: "kai-file-select", onMaximizeChange: "kai-maximize-change", onNavigate: "kai-navigate", onTabChange: "kai-tab-change" },
() => import("@kitn.ai/ui/elements/artifact")
), G = /* @__PURE__ */ e(
"kai-attachments",
["theme", "items", "variant", "hoverCard", "removable", "showMediaType", "emptyText"],
{ onRemove: "kai-remove" },
() => import("@kitn.ai/ui/elements/attachments")
), K = /* @__PURE__ */ e(
"kai-avatar",
["theme", "src", "alt", "fallback", "size"],
{},
() => import("@kitn.ai/ui/elements/avatar")
), Q = /* @__PURE__ */ e(
"kai-badge",
["theme", "variant"],
{},
() => import("@kitn.ai/ui/elements/badge")
), J = /* @__PURE__ */ e(
"kai-button",
["theme", "variant", "size", "icon", "iconTrailing", "label", "disabled", "full", "align", "type"],
{ onClick: "kai-click" },
() => import("@kitn.ai/ui/elements/button")
), X = /* @__PURE__ */ e(
"kai-card",
["theme", "appearance", "orientation", "collapse", "dense", "dismissible", "href", "target", "rel", "clickable"],
{ onCardClick: "kai-card-click", onDismiss: "kai-dismiss" },
() => import("@kitn.ai/ui/elements/card")
), Y = /* @__PURE__ */ e(
"kai-cards",
["theme", "cards", "types", "policy"],
{ onCardResolved: "kai-card-resolved" },
() => import("@kitn.ai/ui/elements/cards")
), Z = /* @__PURE__ */ e(
"kai-chain-of-thought",
["theme", "steps", "type", "value", "defaultValue"],
{ onValueChange: "kai-value-change" },
() => import("@kitn.ai/ui/elements/chain-of-thought")
), _ = /* @__PURE__ */ e(
"kai-chat",
["theme", "messages", "value", "placeholder", "loading", "suggestions", "suggestionMode", "persistSuggestions", "proseSize", "codeTheme", "codeHighlight", "chatTitle", "models", "currentModel", "context", "scrollButton", "headerStart", "headerEnd", "headerFull", "sidebar", "empty", "composer", "composerActions", "footer", "search", "voice", "triggers", "kindIcons", "actionsReveal"],
{ onAttachmentsChange: "kai-attachments-change", onMessageAction: "kai-message-action", onModelChange: "kai-model-change", onSearch: "kai-search", onSubmit: "kai-submit", onSuggestionClick: "kai-suggestion-click", onValueChange: "kai-value-change", onVoice: "kai-voice" },
() => import("@kitn.ai/ui/elements/chat")
), $ = /* @__PURE__ */ e(
"kai-checkpoint",
["theme", "label", "tooltip", "variant", "size"],
{ onSelect: "kai-select" },
() => import("@kitn.ai/ui/elements/checkpoint")
), ee = /* @__PURE__ */ e(
"kai-choice",
["theme", "data", "cardId", "heading", "resolution", "value", "defaultValue", "disabled"],
{ onValueChange: "kai-value-change" },
() => import("@kitn.ai/ui/elements/choice")
), te = /* @__PURE__ */ e(
"kai-coachmark",
["theme", "open", "defaultOpen", "headline", "badge", "placement", "tone", "arrow"],
{ onDismiss: "kai-dismiss", onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/coachmark")
), ae = /* @__PURE__ */ e(
"kai-code-block",
["theme", "code", "language", "codeTheme", "codeHighlight", "proseSize"],
{},
() => import("@kitn.ai/ui/elements/code-block")
), oe = /* @__PURE__ */ e(
"kai-command",
["theme", "items", "placeholder", "emptyLabel"],
{ onActiveChange: "kai-active-change", onQueryChange: "kai-query-change", onSelect: "kai-select" },
() => import("@kitn.ai/ui/elements/command")
), ne = /* @__PURE__ */ e(
"kai-compare",
["theme", "data", "compareId", "selection", "layout", "proseSize", "codeTheme", "codeHighlight"],
{ onCompareSelect: "kai-compare-select", onError: "kai-error", onReady: "kai-ready" },
() => import("@kitn.ai/ui/elements/compare")
), ie = /* @__PURE__ */ e(
"kai-composer",
["theme", "value", "placeholder", "disabled", "loading", "maxHeight", "submitOnEnter", "triggers", "highlights", "kindIcons"],
{ onBlur: "kai-blur", onEntityAdd: "kai-entity-add", onEntityRemove: "kai-entity-remove", onFocus: "kai-focus", onSubmit: "kai-submit", onTrigger: "kai-trigger", onTriggerClose: "kai-trigger-close", onValueChange: "kai-value-change" },
() => import("@kitn.ai/ui/elements/composer")
), se = /* @__PURE__ */ e(
"kai-confirm",
["theme", "data", "cardId", "heading", "autofocus", "resolution"],
{},
() => import("@kitn.ai/ui/elements/confirm-card")
), re = /* @__PURE__ */ e(
"kai-context",
["theme", "context", "warnThreshold", "dangerThreshold"],
{ onThresholdChange: "kai-threshold-change" },
() => import("@kitn.ai/ui/elements/context-meter")
), ce = /* @__PURE__ */ e(
"kai-conversations",
["theme", "groups", "conversations", "activeId", "collapsed", "defaultCollapsed"],
{ onCollapseToggle: "kai-collapse-toggle", onConversationSelect: "kai-conversation-select", onNewChat: "kai-new-chat", onSearch: "kai-search", onToggleSidebar: "kai-toggle-sidebar" },
() => import("@kitn.ai/ui/elements/conversation-list")
), le = /* @__PURE__ */ e(
"kai-dialog",
["theme", "open", "defaultOpen"],
{ onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/dialog")
), de = /* @__PURE__ */ e(
"kai-editable-label",
["theme", "value", "editing", "placeholder", "disabled"],
{ onCancel: "kai-cancel", onRename: "kai-rename" },
() => import("@kitn.ai/ui/elements/editable-label")
), me = /* @__PURE__ */ e(
"kai-embed",
["theme", "cardId", "data"],
{},
() => import("@kitn.ai/ui/elements/embed")
), pe = /* @__PURE__ */ e(
"kai-empty",
["theme", "emptyTitle", "description"],
{},
() => import("@kitn.ai/ui/elements/empty")
), he = /* @__PURE__ */ e(
"kai-feedback-bar",
["theme", "barTitle", "collectDetail", "categories", "detailTitle", "detailPlaceholder", "submitLabel", "thanksMessage"],
{ onClose: "kai-close", onFeedback: "kai-feedback", onFeedbackDetail: "kai-feedback-detail" },
() => import("@kitn.ai/ui/elements/feedback-bar")
), ue = /* @__PURE__ */ e(
"kai-file-tree",
["theme", "files", "activeFile", "defaultExpanded", "summary"],
{ onSelect: "kai-select" },
() => import("@kitn.ai/ui/elements/file-tree")
), ge = /* @__PURE__ */ e(
"kai-file-upload",
["theme", "multiple", "accept", "disabled", "label"],
{ onFilesAdded: "kai-files-added" },
() => import("@kitn.ai/ui/elements/file-upload")
), ke = /* @__PURE__ */ e(
"kai-form",
["theme", "data", "cardId", "heading", "resolution", "values", "defaultValues", "disabled"],
{ onValuesChange: "kai-values-change" },
() => import("@kitn.ai/ui/elements/form")
), be = /* @__PURE__ */ e(
"kai-hover-card",
["theme", "openDelay", "closeDelay", "placement", "open", "defaultOpen", "disabled"],
{ onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/hover-card")
), fe = /* @__PURE__ */ e(
"kai-icon",
["theme", "name", "size"],
{},
() => import("@kitn.ai/ui/elements/icon")
), ve = /* @__PURE__ */ e(
"kai-image",
["theme", "base64", "bytes", "alt", "mediaType"],
{},
() => import("@kitn.ai/ui/elements/image")
), Ce = /* @__PURE__ */ e(
"kai-input",
["theme", "type", "value", "placeholder", "label", "hint", "error", "size", "disabled", "readonly", "required", "invalid", "name", "autocomplete", "inputmode"],
{ onChange: "kai-change", onInput: "kai-input" },
() => import("@kitn.ai/ui/elements/input")
), Se = /* @__PURE__ */ e(
"kai-kbd",
["theme", "keys", "platform", "size"],
{},
() => import("@kitn.ai/ui/elements/kbd")
), ye = /* @__PURE__ */ e(
"kai-link-preview",
["theme", "cardId", "data"],
{},
() => import("@kitn.ai/ui/elements/link-preview")
), Te = /* @__PURE__ */ e(
"kai-loader",
["theme", "variant", "size", "text"],
{},
() => import("@kitn.ai/ui/elements/loader")
), xe = /* @__PURE__ */ e(
"kai-markdown",
["theme", "content", "proseSize", "codeTheme", "codeHighlight"],
{},
() => import("@kitn.ai/ui/elements/markdown")
), Ie = /* @__PURE__ */ e(
"kai-menu",
["theme", "items", "placement", "triggerIcon", "triggerLabel", "triggerIconTrailing", "label", "open", "defaultOpen", "disabled"],
{ onOpenChange: "kai-open-change", onSelect: "kai-select" },
() => import("@kitn.ai/ui/elements/menu")
), ze = /* @__PURE__ */ e(
"kai-message",
["theme", "message", "role", "content", "markdown", "proseSize", "codeTheme", "codeHighlight", "actionsReveal", "avatarSrc", "avatarFallback", "avatar"],
{ onMessageAction: "kai-message-action" },
() => import("@kitn.ai/ui/elements/message")
), we = /* @__PURE__ */ e(
"kai-model-switcher",
["theme", "models", "currentModel", "open", "defaultOpen", "disabled"],
{ onModelChange: "kai-model-change", onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/model-switcher")
), Me = /* @__PURE__ */ e(
"kai-nav",
["theme", "items", "value", "defaultValue", "defaultCollapsed"],
{ onNavItemAction: "kai-nav-item-action", onNavItemClose: "kai-nav-item-close", onNavSelect: "kai-nav-select" },
() => import("@kitn.ai/ui/elements/nav")
), Oe = /* @__PURE__ */ e(
"kai-notice",
["theme", "severity", "icon", "dismissible"],
{ onDismiss: "kai-dismiss" },
() => import("@kitn.ai/ui/elements/notice")
), Re = /* @__PURE__ */ e(
"kai-pane",
["theme", "headline", "subtitle", "maximized", "focused", "showSplit", "showDock", "status"],
{ onClose: "kai-close", onDock: "kai-dock", onMaximize: "kai-maximize", onSplit: "kai-split" },
() => import("@kitn.ai/ui/elements/pane")
), Ae = /* @__PURE__ */ e(
"kai-pane-group",
["theme", "tabs", "active", "focused"],
{ onTabChange: "kai-tab-change", onTabClose: "kai-tab-close", onTabMenu: "kai-tab-menu" },
() => import("@kitn.ai/ui/elements/pane-group")
), Ee = /* @__PURE__ */ e(
"kai-popover",
["theme", "placement", "gutter", "open", "defaultOpen", "disabled"],
{ onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/popover")
), Ve = /* @__PURE__ */ e(
"kai-progress-bar",
["theme", "value", "max", "label", "tone"],
{},
() => import("@kitn.ai/ui/elements/progress-bar")
), De = /* @__PURE__ */ e(
"kai-prompt-dock",
["theme", "frame", "appearance"],
{},
() => import("@kitn.ai/ui/elements/prompt-dock")
), Fe = /* @__PURE__ */ e(
"kai-prompt-input",
["theme", "value", "placeholder", "disabled", "loading", "suggestions", "suggestionMode", "search", "voice", "stoppable", "submit", "attach", "attachments", "triggers", "kindIcons"],
{ onAttachmentsChange: "kai-attachments-change", onSearch: "kai-search", onStop: "kai-stop", onSubmit: "kai-submit", onSuggestionClick: "kai-suggestion-click", onToolbarAction: "kai-toolbar-action", onValueChange: "kai-value-change", onVoice: "kai-voice" },
() => import("@kitn.ai/ui/elements/prompt-input")
), Le = /* @__PURE__ */ e(
"kai-reasoning",
["theme", "text", "label", "open", "defaultOpen", "streaming", "markdown", "disabled"],
{ onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/reasoning")
), Be = /* @__PURE__ */ e(
"kai-remote",
["theme", "src", "providerOrigin", "envelope", "policy"],
{},
() => import("@kitn.ai/ui/elements/remote")
), Pe = /* @__PURE__ */ e(
"kai-resizable",
["theme", "orientation", "maximizedIndex"],
{ onChange: "kai-change", onMaximizeChange: "kai-maximize-change" },
() => import("@kitn.ai/ui/elements/resizable")
), He = /* @__PURE__ */ e(
"kai-resizable-item",
["theme", "size", "min", "max", "locked", "hidden", "collapsed"],
{ onChange: "kai-change", onMaximizeChange: "kai-maximize-change" },
() => import("@kitn.ai/ui/elements/resizable")
), Ne = /* @__PURE__ */ e(
"kai-response-stream",
["theme", "text", "mode", "speed", "as"],
{ onComplete: "kai-complete" },
() => import("@kitn.ai/ui/elements/response-stream")
), Ue = /* @__PURE__ */ e(
"kai-scope-picker",
["theme", "availableAuthors", "availableTags", "currentLabel", "open", "defaultOpen", "disabled"],
{ onOpenChange: "kai-open-change", onScopeChange: "kai-scope-change" },
() => import("@kitn.ai/ui/elements/chat-scope-picker")
), We = /* @__PURE__ */ e(
"kai-screen",
["theme", "open", "defaultOpen", "headline", "back", "noInert"],
{ onBack: "kai-back", onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/screen")
), je = /* @__PURE__ */ e(
"kai-scroll-area",
["theme", "orientation"],
{},
() => import("@kitn.ai/ui/elements/scroll-area")
), qe = /* @__PURE__ */ e(
"kai-scroll-button",
["theme", "for", "variant", "size"],
{ onScroll: "kai-scroll" },
() => import("@kitn.ai/ui/elements/scroll-button")
), Ge = /* @__PURE__ */ e(
"kai-search",
["theme", "value", "placeholder", "icon", "debounce", "loading", "shortcut"],
{ onChange: "kai-change", onSearch: "kai-search", onSubmit: "kai-submit" },
() => import("@kitn.ai/ui/elements/search")
), Ke = /* @__PURE__ */ e(
"kai-segmented",
["theme", "options", "value", "size"],
{ onChange: "kai-change" },
() => import("@kitn.ai/ui/elements/segmented")
), Qe = /* @__PURE__ */ e(
"kai-separator",
["theme", "orientation"],
{},
() => import("@kitn.ai/ui/elements/separator")
), Je = /* @__PURE__ */ e(
"kai-setting-item",
["theme", "label", "description"],
{},
() => import("@kitn.ai/ui/elements/setting-item")
), Xe = /* @__PURE__ */ e(
"kai-settings-group",
["theme", "heading", "description"],
{},
() => import("@kitn.ai/ui/elements/settings-group")
), Ye = /* @__PURE__ */ e(
"kai-skeleton",
["theme", "variant", "width", "height", "lines"],
{},
() => import("@kitn.ai/ui/elements/skeleton")
), Ze = /* @__PURE__ */ e(
"kai-skills",
["theme", "skills"],
{},
() => import("@kitn.ai/ui/elements/message-skills")
), _e = /* @__PURE__ */ e(
"kai-source",
["theme", "href", "label", "headline", "description", "showFavicon"],
{},
() => import("@kitn.ai/ui/elements/source")
), $e = /* @__PURE__ */ e(
"kai-sources",
["theme", "sources", "showFavicon", "numbered"],
{},
() => import("@kitn.ai/ui/elements/source")
), et = /* @__PURE__ */ e(
"kai-status",
["theme", "status", "pulse", "label", "size"],
{},
() => import("@kitn.ai/ui/elements/status")
), tt = /* @__PURE__ */ e(
"kai-suggestions",
["theme", "suggestions", "variant", "size", "layout", "block", "highlight"],
{ onSelect: "kai-select" },
() => import("@kitn.ai/ui/elements/prompt-suggestions")
), at = /* @__PURE__ */ e(
"kai-switch",
["theme", "checked", "defaultChecked", "disabled", "label", "name", "value"],
{ onChange: "kai-change" },
() => import("@kitn.ai/ui/elements/switch")
), ot = /* @__PURE__ */ e(
"kai-tabs",
["theme", "items", "value", "defaultValue", "variant", "block", "disabled"],
{ onTabChange: "kai-tab-change" },
() => import("@kitn.ai/ui/elements/tabs")
), nt = /* @__PURE__ */ e(
"kai-tasks",
["theme", "data", "cardId", "heading", "resolution", "value", "defaultValue", "disabled", "readonly"],
{ onValueChange: "kai-value-change" },
() => import("@kitn.ai/ui/elements/tasks")
), it = /* @__PURE__ */ e(
"kai-text-shimmer",
["theme", "text", "as", "duration", "spread"],
{},
() => import("@kitn.ai/ui/elements/text-shimmer")
), st = /* @__PURE__ */ e(
"kai-thinking-bar",
["theme", "text", "stoppable", "stopLabel"],
{ onStop: "kai-stop" },
() => import("@kitn.ai/ui/elements/thinking-bar")
), rt = /* @__PURE__ */ e(
"kai-toast-region",
["theme", "toasts", "position", "max", "stack", "appearance", "inverse", "target"],
{ onAction: "kai-action", onDismiss: "kai-dismiss" },
() => import("@kitn.ai/ui/elements/toast")
), ct = /* @__PURE__ */ e(
"kai-tool",
["theme", "tool", "open", "defaultOpen", "disabled"],
{ onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/tool")
), lt = /* @__PURE__ */ e(
"kai-tooltip",
["theme", "content", "openDelay", "closeDelay", "placement", "open", "defaultOpen", "disabled"],
{ onOpenChange: "kai-open-change" },
() => import("@kitn.ai/ui/elements/tooltip")
), dt = /* @__PURE__ */ e(
"kai-voice-input",
["theme", "transcribe", "disabled", "recognitionLang", "interim"],
{ onAudioCaptured: "kai-audio-captured", onRecordingChange: "kai-recording-change", onTranscriptInterim: "kai-transcript-interim", onTranscription: "kai-transcription" },
() => import("@kitn.ai/ui/elements/voice-input")
), mt = /* @__PURE__ */ e(
"kai-voice-output",
["theme", "text", "autoplay", "synthesize", "disabled"],
{ onSpeakingChange: "kai-speaking-change", onSynthesized: "kai-synthesized" },
() => import("@kitn.ai/ui/elements/voice-output")
), pt = /* @__PURE__ */ e(
"kai-workspace",
["theme", "groups", "conversations", "activeId", "messages", "value", "placeholder", "loading", "suggestions", "suggestionMode", "proseSize", "codeTheme", "codeHighlight", "chatTitle", "models", "currentModel", "context", "scrollButton", "search", "voice", "triggers", "kindIcons", "sidebarWidth", "sidebarMinWidth", "sidebarMaxWidth", "sidebarCollapsed", "defaultSidebarCollapsed", "collapseBelow", "compact", "noConversations"],
{ onConversationSelect: "kai-conversation-select", onMessageAction: "kai-message-action", onModelChange: "kai-model-change", onNewChat: "kai-new-chat", onSearch: "kai-search", onSidebarToggle: "kai-sidebar-toggle", onSubmit: "kai-submit", onSuggestionClick: "kai-suggestion-click", onValueChange: "kai-value-change", onVoice: "kai-voice" },
() => import("@kitn.ai/ui/elements/chat-workspace")
);
export {
j as AgentCard,
q as Artifact,
G as Attachments,
K as Avatar,
Q as Badge,
J as Button,
X as Card,
Y as Cards,
Z as ChainOfThought,
_ as Chat,
$ as Checkpoint,
ee as Choice,
te as Coachmark,
ae as CodeBlock,
oe as Command,
ne as Compare,
ie as Composer,
se as Confirm,
re as Context,
ce as Conversations,
le as Dialog,
de as EditableLabel,
me as Embed,
pe as Empty,
he as FeedbackBar,
ue as FileTree,
ge as FileUpload,
ke as Form,
be as HoverCard,
fe as Icon,
ve as Image,
Ce as Input,
Se as Kbd,
ye as LinkPreview,
Te as Loader,
xe as Markdown,
Ie as Menu,
ze as Message,
we as ModelSwitcher,
Me as Nav,
Oe as Notice,
Re as Pane,
Ae as PaneGroup,
Ee as Popover,
Ve as ProgressBar,
De as PromptDock,
Fe as PromptInput,
Le as Reasoning,
Be as Remote,
Pe as Resizable,
He as ResizableItem,
Ne as ResponseStream,
Ue as ScopePicker,
We as Screen,
je as ScrollArea,
qe as ScrollButton,
Ge as Search,
Ke as Segmented,
Qe as Separator,
Je as SettingItem,
Xe as SettingsGroup,
Ye as Skeleton,
Ze as Skills,
_e as Source,
$e as Sources,
et as Status,
tt as Suggestions,
at as Switch,
ot as Tabs,
nt as Tasks,
it as TextShimmer,
st as ThinkingBar,
rt as ToastRegion,
ct as Tool,
lt as Tooltip,
dt as VoiceInput,
mt as VoiceOutput,
pt as Workspace,
U as registerAll,
W as useKaiChat
};