@atmtfy/video-background
Version:
Automatic background video from various sources (Youtube, MP4, vimeo) with autoplay across devices. No JS dependencies.
2 lines • 74.5 kB
JavaScript
/*! For license information please see bundle.js.LICENSE.txt */
(()=>{var e={539:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n.r(t),n.d(t,{default:()=>O});var o=void 0!==n.g&&"[object global]"==={}.toString.call(n.g);function a(e,t){return 0===e.indexOf(t.toLowerCase())?e:"".concat(t.toLowerCase()).concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}function s(e){return Boolean(e&&1===e.nodeType&&"nodeName"in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function u(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function l(e){return/^(https?:)?\/\/((player|www)\.)?vimeo\.com(?=$|\/)/.test(e)}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");if(u(r))return"https://vimeo.com/".concat(r);if(l(r))return r.replace("http:","https:");if(t)throw new TypeError("“".concat(t,"” is not a valid video id."));throw new TypeError("“".concat(r,"” is not a vimeo.com url."))}var d=void 0!==Array.prototype.indexOf,h="undefined"!=typeof window&&void 0!==window.postMessage;if(!(o||d&&h))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};!function(e){if(!e.WeakMap){var t=Object.prototype.hasOwnProperty,n=function(e,t,n){Object.defineProperty?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n}):e[t]=n};e.WeakMap=function(){function e(){if(void 0===this)throw new TypeError("Constructor WeakMap requires 'new'");if(n(this,"_id",o("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}function i(e,n){if(!r(e)||!t.call(e,"_id"))throw new TypeError(n+" method called on incompatible receiver "+typeof e)}function o(e){return e+"_"+a()+"."+a()}function a(){return Math.random().toString().substring(2)}return n(e.prototype,"delete",(function(e){if(i(this,"delete"),!r(e))return!1;var t=e[this._id];return!(!t||t[0]!==e)&&(delete e[this._id],!0)})),n(e.prototype,"get",(function(e){if(i(this,"get"),r(e)){var t=e[this._id];return t&&t[0]===e?t[1]:void 0}})),n(e.prototype,"has",(function(e){if(i(this,"has"),!r(e))return!1;var t=e[this._id];return!(!t||t[0]!==e)})),n(e.prototype,"set",(function(e,t){if(i(this,"set"),!r(e))throw new TypeError("Invalid value used as weak map key");var o=e[this._id];return o&&o[0]===e?(o[1]=t,this):(n(e,this._id,[e,t]),this)})),n(e,"_polyfill",!0),e}()}function r(e){return Object(e)===e}}("undefined"!=typeof self?self:"undefined"!=typeof window?window:p);var f,m,g=(f=function(e){var t,n,r;r=function(){var e,t,n,r=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(t){e=function(e,t,n){return e[t]=n,e}}function o(e,r){n.add(e,r),t||(t=i(n.drain))}function a(e){var t,n=typeof e;return null==e||"object"!=n&&"function"!=n||(t=e.then),"function"==typeof t&&t}function s(){for(var e=0;e<this.chain.length;e++)u(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function u(e,t,n){var r,i;try{!1===t?n.reject(e.msg):(r=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(i=a(r))?i.call(r,n.resolve,n.reject):n.resolve(r)}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=a(e))?o((function(){var r=new h(n);try{t.call(e,(function(){l.apply(r,arguments)}),(function(){c.apply(r,arguments)}))}catch(e){c.call(r,e)}})):(n.msg=e,n.state=1,n.chain.length>0&&o(s,n))}catch(e){c.call(new h(n),e)}}}function c(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&o(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)!function(i){e.resolve(t[i]).then((function(e){n(i,e)}),r)}(i)}function h(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function f(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:"function"!=typeof e||e,failure:"function"==typeof n&&n};return r.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");r.resolve=e,r.reject=t})),t.chain.push(r),0!==t.state&&o(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){l.call(t,e)}),(function(e){c.call(t,e)}))}catch(e){c.call(t,e)}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,o){r=new i(t,o),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();var m=e({},"constructor",f,!1);return f.prototype=m,e(m,"__NPO__",0,!1),e(f,"resolve",(function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this((function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)}))})),e(f,"reject",(function(e){return new this((function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)}))})),e(f,"all",(function(e){var t=this;return"[object Array]"!=r.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");var i=e.length,o=Array(i),a=0;d(t,e,(function(e,t){o[e]=t,++a===i&&n(o)}),r)}))})),e(f,"race",(function(e){var t=this;return"[object Array]"!=r.call(e)?t.reject(TypeError("Not an array")):new t((function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");d(t,e,(function(e,t){n(t)}),r)}))})),f},(n=p)[t="Promise"]=n[t]||r(),e.exports&&(e.exports=n[t])},f(m={exports:{}},m.exports),m.exports),v=new WeakMap;function y(e,t,n){var r=v.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),v.set(e.element,r)}function b(e,t){return(v.get(e.element)||{})[t]||[]}function w(e,t,n){var r=v.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],v.set(e.element,r),!0;var i=r[t].indexOf(n);return-1!==i&&r[t].splice(i,1),v.set(e.element,r),r[t]&&0===r[t].length}function E(e,t){var n=v.get(e);v.set(t,n),v.delete(e)}var k=["autopause","autoplay","background","byline","color","controls","dnt","height","id","interactiveparams","keyboard","loop","maxheight","maxwidth","muted","playsinline","portrait","responsive","speed","texttrack","title","transparent","url","width"];function P(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return k.reduce((function(t,n){var r=e.getAttribute("data-vimeo-".concat(n));return(r||""===r)&&(t[n]=""===r?1:r),t}),t)}function x(e,t){var n=e.html;if(!t)throw new TypeError("An element must be provided");if(null!==t.getAttribute("data-vimeo-initialized"))return t.querySelector("iframe");var r=document.createElement("div");return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute("data-vimeo-initialized","true"),t.querySelector("iframe")}function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(r,i){if(!l(e))throw new TypeError("“".concat(e,"” is not a vimeo.com url."));var o="https://vimeo.com/api/oembed.json?url=".concat(encodeURIComponent(e));for(var a in t)t.hasOwnProperty(a)&&(o+="&".concat(a,"=").concat(encodeURIComponent(t[a])));var s="XDomainRequest"in window?new XDomainRequest:new XMLHttpRequest;s.open("GET",o,!0),s.onload=function(){if(404!==s.status)if(403!==s.status)try{var t=JSON.parse(s.responseText);if(403===t.domain_status_code)return x(t,n),void i(new Error("“".concat(e,"” is not embeddable.")));r(t)}catch(e){i(e)}else i(new Error("“".concat(e,"” is not embeddable.")));else i(new Error("“".concat(e,"” was not found.")))},s.onerror=function(){var e=s.status?" (".concat(s.status,")"):"";i(new Error("There was an error fetching the embed code from Vimeo".concat(e,".")))},s.send()}))}function T(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function S(e,t,n){if(e.element.contentWindow&&e.element.contentWindow.postMessage){var r={method:t};void 0!==n&&(r.value=n);var i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,"$1"));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}}function C(e,t){var n,r=[];if((t=T(t)).event){if("error"===t.event)b(e,t.data.method).forEach((function(n){var r=new Error(t.data.message);r.name=t.data.name,n.reject(r),w(e,t.data.method,n)}));r=b(e,"event:".concat(t.event)),n=t.data}else if(t.method){var i=function(e,t){var n=b(e,t);if(n.length<1)return!1;var r=n.shift();return w(e,t,r),r}(e,t.method);i&&(r.push(i),n=t.value)}r.forEach((function(t){try{if("function"==typeof t)return void t.call(e,n);t.resolve(n)}catch(e){}}))}var A=new WeakMap,M=new WeakMap,V={},I=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r(this,e),window.jQuery&&t instanceof jQuery&&(t.length>1&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),t=t[0]),"undefined"!=typeof document&&"string"==typeof t&&(t=document.getElementById(t)),!s(t))throw new TypeError("You must pass either a valid element or a valid id.");if("IFRAME"!==t.nodeName){var o=t.querySelector("iframe");o&&(t=o)}if("IFRAME"===t.nodeName&&!l(t.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");if(A.has(t))return A.get(t);this._window=t.ownerDocument.defaultView,this.element=t,this.origin="*";var a=new g((function(e,r){if(n._onMessage=function(t){if(l(t.origin)&&n.element.contentWindow===t.source){"*"===n.origin&&(n.origin=t.origin);var i=T(t.data);if(i&&"error"===i.event&&i.data&&"ready"===i.data.method){var o=new Error(i.data.message);return o.name=i.data.name,void r(o)}var a=i&&"ready"===i.event,s=i&&"ping"===i.method;if(a||s)return n.element.setAttribute("data-ready","true"),void e();C(n,i)}},n._window.addEventListener("message",n._onMessage),"IFRAME"!==n.element.nodeName){var o=P(t,i);_(c(o),o,t).then((function(e){var r=x(e,t);return n.element=r,n._originalElement=t,E(t,r),A.set(n.element,n),e})).catch(r)}}));if(M.set(this,a),A.set(this.element,this),"IFRAME"===this.element.nodeName&&S(this,"ping"),V.isEnabled){var u=function(){return V.exit()};this.fullscreenchangeHandler=function(){V.isFullscreen?y(n,"event:exitFullscreen",u):w(n,"event:exitFullscreen",u),n.ready().then((function(){S(n,"fullscreenchange",V.isFullscreen)}))},V.on("fullscreenchange",this.fullscreenchangeHandler)}return this}var t,n,o;return t=e,n=[{key:"callMethod",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new g((function(r,i){return t.ready().then((function(){y(t,e,{resolve:r,reject:i}),S(t,e,n)})).catch(i)}))}},{key:"get",value:function(e){var t=this;return new g((function(n,r){return e=a(e,"get"),t.ready().then((function(){y(t,e,{resolve:n,reject:r}),S(t,e)})).catch(r)}))}},{key:"set",value:function(e,t){var n=this;return new g((function(r,i){if(e=a(e,"set"),null==t)throw new TypeError("There must be a value to set.");return n.ready().then((function(){y(n,e,{resolve:r,reject:i}),S(n,e,t)})).catch(i)}))}},{key:"on",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(!t)throw new TypeError("You must pass a callback function.");if("function"!=typeof t)throw new TypeError("The callback must be a function.");0===b(this,"event:".concat(e)).length&&this.callMethod("addEventListener",e).catch((function(){})),y(this,"event:".concat(e),t)}},{key:"off",value:function(e,t){if(!e)throw new TypeError("You must pass an event name.");if(t&&"function"!=typeof t)throw new TypeError("The callback must be a function.");w(this,"event:".concat(e),t)&&this.callMethod("removeEventListener",e).catch((function(e){}))}},{key:"loadVideo",value:function(e){return this.callMethod("loadVideo",e)}},{key:"ready",value:function(){var e=M.get(this)||new g((function(e,t){t(new Error("Unknown player. Probably unloaded."))}));return g.resolve(e)}},{key:"addCuePoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.callMethod("addCuePoint",{time:e,data:t})}},{key:"removeCuePoint",value:function(e){return this.callMethod("removeCuePoint",e)}},{key:"enableTextTrack",value:function(e,t){if(!e)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:e,kind:t})}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"requestFullscreen",value:function(){return V.isEnabled?V.request(this.element):this.callMethod("requestFullscreen")}},{key:"exitFullscreen",value:function(){return V.isEnabled?V.exit():this.callMethod("exitFullscreen")}},{key:"getFullscreen",value:function(){return V.isEnabled?g.resolve(V.isFullscreen):this.get("fullscreen")}},{key:"requestPictureInPicture",value:function(){return this.callMethod("requestPictureInPicture")}},{key:"exitPictureInPicture",value:function(){return this.callMethod("exitPictureInPicture")}},{key:"getPictureInPicture",value:function(){return this.get("pictureInPicture")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var e=this;return new g((function(t){if(M.delete(e),A.delete(e.element),e._originalElement&&(A.delete(e._originalElement),e._originalElement.removeAttribute("data-vimeo-initialized")),e.element&&"IFRAME"===e.element.nodeName&&e.element.parentNode&&(e.element.parentNode.parentNode&&e._originalElement&&e._originalElement!==e.element.parentNode?e.element.parentNode.parentNode.removeChild(e.element.parentNode):e.element.parentNode.removeChild(e.element)),e.element&&"DIV"===e.element.nodeName&&e.element.parentNode){e.element.removeAttribute("data-vimeo-initialized");var n=e.element.querySelector("iframe");n&&n.parentNode&&(n.parentNode.parentNode&&e._originalElement&&e._originalElement!==n.parentNode?n.parentNode.parentNode.removeChild(n.parentNode):n.parentNode.removeChild(n))}e._window.removeEventListener("message",e._onMessage),V.isEnabled&&V.off("fullscreenchange",e.fullscreenchangeHandler),t()}))}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(e){return this.set("autopause",e)}},{key:"getBuffered",value:function(){return this.get("buffered")}},{key:"getCameraProps",value:function(){return this.get("cameraProps")}},{key:"setCameraProps",value:function(e){return this.set("cameraProps",e)}},{key:"getChapters",value:function(){return this.get("chapters")}},{key:"getCurrentChapter",value:function(){return this.get("currentChapter")}},{key:"getColor",value:function(){return this.get("color")}},{key:"setColor",value:function(e){return this.set("color",e)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(e){return this.set("currentTime",e)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(e){return this.set("loop",e)}},{key:"setMuted",value:function(e){return this.set("muted",e)}},{key:"getMuted",value:function(){return this.get("muted")}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(e){return this.set("playbackRate",e)}},{key:"getPlayed",value:function(){return this.get("played")}},{key:"getQualities",value:function(){return this.get("qualities")}},{key:"getQuality",value:function(){return this.get("quality")}},{key:"setQuality",value:function(e){return this.set("quality",e)}},{key:"getSeekable",value:function(){return this.get("seekable")}},{key:"getSeeking",value:function(){return this.get("seeking")}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(e){return this.set("volume",e)}}],n&&i(t.prototype,n),o&&i(t,o),e}();o||(V=function(){var e=function(){for(var e,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,r=t.length,i={};n<r;n++)if((e=t[n])&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request:function(t){return new Promise((function(r,i){var o=function e(){n.off("fullscreenchange",e),r()};n.on("fullscreenchange",o);var a=(t=t||document.documentElement)[e.requestFullscreen]();a instanceof Promise&&a.then(o).catch(i)}))},exit:function(){return new Promise((function(t,r){if(n.isFullscreen){var i=function e(){n.off("fullscreenchange",e),t()};n.on("fullscreenchange",i);var o=document[e.exitFullscreen]();o instanceof Promise&&o.then(i).catch(r)}else t()}))},on:function(e,n){var r=t[e];r&&document.addEventListener(r,n)},off:function(e,n){var r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get:function(){return Boolean(document[e.fullscreenElement])}},element:{enumerable:!0,get:function(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(document[e.fullscreenEnabled])}}}),n}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=[].slice.call(e.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")),n=function(e){"console"in window&&console.error&&console.error("There was an error creating an embed: ".concat(e))};t.forEach((function(e){try{if(null!==e.getAttribute("data-vimeo-defer"))return;var t=P(e);_(c(t),t,e).then((function(t){return x(t,e)})).catch(n)}catch(e){n(e)}}))}(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;if(!window.VimeoPlayerResizeEmbeds_){window.VimeoPlayerResizeEmbeds_=!0;var t=function(t){if(l(t.origin)&&t.data&&"spacechange"===t.data.event)for(var n=e.querySelectorAll("iframe"),r=0;r<n.length;r++)if(n[r].contentWindow===t.source){n[r].parentElement.style.paddingBottom="".concat(t.data.data[0].bottom,"px");break}};window.addEventListener("message",t)}}());const O=I},279:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(640),i=n.n(r),o=n(144),a=n.n(o)()(i());a.push([e.id,':root{--vbg-theme: white;--vbg-bg: black;--vbg-overlay-opacity: 0.5;--vbg-transition-speed: 0.5s;--vbg-preloader-size: 32px;--vbg-icon-size: 34px;--vbg-icon-size-small: 28px;--vbg-icon-spacing-modifier: 0.1;--vbg-icon-space-around: 20px;--vbg-icon-space-around-small: 12px}video-background{width:100%;height:100%;display:block;box-sizing:border-box;position:absolute;z-index:0;top:0;left:0;background:var(--vbg-bg);margin:0;padding:0;overflow:hidden;color:#fff}video-background[status=loading]::after,video-background[status=waiting]::after{content:"";border-radius:50%;position:absolute;top:50%;left:50%;width:var(--vbg-preloader-size, 32px);height:var(--vbg-preloader-size, 32px);margin:calc(0px - var(--vbg-preloader-size)*.5) 0 0 calc(0px - var(--vbg-preloader-size)*.5);border:4px solid var(--vbg-theme);border-top-color:transparent;z-index:2;animation:loader-spin 1s infinite ease}video-background[status=loading] iframe,video-background[status=waiting] iframe{opacity:0}video-background iframe{position:absolute;top:0;left:0;z-index:4;width:100%;height:100%;pointer-events:none}video-background picture,video-background img{position:absolute;top:0;left:0;width:100%;height:100%}video-background img{object-fit:cover}.vbg__controls{z-index:6}.vbg__video,.vbg__poster,.vbg__overlay{position:absolute;width:100%;height:100%;top:0;left:0;display:block;object-fit:cover;object-position:50% 50%;transition:opacity var(--vbg-transition-speed) ease}.vbg__video{z-index:4}.vbg__poster{z-index:3}.vbg__overlay{z-index:5;pointer-events:none;background-color:var(--vbg-bg);opacity:var(--vbg-overlay-opacity)}.vbg--loading{opacity:0}.vbg__icons{position:absolute;z-index:10;bottom:0;left:0;padding:var(--vbg-icon-space-around);width:auto;height:auto;max-width:40%}@media(max-width: 720px){.vbg__icons{padding:var(--vbg-icon-space-around-small)}}.vbg__icon{background:transparent;appearance:none;border:none;--size: var(--vbg-icon-size, 24px);position:relative;width:var(--size);padding:calc(var(--vbg-icon-spacing-modifier)*var(--size));margin:calc(var(--vbg-icon-spacing-modifier)*var(--size));transition:opacity 150ms ease,transform 150ms ease;opacity:.5}.vbg__icon:hover{opacity:.8;transform:scale(1.1)}@media(max-width: 720px){.vbg__icon{--size: var(var(--vbg-icon-size-small), 20px) }}.vbg__icon svg{color:var(--vbg-icon-color, white);width:100%}.vbg__icon path,.vbg__icon rect{fill:currentColor !important}@keyframes loader-spin{100%{transform:rotate(360deg)}}',""]);const s=a},144:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var u=this[s][0];null!=u&&(a[u]=!0)}for(var l=0;l<e.length;l++){var c=[].concat(e[l]);r&&a[c[0]]||(void 0!==o&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=o),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},640:e=>{"use strict";e.exports=function(e){return e[1]}},185:(e,t,n)=>{function r(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=n(991)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),!n)return;var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))})),e.splice(o,0,r)},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=r,t.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(r())},991:(e,t,n)=>{var r;function i(e){function n(){if(n.enabled){var e=n,i=+new Date,o=i-(r||i);e.diff=o,e.prev=r,e.curr=i,r=i;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var u=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;u++;var i=t.formatters[r];if("function"==typeof i){var o=a[u];n=i.call(e,o),a.splice(u,1),u--}return n})),t.formatArgs.call(e,a);var l=n.log||t.log||console.log.bind(console);l.apply(e,a)}}return n.namespace=e,n.enabled=t.enabled(e),n.useColors=t.useColors(),n.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(n),n}(t=e.exports=i.debug=i.default=i).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,i=0;i<r;i++)n[i]&&("-"===(e=n[i].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(65),t.names=[],t.skips=[],t.formatters={}},499:e=>{function t(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function n(e,t){e.onreadystatechange=function(){"complete"!=this.readyState&&"loaded"!=this.readyState||(this.onreadystatechange=null,t(null,e))}}e.exports=function(e,r,i){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("script");"function"==typeof r&&(i=r,r={}),r=r||{},i=i||function(){},a.type=r.type||"text/javascript",a.charset=r.charset||"utf8",a.async=!("async"in r)||!!r.async,a.src=e,r.attrs&&function(e,t){for(var n in t)e.setAttribute(n,t[n])}(a,r.attrs),r.text&&(a.text=""+r.text),("onload"in a?t:n)(a,i),a.onload||t(a,i),o.appendChild(a)}},65:e=>{var t=1e3,n=60*t,r=60*n,i=24*r,o=365.25*i;function a(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}e.exports=function(e,s){s=s||{};var u,l=typeof e;if("string"===l&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!a)return;var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===l&&!1===isNaN(e))return s.long?a(u=e,i,"day")||a(u,r,"hour")||a(u,n,"minute")||a(u,t,"second")||u+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=r)return Math.round(e/r)+"h";if(e>=n)return Math.round(e/n)+"m";if(e>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},878:(e,t)=>{"use strict";var n=Object.prototype.hasOwnProperty;function r(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function i(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var r,o,a=[];for(o in"string"!=typeof t&&(t="?"),e)if(n.call(e,o)){if((r=e[o])||null!=r&&!isNaN(r)||(r=""),o=i(o),r=i(r),null===o||null===r)continue;a.push(o+"="+r)}return a.length?t+a.join("&"):""},t.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,i={};t=n.exec(e);){var o=r(t[1]),a=r(t[2]);null===o||null===a||o in i||(i[o]=a)}return i}},384:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},241:e=>{"use strict";var t;t=function(){var e={},t={};return e.on=function(e,n){var r={name:e,handler:n};return t[e]=t[e]||[],t[e].unshift(r),r},e.off=function(e){var n=t[e.name].indexOf(e);-1!==n&&t[e.name].splice(n,1)},e.trigger=function(e,n){var r,i=t[e];if(i)for(r=i.length;r--;)i[r].handler(n)},e},e.exports=t},36:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var r=n(769),i=n.n(r),o=n(471),a=n.n(o),s=n(834),u=n.n(s),l=n(701),c=n.n(l),d=n(128),h=n.n(d),p=n(493),f=n.n(p),m=n(279),g={};g.styleTagTransform=f(),g.setAttributes=c(),g.insert=u().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=h();i()(m.Z,g);const v=m.Z&&m.Z.locals?m.Z.locals:void 0},769:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},a=[],s=0;s<e.length;s++){var u=e[s],l=r.base?u[0]+r.base:u[0],c=o[l]||0,d="".concat(l," ").concat(c);o[l]=c+1;var h=n(d),p={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var f=i(p,r);r.byIndex=s,t.splice(s,0,{identifier:d,updater:f,references:1})}a.push(d)}return a}function i(e,t){var n=t.domAPI(t);n.update(e);return function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var s=n(o[a]);t[s].references--}for(var u=r(e,i),l=0;l<o.length;l++){var c=n(o[l]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}o=u}}},834:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},128:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},701:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},471:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},493:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},2:e=>{e.exports='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title></title><path d="M18.41,12l1.3-1.29a1,1,0,0,0-1.42-1.42L17,10.59l-1.29-1.3a1,1,0,0,0-1.42,1.42L15.59,12l-1.3,1.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L17,13.41l1.29,1.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z" fill="#464646"></path><path d="M13.23,15.77a2.52,2.52,0,0,1,0-3.54l.23-.23-.23-.23a2.49,2.49,0,0,1,2.77-4V5a1,1,0,0,0-.53-.88,1,1,0,0,0-1,0L8.7,8H6a2,2,0,0,0-2,2v4a2,2,0,0,0,2,2H8.7l5.75,3.83A1,1,0,0,0,16,19V16.27A2.58,2.58,0,0,1,13.23,15.77Z" fill="currentColor"></path></svg>'},383:e=>{e.exports='<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve"><g><rect x="14.6" y="4.8" class="st0" width="3.7" height="14.3" fill="currentColor"></rect></g><g><rect x="5.7" y="4.8" class="st0" width="3.7" height="14.3" fill="currentColor"></rect></g></svg>'},533:e=>{e.exports='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title></title><path d="M19,12a1,1,0,0,1-.55.89l-10,5A1,1,0,0,1,8,18a1,1,0,0,1-.53-.15A1,1,0,0,1,7,17V7a1,1,0,0,1,1.45-.89l10,5A1,1,0,0,1,19,12Z" fill="currentColor"></path></svg>'},291:e=>{e.exports='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M14,5V19a1,1,0,0,1-.53.88,1,1,0,0,1-1-.05L6.7,16H4a2,2,0,0,1-2-2V10A2,2,0,0,1,4,8H6.7l5.75-3.83a1,1,0,0,1,1,0A1,1,0,0,1,14,5Z" fill="currentColor"></path><rect fill="currentColor" height="6" width="2" x="16" y="9"></rect><rect fill="currentColor" height="14" width="2" x="20" y="5"></rect></svg>'},341:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalPlayer=void 0;const i=n(877),o=n(963);class a extends o.default{constructor(e){super(e),this.lastWindowWidth=window.innerWidth,this.config.breakpoints?(this.source=(0,i.getSourcesFilteredBySize)(this.config.source),window.addEventListener("resize",this.checkResize.bind(this))):this.source=[{url:this.config.source[0].url,type:"local",fileType:(0,i.getFileType)(this.config.source[0].url)}],this.build()}get playing(){return!(!this.el||!this.el)&&!!(this.el.currentTime>0&&!this.el.paused&&!this.el.ended&&this.el.readyState>2)}get paused(){return!!this.el&&this.el.paused}checkResize(){const e=this.config.breakpoints;if(!this.lastWindowWidth||!e)return;const t=window.innerWidth;let n=[...e,this.lastWindowWidth].sort(((e,t)=>e-t)),r=[...e,t].sort(((e,t)=>e-t));n.indexOf(this.lastWindowWidth)!=r.indexOf(t)&&this.build()}get currentTime(){return this.el?this.el.currentTime:0}get aspectRatio(){return 1}get muted(){var e,t;return null===(t=null===(e=this.el)||void 0===e?void 0:e.muted)||void 0===t||t}build(){if(this.el&&this.destroy(),!this.source)return;this.el=document.createElement("video"),this.el.classList.add("vbg__video"),this.el.classList.add("vbg--loading"),this.el.setAttribute("playsinline",""),this.el.setAttribute("preload","metadata"),this.props.muted&&this.el.setAttribute("muted","true"),this.config.loop&&this.el.setAttribute("loop","true"),this.el.currentTime=this.config.startTime,this.el.volume=0,this.el.innerHTML="";const e=this.el;this.source.forEach(((t,n)=>{const r=document.createElement("source");"fileType"in t&&(r.type="video/"+t.fileType),r.src=t.url,0==n&&e.addEventListener("loadeddata",(function(){e&&e.classList.remove("vbg--loading")})),e.append(r)})),this.status.ready=!0,this.do("ready"),this.parent.append(this.el)}destroy(){var e;this.el&&(null===(e=this.el.parentElement)||void 0===e||e.removeChild(this.el),this.el=void 0)}mute(){return r(this,void 0,void 0,(function*(){this.el&&(this.el.muted=!0,this.el.volume=0)}))}unmute(){return r(this,void 0,void 0,(function*(){console.log("Trying to unmute"),this.el&&(this.el.muted=!1,this.el.volume=.7)}))}play(){return r(this,void 0,void 0,(function*(){return!!this.el&&(this.el.play().then((()=>{this.status.started=!0})),!0)}))}pause(){return r(this,void 0,void 0,(function*(){return this.el&&this.status.started&&this.el.pause(),!0}))}resize(e=1.4){return!0}}t.LocalPlayer=a},963:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const r={ready:!1,error:!1,paused:!0,playing:!1,started:!1,muted:!0,apiReady:!1,intersecting:!1},i={aspectRatio:.5625,muted:!0,poster:!1,autoplay:!0},o={loop:!0,zoom:1.3,can:{unmute:!1,pause:!1},startTime:0,fillMode:"fill",threshold:.2};t.default=class{constructor(e){if(this.status=r,this.props=i,this.type="local",this.passedConfig=e,this.callbacks={ready:[{fn:this.playCheck.bind(this)}],intersecting:[{fn:this.playCheck.bind(this)}]},this.config=this.mergeConfig(e),this.logger=this.config.parent.logger,this.parent=this.config.parent,this.parseParams(),!this.hasRequiredParams(this.config))throw this.status.error=!0,new Error("No parent passed, cannot create player");this.init()}parseParams(){this.parent.hasAttribute("zoom")&&(this.config.zoom=parseFloat(this.parent.getAttribute("zoom"))),this.parent.hasAttribute("can-unmute")&&(this.config.can.pause="false"!=this.parent.getAttribute("can-unmute")),this.parent.hasAttribute("loop")&&(this.config.can.pause="false"!=this.parent.getAttribute("loop")),this.parent.hasAttribute("can-pause")&&(this.config.can.pause="false"!=this.parent.getAttribute("can-pause")),this.parent.hasAttribute("fill-mode")&&(this.config.fillMode="fit"==this.parent.getAttribute("fill-mode")?"fit":"fill"),this.parent.hasAttribute("start")&&(this.config.startTime=parseInt(this.parent.getAttribute("start")))}hasRequiredParams(e){return null==e.parent?(console.log("Cannot initialize player: No parent provided to Player via constructor"),!1):null!=e.source||(console.log("Cannot initialize player: No source provided to Player via constructor"),!1)}build(){}unbuild(){}init(){window.addEventListener("resize",this.resize.bind(this)),this.buildIntersectionObserver()}destroy(){this.unbuild(),this.removeIntersectionObserver(),window.removeEventListener("resize",this.resize.bind(this))}mergeConfig(e){return Object.assign(o,e)}do(e){const t=this.callbacks[e];"object"==typeof t&&t.forEach((e=>e.fn()))}on(e,t,n){const r="object"==typeof this.callbacks[e];if(r&&n){this.callbacks[e].find((e=>e.key==n))||this.callbacks[e].push({fn:t,key:n})}else r?this.callbacks[e].push({fn:t}):this.callbacks[e]=[{fn:t}]}playCheck(){const{ready:e,intersecting:t}=this.status;e&&(t?this.play():this.pause())}pause(){return n(this,void 0,void 0,(function*(){return!0}))}play(){return n(this,void 0,void 0,(function*(){return!0}))}mute(){return n(this,void 0,void 0,(function*(){}))}unmute(){return n(this,void 0,void 0,(function*(){}))}resize(){if("local"!=this.type){let e=null;if(e=this.wrapper?this.wrapper.querySelector("iframe"):this.iframe,!e)return void console.log("No iframe found.");if(e.removeAttribute("width"),e.removeAttribute("height"),"fit"==this.config.fillMode)return e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("width"),void e.style.removeProperty("height");const t={w:this.parent.clientWidth,h:this.parent.clientHeight,ratio:this.parent.clientHeight/this.parent.clientWidth};let n={w:t.w*this.config.zoom,h:t.h*this.config.zoom};const{aspectRatio:r}=this.props,{zoom:i}=this.config;t.ratio<r?(n.w=t.w*i,n.h=n.w/r):t.ratio>r?(n.h=t.h*i,n.w=n.h/r):(n.h=t.h,n.w=t.w),e.style.width=n.w+"px",e.style.height=n.h+"px",e.style.left=0-(n.w-t.w)/2+"px",e.style.top=0-(n.h-t.h)/2+"px"}}buildIntersectionObserver(){const e={threshold:this.config.threshold};this.observer=new IntersectionObserver(this.handleIntersection.bind(this),e),this.observer.observe(this.parent)}removeIntersectionObserver(){var e;null===(e=this.observer)||void 0===e||e.disconnect()}handleIntersection(e,t){e.forEach((e=>{e.target==this.parent&&(this.status.intersecting=e.isIntersecting,this.do("intersecting"))}))}}},717:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.VimeoPlayer=void 0;const i=n(539),o=n(963);class a extends o.default{constructor(e){super(e),this.type="vimeo",this.wrapper=this.parent.ownerDocument.createElement("div"),this.iframe=this.parent.ownerDocument.createElement("iframe"),this.source=this.config.source[0].url,this.build()}unbuild(){this.player&&(this.player.destroy(),this.player=void 0)}build(){if(this.player)return;this.setupWrapper(),this.player=new i.default(this.wrapper,{url:this.source,controls:!1,dnt:!0,loop:!0,muted:!0});const e=this;this.afterPlayerSetup().then((()=>{this.status.ready=!0,this.status.apiReady=!0,this.do("ready"),e.parent.status="ready"}))}setupWrapper(){this.wrapper.classList.add("vbg__video"),this.wrapper.classList.add("vbg--loading"),this.parent.append(this.wrapper)}afterPlayerSetup(){return r(this,void 0,void 0,(function*(){return this.player&&(this.config.loop&&this.player.on("timeupdate",(e=>{e.percent>.97&&this.player.setCurrentTime(this.config.startTime).then((()=>{this.player.play()}))})),this.props.aspectRatio=yield this.getAspectRatio(),this.resize()),!1}))}getAspectRatio(){return r(this,void 0,void 0,(function*(){const e=yield this.player.getVideoHeight(),t=yield this.player.getVideoWidth();return e&&t?e/t:.5625}))}getPlayState(){return r(this,void 0,void 0,(function*(){if(this.player){const e=yield this.player.getEnded(),t=yield this.player.getPaused();return(yield this.player.getCurrentTime())>0&&!e&&!t}return!1}))}get paused(){var e;return null!==(e=this.paused)&&void 0!==e&&e}set paused(e){}set muted(e){}get muted(){var e;return null===(e=this.muted)||void 0===e||e}get playing(){return this.getPlayState().then((e=>e)),!1}get aspectRatio(){return 1}get currentTime(){return 0}setPlayStatuses(){this.paused=!1,this.status.started=!0,this.status.playing=!0}play(){return r(this,void 0,void 0,(function*(){return this.player?(this.wrapper.classList.remove("vbg--loading"),1==this.status.started?this.player.play().then((()=>{this.setPlayStatuses()})):(this.player.ready().then((()=>{this.player.setCurrentTime(this.config.startTime).then((()=>{this.setPlayStatuses()}))})),this.player.ready().then((()=>{this.player.play().then((()=>{this.setPlayStatuses()}))}))),!0):(this.on("ready",this.play.bind(this),"playCheck"),!1)}))}pause(){return r(this,void 0,void 0,(function*(){return!(!this.player||!this.status.playing)&&(yield this.player.ready().then((()=>{this.player.pause(),this.paused=!0})),!0)}))}mute(){return r(this,void 0,void 0,(function*(){if(this.player)return yield this.player.setVolume(0),void(this.muted=!0)}))}unmute(){return r(this,void 0,void 0,(function*(){if(this.player)return yield this.player.setVolume(.7),void(this.muted=!1);this.on("ready",this.unmute.bind(this),"muteCheck")}))}}t.VimeoPlayer=a},520:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.YoutubePlayer=void 0;const i=n(751),o=n(905),a=n(963);class s extends a.default{constructor(e){super(e),this.type="youtube",this.id=(0,i.getVideoID)(e.source),this.wrapper=this.parent.ownerDocument.createElement("div");const t=this.parent.ownerDocument.createElement("div");this.wrapper.append(t),this.setupWrapper(),this.source=e.source[0].url,this.id&&(this.player=(0,o.default)(t,{playerVars:{autoplay:1,playsinline:0,modestbranding:1,rel:0,fs:0,start:this.config.startTime,controls:0,loop:1}}),this.player.loadVideoById(this.id),0!=this.props.muted&&this.player.mute(),this.build())}setupWrapper(){this.wrapper.classList.add("vbg__video"),this.wrapper.classList.add("vbg--loading"),this.parent.append(this.wrapper)}unbuild(){this.clearLoop(),this.player&&this.player.destroy()}build(){this.afterPlayerSetup().then((()=>{this.status.ready=!0,this.status.apiReady=!0,this.do("ready")}))}startPlayLoop(){this.looper=setInterval((()=>{this.player&&this.player.getDuration()>0?this.player.getCurrentTime()>=this.player.getDuration()-6&&this.player.seekTo(this.config.startTime,!1):this.clearLoop()}),3e3)}clearLoop(){this.looper&&clearInterval(this.looper)}afterPlayerSetup(){return r(this,void 0,void 0,(function*(){return this.player&&(this.iframe=this.player.getIframe(),this.player.seekTo(this.config.startTime,!0),this.getAspectRatio().then((e=>{this.props.aspectRatio=e,window.setTimeout(this.resize.bind(this),400)}))),this.parent.status="ready",!1}))}getAspectRatio(){return r(this,void 0,void 0,(function*(){try{const e=yield fetch(`https://noembed.com/embed?url=https://youtube.com/embed/${this.id}`,{}),t=yield e.json();return t&&t.height&&t.width?t.height/t.width:.5625}catch(e){return.5624}}))}get playing(){var e;return 1==(null===(e=this.player)||void 0===e?void 0:e.getPlayerState())}get buffering(){var e;return 3==(null===(e=this.player)||void 0===e?void 0:e.getPlayerState())}get aspectRatio(){return 1}get currentTime(){return 0}play(){return r(this,void 0,void 0,(function*(){return this.player?(this.wrapper?this.wrapper.classList.remove("vbg--loading"):this.parent.querySelector("iframe").classList.remove("vbg--loading"),0==this.status.started?this.player.playVideo():(this.player.playVideo(),this.status.started=!0),!0):(this.on("ready",this.play.bind(this),"playCheck"),!1)}))}pause(){return r(this,void 0,void 0,(function*(){return!!this.player&&(this.clearLoop(),this.player.pauseVideo(),!0)}))}get paused(){var e;return 2==(null===(e=this.player)||void 0===e?void 0:e.getPlayerState())}get muted(){var e;return null===(e=this.player)||void 0===e?void 0:e.isMuted()}mute(){return r(this,void 0,void 0,(function*(){this.player&&this.player.mute()}))}unmute(){return r(this,void 0,void 0,(function*(){if(this.player)return this.player.unMute();this.on("ready",this.unmute.bind(this),"muteCheck")}))}}t.YoutubePlayer=s},227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2),i=n(291),o=n(383),a=n(533),s={can:{unmute:!0,pause:!1},wrapper:document.body,onMuteUnmute:!1,onPausePlay:!1,initialState:{muted:!0,paused:!1}};t.default=class{constructor(e){this.config=Object.assign(s,e),this.parent=this.config.wrapper,this.state=this.config.initialState||{muted:!0,paused:!1},this.toggleMute=this.config.onMuteUnmute,this.togglePause=this.config.onPausePlay,this.wrapper=document.createElement("div"),this.init()}setupWrapper(){var e,t;this.wrapper.classList.add("vbg__icons"),(null===(e=this.config.can)||void 0===e?void 0:e.unmute)&&(this.muteUnmute=document.createElement("button"),this.muteUnmute.classList.add("icon-button","vbg__icon"),this.muteUnmute.addEventListener("click",this.handleMuteUnmuteClick.bind(this)),this.wrapper.append(this.muteUnmute)),(null===(t=this.config.can)||void 0===t?void 0:t.pause)&&(this.pausePlay=document.createElement("button"),this.pausePlay.classList.add("icon-button","vbg__icon"),this.pausePlay.addEventListener("click",this.handlePausePlay.bind(this)),this.wrapper.append(this.pausePlay)),this.parent.append(this.wrapper)}init(){this.setupWrapper(),this.handleStateChange()}updateState(e,t){return this.state[e]=t,this.handleStateChange()}handleStateChange(){var e,t;(null===(e=this.config.can)||void 0===e?void 0:e.unmute)&&this.muteUnmute&&this.syncMuteState(),(null===(t=this.config.can)||void 0===t?void 0:t.pause)&&this.pausePlay&&this.syncPauseState()}syncMuteState(){this.muteUnmute?this.state.muted?(this.muteUnmute.setAttribute("aria-label","Unmute Video"),this.muteUnmute.innerHTML=r.default):(this.muteUnmute.setAttribute("aria-label","Mute Video"),this.muteUnmute.innerHTML=i.default):console.error("Sometthing went wrong: Trying to sync mute button before button exists")}syncPauseState(){this.pausePlay?this.state.paused?(this.pausePlay.setAttribute("aria-label","Play Video"),this.pausePlay.innerHTML=a.default):(this.pausePlay.setAttribute("aria-label","Pause Video"),this.pausePlay.innerHTML=o.default):console.error("Sometthing went wrong: Trying to sync mute button before button exists")}handleMuteUnmuteClick(){this.state.muted=!this.state.muted,this.toggleMute&&this.toggleMute(),this.syncMuteState()}handlePausePlay(){this.state.paused=!this.state.paused,this.togglePause&&this.togglePause(),this.syncPauseState()}}},418:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{va