{"version":3,"file":"ng-primitives-toast.mjs","sources":["../../../../packages/ng-primitives/toast/src/config/toast-config.ts","../../../../packages/ng-primitives/toast/src/toast/toast-context.ts","../../../../packages/ng-primitives/toast/src/toast/toast-options.ts","../../../../packages/ng-primitives/toast/src/toast/toast-manager.ts","../../../../packages/ng-primitives/toast/src/toast/toast-timer.ts","../../../../packages/ng-primitives/toast/src/toast/toast.ts","../../../../packages/ng-primitives/toast/src/ng-primitives-toast.ts"],"sourcesContent":["import { InjectionToken, Provider, inject } from '@angular/core';\nimport { NgpToastPlacement, NgpToastSwipeDirection } from '../toast/toast';\n\nexport interface NgpToastConfig {\n  /**\n   * The position of the toast.\n   */\n  placement: NgpToastPlacement;\n\n  /**\n   * The duration of each toast.\n   */\n  duration: number;\n\n  /**\n   * The offset from the top of the viewport in pixels.\n   */\n  offsetTop: number;\n\n  /**\n   * The offset from the bottom of the viewport in pixels.\n   */\n  offsetBottom: number;\n\n  /**\n   * The offset from the left of the viewport in pixels.\n   */\n  offsetLeft: number;\n\n  /**\n   * The offset from the right of the viewport in pixels.\n   */\n  offsetRight: number;\n\n  /**\n   * Whether a toast can be dismissed by swiping.\n   */\n  dismissible: boolean;\n\n  /**\n   * The amount a toast must be swiped before it is considered dismissed.\n   */\n  swipeThreshold: number;\n\n  /**\n   * The default swipe directions supported by the toast.\n   */\n  swipeDirections: NgpToastSwipeDirection[];\n\n  /**\n   * The maximum number of toasts that can be displayed at once.\n   */\n  maxToasts: number;\n\n  /**\n   * The aria live setting.\n   */\n  ariaLive: string;\n\n  /**\n   * The gap between each toast.\n   */\n  gap: number;\n\n  /**\n   * The z-index of the toast container.\n   * This is used to ensure that the toast container is always on top of other elements.\n   */\n  zIndex: number;\n\n  /**\n   * When true, only the front toast's timer will run.\n   * When a toast is dismissed, the timer will start on the next toast.\n   */\n  sequential: boolean;\n\n  /**\n   * When true, toasts will not auto-dismiss and must be dismissed explicitly.\n   */\n  persistent: boolean;\n}\n\nexport const defaultToastConfig: NgpToastConfig = {\n  gap: 14,\n  duration: 3000,\n  placement: 'top-end',\n  offsetTop: 24,\n  offsetBottom: 24,\n  offsetLeft: 24,\n  offsetRight: 24,\n  swipeThreshold: 45,\n  swipeDirections: ['left', 'right', 'top', 'bottom'],\n  dismissible: true,\n  maxToasts: 3,\n  zIndex: 9999999,\n  ariaLive: 'polite',\n  sequential: false,\n  persistent: false,\n};\n\nexport const NgpToastConfigToken = new InjectionToken<NgpToastConfig>('NgpToastConfigToken');\n\n/**\n * Provide the default Toast configuration\n * @param config The Toast configuration\n * @returns The provider\n */\nexport function provideToastConfig(config: Partial<NgpToastConfig>): Provider[] {\n  return [\n    {\n      provide: NgpToastConfigToken,\n      useValue: { ...defaultToastConfig, ...config },\n    },\n  ];\n}\n\n/**\n * Inject the Toast configuration\n * @returns The global Toast configuration\n */\nexport function injectToastConfig(): NgpToastConfig {\n  return inject(NgpToastConfigToken, { optional: true }) ?? defaultToastConfig;\n}\n","import { inject, InjectionToken, Provider, Signal, untracked } from '@angular/core';\n\nconst NgpToastContext = new InjectionToken<unknown>('NgpToastContext');\nconst NgpToastContextSignal = new InjectionToken<Signal<unknown>>('NgpToastContextSignal');\n\nexport function provideToastContext<T>(context: Signal<T>): Provider[] {\n  return [\n    { provide: NgpToastContext, useValue: untracked(context) },\n    { provide: NgpToastContextSignal, useValue: context },\n  ];\n}\n\n/**\n * Inject the context passed to `show()`. It does not change when `NgpToastRef.update()` passes a\n * new context: use `injectToastContextSignal()` to follow it.\n */\nexport function injectToastContext<T>(): T {\n  return inject(NgpToastContext) as T;\n}\n\n/**\n * Inject the context of the toast as a signal, which `NgpToastRef.update()` sets.\n */\nexport function injectToastContextSignal<T>(): Signal<T> {\n  return inject(NgpToastContextSignal) as Signal<T>;\n}\n","import { inject, InjectionToken, Signal, ValueProvider } from '@angular/core';\nimport type { NgpToast, NgpToastSwipeDirection, NgpToastPlacement } from './toast';\n\nconst NgpToastOptions = new InjectionToken<NgpToastOptions>('NgpToastOptions');\n\nexport function provideToastOptions(context: NgpToastOptions): ValueProvider {\n  return { provide: NgpToastOptions, useValue: context };\n}\n\nexport function injectToastOptions(): NgpToastOptions {\n  return inject(NgpToastOptions);\n}\n\nexport interface NgpToastOptions {\n  /**\n   * The position of the toast.\n   */\n  placement: NgpToastPlacement;\n\n  /**\n   * The duration of the toast in milliseconds.\n   */\n  duration: number;\n\n  /**\n   * A function to register the toast instance with the manager.\n   * @internal\n   */\n  register: (toast: NgpToast) => void;\n\n  /**\n   * Whether the toast region is expanded.\n   * @internal\n   */\n  expanded: Signal<boolean>;\n\n  /**\n   * Whether the toast supports swipe dismiss.\n   * @internal\n   */\n  dismissible: boolean;\n\n  /**\n   * The swipe directions supported by the toast.\n   * @internal\n   */\n  swipeDirections: NgpToastSwipeDirection[];\n\n  /**\n   * When true, only the front toast's timer will run.\n   * @internal\n   */\n  sequential: boolean;\n\n  /**\n   * When true, the toast will not auto-dismiss and must be dismissed explicitly.\n   * @internal\n   */\n  persistent: boolean;\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n  ApplicationRef,\n  computed,\n  DestroyRef,\n  inject,\n  Injectable,\n  Injector,\n  NgZone,\n  PLATFORM_ID,\n  RendererFactory2,\n  signal,\n  TemplateRef,\n  Type,\n  untracked,\n  ViewContainerRef,\n} from '@angular/core';\nimport { createPortal, NGP_MODAL_EXEMPT_ATTRIBUTE, NgpPortal } from 'ng-primitives/portal';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToast, NgpToastPlacement, NgpToastSwipeDirection } from './toast';\nimport { provideToastContext } from './toast-context';\nimport { provideToastOptions } from './toast-options';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class NgpToastManager {\n  private readonly config = injectToastConfig();\n  private readonly applicationRef = inject(ApplicationRef);\n  private readonly rendererFactory = inject(RendererFactory2);\n  private readonly renderer = this.rendererFactory.createRenderer(null, null);\n  private readonly injector = inject(Injector);\n  private readonly document = inject(DOCUMENT);\n  private readonly ngZone = inject(NgZone);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n  // Map to store containers by placement\n  private readonly containers = new Map<string, HTMLElement>();\n\n  /** The element focused before focus entered the toasts, where it returns once they are gone. */\n  private focusBeforeToasts: HTMLElement | null = null;\n  /** Whether F6 moved focus to the toasts, so that F6 again or Escape takes it back. */\n  private enteredWithF6 = false;\n  private listeningForKeys = false;\n\n  readonly toasts = signal<NgpToastRecord[]>([]);\n\n  /** The toasts playing their exit animation, which can no longer take focus or be updated. */\n  private readonly dismissing = new Set<NgpToastRecord>();\n\n  /** Signal that tracks which placements are expanded */\n  private readonly expanded = signal<NgpToastPlacement[]>([]);\n\n  constructor() {\n    this.createContainers();\n\n    this.destroyRef.onDestroy(() => {\n      // Toast views are created in the root view container, so they would outlive the manager.\n      // `finishDetach()` ends a close already under way, which `destroyView()` alone would race.\n      this.toasts().forEach(({ portal }) => {\n        portal.finishDetach();\n        portal.destroyView();\n      });\n      this.toasts.set([]);\n      this.containers.forEach(container => container.remove());\n      this.containers.clear();\n    });\n  }\n\n  /** Show a toast notification */\n  show<T = unknown>(\n    toast: TemplateRef<void> | Type<unknown>,\n    options: NgpToastOptions<T> = {},\n  ): NgpToastRef<T> {\n    // services can't access the view container directly, so this is a workaround.\n    // Fall back to the caller's injector when no root component is available.\n    const rootComponent = this.applicationRef.components[0];\n    const viewContainerRef =\n      rootComponent?.injector.get(ViewContainerRef) ??\n      options.injector?.get(ViewContainerRef, null) ??\n      null;\n\n    let instance: NgpToast | null = null;\n    const placement = options.placement ?? this.config.placement;\n    const duration = options.duration ?? this.config.duration;\n    this.createContainers();\n    const container = this.getOrCreateContainer(placement);\n    const context = signal(options.context as T);\n\n    const portal = createPortal(\n      toast,\n      viewContainerRef,\n      Injector.create({\n        // Scope toast content to the caller's injector when provided, so its DI\n        // resolves from their subtree rather than the root injector. See #823.\n        parent: options.injector ?? this.injector,\n        providers: [\n          provideToastContext(context.asReadonly()),\n          provideToastOptions({\n            placement,\n            duration,\n            register: (toast: NgpToast) => (instance = toast),\n            expanded: computed(() => this.expanded().includes(placement)),\n            dismissible: options.dismissible ?? this.config.dismissible,\n            swipeDirections: options.swipeDirections ?? this.config.swipeDirections,\n            sequential: options.sequential ?? this.config.sequential,\n            persistent: options.persistent ?? this.config.persistent,\n          }),\n        ],\n      }),\n      {\n        // Hide the toast when the dismiss method is called\n        dismiss: () => this.dismiss(instance!),\n        // A getter, so a template that reads `context` follows the signal\n        get context() {\n          return context();\n        },\n      },\n    );\n\n    portal.attach(container);\n\n    // Add the toast to the list of toasts\n    if (!instance) {\n      throw new Error('A toast must have the NgpToast directive applied.');\n    }\n\n    const record: NgpToastRecord = { instance: instance!, portal };\n    this.toasts.update(toasts => [record, ...toasts]);\n\n    return {\n      dismiss: () => this.dismiss(instance!),\n      update: changes =>\n        untracked(() => {\n          if (this.dismissing.has(record) || !this.toasts().includes(record)) {\n            return;\n          }\n\n          if ('context' in changes) {\n            context.set(changes.context as T);\n          }\n\n          record.instance.restart(changes);\n        }),\n    };\n  }\n\n  /** Hide a toast notification */\n  dismiss(toast: NgpToast): Promise<void> {\n    return this.hide(toast, false);\n  }\n\n  /** @internal */\n  dismissBySwipe(toast: NgpToast): Promise<void> {\n    // a swipe is a pointer close: focus goes back to the page\n    return this.hide(toast, true);\n  }\n\n  private async hide(toast: NgpToast, bySwipe: boolean): Promise<void> {\n    const ref = this.toasts().find(t => t.instance === toast);\n\n    if (ref) {\n      this.dismissing.add(ref);\n      this.moveFocusOutOf(ref, bySwipe);\n\n      try {\n        // Detach the portal from the container\n        await ref.portal.detach();\n      } finally {\n        this.dismissing.delete(ref);\n      }\n\n      // Remove the toast from the list of toasts\n      this.toasts.update(toasts => toasts.filter(t => t !== ref));\n\n      // if there are no more toasts, ensure the container is no longer considered expanded\n      if (this.toasts().length === 0) {\n        this.expanded.update(expanded => expanded.filter(p => p !== toast.options.placement));\n      }\n    }\n  }\n\n  /**\n   * A toast that holds focus as it starts to close hands focus on before its exit animation:\n   * to the next toast for a keyboard user, otherwise back to where focus was before it\n   * entered the toasts. Waiting for the removal would depend on how the toast animates out.\n   */\n  private moveFocusOutOf(ref: NgpToastRecord, bySwipe: boolean): void {\n    const active = this.document.activeElement;\n\n    if (!active) {\n      return;\n    }\n\n    // Focus on a region itself (after F6, or a click on a toast's text) stays while toasts\n    // remain, so F6 can go on to them, and goes back to the page with the last one.\n    if ([...this.containers.values()].includes(active as HTMLElement)) {\n      if (!this.toasts().some(t => t !== ref && !this.dismissing.has(t))) {\n        this.returnFocus();\n      }\n      return;\n    }\n\n    if (!ref.instance.element.contains(active)) {\n      return;\n    }\n\n    // After a pointer close, focus goes back to the page rather than to a toast the user\n    // never moved to.\n    const neighbour = !bySwipe && active.matches(':focus-visible') ? this.neighbourOf(ref) : null;\n\n    if (neighbour) {\n      focusToast(neighbour);\n    } else {\n      this.returnFocus();\n    }\n  }\n\n  /**\n   * The toast that takes focus when the given one leaves: the next older toast at the same\n   * placement, or the next newer one when it was the oldest.\n   */\n  private neighbourOf(ref: NgpToastRecord): HTMLElement | null {\n    const placement = ref.instance.options.placement;\n    const siblings = this.toasts().filter(t => t.instance.options.placement === placement);\n    const index = siblings.indexOf(ref);\n    // `toasts` lists the newest first: walk to the older toasts, then back to the newer ones\n    const candidates = [...siblings.slice(index + 1), ...siblings.slice(0, index).reverse()];\n    return candidates.find(t => !this.dismissing.has(t))?.instance.element ?? null;\n  }\n\n  /**\n   * A container is a live region, and a live region must be in the page before the content it\n   * announces, or screen readers may skip the first toast. So every placement gets one up front,\n   * once the page has a body: a manager injected from a script in the `<head>` adds them on the\n   * first `show()`. The configured placement comes first so that\n   * `querySelector('[data-ngp-toast-container]')` still finds the container default toasts use.\n   */\n  private createContainers(): void {\n    if (!this.isBrowser || !this.document.body || this.containers.size > 0) {\n      return;\n    }\n    const placements = new Set([this.config.placement, ...TOAST_PLACEMENTS]);\n    placements.forEach(placement => this.getOrCreateContainer(placement));\n  }\n\n  /**\n   * Lazily create or get a container for a given placement.\n   */\n  private getOrCreateContainer(placement: string): HTMLElement {\n    if (this.containers.has(placement)) {\n      return this.containers.get(placement)!;\n    }\n    const container = this.createContainer(placement);\n    this.containers.set(placement, container);\n    this.listenForKeys();\n    return container;\n  }\n\n  /**\n   * F6 moves focus to the newest toast's region and back, so toasts stay reachable from the\n   * keyboard even while a dialog traps focus.\n   */\n  private listenForKeys(): void {\n    const view = this.document.defaultView;\n\n    if (this.listeningForKeys || !view) {\n      return;\n    }\n\n    this.listeningForKeys = true;\n\n    const onF6 = (event: KeyboardEvent) => {\n      if (event.key !== 'F6' || event.defaultPrevented) {\n        return;\n      }\n\n      const focused = this.containerOf(this.document.activeElement);\n\n      // Back out only from a region that still shows toasts, and only after an F6 entry.\n      // After a Tab entry, F6 is left to the browser.\n      if (focused && this.hasToasts(focused)) {\n        if (this.enteredWithF6) {\n          event.preventDefault();\n          this.returnFocus();\n        }\n        return;\n      }\n\n      const newest = this.toasts()[0];\n      const container = newest && this.containers.get(newest.instance.options.placement);\n\n      if (!container?.isConnected) {\n        return;\n      }\n\n      event.preventDefault();\n      container.focus({ preventScroll: true });\n      // after focus(): its focusin records an entry that is not an F6 one. From nothing focused it\n      // has no related target to record, so keep the body: F6 again then leaves the toasts.\n      if (!focused) {\n        this.focusBeforeToasts ??= this.document.body;\n      }\n      this.enteredWithF6 = this.focusBeforeToasts !== null;\n    };\n\n    // Capture on the window runs before the overlay registry's capture listener on the\n    // document, so an open dialog never sees the Escape that leaves the toasts.\n    const onEscape = (event: KeyboardEvent) => {\n      if (\n        event.key !== 'Escape' ||\n        event.isComposing ||\n        !this.enteredWithF6 ||\n        !this.containerOf(this.document.activeElement)\n      ) {\n        return;\n      }\n\n      event.preventDefault();\n      event.stopPropagation();\n      this.returnFocus();\n    };\n\n    // Focus entering the toasts by any way (Tab, a click, F6) records where it came from. Focus\n    // coming back from another window has no related target and keeps what was recorded.\n    const onFocusIn = (event: FocusEvent) => {\n      // Focus anywhere else ends the round trip, even when the matching focusout was skipped\n      // because the window was in the background.\n      if (!this.containerOf(event.target as Node | null)) {\n        this.focusBeforeToasts = null;\n        this.enteredWithF6 = false;\n        return;\n      }\n\n      if (\n        event.relatedTarget &&\n        this.containerOf(event.target as Node | null) &&\n        !this.containerOf(event.relatedTarget as Node | null)\n      ) {\n        this.focusBeforeToasts =\n          event.relatedTarget instanceof HTMLElement ? event.relatedTarget : null;\n        this.enteredWithF6 = false;\n      }\n    };\n\n    // Focus leaving the toasts forgets where it came from. Switching to another window does not:\n    // focus comes back to the toasts.\n    const onFocusOut = (event: FocusEvent) => {\n      if (\n        this.document.hasFocus() &&\n        this.containerOf(event.target as Node | null) &&\n        !this.containerOf(event.relatedTarget as Node | null)\n      ) {\n        this.focusBeforeToasts = null;\n        this.enteredWithF6 = false;\n      }\n    };\n\n    this.ngZone.runOutsideAngular(() => {\n      view.addEventListener('keydown', onF6);\n      view.addEventListener('keydown', onEscape, { capture: true });\n      view.addEventListener('focusin', onFocusIn);\n      view.addEventListener('focusout', onFocusOut);\n    });\n\n    this.destroyRef.onDestroy(() => {\n      view.removeEventListener('keydown', onF6);\n      view.removeEventListener('keydown', onEscape, { capture: true });\n      view.removeEventListener('focusin', onFocusIn);\n      view.removeEventListener('focusout', onFocusOut);\n    });\n  }\n\n  private containerOf(node: Node | null): HTMLElement | undefined {\n    return [...this.containers.values()].find(container => container.contains(node));\n  }\n\n  private hasToasts(container: HTMLElement): boolean {\n    return this.toasts().some(\n      toast => this.containers.get(toast.instance.options.placement) === container,\n    );\n  }\n\n  private returnFocus(): void {\n    const target = this.focusBeforeToasts;\n    this.focusBeforeToasts = null;\n    this.enteredWithF6 = false;\n\n    // Nothing had focus before: `body.focus()` would leave focus where it is, so blur instead.\n    if (target === this.document.body) {\n      (this.document.activeElement as HTMLElement | null)?.blur();\n    } else if (target?.isConnected) {\n      target.focus({ preventScroll: true });\n    }\n  }\n\n  /**\n   * Create a section in which toasts will be rendered for a specific placement.\n   */\n  private createContainer(placement: string): HTMLElement {\n    const container = this.renderer.createElement('section') as HTMLElement;\n    this.renderer.setAttribute(container, 'aria-live', this.config.ariaLive);\n    // pair the live region with the role matching its politeness so assistive tech\n    // reliably announces additions (status = polite, alert = assertive)\n    this.renderer.setAttribute(\n      container,\n      'role',\n      this.config.ariaLive === 'assertive' ? 'alert' : 'status',\n    );\n    this.renderer.setAttribute(container, 'aria-atomic', 'false');\n    this.renderer.setAttribute(container, 'tabindex', '-1');\n    this.renderer.setAttribute(container, 'data-ngp-toast-container', placement);\n    this.renderer.setAttribute(container, NGP_MODAL_EXEMPT_ATTRIBUTE, '');\n    container.style.setProperty('position', 'fixed');\n    container.style.setProperty('z-index', `${this.config.zIndex}`);\n    container.style.setProperty('--ngp-toast-offset-top', `${this.config.offsetTop}px`);\n    container.style.setProperty('--ngp-toast-offset-bottom', `${this.config.offsetBottom}px`);\n    container.style.setProperty('--ngp-toast-offset-left', `${this.config.offsetLeft}px`);\n    container.style.setProperty('--ngp-toast-offset-right', `${this.config.offsetRight}px`);\n    container.style.setProperty('--ngp-toast-gap', `${this.config.gap}px`);\n\n    // mark the container as expanded\n    this.renderer.listen(container, 'mouseenter', () =>\n      this.expanded.update(expanded => [...expanded, placement as NgpToastPlacement]),\n    );\n\n    this.renderer.listen(container, 'mouseleave', () => {\n      this.expanded.update(expanded =>\n        expanded.filter(p => p !== (placement as NgpToastPlacement)),\n      );\n    });\n\n    // Set placement styles\n    switch (placement) {\n      case 'top-start':\n        container.style.setProperty('top', `${this.config.offsetTop}px`);\n        container.style.setProperty('left', `${this.config.offsetLeft}px`);\n        break;\n      case 'top-center':\n        container.style.setProperty('top', `${this.config.offsetTop}px`);\n        container.style.setProperty('left', '50%');\n        container.style.setProperty('transform', 'translateX(-50%)');\n        break;\n      case 'top-end':\n        container.style.setProperty('top', `${this.config.offsetTop}px`);\n        container.style.setProperty('right', `${this.config.offsetRight}px`);\n        break;\n      case 'bottom-start':\n        container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n        container.style.setProperty('left', `${this.config.offsetLeft}px`);\n        break;\n      case 'bottom-center':\n        container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n        container.style.setProperty('left', '50%');\n        container.style.setProperty('transform', 'translateX(-50%)');\n        break;\n      case 'bottom-end':\n        container.style.setProperty('bottom', `${this.config.offsetBottom}px`);\n        container.style.setProperty('right', `${this.config.offsetRight}px`);\n        break;\n      default:\n        throw new Error(`Unknown toast placement: ${placement}`);\n    }\n\n    this.renderer.appendChild(this.document.body, container);\n    return container;\n  }\n}\n\nconst TOAST_PLACEMENTS = Object.keys({\n  'top-start': true,\n  'top-center': true,\n  'top-end': true,\n  'bottom-start': true,\n  'bottom-center': true,\n  'bottom-end': true,\n} satisfies Record<NgpToastPlacement, true>) as NgpToastPlacement[];\n\nexport interface NgpToastOptions<T = unknown> {\n  /** The position of the toast */\n  placement?: NgpToastPlacement;\n\n  /** The duration of the toast in milliseconds */\n  duration?: number;\n\n  /** Whether the toast is dismissible */\n  dismissible?: boolean;\n\n  /** The swipe directions supported by the toast */\n  swipeDirections?: NgpToastSwipeDirection[];\n\n  /** The context to make available to the toast */\n  context?: T;\n\n  /** When enabled, only the front toast's timer will run */\n  sequential?: boolean;\n\n  /** When true, the toast will not auto-dismiss and must be dismissed explicitly */\n  persistent?: boolean;\n\n  /**\n   * The injector used to render the toast content. Provide the calling component's\n   * injector when the toast depends on component-scoped providers. Defaults to root.\n   */\n  injector?: Injector;\n}\n\ninterface NgpToastRecord {\n  instance: NgpToast;\n  portal: NgpPortal;\n}\n\nexport interface NgpToastRef<T = unknown> {\n  /** Dismiss the toast. */\n  dismiss(): Promise<void>;\n\n  /**\n   * Change the toast in place: it keeps its position and does not replay its enter animation.\n   * The timer restarts with the new duration, or the current one, unless the toast is persistent.\n   * Does nothing once the toast is being dismissed.\n   */\n  update(changes: NgpToastUpdate<T>): void;\n}\n\nexport interface NgpToastUpdate<T = unknown> {\n  /** The new context of the toast. */\n  context?: T;\n\n  /** The new duration of the toast in milliseconds. */\n  duration?: number;\n\n  /** When true, the toast stops its timer; when false, it starts it again. */\n  persistent?: boolean;\n}\n\n/**\n * Focus a toast, which is not focusable by itself. It holds a tabindex only while focused, so\n * a click on a toast never focuses it.\n */\nfunction focusToast(element: HTMLElement): void {\n  if (!element.hasAttribute('tabindex')) {\n    element.setAttribute('tabindex', '-1');\n\n    const onBlur = () => {\n      // The window losing focus blurs the toast but keeps it active, to refocus on return.\n      if (element.ownerDocument.activeElement === element) {\n        return;\n      }\n      element.removeAttribute('tabindex');\n      element.removeEventListener('blur', onBlur);\n    };\n\n    element.addEventListener('blur', onBlur);\n  }\n  element.focus({ preventScroll: true });\n}\n","class NgpToastTimer {\n  private startTime: number | null = null;\n  private remainingMs: number;\n  private timeoutId: ReturnType<typeof setTimeout> | null = null;\n  private isRunning = false;\n\n  constructor(\n    private duration: number,\n    private callback: () => void,\n    private persistent = false,\n  ) {\n    this.remainingMs = duration;\n  }\n\n  start(): void {\n    if (this.persistent) return;\n    if (this.isRunning) return;\n\n    this.isRunning = true;\n    this.startTime = Date.now();\n\n    this.timeoutId = setTimeout(() => {\n      this.isRunning = false;\n      this.callback();\n    }, this.remainingMs);\n  }\n\n  pause(): void {\n    if (!this.isRunning || this.startTime === null) return;\n\n    this.isRunning = false;\n    clearTimeout(this.timeoutId!);\n\n    const elapsed = Date.now() - this.startTime;\n    this.remainingMs = Math.max(0, this.remainingMs - elapsed);\n    this.startTime = null;\n    this.timeoutId = null;\n  }\n\n  remaining(): number {\n    if (this.startTime === null) return this.remainingMs;\n    return Math.max(0, this.remainingMs - (Date.now() - this.startTime));\n  }\n\n  stop(): void {\n    this.isRunning = false;\n    clearTimeout(this.timeoutId!);\n    this.timeoutId = null;\n    this.startTime = null;\n    this.remainingMs = this.duration;\n  }\n\n  /**\n   * Stop the timer and give it a new duration. It does not start again until `start()`.\n   */\n  reset(duration: number, persistent: boolean): void {\n    this.duration = duration;\n    this.persistent = persistent;\n    this.stop();\n  }\n}\n\nexport interface NgpToastTimerOptions {\n  /**\n   * When true, the timer never fires. `start()`, `pause()`, and `stop()` are safe\n   * to call but have no effect on the callback.\n   */\n  persistent?: boolean;\n}\n\nexport function toastTimer(\n  duration: number,\n  callback: () => void,\n  options: NgpToastTimerOptions = {},\n): NgpToastTimer {\n  return new NgpToastTimer(duration, callback, options.persistent);\n}\n","import { InteractivityChecker } from '@angular/cdk/a11y';\nimport {\n  afterNextRender,\n  computed,\n  Directive,\n  ElementRef,\n  inject,\n  Injector,\n  signal,\n  untracked,\n} from '@angular/core';\nimport { explicitEffect, injectDimensions } from 'ng-primitives/internal';\nimport { listener } from 'ng-primitives/state';\nimport { injectToastConfig } from '../config/toast-config';\nimport { NgpToastManager } from './toast-manager';\nimport { injectToastOptions } from './toast-options';\nimport { toastTimer } from './toast-timer';\n\n@Directive({\n  selector: '[ngpToast]',\n  exportAs: 'ngpToast',\n  host: {\n    '[attr.data-position-x]': 'x',\n    '[attr.data-position-y]': 'y',\n    '[attr.data-visible]': 'visible()',\n    '[attr.data-front]': 'index() === 0',\n    '[attr.data-swiping]': 'swiping()',\n    '[attr.data-swipe-direction]': 'swipeOutDirection()',\n    '[attr.data-expanded]': 'options.expanded()',\n    '[attr.data-paused]': 'paused() ? \"\" : null',\n    '[style.--ngp-toast-duration.ms]': 'duration()',\n    '[style.--ngp-toast-gap.px]': 'config.gap',\n    '[style.--ngp-toast-z-index]': 'zIndex()',\n    '[style.--ngp-toasts-before]': 'index()',\n    '[style.--ngp-toast-index]': 'index() + 1',\n    '[style.--ngp-toast-height.px]': 'dimensions().height',\n    '[style.--ngp-toast-offset.px]': 'offset()',\n    '[style.--ngp-toast-front-height.px]': 'frontToastHeight()',\n    '[style.--ngp-toast-swipe-amount-x.px]': 'swipeAmount().x',\n    '[style.--ngp-toast-swipe-amount-y.px]': 'swipeAmount().y',\n    '[style.--ngp-toast-swipe-x]': 'swipeAmount().x',\n    '[style.--ngp-toast-swipe-y]': 'swipeAmount().y',\n  },\n})\nexport class NgpToast {\n  private readonly manager = inject(NgpToastManager);\n  private readonly injector = inject(Injector);\n  private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n  /** @internal */\n  readonly element = this.elementRef.nativeElement;\n  protected readonly config = injectToastConfig();\n  /** @internal */\n  readonly options = injectToastOptions();\n  private readonly interactivityChecker = inject(InteractivityChecker);\n  private readonly isInteracting = signal(false);\n  protected readonly duration = signal(this.options.duration);\n  private readonly persistent = signal(this.options.persistent);\n  private readonly timerRestarts = signal(0);\n\n  /**\n   * How many times `NgpToastRef.update()` has restarted the timer. Key an element on it to restart\n   * a CSS animation that follows the timer, such as a progress bar.\n   */\n  readonly restarts = this.timerRestarts.asReadonly();\n\n  private pointerStartRef: { x: number; y: number } | null = null;\n  private dragStartTime: Date | null = null;\n  protected readonly swiping = signal(false);\n  protected readonly swipeDirection = signal<'x' | 'y' | null>(null);\n  protected readonly swipeAmount = signal({ x: 0, y: 0 });\n\n  protected readonly swipeOutDirection = computed(() => {\n    const direction = this.swipeDirection();\n    if (direction === 'x') {\n      return this.swipeAmount().x > 0 ? 'right' : 'left';\n    } else if (direction === 'y') {\n      return this.swipeAmount().y > 0 ? 'bottom' : 'top';\n    }\n    return null;\n  });\n\n  /**\n   * Get all toasts that are currently being displayed in the same position.\n   */\n  private readonly toasts = computed(() =>\n    this.manager\n      .toasts()\n      .filter(toast => toast.instance.options.placement === this.options.placement),\n  );\n\n  /**\n   * The number of toasts that are currently being displayed before this toast.\n   */\n  protected readonly index = computed(() => {\n    return this.toasts().findIndex(toast => toast.instance === this);\n  });\n\n  /**\n   * Determine the position of the toast in the list of toasts.\n   * This is the combination of the heights of all the toasts before this one, plus the gap between them.\n   */\n  protected readonly offset = computed(() => {\n    const gap = this.config.gap;\n\n    return this.toasts()\n      .slice(0, this.index())\n      .reduce((acc, toast) => acc + toast.instance.dimensions().height + gap, 0);\n  });\n\n  /**\n   * Determine if this toast is visible.\n   * Visible considers the maximum number of toasts that can be displayed at once, and the last x toasts that are currently being displayed.\n   */\n  protected readonly visible = computed(() => {\n    const maxToasts = this.config.maxToasts;\n    // determine if this toast is within the maximum number of toasts that can be displayed\n    return this.index() < maxToasts || this.toasts().length <= maxToasts;\n  });\n\n  /**\n   * Determine the height of the front toast.\n   * This is used to determine the height of the toast when it is not expanded.\n   */\n  protected readonly frontToastHeight = computed(() => {\n    // get the first toast in the list with height - as when a new toast is added, it may not initially have dimensions\n    return (\n      this.toasts()\n        .find(toast => toast.instance.dimensions().height)\n        ?.instance.dimensions().height || 0\n    );\n  });\n\n  /**\n   * Determine the z-index of the toast. This is the inverse of the index.\n   * The first toast will have the highest z-index, and the last toast will have the lowest z-index.\n   * This is used to ensure that the first toast is always on top of the others.\n   */\n  protected readonly zIndex = computed(() => this.toasts().length - this.index());\n\n  /**\n   * Whether the auto-dismiss timer is paused.\n   */\n  protected readonly paused = computed(\n    () =>\n      this.persistent() ||\n      this.options.expanded() ||\n      this.isInteracting() ||\n      (this.options.sequential && this.index() > 0),\n  );\n\n  /**\n   * The height of the toast in pixels.\n   */\n  protected readonly dimensions = injectDimensions();\n\n  /**\n   * The x position of the toast.\n   */\n  readonly x = this.options.placement.split('-')[1] || 'end';\n\n  /**\n   * The y position of the toast.\n   */\n  readonly y = this.options.placement.split('-')[0] || 'top';\n\n  /**\n   * The toast timer instance.\n   */\n  private readonly timer = toastTimer(this.options.duration, () => this.manager.dismiss(this), {\n    persistent: this.options.persistent,\n  });\n\n  constructor() {\n    this.options.register(this);\n\n    // Bind the pointer listeners outside the Angular zone via the `listener()`\n    // helper. Using `@HostListener` would run every `pointermove` inside the\n    // zone, triggering an application-wide change detection pass on each mouse\n    // move while merely hovering a toast (#762). Registering them out-of-zone\n    // means only the signal writes that occur during an actual swipe schedule\n    // change detection.\n    const element = this.elementRef.nativeElement;\n    listener(element, 'pointerdown', event => this.onPointerDown(event));\n    listener(element, 'pointermove', event => this.onPointerMove(event));\n    listener(element, 'pointerup', () => this.onPointerUp());\n\n    // Start the timer when the toast is created\n    this.timer.start();\n\n    explicitEffect([this.paused], ([paused]) => {\n      if (paused) {\n        this.timer.pause();\n      } else {\n        this.timer.start();\n      }\n    });\n  }\n\n  /**\n   * Restart the timer with a new duration, or stop it when the toast becomes persistent.\n   * @internal\n   */\n  restart({ duration, persistent }: { duration?: number; persistent?: boolean }): void {\n    this.duration.set(duration ?? this.duration());\n    this.persistent.set(persistent ?? this.persistent());\n    this.timer.reset(this.duration(), this.persistent());\n    this.timerRestarts.update(count => count + 1);\n\n    if (!untracked(this.paused)) {\n      this.timer.start();\n    }\n  }\n\n  /**\n   * The milliseconds left before the toast auto-dismisses. Not reactive.\n   */\n  remaining(): number {\n    return this.timer.remaining();\n  }\n\n  private onPointerDown(event: PointerEvent): void {\n    // right click should not trigger swipe and we check if the toast is dismissible\n    if (event.button === 2 || !this.options.dismissible) {\n      return;\n    }\n\n    this.isInteracting.set(true);\n\n    // we need to check if the pointer is on an interactive element, if so, we should not start swiping\n    if (this.interactivityChecker.isFocusable(event.target as HTMLElement)) {\n      return;\n    }\n\n    this.dragStartTime = new Date();\n    // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n    (event.target as HTMLElement).setPointerCapture(event.pointerId);\n    this.swiping.set(true);\n    this.pointerStartRef = { x: event.clientX, y: event.clientY };\n  }\n\n  private onPointerMove(event: PointerEvent): void {\n    if (!this.pointerStartRef || !this.options.dismissible) {\n      return;\n    }\n\n    const isHighlighted = window.getSelection()?.toString().length ?? 0 > 0;\n\n    if (isHighlighted) {\n      return;\n    }\n\n    const yDelta = event.clientY - this.pointerStartRef.y;\n    const xDelta = event.clientX - this.pointerStartRef.x;\n\n    const swipeDirections = this.options.swipeDirections;\n\n    // Determine swipe direction if not already locked\n    if (!this.swipeDirection() && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {\n      this.swipeDirection.set(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');\n    }\n\n    const swipeAmount = { x: 0, y: 0 };\n\n    const getDampening = (delta: number) => {\n      const factor = Math.abs(delta) / 20;\n\n      return 1 / (1.5 + factor);\n    };\n\n    // Only apply swipe in the locked direction\n    if (this.swipeDirection() === 'y') {\n      // Handle vertical swipes\n      if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {\n        if (\n          (swipeDirections.includes('top') && yDelta < 0) ||\n          (swipeDirections.includes('bottom') && yDelta > 0)\n        ) {\n          swipeAmount.y = yDelta;\n        } else {\n          // Smoothly transition to dampened movement\n          const dampenedDelta = yDelta * getDampening(yDelta);\n          // Ensure we don't jump when transitioning to dampened movement\n          swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;\n        }\n      }\n    } else if (this.swipeDirection() === 'x') {\n      // Handle horizontal swipes\n      if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n        if (\n          (swipeDirections.includes('left') && xDelta < 0) ||\n          (swipeDirections.includes('right') && xDelta > 0)\n        ) {\n          swipeAmount.x = xDelta;\n        } else {\n          // Smoothly transition to dampened movement\n          const dampenedDelta = xDelta * getDampening(xDelta);\n          // Ensure we don't jump when transitioning to dampened movement\n          swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;\n        }\n      }\n    }\n\n    this.swipeAmount.set({ x: swipeAmount.x, y: swipeAmount.y });\n\n    if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {\n      this.swiping.set(true);\n    }\n  }\n\n  private onPointerUp(): void {\n    this.isInteracting.set(false);\n\n    if (\n      !this.config.dismissible ||\n      !this.pointerStartRef ||\n      !this.swiping() ||\n      !this.dragStartTime\n    ) {\n      return;\n    }\n\n    this.pointerStartRef = null;\n\n    const swipeAmountX = this.swipeAmount().x;\n    const swipeAmountY = this.swipeAmount().y;\n    const timeTaken = new Date().getTime() - this.dragStartTime.getTime();\n\n    const swipeAmount = this.swipeDirection() === 'x' ? swipeAmountX : swipeAmountY;\n    const velocity = Math.abs(swipeAmount) / timeTaken;\n\n    if (Math.abs(swipeAmount) >= this.config.swipeThreshold || velocity > 0.11) {\n      afterNextRender(\n        { write: () => this.manager.dismissBySwipe(this) },\n        { injector: this.injector },\n      );\n      return;\n    } else {\n      this.swipeAmount.set({ x: 0, y: 0 });\n    }\n\n    // Reset swipe state\n    this.swipeDirection.set(null);\n    this.swiping.set(false);\n  }\n}\n\nexport type NgpToastSwipeDirection = 'top' | 'right' | 'bottom' | 'left';\n\nexport type NgpToastPlacement =\n  | 'top-start'\n  | 'top-end'\n  | 'top-center'\n  | 'bottom-start'\n  | 'bottom-end'\n  | 'bottom-center';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAkFO,MAAM,kBAAkB,GAAmB;AAChD,IAAA,GAAG,EAAE,EAAE;AACP,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,SAAS,EAAE,EAAE;AACb,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,WAAW,EAAE,EAAE;AACf,IAAA,cAAc,EAAE,EAAE;IAClB,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;AACnD,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,MAAM,EAAE,OAAO;AACf,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,UAAU,EAAE,KAAK;AACjB,IAAA,UAAU,EAAE,KAAK;CAClB;AAEM,MAAM,mBAAmB,GAAG,IAAI,cAAc,CAAiB,qBAAqB,CAAC;AAE5F;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,MAA+B,EAAA;IAChE,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,mBAAmB;AAC5B,YAAA,QAAQ,EAAE,EAAE,GAAG,kBAAkB,EAAE,GAAG,MAAM,EAAE;AAC/C,SAAA;KACF;AACH;AAEA;;;AAGG;SACa,iB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