@mux/mux-player 3.0.0-canary.0-e51a7ce → 3.0.0-canary.0-e1d17f4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.1.0](https://github.com/muxinc/elements/compare/@mux/mux-player@3.0.0...@mux/mux-player@3.1.0) (2024-10-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * menu CSS vars to hide menu button ([#999](https://github.com/muxinc/elements/issues/999)) ([4375d6f](https://github.com/muxinc/elements/commit/4375d6f0cb3c56eaee291521ad14c8eb5feb5d59))
12
+ * upgrade Media Chrome v4.2.1 ([#1001](https://github.com/muxinc/elements/issues/1001)) ([46e38b5](https://github.com/muxinc/elements/commit/46e38b5504ce2738c9b896e7424e3cb506e62fdf))
13
+
14
+
15
+ ### Features
16
+
17
+ * **playback-core, mux-video, mux-audio, mux-video-react, mux-audio-react, mux-player, mux-player-react:** Add asset start and end time props and attrs. ([#1002](https://github.com/muxinc/elements/issues/1002)) ([99a0726](https://github.com/muxinc/elements/commit/99a07268cfa78ee026a0ee7b7f9af90fcf3feb4c))
18
+ * **playback-core:** error handling rearchitecture (including more granular and DRM error cases) ([4d0b670](https://github.com/muxinc/elements/commit/4d0b670eacb57f44891fab781941dab6e97e06fe))
19
+
20
+
21
+
22
+
23
+
6
24
  # [3.0.0](https://github.com/muxinc/elements/compare/@mux/mux-player@2.9.1...@mux/mux-player@3.0.0) (2024-09-20)
7
25
 
8
26
 
package/dist/index.cjs.js CHANGED
@@ -1192,7 +1192,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
1192
1192
  </style>
1193
1193
  <slot></slot>
1194
1194
  <div id="arrow"></div>
1195
- `;var js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(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"),v=g?parseFloat(g.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),L=f?parseFloat(f.replace("px","")):0,A=l-n+v-L,T=c-b+v+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(Mc.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[Wi.PLACEMENT,Wi.BOUNDS]}get placement(){return x(this,Wi.PLACEMENT)}set placement(e){M(this,Wi.PLACEMENT,e)}get bounds(){return x(this,Wi.BOUNDS)}set bounds(e){M(this,Wi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",js);var Gp=1,qp=i=>i.mediaMuted?0:i.mediaVolume,Zp=i=>`${Math.round(i*100)}%`,el=class extends Qt{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,t=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",V.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=qp(this),this.range.setAttribute("aria-valuetext",Zp(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return w(this,o.MEDIA_VOLUME,Gp)}set mediaVolume(e){P(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){B(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",el);var E=ph(require("@mux/mux-video")),S=require("@mux/playback-core");var Hc=require("@mux/mux-video");var Oc=require("@mux/playback-core");var ti=require("@mux/playback-core");function Lc(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${On(t)}: ${a}; `)}),e?e.trim():void 0}function On(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Nn(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function fe(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function tl(i){let e=Qp(i).toString();return e?"?"+e:""}function Qp(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var il=(i,e)=>!i||!e?!1:i.contains(e)?!0:il(i,e.getRootNode().host);var Rc="mux.com",zp=()=>{try{return"3.0.0"}catch{}return"UNKNOWN"},Xp=zp(),Un=()=>Xp,wc=(i,{token:e,customDomain:t=Rc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ti.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${t}/${i}/thumbnail.webp${tl({token:e,time:n,program_time:r})}`},xc=(i,{token:e,customDomain:t=Rc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ti.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${tl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ka=i=>{if(i){if([ti.StreamTypes.LIVE,ti.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ti.StreamTypes.LIVE}};var Jp={crossorigin:"crossOrigin",playsinline:"playsInline"};function Dc(i){var e;return(e=Jp[i])!=null?e:Nn(i)}var jt,ei,me,Pn=class{constructor(e,t){X(this,jt,void 0);X(this,ei,void 0);X(this,me,[]);Se(this,jt,e),Se(this,ei,t)}[Symbol.iterator](){return R(this,me).values()}get length(){return R(this,me).length}get value(){var e;return(e=R(this,me).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Se(this,me,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return R(this,me)[e]}values(){return R(this,me).values()}keys(){return R(this,me).keys()}forEach(e){R(this,me).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||R(this,me).push(r)}),!(this.value===""&&!((t=R(this,jt))!=null&&t.hasAttribute(`${R(this,ei)}`)))&&((a=R(this,jt))==null||a.setAttribute(`${R(this,ei)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{R(this,me).splice(R(this,me).indexOf(a),1)}),(t=R(this,jt))==null||t.setAttribute(`${R(this,ei)}`,`${this.value}`)}contains(e){return R(this,me).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)}};jt=new WeakMap,ei=new WeakMap,me=new WeakMap;var Nc=`[mux-player ${Un()}]`;function Qe(...i){console.warn(Nc,...i)}function Ee(...i){console.error(Nc,...i)}function al(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${(0,Oc.i18n)("Read more: ")}
1195
+ `;var js=class extends d.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;let t=this.placement;if(t==="left"||t==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}let a=getComputedStyle(this),r=(e=Ue(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"),v=g?parseFloat(g.replace("px","")):0,f=a.getPropertyValue("--media-tooltip-container-margin"),L=f?parseFloat(f.replace("px","")):0,A=l-n+v-L,T=c-b+v+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(Mc.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[Wi.PLACEMENT,Wi.BOUNDS]}get placement(){return x(this,Wi.PLACEMENT)}set placement(e){M(this,Wi.PLACEMENT,e)}get bounds(){return x(this,Wi.BOUNDS)}set bounds(e){M(this,Wi.BOUNDS,e)}};d.customElements.get("media-tooltip")||d.customElements.define("media-tooltip",js);var Gp=1,qp=i=>i.mediaMuted?0:i.mediaVolume,Zp=i=>`${Math.round(i*100)}%`,el=class extends Qt{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,t=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",V.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=qp(this),this.range.setAttribute("aria-valuetext",Zp(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return w(this,o.MEDIA_VOLUME,Gp)}set mediaVolume(e){P(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return H(this,o.MEDIA_MUTED)}set mediaMuted(e){B(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){M(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",el);var E=ph(require("@mux/mux-video")),S=require("@mux/playback-core");var Hc=require("@mux/mux-video");var Oc=require("@mux/playback-core");var ti=require("@mux/playback-core");function Lc(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${On(t)}: ${a}; `)}),e?e.trim():void 0}function On(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Nn(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function fe(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function tl(i){let e=Qp(i).toString();return e?"?"+e:""}function Qp(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var il=(i,e)=>!i||!e?!1:i.contains(e)?!0:il(i,e.getRootNode().host);var Rc="mux.com",zp=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},Xp=zp(),Un=()=>Xp,wc=(i,{token:e,customDomain:t=Rc,thumbnailTime:a,programTime:r}={})=>{var l;let n=e==null?a:void 0,{aud:s}=(l=(0,ti.parseJwt)(e))!=null?l:{};if(!(e&&s!=="t"))return`https://image.${t}/${i}/thumbnail.webp${tl({token:e,time:n,program_time:r})}`},xc=(i,{token:e,customDomain:t=Rc,programStartTime:a,programEndTime:r}={})=>{var s;let{aud:n}=(s=(0,ti.parseJwt)(e))!=null?s:{};if(!(e&&n!=="s"))return`https://image.${t}/${i}/storyboard.vtt${tl({token:e,format:"webp",program_start_time:a,program_end_time:r})}`},Ka=i=>{if(i){if([ti.StreamTypes.LIVE,ti.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return ti.StreamTypes.LIVE}};var Jp={crossorigin:"crossOrigin",playsinline:"playsInline"};function Dc(i){var e;return(e=Jp[i])!=null?e:Nn(i)}var jt,ei,me,Pn=class{constructor(e,t){X(this,jt,void 0);X(this,ei,void 0);X(this,me,[]);Se(this,jt,e),Se(this,ei,t)}[Symbol.iterator](){return R(this,me).values()}get length(){return R(this,me).length}get value(){var e;return(e=R(this,me).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Se(this,me,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return R(this,me)[e]}values(){return R(this,me).values()}keys(){return R(this,me).keys()}forEach(e){R(this,me).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||R(this,me).push(r)}),!(this.value===""&&!((t=R(this,jt))!=null&&t.hasAttribute(`${R(this,ei)}`)))&&((a=R(this,jt))==null||a.setAttribute(`${R(this,ei)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{R(this,me).splice(R(this,me).indexOf(a),1)}),(t=R(this,jt))==null||t.setAttribute(`${R(this,ei)}`,`${this.value}`)}contains(e){return R(this,me).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)}};jt=new WeakMap,ei=new WeakMap,me=new WeakMap;var Nc=`[mux-player ${Un()}]`;function Qe(...i){console.warn(Nc,...i)}function Ee(...i){console.error(Nc,...i)}function al(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${(0,Oc.i18n)("Read more: ")}
1196
1196
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Qe(e)}var ue={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ii={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Uc=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}}),jp=Hc.VideoEvents.filter(i=>i!=="error"),ev=Object.values(ue).filter(i=>![ue.PLAYSINLINE].includes(i)),tv=Object.values(ii),$i,rl=class extends Q.HTMLElement{constructor(){super();X(this,$i,new WeakMap);let t=r=>{for(let n of r)n.type==="childList"&&(n.removedNodes.forEach(s=>{var l;(l=R(this,$i).get(s))==null||l.remove()}),n.addedNodes.forEach(s=>{var u;let l=s;l!=null&&l.slot||(u=this.media)==null||u.append(Bc(R(this,$i),s))}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...ev,...tv]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(t=>{var a;(a=this.media)==null||a.append(Bc(R(this,$i),t))}),jp.forEach(t=>{var a;(a=this.media)==null||a.addEventListener(t,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(t,a,r){var n,s;switch(t){case ii.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case ii.VOLUME:{let l=(n=fe(r))!=null?n:1;this.media&&(this.media.volume=l);return}case ii.PLAYBACKRATE:{let l=(s=fe(r))!=null?s:1;this.media&&(this.media.playbackRate=l,this.media.defaultPlaybackRate=l);return}}}play(){var t,a;return(a=(t=this.media)==null?void 0:t.play())!=null?a:Promise.reject()}pause(){var t;(t=this.media)==null||t.pause()}load(){var t;(t=this.media)==null||t.load()}requestCast(t){var a;return(a=this.media)==null?void 0:a.requestCast(t)}get media(){var t;return(t=this.shadowRoot)==null?void 0:t.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 t,a;return(a=(t=this.media)==null?void 0:t.paused)!=null?a:!0}get duration(){var t,a;return(a=(t=this.media)==null?void 0:t.duration)!=null?a:NaN}get ended(){var t,a;return(a=(t=this.media)==null?void 0:t.ended)!=null?a:!1}get buffered(){var t,a;return(a=(t=this.media)==null?void 0:t.buffered)!=null?a:Uc}get seekable(){var t,a;return(a=(t=this.media)==null?void 0:t.seekable)!=null?a:Uc}get readyState(){var t,a;return(a=(t=this.media)==null?void 0:t.readyState)!=null?a:0}get videoWidth(){var t,a;return(a=(t=this.media)==null?void 0:t.videoWidth)!=null?a:0}get videoHeight(){var t,a;return(a=(t=this.media)==null?void 0:t.videoHeight)!=null?a:0}get currentSrc(){var t,a;return(a=(t=this.media)==null?void 0:t.currentSrc)!=null?a:""}get currentTime(){var t,a;return(a=(t=this.media)==null?void 0:t.currentTime)!=null?a:0}set currentTime(t){this.media&&(this.media.currentTime=Number(t))}get volume(){var t,a;return(a=(t=this.media)==null?void 0:t.volume)!=null?a:1}set volume(t){this.media&&(this.media.volume=Number(t))}get playbackRate(){var t,a;return(a=(t=this.media)==null?void 0:t.playbackRate)!=null?a:1}set playbackRate(t){this.media&&(this.media.playbackRate=Number(t))}get defaultPlaybackRate(){var t;return(t=fe(this.getAttribute(ii.PLAYBACKRATE)))!=null?t:1}set defaultPlaybackRate(t){t!=null?this.setAttribute(ii.PLAYBACKRATE,`${t}`):this.removeAttribute(ii.PLAYBACKRATE)}get crossOrigin(){return Va(this,ue.CROSSORIGIN)}set crossOrigin(t){this.setAttribute(ue.CROSSORIGIN,`${t}`)}get autoplay(){return Va(this,ue.AUTOPLAY)!=null}set autoplay(t){t?this.setAttribute(ue.AUTOPLAY,typeof t=="string"?t:""):this.removeAttribute(ue.AUTOPLAY)}get loop(){return Va(this,ue.LOOP)!=null}set loop(t){t?this.setAttribute(ue.LOOP,""):this.removeAttribute(ue.LOOP)}get muted(){var t,a;return(a=(t=this.media)==null?void 0:t.muted)!=null?a:!1}set muted(t){this.media&&(this.media.muted=!!t)}get defaultMuted(){return Va(this,ue.MUTED)!=null}set defaultMuted(t){t?this.setAttribute(ue.MUTED,""):this.removeAttribute(ue.MUTED)}get playsInline(){return Va(this,ue.PLAYSINLINE)!=null}set playsInline(t){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(t){["","none","metadata","auto"].includes(t)?this.setAttribute(ue.PRELOAD,t):this.removeAttribute(ue.PRELOAD)}};$i=new WeakMap;function Va(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}function Bc(i,e){let t=i.get(e);return t||(t=e.cloneNode(),i.set(e,t)),t}var nl=rl;var Vc=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},y=(i,e,t)=>(Vc(i,e,"read from private field"),t?t.call(i):e.get(i)),ze=(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)},mt=(i,e,t,a)=>(Vc(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Fi,Bn,ai,Ya,Lt,Rt,wt,ri,Ki,Hn,Oe,Wc=1,$c=0,iv=1,av={processCallback(i,e,t){if(t){for(let[a,r]of e)if(a in t){let n=t[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}}}},ht=class extends d.DocumentFragment{constructor(e,t,a=av){var r;super(),ze(this,Fi,void 0),ze(this,Bn,void 0),this.append(e.content.cloneNode(!0)),mt(this,Fi,Yc(this)),mt(this,Bn,a),(r=a.createCallback)==null||r.call(a,this,y(this,Fi),t),a.processCallback(this,y(this,Fi),t)}update(e){y(this,Bn).processCallback(this,y(this,Fi),e)}};Fi=new WeakMap;Bn=new WeakMap;var Yc=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new ol;for([t,a]of Kc(r.value))if(!t)n.append(a);else{let s=new he(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Wc&&!(r instanceof HTMLTemplateElement))Yc(r,e);else{let n=r.data;if(r.nodeType===Wc||n.includes("{{")){let s=[];if(n)for([t,a]of Kc(n))if(!t)s.push(new Text(a));else{let l=new pt(i);s.push(l),e.push([a,l])}else if(r instanceof HTMLTemplateElement){let l=new Ga(i,r);s.push(l),e.push([l.expression,l])}r.replaceWith(...s.flatMap(l=>l.replacementNodes||[l]))}}return e},Fc={},Kc=i=>{let e="",t=0,a=Fc[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([$c,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([iv,e.trim()]),e="",r++):e+=n||"";return e&&a.push([$c,(t>0?"{{":"")+e]),Fc[i]=a},rv=11,Wn=class{get value(){return""}set value(e){}toString(){return this.value}},Gc=new WeakMap,ol=class{constructor(){ze(this,ai,[])}[Symbol.iterator](){return y(this,ai).values()}get length(){return y(this,ai).length}item(e){return y(this,ai)[e]}append(...e){for(let t of e)t instanceof he&&Gc.set(t,this),y(this,ai).push(t)}toString(){return y(this,ai).join("")}};ai=new WeakMap;var he=class extends Wn{constructor(e,t,a){super(),ze(this,ri),ze(this,Ya,""),ze(this,Lt,void 0),ze(this,Rt,void 0),ze(this,wt,void 0),mt(this,Lt,e),mt(this,Rt,t),mt(this,wt,a)}get attributeName(){return y(this,Rt)}get attributeNamespace(){return y(this,wt)}get element(){return y(this,Lt)}get value(){return y(this,Ya)}set value(e){y(this,Ya)!==e&&(mt(this,Ya,e),!y(this,ri,Ki)||y(this,ri,Ki).length===1?e==null?y(this,Lt).removeAttributeNS(y(this,wt),y(this,Rt)):y(this,Lt).setAttributeNS(y(this,wt),y(this,Rt),e):y(this,Lt).setAttributeNS(y(this,wt),y(this,Rt),y(this,ri,Ki).toString()))}get booleanValue(){return y(this,Lt).hasAttributeNS(y(this,wt),y(this,Rt))}set booleanValue(e){if(!y(this,ri,Ki)||y(this,ri,Ki).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ya=new WeakMap;Lt=new WeakMap;Rt=new WeakMap;wt=new WeakMap;ri=new WeakSet;Ki=function(){return Gc.get(this)};var pt=class extends Wn{constructor(e,t){super(),ze(this,Hn,void 0),ze(this,Oe,void 0),mt(this,Hn,e),mt(this,Oe,t?[...t]:[new Text])}get replacementNodes(){return y(this,Oe)}get parentNode(){return y(this,Hn)}get nextSibling(){return y(this,Oe)[y(this,Oe).length-1].nextSibling}get previousSibling(){return y(this,Oe)[0].previousSibling}get value(){return y(this,Oe).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===rv?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),mt(this,Oe,nv(y(this,Oe)[0].parentNode,y(this,Oe),t,this.nextSibling))}};Hn=new WeakMap;Oe=new WeakMap;var Ga=class extends pt{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),this.expression=r,this.template=t,this.directive=a}};function nv(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var qc={string:i=>String(i)},Fn=class{constructor(e){this.template=e,this.state=void 0}},ni=new WeakMap,oi=new WeakMap,sl={partial:(i,e)=>{e[i.expression]=new Fn(i.template)},if:(i,e)=>{var t;if(Qc(i.expression,e))if(ni.get(i)!==i.template){ni.set(i,i.template);let a=new ht(i.template,e,Kn);i.replace(a),oi.set(i,a)}else(t=oi.get(i))==null||t.update(e);else i.replace(""),ni.delete(i),oi.delete(i)}},ov=Object.keys(sl),Kn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof Ga){if(!s.directive){let u=ov.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=sl[s.directive])==null||a.call(sl,s,t);continue}let l=Qc(n,t);if(l instanceof Fn){ni.get(s)!==l.template?(ni.set(s,l.template),l=new ht(l.template,l.state,Kn),s.value=l,oi.set(s,l)):(r=oi.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,ni.delete(s),oi.delete(s))):s instanceof he?s.value=void 0:(s.value=void 0,ni.delete(s),oi.delete(s))}}},Zc={"!":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=qc[e])==null?void 0:t.call(qc,i)}};function sv(i){return lv(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function Qc(i,e={}){var t,a,r,n,s,l,u;let c=sv(i);if(c.length===0||c.some(({type:b})=>!b))return qa(i);if(((t=c[0])==null?void 0:t.token)===">"){let b=e[(a=c[1])==null?void 0:a.token];if(!b)return qa(i);let g={...e};b.state=g;let v=c.slice(2);for(let f=0;f<v.length;f+=3){let L=(r=v[f])==null?void 0:r.token,A=(n=v[f+1])==null?void 0:n.token,T=(s=v[f+2])==null?void 0:s.token;L&&A==="="&&(g[L]=Za(T,e))}return b}if(c.length===1)return $n(c[0])?Za(c[0].token,e):qa(i);if(c.length===2){let b=(l=c[0])==null?void 0:l.token,g=Zc[b];if(!g||!$n(c[1]))return qa(i);let v=Za(c[1].token,e);return g(v)}if(c.length===3){let b=(u=c[1])==null?void 0:u.token,g=Zc[b];if(!g||!$n(c[0])||!$n(c[2]))return qa(i);let v=Za(c[0].token,e);if(b==="|")return g(v,c[2].token);let f=Za(c[2].token,e);return g(v,f)}}function qa(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function $n({type:i}){return["number","boolean","string","param"].includes(i)}function Za(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):yr(i)?parseFloat(i):e[i]}function lv(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var hl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ul=(i,e,t)=>(hl(i,e,"read from private field"),t?t.call(i):e.get(i)),Qa=(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)},si=(i,e,t,a)=>(hl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ll=(i,e,t)=>(hl(i,e,"access private method"),t),Vi,Vn,Yi,cl,zc,Yn,ml,dl={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Xc=m.createElement("template");Xc.innerHTML=`
1197
1197
  <style>
1198
1198
  :host {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var ke=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(ke(t,a,"read from private field"),e?e.call(t):a.get(t)),b=(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)},R=(t,a,e,i)=>(ke(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e);var h=(t,a,e)=>(ke(t,a,"access private method"),e);var W=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends W{}globalThis.DocumentFragment=t}var X=class extends W{},Re=class extends W{},Gt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(X)}},J,Oe=class{constructor(a,e={}){b(this,J,void 0);R(this,J,e==null?void 0:e.detail)}get detail(){return u(this,J)}initCustomEvent(){}};J=new WeakMap;function jt(t,a){return new X}var lt={document:{createElement:jt},DocumentFragment,customElements:Gt,CustomEvent:Oe,EventTarget:W,HTMLElement:X,HTMLVideoElement:Re},ut=typeof window=="undefined"||typeof globalThis.customElements=="undefined",p=ut?lt:globalThis,C=ut?lt.document:globalThis.document;import{MediaController as Ma}from"media-chrome";import{Attributes as He}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Ht}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import Sa,{MediaError as fe,Attributes as s}from"@mux/mux-video";import{StreamTypes as L,PlaybackTypes as ye,addTextTrack as Na,removeTextTrack as wa,CmcdTypeValues as Kt,i18n as G,parseJwt as Ke,MuxJWTAud as Ue}from"@mux/playback-core";import{VideoEvents as ea}from"@mux/mux-video";import{i18n as Qt}from"@mux/playback-core";import{StreamTypes as Le,parseJwt as ct}from"@mux/playback-core";function mt(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${le(e)}: ${i}; `)}),a?a.trim():void 0}function le(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ue(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function T(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function xe(t){let a=qt(t).toString();return a?"?"+a:""}function qt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var _e=(t,a)=>!t||!a?!1:t.contains(a)?!0:_e(t,a.getRootNode().host);var pt="mux.com",zt=()=>{try{return"3.0.0"}catch{}return"UNKNOWN"},Xt=zt(),ce=()=>Xt,bt=(t,{token:a,customDomain:e=pt,thumbnailTime:i,programTime:r}={})=>{var l;let o=a==null?i:void 0,{aud:d}=(l=ct(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${xe({token:a,time:o,program_time:r})}`},ht=(t,{token:a,customDomain:e=pt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:o}=(d=ct(a))!=null?d:{};if(!(a&&o!=="s"))return`https://image.${e}/${t}/storyboard.vtt${xe({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},Q=t=>{if(t){if([Le.LIVE,Le.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Le.LIVE}};var Jt={crossorigin:"crossOrigin",playsinline:"playsInline"};function gt(t){var a;return(a=Jt[t])!=null?a:ue(t)}var H,K,v,me=class{constructor(a,e){b(this,H,void 0);b(this,K,void 0);b(this,v,[]);R(this,H,a),R(this,K,e)}[Symbol.iterator](){return u(this,v).values()}get length(){return u(this,v).length}get value(){var a;return(a=u(this,v).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(R(this,v,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,v)[a]}values(){return u(this,v).values()}keys(){return u(this,v).keys()}forEach(a){u(this,v).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,v).push(r)}),!(this.value===""&&!((e=u(this,H))!=null&&e.hasAttribute(`${u(this,K)}`)))&&((i=u(this,H))==null||i.setAttribute(`${u(this,K)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,v).splice(u(this,v).indexOf(i),1)}),(e=u(this,H))==null||e.setAttribute(`${u(this,K)}`,`${this.value}`)}contains(a){return u(this,v).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)}};H=new WeakMap,K=new WeakMap,v=new WeakMap;var ft=`[mux-player ${ce()}]`;function _(...t){console.warn(ft,...t)}function E(...t){console.error(ft,...t)}function Me(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Qt("Read more: ")}
1
+ var ke=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var u=(t,a,e)=>(ke(t,a,"read from private field"),e?e.call(t):a.get(t)),b=(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)},R=(t,a,e,i)=>(ke(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e);var h=(t,a,e)=>(ke(t,a,"access private method"),e);var W=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends W{}globalThis.DocumentFragment=t}var X=class extends W{},Re=class extends W{},Gt={get(t){},define(t,a,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(X)}},J,Oe=class{constructor(a,e={}){b(this,J,void 0);R(this,J,e==null?void 0:e.detail)}get detail(){return u(this,J)}initCustomEvent(){}};J=new WeakMap;function jt(t,a){return new X}var lt={document:{createElement:jt},DocumentFragment,customElements:Gt,CustomEvent:Oe,EventTarget:W,HTMLElement:X,HTMLVideoElement:Re},ut=typeof window=="undefined"||typeof globalThis.customElements=="undefined",p=ut?lt:globalThis,C=ut?lt.document:globalThis.document;import{MediaController as Ma}from"media-chrome";import{Attributes as He}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Ht}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import Sa,{MediaError as fe,Attributes as s}from"@mux/mux-video";import{StreamTypes as L,PlaybackTypes as ye,addTextTrack as Na,removeTextTrack as wa,CmcdTypeValues as Kt,i18n as G,parseJwt as Ke,MuxJWTAud as Ue}from"@mux/playback-core";import{VideoEvents as ea}from"@mux/mux-video";import{i18n as Qt}from"@mux/playback-core";import{StreamTypes as Le,parseJwt as ct}from"@mux/playback-core";function mt(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${le(e)}: ${i}; `)}),a?a.trim():void 0}function le(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ue(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function T(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function xe(t){let a=qt(t).toString();return a?"?"+a:""}function qt(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}var _e=(t,a)=>!t||!a?!1:t.contains(a)?!0:_e(t,a.getRootNode().host);var pt="mux.com",zt=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},Xt=zt(),ce=()=>Xt,bt=(t,{token:a,customDomain:e=pt,thumbnailTime:i,programTime:r}={})=>{var l;let o=a==null?i:void 0,{aud:d}=(l=ct(a))!=null?l:{};if(!(a&&d!=="t"))return`https://image.${e}/${t}/thumbnail.webp${xe({token:a,time:o,program_time:r})}`},ht=(t,{token:a,customDomain:e=pt,programStartTime:i,programEndTime:r}={})=>{var d;let{aud:o}=(d=ct(a))!=null?d:{};if(!(a&&o!=="s"))return`https://image.${e}/${t}/storyboard.vtt${xe({token:a,format:"webp",program_start_time:i,program_end_time:r})}`},Q=t=>{if(t){if([Le.LIVE,Le.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Le.LIVE}};var Jt={crossorigin:"crossOrigin",playsinline:"playsInline"};function gt(t){var a;return(a=Jt[t])!=null?a:ue(t)}var H,K,v,me=class{constructor(a,e){b(this,H,void 0);b(this,K,void 0);b(this,v,[]);R(this,H,a),R(this,K,e)}[Symbol.iterator](){return u(this,v).values()}get length(){return u(this,v).length}get value(){var a;return(a=u(this,v).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(R(this,v,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return u(this,v)[a]}values(){return u(this,v).values()}keys(){return u(this,v).keys()}forEach(a){u(this,v).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||u(this,v).push(r)}),!(this.value===""&&!((e=u(this,H))!=null&&e.hasAttribute(`${u(this,K)}`)))&&((i=u(this,H))==null||i.setAttribute(`${u(this,K)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{u(this,v).splice(u(this,v).indexOf(i),1)}),(e=u(this,H))==null||e.setAttribute(`${u(this,K)}`,`${this.value}`)}contains(a){return u(this,v).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)}};H=new WeakMap,K=new WeakMap,v=new WeakMap;var ft=`[mux-player ${ce()}]`;function _(...t){console.warn(ft,...t)}function E(...t){console.error(ft,...t)}function Me(t){var e;let a=(e=t.message)!=null?e:"";t.context&&(a+=` ${t.context}`),t.file&&(a+=` ${Qt("Read more: ")}
2
2
  https://github.com/muxinc/elements/blob/main/errors/${t.file}`),_(a)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},U={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},vt=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}}),ta=ea.filter(t=>t!=="error"),aa=Object.values(y).filter(t=>![y.PLAYSINLINE].includes(t)),ia=Object.values(U),Z,Se=class extends p.HTMLElement{constructor(){super();b(this,Z,new WeakMap);let e=r=>{for(let o of r)o.type==="childList"&&(o.removedNodes.forEach(d=>{var l;(l=u(this,Z).get(d))==null||l.remove()}),o.addedNodes.forEach(d=>{var c;let l=d;l!=null&&l.slot||(c=this.media)==null||c.append(Tt(u(this,Z),d))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...aa,...ia]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(e=>{var i;(i=this.media)==null||i.append(Tt(u(this,Z),e))}),ta.forEach(e=>{var i;(i=this.media)==null||i.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,i,r){var o,d;switch(e){case U.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case U.VOLUME:{let l=(o=T(r))!=null?o:1;this.media&&(this.media.volume=l);return}case U.PLAYBACKRATE:{let l=(d=T(r))!=null?d:1;this.media&&(this.media.playbackRate=l,this.media.defaultPlaybackRate=l);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:vt}get seekable(){var e,i;return(i=(e=this.media)==null?void 0:e.seekable)!=null?i:vt}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=T(this.getAttribute(U.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(U.PLAYBACKRATE,`${e}`):this.removeAttribute(U.PLAYBACKRATE)}get crossOrigin(){return ee(this,y.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(y.CROSSORIGIN,`${e}`)}get autoplay(){return ee(this,y.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(y.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return ee(this,y.LOOP)!=null}set loop(e){e?this.setAttribute(y.LOOP,""):this.removeAttribute(y.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 ee(this,y.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return ee(this,y.PLAYSINLINE)!=null}set playsInline(e){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(e){["","none","metadata","auto"].includes(e)?this.setAttribute(y.PRELOAD,e):this.removeAttribute(y.PRELOAD)}};Z=new WeakMap;function ee(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}function Tt(t,a){let e=t.get(a);return e||(e=a.cloneNode(),t.set(a,e)),e}var Ne=Se;import"media-chrome/dist/media-theme-element.js";var Et=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);
@@ -1243,7 +1243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1243
1243
  `:""}${i.error?`error: ${i.error}
1244
1244
  `:""}${i.event?`event: ${i.event}
1245
1245
  `:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
1246
- `:""}`),l.data=i,l};var Qk=Object.defineProperty,Zk=Object.getPrototypeOf,Jk=Reflect.get,eC=(i,e,t)=>e in i?Qk(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,De=(i,e,t)=>(eC(i,typeof e!="symbol"?e+"":e,t),t),Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Sp(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(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)},ee=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ke=(i,e,t)=>(Sp(i,e,"access private method"),t),rp=(i,e,t)=>Jk(Zk(i),t,e),cu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends cu{}globalThis.DocumentFragment=i}var xp=class extends cu{},tC=class extends cu{},iC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(xp)}},zd,rC=class{constructor(i,e={}){z(this,zd,void 0),ee(this,zd,e==null?void 0:e.detail)}get detail(){return I(this,zd)}initCustomEvent(){}};zd=new WeakMap;function sC(i,e){return new xp}var tT={document:{createElement:sC},DocumentFragment,customElements:iC,CustomEvent:rC,EventTarget:cu,HTMLElement:xp,HTMLVideoElement:tC},iT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",sp=iT?tT:globalThis,o2=iT?tT.document:globalThis.document,nC=()=>{try{return"0.21.0"}catch{}return"UNKNOWN"},aC=nC(),oC=()=>aC,hu=["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 lC(i){return`
1246
+ `:""}`),l.data=i,l};var Qk=Object.defineProperty,Zk=Object.getPrototypeOf,Jk=Reflect.get,eC=(i,e,t)=>e in i?Qk(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,De=(i,e,t)=>(eC(i,typeof e!="symbol"?e+"":e,t),t),Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Sp(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(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)},ee=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ke=(i,e,t)=>(Sp(i,e,"access private method"),t),rp=(i,e,t)=>Jk(Zk(i),t,e),cu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends cu{}globalThis.DocumentFragment=i}var xp=class extends cu{},tC=class extends cu{},iC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(xp)}},zd,rC=class{constructor(i,e={}){z(this,zd,void 0),ee(this,zd,e==null?void 0:e.detail)}get detail(){return I(this,zd)}initCustomEvent(){}};zd=new WeakMap;function sC(i,e){return new xp}var tT={document:{createElement:sC},DocumentFragment,customElements:iC,CustomEvent:rC,EventTarget:cu,HTMLElement:xp,HTMLVideoElement:tC},iT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",sp=iT?tT:globalThis,o2=iT?tT.document:globalThis.document,nC=()=>{try{return"0.22.0"}catch{}return"UNKNOWN"},aC=nC(),oC=()=>aC,hu=["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 lC(i){return`
1247
1247
  <style>
1248
1248
  :host {
1249
1249
  display: inline-flex;
@@ -1285,7 +1285,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1285
1285
  <video${sT(i)}></video>
1286
1286
  </slot>
1287
1287
  <slot></slot>
1288
- `}var rT=(i,{tag:e,is:t})=>{var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?uC(_):[];return n=class extends i{constructor(){super(),z(this,h),z(this,m),z(this,g),z(this,b),z(this,d,void 0),z(this,u,void 0),z(this,c,new Map)}static get observedAttributes(){var R,S,C;return Ke(R=n,o,l).call(R),[...(C=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?C:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,S,C;return Ke(this,h,f).call(this),(C=(S=(R=I(this,u))!=null?R:this.shadowRoot.querySelector(e))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e)}set nativeEl(R){ee(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,S;return(S=this.getAttribute("preload"))!=null?S:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R,S;if(!this.shadowRoot){this.attachShadow({mode:"open"});let C=cC(this.attributes);t&&(C.is=t),e&&(C.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(C)}this.nativeEl.muted=this.hasAttribute("muted");for(let C of A)Ke(this,g,E).call(this,C);this.shadowRoot.addEventListener("slotchange",this),Ke(this,m,p).call(this);for(let C of this.constructor.Events)(S=(R=this.shadowRoot).addEventListener)==null||S.call(R,C,this,!0)}handleEvent(R){if(R.type==="slotchange"){Ke(this,m,p).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,S,C){Ke(this,h,f).call(this),Ke(this,b,T).call(this,R,S,C)}connectedCallback(){Ke(this,h,f).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;ee(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...C){return Ke(this,h,f).call(this),this.call?this.call(S,...C):this.nativeEl[S].apply(this.nativeEl,C)};else{let C={get(){var P,k,M;Ke(this,h,f).call(this);let B=S.toLowerCase();if(R.has(B)){let F=this.getAttribute(B);return F===null?!1:F===""?!0:F}return(M=(P=this.get)==null?void 0:P.call(this,S))!=null?M:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(C.set=function(P){Ke(this,h,f).call(this);let k=S.toLowerCase();if(R.has(k)){P===!0||P===!1||P==null?this.toggleAttribute(k,!!P):this.setAttribute(k,P);return}if(this.set){this.set(S,P);return}this.nativeEl[S]=P}),Object.defineProperty(this.prototype,S,C)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakSet,f=function(){I(this,d)||(ee(this,d,!0),this.init())},m=new WeakSet,p=function(){let R=new Map(I(this,c));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(S=>["track","source"].includes(S.localName)).forEach(S=>{var C,P;R.delete(S);let k=I(this,c).get(S);k||(k=S.cloneNode(),I(this,c).set(S,k)),(P=(C=this.nativeEl).append)==null||P.call(C,k),k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")}),R.forEach(S=>S.remove())},g=new WeakSet,E=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let S=this[R];delete this[R],this[R]=S}},b=new WeakSet,T=function(R,S,C){var P,k,M,B,F,X;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(C===null?(k=(P=this.nativeEl).removeAttribute)==null||k.call(P,R):((B=(M=this.nativeEl).getAttribute)==null?void 0:B.call(M,R))!=C&&((X=(F=this.nativeEl).setAttribute)==null||X.call(F,R,C)))},z(n,o),De(n,"getTemplateHTML",e.endsWith("audio")?lC:dC),De(n,"shadowRootOptions",{mode:"open"}),De(n,"Events",hu),z(n,a,void 0),n};function uC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(...Object.getOwnPropertyNames(t));return e}function sT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var jy,np=rT((jy=globalThis.HTMLElement)!=null?jy:class{},{tag:"video"}),zy,d2=rT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"audio"}),Ts=new WeakMap,ap=class extends Error{},hC=class extends Error{},fC=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 mC(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 pC(){return globalThis.chrome}function gC(){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 _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Rp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function Ip(){var i;return(i=Rp())==null?void 0:i.getSessionObj().media[0]}function vC(i){return new Promise((e,t)=>{Ip().editTracksInfo(i,e,t)})}function EC(i){return new Promise((e,t)=>{Ip().getStatus(i,e,t)})}function nT(i){return _s().setOptions({...aT(),...i})}function aT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var Xd=new fC,xr=new WeakSet,ot;mC(()=>{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}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),Xd.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Xy=0,xe,Qd,Yt,Ar,Cn,Rn,ys,lp,Sr,os,dp,Qy,du,up,cp,oT,Zd,hp,fp,Zy,Jd,op,bC=class extends EventTarget{constructor(i){super(),z(this,Sr),z(this,dp),z(this,du),z(this,cp),z(this,Zd),z(this,fp),z(this,Jd),z(this,xe,void 0),z(this,Qd,void 0),z(this,Yt,void 0),z(this,Ar,void 0),z(this,Cn,"disconnected"),z(this,Rn,!1),z(this,ys,new Set),z(this,lp,new WeakMap),ee(this,xe,i),Xd.add(this),Ts.set(this,{init:()=>Ke(this,Zd,hp).call(this),onCastStateChanged:()=>Ke(this,du,up).call(this),onSessionStateChanged:()=>Ke(this,cp,oT).call(this),getCastPlayer:()=>I(this,Sr,os)}),Ke(this,Zd,hp).call(this)}get state(){return I(this,Cn)}async watchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");return I(this,lp).set(i,++Xy),I(this,ys).add(i),Xy}async cancelWatchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new hC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,xe));xr.add(I(this,xe)),nT(I(this,xe).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Yt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,xe));return}throw new Error(n)}(r=(t=Ts.get(I(this,xe)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};xe=new WeakMap,Qd=new WeakMap,Yt=new WeakMap,Ar=new WeakMap,Cn=new WeakMap,Rn=new WeakMap,ys=new WeakMap,lp=new WeakMap,Sr=new WeakSet,os=function(){if(xr.has(I(this,xe)))return I(this,Yt)},dp=new WeakSet,Qy=function(){xr.has(I(this,xe))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Yt).controller.removeEventListener(i,e)}),xr.delete(I(this,xe)),I(this,xe).muted=I(this,Yt).isMuted,I(this,xe).currentTime=I(this,Yt).savedPlayerState.currentTime,I(this,Yt).savedPlayerState.isPaused===!1&&I(this,xe).play())},du=new WeakSet,up=function(){let i=_s().getCastState();if(xr.has(I(this,xe))&&i==="CONNECTING"&&(ee(this,Cn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Rn)&&i!=null&&i.includes("CONNECT")){ee(this,Rn,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Rn)&&(!i||i==="NO_DEVICES_AVAILABLE")){ee(this,Rn,!1);for(let e of I(this,ys))e(!1)}},cp=new WeakSet,oT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,xe).castSrc===((i=Ip())==null?void 0:i.media.contentId)){xr.add(I(this,xe)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Yt).controller.addEventListener(t,r)});try{await EC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Zd=new WeakSet,hp=function(){!ot||I(this,Qd)||(ee(this,Qd,!0),nT(I(this,xe).castOptions),I(this,xe).textTracks.addEventListener("change",()=>Ke(this,Jd,op).call(this)),Ke(this,du,up).call(this),ee(this,Yt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,Yt)),ee(this,Ar,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(ee(this,Cn,"connected"),this.dispatchEvent(new Event("connect"))):(Ke(this,dp,Qy).call(this),ee(this,Cn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&I(this,xe).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,xe).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,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ke(this,fp,Zy).call(this))}}))},fp=new WeakSet,Zy=function(){Ke(this,Jd,op).call(this)},Jd=new WeakSet,op=async function(){var i,e,t,r,s;if(!I(this,Sr,os))return;let n=((e=(i=I(this,Yt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,xe).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=Rp())==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 vC(h)}catch(h){console.error(h)}};var yC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),z(this,o),z(this,d),z(this,r,{paused:!1}),z(this,s,aT()),z(this,n,void 0),z(this,a,void 0)}get remote(){return I(this,a)?I(this,a):pC()?(gC(),Ts.set(this,{loadOnPrompt:()=>Ke(this,d,u).call(this)}),ee(this,a,new bC(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=Rp())==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}ee(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=Ts.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=rp(t.prototype,this,"paused"),rp(t.prototype,this,"pause").call(this),this.muted=rp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},De(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},fu=class extends Event{constructor(i,e){super(i),De(this,"track"),this.track=e.track}},mp=new WeakMap;function Y(i){var e;return(e=mp.get(i))!=null?e:TC(i,{})}function TC(i,e){let t=mp.get(i);return t||mp.set(i,t={}),Object.assign(t,e)}function pp(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function _C(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,In,Ka,vp=class extends EventTarget{constructor(){super(),z(this,In),z(this,ls,void 0),z(this,ds,void 0),z(this,us,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,In,Ka).values()}get length(){return I(this,In,Ka).size}getTrackById(i){var e;return(e=[...I(this,In,Ka)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,In,Ka)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),ee(this,ls,void 0)),typeof i=="function"&&(ee(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),ee(this,ds,void 0)),typeof i=="function"&&(ee(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),ee(this,us,void 0)),typeof i=="function"&&(ee(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,In=new WeakSet,Ka=function(){return Y(this).trackSet};var mu=class extends Event{constructor(i,e){super(i),De(this,"rendition"),this.rendition=e.rendition}};function AC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in Ep.prototype||Object.defineProperty(Ep.prototype,s,{get(){return Ln(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function SC(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function xC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ln(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,Ep=class extends EventTarget{constructor(){super(...arguments),z(this,cs,void 0),z(this,hs,void 0),z(this,fs,void 0)}[Symbol.iterator](){return Ln(this).values()}get length(){return Ln(this).length}getRenditionById(i){var e;return(e=Ln(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Ln(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Ln(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),ee(this,cs,void 0)),typeof i=="function"&&(ee(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),ee(this,hs,void 0)),typeof i=="function"&&(ee(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),ee(this,fs,void 0)),typeof i=="function"&&(ee(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,RC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"width"),De(this,"height"),De(this,"bitrate"),De(this,"frameRate"),De(this,"codec"),z(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(ee(this,Wa,i),xC(this))}};Wa=new WeakMap;var Va,lT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,Va,!1)}addRendition(i,e,t,r,s,n){let a=new RC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,AC(this,a),a}removeRendition(i){SC(i)}get selected(){return I(this,Va)}set selected(i){I(this,Va)!==i&&(ee(this,Va,i),i===!0&&_C(this))}};Va=new WeakMap;function IC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in bp.prototype||Object.defineProperty(bp.prototype,s,{get(){return kn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function LC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function kC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function kn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,bp=class extends EventTarget{constructor(){super(...arguments),z(this,ms,void 0),z(this,ps,void 0),z(this,gs,void 0)}[Symbol.iterator](){return kn(this).values()}get length(){return kn(this).length}getRenditionById(i){var e;return(e=kn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return kn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of kn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),ee(this,ms,void 0)),typeof i=="function"&&(ee(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),ee(this,ps,void 0)),typeof i=="function"&&(ee(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),ee(this,gs,void 0)),typeof i=="function"&&(ee(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var Ya,CC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"bitrate"),De(this,"codec"),z(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(ee(this,Ya,i),kC(this))}};Ya=new WeakMap;function yp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in _p.prototype||Object.defineProperty(_p.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function Tp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function wC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,qa,eu,_p=class extends EventTarget{constructor(){super(),z(this,qa),z(this,vs,void 0),z(this,Es,void 0),z(this,bs,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,qa,eu).values()}get length(){return I(this,qa,eu).size}getTrackById(i){var e;return(e=[...I(this,qa,eu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),ee(this,vs,void 0)),typeof i=="function"&&(ee(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),ee(this,Es,void 0)),typeof i=="function"&&(ee(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),ee(this,bs,void 0)),typeof i=="function"&&(ee(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,qa=new WeakSet,eu=function(){return Y(this).trackSet};var ja,dT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,ja,!1)}addRendition(i,e,t){let r=new CC;return r.src=i,r.codec=e,r.bitrate=t,IC(this,r),r}removeRendition(i){LC(i)}get enabled(){return I(this,ja)}set enabled(i){I(this,ja)!==i&&(ee(this,ja,i),wC(this))}};ja=new WeakMap;var Jy=uu(globalThis.HTMLMediaElement,"video"),eT=uu(globalThis.HTMLMediaElement,"audio");function DC(i){if(!(i!=null&&i.prototype))return i;let e=uu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return MC(this)}});let t=uu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return PC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new lT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=gp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new dT;return l.kind=n,l.label=a,l.language=o,yp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Tp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new Ep,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new bp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function uu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function MC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new vp,Y(i).videoTracks=t,Jy)){let r=Jy.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof lT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}function PC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new _p,Y(i).audioTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)yp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof dT)){for(let n of r)Tp(n);return}yp(i,s.track)}),r.addEventListener("removetrack",s=>{Tp(s.track)})}return t}hu.push("castchange","entercast","leavecast");var D={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",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"},OC=Object.values(D),NC=oC(),UC="mux-video",wi,za,tu,Xa,iu,ru,su,nu,au,Qa,ou,FC=class extends np{constructor(){super(),z(this,Qa),z(this,wi,void 0),z(this,za,void 0),z(this,tu,void 0),z(this,Xa,{}),z(this,iu,{}),z(this,ru,void 0),z(this,su,void 0),z(this,nu,void 0),z(this,au,void 0),ee(this,tu,Uy())}static get observedAttributes(){var i;return[...OC,...(i=np.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(D.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?xn.includes(i)?this.setAttribute(D.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${xn.join()}`):this.removeAttribute(D.PREFER_CMCD))}get playerInitTime(){return I(this,tu)}get playerSoftwareName(){var i;return(i=I(this,nu))!=null?i:UC}set playerSoftwareName(i){ee(this,nu,i)}get playerSoftwareVersion(){var i;return(i=I(this,su))!=null?i:NC}set playerSoftwareVersion(i){ee(this,su,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=Jm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,au)}set errorTranslator(i){ee(this,au,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(D.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(D.TYPE,i):this.removeAttribute(D.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(D.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(D.DEBUG,""):this.removeAttribute(D.DEBUG))}get disableTracking(){return this.hasAttribute(D.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(D.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(D.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(D.DISABLE_COOKIES,""):this.removeAttribute(D.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(D.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(D.START_TIME):this.setAttribute(D.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(D.PLAYBACK_ID)?this.getAttribute(D.PLAYBACK_ID):(i=Zm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(D.PLAYBACK_ID,i):this.removeAttribute(D.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(D.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(D.MAX_RESOLUTION,i):this.removeAttribute(D.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(D.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(D.MIN_RESOLUTION,i):this.removeAttribute(D.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(D.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(D.RENDITION_ORDER,i):this.removeAttribute(D.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(D.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(D.PROGRAM_START_TIME):this.setAttribute(D.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(D.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(D.PROGRAM_END_TIME):this.setAttribute(D.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(D.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(D.ASSET_START_TIME):this.setAttribute(D.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(D.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(D.ASSET_END_TIME):this.setAttribute(D.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(D.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(D.CUSTOM_DOMAIN,i):this.removeAttribute(D.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(D.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(D.DRM_TOKEN,i):this.removeAttribute(D.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(D.PLAYBACK_TOKEN))return(i=this.getAttribute(D.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(D.PLAYBACK_ID)){let[,s]=Wd((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(D.PLAYBACK_TOKEN,i):this.removeAttribute(D.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(D.PLAYBACK_TOKEN),e=this.getAttribute(D.DRM_TOKEN);return{...I(this,iu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){ee(this,iu,i!=null?i:{})}get ended(){return tp(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(D.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(D.ENV_KEY,i):this.removeAttribute(D.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(D.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(D.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(D.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(D.STREAM_TYPE))!=null?i:Kd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(D.STREAM_TYPE,i):this.removeAttribute(D.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(D.TARGET_LIVE_WINDOW)?+this.getAttribute(D.TARGET_LIVE_WINDOW):Fy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.TARGET_LIVE_WINDOW):this.setAttribute(D.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(D.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 By(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(D.LIVE_EDGE_OFFSET))return+this.getAttribute(D.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.LIVE_EDGE_OFFSET):this.setAttribute(D.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return jd(this.nativeEl)}async addCuePoints(i){return qm(this.nativeEl,i)}get activeCuePoint(){return jm(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return Xm(this.nativeEl,i)}get activeChapter(){return Qm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(D.PREFER_PLAYBACK);if(i===Vt.MSE||i===Vt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Vt.MSE||i===Vt.NATIVE?this.setAttribute(D.PREFER_PLAYBACK,i):this.removeAttribute(D.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![D.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,Xa)}}set metadata(i){ee(this,Xa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Xa))}get _hlsConfig(){return I(this,ru)}set _hlsConfig(i){ee(this,ru,i)}load(){ee(this,wi,Gy(this,this.nativeEl,I(this,wi)))}unload(){ip(this.nativeEl,I(this,wi)),ee(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(np.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case D.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case D.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ke(this,Qa,ou).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ke(this,Qa,ou).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 D.PLAYBACK_ID:this.src=Ga(this);break;case D.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 D.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 D.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case D.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)&&Ke(this,Qa,ou).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,za=new WeakMap,tu=new WeakMap,Xa=new WeakMap,iu=new WeakMap,ru=new WeakMap,su=new WeakMap,nu=new WeakMap,au=new WeakMap,Qa=new WeakSet,ou=async function(){I(this,za)||(await ee(this,za,Promise.resolve()),ee(this,za,null),this.load())};var lu,Ap=class extends yC(DC(FC)){constructor(){super(...arguments),z(this,lu,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,lu))!=null?i:this.muxCastCustomData}set castCustomData(i){ee(this,lu,i)}};lu=new WeakMap;sp.customElements.get("mux-video")||(sp.customElements.define("mux-video",Ap),sp.MuxVideoElement=Ap);var uT=Ap;function cT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${pu(t)}: ${r}; `)}),e?e.trim():void 0}function pu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function gu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Mt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=BC(i).toString();return e?"?"+e:""}function BC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var kp=(i,e)=>!i||!e?!1:i.contains(e)?!0:kp(i,e.getRootNode().host);var hT="mux.com",$C=()=>{try{return"3.0.0"}catch{}return"UNKNOWN"},HC=$C(),Eu=()=>HC,fT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,time:n,program_time:s})}`},mT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Za=i=>{if(i){if([Ae.LIVE,Ae.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Ae.LIVE}};var GC={crossorigin:"crossOrigin",playsinline:"playsInline"};function pT(i){var e;return(e=GC[i])!=null?e:gu(i)}var As,Ss,xt,vu=class{constructor(e,t){Xe(this,As,void 0);Xe(this,Ss,void 0);Xe(this,xt,[]);Ht(this,As,e),Ht(this,Ss,t)}[Symbol.iterator](){return me(this,xt).values()}get length(){return me(this,xt).length}get value(){var e;return(e=me(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ht(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return me(this,xt)[e]}values(){return me(this,xt).values()}keys(){return me(this,xt).keys()}forEach(e){me(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||me(this,xt).push(s)}),!(this.value===""&&!((t=me(this,As))!=null&&t.hasAttribute(`${me(this,Ss)}`)))&&((r=me(this,As))==null||r.setAttribute(`${me(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{me(this,xt).splice(me(this,xt).indexOf(r),1)}),(t=me(this,As))==null||t.setAttribute(`${me(this,Ss)}`,`${this.value}`)}contains(e){return me(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)}};As=new WeakMap,Ss=new WeakMap,xt=new WeakMap;var gT=`[mux-player ${Eu()}]`;function Di(...i){console.warn(gT,...i)}function Pt(...i){console.error(gT,...i)}function Cp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
1288
+ `}var rT=(i,{tag:e,is:t})=>{var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?uC(_):[];return n=class extends i{constructor(){super(),z(this,h),z(this,m),z(this,g),z(this,b),z(this,d,void 0),z(this,u,void 0),z(this,c,new Map)}static get observedAttributes(){var R,S,C;return Ke(R=n,o,l).call(R),[...(C=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?C:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,S,C;return Ke(this,h,f).call(this),(C=(S=(R=I(this,u))!=null?R:this.shadowRoot.querySelector(e))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e)}set nativeEl(R){ee(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,S;return(S=this.getAttribute("preload"))!=null?S:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R,S;if(!this.shadowRoot){this.attachShadow({mode:"open"});let C=cC(this.attributes);t&&(C.is=t),e&&(C.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(C)}this.nativeEl.muted=this.hasAttribute("muted");for(let C of A)Ke(this,g,E).call(this,C);this.shadowRoot.addEventListener("slotchange",this),Ke(this,m,p).call(this);for(let C of this.constructor.Events)(S=(R=this.shadowRoot).addEventListener)==null||S.call(R,C,this,!0)}handleEvent(R){if(R.type==="slotchange"){Ke(this,m,p).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,S,C){Ke(this,h,f).call(this),Ke(this,b,T).call(this,R,S,C)}connectedCallback(){Ke(this,h,f).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;ee(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...C){return Ke(this,h,f).call(this),this.call?this.call(S,...C):this.nativeEl[S].apply(this.nativeEl,C)};else{let C={get(){var P,k,M;Ke(this,h,f).call(this);let B=S.toLowerCase();if(R.has(B)){let F=this.getAttribute(B);return F===null?!1:F===""?!0:F}return(M=(P=this.get)==null?void 0:P.call(this,S))!=null?M:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(C.set=function(P){Ke(this,h,f).call(this);let k=S.toLowerCase();if(R.has(k)){P===!0||P===!1||P==null?this.toggleAttribute(k,!!P):this.setAttribute(k,P);return}if(this.set){this.set(S,P);return}this.nativeEl[S]=P}),Object.defineProperty(this.prototype,S,C)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakSet,f=function(){I(this,d)||(ee(this,d,!0),this.init())},m=new WeakSet,p=function(){let R=new Map(I(this,c));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(S=>["track","source"].includes(S.localName)).forEach(S=>{var C,P;R.delete(S);let k=I(this,c).get(S);k||(k=S.cloneNode(),I(this,c).set(S,k)),(P=(C=this.nativeEl).append)==null||P.call(C,k),k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")}),R.forEach(S=>S.remove())},g=new WeakSet,E=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let S=this[R];delete this[R],this[R]=S}},b=new WeakSet,T=function(R,S,C){var P,k,M,B,F,X;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(C===null?(k=(P=this.nativeEl).removeAttribute)==null||k.call(P,R):((B=(M=this.nativeEl).getAttribute)==null?void 0:B.call(M,R))!=C&&((X=(F=this.nativeEl).setAttribute)==null||X.call(F,R,C)))},z(n,o),De(n,"getTemplateHTML",e.endsWith("audio")?lC:dC),De(n,"shadowRootOptions",{mode:"open"}),De(n,"Events",hu),z(n,a,void 0),n};function uC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(...Object.getOwnPropertyNames(t));return e}function sT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var jy,np=rT((jy=globalThis.HTMLElement)!=null?jy:class{},{tag:"video"}),zy,d2=rT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"audio"}),Ts=new WeakMap,ap=class extends Error{},hC=class extends Error{},fC=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 mC(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 pC(){return globalThis.chrome}function gC(){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 _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Rp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function Ip(){var i;return(i=Rp())==null?void 0:i.getSessionObj().media[0]}function vC(i){return new Promise((e,t)=>{Ip().editTracksInfo(i,e,t)})}function EC(i){return new Promise((e,t)=>{Ip().getStatus(i,e,t)})}function nT(i){return _s().setOptions({...aT(),...i})}function aT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var Xd=new fC,xr=new WeakSet,ot;mC(()=>{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}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),Xd.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Xy=0,xe,Qd,Yt,Ar,Cn,Rn,ys,lp,Sr,os,dp,Qy,du,up,cp,oT,Zd,hp,fp,Zy,Jd,op,bC=class extends EventTarget{constructor(i){super(),z(this,Sr),z(this,dp),z(this,du),z(this,cp),z(this,Zd),z(this,fp),z(this,Jd),z(this,xe,void 0),z(this,Qd,void 0),z(this,Yt,void 0),z(this,Ar,void 0),z(this,Cn,"disconnected"),z(this,Rn,!1),z(this,ys,new Set),z(this,lp,new WeakMap),ee(this,xe,i),Xd.add(this),Ts.set(this,{init:()=>Ke(this,Zd,hp).call(this),onCastStateChanged:()=>Ke(this,du,up).call(this),onSessionStateChanged:()=>Ke(this,cp,oT).call(this),getCastPlayer:()=>I(this,Sr,os)}),Ke(this,Zd,hp).call(this)}get state(){return I(this,Cn)}async watchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");return I(this,lp).set(i,++Xy),I(this,ys).add(i),Xy}async cancelWatchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new hC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,xe));xr.add(I(this,xe)),nT(I(this,xe).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Yt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,xe));return}throw new Error(n)}(r=(t=Ts.get(I(this,xe)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};xe=new WeakMap,Qd=new WeakMap,Yt=new WeakMap,Ar=new WeakMap,Cn=new WeakMap,Rn=new WeakMap,ys=new WeakMap,lp=new WeakMap,Sr=new WeakSet,os=function(){if(xr.has(I(this,xe)))return I(this,Yt)},dp=new WeakSet,Qy=function(){xr.has(I(this,xe))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Yt).controller.removeEventListener(i,e)}),xr.delete(I(this,xe)),I(this,xe).muted=I(this,Yt).isMuted,I(this,xe).currentTime=I(this,Yt).savedPlayerState.currentTime,I(this,Yt).savedPlayerState.isPaused===!1&&I(this,xe).play())},du=new WeakSet,up=function(){let i=_s().getCastState();if(xr.has(I(this,xe))&&i==="CONNECTING"&&(ee(this,Cn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Rn)&&i!=null&&i.includes("CONNECT")){ee(this,Rn,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Rn)&&(!i||i==="NO_DEVICES_AVAILABLE")){ee(this,Rn,!1);for(let e of I(this,ys))e(!1)}},cp=new WeakSet,oT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,xe).castSrc===((i=Ip())==null?void 0:i.media.contentId)){xr.add(I(this,xe)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Yt).controller.addEventListener(t,r)});try{await EC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Zd=new WeakSet,hp=function(){!ot||I(this,Qd)||(ee(this,Qd,!0),nT(I(this,xe).castOptions),I(this,xe).textTracks.addEventListener("change",()=>Ke(this,Jd,op).call(this)),Ke(this,du,up).call(this),ee(this,Yt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,Yt)),ee(this,Ar,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(ee(this,Cn,"connected"),this.dispatchEvent(new Event("connect"))):(Ke(this,dp,Qy).call(this),ee(this,Cn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&I(this,xe).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,xe).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,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ke(this,fp,Zy).call(this))}}))},fp=new WeakSet,Zy=function(){Ke(this,Jd,op).call(this)},Jd=new WeakSet,op=async function(){var i,e,t,r,s;if(!I(this,Sr,os))return;let n=((e=(i=I(this,Yt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,xe).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=Rp())==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 vC(h)}catch(h){console.error(h)}};var yC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),z(this,o),z(this,d),z(this,r,{paused:!1}),z(this,s,aT()),z(this,n,void 0),z(this,a,void 0)}get remote(){return I(this,a)?I(this,a):pC()?(gC(),Ts.set(this,{loadOnPrompt:()=>Ke(this,d,u).call(this)}),ee(this,a,new bC(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=Rp())==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}ee(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=Ts.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=rp(t.prototype,this,"paused"),rp(t.prototype,this,"pause").call(this),this.muted=rp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},De(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},fu=class extends Event{constructor(i,e){super(i),De(this,"track"),this.track=e.track}},mp=new WeakMap;function Y(i){var e;return(e=mp.get(i))!=null?e:TC(i,{})}function TC(i,e){let t=mp.get(i);return t||mp.set(i,t={}),Object.assign(t,e)}function pp(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function _C(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,In,Ka,vp=class extends EventTarget{constructor(){super(),z(this,In),z(this,ls,void 0),z(this,ds,void 0),z(this,us,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,In,Ka).values()}get length(){return I(this,In,Ka).size}getTrackById(i){var e;return(e=[...I(this,In,Ka)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,In,Ka)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),ee(this,ls,void 0)),typeof i=="function"&&(ee(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),ee(this,ds,void 0)),typeof i=="function"&&(ee(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),ee(this,us,void 0)),typeof i=="function"&&(ee(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,In=new WeakSet,Ka=function(){return Y(this).trackSet};var mu=class extends Event{constructor(i,e){super(i),De(this,"rendition"),this.rendition=e.rendition}};function AC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in Ep.prototype||Object.defineProperty(Ep.prototype,s,{get(){return Ln(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function SC(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function xC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ln(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,Ep=class extends EventTarget{constructor(){super(...arguments),z(this,cs,void 0),z(this,hs,void 0),z(this,fs,void 0)}[Symbol.iterator](){return Ln(this).values()}get length(){return Ln(this).length}getRenditionById(i){var e;return(e=Ln(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Ln(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Ln(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),ee(this,cs,void 0)),typeof i=="function"&&(ee(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),ee(this,hs,void 0)),typeof i=="function"&&(ee(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),ee(this,fs,void 0)),typeof i=="function"&&(ee(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,RC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"width"),De(this,"height"),De(this,"bitrate"),De(this,"frameRate"),De(this,"codec"),z(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(ee(this,Wa,i),xC(this))}};Wa=new WeakMap;var Va,lT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,Va,!1)}addRendition(i,e,t,r,s,n){let a=new RC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,AC(this,a),a}removeRendition(i){SC(i)}get selected(){return I(this,Va)}set selected(i){I(this,Va)!==i&&(ee(this,Va,i),i===!0&&_C(this))}};Va=new WeakMap;function IC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in bp.prototype||Object.defineProperty(bp.prototype,s,{get(){return kn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function LC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function kC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function kn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,bp=class extends EventTarget{constructor(){super(...arguments),z(this,ms,void 0),z(this,ps,void 0),z(this,gs,void 0)}[Symbol.iterator](){return kn(this).values()}get length(){return kn(this).length}getRenditionById(i){var e;return(e=kn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return kn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of kn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),ee(this,ms,void 0)),typeof i=="function"&&(ee(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),ee(this,ps,void 0)),typeof i=="function"&&(ee(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),ee(this,gs,void 0)),typeof i=="function"&&(ee(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var Ya,CC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"bitrate"),De(this,"codec"),z(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(ee(this,Ya,i),kC(this))}};Ya=new WeakMap;function yp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in _p.prototype||Object.defineProperty(_p.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function Tp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function wC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,qa,eu,_p=class extends EventTarget{constructor(){super(),z(this,qa),z(this,vs,void 0),z(this,Es,void 0),z(this,bs,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,qa,eu).values()}get length(){return I(this,qa,eu).size}getTrackById(i){var e;return(e=[...I(this,qa,eu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),ee(this,vs,void 0)),typeof i=="function"&&(ee(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),ee(this,Es,void 0)),typeof i=="function"&&(ee(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),ee(this,bs,void 0)),typeof i=="function"&&(ee(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,qa=new WeakSet,eu=function(){return Y(this).trackSet};var ja,dT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,ja,!1)}addRendition(i,e,t){let r=new CC;return r.src=i,r.codec=e,r.bitrate=t,IC(this,r),r}removeRendition(i){LC(i)}get enabled(){return I(this,ja)}set enabled(i){I(this,ja)!==i&&(ee(this,ja,i),wC(this))}};ja=new WeakMap;var Jy=uu(globalThis.HTMLMediaElement,"video"),eT=uu(globalThis.HTMLMediaElement,"audio");function DC(i){if(!(i!=null&&i.prototype))return i;let e=uu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return MC(this)}});let t=uu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return PC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new lT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=gp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new dT;return l.kind=n,l.label=a,l.language=o,yp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Tp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new Ep,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new bp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function uu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function MC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new vp,Y(i).videoTracks=t,Jy)){let r=Jy.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof lT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}function PC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new _p,Y(i).audioTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)yp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof dT)){for(let n of r)Tp(n);return}yp(i,s.track)}),r.addEventListener("removetrack",s=>{Tp(s.track)})}return t}hu.push("castchange","entercast","leavecast");var D={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",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"},OC=Object.values(D),NC=oC(),UC="mux-video",wi,za,tu,Xa,iu,ru,su,nu,au,Qa,ou,FC=class extends np{constructor(){super(),z(this,Qa),z(this,wi,void 0),z(this,za,void 0),z(this,tu,void 0),z(this,Xa,{}),z(this,iu,{}),z(this,ru,void 0),z(this,su,void 0),z(this,nu,void 0),z(this,au,void 0),ee(this,tu,Uy())}static get observedAttributes(){var i;return[...OC,...(i=np.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(D.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?xn.includes(i)?this.setAttribute(D.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${xn.join()}`):this.removeAttribute(D.PREFER_CMCD))}get playerInitTime(){return I(this,tu)}get playerSoftwareName(){var i;return(i=I(this,nu))!=null?i:UC}set playerSoftwareName(i){ee(this,nu,i)}get playerSoftwareVersion(){var i;return(i=I(this,su))!=null?i:NC}set playerSoftwareVersion(i){ee(this,su,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=Jm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,au)}set errorTranslator(i){ee(this,au,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(D.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(D.TYPE,i):this.removeAttribute(D.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(D.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(D.DEBUG,""):this.removeAttribute(D.DEBUG))}get disableTracking(){return this.hasAttribute(D.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(D.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(D.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(D.DISABLE_COOKIES,""):this.removeAttribute(D.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(D.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(D.START_TIME):this.setAttribute(D.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(D.PLAYBACK_ID)?this.getAttribute(D.PLAYBACK_ID):(i=Zm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(D.PLAYBACK_ID,i):this.removeAttribute(D.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(D.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(D.MAX_RESOLUTION,i):this.removeAttribute(D.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(D.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(D.MIN_RESOLUTION,i):this.removeAttribute(D.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(D.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(D.RENDITION_ORDER,i):this.removeAttribute(D.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(D.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(D.PROGRAM_START_TIME):this.setAttribute(D.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(D.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(D.PROGRAM_END_TIME):this.setAttribute(D.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(D.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(D.ASSET_START_TIME):this.setAttribute(D.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(D.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(D.ASSET_END_TIME):this.setAttribute(D.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(D.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(D.CUSTOM_DOMAIN,i):this.removeAttribute(D.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(D.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(D.DRM_TOKEN,i):this.removeAttribute(D.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(D.PLAYBACK_TOKEN))return(i=this.getAttribute(D.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(D.PLAYBACK_ID)){let[,s]=Wd((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(D.PLAYBACK_TOKEN,i):this.removeAttribute(D.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(D.PLAYBACK_TOKEN),e=this.getAttribute(D.DRM_TOKEN);return{...I(this,iu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){ee(this,iu,i!=null?i:{})}get ended(){return tp(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(D.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(D.ENV_KEY,i):this.removeAttribute(D.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(D.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(D.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(D.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(D.STREAM_TYPE))!=null?i:Kd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(D.STREAM_TYPE,i):this.removeAttribute(D.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(D.TARGET_LIVE_WINDOW)?+this.getAttribute(D.TARGET_LIVE_WINDOW):Fy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.TARGET_LIVE_WINDOW):this.setAttribute(D.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(D.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 By(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(D.LIVE_EDGE_OFFSET))return+this.getAttribute(D.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.LIVE_EDGE_OFFSET):this.setAttribute(D.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return jd(this.nativeEl)}async addCuePoints(i){return qm(this.nativeEl,i)}get activeCuePoint(){return jm(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return Xm(this.nativeEl,i)}get activeChapter(){return Qm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(D.PREFER_PLAYBACK);if(i===Vt.MSE||i===Vt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Vt.MSE||i===Vt.NATIVE?this.setAttribute(D.PREFER_PLAYBACK,i):this.removeAttribute(D.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![D.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,Xa)}}set metadata(i){ee(this,Xa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Xa))}get _hlsConfig(){return I(this,ru)}set _hlsConfig(i){ee(this,ru,i)}load(){ee(this,wi,Gy(this,this.nativeEl,I(this,wi)))}unload(){ip(this.nativeEl,I(this,wi)),ee(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(np.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case D.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case D.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ke(this,Qa,ou).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ke(this,Qa,ou).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 D.PLAYBACK_ID:this.src=Ga(this);break;case D.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 D.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 D.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case D.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)&&Ke(this,Qa,ou).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,za=new WeakMap,tu=new WeakMap,Xa=new WeakMap,iu=new WeakMap,ru=new WeakMap,su=new WeakMap,nu=new WeakMap,au=new WeakMap,Qa=new WeakSet,ou=async function(){I(this,za)||(await ee(this,za,Promise.resolve()),ee(this,za,null),this.load())};var lu,Ap=class extends yC(DC(FC)){constructor(){super(...arguments),z(this,lu,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,lu))!=null?i:this.muxCastCustomData}set castCustomData(i){ee(this,lu,i)}};lu=new WeakMap;sp.customElements.get("mux-video")||(sp.customElements.define("mux-video",Ap),sp.MuxVideoElement=Ap);var uT=Ap;function cT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${pu(t)}: ${r}; `)}),e?e.trim():void 0}function pu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function gu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Mt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=BC(i).toString();return e?"?"+e:""}function BC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var kp=(i,e)=>!i||!e?!1:i.contains(e)?!0:kp(i,e.getRootNode().host);var hT="mux.com",$C=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},HC=$C(),Eu=()=>HC,fT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,time:n,program_time:s})}`},mT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Za=i=>{if(i){if([Ae.LIVE,Ae.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Ae.LIVE}};var GC={crossorigin:"crossOrigin",playsinline:"playsInline"};function pT(i){var e;return(e=GC[i])!=null?e:gu(i)}var As,Ss,xt,vu=class{constructor(e,t){Xe(this,As,void 0);Xe(this,Ss,void 0);Xe(this,xt,[]);Ht(this,As,e),Ht(this,Ss,t)}[Symbol.iterator](){return me(this,xt).values()}get length(){return me(this,xt).length}get value(){var e;return(e=me(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ht(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return me(this,xt)[e]}values(){return me(this,xt).values()}keys(){return me(this,xt).keys()}forEach(e){me(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||me(this,xt).push(s)}),!(this.value===""&&!((t=me(this,As))!=null&&t.hasAttribute(`${me(this,Ss)}`)))&&((r=me(this,As))==null||r.setAttribute(`${me(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{me(this,xt).splice(me(this,xt).indexOf(r),1)}),(t=me(this,As))==null||t.setAttribute(`${me(this,Ss)}`,`${this.value}`)}contains(e){return me(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)}};As=new WeakMap,Ss=new WeakMap,xt=new WeakMap;var gT=`[mux-player ${Eu()}]`;function Di(...i){console.warn(gT,...i)}function Pt(...i){console.error(gT,...i)}function Cp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
1289
1289
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Di(e)}var _t={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},xs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ET=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}}),KC=hu.filter(i=>i!=="error"),WC=Object.values(_t).filter(i=>![_t.PLAYSINLINE].includes(i)),VC=Object.values(xs),wn,wp=class extends Ve.HTMLElement{constructor(){super();Xe(this,wn,new WeakMap);let t=s=>{for(let n of s)n.type==="childList"&&(n.removedNodes.forEach(a=>{var o;(o=me(this,wn).get(a))==null||o.remove()}),n.addedNodes.forEach(a=>{var l;let o=a;o!=null&&o.slot||(l=this.media)==null||l.append(bT(me(this,wn),a))}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...WC,...VC]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(t=>{var r;(r=this.media)==null||r.append(bT(me(this,wn),t))}),KC.forEach(t=>{var r;(r=this.media)==null||r.addEventListener(t,s=>{this.dispatchEvent(new Event(s.type))})})}attributeChangedCallback(t,r,s){var n,a;switch(t){case xs.MUTED:{this.media&&(this.media.muted=s!=null,this.media.defaultMuted=s!=null);return}case xs.VOLUME:{let o=(n=Mt(s))!=null?n:1;this.media&&(this.media.volume=o);return}case xs.PLAYBACKRATE:{let o=(a=Mt(s))!=null?a:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var t,r;return(r=(t=this.media)==null?void 0:t.play())!=null?r:Promise.reject()}pause(){var t;(t=this.media)==null||t.pause()}load(){var t;(t=this.media)==null||t.load()}requestCast(t){var r;return(r=this.media)==null?void 0:r.requestCast(t)}get media(){var t;return(t=this.shadowRoot)==null?void 0:t.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 t,r;return(r=(t=this.media)==null?void 0:t.paused)!=null?r:!0}get duration(){var t,r;return(r=(t=this.media)==null?void 0:t.duration)!=null?r:NaN}get ended(){var t,r;return(r=(t=this.media)==null?void 0:t.ended)!=null?r:!1}get buffered(){var t,r;return(r=(t=this.media)==null?void 0:t.buffered)!=null?r:ET}get seekable(){var t,r;return(r=(t=this.media)==null?void 0:t.seekable)!=null?r:ET}get readyState(){var t,r;return(r=(t=this.media)==null?void 0:t.readyState)!=null?r:0}get videoWidth(){var t,r;return(r=(t=this.media)==null?void 0:t.videoWidth)!=null?r:0}get videoHeight(){var t,r;return(r=(t=this.media)==null?void 0:t.videoHeight)!=null?r:0}get currentSrc(){var t,r;return(r=(t=this.media)==null?void 0:t.currentSrc)!=null?r:""}get currentTime(){var t,r;return(r=(t=this.media)==null?void 0:t.currentTime)!=null?r:0}set currentTime(t){this.media&&(this.media.currentTime=Number(t))}get volume(){var t,r;return(r=(t=this.media)==null?void 0:t.volume)!=null?r:1}set volume(t){this.media&&(this.media.volume=Number(t))}get playbackRate(){var t,r;return(r=(t=this.media)==null?void 0:t.playbackRate)!=null?r:1}set playbackRate(t){this.media&&(this.media.playbackRate=Number(t))}get defaultPlaybackRate(){var t;return(t=Mt(this.getAttribute(xs.PLAYBACKRATE)))!=null?t:1}set defaultPlaybackRate(t){t!=null?this.setAttribute(xs.PLAYBACKRATE,`${t}`):this.removeAttribute(xs.PLAYBACKRATE)}get crossOrigin(){return Ja(this,_t.CROSSORIGIN)}set crossOrigin(t){this.setAttribute(_t.CROSSORIGIN,`${t}`)}get autoplay(){return Ja(this,_t.AUTOPLAY)!=null}set autoplay(t){t?this.setAttribute(_t.AUTOPLAY,typeof t=="string"?t:""):this.removeAttribute(_t.AUTOPLAY)}get loop(){return Ja(this,_t.LOOP)!=null}set loop(t){t?this.setAttribute(_t.LOOP,""):this.removeAttribute(_t.LOOP)}get muted(){var t,r;return(r=(t=this.media)==null?void 0:t.muted)!=null?r:!1}set muted(t){this.media&&(this.media.muted=!!t)}get defaultMuted(){return Ja(this,_t.MUTED)!=null}set defaultMuted(t){t?this.setAttribute(_t.MUTED,""):this.removeAttribute(_t.MUTED)}get playsInline(){return Ja(this,_t.PLAYSINLINE)!=null}set playsInline(t){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(t){["","none","metadata","auto"].includes(t)?this.setAttribute(_t.PRELOAD,t):this.removeAttribute(_t.PRELOAD)}};wn=new WeakMap;function Ja(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}function bT(i,e){let t=i.get(e);return t||(t=e.cloneNode(),i.set(e,t)),t}var Dp=wp;var ST=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(ST(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)},Zi=(i,e,t,r)=>(ST(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Dn,bu,Rs,eo,Rr,Ir,Lr,Is,Mn,yu,oi,yT=1,TT=0,YC=1,qC={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}}}},Ji=class extends x.DocumentFragment{constructor(e,t,r=qC){var s;super(),Mi(this,Dn,void 0),Mi(this,bu,void 0),this.append(e.content.cloneNode(!0)),Zi(this,Dn,xT(this)),Zi(this,bu,r),(s=r.createCallback)==null||s.call(r,this,de(this,Dn),t),r.processCallback(this,de(this,Dn),t)}update(e){de(this,bu).processCallback(this,de(this,Dn),e)}};Dn=new WeakMap;bu=new WeakMap;var xT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Mp;for([t,r]of AT(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===yT&&!(s instanceof HTMLTemplateElement))xT(s,e);else{let n=s.data;if(s.nodeType===yT||n.includes("{{")){let a=[];if(n)for([t,r]of AT(n))if(!t)a.push(new Text(r));else{let o=new er(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new to(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},_T={},AT=i=>{let e="",t=0,r=_T[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([TT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([YC,e.trim()]),e="",s++):e+=n||"";return e&&r.push([TT,(t>0?"{{":"")+e]),_T[i]=r},jC=11,Tu=class{get value(){return""}set value(e){}toString(){return this.value}},RT=new WeakMap,Mp=class{constructor(){Mi(this,Rs,[])}[Symbol.iterator](){return de(this,Rs).values()}get length(){return de(this,Rs).length}item(e){return de(this,Rs)[e]}append(...e){for(let t of e)t instanceof Rt&&RT.set(t,this),de(this,Rs).push(t)}toString(){return de(this,Rs).join("")}};Rs=new WeakMap;var Rt=class extends Tu{constructor(e,t,r){super(),Mi(this,Is),Mi(this,eo,""),Mi(this,Rr,void 0),Mi(this,Ir,void 0),Mi(this,Lr,void 0),Zi(this,Rr,e),Zi(this,Ir,t),Zi(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,eo)}set value(e){de(this,eo)!==e&&(Zi(this,eo,e),!de(this,Is,Mn)||de(this,Is,Mn).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,Is,Mn).toString()))}get booleanValue(){return de(this,Rr).hasAttributeNS(de(this,Lr),de(this,Ir))}set booleanValue(e){if(!de(this,Is,Mn)||de(this,Is,Mn).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};eo=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Lr=new WeakMap;Is=new WeakSet;Mn=function(){return RT.get(this)};var er=class extends Tu{constructor(e,t){super(),Mi(this,yu,void 0),Mi(this,oi,void 0),Zi(this,yu,e),Zi(this,oi,t?[...t]:[new Text])}get replacementNodes(){return de(this,oi)}get parentNode(){return de(this,yu)}get nextSibling(){return de(this,oi)[de(this,oi).length-1].nextSibling}get previousSibling(){return de(this,oi)[0].previousSibling}get value(){return de(this,oi).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===jC?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),Zi(this,oi,zC(de(this,oi)[0].parentNode,de(this,oi),t,this.nextSibling))}};yu=new WeakMap;oi=new WeakMap;var to=class extends er{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 zC(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 IT={string:i=>String(i)},Au=class{constructor(e){this.template=e,this.state=void 0}},Ls=new WeakMap,ks=new WeakMap,Pp={partial:(i,e)=>{e[i.expression]=new Au(i.template)},if:(i,e)=>{var t;if(kT(i.expression,e))if(Ls.get(i)!==i.template){Ls.set(i,i.template);let r=new Ji(i.template,e,Su);i.replace(r),ks.set(i,r)}else(t=ks.get(i))==null||t.update(e);else i.replace(""),Ls.delete(i),ks.delete(i)}},XC=Object.keys(Pp),Su={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof to){if(!a.directive){let l=XC.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=Pp[a.directive])==null||r.call(Pp,a,t);continue}let o=kT(n,t);if(o instanceof Au){Ls.get(a)!==o.template?(Ls.set(a,o.template),o=new Ji(o.template,o.state,Su),a.value=o,ks.set(a,o)):(s=ks.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,Ls.delete(a),ks.delete(a))):a instanceof Rt?a.value=void 0:(a.value=void 0,Ls.delete(a),ks.delete(a))}}},LT={"!":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=IT[e])==null?void 0:t.call(IT,i)}};function QC(i){return ZC(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function kT(i,e={}){var t,r,s,n,a,o,l;let d=QC(i);if(d.length===0||d.some(({type:u})=>!u))return io(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return io(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]=ro(g,e))}return u}if(d.length===1)return _u(d[0])?ro(d[0].token,e):io(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=LT[u];if(!c||!_u(d[1]))return io(i);let h=ro(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=LT[u];if(!c||!_u(d[0])||!_u(d[2]))return io(i);let h=ro(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=ro(d[2].token,e);return c(h,f)}}function io(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function _u({type:i}){return["number","boolean","string","param"].includes(i)}function ro(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):wo(i)?parseFloat(i):e[i]}function ZC(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 $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Up=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),so=(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)},Cs=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Op=(i,e,t)=>($p(i,e,"access private method"),t),Pn,xu,On,Fp,CT,Ru,Bp,Np={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},wT=N.createElement("template");wT.innerHTML=`
1290
1290
  <style>
1291
1291
  :host {
@@ -1243,7 +1243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1243
1243
  `:""}${i.error?`error: ${i.error}
1244
1244
  `:""}${i.event?`event: ${i.event}
1245
1245
  `:""}${i.err?`error message: ${(s=i.err)==null?void 0:s.message}
1246
- `:""}`),l.data=i,l};var Qk=Object.defineProperty,Zk=Object.getPrototypeOf,Jk=Reflect.get,eC=(i,e,t)=>e in i?Qk(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,De=(i,e,t)=>(eC(i,typeof e!="symbol"?e+"":e,t),t),Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Sp(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(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)},ee=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ke=(i,e,t)=>(Sp(i,e,"access private method"),t),rp=(i,e,t)=>Jk(Zk(i),t,e),cu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends cu{}globalThis.DocumentFragment=i}var xp=class extends cu{},tC=class extends cu{},iC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(xp)}},zd,rC=class{constructor(i,e={}){z(this,zd,void 0),ee(this,zd,e==null?void 0:e.detail)}get detail(){return I(this,zd)}initCustomEvent(){}};zd=new WeakMap;function sC(i,e){return new xp}var tT={document:{createElement:sC},DocumentFragment,customElements:iC,CustomEvent:rC,EventTarget:cu,HTMLElement:xp,HTMLVideoElement:tC},iT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",sp=iT?tT:globalThis,o2=iT?tT.document:globalThis.document,nC=()=>{try{return"0.21.0"}catch{}return"UNKNOWN"},aC=nC(),oC=()=>aC,hu=["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 lC(i){return`
1246
+ `:""}`),l.data=i,l};var Qk=Object.defineProperty,Zk=Object.getPrototypeOf,Jk=Reflect.get,eC=(i,e,t)=>e in i?Qk(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,De=(i,e,t)=>(eC(i,typeof e!="symbol"?e+"":e,t),t),Sp=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},I=(i,e,t)=>(Sp(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(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)},ee=(i,e,t,r)=>(Sp(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Ke=(i,e,t)=>(Sp(i,e,"access private method"),t),rp=(i,e,t)=>Jk(Zk(i),t,e),cu=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends cu{}globalThis.DocumentFragment=i}var xp=class extends cu{},tC=class extends cu{},iC={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(xp)}},zd,rC=class{constructor(i,e={}){z(this,zd,void 0),ee(this,zd,e==null?void 0:e.detail)}get detail(){return I(this,zd)}initCustomEvent(){}};zd=new WeakMap;function sC(i,e){return new xp}var tT={document:{createElement:sC},DocumentFragment,customElements:iC,CustomEvent:rC,EventTarget:cu,HTMLElement:xp,HTMLVideoElement:tC},iT=typeof window=="undefined"||typeof globalThis.customElements=="undefined",sp=iT?tT:globalThis,o2=iT?tT.document:globalThis.document,nC=()=>{try{return"0.22.0"}catch{}return"UNKNOWN"},aC=nC(),oC=()=>aC,hu=["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 lC(i){return`
1247
1247
  <style>
1248
1248
  :host {
1249
1249
  display: inline-flex;
@@ -1285,7 +1285,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1285
1285
  <video${sT(i)}></video>
1286
1286
  </slot>
1287
1287
  <slot></slot>
1288
- `}var rT=(i,{tag:e,is:t})=>{var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?uC(_):[];return n=class extends i{constructor(){super(),z(this,h),z(this,m),z(this,g),z(this,b),z(this,d,void 0),z(this,u,void 0),z(this,c,new Map)}static get observedAttributes(){var R,S,C;return Ke(R=n,o,l).call(R),[...(C=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?C:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,S,C;return Ke(this,h,f).call(this),(C=(S=(R=I(this,u))!=null?R:this.shadowRoot.querySelector(e))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e)}set nativeEl(R){ee(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,S;return(S=this.getAttribute("preload"))!=null?S:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R,S;if(!this.shadowRoot){this.attachShadow({mode:"open"});let C=cC(this.attributes);t&&(C.is=t),e&&(C.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(C)}this.nativeEl.muted=this.hasAttribute("muted");for(let C of A)Ke(this,g,E).call(this,C);this.shadowRoot.addEventListener("slotchange",this),Ke(this,m,p).call(this);for(let C of this.constructor.Events)(S=(R=this.shadowRoot).addEventListener)==null||S.call(R,C,this,!0)}handleEvent(R){if(R.type==="slotchange"){Ke(this,m,p).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,S,C){Ke(this,h,f).call(this),Ke(this,b,T).call(this,R,S,C)}connectedCallback(){Ke(this,h,f).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;ee(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...C){return Ke(this,h,f).call(this),this.call?this.call(S,...C):this.nativeEl[S].apply(this.nativeEl,C)};else{let C={get(){var P,k,M;Ke(this,h,f).call(this);let B=S.toLowerCase();if(R.has(B)){let F=this.getAttribute(B);return F===null?!1:F===""?!0:F}return(M=(P=this.get)==null?void 0:P.call(this,S))!=null?M:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(C.set=function(P){Ke(this,h,f).call(this);let k=S.toLowerCase();if(R.has(k)){P===!0||P===!1||P==null?this.toggleAttribute(k,!!P):this.setAttribute(k,P);return}if(this.set){this.set(S,P);return}this.nativeEl[S]=P}),Object.defineProperty(this.prototype,S,C)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakSet,f=function(){I(this,d)||(ee(this,d,!0),this.init())},m=new WeakSet,p=function(){let R=new Map(I(this,c));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(S=>["track","source"].includes(S.localName)).forEach(S=>{var C,P;R.delete(S);let k=I(this,c).get(S);k||(k=S.cloneNode(),I(this,c).set(S,k)),(P=(C=this.nativeEl).append)==null||P.call(C,k),k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")}),R.forEach(S=>S.remove())},g=new WeakSet,E=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let S=this[R];delete this[R],this[R]=S}},b=new WeakSet,T=function(R,S,C){var P,k,M,B,F,X;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(C===null?(k=(P=this.nativeEl).removeAttribute)==null||k.call(P,R):((B=(M=this.nativeEl).getAttribute)==null?void 0:B.call(M,R))!=C&&((X=(F=this.nativeEl).setAttribute)==null||X.call(F,R,C)))},z(n,o),De(n,"getTemplateHTML",e.endsWith("audio")?lC:dC),De(n,"shadowRootOptions",{mode:"open"}),De(n,"Events",hu),z(n,a,void 0),n};function uC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(...Object.getOwnPropertyNames(t));return e}function sT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var jy,np=rT((jy=globalThis.HTMLElement)!=null?jy:class{},{tag:"video"}),zy,d2=rT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"audio"}),Ts=new WeakMap,ap=class extends Error{},hC=class extends Error{},fC=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 mC(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 pC(){return globalThis.chrome}function gC(){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 _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Rp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function Ip(){var i;return(i=Rp())==null?void 0:i.getSessionObj().media[0]}function vC(i){return new Promise((e,t)=>{Ip().editTracksInfo(i,e,t)})}function EC(i){return new Promise((e,t)=>{Ip().getStatus(i,e,t)})}function nT(i){return _s().setOptions({...aT(),...i})}function aT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var Xd=new fC,xr=new WeakSet,ot;mC(()=>{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}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),Xd.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Xy=0,xe,Qd,Yt,Ar,Cn,Rn,ys,lp,Sr,os,dp,Qy,du,up,cp,oT,Zd,hp,fp,Zy,Jd,op,bC=class extends EventTarget{constructor(i){super(),z(this,Sr),z(this,dp),z(this,du),z(this,cp),z(this,Zd),z(this,fp),z(this,Jd),z(this,xe,void 0),z(this,Qd,void 0),z(this,Yt,void 0),z(this,Ar,void 0),z(this,Cn,"disconnected"),z(this,Rn,!1),z(this,ys,new Set),z(this,lp,new WeakMap),ee(this,xe,i),Xd.add(this),Ts.set(this,{init:()=>Ke(this,Zd,hp).call(this),onCastStateChanged:()=>Ke(this,du,up).call(this),onSessionStateChanged:()=>Ke(this,cp,oT).call(this),getCastPlayer:()=>I(this,Sr,os)}),Ke(this,Zd,hp).call(this)}get state(){return I(this,Cn)}async watchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");return I(this,lp).set(i,++Xy),I(this,ys).add(i),Xy}async cancelWatchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new hC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,xe));xr.add(I(this,xe)),nT(I(this,xe).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Yt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,xe));return}throw new Error(n)}(r=(t=Ts.get(I(this,xe)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};xe=new WeakMap,Qd=new WeakMap,Yt=new WeakMap,Ar=new WeakMap,Cn=new WeakMap,Rn=new WeakMap,ys=new WeakMap,lp=new WeakMap,Sr=new WeakSet,os=function(){if(xr.has(I(this,xe)))return I(this,Yt)},dp=new WeakSet,Qy=function(){xr.has(I(this,xe))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Yt).controller.removeEventListener(i,e)}),xr.delete(I(this,xe)),I(this,xe).muted=I(this,Yt).isMuted,I(this,xe).currentTime=I(this,Yt).savedPlayerState.currentTime,I(this,Yt).savedPlayerState.isPaused===!1&&I(this,xe).play())},du=new WeakSet,up=function(){let i=_s().getCastState();if(xr.has(I(this,xe))&&i==="CONNECTING"&&(ee(this,Cn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Rn)&&i!=null&&i.includes("CONNECT")){ee(this,Rn,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Rn)&&(!i||i==="NO_DEVICES_AVAILABLE")){ee(this,Rn,!1);for(let e of I(this,ys))e(!1)}},cp=new WeakSet,oT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,xe).castSrc===((i=Ip())==null?void 0:i.media.contentId)){xr.add(I(this,xe)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Yt).controller.addEventListener(t,r)});try{await EC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Zd=new WeakSet,hp=function(){!ot||I(this,Qd)||(ee(this,Qd,!0),nT(I(this,xe).castOptions),I(this,xe).textTracks.addEventListener("change",()=>Ke(this,Jd,op).call(this)),Ke(this,du,up).call(this),ee(this,Yt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,Yt)),ee(this,Ar,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(ee(this,Cn,"connected"),this.dispatchEvent(new Event("connect"))):(Ke(this,dp,Qy).call(this),ee(this,Cn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&I(this,xe).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,xe).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,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ke(this,fp,Zy).call(this))}}))},fp=new WeakSet,Zy=function(){Ke(this,Jd,op).call(this)},Jd=new WeakSet,op=async function(){var i,e,t,r,s;if(!I(this,Sr,os))return;let n=((e=(i=I(this,Yt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,xe).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=Rp())==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 vC(h)}catch(h){console.error(h)}};var yC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),z(this,o),z(this,d),z(this,r,{paused:!1}),z(this,s,aT()),z(this,n,void 0),z(this,a,void 0)}get remote(){return I(this,a)?I(this,a):pC()?(gC(),Ts.set(this,{loadOnPrompt:()=>Ke(this,d,u).call(this)}),ee(this,a,new bC(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=Rp())==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}ee(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=Ts.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=rp(t.prototype,this,"paused"),rp(t.prototype,this,"pause").call(this),this.muted=rp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},De(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},fu=class extends Event{constructor(i,e){super(i),De(this,"track"),this.track=e.track}},mp=new WeakMap;function Y(i){var e;return(e=mp.get(i))!=null?e:TC(i,{})}function TC(i,e){let t=mp.get(i);return t||mp.set(i,t={}),Object.assign(t,e)}function pp(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function _C(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,In,Ka,vp=class extends EventTarget{constructor(){super(),z(this,In),z(this,ls,void 0),z(this,ds,void 0),z(this,us,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,In,Ka).values()}get length(){return I(this,In,Ka).size}getTrackById(i){var e;return(e=[...I(this,In,Ka)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,In,Ka)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),ee(this,ls,void 0)),typeof i=="function"&&(ee(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),ee(this,ds,void 0)),typeof i=="function"&&(ee(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),ee(this,us,void 0)),typeof i=="function"&&(ee(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,In=new WeakSet,Ka=function(){return Y(this).trackSet};var mu=class extends Event{constructor(i,e){super(i),De(this,"rendition"),this.rendition=e.rendition}};function AC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in Ep.prototype||Object.defineProperty(Ep.prototype,s,{get(){return Ln(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function SC(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function xC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ln(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,Ep=class extends EventTarget{constructor(){super(...arguments),z(this,cs,void 0),z(this,hs,void 0),z(this,fs,void 0)}[Symbol.iterator](){return Ln(this).values()}get length(){return Ln(this).length}getRenditionById(i){var e;return(e=Ln(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Ln(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Ln(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),ee(this,cs,void 0)),typeof i=="function"&&(ee(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),ee(this,hs,void 0)),typeof i=="function"&&(ee(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),ee(this,fs,void 0)),typeof i=="function"&&(ee(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,RC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"width"),De(this,"height"),De(this,"bitrate"),De(this,"frameRate"),De(this,"codec"),z(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(ee(this,Wa,i),xC(this))}};Wa=new WeakMap;var Va,lT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,Va,!1)}addRendition(i,e,t,r,s,n){let a=new RC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,AC(this,a),a}removeRendition(i){SC(i)}get selected(){return I(this,Va)}set selected(i){I(this,Va)!==i&&(ee(this,Va,i),i===!0&&_C(this))}};Va=new WeakMap;function IC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in bp.prototype||Object.defineProperty(bp.prototype,s,{get(){return kn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function LC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function kC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function kn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,bp=class extends EventTarget{constructor(){super(...arguments),z(this,ms,void 0),z(this,ps,void 0),z(this,gs,void 0)}[Symbol.iterator](){return kn(this).values()}get length(){return kn(this).length}getRenditionById(i){var e;return(e=kn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return kn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of kn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),ee(this,ms,void 0)),typeof i=="function"&&(ee(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),ee(this,ps,void 0)),typeof i=="function"&&(ee(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),ee(this,gs,void 0)),typeof i=="function"&&(ee(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var Ya,CC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"bitrate"),De(this,"codec"),z(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(ee(this,Ya,i),kC(this))}};Ya=new WeakMap;function yp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in _p.prototype||Object.defineProperty(_p.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function Tp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function wC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,qa,eu,_p=class extends EventTarget{constructor(){super(),z(this,qa),z(this,vs,void 0),z(this,Es,void 0),z(this,bs,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,qa,eu).values()}get length(){return I(this,qa,eu).size}getTrackById(i){var e;return(e=[...I(this,qa,eu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),ee(this,vs,void 0)),typeof i=="function"&&(ee(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),ee(this,Es,void 0)),typeof i=="function"&&(ee(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),ee(this,bs,void 0)),typeof i=="function"&&(ee(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,qa=new WeakSet,eu=function(){return Y(this).trackSet};var ja,dT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,ja,!1)}addRendition(i,e,t){let r=new CC;return r.src=i,r.codec=e,r.bitrate=t,IC(this,r),r}removeRendition(i){LC(i)}get enabled(){return I(this,ja)}set enabled(i){I(this,ja)!==i&&(ee(this,ja,i),wC(this))}};ja=new WeakMap;var Jy=uu(globalThis.HTMLMediaElement,"video"),eT=uu(globalThis.HTMLMediaElement,"audio");function DC(i){if(!(i!=null&&i.prototype))return i;let e=uu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return MC(this)}});let t=uu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return PC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new lT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=gp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new dT;return l.kind=n,l.label=a,l.language=o,yp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Tp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new Ep,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new bp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function uu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function MC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new vp,Y(i).videoTracks=t,Jy)){let r=Jy.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof lT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}function PC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new _p,Y(i).audioTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)yp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof dT)){for(let n of r)Tp(n);return}yp(i,s.track)}),r.addEventListener("removetrack",s=>{Tp(s.track)})}return t}hu.push("castchange","entercast","leavecast");var D={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",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"},OC=Object.values(D),NC=oC(),UC="mux-video",wi,za,tu,Xa,iu,ru,su,nu,au,Qa,ou,FC=class extends np{constructor(){super(),z(this,Qa),z(this,wi,void 0),z(this,za,void 0),z(this,tu,void 0),z(this,Xa,{}),z(this,iu,{}),z(this,ru,void 0),z(this,su,void 0),z(this,nu,void 0),z(this,au,void 0),ee(this,tu,Uy())}static get observedAttributes(){var i;return[...OC,...(i=np.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(D.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?xn.includes(i)?this.setAttribute(D.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${xn.join()}`):this.removeAttribute(D.PREFER_CMCD))}get playerInitTime(){return I(this,tu)}get playerSoftwareName(){var i;return(i=I(this,nu))!=null?i:UC}set playerSoftwareName(i){ee(this,nu,i)}get playerSoftwareVersion(){var i;return(i=I(this,su))!=null?i:NC}set playerSoftwareVersion(i){ee(this,su,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=Jm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,au)}set errorTranslator(i){ee(this,au,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(D.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(D.TYPE,i):this.removeAttribute(D.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(D.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(D.DEBUG,""):this.removeAttribute(D.DEBUG))}get disableTracking(){return this.hasAttribute(D.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(D.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(D.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(D.DISABLE_COOKIES,""):this.removeAttribute(D.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(D.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(D.START_TIME):this.setAttribute(D.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(D.PLAYBACK_ID)?this.getAttribute(D.PLAYBACK_ID):(i=Zm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(D.PLAYBACK_ID,i):this.removeAttribute(D.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(D.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(D.MAX_RESOLUTION,i):this.removeAttribute(D.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(D.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(D.MIN_RESOLUTION,i):this.removeAttribute(D.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(D.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(D.RENDITION_ORDER,i):this.removeAttribute(D.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(D.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(D.PROGRAM_START_TIME):this.setAttribute(D.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(D.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(D.PROGRAM_END_TIME):this.setAttribute(D.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(D.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(D.ASSET_START_TIME):this.setAttribute(D.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(D.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(D.ASSET_END_TIME):this.setAttribute(D.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(D.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(D.CUSTOM_DOMAIN,i):this.removeAttribute(D.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(D.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(D.DRM_TOKEN,i):this.removeAttribute(D.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(D.PLAYBACK_TOKEN))return(i=this.getAttribute(D.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(D.PLAYBACK_ID)){let[,s]=Wd((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(D.PLAYBACK_TOKEN,i):this.removeAttribute(D.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(D.PLAYBACK_TOKEN),e=this.getAttribute(D.DRM_TOKEN);return{...I(this,iu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){ee(this,iu,i!=null?i:{})}get ended(){return tp(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(D.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(D.ENV_KEY,i):this.removeAttribute(D.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(D.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(D.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(D.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(D.STREAM_TYPE))!=null?i:Kd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(D.STREAM_TYPE,i):this.removeAttribute(D.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(D.TARGET_LIVE_WINDOW)?+this.getAttribute(D.TARGET_LIVE_WINDOW):Fy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.TARGET_LIVE_WINDOW):this.setAttribute(D.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(D.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 By(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(D.LIVE_EDGE_OFFSET))return+this.getAttribute(D.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.LIVE_EDGE_OFFSET):this.setAttribute(D.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return jd(this.nativeEl)}async addCuePoints(i){return qm(this.nativeEl,i)}get activeCuePoint(){return jm(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return Xm(this.nativeEl,i)}get activeChapter(){return Qm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(D.PREFER_PLAYBACK);if(i===Vt.MSE||i===Vt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Vt.MSE||i===Vt.NATIVE?this.setAttribute(D.PREFER_PLAYBACK,i):this.removeAttribute(D.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![D.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,Xa)}}set metadata(i){ee(this,Xa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Xa))}get _hlsConfig(){return I(this,ru)}set _hlsConfig(i){ee(this,ru,i)}load(){ee(this,wi,Gy(this,this.nativeEl,I(this,wi)))}unload(){ip(this.nativeEl,I(this,wi)),ee(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(np.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case D.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case D.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ke(this,Qa,ou).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ke(this,Qa,ou).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 D.PLAYBACK_ID:this.src=Ga(this);break;case D.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 D.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 D.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case D.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)&&Ke(this,Qa,ou).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,za=new WeakMap,tu=new WeakMap,Xa=new WeakMap,iu=new WeakMap,ru=new WeakMap,su=new WeakMap,nu=new WeakMap,au=new WeakMap,Qa=new WeakSet,ou=async function(){I(this,za)||(await ee(this,za,Promise.resolve()),ee(this,za,null),this.load())};var lu,Ap=class extends yC(DC(FC)){constructor(){super(...arguments),z(this,lu,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,lu))!=null?i:this.muxCastCustomData}set castCustomData(i){ee(this,lu,i)}};lu=new WeakMap;sp.customElements.get("mux-video")||(sp.customElements.define("mux-video",Ap),sp.MuxVideoElement=Ap);var uT=Ap;function cT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${pu(t)}: ${r}; `)}),e?e.trim():void 0}function pu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function gu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Mt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=BC(i).toString();return e?"?"+e:""}function BC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var kp=(i,e)=>!i||!e?!1:i.contains(e)?!0:kp(i,e.getRootNode().host);var hT="mux.com",$C=()=>{try{return"3.0.0"}catch{}return"UNKNOWN"},HC=$C(),Eu=()=>HC,fT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,time:n,program_time:s})}`},mT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Za=i=>{if(i){if([Ae.LIVE,Ae.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Ae.LIVE}};var GC={crossorigin:"crossOrigin",playsinline:"playsInline"};function pT(i){var e;return(e=GC[i])!=null?e:gu(i)}var As,Ss,xt,vu=class{constructor(e,t){Xe(this,As,void 0);Xe(this,Ss,void 0);Xe(this,xt,[]);Ht(this,As,e),Ht(this,Ss,t)}[Symbol.iterator](){return me(this,xt).values()}get length(){return me(this,xt).length}get value(){var e;return(e=me(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ht(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return me(this,xt)[e]}values(){return me(this,xt).values()}keys(){return me(this,xt).keys()}forEach(e){me(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||me(this,xt).push(s)}),!(this.value===""&&!((t=me(this,As))!=null&&t.hasAttribute(`${me(this,Ss)}`)))&&((r=me(this,As))==null||r.setAttribute(`${me(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{me(this,xt).splice(me(this,xt).indexOf(r),1)}),(t=me(this,As))==null||t.setAttribute(`${me(this,Ss)}`,`${this.value}`)}contains(e){return me(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)}};As=new WeakMap,Ss=new WeakMap,xt=new WeakMap;var gT=`[mux-player ${Eu()}]`;function Di(...i){console.warn(gT,...i)}function Pt(...i){console.error(gT,...i)}function Cp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
1288
+ `}var rT=(i,{tag:e,is:t})=>{var r,s,n,a,o,l,d,u,c,h,f,m,p,g,E,b,T;let _=(s=(r=globalThis.document)==null?void 0:r.createElement)==null?void 0:s.call(r,e,{is:t}),A=_?uC(_):[];return n=class extends i{constructor(){super(),z(this,h),z(this,m),z(this,g),z(this,b),z(this,d,void 0),z(this,u,void 0),z(this,c,new Map)}static get observedAttributes(){var R,S,C;return Ke(R=n,o,l).call(R),[...(C=(S=_==null?void 0:_.constructor)==null?void 0:S.observedAttributes)!=null?C:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var R,S,C;return Ke(this,h,f).call(this),(C=(S=(R=I(this,u))!=null?R:this.shadowRoot.querySelector(e))!=null?S:this.querySelector(":scope > [slot=media]"))!=null?C:this.querySelector(e)}set nativeEl(R){ee(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,S;return(S=this.getAttribute("preload"))!=null?S:(R=this.nativeEl)==null?void 0:R.preload}set preload(R){this.setAttribute("preload",`${R}`)}init(){var R,S;if(!this.shadowRoot){this.attachShadow({mode:"open"});let C=cC(this.attributes);t&&(C.is=t),e&&(C.part=e),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(C)}this.nativeEl.muted=this.hasAttribute("muted");for(let C of A)Ke(this,g,E).call(this,C);this.shadowRoot.addEventListener("slotchange",this),Ke(this,m,p).call(this);for(let C of this.constructor.Events)(S=(R=this.shadowRoot).addEventListener)==null||S.call(R,C,this,!0)}handleEvent(R){if(R.type==="slotchange"){Ke(this,m,p).call(this);return}R.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(R.type,{detail:R.detail}))}attributeChangedCallback(R,S,C){Ke(this,h,f).call(this),Ke(this,b,T).call(this,R,S,C)}connectedCallback(){Ke(this,h,f).call(this)}},a=new WeakMap,o=new WeakSet,l=function(){if(I(this,a))return;ee(this,a,!0);let R=new Set(this.observedAttributes);R.delete("muted");for(let S of A)if(!(S in this.prototype))if(typeof _[S]=="function")this.prototype[S]=function(...C){return Ke(this,h,f).call(this),this.call?this.call(S,...C):this.nativeEl[S].apply(this.nativeEl,C)};else{let C={get(){var P,k,M;Ke(this,h,f).call(this);let B=S.toLowerCase();if(R.has(B)){let F=this.getAttribute(B);return F===null?!1:F===""?!0:F}return(M=(P=this.get)==null?void 0:P.call(this,S))!=null?M:(k=this.nativeEl)==null?void 0:k[S]}};S!==S.toUpperCase()&&(C.set=function(P){Ke(this,h,f).call(this);let k=S.toLowerCase();if(R.has(k)){P===!0||P===!1||P==null?this.toggleAttribute(k,!!P):this.setAttribute(k,P);return}if(this.set){this.set(S,P);return}this.nativeEl[S]=P}),Object.defineProperty(this.prototype,S,C)}},d=new WeakMap,u=new WeakMap,c=new WeakMap,h=new WeakSet,f=function(){I(this,d)||(ee(this,d,!0),this.init())},m=new WeakSet,p=function(){let R=new Map(I(this,c));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(S=>["track","source"].includes(S.localName)).forEach(S=>{var C,P;R.delete(S);let k=I(this,c).get(S);k||(k=S.cloneNode(),I(this,c).set(S,k)),(P=(C=this.nativeEl).append)==null||P.call(C,k),k.localName==="track"&&k.default&&(k.kind==="chapters"||k.kind==="metadata")&&k.track.mode==="disabled"&&(k.track.mode="hidden")}),R.forEach(S=>S.remove())},g=new WeakSet,E=function(R){if(Object.prototype.hasOwnProperty.call(this,R)){let S=this[R];delete this[R],this[R]=S}},b=new WeakSet,T=function(R,S,C){var P,k,M,B,F,X;["id","class"].includes(R)||!n.observedAttributes.includes(R)&&this.constructor.observedAttributes.includes(R)||(C===null?(k=(P=this.nativeEl).removeAttribute)==null||k.call(P,R):((B=(M=this.nativeEl).getAttribute)==null?void 0:B.call(M,R))!=C&&((X=(F=this.nativeEl).setAttribute)==null||X.call(F,R,C)))},z(n,o),De(n,"getTemplateHTML",e.endsWith("audio")?lC:dC),De(n,"shadowRootOptions",{mode:"open"}),De(n,"Events",hu),z(n,a,void 0),n};function uC(i){let e=[];for(let t=Object.getPrototypeOf(i);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))e.push(...Object.getOwnPropertyNames(t));return e}function sT(i){let e="";for(let t in i){let r=i[t];r===""?e+=` ${t}`:e+=` ${t}="${r}"`}return e}function cC(i){let e={};for(let t of i)e[t.name]=t.value;return e}var jy,np=rT((jy=globalThis.HTMLElement)!=null?jy:class{},{tag:"video"}),zy,d2=rT((zy=globalThis.HTMLElement)!=null?zy:class{},{tag:"audio"}),Ts=new WeakMap,ap=class extends Error{},hC=class extends Error{},fC=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 mC(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 pC(){return globalThis.chrome}function gC(){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 _s(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function Rp(){var i;return(i=_s())==null?void 0:i.getCurrentSession()}function Ip(){var i;return(i=Rp())==null?void 0:i.getSessionObj().media[0]}function vC(i){return new Promise((e,t)=>{Ip().editTracksInfo(i,e,t)})}function EC(i){return new Promise((e,t)=>{Ip().getStatus(i,e,t)})}function nT(i){return _s().setOptions({...aT(),...i})}function aT(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var Xd=new fC,xr=new WeakSet,ot;mC(()=>{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}ot||(ot=cast.framework,_s().addEventListener(ot.CastContextEventType.CAST_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,s)})}),_s().addEventListener(ot.CastContextEventType.SESSION_STATE_CHANGED,s=>{Xd.forEach(n=>{var a,o;return(o=(a=Ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,s)})}),Xd.forEach(s=>{var n,a;return(a=(n=Ts.get(s)).init)==null?void 0:a.call(n)}))});var Xy=0,xe,Qd,Yt,Ar,Cn,Rn,ys,lp,Sr,os,dp,Qy,du,up,cp,oT,Zd,hp,fp,Zy,Jd,op,bC=class extends EventTarget{constructor(i){super(),z(this,Sr),z(this,dp),z(this,du),z(this,cp),z(this,Zd),z(this,fp),z(this,Jd),z(this,xe,void 0),z(this,Qd,void 0),z(this,Yt,void 0),z(this,Ar,void 0),z(this,Cn,"disconnected"),z(this,Rn,!1),z(this,ys,new Set),z(this,lp,new WeakMap),ee(this,xe,i),Xd.add(this),Ts.set(this,{init:()=>Ke(this,Zd,hp).call(this),onCastStateChanged:()=>Ke(this,du,up).call(this),onSessionStateChanged:()=>Ke(this,cp,oT).call(this),getCastPlayer:()=>I(this,Sr,os)}),Ke(this,Zd,hp).call(this)}get state(){return I(this,Cn)}async watchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");return I(this,lp).set(i,++Xy),I(this,ys).add(i),Xy}async cancelWatchAvailability(i){if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");i?I(this,ys).delete(i):I(this,ys).clear()}async prompt(){var i,e,t,r;if(I(this,xe).disableRemotePlayback)throw new ap("disableRemotePlayback attribute is present.");if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable))throw new hC("The RemotePlayback API is disabled on this platform.");let s=xr.has(I(this,xe));xr.add(I(this,xe)),nT(I(this,xe).castOptions),Object.entries(I(this,Ar)).forEach(([n,a])=>{I(this,Yt).controller.addEventListener(n,a)});try{await _s().requestSession()}catch(n){if(n==="cancel"){s||xr.delete(I(this,xe));return}throw new Error(n)}(r=(t=Ts.get(I(this,xe)))==null?void 0:t.loadOnPrompt)==null||r.call(t)}};xe=new WeakMap,Qd=new WeakMap,Yt=new WeakMap,Ar=new WeakMap,Cn=new WeakMap,Rn=new WeakMap,ys=new WeakMap,lp=new WeakMap,Sr=new WeakSet,os=function(){if(xr.has(I(this,xe)))return I(this,Yt)},dp=new WeakSet,Qy=function(){xr.has(I(this,xe))&&(Object.entries(I(this,Ar)).forEach(([i,e])=>{I(this,Yt).controller.removeEventListener(i,e)}),xr.delete(I(this,xe)),I(this,xe).muted=I(this,Yt).isMuted,I(this,xe).currentTime=I(this,Yt).savedPlayerState.currentTime,I(this,Yt).savedPlayerState.isPaused===!1&&I(this,xe).play())},du=new WeakSet,up=function(){let i=_s().getCastState();if(xr.has(I(this,xe))&&i==="CONNECTING"&&(ee(this,Cn,"connecting"),this.dispatchEvent(new Event("connecting"))),!I(this,Rn)&&i!=null&&i.includes("CONNECT")){ee(this,Rn,!0);for(let e of I(this,ys))e(!0)}else if(I(this,Rn)&&(!i||i==="NO_DEVICES_AVAILABLE")){ee(this,Rn,!1);for(let e of I(this,ys))e(!1)}},cp=new WeakSet,oT=async function(){var i;let{SESSION_RESUMED:e}=ot.SessionState;if(_s().getSessionState()===e&&I(this,xe).castSrc===((i=Ip())==null?void 0:i.media.contentId)){xr.add(I(this,xe)),Object.entries(I(this,Ar)).forEach(([t,r])=>{I(this,Yt).controller.addEventListener(t,r)});try{await EC(new chrome.cast.media.GetStatusRequest)}catch(t){console.error(t)}I(this,Ar)[ot.RemotePlayerEventType.IS_PAUSED_CHANGED](),I(this,Ar)[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Zd=new WeakSet,hp=function(){!ot||I(this,Qd)||(ee(this,Qd,!0),nT(I(this,xe).castOptions),I(this,xe).textTracks.addEventListener("change",()=>Ke(this,Jd,op).call(this)),Ke(this,du,up).call(this),ee(this,Yt,new ot.RemotePlayer),new ot.RemotePlayerController(I(this,Yt)),ee(this,Ar,{[ot.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:i})=>{i===!0?(ee(this,Cn,"connected"),this.dispatchEvent(new Event("connect"))):(Ke(this,dp,Qy).call(this),ee(this,Cn,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[ot.RemotePlayerEventType.DURATION_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("durationchange"))},[ot.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("volumechange"))},[ot.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&I(this,xe).dispatchEvent(new Event("timeupdate"))},[ot.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event("resize"))},[ot.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{I(this,xe).dispatchEvent(new Event(this.paused?"pause":"play"))},[ot.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var i,e;((i=I(this,Sr,os))==null?void 0:i.playerState)!==chrome.cast.media.PlayerState.PAUSED&&I(this,xe).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,os))==null?void 0:e.playerState]))},[ot.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var i;(i=I(this,Sr,os))!=null&&i.isMediaLoaded&&(await Promise.resolve(),Ke(this,fp,Zy).call(this))}}))},fp=new WeakSet,Zy=function(){Ke(this,Jd,op).call(this)},Jd=new WeakSet,op=async function(){var i,e,t,r,s;if(!I(this,Sr,os))return;let n=((e=(i=I(this,Yt).mediaInfo)==null?void 0:i.tracks)!=null?e:[]).filter(({type:h})=>h===chrome.cast.media.TrackType.TEXT),a=[...I(this,xe).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=Rp())==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 vC(h)}catch(h){console.error(h)}};var yC=i=>{var e,t,r,s,n,a,o,l,d,u;return t=class extends i{constructor(){super(...arguments),z(this,o),z(this,d),z(this,r,{paused:!1}),z(this,s,aT()),z(this,n,void 0),z(this,a,void 0)}get remote(){return I(this,a)?I(this,a):pC()?(gC(),Ts.set(this,{loadOnPrompt:()=>Ke(this,d,u).call(this)}),ee(this,a,new bC(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=Rp())==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}ee(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=Ts.get(this.remote))==null?void 0:c.getCastPlayer)==null?void 0:h.call(c)},d=new WeakSet,u=async function(){I(this,r).paused=rp(t.prototype,this,"paused"),rp(t.prototype,this,"pause").call(this),this.muted=rp(t.prototype,this,"muted");try{await this.load()}catch(c){console.error(c)}},De(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t},fu=class extends Event{constructor(i,e){super(i),De(this,"track"),this.track=e.track}},mp=new WeakMap;function Y(i){var e;return(e=mp.get(i))!=null?e:TC(i,{})}function TC(i,e){let t=mp.get(i);return t||mp.set(i,t={}),Object.assign(t,e)}function pp(i,e){let t=i.videoTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in vp.prototype||Object.defineProperty(vp.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function gp(i){var e;let t=(e=Y(i).media)==null?void 0:e.videoTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function _C(i){var e;let t=(e=Y(i).media.videoTracks)!=null?e:[],r=!1;for(let s of t)s!==i&&(s.selected=!1,r=!0);if(r){if(Y(t).changeRequested)return;Y(t).changeRequested=!0,queueMicrotask(()=>{delete Y(t).changeRequested,t.dispatchEvent(new Event("change"))})}}var ls,ds,us,In,Ka,vp=class extends EventTarget{constructor(){super(),z(this,In),z(this,ls,void 0),z(this,ds,void 0),z(this,us,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,In,Ka).values()}get length(){return I(this,In,Ka).size}getTrackById(i){var e;return(e=[...I(this,In,Ka)].find(t=>t.id===i))!=null?e:null}get selectedIndex(){return[...I(this,In,Ka)].findIndex(i=>i.selected)}get onaddtrack(){return I(this,ls)}set onaddtrack(i){I(this,ls)&&(this.removeEventListener("addtrack",I(this,ls)),ee(this,ls,void 0)),typeof i=="function"&&(ee(this,ls,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,ds)}set onremovetrack(i){I(this,ds)&&(this.removeEventListener("removetrack",I(this,ds)),ee(this,ds,void 0)),typeof i=="function"&&(ee(this,ds,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,us)}set onchange(i){I(this,us)&&(this.removeEventListener("change",I(this,us)),ee(this,us,void 0)),typeof i=="function"&&(ee(this,us,i),this.addEventListener("change",i))}};ls=new WeakMap,ds=new WeakMap,us=new WeakMap,In=new WeakSet,Ka=function(){return Y(this).trackSet};var mu=class extends Event{constructor(i,e){super(i),De(this,"rendition"),this.rendition=e.rendition}};function AC(i,e){let t=Y(i).media.videoRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in Ep.prototype||Object.defineProperty(Ep.prototype,s,{get(){return Ln(this)[s]}}),queueMicrotask(()=>{i.selected&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function SC(i){let e=Y(i).media.videoRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.selected&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function xC(i){let e=Y(i).media.videoRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function Ln(i){return[...Y(i).media.videoTracks].filter(e=>e.selected).flatMap(e=>[...Y(e).renditionSet])}var cs,hs,fs,Ep=class extends EventTarget{constructor(){super(...arguments),z(this,cs,void 0),z(this,hs,void 0),z(this,fs,void 0)}[Symbol.iterator](){return Ln(this).values()}get length(){return Ln(this).length}getRenditionById(i){var e;return(e=Ln(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return Ln(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of Ln(this).entries())t.selected=e===i}get onaddrendition(){return I(this,cs)}set onaddrendition(i){I(this,cs)&&(this.removeEventListener("addrendition",I(this,cs)),ee(this,cs,void 0)),typeof i=="function"&&(ee(this,cs,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,hs)}set onremoverendition(i){I(this,hs)&&(this.removeEventListener("removerendition",I(this,hs)),ee(this,hs,void 0)),typeof i=="function"&&(ee(this,hs,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,fs)}set onchange(i){I(this,fs)&&(this.removeEventListener("change",I(this,fs)),ee(this,fs,void 0)),typeof i=="function"&&(ee(this,fs,i),this.addEventListener("change",i))}};cs=new WeakMap,hs=new WeakMap,fs=new WeakMap;var Wa,RC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"width"),De(this,"height"),De(this,"bitrate"),De(this,"frameRate"),De(this,"codec"),z(this,Wa,!1)}get selected(){return I(this,Wa)}set selected(i){I(this,Wa)!==i&&(ee(this,Wa,i),xC(this))}};Wa=new WeakMap;var Va,lT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,Va,!1)}addRendition(i,e,t,r,s,n){let a=new RC;return a.src=i,a.width=e,a.height=t,a.frameRate=n,a.bitrate=s,a.codec=r,AC(this,a),a}removeRendition(i){SC(i)}get selected(){return I(this,Va)}set selected(i){I(this,Va)!==i&&(ee(this,Va,i),i===!0&&_C(this))}};Va=new WeakMap;function IC(i,e){let t=Y(i).media.audioRenditions;Y(e).media=Y(i).media,Y(e).track=i;let r=Y(i).renditionSet;r.add(e);let s=r.size-1;s in bp.prototype||Object.defineProperty(bp.prototype,s,{get(){return kn(this)[s]}}),queueMicrotask(()=>{i.enabled&&t.dispatchEvent(new mu("addrendition",{rendition:e}))})}function LC(i){let e=Y(i).media.audioRenditions,t=Y(i).track;Y(t).renditionSet.delete(i),queueMicrotask(()=>{Y(i).track.enabled&&e.dispatchEvent(new mu("removerendition",{rendition:i}))})}function kC(i){let e=Y(i).media.audioRenditions;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,Y(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function kn(i){return[...Y(i).media.audioTracks].filter(e=>e.enabled).flatMap(e=>[...Y(e).renditionSet])}var ms,ps,gs,bp=class extends EventTarget{constructor(){super(...arguments),z(this,ms,void 0),z(this,ps,void 0),z(this,gs,void 0)}[Symbol.iterator](){return kn(this).values()}get length(){return kn(this).length}getRenditionById(i){var e;return(e=kn(this).find(t=>`${t.id}`==`${i}`))!=null?e:null}get selectedIndex(){return kn(this).findIndex(i=>i.selected)}set selectedIndex(i){for(let[e,t]of kn(this).entries())t.selected=e===i}get onaddrendition(){return I(this,ms)}set onaddrendition(i){I(this,ms)&&(this.removeEventListener("addrendition",I(this,ms)),ee(this,ms,void 0)),typeof i=="function"&&(ee(this,ms,i),this.addEventListener("addrendition",i))}get onremoverendition(){return I(this,ps)}set onremoverendition(i){I(this,ps)&&(this.removeEventListener("removerendition",I(this,ps)),ee(this,ps,void 0)),typeof i=="function"&&(ee(this,ps,i),this.addEventListener("removerendition",i))}get onchange(){return I(this,gs)}set onchange(i){I(this,gs)&&(this.removeEventListener("change",I(this,gs)),ee(this,gs,void 0)),typeof i=="function"&&(ee(this,gs,i),this.addEventListener("change",i))}};ms=new WeakMap,ps=new WeakMap,gs=new WeakMap;var Ya,CC=class{constructor(){De(this,"src"),De(this,"id"),De(this,"bitrate"),De(this,"codec"),z(this,Ya,!1)}get selected(){return I(this,Ya)}set selected(i){I(this,Ya)!==i&&(ee(this,Ya,i),kC(this))}};Ya=new WeakMap;function yp(i,e){let t=i.audioTracks;Y(e).media=i,Y(e).renditionSet||(Y(e).renditionSet=new Set);let r=Y(t).trackSet;r.add(e);let s=r.size-1;s in _p.prototype||Object.defineProperty(_p.prototype,s,{get(){return[...Y(this).trackSet][s]}}),queueMicrotask(()=>{t.dispatchEvent(new fu("addtrack",{track:e}))})}function Tp(i){var e;let t=(e=Y(i).media)==null?void 0:e.audioTracks;t&&(Y(t).trackSet.delete(i),queueMicrotask(()=>{t.dispatchEvent(new fu("removetrack",{track:i}))}))}function wC(i){let e=Y(i).media.audioTracks;!e||Y(e).changeRequested||(Y(e).changeRequested=!0,queueMicrotask(()=>{delete Y(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var vs,Es,bs,qa,eu,_p=class extends EventTarget{constructor(){super(),z(this,qa),z(this,vs,void 0),z(this,Es,void 0),z(this,bs,void 0),Y(this).trackSet=new Set}[Symbol.iterator](){return I(this,qa,eu).values()}get length(){return I(this,qa,eu).size}getTrackById(i){var e;return(e=[...I(this,qa,eu)].find(t=>t.id===i))!=null?e:null}get onaddtrack(){return I(this,vs)}set onaddtrack(i){I(this,vs)&&(this.removeEventListener("addtrack",I(this,vs)),ee(this,vs,void 0)),typeof i=="function"&&(ee(this,vs,i),this.addEventListener("addtrack",i))}get onremovetrack(){return I(this,Es)}set onremovetrack(i){I(this,Es)&&(this.removeEventListener("removetrack",I(this,Es)),ee(this,Es,void 0)),typeof i=="function"&&(ee(this,Es,i),this.addEventListener("removetrack",i))}get onchange(){return I(this,bs)}set onchange(i){I(this,bs)&&(this.removeEventListener("change",I(this,bs)),ee(this,bs,void 0)),typeof i=="function"&&(ee(this,bs,i),this.addEventListener("change",i))}};vs=new WeakMap,Es=new WeakMap,bs=new WeakMap,qa=new WeakSet,eu=function(){return Y(this).trackSet};var ja,dT=class{constructor(){De(this,"id"),De(this,"kind"),De(this,"label",""),De(this,"language",""),De(this,"sourceBuffer"),z(this,ja,!1)}addRendition(i,e,t){let r=new CC;return r.src=i,r.codec=e,r.bitrate=t,IC(this,r),r}removeRendition(i){LC(i)}get enabled(){return I(this,ja)}set enabled(i){I(this,ja)!==i&&(ee(this,ja,i),wC(this))}};ja=new WeakMap;var Jy=uu(globalThis.HTMLMediaElement,"video"),eT=uu(globalThis.HTMLMediaElement,"audio");function DC(i){if(!(i!=null&&i.prototype))return i;let e=uu(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return MC(this)}});let t=uu(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return PC(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new lT;return l.kind=n,l.label=a,l.language=o,pp(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=gp),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new dT;return l.kind=n,l.label=a,l.language=o,yp(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=Tp),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return r(this)}});let r=n=>{let a=Y(n).videoRenditions;return a||(a=new Ep,Y(a).media=n,Y(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return s(this)}});let s=n=>{let a=Y(n).audioRenditions;return a||(a=new bp,Y(a).media=n,Y(n).audioRenditions=a),a};return i}function uu(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function MC(i){var e;let t=Y(i).videoTracks;if(!t&&(t=new vp,Y(i).videoTracks=t,Jy)){let r=Jy.call((e=i.nativeEl)!=null?e:i);for(let s of r)pp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof lT)){for(let n of r)gp(n);return}pp(i,s.track)}),r.addEventListener("removetrack",s=>{gp(s.track)})}return t}function PC(i){var e;let t=Y(i).audioTracks;if(!t&&(t=new _p,Y(i).audioTracks=t,eT)){let r=eT.call((e=i.nativeEl)!=null?e:i);for(let s of r)yp(i,s);r.addEventListener("change",()=>{t.dispatchEvent(new Event("change"))}),r.addEventListener("addtrack",s=>{if([...t].some(n=>n instanceof dT)){for(let n of r)Tp(n);return}yp(i,s.track)}),r.addEventListener("removetrack",s=>{Tp(s.track)})}return t}hu.push("castchange","entercast","leavecast");var D={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",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"},OC=Object.values(D),NC=oC(),UC="mux-video",wi,za,tu,Xa,iu,ru,su,nu,au,Qa,ou,FC=class extends np{constructor(){super(),z(this,Qa),z(this,wi,void 0),z(this,za,void 0),z(this,tu,void 0),z(this,Xa,{}),z(this,iu,{}),z(this,ru,void 0),z(this,su,void 0),z(this,nu,void 0),z(this,au,void 0),ee(this,tu,Uy())}static get observedAttributes(){var i;return[...OC,...(i=np.observedAttributes)!=null?i:[]]}get preferCmcd(){var i;return(i=this.getAttribute(D.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?xn.includes(i)?this.setAttribute(D.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${xn.join()}`):this.removeAttribute(D.PREFER_CMCD))}get playerInitTime(){return I(this,tu)}get playerSoftwareName(){var i;return(i=I(this,nu))!=null?i:UC}set playerSoftwareName(i){ee(this,nu,i)}get playerSoftwareVersion(){var i;return(i=I(this,su))!=null?i:NC}set playerSoftwareVersion(i){ee(this,su,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=Jm(this.nativeEl))!=null?i:null}get errorTranslator(){return I(this,au)}set errorTranslator(i){ee(this,au,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(D.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(D.TYPE,i):this.removeAttribute(D.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(D.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(D.DEBUG,""):this.removeAttribute(D.DEBUG))}get disableTracking(){return this.hasAttribute(D.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(D.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(D.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(D.DISABLE_COOKIES,""):this.removeAttribute(D.DISABLE_COOKIES))}get startTime(){let i=this.getAttribute(D.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(D.START_TIME):this.setAttribute(D.START_TIME,`${i}`))}get playbackId(){var i;return this.hasAttribute(D.PLAYBACK_ID)?this.getAttribute(D.PLAYBACK_ID):(i=Zm(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(D.PLAYBACK_ID,i):this.removeAttribute(D.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(D.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(D.MAX_RESOLUTION,i):this.removeAttribute(D.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(D.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(D.MIN_RESOLUTION,i):this.removeAttribute(D.MIN_RESOLUTION))}get renditionOrder(){var i;return(i=this.getAttribute(D.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(D.RENDITION_ORDER,i):this.removeAttribute(D.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(D.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(D.PROGRAM_START_TIME):this.setAttribute(D.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(D.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(D.PROGRAM_END_TIME):this.setAttribute(D.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(D.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(D.ASSET_START_TIME):this.setAttribute(D.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(D.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(D.ASSET_END_TIME):this.setAttribute(D.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(D.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(D.CUSTOM_DOMAIN,i):this.removeAttribute(D.CUSTOM_DOMAIN))}get drmToken(){var i;return(i=this.getAttribute(D.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(D.DRM_TOKEN,i):this.removeAttribute(D.DRM_TOKEN))}get playbackToken(){var i,e,t,r;if(this.hasAttribute(D.PLAYBACK_TOKEN))return(i=this.getAttribute(D.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(D.PLAYBACK_ID)){let[,s]=Wd((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(D.PLAYBACK_TOKEN,i):this.removeAttribute(D.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(D.PLAYBACK_TOKEN),e=this.getAttribute(D.DRM_TOKEN);return{...I(this,iu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){ee(this,iu,i!=null?i:{})}get ended(){return tp(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(D.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(D.ENV_KEY,i):this.removeAttribute(D.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(D.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(D.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(D.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(D.STREAM_TYPE))!=null?i:Kd(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(D.STREAM_TYPE,i):this.removeAttribute(D.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(D.TARGET_LIVE_WINDOW)?+this.getAttribute(D.TARGET_LIVE_WINDOW):Fy(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.TARGET_LIVE_WINDOW):this.setAttribute(D.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(D.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 By(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(D.LIVE_EDGE_OFFSET))return+this.getAttribute(D.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(D.LIVE_EDGE_OFFSET):this.setAttribute(D.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return jd(this.nativeEl)}async addCuePoints(i){return qm(this.nativeEl,i)}get activeCuePoint(){return jm(this.nativeEl)}get cuePoints(){return wy(this.nativeEl)}async addChapters(i){return Xm(this.nativeEl,i)}get activeChapter(){return Qm(this.nativeEl)}get chapters(){return My(this.nativeEl)}getStartDate(){return Py(this.nativeEl,this._hls)}get currentPdt(){return Oy(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(D.PREFER_PLAYBACK);if(i===Vt.MSE||i===Vt.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Vt.MSE||i===Vt.NATIVE?this.setAttribute(D.PREFER_PLAYBACK,i):this.removeAttribute(D.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![D.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,Xa)}}set metadata(i){ee(this,Xa,i!=null?i:{}),this.mux&&this.mux.emit("hb",I(this,Xa))}get _hlsConfig(){return I(this,ru)}set _hlsConfig(i){ee(this,ru,i)}load(){ee(this,wi,Gy(this,this.nativeEl,I(this,wi)))}unload(){ip(this.nativeEl,I(this,wi)),ee(this,wi,void 0)}attributeChangedCallback(i,e,t){var r,s;switch(np.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case D.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case D.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Ke(this,Qa,ou).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Ke(this,Qa,ou).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 D.PLAYBACK_ID:this.src=Ga(this);break;case D.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 D.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 D.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case D.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)&&Ke(this,Qa,ou).call(this)}disconnectedCallback(){this.unload()}};wi=new WeakMap,za=new WeakMap,tu=new WeakMap,Xa=new WeakMap,iu=new WeakMap,ru=new WeakMap,su=new WeakMap,nu=new WeakMap,au=new WeakMap,Qa=new WeakSet,ou=async function(){I(this,za)||(await ee(this,za,Promise.resolve()),ee(this,za,null),this.load())};var lu,Ap=class extends yC(DC(FC)){constructor(){super(...arguments),z(this,lu,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,lu))!=null?i:this.muxCastCustomData}set castCustomData(i){ee(this,lu,i)}};lu=new WeakMap;sp.customElements.get("mux-video")||(sp.customElements.define("mux-video",Ap),sp.MuxVideoElement=Ap);var uT=Ap;function cT(i){let e="";return Object.entries(i).forEach(([t,r])=>{r!=null&&(e+=`${pu(t)}: ${r}; `)}),e?e.trim():void 0}function pu(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function gu(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Mt(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Lp(i){let e=BC(i).toString();return e?"?"+e:""}function BC(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}var kp=(i,e)=>!i||!e?!1:i.contains(e)?!0:kp(i,e.getRootNode().host);var hT="mux.com",$C=()=>{try{return"3.1.0"}catch{}return"UNKNOWN"},HC=$C(),Eu=()=>HC,fT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,time:n,program_time:s})}`},mT=(i,{token:e,customDomain:t=hT,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${Lp({token:e,format:"webp",program_start_time:r,program_end_time:s})}`},Za=i=>{if(i){if([Ae.LIVE,Ae.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Ae.LIVE}};var GC={crossorigin:"crossOrigin",playsinline:"playsInline"};function pT(i){var e;return(e=GC[i])!=null?e:gu(i)}var As,Ss,xt,vu=class{constructor(e,t){Xe(this,As,void 0);Xe(this,Ss,void 0);Xe(this,xt,[]);Ht(this,As,e),Ht(this,Ss,t)}[Symbol.iterator](){return me(this,xt).values()}get length(){return me(this,xt).length}get value(){var e;return(e=me(this,xt).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ht(this,xt,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return me(this,xt)[e]}values(){return me(this,xt).values()}keys(){return me(this,xt).keys()}forEach(e){me(this,xt).forEach(e)}add(...e){var t,r;e.forEach(s=>{this.contains(s)||me(this,xt).push(s)}),!(this.value===""&&!((t=me(this,As))!=null&&t.hasAttribute(`${me(this,Ss)}`)))&&((r=me(this,As))==null||r.setAttribute(`${me(this,Ss)}`,`${this.value}`))}remove(...e){var t;e.forEach(r=>{me(this,xt).splice(me(this,xt).indexOf(r),1)}),(t=me(this,As))==null||t.setAttribute(`${me(this,Ss)}`,`${this.value}`)}contains(e){return me(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)}};As=new WeakMap,Ss=new WeakMap,xt=new WeakMap;var gT=`[mux-player ${Eu()}]`;function Di(...i){console.warn(gT,...i)}function Pt(...i){console.error(gT,...i)}function Cp(i){var t;let e=(t=i.message)!=null?t:"";i.context&&(e+=` ${i.context}`),i.file&&(e+=` ${j("Read more: ")}
1289
1289
  https://github.com/muxinc/elements/blob/main/errors/${i.file}`),Di(e)}var _t={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},xs={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ET=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}}),KC=hu.filter(i=>i!=="error"),WC=Object.values(_t).filter(i=>![_t.PLAYSINLINE].includes(i)),VC=Object.values(xs),wn,wp=class extends Ve.HTMLElement{constructor(){super();Xe(this,wn,new WeakMap);let t=s=>{for(let n of s)n.type==="childList"&&(n.removedNodes.forEach(a=>{var o;(o=me(this,wn).get(a))==null||o.remove()}),n.addedNodes.forEach(a=>{var l;let o=a;o!=null&&o.slot||(l=this.media)==null||l.append(bT(me(this,wn),a))}))};new MutationObserver(t).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...WC,...VC]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(t=>{var r;(r=this.media)==null||r.append(bT(me(this,wn),t))}),KC.forEach(t=>{var r;(r=this.media)==null||r.addEventListener(t,s=>{this.dispatchEvent(new Event(s.type))})})}attributeChangedCallback(t,r,s){var n,a;switch(t){case xs.MUTED:{this.media&&(this.media.muted=s!=null,this.media.defaultMuted=s!=null);return}case xs.VOLUME:{let o=(n=Mt(s))!=null?n:1;this.media&&(this.media.volume=o);return}case xs.PLAYBACKRATE:{let o=(a=Mt(s))!=null?a:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);return}}}play(){var t,r;return(r=(t=this.media)==null?void 0:t.play())!=null?r:Promise.reject()}pause(){var t;(t=this.media)==null||t.pause()}load(){var t;(t=this.media)==null||t.load()}requestCast(t){var r;return(r=this.media)==null?void 0:r.requestCast(t)}get media(){var t;return(t=this.shadowRoot)==null?void 0:t.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 t,r;return(r=(t=this.media)==null?void 0:t.paused)!=null?r:!0}get duration(){var t,r;return(r=(t=this.media)==null?void 0:t.duration)!=null?r:NaN}get ended(){var t,r;return(r=(t=this.media)==null?void 0:t.ended)!=null?r:!1}get buffered(){var t,r;return(r=(t=this.media)==null?void 0:t.buffered)!=null?r:ET}get seekable(){var t,r;return(r=(t=this.media)==null?void 0:t.seekable)!=null?r:ET}get readyState(){var t,r;return(r=(t=this.media)==null?void 0:t.readyState)!=null?r:0}get videoWidth(){var t,r;return(r=(t=this.media)==null?void 0:t.videoWidth)!=null?r:0}get videoHeight(){var t,r;return(r=(t=this.media)==null?void 0:t.videoHeight)!=null?r:0}get currentSrc(){var t,r;return(r=(t=this.media)==null?void 0:t.currentSrc)!=null?r:""}get currentTime(){var t,r;return(r=(t=this.media)==null?void 0:t.currentTime)!=null?r:0}set currentTime(t){this.media&&(this.media.currentTime=Number(t))}get volume(){var t,r;return(r=(t=this.media)==null?void 0:t.volume)!=null?r:1}set volume(t){this.media&&(this.media.volume=Number(t))}get playbackRate(){var t,r;return(r=(t=this.media)==null?void 0:t.playbackRate)!=null?r:1}set playbackRate(t){this.media&&(this.media.playbackRate=Number(t))}get defaultPlaybackRate(){var t;return(t=Mt(this.getAttribute(xs.PLAYBACKRATE)))!=null?t:1}set defaultPlaybackRate(t){t!=null?this.setAttribute(xs.PLAYBACKRATE,`${t}`):this.removeAttribute(xs.PLAYBACKRATE)}get crossOrigin(){return Ja(this,_t.CROSSORIGIN)}set crossOrigin(t){this.setAttribute(_t.CROSSORIGIN,`${t}`)}get autoplay(){return Ja(this,_t.AUTOPLAY)!=null}set autoplay(t){t?this.setAttribute(_t.AUTOPLAY,typeof t=="string"?t:""):this.removeAttribute(_t.AUTOPLAY)}get loop(){return Ja(this,_t.LOOP)!=null}set loop(t){t?this.setAttribute(_t.LOOP,""):this.removeAttribute(_t.LOOP)}get muted(){var t,r;return(r=(t=this.media)==null?void 0:t.muted)!=null?r:!1}set muted(t){this.media&&(this.media.muted=!!t)}get defaultMuted(){return Ja(this,_t.MUTED)!=null}set defaultMuted(t){t?this.setAttribute(_t.MUTED,""):this.removeAttribute(_t.MUTED)}get playsInline(){return Ja(this,_t.PLAYSINLINE)!=null}set playsInline(t){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(t){["","none","metadata","auto"].includes(t)?this.setAttribute(_t.PRELOAD,t):this.removeAttribute(_t.PRELOAD)}};wn=new WeakMap;function Ja(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}function bT(i,e){let t=i.get(e);return t||(t=e.cloneNode(),i.set(e,t)),t}var Dp=wp;var ST=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(ST(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)},Zi=(i,e,t,r)=>(ST(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Dn,bu,Rs,eo,Rr,Ir,Lr,Is,Mn,yu,oi,yT=1,TT=0,YC=1,qC={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}}}},Ji=class extends x.DocumentFragment{constructor(e,t,r=qC){var s;super(),Mi(this,Dn,void 0),Mi(this,bu,void 0),this.append(e.content.cloneNode(!0)),Zi(this,Dn,xT(this)),Zi(this,bu,r),(s=r.createCallback)==null||s.call(r,this,de(this,Dn),t),r.processCallback(this,de(this,Dn),t)}update(e){de(this,bu).processCallback(this,de(this,Dn),e)}};Dn=new WeakMap;bu=new WeakMap;var xT=(i,e=[])=>{let t,r;for(let s of i.attributes||[])if(s.value.includes("{{")){let n=new Mp;for([t,r]of AT(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===yT&&!(s instanceof HTMLTemplateElement))xT(s,e);else{let n=s.data;if(s.nodeType===yT||n.includes("{{")){let a=[];if(n)for([t,r]of AT(n))if(!t)a.push(new Text(r));else{let o=new er(i);a.push(o),e.push([r,o])}else if(s instanceof HTMLTemplateElement){let o=new to(i,s);a.push(o),e.push([o.expression,o])}s.replaceWith(...a.flatMap(o=>o.replacementNodes||[o]))}}return e},_T={},AT=i=>{let e="",t=0,r=_T[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([TT,e]),e="",s++):n==="}"&&i[s+1]==="}"&&i[s-1]!=="\\"&&!--t?(r.push([YC,e.trim()]),e="",s++):e+=n||"";return e&&r.push([TT,(t>0?"{{":"")+e]),_T[i]=r},jC=11,Tu=class{get value(){return""}set value(e){}toString(){return this.value}},RT=new WeakMap,Mp=class{constructor(){Mi(this,Rs,[])}[Symbol.iterator](){return de(this,Rs).values()}get length(){return de(this,Rs).length}item(e){return de(this,Rs)[e]}append(...e){for(let t of e)t instanceof Rt&&RT.set(t,this),de(this,Rs).push(t)}toString(){return de(this,Rs).join("")}};Rs=new WeakMap;var Rt=class extends Tu{constructor(e,t,r){super(),Mi(this,Is),Mi(this,eo,""),Mi(this,Rr,void 0),Mi(this,Ir,void 0),Mi(this,Lr,void 0),Zi(this,Rr,e),Zi(this,Ir,t),Zi(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,eo)}set value(e){de(this,eo)!==e&&(Zi(this,eo,e),!de(this,Is,Mn)||de(this,Is,Mn).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,Is,Mn).toString()))}get booleanValue(){return de(this,Rr).hasAttributeNS(de(this,Lr),de(this,Ir))}set booleanValue(e){if(!de(this,Is,Mn)||de(this,Is,Mn).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};eo=new WeakMap;Rr=new WeakMap;Ir=new WeakMap;Lr=new WeakMap;Is=new WeakSet;Mn=function(){return RT.get(this)};var er=class extends Tu{constructor(e,t){super(),Mi(this,yu,void 0),Mi(this,oi,void 0),Zi(this,yu,e),Zi(this,oi,t?[...t]:[new Text])}get replacementNodes(){return de(this,oi)}get parentNode(){return de(this,yu)}get nextSibling(){return de(this,oi)[de(this,oi).length-1].nextSibling}get previousSibling(){return de(this,oi)[0].previousSibling}get value(){return de(this,oi).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===jC?[...r.childNodes]:r.nodeType?[r]:[new Text(r)]);t.length||t.push(new Text),Zi(this,oi,zC(de(this,oi)[0].parentNode,de(this,oi),t,this.nextSibling))}};yu=new WeakMap;oi=new WeakMap;var to=class extends er{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 zC(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 IT={string:i=>String(i)},Au=class{constructor(e){this.template=e,this.state=void 0}},Ls=new WeakMap,ks=new WeakMap,Pp={partial:(i,e)=>{e[i.expression]=new Au(i.template)},if:(i,e)=>{var t;if(kT(i.expression,e))if(Ls.get(i)!==i.template){Ls.set(i,i.template);let r=new Ji(i.template,e,Su);i.replace(r),ks.set(i,r)}else(t=ks.get(i))==null||t.update(e);else i.replace(""),Ls.delete(i),ks.delete(i)}},XC=Object.keys(Pp),Su={processCallback(i,e,t){var r,s;if(t)for(let[n,a]of e){if(a instanceof to){if(!a.directive){let l=XC.find(d=>a.template.hasAttribute(d));l&&(a.directive=l,a.expression=a.template.getAttribute(l))}(r=Pp[a.directive])==null||r.call(Pp,a,t);continue}let o=kT(n,t);if(o instanceof Au){Ls.get(a)!==o.template?(Ls.set(a,o.template),o=new Ji(o.template,o.state,Su),a.value=o,ks.set(a,o)):(s=ks.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,Ls.delete(a),ks.delete(a))):a instanceof Rt?a.value=void 0:(a.value=void 0,Ls.delete(a),ks.delete(a))}}},LT={"!":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=IT[e])==null?void 0:t.call(IT,i)}};function QC(i){return ZC(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function kT(i,e={}){var t,r,s,n,a,o,l;let d=QC(i);if(d.length===0||d.some(({type:u})=>!u))return io(i);if(((t=d[0])==null?void 0:t.token)===">"){let u=e[(r=d[1])==null?void 0:r.token];if(!u)return io(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]=ro(g,e))}return u}if(d.length===1)return _u(d[0])?ro(d[0].token,e):io(i);if(d.length===2){let u=(o=d[0])==null?void 0:o.token,c=LT[u];if(!c||!_u(d[1]))return io(i);let h=ro(d[1].token,e);return c(h)}if(d.length===3){let u=(l=d[1])==null?void 0:l.token,c=LT[u];if(!c||!_u(d[0])||!_u(d[2]))return io(i);let h=ro(d[0].token,e);if(u==="|")return c(h,d[2].token);let f=ro(d[2].token,e);return c(h,f)}}function io(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function _u({type:i}){return["number","boolean","string","param"].includes(i)}function ro(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):wo(i)?parseFloat(i):e[i]}function ZC(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 $p=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Up=(i,e,t)=>($p(i,e,"read from private field"),t?t.call(i):e.get(i)),so=(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)},Cs=(i,e,t,r)=>($p(i,e,"write to private field"),r?r.call(i,t):e.set(i,t),t),Op=(i,e,t)=>($p(i,e,"access private method"),t),Pn,xu,On,Fp,CT,Ru,Bp,Np={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},wT=N.createElement("template");wT.innerHTML=`
1290
1290
  <style>
1291
1291
  :host {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player",
3
- "version": "3.0.0-canary.0-e51a7ce",
3
+ "version": "3.0.0-canary.0-e1d17f4",
4
4
  "description": "An open source Mux player web component that Just Works™",
5
5
  "homepage": "https://mux.com/player",
6
6
  "keywords": [
@@ -95,8 +95,8 @@
95
95
  "publish-release": "../../scripts/publish.sh"
96
96
  },
97
97
  "dependencies": {
98
- "@mux/mux-video": "0.21.0-canary.0-e51a7ce",
99
- "@mux/playback-core": "0.26.0-canary.0-e51a7ce",
98
+ "@mux/mux-video": "0.21.0-canary.0-e1d17f4",
99
+ "@mux/playback-core": "0.26.0-canary.0-e1d17f4",
100
100
  "media-chrome": "~4.2.1",
101
101
  "player.style": "^0.0.8"
102
102
  },