{"version":3,"file":"forty-cdk-tooltip.mjs","sources":["../../../projects/forty-cdk/tooltip/src/tooltip-context.ts","../../../projects/forty-cdk/tooltip/src/tooltip-defaults.ts","../../../projects/forty-cdk/tooltip/src/tooltip.ts","../../../projects/forty-cdk/tooltip/src/tooltip-trigger.ts","../../../projects/forty-cdk/tooltip/src/tooltip-content.ts","../../../projects/forty-cdk/tooltip/src/tooltip-arrow.ts","../../../projects/forty-cdk/tooltip/src/forty-cdk-tooltip.ts"],"sourcesContent":["import { computed, inject, InjectionToken, type Signal } from '@angular/core';\n\nimport { orphanContextError, unresolvedRootError } from 'forty-cdk/core';\nimport { type AnchoredPositioningContext, type Point } from 'forty-cdk/core-overlay';\n\n/** Reason a show / hide was scheduled — `escape` and `press` bypass the close delay. */\nexport type TooltipScheduleReason = 'hover' | 'focus' | 'escape' | 'press';\n\n/**\n * Coordination contract owned by `ForTooltip`. Trigger and content register\n * their host elements so floating-ui can compute position; the optional arrow\n * registers itself so the `arrow` middleware can offset it inside the bubble.\n *\n * The trigger and content forward their host hover / focus events through the\n * `pointerEnter*` / `pointerLeave*` / `focusTrigger` / `blurTrigger` methods;\n * the root owns the single open / close decision so all keep-alive sources\n * (trigger hover, trigger focus, and — under `hoverableContent` — content\n * hover) are reconciled in one place.\n */\nexport interface ForTooltipContext extends AnchoredPositioningContext {\n  readonly open: Signal<boolean>;\n  readonly disabled: Signal<boolean>;\n  /** Whether the pointer may move into the content without dismissing the tooltip. */\n  readonly hoverableContent: Signal<boolean>;\n  /** Whether `prefers-reduced-motion: reduce` is active — reflected as `data-reduced-motion`. */\n  readonly reducedMotion: Signal<boolean>;\n  /** Trigger element id — a consumer-set host `id` is adopted, else a generated one. */\n  readonly triggerId: Signal<string>;\n  /** Content element id — a consumer-set host `id` is adopted, else a generated one. Referenced by the trigger's `aria-describedby` while open. */\n  readonly contentId: Signal<string>;\n  readonly trigger: Signal<HTMLElement | null>;\n\n  registerTrigger(el: HTMLElement): void;\n  unregisterTrigger(el: HTMLElement): void;\n  /** Registers the content host element so the hoverable-content grace polygon can measure it. */\n  registerContent(el: HTMLElement): void;\n  unregisterContent(el: HTMLElement): void;\n  /** Adopts a consumer-set static `id` on the content host into `contentId`. */\n  adoptContentId(el: HTMLElement): void;\n  registerArrow(el: HTMLElement): void;\n  unregisterArrow(el: HTMLElement): void;\n\n  /** The pointer entered the trigger; opens after the resolved open delay (gated by `showOnOverflow`). */\n  pointerEnterTrigger(): void;\n  /** The pointer left the trigger; closes, or arms the hoverable-content bridge from `cursor`. */\n  pointerLeaveTrigger(cursor: Point): void;\n  /** The trigger received focus; opens after the resolved open delay (gated by `showOnOverflow`). */\n  focusTrigger(): void;\n  /** The trigger lost focus; closes when nothing else keeps the tooltip alive. */\n  blurTrigger(): void;\n  /** The pointer entered the content (`hoverableContent`); holds the tooltip open. */\n  pointerEnterContent(): void;\n  /** The pointer left the content (`hoverableContent`); closes when nothing else keeps it alive. */\n  pointerLeaveContent(): void;\n\n  /**\n   * Schedule the tooltip to open after `openDelay` ms (instant when delay is 0).\n   * Hover-driven opens are suppressed while an ancestor scroll container is\n   * moving content under a stationary cursor, so a row sliding past the pointer\n   * can't flicker a tooltip open; the `'focus'` path is never suppressed.\n   */\n  scheduleOpen(reason: TooltipScheduleReason): void;\n  /** Schedule the tooltip to close after `closeDelay` ms (instant on `escape` and `press`). */\n  scheduleClose(reason: TooltipScheduleReason): void;\n  /** Cancel any pending open/close timer without changing state. */\n  cancelPending(): void;\n  /**\n   * Emit the public `(escapeKeyDown)` output and, unless prevented, close.\n   * Driven by the content's document-level dismissible layer, so the tooltip\n   * responds to Escape regardless of where focus lives — including a\n   * hover-opened tooltip while focus sits on an unrelated element (WCAG 2.1 SC\n   * 1.4.13) — and dismisses topmost-first when layered over a dialog.\n   */\n  emitEscapeKeyDown(event: KeyboardEvent): void;\n}\n\nexport const FOR_TOOLTIP_CONTEXT = new InjectionToken<ForTooltipContext>('FOR_TOOLTIP_CONTEXT');\n\nexport function injectTooltipContext(piece: string): ForTooltipContext {\n  const ctx = inject(FOR_TOOLTIP_CONTEXT, { optional: true });\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-TOOLTIP-001',\n      piece,\n      root: '[forTooltip]',\n      token: 'FOR_TOOLTIP_CONTEXT',\n    });\n  }\n  return ctx;\n}\n\n/**\n * Resolves the trigger's root context: the explicit reference when the\n * `[forTooltipTrigger]` input carries one, the injected `FOR_TOOLTIP_CONTEXT`\n * otherwise. The orphan error only fires when neither resolves, on first read\n * of the returned signal. Must be called in an injection context.\n */\nexport function injectTooltipTriggerContext(\n  explicitRoot: Signal<ForTooltipContext | ''>,\n): Signal<ForTooltipContext> {\n  const injected = inject(FOR_TOOLTIP_CONTEXT, { optional: true });\n  return computed(() => {\n    const explicit = explicitRoot();\n    if (explicit !== '') {\n      return explicit;\n    }\n    if (injected) {\n      return injected;\n    }\n    throw unresolvedRootError({\n      code: 'FORCDK-TOOLTIP-002',\n      trigger: '[forTooltipTrigger]',\n      root: '[forTooltip]',\n      token: 'FOR_TOOLTIP_CONTEXT',\n      exportAs: 'forTooltip',\n    });\n  });\n}\n","import { inject, Injectable, type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\nimport {\n  type AnchoredPositioningSeedDefaults,\n  type FloatingAlign,\n  type FloatingSide,\n  SkipDelayCoordinator,\n} from 'forty-cdk/core-overlay';\n\n/**\n * Defaults that descendant tooltips inherit from their injector scope.\n * Configure with `provideForTooltipDefaults` either at the application root\n * or in any component's `providers` array; partial overrides merge with\n * the parent scope.\n */\nexport interface ForTooltipDefaults extends AnchoredPositioningSeedDefaults {\n  /** Open delay (ms) for tooltips that don't override `openDelay` locally. */\n  openDelay: number;\n  /** Close delay (ms) for tooltips that don't override `closeDelay` locally. */\n  closeDelay: number;\n  /**\n   * Window (ms) after a peer tooltip in this scope closes during which\n   * the next open is instant — keeps toolbar-style tooltips from feeling\n   * sluggish on cursor movement between targets.\n   */\n  skipDelayDuration: number;\n  /**\n   * Side the tooltip is anchored to for tooltips that don't override\n   * `side` locally. Library fallback `'top'`.\n   */\n  side: FloatingSide;\n  /**\n   * Alignment along the chosen `side` for tooltips that don't override\n   * `align` locally. Library fallback `'center'`.\n   */\n  align: FloatingAlign;\n  /**\n   * Gap (px) between trigger and content along the main axis for tooltips\n   * that don't override `sideOffset` locally.\n   * Library fallback `8`.\n   */\n  sideOffset: number;\n  /**\n   * Padding (px) applied uniformly to the `flip`, `shift`, and `size`\n   * middlewares for tooltips that don't override `collisionPadding`\n   * locally. Library fallback `8`.\n   */\n  collisionPadding: number;\n  /**\n   * Padding (px) keeping the `[forTooltipArrow]` element that far from the\n   * edges of the content, for tooltips that don't override `arrowPadding`\n   * locally. Only consulted when an arrow is registered — floating-ui installs\n   * the `arrow` middleware only then. Library fallback `0`.\n   */\n  arrowPadding: number;\n  /**\n   * Whether tooltips show only when the trigger's own text is truncated\n   * (`scrollWidth > clientWidth`), for tooltips that don't override\n   * `showOnOverflow` locally. Library fallback `false`.\n   */\n  showOnOverflow: boolean;\n  /**\n   * Whether the pointer may move into the content without dismissing the\n   * tooltip, for tooltips that don't override `hoverableContent` locally.\n   * Library fallback `true`, which satisfies the WCAG 2.1 SC 1.4.13\n   * \"Hoverable\" requirement by default; opt out per scope with\n   * `provideForTooltipDefaults({ hoverableContent: false })`.\n   */\n  hoverableContent: boolean;\n}\n\n/**\n * Library fallback for tooltip defaults, read at the root injector when no\n * consumer has called `provideForTooltipDefaults`. Exported for the shared\n * defaults contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_TOOLTIP_FALLBACK_DEFAULTS: ForTooltipDefaults = {\n  openDelay: 700,\n  closeDelay: 300,\n  skipDelayDuration: 300,\n  side: 'top',\n  align: 'center',\n  sideOffset: 8,\n  collisionPadding: 8,\n  arrowPadding: 0,\n  showOnOverflow: false,\n  hoverableContent: true,\n};\n\nconst { token, provideDefaults } = createDefaults<ForTooltipDefaults>(\n  'FOR_TOOLTIP_DEFAULTS',\n  FOR_TOOLTIP_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved tooltip defaults for the current scope. */\nexport const FOR_TOOLTIP_DEFAULTS = token;\n\n/**\n * Per-injector-scope state owned by forty-cdk tooltip. Thin subclass of the\n * shared `SkipDelayCoordinator` bound to this primitive's own DI token, so\n * each call to `provideForTooltipDefaults` re-provides it and the\n * corresponding subtree gets its own skip-delay window, independent from any\n * hover-card scope. Tooltips inject it on construction.\n */\n@Injectable({ providedIn: 'root' })\nexport class TooltipCoordinator extends SkipDelayCoordinator {\n  constructor() {\n    super(inject(FOR_TOOLTIP_DEFAULTS));\n  }\n}\n\n/**\n * Configures forty-cdk tooltip defaults for this injector scope.\n * Partial overrides inherit unspecified keys from the parent scope (or\n * library defaults at the root). Each call establishes a new\n * coordinator scope: peer tooltips inside the scope share a skip-delay\n * window; tooltips in other scopes don't.\n *\n * @example\n * ```ts\n * // application-level\n * bootstrapApplication(App, {\n *   providers: [provideForTooltipDefaults({ openDelay: 500 })],\n * });\n *\n * // component-level override (e.g. a toolbar with its own cadence)\n * @Component({\n *   providers: [provideForTooltipDefaults({ skipDelayDuration: 100 })],\n *   ...\n * })\n * class Toolbar {}\n * ```\n */\nexport function provideForTooltipDefaults(defaults: Partial<ForTooltipDefaults> = {}): Provider[] {\n  return [...provideDefaults(defaults), TooltipCoordinator];\n}\n","import {\n  booleanAttribute,\n  computed,\n  DestroyRef,\n  Directive,\n  inject,\n  input,\n  model,\n  numberAttribute,\n  output,\n  signal,\n} from '@angular/core';\n\nimport {\n  adoptHostId,\n  emitVetoableNativeEvent,\n  IdGenerator,\n  injectPrefersReducedMotion,\n  type VetoableNativeEvent,\n} from 'forty-cdk/core';\nimport {\n  AnchoredOverlayPositioningBase,\n  forceCloseWhenDisabled,\n  createHoverIntent,\n  type HoverIntentScheduler,\n  attachPointerGrace,\n  buildSubmenuGracePolygon,\n  type Point,\n  resolveGraceSide,\n  ScrollDismissDispatcher,\n} from 'forty-cdk/core-overlay';\nimport {\n  FOR_TOOLTIP_CONTEXT,\n  type ForTooltipContext,\n  type TooltipScheduleReason,\n} from './tooltip-context';\nimport { FOR_TOOLTIP_DEFAULTS, TooltipCoordinator } from './tooltip-defaults';\n\n/**\n * Headless implementation of the [WAI-ARIA Tooltip pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/).\n *\n * Wrapper directive that owns open / closed state, hover / focus delays, and\n * placement. Provides the shared context to `ForTooltipTrigger`,\n * `ForTooltipContent`, and the optional `ForTooltipArrow`.\n *\n * Tooltip content is portaled to `document.body` and positioned via\n * `@floating-ui/dom`. Per APG, content must NOT be interactive — for\n * interactive popups use a Popover primitive.\n */\n@Directive({\n  selector: '[forTooltip]',\n  exportAs: 'forTooltip',\n  host: {\n    '[attr.data-state]': 'open() ? \"open\" : \"closed\"',\n    '[attr.data-disabled]': 'disabled() ? \"\" : null',\n    '[attr.data-reduced-motion]': 'reducedMotion() ? \"\" : null',\n  },\n  providers: [{ provide: FOR_TOOLTIP_CONTEXT, useExisting: ForTooltip }],\n})\nexport class ForTooltip extends AnchoredOverlayPositioningBase implements ForTooltipContext {\n  readonly #idGen = inject(IdGenerator);\n  protected readonly positioningDefaults = inject(FOR_TOOLTIP_DEFAULTS);\n\n  /**\n   * Two-way bindable. Whether the tooltip is currently shown. The `model()`\n   * change emitter (`(openChange)`) fires only on internal transitions\n   * (hover/focus delays, Escape, and the force-close that runs when `disabled`\n   * flips to true), never on consumer writes through `[(open)]` — observe\n   * state changes without binding back.\n   */\n  readonly open = model<boolean>(false);\n\n  /**\n   * Padding (px) keeping `[forTooltipArrow]` that far from the edges of the\n   * content. Only consulted when an arrow is registered, since floating-ui\n   * installs the `arrow` middleware only then — which is why the input is\n   * declared here rather than on the shared positioning base. The default is\n   * read from `provideForTooltipDefaults` for the surrounding scope, since arrow\n   * geometry is a design-system-wide decision rather than a per-tooltip one.\n   */\n  readonly arrowPadding = input(this.positioningDefaults.arrowPadding, {\n    transform: numberAttribute,\n  });\n\n  /**\n   * Per-tooltip override for the open delay (ms). When `undefined`\n   * (default), falls back to `ForTooltipDefaults.openDelay` from the\n   * surrounding `provideForTooltipDefaults` scope (700ms unless configured).\n   */\n  readonly openDelay = input<number | undefined>(undefined);\n\n  /**\n   * Per-tooltip override for the close delay (ms) after hover or focus\n   * leaves. `Escape` ignores this. When `undefined` (default), falls back to\n   * `ForTooltipDefaults.closeDelay` from the surrounding\n   * `provideForTooltipDefaults` scope (300ms unless configured).\n   */\n  readonly closeDelay = input<number | undefined>(undefined);\n\n  /** When true, all hover / focus interaction is ignored and any open tooltip is forced closed. */\n  readonly disabled = input(false, { transform: booleanAttribute });\n\n  /**\n   * Per-tooltip override for whether the tooltip shows only when the\n   * trigger's own text is truncated (`scrollWidth > clientWidth`) — the\n   * common pattern for ellipsized labels where the tooltip adds nothing once\n   * the full text is visible. When `undefined` (default), falls back to\n   * `ForTooltipDefaults.showOnOverflow` from the surrounding\n   * `provideForTooltipDefaults` scope (`false` unless configured).\n   *\n   * The input is aliased to `showOnOverflow`; consumers bind\n   * `[showOnOverflow]=\"...\"` (or the bare attribute) and read the effective\n   * value via the public `showOnOverflow` computed below.\n   */\n  readonly _showOnOverflowInput = input(undefined, {\n    alias: 'showOnOverflow',\n    transform: (v: unknown): boolean | undefined => (v == null ? undefined : booleanAttribute(v)),\n  });\n\n  /** Effective overflow gate: the `showOnOverflow` input when set, else the scope default. */\n  readonly showOnOverflow = computed<boolean>(\n    () => this._showOnOverflowInput() ?? this.positioningDefaults.showOnOverflow,\n  );\n\n  /**\n   * Per-tooltip override for whether the pointer may move into the content\n   * without dismissing the tooltip. When `true`, the content drops its\n   * default `pointer-events: none` while open and a pointer-grace \"safe\n   * triangle\" bridges the gap between trigger and content so a slow diagonal\n   * traversal doesn't close it. When `undefined` (default), falls back to\n   * `ForTooltipDefaults.hoverableContent` from the surrounding\n   * `provideForTooltipDefaults` scope (`true` unless configured).\n   *\n   * Per APG the content must stay non-interactive; this only allows the\n   * pointer to rest over descriptive text (e.g. to select it).\n   *\n   * The input is aliased to `hoverableContent`; consumers bind\n   * `[hoverableContent]=\"...\"` (or the bare attribute) and read the effective\n   * value via the public `hoverableContent` computed below.\n   */\n  readonly _hoverableContentInput = input(undefined, {\n    alias: 'hoverableContent',\n    transform: (v: unknown): boolean | undefined => (v == null ? undefined : booleanAttribute(v)),\n  });\n\n  /** Effective hoverable-content flag: the `hoverableContent` input when set, else the scope default. */\n  readonly hoverableContent = computed<boolean>(\n    () => this._hoverableContentInput() ?? this.positioningDefaults.hoverableContent,\n  );\n\n  /**\n   * Fires when the user presses Escape while the tooltip is open, regardless of\n   * where focus currently lives — on the trigger or on an unrelated element (the\n   * common case for a hover-opened tooltip). Routed through the content's\n   * document-level dismissible layer. Call `preventDefault()` on the emitted\n   * veto to keep the tooltip open. The native `KeyboardEvent` is on `.event`.\n   */\n  readonly escapeKeyDown = output<VetoableNativeEvent<KeyboardEvent>>();\n\n  /**\n   * Whether the user has requested reduced motion via the OS\n   * `prefers-reduced-motion: reduce` media query. Reflected as the boolean\n   * `data-reduced-motion` attribute on the root and content so consumers can\n   * disable their own `animate.enter` / `animate.leave` and CSS transitions\n   * without re-deriving the media query. Tooltip's JS-coordinated timing (the\n   * open / close hover-intent delays) is intent debouncing, not motion, so it\n   * is unchanged under reduced motion.\n   */\n  readonly reducedMotion = injectPrefersReducedMotion();\n\n  readonly #generatedTriggerId = this.#idGen.next('for-tooltip-trigger');\n\n  /**\n   * Id of the trigger element. A consumer-set `id` on the trigger host is\n   * adopted at registration and preserved; the generated\n   * `for-tooltip-trigger-*` id is only assigned when the host has none.\n   */\n  readonly triggerId = signal(this.#generatedTriggerId);\n\n  /** Generated id of the content element, wired to the trigger's `aria-describedby` while open. */\n  readonly contentId = signal(this.#idGen.next('for-tooltip-content'));\n\n  readonly #triggerEl = signal<HTMLElement | null>(null);\n  readonly trigger = this.#triggerEl.asReadonly();\n\n  readonly #contentEl = signal<HTMLElement | null>(null);\n\n  readonly #arrowEl = signal<HTMLElement | null>(null);\n  readonly arrow = this.#arrowEl.asReadonly();\n\n  readonly #coordinator = inject(TooltipCoordinator);\n  readonly #scrollDismissDispatcher = inject(ScrollDismissDispatcher);\n  readonly #hoverIntent: HoverIntentScheduler;\n\n  #triggerHovered = false;\n  #triggerFocused = false;\n  #contentHovered = false;\n  #detachGrace: (() => void) | null = null;\n  #unregisterScrollDismiss: () => void = () => {};\n\n  constructor() {\n    super();\n    forceCloseWhenDisabled({\n      open: this.open,\n      disabled: this.disabled,\n      onForceClose: () => this.cancelPending(),\n    });\n\n    this.#hoverIntent = createHoverIntent({\n      open: this.open,\n      isDisabled: () => this.disabled(),\n      openDelay: () => this.openDelay() ?? this.#coordinator.openDelay,\n      closeDelay: () => this.closeDelay() ?? this.#coordinator.closeDelay,\n      coordinator: this.#coordinator,\n    });\n\n    this.#unregisterScrollDismiss = this.#scrollDismissDispatcher.register(() =>\n      this.#dismissOnScroll(),\n    );\n\n    inject(DestroyRef).onDestroy(() => {\n      this.cancelPending();\n      this.#unregisterScrollDismiss();\n    });\n  }\n\n  /**\n   * Registers the trigger host element. Adopts a pre-existing consumer-set\n   * `id` as the trigger id so external references (anchors, `aria-labelledby`,\n   * label `for`) keep resolving; falls back to the generated id otherwise.\n   */\n  registerTrigger(el: HTMLElement): void {\n    adoptHostId(el, this.triggerId);\n    this.#triggerEl.set(el);\n  }\n\n  unregisterTrigger(el: HTMLElement): void {\n    if (this.#triggerEl() === el) {\n      this.#triggerEl.set(null);\n    }\n  }\n\n  /** Registers the content host element so the hoverable-content grace polygon can measure it. */\n  registerContent(el: HTMLElement): void {\n    this.#contentEl.set(el);\n  }\n\n  unregisterContent(el: HTMLElement): void {\n    if (this.#contentEl() === el) {\n      this.#contentEl.set(null);\n    }\n  }\n\n  /** Adopts a consumer-set static `id` on the content host into `contentId`. */\n  adoptContentId(el: HTMLElement): void {\n    adoptHostId(el, this.contentId);\n  }\n\n  registerArrow(el: HTMLElement): void {\n    this.#arrowEl.set(el);\n  }\n\n  unregisterArrow(el: HTMLElement): void {\n    if (this.#arrowEl() === el) {\n      this.#arrowEl.set(null);\n    }\n  }\n\n  pointerEnterTrigger(): void {\n    this.#triggerHovered = true;\n    this.#disarmContentGrace();\n    if (this.#scrollSuppressed() || this.#suppressedByOverflow()) {\n      return;\n    }\n    this.#hoverIntent.scheduleOpen();\n  }\n\n  pointerLeaveTrigger(cursor: Point): void {\n    this.#triggerHovered = false;\n    if (this.#triggerFocused) {\n      return;\n    }\n    if (this.hoverableContent() && this.open() && this.#contentEl()) {\n      this.#armContentGrace(cursor);\n      return;\n    }\n    this.#scheduleCloseIfInactive();\n  }\n\n  focusTrigger(): void {\n    this.#triggerFocused = true;\n    if (this.#suppressedByOverflow()) {\n      return;\n    }\n    this.#hoverIntent.scheduleOpen();\n  }\n\n  blurTrigger(): void {\n    this.#triggerFocused = false;\n    this.#scheduleCloseIfInactive();\n  }\n\n  pointerEnterContent(): void {\n    if (!this.hoverableContent()) {\n      return;\n    }\n    this.#contentHovered = true;\n    this.#disarmContentGrace();\n    this.#hoverIntent.cancelPending();\n  }\n\n  pointerLeaveContent(): void {\n    if (!this.hoverableContent()) {\n      return;\n    }\n    this.#contentHovered = false;\n    this.#scheduleCloseIfInactive();\n  }\n\n  scheduleOpen(reason: TooltipScheduleReason): void {\n    if (reason !== 'focus' && this.#scrollSuppressed()) {\n      return;\n    }\n    this.#hoverIntent.scheduleOpen();\n  }\n\n  scheduleClose(reason: TooltipScheduleReason): void {\n    this.#disarmContentGrace();\n    this.#hoverIntent.scheduleClose(reason === 'escape' || reason === 'press');\n  }\n\n  cancelPending(): void {\n    this.#disarmContentGrace();\n    this.#hoverIntent.cancelPending();\n  }\n\n  /**\n   * Emit the public `(escapeKeyDown)` output and, unless the consumer calls\n   * `preventDefault()` on the veto, close the tooltip immediately. Driven by the\n   * content's document-level dismissible layer so Escape dismisses the tooltip\n   * regardless of where focus currently lives — including a hover-opened tooltip\n   * with focus on an unrelated element (WCAG 2.1 SC 1.4.13) — and so a tooltip\n   * layered over a dialog is dismissed by the first Escape while the dialog\n   * stays open (topmost layer first). A no-op when nothing is open.\n   */\n  emitEscapeKeyDown(event: KeyboardEvent): void {\n    if (!this.open()) {\n      return;\n    }\n    const vetoed = emitVetoableNativeEvent(this.escapeKeyDown, event);\n    if (!vetoed) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.scheduleClose('escape');\n    }\n  }\n\n  /**\n   * Imperatively opens the tooltip — for programmatic control beyond hover and\n   * focus (e.g. a design-system wrapper driving the tooltip from a\n   * text-truncation observer). Schedules the show after the resolved\n   * `openDelay` (instant when the delay is `0` or the scope's skip-delay window\n   * is active) and applies the same gates as a hover / focus open: a no-op\n   * while `disabled`, a no-op under `showOnOverflow` when the trigger's own\n   * text is not truncated, and a no-op while an ancestor is scrolling (the\n   * scroll-dismiss suppression window). For an instant, unconditional open that\n   * bypasses the delay and every gate, write the `[(open)]` model directly\n   * (`open.set(true)`).\n   */\n  show(): void {\n    if (this.#scrollSuppressed() || this.#suppressedByOverflow()) {\n      return;\n    }\n    this.#hoverIntent.scheduleOpen();\n  }\n\n  /**\n   * Imperatively closes the tooltip, mirroring a hover-leave / blur close:\n   * schedules the hide after the resolved `closeDelay` (instant when the delay\n   * is `0`) and disarms the hoverable-content grace bridge. For an instant\n   * close that ignores `closeDelay`, write the `[(open)]` model directly\n   * (`open.set(false)`).\n   */\n  hide(): void {\n    this.scheduleClose('hover');\n  }\n\n  /** Close only when no keep-alive source (trigger hover/focus, content hover) is active. */\n  #scheduleCloseIfInactive(): void {\n    if (this.#triggerHovered || this.#triggerFocused || this.#contentHovered) {\n      return;\n    }\n    this.#hoverIntent.scheduleClose(false);\n  }\n\n  /**\n   * Closes the tooltip immediately when an ancestor scrolls under a stationary\n   * cursor and cancels any pending open / close timer. Closes silently\n   * (bypassing `closeDelay` and without opening the skip-delay window) so a peer\n   * row sliding under the cursor can't reopen instantly while the scroll is in\n   * flight. A no-op when nothing is open or armed.\n   */\n  #dismissOnScroll(): void {\n    this.cancelPending();\n    if (this.open()) {\n      this.open.set(false);\n    }\n  }\n\n  /** True while an ancestor scroll has opened the suppression window (opens are no-ops). */\n  #scrollSuppressed(): boolean {\n    return this.#scrollDismissDispatcher.isSuppressed();\n  }\n\n  /** True when `showOnOverflow` is on and the trigger's text is NOT truncated. */\n  #suppressedByOverflow(): boolean {\n    if (!this.showOnOverflow()) {\n      return false;\n    }\n    const el = this.#triggerEl();\n    return el !== null && el.scrollWidth <= el.clientWidth;\n  }\n\n  /**\n   * Arms a pointer-grace \"safe triangle\" from `cursor` toward the content so\n   * the pointer can travel across the trigger / content gap without closing.\n   * On exit (or when content hover takes over) the grace disarms and a close\n   * is scheduled if nothing else keeps the tooltip alive.\n   */\n  #armContentGrace(cursor: Point): void {\n    const content = this.#contentEl();\n    if (!content) {\n      this.#scheduleCloseIfInactive();\n      return;\n    }\n    const rect = content.getBoundingClientRect();\n    const trigger = this.#triggerEl();\n    const side = trigger ? resolveGraceSide(trigger.getBoundingClientRect(), rect) : this.side();\n    const polygon = buildSubmenuGracePolygon(cursor, rect, side);\n    this.#disarmContentGrace();\n    this.#detachGrace = attachPointerGrace(content.ownerDocument, polygon, () => {\n      this.#disarmContentGrace();\n      this.#scheduleCloseIfInactive();\n    });\n  }\n\n  #disarmContentGrace(): void {\n    if (this.#detachGrace) {\n      this.#detachGrace();\n      this.#detachGrace = null;\n    }\n  }\n}\n","import { Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { hostDescribedBy, isNonTouchPointer } from 'forty-cdk/core';\n\nimport { type ForTooltipContext, injectTooltipTriggerContext } from './tooltip-context';\n\n/**\n * Element that activates the tooltip on pointer hover or keyboard focus. Apply\n * on a focusable element — preferably a `<button>` so keyboard users can reach\n * it. Receives `aria-describedby` only while the tooltip is open, per APG —\n * composed after a consumer-set **static** `aria-describedby`, which is\n * preserved rather than replaced. The hover path is gated by the shared\n * `isNonTouchPointer` predicate, so a pen hovers the tooltip while a touch tap\n * does not.\n *\n * Activating the trigger dismisses the tooltip: `pointerdown` schedules an\n * immediate close (mirroring Radix / Base UI), so the bubble doesn't cover the\n * result of a click. The focus the same press induces does NOT reopen it —\n * only keyboard focus opens the tooltip. The open-on-focus path fires solely\n * when focus was not preceded by a pointer interaction (mouse, pen, or touch):\n * hover already covers pointer users, so pointer-induced focus is ignored.\n *\n * This makes a touch tap a no-op on both the hover-open and the focus-open\n * paths, because a tap is not a hover and the APG flags hover-tooltips as\n * problematic on touch (no hover, no separate focus affordance, no obvious\n * dismiss). Keyboard focus stays the touch-accessible fallback for descriptive\n * content.\n *\n * Escape dismissal is owned by the content's document-level dismissible layer\n * (see `ForTooltipContent`), so it works from the trigger and from unrelated\n * focus alike (WCAG 2.1 SC 1.4.13) — the trigger carries no Escape listener of\n * its own.\n *\n * The root is normally resolved via DI from the enclosing `[forTooltip]`.\n * When the trigger is declared inside an `ng-template` stamped into the root\n * (e.g. via `ngTemplateOutlet`), DI resolves at the template's declaration\n * site and misses the root — pass it explicitly through the selector input,\n * `routerLink`-style: `[forTooltipTrigger]=\"root\"` with `#root=\"forTooltip\"`.\n */\n@Directive({\n  selector: '[forTooltipTrigger]',\n  exportAs: 'forTooltipTrigger',\n  host: {\n    '[id]': 'ctx().triggerId()',\n    '[attr.aria-describedby]': 'describedBy()',\n    '[attr.data-state]': 'ctx().open() ? \"open\" : \"closed\"',\n    '(pointerenter)': 'onPointerEnter($event)',\n    '(pointerdown)': 'onPointerDown($event)',\n    '(pointerleave)': 'onPointerLeave($event)',\n    '(focus)': 'onFocus()',\n    '(blur)': 'onBlur()',\n  },\n})\nexport class ForTooltipTrigger {\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  /**\n   * Optional explicit reference to the `[forTooltip]` root, named after the\n   * selector `routerLink`-style. The bare valueless attribute keeps resolving\n   * the enclosing root via DI; pass the root explicitly\n   * (`[forTooltipTrigger]=\"root\"`, with `#root=\"forTooltip\"`) when the trigger\n   * is declared in an `ng-template` stamped inside the root — DI resolves at\n   * the template's declaration site, so the enclosing root is invisible there.\n   * The empty string (what the valueless attribute yields) is treated as unset.\n   */\n  readonly forTooltipTrigger = input<ForTooltipContext | ''>('');\n\n  protected readonly ctx = injectTooltipTriggerContext(this.forTooltipTrigger);\n\n  protected readonly describedBy = hostDescribedBy(() =>\n    this.ctx().open() ? this.ctx().contentId() : null,\n  );\n\n  #lastPointerType: string | null = null;\n\n  constructor() {\n    const el = this.#host.nativeElement;\n    // Registration is an imperative call into the resolved root's registry,\n    // not state derivation — the effect only re-registers the element when the\n    // resolved root changes (explicit reference swapped at runtime).\n    effect((onCleanup) => {\n      const ctx = this.ctx();\n      ctx.registerTrigger(el);\n      onCleanup(() => ctx.unregisterTrigger(el));\n    });\n  }\n\n  protected onPointerEnter(event: PointerEvent): void {\n    if (!isNonTouchPointer(event)) {\n      return;\n    }\n    this.ctx().pointerEnterTrigger();\n  }\n\n  protected onPointerDown(event: PointerEvent): void {\n    this.#lastPointerType = event.pointerType;\n    this.ctx().scheduleClose('press');\n  }\n\n  protected onPointerLeave(event: PointerEvent): void {\n    this.ctx().pointerLeaveTrigger({ x: event.clientX, y: event.clientY });\n  }\n\n  protected onFocus(): void {\n    const pointerInduced = this.#lastPointerType !== null;\n    this.#lastPointerType = null;\n    if (pointerInduced) {\n      return;\n    }\n    this.ctx().focusTrigger();\n  }\n\n  protected onBlur(): void {\n    this.#lastPointerType = null;\n    this.ctx().blurTrigger();\n  }\n}\n","import { DestroyRef, Directive, ElementRef, inject } from '@angular/core';\n\nimport {\n  toFloatingPositioner,\n  injectOverlayShell,\n  warnIfMountedWhileClosed,\n} from 'forty-cdk/core-overlay';\nimport { injectTooltipContext } from './tooltip-context';\n\n/**\n * The tooltip bubble. Carries `role=\"tooltip\"`, is portaled to\n * `document.body`, and is positioned by `@floating-ui/dom` while mounted.\n *\n * Default `pointer-events: none` is applied via host styles so the bubble\n * layers above content without intercepting hover. When the root opts in with\n * `hoverableContent`, `pointer-events` is dropped while open so the pointer\n * can rest over the bubble without dismissing it. Override with your own CSS\n * if needed — but per APG, do not put interactive elements inside.\n *\n * The directive does not manage DOM presence — wrap with\n * `@if (tip.open())` (using a template ref on `[forTooltip]`) so the\n * bubble mounts and unmounts with the open state and `animate.enter` /\n * `animate.leave` work natively.\n *\n * Escape is handled at the document level (outside dismissal stays implicit,\n * via hover / focus / scroll timing), so it dismisses the tooltip no matter\n * where focus lives when the\n * tooltip was hover-opened (WCAG 2.1 SC 1.4.13), and a tooltip layered over a\n * dialog is dismissed by the first Escape while the dialog stays open. No\n * initial focus move and no return focus on destroy — the surface is\n * informational and never steals focus.\n */\n@Directive({\n  selector: '[forTooltipContent]',\n  exportAs: 'forTooltipContent',\n  host: {\n    role: 'tooltip',\n    '[id]': 'ctx.contentId()',\n    '[attr.data-state]': 'ctx.open() ? \"open\" : \"closed\"',\n    '[attr.data-reduced-motion]': 'ctx.reducedMotion() ? \"\" : null',\n    '[style.pointer-events]': 'ctx.hoverableContent() ? null : \"none\"',\n    '(pointerenter)': 'ctx.pointerEnterContent()',\n    '(pointerleave)': 'ctx.pointerLeaveContent()',\n  },\n})\nexport class ForTooltipContent {\n  protected readonly ctx = injectTooltipContext('ForTooltipContent');\n\n  constructor() {\n    const el = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n    this.ctx.adoptContentId(el);\n    this.ctx.registerContent(el);\n    inject(DestroyRef).onDestroy(() => this.ctx.unregisterContent(el));\n    warnIfMountedWhileClosed({\n      primitive: 'tooltip',\n      piece: '[forTooltipContent]',\n      condition: 'tip.open()',\n      open: this.ctx.open,\n    });\n    injectOverlayShell({\n      positioner: toFloatingPositioner(this.ctx, this.ctx.trigger),\n      dismiss: {\n        emitEscapeKeyDown: (event) => this.ctx.emitEscapeKeyDown(event),\n      },\n    });\n  }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectTooltipContext } from './tooltip-context';\n\n/**\n * Optional visual arrow inside `ForTooltipContent`. Registers itself with\n * the tooltip context so floating-ui's `arrow` middleware can position it\n * along the bubble edge that points at the trigger. Style size and color\n * yourself — the directive only sets `position`, `left`/`top`, and the\n * opposite-side offset.\n */\n@Directive({\n  selector: '[forTooltipArrow]',\n  exportAs: 'forTooltipArrow',\n  host: {\n    'aria-hidden': 'true',\n    'data-tooltip-arrow': '',\n  },\n})\nexport class ForTooltipArrow {\n  readonly #ctx = injectTooltipContext('ForTooltipArrow');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  constructor() {\n    registerHandle(\n      this.#host.nativeElement,\n      (el) => this.#ctx.registerArrow(el),\n      (el) => this.#ctx.unregisterArrow(el),\n    );\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MA4Ea,mBAAmB,GAAG,IAAI,cAAc,CAAoB,qBAAqB;AAExF,SAAU,oBAAoB,CAAC,KAAa,EAAA;AAChD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3D,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,kBAAkB,CAAC;AACvB,YAAA,IAAI,EAAE,oBAAoB;YAC1B,KAAK;AACL,YAAA,IAAI,EAAE,cAAc;AACpB,YAAA,KAAK,EAAE,qBAAqB;AAC7B,SAAA,CAAC;IACJ;AACA,IAAA,OAAO,GAAG;AACZ;AAEA;;;;;AAKG;AACG,SAAU,2BAA2B,CACzC,YAA4C,EAAA;AAE5C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAChE,OAAO,QAAQ,CAAC,MAAK;AACnB,QAAA,MAAM,QAAQ,GAAG,YAAY,EAAE;AAC/B,QAAA,IAAI,QAAQ,KAAK,EAAE,EAAE;AACnB,YAAA,OAAO,QAAQ;QACjB;QACA,IAAI,QAAQ,EAAE;AACZ,YAAA,OAAO,QAAQ;QACjB;AACA,QAAA,MAA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