import{_ as m,c as s,d,B as o}from"./app.js";import"./swiper.js";const h={name:"SoylentOpenerMedia",components:{CmmsResponsiveImage:s,SoylentMediaElements:d},props:["element"],computed:{isImage:function(){return this.element.data.media_type?this.element.data.media_type==="picture":!1},isFallbackImage:function(){return this.element.data.media_type_mobile?this.element.data.media_type_mobile==="picture":!1},imageModel(){return this.isMobile?this.element.data.media_data_fallback?this.element.data.media_data_fallback.model:this.element.data.media_data.model:this.element.data.media_data.model},elementStyle:function(){let e="";return this.element.data.media_data.type&&this.element.data.media_data.type==="image"?(e+=`padding-top: ${this.element.data.height}${this.element.data.unit};`,e+=`--height: ${this.element.data.height}${this.element.data.unit};`,e):(this.element.data.height!==""?(e+=`height: ${this.element.data.height}${this.element.data.unit};`,e+=`--height: ${this.element.data.height}${this.element.data.unit};`):(e+="height: 50vh;",e+="--height: 50vh;"),e)},videoUrl(){return this.isMobile?this.element.data.media_data_fallback?this.element.data.media_data_fallback.video_url:this.element.data.media_data.video_url:this.element.data.media_data.video_url},isVideo:function(){return this.element.data.media_type?this.element.data.media_type==="video":!1},showImageElement(){return this.isImage&&!this.isMobile||this.isMobile&&this.hasFallbackMedia&&this.isFallbackImage||this.isMobile&&!this.hasFallbackMedia&&!this.isVideo},isFallbackVideo:function(){return this.element.data.media_type_mobile?this.element.data.media_type_mobile==="video":!1},hasFallbackMedia(){return this.element.data.media_data_fallback!==null},isMobile(){return window.innerWidth<o}}},r=window.Vue.resolveComponent,a=window.Vue.openBlock,c=window.Vue.createBlock,_=window.Vue.createCommentVNode,l=window.Vue.createElementBlock,u=window.Vue.normalizeClass,p=window.Vue.normalizeStyle,f=["src"];function g(e,y,i,b,k,t){const n=r("CmmsResponsiveImage");return a(),l("div",{class:u(["element",i.element.type,i.element.subtype]),style:p(t.elementStyle)},[t.showImageElement?(a(),c(n,{key:0,fill:!0,image:t.imageModel},null,8,["image"])):t.showImageElement?_("",!0):(a(),l("video",{key:1,src:t.videoUrl,autoplay:"",loop:"",muted:"",playsinline:""},null,8,f))],6)}const M=m(h,[["render",g]]);export{M as default};