import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js'; /** * `` — a compact, static resource strip for one message or run: tokens in/out, * cost, latency, with a hover/focus tooltip breakdown. Purely formatting — this component computes * no counts, rates, or prices; every segment is independently optional, and with nothing set, * nothing renders at all (not even a focusable/interactive shell). * * The tooltip reuses ``'s hover/focus/Escape/`aria-describedby` contract * wholesale: hover and focus are tracked as independent "keep it open" reasons, so releasing one * modality while the other still holds doesn't close it. * * The built-in latency formatting has no minutes/hours tier (`'{ms}ms'`, or one-decimal seconds * above 1000ms) — a host whose latencies commonly exceed a minute sets `formatLatency` to render * its own scale instead, in both the visible strip and the tooltip row. * * An `aria-label` set on the host element (the idiomatic way to name any custom element) wins * over the localized default accessible name, same convention as ``'s own * `aria-label` precedence. * * Number abbreviation is `abbreviate`, not `compact`. This badge has no density mode; `compact` * (removed in 9.0.0) selected `Intl.NumberFormat`'s `notation: 'compact'` here while meaning * visual density on every other component that spells it, so the name was moved to what it * actually does. A stale `compact` attribute is inert. * * Removing cost-text or summary safely omits that content; explicit empty values remain empty and later values restore it. An open tooltip participates in shared Escape ordering even while only hovered, and dismissal preserves focus elsewhere. * * @customElement lr-usage-badge * @slot summary - Visible summary shown when no built-in segment is set. The `summary` property is * its text fallback. A details-only badge without either form of summary remains non-focusable. * @slot details - Extra rows appended below the built-in tooltip breakdown (e.g. cache-read * tokens). Interactive descendants are intentionally inert because this is a tooltip, not a * dialog; their accessible text is mirrored into the trigger's tooltip description. * @csspart base - The root inline strip (a focusable non-button `role="group"`, only while at * least one segment, or a visible summary with details, has content). * @csspart summary - The visible fallback shown when no built-in segment is set. * @csspart tokens-in - The `'{count} in'` segment. Only rendered when `tokensIn` is a finite * number. * @csspart tokens-out - The `'{count} out'` segment. Only rendered when `tokensOut` is a finite * number. * @csspart cost - The verbatim `costText`. Only rendered when set. * @csspart latency - The formatted `latencyMs`. Only rendered when it's a finite number. * @csspart tooltip - The floating detail breakdown, only meaningful while open. * @cssprop [--lr-overlay-surface=var(--lr-color-surface-overlay)] - Shared floating-surface fill, * on the anchored breakdown tooltip. * @cssprop [--lr-overlay-border=var(--lr-color-border)] - Shared floating-surface edge colour, on * the anchored breakdown tooltip. * @cssprop [--lr-overlay-radius=var(--lr-radius)] - Shared floating-surface corner radius, on the * anchored breakdown tooltip. * @cssprop [--lr-overlay-shadow-anchored=var(--lr-shadow-m)] - Elevation of the anchored surface. * @cssprop --lr-positioning-strategy - Cascading `absolute`/`fixed` override for the breakdown * tooltip's `fixed` default, read from computed style when it is (re)positioned. Set it once on * `:root`, a theme, or one clipping ancestor to change every unset usage badge beneath it; an * unrecognized value falls back to `fixed`. * @status stable * @since 4.0.0 */ export declare class LyraUsageBadge extends LyraElement{static styles:import("lit").CSSResultGroup[]; /** Input tokens. Normalized to a non-negative integer, locale-formatted. Segment omitted * entirely while unset or non-finite. */ tokensIn?:number; /** Output tokens. Same rules as `tokensIn`. */ tokensOut?:number; /** Pre-formatted cost (e.g. `"$0.012"`), rendered verbatim. Currency formatting is host domain. */ costText:string; /** Latency in milliseconds, formatted with the shared duration algorithm (or `formatLatency`, * when set). */ latencyMs?:number; /** Visible text used when there are no built-in token/cost/latency segments. Required to make a * details-only badge into a discoverable tooltip trigger; the `summary` slot takes precedence. */ summary:string; /** Overrides the shared short-duration rendering of `latencyMs` (`'{ms}ms'`, or one-decimal * seconds above 1000ms — no minutes/hours tier) in both the visible strip and the tooltip row. * Mirrors ``'s `formatTimestamp` convention. */ formatLatency?:(ms:number)=>string; /** Token counts render via `Intl.NumberFormat` `notation: 'compact'` (e.g. `12345 -> "12K"`) * when set; the tooltip always shows full grouped figures regardless. Named for the number * formatting it selects, not for density: `compact` means visual density on twenty other * components in this library, and this one has no density mode at all. */ abbreviate:boolean;private tooltipOpen;private hasDetailsSlot;private hasSummarySlot;private detailsText;private readonly tooltipId;private tooltipOverlay?;private tooltipRuntime?;private tooltipOrder?;private tooltipOpening?;private hovering;private focused;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;disconnectedCallback():void;private onDetailsSlotChange;private onSummarySlotChange;private get hasTokensIn();private get hasTokensOut();private get hasCost(); /** `latencyMs` normalized to a finite, non-negative duration -- `undefined` while unset or * non-finite (the `latency` segment/tooltip row is omitted entirely). */ private get validLatencyMs();private get hasLatency();private get hasVisibleContent();private get hasVisibleSummary();private get hasDisplayContent();private get hasTooltipContent();private get hasInteractiveTooltip();private formatTokenCount;private formatTokenCountFull;private localizedDuration;private loadTooltipOverlayRuntime;protected getUpdateComplete():Promise;private waitForTooltipOpening;private cancelTooltipOpening;private showTooltip;private hideTooltip;private closeTooltipLifecycle;private onMouseEnter;private onMouseLeave;private onFocus;private onBlur;private onKeyDown;render():TemplateResult;private renderBadgeContent;}declare global{interface HTMLElementTagNameMap{'lr-usage-badge':LyraUsageBadge;}}