import { AvatarNetwork } from '@agorapulse/ui-components/avatar';
import { agorapulseSymbol } from '@agorapulse/ui-symbol';
import * as _angular_core from '@angular/core';
import { Signal, OnInit, TemplateRef } from '@angular/core';
import * as i1 from '@agorapulse/ui-components/directives';
import { BaseButtonDirective } from '@agorapulse/ui-components/directives';

declare const NavSelectorStyle: {
    readonly DEFAULT: "default";
    readonly MENU: "menu";
};
type NavSelectorStyle = (typeof NavSelectorStyle)[keyof typeof NavSelectorStyle];
type NavSelectorLeafActionClickedEvent = {
    /** Name of the action that has been clicked */
    actionName: string;
    /** Leaf on which the action has been clicked */
    leafUid: string;
};
type NavSelectorCategoryEmptyStateActionEvent = {
    /** Name of the action that has been clicked */
    actionName: string;
};
/**
 * As translation is not available in the DS, this all translations needed
 */
interface NavSelectorTranslatedTexts {
    /** Title of the nav selector */
    title: string;
    /** Only text in multi select mode */
    only: string;
    /** Tooltip displayed on folded group when one of its children have token is invalid */
    groupTokenInvalid: string;
    /** Toolip displaying that token is invalid */
    tokenInvalid: string;
    /** Toolip displaying that feature is locked */
    featureLocked: string;
    /** placeholder for the search input */
    searchPlaceholder: string;
    /** Text displayed when the search return no results */
    noResults: string;
    /** Text of the button to show more details, it’s used when we limit the number of details displayed  */
    viewMore: string;
    /** Text of the button to show less details, it’s used when we limit the number of details displayed  */
    viewLess: string;
}
/**
 * Common interface for the NavSelector
 */
type NavSelectorBaseNode = {
    /** Unique identifier of the node */
    uid: string;
    /** Displayed name of the node */
    alias: string;
};
/**
 * Represent an action that can be performed on a leaf
 */
type NavSelectorLeafAction = {
    /** Unique identifier of the action, used for click tracking */
    id: string | null;
    /** Action label to display */
    label: string;
    /** Technical name of the action, used to identify the action */
    name: string;
    /** Optional icon to display on the action */
    icon: string | null;
    /** Optional Status */
    status: 'disabled' | 'locked' | null;
    /** Whether to add a divider before this item */
    dividerEnabled?: boolean;
};
/**
 * Represent final entry of the nav selector
 */
type NavSelectorLeaf = {
    /** Picture url to display on the avatar, optional */
    pictureUrl: string | null;
    /** When true we do not display the avatar */
    avatarHidden?: boolean | null;
    /** Counter to display on the entry, to ignore if the leaf has details */
    counter: number | null;
    /** When true, the leaf will be hidden */
    missingPermission: boolean;
    /** For social profiles or ad accounts the corresponding network */
    network: AvatarNetwork | null;
    /** Translated text when the entry is disabled */
    disableReason: string | null;
    /** Indicates if entry has its token invalid */
    tokenInvalid: boolean;
    /** Indicates if entry is locked */
    featureLocked: boolean;
    /** Indicates if and which icon should be displayed before the label */
    startSymbolId: agorapulseSymbol | null;
    /** Indicates if and what dot color should be displayed before the label */
    startDotColor: string | null;
    /** Sub elements of the leaf, they are optional */
    details: NavSelectorLeafDetails[];
    /** Optional actions that can be performed on the leaf */
    actions: NavSelectorLeafAction[];
    type: 'LEAF';
} & NavSelectorBaseNode;
/**
 * Represent a group of entries which has been created by the user (ex: menuGroup)
 */
type NavSelectorGroup = {
    /** A group can only have leaves as children */
    children: NavSelectorLeaf[];
    /** Indicates if the group should be folded or expanded when generating the nav selector */
    folded: boolean;
    type: 'GROUP';
} & NavSelectorBaseNode;
/**
 * Represent a category of entries which has been created by the product to separate different kind of entries (ex: social profiles, reports, ad accounts…)
 */
type NavSelectorCategory = {
    /** A Category can have leaves or groups as children, you can have leaves alongside with groups */
    children: (NavSelectorLeaf | NavSelectorGroup)[];
    /** Indicates if the group should be folded or expanded when generating the nav selector */
    folded: boolean;
    /** Title of the empty state */
    emptyStateTitle?: string;
    /** Action of the empty state */
    emptyStateAction?: NavSelectorEmptyStateAction;
    avatar?: NavSelectorCategoryAvatar;
    type: 'CATEGORY';
} & NavSelectorBaseNode;
type NavSelectorCategoryAvatar = {
    pictureUrl: string | null;
    rounded: boolean;
} | {
    symbolId: agorapulseSymbol;
};
/**
 * Represent the action available in the empty state
 */
