import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { Subject, BehaviorSubject, combineLatest, debounceTime, distinctUntilChanged, takeUntil, startWith } from 'rxjs';
import { RunView } from '@memberjunction/core';
import { UUIDsEqual } from '@memberjunction/global';
import * as i0 from "@angular/core";
import * as i1 from "@progress/kendo-angular-dialog";
import * as i2 from "@angular/forms";
import * as i3 from "@progress/kendo-angular-inputs";
import * as i4 from "@progress/kendo-angular-dropdowns";
import * as i5 from "@progress/kendo-angular-buttons";
import * as i6 from "@angular/common";
const _c0 = () => ({ Name: "All Types", ID: "all" });
const _forTrack0 = ($index, $item) => $item.ID;
function SubAgentSelectorDialogComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 5);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1("", ctx_r0.selectedCount, " selected");
} }
function SubAgentSelectorDialogComponent_Conditional_16_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 24);
    i0.ɵɵlistener("click", function SubAgentSelectorDialogComponent_Conditional_16_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.clearSearch()); });
    i0.ɵɵelement(1, "i", 25);
    i0.ɵɵelementEnd();
} }
function SubAgentSelectorDialogComponent_Conditional_24_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 16);
    i0.ɵɵelement(1, "i", 26);
    i0.ɵɵelementStart(2, "p");
    i0.ɵɵtext(3, "Loading available agents...");
    i0.ɵɵelementEnd()();
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_1_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "p");
    i0.ɵɵtext(1, "No eligible root agents are available to become sub-agents.");
    i0.ɵɵelementEnd();
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_1_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "p");
    i0.ɵɵtext(1, "Try adjusting your search criteria or selecting a different agent type.");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(2, "button", 30);
    i0.ɵɵlistener("click", function SubAgentSelectorDialogComponent_Conditional_26_Conditional_1_Conditional_5_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.clearSearch()); });
    i0.ɵɵtext(3, " Clear Search ");
    i0.ɵɵelementEnd();
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 27);
    i0.ɵɵelement(1, "i", 29);
    i0.ɵɵelementStart(2, "h4");
    i0.ɵɵtext(3, "No agents found");
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(4, SubAgentSelectorDialogComponent_Conditional_26_Conditional_1_Conditional_4_Template, 2, 0, "p")(5, SubAgentSelectorDialogComponent_Conditional_26_Conditional_1_Conditional_5_Template, 4, 0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(4);
    i0.ɵɵconditional(ctx_r0.totalAgentCount === 0 ? 4 : 5);
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 34);
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 35);
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "img", 37);
} if (rf & 2) {
    const agent_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("src", agent_r5.LogoURL, i0.ɵɵsanitizeUrl)("alt", agent_r5.Name + " logo");
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i");
} if (rf & 2) {
    const agent_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r0 = i0.ɵɵnextContext(3);
    i0.ɵɵclassMap(ctx_r0.getAgentIcon(agent_r5));
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 41);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const agent_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(agent_r5.Description);
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 46);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const agent_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r0 = i0.ɵɵnextContext(3);
    i0.ɵɵstyleProp("background-color", ctx_r0.getAgentStatusColor(agent_r5));
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", agent_r5.Status, " ");
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_13_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 44);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const agent_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(agent_r5.typeName);
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_14_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 45);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const agent_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(agent_r5.ExecutionMode);
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 32);
    i0.ɵɵlistener("click", function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Template_div_click_0_listener() { const agent_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.toggleAgentSelection(agent_r5)); });
    i0.ɵɵelementStart(1, "div", 33);
    i0.ɵɵconditionalCreate(2, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_2_Template, 1, 0, "i", 34)(3, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_3_Template, 1, 0, "i", 35);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 36);
    i0.ɵɵconditionalCreate(5, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_5_Template, 1, 2, "img", 37)(6, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_6_Template, 1, 2, "i", 38);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "div", 39)(8, "div", 40);
    i0.ɵɵtext(9);
    i0.ɵɵelementEnd();
    i0.ɵɵconditionalCreate(10, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_10_Template, 2, 1, "div", 41);
    i0.ɵɵelementStart(11, "div", 42);
    i0.ɵɵconditionalCreate(12, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_12_Template, 2, 3, "span", 43);
    i0.ɵɵconditionalCreate(13, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_13_Template, 2, 1, "span", 44);
    i0.ɵɵconditionalCreate(14, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Conditional_14_Template, 2, 1, "span", 45);
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const agent_r5 = ctx.$implicit;
    i0.ɵɵclassProp("selected", agent_r5.selected);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(agent_r5.selected ? 2 : 3);
    i0.ɵɵadvance(3);
    i0.ɵɵconditional(agent_r5.LogoURL ? 5 : 6);
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate(agent_r5.Name);
    i0.ɵɵadvance();
    i0.ɵɵconditional(agent_r5.Description ? 10 : -1);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(agent_r5.Status ? 12 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(agent_r5.typeName ? 13 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(agent_r5.ExecutionMode ? 14 : -1);
} }
function SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 28);
    i0.ɵɵrepeaterCreate(1, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_For_2_Template, 15, 9, "div", 31, _forTrack0);
    i0.ɵɵpipe(3, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(i0.ɵɵpipeBind1(3, 0, ctx_r0.filteredAgents$));
} }
function SubAgentSelectorDialogComponent_Conditional_26_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 17);
    i0.ɵɵconditionalCreate(1, SubAgentSelectorDialogComponent_Conditional_26_Conditional_1_Template, 6, 1, "div", 27)(2, SubAgentSelectorDialogComponent_Conditional_26_Conditional_2_Template, 4, 2, "div", 28);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r0.filteredCount === 0 ? 1 : 2);
} }
function SubAgentSelectorDialogComponent_Conditional_29_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 47);
    i0.ɵɵlistener("click", function SubAgentSelectorDialogComponent_Conditional_29_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.createNew()); });
    i0.ɵɵelement(1, "i", 48);
    i0.ɵɵtext(2, " Create Sub-Agent ");
    i0.ɵɵelementEnd();
} }
function SubAgentSelectorDialogComponent_Conditional_34_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵtextInterpolate2(" Add ", ctx_r0.selectedCount > 0 ? ctx_r0.selectedCount + " " : "", "Sub-Agent", ctx_r0.selectedCount !== 1 ? "s" : "", " ");
} }
function SubAgentSelectorDialogComponent_Conditional_35_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0, " Add Sub-Agent ");
} }
/**
 * Sub-Agent Selector Dialog for selecting agents to convert to sub-agents.
 * Only shows agents with NULL ParentID (root agents) that can become sub-agents.
 */
