import { createTheme, mergeDeep, colorToTheme } from 'flowbite-angular';
import * as i0 from '@angular/core';
import { InjectionToken, inject, input, booleanAttribute, computed, Directive } from '@angular/core';
import { createStateToken, createStateProvider, createStateInjector, createState } from 'ng-primitives/state';
import { twMerge } from 'tailwind-merge';
import * as i1 from 'ng-primitives/button';
import { NgpButton } from 'ng-primitives/button';
import * as i2 from 'ng-primitives/interactions';
import { NgpFocus } from 'ng-primitives/interactions';

const flowbiteBreadcrumbTheme = createTheme({
    host: {
        base: 'inline-flex items-center gap-1 rounded-lg px-5 py-3',
        transition: '',
        solid: {
            on: 'border',
            off: 'border-none bg-transparent',
        },
        color: {
            default: {
                light: 'border-gray-300 bg-gray-100',
                dark: 'dark:border-gray-900 dark:bg-gray-800',
            },
            info: {
                light: 'border-blue-300 bg-blue-100',
                dark: 'dark:border-blue-900 dark:bg-blue-800',
            },
            failure: {
                light: 'border-red-300 bg-red-100',
                dark: 'dark:border-red-900 dark:bg-red-800',
            },
            success: {
                light: 'border-green-300 bg-green-100',
                dark: 'dark:border-green-900 dark:bg-green-800',
            },
            warning: {
                light: 'border-yellow-300 bg-yellow-100',
                dark: 'dark:border-yellow-900 dark:bg-yellow-800',
            },
            primary: {
                light: 'border-primary-300 bg-primary-100',
                dark: 'dark:border-primary-900 dark:bg-primary-800',
            },
        },
    },
});

const defaultFlowbiteBreadcrumbConfig = {
    baseTheme: flowbiteBreadcrumbTheme,
    color: 'default',
    solid: false,
    customTheme: {},
};
const FlowbiteBreadcrumbConfigToken = new InjectionToken('FlowbiteBreadcrumbConfigToken');
/**
 * Provide the default Breadcrumb configuration
 * @param config The Breadcrumb configuration
 * @returns The provider
 */
const provideFlowbiteBreadcrumbConfig = (config) => [
    {
        provide: FlowbiteBreadcrumbConfigToken,
        useValue: { ...defaultFlowbiteBreadcrumbConfig, ...config },
    },
];
/**
 * Inject the Breadcrumb configuration
 * @see {@link defaultFlowbiteBreadcrumbConfig}
 * @returns The configuration
 */
const injectFlowbiteBreadcrumbConfig = () => inject(FlowbiteBreadcrumbConfigToken, { optional: true }) ?? defaultFlowbiteBreadcrumbConfig;

const FlowbiteBreadcrumbStateToken = createStateToken('Flowbite Breadcrumb');
const provideFlowbiteBreadcrumbState = createStateProvider(FlowbiteBreadcrumbStateToken);
const injectFlowbiteBreadcrumbState = createStateInjector(FlowbiteBreadcrumbStateToken);
const flowbiteBreadcrumbState = createState(FlowbiteBreadcrumbStateToken);

class Breadcrumb {
    constructor() {
        this.config = injectFlowbiteBreadcrumbConfig();
        /**
         * @see {@link injectFlowbiteBreadcrumbConfig}
         */
        this.color = input(this.config.color);
        /**
         * @see {@link injectFlowbiteBreadcrumbConfig}
         */
        this.solid = input(this.config.solid, { transform: booleanAttribute });
        /**
         * @see {@link injectFlowbiteBreadcrumbConfig}
         */
        this.customTheme = input(this.config.customTheme);
        this.theme = computed(() => {
            const mergedTheme = mergeDeep(this.config.baseTheme, this.state.customTheme());
            return {
                host: {
                    root: twMerge(mergedTheme.host.base, mergedTheme.host.transition, this.state.solid() &&
                        mergedTheme.host.solid[this.state.solid() ? 'on' : 'off'] &&
                        colorToTheme(mergedTheme.host.color, this.state.color())),
                },
            };
        });
        /**
         * @internal
         */
        this.state = flowbiteBreadcrumbState(this);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: Breadcrumb, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: Breadcrumb, isStandalone: true, selector: "\n    nav[flowbiteBreadcrumb]\n  ", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, solid: { classPropertyName: "solid", publicName: "solid", isSignal: true, isRequired: false, transformFunction: null }, customTheme: { classPropertyName: "customTheme", publicName: "customTheme", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "theme().host.root" } }, providers: [provideFlowbiteBreadcrumbState()], exportAs: ["flowbiteBreadcrumb"], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: Breadcrumb, decorators: [{
            type: Directive,
            args: [{
                    standalone: true,
                    selector: `
    nav[flowbiteBreadcrumb]
  `,
                    exportAs: 'flowbiteBreadcrumb',
                    hostDirectives: [],
                    providers: [provideFlowbiteBreadcrumbState()],
                    host: {
                        '[class]': `theme().host.root`,
                    },
                }]
        }] });

