import * as i1 from '@angular/cdk/portal';
import { DomPortal, PortalModule } from '@angular/cdk/portal';
import * as i0 from '@angular/core';
import { InjectionToken, ContentChild, ChangeDetectionStrategy, ViewEncapsulation, Component, EventEmitter, input, signal, inject, ElementRef, computed, DestroyRef, effect, ViewChild, ContentChildren, Output, Input, NgModule } from '@angular/core';
import { FD_LINK_COMPONENT, LinkComponent } from '@fundamental-ngx/core/link';
import { LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';
import { RtlService, KeyUtil } from '@fundamental-ngx/cdk/utils';
import { IconComponent } from '@fundamental-ngx/core/icon';
import { MenuComponent, MenuItemComponent, MenuInteractiveComponent, MenuAddonDirective, MenuTitleDirective, MenuTriggerDirective, GlyphMenuAddonDirective } from '@fundamental-ngx/core/menu';
import { OverflowLayoutComponent, OverflowItemRefDirective, OverflowLayoutItemDirective, OverflowExpandDirective } from '@fundamental-ngx/core/overflow-layout';
import { FD_LANGUAGE_SIGNAL, TranslationResolver, FdTranslatePipe } from '@fundamental-ngx/i18n';
import { ContentDensityModule } from '@fundamental-ngx/core/content-density';

const FD_BREADCRUMB_ITEM_COMPONENT = new InjectionToken('FdBreadcrumbItemComponent');
const FD_BREADCRUMB_COMPONENT = new InjectionToken('FdBreadcrumbComponent');

/**
 * Breadcrumb item directive. Must have child breadcrumb link directives.
 *
 * ```html
 * <fd-breadcrumb-item>
 *     <a fd-link [routerLink]="'#'">Breadcrumb Link</a>
 * </fd-breadcrumb-item>
 * ```
 */
class BreadcrumbItemComponent {
    /** @hidden */
    constructor(elementRef) {
        this.elementRef = elementRef;
        /** @hidden */
        this._attached = false;
    }
    /** @hidden */
    ngAfterViewInit() {
        this._attach();
    }
    /**
     * Sets breadcrumb item dom portal.
     */
    setPortal() {
        if (!this.portal) {
            this.portal = new DomPortal(this.elementRef);
        }
    }
    /** @hidden */
    _detach() {
        if (!this._attached) {
            return;
        }
        if (this.linkContentPortal?.isAttached) {
            this.linkContentPortal?.detach();
        }
        if (this.breadcrumbItemPortal?.isAttached) {
            this.breadcrumbItemPortal?.detach();
        }
        this._attached = false;
    }
    /** @hidden */
    _attach() {
        if (this._attached) {
            return;
        }
        const contentSpan = this.breadcrumbLink?.contentSpan();
        if (this.breadcrumbLink && contentSpan) {
            this.linkContentPortal = new DomPortal(contentSpan.nativeElement);
        }
        this.breadcrumbItemPortal = new DomPortal(this.elementRef.nativeElement.firstElementChild);
        this._attached = true;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.0", type: BreadcrumbItemComponent, isStandalone: true, selector: "fd-breadcrumb-item", host: { classAttribute: "fd-breadcrumb__item" }, providers: [
            {
                provide: FD_BREADCRUMB_ITEM_COMPONENT,
                useExisting: BreadcrumbItemComponent
            }
        ], queries: [{ propertyName: "breadcrumbLink", first: true, predicate: FD_LINK_COMPONENT, descendants: true }], ngImport: i0, template: `<ng-content></ng-content> <span class="fd-breadcrumb__separator" aria-hidden="true"></span>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbItemComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'fd-breadcrumb-item',
                    template: `<ng-content></ng-content> <span class="fd-breadcrumb__separator" aria-hidden="true"></span>`,
                    host: {
                        class: 'fd-breadcrumb__item'
                    },
                    providers: [
                        {
                            provide: FD_BREADCRUMB_ITEM_COMPONENT,
                            useExisting: BreadcrumbItemComponent
                        }
                    ],
                    encapsulation: ViewEncapsulation.None,
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { breadcrumbLink: [{
                type: ContentChild,
                args: [FD_LINK_COMPONENT]
            }] } });

/**
 * Breadcrumb parent wrapper directive. Must have breadcrumb item child directives.
 *
 * ```html
 * <fd-breadcrumb>
 *     <fd-breadcrumb-item>
 *         <a fd-link [routerLink]="'#'">Breadcrumb Link</a>
 *     </fd-breadcrumb-item>
 * </fd-breadcrumb>
 * ```
 */
class BreadcrumbComponent {
    /** @hidden */
    constructor() {
        /** Whether to append items to the overflow dropdown in reverse order. Default is true. */
        this.reverse = false;
        /** Tabindex of the breadcrumb. */
        this.tabIndex = '0';
        /**
         * Event emitted when visible items count is changed.
         */
        this.visibleItemsCount = new EventEmitter();
        /**
         * Event emitted when hidden items count is changed.
         */
        this.hiddenItemsCount = new EventEmitter();
        /**
         * Separator style for the breadcrumb items.
         * Can be 'backslash' | 'double-slash' | 'double-backslash' | 'greater-than' | 'double-greater-than'
         * Omit for default (slash)
         */
        this.separatorStyle = input('', ...(ngDevMode ? [{ debugName: "separatorStyle" }] : []));
        /**
         * @hidden
         * Array of breadcrumb items.
         */
        this._items$ = signal([], ...(ngDevMode ? [{ debugName: "_items$" }] : []));
        /** @hidden */
        this.elementRef = inject(ElementRef);
        /** @hidden */
        this.placement = computed(() => (this._rtlService?.rtl() ? 'bottom-end' : 'bottom-start'), ...(ngDevMode ? [{ debugName: "placement" }] : []));
        /** @hidden */
        this._cssClass = computed(() => {
            const classes = ['fd-breadcrumb'];
            const style = this.separatorStyle();
            if (style) {
                classes.push(`fd-breadcrumb--${style}`);
            }
            return classes.join(' ');
        }, ...(ngDevMode ? [{ debugName: "_cssClass" }] : []));
        /** @hidden */
        this._rtlService = inject(RtlService, {
            optional: true
        });
        /** @hidden */
        this._langSignal = inject(FD_LANGUAGE_SIGNAL);
        /** @hidden */
        this._translationResolver = new TranslationResolver();
        /** @hidden */
        this._destroyRef = inject(DestroyRef);
        effect(() => {
            const lang = this._langSignal();
            this._ariaLabel = this._translationResolver.resolve(lang, 'coreBreadcrumb.breadcrumbTrailLabel');
        });
    }
    /** @hidden */
    onResize() {
        this._overflowLayout.triggerRecalculation();
    }
    /**
     * Function that handles click, touch, enter and space events.
     */
    itemClicked(breadcrumbItem, $event) {
        $event.preventDefault();
        breadcrumbItem.breadcrumbLink.elementRef.nativeElement.click();
    }
    /** @hidden */
    ngAfterViewInit() {
        this._setItems();
        this._contentItems.changes.subscribe(() => {
            this._setItems();
            this._updateAriaLabels();
        });
        // Set menu roles for breadcrumb context
        this._menuComponent._navContainerRole = 'dialog';
        this._menuComponent._menuListContainerRole = 'menu';
        /**
         * Set initial aria-labels
         * Roving tabindex is applied in _onVisibleItemsCountChange once overflow layout resolves
         */
        this._updateAriaLabels();
    }
    /** @hidden */
    _onHiddenChange(isHidden, breadcrumb) {
        if (!isHidden) {
            breadcrumb._detach();
        }
        else {
            breadcrumb._attach();
        }
    }
    /** @hidden */
    _onVisibleItemsCountChange(visibleItemsCount) {
        this.visibleItemsCount.emit(visibleItemsCount);
        /**
         * Defer tabindex update: the overflow layout emits this event before detectChanges(),
         * so soft-hidden CSS classes haven't been applied yet.
         * A microtask ensures the DOM is up to date.
         */
        Promise.resolve().then(() => this._updateTabIndexes());
    }
    /** @hidden */
    _onHiddenItemsCountChange(hiddenItemsCount) {
        this.hiddenItemsCount.emit(hiddenItemsCount);
    }
    /**
     * @hidden
     * Opens the overflow menu on keyboard activation.
     * Bound to keyup (not keydown) so that by the time the menu opens and captures focus,
     * the key has been fully released and no stale key events reach the first menu item.
     */
    openOverflowMenu(event) {
        event.preventDefault();
        if (!this._menuComponent.isOpen()) {
            this._menuComponent.open();
        }
    }
    /** @hidden */
    onKeydown(event) {
        if (!KeyUtil.isKeyCode(event, [LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW])) {
            return;
        }
        const links = this._getVisibleLinks();
        if (links.length === 0) {
            return;
        }
        const activeEl = document.activeElement;
        const currentIndex = links.indexOf(activeEl);
        if (currentIndex === -1) {
            return;
        }
        const isRtl = this._rtlService?.rtl();
        const isNext = KeyUtil.isKeyCode(event, DOWN_ARROW) || KeyUtil.isKeyCode(event, isRtl ? LEFT_ARROW : RIGHT_ARROW);
        const nextIndex = isNext ? Math.min(currentIndex + 1, links.length - 1) : Math.max(currentIndex - 1, 0);
        if (nextIndex !== currentIndex) {
            // Update roving tabindex: old item becomes unfocusable, new item becomes the tab stop
            links[currentIndex].setAttribute('tabindex', '-1');
            links[nextIndex].setAttribute('tabindex', '0');
            links[nextIndex].focus();
            event.preventDefault();
        }
    }
    /**
     * @hidden
     * Returns all focusable breadcrumb elements in DOM order: visible link items,
     * the overflow "..." collapse button, and the aria-current page span.
     * Excludes items hidden by the overflow layout (soft-hidden).
     *
     * Uses querySelectorAll rather than Angular queries because:
     * - The overflow "..." button is rendered in the component template, not projected
     *   as a content child, so it cannot be captured via @ContentChildren.
     * - The aria-current span is user-provided content inside fd-breadcrumb-item and
     *   is not an Angular component/directive — there's no token to query it.
     * - querySelectorAll naturally returns elements in DOM (visual) order, which is
     *   exactly what arrow key navigation needs, without manual sorting.
     */
    _getVisibleLinks() {
        const el = this.elementRef.nativeElement;
        return Array.from(el.querySelectorAll('.fd-overflow-layout__item:not(.fd-overflow-layout__item--soft-hidden) a.fd-link, .fd-overflow-layout__item:not(.fd-overflow-layout__item--soft-hidden) [aria-current], .fd-breadcrumb__collapsed'));
    }
    /**
     * @hidden
     * Applies roving tabindex: sets all focusable breadcrumb elements to tabindex="-1",
     * then promotes the first visible one to tabindex="0".
     * This ensures Tab enters/exits the breadcrumb as a single stop,
     * and non-href elements (click-only links, aria-current spans) are programmatically focusable.
     */
    _updateTabIndexes() {
        const el = this.elementRef.nativeElement;
        // Set ALL focusable breadcrumb elements to -1 (including hidden ones)
        const allLinks = el.querySelectorAll('a.fd-link, [aria-current], .fd-breadcrumb__collapsed');
        allLinks.forEach((link) => link.setAttribute('tabindex', '-1'));
        // Promote the first visible one to 0
        const visibleLinks = this._getVisibleLinks();
        if (visibleLinks.length > 0) {
            visibleLinks[0].setAttribute('tabindex', '0');
        }
    }
    /** @hidden */
    _setItems() {
        this._contentItems.forEach((item) => item.setPortal());
        this._items$.set(this._contentItems.toArray());
    }
    /** @hidden */
    _updateAriaLabels() {
        const items = this._contentItems.toArray();
        const totalCount = items.length;
        const lang = this._langSignal();
        items.forEach((item, index) => {
            const position = index + 1;
            const positionLabel = this._translationResolver.resolve(lang, 'coreBreadcrumb.positionLabel', {
                current: position,
                total: totalCount
            });
            // Set aria-label on link if present
            if (item.breadcrumbLink) {
                const linkEl = item.breadcrumbLink.elementRef.nativeElement;
                const linkText = linkEl.textContent?.trim() || '';
                linkEl.setAttribute('aria-label', `${linkText}, ${positionLabel}`);
            }
            else {
                // Set aria-label on direct child span with aria-current if present
                const itemElement = item.elementRef.nativeElement;
                const directChildSpan = Array.from(itemElement.children).find((child) => child.tagName === 'SPAN' && child.hasAttribute('aria-current'));
                if (directChildSpan) {
                    const spanText = directChildSpan.textContent?.trim() || '';
                    directChildSpan.setAttribute('aria-label', `${spanText}, ${positionLabel}`);
                }
            }
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: BreadcrumbComponent, isStandalone: true, selector: "fd-breadcrumb", inputs: { reverse: { classPropertyName: "reverse", publicName: "reverse", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: null }, separatorStyle: { classPropertyName: "separatorStyle", publicName: "separatorStyle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visibleItemsCount: "visibleItemsCount", hiddenItemsCount: "hiddenItemsCount" }, host: { attributes: { "role": "navigation" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "_cssClass()", "attr.aria-label": "_ariaLabel" } }, providers: [
            {
                provide: FD_BREADCRUMB_COMPONENT,
                useExisting: BreadcrumbComponent
            }
        ], queries: [{ propertyName: "_contentItems", predicate: FD_BREADCRUMB_ITEM_COMPONENT }], viewQueries: [{ propertyName: "_menuComponent", first: true, predicate: MenuComponent, descendants: true }, { propertyName: "_overflowLayout", first: true, predicate: OverflowLayoutComponent, descendants: true }], ngImport: i0, template: "<fd-overflow-layout\n    [reverseHiddenItems]=\"!reverse\"\n    showMorePosition=\"left\"\n    [enableKeyboardNavigation]=\"false\"\n    (visibleItemsCount)=\"_onVisibleItemsCountChange($event)\"\n    (hiddenItemsCount)=\"_onHiddenItemsCountChange($event)\"\n    ariaRole=\"list\"\n>\n    @for (breadcrumb of _items$(); track breadcrumb) {\n        <div\n            *fdOverflowItemRef=\"breadcrumb; let hidden\"\n            fdOverflowLayoutItem\n            (hiddenChange)=\"_onHiddenChange($event, breadcrumb)\"\n        >\n            <ng-template [cdkPortalOutlet]=\"breadcrumb.portal\"></ng-template>\n        </div>\n    }\n    <ng-container *fdOverflowExpand=\"let breadcrumbs; items: _items$()\">\n        <fd-menu #menu [closeOnEscapeKey]=\"true\" [focusAutoCapture]=\"true\" [placement]=\"placement()\">\n            @for (breadcrumbItem of breadcrumbs; track breadcrumbItem) {\n                <li\n                    fd-menu-item\n                    [disabled]=\"\n                        breadcrumbItem.item.breadcrumbLink ? breadcrumbItem.item.breadcrumbLink.disabled() : false\n                    \"\n                >\n                    <a fd-menu-interactive (click)=\"itemClicked(breadcrumbItem.item, $event)\">\n                        @if (breadcrumbItem?.item.breadcrumbLink) {\n                            @if (breadcrumbItem.item.breadcrumbLink.prefixIconName()) {\n                                <fd-menu-addon\n                                    position=\"before\"\n                                    [glyph]=\"breadcrumbItem.item.breadcrumbLink.prefixIconName()\"\n                                ></fd-menu-addon>\n                            }\n                            <span fd-menu-title>\n                                <ng-container [cdkPortalOutlet]=\"breadcrumbItem.item.linkContentPortal\"></ng-container>\n                            </span>\n                            @if (breadcrumbItem.item.breadcrumbLink.postfixIconName()) {\n                                <fd-menu-addon\n                                    [glyph]=\"breadcrumbItem.item.breadcrumbLink.postfixIconName()\"\n                                ></fd-menu-addon>\n                            }\n                        } @else {\n                            <span fd-menu-title>\n                                <ng-container\n                                    [cdkPortalOutlet]=\"breadcrumbItem.item.breadcrumbItemPortal\"\n                                ></ng-container>\n                            </span>\n                        }\n                    </a>\n                </li>\n            }\n        </fd-menu>\n        @if (breadcrumbs.length > 0) {\n            <span class=\"fd-breadcrumb__item\" [fdMenuTrigger]=\"menu\" #menuTriggerSpan>\n                <a\n                    fd-link\n                    [attr.aria-label]=\"('coreBreadcrumb.overflowTitleMore' | fdTranslate)()\"\n                    aria-haspopup=\"menu\"\n                    tabindex=\"-1\"\n                    class=\"fd-breadcrumb__collapsed\"\n                    (keyup.enter)=\"openOverflowMenu($event)\"\n                    (keyup.space)=\"openOverflowMenu($event)\"\n                    (keydown.enter)=\"$event.preventDefault()\"\n                    (keydown.space)=\"$event.preventDefault()\"\n                >\n                    <fd-icon\n                        glyph=\"overflow\"\n                        [title]=\"('coreBreadcrumb.overflowTitleMore' | fdTranslate)()\"\n                        [ariaLabel]=\"('coreBreadcrumb.overflowTitleMore' | fdTranslate)()\"\n                    ></fd-icon>\n                    <fd-icon glyph=\"slim-arrow-down\"></fd-icon>\n                </a>\n                <span class=\"fd-breadcrumb__separator\" aria-hidden=\"true\"></span>\n            </span>\n        }\n    </ng-container>\n</fd-overflow-layout>\n<ng-content></ng-content>\n", styles: [".fd-breadcrumb{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;--fdLink_Line_Height:1.5rem;list-style:none;-webkit-margin-after:.5rem;margin-block-end:.5rem}.fd-breadcrumb:after,.fd-breadcrumb:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--sapContent_LabelColor);padding-block:.0625rem}.fd-breadcrumb__item:after,.fd-breadcrumb__item:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item:last-child:not(:has(a)){--fdBreadcrumb_Separator:none}.fd-breadcrumb__item .fd-breadcrumb__popover-body{border:none;border-top-left-radius:.125rem;border-top-right-radius:.125rem}.fd-breadcrumb__separator{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-breadcrumb__separator:after,.fd-breadcrumb__separator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-breadcrumb__separator:after{color:var(--sapTextColor);content:var(--fdBreadcrumb_Separator,\"/\");margin-inline:.25rem}.fd-breadcrumb--backslash{--fdBreadcrumb_Separator:\"\\\\\"}.fd-breadcrumb--double-slash{--fdBreadcrumb_Separator:\"//\"}.fd-breadcrumb--double-backslash{--fdBreadcrumb_Separator:\"\\\\\\\\\"}.fd-breadcrumb--greater-than{--fdBreadcrumb_Separator:\">\"}.fd-breadcrumb--double-greater-than{--fdBreadcrumb_Separator:\">>\"}.fd-breadcrumb .fd-overflow-layout{justify-content:flex-start}.fd-breadcrumb .fd-breadcrumb__item,.fd-breadcrumb .fd-link{white-space:nowrap;text-wrap:nowrap}\n/*! Bundled license information:\n\nfundamental-styles/dist/breadcrumb.css:\n  (*!\n   * Fundamental Library Styles v0.41.7\n   * Copyright (c) 2026 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"], dependencies: [{ kind: "component", type: OverflowLayoutComponent, selector: "fd-overflow-layout", inputs: ["maxVisibleItems", "navigationTrigger", "showMorePosition", "renderShowMoreButton", "reverseHiddenItems", "enableKeyboardNavigation", "ariaRole", "moreItemsButtonText"], outputs: ["visibleItemsCount", "hiddenItemsCount", "hiddenItemsChange"] }, { kind: "directive", type: OverflowItemRefDirective, selector: "[fdOverflowItemRef]", inputs: ["fdOverflowItemRef"] }, { kind: "directive", type: OverflowLayoutItemDirective, selector: "[fdOverflowLayoutItem]", inputs: ["forceVisibility"], outputs: ["hiddenChange"] }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "directive", type: OverflowExpandDirective, selector: "[fdOverflowExpand]", inputs: ["fdOverflowExpandItems"] }, { kind: "component", type: MenuComponent, selector: "fd-menu", inputs: ["openOnHoverTime", "ariaLabel", "ariaLabelledby", "id", "config", "mobile", "mobileConfig", "placement", "closeOnEscapeKey", "focusAutoCapture", "disabled", "disableScrollbar", "triggers", "fillControlMode", "closeOnOutsideClick", "noArrow", "focusTrapped", "additionalBodyClass", "closeOnNavigation", "restoreFocusOnClose", "appendTo", "fixedPosition", "scrollStrategy", "isOpen"], outputs: ["isOpenChange", "activePath", "beforeOpen"] }, { kind: "component", type: MenuItemComponent, selector: "li[fd-menu-item]", inputs: ["disabled", "itemId", "submenu", "parentSubmenu", "hasSeparator"], outputs: ["onSelect"], exportAs: ["fd-menu-item"] }, { kind: "component", type: MenuInteractiveComponent, selector: "[fd-menu-interactive]" }, { kind: "component", type: MenuAddonDirective, selector: "fd-menu-addon", inputs: ["position", "submenuIndicator", "ariaHidden"] }, { kind: "directive", type: MenuTitleDirective, selector: "[fd-menu-title]", inputs: ["truncate"] }, { kind: "directive", type: MenuTriggerDirective, selector: "[fdMenuTrigger]", inputs: ["fdMenuTrigger"] }, { kind: "component", type: LinkComponent, selector: "[fdLink], [fd-link]", inputs: ["emphasized", "disabled", "inverted", "subtle", "undecorated", "touchTarget"] }, { kind: "component", type: IconComponent, selector: "fd-icon", inputs: ["glyph", "font", "color", "background", "size", "class", "ariaLabel", "ariaHidden"], outputs: ["ariaHiddenChange"] }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-breadcrumb', host: {
                        role: 'navigation',
                        '[class]': '_cssClass()',
                        '[attr.aria-label]': '_ariaLabel',
                        '(keydown)': 'onKeydown($event)'
                    }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                        {
                            provide: FD_BREADCRUMB_COMPONENT,
                            useExisting: BreadcrumbComponent
                        }
                    ], imports: [
                        OverflowLayoutComponent,
                        OverflowItemRefDirective,
                        OverflowLayoutItemDirective,
                        PortalModule,
                        OverflowExpandDirective,
                        MenuComponent,
                        MenuItemComponent,
                        MenuInteractiveComponent,
                        GlyphMenuAddonDirective,
                        MenuAddonDirective,
                        MenuTitleDirective,
                        MenuTriggerDirective,
                        LinkComponent,
                        IconComponent,
                        FdTranslatePipe
                    ], template: "<fd-overflow-layout\n    [reverseHiddenItems]=\"!reverse\"\n    showMorePosition=\"left\"\n    [enableKeyboardNavigation]=\"false\"\n    (visibleItemsCount)=\"_onVisibleItemsCountChange($event)\"\n    (hiddenItemsCount)=\"_onHiddenItemsCountChange($event)\"\n    ariaRole=\"list\"\n>\n    @for (breadcrumb of _items$(); track breadcrumb) {\n        <div\n            *fdOverflowItemRef=\"breadcrumb; let hidden\"\n            fdOverflowLayoutItem\n            (hiddenChange)=\"_onHiddenChange($event, breadcrumb)\"\n        >\n            <ng-template [cdkPortalOutlet]=\"breadcrumb.portal\"></ng-template>\n        </div>\n    }\n    <ng-container *fdOverflowExpand=\"let breadcrumbs; items: _items$()\">\n        <fd-menu #menu [closeOnEscapeKey]=\"true\" [focusAutoCapture]=\"true\" [placement]=\"placement()\">\n            @for (breadcrumbItem of breadcrumbs; track breadcrumbItem) {\n                <li\n                    fd-menu-item\n                    [disabled]=\"\n                        breadcrumbItem.item.breadcrumbLink ? breadcrumbItem.item.breadcrumbLink.disabled() : false\n                    \"\n                >\n                    <a fd-menu-interactive (click)=\"itemClicked(breadcrumbItem.item, $event)\">\n                        @if (breadcrumbItem?.item.breadcrumbLink) {\n                            @if (breadcrumbItem.item.breadcrumbLink.prefixIconName()) {\n                                <fd-menu-addon\n                                    position=\"before\"\n                                    [glyph]=\"breadcrumbItem.item.breadcrumbLink.prefixIconName()\"\n                                ></fd-menu-addon>\n                            }\n                            <span fd-menu-title>\n                                <ng-container [cdkPortalOutlet]=\"breadcrumbItem.item.linkContentPortal\"></ng-container>\n                            </span>\n                            @if (breadcrumbItem.item.breadcrumbLink.postfixIconName()) {\n                                <fd-menu-addon\n                                    [glyph]=\"breadcrumbItem.item.breadcrumbLink.postfixIconName()\"\n                                ></fd-menu-addon>\n                            }\n                        } @else {\n                            <span fd-menu-title>\n                                <ng-container\n                                    [cdkPortalOutlet]=\"breadcrumbItem.item.breadcrumbItemPortal\"\n                                ></ng-container>\n                            </span>\n                        }\n                    </a>\n                </li>\n            }\n        </fd-menu>\n        @if (breadcrumbs.length > 0) {\n            <span class=\"fd-breadcrumb__item\" [fdMenuTrigger]=\"menu\" #menuTriggerSpan>\n                <a\n                    fd-link\n                    [attr.aria-label]=\"('coreBreadcrumb.overflowTitleMore' | fdTranslate)()\"\n                    aria-haspopup=\"menu\"\n                    tabindex=\"-1\"\n                    class=\"fd-breadcrumb__collapsed\"\n                    (keyup.enter)=\"openOverflowMenu($event)\"\n                    (keyup.space)=\"openOverflowMenu($event)\"\n                    (keydown.enter)=\"$event.preventDefault()\"\n                    (keydown.space)=\"$event.preventDefault()\"\n                >\n                    <fd-icon\n                        glyph=\"overflow\"\n                        [title]=\"('coreBreadcrumb.overflowTitleMore' | fdTranslate)()\"\n                        [ariaLabel]=\"('coreBreadcrumb.overflowTitleMore' | fdTranslate)()\"\n                    ></fd-icon>\n                    <fd-icon glyph=\"slim-arrow-down\"></fd-icon>\n                </a>\n                <span class=\"fd-breadcrumb__separator\" aria-hidden=\"true\"></span>\n            </span>\n        }\n    </ng-container>\n</fd-overflow-layout>\n<ng-content></ng-content>\n", styles: [".fd-breadcrumb{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;--fdLink_Line_Height:1.5rem;list-style:none;-webkit-margin-after:.5rem;margin-block-end:.5rem}.fd-breadcrumb:after,.fd-breadcrumb:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--sapContent_LabelColor);padding-block:.0625rem}.fd-breadcrumb__item:after,.fd-breadcrumb__item:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-breadcrumb__item:last-child:not(:has(a)){--fdBreadcrumb_Separator:none}.fd-breadcrumb__item .fd-breadcrumb__popover-body{border:none;border-top-left-radius:.125rem;border-top-right-radius:.125rem}.fd-breadcrumb__separator{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-breadcrumb__separator:after,.fd-breadcrumb__separator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-breadcrumb__separator:after{color:var(--sapTextColor);content:var(--fdBreadcrumb_Separator,\"/\");margin-inline:.25rem}.fd-breadcrumb--backslash{--fdBreadcrumb_Separator:\"\\\\\"}.fd-breadcrumb--double-slash{--fdBreadcrumb_Separator:\"//\"}.fd-breadcrumb--double-backslash{--fdBreadcrumb_Separator:\"\\\\\\\\\"}.fd-breadcrumb--greater-than{--fdBreadcrumb_Separator:\">\"}.fd-breadcrumb--double-greater-than{--fdBreadcrumb_Separator:\">>\"}.fd-breadcrumb .fd-overflow-layout{justify-content:flex-start}.fd-breadcrumb .fd-breadcrumb__item,.fd-breadcrumb .fd-link{white-space:nowrap;text-wrap:nowrap}\n/*! Bundled license information:\n\nfundamental-styles/dist/breadcrumb.css:\n  (*!\n   * Fundamental Library Styles v0.41.7\n   * Copyright (c) 2026 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"] }]
        }], ctorParameters: () => [], propDecorators: { reverse: [{
                type: Input
            }], tabIndex: [{
                type: Input
            }], visibleItemsCount: [{
                type: Output
            }], hiddenItemsCount: [{
                type: Output
            }], _contentItems: [{
                type: ContentChildren,
                args: [FD_BREADCRUMB_ITEM_COMPONENT]
            }], _menuComponent: [{
                type: ViewChild,
                args: [MenuComponent]
            }], _overflowLayout: [{
                type: ViewChild,
                args: [OverflowLayoutComponent]
            }], separatorStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "separatorStyle", required: false }] }] } });

const components = [BreadcrumbComponent, BreadcrumbItemComponent, LinkComponent, ContentDensityModule];
/**
 * @deprecated
 * Use direct imports of components and directives.
 */
class BreadcrumbModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbModule, imports: [BreadcrumbComponent, BreadcrumbItemComponent, LinkComponent, ContentDensityModule], exports: [BreadcrumbComponent, BreadcrumbItemComponent, LinkComponent, ContentDensityModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbModule, imports: [BreadcrumbComponent, LinkComponent, ContentDensityModule, ContentDensityModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: BreadcrumbModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [...components],
                    exports: [...components]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { BreadcrumbComponent, BreadcrumbItemComponent, BreadcrumbModule, FD_BREADCRUMB_COMPONENT, FD_BREADCRUMB_ITEM_COMPONENT };
//# sourceMappingURL=fundamental-ngx-core-breadcrumb.mjs.map
