import * as i0 from '@angular/core';
import { InjectionToken, inject, input, computed, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
/**
 * The injection token to be used when used globally across the app
 */
const SI_COPYRIGHT_DETAILS = new InjectionToken('SI_COPYRIGHT_DETAILS');

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiCopyrightNoticeComponent {
    globalCopyrightInfo = inject(SI_COPYRIGHT_DETAILS, {
        optional: true
    });
    /**
     * Copyright information to be displayed.
     *
     * Note: The {@link CopyrightDetails#company} defaults to `Sample Company`,
     * only set it for other companies.
     */
    copyright = input(...(ngDevMode ? [undefined, { debugName: "copyright" }] : []));
    copyrightInfo = computed(() => {
        const lastYear = this.lastUpdateYear();
        const to = lastYear ? `-${lastYear}` : '';
        return `${this.startYear()}${to}`;
    }, ...(ngDevMode ? [{ debugName: "copyrightInfo" }] : []));
    company = computed(() => this.copyright()?.company ?? this.globalCopyrightInfo?.company, ...(ngDevMode ? [{ debugName: "company" }] : []));
    startYear = computed(() => this.copyright()?.startYear ?? this.globalCopyrightInfo?.startYear ?? new Date().getFullYear(), ...(ngDevMode ? [{ debugName: "startYear" }] : []));
    lastUpdateYear = computed(() => this.copyright()?.lastUpdateYear ?? this.globalCopyrightInfo?.lastUpdateYear ?? undefined, ...(ngDevMode ? [{ debugName: "lastUpdateYear" }] : []));
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiCopyrightNoticeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.8", type: SiCopyrightNoticeComponent, isStandalone: true, selector: "si-copyright-notice", inputs: { copyright: { classPropertyName: "copyright", publicName: "copyright", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<p>\n  \u00A9\n  <span class=\"company\">{{ company() }}</span>\n  {{ copyrightInfo() }}\n</p>\n", styles: [".company:empty:after{content:var(--element-company-name)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiCopyrightNoticeComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-copyright-notice', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p>\n  \u00A9\n  <span class=\"company\">{{ company() }}</span>\n  {{ copyrightInfo() }}\n</p>\n", styles: [".company:empty:after{content:var(--element-company-name)}\n"] }]
        }], propDecorators: { copyright: [{ type: i0.Input, args: [{ isSignal: true, alias: "copyright", required: false }] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiCopyrightNoticeModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiCopyrightNoticeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: SiCopyrightNoticeModule, imports: [SiCopyrightNoticeComponent], exports: [SiCopyrightNoticeComponent] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiCopyrightNoticeModule });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiCopyrightNoticeModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [SiCopyrightNoticeComponent],
                    exports: [SiCopyrightNoticeComponent]
                }]
        }] });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

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

export { SI_COPYRIGHT_DETAILS, SiCopyrightNoticeComponent, SiCopyrightNoticeModule };
//# sourceMappingURL=siemens-element-ng-copyright-notice.mjs.map
