@mux/mux-player 3.1.1-canary.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1220,7 +1220,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1220
1220
  </style>
1221
1221
  <slot></slot>
1222
1222
  <div id="arrow"></div>
1223
- `;var il=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Mr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Pe(this,"#"+this.bounds))!=null?e:Z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),L=v?parseFloat(v.replace("px","")):0,A=l-n+f-L,T=c-b+f+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Uc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$i.PLACEMENT,$i.BOUNDS]}get placement(){return R(this,$i.PLACEMENT)}set placement(e){I(this,$i.PLACEMENT,e)}get bounds(){return R(this,$i.BOUNDS)}set bounds(e){I(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",il);var lf=1,df=t=>t.mediaMuted?0:t.mediaVolume,uf=t=>`${Math.round(t*100)}%`,al=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",V.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=df(this),this.range.setAttribute("aria-valuetext",uf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,lf)}set mediaVolume(e){D(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){U(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return R(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){I(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",al);var E=bh(require("@mux/mux-video")),y=require("@mux/playback-core");var qc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Bc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Nn(i)}: ${a}; `)}),e?e.trim():void 0}function Nn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function rl(t){let e=cf(t).toString();return e?"?"+e:""}function cf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var nl=(t,e)=>!t||!e?!1:t.contains(e)?!0:nl(t,e.getRootNode().host);var Hc="mux.com",mf=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},hf=mf(),Bn=()=>hf,$c=(t,{token:e,customDomain:i=Hc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${rl({token:e,time:n,program_time:r})}`},Wc=(t,{token:e,customDomain:i=Hc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${rl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ba=t=>{if(t){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ei.StreamTypes.LIVE}};var pf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Fc(t){var e;return(e=pf[t])!=null?e:Pn(t)}var Jt,jt,me,Un=class{constructor(e,i){X(this,Jt,void 0);X(this,jt,void 0);X(this,me,[]);Ae(this,Jt,e),Ae(this,jt,i)}[Symbol.iterator](){return P(this,me).values()}get length(){return P(this,me).length}get value(){var e;return(e=P(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Ae(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return P(this,me)[e]}values(){return P(this,me).values()}keys(){return P(this,me).keys()}forEach(e){P(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||P(this,me).push(r)}),!(this.value===""&&!((i=P(this,Jt))!=null&&i.hasAttribute(`${P(this,jt)}`)))&&((a=P(this,Jt))==null||a.setAttribute(`${P(this,jt)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{P(this,me).splice(P(this,me).indexOf(a),1)}),(i=P(this,Jt))==null||i.setAttribute(`${P(this,jt)}`,`${this.value}`)}contains(e){return P(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};Jt=new WeakMap,jt=new WeakMap,me=new WeakMap;var Vc=`[mux-player ${Bn()}]`;function Ze(...t){console.warn(Vc,...t)}function Ee(...t){console.error(Vc,...t)}function ol(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Kc.i18n)("Read more: ")}
1223
+ `;var il=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!Mr(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;let i=this.placement;if(i==="left"||i==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Pe(this,"#"+this.bounds))!=null?e:Z(this);if(!r)return;let{x:n,width:s}=r.getBoundingClientRect(),{x:l,width:u}=this.getBoundingClientRect(),c=l+u,b=n+s,g=a.getPropertyValue("--media-tooltip-offset-x"),f=g?parseFloat(g.replace("px","")):0,v=a.getPropertyValue("--media-tooltip-container-margin"),L=v?parseFloat(v.replace("px","")):0,A=l-n+f-L,T=c-b+f+L;if(A<0){this.style.setProperty("--media-tooltip-offset-x",`${A}px`);return}if(T>0){this.style.setProperty("--media-tooltip-offset-x",`${T}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Uc.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){let e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[$i.PLACEMENT,$i.BOUNDS]}get placement(){return R(this,$i.PLACEMENT)}set placement(e){I(this,$i.PLACEMENT,e)}get bounds(){return R(this,$i.BOUNDS)}set bounds(e){I(this,$i.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",il);var lf=1,df=t=>t.mediaMuted?0:t.mediaVolume,uf=t=>`${Math.round(t*100)}%`,al=class extends Zt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,i=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(i)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",V.VOLUME())}attributeChangedCallback(e,i,a){super.attributeChangedCallback(e,i,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=df(this),this.range.setAttribute("aria-valuetext",uf(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,lf)}set mediaVolume(e){D(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){U(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return R(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){I(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",al);var E=bh(require("@mux/mux-video")),y=require("@mux/playback-core");var qc=require("@mux/mux-video");var Kc=require("@mux/playback-core");var ei=require("@mux/playback-core");function Bc(t){let e="";return Object.entries(t).forEach(([i,a])=>{a!=null&&(e+=`${Nn(i)}: ${a}; `)}),e?e.trim():void 0}function Nn(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Pn(t){return t.replace(/[-_]([a-z])/g,(e,i)=>i.toUpperCase())}function ce(t){if(t==null)return;let e=+t;return Number.isNaN(e)?void 0:e}function rl(t){let e=cf(t).toString();return e?"?"+e:""}function cf(t){let e={};for(let i in t)t[i]!=null&&(e[i]=t[i]);return new URLSearchParams(e)}var nl=(t,e)=>!t||!e?!1:t.contains(e)?!0:nl(t,e.getRootNode().host);var Hc="mux.com",mf=()=>{try{return"3.2.0"}catch{}return"UNKNOWN"},hf=mf(),Bn=()=>hf,$c=(t,{token:e,customDomain:i=Hc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ei.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${i}/${t}/thumbnail.webp${rl({token:e,time:n,program_time:r})}`},Wc=(t,{token:e,customDomain:i=Hc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ei.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${i}/${t}/storyboard.vtt${rl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ba=t=>{if(t){if([ei.StreamTypes.LIVE,ei.StreamTypes.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return ei.StreamTypes.LIVE}};var pf={crossorigin:"crossOrigin",playsinline:"playsInline"};function Fc(t){var e;return(e=pf[t])!=null?e:Pn(t)}var Jt,jt,me,Un=class{constructor(e,i){X(this,Jt,void 0);X(this,jt,void 0);X(this,me,[]);Ae(this,Jt,e),Ae(this,jt,i)}[Symbol.iterator](){return P(this,me).values()}get length(){return P(this,me).length}get value(){var e;return(e=P(this,me).join(" "))!=null?e:""}set value(e){var i;e!==this.value&&(Ae(this,me,[]),this.add(...(i=e==null?void 0:e.split(" "))!=null?i:[]))}toString(){return this.value}item(e){return P(this,me)[e]}values(){return P(this,me).values()}keys(){return P(this,me).keys()}forEach(e){P(this,me).forEach(e)}add(...e){var i,a;e.forEach(r=>{this.contains(r)||P(this,me).push(r)}),!(this.value===""&&!((i=P(this,Jt))!=null&&i.hasAttribute(`${P(this,jt)}`)))&&((a=P(this,Jt))==null||a.setAttribute(`${P(this,jt)}`,`${this.value}`))}remove(...e){var i;e.forEach(a=>{P(this,me).splice(P(this,me).indexOf(a),1)}),(i=P(this,Jt))==null||i.setAttribute(`${P(this,jt)}`,`${this.value}`)}contains(e){return P(this,me).includes(e)}toggle(e,i){return typeof i!="undefined"?i?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,i){this.remove(e),this.add(i)}};Jt=new WeakMap,jt=new WeakMap,me=new WeakMap;var Vc=`[mux-player ${Bn()}]`;function Ze(...t){console.warn(Vc,...t)}function Ee(...t){console.error(Vc,...t)}function ol(t){var i;let e=(i=t.message)!=null?i:"";t.context&&(e+=` ${t.context}`),t.file&&(e+=` ${(0,Kc.i18n)("Read more: ")}
1224
1224
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),Ze(e)}var de={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ti={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Gc=Object.freeze({length:0,start(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let e=t>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ff=qc.VideoEvents.filter(t=>t!=="error"),vf=Object.values(de).filter(t=>![de.PLAYSINLINE].includes(t)),Ef=Object.values(ti),sl=class extends pe.HTMLElement{static get observedAttributes(){return[...vf,...Ef]}constructor(){super()}init(){ff.forEach(e=>{var i;(i=this.media)==null||i.addEventListener(e,a=>{this.dispatchEvent(new Event(a.type))})})}attributeChangedCallback(e,i,a){var r,n;switch(e){case ti.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ti.VOLUME:{let s=(r=ce(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ti.PLAYBACKRATE:{let s=(n=ce(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,i;return(i=(e=this.media)==null?void 0:e.play())!=null?i:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var i;return(i=this.media)==null?void 0:i.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,i;return(i=(e=this.media)==null?void 0:e.paused)!=null?i:!0}get duration(){var e,i;return(i=(e=this.media)==null?void 0:e.duration)!=null?i:NaN}get ended(){var e,i;return(i=(e=this.media)==null?void 0:e.ended)!=null?i:!1}get buffered(){var e,i;return(i=(e=this.media)==null?void 0:e.buffered)!=null?i:Gc}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:Gc}get readyState(){var e,i;return(i=(e=this.media)==null?void 0:e.readyState)!=null?i:0}get videoWidth(){var e,i;return(i=(e=this.media)==null?void 0:e.videoWidth)!=null?i:0}get videoHeight(){var e,i;return(i=(e=this.media)==null?void 0:e.videoHeight)!=null?i:0}get currentSrc(){var e,i;return(i=(e=this.media)==null?void 0:e.currentSrc)!=null?i:""}get currentTime(){var e,i;return(i=(e=this.media)==null?void 0:e.currentTime)!=null?i:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,i;return(i=(e=this.media)==null?void 0:e.volume)!=null?i:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,i;return(i=(e=this.media)==null?void 0:e.playbackRate)!=null?i:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ce(this.getAttribute(ti.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ti.PLAYBACKRATE,`${e}`):this.removeAttribute(ti.PLAYBACKRATE)}get crossOrigin(){return Ha(this,de.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(de.CROSSORIGIN,`${e}`)}get autoplay(){return Ha(this,de.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(de.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(de.AUTOPLAY)}get loop(){return Ha(this,de.LOOP)!=null}set loop(e){e?this.setAttribute(de.LOOP,""):this.removeAttribute(de.LOOP)}get muted(){var e,i;return(i=(e=this.media)==null?void 0:e.muted)!=null?i:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return Ha(this,de.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(de.MUTED,""):this.removeAttribute(de.MUTED)}get playsInline(){return Ha(this,de.PLAYSINLINE)!=null}set playsInline(e){Ee("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(de.PRELOAD,e):this.removeAttribute(de.PRELOAD)}};function Ha(t,e){return t.media?t.media.getAttribute(e):t.getAttribute(e)}var ll=sl;var Jc=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},k=(t,e,i)=>(Jc(t,e,"read from private field"),i?i.call(t):e.get(t)),Qe=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},ct=(t,e,i,a)=>(Jc(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),Wi,Hn,ii,$a,Ct,Mt,Rt,ai,Fi,$n,De,Zc=1,Qc=0,bf=1,gf={processCallback(t,e,i){if(i){for(let[a,r]of e)if(a in i){let n=i[a];typeof n=="boolean"&&r instanceof he&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof he?r.element[r.attributeName]=n:r.value=n}}}},mt=class extends d.DocumentFragment{constructor(e,i,a=gf){var r;super(),Qe(this,Wi,void 0),Qe(this,Hn,void 0),this.append(e.content.cloneNode(!0)),ct(this,Wi,jc(this)),ct(this,Hn,a),(r=a.createCallback)==null||r.call(a,this,k(this,Wi),i),a.processCallback(this,k(this,Wi),i)}update(e){k(this,Hn).processCallback(this,k(this,Wi),e)}};Wi=new WeakMap;Hn=new WeakMap;var jc=(t,e=[])=>{let i,a;for(let r of t.attributes||[])if(r.value.includes("{{")){let n=new dl;for([i,a]of Xc(r.value))if(!i)n.append(a);else{let s=new he(t,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of t.childNodes)if(r.nodeType===Zc&&!(r instanceof HTMLTemplateElement))jc(r,e);else{let n=r.data;if(r.nodeType===Zc||n.includes("{{")){let s=[];if(n)for([i,a]of Xc(n))if(!i)s.push(new Text(a));else{let l=new ht(t);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Wa(t,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},zc={},Xc=t=>{let e="",i=0,a=zc[t],r=0,n;if(a)return a;for(a=[];n=t[r];r++)n==="{"&&t[r+1]==="{"&&t[r-1]!=="\\"&&t[r+2]&&++i==1?(e&&a.push([Qc,e]),e="",r++):n==="}"&&t[r+1]==="}"&&t[r-1]!=="\\"&&!--i?(a.push([bf,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Qc,(i>0?"{{":"")+e]),zc[t]=a},_f=11,Wn=class{get value(){return""}set value(e){}toString(){return this.value}},em=new WeakMap,dl=class{constructor(){Qe(this,ii,[])}[Symbol.iterator](){return k(this,ii).values()}get length(){return k(this,ii).length}item(e){return k(this,ii)[e]}append(...e){for(let i of e)i instanceof he&&em.set(i,this),k(this,ii).push(i)}toString(){return k(this,ii).join("")}};ii=new WeakMap;var he=class extends Wn{constructor(e,i,a){super(),Qe(this,ai),Qe(this,$a,""),Qe(this,Ct,void 0),Qe(this,Mt,void 0),Qe(this,Rt,void 0),ct(this,Ct,e),ct(this,Mt,i),ct(this,Rt,a)}get attributeName(){return k(this,Mt)}get attributeNamespace(){return k(this,Rt)}get element(){return k(this,Ct)}get value(){return k(this,$a)}set value(e){k(this,$a)!==e&&(ct(this,$a,e),!k(this,ai,Fi)||k(this,ai,Fi).length===1?e==null?k(this,Ct).removeAttributeNS(k(this,Rt),k(this,Mt)):k(this,Ct).setAttributeNS(k(this,Rt),k(this,Mt),e):k(this,Ct).setAttributeNS(k(this,Rt),k(this,Mt),k(this,ai,Fi).toString()))}get booleanValue(){return k(this,Ct).hasAttributeNS(k(this,Rt),k(this,Mt))}set booleanValue(e){if(!k(this,ai,Fi)||k(this,ai,Fi).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};$a=new WeakMap;Ct=new WeakMap;Mt=new WeakMap;Rt=new WeakMap;ai=new WeakSet;Fi=function(){return em.get(this)};var ht=class extends Wn{constructor(e,i){super(),Qe(this,$n,void 0),Qe(this,De,void 0),ct(this,$n,e),ct(this,De,i?[...i]:[new Text])}get replacementNodes(){return k(this,De)}get parentNode(){return k(this,$n)}get nextSibling(){return k(this,De)[k(this,De).length-1].nextSibling}get previousSibling(){return k(this,De)[0].previousSibling}get value(){return k(this,De).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let i=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===_f?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);i.length||i.push(new Text),ct(this,De,Af(k(this,De)[0].parentNode,k(this,De),i,this.nextSibling))}};$n=new WeakMap;De=new WeakMap;var Wa=class extends ht{constructor(e,i){let a=i.getAttribute("directive")||i.getAttribute("type"),r=i.getAttribute("expression")||i.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=i,this.directive=a}};function Af(t,e,i,a=null){let r=0,n,s,l,u=i.length,c=e.length;for(;r<u&&r<c&&e[r]==i[r];)r++;for(;r<u&&r<c&&i[u-1]==e[c-1];)a=i[--c,--u];if(r==c)for(;r<u;)t.insertBefore(i[r++],a);if(r==u)for(;r<c;)t.removeChild(e[r++]);else{for(n=e[r];r<u;)l=i[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&i[r]==s?(t.replaceChild(l,n),n=s):t.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,t.removeChild(n),n=s}return i}var tm={string:t=>String(t)},Kn=class{constructor(e){this.template=e,this.state=void 0}},ri=new WeakMap,ni=new WeakMap,ul={partial:(t,e)=>{e[t.expression]=new Kn(t.template)},if:(t,e)=>{var i;if(am(t.expression,e))if(ri.get(t)!==t.template){ri.set(t,t.template);let a=new mt(t.template,e,Vn);t.replace(a),ni.set(t,a)}else(i=ni.get(t))==null||i.update(e);else t.replace(""),ri.delete(t),ni.delete(t)}},Tf=Object.keys(ul),Vn={processCallback(t,e,i){var a,r;if(i)for(let[n,s]of e){if(s instanceof Wa){if(!s.directive){let u=Tf.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=ul[s.directive])==null||a.call(ul,s,i);continue}let l=am(n,i);if(l instanceof Kn){ri.get(s)!==l.template?(ri.set(s,l.template),l=new mt(l.template,l.state,Vn),s.value=l,ni.set(s,l)):(r=ni.get(s))==null||r.update(l.state);continue}l?(s instanceof he&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof he?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ri.delete(s),ni.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ri.delete(s),ni.delete(s))}}},im={"!":t=>!t,"!!":t=>!!t,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"??":(t,e)=>t!=null?t:e,"|":(t,e)=>{var i;return(i=tm[e])==null?void 0:i.call(tm,t)}};function yf(t){return kf(t,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function am(t,e={}){var i,a,r,n,s,l,u;let c=yf(t);if(c.length===0||c.some(({type:b})=>!b))return Fa(t);if(((i=c[0])==null?void 0:i.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return Fa(t);let g={...e};b.state=g;let f=c.slice(2);for(let v=0;v<f.length;v+=3){let L=(r=f[v])==null?void 0:r.token,A=(n=f[v+1])==null?void 0:n.token,T=(s=f[v+2])==null?void 0:s.token;L&&A==="="&&(g[L]=Ka(T,e))}return b}if(c.length===1)return Fn(c[0])?Ka(c[0].token,e):Fa(t);if(c.length===2){let b=(l=c[0])==null?void 0:l.token,g=im[b];if(!g||!Fn(c[1]))return Fa(t);let f=Ka(c[1].token,e);return g(f)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=im[b];if(!g||!Fn(c[0])||!Fn(c[2]))return Fa(t);let f=Ka(c[0].token,e);if(b==="|")return g(f,c[2].token);let v=Ka(c[2].token,e);return g(f,v)}}function Fa(t){return console.warn(`Warning: invalid expression \`${t}\``),!1}function Fn({type:t}){return["number","boolean","string","param"].includes(t)}function Ka(t,e){let i=t[0],a=t.slice(-1);return t==="true"||t==="false"?t==="true":i===a&&["'",'"'].includes(i)?t.slice(1,-1):_r(t)?parseFloat(t):e[t]}function kf(t,e){let i,a,r,n=[];for(;t;){r=null,i=t.length;for(let s in e)a=e[s].exec(t),a&&a.index<i&&(r={token:a[0],type:s,matches:a.slice(1)},i=a.index);i&&n.push({token:t.substr(0,i),type:void 0}),r&&n.push(r),t=t.substr(i+(r?r.token.length:0))}return n}var vl=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},hl=(t,e,i)=>(vl(t,e,"read from private field"),i?i.call(t):e.get(t)),Va=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},oi=(t,e,i,a)=>(vl(t,e,"write to private field"),a?a.call(t,i):e.set(t,i),i),cl=(t,e,i)=>(vl(t,e,"access private method"),i),Ki,Yn,Vi,pl,rm,Gn,fl,ml={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},nm=h.createElement("template");nm.innerHTML=`
1225
1225
  <style>
1226
1226
  :host {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var Ae=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),p=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},C=(t,a,e,i)=>(Ae(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e);var b=(t,a,e)=>(Ae(t,a,"access private method"),e);var Y=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Y{}globalThis.DocumentFragment=t}var j=class extends Y{},Ce=class extends Y{},Vt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(j)}},q,ke=class{constructor(a,e={}){p(this,q,void 0);C(this,q,e==null?void 0:e.detail)}get detail(){return u(this,q)}initCustomEvent(){}};q=new WeakMap;function Kt(t,a){return new j}var tt={document:{createElement:Kt},DocumentFragment,customElements:Vt,CustomEvent:ke,EventTarget:Y,HTMLElement:j,HTMLVideoElement:Ce},at=typeof window=="undefined"||typeof globalThis.customElements=="undefined",v=at?tt:globalThis,F=at?tt.document:globalThis.document;import{MediaController as fa,MediaErrorDialog as Nt}from"media-chrome";import{Attributes as Ie}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Rt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import ga,{MediaError as ee,Attributes as s}from"@mux/mux-video";import{StreamTypes as x,PlaybackTypes as fe,addTextTrack as ya,removeTextTrack as Ta,CmcdTypeValues as Ot,i18n as H,parseJwt as De,MuxJWTAud as Ve,generatePlayerInitTime as va}from"@mux/playback-core";import{VideoEvents as Ft}from"@mux/mux-video";import{i18n as Yt}from"@mux/playback-core";import{StreamTypes as _e,parseJwt as rt}from"@mux/playback-core";function it(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${de(e)}: ${i}; `)}),a?a.trim():void 0}function de(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function le(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function Re(t){let a=Ht(t).toString();return a?"?"+a:""}function Ht(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Oe=(t,a)=>!t||!a?!1:t.contains(a)?!0:Oe(t,a.getRootNode().host);var ot="mux.com",Ut=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},Bt=Ut(),me=()=>Bt,nt=(t,{token:a,customDomain:e=ot,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=rt(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${Re({token:a,time:n,program_time:r})}`},st=(t,{token:a,customDomain:e=ot,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=rt(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${Re({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},z=t=>{if(t){if([_e.LIVE,_e.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return _e.LIVE}};var $t={crossorigin:"crossOrigin",playsinline:"playsInline"};function dt(t){var a;return(a=$t[t])!=null?a:le(t)}var I,D,T,ue=class{constructor(a,e){p(this,I,void 0);p(this,D,void 0);p(this,T,[]);C(this,I,a),C(this,D,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,I))!=null&&e.hasAttribute(`${u(this,D)}`)))&&((i=u(this,I))==null||i.setAttribute(`${u(this,D)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,I))==null||e.setAttribute(`${u(this,D)}`,`${this.value}`)}contains(a){return u(this,T).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};I=new WeakMap,D=new WeakMap,T=new WeakMap;var lt=`[mux-player ${me()}]`;function _(...t){console.warn(lt,...t)}function E(...t){console.error(lt,...t)}function xe(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Yt("Read more: ")}
1
+ var Ae=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(Ae(t,a,"read from private field"),e?e.call(t):a.get(t)),p=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},C=(t,a,e,i)=>(Ae(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e);var b=(t,a,e)=>(Ae(t,a,"access private method"),e);var Y=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends Y{}globalThis.DocumentFragment=t}var j=class extends Y{},Ce=class extends Y{},Vt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(j)}},q,ke=class{constructor(a,e={}){p(this,q,void 0);C(this,q,e==null?void 0:e.detail)}get detail(){return u(this,q)}initCustomEvent(){}};q=new WeakMap;function Kt(t,a){return new j}var tt={document:{createElement:Kt},DocumentFragment,customElements:Vt,CustomEvent:ke,EventTarget:Y,HTMLElement:j,HTMLVideoElement:Ce},at=typeof window=="undefined"||typeof globalThis.customElements=="undefined",v=at?tt:globalThis,F=at?tt.document:globalThis.document;import{MediaController as fa,MediaErrorDialog as Nt}from"media-chrome";import{Attributes as Ie}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Rt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import ga,{MediaError as ee,Attributes as s}from"@mux/mux-video";import{StreamTypes as x,PlaybackTypes as fe,addTextTrack as ya,removeTextTrack as Ta,CmcdTypeValues as Ot,i18n as H,parseJwt as De,MuxJWTAud as Ve,generatePlayerInitTime as va}from"@mux/playback-core";import{VideoEvents as Ft}from"@mux/mux-video";import{i18n as Yt}from"@mux/playback-core";import{StreamTypes as _e,parseJwt as rt}from"@mux/playback-core";function it(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${de(e)}: ${i}; `)}),a?a.trim():void 0}function de(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function le(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function y(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function Re(t){let a=Ht(t).toString();return a?"?"+a:""}function Ht(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var Oe=(t,a)=>!t||!a?!1:t.contains(a)?!0:Oe(t,a.getRootNode().host);var ot="mux.com",Ut=()=>{try{return"3.2.0"}catch{}return"UNKNOWN"},Bt=Ut(),me=()=>Bt,nt=(t,{token:a,customDomain:e=ot,thumbnailTime:i,programTime:r}={})=>{var l;let n=a==null?i:void 0,{aud:d}=(l=rt(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${Re({token:a,time:n,program_time:r})}`},st=(t,{token:a,customDomain:e=ot,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:n}=(d=rt(a))!=null?d:{};if(!(a&&n!=="s"))return`https://image.${e}/${t}/storyboard.vtt${Re({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},z=t=>{if(t){if([_e.LIVE,_e.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return _e.LIVE}};var $t={crossorigin:"crossOrigin",playsinline:"playsInline"};function dt(t){var a;return(a=$t[t])!=null?a:le(t)}var I,D,T,ue=class{constructor(a,e){p(this,I,void 0);p(this,D,void 0);p(this,T,[]);C(this,I,a),C(this,D,e)}[Symbol.iterator](){return u(this,T).values()}get length(){return u(this,T).length}get value(){var a;return(a=u(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(C(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,T)[a]}values(){return u(this,T).values()}keys(){return u(this,T).keys()}forEach(a){u(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,T).push(r)}),!(this.value===""&&!((e=u(this,I))!=null&&e.hasAttribute(`${u(this,D)}`)))&&((i=u(this,I))==null||i.setAttribute(`${u(this,D)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,T).splice(u(this,T).indexOf(i),1)}),(e=u(this,I))==null||e.setAttribute(`${u(this,D)}`,`${this.value}`)}contains(a){return u(this,T).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};I=new WeakMap,D=new WeakMap,T=new WeakMap;var lt=`[mux-player ${me()}]`;function _(...t){console.warn(lt,...t)}function E(...t){console.error(lt,...t)}function xe(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Yt("Read more: ")}
2
2
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),_(a)}var g={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},V={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},mt=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Wt=Ft.filter(t=>t!=="error"),Zt=Object.values(g).filter(t=>![g.PLAYSINLINE].includes(t)),Gt=Object.values(V),Me=class extends v.HTMLElement{static get observedAttributes(){return[...Zt,...Gt]}constructor(){super()}init(){Wt.forEach(a=>{var e;(e=this.media)==null||e.addEventListener(a,i=>{this.dispatchEvent(new Event(i.type))})})}attributeChangedCallback(a,e,i){var r,n;switch(a){case V.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case V.VOLUME:{let d=(r=y(i))!=null?r:1;this.media&&(this.media.volume=d);return}case V.PLAYBACKRATE:{let d=(n=y(i))!=null?n:1;this.media&&(this.media.playbackRate=d,this.media.defaultPlaybackRate=d);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}load(){var a;(a=this.media)==null||a.load()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:mt}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:mt}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentSrc(){var a,e;return(e=(a=this.media)==null?void 0:a.currentSrc)!=null?e:""}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=y(this.getAttribute(V.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(V.PLAYBACKRATE,`${a}`):this.removeAttribute(V.PLAYBACKRATE)}get crossOrigin(){return X(this,g.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(g.CROSSORIGIN,`${a}`)}get autoplay(){return X(this,g.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(g.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(g.AUTOPLAY)}get loop(){return X(this,g.LOOP)!=null}set loop(a){a?this.setAttribute(g.LOOP,""):this.removeAttribute(g.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=!!a)}get defaultMuted(){return X(this,g.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(g.MUTED,""):this.removeAttribute(g.MUTED)}get playsInline(){return X(this,g.PLAYSINLINE)!=null}set playsInline(a){E("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(g.PRELOAD,a):this.removeAttribute(g.PRELOAD)}};function X(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Le=Me;import"media-chrome/dist/media-theme-element.js";var ct=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);
@@ -1271,7 +1271,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1271
1271
  `:""}${i.error?`error: ${i.error}
1272
1272
  `:""}${i.event?`event: ${i.event}
1273
1273
  `:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
1274
- `:""}`),l.data=i,l};var bC=Object.defineProperty,yC=Object.getPrototypeOf,TC=Reflect.get,_C=(i,e,t)=>e in i?bC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ie=(i,e,t)=>(_C(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),X=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Z=(i,e,t,r)=>(Mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Me=(i,e,t)=>(Mp(i,e,"access private method"),t),hp=(i,e,t)=>TC(yC(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Pp=class extends bu{},AC=class extends bu{},SC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Pp)}},ru,xC=class{constructor(i,e={}){X(this,ru,void 0),Z(this,ru,e==null?void 0:e.detail)}get detail(){return I(this,ru)}initCustomEvent(){}};ru=new WeakMap;function RC(i,e){return new Pp}var fT={document:{createElement:RC},DocumentFragment,customElements:SC,CustomEvent:xC,EventTarget:bu,HTMLElement:Pp,HTMLVideoElement:AC},mT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",fp=mT?fT:globalThis,w2=mT?fT.document:globalThis.document,IC=()=>{try{return"0.22.0"}catch{}return"UNKNOWN"},LC=IC(),kC=()=>LC,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"];function CC(i){return`
1274
+ `:""}`),l.data=i,l};var bC=Object.defineProperty,yC=Object.getPrototypeOf,TC=Reflect.get,_C=(i,e,t)=>e in i?bC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ie=(i,e,t)=>(_C(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),X=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Z=(i,e,t,r)=>(Mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Me=(i,e,t)=>(Mp(i,e,"access private method"),t),hp=(i,e,t)=>TC(yC(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Pp=class extends bu{},AC=class extends bu{},SC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Pp)}},ru,xC=class{constructor(i,e={}){X(this,ru,void 0),Z(this,ru,e==null?void 0:e.detail)}get detail(){return I(this,ru)}initCustomEvent(){}};ru=new WeakMap;function RC(i,e){return new Pp}var fT={document:{createElement:RC},DocumentFragment,customElements:SC,CustomEvent:xC,EventTarget:bu,HTMLElement:Pp,HTMLVideoElement:AC},mT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",fp=mT?fT:globalThis,w2=mT?fT.document:globalThis.document,IC=()=>{try{return"0.23.0"}catch{}return"UNKNOWN"},LC=IC(),kC=()=>LC,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"];function CC(i){return`
1275
1275
  <style>
1276
1276
  :host {
1277
1277
  display: inline-flex;
@@ -1313,7 +1313,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1313
1313
  <video${gT(i)}></video>
1314
1314
  </slot>
1315
1315
  <slot></slot>
1316
- `}function pT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T,_,A,k,x,M;let O=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),D=O?DC(O):[];return n=class extends i{constructor(){super(...arguments),X(this,f),X(this,p),X(this,E),X(this,T),X(this,A),X(this,x),X(this,d,!1),X(this,u,null),X(this,c,new Map),X(this,h,void 0),Ie(this,"get"),Ie(this,"set"),Ie(this,"call")}static get observedAttributes(){var R,P,N;return Me(R=n,o,l).call(R),[...(N=(P=O==null?void 0:O.constructor)==null?void 0:P.observedAttributes)!=null?N:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,P,N,$,G;return Me(this,f,m).call(this),(G=($=(P=(R=I(this,u))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?P:this.querySelector(e))!=null?$:(N=this.shadowRoot)==null?void 0:N.querySelector(e))!=null?G:null}set nativeEl(R){Z(this,u,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,P;return(P=this.getAttribute("preload"))!=null?P:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R;if(!this.shadowRoot){this.attachShadow({mode:"open"});let P=MC(this.attributes);t&&(P.is=t),e&&(P.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(P)}this.nativeEl.muted=this.hasAttribute("muted");for(let P of D)Me(this,A,k).call(this,P);Z(this,h,new MutationObserver(Me(this,E,b).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Me(this,p,g).call(this);for(let P of this.constructor.Events)(R=this.shadowRoot)==null||R.addEventListener(P,this,!0)}handleEvent(R){if(R.type==="slotchange"){Me(this,p,g).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,P,N){Me(this,f,m).call(this),Me(this,x,M).call(this,R,P,N)}connectedCallback(){Me(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Z(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let P of D)if(!(P in this.prototype))if(typeof O[P]=="function")this.prototype[P]=function(...N){return Me(this,f,m).call(this),(()=>{var $;if(this.call)return this.call(P,...N);let G=($=this.nativeEl)==null?void 0:$[P];return G==null?void 0:G.apply(this.nativeEl,N)})()};else{let N={get(){var $,G,K;Me(this,f,m).call(this);let ee=P.toLowerCase();if(R.has(ee)){let ae=this.getAttribute(ee);return ae===null?!1:ae===""?!0:ae}return(K=($=this.get)==null?void 0:$.call(this,P))!=null?K:(G=this.nativeEl)==null?void 0:G[P]}};P!==P.toUpperCase()&&(N.set=function($){Me(this,f,m).call(this);let G=P.toLowerCase();if(R.has(G)){$===!0||$===!1||$==null?this.toggleAttribute(G,!!$):this.setAttribute(G,$);return}if(this.set){this.set(P,$);return}this.nativeEl&&(this.nativeEl[P]=$)}),Object.defineProperty(this.prototype,P,N)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Z(this,d,!0),this.init())},p=new WeakSet,g=function(){var R;let P=new Map(I(this,c)),N=(R=this.shadowRoot)==null?void 0:R.querySelector("slot:not([name])");(N==null?void 0:N.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var G,K;P.delete($);let ee=I(this,c).get($);ee||(ee=$.cloneNode(),I(this,c).set($,ee),(G=I(this,h))==null||G.observe($,{attributes:!0})),(K=this.nativeEl)==null||K.append(ee),Me(this,T,_).call(this,ee)}),P.forEach(($,G)=>{$.remove(),I(this,c).delete(G)})},E=new WeakSet,b=function(R){var P;for(let N of R)if(N.type==="attributes"){let{target:$,attributeName:G}=N,K=I(this,c).get($);K&&G&&(K.setAttribute(G,(P=$.getAttribute(G))!=null?P:""),Me(this,T,_).call(this,K))}},T=new WeakSet,_=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},A=new WeakSet,k=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let P=this[R];delete this[R],this[R]=P}},x=new WeakSet,M=function(R,P,N){var $,G,K;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(N===null?($=this.nativeEl)==null||$.removeAttribute(R):((G=this.nativeEl)==null?void 0:G.getAttribute(R))!==N&&((K=this.nativeEl)==null||K.setAttribute(R,N)))},X(n,o),Ie(n,"getTemplateHTML",e.endsWith("audio")?CC:wC),Ie(n,"shadowRootOptions",{mode:"open"}),Ie(n,"Events",yu),X(n,a,!1),n}function DC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function gT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function MC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var sT,mp=pT((sT=globalThis.HTMLElement)!=null?sT:class{},{tag:"video"}),nT,M2=pT((nT=globalThis.HTMLElement)!=null?nT:class{},{tag:"audio"}),_s=new WeakMap,pp=class extends Error{},PC=class extends Error{},OC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function NC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function UC(){return globalThis.chrome}function FC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function As(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Op(){var i;return(i=As())==null?void 0:i.getCurrentSession()}function Np(){var i;return(i=Op())==null?void 0:i.getSessionObj().media[0]}function BC(i){return new Promise((e,t)=>{Np().editTracksInfo(i,e,t)})}function $C(i){return new Promise((e,t)=>{Np().getStatus(i,e,t)})}function vT(i){return As().setOptions({...ET(),...i})}function ET(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var su=new OC,xr=new WeakSet,at;NC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}at||(at=cast.framework,As().addEventListener(at.CastContextEventType.CAST_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),As().addEventListener(at.CastContextEventType.SESSION_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),su.forEach(s=>{var n,a;return(a=(n=_s.get(s)).init)==null?void 0:a.call(n)}))});var aT=0,Re,nu,Vt,Ar,Mn,kn,Ts,vp,Sr,ls,Ep,oT,vu,bp,yp,bT,au,Tp,_p,lT,ou,gp,HC=class extends EventTarget{constructor(i){super(),X(this,Sr),X(this,Ep),X(this,vu),X(this,yp),X(this,au),X(this,_p),X(this,ou),X(this,Re,void 0),X(this,nu,void 0),X(this,Vt,void 0),X(this,Ar,void 0),X(this,Mn,"disconnected"),X(this,kn,!1),X(this,Ts,new Set),X(this,vp,new WeakMap),Z(this,Re,i),su.add(this),_s.set(this,{init:()=>Me(this,au,Tp).call(this),onCastStateChanged:()=>Me(this,vu,bp).call(this),onSessionStateChanged:()=>Me(this,yp,bT).call(this),getCastPlayer:()=>I(this,Sr,ls)}),Me(this,au,Tp).call(this)}get state(){return I(this,Mn)}async watchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");return I(this,vp).set(i,++aT),I(this,Ts).add(i),aT}async cancelWatchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");i?I(this,Ts).delete(i):I(this,Ts).clear()}async prompt(){var i,e,t,r;if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new PC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Re));xr.add(I(this,Re)),vT(I(this,Re).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Vt).controller.addEventListener(n,a)});try{await As().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Re));return}throw new Error(n)}(r=(t=_s.get(I(this,Re)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Re=new WeakMap,nu=new WeakMap,Vt=new WeakMap,Ar=new WeakMap,Mn=new WeakMap,kn=new WeakMap,Ts=new WeakMap,vp=new WeakMap,Sr=new WeakSet,ls=function(){if(xr.has(I(this,Re)))return I(this,Vt)},Ep=new WeakSet,oT=function(){xr.has(I(this,Re))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Vt).controller.removeEventListener(i,e)}),xr.delete(I(this,Re)),I(this,Re).muted=I(this,Vt).isMuted,I(this,Re).currentTime=I(this,Vt).savedPlayerState.currentTime,I(this,Vt).savedPlayerState.isPaused===!1&&I(this,Re).play())},vu=new WeakSet,bp=function(){let i=As().getCastState();if(xr.has(I(this,Re))&&i==="CONNECTING"&&(Z(this,Mn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,kn)&&i!=null&&i.includes("CONNECT")){Z(this,kn,!0);for(let e of I(this,Ts))e(!0)}else if(I(this,kn)&&(!i||i==="NO_DEVICES_AVAILABLE")){Z(this,kn,!1);for(let e of I(this,Ts))e(!1)}},yp=new WeakSet,bT=async function(){var i;let{SESSION_RESUMED:e}=at.SessionState;if(As().getSessionState()===e&&I(this,Re).castSrc===((i=Np())==null?void 0:i.media.contentId)){xr.add(I(this,Re)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Vt).controller.addEventListener(t,r)});try{await $C(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[at.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},au=new WeakSet,Tp=function(){!at||I(this,nu)||(Z(this,nu,!0),vT(I(this,Re).castOptions),I(this,Re).textTracks.addEventListener("change",()=>Me(this,ou,gp).call(this)),Me(this,vu,bp).call(this),Z(this,Vt,new at.RemotePlayer),new at.RemotePlayerController(I(this,Vt)),Z(this,Ar,{[at.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Z(this,Mn,"connected"),this.dispatchEvent(new Event("connect"))):(Me(this,Ep,oT).call(this),Z(this,Mn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[at.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("durationchange"))},[at.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&I(this,Re).dispatchEvent(new Event("timeupdate"))},[at.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("resize"))},[at.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event(this.paused?"pause":"play"))},[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,ls))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Re).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,Sr,ls))==null?void 0:e.playerState]))},[at.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Me(this,_p,lT).call(this))}}))},_p=new WeakSet,lT=function(){Me(this,ou,gp).call(this)},ou=new WeakSet,gp=async function(){var i,e,t,r,s;if(!I(this,Sr,ls))return;let n=((e=(i=I(this,Vt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Re).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Op())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await BC(h)}catch(h){console.error(h)}};var GC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),X(this,o),X(this,d),X(this,r,{paused:!1}),X(this,s,ET()),X(this,n,void 0),X(this,a,void 0)}get remote(){return I(this,a)?I(this,a):UC()?(FC(),_s.set(this,{loadOnPrompt:()=>Me(this,d,u).call(this)}),Z(this,a,new HC(this))):super.remote}attributeChangedCallback(c,h,f){if(super.attributeChangedCallback(c,h,f),c==="cast-receiver"&&f){I(this,s).receiverApplicationId=f;return}if(I(this,o,l))switch(c){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var c,h;if(!I(this,o,l))return super.load();let f=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);f.customData=this.castCustomData;let m=[...this.querySelectorAll("track")].filter(({kind:b,src:T})=>T&&(b==="subtitles"||b==="captions")),p=[],g=0;m.length&&(f.tracks=m.map(b=>{let T=++g;p.length===0&&b.track.mode==="showing"&&p.push(T);let _=new chrome.cast.media.Track(T,chrome.cast.media.TrackType.TEXT);return _.trackContentId=b.src,_.trackContentType="text/vtt",_.subtype=b.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,_.name=b.label,_.language=b.srclang,_})),this.castStreamType==="live"?f.streamType=chrome.cast.media.StreamType.LIVE:f.streamType=chrome.cast.media.StreamType.BUFFERED,f.metadata=new chrome.cast.media.GenericMediaMetadata,f.metadata.title=this.title,f.metadata.images=[{url:this.poster}];let E=new chrome.cast.media.LoadRequest(f);E.currentTime=(c=super.currentTime)!=null?c:0,E.autoplay=!I(this,r).paused,E.activeTrackIds=p,await((h=Op())==null?void 0:h.loadMedia(E)),this.dispatchEvent(new Event("volumechange"))}play(){var c;if(I(this,o,l)){I(this,o,l).isPaused&&((c=I(this,o,l).controller)==null||c.playOrPause());return}return super.play()}pause(){var c;if(I(this,o,l)){I(this,o,l).isPaused||(c=I(this,o,l).controller)==null||c.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var c;return(c=this.getAttribute("cast-receiver"))!=null?c:void 0}set castReceiver(c){this.castReceiver!=c&&this.setAttribute("cast-receiver",`${c}`)}get castSrc(){var c,h,f;return(f=(h=this.getAttribute("cast-src"))!=null?h:(c=this.querySelector("source"))==null?void 0:c.src)!=null?f:this.currentSrc}set castSrc(c){this.castSrc!=c&&this.setAttribute("cast-src",`${c}`)}get castContentType(){var c;return(c=this.getAttribute("cast-content-type"))!=null?c:void 0}set castContentType(c){this.setAttribute("cast-content-type",`${c}`)}get castStreamType(){var c,h;return(h=(c=this.getAttribute("cast-stream-type"))!=null?c:this.streamType)!=null?h:void 0}set castStreamType(c){this.setAttribute("cast-stream-type",`${c}`)}get castCustomData(){return I(this,n)}set castCustomData(c){let h=typeof c;if(!["object","undefined"].includes(h)){console.error(`castCustomData must be nullish or an object but value was of type ${h}`);return}Z(this,n,c)}get readyState(){if(I(this,o,l))switch(I(this,o,l).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var c;return I(this,o,l)?(c=I(this,o,l))==null?void 0:c.isMuted:super.muted}set muted(c){var h;if(I(this,o,l)){(c&&!I(this,o,l).isMuted||!c&&I(this,o,l).isMuted)&&((h=I(this,o,l).controller)==null||h.muteOrUnmute());return}super.muted=c}get volume(){var c,h;return I(this,o,l)?(h=(c=I(this,o,l))==null?void 0:c.volumeLevel)!=null?h:1:super.volume}set volume(c){var h;if(I(this,o,l)){I(this,o,l).volumeLevel=+c,(h=I(this,o,l).controller)==null||h.setVolumeLevel();return}super.volume=c}get duration(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.duration)!=null?f:NaN:super.duration}get currentTime(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.currentTime)!=null?f:0:super.currentTime}set currentTime(c){var h;if(I(this,o,l)){I(this,o,l).currentTime=c,(h=I(this,o,l).controller)==null||h.seek();return}super.currentTime=c}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var c,h;return(h=(c=_s.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=hp(t.prototype,this,"paused"),hp(t.prototype,this,"pause").call(this),this.muted=hp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},Ie(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},Tu=class extends Event{constructor(i,e){super(i),Ie(this,"track"),this.track=e.track}},Ap=new WeakMap;function j(i){var e;return(e=Ap.get(i))!=null?e:KC(i,{})}function KC(i,e){let t=Ap.get(i);return t||Ap.set(i,t={}),Object.assign(t,e)}function Sp(i,e){let t=i.videoTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in Rp.prototype||Object.defineProperty(Rp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function xp(i){var e;let t=(e=j(i).media)==null?void 0:e.videoTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function WC(i){var e;let t=(e=j(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(j(t).changeRequested)return;j(t).changeRequested=!0,queueMicrotask(()=>{delete j(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ds,us,cs,Cn,Va,Rp=class extends EventTarget{constructor(){super(),X(this,Cn),X(this,ds,void 0),X(this,us,void 0),X(this,cs,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,Cn,Va).values()}get length(){return I(this,Cn,Va).size}getTrackById(i){var e;return(e=[...I(this,Cn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,Cn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ds)}set onaddtrack(i){I(this,ds)&&(this.removeEventListener("addtrack",I(this,ds)),Z(this,ds,void 0)),typeof i=="function"&&(Z(this,ds,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,us)}set onremovetrack(i){I(this,us)&&(this.removeEventListener("removetrack",I(this,us)),Z(this,us,void 0)),typeof i=="function"&&(Z(this,us,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,cs)}set onchange(i){I(this,cs)&&(this.removeEventListener("change",I(this,cs)),Z(this,cs,void 0)),typeof i=="function"&&(Z(this,cs,i),this.addEventListener("change",i))}};ds=new WeakMap,us=new WeakMap,cs=new WeakMap,Cn=new WeakSet,Va=function(){return j(this).trackSet};var _u=class extends Event{constructor(i,e){super(i),Ie(this,"rendition"),this.rendition=e.rendition}};function VC(i,e){let t=j(i).media.videoRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Ip.prototype||Object.defineProperty(Ip.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function YC(i){let e=j(i).media.videoRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.selected&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function qC(i){let e=j(i).media.videoRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...j(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...j(e).renditionSet])}var hs,fs,ms,Ip=class extends EventTarget{constructor(){super(...arguments),X(this,hs,void 0),X(this,fs,void 0),X(this,ms,void 0)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,hs)}set onaddrendition(i){I(this,hs)&&(this.removeEventListener("addrendition",I(this,hs)),Z(this,hs,void 0)),typeof i=="function"&&(Z(this,hs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,fs)}set onremoverendition(i){I(this,fs)&&(this.removeEventListener("removerendition",I(this,fs)),Z(this,fs,void 0)),typeof i=="function"&&(Z(this,fs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,ms)}set onchange(i){I(this,ms)&&(this.removeEventListener("change",I(this,ms)),Z(this,ms,void 0)),typeof i=="function"&&(Z(this,ms,i),this.addEventListener("change",i))}};hs=new WeakMap,fs=new WeakMap,ms=new WeakMap;var Ya,jC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"width"),Ie(this,"height"),Ie(this,"bitrate"),Ie(this,"frameRate"),Ie(this,"codec"),X(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Z(this,Ya,i),qC(this))}};Ya=new WeakMap;var qa,yT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,qa,!1)}addRendition(i,e,t,r,s,n){let a=new jC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,VC(this,a),a}removeRendition(i){YC(i)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Z(this,qa,i),i===!0&&WC(this))}};qa=new WeakMap;function zC(i,e){let t=j(i).media.audioRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Lp.prototype||Object.defineProperty(Lp.prototype,s,{get(){return Dn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function XC(i){let e=j(i).media.audioRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.enabled&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function QC(i){let e=j(i).media.audioRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Dn(i){return[...j(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...j(e).renditionSet])}var ps,gs,vs,Lp=class extends EventTarget{constructor(){super(...arguments),X(this,ps,void 0),X(this,gs,void 0),X(this,vs,void 0)}[Symbol.iterator](){return Dn(this).values()}get length(){return Dn(this).length}getRenditionById(i){var e;return(e=Dn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Dn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Dn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ps)}set onaddrendition(i){I(this,ps)&&(this.removeEventListener("addrendition",I(this,ps)),Z(this,ps,void 0)),typeof i=="function"&&(Z(this,ps,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,gs)}set onremoverendition(i){I(this,gs)&&(this.removeEventListener("removerendition",I(this,gs)),Z(this,gs,void 0)),typeof i=="function"&&(Z(this,gs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,vs)}set onchange(i){I(this,vs)&&(this.removeEventListener("change",I(this,vs)),Z(this,vs,void 0)),typeof i=="function"&&(Z(this,vs,i),this.addEventListener("change",i))}};ps=new WeakMap,gs=new WeakMap,vs=new WeakMap;var ja,ZC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"bitrate"),Ie(this,"codec"),X(this,ja,!1)}get selected(){return I(this,ja)}set selected(i){I(this,ja)!==i&&(Z(this,ja,i),QC(this))}};ja=new WeakMap;function kp(i,e){let t=i.audioTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in wp.prototype||Object.defineProperty(wp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function Cp(i){var e;let t=(e=j(i).media)==null?void 0:e.audioTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function JC(i){let e=j(i).media.audioTracks;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Es,bs,ys,za,lu,wp=class extends EventTarget{constructor(){super(),X(this,za),X(this,Es,void 0),X(this,bs,void 0),X(this,ys,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,za,lu).values()}get length(){return I(this,za,lu).size}getTrackById(i){var e;return(e=[...I(this,za,lu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,Es)}set onaddtrack(i){I(this,Es)&&(this.removeEventListener("addtrack",I(this,Es)),Z(this,Es,void 0)),typeof i=="function"&&(Z(this,Es,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,bs)}set onremovetrack(i){I(this,bs)&&(this.removeEventListener("removetrack",I(this,bs)),Z(this,bs,void 0)),typeof i=="function"&&(Z(this,bs,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,ys)}set onchange(i){I(this,ys)&&(this.removeEventListener("change",I(this,ys)),Z(this,ys,void 0)),typeof i=="function"&&(Z(this,ys,i),this.addEventListener("change",i))}};Es=new WeakMap,bs=new WeakMap,ys=new WeakMap,za=new WeakSet,lu=function(){return j(this).trackSet};var Xa,TT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,Xa,!1)}addRendition(i,e,t){let r=new ZC;return r.src=i,r.codec=e,r.bitrate=t,zC(this,r),r}removeRendition(i){XC(i)}get enabled(){return I(this,Xa)}set enabled(i){I(this,Xa)!==i&&(Z(this,Xa,i),JC(this))}};Xa=new WeakMap;var dT=Eu(globalThis.HTMLMediaElement,"video"),uT=Eu(globalThis.HTMLMediaElement,"audio");function ew(i){if(!(i!=null&&i.prototype))return i;let e=Eu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return tw(this)}});let t=Eu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return iw(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new yT;return l.kind=n,l.label=a,l.language=o,Sp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=xp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new TT;return l.kind=n,l.label=a,l.language=o,kp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Cp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=j(n).videoRenditions;return a||(a=new Ip,j(a).media=n,j(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=j(n).audioRenditions;return a||(a=new Lp,j(a).media=n,j(n).audioRenditions=a),a};return i}function Eu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function tw(i){var e;let t=j(i).videoTracks;if(!t&&(t=new Rp,j(i).videoTracks=t,dT)){let r=dT.call((e=i.nativeEl)!=null?e:i);for(let s of r)Sp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof yT)){for(let n of r)xp(n);return}Sp(i,s.track)}),r.addEventListener("removetrack",s=>{xp(s.track)})}return t}function iw(i){var e;let t=j(i).audioTracks;if(!t&&(t=new wp,j(i).audioTracks=t,uT)){let r=uT.call((e=i.nativeEl)!=null?e:i);for(let s of r)kp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof TT)){for(let n of r)Cp(n);return}kp(i,s.track)}),r.addEventListener("removetrack",s=>{Cp(s.track)})}return t}yu.push("castchange","entercast","leavecast");var C={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},rw=Object.values(C),cT=kC(),hT="mux-video",wi,Qa,du,Za,uu,cu,hu,fu,mu,Ja,pu,sw=class extends mp{constructor(){super(),X(this,Ja),X(this,wi,void 0),X(this,Qa,void 0),X(this,du,void 0),X(this,Za,{}),X(this,uu,{}),X(this,cu,void 0),X(this,hu,void 0),X(this,fu,void 0),X(this,mu,void 0),Z(this,du,eu())}static get NAME(){return hT}static get VERSION(){return cT}static get observedAttributes(){var i;return[...rw,...(i=mp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?Ln.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${Ln.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,du)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,fu))!=null?i:hT}set playerSoftwareName(i){Z(this,fu,i)}get playerSoftwareVersion(){var i;return(i=I(this,hu))!=null?i:cT}set playerSoftwareVersion(i){Z(this,hu,i)}get _hls(){var i;return(i=I(this,wi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=lp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,mu)}set errorTranslator(i){Z(this,mu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=op(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Qd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,uu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Z(this,uu,i!=null?i:{})}get ended(){return up(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:Xd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return iu(this.nativeEl)}async addCuePoints(i){return ip(this.nativeEl,i)}get activeCuePoint(){return rp(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return np(this.nativeEl,i)}get activeChapter(){return ap(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Wy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===Wt.MSE||i===Wt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Wt.MSE||i===Wt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){Z(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,cu)}set _hlsConfig(i){Z(this,cu,i)}load(){Z(this,wi,Zy(this,this.nativeEl,I(this,wi)))}unload(){cp(this.nativeEl,I(this,wi)),Z(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(mp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Me(this,Ja,pu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Me(this,Ja,pu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,wi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,wi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Wa(this);break;case C.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,wi)&&Me(this,Ja,pu).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,Qa=new WeakMap,du=new WeakMap,Za=new WeakMap,uu=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,Ja=new WeakSet,pu=async function(){I(this,Qa)||(await Z(this,Qa,Promise.resolve()),Z(this,Qa,null),this.load())};var gu,Dp=class extends GC(ew(sw)){constructor(){super(...arguments),X(this,gu,void 0)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,gu))!=null?i:this.muxCastCustomData}set castCustomData(i){Z(this,gu,i)}};gu=new WeakMap;fp.customElements.get("mux-video")||(fp.customElements.define("mux-video",Dp),fp.MuxVideoElement=Dp);var _T=Dp;function AT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Up(i){let e=nw(i).toString();return e?"?"+e:""}function nw(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Fp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Fp(i,e.getRootNode().host);var ST="mux.com",aw=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},ow=aw(),Ru=()=>ow,xT=(i,{token:e,customDomain:t=ST,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Up({token:e,time:n,program_time:s})}`},RT=(i,{token:e,customDomain:t=ST,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Up({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([xe.LIVE,xe.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return xe.LIVE}};var lw={crossorigin:"crossOrigin",playsinline:"playsInline"};function IT(i){var e;return(e=lw[i])!=null?e:Su(i)}var Ss,xs,xt,xu=class{constructor(e,t){Xe(this,Ss,void 0);Xe(this,xs,void 0);Xe(this,xt,[]);Ut(this,Ss,e),Ut(this,xs,t)}[Symbol.iterator](){return Te(this,xt).values()}get length(){return Te(this,xt).length}get value(){var e;return(e=Te(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ut(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Te(this,xt)[e]}values(){return Te(this,xt).values()}keys(){return Te(this,xt).keys()}forEach(e){Te(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Te(this,xt).push(s)}),!(this.value===""&&!((t=Te(this,Ss))!=null&&t.hasAttribute(`${Te(this,xs)}`)))&&((r=Te(this,Ss))==null||r.setAttribute(`${Te(this,xs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Te(this,xt).splice(Te(this,xt).indexOf(r),1)}),(t=Te(this,Ss))==null||t.setAttribute(`${Te(this,xs)}`,`${this.value}`)}contains(e){return Te(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Ss=new WeakMap,xs=new WeakMap,xt=new WeakMap;var LT=`[mux-player ${Ru()}]`;function Di(...i){console.warn(LT,...i)}function Pt(...i){console.error(LT,...i)}function Bp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${Q("Read more: ")}
1316
+ `}function pT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T,_,A,k,x,M;let O=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),D=O?DC(O):[];return n=class extends i{constructor(){super(...arguments),X(this,f),X(this,p),X(this,E),X(this,T),X(this,A),X(this,x),X(this,d,!1),X(this,u,null),X(this,c,new Map),X(this,h,void 0),Ie(this,"get"),Ie(this,"set"),Ie(this,"call")}static get observedAttributes(){var R,P,N;return Me(R=n,o,l).call(R),[...(N=(P=O==null?void 0:O.constructor)==null?void 0:P.observedAttributes)!=null?N:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,P,N,$,G;return Me(this,f,m).call(this),(G=($=(P=(R=I(this,u))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?P:this.querySelector(e))!=null?$:(N=this.shadowRoot)==null?void 0:N.querySelector(e))!=null?G:null}set nativeEl(R){Z(this,u,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,P;return(P=this.getAttribute("preload"))!=null?P:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R;if(!this.shadowRoot){this.attachShadow({mode:"open"});let P=MC(this.attributes);t&&(P.is=t),e&&(P.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(P)}this.nativeEl.muted=this.hasAttribute("muted");for(let P of D)Me(this,A,k).call(this,P);Z(this,h,new MutationObserver(Me(this,E,b).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Me(this,p,g).call(this);for(let P of this.constructor.Events)(R=this.shadowRoot)==null||R.addEventListener(P,this,!0)}handleEvent(R){if(R.type==="slotchange"){Me(this,p,g).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,P,N){Me(this,f,m).call(this),Me(this,x,M).call(this,R,P,N)}connectedCallback(){Me(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Z(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let P of D)if(!(P in this.prototype))if(typeof O[P]=="function")this.prototype[P]=function(...N){return Me(this,f,m).call(this),(()=>{var $;if(this.call)return this.call(P,...N);let G=($=this.nativeEl)==null?void 0:$[P];return G==null?void 0:G.apply(this.nativeEl,N)})()};else{let N={get(){var $,G,K;Me(this,f,m).call(this);let ee=P.toLowerCase();if(R.has(ee)){let ae=this.getAttribute(ee);return ae===null?!1:ae===""?!0:ae}return(K=($=this.get)==null?void 0:$.call(this,P))!=null?K:(G=this.nativeEl)==null?void 0:G[P]}};P!==P.toUpperCase()&&(N.set=function($){Me(this,f,m).call(this);let G=P.toLowerCase();if(R.has(G)){$===!0||$===!1||$==null?this.toggleAttribute(G,!!$):this.setAttribute(G,$);return}if(this.set){this.set(P,$);return}this.nativeEl&&(this.nativeEl[P]=$)}),Object.defineProperty(this.prototype,P,N)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Z(this,d,!0),this.init())},p=new WeakSet,g=function(){var R;let P=new Map(I(this,c)),N=(R=this.shadowRoot)==null?void 0:R.querySelector("slot:not([name])");(N==null?void 0:N.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var G,K;P.delete($);let ee=I(this,c).get($);ee||(ee=$.cloneNode(),I(this,c).set($,ee),(G=I(this,h))==null||G.observe($,{attributes:!0})),(K=this.nativeEl)==null||K.append(ee),Me(this,T,_).call(this,ee)}),P.forEach(($,G)=>{$.remove(),I(this,c).delete(G)})},E=new WeakSet,b=function(R){var P;for(let N of R)if(N.type==="attributes"){let{target:$,attributeName:G}=N,K=I(this,c).get($);K&&G&&(K.setAttribute(G,(P=$.getAttribute(G))!=null?P:""),Me(this,T,_).call(this,K))}},T=new WeakSet,_=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},A=new WeakSet,k=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let P=this[R];delete this[R],this[R]=P}},x=new WeakSet,M=function(R,P,N){var $,G,K;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(N===null?($=this.nativeEl)==null||$.removeAttribute(R):((G=this.nativeEl)==null?void 0:G.getAttribute(R))!==N&&((K=this.nativeEl)==null||K.setAttribute(R,N)))},X(n,o),Ie(n,"getTemplateHTML",e.endsWith("audio")?CC:wC),Ie(n,"shadowRootOptions",{mode:"open"}),Ie(n,"Events",yu),X(n,a,!1),n}function DC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function gT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function MC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var sT,mp=pT((sT=globalThis.HTMLElement)!=null?sT:class{},{tag:"video"}),nT,M2=pT((nT=globalThis.HTMLElement)!=null?nT:class{},{tag:"audio"}),_s=new WeakMap,pp=class extends Error{},PC=class extends Error{},OC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function NC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function UC(){return globalThis.chrome}function FC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function As(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Op(){var i;return(i=As())==null?void 0:i.getCurrentSession()}function Np(){var i;return(i=Op())==null?void 0:i.getSessionObj().media[0]}function BC(i){return new Promise((e,t)=>{Np().editTracksInfo(i,e,t)})}function $C(i){return new Promise((e,t)=>{Np().getStatus(i,e,t)})}function vT(i){return As().setOptions({...ET(),...i})}function ET(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var su=new OC,xr=new WeakSet,at;NC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}at||(at=cast.framework,As().addEventListener(at.CastContextEventType.CAST_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),As().addEventListener(at.CastContextEventType.SESSION_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),su.forEach(s=>{var n,a;return(a=(n=_s.get(s)).init)==null?void 0:a.call(n)}))});var aT=0,Re,nu,Vt,Ar,Mn,kn,Ts,vp,Sr,ls,Ep,oT,vu,bp,yp,bT,au,Tp,_p,lT,ou,gp,HC=class extends EventTarget{constructor(i){super(),X(this,Sr),X(this,Ep),X(this,vu),X(this,yp),X(this,au),X(this,_p),X(this,ou),X(this,Re,void 0),X(this,nu,void 0),X(this,Vt,void 0),X(this,Ar,void 0),X(this,Mn,"disconnected"),X(this,kn,!1),X(this,Ts,new Set),X(this,vp,new WeakMap),Z(this,Re,i),su.add(this),_s.set(this,{init:()=>Me(this,au,Tp).call(this),onCastStateChanged:()=>Me(this,vu,bp).call(this),onSessionStateChanged:()=>Me(this,yp,bT).call(this),getCastPlayer:()=>I(this,Sr,ls)}),Me(this,au,Tp).call(this)}get state(){return I(this,Mn)}async watchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");return I(this,vp).set(i,++aT),I(this,Ts).add(i),aT}async cancelWatchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");i?I(this,Ts).delete(i):I(this,Ts).clear()}async prompt(){var i,e,t,r;if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new PC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Re));xr.add(I(this,Re)),vT(I(this,Re).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Vt).controller.addEventListener(n,a)});try{await As().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Re));return}throw new Error(n)}(r=(t=_s.get(I(this,Re)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Re=new WeakMap,nu=new WeakMap,Vt=new WeakMap,Ar=new WeakMap,Mn=new WeakMap,kn=new WeakMap,Ts=new WeakMap,vp=new WeakMap,Sr=new WeakSet,ls=function(){if(xr.has(I(this,Re)))return I(this,Vt)},Ep=new WeakSet,oT=function(){xr.has(I(this,Re))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Vt).controller.removeEventListener(i,e)}),xr.delete(I(this,Re)),I(this,Re).muted=I(this,Vt).isMuted,I(this,Re).currentTime=I(this,Vt).savedPlayerState.currentTime,I(this,Vt).savedPlayerState.isPaused===!1&&I(this,Re).play())},vu=new WeakSet,bp=function(){let i=As().getCastState();if(xr.has(I(this,Re))&&i==="CONNECTING"&&(Z(this,Mn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,kn)&&i!=null&&i.includes("CONNECT")){Z(this,kn,!0);for(let e of I(this,Ts))e(!0)}else if(I(this,kn)&&(!i||i==="NO_DEVICES_AVAILABLE")){Z(this,kn,!1);for(let e of I(this,Ts))e(!1)}},yp=new WeakSet,bT=async function(){var i;let{SESSION_RESUMED:e}=at.SessionState;if(As().getSessionState()===e&&I(this,Re).castSrc===((i=Np())==null?void 0:i.media.contentId)){xr.add(I(this,Re)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Vt).controller.addEventListener(t,r)});try{await $C(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[at.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},au=new WeakSet,Tp=function(){!at||I(this,nu)||(Z(this,nu,!0),vT(I(this,Re).castOptions),I(this,Re).textTracks.addEventListener("change",()=>Me(this,ou,gp).call(this)),Me(this,vu,bp).call(this),Z(this,Vt,new at.RemotePlayer),new at.RemotePlayerController(I(this,Vt)),Z(this,Ar,{[at.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Z(this,Mn,"connected"),this.dispatchEvent(new Event("connect"))):(Me(this,Ep,oT).call(this),Z(this,Mn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[at.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("durationchange"))},[at.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&I(this,Re).dispatchEvent(new Event("timeupdate"))},[at.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("resize"))},[at.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event(this.paused?"pause":"play"))},[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,ls))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Re).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,Sr,ls))==null?void 0:e.playerState]))},[at.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Me(this,_p,lT).call(this))}}))},_p=new WeakSet,lT=function(){Me(this,ou,gp).call(this)},ou=new WeakSet,gp=async function(){var i,e,t,r,s;if(!I(this,Sr,ls))return;let n=((e=(i=I(this,Vt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Re).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Op())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await BC(h)}catch(h){console.error(h)}};var GC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),X(this,o),X(this,d),X(this,r,{paused:!1}),X(this,s,ET()),X(this,n,void 0),X(this,a,void 0)}get remote(){return I(this,a)?I(this,a):UC()?(FC(),_s.set(this,{loadOnPrompt:()=>Me(this,d,u).call(this)}),Z(this,a,new HC(this))):super.remote}attributeChangedCallback(c,h,f){if(super.attributeChangedCallback(c,h,f),c==="cast-receiver"&&f){I(this,s).receiverApplicationId=f;return}if(I(this,o,l))switch(c){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var c,h;if(!I(this,o,l))return super.load();let f=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);f.customData=this.castCustomData;let m=[...this.querySelectorAll("track")].filter(({kind:b,src:T})=>T&&(b==="subtitles"||b==="captions")),p=[],g=0;m.length&&(f.tracks=m.map(b=>{let T=++g;p.length===0&&b.track.mode==="showing"&&p.push(T);let _=new chrome.cast.media.Track(T,chrome.cast.media.TrackType.TEXT);return _.trackContentId=b.src,_.trackContentType="text/vtt",_.subtype=b.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,_.name=b.label,_.language=b.srclang,_})),this.castStreamType==="live"?f.streamType=chrome.cast.media.StreamType.LIVE:f.streamType=chrome.cast.media.StreamType.BUFFERED,f.metadata=new chrome.cast.media.GenericMediaMetadata,f.metadata.title=this.title,f.metadata.images=[{url:this.poster}];let E=new chrome.cast.media.LoadRequest(f);E.currentTime=(c=super.currentTime)!=null?c:0,E.autoplay=!I(this,r).paused,E.activeTrackIds=p,await((h=Op())==null?void 0:h.loadMedia(E)),this.dispatchEvent(new Event("volumechange"))}play(){var c;if(I(this,o,l)){I(this,o,l).isPaused&&((c=I(this,o,l).controller)==null||c.playOrPause());return}return super.play()}pause(){var c;if(I(this,o,l)){I(this,o,l).isPaused||(c=I(this,o,l).controller)==null||c.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var c;return(c=this.getAttribute("cast-receiver"))!=null?c:void 0}set castReceiver(c){this.castReceiver!=c&&this.setAttribute("cast-receiver",`${c}`)}get castSrc(){var c,h,f;return(f=(h=this.getAttribute("cast-src"))!=null?h:(c=this.querySelector("source"))==null?void 0:c.src)!=null?f:this.currentSrc}set castSrc(c){this.castSrc!=c&&this.setAttribute("cast-src",`${c}`)}get castContentType(){var c;return(c=this.getAttribute("cast-content-type"))!=null?c:void 0}set castContentType(c){this.setAttribute("cast-content-type",`${c}`)}get castStreamType(){var c,h;return(h=(c=this.getAttribute("cast-stream-type"))!=null?c:this.streamType)!=null?h:void 0}set castStreamType(c){this.setAttribute("cast-stream-type",`${c}`)}get castCustomData(){return I(this,n)}set castCustomData(c){let h=typeof c;if(!["object","undefined"].includes(h)){console.error(`castCustomData must be nullish or an object but value was of type ${h}`);return}Z(this,n,c)}get readyState(){if(I(this,o,l))switch(I(this,o,l).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var c;return I(this,o,l)?(c=I(this,o,l))==null?void 0:c.isMuted:super.muted}set muted(c){var h;if(I(this,o,l)){(c&&!I(this,o,l).isMuted||!c&&I(this,o,l).isMuted)&&((h=I(this,o,l).controller)==null||h.muteOrUnmute());return}super.muted=c}get volume(){var c,h;return I(this,o,l)?(h=(c=I(this,o,l))==null?void 0:c.volumeLevel)!=null?h:1:super.volume}set volume(c){var h;if(I(this,o,l)){I(this,o,l).volumeLevel=+c,(h=I(this,o,l).controller)==null||h.setVolumeLevel();return}super.volume=c}get duration(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.duration)!=null?f:NaN:super.duration}get currentTime(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.currentTime)!=null?f:0:super.currentTime}set currentTime(c){var h;if(I(this,o,l)){I(this,o,l).currentTime=c,(h=I(this,o,l).controller)==null||h.seek();return}super.currentTime=c}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var c,h;return(h=(c=_s.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=hp(t.prototype,this,"paused"),hp(t.prototype,this,"pause").call(this),this.muted=hp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},Ie(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},Tu=class extends Event{constructor(i,e){super(i),Ie(this,"track"),this.track=e.track}},Ap=new WeakMap;function j(i){var e;return(e=Ap.get(i))!=null?e:KC(i,{})}function KC(i,e){let t=Ap.get(i);return t||Ap.set(i,t={}),Object.assign(t,e)}function Sp(i,e){let t=i.videoTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in Rp.prototype||Object.defineProperty(Rp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function xp(i){var e;let t=(e=j(i).media)==null?void 0:e.videoTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function WC(i){var e;let t=(e=j(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(j(t).changeRequested)return;j(t).changeRequested=!0,queueMicrotask(()=>{delete j(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ds,us,cs,Cn,Va,Rp=class extends EventTarget{constructor(){super(),X(this,Cn),X(this,ds,void 0),X(this,us,void 0),X(this,cs,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,Cn,Va).values()}get length(){return I(this,Cn,Va).size}getTrackById(i){var e;return(e=[...I(this,Cn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,Cn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ds)}set onaddtrack(i){I(this,ds)&&(this.removeEventListener("addtrack",I(this,ds)),Z(this,ds,void 0)),typeof i=="function"&&(Z(this,ds,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,us)}set onremovetrack(i){I(this,us)&&(this.removeEventListener("removetrack",I(this,us)),Z(this,us,void 0)),typeof i=="function"&&(Z(this,us,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,cs)}set onchange(i){I(this,cs)&&(this.removeEventListener("change",I(this,cs)),Z(this,cs,void 0)),typeof i=="function"&&(Z(this,cs,i),this.addEventListener("change",i))}};ds=new WeakMap,us=new WeakMap,cs=new WeakMap,Cn=new WeakSet,Va=function(){return j(this).trackSet};var _u=class extends Event{constructor(i,e){super(i),Ie(this,"rendition"),this.rendition=e.rendition}};function VC(i,e){let t=j(i).media.videoRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Ip.prototype||Object.defineProperty(Ip.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function YC(i){let e=j(i).media.videoRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.selected&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function qC(i){let e=j(i).media.videoRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...j(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...j(e).renditionSet])}var hs,fs,ms,Ip=class extends EventTarget{constructor(){super(...arguments),X(this,hs,void 0),X(this,fs,void 0),X(this,ms,void 0)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,hs)}set onaddrendition(i){I(this,hs)&&(this.removeEventListener("addrendition",I(this,hs)),Z(this,hs,void 0)),typeof i=="function"&&(Z(this,hs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,fs)}set onremoverendition(i){I(this,fs)&&(this.removeEventListener("removerendition",I(this,fs)),Z(this,fs,void 0)),typeof i=="function"&&(Z(this,fs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,ms)}set onchange(i){I(this,ms)&&(this.removeEventListener("change",I(this,ms)),Z(this,ms,void 0)),typeof i=="function"&&(Z(this,ms,i),this.addEventListener("change",i))}};hs=new WeakMap,fs=new WeakMap,ms=new WeakMap;var Ya,jC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"width"),Ie(this,"height"),Ie(this,"bitrate"),Ie(this,"frameRate"),Ie(this,"codec"),X(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Z(this,Ya,i),qC(this))}};Ya=new WeakMap;var qa,yT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,qa,!1)}addRendition(i,e,t,r,s,n){let a=new jC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,VC(this,a),a}removeRendition(i){YC(i)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Z(this,qa,i),i===!0&&WC(this))}};qa=new WeakMap;function zC(i,e){let t=j(i).media.audioRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Lp.prototype||Object.defineProperty(Lp.prototype,s,{get(){return Dn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function XC(i){let e=j(i).media.audioRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.enabled&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function QC(i){let e=j(i).media.audioRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Dn(i){return[...j(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...j(e).renditionSet])}var ps,gs,vs,Lp=class extends EventTarget{constructor(){super(...arguments),X(this,ps,void 0),X(this,gs,void 0),X(this,vs,void 0)}[Symbol.iterator](){return Dn(this).values()}get length(){return Dn(this).length}getRenditionById(i){var e;return(e=Dn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Dn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Dn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ps)}set onaddrendition(i){I(this,ps)&&(this.removeEventListener("addrendition",I(this,ps)),Z(this,ps,void 0)),typeof i=="function"&&(Z(this,ps,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,gs)}set onremoverendition(i){I(this,gs)&&(this.removeEventListener("removerendition",I(this,gs)),Z(this,gs,void 0)),typeof i=="function"&&(Z(this,gs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,vs)}set onchange(i){I(this,vs)&&(this.removeEventListener("change",I(this,vs)),Z(this,vs,void 0)),typeof i=="function"&&(Z(this,vs,i),this.addEventListener("change",i))}};ps=new WeakMap,gs=new WeakMap,vs=new WeakMap;var ja,ZC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"bitrate"),Ie(this,"codec"),X(this,ja,!1)}get selected(){return I(this,ja)}set selected(i){I(this,ja)!==i&&(Z(this,ja,i),QC(this))}};ja=new WeakMap;function kp(i,e){let t=i.audioTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in wp.prototype||Object.defineProperty(wp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function Cp(i){var e;let t=(e=j(i).media)==null?void 0:e.audioTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function JC(i){let e=j(i).media.audioTracks;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Es,bs,ys,za,lu,wp=class extends EventTarget{constructor(){super(),X(this,za),X(this,Es,void 0),X(this,bs,void 0),X(this,ys,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,za,lu).values()}get length(){return I(this,za,lu).size}getTrackById(i){var e;return(e=[...I(this,za,lu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,Es)}set onaddtrack(i){I(this,Es)&&(this.removeEventListener("addtrack",I(this,Es)),Z(this,Es,void 0)),typeof i=="function"&&(Z(this,Es,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,bs)}set onremovetrack(i){I(this,bs)&&(this.removeEventListener("removetrack",I(this,bs)),Z(this,bs,void 0)),typeof i=="function"&&(Z(this,bs,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,ys)}set onchange(i){I(this,ys)&&(this.removeEventListener("change",I(this,ys)),Z(this,ys,void 0)),typeof i=="function"&&(Z(this,ys,i),this.addEventListener("change",i))}};Es=new WeakMap,bs=new WeakMap,ys=new WeakMap,za=new WeakSet,lu=function(){return j(this).trackSet};var Xa,TT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,Xa,!1)}addRendition(i,e,t){let r=new ZC;return r.src=i,r.codec=e,r.bitrate=t,zC(this,r),r}removeRendition(i){XC(i)}get enabled(){return I(this,Xa)}set enabled(i){I(this,Xa)!==i&&(Z(this,Xa,i),JC(this))}};Xa=new WeakMap;var dT=Eu(globalThis.HTMLMediaElement,"video"),uT=Eu(globalThis.HTMLMediaElement,"audio");function ew(i){if(!(i!=null&&i.prototype))return i;let e=Eu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return tw(this)}});let t=Eu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return iw(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new yT;return l.kind=n,l.label=a,l.language=o,Sp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=xp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new TT;return l.kind=n,l.label=a,l.language=o,kp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Cp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=j(n).videoRenditions;return a||(a=new Ip,j(a).media=n,j(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=j(n).audioRenditions;return a||(a=new Lp,j(a).media=n,j(n).audioRenditions=a),a};return i}function Eu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function tw(i){var e;let t=j(i).videoTracks;if(!t&&(t=new Rp,j(i).videoTracks=t,dT)){let r=dT.call((e=i.nativeEl)!=null?e:i);for(let s of r)Sp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof yT)){for(let n of r)xp(n);return}Sp(i,s.track)}),r.addEventListener("removetrack",s=>{xp(s.track)})}return t}function iw(i){var e;let t=j(i).audioTracks;if(!t&&(t=new wp,j(i).audioTracks=t,uT)){let r=uT.call((e=i.nativeEl)!=null?e:i);for(let s of r)kp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof TT)){for(let n of r)Cp(n);return}kp(i,s.track)}),r.addEventListener("removetrack",s=>{Cp(s.track)})}return t}yu.push("castchange","entercast","leavecast");var C={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},rw=Object.values(C),cT=kC(),hT="mux-video",wi,Qa,du,Za,uu,cu,hu,fu,mu,Ja,pu,sw=class extends mp{constructor(){super(),X(this,Ja),X(this,wi,void 0),X(this,Qa,void 0),X(this,du,void 0),X(this,Za,{}),X(this,uu,{}),X(this,cu,void 0),X(this,hu,void 0),X(this,fu,void 0),X(this,mu,void 0),Z(this,du,eu())}static get NAME(){return hT}static get VERSION(){return cT}static get observedAttributes(){var i;return[...rw,...(i=mp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?Ln.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${Ln.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,du)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,fu))!=null?i:hT}set playerSoftwareName(i){Z(this,fu,i)}get playerSoftwareVersion(){var i;return(i=I(this,hu))!=null?i:cT}set playerSoftwareVersion(i){Z(this,hu,i)}get _hls(){var i;return(i=I(this,wi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=lp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,mu)}set errorTranslator(i){Z(this,mu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=op(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Qd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,uu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Z(this,uu,i!=null?i:{})}get ended(){return up(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:Xd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return iu(this.nativeEl)}async addCuePoints(i){return ip(this.nativeEl,i)}get activeCuePoint(){return rp(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return np(this.nativeEl,i)}get activeChapter(){return ap(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Wy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===Wt.MSE||i===Wt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Wt.MSE||i===Wt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){Z(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,cu)}set _hlsConfig(i){Z(this,cu,i)}load(){Z(this,wi,Zy(this,this.nativeEl,I(this,wi)))}unload(){cp(this.nativeEl,I(this,wi)),Z(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(mp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Me(this,Ja,pu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Me(this,Ja,pu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,wi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,wi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Wa(this);break;case C.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,wi)&&Me(this,Ja,pu).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,Qa=new WeakMap,du=new WeakMap,Za=new WeakMap,uu=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,Ja=new WeakSet,pu=async function(){I(this,Qa)||(await Z(this,Qa,Promise.resolve()),Z(this,Qa,null),this.load())};var gu,Dp=class extends GC(ew(sw)){constructor(){super(...arguments),X(this,gu,void 0)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,gu))!=null?i:this.muxCastCustomData}set castCustomData(i){Z(this,gu,i)}};gu=new WeakMap;fp.customElements.get("mux-video")||(fp.customElements.define("mux-video",Dp),fp.MuxVideoElement=Dp);var _T=Dp;function AT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Up(i){let e=nw(i).toString();return e?"?"+e:""}function nw(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Fp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Fp(i,e.getRootNode().host);var ST="mux.com",aw=()=>{try{return"3.2.0"}catch{}return"UNKNOWN"},ow=aw(),Ru=()=>ow,xT=(i,{token:e,customDomain:t=ST,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Up({token:e,time:n,program_time:s})}`},RT=(i,{token:e,customDomain:t=ST,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Up({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([xe.LIVE,xe.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return xe.LIVE}};var lw={crossorigin:"crossOrigin",playsinline:"playsInline"};function IT(i){var e;return(e=lw[i])!=null?e:Su(i)}var Ss,xs,xt,xu=class{constructor(e,t){Xe(this,Ss,void 0);Xe(this,xs,void 0);Xe(this,xt,[]);Ut(this,Ss,e),Ut(this,xs,t)}[Symbol.iterator](){return Te(this,xt).values()}get length(){return Te(this,xt).length}get value(){var e;return(e=Te(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ut(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Te(this,xt)[e]}values(){return Te(this,xt).values()}keys(){return Te(this,xt).keys()}forEach(e){Te(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Te(this,xt).push(s)}),!(this.value===""&&!((t=Te(this,Ss))!=null&&t.hasAttribute(`${Te(this,xs)}`)))&&((r=Te(this,Ss))==null||r.setAttribute(`${Te(this,xs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Te(this,xt).splice(Te(this,xt).indexOf(r),1)}),(t=Te(this,Ss))==null||t.setAttribute(`${Te(this,xs)}`,`${this.value}`)}contains(e){return Te(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Ss=new WeakMap,xs=new WeakMap,xt=new WeakMap;var LT=`[mux-player ${Ru()}]`;function Di(...i){console.warn(LT,...i)}function Pt(...i){console.error(LT,...i)}function Bp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${Q("Read more: ")}
1317
1317
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Di(e)}var Tt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Rs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},CT=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),dw=yu.filter(i=>i!=="error"),uw=Object.values(Tt).filter(i=>![Tt.PLAYSINLINE].includes(i)),cw=Object.values(Rs),$p=class extends It.HTMLElement{static get observedAttributes(){return[...uw,...cw]}constructor(){super()}init(){dw.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,t,r){var s,n;switch(e){case Rs.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case Rs.VOLUME:{let a=(s=St(r))!=null?s:1;this.media&&(this.media.volume=a);return}case Rs.PLAYBACKRATE:{let a=(n=St(r))!=null?n:1;this.media&&(this.media.playbackRate=a,this.media.defaultPlaybackRate=a);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:CT}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:CT}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=St(this.getAttribute(Rs.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Rs.PLAYBACKRATE,`${e}`):this.removeAttribute(Rs.PLAYBACKRATE)}get crossOrigin(){return to(this,Tt.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(Tt.CROSSORIGIN,`${e}`)}get autoplay(){return to(this,Tt.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(Tt.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(Tt.AUTOPLAY)}get loop(){return to(this,Tt.LOOP)!=null}set loop(e){e?this.setAttribute(Tt.LOOP,""):this.removeAttribute(Tt.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return to(this,Tt.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(Tt.MUTED,""):this.removeAttribute(Tt.MUTED)}get playsInline(){return to(this,Tt.PLAYSINLINE)!=null}set playsInline(e){Pt("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(Tt.PRELOAD,e):this.removeAttribute(Tt.PRELOAD)}};function to(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Hp=$p;var OT=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(OT(i,e,"read from private field"),t?t.call(i):e.get(i)),Mi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ji=(i,e,t,r)=>(OT(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Pn,Iu,Is,io,Rr,Ir,Lr,Ls,On,Lu,ai,wT=1,DT=0,hw=1,fw={processCallback(i,e,t){if(t){for(let[r,s]of e)if(r in t){let n=t[r];typeof n=="boolean"&&s instanceof Rt&&typeof s.element[s.attributeName]=="boolean"?s.booleanValue=n:typeof n=="function"&&s instanceof Rt?s.element[s.attributeName]=n:s.value=n}}}},er=class extends S.DocumentFragment{constructor(e,t,r=fw){var s;super(),Mi(this,Pn,void 0),Mi(this,Iu,void 0),this.append(e.content.cloneNode(!0)),Ji(this,Pn,NT(this)),Ji(this,Iu,r),(s=r.createCallback)==null||s.call(r,this,de(this,Pn),t),r.processCallback(this,de(this,Pn),t)}update(e){de(this,Iu).processCallback(this,de(this,Pn),e)}};Pn=new WeakMap;Iu=new WeakMap;var NT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Gp;for([t,r]of PT(s.value))if(!t)n.append(r);else{let a=new Rt(i,s.name,s.namespaceURI);n.append(a),e.push([r,a])}s.value=n.toString()}for(let s of i.childNodes)if(s.nodeType===wT&&!(s instanceof HTMLTemplateElement))NT(s,e);else{let n=s.data;if(s.nodeType===wT||n.includes("{{")){let a=[];if(n)for([t,r]of PT(n))if(!t)a.push(new Text(r));else{let o=new tr(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new ro(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},MT={},PT=i=>{let e="",t=0,r=MT[i],s=0,n;if(r)return r;for(r=[];n=i[s];s++)n==="{"&&i[s+1]==="{"&&i[s-1]!=="\\"&&i[s+2]&&++t==1?(e&&r.push([DT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([hw,e.trim()]),e="",s++):e+=n||"";return e&&r.push([DT,(t>0?"{{":"")+e]),MT[i]=r},mw=11,ku=class{get value(){return""}set value(e){}toString(){return this.value}},UT=new WeakMap,Gp=class{constructor(){Mi(this,Is,[])}[Symbol.iterator](){return de(this,Is).values()}get length(){return de(this,Is).length}item(e){return de(this,Is)[e]}append(...e){for(let t of e)t instanceof Rt&&UT.set(t,this),de(this,Is).push(t)}toString(){return de(this,Is).join("")}};Is=new WeakMap;var Rt=class extends ku{constructor(e,t,r){super(),Mi(this,Ls),Mi(this,io,""),Mi(this,Rr,void 0),Mi(this,Ir,void 0),Mi(this,Lr,void 0),Ji(this,Rr,e),Ji(this,Ir,t),Ji(this,Lr,r)}get attributeName(){return de(this,Ir)}get attributeNamespace(){return de(this,Lr)}get element(){return de(this,Rr)}get value(){return de(this,io)}set value(e){de(this,io)!==e&&(Ji(this,io,e),!de(this,Ls,On)||de(this,Ls,On).length===1?e==null?de(this,Rr).removeAttributeNS(de(this,Lr),de(this,Ir)):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),e):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),de(this,Ls,On).toString()))}get booleanValue(){return de(this,Rr).hasAttributeNS(de(this,Lr),de(this,Ir))}set booleanValue(e){if(!de(this,Ls,On)||de(this,Ls,On).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};io=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Lr=new WeakMap;Ls=new WeakSet;On=function(){return UT.get(this)};var tr=class extends ku{constructor(e,t){super(),Mi(this,Lu,void 0),Mi(this,ai,void 0),Ji(this,Lu,e),Ji(this,ai,t?[...t]:[new Text])}get replacementNodes(){return de(this,ai)}get parentNode(){return de(this,Lu)}get nextSibling(){return de(this,ai)[de(this,ai).length-1].nextSibling}get previousSibling(){return de(this,ai)[0].previousSibling}get value(){return de(this,ai).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(r=>r==null?[new Text]:r.forEach?[...r]:r.nodeType===mw?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),Ji(this,ai,pw(de(this,ai)[0].parentNode,de(this,ai),t,this.nextSibling))}};Lu=new WeakMap;ai=new WeakMap;var ro=class extends tr{constructor(e,t){let r=t.getAttribute("directive")||t.getAttribute("type"),s=t.getAttribute("expression")||t.getAttribute(r)||"";s.startsWith("{{")&&(s=s.trim().slice(2,-2).trim()),super(e),this.expression=s,this.template=t,this.directive=r}};function pw(i,e,t,r=null){let s=0,n,a,o,l=t.length,d=e.length;for(;s<l&&s<d&&e[s]==t[s];)s++;for(;s<l&&s<d&&t[l-1]==e[d-1];)r=t[--d,--l];if(s==d)for(;s<l;)i.insertBefore(t[s++],r);if(s==l)for(;s<d;)i.removeChild(e[s++]);else{for(n=e[s];s<l;)o=t[s++],a=n?n.nextSibling:r,n==o?n=a:s<l&&t[s]==a?(i.replaceChild(o,n),n=a):i.insertBefore(o,n);for(;n!=r;)a=n.nextSibling,i.removeChild(n),n=a}return t}var FT={string:i=>String(i)},wu=class{constructor(e){this.template=e,this.state=void 0}},ks=new WeakMap,Cs=new WeakMap,Kp={partial:(i,e)=>{e[i.expression]=new wu(i.template)},if:(i,e)=>{var t;if($T(i.expression,e))if(ks.get(i)!==i.template){ks.set(i,i.template);let r=new er(i.template,e,Du);i.replace(r),Cs.set(i,r)}else(t=Cs.get(i))==null||t.update(e);else i.replace(""),ks.delete(i),Cs.delete(i)}},gw=Object.keys(Kp),Du={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof ro){if(!a.directive){let l=gw.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=Kp[a.directive])==null||r.call(Kp,a,t);continue}let o=$T(n,t);if(o instanceof wu){ks.get(a)!==o.template?(ks.set(a,o.template),o=new er(o.template,o.state,Du),a.value=o,Cs.set(a,o)):(s=Cs.get(a))==null||s.update(o.state);continue}o?(a instanceof Rt&&a.attributeName.startsWith("aria-")&&(o=String(o)),a instanceof Rt?typeof o=="boolean"?a.booleanValue=o:typeof o=="function"?a.element[a.attributeName]=o:a.value=o:(a.value=o,ks.delete(a),Cs.delete(a))):a instanceof Rt?a.value=void 0:(a.value=void 0,ks.delete(a),Cs.delete(a))}}},BT={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=FT[e])==null?void 0:t.call(FT,i)}};function vw(i){return Ew(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function $T(i,e={}){var t,r,s,n,a,o,l;let d=vw(i);if(d.length===0||d.some(({type:u})=>!u))return so(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return so(i);let c={...e};u.state=c;let h=d.slice(2);for(let f=0;f<h.length;f+=3){let m=(s=h[f])==null?void 0:s.token,p=(n=h[f+1])==null?void 0:n.token,g=(a=h[f+2])==null?void 0:a.token;m&&p==="="&&(c[m]=no(g,e))}return u}if(d.length===1)return Cu(d[0])?no(d[0].token,e):so(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=BT[u];if(!c||!Cu(d[1]))return so(i);let h=no(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=BT[u];if(!c||!Cu(d[0])||!Cu(d[2]))return so(i);let h=no(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=no(d[2].token,e);return c(h,f)}}function so(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Cu({type:i}){return["number","boolean","string","param"].includes(i)}function no(i,e){let t=i[0],r=i.slice(-1);return i==="true"||i==="false"?i==="true":t===r&&["'",'"'].includes(t)?i.slice(1,-1):Po(i)?parseFloat(i):e[i]}function Ew(i,e){let t,r,s,n=[];for(;i;){s=null,t=i.length;for(let a in e)r=e[a].exec(i),r&&r.index<t&&(s={token:r[0],type:a,matches:r.slice(1)},t=r.index);t&&n.push({token:i.substr(0,t),type:void 0}),s&&n.push(s),i=i.substr(t+(s?s.token.length:0))}return n}var zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yp=(i,e,t)=>(zp(i,e,"read from private field"),t?t.call(i):e.get(i)),ao=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ws=(i,e,t,r)=>(zp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Wp=(i,e,t)=>(zp(i,e,"access private method"),t),Nn,Mu,Un,qp,HT,Pu,jp,Vp={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},GT=B.createElement("template");GT.innerHTML=`
1318
1318
  <style>
1319
1319
  :host {
@@ -1271,7 +1271,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1271
1271
  `:""}${i.error?`error: ${i.error}
1272
1272
  `:""}${i.event?`event: ${i.event}
1273
1273
  `:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
1274
- `:""}`),l.data=i,l};var bC=Object.defineProperty,yC=Object.getPrototypeOf,TC=Reflect.get,_C=(i,e,t)=>e in i?bC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ie=(i,e,t)=>(_C(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),X=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Z=(i,e,t,r)=>(Mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Me=(i,e,t)=>(Mp(i,e,"access private method"),t),hp=(i,e,t)=>TC(yC(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Pp=class extends bu{},AC=class extends bu{},SC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Pp)}},ru,xC=class{constructor(i,e={}){X(this,ru,void 0),Z(this,ru,e==null?void 0:e.detail)}get detail(){return I(this,ru)}initCustomEvent(){}};ru=new WeakMap;function RC(i,e){return new Pp}var fT={document:{createElement:RC},DocumentFragment,customElements:SC,CustomEvent:xC,EventTarget:bu,HTMLElement:Pp,HTMLVideoElement:AC},mT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",fp=mT?fT:globalThis,w2=mT?fT.document:globalThis.document,IC=()=>{try{return"0.22.0"}catch{}return"UNKNOWN"},LC=IC(),kC=()=>LC,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"];function CC(i){return`
1274
+ `:""}`),l.data=i,l};var bC=Object.defineProperty,yC=Object.getPrototypeOf,TC=Reflect.get,_C=(i,e,t)=>e in i?bC(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ie=(i,e,t)=>(_C(i,typeof e!="symbol"?e+"":e,t),t),Mp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Mp(i,e,"read from private field"),t?t.call(i):e.get(i)),X=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Z=(i,e,t,r)=>(Mp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Me=(i,e,t)=>(Mp(i,e,"access private method"),t),hp=(i,e,t)=>TC(yC(i),t,e),bu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends bu{}globalThis.DocumentFragment=i}var Pp=class extends bu{},AC=class extends bu{},SC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Pp)}},ru,xC=class{constructor(i,e={}){X(this,ru,void 0),Z(this,ru,e==null?void 0:e.detail)}get detail(){return I(this,ru)}initCustomEvent(){}};ru=new WeakMap;function RC(i,e){return new Pp}var fT={document:{createElement:RC},DocumentFragment,customElements:SC,CustomEvent:xC,EventTarget:bu,HTMLElement:Pp,HTMLVideoElement:AC},mT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",fp=mT?fT:globalThis,w2=mT?fT.document:globalThis.document,IC=()=>{try{return"0.23.0"}catch{}return"UNKNOWN"},LC=IC(),kC=()=>LC,yu=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting","waitingforkey","resize","enterpictureinpicture","leavepictureinpicture","webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"];function CC(i){return`
1275
1275
  <style>
1276
1276
  :host {
1277
1277
  display: inline-flex;
@@ -1313,7 +1313,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1313
1313
  <video${gT(i)}></video>
1314
1314
  </slot>
1315
1315
  <slot></slot>
1316
- `}function pT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T,_,A,k,x,M;let O=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),D=O?DC(O):[];return n=class extends i{constructor(){super(...arguments),X(this,f),X(this,p),X(this,E),X(this,T),X(this,A),X(this,x),X(this,d,!1),X(this,u,null),X(this,c,new Map),X(this,h,void 0),Ie(this,"get"),Ie(this,"set"),Ie(this,"call")}static get observedAttributes(){var R,P,N;return Me(R=n,o,l).call(R),[...(N=(P=O==null?void 0:O.constructor)==null?void 0:P.observedAttributes)!=null?N:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,P,N,$,G;return Me(this,f,m).call(this),(G=($=(P=(R=I(this,u))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?P:this.querySelector(e))!=null?$:(N=this.shadowRoot)==null?void 0:N.querySelector(e))!=null?G:null}set nativeEl(R){Z(this,u,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,P;return(P=this.getAttribute("preload"))!=null?P:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R;if(!this.shadowRoot){this.attachShadow({mode:"open"});let P=MC(this.attributes);t&&(P.is=t),e&&(P.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(P)}this.nativeEl.muted=this.hasAttribute("muted");for(let P of D)Me(this,A,k).call(this,P);Z(this,h,new MutationObserver(Me(this,E,b).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Me(this,p,g).call(this);for(let P of this.constructor.Events)(R=this.shadowRoot)==null||R.addEventListener(P,this,!0)}handleEvent(R){if(R.type==="slotchange"){Me(this,p,g).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,P,N){Me(this,f,m).call(this),Me(this,x,M).call(this,R,P,N)}connectedCallback(){Me(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Z(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let P of D)if(!(P in this.prototype))if(typeof O[P]=="function")this.prototype[P]=function(...N){return Me(this,f,m).call(this),(()=>{var $;if(this.call)return this.call(P,...N);let G=($=this.nativeEl)==null?void 0:$[P];return G==null?void 0:G.apply(this.nativeEl,N)})()};else{let N={get(){var $,G,K;Me(this,f,m).call(this);let ee=P.toLowerCase();if(R.has(ee)){let ae=this.getAttribute(ee);return ae===null?!1:ae===""?!0:ae}return(K=($=this.get)==null?void 0:$.call(this,P))!=null?K:(G=this.nativeEl)==null?void 0:G[P]}};P!==P.toUpperCase()&&(N.set=function($){Me(this,f,m).call(this);let G=P.toLowerCase();if(R.has(G)){$===!0||$===!1||$==null?this.toggleAttribute(G,!!$):this.setAttribute(G,$);return}if(this.set){this.set(P,$);return}this.nativeEl&&(this.nativeEl[P]=$)}),Object.defineProperty(this.prototype,P,N)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Z(this,d,!0),this.init())},p=new WeakSet,g=function(){var R;let P=new Map(I(this,c)),N=(R=this.shadowRoot)==null?void 0:R.querySelector("slot:not([name])");(N==null?void 0:N.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var G,K;P.delete($);let ee=I(this,c).get($);ee||(ee=$.cloneNode(),I(this,c).set($,ee),(G=I(this,h))==null||G.observe($,{attributes:!0})),(K=this.nativeEl)==null||K.append(ee),Me(this,T,_).call(this,ee)}),P.forEach(($,G)=>{$.remove(),I(this,c).delete(G)})},E=new WeakSet,b=function(R){var P;for(let N of R)if(N.type==="attributes"){let{target:$,attributeName:G}=N,K=I(this,c).get($);K&&G&&(K.setAttribute(G,(P=$.getAttribute(G))!=null?P:""),Me(this,T,_).call(this,K))}},T=new WeakSet,_=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},A=new WeakSet,k=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let P=this[R];delete this[R],this[R]=P}},x=new WeakSet,M=function(R,P,N){var $,G,K;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(N===null?($=this.nativeEl)==null||$.removeAttribute(R):((G=this.nativeEl)==null?void 0:G.getAttribute(R))!==N&&((K=this.nativeEl)==null||K.setAttribute(R,N)))},X(n,o),Ie(n,"getTemplateHTML",e.endsWith("audio")?CC:wC),Ie(n,"shadowRootOptions",{mode:"open"}),Ie(n,"Events",yu),X(n,a,!1),n}function DC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function gT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function MC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var sT,mp=pT((sT=globalThis.HTMLElement)!=null?sT:class{},{tag:"video"}),nT,M2=pT((nT=globalThis.HTMLElement)!=null?nT:class{},{tag:"audio"}),_s=new WeakMap,pp=class extends Error{},PC=class extends Error{},OC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function NC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function UC(){return globalThis.chrome}function FC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function As(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Op(){var i;return(i=As())==null?void 0:i.getCurrentSession()}function Np(){var i;return(i=Op())==null?void 0:i.getSessionObj().media[0]}function BC(i){return new Promise((e,t)=>{Np().editTracksInfo(i,e,t)})}function $C(i){return new Promise((e,t)=>{Np().getStatus(i,e,t)})}function vT(i){return As().setOptions({...ET(),...i})}function ET(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var su=new OC,xr=new WeakSet,at;NC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}at||(at=cast.framework,As().addEventListener(at.CastContextEventType.CAST_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),As().addEventListener(at.CastContextEventType.SESSION_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),su.forEach(s=>{var n,a;return(a=(n=_s.get(s)).init)==null?void 0:a.call(n)}))});var aT=0,Re,nu,Vt,Ar,Mn,kn,Ts,vp,Sr,ls,Ep,oT,vu,bp,yp,bT,au,Tp,_p,lT,ou,gp,HC=class extends EventTarget{constructor(i){super(),X(this,Sr),X(this,Ep),X(this,vu),X(this,yp),X(this,au),X(this,_p),X(this,ou),X(this,Re,void 0),X(this,nu,void 0),X(this,Vt,void 0),X(this,Ar,void 0),X(this,Mn,"disconnected"),X(this,kn,!1),X(this,Ts,new Set),X(this,vp,new WeakMap),Z(this,Re,i),su.add(this),_s.set(this,{init:()=>Me(this,au,Tp).call(this),onCastStateChanged:()=>Me(this,vu,bp).call(this),onSessionStateChanged:()=>Me(this,yp,bT).call(this),getCastPlayer:()=>I(this,Sr,ls)}),Me(this,au,Tp).call(this)}get state(){return I(this,Mn)}async watchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");return I(this,vp).set(i,++aT),I(this,Ts).add(i),aT}async cancelWatchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");i?I(this,Ts).delete(i):I(this,Ts).clear()}async prompt(){var i,e,t,r;if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new PC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Re));xr.add(I(this,Re)),vT(I(this,Re).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Vt).controller.addEventListener(n,a)});try{await As().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Re));return}throw new Error(n)}(r=(t=_s.get(I(this,Re)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Re=new WeakMap,nu=new WeakMap,Vt=new WeakMap,Ar=new WeakMap,Mn=new WeakMap,kn=new WeakMap,Ts=new WeakMap,vp=new WeakMap,Sr=new WeakSet,ls=function(){if(xr.has(I(this,Re)))return I(this,Vt)},Ep=new WeakSet,oT=function(){xr.has(I(this,Re))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Vt).controller.removeEventListener(i,e)}),xr.delete(I(this,Re)),I(this,Re).muted=I(this,Vt).isMuted,I(this,Re).currentTime=I(this,Vt).savedPlayerState.currentTime,I(this,Vt).savedPlayerState.isPaused===!1&&I(this,Re).play())},vu=new WeakSet,bp=function(){let i=As().getCastState();if(xr.has(I(this,Re))&&i==="CONNECTING"&&(Z(this,Mn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,kn)&&i!=null&&i.includes("CONNECT")){Z(this,kn,!0);for(let e of I(this,Ts))e(!0)}else if(I(this,kn)&&(!i||i==="NO_DEVICES_AVAILABLE")){Z(this,kn,!1);for(let e of I(this,Ts))e(!1)}},yp=new WeakSet,bT=async function(){var i;let{SESSION_RESUMED:e}=at.SessionState;if(As().getSessionState()===e&&I(this,Re).castSrc===((i=Np())==null?void 0:i.media.contentId)){xr.add(I(this,Re)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Vt).controller.addEventListener(t,r)});try{await $C(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[at.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},au=new WeakSet,Tp=function(){!at||I(this,nu)||(Z(this,nu,!0),vT(I(this,Re).castOptions),I(this,Re).textTracks.addEventListener("change",()=>Me(this,ou,gp).call(this)),Me(this,vu,bp).call(this),Z(this,Vt,new at.RemotePlayer),new at.RemotePlayerController(I(this,Vt)),Z(this,Ar,{[at.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Z(this,Mn,"connected"),this.dispatchEvent(new Event("connect"))):(Me(this,Ep,oT).call(this),Z(this,Mn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[at.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("durationchange"))},[at.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&I(this,Re).dispatchEvent(new Event("timeupdate"))},[at.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("resize"))},[at.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event(this.paused?"pause":"play"))},[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,ls))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Re).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,Sr,ls))==null?void 0:e.playerState]))},[at.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Me(this,_p,lT).call(this))}}))},_p=new WeakSet,lT=function(){Me(this,ou,gp).call(this)},ou=new WeakSet,gp=async function(){var i,e,t,r,s;if(!I(this,Sr,ls))return;let n=((e=(i=I(this,Vt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Re).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Op())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await BC(h)}catch(h){console.error(h)}};var GC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),X(this,o),X(this,d),X(this,r,{paused:!1}),X(this,s,ET()),X(this,n,void 0),X(this,a,void 0)}get remote(){return I(this,a)?I(this,a):UC()?(FC(),_s.set(this,{loadOnPrompt:()=>Me(this,d,u).call(this)}),Z(this,a,new HC(this))):super.remote}attributeChangedCallback(c,h,f){if(super.attributeChangedCallback(c,h,f),c==="cast-receiver"&&f){I(this,s).receiverApplicationId=f;return}if(I(this,o,l))switch(c){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var c,h;if(!I(this,o,l))return super.load();let f=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);f.customData=this.castCustomData;let m=[...this.querySelectorAll("track")].filter(({kind:b,src:T})=>T&&(b==="subtitles"||b==="captions")),p=[],g=0;m.length&&(f.tracks=m.map(b=>{let T=++g;p.length===0&&b.track.mode==="showing"&&p.push(T);let _=new chrome.cast.media.Track(T,chrome.cast.media.TrackType.TEXT);return _.trackContentId=b.src,_.trackContentType="text/vtt",_.subtype=b.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,_.name=b.label,_.language=b.srclang,_})),this.castStreamType==="live"?f.streamType=chrome.cast.media.StreamType.LIVE:f.streamType=chrome.cast.media.StreamType.BUFFERED,f.metadata=new chrome.cast.media.GenericMediaMetadata,f.metadata.title=this.title,f.metadata.images=[{url:this.poster}];let E=new chrome.cast.media.LoadRequest(f);E.currentTime=(c=super.currentTime)!=null?c:0,E.autoplay=!I(this,r).paused,E.activeTrackIds=p,await((h=Op())==null?void 0:h.loadMedia(E)),this.dispatchEvent(new Event("volumechange"))}play(){var c;if(I(this,o,l)){I(this,o,l).isPaused&&((c=I(this,o,l).controller)==null||c.playOrPause());return}return super.play()}pause(){var c;if(I(this,o,l)){I(this,o,l).isPaused||(c=I(this,o,l).controller)==null||c.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var c;return(c=this.getAttribute("cast-receiver"))!=null?c:void 0}set castReceiver(c){this.castReceiver!=c&&this.setAttribute("cast-receiver",`${c}`)}get castSrc(){var c,h,f;return(f=(h=this.getAttribute("cast-src"))!=null?h:(c=this.querySelector("source"))==null?void 0:c.src)!=null?f:this.currentSrc}set castSrc(c){this.castSrc!=c&&this.setAttribute("cast-src",`${c}`)}get castContentType(){var c;return(c=this.getAttribute("cast-content-type"))!=null?c:void 0}set castContentType(c){this.setAttribute("cast-content-type",`${c}`)}get castStreamType(){var c,h;return(h=(c=this.getAttribute("cast-stream-type"))!=null?c:this.streamType)!=null?h:void 0}set castStreamType(c){this.setAttribute("cast-stream-type",`${c}`)}get castCustomData(){return I(this,n)}set castCustomData(c){let h=typeof c;if(!["object","undefined"].includes(h)){console.error(`castCustomData must be nullish or an object but value was of type ${h}`);return}Z(this,n,c)}get readyState(){if(I(this,o,l))switch(I(this,o,l).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var c;return I(this,o,l)?(c=I(this,o,l))==null?void 0:c.isMuted:super.muted}set muted(c){var h;if(I(this,o,l)){(c&&!I(this,o,l).isMuted||!c&&I(this,o,l).isMuted)&&((h=I(this,o,l).controller)==null||h.muteOrUnmute());return}super.muted=c}get volume(){var c,h;return I(this,o,l)?(h=(c=I(this,o,l))==null?void 0:c.volumeLevel)!=null?h:1:super.volume}set volume(c){var h;if(I(this,o,l)){I(this,o,l).volumeLevel=+c,(h=I(this,o,l).controller)==null||h.setVolumeLevel();return}super.volume=c}get duration(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.duration)!=null?f:NaN:super.duration}get currentTime(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.currentTime)!=null?f:0:super.currentTime}set currentTime(c){var h;if(I(this,o,l)){I(this,o,l).currentTime=c,(h=I(this,o,l).controller)==null||h.seek();return}super.currentTime=c}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var c,h;return(h=(c=_s.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=hp(t.prototype,this,"paused"),hp(t.prototype,this,"pause").call(this),this.muted=hp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},Ie(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},Tu=class extends Event{constructor(i,e){super(i),Ie(this,"track"),this.track=e.track}},Ap=new WeakMap;function j(i){var e;return(e=Ap.get(i))!=null?e:KC(i,{})}function KC(i,e){let t=Ap.get(i);return t||Ap.set(i,t={}),Object.assign(t,e)}function Sp(i,e){let t=i.videoTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in Rp.prototype||Object.defineProperty(Rp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function xp(i){var e;let t=(e=j(i).media)==null?void 0:e.videoTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function WC(i){var e;let t=(e=j(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(j(t).changeRequested)return;j(t).changeRequested=!0,queueMicrotask(()=>{delete j(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ds,us,cs,Cn,Va,Rp=class extends EventTarget{constructor(){super(),X(this,Cn),X(this,ds,void 0),X(this,us,void 0),X(this,cs,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,Cn,Va).values()}get length(){return I(this,Cn,Va).size}getTrackById(i){var e;return(e=[...I(this,Cn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,Cn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ds)}set onaddtrack(i){I(this,ds)&&(this.removeEventListener("addtrack",I(this,ds)),Z(this,ds,void 0)),typeof i=="function"&&(Z(this,ds,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,us)}set onremovetrack(i){I(this,us)&&(this.removeEventListener("removetrack",I(this,us)),Z(this,us,void 0)),typeof i=="function"&&(Z(this,us,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,cs)}set onchange(i){I(this,cs)&&(this.removeEventListener("change",I(this,cs)),Z(this,cs,void 0)),typeof i=="function"&&(Z(this,cs,i),this.addEventListener("change",i))}};ds=new WeakMap,us=new WeakMap,cs=new WeakMap,Cn=new WeakSet,Va=function(){return j(this).trackSet};var _u=class extends Event{constructor(i,e){super(i),Ie(this,"rendition"),this.rendition=e.rendition}};function VC(i,e){let t=j(i).media.videoRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Ip.prototype||Object.defineProperty(Ip.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function YC(i){let e=j(i).media.videoRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.selected&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function qC(i){let e=j(i).media.videoRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...j(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...j(e).renditionSet])}var hs,fs,ms,Ip=class extends EventTarget{constructor(){super(...arguments),X(this,hs,void 0),X(this,fs,void 0),X(this,ms,void 0)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,hs)}set onaddrendition(i){I(this,hs)&&(this.removeEventListener("addrendition",I(this,hs)),Z(this,hs,void 0)),typeof i=="function"&&(Z(this,hs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,fs)}set onremoverendition(i){I(this,fs)&&(this.removeEventListener("removerendition",I(this,fs)),Z(this,fs,void 0)),typeof i=="function"&&(Z(this,fs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,ms)}set onchange(i){I(this,ms)&&(this.removeEventListener("change",I(this,ms)),Z(this,ms,void 0)),typeof i=="function"&&(Z(this,ms,i),this.addEventListener("change",i))}};hs=new WeakMap,fs=new WeakMap,ms=new WeakMap;var Ya,jC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"width"),Ie(this,"height"),Ie(this,"bitrate"),Ie(this,"frameRate"),Ie(this,"codec"),X(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Z(this,Ya,i),qC(this))}};Ya=new WeakMap;var qa,yT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,qa,!1)}addRendition(i,e,t,r,s,n){let a=new jC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,VC(this,a),a}removeRendition(i){YC(i)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Z(this,qa,i),i===!0&&WC(this))}};qa=new WeakMap;function zC(i,e){let t=j(i).media.audioRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Lp.prototype||Object.defineProperty(Lp.prototype,s,{get(){return Dn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function XC(i){let e=j(i).media.audioRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.enabled&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function QC(i){let e=j(i).media.audioRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Dn(i){return[...j(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...j(e).renditionSet])}var ps,gs,vs,Lp=class extends EventTarget{constructor(){super(...arguments),X(this,ps,void 0),X(this,gs,void 0),X(this,vs,void 0)}[Symbol.iterator](){return Dn(this).values()}get length(){return Dn(this).length}getRenditionById(i){var e;return(e=Dn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Dn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Dn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ps)}set onaddrendition(i){I(this,ps)&&(this.removeEventListener("addrendition",I(this,ps)),Z(this,ps,void 0)),typeof i=="function"&&(Z(this,ps,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,gs)}set onremoverendition(i){I(this,gs)&&(this.removeEventListener("removerendition",I(this,gs)),Z(this,gs,void 0)),typeof i=="function"&&(Z(this,gs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,vs)}set onchange(i){I(this,vs)&&(this.removeEventListener("change",I(this,vs)),Z(this,vs,void 0)),typeof i=="function"&&(Z(this,vs,i),this.addEventListener("change",i))}};ps=new WeakMap,gs=new WeakMap,vs=new WeakMap;var ja,ZC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"bitrate"),Ie(this,"codec"),X(this,ja,!1)}get selected(){return I(this,ja)}set selected(i){I(this,ja)!==i&&(Z(this,ja,i),QC(this))}};ja=new WeakMap;function kp(i,e){let t=i.audioTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in wp.prototype||Object.defineProperty(wp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function Cp(i){var e;let t=(e=j(i).media)==null?void 0:e.audioTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function JC(i){let e=j(i).media.audioTracks;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Es,bs,ys,za,lu,wp=class extends EventTarget{constructor(){super(),X(this,za),X(this,Es,void 0),X(this,bs,void 0),X(this,ys,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,za,lu).values()}get length(){return I(this,za,lu).size}getTrackById(i){var e;return(e=[...I(this,za,lu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,Es)}set onaddtrack(i){I(this,Es)&&(this.removeEventListener("addtrack",I(this,Es)),Z(this,Es,void 0)),typeof i=="function"&&(Z(this,Es,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,bs)}set onremovetrack(i){I(this,bs)&&(this.removeEventListener("removetrack",I(this,bs)),Z(this,bs,void 0)),typeof i=="function"&&(Z(this,bs,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,ys)}set onchange(i){I(this,ys)&&(this.removeEventListener("change",I(this,ys)),Z(this,ys,void 0)),typeof i=="function"&&(Z(this,ys,i),this.addEventListener("change",i))}};Es=new WeakMap,bs=new WeakMap,ys=new WeakMap,za=new WeakSet,lu=function(){return j(this).trackSet};var Xa,TT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,Xa,!1)}addRendition(i,e,t){let r=new ZC;return r.src=i,r.codec=e,r.bitrate=t,zC(this,r),r}removeRendition(i){XC(i)}get enabled(){return I(this,Xa)}set enabled(i){I(this,Xa)!==i&&(Z(this,Xa,i),JC(this))}};Xa=new WeakMap;var dT=Eu(globalThis.HTMLMediaElement,"video"),uT=Eu(globalThis.HTMLMediaElement,"audio");function ew(i){if(!(i!=null&&i.prototype))return i;let e=Eu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return tw(this)}});let t=Eu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return iw(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new yT;return l.kind=n,l.label=a,l.language=o,Sp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=xp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new TT;return l.kind=n,l.label=a,l.language=o,kp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Cp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=j(n).videoRenditions;return a||(a=new Ip,j(a).media=n,j(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=j(n).audioRenditions;return a||(a=new Lp,j(a).media=n,j(n).audioRenditions=a),a};return i}function Eu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function tw(i){var e;let t=j(i).videoTracks;if(!t&&(t=new Rp,j(i).videoTracks=t,dT)){let r=dT.call((e=i.nativeEl)!=null?e:i);for(let s of r)Sp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof yT)){for(let n of r)xp(n);return}Sp(i,s.track)}),r.addEventListener("removetrack",s=>{xp(s.track)})}return t}function iw(i){var e;let t=j(i).audioTracks;if(!t&&(t=new wp,j(i).audioTracks=t,uT)){let r=uT.call((e=i.nativeEl)!=null?e:i);for(let s of r)kp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof TT)){for(let n of r)Cp(n);return}kp(i,s.track)}),r.addEventListener("removetrack",s=>{Cp(s.track)})}return t}yu.push("castchange","entercast","leavecast");var C={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},rw=Object.values(C),cT=kC(),hT="mux-video",wi,Qa,du,Za,uu,cu,hu,fu,mu,Ja,pu,sw=class extends mp{constructor(){super(),X(this,Ja),X(this,wi,void 0),X(this,Qa,void 0),X(this,du,void 0),X(this,Za,{}),X(this,uu,{}),X(this,cu,void 0),X(this,hu,void 0),X(this,fu,void 0),X(this,mu,void 0),Z(this,du,eu())}static get NAME(){return hT}static get VERSION(){return cT}static get observedAttributes(){var i;return[...rw,...(i=mp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?Ln.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${Ln.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,du)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,fu))!=null?i:hT}set playerSoftwareName(i){Z(this,fu,i)}get playerSoftwareVersion(){var i;return(i=I(this,hu))!=null?i:cT}set playerSoftwareVersion(i){Z(this,hu,i)}get _hls(){var i;return(i=I(this,wi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=lp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,mu)}set errorTranslator(i){Z(this,mu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=op(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Qd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,uu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Z(this,uu,i!=null?i:{})}get ended(){return up(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:Xd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return iu(this.nativeEl)}async addCuePoints(i){return ip(this.nativeEl,i)}get activeCuePoint(){return rp(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return np(this.nativeEl,i)}get activeChapter(){return ap(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Wy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===Wt.MSE||i===Wt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Wt.MSE||i===Wt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){Z(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,cu)}set _hlsConfig(i){Z(this,cu,i)}load(){Z(this,wi,Zy(this,this.nativeEl,I(this,wi)))}unload(){cp(this.nativeEl,I(this,wi)),Z(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(mp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Me(this,Ja,pu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Me(this,Ja,pu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,wi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,wi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Wa(this);break;case C.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,wi)&&Me(this,Ja,pu).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,Qa=new WeakMap,du=new WeakMap,Za=new WeakMap,uu=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,Ja=new WeakSet,pu=async function(){I(this,Qa)||(await Z(this,Qa,Promise.resolve()),Z(this,Qa,null),this.load())};var gu,Dp=class extends GC(ew(sw)){constructor(){super(...arguments),X(this,gu,void 0)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,gu))!=null?i:this.muxCastCustomData}set castCustomData(i){Z(this,gu,i)}};gu=new WeakMap;fp.customElements.get("mux-video")||(fp.customElements.define("mux-video",Dp),fp.MuxVideoElement=Dp);var _T=Dp;function AT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Up(i){let e=nw(i).toString();return e?"?"+e:""}function nw(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Fp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Fp(i,e.getRootNode().host);var ST="mux.com",aw=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},ow=aw(),Ru=()=>ow,xT=(i,{token:e,customDomain:t=ST,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Up({token:e,time:n,program_time:s})}`},RT=(i,{token:e,customDomain:t=ST,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Up({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([xe.LIVE,xe.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return xe.LIVE}};var lw={crossorigin:"crossOrigin",playsinline:"playsInline"};function IT(i){var e;return(e=lw[i])!=null?e:Su(i)}var Ss,xs,xt,xu=class{constructor(e,t){Xe(this,Ss,void 0);Xe(this,xs,void 0);Xe(this,xt,[]);Ut(this,Ss,e),Ut(this,xs,t)}[Symbol.iterator](){return Te(this,xt).values()}get length(){return Te(this,xt).length}get value(){var e;return(e=Te(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ut(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Te(this,xt)[e]}values(){return Te(this,xt).values()}keys(){return Te(this,xt).keys()}forEach(e){Te(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Te(this,xt).push(s)}),!(this.value===""&&!((t=Te(this,Ss))!=null&&t.hasAttribute(`${Te(this,xs)}`)))&&((r=Te(this,Ss))==null||r.setAttribute(`${Te(this,xs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Te(this,xt).splice(Te(this,xt).indexOf(r),1)}),(t=Te(this,Ss))==null||t.setAttribute(`${Te(this,xs)}`,`${this.value}`)}contains(e){return Te(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Ss=new WeakMap,xs=new WeakMap,xt=new WeakMap;var LT=`[mux-player ${Ru()}]`;function Di(...i){console.warn(LT,...i)}function Pt(...i){console.error(LT,...i)}function Bp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${Q("Read more: ")}
1316
+ `}function pT(i,{tag:e,is:t}){var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T,_,A,k,x,M;let O=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),D=O?DC(O):[];return n=class extends i{constructor(){super(...arguments),X(this,f),X(this,p),X(this,E),X(this,T),X(this,A),X(this,x),X(this,d,!1),X(this,u,null),X(this,c,new Map),X(this,h,void 0),Ie(this,"get"),Ie(this,"set"),Ie(this,"call")}static get observedAttributes(){var R,P,N;return Me(R=n,o,l).call(R),[...(N=(P=O==null?void 0:O.constructor)==null?void 0:P.observedAttributes)!=null?N:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,P,N,$,G;return Me(this,f,m).call(this),(G=($=(P=(R=I(this,u))!=null?R:this.querySelector(":scope > [slot=media]"))!=null?P:this.querySelector(e))!=null?$:(N=this.shadowRoot)==null?void 0:N.querySelector(e))!=null?G:null}set nativeEl(R){Z(this,u,R)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(R){this.toggleAttribute("muted",R)}get src(){return this.getAttribute("src")}set src(R){this.setAttribute("src",`${R}`)}get preload(){var R,P;return(P=this.getAttribute("preload"))!=null?P:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R;if(!this.shadowRoot){this.attachShadow({mode:"open"});let P=MC(this.attributes);t&&(P.is=t),e&&(P.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(P)}this.nativeEl.muted=this.hasAttribute("muted");for(let P of D)Me(this,A,k).call(this,P);Z(this,h,new MutationObserver(Me(this,E,b).bind(this))),this.shadowRoot.addEventListener("slotchange",this),Me(this,p,g).call(this);for(let P of this.constructor.Events)(R=this.shadowRoot)==null||R.addEventListener(P,this,!0)}handleEvent(R){if(R.type==="slotchange"){Me(this,p,g).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,P,N){Me(this,f,m).call(this),Me(this,x,M).call(this,R,P,N)}connectedCallback(){Me(this,f,m).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;Z(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let P of D)if(!(P in this.prototype))if(typeof O[P]=="function")this.prototype[P]=function(...N){return Me(this,f,m).call(this),(()=>{var $;if(this.call)return this.call(P,...N);let G=($=this.nativeEl)==null?void 0:$[P];return G==null?void 0:G.apply(this.nativeEl,N)})()};else{let N={get(){var $,G,K;Me(this,f,m).call(this);let ee=P.toLowerCase();if(R.has(ee)){let ae=this.getAttribute(ee);return ae===null?!1:ae===""?!0:ae}return(K=($=this.get)==null?void 0:$.call(this,P))!=null?K:(G=this.nativeEl)==null?void 0:G[P]}};P!==P.toUpperCase()&&(N.set=function($){Me(this,f,m).call(this);let G=P.toLowerCase();if(R.has(G)){$===!0||$===!1||$==null?this.toggleAttribute(G,!!$):this.setAttribute(G,$);return}if(this.set){this.set(P,$);return}this.nativeEl&&(this.nativeEl[P]=$)}),Object.defineProperty(this.prototype,P,N)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakMap,f=new WeakSet,m=function(){I(this,d)||(Z(this,d,!0),this.init())},p=new WeakSet,g=function(){var R;let P=new Map(I(this,c)),N=(R=this.shadowRoot)==null?void 0:R.querySelector("slot:not([name])");(N==null?void 0:N.assignedElements({flatten:!0}).filter($=>["track","source"].includes($.localName))).forEach($=>{var G,K;P.delete($);let ee=I(this,c).get($);ee||(ee=$.cloneNode(),I(this,c).set($,ee),(G=I(this,h))==null||G.observe($,{attributes:!0})),(K=this.nativeEl)==null||K.append(ee),Me(this,T,_).call(this,ee)}),P.forEach(($,G)=>{$.remove(),I(this,c).delete(G)})},E=new WeakSet,b=function(R){var P;for(let N of R)if(N.type==="attributes"){let{target:$,attributeName:G}=N,K=I(this,c).get($);K&&G&&(K.setAttribute(G,(P=$.getAttribute(G))!=null?P:""),Me(this,T,_).call(this,K))}},T=new WeakSet,_=function(R){R&&R.localName==="track"&&R.default&&(R.kind==="chapters"||R.kind==="metadata")&&R.track.mode==="disabled"&&(R.track.mode="hidden")},A=new WeakSet,k=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let P=this[R];delete this[R],this[R]=P}},x=new WeakSet,M=function(R,P,N){var $,G,K;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(N===null?($=this.nativeEl)==null||$.removeAttribute(R):((G=this.nativeEl)==null?void 0:G.getAttribute(R))!==N&&((K=this.nativeEl)==null||K.setAttribute(R,N)))},X(n,o),Ie(n,"getTemplateHTML",e.endsWith("audio")?CC:wC),Ie(n,"shadowRootOptions",{mode:"open"}),Ie(n,"Events",yu),X(n,a,!1),n}function DC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t)){let r=Object.getOwnPropertyNames(t);e.push(...r)}return e}function gT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function MC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var sT,mp=pT((sT=globalThis.HTMLElement)!=null?sT:class{},{tag:"video"}),nT,M2=pT((nT=globalThis.HTMLElement)!=null?nT:class{},{tag:"audio"}),_s=new WeakMap,pp=class extends Error{},PC=class extends Error{},OC=globalThis.WeakRef?class extends Set{add(i){super.add(new WeakRef(i))}forEach(i){super.forEach(e=>{let t=e.deref();t&&i(t)})}}:Set;function NC(i){var e,t,r;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(r=globalThis.cast)!=null&&r.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function UC(){return globalThis.chrome}function FC(){var i;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((i=globalThis.chrome)!=null&&i.cast||document.querySelector(`script[src="${e}"]`))return;let t=document.createElement("script");t.src=e,document.head.append(t)}function As(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Op(){var i;return(i=As())==null?void 0:i.getCurrentSession()}function Np(){var i;return(i=Op())==null?void 0:i.getSessionObj().media[0]}function BC(i){return new Promise((e,t)=>{Np().editTracksInfo(i,e,t)})}function $C(i){return new Promise((e,t)=>{Np().getStatus(i,e,t)})}function vT(i){return As().setOptions({...ET(),...i})}function ET(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var su=new OC,xr=new WeakSet,at;NC(()=>{var i,e,t,r;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(r=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:r.isAvailable);return}at||(at=cast.framework,As().addEventListener(at.CastContextEventType.CAST_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),As().addEventListener(at.CastContextEventType.SESSION_STATE_CHANGED,s=>{su.forEach(n=>{var a,o;return(o=(a=_s.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),su.forEach(s=>{var n,a;return(a=(n=_s.get(s)).init)==null?void 0:a.call(n)}))});var aT=0,Re,nu,Vt,Ar,Mn,kn,Ts,vp,Sr,ls,Ep,oT,vu,bp,yp,bT,au,Tp,_p,lT,ou,gp,HC=class extends EventTarget{constructor(i){super(),X(this,Sr),X(this,Ep),X(this,vu),X(this,yp),X(this,au),X(this,_p),X(this,ou),X(this,Re,void 0),X(this,nu,void 0),X(this,Vt,void 0),X(this,Ar,void 0),X(this,Mn,"disconnected"),X(this,kn,!1),X(this,Ts,new Set),X(this,vp,new WeakMap),Z(this,Re,i),su.add(this),_s.set(this,{init:()=>Me(this,au,Tp).call(this),onCastStateChanged:()=>Me(this,vu,bp).call(this),onSessionStateChanged:()=>Me(this,yp,bT).call(this),getCastPlayer:()=>I(this,Sr,ls)}),Me(this,au,Tp).call(this)}get state(){return I(this,Mn)}async watchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");return I(this,vp).set(i,++aT),I(this,Ts).add(i),aT}async cancelWatchAvailability(i){if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");i?I(this,Ts).delete(i):I(this,Ts).clear()}async prompt(){var i,e,t,r;if(I(this,Re).disableRemotePlayback)throw new pp("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new PC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,Re));xr.add(I(this,Re)),vT(I(this,Re).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Vt).controller.addEventListener(n,a)});try{await As().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,Re));return}throw new Error(n)}(r=(t=_s.get(I(this,Re)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};Re=new WeakMap,nu=new WeakMap,Vt=new WeakMap,Ar=new WeakMap,Mn=new WeakMap,kn=new WeakMap,Ts=new WeakMap,vp=new WeakMap,Sr=new WeakSet,ls=function(){if(xr.has(I(this,Re)))return I(this,Vt)},Ep=new WeakSet,oT=function(){xr.has(I(this,Re))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Vt).controller.removeEventListener(i,e)}),xr.delete(I(this,Re)),I(this,Re).muted=I(this,Vt).isMuted,I(this,Re).currentTime=I(this,Vt).savedPlayerState.currentTime,I(this,Vt).savedPlayerState.isPaused===!1&&I(this,Re).play())},vu=new WeakSet,bp=function(){let i=As().getCastState();if(xr.has(I(this,Re))&&i==="CONNECTING"&&(Z(this,Mn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,kn)&&i!=null&&i.includes("CONNECT")){Z(this,kn,!0);for(let e of I(this,Ts))e(!0)}else if(I(this,kn)&&(!i||i==="NO_DEVICES_AVAILABLE")){Z(this,kn,!1);for(let e of I(this,Ts))e(!1)}},yp=new WeakSet,bT=async function(){var i;let{SESSION_RESUMED:e}=at.SessionState;if(As().getSessionState()===e&&I(this,Re).castSrc===((i=Np())==null?void 0:i.media.contentId)){xr.add(I(this,Re)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Vt).controller.addEventListener(t,r)});try{await $C(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[at.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},au=new WeakSet,Tp=function(){!at||I(this,nu)||(Z(this,nu,!0),vT(I(this,Re).castOptions),I(this,Re).textTracks.addEventListener("change",()=>Me(this,ou,gp).call(this)),Me(this,vu,bp).call(this),Z(this,Vt,new at.RemotePlayer),new at.RemotePlayerController(I(this,Vt)),Z(this,Ar,{[at.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(Z(this,Mn,"connected"),this.dispatchEvent(new Event("connect"))):(Me(this,Ep,oT).call(this),Z(this,Mn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[at.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("durationchange"))},[at.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("volumechange"))},[at.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&I(this,Re).dispatchEvent(new Event("timeupdate"))},[at.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event("resize"))},[at.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,Re).dispatchEvent(new Event(this.paused?"pause":"play"))},[at.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,ls))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,Re).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(e=I(this,Sr,ls))==null?void 0:e.playerState]))},[at.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,ls))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Me(this,_p,lT).call(this))}}))},_p=new WeakSet,lT=function(){Me(this,ou,gp).call(this)},ou=new WeakSet,gp=async function(){var i,e,t,r,s;if(!I(this,Sr,ls))return;let n=((e=(i=I(this,Vt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,Re).textTracks].filter(({kind:h})=>h==="subtitles"||h==="captions"),o=n.map(({language:h,name:f,trackId:m})=>{var p;let{mode:g}=(p=a.find(E=>E.language===h&&E.label===f))!=null?p:{};return g?{mode:g,trackId:m}:!1}).filter(Boolean),l=o.filter(({mode:h})=>h!=="showing").map(({trackId:h})=>h),d=o.find(({mode:h})=>h==="showing"),u=(s=(r=(t=Op())==null?void 0:t.getSessionObj().media[0])==null?void 0:r.activeTrackIds)!=null?s:[],c=u;if(u.length&&(c=c.filter(h=>!l.includes(h))),d!=null&&d.trackId&&(c=[...c,d.trackId]),c=[...new Set(c)],!((h,f)=>h.length===f.length&&h.every(m=>f.includes(m)))(u,c))try{let h=new chrome.cast.media.EditTracksInfoRequest(c);await BC(h)}catch(h){console.error(h)}};var GC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),X(this,o),X(this,d),X(this,r,{paused:!1}),X(this,s,ET()),X(this,n,void 0),X(this,a,void 0)}get remote(){return I(this,a)?I(this,a):UC()?(FC(),_s.set(this,{loadOnPrompt:()=>Me(this,d,u).call(this)}),Z(this,a,new HC(this))):super.remote}attributeChangedCallback(c,h,f){if(super.attributeChangedCallback(c,h,f),c==="cast-receiver"&&f){I(this,s).receiverApplicationId=f;return}if(I(this,o,l))switch(c){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var c,h;if(!I(this,o,l))return super.load();let f=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);f.customData=this.castCustomData;let m=[...this.querySelectorAll("track")].filter(({kind:b,src:T})=>T&&(b==="subtitles"||b==="captions")),p=[],g=0;m.length&&(f.tracks=m.map(b=>{let T=++g;p.length===0&&b.track.mode==="showing"&&p.push(T);let _=new chrome.cast.media.Track(T,chrome.cast.media.TrackType.TEXT);return _.trackContentId=b.src,_.trackContentType="text/vtt",_.subtype=b.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,_.name=b.label,_.language=b.srclang,_})),this.castStreamType==="live"?f.streamType=chrome.cast.media.StreamType.LIVE:f.streamType=chrome.cast.media.StreamType.BUFFERED,f.metadata=new chrome.cast.media.GenericMediaMetadata,f.metadata.title=this.title,f.metadata.images=[{url:this.poster}];let E=new chrome.cast.media.LoadRequest(f);E.currentTime=(c=super.currentTime)!=null?c:0,E.autoplay=!I(this,r).paused,E.activeTrackIds=p,await((h=Op())==null?void 0:h.loadMedia(E)),this.dispatchEvent(new Event("volumechange"))}play(){var c;if(I(this,o,l)){I(this,o,l).isPaused&&((c=I(this,o,l).controller)==null||c.playOrPause());return}return super.play()}pause(){var c;if(I(this,o,l)){I(this,o,l).isPaused||(c=I(this,o,l).controller)==null||c.playOrPause();return}super.pause()}get castOptions(){return I(this,s)}get castReceiver(){var c;return(c=this.getAttribute("cast-receiver"))!=null?c:void 0}set castReceiver(c){this.castReceiver!=c&&this.setAttribute("cast-receiver",`${c}`)}get castSrc(){var c,h,f;return(f=(h=this.getAttribute("cast-src"))!=null?h:(c=this.querySelector("source"))==null?void 0:c.src)!=null?f:this.currentSrc}set castSrc(c){this.castSrc!=c&&this.setAttribute("cast-src",`${c}`)}get castContentType(){var c;return(c=this.getAttribute("cast-content-type"))!=null?c:void 0}set castContentType(c){this.setAttribute("cast-content-type",`${c}`)}get castStreamType(){var c,h;return(h=(c=this.getAttribute("cast-stream-type"))!=null?c:this.streamType)!=null?h:void 0}set castStreamType(c){this.setAttribute("cast-stream-type",`${c}`)}get castCustomData(){return I(this,n)}set castCustomData(c){let h=typeof c;if(!["object","undefined"].includes(h)){console.error(`castCustomData must be nullish or an object but value was of type ${h}`);return}Z(this,n,c)}get readyState(){if(I(this,o,l))switch(I(this,o,l).playerState){case chrome.cast.media.PlayerState.IDLE:return 0;case chrome.cast.media.PlayerState.BUFFERING:return 2;default:return 3}return super.readyState}get paused(){return I(this,o,l)?I(this,o,l).isPaused:super.paused}get muted(){var c;return I(this,o,l)?(c=I(this,o,l))==null?void 0:c.isMuted:super.muted}set muted(c){var h;if(I(this,o,l)){(c&&!I(this,o,l).isMuted||!c&&I(this,o,l).isMuted)&&((h=I(this,o,l).controller)==null||h.muteOrUnmute());return}super.muted=c}get volume(){var c,h;return I(this,o,l)?(h=(c=I(this,o,l))==null?void 0:c.volumeLevel)!=null?h:1:super.volume}set volume(c){var h;if(I(this,o,l)){I(this,o,l).volumeLevel=+c,(h=I(this,o,l).controller)==null||h.setVolumeLevel();return}super.volume=c}get duration(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.duration)!=null?f:NaN:super.duration}get currentTime(){var c,h,f;return I(this,o,l)&&(c=I(this,o,l))!=null&&c.isMediaLoaded?(f=(h=I(this,o,l))==null?void 0:h.currentTime)!=null?f:0:super.currentTime}set currentTime(c){var h;if(I(this,o,l)){I(this,o,l).currentTime=c,(h=I(this,o,l).controller)==null||h.seek();return}super.currentTime=c}},r=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,l=function(){var c,h;return(h=(c=_s.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=hp(t.prototype,this,"paused"),hp(t.prototype,this,"pause").call(this),this.muted=hp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},Ie(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},Tu=class extends Event{constructor(i,e){super(i),Ie(this,"track"),this.track=e.track}},Ap=new WeakMap;function j(i){var e;return(e=Ap.get(i))!=null?e:KC(i,{})}function KC(i,e){let t=Ap.get(i);return t||Ap.set(i,t={}),Object.assign(t,e)}function Sp(i,e){let t=i.videoTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in Rp.prototype||Object.defineProperty(Rp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function xp(i){var e;let t=(e=j(i).media)==null?void 0:e.videoTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function WC(i){var e;let t=(e=j(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(j(t).changeRequested)return;j(t).changeRequested=!0,queueMicrotask(()=>{delete j(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ds,us,cs,Cn,Va,Rp=class extends EventTarget{constructor(){super(),X(this,Cn),X(this,ds,void 0),X(this,us,void 0),X(this,cs,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,Cn,Va).values()}get length(){return I(this,Cn,Va).size}getTrackById(i){var e;return(e=[...I(this,Cn,Va)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,Cn,Va)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ds)}set onaddtrack(i){I(this,ds)&&(this.removeEventListener("addtrack",I(this,ds)),Z(this,ds,void 0)),typeof i=="function"&&(Z(this,ds,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,us)}set onremovetrack(i){I(this,us)&&(this.removeEventListener("removetrack",I(this,us)),Z(this,us,void 0)),typeof i=="function"&&(Z(this,us,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,cs)}set onchange(i){I(this,cs)&&(this.removeEventListener("change",I(this,cs)),Z(this,cs,void 0)),typeof i=="function"&&(Z(this,cs,i),this.addEventListener("change",i))}};ds=new WeakMap,us=new WeakMap,cs=new WeakMap,Cn=new WeakSet,Va=function(){return j(this).trackSet};var _u=class extends Event{constructor(i,e){super(i),Ie(this,"rendition"),this.rendition=e.rendition}};function VC(i,e){let t=j(i).media.videoRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Ip.prototype||Object.defineProperty(Ip.prototype,s,{get(){return wn(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function YC(i){let e=j(i).media.videoRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.selected&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function qC(i){let e=j(i).media.videoRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function wn(i){return[...j(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...j(e).renditionSet])}var hs,fs,ms,Ip=class extends EventTarget{constructor(){super(...arguments),X(this,hs,void 0),X(this,fs,void 0),X(this,ms,void 0)}[Symbol.iterator](){return wn(this).values()}get length(){return wn(this).length}getRenditionById(i){var e;return(e=wn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return wn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of wn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,hs)}set onaddrendition(i){I(this,hs)&&(this.removeEventListener("addrendition",I(this,hs)),Z(this,hs,void 0)),typeof i=="function"&&(Z(this,hs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,fs)}set onremoverendition(i){I(this,fs)&&(this.removeEventListener("removerendition",I(this,fs)),Z(this,fs,void 0)),typeof i=="function"&&(Z(this,fs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,ms)}set onchange(i){I(this,ms)&&(this.removeEventListener("change",I(this,ms)),Z(this,ms,void 0)),typeof i=="function"&&(Z(this,ms,i),this.addEventListener("change",i))}};hs=new WeakMap,fs=new WeakMap,ms=new WeakMap;var Ya,jC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"width"),Ie(this,"height"),Ie(this,"bitrate"),Ie(this,"frameRate"),Ie(this,"codec"),X(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(Z(this,Ya,i),qC(this))}};Ya=new WeakMap;var qa,yT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,qa,!1)}addRendition(i,e,t,r,s,n){let a=new jC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,VC(this,a),a}removeRendition(i){YC(i)}get selected(){return I(this,qa)}set selected(i){I(this,qa)!==i&&(Z(this,qa,i),i===!0&&WC(this))}};qa=new WeakMap;function zC(i,e){let t=j(i).media.audioRenditions;j(e).media=j(i).media,j(e).track=i;let r=j(i).renditionSet;r.add(e);let s=r.size-1;s in Lp.prototype||Object.defineProperty(Lp.prototype,s,{get(){return Dn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new _u("addrendition",{rendition:e}))})}function XC(i){let e=j(i).media.audioRenditions,t=j(i).track;j(t).renditionSet.delete(i),queueMicrotask(()=>{j(i).track.enabled&&e.dispatchEvent(new _u("removerendition",{rendition:i}))})}function QC(i){let e=j(i).media.audioRenditions;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,j(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function Dn(i){return[...j(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...j(e).renditionSet])}var ps,gs,vs,Lp=class extends EventTarget{constructor(){super(...arguments),X(this,ps,void 0),X(this,gs,void 0),X(this,vs,void 0)}[Symbol.iterator](){return Dn(this).values()}get length(){return Dn(this).length}getRenditionById(i){var e;return(e=Dn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Dn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Dn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ps)}set onaddrendition(i){I(this,ps)&&(this.removeEventListener("addrendition",I(this,ps)),Z(this,ps,void 0)),typeof i=="function"&&(Z(this,ps,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,gs)}set onremoverendition(i){I(this,gs)&&(this.removeEventListener("removerendition",I(this,gs)),Z(this,gs,void 0)),typeof i=="function"&&(Z(this,gs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,vs)}set onchange(i){I(this,vs)&&(this.removeEventListener("change",I(this,vs)),Z(this,vs,void 0)),typeof i=="function"&&(Z(this,vs,i),this.addEventListener("change",i))}};ps=new WeakMap,gs=new WeakMap,vs=new WeakMap;var ja,ZC=class{constructor(){Ie(this,"src"),Ie(this,"id"),Ie(this,"bitrate"),Ie(this,"codec"),X(this,ja,!1)}get selected(){return I(this,ja)}set selected(i){I(this,ja)!==i&&(Z(this,ja,i),QC(this))}};ja=new WeakMap;function kp(i,e){let t=i.audioTracks;j(e).media=i,j(e).renditionSet||(j(e).renditionSet=new Set);let r=j(t).trackSet;r.add(e);let s=r.size-1;s in wp.prototype||Object.defineProperty(wp.prototype,s,{get(){return[...j(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new Tu("addtrack",{track:e}))})}function Cp(i){var e;let t=(e=j(i).media)==null?void 0:e.audioTracks;t&&(j(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new Tu("removetrack",{track:i}))}))}function JC(i){let e=j(i).media.audioTracks;!e||j(e).changeRequested||(j(e).changeRequested=!0,queueMicrotask(()=>{delete j(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Es,bs,ys,za,lu,wp=class extends EventTarget{constructor(){super(),X(this,za),X(this,Es,void 0),X(this,bs,void 0),X(this,ys,void 0),j(this).trackSet=new Set}[Symbol.iterator](){return I(this,za,lu).values()}get length(){return I(this,za,lu).size}getTrackById(i){var e;return(e=[...I(this,za,lu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,Es)}set onaddtrack(i){I(this,Es)&&(this.removeEventListener("addtrack",I(this,Es)),Z(this,Es,void 0)),typeof i=="function"&&(Z(this,Es,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,bs)}set onremovetrack(i){I(this,bs)&&(this.removeEventListener("removetrack",I(this,bs)),Z(this,bs,void 0)),typeof i=="function"&&(Z(this,bs,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,ys)}set onchange(i){I(this,ys)&&(this.removeEventListener("change",I(this,ys)),Z(this,ys,void 0)),typeof i=="function"&&(Z(this,ys,i),this.addEventListener("change",i))}};Es=new WeakMap,bs=new WeakMap,ys=new WeakMap,za=new WeakSet,lu=function(){return j(this).trackSet};var Xa,TT=class{constructor(){Ie(this,"id"),Ie(this,"kind"),Ie(this,"label",""),Ie(this,"language",""),Ie(this,"sourceBuffer"),X(this,Xa,!1)}addRendition(i,e,t){let r=new ZC;return r.src=i,r.codec=e,r.bitrate=t,zC(this,r),r}removeRendition(i){XC(i)}get enabled(){return I(this,Xa)}set enabled(i){I(this,Xa)!==i&&(Z(this,Xa,i),JC(this))}};Xa=new WeakMap;var dT=Eu(globalThis.HTMLMediaElement,"video"),uT=Eu(globalThis.HTMLMediaElement,"audio");function ew(i){if(!(i!=null&&i.prototype))return i;let e=Eu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return tw(this)}});let t=Eu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return iw(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new yT;return l.kind=n,l.label=a,l.language=o,Sp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=xp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new TT;return l.kind=n,l.label=a,l.language=o,kp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Cp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=j(n).videoRenditions;return a||(a=new Ip,j(a).media=n,j(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=j(n).audioRenditions;return a||(a=new Lp,j(a).media=n,j(n).audioRenditions=a),a};return i}function Eu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function tw(i){var e;let t=j(i).videoTracks;if(!t&&(t=new Rp,j(i).videoTracks=t,dT)){let r=dT.call((e=i.nativeEl)!=null?e:i);for(let s of r)Sp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof yT)){for(let n of r)xp(n);return}Sp(i,s.track)}),r.addEventListener("removetrack",s=>{xp(s.track)})}return t}function iw(i){var e;let t=j(i).audioTracks;if(!t&&(t=new wp,j(i).audioTracks=t,uT)){let r=uT.call((e=i.nativeEl)!=null?e:i);for(let s of r)kp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof TT)){for(let n of r)Cp(n);return}kp(i,s.track)}),r.addEventListener("removetrack",s=>{Cp(s.track)})}return t}yu.push("castchange","entercast","leavecast");var C={BEACON_COLLECTION_DOMAIN:"beacon-collection-domain",CUSTOM_DOMAIN:"custom-domain",DEBUG:"debug",DISABLE_TRACKING:"disable-tracking",DISABLE_COOKIES:"disable-cookies",DRM_TOKEN:"drm-token",PLAYBACK_TOKEN:"playback-token",ENV_KEY:"env-key",MAX_RESOLUTION:"max-resolution",MIN_RESOLUTION:"min-resolution",RENDITION_ORDER:"rendition-order",PROGRAM_START_TIME:"program-start-time",PROGRAM_END_TIME:"program-end-time",ASSET_START_TIME:"asset-start-time",ASSET_END_TIME:"asset-end-time",METADATA_URL:"metadata-url",PLAYBACK_ID:"playback-id",PLAYER_SOFTWARE_NAME:"player-software-name",PLAYER_SOFTWARE_VERSION:"player-software-version",PLAYER_INIT_TIME:"player-init-time",PREFER_CMCD:"prefer-cmcd",PREFER_PLAYBACK:"prefer-playback",START_TIME:"start-time",STREAM_TYPE:"stream-type",TARGET_LIVE_WINDOW:"target-live-window",LIVE_EDGE_OFFSET:"live-edge-offset",TYPE:"type"},rw=Object.values(C),cT=kC(),hT="mux-video",wi,Qa,du,Za,uu,cu,hu,fu,mu,Ja,pu,sw=class extends mp{constructor(){super(),X(this,Ja),X(this,wi,void 0),X(this,Qa,void 0),X(this,du,void 0),X(this,Za,{}),X(this,uu,{}),X(this,cu,void 0),X(this,hu,void 0),X(this,fu,void 0),X(this,mu,void 0),Z(this,du,eu())}static get NAME(){return hT}static get VERSION(){return cT}static get observedAttributes(){var i;return[...rw,...(i=mp.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?Ln.includes(i)?this.setAttribute(C.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${Ln.join()}`):this.removeAttribute(C.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?+this.getAttribute(C.PLAYER_INIT_TIME):I(this,du)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=I(this,fu))!=null?i:hT}set playerSoftwareName(i){Z(this,fu,i)}get playerSoftwareVersion(){var i;return(i=I(this,hu))!=null?i:cT}set playerSoftwareVersion(i){Z(this,hu,i)}get _hls(){var i;return(i=I(this,wi))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=lp(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,mu)}set errorTranslator(i){Z(this,mu,i)}get src(){return this.getAttribute("src")}set src(i){i!==this.src&&(i==null?this.removeAttribute("src"):this.setAttribute("src",i))}get type(){var i;return(i=this.getAttribute(C.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(C.TYPE,i):this.removeAttribute(C.TYPE))}get autoplay(){let i=this.getAttribute("autoplay");return i===null?!1:i===""?!0:i}set autoplay(i){let e=this.autoplay;i!==e&&(i?this.setAttribute("autoplay",typeof i=="string"?i:""):this.removeAttribute("autoplay"))}get preload(){let i=this.getAttribute("preload");return i===""?"auto":["none","metadata","auto"].includes(i)?i:super.preload}set preload(i){i!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(i)?this.setAttribute("preload",i):this.removeAttribute("preload"))}get debug(){return this.getAttribute(C.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG))}get disableTracking(){return this.hasAttribute(C.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(C.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(C.START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set startTime(i){i!==this.startTime&&(i==null?this.removeAttribute(C.START_TIME):this.setAttribute(C.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(C.PLAYBACK_ID)?this.getAttribute(C.PLAYBACK_ID):(i=op(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(C.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(C.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(C.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(C.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(C.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(C.DRM_TOKEN,i):this.removeAttribute(C.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(C.PLAYBACK_TOKEN))return(i=this.getAttribute(C.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(C.PLAYBACK_ID)){let[,s]=Qd((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(s).get("token"))!=null?t:void 0}if(this.src)return(r=new URLSearchParams(this.src).get("token"))!=null?r:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(C.PLAYBACK_TOKEN,i):this.removeAttribute(C.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(C.PLAYBACK_TOKEN),e=this.getAttribute(C.DRM_TOKEN);return{...I(this,uu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Z(this,uu,i!=null?i:{})}get ended(){return up(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(C.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(C.ENV_KEY,i):this.removeAttribute(C.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(C.STREAM_TYPE))!=null?i:Xd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(C.STREAM_TYPE,i):this.removeAttribute(C.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(C.TARGET_LIVE_WINDOW)?+this.getAttribute(C.TARGET_LIVE_WINDOW):jy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(C.TARGET_LIVE_WINDOW):this.setAttribute(C.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(C.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,r=(i=this.nativeEl.seekable.end(0))!=null?i:0,s=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(s,r-t)}return zy(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(C.LIVE_EDGE_OFFSET))return+this.getAttribute(C.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(C.LIVE_EDGE_OFFSET):this.setAttribute(C.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return iu(this.nativeEl)}async addCuePoints(i){return ip(this.nativeEl,i)}get activeCuePoint(){return rp(this.nativeEl)}get cuePoints(){return $y(this.nativeEl)}async addChapters(i){return np(this.nativeEl,i)}get activeChapter(){return ap(this.nativeEl)}get chapters(){return Gy(this.nativeEl)}getStartDate(){return Ky(this.nativeEl,this._hls)}get currentPdt(){return Wy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===Wt.MSE||i===Wt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Wt.MSE||i===Wt.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![C.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...I(this,Za)}}set metadata(i){Z(this,Za,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Za))}get _hlsConfig(){return I(this,cu)}set _hlsConfig(i){Z(this,cu,i)}load(){Z(this,wi,Zy(this,this.nativeEl,I(this,wi)))}unload(){cp(this.nativeEl,I(this,wi)),Z(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(mp.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case C.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case C.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Me(this,Ja,pu).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Me(this,Ja,pu).call(this));break}case"autoplay":if(t===e)break;(r=I(this,wi))==null||r.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(s=I(this,wi))==null||s.setPreload(t);break;case C.PLAYBACK_ID:this.src=Wa(this);break;case C.DEBUG:{let n=this.debug;this.mux&&console.info("Cannot toggle debug mode of mux data after initialization. Make sure you set all metadata to override before setting the src."),this._hls&&(this._hls.config.debug=n);break}case C.METADATA_URL:t&&fetch(t).then(n=>n.json()).then(n=>this.metadata=n).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${t}!`));break;case C.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case C.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var i;(i=super.connectedCallback)==null||i.call(this),this.nativeEl&&this.src&&!I(this,wi)&&Me(this,Ja,pu).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,Qa=new WeakMap,du=new WeakMap,Za=new WeakMap,uu=new WeakMap,cu=new WeakMap,hu=new WeakMap,fu=new WeakMap,mu=new WeakMap,Ja=new WeakSet,pu=async function(){I(this,Qa)||(await Z(this,Qa,Promise.resolve()),Z(this,Qa,null),this.load())};var gu,Dp=class extends GC(ew(sw)){constructor(){super(...arguments),X(this,gu,void 0)}get muxCastCustomData(){return{mux:{playbackId:this.playbackId,minResolution:this.minResolution,maxResolution:this.maxResolution,renditionOrder:this.renditionOrder,customDomain:this.customDomain,tokens:{drm:this.drmToken},envKey:this.envKey,metadata:this.metadata,disableCookies:this.disableCookies,disableTracking:this.disableTracking,beaconCollectionDomain:this.beaconCollectionDomain,startTime:this.startTime,preferCmcd:this.preferCmcd}}}get castCustomData(){var i;return(i=I(this,gu))!=null?i:this.muxCastCustomData}set castCustomData(i){Z(this,gu,i)}};gu=new WeakMap;fp.customElements.get("mux-video")||(fp.customElements.define("mux-video",Dp),fp.MuxVideoElement=Dp);var _T=Dp;function AT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${Au(t)}: ${r}; `)}),e?e.trim():void 0}function Au(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Su(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function St(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Up(i){let e=nw(i).toString();return e?"?"+e:""}function nw(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var Fp=(i,e)=>!i||!e?!1:i.contains(e)?!0:Fp(i,e.getRootNode().host);var ST="mux.com",aw=()=>{try{return"3.2.0"}catch{}return"UNKNOWN"},ow=aw(),Ru=()=>ow,xT=(i,{token:e,customDomain:t=ST,thumbnailTime:r,programTime:s}={})=>{var o;let n=e==null?r:void 0,{aud:a}=(o=_r(e))!=null?o:{};if(!(e&&a!=="t"))return`https://image.${t}/${i}/thumbnail.webp${Up({token:e,time:n,program_time:s})}`},RT=(i,{token:e,customDomain:t=ST,programStartTime:r,programEndTime:s}={})=>{var a;let{aud:n}=(a=_r(e))!=null?a:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Up({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},eo=i=>{if(i){if([xe.LIVE,xe.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return xe.LIVE}};var lw={crossorigin:"crossOrigin",playsinline:"playsInline"};function IT(i){var e;return(e=lw[i])!=null?e:Su(i)}var Ss,xs,xt,xu=class{constructor(e,t){Xe(this,Ss,void 0);Xe(this,xs,void 0);Xe(this,xt,[]);Ut(this,Ss,e),Ut(this,xs,t)}[Symbol.iterator](){return Te(this,xt).values()}get length(){return Te(this,xt).length}get value(){var e;return(e=Te(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ut(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return Te(this,xt)[e]}values(){return Te(this,xt).values()}keys(){return Te(this,xt).keys()}forEach(e){Te(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||Te(this,xt).push(s)}),!(this.value===""&&!((t=Te(this,Ss))!=null&&t.hasAttribute(`${Te(this,xs)}`)))&&((r=Te(this,Ss))==null||r.setAttribute(`${Te(this,xs)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{Te(this,xt).splice(Te(this,xt).indexOf(r),1)}),(t=Te(this,Ss))==null||t.setAttribute(`${Te(this,xs)}`,`${this.value}`)}contains(e){return Te(this,xt).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};Ss=new WeakMap,xs=new WeakMap,xt=new WeakMap;var LT=`[mux-player ${Ru()}]`;function Di(...i){console.warn(LT,...i)}function Pt(...i){console.error(LT,...i)}function Bp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${Q("Read more: ")}
1317
1317
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Di(e)}var Tt={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Rs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},CT=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),dw=yu.filter(i=>i!=="error"),uw=Object.values(Tt).filter(i=>![Tt.PLAYSINLINE].includes(i)),cw=Object.values(Rs),$p=class extends It.HTMLElement{static get observedAttributes(){return[...uw,...cw]}constructor(){super()}init(){dw.forEach(e=>{var t;(t=this.media)==null||t.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,t,r){var s,n;switch(e){case Rs.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case Rs.VOLUME:{let a=(s=St(r))!=null?s:1;this.media&&(this.media.volume=a);return}case Rs.PLAYBACKRATE:{let a=(n=St(r))!=null?n:1;this.media&&(this.media.playbackRate=a,this.media.defaultPlaybackRate=a);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:CT}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:CT}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentSrc(){var e,t;return(t=(e=this.media)==null?void 0:e.currentSrc)!=null?t:""}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=St(this.getAttribute(Rs.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Rs.PLAYBACKRATE,`${e}`):this.removeAttribute(Rs.PLAYBACKRATE)}get crossOrigin(){return to(this,Tt.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(Tt.CROSSORIGIN,`${e}`)}get autoplay(){return to(this,Tt.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(Tt.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(Tt.AUTOPLAY)}get loop(){return to(this,Tt.LOOP)!=null}set loop(e){e?this.setAttribute(Tt.LOOP,""):this.removeAttribute(Tt.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return to(this,Tt.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(Tt.MUTED,""):this.removeAttribute(Tt.MUTED)}get playsInline(){return to(this,Tt.PLAYSINLINE)!=null}set playsInline(e){Pt("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(Tt.PRELOAD,e):this.removeAttribute(Tt.PRELOAD)}};function to(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Hp=$p;var OT=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(OT(i,e,"read from private field"),t?t.call(i):e.get(i)),Mi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ji=(i,e,t,r)=>(OT(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Pn,Iu,Is,io,Rr,Ir,Lr,Ls,On,Lu,ai,wT=1,DT=0,hw=1,fw={processCallback(i,e,t){if(t){for(let[r,s]of e)if(r in t){let n=t[r];typeof n=="boolean"&&s instanceof Rt&&typeof s.element[s.attributeName]=="boolean"?s.booleanValue=n:typeof n=="function"&&s instanceof Rt?s.element[s.attributeName]=n:s.value=n}}}},er=class extends S.DocumentFragment{constructor(e,t,r=fw){var s;super(),Mi(this,Pn,void 0),Mi(this,Iu,void 0),this.append(e.content.cloneNode(!0)),Ji(this,Pn,NT(this)),Ji(this,Iu,r),(s=r.createCallback)==null||s.call(r,this,de(this,Pn),t),r.processCallback(this,de(this,Pn),t)}update(e){de(this,Iu).processCallback(this,de(this,Pn),e)}};Pn=new WeakMap;Iu=new WeakMap;var NT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Gp;for([t,r]of PT(s.value))if(!t)n.append(r);else{let a=new Rt(i,s.name,s.namespaceURI);n.append(a),e.push([r,a])}s.value=n.toString()}for(let s of i.childNodes)if(s.nodeType===wT&&!(s instanceof HTMLTemplateElement))NT(s,e);else{let n=s.data;if(s.nodeType===wT||n.includes("{{")){let a=[];if(n)for([t,r]of PT(n))if(!t)a.push(new Text(r));else{let o=new tr(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new ro(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},MT={},PT=i=>{let e="",t=0,r=MT[i],s=0,n;if(r)return r;for(r=[];n=i[s];s++)n==="{"&&i[s+1]==="{"&&i[s-1]!=="\\"&&i[s+2]&&++t==1?(e&&r.push([DT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([hw,e.trim()]),e="",s++):e+=n||"";return e&&r.push([DT,(t>0?"{{":"")+e]),MT[i]=r},mw=11,ku=class{get value(){return""}set value(e){}toString(){return this.value}},UT=new WeakMap,Gp=class{constructor(){Mi(this,Is,[])}[Symbol.iterator](){return de(this,Is).values()}get length(){return de(this,Is).length}item(e){return de(this,Is)[e]}append(...e){for(let t of e)t instanceof Rt&&UT.set(t,this),de(this,Is).push(t)}toString(){return de(this,Is).join("")}};Is=new WeakMap;var Rt=class extends ku{constructor(e,t,r){super(),Mi(this,Ls),Mi(this,io,""),Mi(this,Rr,void 0),Mi(this,Ir,void 0),Mi(this,Lr,void 0),Ji(this,Rr,e),Ji(this,Ir,t),Ji(this,Lr,r)}get attributeName(){return de(this,Ir)}get attributeNamespace(){return de(this,Lr)}get element(){return de(this,Rr)}get value(){return de(this,io)}set value(e){de(this,io)!==e&&(Ji(this,io,e),!de(this,Ls,On)||de(this,Ls,On).length===1?e==null?de(this,Rr).removeAttributeNS(de(this,Lr),de(this,Ir)):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),e):de(this,Rr).setAttributeNS(de(this,Lr),de(this,Ir),de(this,Ls,On).toString()))}get booleanValue(){return de(this,Rr).hasAttributeNS(de(this,Lr),de(this,Ir))}set booleanValue(e){if(!de(this,Ls,On)||de(this,Ls,On).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};io=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Lr=new WeakMap;Ls=new WeakSet;On=function(){return UT.get(this)};var tr=class extends ku{constructor(e,t){super(),Mi(this,Lu,void 0),Mi(this,ai,void 0),Ji(this,Lu,e),Ji(this,ai,t?[...t]:[new Text])}get replacementNodes(){return de(this,ai)}get parentNode(){return de(this,Lu)}get nextSibling(){return de(this,ai)[de(this,ai).length-1].nextSibling}get previousSibling(){return de(this,ai)[0].previousSibling}get value(){return de(this,ai).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(r=>r==null?[new Text]:r.forEach?[...r]:r.nodeType===mw?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),Ji(this,ai,pw(de(this,ai)[0].parentNode,de(this,ai),t,this.nextSibling))}};Lu=new WeakMap;ai=new WeakMap;var ro=class extends tr{constructor(e,t){let r=t.getAttribute("directive")||t.getAttribute("type"),s=t.getAttribute("expression")||t.getAttribute(r)||"";s.startsWith("{{")&&(s=s.trim().slice(2,-2).trim()),super(e),this.expression=s,this.template=t,this.directive=r}};function pw(i,e,t,r=null){let s=0,n,a,o,l=t.length,d=e.length;for(;s<l&&s<d&&e[s]==t[s];)s++;for(;s<l&&s<d&&t[l-1]==e[d-1];)r=t[--d,--l];if(s==d)for(;s<l;)i.insertBefore(t[s++],r);if(s==l)for(;s<d;)i.removeChild(e[s++]);else{for(n=e[s];s<l;)o=t[s++],a=n?n.nextSibling:r,n==o?n=a:s<l&&t[s]==a?(i.replaceChild(o,n),n=a):i.insertBefore(o,n);for(;n!=r;)a=n.nextSibling,i.removeChild(n),n=a}return t}var FT={string:i=>String(i)},wu=class{constructor(e){this.template=e,this.state=void 0}},ks=new WeakMap,Cs=new WeakMap,Kp={partial:(i,e)=>{e[i.expression]=new wu(i.template)},if:(i,e)=>{var t;if($T(i.expression,e))if(ks.get(i)!==i.template){ks.set(i,i.template);let r=new er(i.template,e,Du);i.replace(r),Cs.set(i,r)}else(t=Cs.get(i))==null||t.update(e);else i.replace(""),ks.delete(i),Cs.delete(i)}},gw=Object.keys(Kp),Du={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof ro){if(!a.directive){let l=gw.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=Kp[a.directive])==null||r.call(Kp,a,t);continue}let o=$T(n,t);if(o instanceof wu){ks.get(a)!==o.template?(ks.set(a,o.template),o=new er(o.template,o.state,Du),a.value=o,Cs.set(a,o)):(s=Cs.get(a))==null||s.update(o.state);continue}o?(a instanceof Rt&&a.attributeName.startsWith("aria-")&&(o=String(o)),a instanceof Rt?typeof o=="boolean"?a.booleanValue=o:typeof o=="function"?a.element[a.attributeName]=o:a.value=o:(a.value=o,ks.delete(a),Cs.delete(a))):a instanceof Rt?a.value=void 0:(a.value=void 0,ks.delete(a),Cs.delete(a))}}},BT={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=FT[e])==null?void 0:t.call(FT,i)}};function vw(i){return Ew(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function $T(i,e={}){var t,r,s,n,a,o,l;let d=vw(i);if(d.length===0||d.some(({type:u})=>!u))return so(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return so(i);let c={...e};u.state=c;let h=d.slice(2);for(let f=0;f<h.length;f+=3){let m=(s=h[f])==null?void 0:s.token,p=(n=h[f+1])==null?void 0:n.token,g=(a=h[f+2])==null?void 0:a.token;m&&p==="="&&(c[m]=no(g,e))}return u}if(d.length===1)return Cu(d[0])?no(d[0].token,e):so(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=BT[u];if(!c||!Cu(d[1]))return so(i);let h=no(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=BT[u];if(!c||!Cu(d[0])||!Cu(d[2]))return so(i);let h=no(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=no(d[2].token,e);return c(h,f)}}function so(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Cu({type:i}){return["number","boolean","string","param"].includes(i)}function no(i,e){let t=i[0],r=i.slice(-1);return i==="true"||i==="false"?i==="true":t===r&&["'",'"'].includes(t)?i.slice(1,-1):Po(i)?parseFloat(i):e[i]}function Ew(i,e){let t,r,s,n=[];for(;i;){s=null,t=i.length;for(let a in e)r=e[a].exec(i),r&&r.index<t&&(s={token:r[0],type:a,matches:r.slice(1)},t=r.index);t&&n.push({token:i.substr(0,t),type:void 0}),s&&n.push(s),i=i.substr(t+(s?s.token.length:0))}return n}var zp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Yp=(i,e,t)=>(zp(i,e,"read from private field"),t?t.call(i):e.get(i)),ao=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ws=(i,e,t,r)=>(zp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Wp=(i,e,t)=>(zp(i,e,"access private method"),t),Nn,Mu,Un,qp,HT,Pu,jp,Vp={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},GT=B.createElement("template");GT.innerHTML=`
1318
1318
  <style>
1319
1319
  :host {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player",
3
- "version": "3.1.1-canary.0",
3
+ "version": "3.2.0",
4
4
  "description": "An open source Mux player web component that Just Works™",
5
5
  "homepage": "https://mux.com/player",
6
6
  "keywords": [
@@ -93,8 +93,8 @@
93
93
  "build": "npm-run-all --parallel 'build:esm --minify' 'build:iife --minify' 'build:cjs --minify' 'build:esm-module --minify' 'build:themes'"
94
94
  },
95
95
  "dependencies": {
96
- "@mux/mux-video": "0.22.0",
97
- "@mux/playback-core": "0.27.0",
96
+ "@mux/mux-video": "0.23.0",
97
+ "@mux/playback-core": "0.28.0",
98
98
  "media-chrome": "~4.3.0",
99
99
  "player.style": "^0.1.0"
100
100
  },