import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { Observable } from 'rxjs';
import { AIInstrumentationService, DashboardKPIs, TrendData, LiveExecution, ChartData, ExecutionDetails } from '../services/ai-instrumentation.service';
import { DataPointClickEvent } from './charts/time-series-chart.component';
import { KPICardData } from './widgets/kpi-card.component';
import { HeatmapData } from './charts/performance-heatmap.component';
import { ResourceData } from "@memberjunction/core-entities";
import { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';
import * as i0 from "@angular/core";
export interface DrillDownTab {
    id: string;
    title: string;
    type: 'chart' | 'executions' | 'model-detail';
    data?: any;
    timestamp?: Date;
    metric?: string;
    closeable: boolean;
}
export interface ExecutionRecord {
    id: string;
    type: 'prompt' | 'agent';
    name: string;
    model?: string;
    status: string;
    startTime: Date;
    endTime?: Date;
    duration: number;
    cost: number;
    tokens: number;
    errorMessage?: string;
}
export interface ExecutionMonitoringState {
    selectedTimeRange: string;
    refreshInterval: number;
    panelStates: {
        cost: boolean;
        efficiency: boolean;
        executions: boolean;
    };
    drillDownTabs: Array<{
        id: string;
        title: string;
        type: string;
        timestamp?: string;
        metric?: string;
    }>;
    activeTabId: string;
    splitterSizes?: number[];
}
/**
 * AI Monitor Resource - displays AI execution monitoring and analytics
 * Extends BaseResourceComponent to work with the resource type system
 */
export declare class ExecutionMonitoringComponent extends BaseResourceComponent implements OnInit, OnDestroy {
    private instrumentationService;
    private navigationService;
    private cdr;
    private destroy$;
    private stateChangeSubject$;
    selectedTimeRange: string;
    isLoading: boolean;
    timeSeriesConfig: {
        showGrid: boolean;
        showTooltip: boolean;
        animationDuration: number;
        useDualAxis: boolean;
    };
    heatmapConfig: {
        height: number;
        showTooltip: boolean;
        animationDuration: number;
    };
    kpis$: Observable<DashboardKPIs>;
    trends$: Observable<TrendData[]>;
    liveExecutions$: Observable<LiveExecution[]>;
    chartData$: Observable<ChartData>;
    kpiCards$: Observable<KPICardData[]>;
    performanceMatrix$: Observable<HeatmapData[]>;
    costData$: Observable<{
        model: string;
        cost: number;
        tokens: number;
    }[]>;
    tokenEfficiency$: Observable<{
        inputTokens: number;
        outputTokens: number;
        cost: number;
        model: string;
    }[]>;
    selectedExecution: LiveExecution | null;
    executionDetails: ExecutionDetails | null;
    loadingExecutionDetails: boolean;
    drillDownTabs: DrillDownTab[];
    activeTabId: string;
    loadingDrillDown: boolean;
    panelStates: {
        cost: boolean;
        efficiency: boolean;
        executions: boolean;
    };
    get activeTab(): DrillDownTab | undefined;
    constructor(instrumentationService: AIInstrumentationService, navigationService: NavigationService, cdr: ChangeDetectorRef);
    ngOnInit(): void;
    ngOnDestroy(): void;
    private getCurrentState;
    private emitStateChange;
    loadUserState(state: Partial<ExecutionMonitoringState>): void;
    private createKPICards;
    onTimeRangeChange(): void;
    private setTimeRange;
    private getTimeRangeFromSelection;
    refreshData(): void;
    onExecutionClick(execution: LiveExecution): void;
    onDataPointClick(event: DataPointClickEvent): void;
    onChartTimeRangeChange(range: string): void;
    private getMetricValue;
    private formatMetricValue;
    private loadExecutionDetails;
    closeExecutionModal(): void;
    openFullRecord(): void;
    trackByKpiTitle(index: number, kpi: KPICardData): string;
    trackByCostModel(index: number, item: {
        model: string;
        cost: number;
        tokens: number;
    }): string;
    trackByEfficiencyModel(index: number, item: {
        model: string;
        inputTokens: number;
        outputTokens: number;
        cost: number;
    }): string;
    formatTokens(tokens: number): string;
    formatCurrency(amount: number, decimals?: number): string;
    formatCostPerToken(cost: number, tokens: number): string;
    getCostBarWidth(cost: number, maxCost: number): number;
    getMaxCost(costData: {
        cost: number;
    }[]): number;
    getTokenRatio(input: number, output: number): string;
    getTokenPercentage(tokens: number, total: number): number;
    getCostPerToken(cost: number, tokens: number): string;
    selectTab(tabId: string): void;
    closeTab(event: MouseEvent, tabId: string): void;
    onKpiClick(kpi: KPICardData): void;
    isKpiClickable(kpi: KPICardData): boolean;
    private openModelDrillDown;
    private loadDrillDownData;
    private loadModelDetails;
    formatTimestamp(timestamp: Date): string;
    formatTime(time: Date): string;
    getMetricDisplayLabel(metric: string): string;
    getFormattedTimestamp(tab: DrillDownTab | undefined): string;
    getFormattedMetricLabel(tab: DrillDownTab | undefined): string;
    togglePanel(panelName: 'cost' | 'efficiency' | 'executions'): void;
    viewExecutionDetail(execution: ExecutionRecord): void;
    formatDuration(milliseconds: number): string;
    getDuration(details: ExecutionDetails): number;
    onSplitterLayoutChange(event: any): void;
    /**
     * Get the display name for this resource
     */
    GetResourceDisplayName(data: ResourceData): Promise<string>;
    /**
     * Get the icon class for this resource
     */
    GetResourceIconClass(data: ResourceData): Promise<string>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ExecutionMonitoringComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ExecutionMonitoringComponent, "app-execution-monitoring", never, {}, {}, never, never, false, never>;
}
//# sourceMappingURL=execution-monitoring.component.d.ts.map