/*
 * Copyright 2015-2024 Ritense BV, the Netherlands.
 *
 * Licensed under EUPL, Version 1.2 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { Component, HostBinding, ViewEncapsulation } from '@angular/core';
import { combineLatest, map, Subscription } from 'rxjs';
import * as i0 from "@angular/core";
import * as i1 from "./breadcrumb.service";
import * as i2 from "../../services";
import * as i3 from "@angular/common";
import * as i4 from "carbon-components-angular";
export class BreadcrumbNavigationComponent {
    constructor(breadcrumbService, pageHeaderService, pageTitleService) {
        this.breadcrumbService = breadcrumbService;
        this.pageHeaderService = pageHeaderService;
        this.pageTitleService = pageTitleService;
        this.compactMode$ = this.pageHeaderService.compactMode$;
        this.breadcrumbItems$ = combineLatest([
            this.breadcrumbService.breadcrumbItems$,
            this.compactMode$,
            this.pageTitleService.pageTitleHidden$,
        ]).pipe(map(([breadCrumbItems, compactMode, pageTitleHidden]) => [
            ...(compactMode && !pageTitleHidden ? [{ content: '' }] : []),
            ...breadCrumbItems,
        ]));
        this._subscriptions = new Subscription();
    }
    ngOnInit() {
        this._subscriptions.add(this.pageHeaderService.compactMode$.subscribe(compactMode => {
            this.isCompact = compactMode;
        }));
    }
    ngOnDestroy() {
        this._subscriptions.unsubscribe();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BreadcrumbNavigationComponent, deps: [{ token: i1.BreadcrumbService }, { token: i2.PageHeaderService }, { token: i2.PageTitleService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: BreadcrumbNavigationComponent, selector: "valtimo-breadcrumb-navigation", host: { properties: { "class.valtimo-breadcrumb-navigation--compact": "this.isCompact" } }, ngImport: i0, template: "<!--\n  ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n  ~\n  ~ Licensed under EUPL, Version 1.2 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" basis,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<ng-container *ngIf=\"breadcrumbItems$ | async as breadcrumbItems\">\n  <div\n    class=\"breadcrumbs-container\"\n    *ngIf=\"breadcrumbItems.length > 0\"\n    [ngClass]=\"{'--compact': compactMode$ | async}\"\n  >\n    <cds-breadcrumb [items]=\"breadcrumbItems\"></cds-breadcrumb>\n  </div>\n</ng-container>\n", styles: [".breadcrumbs-container{margin-bottom:8px;display:flex;width:max-content}.breadcrumbs-container.--compact{margin-bottom:0}.valtimo-breadcrumb-navigation--compact{flex-shrink:0}\n/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.Breadcrumb, selector: "cds-breadcrumb, ibm-breadcrumb", inputs: ["items", "noTrailingSlash", "ariaLabel", "skeleton", "threshold"], outputs: ["navigation"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BreadcrumbNavigationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'valtimo-breadcrumb-navigation', encapsulation: ViewEncapsulation.None, template: "<!--\n  ~ Copyright 2015-2024 Ritense BV, the Netherlands.\n  ~\n  ~ Licensed under EUPL, Version 1.2 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~ https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" basis,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<ng-container *ngIf=\"breadcrumbItems$ | async as breadcrumbItems\">\n  <div\n    class=\"breadcrumbs-container\"\n    *ngIf=\"breadcrumbItems.length > 0\"\n    [ngClass]=\"{'--compact': compactMode$ | async}\"\n  >\n    <cds-breadcrumb [items]=\"breadcrumbItems\"></cds-breadcrumb>\n  </div>\n</ng-container>\n", styles: [".breadcrumbs-container{margin-bottom:8px;display:flex;width:max-content}.breadcrumbs-container.--compact{margin-bottom:0}.valtimo-breadcrumb-navigation--compact{flex-shrink:0}\n/*!\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n"] }]
        }], ctorParameters: () => [{ type: i1.BreadcrumbService }, { type: i2.PageHeaderService }, { type: i2.PageTitleService }], propDecorators: { isCompact: [{
                type: HostBinding,
                args: ['class.valtimo-breadcrumb-navigation--compact']
            }] } });
//# sourceMappingURL=data:application/json;base64, 