import { OnInit, OnDestroy, EventEmitter, ChangeDetectorRef, ViewContainerRef } from '@angular/core';
import { Observable } from 'rxjs';
import { TestingDialogService } from '@memberjunction/ng-testing';
import { EvaluationPreferences } from '@memberjunction/ng-testing';
import { TestingInstrumentationService, TestRunWithFeedbackSummary } from '../services/testing-instrumentation.service';
import * as i0 from "@angular/core";
type StatusFilter = 'all' | 'running' | 'passed' | 'failed' | 'error';
type TimeRange = 'today' | 'week' | 'month' | '90days';
interface RunsFilterState {
    status: StatusFilter;
    timeRange: TimeRange;
    searchText: string;
}
interface FilteredStats {
    totalRuns: number;
    passRate: number;
    avgDuration: number;
    totalCost: number;
}
export declare class TestingRunsComponent implements OnInit, OnDestroy {
    instrumentationService: TestingInstrumentationService;
    private testingDialogService;
    private cdr;
    private viewContainerRef;
    initialState: Record<string, unknown> | null;
    /** When true, the inner bespoke .page-header is hidden — the parent shell owns the chrome. */
    HideToolbar: boolean;
    stateChange: EventEmitter<Record<string, unknown>>;
    private destroy$;
    private filterTrigger$;
    filterState: RunsFilterState;
    feedbackRating: number;
    feedbackIsCorrect: boolean | null;
    feedbackComments: string;
    IsSubmittingFeedback: boolean;
    IsRefreshing: boolean;
    SelectedRun: TestRunWithFeedbackSummary | null;
    /** Latest filtered/visible runs, cached for state reporting (agent context). */
    private latestVisibleRuns;
    EvalPreferences: EvaluationPreferences;
    FilteredRuns$: Observable<TestRunWithFeedbackSummary[]>;
    FilteredStats$: Observable<FilteredStats>;
    readonly StatusChips: Array<{
        value: StatusFilter;
        label: string;
        icon: string;
    }>;
    readonly RatingValues: number[];
    constructor(instrumentationService: TestingInstrumentationService, testingDialogService: TestingDialogService, cdr: ChangeDetectorRef, viewContainerRef: ViewContainerRef);
    ngOnInit(): void;
    /**
     * Apply agent-driven run-SELECTION intents published on the shared
     * instrumentation service (from the dashboard's `SelectTestRun` / open-run
     * client tools). The dashboard owns no `SelectedRun` UI state — it publishes a
     * target run id (+ open flag + monotonic nonce) here, and this surface resolves
     * it against the currently-loaded runs. Read-only navigational affordance:
     * selecting opens the detail panel; `open` additionally opens the run's record
     * in the entity workspace. Neither executes a test.
     */
    private subscribeToAgentSelectionIntents;
    /**
     * Apply agent-driven filter intents published on the shared instrumentation
     * service (from the Testing dashboard's `FilterTestsByStatus` / `SearchTests`
     * client tools). Decouples those tools from this component's lifetime — the
     * intent is replayed via BehaviorSubject when this surface mounts.
     */
    private subscribeToAgentFilterIntents;
    ngOnDestroy(): void;
    OnEscapeKey(): void;
    SetStatusFilter(status: StatusFilter): void;
    OnTimeRangeChange(event: Event): void;
    OnSearchInput(event: Event): void;
    ClearSearch(): void;
    Refresh(): void;
    StartNewTest(): void;
    SelectRun(run: TestRunWithFeedbackSummary): void;
    CloseDetailPanel(): void;
    NavigateToTest(run: TestRunWithFeedbackSummary, event: MouseEvent): void;
    RerunTest(run: TestRunWithFeedbackSummary): void;
    SubmitFeedback(): Promise<void>;
    OnFeedbackCommentInput(event: Event): void;
    TrackByRunId(_index: number, run: TestRunWithFeedbackSummary): string;
    FormatDuration(milliseconds: number): string;
    FormatRelativeTime(date: Date): string;
    FormatDateTime(date: Date): string;
    FormatPercent(value: number): string;
    FormatCostTotal(cost: number): string;
    private setupObservables;
    private applyClientFilters;
    private filterByStatus;
    private filterBySearch;
    private sortRunsWithRunningFirst;
    private computeStats;
    private updateServiceDateRange;
    private applyInitialState;
    private emitStateChange;
    private resetFeedbackForm;
    private formatShortDate;
    static ɵfac: i0.ɵɵFactoryDeclaration<TestingRunsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<TestingRunsComponent, "app-testing-runs", never, { "initialState": { "alias": "initialState"; "required": false; }; "HideToolbar": { "alias": "HideToolbar"; "required": false; }; }, { "stateChange": "stateChange"; }, never, never, false, never>;
}
export {};
//# sourceMappingURL=testing-runs.component.d.ts.map