plyr.min-legacy.a0adaba2.js 120 KB

12
  1. !function(){var e=["premium","referrerPolicy"];function t(e,t){if(null==e)return{};var n,i,a=function(e,t){if(null==e)return{};var n,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function n(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,a,r=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(l){s=!0,a=l}finally{try{o||null==n.return||n.return()}finally{if(s)throw a}}return r}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}System.register([],(function(a){"use strict";return{execute:function(){function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f={addCSS:!0,thumbWidth:15,watch:!0};function g(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var y=function(e){return null!=e?e.constructor:null},b=function(e,t){return!!(e&&t&&e instanceof t)},v=function(e){return null==e},w=function(e){return y(e)===Object},k=function(e){return y(e)===String},T=function(e){return Array.isArray(e)},A=function(e){return b(e,NodeList)},C=k,S=T,E=A,P=function(e){return b(e,Element)},M=function(e){return b(e,Event)},x=function(e){return v(e)||(k(e)||T(e)||A(e))&&!e.length||w(e)&&!Object.keys(e).length};function N(e,t){if(1>t){var n=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}var I,L,O,_=function(){function e(t,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),P(t)?this.element=t:C(t)&&(this.element=document.querySelector(t)),P(this.element)&&x(this.element.rangeTouch)&&(this.config=p({},f,{},n),this.init())}return function(e,t,n){t&&c(e.prototype,t),n&&c(e,n)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,n=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[n](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!M(t))return null;var n,i=t.target,a=t.changedTouches[0],r=parseFloat(i.getAttribute("min"))||0,o=parseFloat(i.getAttribute("max"))||100,s=parseFloat(i.getAttribute("step"))||1,l=i.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(n=100/l.width*(a.clientX-l.left))?n=0:100<n&&(n=100),50>n?n-=(100-2*n)*c:50<n&&(n+=2*(n-50)*c),r+N(n/100*(o-r),s)}},{key:"set",value:function(t){e.enabled&&M(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var n=new Event(t,{bubbles:!0});e.dispatchEvent(n)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=null;if(x(t)||C(t)?i=Array.from(document.querySelectorAll(C(t)?t:'input[type="range"]')):P(t)?i=[t]:E(t)?i=Array.from(t):S(t)&&(i=t.filter(P)),x(i))return null;var a=p({},f,{},n);if(C(t)&&a.watch){var r=new MutationObserver((function(n){Array.from(n).forEach((function(n){Array.from(n.addedNodes).forEach((function(n){P(n)&&g(n,t)&&new e(n,a)}))}))}));r.observe(document.body,{childList:!0,subtree:!0})}return i.map((function(t){return new e(t,n)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}(),j=function(e){return null!=e?e.constructor:null},D=function(e,t){return Boolean(e&&t&&e instanceof t)},q=function(e){return null==e},H=function(e){return j(e)===Object},R=function(e){return j(e)===String},F=function(e){return"function"==typeof e},V=function(e){return Array.isArray(e)},B=function(e){return D(e,NodeList)},U=function(e){return q(e)||(R(e)||V(e)||B(e))&&!e.length||H(e)&&!Object.keys(e).length},W=q,z=H,K=function(e){return j(e)===Number&&!Number.isNaN(e)},Y=R,Q=function(e){return j(e)===Boolean},X=F,$=V,J=B,G=function(e){return null!==e&&"object"==h(e)&&1===e.nodeType&&"object"==h(e.style)&&"object"==h(e.ownerDocument)},Z=function(e){return D(e,Event)},ee=function(e){return D(e,KeyboardEvent)},te=function(e){return D(e,TextTrack)||!q(e)&&R(e.kind)},ne=function(e){return D(e,Promise)&&F(e.then)},ie=function(e){if(D(e,window.URL))return!0;if(!R(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!U(new URL(t).hostname)}catch(e){return!1}},ae=U,re=(I=document.createElement("span"),L={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},O=Object.keys(L).find((function(e){return void 0!==I.style[e]})),!!Y(O)&&L[O]);function oe(e,t){setTimeout((function(){try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}var se={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function le(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function ce(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];if(!n.length)return e;var a=n.shift();return z(a)?(Object.keys(a).forEach((function(t){z(a[t])?(Object.keys(e).includes(t)||Object.assign(e,d({},t,{})),ce(e[t],a[t])):Object.assign(e,d({},t,a[t]))})),ce.apply(void 0,[e].concat(n))):e}function ue(e,t){var n=e.length?e:[e];Array.from(n).reverse().forEach((function(e,n){var i=n>0?t.cloneNode(!0):t,a=e.parentNode,r=e.nextSibling;i.appendChild(e),r?a.insertBefore(i,r):a.appendChild(i)}))}function de(e,t){G(e)&&!ae(t)&&Object.entries(t).filter((function(e){var t=l(e,2)[1];return!W(t)})).forEach((function(t){var n=l(t,2),i=n[0],a=n[1];return e.setAttribute(i,a)}))}function he(e,t,n){var i=document.createElement(e);return z(t)&&de(i,t),Y(n)&&(i.innerText=n),i}function me(e,t,n,i){G(t)&&t.appendChild(he(e,n,i))}function pe(e){J(e)||$(e)?Array.from(e).forEach(pe):G(e)&&G(e.parentNode)&&e.parentNode.removeChild(e)}function fe(e){if(G(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function ge(e,t){return G(t)&&G(t.parentNode)&&G(e)?(t.parentNode.replaceChild(e,t),e):null}function ye(e,t){if(!Y(e)||ae(e))return{};var n={},i=ce({},t);return e.split(",").forEach((function(e){var t=e.trim(),a=t.replace(".",""),r=t.replace(/[[\]]/g,"").split("="),o=l(r,1)[0],s=r.length>1?r[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":Y(i.class)?n.class="".concat(i.class," ").concat(a):n.class=a;break;case"#":n.id=t.replace("#","");break;case"[":n[o]=s}})),ce(i,n)}function be(e,t){if(G(e)){var n=t;Q(n)||(n=!e.hidden),e.hidden=n}}function ve(e,t,n){if(J(e))return Array.from(e).map((function(e){return ve(e,t,n)}));if(G(e)){var i="toggle";return void 0!==n&&(i=n?"add":"remove"),e.classList[i](t),e.classList.contains(t)}return!1}function we(e,t){return G(e)&&e.classList.contains(t)}function ke(e,t){var n=Element.prototype;return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function Te(e){return this.elements.container.querySelectorAll(e)}function Ae(e){return this.elements.container.querySelector(e)}function Ce(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];G(e)&&(e.focus({preventScroll:!0}),t&&ve(e,this.config.classNames.tabFocus))}var Se={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Ee={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,n){var i=se.isIPhone&&n&&Ee.playsinline,a=Ee[e]||"html5"!==t;return{api:a,ui:a&&Ee.rangeInput&&("video"!==e||!se.isIPhone||i)}},pip:!(se.isIPhone||!X(he("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||he("video").disablePictureInPicture)),airplay:X(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(ae(e))return!1;var t=l(e.split("/"),1)[0],n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Se).includes(n)&&(n+='; codecs="'.concat(Se[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:function(){var e=document.createElement("input");return e.type="range","range"===e.type}(),touch:"ontouchstart"in document.documentElement,transitions:!1!==re,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Pe=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function Me(e,t,n){var i=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!ae(t)&&X(n)){var s=t.split(" "),l=o;Pe&&(l={passive:r,capture:o}),s.forEach((function(t){i&&i.eventListeners&&a&&i.eventListeners.push({element:e,type:t,callback:n,options:l}),e[a?"addEventListener":"removeEventListener"](t,n,l)}))}}function xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Me.call(this,e,t,n,!0,i,a)}function Ne(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Me.call(this,e,t,n,!1,i,a)}function Ie(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=function o(){for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];Ne(e,n,o,a,r),i.apply(t,l)};Me.call(this,e,n,o,!0,a,r)}function Le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(G(e)&&!ae(t)){var a=new CustomEvent(t,{bubbles:n,detail:s(s({},i),{},{plyr:this})});e.dispatchEvent(a)}}function Oe(){this&&this.eventListeners&&(this.eventListeners.forEach((function(e){var t=e.element,n=e.type,i=e.callback,a=e.options;t.removeEventListener(n,i,a)})),this.eventListeners=[])}function _e(){var e=this;return new Promise((function(t){return e.ready?setTimeout(t,0):xe.call(e,e.elements.container,"ready",t)})).then((function(){}))}function je(e){ne(e)&&e.then(null,(function(){}))}function De(e){return $(e)?e.filter((function(t,n){return e.indexOf(t)===n})):e}function qe(e,t){return $(e)&&e.length?e.reduce((function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e})):null}function He(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}var Re=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((function(e,t){var n=l(t,2),i=n[0],a=n[1];return s(s({},e),{},d({},i/a,[i,a]))}),{});function Fe(e){return!!($(e)||Y(e)&&e.includes(":"))&&($(e)?e:e.split(":")).map(Number).every(K)}function Ve(e){if(!$(e)||!e.every(K))return null;var t=l(e,2),n=t[0],i=t[1],a=function e(t,n){return 0===n?t:e(n,t%n)}(n,i);return[n/a,i/a]}function Be(e){var t=function(e){return Fe(e)?e.split(":").map(Number):null},n=t(e);if(null===n&&(n=t(this.config.ratio)),null===n&&!ae(this.embed)&&$(this.embed.ratio)&&(n=this.embed.ratio),null===n&&this.isHTML5){var i=this.media;n=[i.videoWidth,i.videoHeight]}return Ve(n)}function Ue(e){if(!this.isVideo)return{};var t=this.elements.wrapper,n=Be.call(this,e);if(!$(n))return{};var i=l(Ve(n),2),a=i[0],r=i[1],o=100/a*r;if(He("aspect-ratio: ".concat(a,"/").concat(r))?t.style.aspectRatio="".concat(a,"/").concat(r):t.style.paddingBottom="".concat(o,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var s=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),c=(s-o)/(s/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform="translateY(-".concat(c,"%)")}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:o,ratio:n}}function We(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.05,i=e/t,a=qe(Object.keys(Re),i);return Math.abs(a-i)<=n?Re[a]:[e,t]}var ze={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(t){var n=t.getAttribute("type");return!!ae(n)||Ee.mime.call(e,n)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:ze.getSources.call(this).map((function(e){return Number(e.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var e=this;e.options.speed=e.config.speed.options,ae(this.config.ratio)||Ue.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=ze.getSources.call(e).find((function(t){return t.getAttribute("src")===e.source}));return t&&Number(t.getAttribute("size"))},set:function(t){if(e.quality!==t){if(e.config.quality.forced&&X(e.config.quality.onChange))e.config.quality.onChange(t);else{var n=ze.getSources.call(e).find((function(e){return Number(e.getAttribute("size"))===t}));if(!n)return;var i=e.media,a=i.currentTime,r=i.paused,o=i.preload,s=i.readyState,l=i.playbackRate;e.media.src=n.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",(function(){e.speed=l,e.currentTime=a,r||je(e.play())})),e.media.load())}Le.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(pe(ze.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Ke(e){return"".concat(e,"-").concat(Math.floor(1e4*Math.random()))}function Ye(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return ae(e)?e:e.toString().replace(/{(\d+)}/g,(function(e,t){return n[t].toString()}))}var Qe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),n.toString())},Xe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.toString().replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}))};function $e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.toString();return t=Qe(t,"-"," "),t=Qe(t,"_"," "),t=Xe(t),Qe(t," ","")}function Je(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var Ge={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ae(e)||ae(t))return"";var n=le(t.i18n,e);if(ae(n))return Object.keys(Ge).includes(e)?Ge[e]:"";var i={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(i).forEach((function(e){var t=l(e,2),i=t[0],a=t[1];n=Qe(n,i,a)})),n},et=function(){function e(t){var n=this;i(this,e),o(this,"get",(function(t){if(!e.supported||!n.enabled)return null;var i=window.localStorage.getItem(n.key);if(ae(i))return null;var a=JSON.parse(i);return Y(t)&&t.length?a[t]:a})),o(this,"set",(function(t){if(e.supported&&n.enabled&&z(t)){var i=n.get();ae(i)&&(i={}),ce(i,t);try{window.localStorage.setItem(n.key,JSON.stringify(i))}catch(t){}}})),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return r(e,null,[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;var e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}]),e}();function tt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(n,i){try{var a=new XMLHttpRequest;if(!("withCredentials"in a))return;a.addEventListener("load",(function(){if("text"===t)try{n(JSON.parse(a.responseText))}catch(e){n(a.responseText)}else n(a.response)})),a.addEventListener("error",(function(){throw new Error(a.status)})),a.open("GET",e,!0),a.responseType=t,a.send()}catch(e){i(e)}}))}function nt(e,t){if(Y(e)){var n=Y(t),i=function(){return null!==document.getElementById(t)},a=function(e,t){e.innerHTML=t,n&&i()||document.body.insertAdjacentElement("afterbegin",e)};if(!n||!i()){var r=et.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),n&&o.setAttribute("id",t),r){var s=window.localStorage.getItem("cache-".concat(t));if(null!==s){var l=JSON.parse(s);a(o,l.content)}}tt(e).then((function(e){if(!ae(e)){if(r)try{window.localStorage.setItem("cache-".concat(t),JSON.stringify({content:e}))}catch(e){}a(o,e)}})).catch((function(){}))}}}var it=function(e){return Math.trunc(e/60/60%60,10)},at=function(e){return Math.trunc(e%60,10)};function rt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!K(e))return rt(void 0,t,n);var i,a=function(e){return"0".concat(e).slice(-2)},r=it(e),o=(i=e,Math.trunc(i/60%60,10)),s=at(e);return r=t||r>0?"".concat(r,":"):"","".concat(n&&e>0?"-":"").concat(r).concat(a(o),":").concat(a(s))}var ot={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,n=e.host!==t||se.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:n}},findElements:function(){try{return this.elements.controls=Ae.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Te.call(this,this.config.selectors.buttons.play),pause:Ae.call(this,this.config.selectors.buttons.pause),restart:Ae.call(this,this.config.selectors.buttons.restart),rewind:Ae.call(this,this.config.selectors.buttons.rewind),fastForward:Ae.call(this,this.config.selectors.buttons.fastForward),mute:Ae.call(this,this.config.selectors.buttons.mute),pip:Ae.call(this,this.config.selectors.buttons.pip),airplay:Ae.call(this,this.config.selectors.buttons.airplay),settings:Ae.call(this,this.config.selectors.buttons.settings),captions:Ae.call(this,this.config.selectors.buttons.captions),fullscreen:Ae.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Ae.call(this,this.config.selectors.progress),this.elements.inputs={seek:Ae.call(this,this.config.selectors.inputs.seek),volume:Ae.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Ae.call(this,this.config.selectors.display.buffer),currentTime:Ae.call(this,this.config.selectors.display.currentTime),duration:Ae.call(this,this.config.selectors.display.duration)},G(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(I){return this.debug.warn("It looks like there is a problem with your custom controls HTML",I),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var n="http://www.w3.org/2000/svg",i=ot.getIconUrl.call(this),a="".concat(i.cors?"":i.url,"#").concat(this.config.iconPrefix),r=document.createElementNS(n,"svg");de(r,ce(t,{"aria-hidden":"true",focusable:"false"}));var o=document.createElementNS(n,"use"),s="".concat(a,"-").concat(e);return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",s),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),r.appendChild(o),r},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Ze(e,this.config);return he("span",s(s({},t),{},{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),n)},createBadge:function(e){if(ae(e))return null;var t=he("span",{class:this.config.classNames.menu.value});return t.appendChild(he("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var n=this,i=ce({},t),a=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(e=$e(e)).charAt(0).toLowerCase()+e.slice(1)}(e),r={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(e){Object.keys(i).includes(e)&&(r[e]=i[e],delete i[e])})),"button"!==r.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((function(e){return e===n.config.classNames.control}))||ce(i,{class:"".concat(i.class," ").concat(this.config.classNames.control)}):i.class=this.config.classNames.control,e){case"play":r.toggle=!0,r.label="play",r.labelPressed="pause",r.icon="play",r.iconPressed="pause";break;case"mute":r.toggle=!0,r.label="mute",r.labelPressed="unmute",r.icon="volume",r.iconPressed="muted";break;case"captions":r.toggle=!0,r.label="enableCaptions",r.labelPressed="disableCaptions",r.icon="captions-off",r.iconPressed="captions-on";break;case"fullscreen":r.toggle=!0,r.label="enterFullscreen",r.labelPressed="exitFullscreen",r.icon="enter-fullscreen",r.iconPressed="exit-fullscreen";break;case"play-large":i.class+=" ".concat(this.config.classNames.control,"--overlaid"),a="play",r.label="play",r.icon="play";break;default:ae(r.label)&&(r.label=a),ae(r.icon)&&(r.icon=e)}var o=he(r.element);return r.toggle?(o.appendChild(ot.createIcon.call(this,r.iconPressed,{class:"icon--pressed"})),o.appendChild(ot.createIcon.call(this,r.icon,{class:"icon--not-pressed"})),o.appendChild(ot.createLabel.call(this,r.labelPressed,{class:"label--pressed"})),o.appendChild(ot.createLabel.call(this,r.label,{class:"label--not-pressed"}))):(o.appendChild(ot.createIcon.call(this,r.icon)),o.appendChild(ot.createLabel.call(this,r.label))),ce(i,ye(this.config.selectors.buttons[a],i)),de(o,i),"play"===a?($(this.elements.buttons[a])||(this.elements.buttons[a]=[]),this.elements.buttons[a].push(o)):this.elements.buttons[a]=o,o},createRange:function(e,t){var n=he("input",ce(ye(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Ze(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,ot.updateRangeFill.call(this,n),_.setup(n),n},createProgress:function(e,t){var n=he("progress",ce(ye(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){n.appendChild(he("span",null,"0"));var i={played:"played",buffer:"buffered"}[e],a=i?Ze(i,this.config):"";n.innerText="% ".concat(a.toLowerCase())}return this.elements.display[e]=n,n},createTime:function(e,t){var n=ye(this.config.selectors.display[e],t),i=he("div",ce(n,{class:"".concat(n.class?n.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":Ze(e,this.config)}),"00:00");return this.elements.display[e]=i,i},bindMenuItemShortcuts:function(e,t){var n=this;xe.call(this,e,"keydown keyup",(function(i){if(["Space","ArrowUp","ArrowDown","ArrowRight"].includes(i.key)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var a,r=ke(e,'[role="menuitemradio"]');if(!r&&["Space","ArrowRight"].includes(i.key))ot.showMenuPanel.call(n,t,!0);else"Space"!==i.key&&("ArrowDown"===i.key||r&&"ArrowRight"===i.key?(a=e.nextElementSibling,G(a)||(a=e.parentNode.firstElementChild)):(a=e.previousElementSibling,G(a)||(a=e.parentNode.lastElementChild)),Ce.call(n,a,!0))}}),!1),xe.call(this,e,"keyup",(function(e){"Return"===e.key&&ot.focusFirstMenuItem.call(n,null,!0)}))},createMenuItem:function(e){var t=this,n=e.value,i=e.list,a=e.type,r=e.title,o=e.badge,s=void 0===o?null:o,l=e.checked,c=void 0!==l&&l,u=ye(this.config.selectors.inputs[a]),d=he("button",ce(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":c,value:n})),h=he("span");h.innerHTML=r,G(s)&&h.appendChild(s),d.appendChild(h),Object.defineProperty(d,"checked",{enumerable:!0,get:function(){return"true"===d.getAttribute("aria-checked")},set:function(e){e&&Array.from(d.parentNode.children).filter((function(e){return ke(e,'[role="menuitemradio"]')})).forEach((function(e){return e.setAttribute("aria-checked","false")})),d.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(d,"click keyup",(function(e){if(!ee(e)||"Space"===e.key){switch(e.preventDefault(),e.stopPropagation(),d.checked=!0,a){case"language":t.currentTrack=Number(n);break;case"quality":t.quality=n;break;case"speed":t.speed=parseFloat(n)}ot.showMenuPanel.call(t,"home",ee(e))}}),a,!1),ot.bindMenuItemShortcuts.call(this,d,a),i.appendChild(d)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return K(e)?rt(e,it(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];G(e)&&K(t)&&(e.innerText=ot.formatTime(t,n))},updateVolume:function(){this.supported.ui&&(G(this.elements.inputs.volume)&&ot.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),G(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;G(e)&&(e.value=t,ot.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&Z(e)){var n=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=function(e,t){return 0===e||0===t||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}(this.currentTime,this.duration),"timeupdate"===e.type&&ot.setRange.call(this,this.elements.inputs.seek,n);break;case"playing":case"progress":!function(e,n){var i=K(n)?n:0,a=G(e)?e:t.elements.display.buffer;if(G(a)){a.value=i;var r=a.getElementsByTagName("span")[0];G(r)&&(r.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=Z(e)?e.target:e;if(G(t)&&"range"===t.getAttribute("type")){if(ke(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var n=ot.formatTime(this.currentTime),i=ot.formatTime(this.duration),a=Ze("seekLabel",this.config);t.setAttribute("aria-valuetext",a.replace("{currentTime}",n).replace("{duration}",i))}else if(ke(t,this.config.selectors.inputs.volume)){var r=100*t.value;t.setAttribute("aria-valuenow",r),t.setAttribute("aria-valuetext","".concat(r.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);se.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip:function(e){var t,n;if(this.config.tooltips.seek&&G(this.elements.inputs.seek)&&G(this.elements.display.seekTooltip)&&0!==this.duration){var i=this.elements.display.seekTooltip,a="".concat(this.config.classNames.tooltip,"--visible"),r=function(e){return ve(i,a,e)};if(this.touch)r(!1);else{var o=0,s=this.elements.progress.getBoundingClientRect();if(Z(e))o=100/s.width*(e.pageX-s.left);else{if(!we(i,a))return;o=parseFloat(i.style.left,10)}o<0?o=0:o>100&&(o=100);var l=this.duration/100*o;i.innerText=ot.formatTime(l);var c=null===(t=this.config.markers)||void 0===t||null===(n=t.points)||void 0===n?void 0:n.find((function(e){return e.time===Math.round(l)}));c&&i.insertAdjacentHTML("afterbegin","".concat(c.label,"<br>")),i.style.left="".concat(o,"%"),Z(e)&&["mouseenter","mouseleave"].includes(e.type)&&r("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!G(this.elements.display.duration)&&this.config.invertTime;ot.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||ot.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return be(this.elements.display.currentTime,!0),void be(this.elements.progress,!0);G(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=G(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&ot.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&ot.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&ot.setMarkers.call(this),ot.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){be(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,n){var i=this.elements.settings.panels[e],a=null,r=t;if("captions"===e)a=this.currentTrack;else{if(a=ae(n)?this[e]:n,ae(a)&&(a=this.config[e].default),!ae(this.options[e])&&!this.options[e].includes(a))return void this.debug.warn("Unsupported value of '".concat(a,"' for ").concat(e));if(!this.config[e].options.includes(a))return void this.debug.warn("Disabled value of '".concat(a,"' for ").concat(e))}if(G(r)||(r=i&&i.querySelector('[role="menu"]')),G(r)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=ot.getLabel.call(this,e,a);var o=r&&r.querySelector('[value="'.concat(a,'"]'));G(o)&&(o.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?Ze("normal",this.config):"".concat(t,"&times;");case"quality":if(K(t)){var n=Ze("qualityLabel.".concat(t),this.config);return n.length?n:"".concat(t,"p")}return Xe(t);case"captions":return ct.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(G(this.elements.settings.panels.quality)){var n="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');$(e)&&(this.options.quality=De(e).filter((function(e){return t.config.quality.options.includes(e)})));var a=!ae(this.options.quality)&&this.options.quality.length>1;if(ot.toggleMenuButton.call(this,n,a),fe(i),ot.checkMenu.call(this),a){var r=function(e){var n=Ze("qualityBadge.".concat(e),t.config);return n.length?ot.createBadge.call(t,n):null};this.options.quality.sort((function(e,n){var i=t.config.quality.options;return i.indexOf(e)>i.indexOf(n)?1:-1})).forEach((function(e){ot.createMenuItem.call(t,{value:e,list:i,type:n,title:ot.getLabel.call(t,"quality",e),badge:r(e)})})),ot.updateSetting.call(this,n,i)}}},setCaptionsMenu:function(){var e=this;if(G(this.elements.settings.panels.captions)){var t="captions",n=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=ct.getTracks.call(this),a=Boolean(i.length);if(ot.toggleMenuButton.call(this,t,a),fe(n),ot.checkMenu.call(this),a){var r=i.map((function(t,i){return{value:i,checked:e.captions.toggled&&e.currentTrack===i,title:ct.getLabel.call(e,t),badge:t.language&&ot.createBadge.call(e,t.language.toUpperCase()),list:n,type:"language"}}));r.unshift({value:-1,checked:!this.captions.toggled,title:Ze("disabled",this.config),list:n,type:"language"}),r.forEach(ot.createMenuItem.bind(this)),ot.updateSetting.call(this,t,n)}}},setSpeedMenu:function(){var e=this;if(G(this.elements.settings.panels.speed)){var t="speed",n=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(t){return t>=e.minimumSpeed&&t<=e.maximumSpeed}));var i=!ae(this.options.speed)&&this.options.speed.length>1;ot.toggleMenuButton.call(this,t,i),fe(n),ot.checkMenu.call(this),i&&(this.options.speed.forEach((function(i){ot.createMenuItem.call(e,{value:i,list:n,type:t,title:ot.getLabel.call(e,"speed",i)})})),ot.updateSetting.call(this,t,n))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!ae(e)&&Object.values(e).some((function(e){return!e.hidden}));be(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var n=e;G(n)||(n=Object.values(this.elements.settings.panels).find((function(e){return!e.hidden})));var i=n.querySelector('[role^="menuitem"]');Ce.call(this,i,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,n=this.elements.buttons.settings;if(G(t)&&G(n)){var i=t.hidden,a=i;if(Q(e))a=e;else if(ee(e)&&"Escape"===e.key)a=!1;else if(Z(e)){var r=X(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(r);if(o||!o&&e.target!==n&&a)return}n.setAttribute("aria-expanded",a),be(t,!a),ve(this.elements.container,this.config.classNames.menu.open,a),a&&ee(e)?ot.focusFirstMenuItem.call(this,null,!0):a||i||Ce.call(this,n,ee(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var n=t.scrollWidth,i=t.scrollHeight;return pe(t),{width:n,height:i}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(t));if(G(i)){var a=i.parentNode,r=Array.from(a.children).find((function(e){return!e.hidden}));if(Ee.transitions&&!Ee.reducedMotion){a.style.width="".concat(r.scrollWidth,"px"),a.style.height="".concat(r.scrollHeight,"px");var o=ot.getMenuSize.call(this,i),s=function t(n){n.target===a&&["width","height"].includes(n.propertyName)&&(a.style.width="",a.style.height="",Ne.call(e,a,re,t))};xe.call(this,a,re,s),a.style.width="".concat(o.width,"px"),a.style.height="".concat(o.height,"px")}be(r,!0),be(i,!1),ot.focusFirstMenuItem.call(this,i,n)}},setDownloadUrl:function(){var e=this.elements.buttons.download;G(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,n=ot.bindMenuItemShortcuts,i=ot.createButton,a=ot.createProgress,r=ot.createRange,o=ot.createTime,s=ot.setQualityMenu,l=ot.setSpeedMenu,c=ot.showMenuPanel;this.elements.controls=null,$(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));var u=he("div",ye(this.config.selectors.controls.wrapper));this.elements.controls=u;var d={class:"plyr__controls__item"};return De($(this.config.controls)?this.config.controls:[]).forEach((function(s){if("restart"===s&&u.appendChild(i.call(t,"restart",d)),"rewind"===s&&u.appendChild(i.call(t,"rewind",d)),"play"===s&&u.appendChild(i.call(t,"play",d)),"fast-forward"===s&&u.appendChild(i.call(t,"fast-forward",d)),"progress"===s){var l=he("div",{class:"".concat(d.class," plyr__progress__container")}),h=he("div",ye(t.config.selectors.progress));if(h.appendChild(r.call(t,"seek",{id:"plyr-seek-".concat(e.id)})),h.appendChild(a.call(t,"buffer")),t.config.tooltips.seek){var m=he("span",{class:t.config.classNames.tooltip},"00:00");h.appendChild(m),t.elements.display.seekTooltip=m}t.elements.progress=h,l.appendChild(t.elements.progress),u.appendChild(l)}if("current-time"===s&&u.appendChild(o.call(t,"currentTime",d)),"duration"===s&&u.appendChild(o.call(t,"duration",d)),"mute"===s||"volume"===s){var p=t.elements.volume;if(G(p)&&u.contains(p)||(p=he("div",ce({},d,{class:"".concat(d.class," plyr__volume").trim()})),t.elements.volume=p,u.appendChild(p)),"mute"===s&&p.appendChild(i.call(t,"mute")),"volume"===s&&!se.isIos){var f={max:1,step:.05,value:t.config.volume};p.appendChild(r.call(t,"volume",ce(f,{id:"plyr-volume-".concat(e.id)})))}}if("captions"===s&&u.appendChild(i.call(t,"captions",d)),"settings"===s&&!ae(t.config.settings)){var g=he("div",ce({},d,{class:"".concat(d.class," plyr__menu").trim(),hidden:""}));g.appendChild(i.call(t,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var y=he("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),b=he("div"),v=he("div",{id:"plyr-settings-".concat(e.id,"-home")}),w=he("div",{role:"menu"});v.appendChild(w),b.appendChild(v),t.elements.settings.panels.home=v,t.config.settings.forEach((function(i){var a=he("button",ce(ye(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));n.call(t,a,i),xe.call(t,a,"click",(function(){c.call(t,i,!1)}));var r=he("span",null,Ze(i,t.config)),o=he("span",{class:t.config.classNames.menu.value});o.innerHTML=e[i],r.appendChild(o),a.appendChild(r),w.appendChild(a);var s=he("div",{id:"plyr-settings-".concat(e.id,"-").concat(i),hidden:""}),l=he("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});l.appendChild(he("span",{"aria-hidden":!0},Ze(i,t.config))),l.appendChild(he("span",{class:t.config.classNames.hidden},Ze("menuBack",t.config))),xe.call(t,s,"keydown",(function(e){"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),c.call(t,"home",!0))}),!1),xe.call(t,l,"click",(function(){c.call(t,"home",!1)})),s.appendChild(l),s.appendChild(he("div",{role:"menu"})),b.appendChild(s),t.elements.settings.buttons[i]=a,t.elements.settings.panels[i]=s})),y.appendChild(b),g.appendChild(y),u.appendChild(g),t.elements.settings.popup=y,t.elements.settings.menu=g}if("pip"===s&&Ee.pip&&u.appendChild(i.call(t,"pip",d)),"airplay"===s&&Ee.airplay&&u.appendChild(i.call(t,"airplay",d)),"download"===s){var k=ce({},d,{element:"a",href:t.download,target:"_blank"});t.isHTML5&&(k.download="");var T=t.config.urls.download;!ie(T)&&t.isEmbed&&ce(k,{icon:"logo-".concat(t.provider),label:t.provider}),u.appendChild(i.call(t,"download",k))}"fullscreen"===s&&u.appendChild(i.call(t,"fullscreen",d))})),this.isHTML5&&s.call(this,ze.getQualityOptions.call(this)),l.call(this),u},inject:function(){var e=this;if(this.config.loadSprite){var t=ot.getIconUrl.call(this);t.cors&&nt(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var n=null;this.elements.controls=null;var i,a={id:this.id,seektime:this.config.seekTime,title:this.config.title},r=!0;if(X(this.config.controls)&&(this.config.controls=this.config.controls.call(this,a)),this.config.controls||(this.config.controls=[]),G(this.config.controls)||Y(this.config.controls)?n=this.config.controls:(n=ot.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:ct.getLabel.call(this)}),r=!1),r&&Y(this.config.controls)&&(n=function(e){var t=e;return Object.entries(a).forEach((function(e){var n=l(e,2),i=n[0],a=n[1];t=Qe(t,"{".concat(i,"}"),a)})),t}(n)),Y(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),G(i)||(i=this.elements.container),i[G(n)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",n),G(this.elements.controls)||ot.findElements.call(this),!ae(this.elements.buttons)){var o=function(t){var n=e.config.classNames.controlPressed;t.setAttribute("aria-pressed","false"),Object.defineProperty(t,"pressed",{configurable:!0,enumerable:!0,get:function(){return we(t,n)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ve(t,n,e),t.setAttribute("aria-pressed",e?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(e){$(e)||J(e)?Array.from(e).filter(Boolean).forEach(o):o(e)}))}if(se.isEdge&&oe(i),this.config.tooltips.controls){var s=this.config,c=s.classNames,u=s.selectors,d="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(c.hidden),h=Te.call(this,d);Array.from(h).forEach((function(t){ve(t,e.config.classNames.hidden,!1),ve(t,e.config.classNames.tooltip,!0)}))}},setMediaMetadata:function(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(I){}},setMarkers:function(){var e,t,n=this;if(this.duration&&!this.elements.markers){var i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((function(e){var t=e.time;return t>0&&t<n.duration}));if(null!=i&&i.length){var a=document.createDocumentFragment(),r=document.createDocumentFragment(),o=null,s="".concat(this.config.classNames.tooltip,"--visible"),l=function(e){return ve(o,s,e)};i.forEach((function(e){var t=he("span",{class:n.config.classNames.marker},""),i=e.time/n.duration*100+"%";o&&(t.addEventListener("mouseenter",(function(){e.label||(o.style.left=i,o.innerHTML=e.label,l(!0))})),t.addEventListener("mouseleave",(function(){l(!1)}))),t.addEventListener("click",(function(){n.currentTime=e.time})),t.style.left=i,r.appendChild(t)})),a.appendChild(r),this.config.tooltips.seek||(o=he("span",{class:this.config.classNames.tooltip},""),a.appendChild(o)),this.elements.markers={points:r,tip:o},this.elements.progress.appendChild(a)}}}};function st(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e;if(t){var i=document.createElement("a");i.href=n,n=i.href}try{return new URL(n)}catch(e){return null}}function lt(e){var t=new URLSearchParams;return z(e)&&Object.entries(e).forEach((function(e){var n=l(e,2),i=n[0],a=n[1];t.set(i,a)})),t}var ct={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!Ee.textTracks)$(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&ot.setCaptionsMenu.call(this);else{if(G(this.elements.captions)||(this.elements.captions=he("div",ye(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),function(e,t){G(e)&&G(t)&&t.parentNode.insertBefore(e,t.nextSibling)}(this.elements.captions,this.elements.wrapper)),se.isIE&&window.URL){var e=this.media.querySelectorAll("track");Array.from(e).forEach((function(e){var t=e.getAttribute("src"),n=st(t);null!==n&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&tt(t,"blob").then((function(t){e.setAttribute("src",window.URL.createObjectURL(t))})).catch((function(){pe(e)}))}))}var t=De((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(e){return e.split("-")[0]}))),n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===n&&(n=l(t,1)[0]);var i=this.storage.get("captions");if(Q(i)||(i=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:i,language:n,languages:t}),this.isHTML5){var a=this.config.captions.update?"addtrack removetrack":"removetrack";xe.call(this,this.media.textTracks,a,ct.update.bind(this))}setTimeout(ct.update.bind(this),0)}},update:function(){var e=this,t=ct.getTracks.call(this,!0),n=this.captions,i=n.active,a=n.language,r=n.meta,o=n.currentTrackNode,s=Boolean(t.find((function(e){return e.language===a})));this.isHTML5&&this.isVideo&&t.filter((function(e){return!r.get(e)})).forEach((function(t){e.debug.log("Track added",t),r.set(t,{default:"showing"===t.mode}),"showing"===t.mode&&(t.mode="hidden"),xe.call(e,t,"cuechange",(function(){return ct.updateCues.call(e)}))})),(s&&this.language!==a||!t.includes(o))&&(ct.setLanguage.call(this,a),ct.toggle.call(this,i&&s)),this.elements&&ve(this.elements.container,this.config.classNames.captions.enabled,!ae(t)),$(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&ot.setCaptionsMenu.call(this)},toggle:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var a=this.captions.toggled,r=this.config.classNames.captions.active,o=W(e)?!a:e;if(o!==a){if(i||(this.captions.active=o,this.storage.set({captions:o})),!this.language&&o&&!i){var s=ct.getTracks.call(this),l=ct.findTrack.call(this,[this.captions.language].concat(n(this.captions.languages)),!0);return this.captions.language=l.language,void ct.set.call(this,s.indexOf(l))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=o),ve(this.elements.container,r,o),this.captions.toggled=o,ot.updateSetting.call(this,"captions"),Le.call(this,this.media,o?"captionsenabled":"captionsdisabled")}setTimeout((function(){o&&t.captions.toggled&&(t.captions.currentTrackNode.mode="hidden")}))}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=ct.getTracks.call(this);if(-1!==e)if(K(e))if(e in n){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var i=n[e],a=i||{},r=a.language;this.captions.currentTrackNode=i,ot.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),Le.call(this,this.media,"languagechange")}ct.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&ct.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else ct.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Y(e)){var n=e.toLowerCase();this.captions.language=n;var i=ct.getTracks.call(this),a=ct.findTrack.call(this,[n]);ct.set.call(this,i.indexOf(a),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter((function(n){return!e.isHTML5||t||e.captions.meta.has(n)})).filter((function(e){return["captions","subtitles"].includes(e.kind)}))},findTrack:function(e){var t,n=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=ct.getTracks.call(this),r=function(e){return Number((n.captions.meta.get(e)||{}).default)},o=Array.from(a).sort((function(e,t){return r(t)-r(e)}));return e.every((function(e){return t=o.find((function(t){return t.language===e})),!t})),t||(i?o[0]:void 0)},getCurrentTrack:function(){return ct.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!te(t)&&Ee.textTracks&&this.captions.toggled&&(t=ct.getCurrentTrack.call(this)),te(t)?ae(t.label)?ae(t.language)?Ze("enabled",this.config):e.language.toUpperCase():t.label:Ze("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(G(this.elements.captions))if(W(e)||Array.isArray(e)){var t=e;if(!t){var n=ct.getCurrentTrack.call(this);t=Array.from((n||{}).activeCues||[]).map((function(e){return e.getCueAsHTML()})).map(Je)}var i=t.map((function(e){return e.trim()})).join("\n");if(i!==this.elements.captions.innerHTML){fe(this.elements.captions);var a=he("span",ye(this.config.selectors.caption));a.innerHTML=i,this.elements.captions.appendChild(a),Le.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},ut={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},dt="picture-in-picture",ht="inline",mt={html5:"html5",youtube:"youtube",vimeo:"vimeo"},pt="audio",ft="video";var gt=function(){},yt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];i(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return r(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):gt}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):gt}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):gt}}]),e}(),bt=function(){function e(t){var n=this;i(this,e),o(this,"onChange",(function(){if(n.enabled){var e=n.player.elements.buttons.fullscreen;G(e)&&(e.pressed=n.active);var t=n.target===n.player.media?n.target:n.player.elements.container;Le.call(n.player,t,n.active?"enterfullscreen":"exitfullscreen",!0)}})),o(this,"toggleFallback",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e?n.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(n.scrollPosition.x,n.scrollPosition.y),document.body.style.overflow=e?"hidden":"",ve(n.target,n.player.config.classNames.fullscreen.fallback,e),se.isIos){var t=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";t||(t=document.createElement("meta")).setAttribute("name","viewport");var a=Y(t.content)&&t.content.includes(i);e?(n.cleanupViewport=!a,a||(t.content+=",".concat(i))):n.cleanupViewport&&(t.content=t.content.split(",").filter((function(e){return e.trim()!==i})).join(","))}n.onChange()})),o(this,"trapFocus",(function(e){if(!se.isIos&&n.active&&"Tab"===e.key){var t=document.activeElement,i=Te.call(n.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),a=l(i,1)[0],r=i[i.length-1];t!==r||e.shiftKey?t===a&&e.shiftKey&&(r.focus(),e.preventDefault()):(a.focus(),e.preventDefault())}})),o(this,"update",(function(){var t;n.enabled?(t=n.forceFallback?"Fallback (forced)":e.native?"Native":"Fallback",n.player.debug.log("".concat(t," fullscreen enabled"))):n.player.debug.log("Fullscreen not supported and fallback disabled");ve(n.player.elements.container,n.player.config.classNames.fullscreen.enabled,n.enabled)})),o(this,"enter",(function(){n.enabled&&(se.isIos&&n.player.config.fullscreen.iosNative?n.player.isVimeo?n.player.embed.requestFullscreen():n.target.webkitEnterFullscreen():!e.native||n.forceFallback?n.toggleFallback(!0):n.prefix?ae(n.prefix)||n.target["".concat(n.prefix,"Request").concat(n.property)]():n.target.requestFullscreen({navigationUI:"hide"}))})),o(this,"exit",(function(){if(n.enabled)if(se.isIos&&n.player.config.fullscreen.iosNative)n.target.webkitExitFullscreen(),je(n.player.play());else if(!e.native||n.forceFallback)n.toggleFallback(!1);else if(n.prefix){if(!ae(n.prefix)){var t="moz"===n.prefix?"Cancel":"Exit";document["".concat(n.prefix).concat(t).concat(n.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),o(this,"toggle",(function(){n.active?n.exit():n.enter()})),this.player=t,this.prefix=e.prefix,this.property=e.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){return(Element.prototype.closest||function(){var e=this;do{if(ke.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),xe.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){n.onChange()})),xe.call(this.player,this.player.elements.container,"dblclick",(function(e){G(n.player.elements.controls)&&n.player.elements.controls.contains(e.target)||n.player.listeners.proxy(e,n.toggle,"fullscreen")})),xe.call(this,this.player.elements.container,"keydown",(function(e){return n.trapFocus(e)})),this.update()}return r(e,[{key:"usingNative",get:function(){return e.native&&!this.forceFallback}},{key:"enabled",get:function(){return(e.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!e.native||this.forceFallback)return we(this.target,this.player.config.classNames.fullscreen.fallback);var t=this.prefix?this.target.getRootNode()["".concat(this.prefix).concat(this.property,"Element")]:this.target.getRootNode().fullscreenElement;return t&&t.shadowRoot?t===this.target.getRootNode().host:t===this.target}},{key:"target",get:function(){return se.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(X(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some((function(t){return!(!X(document["".concat(t,"ExitFullscreen")])&&!X(document["".concat(t,"CancelFullScreen")])||(e=t,0))})),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),e}();function vt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(n,i){var a=new Image,r=function(){delete a.onload,delete a.onerror,(a.naturalWidth>=t?n:i)(a)};Object.assign(a,{onload:r,onerror:r,src:e})}))}var wt={addStyleHook:function(){ve(this.elements.container,this.config.selectors.container.replace(".",""),!0),ve(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void wt.toggleNativeControls.call(this,!0);G(this.elements.controls)||(ot.inject.call(this),this.listeners.controls()),wt.toggleNativeControls.call(this),this.isHTML5&&ct.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,ot.updateVolume.call(this),ot.timeUpdate.call(this),ot.durationUpdate.call(this),wt.checkPlaying.call(this),ve(this.elements.container,this.config.classNames.pip.supported,Ee.pip&&this.isHTML5&&this.isVideo),ve(this.elements.container,this.config.classNames.airplay.supported,Ee.airplay&&this.isHTML5),ve(this.elements.container,this.config.classNames.isIos,se.isIos),ve(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){Le.call(e,e.media,"ready")}),0),wt.setTitle.call(this),this.poster&&wt.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&ot.durationUpdate.call(this),this.config.mediaMetadata&&ot.setMediaMetadata.call(this)},setTitle:function(){var e=Ze("play",this.config);if(Y(this.config.title)&&!ae(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(t){t.setAttribute("aria-label",e)})),this.isEmbed){var t=Ae.call(this,"iframe");if(!G(t))return;var n=ae(this.config.title)?"video":this.config.title,i=Ze("frameTitle",this.config);t.setAttribute("title",i.replace("{title}",n))}},togglePoster:function(e){ve(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),_e.call(this).then((function(){return vt(e)})).catch((function(n){throw e===t.poster&&wt.togglePoster.call(t,!1),n})).then((function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),wt.togglePoster.call(t,!0),e})))},checkPlaying:function(e){var t=this;ve(this.elements.container,this.config.classNames.playing,this.playing),ve(this.elements.container,this.config.classNames.paused,this.paused),ve(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(e){Object.assign(e,{pressed:t.playing}),e.setAttribute("aria-label",Ze(t.playing?"pause":"play",t.config))})),Z(e)&&"timeupdate"===e.type||wt.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){ve(t.elements.container,t.config.classNames.loading,t.loading),wt.toggleControls.call(t)}),this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||n))}},migrateStyles:function(){var e=this;Object.values(s({},this.media.style)).filter((function(e){return!ae(e)&&Y(e)&&e.startsWith("--plyr")})).forEach((function(t){e.elements.container.style.setProperty(t,e.media.style.getPropertyValue(t)),e.media.style.removeProperty(t)})),ae(this.media.style)&&this.media.removeAttribute("style")}},kt=function(){function e(t){var n=this;i(this,e),o(this,"firstTouch",(function(){var e=n.player,t=e.elements;e.touch=!0,ve(t.container,e.config.classNames.isTouch,!0)})),o(this,"setTabFocus",(function(e){var t=n.player,i=t.elements,a=e.key,r=e.type,o=e.timeStamp;if(clearTimeout(n.focusTimer),"keydown"!==r||"Tab"===a){"keydown"===r&&(n.lastKeyDown=o);var s=o-n.lastKeyDown<=20;("focus"!==r||s)&&(function(){var e=t.config.classNames.tabFocus;ve(Te.call(t,".".concat(e)),e,!1)}(),"focusout"!==r&&(n.focusTimer=setTimeout((function(){var e=document.activeElement;i.container.contains(e)&&ve(document.activeElement,t.config.classNames.tabFocus,!0)}),10)))}})),o(this,"global",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=n.player;t.config.keyboard.global&&Me.call(t,window,"keydown keyup",n.handleKey,e,!1),Me.call(t,document.body,"click",n.toggleMenu,e),Ie.call(t,document.body,"touchstart",n.firstTouch),Me.call(t,document.body,"keydown focus blur focusout",n.setTabFocus,e,!1,!0)})),o(this,"container",(function(){var e=n.player,t=e.config,i=e.elements,a=e.timers;!t.keyboard.global&&t.keyboard.focused&&xe.call(e,i.container,"keydown keyup",n.handleKey,!1),xe.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(t){var n=i.controls;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);var r=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(wt.toggleControls.call(e,!0),r=e.touch?3e3:2e3),clearTimeout(a.controls),a.controls=setTimeout((function(){return wt.toggleControls.call(e,!1)}),r)}));var r=function(){if(e.isVimeo&&!e.config.vimeo.premium){var t=i.wrapper,n=e.fullscreen.active,a=l(Be.call(e),2),r=a[0],o=a[1],s=He("aspect-ratio: ".concat(r," / ").concat(o));if(n){var c=l([Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],2),u=c[0],d=c[1],h=u/d>r/o;s?(t.style.width=h?"auto":"100%",t.style.height=h?"100%":"auto"):(t.style.maxWidth=h?d/o*r+"px":null,t.style.margin=h?"0 auto":null)}else s?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null)}},o=function(){clearTimeout(a.resized),a.resized=setTimeout(r,50)};xe.call(e,i.container,"enterfullscreen exitfullscreen",(function(t){e.fullscreen.target===i.container&&(!e.isEmbed&&ae(e.config.ratio)||(r(),("enterfullscreen"===t.type?xe:Ne).call(e,window,"resize",o)))}))})),o(this,"media",(function(){var e=n.player,t=e.elements;if(xe.call(e,e.media,"timeupdate seeking seeked",(function(t){return ot.timeUpdate.call(e,t)})),xe.call(e,e.media,"durationchange loadeddata loadedmetadata",(function(t){return ot.durationUpdate.call(e,t)})),xe.call(e,e.media,"ended",(function(){e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),xe.call(e,e.media,"progress playing seeking seeked",(function(t){return ot.updateProgress.call(e,t)})),xe.call(e,e.media,"volumechange",(function(t){return ot.updateVolume.call(e,t)})),xe.call(e,e.media,"playing play pause ended emptied timeupdate",(function(t){return wt.checkPlaying.call(e,t)})),xe.call(e,e.media,"waiting canplay seeked playing",(function(t){return wt.checkLoading.call(e,t)})),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){var i=Ae.call(e,".".concat(e.config.classNames.video));if(!G(i))return;xe.call(e,t.container,"click",(function(a){([t.container,i].includes(a.target)||i.contains(a.target))&&(e.touch&&e.config.hideControls||(e.ended?(n.proxy(a,e.restart,"restart"),n.proxy(a,(function(){je(e.play())}),"play")):n.proxy(a,(function(){je(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&xe.call(e,t.wrapper,"contextmenu",(function(e){e.preventDefault()}),!1),xe.call(e,e.media,"volumechange",(function(){e.storage.set({volume:e.volume,muted:e.muted})})),xe.call(e,e.media,"ratechange",(function(){ot.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),xe.call(e,e.media,"qualitychange",(function(t){ot.updateSetting.call(e,"quality",null,t.detail.quality)})),xe.call(e,e.media,"ready qualitychange",(function(){ot.setDownloadUrl.call(e)}));var a=e.config.events.concat(["keyup","keydown"]).join(" ");xe.call(e,e.media,a,(function(n){var i=n.detail,a=void 0===i?{}:i;"error"===n.type&&(a=e.media.error),Le.call(e,t.container,n.type,!0,a)}))})),o(this,"proxy",(function(e,t,i){var a=n.player,r=a.config.listeners[i],o=!0;X(r)&&(o=r.call(a,e)),!1!==o&&X(t)&&t.call(a,e)})),o(this,"bind",(function(e,t,i,a){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=n.player,s=o.config.listeners[a],l=X(s);xe.call(o,e,t,(function(e){return n.proxy(e,i,a)}),r&&!l)})),o(this,"controls",(function(){var e=n.player,t=e.elements,i=se.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((function(t){n.bind(t,"click",(function(){je(e.togglePlay())}),"play")})),n.bind(t.buttons.restart,"click",e.restart,"restart"),n.bind(t.buttons.rewind,"click",(function(){e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),n.bind(t.buttons.fastForward,"click",(function(){e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),n.bind(t.buttons.mute,"click",(function(){e.muted=!e.muted}),"mute"),n.bind(t.buttons.captions,"click",(function(){return e.toggleCaptions()})),n.bind(t.buttons.download,"click",(function(){Le.call(e,e.media,"download")}),"download"),n.bind(t.buttons.fullscreen,"click",(function(){e.fullscreen.toggle()}),"fullscreen"),n.bind(t.buttons.pip,"click",(function(){e.pip="toggle"}),"pip"),n.bind(t.buttons.airplay,"click",e.airplay,"airplay"),n.bind(t.buttons.settings,"click",(function(t){t.stopPropagation(),t.preventDefault(),ot.toggleMenu.call(e,t)}),null,!1),n.bind(t.buttons.settings,"keyup",(function(t){["Space","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),ot.toggleMenu.call(e,t)):ot.focusFirstMenuItem.call(e,null,!0))}),null,!1),n.bind(t.settings.menu,"keydown",(function(t){"Escape"===t.key&&ot.toggleMenu.call(e,t)})),n.bind(t.inputs.seek,"mousedown mousemove",(function(e){var n=t.progress.getBoundingClientRect(),i=100/n.width*(e.pageX-n.left);e.currentTarget.setAttribute("seek-value",i)})),n.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(t){var n=t.currentTarget,i="play-on-seeked";if(!ee(t)||["ArrowLeft","ArrowRight"].includes(t.key)){e.lastSeekTime=Date.now();var a=n.hasAttribute(i),r=["mouseup","touchend","keyup"].includes(t.type);a&&r?(n.removeAttribute(i),je(e.play())):!r&&e.playing&&(n.setAttribute(i,""),e.pause())}})),se.isIos){var a=Te.call(e,'input[type="range"]');Array.from(a).forEach((function(e){return n.bind(e,i,(function(e){return oe(e.target)}))}))}n.bind(t.inputs.seek,i,(function(t){var n=t.currentTarget,i=n.getAttribute("seek-value");ae(i)&&(i=n.value),n.removeAttribute("seek-value"),e.currentTime=i/n.max*e.duration}),"seek"),n.bind(t.progress,"mouseenter mouseleave mousemove",(function(t){return ot.updateSeekTooltip.call(e,t)})),n.bind(t.progress,"mousemove touchmove",(function(t){var n=e.previewThumbnails;n&&n.loaded&&n.startMove(t)})),n.bind(t.progress,"mouseleave touchend click",(function(){var t=e.previewThumbnails;t&&t.loaded&&t.endMove(!1,!0)})),n.bind(t.progress,"mousedown touchstart",(function(t){var n=e.previewThumbnails;n&&n.loaded&&n.startScrubbing(t)})),n.bind(t.progress,"mouseup touchend",(function(t){var n=e.previewThumbnails;n&&n.loaded&&n.endScrubbing(t)})),se.isWebkit&&Array.from(Te.call(e,'input[type="range"]')).forEach((function(t){n.bind(t,"input",(function(t){return ot.updateRangeFill.call(e,t.target)}))})),e.config.toggleInvert&&!G(t.display.duration)&&n.bind(t.display.currentTime,"click",(function(){0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,ot.timeUpdate.call(e))})),n.bind(t.inputs.volume,i,(function(t){e.volume=t.target.value}),"volume"),n.bind(t.controls,"mouseenter mouseleave",(function(n){t.controls.hover=!e.touch&&"mouseenter"===n.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((function(e){return!e.contains(t.container)})).forEach((function(i){n.bind(i,"mouseenter mouseleave",(function(n){t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===n.type)}))})),n.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(function(e){t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),n.bind(t.controls,"focusin",(function(){var i=e.config,a=e.timers;ve(t.controls,i.classNames.noTransition,!0),wt.toggleControls.call(e,!0),setTimeout((function(){ve(t.controls,i.classNames.noTransition,!1)}),0);var r=n.touch?3e3:4e3;clearTimeout(a.controls),a.controls=setTimeout((function(){return wt.toggleControls.call(e,!1)}),r)})),n.bind(t.inputs.volume,"wheel",(function(t){var n=t.webkitDirectionInvertedFromDevice,i=[t.deltaX,-t.deltaY].map((function(e){return n?-e:e})),a=l(i,2),r=a[0],o=a[1],s=Math.sign(Math.abs(r)>Math.abs(o)?r:o);e.increaseVolume(s/50);var c=e.media.volume;(1===s&&c<1||-1===s&&c>0)&&t.preventDefault()}),"volume",!1)})),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return r(e,[{key:"handleKey",value:function(e){var t,n=this.player,i=n.elements,a=e.key,r=e.type,o=e.altKey,s=e.ctrlKey,l=e.metaKey,c=e.shiftKey,u="keydown"===r,d=u&&a===this.lastKey;if(!(o||s||l||c)&&a)if(u){var h=document.activeElement;if(G(h)){var m=n.config.selectors.editable;if(h!==i.inputs.seek&&ke(h,m))return;if("Space"===e.key&&ke(h,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(a)&&(e.preventDefault(),e.stopPropagation()),a){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":d||(t=parseInt(a,10),n.currentTime=n.duration/10*t);break;case"Space":case"k":d||je(n.togglePlay());break;case"ArrowUp":n.increaseVolume(.1);break;case"ArrowDown":n.decreaseVolume(.1);break;case"m":d||(n.muted=!n.muted);break;case"ArrowRight":n.forward();break;case"ArrowLeft":n.rewind();break;case"f":n.fullscreen.toggle();break;case"c":d||n.toggleCaptions();break;case"l":n.loop=!n.loop}"Escape"===a&&!n.fullscreen.usingNative&&n.fullscreen.active&&n.fullscreen.toggle(),this.lastKey=a}else this.lastKey=null}},{key:"toggleMenu",value:function(e){ot.toggleMenu.call(this.player,e)}}]),e}();var Tt=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(){var e=function(){},t={},n={},i={};function a(e,t){if(e){var a=i[e];if(n[e]=t,a)for(;a.length;)a[0](e,t),a.splice(0,1)}}function r(t,n){t.call&&(t={success:t}),n.length?(t.error||e)(n):(t.success||e)(t)}function o(t,n,i,a){var r,s,l=document,c=i.async,u=(i.numRetries||0)+1,d=i.before||e,h=t.replace(/[\?|#].*$/,""),m=t.replace(/^(css|img)!/,"");a=a||0,/(^css!|\.css$)/.test(h)?((s=l.createElement("link")).rel="stylesheet",s.href=m,(r="hideFocus"in s)&&s.relList&&(r=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)?(s=l.createElement("img")).src=m:((s=l.createElement("script")).src=t,s.async=void 0===c||c),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(r)try{s.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((a+=1)<u)return o(t,n,i,a)}else if("preload"==s.rel&&"style"==s.as)return s.rel="stylesheet";n(t,l,e.defaultPrevented)},!1!==d(t,s)&&l.head.appendChild(s)}function s(e,t,n){var i,a,r=(e=e.push?e:[e]).length,s=r,l=[];for(i=function(e,n,i){if("e"==n&&l.push(e),"b"==n){if(!i)return;l.push(e)}--r||t(l)},a=0;a<s;a++)o(e[a],i,n)}function l(e,n,i){var o,l;if(n&&n.trim&&(o=n),l=(o?i:n)||{},o){if(o in t)throw"LoadJS";t[o]=!0}function c(t,n){s(e,(function(e){r(l,e),t&&r({success:t,error:n},e),a(o,e)}),l)}if(l.returnPromise)return new Promise(c);c()}return l.ready=function(e,t){return function(e,t){e=e.push?e:[e];var a,r,o,s=[],l=e.length,c=l;for(a=function(e,n){n.length&&s.push(e),--c||t(s)};l--;)r=e[l],(o=n[r])?a(r,o):(i[r]=i[r]||[]).push(a)}(e,(function(e){r(t,e)})),l},l.done=function(e){a(e,[])},l.reset=function(){t={},n={},i={}},l.isDefined=function(e){return e in t},l}()}));function At(e){return new Promise((function(t,n){Tt(e,{success:t,error:n})}))}function Ct(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Le.call(this,this.media,e?"play":"pause"))}var St={setup:function(){var e=this;ve(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Ue.call(e),z(window.Vimeo)?St.ready.call(e):At(e.config.urls.vimeo.sdk).then((function(){St.ready.call(e)})).catch((function(t){e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready:function(){var n=this,i=this,a=i.config.vimeo,r=a.premium,o=a.referrerPolicy,c=t(a,e),u=i.media.getAttribute("src"),d="";ae(u)?(u=i.media.getAttribute(i.config.attributes.embed.id),d=i.media.getAttribute(i.config.attributes.embed.hash)):d=function(e){var t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(u);var h=d?{h:d}:{};r&&Object.assign(c,{controls:!1,sidedock:!1});var m=lt(s(s({loop:i.config.loop.active,autoplay:i.autoplay,muted:i.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},h),c)),p=function(e){return ae(e)?null:K(Number(e))?e:e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:e}(u),f=he("iframe"),g=Ye(i.config.urls.vimeo.iframe,p,m);if(f.setAttribute("src",g),f.setAttribute("allowfullscreen",""),f.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),ae(o)||f.setAttribute("referrerPolicy",o),r||!a.customControls)f.setAttribute("data-poster",i.poster),i.media=ge(f,i.media);else{var y=he("div",{class:i.config.classNames.embedContainer,"data-poster":i.poster});y.appendChild(f),i.media=ge(y,i.media)}a.customControls||tt(Ye(i.config.urls.vimeo.api,g)).then((function(e){!ae(e)&&e.thumbnail_url&&wt.setPoster.call(i,e.thumbnail_url).catch((function(){}))})),i.embed=new window.Vimeo.Player(f,{autopause:i.config.autopause,muted:i.muted}),i.media.paused=!0,i.media.currentTime=0,i.supported.ui&&i.embed.disableTextTrack(),i.media.play=function(){return Ct.call(i,!0),i.embed.play()},i.media.pause=function(){return Ct.call(i,!1),i.embed.pause()},i.media.stop=function(){i.pause(),i.currentTime=0};var b=i.media.currentTime;Object.defineProperty(i.media,"currentTime",{get:function(){return b},set:function(e){var t=i.embed,n=i.media,a=i.paused,r=i.volume,o=a&&!t.hasPlayed;n.seeking=!0,Le.call(i,n,"seeking"),Promise.resolve(o&&t.setVolume(0)).then((function(){return t.setCurrentTime(e)})).then((function(){return o&&t.pause()})).then((function(){return o&&t.setVolume(r)})).catch((function(){}))}});var v=i.config.speed.selected;Object.defineProperty(i.media,"playbackRate",{get:function(){return v},set:function(e){i.embed.setPlaybackRate(e).then((function(){v=e,Le.call(i,i.media,"ratechange")})).catch((function(){i.options.speed=[1]}))}});var w=i.config.volume;Object.defineProperty(i.media,"volume",{get:function(){return w},set:function(e){i.embed.setVolume(e).then((function(){w=e,Le.call(i,i.media,"volumechange")}))}});var k=i.config.muted;Object.defineProperty(i.media,"muted",{get:function(){return k},set:function(e){var t=!!Q(e)&&e;i.embed.setVolume(t?0:i.config.volume).then((function(){k=t,Le.call(i,i.media,"volumechange")}))}});var T,A=i.config.loop;Object.defineProperty(i.media,"loop",{get:function(){return A},set:function(e){var t=Q(e)?e:i.config.loop.active;i.embed.setLoop(t).then((function(){A=t}))}}),i.embed.getVideoUrl().then((function(e){T=e,ot.setDownloadUrl.call(i)})).catch((function(e){n.debug.warn(e)})),Object.defineProperty(i.media,"currentSrc",{get:function(){return T}}),Object.defineProperty(i.media,"ended",{get:function(){return i.currentTime===i.duration}}),Promise.all([i.embed.getVideoWidth(),i.embed.getVideoHeight()]).then((function(e){var t=l(e,2),a=t[0],r=t[1];i.embed.ratio=We(a,r),Ue.call(n)})),i.embed.setAutopause(i.config.autopause).then((function(e){i.config.autopause=e})),i.embed.getVideoTitle().then((function(e){i.config.title=e,wt.setTitle.call(n)})),i.embed.getCurrentTime().then((function(e){b=e,Le.call(i,i.media,"timeupdate")})),i.embed.getDuration().then((function(e){i.media.duration=e,Le.call(i,i.media,"durationchange")})),i.embed.getTextTracks().then((function(e){i.media.textTracks=e,ct.setup.call(i)})),i.embed.on("cuechange",(function(e){var t=e.cues,n=(void 0===t?[]:t).map((function(e){return function(e){var t=document.createDocumentFragment(),n=document.createElement("div");return t.appendChild(n),n.innerHTML=e,t.firstChild.innerText}(e.text)}));ct.updateCues.call(i,n)})),i.embed.on("loaded",(function(){i.embed.getPaused().then((function(e){Ct.call(i,!e),e||Le.call(i,i.media,"playing")})),G(i.embed.element)&&i.supported.ui&&i.embed.element.setAttribute("tabindex",-1)})),i.embed.on("bufferstart",(function(){Le.call(i,i.media,"waiting")})),i.embed.on("bufferend",(function(){Le.call(i,i.media,"playing")})),i.embed.on("play",(function(){Ct.call(i,!0),Le.call(i,i.media,"playing")})),i.embed.on("pause",(function(){Ct.call(i,!1)})),i.embed.on("timeupdate",(function(e){i.media.seeking=!1,b=e.seconds,Le.call(i,i.media,"timeupdate")})),i.embed.on("progress",(function(e){i.media.buffered=e.percent,Le.call(i,i.media,"progress"),1===parseInt(e.percent,10)&&Le.call(i,i.media,"canplaythrough"),i.embed.getDuration().then((function(e){e!==i.media.duration&&(i.media.duration=e,Le.call(i,i.media,"durationchange"))}))})),i.embed.on("seeked",(function(){i.media.seeking=!1,Le.call(i,i.media,"seeked")})),i.embed.on("ended",(function(){i.media.paused=!0,Le.call(i,i.media,"ended")})),i.embed.on("error",(function(e){i.media.error=e,Le.call(i,i.media,"error")})),a.customControls&&setTimeout((function(){return wt.build.call(i)}),0)}};function Et(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Le.call(this,this.media,e?"play":"pause"))}function Pt(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var Mt={setup:function(){var e=this;if(ve(this.elements.wrapper,this.config.classNames.embed,!0),z(window.YT)&&X(window.YT.Player))Mt.ready.call(this);else{var t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){X(t)&&t(),Mt.ready.call(e)},At(this.config.urls.youtube.sdk).catch((function(t){e.debug.warn("YouTube API failed to load",t)}))}},getTitle:function(e){var t=this;tt(Ye(this.config.urls.youtube.api,e)).then((function(e){if(z(e)){var n=e.title,i=e.height,a=e.width;t.config.title=n,wt.setTitle.call(t),t.embed.ratio=We(a,i)}Ue.call(t)})).catch((function(){Ue.call(t)}))},ready:function(){var e=this,t=e.config.youtube,n=e.media&&e.media.getAttribute("id");if(ae(n)||!n.startsWith("youtube-")){var i=e.media.getAttribute("src");ae(i)&&(i=e.media.getAttribute(this.config.attributes.embed.id));var a=function(e){return ae(e)?null:e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:e}(i),r=he("div",{id:Ke(e.provider),"data-poster":t.customControls?e.poster:void 0});if(e.media=ge(r,e.media),t.customControls){var o=function(e){return"https://i.ytimg.com/vi/".concat(a,"/").concat(e,"default.jpg")};vt(o("maxres"),121).catch((function(){return vt(o("sd"),121)})).catch((function(){return vt(o("hq"))})).then((function(t){return wt.setPoster.call(e,t.src)})).then((function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((function(){}))}e.embed=new window.YT.Player(e.media,{videoId:a,host:Pt(t),playerVars:ce({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError:function(t){if(!e.media.error){var n=t.data,i={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[n]||"An unknown error occured";e.media.error={code:n,message:i},Le.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var n=t.target;e.media.playbackRate=n.getPlaybackRate(),Le.call(e,e.media,"ratechange")},onReady:function(n){if(!X(e.media.play)){var i=n.target;Mt.getTitle.call(e,a),e.media.play=function(){Et.call(e,!0),i.playVideo()},e.media.pause=function(){Et.call(e,!1),i.pauseVideo()},e.media.stop=function(){i.stopVideo()},e.media.duration=i.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Le.call(e,e.media,"seeking"),i.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(e){i.setPlaybackRate(e)}});var r=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return r},set:function(t){r=t,i.setVolume(100*r),Le.call(e,e.media,"volumechange")}});var o=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return o},set:function(t){var n=Q(t)?t:o;o=n,i[n?"mute":"unMute"](),i.setVolume(100*r),Le.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}});var s=i.getAvailablePlaybackRates();e.options.speed=s.filter((function(t){return e.config.speed.options.includes(t)})),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),Le.call(e,e.media,"timeupdate"),Le.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((function(){e.media.buffered=i.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Le.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Le.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((function(){return wt.build.call(e)}),50)}},onStateChange:function(n){var i=n.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(n.data)&&(e.media.seeking=!1,Le.call(e,e.media,"seeked")),n.data){case-1:Le.call(e,e.media,"timeupdate"),e.media.buffered=i.getVideoLoadedFraction(),Le.call(e,e.media,"progress");break;case 0:Et.call(e,!1),e.media.loop?(i.stopVideo(),i.playVideo()):Le.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Et.call(e,!0),Le.call(e,e.media,"playing"),e.timers.playing=setInterval((function(){Le.call(e,e.media,"timeupdate")}),50),e.media.duration!==i.getDuration()&&(e.media.duration=i.getDuration(),Le.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Et.call(e,!1);break;case 3:Le.call(e,e.media,"waiting")}Le.call(e,e.elements.container,"statechange",!1,{code:n.data})}}})}}},xt={setup:function(){this.media?(ve(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),ve(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&ve(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=he("div",{class:this.config.classNames.video}),ue(this.media,this.elements.wrapper),this.elements.poster=he("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?ze.setup.call(this):this.isYouTube?Mt.setup.call(this):this.isVimeo&&St.setup.call(this)):this.debug.warn("No media element found!")}},Nt=function(){function e(t){var n=this;i(this,e),o(this,"load",(function(){n.enabled&&(z(window.google)&&z(window.google.ima)?n.ready():At(n.player.config.urls.googleIMA.sdk).then((function(){n.ready()})).catch((function(){n.trigger("error",new Error("Google IMA SDK failed to load"))})))})),o(this,"ready",(function(){var e;n.enabled||((e=n).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),n.startSafetyTimer(12e3,"ready()"),n.managerPromise.then((function(){n.clearSafetyTimer("onAdsManagerLoaded()")})),n.listeners(),n.setupIMA()})),o(this,"setupIMA",(function(){n.elements.container=he("div",{class:n.player.config.classNames.ads}),n.player.elements.container.appendChild(n.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(n.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(n.player.config.playsinline),n.elements.displayContainer=new google.ima.AdDisplayContainer(n.elements.container,n.player.media),n.loader=new google.ima.AdsLoader(n.elements.displayContainer),n.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(e){return n.onAdsManagerLoaded(e)}),!1),n.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return n.onAdError(e)}),!1),n.requestAds()})),o(this,"requestAds",(function(){var e=n.player.elements.container;try{var t=new google.ima.AdsRequest;t.adTagUrl=n.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!n.player.muted),n.loader.requestAds(t)}catch(e){n.onAdError(e)}})),o(this,"pollCountdown",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return clearInterval(n.countdownTimer),void n.elements.container.removeAttribute("data-badge-text");n.countdownTimer=setInterval((function(){var e=rt(Math.max(n.manager.getRemainingTime(),0)),t="".concat(Ze("advertisement",n.player.config)," - ").concat(e);n.elements.container.setAttribute("data-badge-text",t)}),100)})),o(this,"onAdsManagerLoaded",(function(e){if(n.enabled){var t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,n.manager=e.getAdsManager(n.player,t),n.cuePoints=n.manager.getCuePoints(),n.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return n.onAdError(e)})),Object.keys(google.ima.AdEvent.Type).forEach((function(e){n.manager.addEventListener(google.ima.AdEvent.Type[e],(function(e){return n.onAdEvent(e)}))})),n.trigger("loaded")}})),o(this,"addCuePoints",(function(){ae(n.cuePoints)||n.cuePoints.forEach((function(e){if(0!==e&&-1!==e&&e<n.player.duration){var t=n.player.elements.progress;if(G(t)){var i=100/n.player.duration*e,a=he("span",{class:n.player.config.classNames.cues});a.style.left="".concat(i.toString(),"%"),t.appendChild(a)}}}))})),o(this,"onAdEvent",(function(e){var t=n.player.elements.container,i=e.getAd(),a=e.getAdData();switch(function(e){Le.call(n.player,n.player.media,"ads".concat(e.replace(/_/g,"").toLowerCase()))}(e.type),e.type){case google.ima.AdEvent.Type.LOADED:n.trigger("loaded"),n.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:n.manager.setVolume(n.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:n.player.ended?n.loadAds():n.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:n.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:n.pollCountdown(),n.resumeContent();break;case google.ima.AdEvent.Type.LOG:a.adError&&n.player.debug.warn("Non-fatal ad error: ".concat(a.adError.getMessage()))}})),o(this,"onAdError",(function(e){n.cancel(),n.player.debug.warn("Ads error",e)})),o(this,"listeners",(function(){var e,t=n.player.elements.container;n.player.on("canplay",(function(){n.addCuePoints()})),n.player.on("ended",(function(){n.loader.contentComplete()})),n.player.on("timeupdate",(function(){e=n.player.currentTime})),n.player.on("seeked",(function(){var t=n.player.currentTime;ae(n.cuePoints)||n.cuePoints.forEach((function(i,a){e<i&&i<t&&(n.manager.discardAdBreak(),n.cuePoints.splice(a,1))}))})),window.addEventListener("resize",(function(){n.manager&&n.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)}))})),o(this,"play",(function(){var e=n.player.elements.container;n.managerPromise||n.resumeContent(),n.managerPromise.then((function(){n.manager.setVolume(n.player.volume),n.elements.displayContainer.initialize();try{n.initialized||(n.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),n.manager.start()),n.initialized=!0}catch(e){n.onAdError(e)}})).catch((function(){}))})),o(this,"resumeContent",(function(){n.elements.container.style.zIndex="",n.playing=!1,je(n.player.media.play())})),o(this,"pauseContent",(function(){n.elements.container.style.zIndex=3,n.playing=!0,n.player.media.pause()})),o(this,"cancel",(function(){n.initialized&&n.resumeContent(),n.trigger("error"),n.loadAds()})),o(this,"loadAds",(function(){n.managerPromise.then((function(){n.manager&&n.manager.destroy(),n.managerPromise=new Promise((function(e){n.on("loaded",e),n.player.debug.log(n.manager)})),n.initialized=!1,n.requestAds()})).catch((function(){}))})),o(this,"trigger",(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];var r=n.events[e];$(r)&&r.forEach((function(e){X(e)&&e.apply(n,i)}))})),o(this,"on",(function(e,t){return $(n.events[e])||(n.events[e]=[]),n.events[e].push(t),n})),o(this,"startSafetyTimer",(function(e,t){n.player.debug.log("Safety timer invoked from: ".concat(t)),n.safetyTimer=setTimeout((function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")}),e)})),o(this,"clearSafetyTimer",(function(e){W(n.safetyTimer)||(n.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(n.safetyTimer),n.safetyTimer=null)})),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((function(e,t){n.on("loaded",e),n.on("error",t)})),this.load()}return r(e,[{key:"enabled",get:function(){var e=this.config;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!ae(e.publisherId)||ie(e.tagUrl))}},{key:"tagUrl",get:function(){var e=this.config;return ie(e.tagUrl)?e.tagUrl:"https://go.aniview.com/api/adserver6/vast/?".concat(lt({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId}))}}]),e}();function It(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(e,t),n)}var Lt=function(e){var t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(e){var n={};e.split(/\r\n|\n|\r/).forEach((function(e){if(K(n.startTime)){if(!ae(e.trim())&&ae(n.text)){var t,i,a=e.trim().split("#xywh=");t=l(a,1),n.text=t[0],a[1]&&(i=l(a[1].split(","),4),n.x=i[0],n.y=i[1],n.w=i[2],n.h=i[3])}}else{var r=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);r&&(n.startTime=60*Number(r[1]||0)*60+60*Number(r[2])+Number(r[3])+Number("0.".concat(r[4])),n.endTime=60*Number(r[6]||0)*60+60*Number(r[7])+Number(r[8])+Number("0.".concat(r[9])))}})),n.text&&t.push(n)})),t},Ot=function(e,t){var n={};return e>t.width/t.height?(n.width=t.width,n.height=1/e*t.width):(n.height=t.height,n.width=e*t.height),n},_t=function(){function e(t){var n=this;i(this,e),o(this,"load",(function(){n.player.elements.display.seekTooltip&&(n.player.elements.display.seekTooltip.hidden=n.enabled),n.enabled&&n.getThumbnails().then((function(){n.enabled&&(n.render(),n.determineContainerAutoSizing(),n.loaded=!0)}))})),o(this,"getThumbnails",(function(){return new Promise((function(e){var t=n.player.config.previewThumbnails.src;if(ae(t))throw new Error("Missing previewThumbnails.src config attribute");var i=function(){n.thumbnails.sort((function(e,t){return e.height-t.height})),n.player.debug.log("Preview thumbnails",n.thumbnails),e()};if(X(t))t((function(e){n.thumbnails=e,i()}));else{var a=(Y(t)?[t]:t).map((function(e){return n.getThumbnail(e)}));Promise.all(a).then(i)}}))})),o(this,"getThumbnail",(function(e){return new Promise((function(t){tt(e).then((function(i){var a={frames:Lt(i),height:null,urlPrefix:""};a.frames[0].text.startsWith("/")||a.frames[0].text.startsWith("http://")||a.frames[0].text.startsWith("https://")||(a.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var r=new Image;r.onload=function(){a.height=r.naturalHeight,a.width=r.naturalWidth,n.thumbnails.push(a),t()},r.src=a.urlPrefix+a.frames[0].text}))}))})),o(this,"startMove",(function(e){if(n.loaded&&Z(e)&&["touchmove","mousemove"].includes(e.type)&&n.player.media.duration){if("touchmove"===e.type)n.seekTime=n.player.media.duration*(n.player.elements.inputs.seek.value/100);else{var t,i,a=n.player.elements.progress.getBoundingClientRect(),r=100/a.width*(e.pageX-a.left);n.seekTime=n.player.media.duration*(r/100),n.seekTime<0&&(n.seekTime=0),n.seekTime>n.player.media.duration-1&&(n.seekTime=n.player.media.duration-1),n.mousePosX=e.pageX,n.elements.thumb.time.innerText=rt(n.seekTime);var o=null===(t=n.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((function(e){return e.time===Math.round(n.seekTime)}));o&&n.elements.thumb.time.insertAdjacentHTML("afterbegin","".concat(o.label,"<br>"))}n.showImageAtCurrentTime()}})),o(this,"endMove",(function(){n.toggleThumbContainer(!1,!0)})),o(this,"startScrubbing",(function(e){(W(e.button)||!1===e.button||0===e.button)&&(n.mouseDown=!0,n.player.media.duration&&(n.toggleScrubbingContainer(!0),n.toggleThumbContainer(!1,!0),n.showImageAtCurrentTime()))})),o(this,"endScrubbing",(function(){n.mouseDown=!1,Math.ceil(n.lastTime)===Math.ceil(n.player.media.currentTime)?n.toggleScrubbingContainer(!1):Ie.call(n.player,n.player.media,"timeupdate",(function(){n.mouseDown||n.toggleScrubbingContainer(!1)}))})),o(this,"listeners",(function(){n.player.on("play",(function(){n.toggleThumbContainer(!1,!0)})),n.player.on("seeked",(function(){n.toggleThumbContainer(!1)})),n.player.on("timeupdate",(function(){n.lastTime=n.player.media.currentTime}))})),o(this,"render",(function(){n.elements.thumb.container=he("div",{class:n.player.config.classNames.previewThumbnails.thumbContainer}),n.elements.thumb.imageContainer=he("div",{class:n.player.config.classNames.previewThumbnails.imageContainer}),n.elements.thumb.container.appendChild(n.elements.thumb.imageContainer);var e=he("div",{class:n.player.config.classNames.previewThumbnails.timeContainer});n.elements.thumb.time=he("span",{},"00:00"),e.appendChild(n.elements.thumb.time),n.elements.thumb.imageContainer.appendChild(e),G(n.player.elements.progress)&&n.player.elements.progress.appendChild(n.elements.thumb.container),n.elements.scrubbing.container=he("div",{class:n.player.config.classNames.previewThumbnails.scrubbingContainer}),n.player.elements.wrapper.appendChild(n.elements.scrubbing.container)})),o(this,"destroy",(function(){n.elements.thumb.container&&n.elements.thumb.container.remove(),n.elements.scrubbing.container&&n.elements.scrubbing.container.remove()})),o(this,"showImageAtCurrentTime",(function(){n.mouseDown?n.setScrubbingContainerSize():n.setThumbContainerSizeAndPos();var e=n.thumbnails[0].frames.findIndex((function(e){return n.seekTime>=e.startTime&&n.seekTime<=e.endTime})),t=e>=0,i=0;n.mouseDown||n.toggleThumbContainer(t),t&&(n.thumbnails.forEach((function(t,a){n.loadedImages.includes(t.frames[e].text)&&(i=a)})),e!==n.showingThumb&&(n.showingThumb=e,n.loadImage(i)))})),o(this,"loadImage",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=n.showingThumb,i=n.thumbnails[e],a=i.urlPrefix,r=i.frames[t],o=i.frames[t].text,s=a+o;if(n.currentImageElement&&n.currentImageElement.dataset.filename===o)n.showImage(n.currentImageElement,r,e,t,o,!1),n.currentImageElement.dataset.index=t,n.removeOldImages(n.currentImageElement);else{n.loadingImage&&n.usingSprites&&(n.loadingImage.onload=null);var l=new Image;l.src=s,l.dataset.index=t,l.dataset.filename=o,n.showingThumbFilename=o,n.player.debug.log("Loading image: ".concat(s)),l.onload=function(){return n.showImage(l,r,e,t,o,!0)},n.loadingImage=l,n.removeOldImages(l)}})),o(this,"showImage",(function(e,t,i,a,r){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];n.player.debug.log("Showing thumb: ".concat(r,". num: ").concat(a,". qual: ").concat(i,". newimg: ").concat(o)),n.setImageSizeAndOffset(e,t),o&&(n.currentImageContainer.appendChild(e),n.currentImageElement=e,n.loadedImages.includes(r)||n.loadedImages.push(r)),n.preloadNearby(a,!0).then(n.preloadNearby(a,!1)).then(n.getHigherQuality(i,e,t,r))})),o(this,"removeOldImages",(function(e){Array.from(n.currentImageContainer.children).forEach((function(t){if("img"===t.tagName.toLowerCase()){var i=n.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;var a=n.currentImageContainer;setTimeout((function(){a.removeChild(t),n.player.debug.log("Removing thumb: ".concat(t.dataset.filename))}),i)}}}))})),o(this,"preloadNearby",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i){setTimeout((function(){var a=n.thumbnails[0].frames[e].text;if(n.showingThumbFilename===a){var r;r=t?n.thumbnails[0].frames.slice(e):n.thumbnails[0].frames.slice(0,e).reverse();var o=!1;r.forEach((function(e){var t=e.text;if(t!==a&&!n.loadedImages.includes(t)){o=!0,n.player.debug.log("Preloading thumb filename: ".concat(t));var r=n.thumbnails[0].urlPrefix+t,s=new Image;s.src=r,s.onload=function(){n.player.debug.log("Preloaded thumb filename: ".concat(t)),n.loadedImages.includes(t)||n.loadedImages.push(t),i()}}})),o||i()}}),300)}))})),o(this,"getHigherQuality",(function(e,t,i,a){if(e<n.thumbnails.length-1){var r=t.naturalHeight;n.usingSprites&&(r=i.h),r<n.thumbContainerHeight&&setTimeout((function(){n.showingThumbFilename===a&&(n.player.debug.log("Showing higher quality thumb for: ".concat(a)),n.loadImage(e+1))}),300)}})),o(this,"toggleThumbContainer",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.player.config.classNames.previewThumbnails.thumbContainerShown;n.elements.thumb.container.classList.toggle(i,e),!e&&t&&(n.showingThumb=null,n.showingThumbFilename=null)})),o(this,"toggleScrubbingContainer",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=n.player.config.classNames.previewThumbnails.scrubbingContainerShown;n.elements.scrubbing.container.classList.toggle(t,e),e||(n.showingThumb=null,n.showingThumbFilename=null)})),o(this,"determineContainerAutoSizing",(function(){(n.elements.thumb.imageContainer.clientHeight>20||n.elements.thumb.imageContainer.clientWidth>20)&&(n.sizeSpecifiedInCSS=!0)})),o(this,"setThumbContainerSizeAndPos",(function(){var e=n.elements.thumb.imageContainer;if(n.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){var t=Math.floor(e.clientHeight*n.thumbAspectRatio);e.style.width="".concat(t,"px")}else if(e.clientHeight<20&&e.clientWidth>20){var i=Math.floor(e.clientWidth/n.thumbAspectRatio);e.style.height="".concat(i,"px")}}else{var a=Math.floor(n.thumbContainerHeight*n.thumbAspectRatio);e.style.height="".concat(n.thumbContainerHeight,"px"),e.style.width="".concat(a,"px")}n.setThumbContainerPos()})),o(this,"setThumbContainerPos",(function(){var e=n.player.elements.progress.getBoundingClientRect(),t=n.player.elements.container.getBoundingClientRect(),i=n.elements.thumb.container,a=t.left-e.left+10,r=t.right-e.left-i.clientWidth-10,o=n.mousePosX-e.left-i.clientWidth/2,s=It(o,a,r);i.style.left="".concat(s,"px"),i.style.setProperty("--preview-arrow-offset",o-s+"px")})),o(this,"setScrubbingContainerSize",(function(){var e=Ot(n.thumbAspectRatio,{width:n.player.media.clientWidth,height:n.player.media.clientHeight}),t=e.width,i=e.height;n.elements.scrubbing.container.style.width="".concat(t,"px"),n.elements.scrubbing.container.style.height="".concat(i,"px")})),o(this,"setImageSizeAndOffset",(function(e,t){if(n.usingSprites){var i=n.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left="-".concat(t.x*i,"px"),e.style.top="-".concat(t.y*i,"px")}})),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return r(e,[{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?Ot(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),e}(),jt={insertElements:function(e,t){var n=this;Y(t)?me(e,this.media,{src:t}):$(t)&&t.forEach((function(t){me(e,n.media,t)}))},change:function(e){var t=this;le(e,"sources.length")?(ze.cancelRequests.call(this),this.destroy.call(this,(function(){t.options.quality=[],pe(t.media),t.media=null,G(t.elements.container)&&t.elements.container.removeAttribute("class");var n=e.sources,i=e.type,a=l(n,1)[0],r=a.provider,o=void 0===r?mt.html5:r,s=a.src,c="html5"===o?i:"div",u="html5"===o?{}:{src:s};Object.assign(t,{provider:o,type:i,supported:Ee.check(i,o,t.config.playsinline),media:he(c,u)}),t.elements.container.appendChild(t.media),Q(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),ae(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),wt.addStyleHook.call(t),t.isHTML5&&jt.insertElements.call(t,"source",n),t.config.title=e.title,xt.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&jt.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&wt.build.call(t),t.isHTML5&&t.media.load(),ae(e.previewThumbnails)||(Object.assign(t.config.previewThumbnails,e.previewThumbnails),t.previewThumbnails&&t.previewThumbnails.loaded&&(t.previewThumbnails.destroy(),t.previewThumbnails=null),t.config.previewThumbnails.enabled&&(t.previewThumbnails=new _t(t))),t.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}},Dt=function(){function e(t,n){var a=this;if(i(this,e),o(this,"play",(function(){return X(a.media.play)?(a.ads&&a.ads.enabled&&a.ads.managerPromise.then((function(){return a.ads.play()})).catch((function(){return je(a.media.play())})),a.media.play()):null})),o(this,"pause",(function(){return a.playing&&X(a.media.pause)?a.media.pause():null})),o(this,"togglePlay",(function(e){return(Q(e)?e:!a.playing)?a.play():a.pause()})),o(this,"stop",(function(){a.isHTML5?(a.pause(),a.restart()):X(a.media.stop)&&a.media.stop()})),o(this,"restart",(function(){a.currentTime=0})),o(this,"rewind",(function(e){a.currentTime-=K(e)?e:a.config.seekTime})),o(this,"forward",(function(e){a.currentTime+=K(e)?e:a.config.seekTime})),o(this,"increaseVolume",(function(e){var t=a.media.muted?0:a.volume;a.volume=t+(K(e)?e:0)})),o(this,"decreaseVolume",(function(e){a.increaseVolume(-e)})),o(this,"airplay",(function(){Ee.airplay&&a.media.webkitShowPlaybackTargetPicker()})),o(this,"toggleControls",(function(e){if(a.supported.ui&&!a.isAudio){var t=we(a.elements.container,a.config.classNames.hideControls),n=void 0===e?void 0:!e,i=ve(a.elements.container,a.config.classNames.hideControls,n);if(i&&$(a.config.controls)&&a.config.controls.includes("settings")&&!ae(a.config.settings)&&ot.toggleMenu.call(a,!1),i!==t){var r=i?"controlshidden":"controlsshown";Le.call(a,a.media,r)}return!i}return!1})),o(this,"on",(function(e,t){xe.call(a,a.elements.container,e,t)})),o(this,"once",(function(e,t){Ie.call(a,a.elements.container,e,t)})),o(this,"off",(function(e,t){Ne(a.elements.container,e,t)})),o(this,"destroy",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(a.ready){var n=function(){document.body.style.overflow="",a.embed=null,t?(Object.keys(a.elements).length&&(pe(a.elements.buttons.play),pe(a.elements.captions),pe(a.elements.controls),pe(a.elements.wrapper),a.elements.buttons.play=null,a.elements.captions=null,a.elements.controls=null,a.elements.wrapper=null),X(e)&&e()):(Oe.call(a),ze.cancelRequests.call(a),ge(a.elements.original,a.elements.container),Le.call(a,a.elements.original,"destroyed",!0),X(e)&&e.call(a.elements.original),a.ready=!1,setTimeout((function(){a.elements=null,a.media=null}),200))};a.stop(),clearTimeout(a.timers.loading),clearTimeout(a.timers.controls),clearTimeout(a.timers.resized),a.isHTML5?(wt.toggleNativeControls.call(a,!0),n()):a.isYouTube?(clearInterval(a.timers.buffering),clearInterval(a.timers.playing),null!==a.embed&&X(a.embed.destroy)&&a.embed.destroy(),n()):a.isVimeo&&(null!==a.embed&&a.embed.unload().then(n),setTimeout(n,200))}})),o(this,"supports",(function(e){return Ee.mime.call(a,e)})),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Ee.touch,this.media=t,Y(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||J(this.media)||$(this.media))&&(this.media=this.media[0]),this.config=ce({},ut,e.defaults,n||{},function(){try{return JSON.parse(a.media.getAttribute("data-plyr-config"))}catch(t){return{}}}()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new yt(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Ee),!W(this.media)&&G(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(Ee.check().api){var r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;var s=this.media.tagName.toLowerCase(),l=null,c=null;switch(s){case"div":if(l=this.media.querySelector("iframe"),G(l)){if(c=st(l.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?mt.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?mt.vimeo:null}(c.toString()),this.elements.container=this.media,this.media=l,this.elements.container.className="",c.search.length){var u=["1","true"];u.includes(c.searchParams.get("autoplay"))&&(this.config.autoplay=!0),u.includes(c.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=u.includes(c.searchParams.get("playsinline")),this.config.youtube.hl=c.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(ae(this.provider)||!Object.values(mt).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=ft;break;case"video":case"audio":this.type=s,this.provider=mt.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Ee.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new kt(this),this.storage=new et(this),this.media.plyr=this,G(this.elements.container)||(this.elements.container=he("div",{tabindex:0}),ue(this.media,this.elements.container)),wt.migrateStyles.call(this),wt.addStyleHook.call(this),xt.setup.call(this),this.config.debug&&xe.call(this,this.elements.container,this.config.events.join(" "),(function(e){a.debug.log("event: ".concat(e.type))})),this.fullscreen=new bt(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&wt.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Nt(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(function(){return je(a.play())})),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new _t(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return r(e,[{key:"isHTML5",get:function(){return this.provider===mt.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===mt.youtube}},{key:"isVimeo",get:function(){return this.provider===mt.vimeo}},{key:"isVideo",get:function(){return this.type===ft}},{key:"isAudio",get:function(){return this.type===pt}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",get:function(){return Number(this.media.currentTime)},set:function(e){if(this.duration){var t=K(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}}},{key:"buffered",get:function(){var e=this.media.buffered;return K(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,n=K(t)&&t!==1/0?t:0;return e||n}},{key:"volume",get:function(){return Number(this.media.volume)},set:function(e){var t=e;Y(t)&&(t=Number(t)),K(t)||(t=this.storage.get("volume")),K(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!ae(e)&&this.muted&&t>0&&(this.muted=!1)}},{key:"muted",get:function(){return Boolean(this.media.muted)},set:function(e){var t=e;Q(t)||(t=this.storage.get("muted")),Q(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}},{key:"hasAudio",get:function(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}},{key:"speed",get:function(){return Number(this.media.playbackRate)},set:function(e){var t=this,n=null;K(e)&&(n=e),K(n)||(n=this.storage.get("speed")),K(n)||(n=this.config.speed.selected);var i=this.minimumSpeed,a=this.maximumSpeed;n=It(n,i,a),this.config.speed.selected=n,setTimeout((function(){t.media&&(t.media.playbackRate=n)}),0)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,n(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,n(this.options.speed)):this.isVimeo?2:16}},{key:"quality",get:function(){return this.media.quality},set:function(e){var t=this.config.quality,n=this.options.quality;if(n.length){var i=[!ae(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(K),a=!0;if(!n.includes(i)){var r=qe(n,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(r," instead")),i=r,a=!1}t.selected=i,this.media.quality=i,a&&this.storage.set({quality:i})}}},{key:"loop",get:function(){return Boolean(this.media.loop)},set:function(e){var t=Q(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}},{key:"source",get:function(){return this.media.currentSrc},set:function(e){jt.change.call(this,e)}},{key:"download",get:function(){var e=this.config.urls.download;return ie(e)?e:this.source},set:function(e){ie(e)&&(this.config.urls.download=e,ot.setDownloadUrl.call(this))}},{key:"poster",get:function(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null},set:function(e){this.isVideo?wt.setPoster.call(this,e,!1).catch((function(){})):this.debug.warn("Poster can only be set for video")}},{key:"ratio",get:function(){if(!this.isVideo)return null;var e=Ve(Be.call(this));return $(e)?e.join(":"):e},set:function(e){this.isVideo?Y(e)&&Fe(e)?(this.config.ratio=Ve(e),Ue.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(e,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",get:function(){return Boolean(this.config.autoplay)},set:function(e){this.config.autoplay=Q(e)?e:this.config.autoplay}},{key:"toggleCaptions",value:function(e){ct.toggle.call(this,e,!1)}},{key:"currentTrack",get:function(){var e=this.captions,t=e.toggled,n=e.currentTrack;return t?n:-1},set:function(e){ct.set.call(this,e,!1),ct.setup.call(this)}},{key:"language",get:function(){return(ct.getCurrentTrack.call(this)||{}).language},set:function(e){ct.setLanguage.call(this,e,!1)}},{key:"pip",get:function(){return Ee.pip?ae(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===dt:null},set:function(e){if(Ee.pip){var t=Q(e)?e:!this.pip;X(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?dt:ht),X(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}}},{key:"setPreviewThumbnails",value:function(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new _t(this))}}],[{key:"supported",value:function(e,t,n){return Ee.check(e,t,n)}},{key:"loadSprite",value:function(e,t){return nt(e,t)}},{key:"setup",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return Y(t)?i=Array.from(document.querySelectorAll(t)):J(t)?i=Array.from(t):$(t)&&(i=t.filter(G)),ae(i)?null:i.map((function(t){return new e(t,n)}))}}]),e}();a("P",Dt),Dt.defaults=function(e){return JSON.parse(JSON.stringify(e))}(ut)}}}))}();