import { AsyncPipe, NgIf } from '@angular/common';
import { ChangeDetectionStrategy, Component, EventEmitter, inject, Input, Output, } from '@angular/core';
import { tuiIsString } from '@taiga-ui/cdk/utils/miscellaneous';
import { TuiButton, tuiButtonOptionsProvider } from '@taiga-ui/core/components/button';
import { TuiFormatDatePipe } from '@taiga-ui/core/pipes/format-date';
import { TUI_CLOSE_WORD, TUI_COMMON_ICONS } from '@taiga-ui/core/tokens';
import * as i0 from "@angular/core";
class TuiPushComponent {
    constructor() {
        this.isString = tuiIsString;
        this.closeWord$ = inject(TUI_CLOSE_WORD);
        this.icons = inject(TUI_COMMON_ICONS);
        this.heading = '';
        this.type = '';
        this.lines = 2;
        this.timestamp = '';
        this.close = new EventEmitter();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPushComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiPushComponent, isStandalone: true, selector: "tui-push", inputs: { heading: "heading", type: "type", lines: "lines", timestamp: "timestamp" }, outputs: { close: "close" }, host: { properties: { "style.--t-lines": "lines" } }, providers: [tuiButtonOptionsProvider({ size: 's', appearance: 'secondary' })], ngImport: i0, template: "<div class=\"t-image\">\n    <ng-content select=\"img\" />\n</div>\n<button\n    *ngIf=\"close.observed\"\n    appearance=\"\"\n    size=\"xs\"\n    tuiIconButton\n    type=\"button\"\n    class=\"t-close\"\n    [iconStart]=\"icons.close\"\n    [style.border-radius.%]=\"100\"\n    (click)=\"close.emit()\"\n>\n    {{ closeWord$ | async }}\n</button>\n<div class=\"t-top\">\n    <span class=\"t-icon\">\n        <ng-content select=\"tui-svg,tui-icon\" />\n    </span>\n    {{ type }}\n    <span\n        *ngIf=\"timestamp\"\n        class=\"t-time\"\n        [textContent]=\"isString(timestamp) ? timestamp : (timestamp | tuiFormatDate | async)\"\n    ></span>\n</div>\n<h3\n    automation-id=\"tui-push__heading\"\n    class=\"t-heading\"\n>\n    {{ heading }}\n</h3>\n<div class=\"t-content\">\n    <ng-content />\n</div>\n<div class=\"t-actions\">\n    <span class=\"t-button\">\n        <ng-content select=\"[tuiButton]\" />\n    </span>\n    <span class=\"t-link\">\n        <ng-content select=\"[tuiLink]\" />\n    </span>\n</div>\n", styles: [":host{position:relative;display:block;inline-size:22.5rem;max-inline-size:100%;box-sizing:border-box;padding:1.25rem 1.25rem .25rem;overflow:hidden;font:var(--tui-font-text-m);border-radius:var(--tui-radius-xl);background:var(--tui-background-elevation-2);box-shadow:var(--tui-shadow-small)}.t-image{display:flex;flex-direction:column;max-block-size:10.625rem;overflow:hidden;margin:-1.25rem -1.25rem 1.25rem}.t-close{position:absolute;top:.75rem;right:.75rem;color:#0000008a;background:#f2f2f252;-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem)}@supports (inset-inline-end: 0){.t-close{right:unset;inset-inline-end:.75rem}}.t-top{display:flex;align-items:center;font:var(--tui-font-text-s);color:var(--tui-text-secondary)}.t-icon{block-size:1.25rem;margin-inline-end:.5rem;transform:scale(.833);transform-origin:top left;color:var(--tui-text-action)}.t-time:before{content:\"\\2022\";display:inline-block;inline-size:1rem;text-align:center}.t-heading{line-height:1.25rem;font-weight:700;margin:.75rem 0 .25rem}.t-heading,.t-content{display:-webkit-box;-webkit-box-orient:block-axis;-webkit-line-clamp:var(--t-lines);word-break:break-word;overflow:hidden}.t-actions{display:flex;align-items:center;font:var(--tui-font-text-s)}.t-button:not(:empty){margin:.75rem .75rem .75rem 0}.t-link{margin:.75rem 0}.t-link:empty{margin:.5rem}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "pipe", type: TuiFormatDatePipe, name: "tuiFormatDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
export { TuiPushComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPushComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, selector: 'tui-push', imports: [AsyncPipe, NgIf, TuiButton, TuiFormatDatePipe], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiButtonOptionsProvider({ size: 's', appearance: 'secondary' })], host: {
                        '[style.--t-lines]': 'lines',
                    }, template: "<div class=\"t-image\">\n    <ng-content select=\"img\" />\n</div>\n<button\n    *ngIf=\"close.observed\"\n    appearance=\"\"\n    size=\"xs\"\n    tuiIconButton\n    type=\"button\"\n    class=\"t-close\"\n    [iconStart]=\"icons.close\"\n    [style.border-radius.%]=\"100\"\n    (click)=\"close.emit()\"\n>\n    {{ closeWord$ | async }}\n</button>\n<div class=\"t-top\">\n    <span class=\"t-icon\">\n        <ng-content select=\"tui-svg,tui-icon\" />\n    </span>\n    {{ type }}\n    <span\n        *ngIf=\"timestamp\"\n        class=\"t-time\"\n        [textContent]=\"isString(timestamp) ? timestamp : (timestamp | tuiFormatDate | async)\"\n    ></span>\n</div>\n<h3\n    automation-id=\"tui-push__heading\"\n    class=\"t-heading\"\n>\n    {{ heading }}\n</h3>\n<div class=\"t-content\">\n    <ng-content />\n</div>\n<div class=\"t-actions\">\n    <span class=\"t-button\">\n        <ng-content select=\"[tuiButton]\" />\n    </span>\n    <span class=\"t-link\">\n        <ng-content select=\"[tuiLink]\" />\n    </span>\n</div>\n", styles: [":host{position:relative;display:block;inline-size:22.5rem;max-inline-size:100%;box-sizing:border-box;padding:1.25rem 1.25rem .25rem;overflow:hidden;font:var(--tui-font-text-m);border-radius:var(--tui-radius-xl);background:var(--tui-background-elevation-2);box-shadow:var(--tui-shadow-small)}.t-image{display:flex;flex-direction:column;max-block-size:10.625rem;overflow:hidden;margin:-1.25rem -1.25rem 1.25rem}.t-close{position:absolute;top:.75rem;right:.75rem;color:#0000008a;background:#f2f2f252;-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem)}@supports (inset-inline-end: 0){.t-close{right:unset;inset-inline-end:.75rem}}.t-top{display:flex;align-items:center;font:var(--tui-font-text-s);color:var(--tui-text-secondary)}.t-icon{block-size:1.25rem;margin-inline-end:.5rem;transform:scale(.833);transform-origin:top left;color:var(--tui-text-action)}.t-time:before{content:\"\\2022\";display:inline-block;inline-size:1rem;text-align:center}.t-heading{line-height:1.25rem;font-weight:700;margin:.75rem 0 .25rem}.t-heading,.t-content{display:-webkit-box;-webkit-box-orient:block-axis;-webkit-line-clamp:var(--t-lines);word-break:break-word;overflow:hidden}.t-actions{display:flex;align-items:center;font:var(--tui-font-text-s)}.t-button:not(:empty){margin:.75rem .75rem .75rem 0}.t-link{margin:.75rem 0}.t-link:empty{margin:.5rem}\n"] }]
        }], propDecorators: { heading: [{
                type: Input
            }], type: [{
                type: Input
            }], lines: [{
                type: Input
            }], timestamp: [{
                type: Input
            }], close: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 