12 |
- import{T as vt}from"./index.e6572137.js";import{T as wt,r as Tt}from"./request.a45d1be5.js";import{T as kt}from"./index.87de90a8.js";import{d as At,w as Ct,n as De,o as Et,r as be,K as St,c as T,b as ee,F as Pt,a as Nt,u as Mt}from"./index.3718c0a8.js";import{I as It}from"./index.2b675c4f.js";import{i as Fe}from"./icon_teacher.279658ad.js";import{T as xt}from"./index.b591d515.js";import{T as Lt}from"./index.e03f08ff.js";import"./icon-search.f54aed7d.js";import"./logo-1.1c5bc018.js";import"./utils.e748d7c8.js";const Ot="_musicDeatail_1fnrj_1",jt="_header_1fnrj_1",Rt="_bgImg_1fnrj_10",Dt="_musicContent_1fnrj_19",Ft="_bg_1fnrj_10",Ht="_alumWrap_1fnrj_33",_t="_alumTitle_1fnrj_33",qt="_des_1fnrj_39",Vt="_musicDes_1fnrj_44",Bt="_desItem_1fnrj_49",$t="_author_1fnrj_52",Ut="_avator_1fnrj_61",Wt="_authorName_1fnrj_68",zt="_by_1fnrj_75",Kt="_iframe_1fnrj_86",Jt="_sheetName_1fnrj_91",Qt="_alumnContainer_1fnrj_95",Xt="_alumnList_1fnrj_102",Yt="_emtry_1fnrj_109",Gt="_tag_1fnrj_112",Zt="_btns_1fnrj_195",ei="_btn_1fnrj_195",I={musicDeatail:Ot,header:jt,bgImg:Rt,musicContent:Dt,bg:Ft,alumWrap:Ht,alumTitle:_t,des:qt,musicDes:Vt,desItem:Bt,author:$t,avator:Ut,authorName:Wt,by:zt,iframe:Kt,sheetName:Jt,alumnContainer:Qt,alumnList:Xt,emtry:Yt,tag:Gt,btns:Zt,btn:ei};function p(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function ti(e,i){if(!(e instanceof i))throw new TypeError("Cannot call a class as a function")}function He(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 ii(e,i,t){return i&&He(e.prototype,i),t&&He(e,t),e}function si(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function _e(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 qe(e){for(var i=1;i<arguments.length;i++){var t=arguments[i]!=null?arguments[i]:{};i%2?_e(Object(t),!0).forEach(function(s){si(e,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_e(Object(t)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(t,s))})}return e}var Ve={addCSS:!0,thumbWidth:15,watch:!0};function ni(e,i){return function(){return Array.from(document.querySelectorAll(i)).includes(this)}.call(e,i)}function ai(e,i){if(e&&i){var t=new Event(i,{bubbles:!0});e.dispatchEvent(t)}}var le=function(e){return e!=null?e.constructor:null},Ie=function(e,i){return!!(e&&i&&e instanceof i)},Ke=function(e){return e==null},Je=function(e){return le(e)===Object},li=function(e){return le(e)===Number&&!Number.isNaN(e)},Qe=function(e){return le(e)===String},ri=function(e){return le(e)===Boolean},oi=function(e){return le(e)===Function},Xe=function(e){return Array.isArray(e)},Ye=function(e){return Ie(e,NodeList)},ci=function(e){return Ie(e,Element)},ui=function(e){return Ie(e,Event)},hi=function(e){return Ke(e)||(Qe(e)||Xe(e)||Ye(e))&&!e.length||Je(e)&&!Object.keys(e).length},F={nullOrUndefined:Ke,object:Je,number:li,string:Qe,boolean:ri,function:oi,array:Xe,nodeList:Ye,element:ci,event:ui,empty:hi};function di(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 mi(e,i){if(1>i){var t=di(i);return parseFloat(e.toFixed(t))}return Math.round(e/i)*i}var pi=function(){function e(i,t){ti(this,e),F.element(i)?this.element=i:F.string(i)&&(this.element=document.querySelector(i)),F.element(this.element)&&F.empty(this.element.rangeTouch)&&(this.config=qe({},Ve,{},t),this.init())}return ii(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(a){return t.set(a)},!1)})}},{key:"get",value:function(i){if(!e.enabled||!F.event(i))return null;var t,s=i.target,n=i.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,r=parseFloat(s.getAttribute("max"))||100,o=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),a+mi(t/100*(r-a),o)}},{key:"set",value:function(i){e.enabled&&F.event(i)&&!i.target.disabled&&(i.preventDefault(),i.target.value=this.get(i),ai(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(F.empty(i)||F.string(i)?s=Array.from(document.querySelectorAll(F.string(i)?i:'input[type="range"]')):F.element(i)?s=[i]:F.nodeList(i)?s=Array.from(i):F.array(i)&&(s=i.filter(F.element)),F.empty(s))return null;var n=qe({},Ve,{},t);if(F.string(i)&&n.watch){var a=new MutationObserver(function(r){Array.from(r).forEach(function(o){Array.from(o.addedNodes).forEach(function(c){F.element(c)&&ni(c,i)&&new e(c,n)})})});a.observe(document.body,{childList:!0,subtree:!0})}return s.map(function(r){return new e(r,t)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const Z=e=>e!=null?e.constructor:null,W=(e,i)=>Boolean(e&&i&&e instanceof i),xe=e=>e==null,Ge=e=>Z(e)===Object,gi=e=>Z(e)===Number&&!Number.isNaN(e),ge=e=>Z(e)===String,fi=e=>Z(e)===Boolean,Ze=e=>Z(e)===Function,et=e=>Array.isArray(e),yi=e=>W(e,WeakMap),tt=e=>W(e,NodeList),bi=e=>Z(e)===Text,vi=e=>W(e,Event),wi=e=>W(e,KeyboardEvent),Ti=e=>W(e,window.TextTrackCue)||W(e,window.VTTCue),ki=e=>W(e,TextTrack)||!xe(e)&&ge(e.kind),Ai=e=>W(e,Promise)&&Ze(e.then),Ci=e=>e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object",it=e=>xe(e)||(ge(e)||et(e)||tt(e))&&!e.length||Ge(e)&&!Object.keys(e).length,Ei=e=>{if(W(e,window.URL))return!0;if(!ge(e))return!1;let i=e;e.startsWith("http://")&&e.startsWith("https://")||(i=`http://${e}`);try{return!it(new URL(i).hostname)}catch{return!1}};var l={nullOrUndefined:xe,object:Ge,number:gi,string:ge,boolean:fi,function:Ze,array:et,weakMap:yi,nodeList:tt,element:Ci,textNode:bi,event:vi,keyboardEvent:wi,cue:Ti,track:ki,promise:Ai,url:Ei,empty:it};const Ae=(()=>{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!!l.string(t)&&i[t]})();function st(e,i){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},i)}const D={isIE:Boolean(window.document.documentMode),isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)};function Si(e){return JSON.parse(JSON.stringify(e))}function nt(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 l.object(t)?(Object.keys(t).forEach(s=>{l.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 at(e,i){const t=e.length?e:[e];Array.from(t).reverse().forEach((s,n)=>{const a=n>0?i.cloneNode(!0):i,r=s.parentNode,o=s.nextSibling;a.appendChild(s),o?r.insertBefore(a,o):r.appendChild(a)})}function Ce(e,i){l.element(e)&&!l.empty(i)&&Object.entries(i).filter(([,t])=>!l.nullOrUndefined(t)).forEach(([t,s])=>e.setAttribute(t,s))}function b(e,i,t){const s=document.createElement(e);return l.object(i)&&Ce(s,i),l.string(t)&&(s.innerText=t),s}function Pi(e,i){l.element(e)&&l.element(i)&&i.parentNode.insertBefore(e,i.nextSibling)}function Be(e,i,t,s){l.element(i)&&i.appendChild(b(e,t,s))}function U(e){l.nodeList(e)||l.array(e)?Array.from(e).forEach(U):l.element(e)&&l.element(e.parentNode)&&e.parentNode.removeChild(e)}function ce(e){if(!l.element(e))return;let{length:i}=e.childNodes;for(;i>0;)e.removeChild(e.lastChild),i-=1}function de(e,i){return l.element(i)&&l.element(i.parentNode)&&l.element(e)?(i.parentNode.replaceChild(e,i),e):null}function V(e,i){if(!l.string(e)||l.empty(e))return{};const t={},s=L({},i);return e.split(",").forEach(n=>{const a=n.trim(),r=a.replace(".",""),o=a.replace(/[[\]]/g,"").split("="),[c]=o,u=o.length>1?o[1].replace(/["']/g,""):"";switch(a.charAt(0)){case".":l.string(s.class)?t.class=`${s.class} ${r}`:t.class=r;break;case"#":t.id=a.replace("#","");break;case"[":t[c]=u}}),L(s,t)}function J(e,i){if(!l.element(e))return;let t=i;l.boolean(t)||(t=!e.hidden),e.hidden=t}function C(e,i,t){if(l.nodeList(e))return Array.from(e).map(s=>C(s,i,t));if(l.element(e)){let s="toggle";return t!==void 0&&(s=t?"add":"remove"),e.classList[s](i),e.classList.contains(i)}return!1}function me(e,i){return l.element(e)&&e.classList.contains(i)}function Q(e,i){const{prototype:t}=Element;return(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||function(){return Array.from(document.querySelectorAll(i)).includes(this)}).call(e,i)}function Ni(e,i){const{prototype:t}=Element;return(t.closest||function(){let s=this;do{if(Q.matches(s,i))return s;s=s.parentElement||s.parentNode}while(s!==null&&s.nodeType===1);return null}).call(e,i)}function X(e){return this.elements.container.querySelectorAll(e)}function j(e){return this.elements.container.querySelector(e)}function ve(e=null,i=!1){l.element(e)&&(e.focus({preventScroll:!0}),i&&C(e,this.config.classNames.tabFocus))}const $e={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},x={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,i,t){const s=D.isIPhone&&t&&x.playsinline,n=x[e]||i!=="html5";return{api:n,ui:n&&x.rangeInput&&(e!=="video"||!D.isIPhone||s)}},pip:!(D.isIPhone||!l.function(b("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||b("video").disablePictureInPicture)),airplay:l.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(l.empty(e))return!1;const[i]=e.split("/");let t=e;if(!this.isHTML5||i!==this.type)return!1;Object.keys($e).includes(t)&&(t+=`; codecs="${$e[e]}"`);try{return Boolean(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:Ae!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Mi=(()=>{let e=!1;try{const i=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,i),window.removeEventListener("test",null,i)}catch{}return e})();function Y(e,i,t,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||l.empty(i)||!l.function(t))return;const r=i.split(" ");let o=a;Mi&&(o={passive:n,capture:a}),r.forEach(c=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:c,callback:t,options:o}),e[s?"addEventListener":"removeEventListener"](c,t,o)})}function E(e,i="",t,s=!0,n=!1){Y.call(this,e,i,t,!0,s,n)}function fe(e,i="",t,s=!0,n=!1){Y.call(this,e,i,t,!1,s,n)}function Le(e,i="",t,s=!0,n=!1){const a=(...r)=>{fe(e,i,a,s,n),t.apply(this,r)};Y.call(this,e,i,a,!0,s,n)}function v(e,i="",t=!1,s={}){if(!l.element(e)||l.empty(i))return;const n=new CustomEvent(i,{bubbles:t,detail:{...s,plyr:this}});e.dispatchEvent(n)}function Ii(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:i,type:t,callback:s,options:n}=e;i.removeEventListener(t,s,n)}),this.eventListeners=[])}function xi(){return new Promise(e=>this.ready?setTimeout(e,0):E.call(this,this.elements.container,"ready",e)).then(()=>{})}function $(e){l.promise(e)&&e.then(null,()=>{})}function Ee(e){return l.array(e)?e.filter((i,t)=>e.indexOf(i)===t):e}function lt(e,i){return l.array(e)&&e.length?e.reduce((t,s)=>Math.abs(s-i)<Math.abs(t-i)?s:t):null}function rt(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const Ue=[[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 l.array(e)||l.string(e)&&e.includes(":")?(l.array(e)?e:e.split(":")).map(Number).every(l.number):!1}function pe(e){if(!l.array(e)||!e.every(l.number))return null;const[i,t]=e,s=(a,r)=>r===0?a:s(r,a%r),n=s(i,t);return[i/n,t/n]}function Oe(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&&!l.empty(this.embed)&&l.array(this.embed.ratio)&&({ratio:t}=this.embed),t===null&&this.isHTML5){const{videoWidth:s,videoHeight:n}=this.media;t=[s,n]}return pe(t)}function G(e){if(!this.isVideo)return{};const{wrapper:i}=this.elements,t=Oe.call(this,e);if(!l.array(t))return{};const[s,n]=pe(t),a=100/s*n;if(rt(`aspect-ratio: ${s}/${n}`)?i.style.aspectRatio=`${s}/${n}`:i.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const r=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),o=(r-a)/(r/50);this.fullscreen.active?i.style.paddingBottom=null:this.media.style.transform=`translateY(-${o}%)`}else this.isHTML5&&i.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:t}}function ct(e,i,t=.05){const s=e/i,n=lt(Object.keys(Ue),s);return Math.abs(n-s)<=t?Ue[n]:[e,i]}function Li(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const K={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(e=>{const i=e.getAttribute("type");return!!l.empty(i)||x.mime.call(this,i)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:K.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,l.empty(this.config.ratio)||G.call(e),Object.defineProperty(e.media,"quality",{get(){const i=K.getSources.call(e).find(t=>t.getAttribute("src")===e.source);return i&&Number(i.getAttribute("size"))},set(i){if(e.quality!==i){if(e.config.quality.forced&&l.function(e.config.quality.onChange))e.config.quality.onChange(i);else{const t=K.getSources.call(e).find(c=>Number(c.getAttribute("size"))===i);if(!t)return;const{currentTime:s,paused:n,preload:a,readyState:r,playbackRate:o}=e.media;e.media.src=t.getAttribute("src"),(a!=="none"||r)&&(e.once("loadedmetadata",()=>{e.speed=o,e.currentTime=s,n||$(e.play())}),e.media.load())}v.call(e,e.media,"qualitychange",!1,{quality:i})}}})},cancelRequests(){this.isHTML5&&(U(K.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Oi(e){return`${e}-${Math.floor(1e4*Math.random())}`}function Se(e,...i){return l.empty(e)?e:e.toString().replace(/{(\d+)}/g,(t,s)=>i[s].toString())}function ji(e,i){return e===0||i===0||Number.isNaN(e)||Number.isNaN(i)?0:(e/i*100).toFixed(2)}const se=(e="",i="",t="")=>e.replace(new RegExp(i.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),t.toString()),ut=(e="")=>e.toString().replace(/\w\S*/g,i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase());function Ri(e=""){let i=e.toString();return i=se(i,"-"," "),i=se(i,"_"," "),i=ut(i),se(i," ","")}function Di(e=""){let i=e.toString();return i=Ri(i),i.charAt(0).toLowerCase()+i.slice(1)}function Fi(e){const i=document.createDocumentFragment(),t=document.createElement("div");return i.appendChild(t),t.innerHTML=e,i.firstChild.innerText}function Hi(e){const i=document.createElement("div");return i.appendChild(e),i.innerHTML}const We={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},R={get(e="",i={}){if(l.empty(e)||l.empty(i))return"";let t=nt(i.i18n,e);if(l.empty(t))return Object.keys(We).includes(e)?We[e]:"";const s={"{seektime}":i.seekTime,"{title}":i.title};return Object.entries(s).forEach(([n,a])=>{t=se(t,n,a)}),t}};class ne{constructor(i){p(this,"get",t=>{if(!ne.supported||!this.enabled)return null;const s=window.localStorage.getItem(this.key);if(l.empty(s))return null;const n=JSON.parse(s);return l.string(t)&&t.length?n[t]:n}),p(this,"set",t=>{if(!ne.supported||!this.enabled||!l.object(t))return;let s=this.get();l.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 re(e,i="text"){return new Promise((t,s)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",()=>{if(i==="text")try{t(JSON.parse(n.responseText))}catch{t(n.responseText)}else t(n.response)}),n.addEventListener("error",()=>{throw new Error(n.status)}),n.open("GET",e,!0),n.responseType=i,n.send()}catch(n){s(n)}})}function ht(e,i){if(!l.string(e))return;const t=l.string(i);let s=!1;const n=()=>document.getElementById(i)!==null,a=(r,o)=>{r.innerHTML=o,t&&n()||document.body.insertAdjacentElement("afterbegin",r)};if(!t||!n()){const r=ne.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),t&&o.setAttribute("id",i),r){const c=window.localStorage.getItem(`cache-${i}`);if(s=c!==null,s){const u=JSON.parse(c);a(o,u.content)}}re(e).then(c=>{if(!l.empty(c)){if(r)try{window.localStorage.setItem(`cache-${i}`,JSON.stringify({content:c}))}catch{}a(o,c)}}).catch(()=>{})}}const dt=e=>Math.trunc(e/60/60%60,10),_i=e=>Math.trunc(e%60,10);function ye(e=0,i=!1,t=!1){if(!l.number(e))return ye(void 0,i,t);const s=c=>`0${c}`.slice(-2);let n=dt(e);const a=(r=e,Math.trunc(r/60%60,10));var r;const o=_i(e);return n=i||n>0?`${n}:`:"",`${t&&e>0?"-":""}${n}${s(a)}:${s(o)}`}const m={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||D.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:t}},findElements(){try{return this.elements.controls=j.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:X.call(this,this.config.selectors.buttons.play),pause:j.call(this,this.config.selectors.buttons.pause),restart:j.call(this,this.config.selectors.buttons.restart),rewind:j.call(this,this.config.selectors.buttons.rewind),fastForward:j.call(this,this.config.selectors.buttons.fastForward),mute:j.call(this,this.config.selectors.buttons.mute),pip:j.call(this,this.config.selectors.buttons.pip),airplay:j.call(this,this.config.selectors.buttons.airplay),settings:j.call(this,this.config.selectors.buttons.settings),captions:j.call(this,this.config.selectors.buttons.captions),fullscreen:j.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=j.call(this,this.config.selectors.progress),this.elements.inputs={seek:j.call(this,this.config.selectors.inputs.seek),volume:j.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:j.call(this,this.config.selectors.display.buffer),currentTime:j.call(this,this.config.selectors.display.currentTime),duration:j.call(this,this.config.selectors.display.duration)},l.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=m.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(t,"svg");Ce(a,L(i,{"aria-hidden":"true",focusable:"false"}));const r=document.createElementNS(t,"use"),o=`${n}-${e}`;return"href"in r&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",o),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(r),a},createLabel(e,i={}){const t=R.get(e,this.config);return b("span",{...i,class:[i.class,this.config.classNames.hidden].filter(Boolean).join(" ")},t)},createBadge(e){if(l.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=Di(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(r=>{Object.keys(t).includes(r)&&(n[r]=t[r],delete t[r])}),n.element!=="button"||Object.keys(t).includes("type")||(t.type="button"),Object.keys(t).includes("class")?t.class.split(" ").some(r=>r===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:l.empty(n.label)&&(n.label=s),l.empty(n.icon)&&(n.icon=e)}const a=b(n.element);return n.toggle?(a.appendChild(m.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(m.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(m.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(m.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(m.createIcon.call(this,n.icon)),a.appendChild(m.createLabel.call(this,n.label))),L(t,V(this.config.selectors.buttons[s],t)),Ce(a,t),s==="play"?(l.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},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":R.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},i));return this.elements.inputs[e]=t,m.updateRangeFill.call(this,t),pi.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?R.get(s,this.config):"";t.innerText=`% ${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":R.get(e,this.config)}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,i){E.call(this,e,"keydown keyup",t=>{if(!["Space","ArrowUp","ArrowDown","ArrowRight"].includes(t.key)||(t.preventDefault(),t.stopPropagation(),t.type==="keydown"))return;const s=Q(e,'[role="menuitemradio"]');if(!s&&["Space","ArrowRight"].includes(t.key))m.showMenuPanel.call(this,i,!0);else{let n;t.key!=="Space"&&(t.key==="ArrowDown"||s&&t.key==="ArrowRight"?(n=e.nextElementSibling,l.element(n)||(n=e.parentNode.firstElementChild)):(n=e.previousElementSibling,l.element(n)||(n=e.parentNode.lastElementChild)),ve.call(this,n,!0))}},!1),E.call(this,e,"keyup",t=>{t.key==="Return"&&m.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:i,type:t,title:s,badge:n=null,checked:a=!1}){const r=V(this.config.selectors.inputs[t]),o=b("button",L(r,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${r.class?r.class:""}`.trim(),"aria-checked":a,value:e})),c=b("span");c.innerHTML=s,l.element(n)&&c.appendChild(n),o.appendChild(c),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>o.getAttribute("aria-checked")==="true",set(u){u&&Array.from(o.parentNode.children).filter(g=>Q(g,'[role="menuitemradio"]')).forEach(g=>g.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",u?"true":"false")}}),this.listeners.bind(o,"click keyup",u=>{if(!l.keyboardEvent(u)||u.key==="Space"){switch(u.preventDefault(),u.stopPropagation(),o.checked=!0,t){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}m.showMenuPanel.call(this,"home",l.keyboardEvent(u))}},t,!1),m.bindMenuItemShortcuts.call(this,o,t),i.appendChild(o)},formatTime(e=0,i=!1){return l.number(e)?ye(e,dt(this.duration)>0,i):e},updateTimeDisplay(e=null,i=0,t=!1){l.element(e)&&l.number(i)&&(e.innerText=m.formatTime(i,t))},updateVolume(){this.supported.ui&&(l.element(this.elements.inputs.volume)&&m.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),l.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,i=0){l.element(e)&&(e.value=i,m.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!l.event(e))return;let i=0;const t=(s,n)=>{const a=l.number(n)?n:0,r=l.element(s)?s:this.elements.display.buffer;if(l.element(r)){r.value=a;const o=r.getElementsByTagName("span")[0];l.element(o)&&(o.childNodes[0].nodeValue=a)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":i=ji(this.currentTime,this.duration),e.type==="timeupdate"&&m.setRange.call(this,this.elements.inputs.seek,i);break;case"playing":case"progress":t(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(e){const i=l.event(e)?e.target:e;if(l.element(i)&&i.getAttribute("type")==="range"){if(Q(i,this.config.selectors.inputs.seek)){i.setAttribute("aria-valuenow",this.currentTime);const t=m.formatTime(this.currentTime),s=m.formatTime(this.duration),n=R.get("seekLabel",this.config);i.setAttribute("aria-valuetext",n.replace("{currentTime}",t).replace("{duration}",s))}else if(Q(i,this.config.selectors.inputs.volume)){const t=100*i.value;i.setAttribute("aria-valuenow",t),i.setAttribute("aria-valuetext",`${t.toFixed(1)}%`)}else i.setAttribute("aria-valuenow",i.value);D.isWebkit&&i.style.setProperty("--value",i.value/i.max*100+"%")}},updateSeekTooltip(e){var i,t;if(!this.config.tooltips.seek||!l.element(this.elements.inputs.seek)||!l.element(this.elements.display.seekTooltip)||this.duration===0)return;const s=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,a=g=>C(s,n,g);if(this.touch)return void a(!1);let r=0;const o=this.elements.progress.getBoundingClientRect();if(l.event(e))r=100/o.width*(e.pageX-o.left);else{if(!me(s,n))return;r=parseFloat(s.style.left,10)}r<0?r=0:r>100&&(r=100);const c=this.duration/100*r;s.innerText=m.formatTime(c);const u=(i=this.config.markers)===null||i===void 0||(t=i.points)===null||t===void 0?void 0:t.find(({time:g})=>g===Math.round(c));u&&s.insertAdjacentHTML("afterbegin",`${u.label}<br>`),s.style.left=`${r}%`,l.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a(e.type==="mouseenter")},timeUpdate(e){const i=!l.element(this.elements.display.duration)&&this.config.invertTime;m.updateTimeDisplay.call(this,this.elements.display.currentTime,i?this.duration-this.currentTime:this.currentTime,i),e&&e.type==="timeupdate"&&this.media.seeking||m.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return J(this.elements.display.currentTime,!0),void J(this.elements.progress,!0);l.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=l.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&m.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&m.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&m.setMarkers.call(this),m.updateSeekTooltip.call(this)},toggleMenuButton(e,i){J(this.elements.settings.buttons[e],!i)},updateSetting(e,i,t){const s=this.elements.settings.panels[e];let n=null,a=i;if(e==="captions")n=this.currentTrack;else{if(n=l.empty(t)?this[e]:t,l.empty(n)&&(n=this.config[e].default),!l.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(l.element(a)||(a=s&&s.querySelector('[role="menu"]')),!l.element(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=m.getLabel.call(this,e,n);const r=a&&a.querySelector(`[value="${n}"]`);l.element(r)&&(r.checked=!0)},getLabel(e,i){switch(e){case"speed":return i===1?R.get("normal",this.config):`${i}×`;case"quality":if(l.number(i)){const t=R.get(`qualityLabel.${i}`,this.config);return t.length?t:`${i}p`}return ut(i);case"captions":return P.getLabel.call(this);default:return null}},setQualityMenu(e){if(!l.element(this.elements.settings.panels.quality))return;const i="quality",t=this.elements.settings.panels.quality.querySelector('[role="menu"]');l.array(e)&&(this.options.quality=Ee(e).filter(a=>this.config.quality.options.includes(a)));const s=!l.empty(this.options.quality)&&this.options.quality.length>1;if(m.toggleMenuButton.call(this,i,s),ce(t),m.checkMenu.call(this),!s)return;const n=a=>{const r=R.get(`qualityBadge.${a}`,this.config);return r.length?m.createBadge.call(this,r):null};this.options.quality.sort((a,r)=>{const o=this.config.quality.options;return o.indexOf(a)>o.indexOf(r)?1:-1}).forEach(a=>{m.createMenuItem.call(this,{value:a,list:t,type:i,title:m.getLabel.call(this,"quality",a),badge:n(a)})}),m.updateSetting.call(this,i,t)},setCaptionsMenu(){if(!l.element(this.elements.settings.panels.captions))return;const e="captions",i=this.elements.settings.panels.captions.querySelector('[role="menu"]'),t=P.getTracks.call(this),s=Boolean(t.length);if(m.toggleMenuButton.call(this,e,s),ce(i),m.checkMenu.call(this),!s)return;const n=t.map((a,r)=>({value:r,checked:this.captions.toggled&&this.currentTrack===r,title:P.getLabel.call(this,a),badge:a.language&&m.createBadge.call(this,a.language.toUpperCase()),list:i,type:"language"}));n.unshift({value:-1,checked:!this.captions.toggled,title:R.get("disabled",this.config),list:i,type:"language"}),n.forEach(m.createMenuItem.bind(this)),m.updateSetting.call(this,e,i)},setSpeedMenu(){if(!l.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=!l.empty(this.options.speed)&&this.options.speed.length>1;m.toggleMenuButton.call(this,e,t),ce(i),m.checkMenu.call(this),t&&(this.options.speed.forEach(s=>{m.createMenuItem.call(this,{value:s,list:i,type:e,title:m.getLabel.call(this,"speed",s)})}),m.updateSetting.call(this,e,i))},checkMenu(){const{buttons:e}=this.elements.settings,i=!l.empty(e)&&Object.values(e).some(t=>!t.hidden);J(this.elements.settings.menu,!i)},focusFirstMenuItem(e,i=!1){if(this.elements.settings.popup.hidden)return;let t=e;l.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(!l.element(i)||!l.element(t))return;const{hidden:s}=i;let n=s;if(l.boolean(e))n=e;else if(l.keyboardEvent(e)&&e.key==="Escape")n=!1;else if(l.event(e)){const a=l.function(e.composedPath)?e.composedPath()[0]:e.target,r=i.contains(a);if(r||!r&&e.target!==t&&n)return}t.setAttribute("aria-expanded",n),J(i,!n),C(this.elements.container,this.config.classNames.menu.open,n),n&&l.keyboardEvent(e)?m.focusFirstMenuItem.call(this,null,!0):n||s||ve.call(this,t,l.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 U(i),{width:t,height:s}},showMenuPanel(e="",i=!1){const t=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!l.element(t))return;const s=t.parentNode,n=Array.from(s.children).find(a=>!a.hidden);if(x.transitions&&!x.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const a=m.getMenuSize.call(this,t),r=o=>{o.target===s&&["width","height"].includes(o.propertyName)&&(s.style.width="",s.style.height="",fe.call(this,s,Ae,r))};E.call(this,s,Ae,r),s.style.width=`${a.width}px`,s.style.height=`${a.height}px`}J(n,!0),J(t,!1),m.focusFirstMenuItem.call(this,t,i)},setDownloadUrl(){const e=this.elements.buttons.download;l.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:i,createButton:t,createProgress:s,createRange:n,createTime:a,setQualityMenu:r,setSpeedMenu:o,showMenuPanel:c}=m;this.elements.controls=null,l.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 g={class:"plyr__controls__item"};return Ee(l.array(this.config.controls)?this.config.controls:[]).forEach(f=>{if(f==="restart"&&u.appendChild(t.call(this,"restart",g)),f==="rewind"&&u.appendChild(t.call(this,"rewind",g)),f==="play"&&u.appendChild(t.call(this,"play",g)),f==="fast-forward"&&u.appendChild(t.call(this,"fast-forward",g)),f==="progress"){const h=b("div",{class:`${g.class} plyr__progress__container`}),y=b("div",V(this.config.selectors.progress));if(y.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),y.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const k=b("span",{class:this.config.classNames.tooltip},"00:00");y.appendChild(k),this.elements.display.seekTooltip=k}this.elements.progress=y,h.appendChild(this.elements.progress),u.appendChild(h)}if(f==="current-time"&&u.appendChild(a.call(this,"currentTime",g)),f==="duration"&&u.appendChild(a.call(this,"duration",g)),f==="mute"||f==="volume"){let{volume:h}=this.elements;if(l.element(h)&&u.contains(h)||(h=b("div",L({},g,{class:`${g.class} plyr__volume`.trim()})),this.elements.volume=h,u.appendChild(h)),f==="mute"&&h.appendChild(t.call(this,"mute")),f==="volume"&&!D.isIos){const y={max:1,step:.05,value:this.config.volume};h.appendChild(n.call(this,"volume",L(y,{id:`plyr-volume-${e.id}`})))}}if(f==="captions"&&u.appendChild(t.call(this,"captions",g)),f==="settings"&&!l.empty(this.config.settings)){const h=b("div",L({},g,{class:`${g.class} plyr__menu`.trim(),hidden:""}));h.appendChild(t.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const y=b("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),k=b("div"),A=b("div",{id:`plyr-settings-${e.id}-home`}),M=b("div",{role:"menu"});A.appendChild(M),k.appendChild(A),this.elements.settings.panels.home=A,this.config.settings.forEach(w=>{const d=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,d,w),E.call(this,d,"click",()=>{c.call(this,w,!1)});const S=b("span",null,R.get(w,this.config)),O=b("span",{class:this.config.classNames.menu.value});O.innerHTML=e[w],S.appendChild(O),d.appendChild(S),M.appendChild(d);const H=b("div",{id:`plyr-settings-${e.id}-${w}`,hidden:""}),_=b("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});_.appendChild(b("span",{"aria-hidden":!0},R.get(w,this.config))),_.appendChild(b("span",{class:this.config.classNames.hidden},R.get("menuBack",this.config))),E.call(this,H,"keydown",q=>{q.key==="ArrowLeft"&&(q.preventDefault(),q.stopPropagation(),c.call(this,"home",!0))},!1),E.call(this,_,"click",()=>{c.call(this,"home",!1)}),H.appendChild(_),H.appendChild(b("div",{role:"menu"})),k.appendChild(H),this.elements.settings.buttons[w]=d,this.elements.settings.panels[w]=H}),y.appendChild(k),h.appendChild(y),u.appendChild(h),this.elements.settings.popup=y,this.elements.settings.menu=h}if(f==="pip"&&x.pip&&u.appendChild(t.call(this,"pip",g)),f==="airplay"&&x.airplay&&u.appendChild(t.call(this,"airplay",g)),f==="download"){const h=L({},g,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(h.download="");const{download:y}=this.config.urls;!l.url(y)&&this.isEmbed&&L(h,{icon:`logo-${this.provider}`,label:this.provider}),u.appendChild(t.call(this,"download",h))}f==="fullscreen"&&u.appendChild(t.call(this,"fullscreen",g))}),this.isHTML5&&r.call(this,K.getQualityOptions.call(this)),o.call(this),u},inject(){if(this.config.loadSprite){const n=m.getIconUrl.call(this);n.cors&&ht(n.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const i={id:this.id,seektime:this.config.seekTime,title:this.config.title};let t=!0;l.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,i)),this.config.controls||(this.config.controls=[]),l.element(this.config.controls)||l.string(this.config.controls)?e=this.config.controls:(e=m.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:P.getLabel.call(this)}),t=!1);let s;if(t&&l.string(this.config.controls)&&(e=(n=>{let a=n;return Object.entries(i).forEach(([r,o])=>{a=se(a,`{${r}}`,o)}),a})(e)),l.string(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),l.element(s)||(s=this.elements.container),s[l.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),l.element(this.elements.controls)||m.findElements.call(this),!l.empty(this.elements.buttons)){const n=a=>{const r=this.config.classNames.controlPressed;Object.defineProperty(a,"pressed",{enumerable:!0,get:()=>me(a,r),set(o=!1){C(a,r,o)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(a=>{l.array(a)||l.nodeList(a)?Array.from(a).filter(Boolean).forEach(n):n(a)})}if(D.isEdge&&st(s),this.config.tooltips.controls){const{classNames:n,selectors:a}=this.config,r=`${a.controls.wrapper} ${a.labels} .${n.hidden}`,o=X.call(this,r);Array.from(o).forEach(c=>{C(c,this.config.classNames.hidden,!1),C(c,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 a=null;const r=`${this.config.classNames.tooltip}--visible`,o=c=>C(a,r,c);t.forEach(c=>{const u=b("span",{class:this.config.classNames.marker},""),g=c.time/this.duration*100+"%";a&&(u.addEventListener("mouseenter",()=>{c.label||(a.style.left=g,a.innerHTML=c.label,o(!0))}),u.addEventListener("mouseleave",()=>{o(!1)})),u.addEventListener("click",()=>{this.currentTime=c.time}),u.style.left=g,n.appendChild(u)}),s.appendChild(n),this.config.tooltips.seek||(a=b("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(s)}};function mt(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 pt(e){const i=new URLSearchParams;return l.object(e)&&Object.entries(e).forEach(([t,s])=>{i.set(t,s)}),i}const P={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!x.textTracks)return void(l.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&m.setCaptionsMenu.call(this));if(l.element(this.elements.captions)||(this.elements.captions=b("div",V(this.config.selectors.captions)),Pi(this.elements.captions,this.elements.wrapper)),D.isIE&&window.URL){const s=this.media.querySelectorAll("track");Array.from(s).forEach(n=>{const a=n.getAttribute("src"),r=mt(a);r!==null&&r.hostname!==window.location.href.hostname&&["http:","https:"].includes(r.protocol)&&re(a,"blob").then(o=>{n.setAttribute("src",window.URL.createObjectURL(o))}).catch(()=>{U(n)})})}const e=Ee((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(s=>s.split("-")[0]));let i=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();i==="auto"&&([i]=e);let t=this.storage.get("captions");if(l.boolean(t)||({active:t}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:t,language:i,languages:e}),this.isHTML5){const s=this.config.captions.update?"addtrack removetrack":"removetrack";E.call(this,this.media.textTracks,s,P.update.bind(this))}setTimeout(P.update.bind(this),0)},update(){const e=P.getTracks.call(this,!0),{active:i,language:t,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find(r=>r.language===t));this.isHTML5&&this.isVideo&&e.filter(r=>!s.get(r)).forEach(r=>{this.debug.log("Track added",r),s.set(r,{default:r.mode==="showing"}),r.mode==="showing"&&(r.mode="hidden"),E.call(this,r,"cuechange",()=>P.updateCues.call(this))}),(a&&this.language!==t||!e.includes(n))&&(P.setLanguage.call(this,t),P.toggle.call(this,i&&a)),this.elements&&C(this.elements.container,this.config.classNames.captions.enabled,!l.empty(e)),l.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&m.setCaptionsMenu.call(this)},toggle(e,i=!0){if(!this.supported.ui)return;const{toggled:t}=this.captions,s=this.config.classNames.captions.active,n=l.nullOrUndefined(e)?!t:e;if(n!==t){if(i||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!i){const a=P.getTracks.call(this),r=P.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=r.language,void P.set.call(this,a.indexOf(r))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),C(this.elements.container,s,n),this.captions.toggled=n,m.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=P.getTracks.call(this);if(e!==-1)if(l.number(e))if(e in t){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=t[e],{language:n}=s||{};this.captions.currentTrackNode=s,m.updateSetting.call(this,"captions"),i||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),v.call(this,this.media,"languagechange")}P.toggle.call(this,!0,i),this.isHTML5&&this.isVideo&&P.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else P.toggle.call(this,!1,i)},setLanguage(e,i=!0){if(!l.string(e))return void this.debug.warn("Invalid language argument",e);const t=e.toLowerCase();this.captions.language=t;const s=P.getTracks.call(this),n=P.findTrack.call(this,[t]);P.set.call(this,s.indexOf(n),i)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(i=>!this.isHTML5||e||this.captions.meta.has(i)).filter(i=>["captions","subtitles"].includes(i.kind))},findTrack(e,i=!1){const t=P.getTracks.call(this),s=r=>Number((this.captions.meta.get(r)||{}).default),n=Array.from(t).sort((r,o)=>s(o)-s(r));let a;return e.every(r=>(a=n.find(o=>o.language===r),!a)),a||(i?n[0]:void 0)},getCurrentTrack(){return P.getTracks.call(this)[this.currentTrack]},getLabel(e){let i=e;return!l.track(i)&&x.textTracks&&this.captions.toggled&&(i=P.getCurrentTrack.call(this)),l.track(i)?l.empty(i.label)?l.empty(i.language)?R.get("enabled",this.config):e.language.toUpperCase():i.label:R.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!l.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!l.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let i=e;if(!i){const s=P.getCurrentTrack.call(this);i=Array.from((s||{}).activeCues||[]).map(n=>n.getCueAsHTML()).map(Hi)}const t=i.map(s=>s.trim()).join(`
- `);if(t!==this.elements.captions.innerHTML){ce(this.elements.captions);const s=b("span",V(this.config.selectors.caption));s.innerHTML=t,this.elements.captions.appendChild(s),v.call(this,this.media,"cuechange")}}},gt={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.2/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},we={active:"picture-in-picture",inactive:"inline"},z={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Te={audio:"audio",video:"video"};function qi(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?z.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?z.vimeo:null}const ke=()=>{};class Vi{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):ke}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):ke}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):ke}}class B{constructor(i){p(this,"onChange",()=>{if(!this.enabled)return;const t=this.player.elements.buttons.fullscreen;l.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)}),p(this,"toggleFallback",(t=!1)=>{if(t?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=t?"hidden":"",C(this.target,this.player.config.classNames.fullscreen.fallback,t),D.isIos){let s=document.head.querySelector('meta[name="viewport"]');const n="viewport-fit=cover";s||(s=document.createElement("meta"),s.setAttribute("name","viewport"));const a=l.string(s.content)&&s.content.includes(n);t?(this.cleanupViewport=!a,a||(s.content+=`,${n}`)):this.cleanupViewport&&(s.content=s.content.split(",").filter(r=>r.trim()!==n).join(","))}this.onChange()}),p(this,"trapFocus",t=>{if(D.isIos||!this.active||t.key!=="Tab")return;const s=document.activeElement,n=X.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[a]=n,r=n[n.length-1];s!==r||t.shiftKey?s===a&&t.shiftKey&&(r.focus(),t.preventDefault()):(a.focus(),t.preventDefault())}),p(this,"update",()=>{if(this.enabled){let t;t=this.forceFallback?"Fallback (forced)":B.native?"Native":"Fallback",this.player.debug.log(`${t} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");C(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}),p(this,"enter",()=>{this.enabled&&(D.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!B.native||this.forceFallback?this.toggleFallback(!0):this.prefix?l.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),p(this,"exit",()=>{if(this.enabled)if(D.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),$(this.player.play());else if(!B.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!l.empty(this.prefix)){const t=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${t}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),p(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=i,this.prefix=B.prefix,this.property=B.property,this.scrollPosition={x:0,y:0},this.forceFallback=i.config.fullscreen.fallback==="force",this.player.elements.fullscreen=i.config.fullscreen.container&&Ni(this.player.elements.container,i.config.fullscreen.container),E.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),E.call(this.player,this.player.elements.container,"dblclick",t=>{l.element(this.player.elements.controls)&&this.player.elements.controls.contains(t.target)||this.player.listeners.proxy(t,this.toggle,"fullscreen")}),E.call(this,this.player.elements.container,"keydown",t=>this.trapFocus(t)),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return B.native&&!this.forceFallback}static get prefix(){if(l.function(document.exitFullscreen))return"";let i="";return["webkit","moz","ms"].some(t=>!(!l.function(document[`${t}ExitFullscreen`])&&!l.function(document[`${t}CancelFullScreen`]))&&(i=t,!0)),i}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get enabled(){return(B.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!B.native||this.forceFallback)return me(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(){return D.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function ue(e,i=1){return new Promise((t,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=i?t:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})})}const N={addStyleHook(){C(this.elements.container,this.config.selectors.container.replace(".",""),!0),C(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)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void N.toggleNativeControls.call(this,!0);l.element(this.elements.controls)||(m.inject.call(this),this.listeners.controls()),N.toggleNativeControls.call(this),this.isHTML5&&P.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,m.updateVolume.call(this),m.timeUpdate.call(this),m.durationUpdate.call(this),N.checkPlaying.call(this),C(this.elements.container,this.config.classNames.pip.supported,x.pip&&this.isHTML5&&this.isVideo),C(this.elements.container,this.config.classNames.airplay.supported,x.airplay&&this.isHTML5),C(this.elements.container,this.config.classNames.isIos,D.isIos),C(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{v.call(this,this.media,"ready")},0),N.setTitle.call(this),this.poster&&N.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&m.durationUpdate.call(this),this.config.mediaMetadata&&m.setMediaMetadata.call(this)},setTitle(){let e=R.get("play",this.config);if(l.string(this.config.title)&&!l.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=j.call(this,"iframe");if(!l.element(i))return;const t=l.empty(this.config.title)?"video":this.config.title,s=R.get("frameTitle",this.config);i.setAttribute("title",s.replace("{title}",t))}},togglePoster(e){C(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"),xi.call(this).then(()=>ue(e)).catch(t=>{throw e===this.poster&&N.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:""}),N.togglePoster.call(this,!0),e)))},checkPlaying(e){C(this.elements.container,this.config.classNames.playing,this.playing),C(this.elements.container,this.config.classNames.paused,this.paused),C(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",R.get(this.playing?"pause":"play",this.config))}),l.event(e)&&e.type==="timeupdate"||N.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{C(this.elements.container,this.config.classNames.loading,this.loading),N.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(Boolean(e||this.loading||this.paused||i.pressed||i.hover||t))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!l.empty(e)&&l.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),l.empty(this.media.style)&&this.media.removeAttribute("style")}};class Bi{constructor(i){p(this,"firstTouch",()=>{const{player:t}=this,{elements:s}=t;t.touch=!0,C(s.container,t.config.classNames.isTouch,!0)}),p(this,"setTabFocus",t=>{const{player:s}=this,{elements:n}=s,{key:a,type:r,timeStamp:o}=t;if(clearTimeout(this.focusTimer),r==="keydown"&&a!=="Tab")return;r==="keydown"&&(this.lastKeyDown=o);const c=o-this.lastKeyDown<=20;(r!=="focus"||c)&&((()=>{const u=s.config.classNames.tabFocus;C(X.call(s,`.${u}`),u,!1)})(),r!=="focusout"&&(this.focusTimer=setTimeout(()=>{const u=document.activeElement;n.container.contains(u)&&C(document.activeElement,s.config.classNames.tabFocus,!0)},10)))}),p(this,"global",(t=!0)=>{const{player:s}=this;s.config.keyboard.global&&Y.call(s,window,"keydown keyup",this.handleKey,t,!1),Y.call(s,document.body,"click",this.toggleMenu,t),Le.call(s,document.body,"touchstart",this.firstTouch),Y.call(s,document.body,"keydown focus blur focusout",this.setTabFocus,t,!1,!0)}),p(this,"container",()=>{const{player:t}=this,{config:s,elements:n,timers:a}=t;!s.keyboard.global&&s.keyboard.focused&&E.call(t,n.container,"keydown keyup",this.handleKey,!1),E.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);let g=0;["touchstart","touchmove","mousemove"].includes(c.type)&&(N.toggleControls.call(t,!0),g=t.touch?3e3:2e3),clearTimeout(a.controls),a.controls=setTimeout(()=>N.toggleControls.call(t,!1),g)});const r=()=>{if(!t.isVimeo||t.config.vimeo.premium)return;const c=n.wrapper,{active:u}=t.fullscreen,[g,f]=Oe.call(t),h=rt(`aspect-ratio: ${g} / ${f}`);if(!u)return void(h?(c.style.width=null,c.style.height=null):(c.style.maxWidth=null,c.style.margin=null));const[y,k]=Li(),A=y/k>g/f;h?(c.style.width=A?"auto":"100%",c.style.height=A?"100%":"auto"):(c.style.maxWidth=A?k/f*g+"px":null,c.style.margin=A?"0 auto":null)},o=()=>{clearTimeout(a.resized),a.resized=setTimeout(r,50)};E.call(t,n.container,"enterfullscreen exitfullscreen",c=>{const{target:u}=t.fullscreen;u===n.container&&(!t.isEmbed&&l.empty(t.config.ratio)||(r(),(c.type==="enterfullscreen"?E:fe).call(t,window,"resize",o)))})}),p(this,"media",()=>{const{player:t}=this,{elements:s}=t;if(E.call(t,t.media,"timeupdate seeking seeked",a=>m.timeUpdate.call(t,a)),E.call(t,t.media,"durationchange loadeddata loadedmetadata",a=>m.durationUpdate.call(t,a)),E.call(t,t.media,"ended",()=>{t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())}),E.call(t,t.media,"progress playing seeking seeked",a=>m.updateProgress.call(t,a)),E.call(t,t.media,"volumechange",a=>m.updateVolume.call(t,a)),E.call(t,t.media,"playing play pause ended emptied timeupdate",a=>N.checkPlaying.call(t,a)),E.call(t,t.media,"waiting canplay seeked playing",a=>N.checkLoading.call(t,a)),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){const a=j.call(t,`.${t.config.classNames.video}`);if(!l.element(a))return;E.call(t,s.container,"click",r=>{([s.container,a].includes(r.target)||a.contains(r.target))&&(t.touch&&t.config.hideControls||(t.ended?(this.proxy(r,t.restart,"restart"),this.proxy(r,()=>{$(t.play())},"play")):this.proxy(r,()=>{$(t.togglePlay())},"play")))})}t.supported.ui&&t.config.disableContextMenu&&E.call(t,s.wrapper,"contextmenu",a=>{a.preventDefault()},!1),E.call(t,t.media,"volumechange",()=>{t.storage.set({volume:t.volume,muted:t.muted})}),E.call(t,t.media,"ratechange",()=>{m.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})}),E.call(t,t.media,"qualitychange",a=>{m.updateSetting.call(t,"quality",null,a.detail.quality)}),E.call(t,t.media,"ready qualitychange",()=>{m.setDownloadUrl.call(t)});const n=t.config.events.concat(["keyup","keydown"]).join(" ");E.call(t,t.media,n,a=>{let{detail:r={}}=a;a.type==="error"&&(r=t.media.error),v.call(t,s.container,a.type,!0,r)})}),p(this,"proxy",(t,s,n)=>{const{player:a}=this,r=a.config.listeners[n];let o=!0;l.function(r)&&(o=r.call(a,t)),o!==!1&&l.function(s)&&s.call(a,t)}),p(this,"bind",(t,s,n,a,r=!0)=>{const{player:o}=this,c=o.config.listeners[a],u=l.function(c);E.call(o,t,s,g=>this.proxy(g,n,a),r&&!u)}),p(this,"controls",()=>{const{player:t}=this,{elements:s}=t,n=D.isIE?"change":"input";if(s.buttons.play&&Array.from(s.buttons.play).forEach(a=>{this.bind(a,"click",()=>{$(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",a=>{a.stopPropagation(),a.preventDefault(),m.toggleMenu.call(t,a)},null,!1),this.bind(s.buttons.settings,"keyup",a=>{["Space","Enter"].includes(a.key)&&(a.key!=="Enter"?(a.preventDefault(),a.stopPropagation(),m.toggleMenu.call(t,a)):m.focusFirstMenuItem.call(t,null,!0))},null,!1),this.bind(s.settings.menu,"keydown",a=>{a.key==="Escape"&&m.toggleMenu.call(t,a)}),this.bind(s.inputs.seek,"mousedown mousemove",a=>{const r=s.progress.getBoundingClientRect(),o=100/r.width*(a.pageX-r.left);a.currentTarget.setAttribute("seek-value",o)}),this.bind(s.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",a=>{const r=a.currentTarget,o="play-on-seeked";if(l.keyboardEvent(a)&&!["ArrowLeft","ArrowRight"].includes(a.key))return;t.lastSeekTime=Date.now();const c=r.hasAttribute(o),u=["mouseup","touchend","keyup"].includes(a.type);c&&u?(r.removeAttribute(o),$(t.play())):!u&&t.playing&&(r.setAttribute(o,""),t.pause())}),D.isIos){const a=X.call(t,'input[type="range"]');Array.from(a).forEach(r=>this.bind(r,n,o=>st(o.target)))}this.bind(s.inputs.seek,n,a=>{const r=a.currentTarget;let o=r.getAttribute("seek-value");l.empty(o)&&(o=r.value),r.removeAttribute("seek-value"),t.currentTime=o/r.max*t.duration},"seek"),this.bind(s.progress,"mouseenter mouseleave mousemove",a=>m.updateSeekTooltip.call(t,a)),this.bind(s.progress,"mousemove touchmove",a=>{const{previewThumbnails:r}=t;r&&r.loaded&&r.startMove(a)}),this.bind(s.progress,"mouseleave touchend click",()=>{const{previewThumbnails:a}=t;a&&a.loaded&&a.endMove(!1,!0)}),this.bind(s.progress,"mousedown touchstart",a=>{const{previewThumbnails:r}=t;r&&r.loaded&&r.startScrubbing(a)}),this.bind(s.progress,"mouseup touchend",a=>{const{previewThumbnails:r}=t;r&&r.loaded&&r.endScrubbing(a)}),D.isWebkit&&Array.from(X.call(t,'input[type="range"]')).forEach(a=>{this.bind(a,"input",r=>m.updateRangeFill.call(t,r.target))}),t.config.toggleInvert&&!l.element(s.display.duration)&&this.bind(s.display.currentTime,"click",()=>{t.currentTime!==0&&(t.config.invertTime=!t.config.invertTime,m.timeUpdate.call(t))}),this.bind(s.inputs.volume,n,a=>{t.volume=a.target.value},"volume"),this.bind(s.controls,"mouseenter mouseleave",a=>{s.controls.hover=!t.touch&&a.type==="mouseenter"}),s.fullscreen&&Array.from(s.fullscreen.children).filter(a=>!a.contains(s.container)).forEach(a=>{this.bind(a,"mouseenter mouseleave",r=>{s.controls&&(s.controls.hover=!t.touch&&r.type==="mouseenter")})}),this.bind(s.controls,"mousedown mouseup touchstart touchend touchcancel",a=>{s.controls.pressed=["mousedown","touchstart"].includes(a.type)}),this.bind(s.controls,"focusin",()=>{const{config:a,timers:r}=t;C(s.controls,a.classNames.noTransition,!0),N.toggleControls.call(t,!0),setTimeout(()=>{C(s.controls,a.classNames.noTransition,!1)},0);const o=this.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout(()=>N.toggleControls.call(t,!1),o)}),this.bind(s.inputs.volume,"wheel",a=>{const r=a.webkitDirectionInvertedFromDevice,[o,c]=[a.deltaX,-a.deltaY].map(f=>r?-f:f),u=Math.sign(Math.abs(o)>Math.abs(c)?o:c);t.increaseVolume(u/50);const{volume:g}=t.media;(u===1&&g<1||u===-1&&g>0)&&a.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.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(i){const{player:t}=this,{elements:s}=t,{key:n,type:a,altKey:r,ctrlKey:o,metaKey:c,shiftKey:u}=i,g=a==="keydown",f=g&&n===this.lastKey;if(!(r||o||c||u)&&!!n){if(g){const y=document.activeElement;if(l.element(y)){const{editable:k}=t.config.selectors,{seek:A}=s.inputs;if(y!==A&&Q(y,k)||i.key==="Space"&&Q(y,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(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":f||(h=parseInt(n,10),t.currentTime=t.duration/10*h);break;case"Space":case"k":f||$(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":f||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":f||t.toggleCaptions();break;case"l":t.loop=!t.loop}n==="Escape"&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null;var h}}toggleMenu(i){m.toggleMenu.call(this.player,i)}}function $i(e,i){return e(i={exports:{}},i.exports),i.exports}var Ui=$i(function(e,i){e.exports=function(){var t=function(){},s={},n={},a={};function r(h,y){h=h.push?h:[h];var k,A,M,w=[],d=h.length,S=d;for(k=function(O,H){H.length&&w.push(O),--S||y(w)};d--;)A=h[d],(M=n[A])?k(A,M):(a[A]=a[A]||[]).push(k)}function o(h,y){if(h){var k=a[h];if(n[h]=y,k)for(;k.length;)k[0](h,y),k.splice(0,1)}}function c(h,y){h.call&&(h={success:h}),y.length?(h.error||t)(y):(h.success||t)(h)}function u(h,y,k,A){var M,w,d=document,S=k.async,O=(k.numRetries||0)+1,H=k.before||t,_=h.replace(/[\?|#].*$/,""),q=h.replace(/^(css|img)!/,"");A=A||0,/(^css!|\.css$)/.test(_)?((w=d.createElement("link")).rel="stylesheet",w.href=q,(M="hideFocus"in w)&&w.relList&&(M=0,w.rel="preload",w.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(_)?(w=d.createElement("img")).src=q:((w=d.createElement("script")).src=h,w.async=S===void 0||S),w.onload=w.onerror=w.onbeforeload=function(Re){var oe=Re.type[0];if(M)try{w.sheet.cssText.length||(oe="e")}catch(bt){bt.code!=18&&(oe="e")}if(oe=="e"){if((A+=1)<O)return u(h,y,k,A)}else if(w.rel=="preload"&&w.as=="style")return w.rel="stylesheet";y(h,oe,Re.defaultPrevented)},H(h,w)!==!1&&d.head.appendChild(w)}function g(h,y,k){var A,M,w=(h=h.push?h:[h]).length,d=w,S=[];for(A=function(O,H,_){if(H=="e"&&S.push(O),H=="b"){if(!_)return;S.push(O)}--w||y(S)},M=0;M<d;M++)u(h[M],A,k)}function f(h,y,k){var A,M;if(y&&y.trim&&(A=y),M=(A?k:y)||{},A){if(A in s)throw"LoadJS";s[A]=!0}function w(d,S){g(h,function(O){c(M,O),d&&c({success:d,error:S},O),o(A,O)},M)}if(M.returnPromise)return new Promise(w);w()}return f.ready=function(h,y){return r(h,function(k){c(y,k)}),f},f.done=function(h){o(h,[])},f.reset=function(){s={},n={},a={}},f.isDefined=function(h){return h in s},f}()});function je(e){return new Promise((i,t)=>{Ui(e,{success:i,error:t})})}function Wi(e){return l.empty(e)?null:l.number(Number(e))?e:e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:e}function zi(e){const i=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return i&&i.length===5?i[4]:null}function te(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;C(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,G.call(e),l.object(window.Vimeo)?Pe.ready.call(e):je(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 a=e.media.getAttribute("src"),r="";l.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),r=e.media.getAttribute(e.config.attributes.embed.hash)):r=zi(a);const o=r?{h:r}:{};t&&Object.assign(n,{controls:!1,sidedock:!1});const c=pt({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative,...o,...n}),u=Wi(a),g=b("iframe"),f=Se(e.config.urls.vimeo.iframe,u,c);if(g.setAttribute("src",f),g.setAttribute("allowfullscreen",""),g.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),l.empty(s)||g.setAttribute("referrerPolicy",s),t||!i.customControls)g.setAttribute("data-poster",e.poster),e.media=de(g,e.media);else{const d=b("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});d.appendChild(g),e.media=de(d,e.media)}i.customControls||re(Se(e.config.urls.vimeo.api,f)).then(d=>{!l.empty(d)&&d.thumbnail_url&&N.setPoster.call(e,d.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(g,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(te.call(e,!0),e.embed.play()),e.media.pause=()=>(te.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:h}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>h,set(d){const{embed:S,media:O,paused:H,volume:_}=e,q=H&&!S.hasPlayed;O.seeking=!0,v.call(e,O,"seeking"),Promise.resolve(q&&S.setVolume(0)).then(()=>S.setCurrentTime(d)).then(()=>q&&S.pause()).then(()=>q&&S.setVolume(_)).catch(()=>{})}});let y=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>y,set(d){e.embed.setPlaybackRate(d).then(()=>{y=d,v.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:k}=e.config;Object.defineProperty(e.media,"volume",{get:()=>k,set(d){e.embed.setVolume(d).then(()=>{k=d,v.call(e,e.media,"volumechange")})}});let{muted:A}=e.config;Object.defineProperty(e.media,"muted",{get:()=>A,set(d){const S=!!l.boolean(d)&&d;e.embed.setVolume(S?0:e.config.volume).then(()=>{A=S,v.call(e,e.media,"volumechange")})}});let M,{loop:w}=e.config;Object.defineProperty(e.media,"loop",{get:()=>w,set(d){const S=l.boolean(d)?d:e.config.loop.active;e.embed.setLoop(S).then(()=>{w=S})}}),e.embed.getVideoUrl().then(d=>{M=d,m.setDownloadUrl.call(e)}).catch(d=>{this.debug.warn(d)}),Object.defineProperty(e.media,"currentSrc",{get:()=>M}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(d=>{const[S,O]=d;e.embed.ratio=ct(S,O),G.call(this)}),e.embed.setAutopause(e.config.autopause).then(d=>{e.config.autopause=d}),e.embed.getVideoTitle().then(d=>{e.config.title=d,N.setTitle.call(this)}),e.embed.getCurrentTime().then(d=>{h=d,v.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(d=>{e.media.duration=d,v.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(d=>{e.media.textTracks=d,P.setup.call(e)}),e.embed.on("cuechange",({cues:d=[]})=>{const S=d.map(O=>Fi(O.text));P.updateCues.call(e,S)}),e.embed.on("loaded",()=>{e.embed.getPaused().then(d=>{te.call(e,!d),d||v.call(e,e.media,"playing")}),l.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",()=>{te.call(e,!0),v.call(e,e.media,"playing")}),e.embed.on("pause",()=>{te.call(e,!1)}),e.embed.on("timeupdate",d=>{e.media.seeking=!1,h=d.seconds,v.call(e,e.media,"timeupdate")}),e.embed.on("progress",d=>{e.media.buffered=d.percent,v.call(e,e.media,"progress"),parseInt(d.percent,10)===1&&v.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(S=>{S!==e.media.duration&&(e.media.duration=S,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",d=>{e.media.error=d,v.call(e,e.media,"error")}),i.customControls&&setTimeout(()=>N.build.call(e),0)}};function Ki(e){return l.empty(e)?null:e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:e}function ie(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 Ji(e){return e.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const he={setup(){if(C(this.elements.wrapper,this.config.classNames.embed,!0),l.object(window.YT)&&l.function(window.YT.Player))he.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{l.function(e)&&e(),he.ready.call(this)},je(this.config.urls.youtube.sdk).catch(i=>{this.debug.warn("YouTube API failed to load",i)})}},getTitle(e){re(Se(this.config.urls.youtube.api,e)).then(i=>{if(l.object(i)){const{title:t,height:s,width:n}=i;this.config.title=t,N.setTitle.call(this),this.embed.ratio=ct(n,s)}G.call(this)}).catch(()=>{G.call(this)})},ready(){const e=this,i=e.config.youtube,t=e.media&&e.media.getAttribute("id");if(!l.empty(t)&&t.startsWith("youtube-"))return;let s=e.media.getAttribute("src");l.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=Ki(s),a=b("div",{id:Oi(e.provider),"data-poster":i.customControls?e.poster:void 0});if(e.media=de(a,e.media),i.customControls){const r=o=>`https://i.ytimg.com/vi/${n}/${o}default.jpg`;ue(r("maxres"),121).catch(()=>ue(r("sd"),121)).catch(()=>ue(r("hq"))).then(o=>N.setPoster.call(e,o.src)).then(o=>{o.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:n,host:Ji(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.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},i),events:{onError(r){if(!e.media.error){const o=r.data,c={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."}[o]||"An unknown error occured";e.media.error={code:o,message:c},v.call(e,e.media,"error")}},onPlaybackRateChange(r){const o=r.target;e.media.playbackRate=o.getPlaybackRate(),v.call(e,e.media,"ratechange")},onReady(r){if(l.function(e.media.play))return;const o=r.target;he.getTitle.call(e,n),e.media.play=()=>{ie.call(e,!0),o.playVideo()},e.media.pause=()=>{ie.call(e,!1),o.pauseVideo()},e.media.stop=()=>{o.stopVideo()},e.media.duration=o.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(o.getCurrentTime()),set(f){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,v.call(e,e.media,"seeking"),o.seekTo(f)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>o.getPlaybackRate(),set(f){o.setPlaybackRate(f)}});let{volume:c}=e.config;Object.defineProperty(e.media,"volume",{get:()=>c,set(f){c=f,o.setVolume(100*c),v.call(e,e.media,"volumechange")}});let{muted:u}=e.config;Object.defineProperty(e.media,"muted",{get:()=>u,set(f){const h=l.boolean(f)?f:u;u=h,o[h?"mute":"unMute"](),o.setVolume(100*c),v.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>o.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const g=o.getAvailablePlaybackRates();e.options.speed=g.filter(f=>e.config.speed.options.includes(f)),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=o.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(()=>N.build.call(e),50)},onStateChange(r){const o=r.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(r.data)&&(e.media.seeking=!1,v.call(e,e.media,"seeked")),r.data){case-1:v.call(e,e.media,"timeupdate"),e.media.buffered=o.getVideoLoadedFraction(),v.call(e,e.media,"progress");break;case 0:ie.call(e,!1),e.media.loop?(o.stopVideo(),o.playVideo()):v.call(e,e.media,"ended");break;case 1:i.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(ie.call(e,!0),v.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{v.call(e,e.media,"timeupdate")},50),e.media.duration!==o.getDuration()&&(e.media.duration=o.getDuration(),v.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),ie.call(e,!1);break;case 3:v.call(e,e.media,"waiting")}v.call(e,e.elements.container,"statechange",!1,{code:r.data})}}})}},ft={setup(){this.media?(C(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),C(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&C(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=b("div",{class:this.config.classNames.video}),at(this.media,this.elements.wrapper),this.elements.poster=b("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?K.setup.call(this):this.isYouTube?he.setup.call(this):this.isVimeo&&Pe.setup.call(this)):this.debug.warn("No media element found!")}};class Qi{constructor(i){p(this,"load",()=>{this.enabled&&(l.object(window.google)&&l.object(window.google.ima)?this.ready():je(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),p(this,"ready",()=>{var t;this.enabled||((t=this).manager&&t.manager.destroy(),t.elements.displayContainer&&t.elements.displayContainer.destroy(),t.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),p(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()}),p(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)}}),p(this,"pollCountdown",(t=!1)=>{if(!t)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const s=ye(Math.max(this.manager.getRemainingTime(),0)),n=`${R.get("advertisement",this.player.config)} - ${s}`;this.elements.container.setAttribute("data-badge-text",n)},100)}),p(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],a=>this.onAdEvent(a))}),this.trigger("loaded")}),p(this,"addCuePoints",()=>{l.empty(this.cuePoints)||this.cuePoints.forEach(t=>{if(t!==0&&t!==-1&&t<this.player.duration){const s=this.player.elements.progress;if(l.element(s)){const n=100/this.player.duration*t,a=b("span",{class:this.player.config.classNames.cues});a.style.left=`${n.toString()}%`,s.appendChild(a)}}})}),p(this,"onAdEvent",t=>{const{container:s}=this.player.elements,n=t.getAd(),a=t.getAdData();switch((r=>{v.call(this.player,this.player.media,`ads${r.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:a.adError&&this.player.debug.warn(`Non-fatal ad error: ${a.adError.getMessage()}`)}}),p(this,"onAdError",t=>{this.cancel(),this.player.debug.warn("Ads error",t)}),p(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;l.empty(this.cuePoints)||this.cuePoints.forEach((a,r)=>{s<a&&a<n&&(this.manager.discardAdBreak(),this.cuePoints.splice(r,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)})}),p(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(()=>{})}),p(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,$(this.player.media.play())}),p(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),p(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),p(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(()=>{})}),p(this,"trigger",(t,...s)=>{const n=this.events[t];l.array(n)&&n.forEach(a=>{l.function(a)&&a.apply(this,s)})}),p(this,"on",(t,s)=>(l.array(this.events[t])||(this.events[t]=[]),this.events[t].push(s),this)),p(this,"startSafetyTimer",(t,s)=>{this.player.debug.log(`Safety timer invoked from: ${s}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},t)}),p(this,"clearSafetyTimer",t=>{l.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&&(!l.empty(i.publisherId)||l.url(i.tagUrl))}get tagUrl(){const{config:i}=this;return l.url(i.tagUrl)?i.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${pt({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:i.publisherId})}`}}function yt(e=0,i=0,t=255){return Math.min(Math.max(e,i),t)}const Xi=e=>{const i=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(t=>{const s={};t.split(/\r\n|\n|\r/).forEach(n=>{if(l.number(s.startTime)){if(!l.empty(n.trim())&&l.empty(s.text)){const a=n.trim().split("#xywh=");[s.text]=a,a[1]&&([s.x,s.y,s.w,s.h]=a[1].split(","))}}else{const a=n.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);a&&(s.startTime=60*Number(a[1]||0)*60+60*Number(a[2])+Number(a[3])+Number(`0.${a[4]}`),s.endTime=60*Number(a[6]||0)*60+60*Number(a[7])+Number(a[8])+Number(`0.${a[9]}`))}}),s.text&&i.push(s)}),i},ze=(e,i)=>{const t={};return e>i.width/i.height?(t.width=i.width,t.height=1/e*i.width):(t.height=i.height,t.width=e*i.height),t};class Ne{constructor(i){p(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.loaded=!0)})}),p(this,"getThumbnails",()=>new Promise(t=>{const{src:s}=this.player.config.previewThumbnails;if(l.empty(s))throw new Error("Missing previewThumbnails.src config attribute");const n=()=>{this.thumbnails.sort((a,r)=>a.height-r.height),this.player.debug.log("Preview thumbnails",this.thumbnails),t()};if(l.function(s))s(a=>{this.thumbnails=a,n()});else{const a=(l.string(s)?[s]:s).map(r=>this.getThumbnail(r));Promise.all(a).then(n)}})),p(this,"getThumbnail",t=>new Promise(s=>{re(t).then(n=>{const a={frames:Xi(n),height:null,urlPrefix:""};a.frames[0].text.startsWith("/")||a.frames[0].text.startsWith("http://")||a.frames[0].text.startsWith("https://")||(a.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));const r=new Image;r.onload=()=>{a.height=r.naturalHeight,a.width=r.naturalWidth,this.thumbnails.push(a),s()},r.src=a.urlPrefix+a.frames[0].text})})),p(this,"startMove",t=>{if(this.loaded&&l.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 a=this.player.elements.progress.getBoundingClientRect(),r=100/a.width*(t.pageX-a.left);this.seekTime=this.player.media.duration*(r/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.innerText=ye(this.seekTime);const o=(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));o&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${o.label}<br>`)}this.showImageAtCurrentTime()}}),p(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),p(this,"startScrubbing",t=>{(l.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()))}),p(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Le.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),p(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})}),p(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),l.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)}),p(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),p(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const t=this.thumbnails[0].frames.findIndex(a=>this.seekTime>=a.startTime&&this.seekTime<=a.endTime),s=t>=0;let n=0;this.mouseDown||this.toggleThumbContainer(s),s&&(this.thumbnails.forEach((a,r)=>{this.loadedImages.includes(a.frames[t].text)&&(n=r)}),t!==this.showingThumb&&(this.showingThumb=t,this.loadImage(n)))}),p(this,"loadImage",(t=0)=>{const s=this.showingThumb,n=this.thumbnails[t],{urlPrefix:a}=n,r=n.frames[s],o=n.frames[s].text,c=a+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,r,t,s,o,!1),this.currentImageElement.dataset.index=s,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const u=new Image;u.src=c,u.dataset.index=s,u.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log(`Loading image: ${c}`),u.onload=()=>this.showImage(u,r,t,s,o,!0),this.loadingImage=u,this.removeOldImages(u)}}),p(this,"showImage",(t,s,n,a,r,o=!0)=>{this.player.debug.log(`Showing thumb: ${r}. num: ${a}. qual: ${n}. newimg: ${o}`),this.setImageSizeAndOffset(t,s),o&&(this.currentImageContainer.appendChild(t),this.currentImageElement=t,this.loadedImages.includes(r)||this.loadedImages.push(r)),this.preloadNearby(a,!0).then(this.preloadNearby(a,!1)).then(this.getHigherQuality(n,t,s,r))}),p(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:a}=this;setTimeout(()=>{a.removeChild(s),this.player.debug.log(`Removing thumb: ${s.dataset.filename}`)},n)}})}),p(this,"preloadNearby",(t,s=!0)=>new Promise(n=>{setTimeout(()=>{const a=this.thumbnails[0].frames[t].text;if(this.showingThumbFilename===a){let r;r=s?this.thumbnails[0].frames.slice(t):this.thumbnails[0].frames.slice(0,t).reverse();let o=!1;r.forEach(c=>{const u=c.text;if(u!==a&&!this.loadedImages.includes(u)){o=!0,this.player.debug.log(`Preloading thumb filename: ${u}`);const{urlPrefix:g}=this.thumbnails[0],f=g+u,h=new Image;h.src=f,h.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${u}`),this.loadedImages.includes(u)||this.loadedImages.push(u),n()}}}),o||n()}},300)})),p(this,"getHigherQuality",(t,s,n,a)=>{if(t<this.thumbnails.length-1){let r=s.naturalHeight;this.usingSprites&&(r=n.h),r<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===a&&(this.player.debug.log(`Showing higher quality thumb for: ${a}`),this.loadImage(t+1))},300)}}),p(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)}),p(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)}),p(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),p(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()}),p(this,"setThumbContainerPos",()=>{const t=this.player.elements.progress.getBoundingClientRect(),s=this.player.elements.container.getBoundingClientRect(),{container:n}=this.elements.thumb,a=s.left-t.left+10,r=s.right-t.left-n.clientWidth-10,o=this.mousePosX-t.left-n.clientWidth/2,c=yt(o,a,r);n.style.left=`${c}px`,n.style.setProperty("--preview-arrow-offset",o-c+"px")}),p(this,"setScrubbingContainerSize",()=>{const{width:t,height:s}=ze(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`}),p(this,"setImageSizeAndOffset",(t,s)=>{if(!this.usingSprites)return;const n=this.thumbContainerHeight/s.h;t.style.height=t.naturalHeight*n+"px",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}=ze(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 Me={insertElements(e,i){l.string(i)?Be(e,this.media,{src:i}):l.array(i)&&i.forEach(t=>{Be(e,this.media,t)})},change(e){nt(e,"sources.length")?(K.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],U(this.media),this.media=null,l.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:i,type:t}=e,[{provider:s=z.html5,src:n}]=i,a=s==="html5"?t:"div",r=s==="html5"?{}:{src:n};Object.assign(this,{provider:s,type:t,supported:x.check(t,s,this.config.playsinline),media:b(a,r)}),this.elements.container.appendChild(this.media),l.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),l.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","")),N.addStyleHook.call(this),this.isHTML5&&Me.insertElements.call(this,"source",i),this.config.title=e.title,ft.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Me.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&N.build.call(this),this.isHTML5&&this.media.load(),l.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 Ne(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class ae{constructor(i,t){if(p(this,"play",()=>l.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>$(this.media.play())),this.media.play()):null),p(this,"pause",()=>this.playing&&l.function(this.media.pause)?this.media.pause():null),p(this,"togglePlay",o=>(l.boolean(o)?o:!this.playing)?this.play():this.pause()),p(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):l.function(this.media.stop)&&this.media.stop()}),p(this,"restart",()=>{this.currentTime=0}),p(this,"rewind",o=>{this.currentTime-=l.number(o)?o:this.config.seekTime}),p(this,"forward",o=>{this.currentTime+=l.number(o)?o:this.config.seekTime}),p(this,"increaseVolume",o=>{const c=this.media.muted?0:this.volume;this.volume=c+(l.number(o)?o:0)}),p(this,"decreaseVolume",o=>{this.increaseVolume(-o)}),p(this,"airplay",()=>{x.airplay&&this.media.webkitShowPlaybackTargetPicker()}),p(this,"toggleControls",o=>{if(this.supported.ui&&!this.isAudio){const c=me(this.elements.container,this.config.classNames.hideControls),u=o===void 0?void 0:!o,g=C(this.elements.container,this.config.classNames.hideControls,u);if(g&&l.array(this.config.controls)&&this.config.controls.includes("settings")&&!l.empty(this.config.settings)&&m.toggleMenu.call(this,!1),g!==c){const f=g?"controlshidden":"controlsshown";v.call(this,this.media,f)}return!g}return!1}),p(this,"on",(o,c)=>{E.call(this,this.elements.container,o,c)}),p(this,"once",(o,c)=>{Le.call(this,this.elements.container,o,c)}),p(this,"off",(o,c)=>{fe(this.elements.container,o,c)}),p(this,"destroy",(o,c=!1)=>{if(!this.ready)return;const u=()=>{document.body.style.overflow="",this.embed=null,c?(Object.keys(this.elements).length&&(U(this.elements.buttons.play),U(this.elements.captions),U(this.elements.controls),U(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),l.function(o)&&o()):(Ii.call(this),K.cancelRequests.call(this),de(this.elements.original,this.elements.container),v.call(this,this.elements.original,"destroyed",!0),l.function(o)&&o.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?(N.toggleNativeControls.call(this,!0),u()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&l.function(this.embed.destroy)&&this.embed.destroy(),u()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(u),setTimeout(u,200))}),p(this,"supports",o=>x.mime.call(this,o)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=x.touch,this.media=i,l.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||l.nodeList(this.media)||l.array(this.media))&&(this.media=this.media[0]),this.config=L({},gt,ae.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 Vi(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",x),l.nullOrUndefined(this.media)||!l.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!x.check().api)return void this.debug.error("Setup failed: no support");const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const n=this.media.tagName.toLowerCase();let a=null,r=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),l.element(a)){if(r=mt(a.getAttribute("src")),this.provider=qi(r.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",r.search.length){const o=["1","true"];o.includes(r.searchParams.get("autoplay"))&&(this.config.autoplay=!0),o.includes(r.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=o.includes(r.searchParams.get("playsinline")),this.config.youtube.hl=r.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(l.empty(this.provider)||!Object.values(z).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Te.video;break;case"video":case"audio":this.type=n,this.provider=z.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=x.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new Bi(this),this.storage=new ne(this),this.media.plyr=this,l.element(this.elements.container)||(this.elements.container=b("div",{tabindex:0}),at(this.media,this.elements.container)),N.migrateStyles.call(this),N.addStyleHook.call(this),ft.setup.call(this),this.config.debug&&E.call(this,this.elements.container,this.config.events.join(" "),o=>{this.debug.log(`event: ${o.type}`)}),this.fullscreen=new B(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&N.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Qi(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>$(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ne(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===z.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===z.youtube}get isVimeo(){return this.provider===z.vimeo}get isVideo(){return this.type===Te.video}get isAudio(){return this.type===Te.audio}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&this.currentTime===0)}get ended(){return Boolean(this.media.ended)}set currentTime(i){if(!this.duration)return;const t=l.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 l.number(i)?i:i&&i.length&&this.duration>0?i.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const i=parseFloat(this.config.duration),t=(this.media||{}).duration,s=l.number(t)&&t!==1/0?t:0;return i||s}set volume(i){let t=i;l.string(t)&&(t=Number(t)),l.number(t)||(t=this.storage.get("volume")),l.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!l.empty(i)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(i){let t=i;l.boolean(t)||(t=this.storage.get("muted")),l.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(i){let t=null;l.number(i)&&(t=i),l.number(t)||(t=this.storage.get("speed")),l.number(t)||(t=this.config.speed.selected);const{minimumSpeed:s,maximumSpeed:n}=this;t=yt(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=[!l.empty(i)&&Number(i),this.storage.get("quality"),t.selected,t.default].find(l.number),a=!0;if(!s.includes(n)){const r=lt(s,n);this.debug.warn(`Unsupported quality option: ${n}, using ${r} instead`),n=r,a=!1}t.selected=n,this.media.quality=n,a&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(i){const t=l.boolean(i)?i:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(i){Me.change.call(this,i)}get source(){return this.media.currentSrc}get download(){const{download:i}=this.config.urls;return l.url(i)?i:this.source}set download(i){l.url(i)&&(this.config.urls.download=i,m.setDownloadUrl.call(this))}set poster(i){this.isVideo?N.setPoster.call(this,i,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const i=pe(Oe.call(this));return l.array(i)?i.join(":"):i}set ratio(i){this.isVideo?l.string(i)&&ot(i)?(this.config.ratio=pe(i),G.call(this)):this.debug.error(`Invalid aspect ratio specified (${i})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(i){this.config.autoplay=l.boolean(i)?i:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(i){P.toggle.call(this,i,!1)}set currentTrack(i){P.set.call(this,i,!1),P.setup.call(this)}get currentTrack(){const{toggled:i,currentTrack:t}=this.captions;return i?t:-1}set language(i){P.setLanguage.call(this,i,!1)}get language(){return(P.getCurrentTrack.call(this)||{}).language}set pip(i){if(!x.pip)return;const t=l.boolean(i)?i:!this.pip;l.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?we.active:we.inactive),l.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return x.pip?l.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 Ne(this))}static supported(i,t,s){return x.check(i,t,s)}static loadSprite(i,t){return ht(i,t)}static setup(i,t={}){let s=null;return l.string(i)?s=Array.from(document.querySelectorAll(i)):l.nodeList(i)?s=Array.from(i):l.array(i)&&(s=i.filter(l.element)),l.empty(s)?null:s.map(n=>new ae(n,t))}}ae.defaults=Si(gt);const Yi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAACVRJREFUaEPlWn1wXFUVP+fu5m3bILRKP9ICFsdWgSLCSC3QQTuitQVpBY3U6RST7L67SdqM/IGjlimLQHVwBpnUuHvfbhLpdKRGrEJpEa2iTEGwjoKtoOBI/aCh1drYEtrdvL3HOeGlE5p9777Nbj5mvP+9ueec+/u9e++5555zEf7PGo4nX6XUUgBYAQDvAQAkor9Go9Fd8Xj86fHCMS6ElVLvB4BOALjah9heIpLJZPLFsSY+5oQzmcxViPgEALwjiAwRHRdCrLBt+5mxJD2mhDs7O+e6rvt7AJgVksSRaDR6eVNT06GQ8mWLjSVhdBzncSJaXg4qXg22bfM+p3L0wsqOGeFsNtuqtf52WCDD5YQQ6xOJRMdodE06Y0K4s7Pzfa7r/g4AppkA+PS/GY1Gr2hqavrzKPV91apOOJVKRevq6n4NAB8KAPscIp9KtCRA5re9vb1XpVIpt5qkq044k8nchYibAkCeKBaLH+T+SCTyfJD3JqKvJZPJOyctYaXUh4loLyJGA0AmpJQ57ldKxQEg6ydLRC4iLpVSPlct0lWb4fb29pmxWOw3ADA/ANyjUspVw/uVUo8AwI0BOgfz+fzitra2f1WDdFUIt7e3n21Z1m5EvCYA1BGt9aXNzc1Hhsuk0+lZQoj9QWc1ET1dKBRWtrW1Ha+UdMWEs9nshVprnqVL/cCwg9JafzqZTLLciJbJZFYJIX5EREF49gshViUSiVcrIT1qwh0dHWfV1NRsAICNRFQbBAIRO23b5v3q2xzHyRFRk8FOPwDcOzAwsKW1tfWN0RAvi3B7e3vMsqxliHgzAHzOFB97gF6YOnXqNevWrWOwvm3r1q21J0+e5FvTZSGInACA7xPRDwuFwpNtbW35EDqDIkbCvMcikchKIvoUAHwCAM4KaxwADgPAYinl38PoKKUuAAB2fLPDyHsyPNM/RcSdxWJx95k+4kw7JQlzpFQsFm8CgBu84ECUAWBI9JgQYmUikXi2HN1sNrtEa70bAGaUo+fJFhGRj7DHXNfd0dLSMiJSexthx3Eu0Vq3CyGWGRyICcurrute39ra+pJJsFR/R0fHRZwYAIALR6Pv6fDl4xdCiA2JROI0jtOElVLXE9EPEHFqBYOw6k+01realpZpDO+4ehAAPmmSNfSfAoDPSCn5B761h9Pp9CIhBO+dUZMlon8AwBeTyeSOCgG+TT2TyfDWegARz6/A7imt9ZXNzc0HBgkrpX4FANeO0uABREwT0XellG+O0kagmlJqGiJ+gYiaAWDRKMd4Skr5EfRmlyOdsE0DwD4A2BmJRB6Jx+MHwipWQy6Xyy1yXXc1It4AAFcCQGiHypEeKqXWA8CWIDCIyGfoHnb9hUJhV2tr6+vVAF+pjY6OjjmWZbHv4SPzOlMABADrmfC9APDVUoMT0bOIeI9lWT9vaGjgzT9pW3d395RCofAxIroDEf3u2Zs577SJiO7yYfK6ZVmXNzQ0TIoZNf3t7u7uOYVCgZOGc0rJIuKdTPhmInrYzxgi/nL69OnX1dfXF00DTmR/T09PpK+vbw8RfTSAy028pDnvxDMYlDfeLKXcOJGETGMHbU1P97jruvOGjiUmc0+AUc1e0bbtx00DT0S/4zgriOgxg8feJKW8e5BwKpWy5s6dy+UOdvMlGxEd5f3c2NjIAcakaV1dXefzvkXEdwUs5X2HDh1amkqlCqdDy3Q6PV8IwalV36Dd89rXSikHJgNjpVQNET0V4JUZ5jGt9RXNzc0H+ePMy8ONRPRjw7XxG1LKr0wSwl8HgC8HYCFEXG3b9qNDMiOuh0qp+wDg9gAjA7z0k8nkCxNJOpPJXIaIHPHVBOD4ppTyS8P7RxD2EulPAgDXcv3avt7e3iWpVIrDzHFvqVRK1NXV8T3b1+cAwN7e3t5lZybySyYA0un0PG8/+1b9EHGNbdvbx50tADiOcwsRPRQwNmdIed++dqaMb4rHcZzlRMTHkJ/MPinl4okgrJTiq6zf7PK+5Toz16RHtMCcllKqCwAaAtz9Itu2/ziepDkrQ0RBN7RuKWWjL+YgsF1dXTMHBgY4ATfFR26jlHLzeBJWSvFFhy88pdqpmpqaCxobG32rFMaspeM4DxLROp8B9kgpPz7OhH/GV8FSYxLR1mQyeWsQHiNhrgogIp/NpdpRKeW540z43wBQMqoiotV+1Y0hjEbCSqlzEfGIXxaztrb2nLVr11Zc8wnz07Zt23Z2f3//f0s6o7fqzbOklPxDfJuRMGsqpTjZXbKcQkQLk8nkK2EAVyqTyWQWIOLLPnb6pZTGIkFYwv8EgHk+f3bcPLXBQ78mpTzP9FMrJkxEl4zHgzImkslkLkZEv2OwqoS5RlQy6opEIgvi8fhfTH+2Gv25XO69xWLRb/sckVIaa1JhZ/gYAEwvBToSicyPx+N/qwYhk41cLvfuYrE4eM0r0fqklMZ6VFjCvk6rUCjM27Bhw5i9nBtObMuWLXMtyxoRH3sy1XNajuPkicjy+bMzTUcB325mz559sRDiIi6ZENFg/gwRT3CJRmv90uHDh1803b74iASAklEUIhZs246ZVknYGeZroJ/sdCnliLPRK49wQoFrQ1xXPscAhm1wnXcHEfHjlxFlG6UU2+jzsUNSSmMVwkiY0ygAUAgAWzsEjmURcbnW+vOIyNUA47noY/cNItophPgeET0xlFLyMqxBLwksU/opDGFO4/oOks/np8RisauJaI33FOKdpmVVZv9/+GkDIj6Uz+eficVivhWQGTNmTKuvrz9ZUaTlZRc4aee3XI76xbZlEgsjHjSWa9u2xS+GKiLshZYczi0Ig2gCZV6RUi40jW9c0h7h+wHgNpOxCe5/QEppxBiKsHfg/ykgERCW68tE9DwiDh4tRDQTEfmhqXFmDAPws6WFYV4LhSLszTJX378Tlpknx/uJs4vbhRA7EokEX0JGtGw2e57Wmo+vWwCAS52hcXnGWqSU6TDYyjKslLqNiO4zvJblcfezV0XE7eU+FeSnjETEWck1Qc8ZPXJc0bxdSvmtMGRZpizCrJDNZj+gtb4DAPicHcx1eY+92bE9rLXezo9HwgIIkvOeY/Csf3b4sieik0KIXa7r3t3S0vKHcsYqm/CQ8Z6eHquvr29BsVi0otHooUQiwTeqMWtc7OZyp9a637Ksg6N9kTBqwmPGbIwN/w/2ErkXj1bdFAAAAABJRU5ErkJggg==",Gi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABOtJREFUaEPtWF1MHFUU/s4Mi6yUGmj6ZDVGURrKQLQEdldLpNoCkrbSsgOxxEaM+m5MNLFpMGqiifFdjfgTiDCLrW2lpaLFUGWXSlUYSkTRmLQ+NYVYoBCWmWNmhbrA7O7MsKWS7H3bne985/vuOffOvUNY54PWuX6kDNzqCt6UCkihQDOYGwC4FgyGQdSievyNyTacdAOFoc+3MGuXzIQSiXcNeQ5cTqaJpBvI71NyRcJvZiI1xv0jPnksZSBqBlIVWN4OqRayuUBSLbSuWkjqb3+SdKFcE7Tmi6X1g2bVdroGtvW3FYm62MiC3qOW1n1htZMst5AUVF4E8A4AAmMKaWK1WnKgNxkVkM63l0ETvgQ4CwADeEn1yu9aMWHJgBRsfxmgt5YQEqaJsHeoVD4b/b/dChT2KzuZcQKMzKWC+RXVW/d2IhMJDRhtA52OxSCaEZhrBn11Zxaf2zFQFArs1pmNdnGb8gtck6idEhooDCqvMvBGrJlgYBYCaodL5U4DY9VAQb9SDR0dBGTE4ibg8JBXfjNeFRIayO9TckQBvWBsi0M0ByJZ9fiPWzEghQL7wGgH+LaYnISLmo6yEZ88vioDRnBur7LZ7cLXAApjk3GYdHpqnvBzvMNcmiAUMWufAbR41DajHJoJ4/GxMvnKqtfAIsHW/k82uXT3VwAeikM6D5Feg8avm2KIj4DpCIC0OBw/hoWZ3b+UHrqaSLzxPGELRZNI51qzyeXqYkaJFXIHmB8wH65QdxycsBpry0CknUKnNrox1QWG12oSSzhCcHoSVX/skv+2hF8A2TZgxOV992FWelpWJxg77CSLvWDp3Nz8terRR56dtMvnyICRpHDw00xczzjJQLndpNF4IvTAPbtnqOjpaSc8jg0Yybb0Ke5swnEAu5wkB6F7Qse+yz55xlG83UVsluSeno8ysjIyjwKosini9OTs9P4/y5+ZtRm3BL6qCiwy5Q8r6eIUAmDstSSGcELbAP9IgTxnCR8HdMNAbqhlYwa7KgVBiLzaddZ1aOnB4YdrfreSZPvAe65wOLuNgf3x8AQ66nKN118ofiFshbfg+2P3QZzzCiQIEV26PjtL4a4xT8M14/cNA1JQCQLwLKvPtKAjb9An/2Ul2aM9PWnj7istzKgzwxOhPWdmc8O35eXzVviK+pQ7dQGjK0+qCKleObKNRxvQzdYEMaqGfHKXlYQRjKKI0t308cKXuagwblUv0SHIsmaVq7BPqWTCaRM8q145UpFoA8ZFwmTQE6rXb0YSW0dTk1BQUVAL0qoBIpHROXhmJICmJmOSLA8pGKgC+JRZgOqVI9pvjgHLEuMDUwb+nR8HLfT/qoDwvOqt/SBJmmzRSMGO5wD9/dWtAcKv6WnuBy8U77luK/sqwdsHTt4+Nz/zExgPWDMQCuhgjvVmHgbRYejhUVFIt7wNOvGg6XMiBFcemI17eIH5xkisevwrtlHj7pntJOnax/CE6q3LWbqN9infgLBz7cU4yMg4q/rkx5a9BwIHAW5xQHcLQqhB9fpblxgw+l8KBYwPVM7O9mtno1v1+CtAFDk5LFm093Yrd2RuQBuAyrXTYytT1/QU6qPvzSt3HQZJ5wO10LmRCcXE2JSMi48tmf+BjX3xKjEGIFCzWuLviHxajhpJudA4FJeUsJSBpEzjKkjWfQX+AVpIDU+9KBU+AAAAAElFTkSuQmCC",Zi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAdFJREFUaEPtWztOw0AQfZtIVHwOwA2ILOgScwZqN/RU5DRQ0dO45gyx04GscAMOAKZCSowcyQgkE89YzCJ5X+qn2ZnZec/e56yDp9/JKt0bv+MKFS5RYbJd1mEFh/v1Pu6eJ8mHj1Scj0VOF+nxGnhwDmdt61UVHsfAxdN58mKdj3nB9c6OXrH8rdimwLrozRGm1jttXnC0TK+xwY1o50aYF9PkVoTtCbIvOE8zVJiJ8nPIi1kSi7A9QfYFZ+kbgANhfmURJ4dCbC+Yj4IrTWZFnJjmZBq8LjTKUha8a8e5wxo+CLAcaUGTVBByuKNd5LBqnrrB5HB3j3QIcpgc/tkBipaOQZ1oilZni5QAihZFi6JlqitfwVt8Y6kto2S1N3jZ5ntvC+7yjb2laLTQd9/bSX1jo1y8hW18b6fyjb2lZ7TQCHMXaXxjozy8hXXIXaTzjb3lZrRQGWDBwY205mOX0Zx5C1uLVnCPpeBePJpxCurV0pJDPA/zPMzzsJ/zsBWPyWFymBwmh/9SX0y7WSdK0aJoUbRMaWYanBwWyC0/iAuapIFwpDXdkmBDfA4H9gdxje89iCsAGt97CJc8pL73YK7xSHzvQV3U2uF7/8tVvE9Thj+uDI02lgAAAABJRU5ErkJggg==",es=""+new URL("icon-music-detail.0b87075b.png",import.meta.url).href,ds=At({name:"musicAlumn",setup(){const e=Mt(),i=Nt();Ct(e,()=>{window.scrollTo({top:0}),n()});const t=De({}),s=De({iframe:"",audioFileUrl:""}),n=async()=>{const f=e.query.id;if(!!f)try{const{data:h}=await Tt.get(`/api-website/open/music/sheet/detail/${f}`);if(Object.assign(t,h),Array.isArray(h.background)&&h.background.length){const y=h.background[0];s.audioFileUrl=y.audioFileUrl,console.log(e),location.host.includes("dev.colexiu")||location.host.includes("192.168")?s.iframe=`https://dev.colexiu.com/accompany/colxiu-website.html?id=${f}&part-index=${y.id}`:s.iframe=`https://online.colexiu.com/accompany/colxiu-website.html?id=${f}&part-index=${y.id}`}}catch{}};Et(()=>{n(),c()});const a=be(!0),r=be(0);St("scroll",()=>{const f=document.body.scrollTop||document.documentElement.scrollTop;a.value=!(f>55),r.value=f/55});const c=()=>{new ae("#musicAudio",{controls:["play-large","play","progress","current-time","duration"]})},u={FREE:{color:"#01B84F",text:"\u514D\u8D39"},VIP:{color:"#CD863E",bgColor:"#FFE1C2",text:"\u4F1A\u5458"},CHARGE:{color:"#3591CE",bgColor:"#C7E9FF",text:"\u70B9\u64AD"}},g=be();return()=>{var f,h,y,k,A,M,w;return T("div",{class:I.musicDeatail},[T(vt,{style:{background:`rgba(255,255,255,${r.value})`},class:I.header,theme:a.value?"dark":"light"},null),T("img",{class:I.bgImg,src:((f=t.teacher)==null?void 0:f.userAvatar)||Fe||t.titleImg},null),T("div",{class:I.musicContent},[T("div",{class:I.bg},[T("div",{class:I.alumWrap},[T("div",{class:[I.alumTitle,"van-ellipsis"]},[t.musicSheetName]),T("div",{class:I.musicDes},[T("div",{class:I.des},[T("div",{class:[I.desItem,"van-multi-ellipsis--l2"]},[ee("\u4F5C\u66F2\uFF1A"),t.composer]),T("div",{class:I.desItem},[ee("\u58F0\u90E8\uFF1A"),t.subjectNames])]),T("div",{class:I.author},[T("img",{class:I.avator,src:((h=t.teacher)==null?void 0:h.userAvatar)||Fe},null),T("div",{class:I.authorName},[T("div",{class:"van-ellipsis"},[(y=t.teacher)==null?void 0:y.userName]),T("div",{class:I.by},[ee("\u4E0A\u4F20\u8005")])]),T(It,{name:Zi,onClick:()=>{var d;(d=g.value)==null||d.toggle()}},null)])])])])]),T("div",{class:I.alumnContainer},[T("div",{class:[I.alumnList,!s.audioFileUrl&&I.emtry]},[s.audioFileUrl&&T(Pt,null,[T("div",{class:I.tag,style:{color:(k=u[t.chargeType])==null?void 0:k.color,backgroundColor:(A=u[t.chargeType])==null?void 0:A.bgColor}},[(M=u[t.chargeType])==null?void 0:M.text]),T("audio",{id:"musicAudio",src:s.audioFileUrl},null)]),T("div",{class:I.iframe},[T("div",{class:I.sheetName},[t.musicSheetName]),T("iframe",{id:"musicIframe",src:s.iframe},null)])]),T("div",{class:I.btns},[T("div",{class:I.btn,onClick:()=>{var d;return(d=g.value)==null?void 0:d.toggle()}},[T("img",{src:Yi},null),T("div",null,[T("span",{style:{color:"#EB5E00"}},[t.favoriteNum])," ",ee("\u6536\u85CF")])]),T("div",{class:I.btn,onClick:()=>{var d;return(d=g.value)==null?void 0:d.toggle()}},[T("img",{src:Gi},null),T("div",null,[T("span",{style:{color:"#EB5E00"}},null),ee(" \u4E0B\u8F7D")])])]),T("img",{style:{width:"100%"},src:es},null),T(wt,{title:"TA\u7684\u66F2\u8C31",onMore:()=>{i.push({path:"/search"})}},null),T(kt,{list:(w=t.teacher)==null?void 0:w.musicSheetList},null)]),T(xt,null,null),T(Lt,{ref:g},null)])}}});export{ds as default};
|