/*
 * 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, ViewEncapsulation } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SkeletonModule } from 'carbon-components-angular';
import { map, startWith, switchMap } from 'rxjs';
import { RenderPageSubtitleDirectiveModule } from '../../directives/render-page-subtitle/render-page-subtitle-directive.module';
import { RenderPageHeaderDirectiveModule } from '../../directives/render-page-header/render-page-header-directive.module';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "../../services";
import * as i3 from "@angular/common";
import * as i4 from "carbon-components-angular";
import * as i5 from "../../directives/render-page-subtitle/render-page-subtitle.directive";
export class PageSubtitleComponent {
    constructor(router, activatedRoute, pageTitleService, pageHeaderService) {
        this.router = router;
        this.activatedRoute = activatedRoute;
        this.pageTitleService = pageTitleService;
        this.pageHeaderService = pageHeaderService;
        this.hasCustomPageSubtitle$ = this.router.events.pipe(startWith(this.router), switchMap(() => this.activatedRoute.firstChild.data), map(data => !!data?.customPageSubtitle));
        this.hasPageActions$ = this.pageTitleService.hasPageActions$;
        this.pageActionsFullWidth$ = this.pageTitleService.pageActionsFullWidth$;
        this.customPageSubtitleSet$ = this.pageTitleService.customPageSubtitleSet$;
        this.customPageSubtitle$ = this.pageTitleService.customPageSubtitle$;
        this.compactMode$ = this.pageHeaderService.compactMode$;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PageSubtitleComponent, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: i2.PageTitleService }, { token: i2.PageHeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PageSubtitleComponent, isStandalone: true, selector: "valtimo-page-subtitle", 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 renderPageSubtitle>\n  <ng-template>\n    <div\n      class=\"subtitle-container\"\n      *ngIf=\"{\n        hasCustomPageSubtitle: hasCustomPageSubtitle$ | async,\n        customPageSubtitleSet: customPageSubtitleSet$ | async,\n        customPageSubtitle: customPageSubtitle$ | async,\n        compactMode: compactMode$ | async,\n        hasPageActions: hasPageActions$ | async,\n        pageActionsFullWidth: pageActionsFullWidth$ | async,\n      } as obs\"\n    >\n      <div\n        *ngIf=\"obs.hasCustomPageSubtitle && !obs.customPageSubtitleSet\"\n        class=\"subtitle-skeleton-container\"\n        [ngClass]=\"{'--compact': obs.compactMode}\"\n      >\n        <cds-skeleton-placeholder></cds-skeleton-placeholder>\n      </div>\n\n      <span\n        *ngIf=\"obs.hasCustomPageSubtitle && obs.customPageSubtitleSet\"\n        [innerHtml]=\"obs.customPageSubtitle\"\n        [title]=\"obs.customPageSubtitle\"\n        class=\"page-subtitle\"\n        [ngClass]=\"{'--compact': obs.compactMode}\"\n      >\n      </span>\n    </div>\n  </ng-template>\n</ng-container>\n", styles: [".subtitle-container .subtitle-skeleton-container .cds--skeleton__placeholder{height:18px;margin-bottom:8px;width:200px;margin-left:16px}.subtitle-container .subtitle-skeleton-container.--compact .cds--skeleton__placeholder{height:18px;width:60px;margin:0}.subtitle-container .page-subtitle{margin-left:16px;padding-bottom:4px;color:var(--cds-text-helper, #6f6f6f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;line-height:18px}.subtitle-container .page-subtitle b{font-weight:bolder}.subtitle-container .page-subtitle.--compact{padding-bottom:0;margin-left: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: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i4.SkeletonPlaceholder, selector: "cds-skeleton-placeholder, ibm-skeleton-placeholder" }, { kind: "ngmodule", type: RenderPageSubtitleDirectiveModule }, { kind: "directive", type: i5.RenderPageSubtitleDirective, selector: "[renderPageSubtitle]" }, { kind: "ngmodule", type: RenderPageHeaderDirectiveModule }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PageSubtitleComponent, decorators: [{
            type: Component,
            args: [{ selector: 'valtimo-page-subtitle', standalone: true, imports: [
                        CommonModule,
                        SkeletonModule,
                        RenderPageSubtitleDirectiveModule,
                        RenderPageHeaderDirectiveModule,
                    ], 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 renderPageSubtitle>\n  <ng-template>\n    <div\n      class=\"subtitle-container\"\n      *ngIf=\"{\n        hasCustomPageSubtitle: hasCustomPageSubtitle$ | async,\n        customPageSubtitleSet: customPageSubtitleSet$ | async,\n        customPageSubtitle: customPageSubtitle$ | async,\n        compactMode: compactMode$ | async,\n        hasPageActions: hasPageActions$ | async,\n        pageActionsFullWidth: pageActionsFullWidth$ | async,\n      } as obs\"\n    >\n      <div\n        *ngIf=\"obs.hasCustomPageSubtitle && !obs.customPageSubtitleSet\"\n        class=\"subtitle-skeleton-container\"\n        [ngClass]=\"{'--compact': obs.compactMode}\"\n      >\n        <cds-skeleton-placeholder></cds-skeleton-placeholder>\n      </div>\n\n      <span\n        *ngIf=\"obs.hasCustomPageSubtitle && obs.customPageSubtitleSet\"\n        [innerHtml]=\"obs.customPageSubtitle\"\n        [title]=\"obs.customPageSubtitle\"\n        class=\"page-subtitle\"\n        [ngClass]=\"{'--compact': obs.compactMode}\"\n      >\n      </span>\n    </div>\n  </ng-template>\n</ng-container>\n", styles: [".subtitle-container .subtitle-skeleton-container .cds--skeleton__placeholder{height:18px;margin-bottom:8px;width:200px;margin-left:16px}.subtitle-container .subtitle-skeleton-container.--compact .cds--skeleton__placeholder{height:18px;width:60px;margin:0}.subtitle-container .page-subtitle{margin-left:16px;padding-bottom:4px;color:var(--cds-text-helper, #6f6f6f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;line-height:18px}.subtitle-container .page-subtitle b{font-weight:bolder}.subtitle-container .page-subtitle.--compact{padding-bottom:0;margin-left: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.Router }, { type: i1.ActivatedRoute }, { type: i2.PageTitleService }, { type: i2.PageHeaderService }] });
//# sourceMappingURL=data:application/json;base64, 