{"version":3,"file":"mn-angular-lib-alert.mjs","sources":["../../../projects/mn-angular-lib/alert/src/mn-alert/mn-alert.tokens.ts","../../../projects/mn-angular-lib/alert/src/mn-alert/mn-alert.providers.ts","../../../projects/mn-angular-lib/alert/src/mn-alert/mn-alert.store.ts","../../../projects/mn-angular-lib/alert/src/mn-alert/mn-alert.service.ts","../../../projects/mn-angular-lib/alert/src/mn-alert/mn-alertVariants.ts","../../../projects/mn-angular-lib/alert/src/mn-alert/mn-alert-outlet/mn-alert-outlet.ts","../../../projects/mn-angular-lib/alert/src/mn-alert/mn-alert-outlet/mn-alert-outlet.html","../../../projects/mn-angular-lib/alert/public-api.ts","../../../projects/mn-angular-lib/alert/mn-angular-lib-alert.ts"],"sourcesContent":["// projects/mn-angular-lib/src/lib/mn-mn-alert/mn-mn-alert.tokens.ts\nimport {InjectionToken} from '@angular/core';\nimport {MnAlert} from './mn-alert.types';\n\nexport type MnAlertKind = 'success' | 'info' | 'warning' | 'error' | 'default';\n\nexport type MnAlertConfig = {\n  durations?: Partial<Record<MnAlertKind, number | null>>;\n  cssClasses?: Partial<Record<MnAlertKind, string>>;\n  icons?: Partial<Record<MnAlertKind, unknown>>;\n  fallbackDuration?: number | null;\n  /**\n   * How many alerts may be on screen at once. Showing one past this cap drops the oldest\n   * alert still visible, so a burst of alerts never grows into an unreadable stack.\n   */\n  maxVisible?: number;\n  finalize?: (a: MnAlert) => MnAlert;\n}\n\nexport const MN_ALERT_CONFIG = new InjectionToken<MnAlertConfig>('MN_ALERT_CONFIG');\n\nexport const DEFAULT_MN_ALERT_CONFIG: Required<MnAlertConfig> = {\n  durations: { success: 3000, info: 4000, warning: 5000, error: 7000, default: 4000 },\n  cssClasses: {\n    success: 'mn-alert-success',\n    info: 'mn-alert-info',\n    warning: 'mn-alert-warning',\n    error: 'mn-alert-error',\n    default: 'alert'\n  },\n  icons: {},\n  fallbackDuration: 4000,\n  maxVisible: 3,\n  finalize: (a) => a\n};\n","// projects/mn-angular-lib/src/lib/mn-mn-alert/mn-mn-alert.providers.ts\nimport { Provider } from '@angular/core';\nimport { MN_ALERT_CONFIG, MnAlertConfig, DEFAULT_MN_ALERT_CONFIG } from './mn-alert.tokens';\n\nexport function provideMnAlerts(config: MnAlertConfig = {}): Provider {\n  const merged: MnAlertConfig = {\n    ...DEFAULT_MN_ALERT_CONFIG,\n    ...config,\n    durations: { ...DEFAULT_MN_ALERT_CONFIG.durations, ...(config.durations ?? {}) },\n    cssClasses: { ...DEFAULT_MN_ALERT_CONFIG.cssClasses, ...(config.cssClasses ?? {}) },\n    icons: { ...DEFAULT_MN_ALERT_CONFIG.icons, ...(config.icons ?? {}) }\n  };\n  return { provide: MN_ALERT_CONFIG, useValue: merged };\n}\n","import {inject, Injectable} from '@angular/core';\nimport {BehaviorSubject} from 'rxjs';\nimport {MnAlert, MnAlertId} from './mn-alert.types';\nimport {DEFAULT_MN_ALERT_CONFIG, MN_ALERT_CONFIG, MnAlertConfig} from './mn-alert.tokens';\n\nlet COUNTER = 0;\nconst uid = () => `mn_${++COUNTER}`;\n\n@Injectable({ providedIn: 'root' })\nexport class MnAlertStore {\n  private readonly _alerts$ = new BehaviorSubject<MnAlert[]>([]);\n  readonly alerts$ = this._alerts$.asObservable();\n\n  /** Host configuration, when the app provided one. Only `maxVisible` is read here — the\n   *  per-kind durations are resolved by {@link MnAlertService} before an alert reaches the store. */\n  private readonly cfg = inject<MnAlertConfig | null>(MN_ALERT_CONFIG, {optional: true});\n\n  /** In-flight auto-dismiss timers keyed by alert id, so an alert that leaves early (dismissed\n   *  by hand, or pushed out by the visible cap) never fires a stale timeout later. */\n  private readonly timers = new Map<MnAlertId, ReturnType<typeof setTimeout>>();\n\n  /** How many alerts stay on screen at once; showing more drops the oldest ones. */\n  private get maxVisible(): number {\n    const configured = this.cfg?.maxVisible;\n    return typeof configured === 'number' && configured > 0\n      ? configured\n      : DEFAULT_MN_ALERT_CONFIG.maxVisible;\n  }\n\n  show(partial: Omit<MnAlert, 'id'>): MnAlertId {\n    // Ensure every alert has a numeric duration: use provided or fall back to per-kind default\n    const computedDuration = (partial as {\n      duration?: number\n    }).duration ?? (DEFAULT_MN_ALERT_CONFIG.durations as Record<string, number>)[(partial as {\n      kind?: string\n    }).kind ?? ''] ?? DEFAULT_MN_ALERT_CONFIG.fallbackDuration;\n    const a: MnAlert = { id: uid(), ...partial, duration: computedDuration } as MnAlert;\n\n    // Newest alert last; anything beyond the cap is trimmed off the front (the oldest still\n    // visible), so a burst of alerts scrolls rather than piling up.\n    const queued = [...this._alerts$.value, a];\n    const overflow = queued.length - this.maxVisible;\n    if (overflow > 0) {\n      queued.splice(0, overflow).forEach(dropped => this.clearTimer(dropped.id));\n    }\n    this._alerts$.next(queued);\n\n    if (typeof a.duration === 'number' && a.duration > 0) {\n      this.timers.set(a.id, setTimeout(() => this.dismiss(a.id), a.duration));\n    }\n    return a.id;\n  }\n\n  dismiss(id: MnAlertId) {\n    const list = this._alerts$.value;\n    if (list.some(x => x.id === id)) {\n      this.clearTimer(id);\n      this._alerts$.next(list.filter(x => x.id !== id));\n    }\n  }\n\n  clear() {\n    this.timers.forEach(t => clearTimeout(t));\n    this.timers.clear();\n    this._alerts$.next([]);\n  }\n\n  private clearTimer(id: MnAlertId) {\n    const timer = this.timers.get(id);\n    if (timer !== undefined) {\n      clearTimeout(timer);\n      this.timers.delete(id);\n    }\n  }\n}\n","// projects/mn-angular-lib/src/lib/mn-mn-alert/mn-mn-alert.service.ts\nimport {Injectable, inject} from '@angular/core';\nimport { MnAlertStore } from './mn-alert.store';\nimport { MnAlert, MnAlertId } from './mn-alert.types';\nimport { MN_ALERT_CONFIG, DEFAULT_MN_ALERT_CONFIG, MnAlertConfig, MnAlertKind } from './mn-alert.tokens';\nimport { MnAlertVariants } from './mn-alertVariants';\n\nexport type MnShowInput = {\n  title: string;\n  subTitle?: string;\n  duration?: number;\n  icon?: unknown;\n  cssClass?: string;\n  meta?: Record<string, unknown>;\n  kind: MnAlertKind;\n  variant?: MnAlertVariants['variant'];\n}\n\n@Injectable({ providedIn: 'root' })\nexport class MnAlertService {\n  private readonly store = inject(MnAlertStore);\n\n  private readonly cfg: Required<MnAlertConfig>;\n  private readonly userDurations?: Partial<Record<MnAlertKind, number | null>>;\n  private readonly hasUserDurations: boolean;\n\n  constructor() {\n    const cfg = inject<MnAlertConfig | null>(MN_ALERT_CONFIG, {optional: true});\n\n    this.userDurations = cfg?.durations;\n    this.hasUserDurations = !!cfg?.durations;\n    this.cfg = {\n      ...DEFAULT_MN_ALERT_CONFIG,\n      ...(cfg ?? {}),\n      // Do not pre-merge durations; keep defaults separate and use logic in kind()\n      durations: DEFAULT_MN_ALERT_CONFIG.durations,\n      cssClasses: { ...DEFAULT_MN_ALERT_CONFIG.cssClasses, ...(cfg?.cssClasses ?? {}) },\n      icons: { ...DEFAULT_MN_ALERT_CONFIG.icons, ...(cfg?.icons ?? {}) }\n    };\n  }\n\n  show(input: MnShowInput): MnAlertId {\n    // Always ensure a numeric duration is set\n    let duration = input.duration;\n    if (duration == null) {\n      // Prefer user defaultDuration if provided and not null, otherwise use library per-kind default\n      const userDefault = this.cfg.fallbackDuration;\n      if (typeof userDefault === 'number') {\n        duration = userDefault;\n      } else {\n        duration = DEFAULT_MN_ALERT_CONFIG.durations[input.kind as keyof typeof DEFAULT_MN_ALERT_CONFIG.durations] as number;\n      }\n    }\n\n    const a: Omit<MnAlert, 'id'> = {\n      title: input.title,\n      subTitle: input.subTitle,\n      duration,\n      icon: input.icon,\n      cssClass: input.cssClass,\n      meta: input.meta,\n      kind: input.kind,\n      variant: input.variant\n    };\n    return this.store.show(this.cfg.finalize(a as MnAlert));\n  }\n\n  success(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n    return this.kind('success', title, subTitle, extra);\n  }\n  info(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n    return this.kind('info', title, subTitle, extra);\n  }\n  warning(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n    return this.kind('warning', title, subTitle, extra);\n  }\n  error(title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n    return this.kind('error', title, subTitle, extra);\n  }\n\n  dismiss(id: MnAlertId) { this.store.dismiss(id); }\n  clear() { this.store.clear(); }\n\n  private kind(kind: MnAlertKind, title: string, subTitle?: string, extra?: Partial<MnShowInput>) {\n    let duration: number | null | undefined = extra?.duration;\n\n    if (duration == null) {\n      if (this.hasUserDurations) {\n        const userDur = this.userDurations?.[kind];\n        if (typeof userDur === 'number') {\n          duration = userDur;\n        } else {\n          // userDur is undefined or null -> fallback to user defaultDuration if numeric\n          if (typeof this.cfg.fallbackDuration === 'number') {\n            duration = this.cfg.fallbackDuration;\n          } else {\n            duration = this.cfg.durations[kind as keyof typeof this.cfg.durations];\n          }\n        }\n      } else {\n        // No user durations provided at all; use library defaults per kind\n        duration = this.cfg.durations[kind as keyof typeof this.cfg.durations];\n      }\n    }\n\n    const cssClass = extra?.cssClass ?? this.cfg.cssClasses[kind];\n    const icon = (extra?.icon ?? this.cfg.icons[kind]) as unknown;\n    const variant = extra?.variant;\n\n    return this.show({ title, subTitle, duration: duration as number, cssClass, icon, meta: extra?.meta , kind: kind, variant});\n  }\n}\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnAlertVariants = tv({\n  base: 'flex items-start gap-3 p-4 border rounded-xl shadow-sm transition-all duration-300 w-full ',\n  variants: {\n    kind: {\n      success: 'bg-success/10 border-success/30 text-success',\n      info: 'bg-info/10 border-info/30 text-info',\n      warning: 'bg-warning/10 border-warning/30 text-warning',\n      error: 'bg-error/10 border-error/30 text-error',\n      default: 'bg-base-100 border-base-300 text-base-content',\n      accent: 'bg-accent/10 border-accent/30 text-accent',\n    },\n    variant: {\n      fill: '',\n      outline: 'bg-base-200 border-2',\n      soft: 'border-none shadow-none',\n    }\n  },\n  compoundVariants: [\n    {\n      kind: 'success',\n      variant: 'fill',\n      class: 'bg-success border-success text-success-content'\n    },\n    {\n      kind: 'info',\n      variant: 'fill',\n      class: 'bg-info border-info text-info-content'\n    },\n    {\n      kind: 'warning',\n      variant: 'fill',\n      class: 'bg-warning border-warning text-warning-content'\n    },\n    {\n      kind: 'error',\n      variant: 'fill',\n      class: 'bg-error border-error text-error-content'\n    },\n    {\n      kind: 'accent',\n      variant: 'fill',\n      class: 'bg-accent border-accent text-accent-content'\n    },\n  ],\n  defaultVariants: {\n    kind: 'info',\n    variant: 'soft'\n  }\n});\n\nexport type MnAlertVariants = VariantProps<typeof mnAlertVariants>;\n","import {ChangeDetectionStrategy, Component, DestroyRef, inject, Input, signal, TemplateRef,} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {CommonModule} from '@angular/common';\nimport {MnAlertStore} from '../mn-alert.store';\nimport {MnAlert, MnAlertId} from '../mn-alert.types';\nimport {mnAlertVariants} from '../mn-alertVariants';\nimport {MnButton} from 'mn-angular-lib/button';\nimport {MnLanguageService} from 'mn-angular-lib/core';\n\nexport type MnAlertTemplateContext = {\n  $implicit: MnAlert;\n  alert: MnAlert;\n  dismiss: () => void;\n}\n\n/**\n * A view-owned wrapper around a single {@link MnAlert}. The store's list is the source\n * of truth for which alerts *exist*; this outlet mirrors it into `views` so a removed\n * alert can play a leave animation (swipe-fling or fade + height-collapse) before its\n * node is actually dropped, rather than vanishing instantly.\n */\ntype MnAlertView = {\n  alert: MnAlert;\n  /** True once the alert has left the store — the node is animating out and will be removed. */\n  leaving: boolean;\n  /** True while the user is actively dragging this card (disables the snap transition). */\n  dragging: boolean;\n  /** Live drag offset (px) along the active swipe axis while swiping. */\n  drag: number;\n  /** Final offset (px) along the swipe axis the card flings to when a swipe dismisses it. */\n  fling: number;\n};\n\n@Component({\n  selector: 'mn-alert-outlet',\n  standalone: true,\n  imports: [CommonModule, MnButton],\n  templateUrl: './mn-alert-outlet.html',\n  styleUrl: './mn-alert-outlet.css',\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MnAlertOutletComponent {\n  private readonly lang = inject(MnLanguageService);\n  private readonly store = inject(MnAlertStore);\n  private readonly destroyRef = inject(DestroyRef);\n\n  /** Drag distance (px) past which a release dismisses regardless of speed. */\n  private static readonly SWIPE_DISMISS_THRESHOLD = 96;\n  /** Release speed (px/ms) above which a short drag still dismisses — a \"flick\". */\n  private static readonly FLICK_VELOCITY = 0.4;\n  /** Minimum drag distance (px) a flick must cover, so an incidental fast tap never dismisses. */\n  private static readonly FLICK_MIN_DISTANCE = 24;\n  /** Upper bound for the leave wait; kept a touch longer than the CSS exit so removal never\n   *  preempts the animation. Mirrored by the `--mn-alert-exit` duration in the stylesheet. */\n  private static readonly EXIT_MS = 320;\n  /** Opacity floor a card fades to at the dismiss threshold, for drag feedback. */\n  private static readonly DRAG_OPACITY_FLOOR = 0.35;\n\n  /**\n   * How the dismiss swipe is oriented:\n   * - `'auto'` (default) matches the host platform's convention — Apple platforms\n   *   (iOS/iPadOS/macOS) flick a top banner *upward*, so we swipe vertically; Android (and\n   *   every other platform) dismisses toasts *to the right*, so we swipe horizontally.\n   *\n   * Either axis is one-directional: only an upward (vertical) or rightward (horizontal)\n   * drag dismisses; dragging the opposite way springs the card back.\n   * - `'vertical'` / `'horizontal'` force the axis regardless of platform. Useful when the\n   *   host can't be sniffed reliably (e.g. Chrome DevTools *Responsive* mode does not spoof\n   *   the user agent, so `'auto'` there resolves to the desktop/Android horizontal axis).\n   */\n  @Input() swipeAxis: 'auto' | 'vertical' | 'horizontal' = 'auto';\n\n  /** Whether the running device is an Apple platform. Sniffed once from `navigator` at\n   *  construction (the UA is read at page load and does not change mid-session). */\n  private readonly isApple = this.detectApple();\n\n  /** The resolved swipe axis: the explicit {@link swipeAxis} override, or the platform\n   *  default when left on `'auto'`. */\n  private get vertical(): boolean {\n    if (this.swipeAxis === 'vertical') return true;\n    if (this.swipeAxis === 'horizontal') return false;\n    return this.isApple;\n  }\n\n  /**\n   * Accessible name for this control. Resolved through the conventional\n   * `mnAlert.close` key so an app can translate it, falling back to English when the\n   * key is not defined rather than leaking the raw key into the UI.\n   */\n  get closeLabel(): string {\n    return this.lang.translateIfPresent('mnAlert.close') ?? 'Close';\n  }\n\n  @Input() template?: TemplateRef<MnAlertTemplateContext>;\n\n  /** The view-layer mirror of the store's alerts, retaining alerts mid-leave. A signal so\n   *  writes from the (external) store subscription and leave timers schedule change\n   *  detection in a zoneless app. */\n  readonly views = signal<MnAlertView[]>([]);\n\n  /**\n   * `touch-action` for the swipe wrapper: reserve the swipe axis for our gesture while\n   * leaving the cross-axis to the browser. Vertical swipe (Apple) claims the Y axis\n   * (`pan-x`); horizontal swipe (Android/other) claims the X axis (`pan-y`).\n   */\n  get touchAction(): string {\n    return this.vertical ? 'pan-x' : 'pan-y';\n  }\n\n  /** In-flight leave-removal timers, keyed by alert id, cleared on destroy so a fired\n   *  timer never touches a torn-down view. */\n  private readonly exitTimers = new Map<MnAlertId, ReturnType<typeof setTimeout>>();\n\n  /** The single active swipe, or null. Only one card is dragged at a time. `startCoord`\n   *  and the samples are taken along the active axis (Y when vertical, else X). */\n  private activeDrag: {\n    view: MnAlertView;\n    startCoord: number;\n    lastSample: { c: number; t: number };\n    prevSample: { c: number; t: number };\n  } | null = null;\n\n  constructor() {\n    this.store.alerts$\n      .pipe(takeUntilDestroyed())\n      .subscribe(alerts => this.sync(alerts));\n\n    this.destroyRef.onDestroy(() => {\n      this.exitTimers.forEach(t => clearTimeout(t));\n      this.exitTimers.clear();\n    });\n  }\n\n  trackById = (_: number, v: MnAlertView) => v.alert.id;\n\n  getAlertClasses(a: MnAlert) {\n    return mnAlertVariants({kind: a.kind, variant: a.variant});\n  }\n\n  /**\n   * The lifetime (ms) to run the countdown bar over, or null when no bar should show: an alert\n   * that never auto-dismisses has nothing to count down, and one already leaving would only\n   * restart the animation mid-exit.\n   */\n  countdownDuration(v: MnAlertView): number | null {\n    if (v.leaving) return null;\n    const duration = v.alert.duration;\n    return typeof duration === 'number' && duration > 0 ? duration : null;\n  }\n\n  contextFor(a: MnAlert) {\n    return {\n      $implicit: a,\n      alert: a,\n      dismiss: () => this.dismissAlert(a.id)\n    } as const;\n  }\n\n  /** Dismisses via the store; the store's removal is turned into a leave animation by\n   *  {@link sync}. Used by the close button and the custom-template `dismiss` context. */\n  dismissAlert(id: MnAlertId) {\n    this.store.dismiss(id);\n  }\n\n  // =========================\n  // Store → view reconciliation\n  // =========================\n\n  /** Reconciles the view list against the store: appends new alerts, updates the alert\n   *  reference for still-present ones, and marks vanished ones as leaving (they stay in the\n   *  list, animating out, until their removal timer fires). */\n  private sync(alerts: MnAlert[]): void {\n    const current = this.views();\n    const existing = new Set(current.map(v => v.alert.id));\n    const storeById = new Map(alerts.map(a => [a.id, a]));\n\n    const next: MnAlertView[] = [];\n    for (const v of current) {\n      const fresh = storeById.get(v.alert.id);\n      if (fresh) {\n        v.alert = fresh;\n      } else if (!v.leaving) {\n        this.beginLeave(v);\n      }\n      next.push(v);\n    }\n    for (const a of alerts) {\n      if (!existing.has(a.id)) {\n        next.push({alert: a, leaving: false, dragging: false, drag: 0, fling: 0});\n      }\n    }\n    this.views.set(next);\n  }\n\n  /** Flags a view as leaving and schedules its removal once the exit animation has run.\n   *  Idempotent: a card already leaving (e.g. flung by a swipe) is left untouched, so a\n   *  synchronous store re-emit cannot overwrite the swipe direction with the default fade. */\n  private beginLeave(v: MnAlertView, fling?: number): void {\n    if (v.leaving) return;\n    v.leaving = true;\n    v.dragging = false;\n    if (fling !== undefined) v.fling = fling;\n\n    const delay = this.prefersReducedMotion() ? 0 : MnAlertOutletComponent.EXIT_MS;\n    const timer = setTimeout(() => this.removeView(v.alert.id), delay);\n    this.exitTimers.set(v.alert.id, timer);\n  }\n\n  private removeView(id: MnAlertId): void {\n    const timer = this.exitTimers.get(id);\n    if (timer) {\n      clearTimeout(timer);\n      this.exitTimers.delete(id);\n    }\n    this.views.update(list => list.filter(v => v.alert.id !== id));\n  }\n\n  // =========================\n  // Swipe-to-dismiss\n  // =========================\n\n  onPointerDown(event: PointerEvent, v: MnAlertView): void {\n    if (v.leaving) return;\n    // Don't hijack a press that begins on an interactive control inside the alert.\n    if ((event.target as HTMLElement).closest('button, a, input, textarea, select')) return;\n    if (event.button !== undefined && event.button !== 0) return;\n\n    const coord = this.axisCoord(event);\n    this.activeDrag = {\n      view: v,\n      startCoord: coord,\n      lastSample: {c: coord, t: event.timeStamp},\n      prevSample: {c: coord, t: event.timeStamp},\n    };\n    v.dragging = true;\n    (event.currentTarget as HTMLElement).setPointerCapture?.(event.pointerId);\n  }\n\n  onPointerMove(event: PointerEvent, v: MnAlertView): void {\n    const drag = this.activeDrag;\n    if (!drag || drag.view !== v) return;\n    const delta = this.axisCoord(event) - drag.startCoord;\n    // Dismissal is one-directional: vertical (Apple) tracks upward only (clamp ≤ 0),\n    // horizontal (Android/other) tracks rightward only (clamp ≥ 0). A drag the other way\n    // rests at 0 and springs back.\n    v.drag = this.vertical ? Math.min(0, delta) : Math.max(0, delta);\n    drag.prevSample = drag.lastSample;\n    drag.lastSample = {c: this.axisCoord(event), t: event.timeStamp};\n  }\n\n  onPointerUp(event: PointerEvent, v: MnAlertView): void {\n    const drag = this.activeDrag;\n    if (!drag || drag.view !== v) return;\n    this.activeDrag = null;\n    v.dragging = false;\n\n    if (this.shouldDismiss(drag, v)) {\n      // Fling the card the rest of the way off its edge, then dismiss through the store.\n      // Vertical flings upward (off the top); horizontal flings rightward (off the right).\n      const extent = this.viewportExtent() + Math.abs(v.drag);\n      const fling = this.vertical ? -extent : extent;\n      this.beginLeave(v, fling);\n      this.store.dismiss(v.alert.id);\n    } else {\n      // Snap back to rest; the wrapper's transition eases the offset → 0.\n      v.drag = 0;\n    }\n    // Notify: pointerup is template-bound (schedules CD), but the leave/snap mutations live\n    // on the view object — re-set the signal so the new transform is reflected reliably.\n    this.views.update(list => [...list]);\n  }\n\n  private shouldDismiss(\n    drag: NonNullable<typeof this.activeDrag>,\n    v: MnAlertView\n  ): boolean {\n    if (Math.abs(v.drag) > MnAlertOutletComponent.SWIPE_DISMISS_THRESHOLD) return true;\n    const dt = drag.lastSample.t - drag.prevSample.t;\n    const velocity = dt > 0 ? Math.abs(drag.lastSample.c - drag.prevSample.c) / dt : 0;\n    return velocity > MnAlertOutletComponent.FLICK_VELOCITY\n      && Math.abs(v.drag) > MnAlertOutletComponent.FLICK_MIN_DISTANCE;\n  }\n\n  // =========================\n  // Template style helpers\n  // =========================\n\n  /** Offset transform for a card: the fling target while leaving via swipe, otherwise the\n   *  live drag offset, translated along the active axis. Returns null when neither applies,\n   *  letting the stylesheet own the default (fade-in-place) leave. */\n  itemTransform(v: MnAlertView): string | null {\n    if (v.leaving) {\n      return v.fling !== 0 ? this.translate(v.fling) : null;\n    }\n    return v.drag !== 0 ? this.translate(v.drag) : null;\n  }\n\n  /** Fades a card toward a floor as it is dragged toward the dismiss threshold. Null (CSS\n   *  owns opacity) when at rest or leaving. */\n  itemOpacity(v: MnAlertView): number | null {\n    if (v.leaving || !v.dragging || v.drag === 0) return null;\n    const progress = Math.min(Math.abs(v.drag) / MnAlertOutletComponent.SWIPE_DISMISS_THRESHOLD, 1);\n    return 1 - progress * (1 - MnAlertOutletComponent.DRAG_OPACITY_FLOOR);\n  }\n\n  private translate(px: number): string {\n    return this.vertical ? `translateY(${px}px)` : `translateX(${px}px)`;\n  }\n\n  private axisCoord(event: PointerEvent): number {\n    return this.vertical ? event.clientY : event.clientX;\n  }\n\n  private viewportExtent(): number {\n    if (typeof window === 'undefined') return 400;\n    return this.vertical ? window.innerHeight : window.innerWidth;\n  }\n\n  /** Whether the current device runs an Apple OS (iOS/iPadOS/macOS). iPadOS 13+ masquerades\n   *  as a Mac, so it is caught by the touch-capable-Mac branch. */\n  private detectApple(): boolean {\n    if (typeof navigator === 'undefined') return false;\n    const ua = navigator.userAgent ?? '';\n    const platform = navigator.platform ?? '';\n    const isIOS = /iP(hone|ad|od)/.test(platform) || /iPad|iPhone|iPod/.test(ua);\n    const isTouchMac = /Mac/.test(platform + ' ' + ua)\n      && typeof document !== 'undefined' && 'ontouchend' in document;\n    const isMac = /Mac/.test(ua);\n    return isIOS || isTouchMac || isMac;\n  }\n\n  private prefersReducedMotion(): boolean {\n    return typeof window !== 'undefined'\n      && typeof window.matchMedia === 'function'\n      && window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n  }\n}\n","<!-- The stack is a polite live region so every toast is announced; an error toast upgrades itself to an alert. -->\n<div aria-live=\"polite\" role=\"status\" class=\"fixed top-4 left-0 right-0 z-[9999] flex flex-col w-full px-2 sm:px-0 sm:left-auto sm:right-4 sm:max-w-sm\">\n  @for (v of views(); track trackById($index, v)) {\n    <div\n      class=\"mn-alert-item\"\n      [attr.role]=\"v.alert.kind === 'error' ? 'alert' : null\"\n      [class.dragging]=\"v.dragging\"\n      [class.leaving]=\"v.leaving\"\n      [style.touch-action]=\"touchAction\"\n      [style.transform]=\"itemTransform(v)\"\n      [style.opacity]=\"itemOpacity(v)\"\n      (pointerdown)=\"onPointerDown($event, v)\"\n      (pointermove)=\"onPointerMove($event, v)\"\n      (pointerup)=\"onPointerUp($event, v)\"\n      (pointercancel)=\"onPointerUp($event, v)\"\n    >\n      <div class=\"mn-alert-inner\">\n        @if (template) {\n          <ng-container\n            [ngTemplateOutlet]=\"template\"\n            [ngTemplateOutletContext]=\"contextFor(v.alert)\">\n          </ng-container>\n        } @else {\n          <div [class.extra]=\"v.alert.cssClass\" [class]=\"getAlertClasses(v.alert)\" class=\"relative overflow-hidden\">\n            <div class=\"flex-1 min-w-0 pr-8\">\n              <h4 class=\"font-semibold text-sm\">{{ v.alert.title }}</h4>\n              @if (v.alert.subTitle) {\n                <p class=\"text-sm mt-1 opacity-90 leading-tight\">{{ v.alert.subTitle }}</p>\n              }\n            </div>\n            <button\n              [attr.aria-label]=\"closeLabel\"\n              mnButton\n              [data]=\"{ size: 'md', variant: 'text' }\"\n              (click)=\"dismissAlert(v.alert.id)\"\n              class=\"absolute top-2 right-2 shrink-0 !text-current hover:!bg-current/10\"\n              type=\"button\"\n            >\n              &times;\n            </button>\n            @if (countdownDuration(v); as ms) {\n              <span aria-hidden=\"true\" class=\"mn-alert-progress\">\n                <span [style.animation-duration.ms]=\"ms\" class=\"mn-alert-progress-bar\"></span>\n              </span>\n            }\n          </div>\n        }\n      </div>\n    </div>\n  }\n</div>\n","/**\n * Public API of the `mn-angular-lib/alert` entry point: toast alerts.\n *\n * Each entry point is its own module in the published package, so a consumer's bundler\n * splits it into the chunk that uses it instead of loading the whole library at startup.\n * The root `mn-angular-lib` entry re-exports every entry point.\n */\nexport * from './src/mn-alert';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;MAmBa,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB;AAE3E,MAAM,uBAAuB,GAA4B;IAC9D,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AACnF,IAAA,UAAU,EAAE;AACV,QAAA,OAAO,EAAE,kBAAkB;AAC3B,QAAA,IAAI,EAAE,eAAe;AACrB,QAAA,OAAO,EAAE,kBAAkB;AAC3B,QAAA,KAAK,EAAE,gBAAgB;AACvB,QAAA,OAAO,EAAE;AACV,KAAA;AACD,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,gBAAgB,EAAE,IAAI;AACtB,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,QAAQ,EAAE,CAAC,CAAC,KAAK;;;AC7Bb,SAAU,eAAe,CAAC,MAAA,GAAwB,EAAE,EAAA;AACxD,IAAA,MAAM,MAAM,GAAkB;AAC5B,QAAA,GAAG,uBAAuB;AAC1B,QAAA,GAAG,MAAM;AACT,QAAA,SAAS,EAAE,EAAE,GAAG,uBAAuB,CAAC,SAAS,EAAE,IAAI,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE;AAChF,QAAA,UAAU,EAAE,EAAE,GAAG,uBAAuB,CAAC,UAAU,EAAE,I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