import * as i0 from '@angular/core';
import { input, output, inject, ElementRef, Injector, runInInjectionContext, effect, ChangeDetectionStrategy, Component } from '@angular/core';
import '@ui5/webcomponents/dist/Breadcrumbs.js';

class Breadcrumbs {
    constructor() {
        /**
         * Defines the visual appearance of the last BreadcrumbsItem.
      
      The Breadcrumbs supports two visual appearances for the last BreadcrumbsItem:
      - "Standard" - displaying the last item as "current page" (bold and without separator)
      - "NoCurrentPage" - displaying the last item as a regular BreadcrumbsItem, followed by separator
         */
        this.design = input("Standard", ...(ngDevMode ? [{ debugName: "design" }] : []));
        /**
         * Determines the visual style of the separator between the breadcrumb items.
         */
        this.separators = input("Slash", ...(ngDevMode ? [{ debugName: "separators" }] : [])); // className is now passed
        /**
         * Fires when a `BreadcrumbsItem` is clicked.
      
      **Note:** You can prevent browser location change by calling `event.preventDefault()`.
         */
        this.ui5ItemClick = output();
        /**
         * Available slots for content projection in this component.
         *
         * Slots allow you to insert custom content into predefined areas of the web component.
         * Use the `slot` attribute on child elements to target specific slots.
         *
         * - **(default)**: Defines the component items.
      
      **Note:** Use the `ui5-breadcrumbs-item` component to define the desired items.
         *
         * @example
         * ```html
         * <ui5-breadcrumbs>
         *   <div slot="header">Custom header content</div>
         *   <p>Default slot content</p>
         * </ui5-breadcrumbs>
         * ```
         *
         * @readonly
         * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_templates_and_slots | MDN Web Components Slots}
         */
        this.slots = [
            {
                "name": "default",
                "description": "Defines the component items.\n\n**Note:** Use the `ui5-breadcrumbs-item` component to define the desired items."
            }
        ];
        this.elementRef = inject(ElementRef);
        this.injector = inject(Injector);
    }
    get element() {
        return this.elementRef.nativeElement;
    }
    ngAfterViewInit() {
        const wcElement = this.element;
        const inputsToSync = [
            'design',
            'separators',
        ];
        // Synchronize inputs (properties)
        for (const inputName of inputsToSync) {
            // Find the corresponding camelCase signal property on the Angular component
            const signalName = inputName.replace(/-./g, (x) => x[1].toUpperCase());
            // Use the Injector to run the effect in the correct context
            if (this[signalName] && typeof this[signalName] === 'function') {
                runInInjectionContext(this.injector, () => {
                    effect(() => {
                        // Read the signal value
                        const value = this[signalName]();
                        if (wcElement) {
                            // Write the value to the Web Component's property
                            wcElement[inputName] = value;
                        }
                    });
                });
            }
        }
        const outputsToSync = [
            'ui5ItemClick',
        ];
        // Synchronize outputs (events)
        for (const outputName of outputsToSync) {
            // Map Angular output name to UI5 web component event name
            const eventName = outputName.replace('ui5', '').replace(/([A-Z])/g, '-$1').toLowerCase().substring(1);
            // Ensure the output property exists and has an emit function before adding listener
            if (this[outputName] && typeof this[outputName].emit === 'function' && wcElement.addEventListener) {
                // Cast the listener to the correct type to satisfy TypeScript
                wcElement.addEventListener(eventName, (e) => {
                    this[outputName].emit(e);
                });
            }
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: Breadcrumbs, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.4", type: Breadcrumbs, isStandalone: true, selector: "ui5-breadcrumbs, [ui5-breadcrumbs]", inputs: { design: { classPropertyName: "design", publicName: "design", isSignal: true, isRequired: false, transformFunction: null }, separators: { classPropertyName: "separators", publicName: "separators", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ui5ItemClick: "ui5ItemClick" }, exportAs: ["ui5Breadcrumbs"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: Breadcrumbs, decorators: [{
            type: Component,
            args: [{
                    standalone: true,
                    selector: 'ui5-breadcrumbs, [ui5-breadcrumbs]',
                    template: '<ng-content></ng-content>',
                    exportAs: 'ui5Breadcrumbs',
                    changeDetection: ChangeDetectionStrategy.OnPush,
                }]
        }] });

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

export { Breadcrumbs };
//# sourceMappingURL=fundamental-ngx-ui5-webcomponents-breadcrumbs.mjs.map
