/**
 * @fileoverview AI Analytics Shell — Resource Component
 *
 * Main resource component for the AI Analytics dashboard. Provides a left
 * navigation panel and content area that switches between analytics sections:
 * Executive Summary, Prompt Runs, Agent Runs, Model Performance, Cost & Budget,
 * Error Analysis, and Usage Patterns.
 *
 * Persists the active section and filter state via UserInfoEngine settings
 * with debounced writes.
 */
import { OnInit, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
import { ResourceData } from '@memberjunction/core-entities';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { GlobalFilterState } from '../../interfaces/analytics-preferences.interface';
import { FilterFieldConfig, MJLeftNavItem, MJLeftNavSection } from '@memberjunction/ng-ui-components';
import * as i0 from "@angular/core";
interface NavItem {
    Label?: string;
    Icon?: string;
    Key: string;
    /**
     * Short prose used as the Subtitle on this section's
     * <mj-page-header-interior> card. Omitted for the `divider` entry.
     */
    Description?: string;
}
export declare class AIAnalyticsResourceComponent extends BaseResourceComponent implements OnInit, OnDestroy {
    private readonly USER_SETTINGS_KEY;
    private settingsPersistSubject;
    protected destroy$: Subject<void>;
    private settingsLoaded;
    private cdr;
    private executiveSummary?;
    private promptRuns?;
    /**
     * Active analytics section. Implemented as a getter/setter so that changing
     * it recomputes the (section-dependent) filter-field config exactly once,
     * rather than rebuilding the whole FilterFieldConfig[] on every
     * change-detection pass (the field config is template-bound twice).
     */
    private _activeSection;
    get ActiveSection(): string;
    set ActiveSection(value: string);
    CurrentTimeRange: string;
    CurrentFilters: GlobalFilterState;
    /** Single-value SortBy used by Model Performance (lives on the shared chrome). */
    CurrentSortBy: string;
    /** Single-value Vendor filter used by Model Performance (lives on the shared chrome). */
    CurrentVendor: string;
    /** SortBy options for Model Performance leaderboard. */
    readonly sortByOptions: {
        text: string;
        value: string;
    }[];
    private _modelOptions;
    private _agentOptions;
    private _promptOptions;
    private _vendorOptions;
    /** Vendor options, built from AIEngineBase for the Model Performance leaderboard. */
    get vendorOptions(): {
        text: string;
        value: string;
    }[];
    /** Per-section filter-bar config — switched on ActiveSection. */
    get FilterBarConfig(): {
        ShowModelFilter: boolean;
        ShowAgentFilter: boolean;
        ShowPromptFilter: boolean;
        ShowStatusFilter: boolean;
        ShowSortBy: boolean;
        ShowVendor: boolean;
        ShowCompareToggle: boolean;
        ShowExportButton: boolean;
        TimeRangeOptions: string[];
    };
    /**
     * Always true now — every section uses the shared chrome filter bar.
     * Kept as a getter for future per-section carve-outs.
     */
    get ShowSharedFilterBar(): boolean;
    /** Status options used by the popover dropdown when the section has ShowStatusFilter. */
    readonly statusOptions: {
        text: string;
        value: string;
    }[];
    /** Built from AIEngineBase (see recomputeOptionLists). */
    get modelOptions(): {
        text: string;
        value: string;
    }[];
    get agentOptions(): {
        text: string;
        value: string;
    }[];
    get promptOptions(): {
        text: string;
        value: string;
    }[];
    /**
     * Build the four option lists from AIEngineBase's cached metadata. Called once
     * after the engine is loaded (ngOnInit). Mirrors the exact map/filter/sort the
     * former getters performed, so the values are identical — just computed once.
     *
     * Accepted staleness tradeoff: these lists are built once after engine load and
     * are NOT reactive — a mid-session AIEngineBase metadata reload (new model/agent/
     * prompt/vendor) would not refresh them until this component is re-created. That
     * is acceptable for an analytics surface (its option lists are near-static within
     * a session); we deliberately do NOT wire observable reactivity here. The former
     * getters re-read the engine on every CD, which was the perf cost we removed.
     */
    private recomputeOptionLists;
    /** Time-range chip options for the toolbar slot. */
    get timeRangeChipOptions(): {
        text: string;
        value: string;
    }[];
    /** Compare-mode visual state (kept on the shell now that analytics-filter-bar is gone). */
    compareActive: boolean;
    /**
     * Precomputed popover field config for the active section. Recomputed only when
     * ActiveSection changes (via its setter) or after the option lists load — NOT
     * on every CD pass, even though the template binds this twice (the `@if` guard
     * and the `[Fields]` input).
     */
    private _analyticsFilterFields;
    /** Field config for the popover, based on the active section (precomputed). */
    get analyticsFilterFields(): FilterFieldConfig[];
    /** Rebuild {@link _analyticsFilterFields} for the current section from the option lists. */
    private recomputeFilterFields;
    /** Single-value flattened state for the centralized panel (the panel takes scalar values; we hold arrays in CurrentFilters). */
    get analyticsFilterValues(): Record<string, unknown>;
    /** Receive popover updates and translate scalar → array shape used by GlobalFilterState. */
    onAnalyticsFilterValuesChange(values: Record<string, unknown>): void;
    /** Reset only the popover filters — leaves TimeRange and CompareActive alone. */
    resetPopoverFilters(): void;
    /** Active filter count for the popover badge. */
    get ActiveFilterCount(): number;
    /** Toggle Compare mode — the mjButton directive owns the [(selected)] flip, so this handler only forwards the new value. */
    toggleCompare(): void;
    readonly NavItems: NavItem[];
    /**
     * Active section metadata — drives <mj-page-header-interior> Title +
     * Subtitle. Mirrors the pattern in KH Configuration / KH Analytics: one
     * source of truth (NavItems) used both to build the rail and to render
     * per-section identity.
     */
    get currentSection(): NavItem | undefined;
    /**
     * Wraps `NavItems` for `<mj-left-nav>`. The `{ Key: 'divider' }` entry
     * splits the items into two `MJLeftNavSection`s (an unlabeled section per
     * group) — the rail's natural section break replaces the bespoke
     * `.nav-divider` line.
     */
    get navSections(): MJLeftNavSection[];
    /** Adapter for `<mj-left-nav>`'s `(ItemClicked)` output. */
    onNavItemClicked(item: MJLeftNavItem): void;
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    GetResourceDisplayName(data: ResourceData): Promise<string>;
    GetResourceIconClass(data: ResourceData): Promise<string>;
    /** Navigate to a different analytics section */
    OnSectionChange(key: string): void;
    /** Handle time range changes from the filter bar */
    OnTimeRangeChange(range: string): void;
    /** Handle filter changes from the filter bar */
    OnFiltersChange(filters: GlobalFilterState): void;
    /** Compare-toggle button — only visible on Executive Summary; forwards to that section. */
    OnCompareToggled(value: boolean): void;
    /** Export button — only visible on Prompt Runs; forwards to that section. */
    OnExportClicked(): void;
    private setupSettingsDebounce;
    private loadUserSettings;
    private saveUserSettings;
    private persistUserSettings;
    static ɵfac: i0.ɵɵFactoryDeclaration<AIAnalyticsResourceComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AIAnalyticsResourceComponent, "app-ai-analytics-resource", never, {}, {}, never, never, false, never>;
}
export declare function LoadAIAnalyticsResource(): void;
export {};
//# sourceMappingURL=ai-analytics-resource.component.d.ts.map