export class SubAgentSelectorDialogComponent {
    // Computed values
    get selectedCount() {
        return this.selectedAgents$.value.size;
    }
    get totalAgentCount() {
        return this.allAgents$.value.length;
    }
    get filteredCount() {
        return this.filteredAgents$.value.length;
    }
    constructor(dialogRef, cdr) {
        this.dialogRef = dialogRef;
        this.cdr = cdr;
        // Reactive state management
        this.destroy$ = new Subject();
        this.result = new Subject();
        // Data streams
        this.allAgents$ = new BehaviorSubject([]);
        this.agentTypes$ = new BehaviorSubject([]);
        this.filteredAgents$ = new BehaviorSubject([]);
        this.selectedAgents$ = new BehaviorSubject(new Set());
        this.isLoading$ = new BehaviorSubject(false);
        // UI state
        this.searchControl = new FormControl('');
        this.selectedTypeId$ = new BehaviorSubject('all');
    }
    ngOnInit() {
        this.initializeData();
        this.setupFiltering();
        this.preselectExistingAgents();
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    async initializeData() {
        this.isLoading$.next(true);
        try {
            await this.loadAgentsAndTypes();
        }
        catch (error) {
            console.error('Error loading dialog data:', error);
        }
        finally {
            this.isLoading$.next(false);
        }
    }
    async loadAgentsAndTypes() {
        const rv = new RunView();
        // Load both agents and types in a single batch for better performance
        const results = await rv.RunViews([
            // Root agents (index 0)
            {
                EntityName: 'MJ: AI Agents',
                ExtraFilter: `ParentID IS NULL AND ID != '${this.config.parentAgentId}' AND Status = 'Active' AND (ExposeAsAction = 0 OR ExposeAsAction IS NULL)`,
                OrderBy: 'Name',
                ResultType: 'entity_object',
                MaxRows: 1000
            },
            // Agent types (index 1)
            {
                EntityName: 'MJ: AI Agent Types',
                ExtraFilter: 'IsActive = 1',
                OrderBy: 'Name',
                ResultType: 'entity_object',
                MaxRows: 1000
            }
        ]);
        // Process root agents (index 0)
        if (results[0].Success) {
            const agents = (results[0].Results || []).map(agent => ({
                ...agent.GetAll(),
                selected: false,
                typeName: agent.Type || 'Default'
            }));
            this.allAgents$.next(agents);
        }
        // Process agent types (index 1)
        if (results[1].Success) {
            this.agentTypes$.next(results[1].Results || []);
        }
    }
    setupFiltering() {
        combineLatest([
            this.allAgents$,
            this.searchControl.valueChanges.pipe(debounceTime(300), distinctUntilChanged(), startWith('')),
            this.selectedTypeId$
        ]).pipe(takeUntil(this.destroy$)).subscribe(([agents, searchTerm, typeId]) => {
            this.filterAgents(agents, searchTerm || '', typeId);
        });
    }
    filterAgents(agents, searchTerm, typeId) {
        let filtered = [...agents];
        // Type filter
        if (typeId !== 'all') {
            filtered = filtered.filter(agent => UUIDsEqual(agent.TypeID, typeId));
        }
        // Search filter
        if (searchTerm) {
            const term = searchTerm.toLowerCase();
            filtered = filtered.filter(agent => (agent.Name && agent.Name.toLowerCase().includes(term)) ||
                (agent.Description && agent.Description.toLowerCase().includes(term)) ||
                (agent.typeName && agent.typeName.toLowerCase().includes(term)));
        }
        this.filteredAgents$.next(filtered);
    }
    preselectExistingAgents() {
        if (this.config.selectedAgentIds.length > 0) {
            const selected = new Set(this.config.selectedAgentIds);
            this.selectedAgents$.next(selected);
            // Update agent selection state
            const agents = this.allAgents$.value;
            agents.forEach(agent => {
                agent.selected = selected.has(agent.ID);
            });
            this.allAgents$.next(agents);
        }
    }
    // === UI Event Handlers ===
    selectType(typeId) {
        this.selectedTypeId$.next(typeId);
    }
    toggleAgentSelection(agent) {
        const selected = this.selectedAgents$.value;
        const agents = this.allAgents$.value;
        // Find the agent and toggle its selection
        const agentToUpdate = agents.find(a => UUIDsEqual(a.ID, agent.ID));
        if (agentToUpdate) {
            agentToUpdate.selected = !agentToUpdate.selected;
            if (agentToUpdate.selected) {
                if (!this.config.multiSelect) {
                    // Single select mode - clear other selections
                    selected.clear();
                    agents.forEach(a => {
                        if (!UUIDsEqual(a.ID, agent.ID)) {
                            a.selected = false;
                        }
                    });
                }
                selected.add(agent.ID);
            }
            else {
                selected.delete(agent.ID);
            }
            this.selectedAgents$.next(new Set(selected));
            this.allAgents$.next(agents);
            // Update filtered agents to reflect selection state
            const filtered = this.filteredAgents$.value;
            const filteredAgent = filtered.find(a => UUIDsEqual(a.ID, agent.ID));
            if (filteredAgent) {
                filteredAgent.selected = agentToUpdate.selected;
                this.filteredAgents$.next(filtered);
            }
        }
    }
    clearSearch() {
        this.searchControl.reset();
    }
    getAgentIcon(agent) {
        if (agent.IconClass) {
            return agent.IconClass;
        }
        return 'fa-solid fa-robot';
    }
    getAgentStatusColor(agent) {
        switch (agent.Status) {
            case 'Active': return 'var(--mj-status-success)';
            case 'Disabled': return 'var(--mj-text-muted)';
            case 'Pending': return 'var(--mj-status-warning)';
            default: return 'var(--mj-text-muted)';
        }
    }
    // === Dialog Actions ===
    cancel() {
        this.result.next(null);
        this.dialogRef.close();
    }
    createNew() {
        this.result.next({
            selectedAgents: [],
            createNew: true
        });
        this.dialogRef.close();
    }
    async addSelectedAgents() {
        const selectedIds = this.selectedAgents$.value;
        const allAgents = this.allAgents$.value;
        // Get the selected agent display items
        const selectedDisplayItems = allAgents
            .filter(agent => selectedIds.has(agent.ID));
        // Convert AgentDisplayItem to MJAIAgentEntityExtended by casting (they have the same structure)
        const selectedAgents = selectedDisplayItems.map(item => item);
        this.result.next({
            selectedAgents,
            createNew: false
        });
        this.dialogRef.close();
    }
    static { this.ɵfac = function SubAgentSelectorDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubAgentSelectorDialogComponent)(i0.ɵɵdirectiveInject(i1.WindowRef), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SubAgentSelectorDialogComponent, selectors: [["mj-sub-agent-selector-dialog"]], standalone: false, decls: 36, vars: 21, consts: [[1, "sub-agent-selector-dialog"], [1, "dialog-header"], [1, "header-info"], [1, "header-description"], [1, "header-stats"], [1, "selection-count"], [1, "total-count"], [1, "controls-section"], [1, "search-controls"], [1, "search-input"], [1, "fa-solid", "fa-search", "search-icon"], ["placeholder", "Search agents by name, description, or type...", 1, "search-field", 3, "formControl"], ["kendoButton", "", "fillMode", "flat", "size", "small", 1, "clear-search"], [1, "filter-controls"], [1, "type-filter"], ["textField", "Name", "valueField", "ID", 1, "type-dropdown", 3, "valueChange", "value", "valuePrimitive", "defaultItem", "data"], [1, "loading-state"], [1, "content-area"], [1, "dialog-footer"], [1, "footer-left"], ["kendoButton", "", "look", "outline", "themeColor", "primary"], [1, "footer-right"], ["kendoButton", "", "look", "flat", 3, "click"], ["kendoButton", "", "themeColor", "primary", 3, "click", "disabled"], ["kendoButton", "", "fillMode", "flat", "size", "small", 1, "clear-search", 3, "click"], [1, "fa-solid", "fa-times"], [1, "fa-solid", "fa-spinner", "fa-spin", "fa-2x"], [1, "empty-state"], [1, "agents-grid"], [1, "fa-solid", "fa-robot"], ["kendoButton", "", "themeColor", "primary", 3, "click"], [1, "agent-card", 3, "selected"], [1, "agent-card", 3, "click"], [1, "selection-indicator"], [1, "fa-solid", "fa-check-circle"], [1, "fa-regular", "fa-circle"], [1, "agent-icon"], [1, "agent-logo", 3, "src", "alt"], [3, "class"], [1, "agent-info"], [1, "agent-name"], [1, "agent-description"], [1, "agent-meta"], [1, "status-badge", 3, "background-color"], [1, "type-badge"], [1, "execution-badge"], [1, "status-badge"], ["kendoButton", "", "look", "outline", "themeColor", "primary", 3, "click"], [1, "fa-solid", "fa-plus"]], template: function SubAgentSelectorDialogComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "h3");
            i0.ɵɵtext(4);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(5, "p", 3);
            i0.ɵɵtext(6, " Choose existing root agents to convert into sub-agents. Only active agents without parents and not exposed as actions can be selected. ");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(7, "div", 4);
            i0.ɵɵconditionalCreate(8, SubAgentSelectorDialogComponent_Conditional_8_Template, 2, 1, "span", 5);
            i0.ɵɵelementStart(9, "span", 6);
            i0.ɵɵtext(10);
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(11, "div", 7)(12, "div", 8)(13, "div", 9);
            i0.ɵɵelement(14, "i", 10)(15, "kendo-textbox", 11);
            i0.ɵɵconditionalCreate(16, SubAgentSelectorDialogComponent_Conditional_16_Template, 2, 0, "button", 12);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(17, "div", 13)(18, "div", 14)(19, "label");
            i0.ɵɵtext(20, "Agent Type:");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(21, "kendo-dropdownlist", 15);
            i0.ɵɵpipe(22, "async");
            i0.ɵɵpipe(23, "async");
            i0.ɵɵlistener("valueChange", function SubAgentSelectorDialogComponent_Template_kendo_dropdownlist_valueChange_21_listener($event) { return ctx.selectType($event); });
            i0.ɵɵelementEnd()()()();
            i0.ɵɵconditionalCreate(24, SubAgentSelectorDialogComponent_Conditional_24_Template, 4, 0, "div", 16);
            i0.ɵɵpipe(25, "async");
            i0.ɵɵconditionalBranchCreate(26, SubAgentSelectorDialogComponent_Conditional_26_Template, 3, 1, "div", 17);
            i0.ɵɵelementStart(27, "div", 18)(28, "div", 19);
            i0.ɵɵconditionalCreate(29, SubAgentSelectorDialogComponent_Conditional_29_Template, 3, 0, "button", 20);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(30, "div", 21)(31, "button", 22);
            i0.ɵɵlistener("click", function SubAgentSelectorDialogComponent_Template_button_click_31_listener() { return ctx.cancel(); });
            i0.ɵɵtext(32, " Cancel ");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(33, "button", 23);
            i0.ɵɵlistener("click", function SubAgentSelectorDialogComponent_Template_button_click_33_listener() { return ctx.addSelectedAgents(); });
            i0.ɵɵconditionalCreate(34, SubAgentSelectorDialogComponent_Conditional_34_Template, 1, 2)(35, SubAgentSelectorDialogComponent_Conditional_35_Template, 1, 0);
            i0.ɵɵelementEnd()()()();
        } if (rf & 2) {
            i0.ɵɵadvance(4);
            i0.ɵɵtextInterpolate(ctx.config.title || "Select Sub-Agents");
            i0.ɵɵadvance(4);
            i0.ɵɵconditional(ctx.selectedCount > 0 ? 8 : -1);
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate2("", ctx.filteredCount, " of ", ctx.totalAgentCount, " agents");
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("formControl", ctx.searchControl);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.searchControl.value ? 16 : -1);
            i0.ɵɵadvance(5);
            i0.ɵɵproperty("value", i0.ɵɵpipeBind1(22, 14, ctx.selectedTypeId$))("valuePrimitive", true)("defaultItem", i0.ɵɵpureFunction0(20, _c0))("data", i0.ɵɵpipeBind1(23, 16, ctx.agentTypes$));
            i0.ɵɵadvance(3);
            i0.ɵɵconditional(i0.ɵɵpipeBind1(25, 18, ctx.isLoading$) ? 24 : 26);
            i0.ɵɵadvance(5);
            i0.ɵɵconditional(ctx.config.showCreateNew ? 29 : -1);
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("disabled", ctx.selectedCount === 0);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.config.multiSelect ? 34 : 35);
        } }, dependencies: [i2.NgControlStatus, i2.FormControlDirective, i3.TextBoxComponent, i4.DropDownListComponent, i5.ButtonComponent, i6.AsyncPipe], styles: [".sub-agent-selector-dialog[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  height: 100%;\n  background: var(--mj-bg-surface-card);\n  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n}\n\n\n\n[_nghost-%COMP%]     .k-dialog, \n[_nghost-%COMP%]     .k-window {\n  z-index: 10000 !important;\n}\n\n[_nghost-%COMP%]     .k-overlay {\n  z-index: 9999 !important;\n}\n\n\n\n.dialog-header[_ngcontent-%COMP%] {\n  padding: 1.5rem;\n  background: var(--mj-bg-surface);\n  border-bottom: 1px solid var(--mj-bg-surface-sunken);\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n}\n\n.header-info[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%] {\n  margin: 0 0 0.5rem 0;\n  color: var(--mj-text-primary);\n  font-size: 1.25rem;\n  font-weight: 600;\n}\n\n.header-description[_ngcontent-%COMP%] {\n  margin: 0;\n  color: var(--mj-text-muted);\n  font-size: 0.9rem;\n  line-height: 1.4;\n}\n\n.header-stats[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  align-items: flex-end;\n  gap: 0.25rem;\n  font-size: 0.85rem;\n}\n\n.selection-count[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n  font-weight: 600;\n}\n\n.total-count[_ngcontent-%COMP%] {\n  color: var(--mj-text-muted);\n}\n\n\n\n.controls-section[_ngcontent-%COMP%] {\n  padding: 1rem 1.5rem;\n  background: var(--mj-bg-surface);\n  border-bottom: 1px solid var(--mj-bg-surface-sunken);\n  display: flex;\n  gap: 1rem;\n  align-items: flex-end;\n}\n\n.search-controls[_ngcontent-%COMP%] {\n  flex: 1;\n}\n\n.search-input[_ngcontent-%COMP%] {\n  position: relative;\n  display: flex;\n  align-items: center;\n}\n\n.search-icon[_ngcontent-%COMP%] {\n  position: absolute;\n  left: 12px;\n  color: var(--mj-text-muted);\n  z-index: 1;\n}\n\n.search-field[_ngcontent-%COMP%] {\n  width: 100%;\n  padding-left: 40px;\n}\n\n.clear-search[_ngcontent-%COMP%] {\n  position: absolute;\n  right: 8px;\n  z-index: 1;\n}\n\n.filter-controls[_ngcontent-%COMP%] {\n  display: flex;\n  gap: 1rem;\n  align-items: flex-end;\n}\n\n.type-filter[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  gap: 0.5rem;\n}\n\n.type-filter[_ngcontent-%COMP%]   label[_ngcontent-%COMP%] {\n  font-size: 0.85rem;\n  font-weight: 500;\n  color: var(--mj-text-secondary);\n}\n\n.type-dropdown[_ngcontent-%COMP%] {\n  min-width: 150px;\n}\n\n\n\n.content-area[_ngcontent-%COMP%] {\n  flex: 1;\n  overflow-y: auto;\n  padding: 1rem;\n}\n\n\n\n.loading-state[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  height: 300px;\n  color: var(--mj-text-muted);\n}\n\n.loading-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n  margin-bottom: 1rem;\n}\n\n.loading-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n  margin: 0;\n  font-size: 1rem;\n}\n\n\n\n.empty-state[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  height: 300px;\n  color: var(--mj-text-muted);\n  text-align: center;\n}\n\n.empty-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: 3rem;\n  color: var(--mj-border-default);\n  margin-bottom: 1rem;\n}\n\n.empty-state[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%] {\n  margin: 0 0 0.5rem 0;\n  color: var(--mj-text-secondary);\n  font-size: 1.1rem;\n}\n\n.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%] {\n  margin: 0 0 1rem 0;\n  max-width: 400px;\n  line-height: 1.5;\n}\n\n\n\n.agents-grid[_ngcontent-%COMP%] {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n  gap: 1rem;\n}\n\n.agent-card[_ngcontent-%COMP%] {\n  background: var(--mj-bg-surface);\n  border: 2px solid var(--mj-bg-surface-sunken);\n  border-radius: 8px;\n  padding: 1rem;\n  cursor: pointer;\n  transition: all 0.2s ease;\n  display: flex;\n  gap: 1rem;\n  position: relative;\n}\n\n.agent-card[_ngcontent-%COMP%]:hover {\n  border-color: var(--mj-brand-primary);\n  box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.agent-card.selected[_ngcontent-%COMP%] {\n  border-color: var(--mj-brand-primary);\n  background: color-mix(in srgb, var(--mj-brand-primary) 4%, var(--mj-bg-surface));\n  box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n}\n\n.selection-indicator[_ngcontent-%COMP%] {\n  position: absolute;\n  top: 0.75rem;\n  right: 0.75rem;\n  font-size: 1.1rem;\n}\n\n.selection-indicator[_ngcontent-%COMP%]   .fa-check-circle[_ngcontent-%COMP%] {\n  color: var(--mj-status-success);\n}\n\n.selection-indicator[_ngcontent-%COMP%]   .fa-circle[_ngcontent-%COMP%] {\n  color: var(--mj-border-default);\n}\n\n.agent-icon[_ngcontent-%COMP%] {\n  flex-shrink: 0;\n  width: 48px;\n  height: 48px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: 8px;\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.agent-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: 1.5rem;\n  color: var(--mj-brand-primary);\n}\n\n.agent-logo[_ngcontent-%COMP%] {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  border-radius: 6px;\n}\n\n.agent-info[_ngcontent-%COMP%] {\n  flex: 1;\n  min-width: 0;\n}\n\n.agent-name[_ngcontent-%COMP%] {\n  font-size: 1rem;\n  font-weight: 600;\n  color: var(--mj-text-primary);\n  margin-bottom: 0.5rem;\n  word-wrap: break-word;\n}\n\n.agent-description[_ngcontent-%COMP%] {\n  font-size: 0.85rem;\n  color: var(--mj-text-muted);\n  line-height: 1.4;\n  margin-bottom: 0.75rem;\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n\n.agent-meta[_ngcontent-%COMP%] {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 0.5rem;\n}\n\n.status-badge[_ngcontent-%COMP%], \n.type-badge[_ngcontent-%COMP%], \n.execution-badge[_ngcontent-%COMP%] {\n  padding: 0.25rem 0.5rem;\n  border-radius: 4px;\n  font-size: 0.75rem;\n  font-weight: 500;\n  color: var(--mj-text-inverse);\n}\n\n\n\n\n.type-badge[_ngcontent-%COMP%] {\n  background: var(--mj-brand-primary);\n}\n\n.execution-badge[_ngcontent-%COMP%] {\n  background: var(--mj-status-warning);\n}\n\n\n\n.dialog-footer[_ngcontent-%COMP%] {\n  padding: 1rem 1.5rem;\n  background: var(--mj-bg-surface);\n  border-top: 1px solid var(--mj-bg-surface-sunken);\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.footer-left[_ngcontent-%COMP%] {\n  display: flex;\n  gap: 0.5rem;\n}\n\n.footer-right[_ngcontent-%COMP%] {\n  display: flex;\n  gap: 0.75rem;\n}\n\n.dialog-footer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%] {\n  min-width: 100px;\n}\n\n.dialog-footer[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  margin-right: 0.5rem;\n}\n\n\n\n@media (max-width: 768px) {\n  .agents-grid[_ngcontent-%COMP%] {\n    grid-template-columns: 1fr;\n  }\n\n  .dialog-header[_ngcontent-%COMP%] {\n    flex-direction: column;\n    gap: 1rem;\n  }\n\n  .header-stats[_ngcontent-%COMP%] {\n    align-items: flex-start;\n  }\n\n  .controls-section[_ngcontent-%COMP%] {\n    flex-direction: column;\n    align-items: stretch;\n  }\n\n  .filter-controls[_ngcontent-%COMP%] {\n    justify-content: flex-start;\n  }\n\n  .dialog-footer[_ngcontent-%COMP%] {\n    flex-direction: column-reverse;\n    gap: 1rem;\n  }\n\n  .footer-left[_ngcontent-%COMP%], \n   .footer-right[_ngcontent-%COMP%] {\n    width: 100%;\n    justify-content: center;\n  }\n}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubAgentSelectorDialogComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-sub-agent-selector-dialog', template: "<!-- Sub-Agent Selector Dialog -->\n<div class=\"sub-agent-selector-dialog\">\n  \n  <!-- Dialog Header -->\n  <div class=\"dialog-header\">\n    <div class=\"header-info\">\n      <h3>{{ config.title || 'Select Sub-Agents' }}</h3>\n      <p class=\"header-description\">\n        Choose existing root agents to convert into sub-agents. Only active agents without parents and not exposed as actions can be selected.\n      </p>\n    </div>\n    <div class=\"header-stats\">\n      @if (selectedCount > 0) {\n        <span class=\"selection-count\">{{ selectedCount }} selected</span>\n      }\n      <span class=\"total-count\">{{ filteredCount }} of {{ totalAgentCount }} agents</span>\n    </div>\n  </div>\n\n  <!-- Search and Filter Controls -->\n  <div class=\"controls-section\">\n    <div class=\"search-controls\">\n      <div class=\"search-input\">\n        <i class=\"fa-solid fa-search search-icon\"></i>\n        <kendo-textbox \n          [formControl]=\"searchControl\"\n          placeholder=\"Search agents by name, description, or type...\"\n          class=\"search-field\">\n        </kendo-textbox>\n        @if (searchControl.value) {\n          <button kendoButton \n                  fillMode=\"flat\" \n                  size=\"small\"\n                  (click)=\"clearSearch()\"\n                  class=\"clear-search\">\n            <i class=\"fa-solid fa-times\"></i>\n          </button>\n        }\n      </div>\n    </div>\n\n    <div class=\"filter-controls\">\n      <div class=\"type-filter\">\n        <label>Agent Type:</label>\n        <kendo-dropdownlist \n          [value]=\"selectedTypeId$ | async\"\n          (valueChange)=\"selectType($event)\"\n          textField=\"Name\"\n          valueField=\"ID\"\n          [valuePrimitive]=\"true\"\n          [defaultItem]=\"{ Name: 'All Types', ID: 'all' }\"\n          [data]=\"agentTypes$ | async\"\n          class=\"type-dropdown\">\n        </kendo-dropdownlist>\n      </div>\n    </div>\n  </div>\n\n  <!-- Loading State -->\n  @if (isLoading$ | async) {\n    <div class=\"loading-state\">\n      <i class=\"fa-solid fa-spinner fa-spin fa-2x\"></i>\n      <p>Loading available agents...</p>\n    </div>\n  } @else {\n    \n    <!-- Content Area -->\n    <div class=\"content-area\">\n      @if (filteredCount === 0) {\n        <div class=\"empty-state\">\n          <i class=\"fa-solid fa-robot\"></i>\n          <h4>No agents found</h4>\n          @if (totalAgentCount === 0) {\n            <p>No eligible root agents are available to become sub-agents.</p>\n          } @else {\n            <p>Try adjusting your search criteria or selecting a different agent type.</p>\n            <button kendoButton (click)=\"clearSearch()\" themeColor=\"primary\">\n              Clear Search\n            </button>\n          }\n        </div>\n      } @else {\n        \n        <!-- Agents Grid -->\n        <div class=\"agents-grid\">\n          @for (agent of (filteredAgents$ | async); track agent.ID) {\n            <div class=\"agent-card\" \n                 [class.selected]=\"agent.selected\"\n                 (click)=\"toggleAgentSelection(agent)\">\n              \n              <!-- Selection Indicator -->\n              <div class=\"selection-indicator\">\n                @if (agent.selected) {\n                  <i class=\"fa-solid fa-check-circle\"></i>\n                } @else {\n                  <i class=\"fa-regular fa-circle\"></i>\n                }\n              </div>\n              \n              <!-- Agent Icon/Logo -->\n              <div class=\"agent-icon\">\n                @if (agent.LogoURL) {\n                  <img [src]=\"agent.LogoURL\" [alt]=\"agent.Name + ' logo'\" class=\"agent-logo\">\n                } @else {\n                  <i [class]=\"getAgentIcon(agent)\"></i>\n                }\n              </div>\n              \n              <!-- Agent Info -->\n              <div class=\"agent-info\">\n                <div class=\"agent-name\">{{ agent.Name }}</div>\n                @if (agent.Description) {\n                  <div class=\"agent-description\">{{ agent.Description }}</div>\n                }\n                <div class=\"agent-meta\">\n                  @if (agent.Status) {\n                    <span class=\"status-badge\" [style.background-color]=\"getAgentStatusColor(agent)\">\n                      {{ agent.Status }}\n                    </span>\n                  }\n                  @if (agent.typeName) {\n                    <span class=\"type-badge\">{{ agent.typeName }}</span>\n                  }\n                  @if (agent.ExecutionMode) {\n                    <span class=\"execution-badge\">{{ agent.ExecutionMode }}</span>\n                  }\n                </div>\n              </div>\n            </div>\n          }\n        </div>\n      }\n    </div>\n  }\n\n  <!-- Dialog Footer -->\n  <div class=\"dialog-footer\">\n    <div class=\"footer-left\">\n      @if (config.showCreateNew) {\n        <button kendoButton \n                look=\"outline\"\n                themeColor=\"primary\"\n                (click)=\"createNew()\">\n          <i class=\"fa-solid fa-plus\"></i>\n          Create Sub-Agent\n        </button>\n      }\n    </div>\n    \n    <div class=\"footer-right\">\n      <button kendoButton \n              look=\"flat\" \n              (click)=\"cancel()\">\n        Cancel\n      </button>\n      \n      <button kendoButton \n              themeColor=\"primary\" \n              (click)=\"addSelectedAgents()\"\n              [disabled]=\"selectedCount === 0\">\n        @if (config.multiSelect) {\n          Add {{ selectedCount > 0 ? selectedCount + ' ' : '' }}Sub-Agent{{ selectedCount !== 1 ? 's' : '' }}\n        } @else {\n          Add Sub-Agent\n        }\n      </button>\n    </div>\n  </div>\n</div>", styles: [".sub-agent-selector-dialog {\n  display: flex;\n  flex-direction: column;\n  height: 100%;\n  background: var(--mj-bg-surface-card);\n  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n}\n\n/* Ensure dialog appears above banner and other elements */\n:host ::ng-deep .k-dialog,\n:host ::ng-deep .k-window {\n  z-index: 10000 !important;\n}\n\n:host ::ng-deep .k-overlay {\n  z-index: 9999 !important;\n}\n\n/* === Dialog Header === */\n.dialog-header {\n  padding: 1.5rem;\n  background: var(--mj-bg-surface);\n  border-bottom: 1px solid var(--mj-bg-surface-sunken);\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n}\n\n.header-info h3 {\n  margin: 0 0 0.5rem 0;\n  color: var(--mj-text-primary);\n  font-size: 1.25rem;\n  font-weight: 600;\n}\n\n.header-description {\n  margin: 0;\n  color: var(--mj-text-muted);\n  font-size: 0.9rem;\n  line-height: 1.4;\n}\n\n.header-stats {\n  display: flex;\n  flex-direction: column;\n  align-items: flex-end;\n  gap: 0.25rem;\n  font-size: 0.85rem;\n}\n\n.selection-count {\n  color: var(--mj-brand-primary);\n  font-weight: 600;\n}\n\n.total-count {\n  color: var(--mj-text-muted);\n}\n\n/* === Controls Section === */\n.controls-section {\n  padding: 1rem 1.5rem;\n  background: var(--mj-bg-surface);\n  border-bottom: 1px solid var(--mj-bg-surface-sunken);\n  display: flex;\n  gap: 1rem;\n  align-items: flex-end;\n}\n\n.search-controls {\n  flex: 1;\n}\n\n.search-input {\n  position: relative;\n  display: flex;\n  align-items: center;\n}\n\n.search-icon {\n  position: absolute;\n  left: 12px;\n  color: var(--mj-text-muted);\n  z-index: 1;\n}\n\n.search-field {\n  width: 100%;\n  padding-left: 40px;\n}\n\n.clear-search {\n  position: absolute;\n  right: 8px;\n  z-index: 1;\n}\n\n.filter-controls {\n  display: flex;\n  gap: 1rem;\n  align-items: flex-end;\n}\n\n.type-filter {\n  display: flex;\n  flex-direction: column;\n  gap: 0.5rem;\n}\n\n.type-filter label {\n  font-size: 0.85rem;\n  font-weight: 500;\n  color: var(--mj-text-secondary);\n}\n\n.type-dropdown {\n  min-width: 150px;\n}\n\n/* === Content Area === */\n.content-area {\n  flex: 1;\n  overflow-y: auto;\n  padding: 1rem;\n}\n\n/* === Loading State === */\n.loading-state {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  height: 300px;\n  color: var(--mj-text-muted);\n}\n\n.loading-state i {\n  color: var(--mj-brand-primary);\n  margin-bottom: 1rem;\n}\n\n.loading-state p {\n  margin: 0;\n  font-size: 1rem;\n}\n\n/* === Empty State === */\n.empty-state {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  height: 300px;\n  color: var(--mj-text-muted);\n  text-align: center;\n}\n\n.empty-state i {\n  font-size: 3rem;\n  color: var(--mj-border-default);\n  margin-bottom: 1rem;\n}\n\n.empty-state h4 {\n  margin: 0 0 0.5rem 0;\n  color: var(--mj-text-secondary);\n  font-size: 1.1rem;\n}\n\n.empty-state p {\n  margin: 0 0 1rem 0;\n  max-width: 400px;\n  line-height: 1.5;\n}\n\n/* === Agents Grid === */\n.agents-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n  gap: 1rem;\n}\n\n.agent-card {\n  background: var(--mj-bg-surface);\n  border: 2px solid var(--mj-bg-surface-sunken);\n  border-radius: 8px;\n  padding: 1rem;\n  cursor: pointer;\n  transition: all 0.2s ease;\n  display: flex;\n  gap: 1rem;\n  position: relative;\n}\n\n.agent-card:hover {\n  border-color: var(--mj-brand-primary);\n  box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n}\n\n.agent-card.selected {\n  border-color: var(--mj-brand-primary);\n  background: color-mix(in srgb, var(--mj-brand-primary) 4%, var(--mj-bg-surface));\n  box-shadow: 0 2px 8px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n}\n\n.selection-indicator {\n  position: absolute;\n  top: 0.75rem;\n  right: 0.75rem;\n  font-size: 1.1rem;\n}\n\n.selection-indicator .fa-check-circle {\n  color: var(--mj-status-success);\n}\n\n.selection-indicator .fa-circle {\n  color: var(--mj-border-default);\n}\n\n.agent-icon {\n  flex-shrink: 0;\n  width: 48px;\n  height: 48px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: 8px;\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-bg-surface-sunken);\n}\n\n.agent-icon i {\n  font-size: 1.5rem;\n  color: var(--mj-brand-primary);\n}\n\n.agent-logo {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  border-radius: 6px;\n}\n\n.agent-info {\n  flex: 1;\n  min-width: 0;\n}\n\n.agent-name {\n  font-size: 1rem;\n  font-weight: 600;\n  color: var(--mj-text-primary);\n  margin-bottom: 0.5rem;\n  word-wrap: break-word;\n}\n\n.agent-description {\n  font-size: 0.85rem;\n  color: var(--mj-text-muted);\n  line-height: 1.4;\n  margin-bottom: 0.75rem;\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n\n.agent-meta {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 0.5rem;\n}\n\n.status-badge,\n.type-badge,\n.execution-badge {\n  padding: 0.25rem 0.5rem;\n  border-radius: 4px;\n  font-size: 0.75rem;\n  font-weight: 500;\n  color: var(--mj-text-inverse);\n}\n\n/* Status badge color set dynamically via style binding */\n\n.type-badge {\n  background: var(--mj-brand-primary);\n}\n\n.execution-badge {\n  background: var(--mj-status-warning);\n}\n\n/* === Dialog Footer === */\n.dialog-footer {\n  padding: 1rem 1.5rem;\n  background: var(--mj-bg-surface);\n  border-top: 1px solid var(--mj-bg-surface-sunken);\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.footer-left {\n  display: flex;\n  gap: 0.5rem;\n}\n\n.footer-right {\n  display: flex;\n  gap: 0.75rem;\n}\n\n.dialog-footer button {\n  min-width: 100px;\n}\n\n.dialog-footer button i {\n  margin-right: 0.5rem;\n}\n\n/* === Responsive Design === */\n@media (max-width: 768px) {\n  .agents-grid {\n    grid-template-columns: 1fr;\n  }\n\n  .dialog-header {\n    flex-direction: column;\n    gap: 1rem;\n  }\n\n  .header-stats {\n    align-items: flex-start;\n  }\n\n  .controls-section {\n    flex-direction: column;\n    align-items: stretch;\n  }\n\n  .filter-controls {\n    justify-content: flex-start;\n  }\n\n  .dialog-footer {\n    flex-direction: column-reverse;\n    gap: 1rem;\n  }\n\n  .footer-left,\n  .footer-right {\n    width: 100%;\n    justify-content: center;\n  }\n}\n"] }]
    }], () => [{ type: i1.WindowRef }, { type: i0.ChangeDetectorRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubAgentSelectorDialogComponent, { className: "SubAgentSelectorDialogComponent", filePath: "src/lib/custom/AIAgents/sub-agent-selector-dialog.component.ts", lineNumber: 38 }); })();
//# sourceMappingURL=sub-agent-selector-dialog.component.js.map