function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var TF_Dailymotion_Video=function(e){function t(t){t=e.call(this,t)||this;return t.player=null,t}_inheritsLoose(t,e);var o=t.prototype;return o.init=function(){this.maybeLoadAPI()},o.pause=function(){this.player&&this.player.pause()},o.dailymotionApiLoaded=function(){return window.dailymotion&&void 0!==window.dailymotion},o.maybeLoadAPI=function(){var t,e,o,i=this;if(!document.querySelector('script[data-video="'+this.dataset.videoId+'"]')||this.dailymotionApiLoaded())return(t=document.createElement("script")).src="https://geo.dailymotion.com/player.js",t.setAttribute("data-video",this.dataset.videoId),(e=document.getElementsByTagName("script")[0]).parentNode.insertBefore(t,e),o=function t(e){i.dailymotionApiLoaded()?i.initDailymotionVideo():setTimeout(function(){return t(e)},350)},new Promise(function(t,e){o(t)})},o.initDailymotionVideo=function(){function e(t){0<parseInt(o.dataset.videoEnd)&&parseInt(t.videoTime)>=parseInt(o.dataset.videoEnd)&&(o.pause(),o.dataset.videoEnd=0)}var o=this,i=this;dailymotion.createPlayer(this.videoElement.querySelector(":scope div").id,{video:this.dataset.videoId,params:{mute:"true"===this.dataset.videoMute,startTime:this.dataset.videoStart,loop:"true"===this.dataset.videoLoop,autoplay:!1}}).then(function(t){i.player=t,0<parseInt(i.dataset.videoEnd)&&(i.player.on("timeupdate",e),i.player.on("seeking",function(t){t.videoTime<1||i.player.off("timeupdate",e)}))}).catch(function(t){return console.error(t)})},t}(TF_Video);

