import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraToolStatus}from'../../../internal/shared-unions.js'; /** Same status vocabulary as ``, so a call's chip * and its detail dialog always agree on icon/label/tone. */ export type ToolCallStatus=LyraToolStatus;export interface ToolChipSelectDetail{name:string;callId:string;}export interface LyraToolCallChipEventMap{'lr-tool-call-chip-select':CustomEvent;} /** * `` — a compact inline pill representing one tool/ * function call an agent made mid-conversation, e.g. * `web_search: Searching web…` with a `running` spinner. It owns no detail * surface of its own: clicking (or Enter/Space-activating) it only fires * `lr-tool-call-chip-select` — a consumer wires that to opening a * `` (or anything else) at the call site. Keeping * the two decoupled means a chip can be reused wherever a compact call * summary is useful, with or without a detail surface behind it. * * The default slot is *not* the chip's visible content — the chip's own * label is always built from `name`/`summary`/`status`/`duration-ms`. It's * reserved for optional read-only preview content (e.g. the tool's raw * arguments or a short formatted summary) shown in a floating tooltip on hover/focus, positioned * with `internal/positioner.js`'s `place()` the same way `` * positions its listbox. No tooltip is shown at all when the slot carries no * content — hovering an empty chip does nothing. Hover and keyboard focus are * tracked as independent reasons to keep the tooltip open (mirrors * ``'s popover), so releasing one modality while the * other is still active doesn't close it, and the trigger button's * `aria-describedby` points at the tooltip's id whenever it's open and has * content, so the association reaches assistive tech too. The tooltip is an * explicitly noninteractive preview: its flattened subtree is inert, so a * consumer must put actions in the detail surface opened from * `lr-tool-call-chip-select`, not links or controls in this description slot. * * The `icon` slot overrides the built-in per-status glyph entirely via the * platform's own slot-fallback-content mechanism (`${fallback}` — the same pattern ``'s * `caption` slot and ``'s default slot already use): * whatever is assigned to `slot="icon"` wins; otherwise the `icon` prop is * rendered as a literal hint (e.g. an emoji); otherwise the built-in glyph * for the current `status` is used. * * @customElement lr-tool-call-chip * @slot - Noninteractive tooltip preview text or formatting, shown on hover/focus. Interactive * descendants are inert; put actions in the detail surface opened from * `lr-tool-call-chip-select`. Nothing renders when this slot is empty. * @slot icon - Overrides the built-in status glyph entirely. * @event lr-tool-call-chip-select - The chip was activated (click or * Enter/Space while focused). `detail: { name, callId }`. The `lr-tool-chip-select` * alias this event replaced was removed in 9.0.0. * @csspart base - The clickable pill (`