import * as i0 from '@angular/core';
import { EventEmitter, Component, Input, Directive, HostBinding, NgModule } from '@angular/core';
import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
import { CommonModule } from '@angular/common';

class BsPlaceholderComponent {
    constructor() {
        //#region isLoading
        this.isLoading$ = new BehaviorSubject(false);
        this.isLoadingChange = new EventEmitter();
    }
    get isLoading() {
        return this.isLoading$.value;
    }
    set isLoading(value) {
        this.isLoading$.next(value);
        this.isLoadingChange.emit(value);
    }
}
BsPlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
BsPlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: BsPlaceholderComponent, selector: "bs-placeholder", inputs: { isLoading: "isLoading" }, ngImport: i0, template: "<div class=\"placeholder-glow\">\n    <ng-content></ng-content>\n</div>", styles: [":host ::ng-deep .placeholder{display:inline-block;min-height:1em;vertical-align:middle;cursor:wait;background-color:currentcolor;opacity:.5}:host ::ng-deep .placeholder.btn:before{display:inline-block;content:\"\"}:host ::ng-deep .placeholder-xs{min-height:.6em}:host ::ng-deep .placeholder-sm{min-height:.8em}:host ::ng-deep .placeholder-lg{min-height:1.2em}:host ::ng-deep .placeholder-glow .placeholder{animation:placeholder-glow 2s ease-in-out infinite}@keyframes placeholder-glow{50%{opacity:.2}}:host ::ng-deep .placeholder-wave{-webkit-mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,.8) 75%,#000 95%);mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,.8) 75%,#000 95%);-webkit-mask-size:200% 100%;mask-size:200% 100%;animation:placeholder-wave 2s linear infinite}@keyframes placeholder-wave{to{-webkit-mask-position:-200% 0%;mask-position:-200% 0%}}:host ::ng-deep .placeholder{min-height:calc(1em - 1px)!important}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderComponent, decorators: [{
            type: Component,
            args: [{ selector: 'bs-placeholder', template: "<div class=\"placeholder-glow\">\n    <ng-content></ng-content>\n</div>", styles: [":host ::ng-deep .placeholder{display:inline-block;min-height:1em;vertical-align:middle;cursor:wait;background-color:currentcolor;opacity:.5}:host ::ng-deep .placeholder.btn:before{display:inline-block;content:\"\"}:host ::ng-deep .placeholder-xs{min-height:.6em}:host ::ng-deep .placeholder-sm{min-height:.8em}:host ::ng-deep .placeholder-lg{min-height:1.2em}:host ::ng-deep .placeholder-glow .placeholder{animation:placeholder-glow 2s ease-in-out infinite}@keyframes placeholder-glow{50%{opacity:.2}}:host ::ng-deep .placeholder-wave{-webkit-mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,.8) 75%,#000 95%);mask-image:linear-gradient(130deg,#000 55%,rgba(0,0,0,.8) 75%,#000 95%);-webkit-mask-size:200% 100%;mask-size:200% 100%;animation:placeholder-wave 2s linear infinite}@keyframes placeholder-wave{to{-webkit-mask-position:-200% 0%;mask-position:-200% 0%}}:host ::ng-deep .placeholder{min-height:calc(1em - 1px)!important}\n"] }]
        }], propDecorators: { isLoading: [{
                type: Input
            }] } });

class BsPlaceholderFieldDirective {
    constructor(placeholder) {
        this.placeholder = placeholder;
        this.html = undefined;
        this.minWidth = 80;
        this.marginBottom = 0;
        this.placeholderClass = true;
        this.destroyed$ = new Subject();
        this.placeholder.isLoading$
            .pipe(takeUntil(this.destroyed$))
            .subscribe((isLoading) => {
            this.placeholderClass = isLoading;
            this.marginBottom = isLoading ? -1 : 0;
            this.html = isLoading ? '&nbsp;' : undefined;
        });
    }
    ngOnDestroy() {
        this.destroyed$.next(true);
    }
}
BsPlaceholderFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderFieldDirective, deps: [{ token: BsPlaceholderComponent }], target: i0.ɵɵFactoryTarget.Directive });
BsPlaceholderFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: BsPlaceholderFieldDirective, selector: "[bsPlaceholderField]", host: { properties: { "attr.innerHtml": "this.html", "style.min-width.px": "this.minWidth", "style.margin-bottom.px": "this.marginBottom", "class.placeholder": "this.placeholderClass" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderFieldDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[bsPlaceholderField]'
                }]
        }], ctorParameters: function () { return [{ type: BsPlaceholderComponent }]; }, propDecorators: { html: [{
                type: HostBinding,
                args: ['attr.innerHtml']
            }], minWidth: [{
                type: HostBinding,
                args: ['style.min-width.px']
            }], marginBottom: [{
                type: HostBinding,
                args: ['style.margin-bottom.px']
            }], placeholderClass: [{
                type: HostBinding,
                args: ['class.placeholder']
            }] } });

class BsPlaceholderModule {
}
BsPlaceholderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
BsPlaceholderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderModule, declarations: [BsPlaceholderComponent, BsPlaceholderFieldDirective], imports: [CommonModule], exports: [BsPlaceholderComponent, BsPlaceholderFieldDirective] });
BsPlaceholderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsPlaceholderModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [BsPlaceholderComponent, BsPlaceholderFieldDirective],
                    imports: [CommonModule],
                    exports: [BsPlaceholderComponent, BsPlaceholderFieldDirective],
                }]
        }] });

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

export { BsPlaceholderComponent, BsPlaceholderFieldDirective, BsPlaceholderModule };
//# sourceMappingURL=mintplayer-ng-bootstrap-placeholder.mjs.map