type NavSelectorEmptyStateAction = {
    name: string;
    title: string;
    id?: string;
    symbolId?: agorapulseSymbol;
    featureLocked?: boolean;
};
type NavSelectorEntry = NavSelectorLeaf | NavSelectorGroup | NavSelectorCategory;
/**
 * Represent details of a leaf, they are used to allow to display more specific information about the leaf
 */
interface NavSelectorLeafDetails {
    /** Unique identifier of the node */
    uid: string;
    /** Counter to display on the entry */
    counter: number | null;
    /** If true, excludes this from the counter sum */
    excludedCounterSum: boolean;
    /** Displayed name of the node */
    name: string;
    /** Translation of the error on the leaf */
    errorReason: string | null;
}
/**
 * Represent the accessibility on a node
 */
type NodeAccessibility = {
    /** Number of sibling elements, itself included. Ex: there are 7 social profiles display in the group */
    ariaSetsize: number;
    /** Index starting from 1 of the element alongside its sibling */
    ariaPosinset: number;
    /** 0 to be focusable by Tab key and -1 to be focusable by keyboard with JS */
    tabIndex: number;
    /** In a tree, the deep level, starting from 1 */
    ariaLevel: number;
};
type InternalNavSelectorLeafAction = {
    /** Unique identifier of the action, used for click tracking */
    id: string | null;
    /** Action label to display */
    label: string;
    /** Technical name of the action, used to identify the action */
    name: string;
    /** Optional icon to display on the action */
    icon: string | null;
    /** Optional Status */
    status: 'disabled' | 'locked' | null;
    /** Whether to add a divider before this item */
    dividerEnabled?: boolean;
};
/**
 * Represent a node
 */
type InternalNavSelectorBaseNode = {
    /** Unique identifier of the entry */
    uid: string;
    /** Displayed name of the entry */
    alias: string;
    accessibility: NodeAccessibility;
    /** When hidden, the entry is not displayed, used when searching an element */
    hidden: boolean;
    /** When true, you can navigate with arrow keys on this entry */
    focusable: boolean;
};
/**
 * Represent a group of entries which has been created by the user (ex: menuGroup)
 */
type InternalNavSelectorGroup = {
    /** A group can only have leaves as children */
    children: InternalNavSelectorLeaf[];
    /** Picture url of the group, used when the nav selector is minified */
    childrenPictureUrlSample: {
        url: string | null;
        initial: string;
    }[];
    /** Indicates whenever the group is folded or not */
    folded: boolean;
    /** Indicates the counter value to display when the group is folded */
    counter: number;
    /** Indicates if the counter should be display when the group is folded */
    displayCounter: boolean;
    /** Indicates if the token invalid icon should be display when the group is folded */
    displayTokenInvalid: boolean;
    /** Indicates in multi select mode if the group has some children selected */
    undeterminedSelection: boolean;
    /** Indicates if the group is selected */
    selected: boolean;
    /** Indicates if the group is selectable */
    selectable: boolean;
    type: 'GROUP';
} & InternalNavSelectorBaseNode;
/**
 * Represent a category of entries which has been created by the product to separate different kind of entries (ex: social profiles, reports, ad accounts…)
 */
type InternalNavSelectorCategory = {
    /** A Category can have leaves or groups as children, you can have leaves alongside with groups */
    children: (InternalNavSelectorGroup | InternalNavSelectorLeaf)[];
    /** Indicates whenever the category is folded or not */
    folded: boolean;
    /** Title of the empty state */
    emptyStateTitle?: string;
    /** Action of the empty state */
    emptyStateAction?: NavSelectorEmptyStateAction;
    /** Avatar configuration of the category */
    avatarDisplayed: boolean;
    avatarRounded: boolean;
    avatarSymbolId: agorapulseSymbol | null;
    avatarPictureUrl: string | undefined;
    avatarPictureUrlDisplayed: boolean;
    type: 'CATEGORY';
} & InternalNavSelectorBaseNode;
/**
 * Represent final entry of the nav selector
 */
