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, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil, debounceTime, distinctUntilChanged, combineLatestWith } from 'rxjs/operators';
import { CompositeKey, LogError, RunView } from '@memberjunction/core';
import { ActionEngineBase } from '@memberjunction/actions-base';
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { ActionExplorerStateService } from '../../services/action-explorer-state.service';
import { ActionTreePanelComponent } from './action-tree-panel.component';
import { validateEnumParam, boundNameList } from '../../../shared/agent-tool-validation';
import { findByIdOrNameOrError } from '../../agent-tool-helpers';
import * as i0 from "@angular/core";
import * as i1 from "../../services/action-explorer-state.service";
import * as i2 from "@memberjunction/ng-ui-components";
import * as i3 from "@memberjunction/ng-actions";
import * as i4 from "@memberjunction/ng-shared-generic";
import * as i5 from "./action-tree-panel.component";
import * as i6 from "./action-breadcrumb.component";
import * as i7 from "./action-card.component";
import * as i8 from "./action-list-item.component";
import * as i9 from "./new-category-panel.component";
import * as i10 from "./new-action-panel.component";
const _forTrack0 = ($index, $item) => $item.value;
const _forTrack1 = ($index, $item) => $item.field;
const _forTrack2 = ($index, $item) => $item.ID;
function ActionExplorerComponent_Conditional_17_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 29);
    i0.ɵɵlistener("click", function ActionExplorerComponent_Conditional_17_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.StateService.setStatusFilter([])); });
    i0.ɵɵtext(1, "Clear");
    i0.ɵɵelementEnd();
} }
function ActionExplorerComponent_For_20_Template(rf, ctx) { if (rf & 1) {
    const _r3 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "label", 30)(1, "input", 31);
    i0.ɵɵlistener("change", function ActionExplorerComponent_For_20_Template_input_change_1_listener() { const status_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleStatus(status_r4.value)); });
    i0.ɵɵelementEnd();
    i0.ɵɵelement(2, "span", 32);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const status_r4 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("selected", ctx_r1.isStatusSelected(status_r4.value));
    i0.ɵɵadvance();
    i0.ɵɵproperty("checked", ctx_r1.isStatusSelected(status_r4.value));
    i0.ɵɵadvance();
    i0.ɵɵattribute("data-status", status_r4.value);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", status_r4.label, " ");
} }
function ActionExplorerComponent_Conditional_25_Template(rf, ctx) { if (rf & 1) {
    const _r5 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 29);
    i0.ɵɵlistener("click", function ActionExplorerComponent_Conditional_25_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.StateService.setTypeFilter([])); });
    i0.ɵɵtext(1, "Clear");
    i0.ɵɵelementEnd();
} }
function ActionExplorerComponent_For_28_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "label", 30)(1, "input", 31);
    i0.ɵɵlistener("change", function ActionExplorerComponent_For_28_Template_input_change_1_listener() { const type_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toggleType(type_r7.value)); });
    i0.ɵɵelementEnd();
    i0.ɵɵelement(2, "i");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const type_r7 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("selected", ctx_r1.isTypeSelected(type_r7.value));
    i0.ɵɵadvance();
    i0.ɵɵproperty("checked", ctx_r1.isTypeSelected(type_r7.value));
    i0.ɵɵadvance();
    i0.ɵɵclassMap(type_r7.icon);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", type_r7.label, " ");
} }
function ActionExplorerComponent_For_35_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 35);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵclassMap(ctx_r1.SortDirection === "asc" ? "fa-solid fa-arrow-up" : "fa-solid fa-arrow-down");
} }
function ActionExplorerComponent_For_35_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 33);
    i0.ɵɵlistener("click", function ActionExplorerComponent_For_35_Template_button_click_0_listener() { const option_r9 = i0.ɵɵrestoreView(_r8).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.setSortField(option_r9.field)); });
    i0.ɵɵelement(1, "i");
    i0.ɵɵtext(2);
    i0.ɵɵconditionalCreate(3, ActionExplorerComponent_For_35_Conditional_3_Template, 1, 2, "i", 34);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const option_r9 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("selected", ctx_r1.SortField === option_r9.field);
    i0.ɵɵadvance();
    i0.ɵɵclassMap(option_r9.icon);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", option_r9.label, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.SortField === option_r9.field ? 3 : -1);
} }
function ActionExplorerComponent_Conditional_39_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵelement(1, "mj-loading", 36);
    i0.ɵɵelementEnd();
} }
function ActionExplorerComponent_Conditional_44_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-empty-state", 37);
    i0.ɵɵlistener("Action", function ActionExplorerComponent_Conditional_44_Template_mj_empty_state_Action_0_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEmptyStateAction()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("Variant", ctx_r1.IsListNarrowed ? "no-results" : "empty")("Icon", ctx_r1.IsListNarrowed ? "fa-solid fa-filter-circle-xmark" : "fa-solid fa-bolt")("Title", ctx_r1.IsListNarrowed ? "No actions match your filters" : "No actions yet")("Message", ctx_r1.IsListNarrowed ? "Try adjusting your search or filter criteria" : "Create your first action to get started")("ActionText", ctx_r1.IsListNarrowed ? "Reset filters" : "Create Action")("ActionIcon", ctx_r1.IsListNarrowed ? "fa-solid fa-rotate-left" : "fa-solid fa-plus");
} }
function ActionExplorerComponent_Conditional_45_Conditional_0_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r11 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-action-card", 42);
    i0.ɵɵlistener("ActionClick", function ActionExplorerComponent_Conditional_45_Conditional_0_For_2_Template_mj_action_card_ActionClick_0_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionClick($event)); })("EditClick", function ActionExplorerComponent_Conditional_45_Conditional_0_For_2_Template_mj_action_card_EditClick_0_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionEdit($event)); })("RunClick", function ActionExplorerComponent_Conditional_45_Conditional_0_For_2_Template_mj_action_card_RunClick_0_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionRun($event)); })("CategoryClick", function ActionExplorerComponent_Conditional_45_Conditional_0_For_2_Template_mj_action_card_CategoryClick_0_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCategoryClick($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const action_r12 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("Action", action_r12)("Categories", ctx_r1.CategoriesMap);
} }
function ActionExplorerComponent_Conditional_45_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 38);
    i0.ɵɵrepeaterCreate(1, ActionExplorerComponent_Conditional_45_Conditional_0_For_2_Template, 1, 2, "mj-action-card", 41, _forTrack2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r1.FilteredActions);
} }
function ActionExplorerComponent_Conditional_45_Conditional_1_For_17_Template(rf, ctx) { if (rf & 1) {
    const _r13 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-action-list-item", 53);
    i0.ɵɵlistener("ActionClick", function ActionExplorerComponent_Conditional_45_Conditional_1_For_17_Template_mj_action_list_item_ActionClick_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionClick($event)); })("EditClick", function ActionExplorerComponent_Conditional_45_Conditional_1_For_17_Template_mj_action_list_item_EditClick_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionEdit($event)); })("RunClick", function ActionExplorerComponent_Conditional_45_Conditional_1_For_17_Template_mj_action_list_item_RunClick_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionRun($event)); })("CategoryClick", function ActionExplorerComponent_Conditional_45_Conditional_1_For_17_Template_mj_action_list_item_CategoryClick_0_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCategoryClick($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const action_r14 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("Action", action_r14)("Categories", ctx_r1.CategoriesMap)("IsCompact", false);
} }
function ActionExplorerComponent_Conditional_45_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 39)(1, "div", 43);
    i0.ɵɵelement(2, "div", 44);
    i0.ɵɵelementStart(3, "div", 45);
    i0.ɵɵtext(4, "Name");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "div", 46);
    i0.ɵɵtext(6, "Category");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "div", 47);
    i0.ɵɵtext(8, "Status");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "div", 48);
    i0.ɵɵtext(10, "Type");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "div", 49);
    i0.ɵɵtext(12, "Params");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(13, "div", 50);
    i0.ɵɵtext(14, "Updated");
    i0.ɵɵelementEnd();
    i0.ɵɵelement(15, "div", 51);
    i0.ɵɵelementEnd();
    i0.ɵɵrepeaterCreate(16, ActionExplorerComponent_Conditional_45_Conditional_1_For_17_Template, 1, 3, "mj-action-list-item", 52, _forTrack2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(16);
    i0.ɵɵrepeater(ctx_r1.FilteredActions);
} }
function ActionExplorerComponent_Conditional_45_Conditional_2_For_2_Template(rf, ctx) { if (rf & 1) {
    const _r15 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-action-list-item", 53);
    i0.ɵɵlistener("ActionClick", function ActionExplorerComponent_Conditional_45_Conditional_2_For_2_Template_mj_action_list_item_ActionClick_0_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionClick($event)); })("EditClick", function ActionExplorerComponent_Conditional_45_Conditional_2_For_2_Template_mj_action_list_item_EditClick_0_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionEdit($event)); })("RunClick", function ActionExplorerComponent_Conditional_45_Conditional_2_For_2_Template_mj_action_list_item_RunClick_0_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onActionRun($event)); })("CategoryClick", function ActionExplorerComponent_Conditional_45_Conditional_2_For_2_Template_mj_action_list_item_CategoryClick_0_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCategoryClick($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const action_r16 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("Action", action_r16)("Categories", ctx_r1.CategoriesMap)("IsCompact", true);
} }
function ActionExplorerComponent_Conditional_45_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 40);
    i0.ɵɵrepeaterCreate(1, ActionExplorerComponent_Conditional_45_Conditional_2_For_2_Template, 1, 3, "mj-action-list-item", 52, _forTrack2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r1.FilteredActions);
} }
function ActionExplorerComponent_Conditional_45_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵconditionalCreate(0, ActionExplorerComponent_Conditional_45_Conditional_0_Template, 3, 0, "div", 38);
    i0.ɵɵconditionalCreate(1, ActionExplorerComponent_Conditional_45_Conditional_1_Template, 18, 0, "div", 39);
    i0.ɵɵconditionalCreate(2, ActionExplorerComponent_Conditional_45_Conditional_2_Template, 3, 0, "div", 40);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵconditional(ctx_r1.ViewMode === "card" ? 0 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.ViewMode === "list" ? 1 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r1.ViewMode === "compact" ? 2 : -1);
} }
function ActionExplorerComponent_Conditional_48_Template(rf, ctx) { if (rf & 1) {
    const _r17 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "mj-action-test-harness-dialog", 54);
    i0.ɵɵlistener("Close", function ActionExplorerComponent_Conditional_48_Template_mj_action_test_harness_dialog_Close_0_listener() { i0.ɵɵrestoreView(_r17); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnRunDialogClose()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("Action", ctx_r1.SelectedActionForRun)("ActionParams", ctx_r1.SelectedActionParams)("IsOpen", ctx_r1.IsRunDialogOpen);
} }
let ActionExplorerComponent = class ActionExplorerComponent extends BaseResourceComponent {
    StateService;
    cdr;
    TreePanel;
    IsLoading = true;
    Actions = [];
    FilteredActions = [];
    Categories = [];
    CategoriesMap = new Map();
    ViewMode = 'card';
    SortField = 'name';
    SortDirection = 'asc';
    Filters = {
        searchTerm: '',
        statuses: [],
        types: [],
        approvalStatuses: [],
        hasExecutions: null
    };
    SelectedCategoryId = 'all';
    NewCategoryParentId = null;
    // Run dialog state
    IsRunDialogOpen = false;
    SelectedActionForRun = null;
    SelectedActionParams = [];
    // ───── Toolbar option arrays + helpers (consolidated from former mj-action-toolbar) ─────
    ViewToggleOptions = [
        { key: 'card', icon: 'fa-solid fa-grip', title: 'Card view' },
        { key: 'list', icon: 'fa-solid fa-list', title: 'List view' },
        { key: 'compact', icon: 'fa-solid fa-bars', title: 'Compact view' }
    ];
    SortOptions = [
        { field: 'name', label: 'Name', icon: 'fa-solid fa-font' },
        { field: 'updated', label: 'Last Updated', icon: 'fa-solid fa-clock' },
        { field: 'status', label: 'Status', icon: 'fa-solid fa-circle-check' },
        { field: 'type', label: 'Type', icon: 'fa-solid fa-tag' },
        { field: 'category', label: 'Category', icon: 'fa-solid fa-folder' }
    ];
    StatusOptions = [
        { value: 'Active', label: 'Active' },
        { value: 'Pending', label: 'Pending' },
        { value: 'Disabled', label: 'Disabled' }
    ];
    TypeOptions = [
        { value: 'Generated', label: 'AI Generated', icon: 'fa-solid fa-robot' },
        { value: 'Custom', label: 'Custom', icon: 'fa-solid fa-code' }
    ];
    /** Allowed view modes (mirrors `ViewToggleOptions` / `ActionViewMode`). */
    viewModeValues = ['card', 'list', 'compact'];
    /** Allowed sort fields (mirrors `SortOptions` / `SortField`). */
    sortFieldValues = ['name', 'updated', 'status', 'type', 'category'];
    /** Allowed sort directions. */
    sortDirectionValues = ['asc', 'desc'];
    /** Allowed action statuses (mirrors `StatusOptions`). */
    statusValues = ['Active', 'Pending', 'Disabled'];
    /** Allowed action types (mirrors `TypeOptions`). */
    typeValues = ['Generated', 'Custom'];
    destroy$ = new Subject();
    searchInput$ = new Subject();
    constructor(StateService, cdr) {
        super();
        this.StateService = StateService;
        this.cdr = cdr;
    }
    ngOnInit() {
        super.ngOnInit();
        this.subscribeToState();
        this.setupSearchDebounce();
        this.applyQueryParams(this.GetQueryParams());
        this.StateService.loadSavedState();
        this.registerAgentTools();
        this.loadData();
    }
    setupSearchDebounce() {
        this.searchInput$.pipe(debounceTime(300), distinctUntilChanged(), takeUntil(this.destroy$)).subscribe(term => {
            this.StateService.setSearchTerm(term);
        });
    }
    ngOnDestroy() {
        super.ngOnDestroy();
        this.destroy$.next();
        this.destroy$.complete();
    }
    subscribeToState() {
        // Subscribe to view mode changes
        this.StateService.ViewMode$.pipe(takeUntil(this.destroy$)).subscribe(mode => {
            this.ViewMode = mode;
            this.publishAgentContext();
            this.cdr.markForCheck();
        });
        // Subscribe to selected category changes
        this.StateService.SelectedCategoryId$.pipe(takeUntil(this.destroy$)).subscribe(id => {
            this.SelectedCategoryId = id;
            this.applyFilters();
            this.UpdateQueryParams(this.StateService.buildQueryParams());
            this.publishAgentContext();
            this.cdr.markForCheck();
        });
        // Subscribe to filter and sort changes
        this.StateService.Filters$.pipe(combineLatestWith(this.StateService.SortConfig$), debounceTime(50), takeUntil(this.destroy$)).subscribe(([filters, sort]) => {
            this.Filters = filters;
            this.SortField = sort.field;
            this.SortDirection = sort.direction;
            this.applyFilters();
            this.UpdateQueryParams(this.StateService.buildQueryParams());
            this.publishAgentContext();
            this.cdr.markForCheck();
        });
    }
    // ================================================================
    // AI Agent context + client tools
    //
    // 🚨 SAFETY BOUNDARY: This is the Actions app. Executing an action has real
    // side effects (data mutation, emails, integrations). Action EXECUTION is
    // intentionally NOT exposed to the agent — `onActionRun()` (which opens the
    // run dialog) is deliberately NOT wired as a tool; running stays user-driven
    // via that dialog. The agent may only FIND / FILTER / SORT / NAVIGATE
    // actions. Every Handler is tolerant (never throws; returns a structured
    // failure on bad input).
    // ================================================================
    /** Publish the current explorer state to the agent. Called on load and on every
     *  view/filter/sort/category change. Deep context: view mode, sort, the selected
     *  category (id + NAME), total/filtered counts, all filter state, and the bounded
     *  list of currently-visible action names so the agent can pick one by name. */
    publishAgentContext() {
        this.navigationService.SetAgentContext(this, {
            ActiveViewMode: this.ViewMode,
            CurrentSortField: this.SortField,
            CurrentSortDirection: this.SortDirection,
            SelectedCategoryId: this.SelectedCategoryId,
            SelectedCategoryName: this.getSelectedCategoryLabel(),
            TotalActionCount: this.Actions.length,
            FilteredActionCount: this.FilteredActions.length,
            CategoryCount: this.Categories.length,
            CurrentSearchTerm: this.Filters.searchTerm,
            SelectedStatuses: [...this.Filters.statuses],
            SelectedTypes: [...this.Filters.types],
            // What the user is looking at — bounded so the streamed note stays small
            VisibleActionNames: boundNameList(this.FilteredActions.map(a => a.Name)),
            AvailableCategoryNames: boundNameList(this.Categories.map(c => c.Name)),
        });
    }
    /** Human label for the current category selection (resolves id → name; handles the special selections). */
    getSelectedCategoryLabel() {
        if (this.SelectedCategoryId === 'all')
            return 'All Categories';
        if (this.SelectedCategoryId === 'uncategorized')
            return 'Uncategorized';
        return this.CategoriesMap.get(this.SelectedCategoryId)?.Name ?? this.SelectedCategoryId;
    }
    /** Register the read-only / navigational client tools the agent can invoke on this surface. */
    registerAgentTools() {
        this.navigationService.SetAgentClientTools(this, [
            {
                Name: 'SwitchViewMode',
                Description: 'Switch the explorer view mode. Allowed: card, list, compact.',
                ParameterSchema: { type: 'object', properties: { mode: { type: 'string', enum: [...this.viewModeValues] } }, required: ['mode'] },
                Handler: async (params) => {
                    const v = validateEnumParam(params['mode'], this.viewModeValues, 'mode');
                    if (!v.ok)
                        return v.result;
                    this.setViewMode(v.value);
                    return { Success: true };
                },
            },
            {
                Name: 'SortActionsByField',
                Description: 'Sort actions by a field and direction. field: name, updated, status, type, category. direction: asc, desc.',
                ParameterSchema: {
                    type: 'object',
                    properties: {
                        field: { type: 'string', enum: [...this.sortFieldValues] },
                        direction: { type: 'string', enum: [...this.sortDirectionValues] },
                    },
                    required: ['field'],
                },
                Handler: async (params) => {
                    const f = validateEnumParam(params['field'], this.sortFieldValues, 'field');
                    if (!f.ok)
                        return f.result;
                    // direction is optional; default to ascending when omitted.
                    let direction = 'asc';
                    if (params['direction'] !== undefined) {
                        const d = validateEnumParam(params['direction'], this.sortDirectionValues, 'direction');
                        if (!d.ok)
                            return d.result;
                        direction = d.value;
                    }
                    this.StateService.setSortConfig({ field: f.value, direction });
                    return { Success: true };
                },
            },
            {
                Name: 'SearchActions',
                Description: 'Search the actions list by a free-text term (matches name and description).',
                ParameterSchema: { type: 'object', properties: { searchTerm: { type: 'string' } }, required: ['searchTerm'] },
                Handler: async (params) => {
                    const term = typeof params['searchTerm'] === 'string' ? params['searchTerm'] : '';
                    this.onSearchInput(term);
                    return { Success: true };
                },
            },
            {
                Name: 'ClearExplorerSearch',
                Description: 'Clear the explorer search term.',
                ParameterSchema: { type: 'object', properties: {} },
                Handler: async () => {
                    this.clearSearch();
                    return { Success: true };
                },
            },
            {
                Name: 'SelectCategory',
                Description: 'Select a category to filter the actions list. Use "all" for all categories or "uncategorized" for actions without a category; otherwise pass a category id.',
                ParameterSchema: { type: 'object', properties: { categoryId: { type: 'string' } }, required: ['categoryId'] },
                Handler: async (params) => {
                    const raw = params['categoryId'];
                    if (typeof raw !== 'string' || raw.trim() === '') {
                        return { Success: false, ErrorMessage: 'A non-empty categoryId is required (use "all" or "uncategorized" for the special selections).' };
                    }
                    if (raw !== 'all' && raw !== 'uncategorized' && !this.CategoriesMap.has(raw)) {
                        return { Success: false, ErrorMessage: `No category found with id "${raw}".` };
                    }
                    this.onCategorySelect(raw);
                    return { Success: true };
                },
            },
            {
                Name: 'SelectCategoryByName',
                Description: 'Select a category to filter by its name (case-insensitive, exact then contains). Use the literal "all" or "uncategorized" for the special selections.',
                ParameterSchema: { type: 'object', properties: { categoryName: { type: 'string' } }, required: ['categoryName'] },
                Handler: async (params) => {
                    const raw = params['categoryName'];
                    if (typeof raw !== 'string' || raw.trim() === '') {
                        return { Success: false, ErrorMessage: 'A non-empty categoryName is required.' };
                    }
                    const lowered = raw.trim().toLowerCase();
                    if (lowered === 'all' || lowered === 'uncategorized') {
                        this.onCategorySelect(lowered);
                        return { Success: true };
                    }
                    const found = findByIdOrNameOrError(raw, this.Categories, 'category');
                    if (!found.ok)
                        return found.result;
                    this.onCategorySelect(found.value.ID);
                    return { Success: true, Data: { Id: found.value.ID, Name: found.value.Name } };
                },
            },
            {
                Name: 'ToggleStatusFilter',
                Description: 'Toggle a status in the status filter. Allowed: Active, Pending, Disabled.',
                ParameterSchema: { type: 'object', properties: { status: { type: 'string', enum: [...this.statusValues] } }, required: ['status'] },
                Handler: async (params) => {
                    const v = validateEnumParam(params['status'], this.statusValues, 'status');
                    if (!v.ok)
                        return v.result;
                    this.toggleStatus(v.value);
                    return { Success: true };
                },
            },
            {
                Name: 'ToggleTypeFilter',
                Description: 'Toggle a type in the type filter. Allowed: Generated (AI-generated), Custom.',
                ParameterSchema: { type: 'object', properties: { type: { type: 'string', enum: [...this.typeValues] } }, required: ['type'] },
                Handler: async (params) => {
                    const v = validateEnumParam(params['type'], this.typeValues, 'type');
                    if (!v.ok)
                        return v.result;
                    this.toggleType(v.value);
                    return { Success: true };
                },
            },
            {
                Name: 'ClearExplorerFilters',
                Description: 'Clear all status / type / search filters in the explorer.',
                ParameterSchema: { type: 'object', properties: {} },
                Handler: async () => {
                    this.clearFilters();
                    return { Success: true };
                },
            },
            {
                Name: 'SetSortDirection',
                Description: 'Set the sort direction without changing the sort field. Allowed: asc, desc.',
                ParameterSchema: { type: 'object', properties: { direction: { type: 'string', enum: [...this.sortDirectionValues] } }, required: ['direction'] },
                Handler: async (params) => {
                    const d = validateEnumParam(params['direction'], this.sortDirectionValues, 'direction');
                    if (!d.ok)
                        return d.result;
                    this.StateService.setSortConfig({ field: this.SortField, direction: d.value });
                    return { Success: true };
                },
            },
            {
                Name: 'OpenActionRecord',
                Description: 'Open the detail record for an action by its id OR its name (navigation only — does NOT run the action). Name matching is case-insensitive (exact then contains).',
                ParameterSchema: { type: 'object', properties: { action: { type: 'string' } }, required: ['action'] },
                Handler: async (params) => {
                    const found = findByIdOrNameOrError(params['action'], this.Actions, 'action');
                    if (!found.ok)
                        return found.result;
                    this.onActionClick(found.value);
                    return { Success: true, Data: { Id: found.value.ID, Name: found.value.Name } };
                },
            },
            {
                Name: 'NavigateToActionCategory',
                Description: 'Open the category record that a given action belongs to (related-record navigation). Pass the action id or name. Fails if the action has no category.',
                ParameterSchema: { type: 'object', properties: { action: { type: 'string' } }, required: ['action'] },
                Handler: async (params) => {
                    const found = findByIdOrNameOrError(params['action'], this.Actions, 'action');
                    if (!found.ok)
                        return found.result;
                    const categoryId = found.value.CategoryID;
                    if (!categoryId) {
                        return { Success: false, ErrorMessage: `Action "${found.value.Name}" has no category to navigate to.` };
                    }
                    const category = this.CategoriesMap.get(categoryId);
                    this.onEditCategory(category ?? { ID: categoryId });
                    return { Success: true, Data: { CategoryId: categoryId, CategoryName: category?.Name ?? null } };
                },
            },
            {
                Name: 'RefreshExplorerData',
                Description: 'Reload the action explorer data (actions + categories).',
                ParameterSchema: { type: 'object', properties: {} },
                Handler: async () => {
                    await this.onRefresh();
                    return { Success: true };
                },
            },
        ]);
    }
    /**
     * Convert the framework's plain-object params into the StateService's URLSearchParams-based parser.
     */
    applyQueryParams(params) {
        const urlParams = new URLSearchParams();
        for (const [key, value] of Object.entries(params)) {
            if (value != null) {
                urlParams.set(key, value);
            }
        }
        this.StateService.parseQueryParams(urlParams);
    }
    async loadData() {
        try {
            this.IsLoading = true;
            this.cdr.markForCheck();
            // Initialize ActionEngineBase
            await ActionEngineBase.Instance.Config(false);
            // Get actions and categories from engine
            this.Actions = ActionEngineBase.Instance.Actions;
            this.Categories = ActionEngineBase.Instance.ActionCategories;
            // Build categories map
            this.CategoriesMap.clear();
            this.Categories.forEach(c => this.CategoriesMap.set(c.ID, c));
            // Build tree panel if available
            if (this.TreePanel) {
                this.TreePanel.Categories = this.Categories;
                this.TreePanel.Actions = this.Actions;
                this.TreePanel.buildCategoryTree();
            }
            // Apply filters
            this.applyFilters();
            // Expand path to selected category if needed
            if (this.SelectedCategoryId !== 'all' && this.SelectedCategoryId !== 'uncategorized') {
                const categoryParentMap = new Map();
                this.Categories.forEach(c => categoryParentMap.set(c.ID, c.ParentID || null));
                this.StateService.expandPathToCategory(this.SelectedCategoryId, categoryParentMap);
            }
            this.publishAgentContext();
        }
        catch (error) {
            LogError('Failed to load action explorer data', undefined, error);
        }
        finally {
            this.IsLoading = false;
            this.cdr.markForCheck();
            this.NotifyLoadComplete();
        }
    }
    applyFilters() {
        let filtered = [...this.Actions];
        const filters = this.StateService.Filters;
        const sortConfig = this.StateService.SortConfig;
        // Apply category filter
        if (this.SelectedCategoryId === 'uncategorized') {
            filtered = filtered.filter(a => !a.CategoryID);
        }
        else if (this.SelectedCategoryId !== 'all') {
            // Include descendants
            const descendants = this.getDescendantCategoryIds(this.SelectedCategoryId);
            filtered = filtered.filter(a => a.CategoryID && descendants.has(a.CategoryID));
        }
        // Apply search filter
        if (filters.searchTerm) {
            const term = filters.searchTerm.toLowerCase();
            filtered = filtered.filter(a => a.Name.toLowerCase().includes(term) ||
                (a.Description || '').toLowerCase().includes(term));
        }
        // Apply status filter
        if (filters.statuses.length > 0) {
            filtered = filtered.filter(a => filters.statuses.includes(a.Status));
        }
        // Apply type filter
        if (filters.types.length > 0) {
            filtered = filtered.filter(a => filters.types.includes(a.Type));
        }
        // Apply sorting
        filtered = this.sortActions(filtered, sortConfig);
        this.FilteredActions = filtered;
    }
    getDescendantCategoryIds(categoryId) {
        const descendants = new Set([categoryId]);
        const addDescendants = (parentId) => {
            this.Categories.forEach(c => {
                if (UUIDsEqual(c.ParentID, parentId) && !descendants.has(c.ID)) {
                    descendants.add(c.ID);
                    addDescendants(c.ID);
                }
            });
        };
        addDescendants(categoryId);
        return descendants;
    }
    sortActions(actions, config) {
        const sorted = [...actions];
        const direction = config.direction === 'asc' ? 1 : -1;
        sorted.sort((a, b) => {
            let comparison = 0;
            switch (config.field) {
                case 'name':
                    comparison = a.Name.localeCompare(b.Name);
                    break;
                case 'updated':
                    const dateA = a.__mj_UpdatedAt ? new Date(a.__mj_UpdatedAt).getTime() : 0;
                    const dateB = b.__mj_UpdatedAt ? new Date(b.__mj_UpdatedAt).getTime() : 0;
                    comparison = dateA - dateB;
                    break;
                case 'status':
                    comparison = (a.Status || '').localeCompare(b.Status || '');
                    break;
                case 'type':
                    comparison = (a.Type || '').localeCompare(b.Type || '');
                    break;
                case 'category':
                    const catA = this.CategoriesMap.get(a.CategoryID || '')?.Name || '';
                    const catB = this.CategoriesMap.get(b.CategoryID || '')?.Name || '';
                    comparison = catA.localeCompare(catB);
                    break;
            }
            return comparison * direction;
        });
        return sorted;
    }
    /**
     * React to back/forward navigation or deep-link activation.
     * Called by the base class when the URL query params change externally.
     */
    OnQueryParamsChanged(params, source) {
        this.applyQueryParams(params);
        this.applyFilters();
        this.cdr.markForCheck();
    }
    async onRefresh() {
        await ActionEngineBase.Instance.Config(true); // Force refresh
        await this.loadData();
    }
    onCategorySelect(categoryId) {
        this.StateService.setSelectedCategoryId(categoryId);
    }
    onNewCategory(parentId) {
        this.NewCategoryParentId = parentId;
        this.StateService.openNewCategoryPanel();
    }
    onEditCategory(category) {
        const key = new CompositeKey([{ FieldName: 'ID', Value: category.ID }]);
        this.navigationService.OpenEntityRecord('MJ: Action Categories', key);
    }
    onNewAction() {
        this.StateService.openNewActionPanel();
    }
    /** True when search/filters or a category selection narrow the list. */
    get IsListNarrowed() {
        return this.StateService.hasActiveFilters() || this.SelectedCategoryId !== 'all';
    }
    /** Empty-state CTA: reset filters when narrowed, otherwise create. */
    onEmptyStateAction() {
        if (this.IsListNarrowed) {
            this.StateService.clearFilters();
            this.StateService.setSelectedCategoryId('all');
        }
        else {
            this.onNewAction();
        }
    }
    onActionClick(action) {
        const key = new CompositeKey([{ FieldName: 'ID', Value: action.ID }]);
        this.navigationService.OpenEntityRecord('MJ: Actions', key);
    }
    onActionEdit(action) {
        this.onActionClick(action);
    }
    async onActionRun(action) {
        if (action.Status !== 'Active') {
            return; // Can't run inactive actions
        }
        try {
            // Load action params
            const rv = RunView.FromMetadataProvider(this.ProviderToUse);
            const result = await rv.RunView({
                EntityName: 'MJ: Action Params',
                ExtraFilter: `ActionID='${action.ID}'`,
                OrderBy: 'Name',
                ResultType: 'entity_object'
            });
            this.SelectedActionParams = result.Success ? result.Results || [] : [];
            // MJActionEntityExtended extends MJActionEntity, so this cast is safe
            this.SelectedActionForRun = action;
            this.IsRunDialogOpen = true;
            this.cdr.markForCheck();
        }
        catch (error) {
            LogError('Failed to open action run dialog', undefined, error);
        }
    }
    OnRunDialogClose() {
        this.IsRunDialogOpen = false;
        this.SelectedActionForRun = null;
        this.SelectedActionParams = [];
        this.cdr.markForCheck();
    }
    onCategoryClick(categoryId) {
        this.StateService.setSelectedCategoryId(categoryId);
    }
    async onCategoryCreated(category) {
        // Refresh data to include new category
        await this.loadData();
        // Select the new category
        this.StateService.setSelectedCategoryId(category.ID);
    }
    async onActionCreated() {
        // Refresh data to include new action
        await this.loadData();
    }
    // ───── Toolbar handlers (consolidated from former mj-action-toolbar) ─────
    onSearchInput(term) {
        this.searchInput$.next(term);
    }
    clearSearch() {
        this.StateService.setSearchTerm('');
    }
    setViewMode(mode) {
        this.StateService.setViewMode(mode);
    }
    setSortField(field) {
        this.StateService.setSortField(field);
    }
    toggleStatus(status) {
        const current = [...this.Filters.statuses];
        const i = current.indexOf(status);
        if (i >= 0)
            current.splice(i, 1);
        else
            current.push(status);
        this.StateService.setStatusFilter(current);
    }
    toggleType(type) {
        const current = [...this.Filters.types];
        const i = current.indexOf(type);
        if (i >= 0)
            current.splice(i, 1);
        else
            current.push(type);
        this.StateService.setTypeFilter(current);
    }
    isStatusSelected(status) {
        return this.Filters.statuses.includes(status);
    }
    isTypeSelected(type) {
        return this.Filters.types.includes(type);
    }
    clearFilters() {
        this.StateService.clearFilters();
    }
    /** Active filter count for the popover badge — counts only Status + Type
     *  (searchTerm has its own search input, not part of the popover). */
    get StatusTypeFilterCount() {
        return this.Filters.statuses.length + this.Filters.types.length;
    }
    async GetResourceDisplayName(data) {
        return 'Action Explorer';
    }
    async GetResourceIconClass(data) {
        return 'fa-solid fa-folder-tree';
    }
    static ɵfac = function ActionExplorerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ActionExplorerComponent)(i0.ɵɵdirectiveInject(i1.ActionExplorerStateService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ActionExplorerComponent, selectors: [["mj-action-explorer"]], viewQuery: function ActionExplorerComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(ActionTreePanelComponent, 5);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.TreePanel = _t.first);
        } }, standalone: false, features: [i0.ɵɵProvidersFeature([ActionExplorerStateService]), i0.ɵɵInheritDefinitionFeature], decls: 49, vars: 21, consts: [["Title", "Action Explorer", "Icon", "fa-solid fa-folder-tree", "Subtitle", "Browse, organize, and run all configured actions"], ["meta", ""], ["Label", "actions", 3, "Count", "Total"], ["actions", ""], [3, "Clicked"], ["mjButton", "", "variant", "primary", "size", "sm", "title", "New Action", 3, "click"], [1, "fa-solid", "fa-plus"], [1, "action-btn-label"], ["toolbar", ""], ["Placeholder", "Search actions...", 3, "ValueChange", "Value"], [3, "ClearAllRequested", "ActiveCount", "ShowClearAll"], [1, "dropdown-section"], [1, "section-header"], ["mjButton", "", "variant", "flat", "size", "sm"], [1, "filter-options"], [1, "filter-option", 3, "selected"], [1, "sort-option", 3, "selected"], [3, "KeyChange", "Options", "ActiveKey"], [3, "Flex", "Padding"], [1, "action-explorer"], [1, "loading-overlay"], [3, "CategorySelected", "NewCategoryClick", "EditCategoryClick", "Categories", "Actions"], [1, "explorer-main"], [3, "CategorySelect", "SelectedCategoryId", "Categories"], [1, "explorer-content"], [3, "Variant", "Icon", "Title", "Message", "ActionText", "ActionIcon"], [3, "CategoryCreated", "Close", "Categories", "PreselectedParentId"], [3, "ActionCreated", "Categories"], [3, "Action", "ActionParams", "IsOpen"], ["mjButton", "", "variant", "flat", "size", "sm", 3, "click"], [1, "filter-option"], ["type", "checkbox", 3, "change", "checked"], [1, "status-dot"], [1, "sort-option", 3, "click"], [1, "direction-icon", 3, "class"], [1, "direction-icon"], ["text", "Loading actions...", "size", "medium"], [3, "Action", "Variant", "Icon", "Title", "Message", "ActionText", "ActionIcon"], [1, "card-grid"], [1, "list-view"], [1, "compact-view"], [3, "Action", "Categories"], [3, "ActionClick", "EditClick", "RunClick", "CategoryClick", "Action", "Categories"], [1, "list-header"], [1, "header-icon"], [1, "header-name"], [1, "header-category"], [1, "header-status"], [1, "header-type"], [1, "header-params"], [1, "header-updated"], [1, "header-actions"], [3, "Action", "Categories", "IsCompact"], [3, "ActionClick", "EditClick", "RunClick", "CategoryClick", "Action", "Categories", "IsCompact"], [3, "Close", "Action", "ActionParams", "IsOpen"]], template: function ActionExplorerComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "mj-page-layout")(1, "mj-page-header", 0)(2, "div", 1);
            i0.ɵɵelement(3, "mj-stat-badge", 2);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(4, "div", 3)(5, "mj-refresh-button", 4);
            i0.ɵɵlistener("Clicked", function ActionExplorerComponent_Template_mj_refresh_button_Clicked_5_listener() { return ctx.onRefresh(); });
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(6, "button", 5);
            i0.ɵɵlistener("click", function ActionExplorerComponent_Template_button_click_6_listener() { return ctx.onNewAction(); });
            i0.ɵɵelement(7, "i", 6);
            i0.ɵɵelementStart(8, "span", 7);
            i0.ɵɵtext(9, "New Action");
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(10, "div", 8)(11, "mj-page-search", 9);
            i0.ɵɵlistener("ValueChange", function ActionExplorerComponent_Template_mj_page_search_ValueChange_11_listener($event) { return ctx.onSearchInput($event); });
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(12, "mj-filter-popover", 10);
            i0.ɵɵlistener("ClearAllRequested", function ActionExplorerComponent_Template_mj_filter_popover_ClearAllRequested_12_listener() { return ctx.clearFilters(); });
            i0.ɵɵelementStart(13, "div", 11)(14, "div", 12)(15, "span");
            i0.ɵɵtext(16, "Status");
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(17, ActionExplorerComponent_Conditional_17_Template, 2, 0, "button", 13);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(18, "div", 14);
            i0.ɵɵrepeaterCreate(19, ActionExplorerComponent_For_20_Template, 4, 5, "label", 15, _forTrack0);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(21, "div", 11)(22, "div", 12)(23, "span");
            i0.ɵɵtext(24, "Type");
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(25, ActionExplorerComponent_Conditional_25_Template, 2, 0, "button", 13);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(26, "div", 14);
            i0.ɵɵrepeaterCreate(27, ActionExplorerComponent_For_28_Template, 4, 6, "label", 15, _forTrack0);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(29, "div", 11)(30, "div", 12)(31, "span");
            i0.ɵɵtext(32, "Sort");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(33, "div", 14);
            i0.ɵɵrepeaterCreate(34, ActionExplorerComponent_For_35_Template, 4, 6, "button", 16, _forTrack1);
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(36, "mj-view-toggle", 17);
            i0.ɵɵlistener("KeyChange", function ActionExplorerComponent_Template_mj_view_toggle_KeyChange_36_listener($event) { return ctx.setViewMode($event); });
            i0.ɵɵelementEnd()()();
            i0.ɵɵelementStart(37, "mj-page-body", 18)(38, "div", 19);
            i0.ɵɵconditionalCreate(39, ActionExplorerComponent_Conditional_39_Template, 2, 0, "div", 20);
            i0.ɵɵelementStart(40, "mj-action-tree-panel", 21);
            i0.ɵɵlistener("CategorySelected", function ActionExplorerComponent_Template_mj_action_tree_panel_CategorySelected_40_listener($event) { return ctx.onCategorySelect($event); })("NewCategoryClick", function ActionExplorerComponent_Template_mj_action_tree_panel_NewCategoryClick_40_listener($event) { return ctx.onNewCategory($event); })("EditCategoryClick", function ActionExplorerComponent_Template_mj_action_tree_panel_EditCategoryClick_40_listener($event) { return ctx.onEditCategory($event); });
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(41, "div", 22)(42, "mj-action-breadcrumb", 23);
            i0.ɵɵlistener("CategorySelect", function ActionExplorerComponent_Template_mj_action_breadcrumb_CategorySelect_42_listener($event) { return ctx.onCategorySelect($event); });
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(43, "div", 24);
            i0.ɵɵconditionalCreate(44, ActionExplorerComponent_Conditional_44_Template, 1, 6, "mj-empty-state", 25)(45, ActionExplorerComponent_Conditional_45_Template, 3, 3);
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(46, "mj-new-category-panel", 26);
            i0.ɵɵlistener("CategoryCreated", function ActionExplorerComponent_Template_mj_new_category_panel_CategoryCreated_46_listener($event) { return ctx.onCategoryCreated($event); })("Close", function ActionExplorerComponent_Template_mj_new_category_panel_Close_46_listener() { return ctx.NewCategoryParentId = null; });
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(47, "mj-new-action-panel", 27);
            i0.ɵɵlistener("ActionCreated", function ActionExplorerComponent_Template_mj_new_action_panel_ActionCreated_47_listener() { return ctx.onActionCreated(); });
            i0.ɵɵelementEnd();
            i0.ɵɵconditionalCreate(48, ActionExplorerComponent_Conditional_48_Template, 1, 3, "mj-action-test-harness-dialog", 28);
            i0.ɵɵelementEnd()()();
        } if (rf & 2) {
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("Count", ctx.FilteredActions.length)("Total", ctx.Actions.length);
            i0.ɵɵadvance(8);
            i0.ɵɵproperty("Value", ctx.Filters.searchTerm);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ActiveCount", ctx.StatusTypeFilterCount)("ShowClearAll", ctx.StatusTypeFilterCount > 0);
            i0.ɵɵadvance(5);
            i0.ɵɵconditional(ctx.Filters.statuses.length > 0 ? 17 : -1);
            i0.ɵɵadvance(2);
            i0.ɵɵrepeater(ctx.StatusOptions);
            i0.ɵɵadvance(6);
            i0.ɵɵconditional(ctx.Filters.types.length > 0 ? 25 : -1);
            i0.ɵɵadvance(2);
            i0.ɵɵrepeater(ctx.TypeOptions);
            i0.ɵɵadvance(7);
            i0.ɵɵrepeater(ctx.SortOptions);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("Options", ctx.ViewToggleOptions)("ActiveKey", ctx.ViewMode);
            i0.ɵɵadvance();
            i0.ɵɵproperty("Flex", true)("Padding", false);
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.IsLoading ? 39 : -1);
            i0.ɵɵadvance();
            i0.ɵɵproperty("Categories", ctx.Categories)("Actions", ctx.Actions);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("SelectedCategoryId", ctx.SelectedCategoryId)("Categories", ctx.Categories);
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(ctx.FilteredActions.length === 0 && !ctx.IsLoading ? 44 : 45);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("Categories", ctx.Categories)("PreselectedParentId", ctx.NewCategoryParentId);
            i0.ɵɵadvance();
            i0.ɵɵproperty("Categories", ctx.Categories);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.SelectedActionForRun ? 48 : -1);
        } }, dependencies: [i2.MJButtonDirective, i2.MJPageBodyComponent, i2.MJPageHeaderComponent, i2.MJPageLayoutComponent, i2.MJPageSearchComponent, i2.MJFilterPopoverComponent, i2.MJViewToggleComponent, i2.MJStatBadgeComponent, i2.MJRefreshButtonComponent, i2.MJEmptyStateComponent, i3.ActionTestHarnessDialogComponent, i4.LoadingComponent, i5.ActionTreePanelComponent, i6.ActionBreadcrumbComponent, i7.ActionCardComponent, i8.ActionListItemComponent, i9.NewCategoryPanelComponent, i10.NewActionPanelComponent], styles: ["\n\n.dropdown-section[_ngcontent-%COMP%] {\n  padding: 8px 12px;\n}\n.dropdown-section[_ngcontent-%COMP%]:not(:last-child) {\n  border-bottom: 1px solid var(--mj-border-default);\n}\n.section-header[_ngcontent-%COMP%] {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin-bottom: 8px;\n  font-size: 11px;\n  font-weight: 600;\n  text-transform: uppercase;\n  color: var(--mj-text-muted);\n  letter-spacing: 0.5px;\n}\n.section-header[_ngcontent-%COMP%]   button[_ngcontent-%COMP%] {\n  font-size: 11px;\n  padding: 2px 6px;\n}\n.filter-options[_ngcontent-%COMP%] {\n  display: flex;\n  flex-direction: column;\n  gap: 4px;\n}\n.filter-option[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  padding: 6px 8px;\n  border-radius: 4px;\n  cursor: pointer;\n  transition: background 0.15s ease;\n  font-size: 13px;\n}\n.filter-option[_ngcontent-%COMP%]:hover {\n  background: var(--mj-bg-surface-hover);\n}\n.filter-option.selected[_ngcontent-%COMP%] {\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n}\n.filter-option[_ngcontent-%COMP%]   input[type=\"checkbox\"][_ngcontent-%COMP%] {\n  display: none;\n}\n.filter-option[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  font-size: 13px;\n  width: 18px;\n  color: var(--mj-text-muted);\n}\n.filter-option.selected[_ngcontent-%COMP%]   i[_ngcontent-%COMP%] {\n  color: var(--mj-brand-primary);\n}\n.status-dot[_ngcontent-%COMP%] {\n  width: 8px;\n  height: 8px;\n  border-radius: 50%;\n}\n.status-dot[data-status=\"Active\"][_ngcontent-%COMP%]   { background: var(--mj-status-success); }\n.status-dot[data-status=\"Pending\"][_ngcontent-%COMP%]  { background: var(--mj-status-warning); }\n.status-dot[data-status=\"Disabled\"][_ngcontent-%COMP%] { background: var(--mj-status-error); }\n\n\n\n.sort-option[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  width: 100%;\n  padding: 8px 12px;\n  border: none;\n  background: transparent;\n  cursor: pointer;\n  font-size: 13px;\n  text-align: left;\n  transition: background 0.15s ease;\n}\n.sort-option[_ngcontent-%COMP%]:hover {\n  background: var(--mj-bg-surface-hover);\n}\n.sort-option.selected[_ngcontent-%COMP%] {\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n}\n.sort-option[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]:first-child {\n  width: 18px;\n  color: var(--mj-text-muted);\n}\n.sort-option.selected[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]:first-child {\n  color: var(--mj-brand-primary);\n}\n.sort-option[_ngcontent-%COMP%]   .direction-icon[_ngcontent-%COMP%] {\n  margin-left: auto;\n  font-size: 11px;\n}\n\n.action-explorer[_ngcontent-%COMP%] {\n  display: flex;\n  flex: 1;\n  min-height: 0;\n  background: var(--mj-bg-page);\n  overflow: hidden;\n  position: relative;\n}\n\n\n\n.explorer-main[_ngcontent-%COMP%] {\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n  min-width: 0;\n  overflow: hidden;\n}\n\n.explorer-content[_ngcontent-%COMP%] {\n  flex: 1;\n  overflow-y: auto;\n  padding: 20px;\n}\n\n\n\n.loading-overlay[_ngcontent-%COMP%] {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background: color-mix(in srgb, var(--mj-bg-surface) 85%, transparent);\n  z-index: 100;\n  backdrop-filter: blur(2px);\n}\n\n\n\n.loading-container[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 100%;\n  min-height: 300px;\n}\n\n\n\n\n.card-grid[_ngcontent-%COMP%] {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));\n  gap: 20px;\n}\n\n\n\n.list-view[_ngcontent-%COMP%] {\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 8px;\n  overflow: hidden;\n}\n\n.list-header[_ngcontent-%COMP%] {\n  display: grid;\n  grid-template-columns: 40px 1fr 140px 90px 70px 50px 90px 70px;\n  gap: 12px;\n  padding: 12px 16px;\n  background: var(--mj-bg-page);\n  border-bottom: 1px solid var(--mj-border-default);\n  font-size: 11px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  color: var(--mj-text-muted);\n}\n\n.header-icon[_ngcontent-%COMP%] {\n  \n\n}\n\n\n\n.compact-view[_ngcontent-%COMP%] {\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 8px;\n  overflow: hidden;\n}\n\n\n\n@media (max-width: 1200px) {\n  .card-grid[_ngcontent-%COMP%] {\n    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n  }\n}\n\n@media (max-width: 1024px) {\n  .list-header[_ngcontent-%COMP%] {\n    grid-template-columns: 36px 1fr 90px 50px 80px 60px;\n  }\n\n  .list-header[_ngcontent-%COMP%]   .header-category[_ngcontent-%COMP%], \n   .list-header[_ngcontent-%COMP%]   .header-params[_ngcontent-%COMP%] {\n    display: none;\n  }\n}\n\n@media (max-width: 768px) {\n  \n\n\n  .explorer-content[_ngcontent-%COMP%] {\n    padding: 12px;\n  }\n\n  .card-grid[_ngcontent-%COMP%] {\n    grid-template-columns: 1fr;\n    gap: 12px;\n  }\n\n  .list-header[_ngcontent-%COMP%] {\n    display: none;\n  }\n}\n\n\n\n.explorer-content[_ngcontent-%COMP%]::-webkit-scrollbar {\n  width: 8px;\n}\n\n.explorer-content[_ngcontent-%COMP%]::-webkit-scrollbar-track {\n  background: transparent;\n}\n\n.explorer-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb {\n  background: var(--mj-border-default);\n  border-radius: 4px;\n}\n\n.explorer-content[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover {\n  background: var(--mj-text-muted);\n}"], changeDetection: 0 });
};
ActionExplorerComponent = __decorate([
    RegisterClass(BaseResourceComponent, 'ActionExplorerResource')
], ActionExplorerComponent);
export { ActionExplorerComponent };
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActionExplorerComponent, [{
        type: Component,
        args: [{ standalone: false, selector: 'mj-action-explorer', changeDetection: ChangeDetectionStrategy.OnPush, providers: [ActionExplorerStateService], template: "<mj-page-layout>\n  <mj-page-header\n    Title=\"Action Explorer\"\n    Icon=\"fa-solid fa-folder-tree\"\n    Subtitle=\"Browse, organize, and run all configured actions\">\n    <div meta>\n      <mj-stat-badge\n        [Count]=\"FilteredActions.length\"\n        [Total]=\"Actions.length\"\n        Label=\"actions\">\n      </mj-stat-badge>\n    </div>\n    <div actions>\n      <!-- Verbs only per \u00A73: secondary Refresh + the one primary CTA (rightmost). -->\n      <mj-refresh-button (Clicked)=\"onRefresh()\"></mj-refresh-button>\n\n      <button mjButton variant=\"primary\" size=\"sm\" (click)=\"onNewAction()\" title=\"New Action\">\n        <i class=\"fa-solid fa-plus\"></i> <span class=\"action-btn-label\">New Action</span>\n      </button>\n    </div>\n    <div toolbar>\n      <!-- Control bar per \u00A73: search \u00B7 Filter (Status/Type/Sort) \u00B7 view. -->\n      <mj-page-search\n        Placeholder=\"Search actions...\"\n        [Value]=\"Filters.searchTerm\"\n        (ValueChange)=\"onSearchInput($event)\">\n      </mj-page-search>\n\n      <!-- Filters popover (shared trigger + popover chrome; multi-select checkbox content stays bespoke) -->\n      <mj-filter-popover\n        [ActiveCount]=\"StatusTypeFilterCount\"\n        [ShowClearAll]=\"StatusTypeFilterCount > 0\"\n        (ClearAllRequested)=\"clearFilters()\">\n        <div class=\"dropdown-section\">\n          <div class=\"section-header\">\n            <span>Status</span>\n            @if (Filters.statuses.length > 0) {\n              <button mjButton variant=\"flat\" size=\"sm\" (click)=\"StateService.setStatusFilter([])\">Clear</button>\n            }\n          </div>\n          <div class=\"filter-options\">\n            @for (status of StatusOptions; track status.value) {\n              <label class=\"filter-option\" [class.selected]=\"isStatusSelected(status.value)\">\n                <input type=\"checkbox\"\n                  [checked]=\"isStatusSelected(status.value)\"\n                  (change)=\"toggleStatus(status.value)\">\n                <span class=\"status-dot\" [attr.data-status]=\"status.value\"></span>\n                {{ status.label }}\n              </label>\n            }\n          </div>\n        </div>\n        <div class=\"dropdown-section\">\n          <div class=\"section-header\">\n            <span>Type</span>\n            @if (Filters.types.length > 0) {\n              <button mjButton variant=\"flat\" size=\"sm\" (click)=\"StateService.setTypeFilter([])\">Clear</button>\n            }\n          </div>\n          <div class=\"filter-options\">\n            @for (type of TypeOptions; track type.value) {\n              <label class=\"filter-option\" [class.selected]=\"isTypeSelected(type.value)\">\n                <input type=\"checkbox\"\n                  [checked]=\"isTypeSelected(type.value)\"\n                  (change)=\"toggleType(type.value)\">\n                <i [class]=\"type.icon\"></i>\n                {{ type.label }}\n              </label>\n            }\n          </div>\n        </div>\n        <!-- Sort lives inside the Filters popover (was a standalone dropdown). -->\n        <div class=\"dropdown-section\">\n          <div class=\"section-header\"><span>Sort</span></div>\n          <div class=\"filter-options\">\n            @for (option of SortOptions; track option.field) {\n              <button class=\"sort-option\"\n                [class.selected]=\"SortField === option.field\"\n                (click)=\"setSortField(option.field)\">\n                <i [class]=\"option.icon\"></i>\n                {{ option.label }}\n                @if (SortField === option.field) {\n                  <i [class]=\"SortDirection === 'asc' ? 'fa-solid fa-arrow-up' : 'fa-solid fa-arrow-down'\" class=\"direction-icon\"></i>\n                }\n              </button>\n            }\n          </div>\n        </div>\n      </mj-filter-popover>\n\n      <mj-view-toggle\n        [Options]=\"ViewToggleOptions\"\n        [ActiveKey]=\"ViewMode\"\n        (KeyChange)=\"setViewMode($any($event))\">\n      </mj-view-toggle>\n    </div>\n  </mj-page-header>\n\n  <mj-page-body [Flex]=\"true\" [Padding]=\"false\">\n<div class=\"action-explorer\">\n  <!-- Full-page Loading Overlay -->\n  @if (IsLoading) {\n    <div class=\"loading-overlay\">\n      <mj-loading text=\"Loading actions...\" size=\"medium\"></mj-loading>\n    </div>\n  }\n\n  <!-- Tree Panel (Left Sidebar) -->\n  <mj-action-tree-panel\n    [Categories]=\"Categories\"\n    [Actions]=\"Actions\"\n    (CategorySelected)=\"onCategorySelect($event)\"\n    (NewCategoryClick)=\"onNewCategory($event)\"\n    (EditCategoryClick)=\"onEditCategory($event)\">\n  </mj-action-tree-panel>\n\n  <!-- Main Content Area -->\n  <div class=\"explorer-main\">\n    <!-- Breadcrumb -->\n    <mj-action-breadcrumb\n      [SelectedCategoryId]=\"SelectedCategoryId\"\n      [Categories]=\"Categories\"\n      (CategorySelect)=\"onCategorySelect($event)\">\n    </mj-action-breadcrumb>\n\n    <!-- Content Area -->\n    <div class=\"explorer-content\">\n      @if (FilteredActions.length === 0 && !IsLoading) {\n        <mj-empty-state\n          [Variant]=\"IsListNarrowed ? 'no-results' : 'empty'\"\n          [Icon]=\"IsListNarrowed ? 'fa-solid fa-filter-circle-xmark' : 'fa-solid fa-bolt'\"\n          [Title]=\"IsListNarrowed ? 'No actions match your filters' : 'No actions yet'\"\n          [Message]=\"IsListNarrowed ? 'Try adjusting your search or filter criteria' : 'Create your first action to get started'\"\n          [ActionText]=\"IsListNarrowed ? 'Reset filters' : 'Create Action'\"\n          [ActionIcon]=\"IsListNarrowed ? 'fa-solid fa-rotate-left' : 'fa-solid fa-plus'\"\n          (Action)=\"onEmptyStateAction()\" />\n      } @else {\n        <!-- Card View -->\n        @if (ViewMode === 'card') {\n          <div class=\"card-grid\">\n            @for (action of FilteredActions; track action.ID) {\n              <mj-action-card\n                [Action]=\"action\"\n                [Categories]=\"CategoriesMap\"\n                (ActionClick)=\"onActionClick($event)\"\n                (EditClick)=\"onActionEdit($event)\"\n                (RunClick)=\"onActionRun($event)\"\n                (CategoryClick)=\"onCategoryClick($event)\">\n              </mj-action-card>\n            }\n          </div>\n        }\n\n        <!-- List View -->\n        @if (ViewMode === 'list') {\n          <div class=\"list-view\">\n            <div class=\"list-header\">\n              <div class=\"header-icon\"></div>\n              <div class=\"header-name\">Name</div>\n              <div class=\"header-category\">Category</div>\n              <div class=\"header-status\">Status</div>\n              <div class=\"header-type\">Type</div>\n              <div class=\"header-params\">Params</div>\n              <div class=\"header-updated\">Updated</div>\n              <div class=\"header-actions\"></div>\n            </div>\n            @for (action of FilteredActions; track action.ID) {\n              <mj-action-list-item\n                [Action]=\"action\"\n                [Categories]=\"CategoriesMap\"\n                [IsCompact]=\"false\"\n                (ActionClick)=\"onActionClick($event)\"\n                (EditClick)=\"onActionEdit($event)\"\n                (RunClick)=\"onActionRun($event)\"\n                (CategoryClick)=\"onCategoryClick($event)\">\n              </mj-action-list-item>\n            }\n          </div>\n        }\n\n        <!-- Compact View -->\n        @if (ViewMode === 'compact') {\n          <div class=\"compact-view\">\n            @for (action of FilteredActions; track action.ID) {\n              <mj-action-list-item\n                [Action]=\"action\"\n                [Categories]=\"CategoriesMap\"\n                [IsCompact]=\"true\"\n                (ActionClick)=\"onActionClick($event)\"\n                (EditClick)=\"onActionEdit($event)\"\n                (RunClick)=\"onActionRun($event)\"\n                (CategoryClick)=\"onCategoryClick($event)\">\n              </mj-action-list-item>\n            }\n          </div>\n        }\n      }\n    </div>\n  </div>\n\n  <!-- Slide-in Panels -->\n  <mj-new-category-panel\n    [Categories]=\"Categories\"\n    [PreselectedParentId]=\"NewCategoryParentId\"\n    (CategoryCreated)=\"onCategoryCreated($event)\"\n    (Close)=\"NewCategoryParentId = null\">\n  </mj-new-category-panel>\n\n  <mj-new-action-panel\n    [Categories]=\"Categories\"\n    (ActionCreated)=\"onActionCreated()\">\n  </mj-new-action-panel>\n\n  <!-- Action Run Dialog -->\n  @if (SelectedActionForRun) {\n    <mj-action-test-harness-dialog\n      [Action]=\"SelectedActionForRun\"\n      [ActionParams]=\"SelectedActionParams\"\n      [IsOpen]=\"IsRunDialogOpen\"\n      (Close)=\"OnRunDialogClose()\">\n    </mj-action-test-harness-dialog>\n  }\n</div>\n  </mj-page-body>\n</mj-page-layout>\n", styles: ["/* \u2500\u2500\u2500\u2500 Filter popover internals (multi-select Status/Type) \u2500\u2500\u2500\u2500 */\n.dropdown-section {\n  padding: 8px 12px;\n}\n.dropdown-section:not(:last-child) {\n  border-bottom: 1px solid var(--mj-border-default);\n}\n.section-header {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  margin-bottom: 8px;\n  font-size: 11px;\n  font-weight: 600;\n  text-transform: uppercase;\n  color: var(--mj-text-muted);\n  letter-spacing: 0.5px;\n}\n.section-header button {\n  font-size: 11px;\n  padding: 2px 6px;\n}\n.filter-options {\n  display: flex;\n  flex-direction: column;\n  gap: 4px;\n}\n.filter-option {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  padding: 6px 8px;\n  border-radius: 4px;\n  cursor: pointer;\n  transition: background 0.15s ease;\n  font-size: 13px;\n}\n.filter-option:hover {\n  background: var(--mj-bg-surface-hover);\n}\n.filter-option.selected {\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n}\n.filter-option input[type=\"checkbox\"] {\n  display: none;\n}\n.filter-option i {\n  font-size: 13px;\n  width: 18px;\n  color: var(--mj-text-muted);\n}\n.filter-option.selected i {\n  color: var(--mj-brand-primary);\n}\n.status-dot {\n  width: 8px;\n  height: 8px;\n  border-radius: 50%;\n}\n.status-dot[data-status=\"Active\"]   { background: var(--mj-status-success); }\n.status-dot[data-status=\"Pending\"]  { background: var(--mj-status-warning); }\n.status-dot[data-status=\"Disabled\"] { background: var(--mj-status-error); }\n\n/* \u2500\u2500\u2500\u2500 Sort options (inside the Filters popover) \u2500\u2500\u2500\u2500 */\n.sort-option {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  width: 100%;\n  padding: 8px 12px;\n  border: none;\n  background: transparent;\n  cursor: pointer;\n  font-size: 13px;\n  text-align: left;\n  transition: background 0.15s ease;\n}\n.sort-option:hover {\n  background: var(--mj-bg-surface-hover);\n}\n.sort-option.selected {\n  background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n  color: var(--mj-brand-primary);\n}\n.sort-option i:first-child {\n  width: 18px;\n  color: var(--mj-text-muted);\n}\n.sort-option.selected i:first-child {\n  color: var(--mj-brand-primary);\n}\n.sort-option .direction-icon {\n  margin-left: auto;\n  font-size: 11px;\n}\n\n.action-explorer {\n  display: flex;\n  flex: 1;\n  min-height: 0;\n  background: var(--mj-bg-page);\n  overflow: hidden;\n  position: relative;\n}\n\n/* Main Content Area */\n.explorer-main {\n  flex: 1;\n  display: flex;\n  flex-direction: column;\n  min-width: 0;\n  overflow: hidden;\n}\n\n.explorer-content {\n  flex: 1;\n  overflow-y: auto;\n  padding: 20px;\n}\n\n/* Full-page Loading Overlay */\n.loading-overlay {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background: color-mix(in srgb, var(--mj-bg-surface) 85%, transparent);\n  z-index: 100;\n  backdrop-filter: blur(2px);\n}\n\n/* Legacy loading container (kept for backwards compatibility) */\n.loading-container {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  height: 100%;\n  min-height: 300px;\n}\n\n\n/* Card Grid */\n.card-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));\n  gap: 20px;\n}\n\n/* List View */\n.list-view {\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 8px;\n  overflow: hidden;\n}\n\n.list-header {\n  display: grid;\n  grid-template-columns: 40px 1fr 140px 90px 70px 50px 90px 70px;\n  gap: 12px;\n  padding: 12px 16px;\n  background: var(--mj-bg-page);\n  border-bottom: 1px solid var(--mj-border-default);\n  font-size: 11px;\n  font-weight: 600;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  color: var(--mj-text-muted);\n}\n\n.header-icon {\n  /* Empty column for icon */\n}\n\n/* Compact View */\n.compact-view {\n  background: var(--mj-bg-surface-card);\n  border: 1px solid var(--mj-border-default);\n  border-radius: 8px;\n  overflow: hidden;\n}\n\n/* Responsive */\n@media (max-width: 1200px) {\n  .card-grid {\n    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n  }\n}\n\n@media (max-width: 1024px) {\n  .list-header {\n    grid-template-columns: 36px 1fr 90px 50px 80px 60px;\n  }\n\n  .list-header .header-category,\n  .list-header .header-params {\n    display: none;\n  }\n}\n\n@media (max-width: 768px) {\n  /* Search-grow + .action-btn-label collapse are owned by the shared chrome\n     (page-header.scss) since search lives in the [toolbar] slot. None here. */\n  .explorer-content {\n    padding: 12px;\n  }\n\n  .card-grid {\n    grid-template-columns: 1fr;\n    gap: 12px;\n  }\n\n  .list-header {\n    display: none;\n  }\n}\n\n/* Scrollbar Styling */\n.explorer-content::-webkit-scrollbar {\n  width: 8px;\n}\n\n.explorer-content::-webkit-scrollbar-track {\n  background: transparent;\n}\n\n.explorer-content::-webkit-scrollbar-thumb {\n  background: var(--mj-border-default);\n  border-radius: 4px;\n}\n\n.explorer-content::-webkit-scrollbar-thumb:hover {\n  background: var(--mj-text-muted);\n}\n"] }]
    }], () => [{ type: i1.ActionExplorerStateService }, { type: i0.ChangeDetectorRef }], { TreePanel: [{
            type: ViewChild,
            args: [ActionTreePanelComponent]
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ActionExplorerComponent, { className: "ActionExplorerComponent", filePath: "src/Actions/components/explorer/action-explorer.component.ts", lineNumber: 43 }); })();
//# sourceMappingURL=action-explorer.component.js.map