/*! @name @viostream/videojs-overlay @version v2.1.6-f.97-master @license Apache-2.0 */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).videojsOverlay=e(t.videojs)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t);function i(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},n.exports),n.exports}var o=i((function(t){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0})),r=i((function(t){function e(n,i){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,e(n,i)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0})),s=i((function(t){t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0})),a={align:"top-left",class:"",content:"This overlay will show up while the video is playing",debug:!1,showBackground:!0,attachToControlBar:!1,overlays:[{start:"playing",end:"paused"}]},h=n.default.getComponent("Component"),d=n.default.dom||n.default,l=n.default.registerPlugin||n.default.plugin,u=function(t){return"number"==typeof t&&t==t},p=function(t){return"string"==typeof t&&/^\S+$/.test(t)},c=function(t){function e(n,i){var r;return(r=t.call(this,n,i)||this).isVisible=!0,["start","end"].forEach((function(t){var e=r.options_[t];if(u(e))r[t+"Event_"]="timeupdate";else if(p(e))r[t+"Event_"]=e;else if("start"===t)throw new Error('invalid "start" option; expected number or string')})),["endListener_","rewindListener_","startListener_"].forEach((function(t){r[t]=function(n){return e.prototype[t].call(o(r),n)}})),"timeupdate"===r.startEvent_&&r.on(n,"timeupdate",r.rewindListener_),r.debug('created, listening to "'+r.startEvent_+'" for "start" and "'+(r.endEvent_||"nothing")+'" for "end"'),r.hide(),r}s(e,t);var i=e.prototype;return i.createEl=function(){var t=this.options_,e=t.content,n=t.showBackground?"vjs-overlay-background":"vjs-overlay-no-background",i=d.createEl("div",{className:"\n vjs-overlay\n vjs-overlay-"+t.align+"\n "+t.class+"\n "+n+"\n vjs-hidden\n "});return"string"==typeof e?i.innerHTML=e:e instanceof window.DocumentFragment?i.appendChild(e):d.appendContent(i,e),i},i.debug=function(){if(this.options_.debug){for(var t=n.default.log,e=t,i=arguments.length,o=new Array(i),r=0;r=n:n===e},i.show=function(){return t.prototype.show.call(this),this.isVisible=!0,this.off(this.player(),this.startEvent_,this.startListener_),this.debug("shown"),this.debug('unbound `startListener_` from "'+this.startEvent_+'"'),u(this.options_.start)&&(this.player().paused()&&0!==this.options_.start||this.player().trigger("show-overlay",{id:this.options_.cta_id,align:this.options_.align})),this.endEvent_&&(this.debug('bound `endListener_` to "'+this.endEvent_+'"'),this.on(this.player(),this.endEvent_,this.endListener_)),this},i.shouldShow_=function(t,e){var n=this.options_.start,i=this.options_.end;return u(n)?u(i)?t>=n&&t=n):n===e},i.startListener_=function(t){var e=this.player().currentTime();this.shouldShow_(e,t.type)&&this.show()},i.endListener_=function(t){var e=this.player().currentTime();this.shouldHide_(e,t.type)&&this.hide()},i.rewindListener_=function(t){var e=this.player().currentTime(),n=this.previousTime_,i=this.options_.start,o=this.options_.end;e