type InternalNavSelectorLeaf = {
    /** Indicates if the actions dropdown could be display. Should not be display if the leaf has an error status. */
    actionsDisplayable: boolean;
    /** Actions that can be performed on the leaf */
    actions: InternalNavSelectorLeafAction[];
    /** When true we do not display the avatar */
    avatarHidden?: boolean | null;
    /** Picture url to display on the avatar, optional */
    pictureUrl: string | null;
    /** Indicates if the counter could be display. The leaf should not be disabled, feature locked or has token invalid */
    counterDisplayable: boolean;
    /** Indicates if the token invalid icon should be display. So when displayable when no details or folded */
    displayCounter: boolean;
    /** Counter value to display */
    counter: number;
    /** Indicates if the token invalid icon should be display */
    displayTokenInvalid: boolean;
    /** Indicates if the feature is locked */
    displayFeatureLocked: boolean;
    /** Indicates if and which icon should be displayed before the label */
    startSymbolId: agorapulseSymbol | null;
    /** Indicates if and what dot color should be displayed before the label */
    startDotColor: string | null;
    /** Indicates if the leaf is disabled */
    disabled: boolean;
    /** The disabled reason to display in tooltip */
    disableReason: string | null;
    /** Indicates if the leaf is selected */
    selected: boolean;
    /** Indicates if the leaf is selectable */
    selectable: boolean;
    /** For social profiles or ad accounts, the corresponding network */
    network: AvatarNetwork | null;
    /** Indicates if the leaf foldable. So when it has details and no error status */
    foldable: boolean;
    /** Indicates if the leaf is folded */
    folded: boolean;
    /** Indicates if the leaf has one of its details selected */
    detailSelected: boolean;
    /** Indicates if the leaf has details and they are displayable. So no error status */
    detailsDisplayable: boolean;
    /** Details of the leaf */
    details: InternalNavSelectorLeafDetails[];
    type: 'LEAF';
    /** Indicates if the view more section should be display for details */
    viewMoreDisplayable: boolean;
    /** Indicates if the view more or view less button is displayed */
    viewMoreDisplayed: boolean;
    /** Number of details to display when the view more is not clicked */
    viewMoreDetailsDisplayedLimit: number;
} & InternalNavSelectorBaseNode;
/**
 * Represent details of a leaf, they are used to allow to display more specific information about the leaf
 */
type InternalNavSelectorLeafDetails = {
    /** Unique identifier of the node */
    uid: string;
    /** Counter to display on the detail */
    counter: number;
    /** Indicates if the counter should be display. So no error on the detail */
    displayCounter: boolean;
    /** Displayed name of the node */
    alias: string;
    /** Indicates if the detail is selected */
    selected: boolean;
    /** Indicates if we should display an error icon */
    displayError: boolean;
    /** Translated text to display in the tooltip */
    errorReason: string | null;
    type: 'LEAF_DETAILS';
} & InternalNavSelectorBaseNode;
type InternalNavSelectorEntry = InternalNavSelectorLeaf | InternalNavSelectorGroup | InternalNavSelectorCategory | InternalNavSelectorLeafDetails;

declare class NavSelectorPopoverItemComponent {
    selected: _angular_core.InputSignal<boolean>;
    disabled: _angular_core.InputSignal<boolean>;
    locked: _angular_core.InputSignal<boolean>;
    id: _angular_core.InputSignal<string | null>;
    name: _angular_core.InputSignal<string>;
    ariaLabel: _angular_core.InputSignal<string | undefined>;
    readonly baseButtonDirective: BaseButtonDirective;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<NavSelectorPopoverItemComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<NavSelectorPopoverItemComponent, "ap-nav-selector-popover-item", never, { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "locked": { "alias": "locked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": true; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BaseButtonDirective; inputs: {}; outputs: {}; }]>;
}

/**
 * NavSelectorState is a service that manages the state of the nav selector.
 *
 * It should be provided by the component to ensure that if many nav selectors are used in the same page, they don't share the same state.
 */
declare class NavSelectorState {
    _entries: _angular_core.WritableSignal<InternalNavSelectorEntry[]>;
    entries: Signal<InternalNavSelectorEntry[]>;
    style: Signal<NavSelectorStyle>;
    private multipleModeEnabled;
    private _texts;
    isMultipleModeEnabled: _angular_core.WritableSignal<boolean>;
    search: _angular_core.WritableSignal<string>;
    noResults: Signal<boolean>;
    texts: Signal<NavSelectorTranslatedTexts>;
    isAllSelected: Signal<boolean>;
    isSelectAllIndeterminate: Signal<boolean>;
    expanded: _angular_core.WritableSignal<boolean>;
    previousSelectedUids: string[];
    private selectedUidsChangeCallback;
    private newSelectedUids;
    constructor();
    updateMultiModeEnabled(enabled: boolean): void;
    initEntries(entries: NavSelectorEntry[], initialSelectedEntryUids: string[], detailsDisplayedLimit: number): void;
    updateEntries(entries: NavSelectorEntry[], initialSelectedEntryUids: string[], detailsDisplayedLimit: number): void;
    onGroupToggleFolding(group: InternalNavSelectorEntry): void;
    onNodeSelect(node: InternalNavSelectorEntry): void;
    onLeafClicked(leaf: InternalNavSelectorLeaf): void;
    onLeafToggleFolding(leaf: InternalNavSelectorEntry): void;
    private findUnfoldedLeafUids;
    onLeafDetailClicked(leafDetail: InternalNavSelectorLeafDetails): void;
    updateTexts(texts: NavSelectorTranslatedTexts): void;
    selectOnlyLeaf(leaf: InternalNavSelectorLeaf): void;
    toggleExpanded(): void;
    minify(): void;
    forceMinify(): void;
    forceExpand(): void;
    onSelectionChange(uids: string[]): void;
    registerOnSelectedUidsChange(callback: (selectedUids: string[]) => void): void;
    onArrowDown(): void;
    onArrowUp(): void;
    private collectSelectedUids;
    private getFoldingOptions;
    fold(entry: InternalNavSelectorEntry): void;
    unfold(entry: InternalNavSelectorEntry): void;
    updateDetailsDisplayedLimit(detailsDisplayedLimit: number): void;
    viewMore(leaf: InternalNavSelectorLeaf): void;
    viewLess(leaf: InternalNavSelectorLeaf): void;
    resetFocus(): void;
    toggleSelectAll(): void;
    private areAllSelectableItemsSelected;
    private collectSelectableNonDisabledUids;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<NavSelectorState, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<NavSelectorState>;
}

