export class Iframe {
    constructor() {
        this.width = '100%';
        this.height = '420';
        this.fullscreen = false;
        this.fullscreenMargins = '0,0,0,0';
        this.fullscreenClass = '';
    }
    render() {
        if (this.fullscreen == true) {
            this.fullscreenClass = 'iframe-holder';
        }
        const self = this;
        setTimeout(() => {
            let iframe = this.host.getElementsByClassName('ema-iframe-iframe')[0];
            let holderEl = this.host.getElementsByClassName('ema-iframe-holder')[0];
            console.log('fixme:', iframe, holderEl);
            // iframe.onload = () => {
            //     console.log('loaded');
            //     // this.loaded.emit('loaded');
            // };
            // holderEl.style.margin = this.fullscreenMargins;
            // self.loading.emit(this.src);
        }, 100);
        return (h("div", { class: 'ema-iframe-holder ' + this.fullscreenClass },
            h("iframe", { src: this.src, width: this.width, height: this.height, frameborder: "0", class: "ema-iframe-iframe" })));
    }
    static get is() { return "ema-iframe"; }
    static get properties() { return {
        "fullscreen": {
            "type": Boolean,
            "attr": "fullscreen"
        },
        "fullscreenMargins": {
            "type": String,
            "attr": "fullscreen-margins"
        },
        "height": {
            "type": "Any",
            "attr": "height"
        },
        "host": {
            "elementRef": true
        },
        "src": {
            "type": String,
            "attr": "src"
        },
        "width": {
            "type": String,
            "attr": "width"
        }
    }; }
    static get style() { return "/**style-placeholder:ema-iframe:**/"; }
}
// import { Component, OnInit, Input, Output, ElementRef, EventEmitter } from '@angular/core';
// import { DomSanitizer, SafeResourceUrl  } from '@angular/platform-browser';
//
// @Component({
//     selector: 'ab-iframe',
//     template: `
//       <div class="ab-iframe-holder" [ngClass]="fullscreen ? 'iframe-holder':''">
//         <iframe class="ab-iframe-iframe" [src]="srcSafe" [width]="width" [height]="height" frameborder="0" ></iframe>
//     </div>`,
//     styleUrls: ['./iframe.component.scss']
//     // styleUrls: ['./iframe.component.scss']
// })
// export class IframeComponent implements OnInit {
//     @Input() src: string;
//     @Input() width: string = '100%';
//     @Input() height: any = '420';
//     @Input() fullscreen = false;
//     @Input() fullscreenMargins = '0,0,0,0';
//     @Output() loading = new EventEmitter();
//     @Output() loaded = new EventEmitter();
//
//     srcSafe: SafeResourceUrl;
//
//     constructor(private sanitizer: DomSanitizer, private elRef: ElementRef) { }
//
//     ngOnInit() {
//         let iframe = this.elRef.nativeElement.getElementsByClassName('ema-iframe-iframe')[0];
//         let holderEl = this.elRef.nativeElement.getElementsByClassName('ema-iframe-holder')[0];
//
//         this.srcSafe = this.sanitizer.bypassSecurityTrustResourceUrl(this.src);
//         iframe.onload = () => {
//             this.loaded.emit('loaded');
//         };
//         holderEl.style.margin = this.fullscreenMargins;
//
//         this.loading.emit(this.src);
//     }
//
// }
//# sourceMappingURL=iframe.js.map