const flowbiteBreadcrumbItemTheme = createTheme({
    host: {
        base: 'group flex items-center justify-between text-sm font-medium data-hover:cursor-pointer',
        transition: '',
        color: {
            default: {
                light: 'text-gray-700 data-hover:text-gray-900',
                dark: 'dark:text-gray-100 dark:data-hover:text-white',
            },
            info: {
                light: 'text-blue-700 data-hover:text-blue-900',
                dark: 'dark:text-blue-100 dark:data-hover:text-blue-300',
            },
            failure: {
                light: 'text-red-700 data-hover:text-red-900',
                dark: 'dark:text-red-100 dark:data-hover:text-red-300',
            },
            success: {
                light: 'text-green-700 data-hover:text-green-900',
                dark: 'dark:text-green-100 dark:data-hover:text-green-300',
            },
            warning: {
                light: 'text-yellow-700 data-hover:text-yellow-900',
                dark: 'dark:text-yellow-100 dark:data-hover:text-yellow-300',
            },
            primary: {
                light: 'data-hover:text-primary-900 text-primary-700',
                dark: 'dark:text-primary-100 dark:data-hover:text-primary-300',
            },
        },
    },
});

const defaultFlowbiteBreadcrumbItemConfig = {
    baseTheme: flowbiteBreadcrumbItemTheme,
    customTheme: {},
};
const FlowbiteBreadcrumbItemConfigToken = new InjectionToken('FlowbiteBreadcrumbConfigToken');
/**
 * Provide the default Breadcrumb Item configuration
 * @param config The Breadcrumb configuration
 * @returns The provider
 */
const provideFlowbiteBreadcrumbItemConfig = (config) => [
    {
        provide: FlowbiteBreadcrumbItemConfigToken,
        useValue: { ...defaultFlowbiteBreadcrumbItemConfig, ...config },
    },
];
/**
 * Inject the Breadcrumb Item configuration
 * @see {@link defaultFlowbiteBreadcrumbItemConfig}
 * @returns The configuration
 */
const injectFlowbiteBreadcrumbItemConfig = () => inject(FlowbiteBreadcrumbItemConfigToken, { optional: true }) ??
    defaultFlowbiteBreadcrumbItemConfig;

const FlowbiteBreadcrumbItemStateToken = createStateToken('Flowbite Breadcrumb Item');
const provideFlowbiteBreadcrumbItemState = createStateProvider(FlowbiteBreadcrumbItemStateToken);
const injectFlowbiteBreadcrumbItemState = createStateInjector(FlowbiteBreadcrumbItemStateToken);
const flowbiteBreadcrumbItemState = createState(FlowbiteBreadcrumbItemStateToken);

class BreadcrumbItem {
    constructor() {
        this.config = injectFlowbiteBreadcrumbItemConfig();
        this.breadcrumbState = injectFlowbiteBreadcrumbState();
        /**
         * @see {@link injectFlowbiteBreadcrumbItemConfig}
         */
        this.customTheme = input(this.config.customTheme);
        this.theme = computed(() => {
            const mergedTheme = mergeDeep(this.config.baseTheme, this.state.customTheme());
            return {
                host: {
                    root: twMerge(mergedTheme.host.base, mergedTheme.host.transition, colorToTheme(mergedTheme.host.color, this.breadcrumbState().color())),
                },
            };
        });
        /**
         * @internal
         */
        this.state = flowbiteBreadcrumbItemState(this);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: BreadcrumbItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: BreadcrumbItem, isStandalone: true, selector: "\n    li[flowbiteBreadcrumbItem]\n  ", inputs: { customTheme: { classPropertyName: "customTheme", publicName: "customTheme", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "theme().host.root" } }, providers: [provideFlowbiteBreadcrumbItemState()], exportAs: ["flowbiteBreadcrumbItem"], hostDirectives: [{ directive: i1.NgpButton, inputs: ["disabled", "disabled"] }, { directive: i2.NgpFocus }], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: BreadcrumbItem, decorators: [{
            type: Directive,
            args: [{
                    standalone: true,
                    selector: `
    li[flowbiteBreadcrumbItem]
  `,
                    exportAs: 'flowbiteBreadcrumbItem',
                    hostDirectives: [
                        {
                            directive: NgpButton,
                            inputs: ['disabled:disabled'],
                            outputs: [],
                        },
                        {
                            directive: NgpFocus,
                            inputs: [],
                            outputs: [],
                        },
                    ],
                    providers: [provideFlowbiteBreadcrumbItemState()],
                    host: {
                        '[class]': `theme().host.root`,
                    },
                }]
        }] });

