import{h}from"../ema.core.js";import"./chunk-de721f0a.js";import{m as Css,e as DomUtil}from"./chunk-f41c48db.js";var Iframe=function(){function e(){this.fullscreenClass="iframe-holder-fullscreen",this.width="100%",this.height="420px",this.fullscreen=!1,this.fullscreenMargin="0,0,0,0"}return e.prototype.onIframeLoaded=function(){this.iframeLoaded.emit({src:this.src})},e.prototype.componentDidLoad=function(){this.postRender()},e.prototype.componentDidUpdate=function(){this.postRender()},e.prototype.postRender=function(){var e=this,t=this.el.getElementsByClassName("ema-iframe-iframe")[0],s=this.el.getElementsByClassName("ema-iframe-holder")[0];if(this.fullscreen||(Css.setVar("width",this.width,this.el),Css.setVar("height",this.height,this.el),t.setAttribute("width",Css.getVar("width",this.el)),t.setAttribute("height",Css.getVar("height",this.el))),this.fullscreen){var r=this.fullscreenMargin.split(",");r.length&&1===r.length&&(Css.setVar("top",r[0],this.el),Css.setVar("right",r[0],this.el),Css.setVar("bottom",r[0],this.el),Css.setVar("left",r[0],this.el)),r.length&&2===r.length&&(Css.setVar("top",r[0],this.el),Css.setVar("right",r[1],this.el),Css.setVar("bottom",r[0],this.el),Css.setVar("left",r[1],this.el)),r.length&&3===r.length&&(Css.setVar("top",r[0],this.el),Css.setVar("right",r[1],this.el),Css.setVar("bottom",r[2],this.el)),r.length&&4===r.length&&(Css.setVar("top",r[0],this.el),Css.setVar("right",r[1],this.el),Css.setVar("bottom",r[2],this.el),Css.setVar("left",r[3],this.el)),DomUtil.addClass(s,this.fullscreenClass)}this.zIndex&&Css.setVar("zIndex",this.zIndex,this.el),t.onload=function(){Css.setVar("visibility","visible",e.el),e.iframeLoaded.emit({src:e.src,el:e.el})}},e.prototype.render=function(){return h("div",{class:"ema-iframe-holder "},h("iframe",{src:this.src,frameborder:"0",class:"ema-iframe-iframe"}))},Object.defineProperty(e,"is",{get:function(){return"ema-iframe"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{el:{elementRef:!0},fullscreen:{type:Boolean,attr:"fullscreen"},fullscreenMargin:{type:String,attr:"fullscreen-margin"},height:{type:String,attr:"height"},src:{type:String,attr:"src"},width:{type:String,attr:"width"},zIndex:{type:Number,attr:"z-index"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"iframeLoaded",method:"iframeLoaded",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"style",{get:function(){return":root{--ema-color:#343a40;--ema-primary:#007bff;--ema-secondary:#6c757d;--ema-success:#28a745;--ema-info:#17a2b8;--ema-warning:#ffc107;--ema-danger:#dc3545;--ema-light:#f8f9fa;--ema-dark:#343a40;--ema-background:#fff;--ema-background-diap:rgba(29,29,29,0.97);--ema-border-color:#c5c9cd;--ema-border:1px solid #c5c9cd;--ema-border-radius:3px 3px 3px 3px;--ema-box-shadow:1px 1px 10px 1px #ccc;--ema-margin:0.25rem;--ema-margin-sm:0.5rem;--ema-margin-md:1rem;--ema-margin-lg:1.5rem;--ema-margin-xl:2rem;--ema-padding:0.25rem;--ema-padding-sm:0.5rem;--ema-padding-md:1rem;--ema-padding-lg:1.5rem;--ema-padding-xl:2rem;--ema-gray-100:#f8f9fa;--ema-gray-200:#e9ecef;--ema-gray-300:#dee2e6;--ema-gray-400:#ced4da;--ema-gray-500:#adb5bd;--ema-gray-600:#868e96;--ema-gray-700:#495057;--ema-gray-800:#343a40;--ema-gray-900:#212529}ema-iframe{--top:0;--right:0;--bottom:0;--left:0;--visibility:hidden}ema-iframe .ema-iframe-holder{z-index:var(--zIndex);width:var(--width);height:var(--height);visibility:var(--visibility,\"visible\")}ema-iframe .ema-iframe-holder iframe{height:100%;width:100%}ema-iframe .iframe-holder-fullscreen{position:fixed;top:var(--top);right:var(--right);bottom:var(--bottom);left:var(--left);-webkit-overflow-scrolling:touch;overflow-y:scroll}ema-iframe .iframe-holder-fullscreen iframe{height:100%;width:100%}"},enumerable:!0,configurable:!0}),e}();export{Iframe as EmaIframe};