declare class NavSelectorComponent implements OnInit {
    private readonly symbolRegistry;
    navSelectorEntries: _angular_core.InputSignal<NavSelectorEntry[]>;
    translatedTexts: _angular_core.InputSignal<NavSelectorTranslatedTexts>;
    multipleModeEnabled: _angular_core.InputSignal<boolean>;
    style: _angular_core.InputSignal<NavSelectorStyle>;
    detailsDisplayedLimit: _angular_core.InputSignal<number>;
    embedded: _angular_core.InputSignal<boolean>;
    /**
     * If true, the nav selector will be expanded by default. Even if the width of the screen is smaller than 1280px.
     */
    forceExpanded: _angular_core.InputSignal<boolean>;
    expandedStateLocalStorageKey: _angular_core.InputSignal<string | undefined>;
    selectedEntryUids: _angular_core.ModelSignal<string[]>;
    actionClicked: _angular_core.OutputEmitterRef<NavSelectorLeafActionClickedEvent>;
    emptyStateActionClicked: _angular_core.OutputEmitterRef<NavSelectorCategoryEmptyStateActionEvent>;
    headerProjection: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    contentHeaderProjection: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    footerProjection: _angular_core.Signal<TemplateRef<unknown> | undefined>;
    displayFooter: _angular_core.Signal<boolean>;
    expansionState: _angular_core.Signal<"expanded" | "minified">;
    onExpansionStateChange: _angular_core.OutputEmitterRef<{
        expanded: boolean;
    }>;
    navSelectorState: NavSelectorState;
    private el;
    componentUid: string;
    ready: _angular_core.WritableSignal<boolean>;
    private stableNavSelectorEntries;
    private expanded;
    private entries;
    private visibleEntryUids;
    visibleAccountsChange: _angular_core.OutputRef<{
        visibleAccountUids: string[];
    }>;
    constructor();
    ngOnInit(): void;
    onMinifiedSearchClicked(): void;
    onArrowDown(event: Event): void;
    onArrowUp(event: Event): void;
    onWindowResize(): void;
    private initializeExpandedState;
    clickExpandButton(): void;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<NavSelectorComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<NavSelectorComponent, "ap-nav-selector", never, { "navSelectorEntries": { "alias": "navSelectorEntries"; "required": true; "isSignal": true; }; "translatedTexts": { "alias": "translatedTexts"; "required": true; "isSignal": true; }; "multipleModeEnabled": { "alias": "multipleModeEnabled"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "detailsDisplayedLimit": { "alias": "detailsDisplayedLimit"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; "forceExpanded": { "alias": "forceExpanded"; "required": false; "isSignal": true; }; "expandedStateLocalStorageKey": { "alias": "expandedStateLocalStorageKey"; "required": false; "isSignal": true; }; "selectedEntryUids": { "alias": "selectedEntryUids"; "required": true; "isSignal": true; }; }, { "selectedEntryUids": "selectedEntryUidsChange"; "actionClicked": "actionClicked"; "emptyStateActionClicked": "emptyStateActionClicked"; "onExpansionStateChange": "onExpansionStateChange"; "visibleAccountsChange": "visibleAccountsChange"; }, ["headerProjection", "contentHeaderProjection", "footerProjection"], never, true, never>;
}

export { NavSelectorComponent, NavSelectorPopoverItemComponent };
export type { NavSelectorCategory, NavSelectorCategoryEmptyStateActionEvent, NavSelectorEntry, NavSelectorGroup, NavSelectorLeaf, NavSelectorLeafAction, NavSelectorLeafActionClickedEvent, NavSelectorLeafDetails, NavSelectorTranslatedTexts, NodeAccessibility };
