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