{"version":3,"file":"forty-cdk-navigation-menu.mjs","sources":["../../../projects/forty-cdk/navigation-menu/src/navigation-menu-context.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-defaults.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-list.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-item.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-trigger.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-content.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-link.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-indicator.ts","../../../projects/forty-cdk/navigation-menu/src/navigation-menu-viewport.ts","../../../projects/forty-cdk/navigation-menu/src/forty-cdk-navigation-menu.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n  assertRootContext,\n  type CollectionHandle,\n  type ListNavigationAction,\n  orphanContextError,\n  type WritingDirection,\n} from 'forty-cdk/core';\n\n/**\n * Per-trigger handle stored in the menu's `Collection`. Triggers register\n * themselves on construction so the menu can run roving-tabindex and\n * arrow-key navigation in DOM order.\n *\n * Part of the registration protocol, so it is never exported from\n * `public-api.ts` — see {@link NavigationMenuContext}.\n */\nexport interface ForNavigationMenuTriggerHandle extends CollectionHandle {\n  /**\n   * Narrowed from {@link CollectionHandle}'s `Node`: the menu focuses the\n   * trigger, scrolls it into view, and measures it for indicator positioning.\n   */\n  readonly host: HTMLElement;\n  readonly value: Signal<string>;\n  readonly disabled: Signal<boolean>;\n  readonly id: Signal<string>;\n}\n\n/**\n * Per-content handle stored in the menu's `Collection` for trigger ↔ content\n * wiring. Part of the registration protocol, so it is never exported from\n * `public-api.ts` — see {@link NavigationMenuContext}.\n */\nexport interface ForNavigationMenuContentHandle extends CollectionHandle {\n  /**\n   * Narrowed from {@link CollectionHandle}'s `Node`: the active panel's host is\n   * measured for viewport sizing and counted as a dismiss-exempt surface.\n   */\n  readonly host: HTMLElement;\n  readonly value: Signal<string>;\n  readonly id: Signal<string>;\n}\n\n/**\n * Per-viewport handle. Only one viewport is expected per menu. The host\n * element is the destination for re-parented active\n * content panels, and the viewport owns their ordering.\n *\n * Part of the registration protocol, so it is never exported from\n * `public-api.ts` — see {@link NavigationMenuContext}.\n */\nexport interface ForNavigationMenuViewportHandle {\n  readonly host: HTMLElement;\n  /**\n   * Re-parent `panel` into the viewport host at the position dictated by\n   * its `triggerHost`'s document order, so the panels' DOM order always\n   * matches trigger order regardless of mount timing. This makes the\n   * entering/leaving overlap during an animated A→B transition\n   * deterministic: a panel whose trigger precedes another's is always\n   * inserted before it, never appended last just because it mounted later.\n   *\n   * No-op when the panel is already correctly placed. `triggerHost` may be\n   * `null` (trigger not yet registered); the panel is then appended last.\n   */\n  insertPanel(panel: HTMLElement, triggerHost: HTMLElement | null): void;\n}\n\n/**\n * Logical motion direction for `[forNavigationMenuContent]`'s\n * `data-motion` hook, computed from the relative DOM position of the\n * previously- and currently-active triggers. `null` (attribute absent)\n * when no comparison applies — first open, last close, or unknown values.\n */\nexport type ForNavigationMenuMotion = 'from-start' | 'from-end' | 'to-start' | 'to-end';\n\n/** Read surface `[forNavigationMenu]` publishes through {@link FOR_NAVIGATION_MENU_CONTEXT}. */\nexport interface ForNavigationMenuContext {\n  /**\n   * The open item's value, or `null` for none, as a read-only signal. Mutate it\n   * through `open` / `close` / `toggle` or the root's `[(value)]` binding — a\n   * direct write would skip the scheduled open / close delays.\n   */\n  readonly value: Signal<string | null>;\n  readonly orientation: Signal<'horizontal' | 'vertical'>;\n  readonly dir: Signal<WritingDirection>;\n  readonly loop: Signal<boolean>;\n  readonly disabled: Signal<boolean>;\n\n  isOpen(value: string): boolean;\n  /** Toggle the open item (open if closed, close if currently open). */\n  toggle(value: string): void;\n  /** Open the given item (no-op if already open). */\n  open(value: string): void;\n  /** Close any open item. */\n  close(): void;\n\n  /**\n   * Schedule open / close with the configured delays. Keyboard-driven changes\n   * (`reason`) skip the delays.\n   */\n  scheduleOpen(value: string, reason: NavigationMenuScheduleReason): void;\n  /**\n   * Schedule a hover close. Pass the leaving trigger's `value` so a quick\n   * hover-then-leave on a still-closed trigger cancels its own pending open;\n   * a pending open for a sibling (hover-across) is left to take over.\n   */\n  scheduleClose(reason: NavigationMenuScheduleReason, value?: string): void;\n  cancelPending(): void;\n\n  navigate(currentTrigger: HTMLElement, action: ListNavigationAction): void;\n  /** Focus the trigger associated with the given value, if any. */\n  focusTrigger(value: string): void;\n\n  /**\n   * Looks up the content id for a given item value. Reactive.\n   *\n   * Triggers and contents register synchronously in their constructors, so the\n   * pairing resolves during the first change-detection pass — including a real\n   * server render, where `afterNextRender` never fires and a deferred\n   * registration left the pre-hydration DOM without its `aria-controls` /\n   * `aria-labelledby` linkage. A handle whose owning `[forNavigationMenuItem]`\n   * has not had its `[value]` written yet reads the `unsetInput` sentinel and is\n   * skipped — it can never pair with a lookup value — and the tracked dependency\n   * re-runs the lookup once that binding lands.\n   */\n  contentIdFor(value: string): string | null;\n  /**\n   * Looks up the trigger id for a given item value. Reactive. Same\n   * synchronous-registration and not-yet-bound handling as\n   * {@link contentIdFor}.\n   */\n  triggerIdFor(value: string): string | null;\n  /**\n   * Looks up the trigger host element for a given item value. Reactive. Same\n   * synchronous-registration and not-yet-bound handling as\n   * {@link contentIdFor}.\n   */\n  triggerHostFor(value: string): HTMLElement | null;\n  /** Layout-oriented selector for indicator positioning. */\n  readonly activeTriggerHost: Signal<HTMLElement | null>;\n  /** Host element of the currently-active content, if any. */\n  readonly activeContentHost: Signal<HTMLElement | null>;\n  /** Most recent open value before the current one. `null` if none. */\n  readonly previousValue: Signal<string | null>;\n  /**\n   * Motion direction for `[forNavigationMenuContent]` whose item carries\n   * `value`. Returns `null` when no transition applies (first open, value\n   * not currently entering or leaving, indices unknown).\n   */\n  motionFor(value: string): ForNavigationMenuMotion | null;\n}\n\nexport type NavigationMenuScheduleReason = 'hover' | 'keyboard' | 'click';\n\n/**\n * The navigation menu's internal coordination surface: everything\n * {@link ForNavigationMenuContext} publishes plus the piece-registration\n * protocol and the surface-level focus delegation.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_NAVIGATION_MENU_CONTEXT} at, so a consumer who injects that token\n * gets the read surface while the pieces get the wiring protocol.\n * `ForNavigationMenu` declares the protocol members TS-`private` / `protected`,\n * which keeps them out of the emitted `.d.ts` while `useExisting` still\n * satisfies this contract at runtime.\n */\nexport interface NavigationMenuContext extends ForNavigationMenuContext {\n  registerTrigger(handle: ForNavigationMenuTriggerHandle): void;\n  unregisterTrigger(handle: ForNavigationMenuTriggerHandle): void;\n  registerContent(handle: ForNavigationMenuContentHandle): void;\n  unregisterContent(handle: ForNavigationMenuContentHandle): void;\n  registerViewport(handle: ForNavigationMenuViewportHandle): void;\n  unregisterViewport(handle: ForNavigationMenuViewportHandle): void;\n  /** Currently-registered viewport (at most one), or `null`. */\n  readonly viewport: Signal<ForNavigationMenuViewportHandle | null>;\n  /**\n   * Route a `focusout` observed anywhere on the widget's surface to the root,\n   * which acts on it only when the leave reports no destination\n   * (`relatedTarget === null`) — every other leave is owned by the dismissible\n   * layer's `'focus'` channel. `[forNavigationMenuContent]` delegates its own\n   * host's `focusout` here so such a leave is visible to the root even when a\n   * `[forNavigationMenuViewport]` re-parented the panel outside the `<nav>`.\n   */\n  handleSurfaceFocusOut(event: FocusEvent): void;\n}\n\n/** Per-item context, consumed by the trigger and content. */\nexport interface ForNavigationMenuItemContext {\n  /**\n   * The item's id, matched against the menu's `value`. Reads the `unsetInput`\n   * sentinel until the consumer's `[value]` binding is written — the root's\n   * lookups skip a handle in that state rather than throwing, which is what lets\n   * the trigger and content register synchronously. Guard with `isUnset` before\n   * letting the value leave a read site.\n   */\n  readonly value: Signal<string>;\n  /**\n   * The item's own `[disabled]`, without the root `[forNavigationMenu]`'s\n   * `disabled` folded in. The trigger composes the two into its\n   * `effectiveDisabled`.\n   */\n  readonly disabled: Signal<boolean>;\n}\n\n/**\n * DI token for the navigation menu's coordination surface, provided by\n * `[forNavigationMenu]`.\n *\n * Publicly typed as the read surface {@link ForNavigationMenuContext}, which is the whole\n * of what the token promises a consumer. The pieces read the same token at an internal type\n * that adds the registration protocol, so a wrapper re-providing it must alias it to the\n * root: `{ provide: FOR_NAVIGATION_MENU_CONTEXT, useExisting: MyNavigationMenu }`, where\n * `MyNavigationMenu` extends `ForNavigationMenu`. A value that merely satisfies the declared\n * type resolves too, and is rejected in dev mode by the first piece to reach the protocol.\n */\nexport const FOR_NAVIGATION_MENU_CONTEXT = new InjectionToken<ForNavigationMenuContext>(\n  'FOR_NAVIGATION_MENU_CONTEXT',\n);\n\nexport const FOR_NAVIGATION_MENU_ITEM_CONTEXT = new InjectionToken<ForNavigationMenuItemContext>(\n  'FOR_NAVIGATION_MENU_ITEM_CONTEXT',\n);\n\nexport function injectNavigationMenuContext(piece: string): NavigationMenuContext {\n  const ctx = inject(FOR_NAVIGATION_MENU_CONTEXT, {\n    optional: true,\n  }) as NavigationMenuContext | null;\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-NAVIGATION-MENU-001',\n      piece,\n      root: '[forNavigationMenu]',\n      token: 'FOR_NAVIGATION_MENU_CONTEXT',\n    });\n  }\n  assertRootContext({\n    entryPoint: 'navigation-menu',\n    token: 'FOR_NAVIGATION_MENU_CONTEXT',\n    root: '[forNavigationMenu]',\n    piece,\n    probe: () => ctx.registerTrigger,\n  });\n  return ctx;\n}\n\nexport function injectNavigationMenuItemContext(piece: string): ForNavigationMenuItemContext {\n  const ctx = inject(FOR_NAVIGATION_MENU_ITEM_CONTEXT, { optional: true });\n  if (!ctx) {\n    throw orphanContextError({\n      code: 'FORCDK-NAVIGATION-MENU-002',\n      piece,\n      root: '[forNavigationMenuItem]',\n      token: 'FOR_NAVIGATION_MENU_ITEM_CONTEXT',\n    });\n  }\n  return ctx;\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant navigation menus in the surrounding\n * injector scope. Configure with `provideForNavigationMenuDefaults` either\n * at the application root or in any component's `providers` array; partial\n * overrides merge with the parent scope.\n */\nexport interface ForNavigationMenuDefaults {\n  /** ms before a hover opens an item. */\n  openDelay: number;\n  /** ms before an item closes after hover leaves. */\n  closeDelay: number;\n  /**\n   * ms after a peer item closed during which the next open is instant.\n   * Keeps fluid hover-across-triggers feeling responsive.\n   */\n  skipDelayDuration: number;\n}\n\n/**\n * Library fallback for navigation menu defaults, read at the root injector when no\n * consumer has called `provideForNavigationMenuDefaults`. Exported for the shared defaults\n * contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_NAVIGATION_MENU_FALLBACK_DEFAULTS: ForNavigationMenuDefaults = {\n  openDelay: 200,\n  closeDelay: 150,\n  skipDelayDuration: 300,\n};\n\nconst { token, provideDefaults } = createDefaults<ForNavigationMenuDefaults>(\n  'FOR_NAVIGATION_MENU_DEFAULTS',\n  FOR_NAVIGATION_MENU_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved navigation-menu defaults for the current scope. */\nexport const FOR_NAVIGATION_MENU_DEFAULTS = token;\n\n/**\n * Configures forty-cdk navigation-menu defaults for this injector scope.\n * Partial overrides inherit unspecified keys from the parent scope (or\n * library defaults at the root).\n */\nexport function provideForNavigationMenuDefaults(\n  defaults: Partial<ForNavigationMenuDefaults> = {},\n): Provider[] {\n  return provideDefaults(defaults);\n}\n","import {\n  booleanAttribute,\n  computed,\n  DestroyRef,\n  Directive,\n  DOCUMENT,\n  ElementRef,\n  inject,\n  input,\n  linkedSignal,\n  model,\n  signal,\n  type Signal,\n} from '@angular/core';\n\nimport {\n  Collection,\n  createPointerSuppression,\n  type ListNavigationAction,\n  type WritingDirection,\n  isUnset,\n  nextEnabledHandle,\n  injectTextDirection,\n  hostAriaLabel,\n} from 'forty-cdk/core';\nimport {\n  injectDismissibleLayer,\n  createDebouncedAction,\n  createSkipDelayWindow,\n} from 'forty-cdk/core-overlay';\nimport {\n  FOR_NAVIGATION_MENU_CONTEXT,\n  type ForNavigationMenuContentHandle,\n  type ForNavigationMenuContext,\n  type ForNavigationMenuMotion,\n  type ForNavigationMenuTriggerHandle,\n  type ForNavigationMenuViewportHandle,\n  type NavigationMenuScheduleReason,\n} from './navigation-menu-context';\nimport { FOR_NAVIGATION_MENU_DEFAULTS } from './navigation-menu-defaults';\n\n/**\n * Headless implementation of the\n * [WAI-ARIA Disclosure Navigation Menu pattern](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/).\n *\n * Despite the name, this is a `<nav>` of disclosures — NOT an ARIA `menu`.\n * Triggers are buttons with `aria-expanded`, content is regular landmarks\n * with links inside; Tab moves through links; Escape closes the open item\n * and returns focus to its trigger.\n *\n * One item is open at a time. Selection is exposed as `value` (the open\n * item's id, or `null` when nothing is open). The `model()` change emitter\n * fires only on internal transitions, never on consumer writes.\n *\n * Nested submenus are out of scope for v1.\n *\n * @example\n * ```html\n * <nav forNavigationMenu aria-label=\"Main\">\n *   <ul forNavigationMenuList>\n *     <li forNavigationMenuItem value=\"products\">\n *       <button forNavigationMenuTrigger>Products</button>\n *       @if (products.isOpen()) {\n *         <div forNavigationMenuContent>…</div>\n *       }\n *     </li>\n *   </ul>\n * </nav>\n * ```\n */\n@Directive({\n  selector: '[forNavigationMenu]',\n  exportAs: 'forNavigationMenu',\n  host: {\n    '[attr.aria-label]': 'resolvedAriaLabel()',\n    '[attr.data-state]': 'value() === null ? \"closed\" : \"open\"',\n    '[attr.data-orientation]': 'orientation()',\n    '[attr.data-disabled]': 'disabled() ? \"\" : null',\n    '[attr.dir]': 'dir()',\n    '(focusout)': 'handleSurfaceFocusOut($event)',\n  },\n  providers: [{ provide: FOR_NAVIGATION_MENU_CONTEXT, useExisting: ForNavigationMenu }],\n})\nexport class ForNavigationMenu implements ForNavigationMenuContext {\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n  readonly #document = inject(DOCUMENT);\n  readonly #defaults = inject(FOR_NAVIGATION_MENU_DEFAULTS);\n  /**\n   * Two-way bindable. The id of the open item, or `null` for none. The\n   * `model()` change emitter (`(valueChange)`) fires only on internal\n   * transitions (trigger click, hover delay, Escape, outside click), never\n   * on consumer writes via `[(value)]`.\n   */\n  readonly value = model<string | null>(null);\n\n  /**\n   * Axis the arrow keys navigate between triggers. Reflected as `data-orientation`.\n   */\n  readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n  /**\n   * Writing direction. When unset (default `null`), the inherited ambient\n   * direction is resolved from the nearest ancestor carrying a `dir` attribute\n   * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n   * The resolved value is reflected to the host `dir` attribute and swaps\n   * ArrowLeft / ArrowRight semantics in RTL.\n   */\n  readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n  readonly dir = injectTextDirection(this._dirInput);\n  /**\n   * Whether arrow navigation wraps past the first / last enabled trigger.\n   */\n  readonly loop = input(true, { transform: booleanAttribute });\n  /**\n   * Whether every item in the navigation is disabled, so no panel can be opened.\n   */\n  readonly disabled = input(false, { transform: booleanAttribute });\n\n  /**\n   * Manual `aria-label` for the surrounding `<nav>`. Use this when no visible\n   * label element exists; otherwise prefer pointing `aria-labelledby` at one.\n   * A `null` (default) or empty value emits no attribute.\n   */\n  readonly ariaLabel = input<string | null>(null);\n\n  protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n  /**\n   * ms before a hover opens an item. Default `200`. The default is read from\n   * `provideForNavigationMenuDefaults` for the surrounding scope.\n   */\n  readonly openDelay = input<number>(this.#defaults.openDelay);\n\n  /**\n   * ms before an item closes after hover leaves. Default `150`. The default\n   * is read from `provideForNavigationMenuDefaults` for the surrounding\n   * scope.\n   */\n  readonly closeDelay = input<number>(this.#defaults.closeDelay);\n\n  /**\n   * ms after a peer item closed during which the next open is instant.\n   * Keeps fluid hover-across-triggers feeling responsive. Default `300`.\n   * The default is read from `provideForNavigationMenuDefaults` for the\n   * surrounding scope.\n   */\n  readonly skipDelayDuration = input<number>(this.#defaults.skipDelayDuration);\n\n  readonly #triggers = new Collection<ForNavigationMenuTriggerHandle>();\n  readonly #contents = new Collection<ForNavigationMenuContentHandle>();\n  readonly #viewport = signal<ForNavigationMenuViewportHandle | null>(null);\n\n  /** The `value` that was open before the current one, or `null`. */\n  readonly previousValue = linkedSignal<string | null, string | null>({\n    source: () => this.value(),\n    computation: (_current, prev) => prev?.source ?? null,\n  });\n\n  /**\n   * Frozen `data-motion` per mounted panel `value`. Recorded imperatively at\n   * each `open()` / `close()` transition — the entering panel and the panel\n   * that just started leaving — and left untouched for panels that began\n   * leaving in an earlier transition, so their direction stays stable for as\n   * long as `animate.leave` keeps them mounted. Cleared when a panel\n   * unmounts (`unregisterContent`) or re-enters as the current value.\n   *\n   * Backed by a `signal` holding an immutable `Map` so `motionFor` stays a\n   * pure, pull-based read — no state is propagated from an `effect()`.\n   */\n  readonly #motion = signal<ReadonlyMap<string, ForNavigationMenuMotion>>(new Map());\n\n  /** The value a pending hover-open is queued for (so a same-trigger leave can cancel it). */\n  #pendingOpenValue: string | null = null;\n  readonly #openAction = createDebouncedAction(() => {\n    const value = this.#pendingOpenValue;\n    this.#pendingOpenValue = null;\n    if (value !== null) {\n      this.open(value);\n    }\n  });\n  readonly #closeAction = createDebouncedAction(() => this.close());\n  readonly #skipDelayWindow = createSkipDelayWindow(this.skipDelayDuration);\n\n  readonly #dismiss = injectDismissibleLayer();\n\n  /**\n   * Short window opened by a pointerdown the dismissible layer resolved as\n   * *inside* the widget's surface, so a `null`-`relatedTarget` focusout that\n   * follows it is read as \"the press moved focus to nothing\" rather than as\n   * \"focus left the document\". Both leaves are indistinguishable from the\n   * `FocusEvent` alone — `document.activeElement` is `<body>` either way — and\n   * the pointer is the only thing that tells them apart.\n   */\n  readonly #surfacePointerDown = createPointerSuppression();\n\n  constructor() {\n    inject(DestroyRef).onDestroy(() => {\n      this.#cancelPending();\n      this.#skipDelayWindow.cancel();\n      this.#dismiss.deactivate();\n    });\n  }\n\n  isOpen(value: string): boolean {\n    return this.value() === value;\n  }\n\n  toggle(value: string): void {\n    if (this.disabled()) return;\n    if (this.value() === value) {\n      this.close();\n    } else {\n      this.open(value);\n    }\n  }\n\n  /**\n   * Opens the item with the given `value` and arms the dismissible layer.\n   *\n   * The layer owns both outside-interaction channels: `'pointer'` for an\n   * outside pointerdown and `'focus'` for a focus move landing outside the\n   * widget. The `'focus'` channel is what makes the APG close-on-leave rule\n   * work from anywhere in the widget rather than only from the trigger row — it\n   * observes `focusin` on the document, so it also fires for a panel that a\n   * `[forNavigationMenuViewport]` re-parented outside the `<nav>`, whose\n   * `focusout` never bubbles to the nav host. It is also the sole owner of every\n   * leave that reports a destination, which is what keeps the widget's\n   * containment rule single ({@link handleSurfaceFocusOut}). Both channels treat\n   * the nav host, the registered viewport and the active panel — plus any layer\n   * stacked above them — as inside, and the layer reports a press it resolved as\n   * *inside* that same set through `onPointerDownInside` — the one input\n   * {@link handleSurfaceFocusOut} needs to tell a pointer-induced blur from\n   * focus leaving the document.\n   */\n  open(value: string): void {\n    if (this.disabled()) return;\n    // The single write funnel into `value`, so it is where the `unsetInput`\n    // sentinel is stopped: a trigger whose `[forNavigationMenuItem]` has no\n    // `[value]` binding yet would otherwise commit the sentinel into the value\n    // model instead of failing (dev mode reports it through `assertInputBound`).\n    if (isUnset(value)) return;\n    this.#cancelPending();\n    if (this.value() === value) return;\n    this.#recordMotion(this.value(), value);\n    this.value.set(value);\n    this.#dismiss.activate({\n      channels: ['pointer', 'focus'],\n      exemptElements: () => this.#surfaceElements(),\n      onEscapeKeyDown: () => {\n        if (!this.#containsFocusTarget(this.#document.activeElement)) {\n          return;\n        }\n        const current = this.value();\n        this.close();\n        const trigger = current !== null ? this.triggerHostFor(current) : null;\n        trigger?.focus();\n      },\n      onPointerDownOutside: () => this.close(),\n      onPointerDownInside: () => this.#surfacePointerDown.suppress(),\n      onFocusOutside: () => this.close(),\n    });\n  }\n\n  close(): void {\n    this.#cancelPending();\n    if (this.value() === null) return;\n    this.#recordMotion(this.value(), null);\n    this.value.set(null);\n    this.#dismiss.deactivate();\n    this.#skipDelayWindow.start();\n  }\n\n  scheduleOpen(value: string, reason: NavigationMenuScheduleReason): void {\n    if (this.disabled()) return;\n    if (isUnset(value)) return;\n    this.#closeAction.cancel();\n    this.#clearOpenTimer();\n    if (this.value() === value) return;\n    if (reason === 'click' || reason === 'keyboard') {\n      this.open(value);\n      return;\n    }\n    this.#pendingOpenValue = value;\n    this.#openAction.schedule(this.#skipDelayWindow.active() ? 0 : this.openDelay());\n  }\n\n  scheduleClose(reason: NavigationMenuScheduleReason, value?: string): void {\n    if (reason === 'click' || reason === 'keyboard') {\n      this.#clearOpenTimer();\n      this.#closeAction.cancel();\n      this.close();\n      return;\n    }\n    if (this.#openAction.isPending()) {\n      // A hover-open is queued. If it is for the trigger we are leaving, cancel\n      // it so a quick hover-then-leave on a closed trigger doesn't open after\n      // the pointer is gone. If it is for a sibling (hover-across), leave it so\n      // that pending open takes over.\n      if (value !== undefined && this.#pendingOpenValue === value) {\n        this.#clearOpenTimer();\n      }\n      return;\n    }\n    this.#closeAction.cancel();\n    if (this.value() === null) return;\n    this.#closeAction.schedule(this.closeDelay());\n  }\n\n  cancelPending(): void {\n    this.#cancelPending();\n  }\n\n  /**\n   * Closes any open dropdown when focus leaves the navigation, per APG.\n   *\n   * Every leave that reports a destination is owned by the dismissible layer's `'focus'` channel\n   * and returns from here untouched, so \"did focus leave the widget?\" has one owner.\n   *\n   * This handler covers only the leave the layer cannot see: a `null` `relatedTarget`, which fires\n   * no `focusin` at all — focus leaving the document, or landing on a non-focusable area. It runs\n   * on both the nav host and `[forNavigationMenuContent]`, since a `focusout` inside a panel\n   * re-parented by `[forNavigationMenuViewport]` never bubbles to the `<nav>`.\n   *\n   * Because a `null` `relatedTarget` says nothing about where focus went, the decision is deferred\n   * one microtask and taken against `document.activeElement` once focus has settled.\n   *\n   * Focus landing on `<body>` is ambiguous — it looks the same whether the user tabbed out of the\n   * document or pressed a non-focusable region inside the widget. The layer resolves that press\n   * against the same containment set and reports it through `onPointerDownInside`, so a\n   * pointer-induced blur does not dismiss a panel the user is still interacting with.\n   */\n  protected handleSurfaceFocusOut(event: FocusEvent): void {\n    if (this.value() === null) {\n      return;\n    }\n    if (event.relatedTarget !== null) {\n      return;\n    }\n    queueMicrotask(() => this.#closeIfFocusLeftSurface());\n  }\n\n  #closeIfFocusLeftSurface(): void {\n    if (this.value() === null) {\n      return;\n    }\n    if (this.#surfacePointerDown.isSuppressed()) {\n      return;\n    }\n    if (this.#containsFocusTarget(this.#document.activeElement)) {\n      return;\n    }\n    this.close();\n  }\n\n  #containsFocusTarget(node: Node | null): boolean {\n    if (!node) {\n      return false;\n    }\n    if (this.#host.nativeElement.contains(node)) {\n      return true;\n    }\n    return this.#surfaceElements().some((el) => el.contains(node));\n  }\n\n  #surfaceElements(): readonly HTMLElement[] {\n    const elements: HTMLElement[] = [];\n    const viewport = this.#viewport();\n    if (viewport) {\n      elements.push(viewport.host);\n    }\n    const content = this.activeContentHost();\n    if (content) {\n      elements.push(content);\n    }\n    return elements;\n  }\n\n  navigate(currentTrigger: HTMLElement, action: ListNavigationAction): void {\n    if (this.disabled()) return;\n    const target = nextEnabledHandle(this.#triggers.items(), currentTrigger, action, {\n      loop: this.loop(),\n    });\n    if (target === null) {\n      return;\n    }\n    target.host.focus();\n    target.host.scrollIntoView?.({ block: 'nearest' });\n  }\n\n  focusTrigger(value: string): void {\n    const host = this.triggerHostFor(value);\n    if (!host) {\n      return;\n    }\n    host.focus();\n    host.scrollIntoView?.({ block: 'nearest' });\n  }\n\n  private registerTrigger(handle: ForNavigationMenuTriggerHandle): void {\n    this.#triggers.register(handle);\n  }\n  private unregisterTrigger(handle: ForNavigationMenuTriggerHandle): void {\n    this.#triggers.unregister(handle);\n  }\n  private registerContent(handle: ForNavigationMenuContentHandle): void {\n    this.#contents.register(handle);\n  }\n  private unregisterContent(handle: ForNavigationMenuContentHandle): void {\n    this.#contents.unregister(handle);\n    this.#clearMotion(handle.value());\n  }\n  private registerViewport(handle: ForNavigationMenuViewportHandle): void {\n    this.#viewport.set(handle);\n  }\n  private unregisterViewport(handle: ForNavigationMenuViewportHandle): void {\n    if (this.#viewport() === handle) {\n      this.#viewport.set(null);\n    }\n  }\n  private readonly viewport: Signal<ForNavigationMenuViewportHandle | null> =\n    this.#viewport.asReadonly();\n\n  contentIdFor(value: string): string | null {\n    for (const c of this.#contents.items()) {\n      const candidate = c.value();\n      if (!isUnset(candidate) && candidate === value) {\n        return c.id();\n      }\n    }\n    return null;\n  }\n\n  triggerIdFor(value: string): string | null {\n    for (const t of this.#triggers.items()) {\n      const candidate = t.value();\n      if (!isUnset(candidate) && candidate === value) {\n        return t.id();\n      }\n    }\n    return null;\n  }\n\n  triggerHostFor(value: string): HTMLElement | null {\n    for (const t of this.#triggers.items()) {\n      const candidate = t.value();\n      if (!isUnset(candidate) && candidate === value) {\n        return t.host;\n      }\n    }\n    return null;\n  }\n\n  /** Layout-oriented selectors for indicator positioning. */\n  readonly activeTriggerHost = computed<HTMLElement | null>(() => {\n    const v = this.value();\n    if (v === null) return null;\n    for (const t of this.#triggers.items()) {\n      const candidate = t.value();\n      if (!isUnset(candidate) && candidate === v) return t.host;\n    }\n    return null;\n  });\n\n  /** Currently-active content's host element, if mounted. */\n  readonly activeContentHost = computed<HTMLElement | null>(() => {\n    const v = this.value();\n    if (v === null) return null;\n    for (const c of this.#contents.items()) {\n      const candidate = c.value();\n      if (!isUnset(candidate) && candidate === v) return c.host;\n    }\n    return null;\n  });\n\n  /**\n   * `data-motion` direction for the content with the given `value`, so entering and leaving panels\n   * shift in the same logical direction like a carousel advancing.\n   *\n   * - The entering content reflects `from-start` / `from-end`, based on which side the previous\n   *   trigger sat on relative to it.\n   * - A leaving content reflects `to-start` / `to-end`, frozen at the transition that started its\n   *   exit and stable for as long as the panel stays mounted, so overlapping `animate.leave`\n   *   transitions never lose a panel's direction.\n   * - Anything else returns `null` and the host emits no attribute, including the first open and\n   *   last close, where there is no peer to compare against.\n   *\n   * \"Start\" and \"end\" are logical — index 0 in DOM order is start, which is visually on the right\n   * under `dir=\"rtl\"` — so keyframes authored with logical CSS flip automatically.\n   */\n  motionFor(value: string): ForNavigationMenuMotion | null {\n    if (value === this.value()) {\n      return this.#enterMotion(this.previousValue(), value);\n    }\n    return this.#motion().get(value) ?? null;\n  }\n\n  /**\n   * Record the frozen motion for a `from` → `to` transition: the entering\n   * `to` panel and the leaving `from` panel. Existing entries for other\n   * still-leaving panels are preserved so overlapping exits keep their\n   * direction. `to`'s own stale leaving entry is dropped (it is re-entering).\n   */\n  #recordMotion(from: string | null, to: string | null): void {\n    const next = new Map(this.#motion());\n    if (to !== null) {\n      const enter = this.#enterMotion(from, to);\n      if (enter === null) next.delete(to);\n      else next.set(to, enter);\n    }\n    if (from !== null) {\n      const leave = this.#leaveMotion(from, to);\n      if (leave === null) next.delete(from);\n      else next.set(from, leave);\n    }\n    this.#motion.set(next);\n  }\n\n  #clearMotion(value: string): void {\n    if (!this.#motion().has(value)) return;\n    const next = new Map(this.#motion());\n    next.delete(value);\n    this.#motion.set(next);\n  }\n\n  /** Entering direction for `to` given the panel `from` it replaced. */\n  #enterMotion(from: string | null, to: string): ForNavigationMenuMotion | null {\n    if (from === null || from === to) return null;\n    const fromIndex = this.#triggerIndexFor(from);\n    const toIndex = this.#triggerIndexFor(to);\n    if (fromIndex < 0 || toIndex < 0) return null;\n    if (fromIndex < toIndex) return 'from-end';\n    if (fromIndex > toIndex) return 'from-start';\n    return null;\n  }\n\n  /** Leaving direction for `from` given the panel `to` that replaced it. */\n  #leaveMotion(from: string, to: string | null): ForNavigationMenuMotion | null {\n    if (to === null || to === from) return null;\n    const fromIndex = this.#triggerIndexFor(from);\n    const toIndex = this.#triggerIndexFor(to);\n    if (fromIndex < 0 || toIndex < 0) return null;\n    if (toIndex > fromIndex) return 'to-start';\n    if (toIndex < fromIndex) return 'to-end';\n    return null;\n  }\n\n  #triggerIndexFor(value: string): number {\n    const triggers = this.#triggers.items();\n    for (let i = 0; i < triggers.length; i++) {\n      const candidate = triggers[i]!.value();\n      if (!isUnset(candidate) && candidate === value) return i;\n    }\n    return -1;\n  }\n\n  #cancelPending(): void {\n    this.#clearOpenTimer();\n    this.#closeAction.cancel();\n  }\n\n  #clearOpenTimer(): void {\n    this.#openAction.cancel();\n    this.#pendingOpenValue = null;\n  }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectNavigationMenuContext } from './navigation-menu-context';\n\n/**\n * Wrapper around the row / column of items. Carries `data-orientation` so\n * the consumer can flip CSS layout. No semantic role — this is a layout\n * helper, not a `menubar` (the disclosure pattern doesn't use one).\n */\n@Directive({\n  selector: '[forNavigationMenuList]',\n  exportAs: 'forNavigationMenuList',\n  host: {\n    '[attr.data-orientation]': 'ctx.orientation()',\n  },\n})\nexport class ForNavigationMenuList {\n  protected readonly ctx = injectNavigationMenuContext('ForNavigationMenuList');\n}\n","import { booleanAttribute, computed, Directive, input } from '@angular/core';\n\nimport { assertInputBound, unsetInput } from 'forty-cdk/core';\nimport {\n  FOR_NAVIGATION_MENU_ITEM_CONTEXT,\n  type ForNavigationMenuItemContext,\n  injectNavigationMenuContext,\n} from './navigation-menu-context';\n\n/**\n * Wrapper around one trigger + its content. Owns the item's `value` (the\n * id used to coordinate which item is open) and its disabled state, then\n * exposes them downstream so the trigger and content can share a single\n * source of truth.\n */\n@Directive({\n  selector: '[forNavigationMenuItem]',\n  exportAs: 'forNavigationMenuItem',\n  host: {\n    '[attr.data-state]': 'state()',\n    '[attr.data-disabled]': 'disabled() ? \"\" : null',\n  },\n  providers: [\n    {\n      provide: FOR_NAVIGATION_MENU_ITEM_CONTEXT,\n      useExisting: ForNavigationMenuItem,\n    },\n  ],\n})\nexport class ForNavigationMenuItem implements ForNavigationMenuItemContext {\n  readonly #ctx = injectNavigationMenuContext('ForNavigationMenuItem');\n\n  /**\n   * Identifier matched against the menu's `value`, shared by this item's trigger and content.\n   * Mandatory — an unbound item throws in dev mode.\n   *\n   * That seeding is what lets both pieces register **synchronously**: the\n   * pairing then resolves during the first change-detection pass, including a\n   * real server render, where `afterNextRender` never fires and a deferred\n   * registration would leave the pre-hydration DOM without its\n   * `aria-controls` / `aria-labelledby` linkage.\n   */\n  readonly value = input(unsetInput<string>());\n\n  /**\n   * Per-item disabled. Stands on its own — the root `[forNavigationMenu]`'s\n   * `disabled` is merged with this value by the item's trigger\n   * (`ForNavigationMenuTrigger.effectiveDisabled`), which is what reflects the\n   * composed state and gates activation. This host's `data-disabled` reflects\n   * the per-item value only.\n   */\n  readonly disabled = input(false, { transform: booleanAttribute });\n\n  protected readonly state = computed(() => (this.#ctx.isOpen(this.value()) ? 'open' : 'closed'));\n\n  constructor() {\n    assertInputBound(this.value, 'navigation-menu', '[forNavigationMenuItem]', 'value');\n  }\n}\n","import { computed, Directive, ElementRef, inject, type Signal } from '@angular/core';\n\nimport {\n  hostButtonType,\n  registerHandle,\n  hostId,\n  isHoverCapablePointer,\n  resolveListNavigation,\n} from 'forty-cdk/core';\nimport {\n  injectNavigationMenuContext,\n  injectNavigationMenuItemContext,\n} from './navigation-menu-context';\n\n/**\n * Disclosure trigger. Apply on `<button>`. Mouse hover / click open the paired\n * `[forNavigationMenuContent]`; arrow keys move focus across siblings;\n * ArrowDown (horizontal) / ArrowRight (vertical) open; Escape closes;\n * Enter / Space toggle.\n *\n * Per the APG disclosure-navigation pattern this does NOT open on plain\n * focus: Tabbing across the trigger row must not auto-expand panels, and a\n * programmatic return-focus (e.g. after Escape) must not synchronously\n * re-open the panel that just closed.\n *\n * Hover is a mouse affordance: the `pointerenter` / `pointerleave` path is\n * gated to hover-capable pointers, so a touch or pen tap drives the panel\n * through the native `click` instead of opening it mid-press.\n *\n * `aria-controls` is emitted only while the item is open, and only once the\n * paired `[forNavigationMenuContent]` has registered — an id that cannot be\n * resolved emits no attribute rather than an empty one, so the reference never\n * dangles (mirroring `[forAccordionTrigger]` and the carousel arrows).\n *\n * Disabling: {@link effectiveDisabled} merges the owning\n * `[forNavigationMenuItem]`'s `[disabled]` with the root\n * `[forNavigationMenu]`'s. It is reflected through a single channel,\n * `aria-disabled=\"true\"` + `data-disabled`, and enforced by the click / hover /\n * keyboard guards; arrow navigation skips the trigger. The native `disabled`\n * attribute is NOT emitted: every trigger is its\n * own tab stop in this pattern, so a disabled trigger stays focusable and\n * announceable instead of vanishing from the trigger row — which a menu-level\n * `disabled` would otherwise do to the entire nav.\n */\n@Directive({\n  selector: '[forNavigationMenuTrigger]',\n  exportAs: 'forNavigationMenuTrigger',\n  host: {\n    '[attr.type]': 'buttonType()',\n    '[id]': 'id()',\n    '[attr.aria-expanded]': 'isOpen() ? \"true\" : \"false\"',\n    '[attr.aria-controls]': 'isOpen() ? contentId() : null',\n    '[attr.aria-disabled]': 'effectiveDisabled() ? \"true\" : null',\n    '[attr.data-state]': 'isOpen() ? \"open\" : \"closed\"',\n    '[attr.data-disabled]': 'effectiveDisabled() ? \"\" : null',\n    '(click)': 'onClick()',\n    '(pointerenter)': 'onPointerEnter($event)',\n    '(pointerleave)': 'onPointerLeave($event)',\n    '(keydown)': 'onKeyDown($event)',\n  },\n})\nexport class ForNavigationMenuTrigger {\n  protected readonly buttonType = hostButtonType();\n\n  protected readonly menu = injectNavigationMenuContext('ForNavigationMenuTrigger');\n  readonly #item = injectNavigationMenuItemContext('ForNavigationMenuTrigger');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n  readonly id = hostId('for-navigation-menu-trigger');\n  protected readonly value: Signal<string> = this.#item.value;\n\n  /**\n   * Effective disabled state: the owning `[forNavigationMenuItem]`'s\n   * `[disabled]` OR the root `[forNavigationMenu]`'s `disabled`. Everything\n   * that gates on the trigger's disabled state reads this — the\n   * `aria-disabled` / `data-disabled` reflection, the click / hover / keyboard\n   * guards, and the arrow-navigation skip.\n   */\n  readonly effectiveDisabled: Signal<boolean> = computed(\n    () => this.#item.disabled() || this.menu.disabled(),\n  );\n\n  protected readonly isOpen = computed(() => this.menu.isOpen(this.value()));\n  protected readonly contentId = computed(() => this.menu.contentIdFor(this.value()));\n\n  constructor() {\n    const handle = {\n      host: this.#host.nativeElement,\n      value: this.value,\n      disabled: this.effectiveDisabled,\n      id: this.id,\n    };\n    // Registered synchronously so the parent's `triggerIdFor` / `contentIdFor` /\n    // `triggerHostFor` lookups resolve during the same pass that renders the\n    // pairing. A deferred registration is invisible to a server render, where\n    // `afterNextRender` never fires — which is what shipped `aria-controls=\"\"`\n    // on the trigger and no `aria-labelledby` on the panel\n    // ([#1409](https://github.com/tutkli/forty-cdk/issues/1409) is the same\n    // failure class in Tabs). The lookups can read `handle.value()` safely\n    // because the owning `[forNavigationMenuItem]`'s `value` is seeded with the\n    // `unsetInput` sentinel instead of being declared `input.required`, so a\n    // lookup running before that binding is written skips the handle rather\n    // than throwing.\n    registerHandle(\n      handle,\n      (h) => this.menu.registerTrigger(h),\n      (h) => this.menu.unregisterTrigger(h),\n    );\n  }\n\n  protected onClick(): void {\n    if (this.effectiveDisabled()) return;\n    this.menu.toggle(this.value());\n  }\n\n  protected onPointerEnter(event: PointerEvent): void {\n    if (!isHoverCapablePointer(event)) return;\n    if (this.effectiveDisabled()) return;\n    this.menu.scheduleOpen(this.value(), 'hover');\n  }\n\n  protected onPointerLeave(event: PointerEvent): void {\n    if (!isHoverCapablePointer(event)) return;\n    if (this.effectiveDisabled()) return;\n    this.menu.scheduleClose('hover', this.value());\n  }\n\n  protected onKeyDown(event: KeyboardEvent): void {\n    if (this.effectiveDisabled()) return;\n    // Activation: Enter / Space toggle the disclosure.\n    if (event.key === 'Enter' || event.key === ' ') {\n      event.preventDefault();\n      this.menu.toggle(this.value());\n      return;\n    }\n    if (event.key === 'Escape' && this.isOpen()) {\n      event.preventDefault();\n      event.stopPropagation();\n      this.menu.close();\n      this.#host.nativeElement.focus();\n      return;\n    }\n    // Cross-axis arrow opens, main-axis arrows navigate.\n    const orientation = this.menu.orientation();\n    const action = resolveListNavigation(event, {\n      orientation,\n      dir: this.menu.dir(),\n    });\n    if (action) {\n      event.preventDefault();\n      this.menu.navigate(this.#host.nativeElement, action);\n      return;\n    }\n    // ArrowDown (horizontal) / ArrowRight (vertical) opens the disclosure.\n    const openKey = orientation === 'horizontal' ? 'ArrowDown' : 'ArrowRight';\n    if (event.key === openKey) {\n      event.preventDefault();\n      this.menu.scheduleOpen(this.value(), 'keyboard');\n    }\n  }\n}\n","import {\n  afterNextRender,\n  computed,\n  Directive,\n  effect,\n  ElementRef,\n  inject,\n  type Signal,\n  signal,\n} from '@angular/core';\n\nimport { registerHandle, hostId, hostLabelledBy, isHoverCapablePointer } from 'forty-cdk/core';\nimport { warnIfMountedWhileClosed } from 'forty-cdk/core-overlay';\nimport {\n  injectNavigationMenuContext,\n  injectNavigationMenuItemContext,\n} from './navigation-menu-context';\n\n/**\n * The disclosure panel for a navigation-menu item. Mounted via `@if`\n * (consumer drives it from `forNavigationMenu.value()` or\n * `forNavigationMenuItem`'s state) so animations work natively.\n *\n * Carries `aria-labelledby` pointing at the trigger and reflects\n * `data-state` for CSS hooks. A consumer-set **static** `aria-labelledby` on\n * the panel wins over that fallback and is preserved. No focus management is\n * imposed — content\n * is a regular landmark; Tab moves through links inside, then out to the\n * next focusable element after the wrapper.\n *\n * When a `[forNavigationMenuViewport]` is present in the menu, the host\n * element re-parents itself into the viewport on mount so all active\n * panels share a single animated surface (mega-menu pattern). The viewport\n * owns the ordering: each panel is inserted in its trigger's document\n * order, never simply appended in mount order. So during an overlapping\n * A→B transition — where the leaving A is still mounted (its\n * `animate.leave` keeps it around) while B enters — the viewport's child\n * order is deterministic and always matches trigger order: the panel whose\n * trigger comes first in the DOM is the first child, irrespective of which\n * panel mounted last. Cross-fade / slide carousels can therefore author\n * their stacking against trigger order (pair it with `data-motion`). The\n * directive does not undo the re-parent on destroy: the consumer's `@if`\n * is destroying the element anyway, and Angular's renderer removes nodes\n * by their actual current parent.\n *\n * `data-motion` is reflected (`from-start | from-end | to-start | to-end`)\n * for CSS keyframes that slide the entering and leaving panels together\n * during a transition.\n *\n * The host's `focusout` is delegated to the root, which acts on it only for a\n * leave that reports no destination (`relatedTarget === null`); every other\n * leave belongs to the dismissible layer's `'focus'` channel. This host is the\n * panel itself, so such a leave fired inside it always reaches the root — which\n * is what makes the rule independent of where a `[forNavigationMenuViewport]`\n * re-parented the panel: an externally-hosted panel's `focusout` never bubbles\n * to the `<nav>`.\n */\n@Directive({\n  selector: '[forNavigationMenuContent]',\n  exportAs: 'forNavigationMenuContent',\n  host: {\n    '[id]': 'id()',\n    '[attr.aria-labelledby]': 'labelledBy()',\n    '[attr.data-state]': 'menu.isOpen(value()) ? \"open\" : \"closed\"',\n    '[attr.data-motion]': 'motion()',\n    '(pointerenter)': 'onPointerEnter($event)',\n    '(pointerleave)': 'onPointerLeave($event)',\n    '(focusout)': 'menu.handleSurfaceFocusOut($event)',\n    '(keydown.escape)': 'onEscape($any($event))',\n  },\n})\nexport class ForNavigationMenuContent {\n  protected readonly menu = injectNavigationMenuContext('ForNavigationMenuContent');\n  readonly #item = injectNavigationMenuItemContext('ForNavigationMenuContent');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n  readonly id = hostId('for-navigation-menu-content');\n  protected readonly value: Signal<string> = this.#item.value;\n  protected readonly labelledBy = hostLabelledBy(() => this.menu.triggerIdFor(this.value()));\n  protected readonly motion = computed(() => this.menu.motionFor(this.value()));\n\n  readonly #mounted = signal(false);\n\n  constructor() {\n    const handle = {\n      host: this.#host,\n      value: this.value,\n      id: this.id,\n    };\n    // Registered synchronously so the trigger's `contentIdFor` lookup — and this\n    // panel's own `aria-labelledby` — resolve during the same pass that renders\n    // them, including a server render, where `afterNextRender` never fires and a\n    // deferred registration left the pre-hydration DOM unpaired\n    // ([#1409](https://github.com/tutkli/forty-cdk/issues/1409) is the same\n    // failure class in Tabs). The parent's lookups can read `handle.value()`\n    // safely because the owning `[forNavigationMenuItem]`'s `value` is seeded\n    // with the `unsetInput` sentinel instead of being declared `input.required`,\n    // so a lookup running before that binding is written skips the handle rather\n    // than throwing.\n    registerHandle(\n      handle,\n      (h) => this.menu.registerContent(h),\n      (h) => this.menu.unregisterContent(h),\n    );\n\n    warnIfMountedWhileClosed({\n      primitive: 'navigation-menu',\n      piece: '[forNavigationMenuContent]',\n      // A thunk, so the quoted fix carries this panel's own value rather than a\n      // placeholder — `value` is the owning item's binding, which the consumer\n      // has written by the time the helper's render hook runs (before that it\n      // reads the `unsetInput` sentinel).\n      condition: () => `open() === '${this.value()}'`,\n      open: () => this.menu.isOpen(this.value()),\n    });\n\n    // Defer the re-parent until after the embedded view is attached to its\n    // template anchor — Angular inserts root nodes AFTER directive\n    // constructors run, so an `appendChild` here would be undone. Running\n    // it in `afterNextRender` happens before browser paint, so the move is\n    // not visible. The viewport owns ordering: it inserts this panel in its\n    // trigger's document order, so an overlapping A→B transition keeps a\n    // deterministic child order regardless of which panel mounted last.\n    afterNextRender(() => {\n      this.#reparent();\n      this.#mounted.set(true);\n    });\n\n    // Re-parent (and re-order) the panel reactively once mounted.\n    // `triggerHostFor` reads the menu's trigger collection, so this re-runs\n    // whenever this panel's trigger registers or unregisters — closing the\n    // race where the trigger is not yet resolvable when the content mounts\n    // (its item's `value` binding may still be unwritten, so the lookup skips\n    // it). Until the trigger is known the panel sorts last; once it resolves\n    // the viewport re-orders it into trigger document order. The re-parent is a\n    // DOM side effect on the imperative viewport handle (no signal writes), and\n    // it waits for `#mounted` so it never runs before `afterNextRender` has\n    // attached the panel under the viewport.\n    //\n    // Note: the trigger collection is backed by a `MutationObserver`, and this\n    // very `appendChild` re-parent mutates the observed subtree, so the\n    // collection can re-notify and re-run this effect a second time. That extra\n    // pass is EXPECTED and harmless — `insertPanel` / `#reorder` are idempotent\n    // (a node already in its target slot is left untouched), so the re-run is a\n    // no-op. Do not \"fix\" the idempotency away to suppress it: the convergence\n    // it guarantees is what makes the registration race self-heal.\n    effect(() => {\n      if (!this.#mounted()) return;\n      this.#reparent();\n    });\n  }\n\n  #reparent(): void {\n    const viewport = this.menu.viewport();\n    if (!viewport) return;\n    viewport.insertPanel(this.#host, this.menu.triggerHostFor(this.value()));\n  }\n\n  protected onPointerEnter(event: PointerEvent): void {\n    if (!isHoverCapablePointer(event)) return;\n    this.menu.cancelPending();\n  }\n\n  protected onPointerLeave(event: PointerEvent): void {\n    if (!isHoverCapablePointer(event)) return;\n    this.menu.scheduleClose('hover');\n  }\n\n  protected onEscape(event: KeyboardEvent): void {\n    event.preventDefault();\n    event.stopPropagation();\n    const v = this.value();\n    this.menu.close();\n    this.menu.focusTrigger(v);\n  }\n}\n","import { booleanAttribute, Directive, input } from '@angular/core';\n\n/**\n * Decorative marker for links inside a navigation-menu content. Reflects\n * `data-active` for CSS hooks (the consumer flips it based on the\n * router's current URL — the directive doesn't know about routing).\n *\n * Apply on `<a>`.\n */\n@Directive({\n  selector: '[forNavigationMenuLink]',\n  exportAs: 'forNavigationMenuLink',\n  host: {\n    '[attr.data-active]': 'active() ? \"\" : null',\n    '[attr.aria-current]': 'active() ? ariaCurrent() : null',\n  },\n})\nexport class ForNavigationMenuLink {\n  /** When true, this link points at the current page. Reflects `aria-current`. */\n  readonly active = input(false, { transform: booleanAttribute });\n\n  /**\n   * Value forwarded to `aria-current` when `active` is true. Defaults to\n   * `'page'` (the most common case for top-level navigation).\n   */\n  readonly ariaCurrent = input<'page' | 'step' | 'location' | 'date' | 'time' | 'true'>('page');\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n  afterNextRender,\n  computed,\n  DestroyRef,\n  Directive,\n  effect,\n  ElementRef,\n  inject,\n  PLATFORM_ID,\n  signal,\n} from '@angular/core';\n\nimport { injectNavigationMenuContext } from './navigation-menu-context';\n\n/**\n * Optional visual indicator (underline, pill) that follows the active\n * trigger. Computes geometry from the trigger's position relative to\n * `[forNavigationMenuList]` and exposes it via CSS custom properties:\n *\n * - `--for-navigation-menu-indicator-x` — horizontal offset (px)\n * - `--for-navigation-menu-indicator-y` — vertical offset (px)\n * - `--for-navigation-menu-indicator-width` — trigger width (px)\n * - `--for-navigation-menu-indicator-height` — trigger height (px)\n *\n * Drive `transform` / `width` / `height` from these in CSS. The directive\n * is decorative — set `aria-hidden=\"true\"` on the host element if\n * needed.\n *\n * Geometry is re-measured reactively, not on every render: a `ResizeObserver`\n * (browser-only) watches the active trigger and the surrounding list and bumps\n * a measure-tick signal, and the offset / size are recomputed only when the\n * active trigger changes or one of those boxes resizes. `afterNextRender`\n * covers the initial measure once the host is in the DOM.\n */\n@Directive({\n  selector: '[forNavigationMenuIndicator]',\n  exportAs: 'forNavigationMenuIndicator',\n  host: {\n    'aria-hidden': 'true',\n    '[attr.data-state]': 'state()',\n    '[attr.data-orientation]': 'menu.orientation()',\n    '[style.--for-navigation-menu-indicator-x.px]': 'x()',\n    '[style.--for-navigation-menu-indicator-y.px]': 'y()',\n    '[style.--for-navigation-menu-indicator-width.px]': 'width()',\n    '[style.--for-navigation-menu-indicator-height.px]': 'height()',\n  },\n})\nexport class ForNavigationMenuIndicator {\n  protected readonly menu = injectNavigationMenuContext('ForNavigationMenuIndicator');\n  readonly #host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n  readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n  readonly #measureTick = signal(0);\n\n  readonly #geometry = computed<{ x: number; y: number; width: number; height: number }>(() => {\n    // Depend on the manual tick so ResizeObserver callbacks invalidate the\n    // geometry, and on the active trigger so a trigger switch re-measures.\n    this.#measureTick();\n    // Browser-only: `getBoundingClientRect` is a layout API, and the DOM\n    // `@angular/platform-server` runs on (domino) does not implement it at all —\n    // so an ungated read throws a `TypeError` on Angular Universal rather than\n    // returning zeros. jsdom does implement it, which is why the SSR smoke suite\n    // cannot see this. Reachable since triggers register synchronously\n    // ([#1636](https://github.com/tutkli/forty-cdk/issues/1636)): before that\n    // `activeTriggerHost()` was always `null` server-side, so the early return\n    // below hid the call by accident.\n    if (!this.#isBrowser) {\n      return { x: 0, y: 0, width: 0, height: 0 };\n    }\n    const trigger = this.menu.activeTriggerHost();\n    const list = this.#host.parentElement;\n    if (!trigger || !list) {\n      return { x: 0, y: 0, width: 0, height: 0 };\n    }\n    const tr = trigger.getBoundingClientRect();\n    const lr = list.getBoundingClientRect();\n    return { x: tr.left - lr.left, y: tr.top - lr.top, width: tr.width, height: tr.height };\n  });\n\n  protected readonly x = computed(() => this.#geometry().x);\n  protected readonly y = computed(() => this.#geometry().y);\n  protected readonly width = computed(() => this.#geometry().width);\n  protected readonly height = computed(() => this.#geometry().height);\n\n  protected readonly state = computed(() => (this.menu.activeTriggerHost() ? 'visible' : 'hidden'));\n\n  constructor() {\n    // Initial measure once the host (and its list parent) are attached.\n    afterNextRender(() => this.#measureTick.update((t) => t + 1));\n\n    if (this.#isBrowser && typeof ResizeObserver !== 'undefined') {\n      const ro = new ResizeObserver(() => this.#measureTick.update((t) => t + 1));\n      const list = this.#host.parentElement;\n      if (list) {\n        ro.observe(list);\n      }\n\n      // Follow the active trigger: observe it for size changes and re-measure\n      // on every switch. Pure side effect on the imperative ResizeObserver — no\n      // signal writes from this effect.\n      let observed: HTMLElement | null = null;\n      effect(() => {\n        const active = this.menu.activeTriggerHost();\n        if (observed && observed !== active) {\n          ro.unobserve(observed);\n          observed = null;\n        }\n        if (active && active !== observed) {\n          ro.observe(active);\n          observed = active;\n        }\n      });\n\n      inject(DestroyRef).onDestroy(() => ro.disconnect());\n    }\n  }\n}\n","import {\n  PLATFORM_ID,\n  computed,\n  DestroyRef,\n  Directive,\n  effect,\n  ElementRef,\n  inject,\n  signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport {\n  type ForNavigationMenuViewportHandle,\n  injectNavigationMenuContext,\n} from './navigation-menu-context';\n\n/**\n * Optional shared surface for mega-menu style navigation. When present,\n * `[forNavigationMenuContent]` re-parents itself into this host on mount,\n * so all active content panels live inside a single visual container that\n * can animate width/height between trigger groups.\n *\n * The viewport exposes the active content's natural size as CSS custom\n * properties:\n *\n * - `--for-navigation-menu-viewport-width` (px)\n * - `--for-navigation-menu-viewport-height` (px)\n *\n * Drive `width` / `height` from these in CSS to get fluid resize between\n * panels. The directive is a real interactive surface (it hosts the\n * focusable content), so `aria-hidden=\"false\"` is reflected explicitly to\n * counteract any wrapper that defaults to hidden.\n *\n * Two panels can briefly co-exist inside the viewport during a transition, since a leaving panel\n * stays mounted for as long as the consumer's `@if` keeps it, so a cross-fade or slide is possible.\n * Mount lifecycle stays with the consumer's template; this directive only re-parents and measures.\n *\n * Panels are inserted in their triggers' document order rather than in mount order, so during an\n * overlapping transition the panel whose trigger comes first is always the viewport's first child.\n * That gives carousels a deterministic axis to author against — pair it with the `data-motion` hook\n * on the content.\n *\n * Measurement follows the active panel only, so a panel kept mounted by `animate.leave` no longer\n * drives the viewport box, and the exposed variables reflect the entering panel as soon as it\n * becomes active.\n *\n * **Avoid a measurement feedback loop.** The variables are measured from the active content panel,\n * but the `ResizeObserver` also watches the host so a surrounding column resize is picked up. Do\n * not drive the host's own measured dimension from these variables while the host's box constrains\n * the panel's — a measure tick's CSS output would feed back into the next observation. Apply them\n * on a wrapper, or transition them on the host without coupling them to the measured child's size.\n *\n * @example\n * ```html\n * <nav forNavigationMenu [(value)]=\"open\">\n *   <ul forNavigationMenuList>…</ul>\n *   <div forNavigationMenuViewport></div>\n * </nav>\n * ```\n */\n@Directive({\n  selector: '[forNavigationMenuViewport]',\n  exportAs: 'forNavigationMenuViewport',\n  host: {\n    'aria-hidden': 'false',\n    '[attr.data-state]': 'state()',\n    '[attr.data-orientation]': 'menu.orientation()',\n    '[style.--for-navigation-menu-viewport-width.px]': 'width()',\n    '[style.--for-navigation-menu-viewport-height.px]': 'height()',\n  },\n})\nexport class ForNavigationMenuViewport {\n  protected readonly menu = injectNavigationMenuContext('ForNavigationMenuViewport');\n  readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n  readonly #measureTick = signal(0);\n  protected readonly width = computed(() => this.#measureSize().width);\n  protected readonly height = computed(() => this.#measureSize().height);\n\n  protected readonly state = computed(() => (this.menu.value() !== null ? 'open' : 'closed'));\n\n  readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n  // Tracked panels in insertion order, each with its last known trigger host.\n  // Ordering resolves a trigger's document position from this list rather than\n  // a DOM `aria-labelledby` → `getElementById` round-trip, which silently\n  // returns `null` whenever a panel's trigger is not yet resolvable (its item's\n  // `[value]` binding may still be unwritten, so the parent's lookup skips the\n  // handle) and degrades ordering to mount order. The\n  // content re-invokes `insertPanel` once its trigger registers, so the list\n  // and the resulting DOM order self-heal. Insertion order is preserved so\n  // panels whose trigger is not yet known keep a stable relative position\n  // (sorted to the end) instead of thrashing as siblings re-insert.\n  readonly #panels: { panel: HTMLElement; triggerHost: HTMLElement | null }[] = [];\n\n  constructor() {\n    const handle: ForNavigationMenuViewportHandle = {\n      host: this.host,\n      insertPanel: (panel, triggerHost) => this.#insertPanel(panel, triggerHost),\n    };\n    registerHandle(\n      handle,\n      (h) => this.menu.registerViewport(h),\n      (h) => this.menu.unregisterViewport(h),\n    );\n\n    // Track the active content's natural size via ResizeObserver so layout\n    // mutations between renders (e.g. async content load, viewport host\n    // resize from a surrounding column) flow into the exposed CSS variables.\n    // Browser-only API; off-browser the observation is skipped and\n    // `width` / `height` resolve to 0 without measuring at all — see\n    // `#measureSize` for why reading the rect there is not an option.\n    if (this.#isBrowser && typeof ResizeObserver !== 'undefined') {\n      const ro = new ResizeObserver(() => this.#measureTick.update((t) => t + 1));\n      // Always observe the viewport host itself so layout changes that affect\n      // its own box (e.g. the surrounding column resizing) are picked up.\n      ro.observe(this.host);\n\n      // Switch which content child is being observed whenever the active\n      // panel changes. Pure side effect on the imperative ResizeObserver —\n      // no signal writes from this effect, so the host bindings on\n      // `width`/`height` settle within the same CD pass that the active\n      // content changed in (no CLAUDE.md \"state in effects\" exception\n      // needed here).\n      let observed: HTMLElement | null = null;\n      effect(() => {\n        const active = this.menu.activeContentHost();\n        if (observed && observed !== active) {\n          ro.unobserve(observed);\n          observed = null;\n        }\n        if (active && active !== observed) {\n          ro.observe(active);\n          observed = active;\n        }\n      });\n\n      inject(DestroyRef).onDestroy(() => ro.disconnect());\n    }\n  }\n\n  #insertPanel(panel: HTMLElement, triggerHost: HTMLElement | null): void {\n    const existing = this.#panels.find((p) => p.panel === panel);\n    if (existing) {\n      existing.triggerHost = triggerHost;\n    } else {\n      this.#panels.push({ panel, triggerHost });\n    }\n    this.#reorder();\n  }\n\n  // Reconcile the viewport's children to a single deterministic order: panels\n  // whose trigger host is known come first, sorted by the trigger's document\n  // position; panels whose trigger is not yet known follow, in insertion\n  // order. Computing one total order (rather than inserting each panel\n  // relative to the others) makes the result independent of the order in\n  // which panels call `insertPanel`, so a registration race converges instead\n  // of thrashing. Nodes already in their target slot are left untouched, so\n  // re-running this never disturbs an unaffected panel mid-animation.\n  #reorder(): void {\n    this.#prunePanels();\n    const ordered = [...this.#panels].sort((a, b) => {\n      if (a.triggerHost && b.triggerHost) {\n        if (a.triggerHost === b.triggerHost) return 0;\n        const rel = a.triggerHost.compareDocumentPosition(b.triggerHost);\n        if ((rel & Node.DOCUMENT_POSITION_FOLLOWING) !== 0) return -1;\n        if ((rel & Node.DOCUMENT_POSITION_PRECEDING) !== 0) return 1;\n        return 0;\n      }\n      if (a.triggerHost) return -1;\n      if (b.triggerHost) return 1;\n      return 0;\n    });\n    // Reconcile against the host's live children by index: walk the target\n    // order, and whenever the child currently at position `i` is not the panel\n    // that belongs there, move it in. Moving into the already-correct slot is\n    // a no-op, so an unaffected panel is never disturbed mid-animation. Using\n    // the live child at `i` as the reference (rather than a not-yet-inserted\n    // sibling) keeps every `insertBefore` valid on the first re-parent too.\n    for (let i = 0; i < ordered.length; i++) {\n      const panel = ordered[i]!.panel;\n      const current = this.host.children[i] ?? null;\n      if (current !== panel) {\n        this.host.insertBefore(panel, current);\n      }\n    }\n  }\n\n  // Drop panels the consumer's `@if` already destroyed so the tracking list\n  // does not leak detached nodes across mount/unmount cycles. A freshly\n  // mounted panel still sits under its `[forNavigationMenuItem]` (connected,\n  // pending its first re-parent) and must be kept.\n  #prunePanels(): void {\n    for (let i = this.#panels.length - 1; i >= 0; i--) {\n      if (!this.#panels[i]!.panel.isConnected) {\n        this.#panels.splice(i, 1);\n      }\n    }\n  }\n\n  #measureSize(): { width: number; height: number } {\n    // Depend on the manual tick so RO callbacks invalidate the computed.\n    this.#measureTick();\n    // Browser-only: `getBoundingClientRect` is a layout API, and the DOM\n    // `@angular/platform-server` runs on (domino) does not implement it at all —\n    // so an ungated read throws a `TypeError` on Angular Universal rather than\n    // returning zeros. jsdom does implement it, which is why the SSR smoke suite\n    // cannot see this. Reachable since panels register synchronously\n    // ([#1636](https://github.com/tutkli/forty-cdk/issues/1636)): before that\n    // `activeContentHost()` was always `null` server-side, so the early return\n    // below hid the call by accident.\n    if (!this.#isBrowser) return { width: 0, height: 0 };\n    const active = this.menu.activeContentHost();\n    if (!active) return { width: 0, height: 0 };\n    const r = active.getBoundingClientRect();\n    return { width: r.width, height: r.height };\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AA6MA;;;;;;;;;;AAUG;MACU,2BAA2B,GAAG,IAAI,cAAc,CAC3D,6BAA6B;MAGlB,gCAAgC,GAAG,IAAI,cAAc,CAChE,kCAAkC;AAG9B,SAAU,2BAA2B,CAAC,KAAa,EAAA;AACvD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,2BAA2B,EAAE;AAC9C,QAAA,QAAQ,EAAE,IAAI;AACf,KAAA,CAAiC;IAClC,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,kBAAkB,CAAC;AACvB,YAAA,IAAI,EAAE,4BAA4B;YAClC,KAAK;AACL,YAAA,IAAI,EAAE,qBAAqB;AAC3B,YAAA,KAAK,EAAE,6BAA6B;AACrC,SAAA,CAAC;IACJ;AACA,IAAA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