(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/animations'), require('@angular/cdk/coercion'), require('@ng-tangram/components/core')) :
    typeof define === 'function' && define.amd ? define('@ng-tangram/components/scrim', ['exports', '@angular/common', '@angular/core', '@angular/animations', '@angular/cdk/coercion', '@ng-tangram/components/core'], factory) :
    (global = global || self, factory((global.nt = global.nt || {}, global.nt.components = global.nt.components || {}, global.nt.components.scrim = {}), global.ng.common, global.ng.core, global.ng.animations, global.ng.cdk.coercion, global.nt.components.core));
}(this, (function (exports, common, core, animations, coercion, core$1) { 'use strict';

    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var NtScrimComponent = (function () {
        function NtScrimComponent() {
            this._isOpen = false;
            this.text = '';
        }
        Object.defineProperty(NtScrimComponent.prototype, "isOpen", {
            get: function () { return this._isOpen; },
            set: function (value) { this._isOpen = coercion.coerceBooleanProperty(value); },
            enumerable: true,
            configurable: true
        });
        __decorate([
            core.Input()
        ], NtScrimComponent.prototype, "text", void 0);
        NtScrimComponent = __decorate([
            core.Component({
                selector: '[nt-scrim], nt-scrim',
                template: "<div class=\"nt-scrim\" *ngIf=\"isOpen\" [@fade]>\n  <div class=\"nt-scrim-animation\">\n    <div class=\"nt-scrim-loading\"></div>\n  </div>\n  <h3 class=\"nt-scrim-text\">{{ text }}</h3>\n</div>\n",
                encapsulation: core.ViewEncapsulation.None,
                animations: [
                    animations.trigger('fade', [
                        animations.transition('void => *', core$1.fadeIn(.15)),
                        animations.transition('* => void', core$1.fadeOut(.15))
                    ])
                ]
            })
        ], NtScrimComponent);
        return NtScrimComponent;
    }());

    var __decorate$1 = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var __param = (this && this.__param) || function (paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); }
    };
    var NtScrimDirective = (function () {
        function NtScrimDirective(platformId, _elementRef, _renderer, _componentFactoryResolver, _viewContainerRef) {
            this.platformId = platformId;
            this._elementRef = _elementRef;
            this._renderer = _renderer;
            this._componentFactoryResolver = _componentFactoryResolver;
            this._viewContainerRef = _viewContainerRef;
            var componentFactory = this._componentFactoryResolver.resolveComponentFactory(NtScrimComponent);
            this._componentRef = this._viewContainerRef.createComponent(componentFactory);
            if (common.isPlatformBrowser(this.platformId)) {
                var style = window.getComputedStyle(this._elementRef.nativeElement);
                if (style.position !== 'absolute' || style.position !== 'absolute') {
                    this._renderer.setStyle(this._elementRef.nativeElement, 'position', 'relative');
                }
                this._renderer.appendChild(this._elementRef.nativeElement, this._componentRef.location.nativeElement);
            }
        }
        Object.defineProperty(NtScrimDirective.prototype, "text", {
            set: function (value) { this._componentRef.instance.text = value; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(NtScrimDirective.prototype, "scrim", {
            set: function (value) { this._componentRef.instance.isOpen = coercion.coerceBooleanProperty(value); },
            enumerable: true,
            configurable: true
        });
        NtScrimDirective.prototype.ngOnDestroy = function () {
            if (common.isPlatformBrowser(this.platformId)) {
                this._renderer.removeChild(this._elementRef.nativeElement, this._componentRef.location.nativeElement);
                this._componentRef.destroy();
            }
        };
        NtScrimDirective.ctorParameters = function () { return [
            { type: Object, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] },
            { type: core.ElementRef },
            { type: core.Renderer2 },
            { type: core.ComponentFactoryResolver },
            { type: core.ViewContainerRef }
        ]; };
        __decorate$1([
            core.Input('scrimText')
        ], NtScrimDirective.prototype, "text", null);
        __decorate$1([
            core.Input('ntScrim')
        ], NtScrimDirective.prototype, "scrim", null);
        NtScrimDirective = __decorate$1([
            core.Directive({
                selector: '[ntScrim]'
            }),
            __param(0, core.Inject(core.PLATFORM_ID))
        ], NtScrimDirective);
        return NtScrimDirective;
    }());

    var __decorate$2 = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var NtScrimModule = (function () {
        function NtScrimModule() {
        }
        NtScrimModule = __decorate$2([
            core.NgModule({
                imports: [common.CommonModule],
                exports: [NtScrimComponent, NtScrimDirective],
                declarations: [NtScrimComponent, NtScrimDirective],
                entryComponents: [NtScrimComponent]
            })
        ], NtScrimModule);
        return NtScrimModule;
    }());

    exports.NtScrimComponent = NtScrimComponent;
    exports.NtScrimDirective = NtScrimDirective;
    exports.NtScrimModule = NtScrimModule;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=scrim.umd.js.map
