var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { BaseDashboard } from '@memberjunction/ng-shared';
import { RegisterClass } from '@memberjunction/global';
import { Subject } from 'rxjs';
import { debounceTime, takeUntil } from 'rxjs/operators';
import * as i0 from "@angular/core";
import * as i1 from "@memberjunction/ng-testing";
import * as i2 from "@memberjunction/ng-versions";
import * as i3 from "@memberjunction/ng-shared-generic";
import * as i4 from "./components/testing-dashboard-tab.component";
import * as i5 from "./components/testing-runs.component";
import * as i6 from "./components/testing-analytics.component";
import * as i7 from "./components/testing-review.component";
function TestingDashboardComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 1);
    i0.ɵɵelement(1, "mj-loading", 3);
    i0.ɵɵelementEnd();
} }
function TestingDashboardComponent_Conditional_2_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵelement(1, "i", 11);
    i0.ɵɵelementStart(2, "span", 12);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "span", 13);
    i0.ɵɵtext(5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "button", 14);
    i0.ɵɵlistener("click", function TestingDashboardComponent_Conditional_2_Conditional_0_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnViewActiveRun(ctx_r1.ActiveRuns[0])); });
    i0.ɵɵtext(7, "View");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate2("", ctx_r1.ActiveRuns.length, " test", ctx_r1.ActiveRuns.length === 1 ? "" : "s", " running");
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2("", ctx_r1.ActiveRuns[0].TestName, " \u2014 ", ctx_r1.ActiveRuns[0].Progress, "%");
} }
function TestingDashboardComponent_Conditional_2_For_4_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 15);
    i0.ɵɵlistener("click", function TestingDashboardComponent_Conditional_2_For_4_Template_div_click_0_listener() { const $index_r4 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onTabChange(ctx_r1.navigationItems[$index_r4])); });
    i0.ɵɵelement(1, "i");
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const navItem_r5 = ctx.$implicit;
    i0.ɵɵclassProp("active", navItem_r5.selected);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(navItem_r5.icon);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(navItem_r5.text);
} }
function TestingDashboardComponent_Conditional_2_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "app-testing-dashboard-tab", 16);
    i0.ɵɵlistener("stateChange", function TestingDashboardComponent_Conditional_2_Conditional_8_Template_app_testing_dashboard_tab_stateChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onDashboardStateChange($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("initialState", ctx_r1.dashboardState);
} }
function TestingDashboardComponent_Conditional_2_Conditional_9_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "app-testing-runs", 16);
    i0.ɵɵlistener("stateChange", function TestingDashboardComponent_Conditional_2_Conditional_9_Template_app_testing_runs_stateChange_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onRunsStateChange($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("initialState", ctx_r1.runsState);
} }
function TestingDashboardComponent_Conditional_2_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "app-testing-analytics", 16);
    i0.ɵɵlistener("stateChange", function TestingDashboardComponent_Conditional_2_Conditional_10_Template_app_testing_analytics_stateChange_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onAnalyticsStateChange($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("initialState", ctx_r1.analyticsState);
} }
function TestingDashboardComponent_Conditional_2_Conditional_11_Template(rf, ctx) { if (rf & 1) {
    const _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "app-testing-review", 16);
    i0.ɵɵlistener("stateChange", function TestingDashboardComponent_Conditional_2_Conditional_11_Template_app_testing_review_stateChange_0_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onReviewStateChange($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("initialState", ctx_r1.reviewState);
} }
function TestingDashboardComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵconditionalCreate(0, TestingDashboardComponent_Conditional_2_Conditional_0_Template, 8, 4, "div", 4);
    i0.ɵɵelementStart(1, "div", 5)(2, "div", 6);
    i0.ɵɵrepeaterCreate(3, TestingDashboardComponent_Conditional_2_For_4_Template, 4, 5, "div", 7, i0.ɵɵrepeaterTrackByIndex);
    i0.ɵɵelement(5, "div", 8)(6, "app-evaluation-mode-toggle");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "div", 9);
    i0.ɵɵconditionalCreate(8, TestingDashboardComponent_Conditional_2_Conditional_8_Template, 1, 1, "app-testing-dashboard-tab", 10);
    i0.ɵɵconditionalCreate(9, TestingDashboardComponent_Conditional_2_Conditional_9_Template, 1, 1, "app-testing-runs", 10);
    i0.ɵɵconditionalCreate(10, TestingDashboardComponent_Conditional_2_Conditional_10_Template, 1, 1, "app-testing-analytics", 10);
    i0.ɵɵconditionalCreate(11, TestingDashboardComponent_Conditional_2_Conditional_11_Template, 1, 1, "app-testing-review", 10);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵconditional(ctx_r1.ActiveRuns.length > 0 ? 0 : -1);
    i0.ɵɵadvance(3);
    i0.ɵɵrepeater(ctx_r1.navigationConfig);
    i0.ɵɵadvance(5);
    i0.ɵɵconditional(ctx_r1.activeTab === "dashboard" && ctx_r1.hasVisited("dashboard") ? 8 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.activeTab === "runs" && ctx_r1.hasVisited("runs") ? 9 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.activeTab === "analytics" && ctx_r1.hasVisited("analytics") ? 10 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.activeTab === "review" && ctx_r1.hasVisited("review") ? 11 : -1);
} }
function TestingDashboardComponent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-slide-panel", 17);
    i0.ɵɵlistener("Closed", function TestingDashboardComponent_Conditional_3_Template_mj_slide_panel_Closed_0_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnPanelClosed()); });
    i0.ɵɵelementStart(1, "app-test-run-dialog", 18);
    i0.ɵɵlistener("PanelClose", function TestingDashboardComponent_Conditional_3_Template_app_test_run_dialog_PanelClose_1_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnPanelClosed()); });
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("Title", (ctx_r1.testingDialogService.PanelOptions == null ? null : ctx_r1.testingDialogService.PanelOptions.testId) ? "Test Execution" : "Run Test")("Resizable", true);
    i0.ɵɵadvance();
    i0.ɵɵproperty("PanelMode", true)("selectedTestId", (ctx_r1.testingDialogService.PanelOptions == null ? null : ctx_r1.testingDialogService.PanelOptions.testId) ?? null)("selectedSuiteId", (ctx_r1.testingDialogService.PanelOptions == null ? null : ctx_r1.testingDialogService.PanelOptions.suiteId) ?? null)("runMode", (ctx_r1.testingDialogService.PanelOptions == null ? null : ctx_r1.testingDialogService.PanelOptions.mode) ?? "test");
} }
let TestingDashboardComponent = class TestingDashboardComponent extends BaseDashboard {
    cdr;
    testingDialogService;
    executionService;
    isLoading = false;
    activeTab = 'dashboard';
    selectedIndex = 0;
    // Active test runs from execution service
    ActiveRuns = [];
    // Component states
    dashboardState = null;
    runsState = null;
    analyticsState = null;
    reviewState = null;
    // Track visited tabs for lazy loading
    visitedTabs = new Set();
    // Navigation items
    navigationItems = ['dashboard', 'runs', 'analytics', 'review'];
    navigationConfig = [
        { text: 'Dashboard', icon: 'fa-solid fa-gauge-high', selected: false },
        { text: 'Runs', icon: 'fa-solid fa-play-circle', selected: false },
        { text: 'Analytics', icon: 'fa-solid fa-chart-bar', selected: false },
        { text: 'Review', icon: 'fa-solid fa-clipboard-check', selected: false }
    ];
    stateChangeSubject = new Subject();
    destroy$ = new Subject();
    constructor(cdr, testingDialogService, executionService) {
        super();
        this.cdr = cdr;
        this.testingDialogService = testingDialogService;
        this.executionService = executionService;
        this.setupStateManagement();
        this.updateNavigationSelection();
    }
    async GetResourceDisplayName(data) {
        return 'Testing';
    }
    ngAfterViewInit() {
        this.visitedTabs.add(this.activeTab);
        this.updateNavigationSelection();
        this.emitStateChange();
        this.executionService.ActiveRuns$.pipe(takeUntil(this.destroy$)).subscribe(runs => {
            this.ActiveRuns = runs;
            this.cdr.markForCheck();
        });
        this.testingDialogService.PanelStateChanged$.pipe(takeUntil(this.destroy$)).subscribe((isOpen) => {
            console.log('[TestingDashboard] PanelStateChanged$:', isOpen, 'IsPanelOpen:', this.testingDialogService.IsPanelOpen);
            this.cdr.detectChanges();
        });
        this.cdr.detectChanges();
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
        this.stateChangeSubject.complete();
    }
    onTabChange(tabId) {
        this.activeTab = tabId;
        const index = this.navigationItems.indexOf(tabId);
        this.selectedIndex = index >= 0 ? index : 0;
        this.updateNavigationSelection();
        this.visitedTabs.add(tabId);
        this.emitStateChange();
        this.cdr.markForCheck();
    }
    hasVisited(tabId) {
        return this.visitedTabs.has(tabId);
    }
    setupStateManagement() {
        this.stateChangeSubject.pipe(debounceTime(50)).subscribe(state => {
            this.UserStateChanged.emit(state);
        });
    }
    emitStateChange() {
        const state = {
            activeTab: this.activeTab,
            dashboardState: (this.dashboardState || {}),
            runsState: (this.runsState || {}),
            analyticsState: (this.analyticsState || {}),
            reviewState: (this.reviewState || {})
        };
        this.stateChangeSubject.next(state);
    }
    onDashboardStateChange(state) {
        this.dashboardState = state;
        this.emitStateChange();
    }
    onRunsStateChange(state) {
        this.runsState = state;
        this.emitStateChange();
    }
    onAnalyticsStateChange(state) {
        this.analyticsState = state;
        this.emitStateChange();
    }
    onReviewStateChange(state) {
        this.reviewState = state;
        this.emitStateChange();
    }
    loadUserState(state) {
        if (state.activeTab) {
            this.activeTab = state.activeTab;
            const index = this.navigationItems.indexOf(state.activeTab);
            this.selectedIndex = index >= 0 ? index : 0;
            this.visitedTabs.add(state.activeTab);
            this.updateNavigationSelection();
        }
        if (state.dashboardState)
            this.dashboardState = state.dashboardState;
        if (state.runsState)
            this.runsState = state.runsState;
        if (state.analyticsState)
            this.analyticsState = state.analyticsState;
        if (state.reviewState)
            this.reviewState = state.reviewState;
        this.cdr.markForCheck();
    }
    initDashboard() {
        try {
            this.isLoading = true;
        }
        catch (error) {
            console.error('Error initializing Testing dashboard:', error);
            this.Error.emit(new Error('Failed to initialize Testing dashboard. Please try again.'));
        }
        finally {
            this.isLoading = false;
        }
    }
    loadData() {
        if (this.Config?.userState) {
            setTimeout(() => {
                if (this.Config?.userState) {
                    this.loadUserState(this.Config.userState);
                }
            }, 0);
        }
        this.NotifyLoadComplete();
    }
    getCurrentTabLabel() {
        const tabIndex = this.navigationItems.indexOf(this.activeTab);
        return tabIndex >= 0 ? this.navigationConfig[tabIndex].text : 'Testing Dashboard';
    }
    OnPanelClosed() {
        this.testingDialogService.ClosePanel();
        this.cdr.markForCheck();
    }
    OnViewActiveRun(run) {
        this.testingDialogService.OpenTestPanel(run.TestId);
        this.cdr.markForCheck();
    }
    OnViewRunningTestFromTab(testId) {
        this.testingDialogService.OpenTestPanel(testId);
        this.cdr.detectChanges();
    }
    updateNavigationSelection() {
        this.navigationConfig.forEach((item, index) => {
            item.selected = this.navigationItems[index] === this.activeTab;
        });
    }
    static ɵfac = function TestingDashboardComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestingDashboardComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.TestingDialogService), i0.ɵɵdirectiveInject(i1.TestingExecutionService)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TestingDashboardComponent, selectors: [["mj-testing-dashboard"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 3, consts: [[1, "testing-dashboard-container"], [1, "loading-container"], ["Mode", "slide", 3, "Title", "Resizable"], ["text", "Loading Testing Dashboard...", "size", "large"], [1, "active-runs-banner"], [1, "dashboard-content-wrapper"], [1, "testing-dashboard-nav"], [1, "nav-item", 3, "active"], [1, "nav-spacer"], [1, "dashboard-content"], [3, "initialState"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "active-runs-count"], [1, "active-runs-detail"], [1, "active-runs-view-btn", 3, "click"], [1, "nav-item", 3, "click"], [3, "stateChange", "initialState"], ["Mode", "slide", 3, "Closed", "Title", "Resizable"], [3, "PanelClose", "PanelMode", "selectedTestId", "selectedSuiteId", "runMode"]], template: function TestingDashboardComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵconditionalCreate(1, TestingDashboardComponent_Conditional_1_Template, 2, 0, "div", 1);
            i0.ɵɵconditionalCreate(2, TestingDashboardComponent_Conditional_2_Template, 12, 5);
            i0.ɵɵconditionalCreate(3, TestingDashboardComponent_Conditional_3_Template, 2, 6, "mj-slide-panel", 2);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.isLoading ? 1 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(!ctx.isLoading ? 2 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.testingDialogService.IsPanelOpen ? 3 : -1);
        } }, dependencies: [i1.TestRunDialogComponent, i1.EvaluationModeToggleComponent, i2.MjSlidePanelComponent, i3.LoadingComponent, i4.TestingDashboardTabComponent, i5.TestingRunsComponent, i6.TestingAnalyticsComponent, i7.TestingReviewComponent], styles: ["\n\n\n\n\n\n.testing-dashboard-container[_ngcontent-%COMP%] {\n  height: 100%;\n  background: var(--mj-bg-surface-sunken);\n  position: relative;\n  overflow: hidden;\n}\n\n\n\n.loading-container[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 100%;\n  background: var(--mj-bg-surface);\n  backdrop-filter: blur(8px);\n}\n\n.loading-content[_ngcontent-%COMP%] {\n  text-align: center;\n}\n\n.loading-spinner[_ngcontent-%COMP%] {\n  display: inline-block;\n  position: relative;\n  width: 80px;\n  height: 80px;\n}\n\n.spinner-ring[_ngcontent-%COMP%] {\n  box-sizing: border-box;\n  display: block;\n  position: absolute;\n  width: 64px;\n  height: 64px;\n  margin: 8px;\n  border: 8px solid var(--mj-brand-primary);\n  border-radius: 50%;\n  animation: _ngcontent-%COMP%_spinner-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n  border-color: var(--mj-brand-primary) transparent transparent transparent;\n}\n\n.spinner-ring[_ngcontent-%COMP%]:nth-child(1) {\n  animation-delay: -0.45s;\n}\n\n.spinner-ring[_ngcontent-%COMP%]:nth-child(2) {\n  animation-delay: -0.3s;\n}\n\n.spinner-ring[_ngcontent-%COMP%]:nth-child(3) {\n  animation-delay: -0.15s;\n}\n\n@keyframes _ngcontent-%COMP%_spinner-ring {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n\n.loading-text[_ngcontent-%COMP%] {\n  margin-top: 20px;\n  font-size: 16px;\n  color: var(--mj-text-muted);\n  font-weight: 500;\n}\n\n\n\n.dashboard-content-wrapper[_ngcontent-%COMP%] {\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n}\n\n.dashboard-content[_ngcontent-%COMP%] {\n  flex: 1;\n  overflow: hidden;\n}\n\n\n\n.testing-dashboard-nav[_ngcontent-%COMP%] {\n  display: flex;\n  justify-content: flex-start;\n  gap: 2px;\n  background: var(--mj-bg-surface);\n  border-bottom: 1px solid var(--mj-border-default);\n  box-shadow: var(--mj-shadow-sm);\n  padding: 0 16px;\n  position: relative;\n  z-index: 10;\n}\n\n.nav-item[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n  padding: 16px 24px;\n  cursor: pointer;\n  color: var(--mj-text-muted);\n  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);\n  border-bottom: 3px solid transparent;\n  white-space: nowrap;\n  position: relative;\n  font-weight: 500;\n}\n\n.nav-item[_ngcontent-%COMP%]::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 3px;\n  background: transparent;\n  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);\n  border-radius: 8px 8px 0 0;\n}\n\n.nav-item[_ngcontent-%COMP%]:hover {\n  color: var(--mj-brand-primary);\n}\n\n.nav-item[_ngcontent-%COMP%]:hover::before {\n  background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n}\n\n.nav-item.active[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n  border-bottom-color: var(--mj-brand-primary);\n}\n\n.nav-item.active[_ngcontent-%COMP%]::before {\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.nav-item[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: 16px;\n  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n  position: relative;\n  z-index: 1;\n}\n\n.nav-item[_ngcontent-%COMP%]:hover   i[_ngcontent-%COMP%] {\n  transform: scale(1.1);\n}\n\n.nav-item[_ngcontent-%COMP%]   span[_ngcontent-%COMP%] {\n  font-size: 13px;\n  font-weight: 600;\n  letter-spacing: 0.2px;\n  position: relative;\n  z-index: 1;\n}\n\n\n\n.nav-spacer[_ngcontent-%COMP%] {\n  flex: 1;\n}\n\n\n\n.active-runs-banner[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  padding: 10px 20px;\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n  border-bottom: 1px solid color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-border-default));\n  font-size: 13px;\n  color: var(--mj-text-primary);\n}\n\n.active-runs-banner[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n}\n\n.active-runs-count[_ngcontent-%COMP%] {\n  font-weight: 600;\n}\n\n.active-runs-detail[_ngcontent-%COMP%] {\n  color: var(--mj-text-secondary);\n  flex: 1;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.active-runs-view-btn[_ngcontent-%COMP%] {\n  padding: 4px 14px;\n  border: 1px solid var(--mj-brand-primary);\n  border-radius: 6px;\n  background: transparent;\n  color: var(--mj-brand-primary);\n  font-size: 12px;\n  font-weight: 600;\n  cursor: pointer;\n  white-space: nowrap;\n  transition: background 0.2s;\n}\n\n.active-runs-view-btn[_ngcontent-%COMP%]:hover {\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n}\n\n\n\n@media (max-width: 768px) {\n  .testing-dashboard-nav[_ngcontent-%COMP%] {\n    padding: 0 8px;\n    overflow-x: auto;\n  }\n\n  .nav-item[_ngcontent-%COMP%] {\n    padding: 12px 16px;\n    gap: 8px;\n  }\n\n  .nav-item[_ngcontent-%COMP%]   span[_ngcontent-%COMP%] {\n    font-size: 11px;\n  }\n\n  .nav-item[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n    font-size: 18px;\n  }\n\n  .active-runs-banner[_ngcontent-%COMP%] {\n    flex-wrap: wrap;\n    padding: 8px 12px;\n    gap: 6px;\n  }\n\n  .active-runs-detail[_ngcontent-%COMP%] {\n    width: 100%;\n    order: 3;\n  }\n}\n\n@media (max-width: 480px) {\n  .nav-item[_ngcontent-%COMP%]   span[_ngcontent-%COMP%] {\n    display: none;\n  }\n\n  .nav-item[_ngcontent-%COMP%] {\n    padding: 12px 14px;\n  }\n}"], changeDetection: 0 });
};
TestingDashboardComponent = __decorate([
    RegisterClass(BaseDashboard, 'TestingDashboard')
], TestingDashboardComponent);
export { TestingDashboardComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TestingDashboardComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-testing-dashboard', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"testing-dashboard-container\">\n  @if (isLoading) {\n    <div class=\"loading-container\">\n      <mj-loading text=\"Loading Testing Dashboard...\" size=\"large\"></mj-loading>\n    </div>\n  }\n\n  @if (!isLoading) {\n    <!-- Active Runs Banner -->\n    @if (ActiveRuns.length > 0) {\n      <div class=\"active-runs-banner\">\n        <i class=\"fa-solid fa-spinner fa-spin\"></i>\n        <span class=\"active-runs-count\">{{ ActiveRuns.length }} test{{ ActiveRuns.length === 1 ? '' : 's' }} running</span>\n        <span class=\"active-runs-detail\">{{ ActiveRuns[0].TestName }} &mdash; {{ ActiveRuns[0].Progress }}%</span>\n        <button class=\"active-runs-view-btn\" (click)=\"OnViewActiveRun(ActiveRuns[0])\">View</button>\n      </div>\n    }\n\n    <div class=\"dashboard-content-wrapper\">\n      <div class=\"testing-dashboard-nav\">\n        @for (navItem of navigationConfig; track $index) {\n          <div\n            class=\"nav-item\"\n            [class.active]=\"navItem.selected\"\n            (click)=\"onTabChange(navigationItems[$index])\"\n          >\n            <i [class]=\"navItem.icon\"></i>\n            <span>{{ navItem.text }}</span>\n          </div>\n        }\n        <div class=\"nav-spacer\"></div>\n        <app-evaluation-mode-toggle></app-evaluation-mode-toggle>\n      </div>\n\n      <div class=\"dashboard-content\">\n        @if (activeTab === 'dashboard' && hasVisited('dashboard')) {\n          <app-testing-dashboard-tab\n            [initialState]=\"dashboardState\"\n            (stateChange)=\"onDashboardStateChange($event)\"\n          ></app-testing-dashboard-tab>\n        }\n\n        @if (activeTab === 'runs' && hasVisited('runs')) {\n          <app-testing-runs\n            [initialState]=\"runsState\"\n            (stateChange)=\"onRunsStateChange($event)\"\n          ></app-testing-runs>\n        }\n\n        @if (activeTab === 'analytics' && hasVisited('analytics')) {\n          <app-testing-analytics\n            [initialState]=\"analyticsState\"\n            (stateChange)=\"onAnalyticsStateChange($event)\"\n          ></app-testing-analytics>\n        }\n\n        @if (activeTab === 'review' && hasVisited('review')) {\n          <app-testing-review\n            [initialState]=\"reviewState\"\n            (stateChange)=\"onReviewStateChange($event)\"\n          ></app-testing-review>\n        }\n      </div>\n    </div>\n  }\n\n  <!-- Slide Panel for Test Execution -->\n  @if (testingDialogService.IsPanelOpen) {\n    <mj-slide-panel\n      Mode=\"slide\"\n      [Title]=\"testingDialogService.PanelOptions?.testId ? 'Test Execution' : 'Run Test'\"\n      [Resizable]=\"true\"\n      (Closed)=\"OnPanelClosed()\">\n      <app-test-run-dialog\n        [PanelMode]=\"true\"\n        [selectedTestId]=\"testingDialogService.PanelOptions?.testId ?? null\"\n        [selectedSuiteId]=\"testingDialogService.PanelOptions?.suiteId ?? null\"\n        [runMode]=\"testingDialogService.PanelOptions?.mode ?? 'test'\"\n        (PanelClose)=\"OnPanelClosed()\">\n      </app-test-run-dialog>\n    </mj-slide-panel>\n  }\n</div>\n", styles: ["/* ============================================\n   Testing Dashboard - Premium Design System\n   Based on AI Dashboard patterns\n   ============================================ */\n\n.testing-dashboard-container {\n  height: 100%;\n  background: var(--mj-bg-surface-sunken);\n  position: relative;\n  overflow: hidden;\n}\n\n/* Loading State */\n.loading-container {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 100%;\n  background: var(--mj-bg-surface);\n  backdrop-filter: blur(8px);\n}\n\n.loading-content {\n  text-align: center;\n}\n\n.loading-spinner {\n  display: inline-block;\n  position: relative;\n  width: 80px;\n  height: 80px;\n}\n\n.spinner-ring {\n  box-sizing: border-box;\n  display: block;\n  position: absolute;\n  width: 64px;\n  height: 64px;\n  margin: 8px;\n  border: 8px solid var(--mj-brand-primary);\n  border-radius: 50%;\n  animation: spinner-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n  border-color: var(--mj-brand-primary) transparent transparent transparent;\n}\n\n.spinner-ring:nth-child(1) {\n  animation-delay: -0.45s;\n}\n\n.spinner-ring:nth-child(2) {\n  animation-delay: -0.3s;\n}\n\n.spinner-ring:nth-child(3) {\n  animation-delay: -0.15s;\n}\n\n@keyframes spinner-ring {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n\n.loading-text {\n  margin-top: 20px;\n  font-size: 16px;\n  color: var(--mj-text-muted);\n  font-weight: 500;\n}\n\n/* Dashboard Layout */\n.dashboard-content-wrapper {\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n}\n\n.dashboard-content {\n  flex: 1;\n  overflow: hidden;\n}\n\n/* Premium Navigation Tabs */\n.testing-dashboard-nav {\n  display: flex;\n  justify-content: flex-start;\n  gap: 2px;\n  background: var(--mj-bg-surface);\n  border-bottom: 1px solid var(--mj-border-default);\n  box-shadow: var(--mj-shadow-sm);\n  padding: 0 16px;\n  position: relative;\n  z-index: 10;\n}\n\n.nav-item {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n  padding: 16px 24px;\n  cursor: pointer;\n  color: var(--mj-text-muted);\n  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);\n  border-bottom: 3px solid transparent;\n  white-space: nowrap;\n  position: relative;\n  font-weight: 500;\n}\n\n.nav-item::before {\n  content: '';\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 3px;\n  background: transparent;\n  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);\n  border-radius: 8px 8px 0 0;\n}\n\n.nav-item:hover {\n  color: var(--mj-brand-primary);\n}\n\n.nav-item:hover::before {\n  background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n}\n\n.nav-item.active {\n  color: var(--mj-brand-primary);\n  border-bottom-color: var(--mj-brand-primary);\n}\n\n.nav-item.active::before {\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.nav-item i {\n  font-size: 16px;\n  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n  position: relative;\n  z-index: 1;\n}\n\n.nav-item:hover i {\n  transform: scale(1.1);\n}\n\n.nav-item span {\n  font-size: 13px;\n  font-weight: 600;\n  letter-spacing: 0.2px;\n  position: relative;\n  z-index: 1;\n}\n\n/* Spacer for flex layout */\n.nav-spacer {\n  flex: 1;\n}\n\n/* Active Runs Banner */\n.active-runs-banner {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  padding: 10px 20px;\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n  border-bottom: 1px solid color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-border-default));\n  font-size: 13px;\n  color: var(--mj-text-primary);\n}\n\n.active-runs-banner i {\n  color: var(--mj-brand-primary);\n}\n\n.active-runs-count {\n  font-weight: 600;\n}\n\n.active-runs-detail {\n  color: var(--mj-text-secondary);\n  flex: 1;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.active-runs-view-btn {\n  padding: 4px 14px;\n  border: 1px solid var(--mj-brand-primary);\n  border-radius: 6px;\n  background: transparent;\n  color: var(--mj-brand-primary);\n  font-size: 12px;\n  font-weight: 600;\n  cursor: pointer;\n  white-space: nowrap;\n  transition: background 0.2s;\n}\n\n.active-runs-view-btn:hover {\n  background: color-mix(in srgb, var(--mj-brand-primary) 12%, transparent);\n}\n\n/* Responsive */\n@media (max-width: 768px) {\n  .testing-dashboard-nav {\n    padding: 0 8px;\n    overflow-x: auto;\n  }\n\n  .nav-item {\n    padding: 12px 16px;\n    gap: 8px;\n  }\n\n  .nav-item span {\n    font-size: 11px;\n  }\n\n  .nav-item i {\n    font-size: 18px;\n  }\n\n  .active-runs-banner {\n    flex-wrap: wrap;\n    padding: 8px 12px;\n    gap: 6px;\n  }\n\n  .active-runs-detail {\n    width: 100%;\n    order: 3;\n  }\n}\n\n@media (max-width: 480px) {\n  .nav-item span {\n    display: none;\n  }\n\n  .nav-item {\n    padding: 12px 14px;\n  }\n}\n"] }]
    }], () => [{ type: i0.ChangeDetectorRef }, { type: i1.TestingDialogService }, { type: i1.TestingExecutionService }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TestingDashboardComponent, { className: "TestingDashboardComponent", filePath: "src/Testing/testing-dashboard.component.ts", lineNumber: 25 }); })();
//# sourceMappingURL=testing-dashboard.component.js.map