System.register(["./p-3c39d395.system.js","./p-61149f05.system.js"],function(t){"use strict";var e,r,u;return{setters:[function(t){e=t.r;r=t.h},function(t){u=t.R}],execute:function(){var o=t("bce_element_video",function(){function t(t){e(this,t);this.resolveLocation=u.NOOP;this.url="";this.youtube=false}t.prototype.componentWillLoad=function(){var t=this;if(!this.template)return;if(this.template.location.startsWith("BCE://")){this.resolveLocation(this.template.location).then(function(e){return t.url=e});return}var e=this.template.location.match(/youtube.com\/watch\?v=([^&]+)/);if(e){this.youtube=true;this.url=this.createYouTubeURL(e[1]);return}var r=this.template.location.match(/youtu\.be\/([^\?]+)/);if(r){this.youtube=true;this.url=this.createYouTubeURL(r[1]);return}this.url=this.template.location};t.prototype.createYouTubeURL=function(t){var e=this.template&&new URL(this.template.location);var r="https://www.youtube.com/embed/"+t;var u=e&&e.searchParams.get("t")||0;var o=this.template&&this.template.autoplay;return r+"?start="+u+"&autoplay="+o};t.prototype.renderVideo=function(){if(!this.template||!this.url)return null;var t=this.template.autoplay;return r("video",{key:this.url,autoplay:t,muted:t,playsInline:t,controls:true},r("source",{src:this.url}))};t.prototype.renderYouTube=function(){return[r("img",{src:"http://placehold.it/16x9"}),r("iframe",{src:this.url,frameborder:"0",allowFullScreen:true})]};t.prototype.render=function(){return this.youtube?this.renderYouTube():this.renderVideo()};Object.defineProperty(t,"style",{get:function(){return"bce-element-video{position:relative;display:block;margin:1rem auto;max-width:1200px;text-align:center}bce-element-video img,bce-element-video video{width:100%;height:auto}bce-element-video img{opacity:0}bce-element-video iframe{position:absolute;top:0;left:0;width:100%;height:100%}\@media screen and (min-width:1024px){bce-element-video{text-align:left;width:auto}}"},enumerable:true,configurable:true});return t}())}}});