const flowbiteBreadcrumbContentTheme = createTheme({
    host: {
        base: 'inline-flex items-center space-x-1 md:space-x-2',
        transition: '',
    },
});

const defaultFlowbiteBreadcrumbContentConfig = {
    baseTheme: flowbiteBreadcrumbContentTheme,
    customTheme: {},
};
const FlowbiteBreadcrumbContentConfigToken = new InjectionToken('FlowbiteBreadcrumbContentConfigToken');
/**
 * Provide the default BreadcrumbContent configuration
 * @param config The BreadcrumbContent configuration
 * @returns The provider
 */
const provideFlowbiteBreadcrumbContentConfig = (config) => [
    {
        provide: FlowbiteBreadcrumbContentConfigToken,
        useValue: { ...defaultFlowbiteBreadcrumbContentConfig, ...config },
    },
];
/**
 * Inject the BreadcrumbContent configuration
 * @see {@link defaultFlowbiteBreadcrumbContentConfig}
 * @returns The configuration
 */
const injectFlowbiteBreadcrumbContentConfig = () => inject(FlowbiteBreadcrumbContentConfigToken, { optional: true }) ??
    defaultFlowbiteBreadcrumbContentConfig;

const FlowbiteBreadcrumbContentStateToken = createStateToken('Flowbite BreadcrumbContent');
const provideFlowbiteBreadcrumbContentState = createStateProvider(FlowbiteBreadcrumbContentStateToken);
const injectFlowbiteBreadcrumbContentState = createStateInjector(FlowbiteBreadcrumbContentStateToken);
const flowbiteBreadcrumbContentState = createState(FlowbiteBreadcrumbContentStateToken);

class BreadcrumbContent {
    constructor() {
        this.config = injectFlowbiteBreadcrumbContentConfig();
        /**
         * @see {@link injectFlowbiteBreadcrumbContentConfig}
         */
        this.customTheme = input(this.config.customTheme);
        this.theme = computed(() => {
            const mergedTheme = mergeDeep(this.config.baseTheme, this.state.customTheme());
            return {
                host: {
                    root: twMerge(mergedTheme.host.base, mergedTheme.host.transition),
                },
            };
        });
        /**
         * @internal
         */
        this.state = flowbiteBreadcrumbContentState(this);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: BreadcrumbContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.0.6", type: BreadcrumbContent, isStandalone: true, selector: "\n    ol[flowbiteBreadcrumbContent]\n  ", inputs: { customTheme: { classPropertyName: "customTheme", publicName: "customTheme", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "theme().host.root" } }, providers: [provideFlowbiteBreadcrumbContentState()], exportAs: ["flowbiteBreadcrumbContent"], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: BreadcrumbContent, decorators: [{
            type: Directive,
            args: [{
                    standalone: true,
                    selector: `
    ol[flowbiteBreadcrumbContent]
  `,
                    exportAs: 'flowbiteBreadcrumbContent',
                    hostDirectives: [],
                    providers: [provideFlowbiteBreadcrumbContentState()],
                    host: { '[class]': `theme().host.root` },
                }]
        }] });

/* Breadcrumb */

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

export { Breadcrumb, BreadcrumbContent, BreadcrumbItem, FlowbiteBreadcrumbConfigToken, FlowbiteBreadcrumbContentConfigToken, FlowbiteBreadcrumbContentStateToken, FlowbiteBreadcrumbItemConfigToken, FlowbiteBreadcrumbItemStateToken, FlowbiteBreadcrumbStateToken, defaultFlowbiteBreadcrumbConfig, defaultFlowbiteBreadcrumbContentConfig, defaultFlowbiteBreadcrumbItemConfig, flowbiteBreadcrumbContentState, flowbiteBreadcrumbContentTheme, flowbiteBreadcrumbItemState, flowbiteBreadcrumbItemTheme, flowbiteBreadcrumbState, flowbiteBreadcrumbTheme, injectFlowbiteBreadcrumbConfig, injectFlowbiteBreadcrumbContentConfig, injectFlowbiteBreadcrumbContentState, injectFlowbiteBreadcrumbItemConfig, injectFlowbiteBreadcrumbItemState, injectFlowbiteBreadcrumbState, provideFlowbiteBreadcrumbConfig, provideFlowbiteBreadcrumbContentConfig, provideFlowbiteBreadcrumbContentState, provideFlowbiteBreadcrumbItemConfig, provideFlowbiteBreadcrumbItemState, provideFlowbiteBreadcrumbState };
//# sourceMappingURL=flowbite-angular-breadcrumb.mjs.map
