var di=Object.defineProperty;var ui=Object.getPrototypeOf;var ci=Reflect.get;var hi=(e,r,t)=>r in e?di(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var E=(e,r,t)=>(hi(e,typeof r!="symbol"?r+"":r,t),t),ge=(e,r,t)=>{if(!r.has(e))throw TypeError("Cannot "+t)};var i=(e,r,t)=>(ge(e,r,"read from private field"),t?t.call(e):r.get(e)),u=(e,r,t)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,t)},h=(e,r,t,s)=>(ge(e,r,"write to private field"),s?s.call(e,t):r.set(e,t),t);var A=(e,r,t)=>(ge(e,r,"access private method"),t),Jt=(e,r,t)=>ci(ui(e),t,r);var Et=class{addEventListener(){}removeEventListener(){}dispatchEvent(r){return!0}};if(typeof DocumentFragment=="undefined"){class e extends Et{}globalThis.DocumentFragment=e}var wt=class extends Et{},Ee=class extends Et{},li={get(e){},define(e,r,t){},getName(e){return null},upgrade(e){},whenDefined(e){return Promise.resolve(wt)}},xt,Te=class{constructor(r,t={}){u(this,xt,void 0);h(this,xt,t==null?void 0:t.detail)}get detail(){return i(this,xt)}initCustomEvent(){}};xt=new WeakMap;function fi(e,r){return new wt}var Oe={document:{createElement:fi},DocumentFragment,customElements:li,CustomEvent:Te,EventTarget:Et,HTMLElement:wt,HTMLVideoElement:Ee},Pe=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Qt=Pe?Oe:globalThis,$i=Pe?Oe.document:globalThis.document;import{initialize as ki,teardown as Si,generatePlayerInitTime as Ri,PlaybackTypes as me,toMuxVideoURL as Ci,MediaError as vs,getError as _i,CmcdTypeValues as ai,addCuePoints as Oi,getCuePoints as Pi,getActiveCuePoint as Ii,addChapters as Li,getActiveChapter as Mi,getStartDate as wi,getCurrentPdt as xi,getStreamType as Ni,getTargetLiveWindow as Di,getLiveEdgeStart as Vi,getSeekable as Gi,getEnded as Bi,getChapters as Ki,toPlaybackIdFromSrc as qi,toPlaybackIdParts as Fi}from"@mux/playback-core";var mi=()=>{try{return"0.22.0"}catch{}return"UNKNOWN"},pi=mi(),Ie=()=>pi;var ve=["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 gi(e){return` `}function Ei(e){return` `}var we=(e,{tag:r,is:t})=>{var l,f,d,T,C,xe,mt,x,a,m,nt,w,be,L,Ne,O,De;let s=(f=(l=globalThis.document)==null?void 0:l.createElement)==null?void 0:f.call(l,r,{is:t}),n=s?Ti(s):[];return d=class extends e{constructor(){super();u(this,m);u(this,w);u(this,L);u(this,O);u(this,mt,void 0);u(this,x,void 0);u(this,a,new Map)}static get observedAttributes(){var g,v,P;return A(g=d,C,xe).call(g),[...(P=(v=s==null?void 0:s.constructor)==null?void 0:v.observedAttributes)!=null?P:[],"autopictureinpicture","disablepictureinpicture","disableremoteplayback","autoplay","controls","controlslist","crossorigin","loop","muted","playsinline","poster","preload","src"]}get nativeEl(){var p,g,v;return A(this,m,nt).call(this),(v=(g=(p=i(this,x))!=null?p:this.shadowRoot.querySelector(r))!=null?g:this.querySelector(":scope > [slot=media]"))!=null?v:this.querySelector(r)}set nativeEl(p){h(this,x,p)}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(p){this.toggleAttribute("muted",!!p)}get src(){return this.getAttribute("src")}set src(p){this.setAttribute("src",`${p}`)}get preload(){var p,g;return(g=this.getAttribute("preload"))!=null?g:(p=this.nativeEl)==null?void 0:p.preload}set preload(p){this.setAttribute("preload",`${p}`)}init(){var p,g;if(!this.shadowRoot){this.attachShadow({mode:"open"});let v=bi(this.attributes);t&&(v.is=t),r&&(v.part=r),this.shadowRoot.innerHTML=this.constructor.getTemplateHTML(v)}this.nativeEl.muted=this.hasAttribute("muted");for(let v of n)A(this,L,Ne).call(this,v);this.shadowRoot.addEventListener("slotchange",this),A(this,w,be).call(this);for(let v of this.constructor.Events)(g=(p=this.shadowRoot).addEventListener)==null||g.call(p,v,this,!0)}handleEvent(p){if(p.type==="slotchange"){A(this,w,be).call(this);return}p.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(p.type,{detail:p.detail}))}attributeChangedCallback(p,g,v){A(this,m,nt).call(this),A(this,O,De).call(this,p,g,v)}connectedCallback(){A(this,m,nt).call(this)}},T=new WeakMap,C=new WeakSet,xe=function(){if(i(this,T))return;h(this,T,!0);let p=new Set(this.observedAttributes);p.delete("muted");for(let g of n){if(g in this.prototype)continue;if(typeof s[g]=="function")this.prototype[g]=function(...P){return A(this,m,nt).call(this),this.call?this.call(g,...P):this.nativeEl[g].apply(this.nativeEl,P)};else{let P={get(){var D,Lt,Mt;A(this,m,nt).call(this);let _=g.toLowerCase();if(p.has(_)){let gt=this.getAttribute(_);return gt===null?!1:gt===""?!0:gt}return(Mt=(D=this.get)==null?void 0:D.call(this,g))!=null?Mt:(Lt=this.nativeEl)==null?void 0:Lt[g]}};g!==g.toUpperCase()&&(P.set=function(_){A(this,m,nt).call(this);let D=g.toLowerCase();if(p.has(D)){_===!0||_===!1||_==null?this.toggleAttribute(D,!!_):this.setAttribute(D,_);return}if(this.set){this.set(g,_);return}this.nativeEl[g]=_}),Object.defineProperty(this.prototype,g,P)}}},mt=new WeakMap,x=new WeakMap,a=new WeakMap,m=new WeakSet,nt=function(){i(this,mt)||(h(this,mt,!0),this.init())},w=new WeakSet,be=function(){let p=new Map(i(this,a));this.shadowRoot.querySelector("slot:not([name])").assignedElements({flatten:!0}).filter(g=>["track","source"].includes(g.localName)).forEach(g=>{var P,_;p.delete(g);let v=i(this,a).get(g);v||(v=g.cloneNode(),i(this,a).set(g,v)),(_=(P=this.nativeEl).append)==null||_.call(P,v),v.localName==="track"&&v.default&&(v.kind==="chapters"||v.kind==="metadata")&&v.track.mode==="disabled"&&(v.track.mode="hidden")}),p.forEach(g=>g.remove())},L=new WeakSet,Ne=function(p){if(Object.prototype.hasOwnProperty.call(this,p)){let g=this[p];delete this[p],this[p]=g}},O=new WeakSet,De=function(p,g,v){var P,_,D,Lt,Mt,gt;["id","class"].includes(p)||!d.observedAttributes.includes(p)&&this.constructor.observedAttributes.includes(p)||(v===null?(_=(P=this.nativeEl).removeAttribute)==null||_.call(P,p):((Lt=(D=this.nativeEl).getAttribute)==null?void 0:Lt.call(D,p))!=v&&((gt=(Mt=this.nativeEl).setAttribute)==null||gt.call(Mt,p,v)))},u(d,C),E(d,"getTemplateHTML",r.endsWith("audio")?gi:Ei),E(d,"shadowRootOptions",{mode:"open"}),E(d,"Events",ve),u(d,T,void 0),d};function Ti(e){let r=[];for(let t=Object.getPrototypeOf(e);t&&t!==HTMLElement.prototype;t=Object.getPrototypeOf(t))r.push(...Object.getOwnPropertyNames(t));return r}function Ve(e){let r="";for(let t in e){let s=e[t];s===""?r+=` ${t}`:r+=` ${t}="${s}"`}return r}function bi(e){let r={};for(let t of e)r[t.name]=t.value;return r}var Le,Zt=we((Le=globalThis.HTMLElement)!=null?Le:class{},{tag:"video"}),Me,Qi=we((Me=globalThis.HTMLElement)!=null?Me:class{},{tag:"audio"});var V=new WeakMap,Tt=class extends Error{},te=class extends Error{};var Ge=globalThis.WeakRef?class extends Set{add(e){super.add(new WeakRef(e))}forEach(e){super.forEach(r=>{let t=r.deref();t&&e(t)})}}:Set;function Be(e){var r,t,s;(t=(r=globalThis.chrome)==null?void 0:r.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?e():customElements.whenDefined("google-cast-button").then(e):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(e)}}function Ke(){return globalThis.chrome}function qe(){var t;let e="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${e}"]`))return;let r=document.createElement("script");r.src=e,document.head.append(r)}function U(){var e,r;return(r=(e=globalThis.cast)==null?void 0:e.framework)==null?void 0:r.CastContext.getInstance()}function Nt(){var e;return(e=U())==null?void 0:e.getCurrentSession()}function ee(){var e;return(e=Nt())==null?void 0:e.getSessionObj().media[0]}function Fe(e){return new Promise((r,t)=>{ee().editTracksInfo(e,r,t)})}function Ue(e){return new Promise((r,t)=>{ee().getStatus(e,r,t)})}function ye(e){return U().setOptions({...Ae(),...e})}function Ae(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}var ie=new Ge,Y=new WeakSet,R;Be(()=>{var e,r,t,s;if(!((r=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&r.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}R||(R=cast.framework,U().addEventListener(R.CastContextEventType.CAST_STATE_CHANGED,n=>{ie.forEach(l=>{var f,d;return(d=(f=V.get(l)).onCastStateChanged)==null?void 0:d.call(f,n)})}),U().addEventListener(R.CastContextEventType.SESSION_STATE_CHANGED,n=>{ie.forEach(l=>{var f,d;return(d=(f=V.get(l)).onSessionStateChanged)==null?void 0:d.call(f,n)})}),ie.forEach(n=>{var l,f;return(f=(l=V.get(n)).init)==null?void 0:f.call(l)}))});var Ye=0,y,Dt,I,G,at,dt,j,se,B,ot,ne,je,Vt,ke,oe,We,Gt,Se,ae,He,Bt,Re,re=class extends EventTarget{constructor(t){super();u(this,B);u(this,ne);u(this,Vt);u(this,oe);u(this,Gt);u(this,ae);u(this,Bt);u(this,y,void 0);u(this,Dt,void 0);u(this,I,void 0);u(this,G,void 0);u(this,at,"disconnected");u(this,dt,!1);u(this,j,new Set);u(this,se,new WeakMap);h(this,y,t),ie.add(this),V.set(this,{init:()=>A(this,Gt,Se).call(this),onCastStateChanged:()=>A(this,Vt,ke).call(this),onSessionStateChanged:()=>A(this,oe,We).call(this),getCastPlayer:()=>i(this,B,ot)}),A(this,Gt,Se).call(this)}get state(){return i(this,at)}async watchAvailability(t){if(i(this,y).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");return i(this,se).set(t,++Ye),i(this,j).add(t),Ye}async cancelWatchAvailability(t){if(i(this,y).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");t?i(this,j).delete(t):i(this,j).clear()}async prompt(){var s,n,l,f;if(i(this,y).disableRemotePlayback)throw new Tt("disableRemotePlayback attribute is present.");if(!((n=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&n.isAvailable))throw new te("The RemotePlayback API is disabled on this platform.");let t=Y.has(i(this,y));Y.add(i(this,y)),ye(i(this,y).castOptions),Object.entries(i(this,G)).forEach(([d,T])=>{i(this,I).controller.addEventListener(d,T)});try{await U().requestSession()}catch(d){if(d==="cancel"){t||Y.delete(i(this,y));return}throw new Error(d)}(f=(l=V.get(i(this,y)))==null?void 0:l.loadOnPrompt)==null||f.call(l)}};y=new WeakMap,Dt=new WeakMap,I=new WeakMap,G=new WeakMap,at=new WeakMap,dt=new WeakMap,j=new WeakMap,se=new WeakMap,B=new WeakSet,ot=function(){if(Y.has(i(this,y)))return i(this,I)},ne=new WeakSet,je=function(){Y.has(i(this,y))&&(Object.entries(i(this,G)).forEach(([t,s])=>{i(this,I).controller.removeEventListener(t,s)}),Y.delete(i(this,y)),i(this,y).muted=i(this,I).isMuted,i(this,y).currentTime=i(this,I).savedPlayerState.currentTime,i(this,I).savedPlayerState.isPaused===!1&&i(this,y).play())},Vt=new WeakSet,ke=function(){let t=U().getCastState();if(Y.has(i(this,y))&&t==="CONNECTING"&&(h(this,at,"connecting"),this.dispatchEvent(new Event("connecting"))),!i(this,dt)&&(t!=null&&t.includes("CONNECT"))){h(this,dt,!0);for(let s of i(this,j))s(!0)}else if(i(this,dt)&&(!t||t==="NO_DEVICES_AVAILABLE")){h(this,dt,!1);for(let s of i(this,j))s(!1)}},oe=new WeakSet,We=async function(){var s;let{SESSION_RESUMED:t}=R.SessionState;if(U().getSessionState()===t&&i(this,y).castSrc===((s=ee())==null?void 0:s.media.contentId)){Y.add(i(this,y)),Object.entries(i(this,G)).forEach(([n,l])=>{i(this,I).controller.addEventListener(n,l)});try{await Ue(new chrome.cast.media.GetStatusRequest)}catch(n){console.error(n)}i(this,G)[R.RemotePlayerEventType.IS_PAUSED_CHANGED](),i(this,G)[R.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},Gt=new WeakSet,Se=function(){!R||i(this,Dt)||(h(this,Dt,!0),ye(i(this,y).castOptions),i(this,y).textTracks.addEventListener("change",()=>A(this,Bt,Re).call(this)),A(this,Vt,ke).call(this),h(this,I,new R.RemotePlayer),new R.RemotePlayerController(i(this,I)),h(this,G,{[R.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(h(this,at,"connected"),this.dispatchEvent(new Event("connect"))):(A(this,ne,je).call(this),h(this,at,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[R.RemotePlayerEventType.DURATION_CHANGED]:()=>{i(this,y).dispatchEvent(new Event("durationchange"))},[R.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{i(this,y).dispatchEvent(new Event("volumechange"))},[R.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{i(this,y).dispatchEvent(new Event("volumechange"))},[R.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=i(this,B,ot))!=null&&t.isMediaLoaded&&i(this,y).dispatchEvent(new Event("timeupdate"))},[R.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{i(this,y).dispatchEvent(new Event("resize"))},[R.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{i(this,y).dispatchEvent(new Event(this.paused?"pause":"play"))},[R.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=i(this,B,ot))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&i(this,y).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=i(this,B,ot))==null?void 0:s.playerState]))},[R.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=i(this,B,ot))!=null&&t.isMediaLoaded&&(await Promise.resolve(),A(this,ae,He).call(this))}}))},ae=new WeakSet,He=function(){A(this,Bt,Re).call(this)},Bt=new WeakSet,Re=async function(){var x,a,m,S,w;if(!i(this,B,ot))return;let s=((a=(x=i(this,I).mediaInfo)==null?void 0:x.tracks)!=null?a:[]).filter(({type:k})=>k===chrome.cast.media.TrackType.TEXT),n=[...i(this,y).textTracks].filter(({kind:k})=>k==="subtitles"||k==="captions"),l=s.map(({language:k,name:L,trackId:pt})=>{var st;let{mode:O}=(st=n.find(N=>N.language===k&&N.label===L))!=null?st:{};return O?{mode:O,trackId:pt}:!1}).filter(Boolean),d=l.filter(({mode:k})=>k!=="showing").map(({trackId:k})=>k),T=l.find(({mode:k})=>k==="showing"),C=(w=(S=(m=Nt())==null?void 0:m.getSessionObj().media[0])==null?void 0:S.activeTrackIds)!=null?w:[],F=C;if(C.length&&(F=F.filter(k=>!d.includes(k))),T!=null&&T.trackId&&(F=[...F,T.trackId]),F=[...new Set(F)],!((k,L)=>k.length===L.length&&k.every(pt=>L.includes(pt)))(C,F))try{let k=new chrome.cast.media.EditTracksInfoRequest(F);await Fe(k)}catch(k){console.error(k)}};var $e=e=>{var r,t,s,n,l,f,d,b,C,ze;return t=class extends e{constructor(){super(...arguments);u(this,d);u(this,C);u(this,s,{paused:!1});u(this,n,Ae());u(this,l,void 0);u(this,f,void 0)}get remote(){return i(this,f)?i(this,f):Ke()?(qe(),V.set(this,{loadOnPrompt:()=>A(this,C,ze).call(this)}),h(this,f,new re(this))):super.remote}attributeChangedCallback(a,m,S){if(super.attributeChangedCallback(a,m,S),a==="cast-receiver"&&S){i(this,n).receiverApplicationId=S;return}if(i(this,d,b))switch(a){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var L,pt;if(!i(this,d,b))return super.load();let a=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);a.customData=this.castCustomData;let m=[...this.querySelectorAll("track")].filter(({kind:O,src:st})=>st&&(O==="subtitles"||O==="captions")),S=[],w=0;m.length&&(a.tracks=m.map(O=>{let st=++w;S.length===0&&O.track.mode==="showing"&&S.push(st);let N=new chrome.cast.media.Track(st,chrome.cast.media.TrackType.TEXT);return N.trackContentId=O.src,N.trackContentType="text/vtt",N.subtype=O.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,N.name=O.label,N.language=O.srclang,N})),this.castStreamType==="live"?a.streamType=chrome.cast.media.StreamType.LIVE:a.streamType=chrome.cast.media.StreamType.BUFFERED,a.metadata=new chrome.cast.media.GenericMediaMetadata,a.metadata.title=this.title,a.metadata.images=[{url:this.poster}];let k=new chrome.cast.media.LoadRequest(a);k.currentTime=(L=super.currentTime)!=null?L:0,k.autoplay=!i(this,s).paused,k.activeTrackIds=S,await((pt=Nt())==null?void 0:pt.loadMedia(k)),this.dispatchEvent(new Event("volumechange"))}play(){var a;if(i(this,d,b)){i(this,d,b).isPaused&&((a=i(this,d,b).controller)==null||a.playOrPause());return}return super.play()}pause(){var a;if(i(this,d,b)){i(this,d,b).isPaused||(a=i(this,d,b).controller)==null||a.playOrPause();return}super.pause()}get castOptions(){return i(this,n)}get castReceiver(){var a;return(a=this.getAttribute("cast-receiver"))!=null?a:void 0}set castReceiver(a){this.castReceiver!=a&&this.setAttribute("cast-receiver",`${a}`)}get castSrc(){var a,m,S;return(S=(m=this.getAttribute("cast-src"))!=null?m:(a=this.querySelector("source"))==null?void 0:a.src)!=null?S:this.currentSrc}set castSrc(a){this.castSrc!=a&&this.setAttribute("cast-src",`${a}`)}get castContentType(){var a;return(a=this.getAttribute("cast-content-type"))!=null?a:void 0}set castContentType(a){this.setAttribute("cast-content-type",`${a}`)}get castStreamType(){var a,m;return(m=(a=this.getAttribute("cast-stream-type"))!=null?a:this.streamType)!=null?m:void 0}set castStreamType(a){this.setAttribute("cast-stream-type",`${a}`)}get castCustomData(){return i(this,l)}set castCustomData(a){let m=typeof a;if(!["object","undefined"].includes(m)){console.error(`castCustomData must be nullish or an object but value was of type ${m}`);return}h(this,l,a)}get readyState(){if(i(this,d,b))switch(i(this,d,b).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,d,b)?i(this,d,b).isPaused:super.paused}get muted(){var a;return i(this,d,b)?(a=i(this,d,b))==null?void 0:a.isMuted:super.muted}set muted(a){var m;if(i(this,d,b)){(a&&!i(this,d,b).isMuted||!a&&i(this,d,b).isMuted)&&((m=i(this,d,b).controller)==null||m.muteOrUnmute());return}super.muted=a}get volume(){var a,m;return i(this,d,b)?(m=(a=i(this,d,b))==null?void 0:a.volumeLevel)!=null?m:1:super.volume}set volume(a){var m;if(i(this,d,b)){i(this,d,b).volumeLevel=+a,(m=i(this,d,b).controller)==null||m.setVolumeLevel();return}super.volume=a}get duration(){var a,m,S;return i(this,d,b)&&((a=i(this,d,b))!=null&&a.isMediaLoaded)?(S=(m=i(this,d,b))==null?void 0:m.duration)!=null?S:NaN:super.duration}get currentTime(){var a,m,S;return i(this,d,b)&&((a=i(this,d,b))!=null&&a.isMediaLoaded)?(S=(m=i(this,d,b))==null?void 0:m.currentTime)!=null?S:0:super.currentTime}set currentTime(a){var m;if(i(this,d,b)){i(this,d,b).currentTime=a,(m=i(this,d,b).controller)==null||m.seek();return}super.currentTime=a}},s=new WeakMap,n=new WeakMap,l=new WeakMap,f=new WeakMap,d=new WeakSet,b=function(){var a,m;return(m=(a=V.get(this.remote))==null?void 0:a.getCastPlayer)==null?void 0:m.call(a)},C=new WeakSet,ze=async function(){i(this,s).paused=Jt(t.prototype,this,"paused"),Jt(t.prototype,this,"pause").call(this),this.muted=Jt(t.prototype,this,"muted");try{await this.load()}catch(a){console.error(a)}},E(t,"observedAttributes",[...(r=e.observedAttributes)!=null?r:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var K=class extends Event{constructor(t,s){super(t);E(this,"track");this.track=s.track}};var Ce=new WeakMap;function c(e){var r;return(r=Ce.get(e))!=null?r:vi(e,{})}function vi(e,r){let t=Ce.get(e);return t||Ce.set(e,t={}),Object.assign(t,r)}function de(e,r){let t=e.videoTracks;c(r).media=e,c(r).renditionSet||(c(r).renditionSet=new Set);let s=c(t).trackSet;s.add(r);let n=s.size-1;n in ct.prototype||Object.defineProperty(ct.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new K("addtrack",{track:r}))})}function ue(e){var s;let r=(s=c(e).media)==null?void 0:s.videoTracks;if(!r)return;c(r).trackSet.delete(e),queueMicrotask(()=>{r.dispatchEvent(new K("removetrack",{track:e}))})}function Xe(e){var s;let r=(s=c(e).media.videoTracks)!=null?s:[],t=!1;for(let n of r)n!==e&&(n.selected=!1,t=!0);if(t){if(c(r).changeRequested)return;c(r).changeRequested=!0,queueMicrotask(()=>{delete c(r).changeRequested,r.dispatchEvent(new Event("change"))})}}var W,H,$,ut,Kt,ct=class extends EventTarget{constructor(){super();u(this,ut);u(this,W,void 0);u(this,H,void 0);u(this,$,void 0);c(this).trackSet=new Set}[Symbol.iterator](){return i(this,ut,Kt).values()}get length(){return i(this,ut,Kt).size}getTrackById(t){var s;return(s=[...i(this,ut,Kt)].find(n=>n.id===t))!=null?s:null}get selectedIndex(){return[...i(this,ut,Kt)].findIndex(t=>t.selected)}get onaddtrack(){return i(this,W)}set onaddtrack(t){i(this,W)&&(this.removeEventListener("addtrack",i(this,W)),h(this,W,void 0)),typeof t=="function"&&(h(this,W,t),this.addEventListener("addtrack",t))}get onremovetrack(){return i(this,H)}set onremovetrack(t){i(this,H)&&(this.removeEventListener("removetrack",i(this,H)),h(this,H,void 0)),typeof t=="function"&&(h(this,H,t),this.addEventListener("removetrack",t))}get onchange(){return i(this,$)}set onchange(t){i(this,$)&&(this.removeEventListener("change",i(this,$)),h(this,$,void 0)),typeof t=="function"&&(h(this,$,t),this.addEventListener("change",t))}};W=new WeakMap,H=new WeakMap,$=new WeakMap,ut=new WeakSet,Kt=function(){return c(this).trackSet};var q=class extends Event{constructor(t,s){super(t);E(this,"rendition");this.rendition=s.rendition}};function Je(e,r){let t=c(e).media.videoRenditions;c(r).media=c(e).media,c(r).track=e;let s=c(e).renditionSet;s.add(r);let n=s.size-1;n in ht.prototype||Object.defineProperty(ht.prototype,n,{get(){return bt(this)[n]}}),queueMicrotask(()=>{e.selected&&t.dispatchEvent(new q("addrendition",{rendition:r}))})}function Qe(e){let r=c(e).media.videoRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.selected&&r.dispatchEvent(new q("removerendition",{rendition:e}))})}function Ze(e){let r=c(e).media.videoRenditions;!r||c(r).changeRequested||(c(r).changeRequested=!0,queueMicrotask(()=>{delete c(r).changeRequested,c(e).track.selected&&r.dispatchEvent(new Event("change"))}))}function bt(e){return[...c(e).media.videoTracks].filter(t=>t.selected).flatMap(t=>[...c(t).renditionSet])}var z,X,J,ht=class extends EventTarget{constructor(){super(...arguments);u(this,z,void 0);u(this,X,void 0);u(this,J,void 0)}[Symbol.iterator](){return bt(this).values()}get length(){return bt(this).length}getRenditionById(t){var s;return(s=bt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return bt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of bt(this).entries())n.selected=s===t}get onaddrendition(){return i(this,z)}set onaddrendition(t){i(this,z)&&(this.removeEventListener("addrendition",i(this,z)),h(this,z,void 0)),typeof t=="function"&&(h(this,z,t),this.addEventListener("addrendition",t))}get onremoverendition(){return i(this,X)}set onremoverendition(t){i(this,X)&&(this.removeEventListener("removerendition",i(this,X)),h(this,X,void 0)),typeof t=="function"&&(h(this,X,t),this.addEventListener("removerendition",t))}get onchange(){return i(this,J)}set onchange(t){i(this,J)&&(this.removeEventListener("change",i(this,J)),h(this,J,void 0)),typeof t=="function"&&(h(this,J,t),this.addEventListener("change",t))}};z=new WeakMap,X=new WeakMap,J=new WeakMap;var vt,qt=class{constructor(){E(this,"src");E(this,"id");E(this,"width");E(this,"height");E(this,"bitrate");E(this,"frameRate");E(this,"codec");u(this,vt,!1)}get selected(){return i(this,vt)}set selected(r){i(this,vt)!==r&&(h(this,vt,r),Ze(this))}};vt=new WeakMap;var yt,At=class{constructor(){E(this,"id");E(this,"kind");E(this,"label","");E(this,"language","");E(this,"sourceBuffer");u(this,yt,!1)}addRendition(r,t,s,n,l,f){let d=new qt;return d.src=r,d.width=t,d.height=s,d.frameRate=f,d.bitrate=l,d.codec=n,Je(this,d),d}removeRendition(r){Qe(r)}get selected(){return i(this,yt)}set selected(r){i(this,yt)!==r&&(h(this,yt,r),r===!0&&Xe(this))}};yt=new WeakMap;function ti(e,r){let t=c(e).media.audioRenditions;c(r).media=c(e).media,c(r).track=e;let s=c(e).renditionSet;s.add(r);let n=s.size-1;n in lt.prototype||Object.defineProperty(lt.prototype,n,{get(){return kt(this)[n]}}),queueMicrotask(()=>{e.enabled&&t.dispatchEvent(new q("addrendition",{rendition:r}))})}function ei(e){let r=c(e).media.audioRenditions,t=c(e).track;c(t).renditionSet.delete(e),queueMicrotask(()=>{c(e).track.enabled&&r.dispatchEvent(new q("removerendition",{rendition:e}))})}function ii(e){let r=c(e).media.audioRenditions;!r||c(r).changeRequested||(c(r).changeRequested=!0,queueMicrotask(()=>{delete c(r).changeRequested,c(e).track.enabled&&r.dispatchEvent(new Event("change"))}))}function kt(e){return[...c(e).media.audioTracks].filter(t=>t.enabled).flatMap(t=>[...c(t).renditionSet])}var Q,Z,tt,lt=class extends EventTarget{constructor(){super(...arguments);u(this,Q,void 0);u(this,Z,void 0);u(this,tt,void 0)}[Symbol.iterator](){return kt(this).values()}get length(){return kt(this).length}getRenditionById(t){var s;return(s=kt(this).find(n=>`${n.id}`==`${t}`))!=null?s:null}get selectedIndex(){return kt(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,n]of kt(this).entries())n.selected=s===t}get onaddrendition(){return i(this,Q)}set onaddrendition(t){i(this,Q)&&(this.removeEventListener("addrendition",i(this,Q)),h(this,Q,void 0)),typeof t=="function"&&(h(this,Q,t),this.addEventListener("addrendition",t))}get onremoverendition(){return i(this,Z)}set onremoverendition(t){i(this,Z)&&(this.removeEventListener("removerendition",i(this,Z)),h(this,Z,void 0)),typeof t=="function"&&(h(this,Z,t),this.addEventListener("removerendition",t))}get onchange(){return i(this,tt)}set onchange(t){i(this,tt)&&(this.removeEventListener("change",i(this,tt)),h(this,tt,void 0)),typeof t=="function"&&(h(this,tt,t),this.addEventListener("change",t))}};Q=new WeakMap,Z=new WeakMap,tt=new WeakMap;var St,Ft=class{constructor(){E(this,"src");E(this,"id");E(this,"bitrate");E(this,"codec");u(this,St,!1)}get selected(){return i(this,St)}set selected(r){i(this,St)!==r&&(h(this,St,r),ii(this))}};St=new WeakMap;function he(e,r){let t=e.audioTracks;c(r).media=e,c(r).renditionSet||(c(r).renditionSet=new Set);let s=c(t).trackSet;s.add(r);let n=s.size-1;n in ft.prototype||Object.defineProperty(ft.prototype,n,{get(){return[...c(this).trackSet][n]}}),queueMicrotask(()=>{t.dispatchEvent(new K("addtrack",{track:r}))})}function le(e){var s;let r=(s=c(e).media)==null?void 0:s.audioTracks;if(!r)return;c(r).trackSet.delete(e),queueMicrotask(()=>{r.dispatchEvent(new K("removetrack",{track:e}))})}function ri(e){let r=c(e).media.audioTracks;!r||c(r).changeRequested||(c(r).changeRequested=!0,queueMicrotask(()=>{delete c(r).changeRequested,r.dispatchEvent(new Event("change"))}))}var et,it,rt,Rt,ce,ft=class extends EventTarget{constructor(){super();u(this,Rt);u(this,et,void 0);u(this,it,void 0);u(this,rt,void 0);c(this).trackSet=new Set}[Symbol.iterator](){return i(this,Rt,ce).values()}get length(){return i(this,Rt,ce).size}getTrackById(t){var s;return(s=[...i(this,Rt,ce)].find(n=>n.id===t))!=null?s:null}get onaddtrack(){return i(this,et)}set onaddtrack(t){i(this,et)&&(this.removeEventListener("addtrack",i(this,et)),h(this,et,void 0)),typeof t=="function"&&(h(this,et,t),this.addEventListener("addtrack",t))}get onremovetrack(){return i(this,it)}set onremovetrack(t){i(this,it)&&(this.removeEventListener("removetrack",i(this,it)),h(this,it,void 0)),typeof t=="function"&&(h(this,it,t),this.addEventListener("removetrack",t))}get onchange(){return i(this,rt)}set onchange(t){i(this,rt)&&(this.removeEventListener("change",i(this,rt)),h(this,rt,void 0)),typeof t=="function"&&(h(this,rt,t),this.addEventListener("change",t))}};et=new WeakMap,it=new WeakMap,rt=new WeakMap,Rt=new WeakSet,ce=function(){return c(this).trackSet};var Ct,_t=class{constructor(){E(this,"id");E(this,"kind");E(this,"label","");E(this,"language","");E(this,"sourceBuffer");u(this,Ct,!1)}addRendition(r,t,s){let n=new Ft;return n.src=r,n.codec=t,n.bitrate=s,ti(this,n),n}removeRendition(r){ei(r)}get enabled(){return i(this,Ct)}set enabled(r){i(this,Ct)!==r&&(h(this,Ct,r),ri(this))}};Ct=new WeakMap;var si=fe(globalThis.HTMLMediaElement,"video"),ni=fe(globalThis.HTMLMediaElement,"audio");function oi(e){if(!(e!=null&&e.prototype))return e;let r=fe(e,"video");(!r||`${r}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"videoTracks",{get(){return yi(this)}});let t=fe(e,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(e.prototype,"audioTracks",{get(){return Ai(this)}}),"addVideoTrack"in e.prototype||(e.prototype.addVideoTrack=function(l,f="",d=""){let T=new At;return T.kind=l,T.label=f,T.language=d,de(this,T),T}),"removeVideoTrack"in e.prototype||(e.prototype.removeVideoTrack=ue),"addAudioTrack"in e.prototype||(e.prototype.addAudioTrack=function(l,f="",d=""){let T=new _t;return T.kind=l,T.label=f,T.language=d,he(this,T),T}),"removeAudioTrack"in e.prototype||(e.prototype.removeAudioTrack=le),"videoRenditions"in e.prototype||Object.defineProperty(e.prototype,"videoRenditions",{get(){return s(this)}});let s=l=>{let f=c(l).videoRenditions;return f||(f=new ht,c(f).media=l,c(l).videoRenditions=f),f};"audioRenditions"in e.prototype||Object.defineProperty(e.prototype,"audioRenditions",{get(){return n(this)}});let n=l=>{let f=c(l).audioRenditions;return f||(f=new lt,c(f).media=l,c(l).audioRenditions=f),f};return e}function fe(e,r){var t;if(e!=null&&e.prototype)return(t=Object.getOwnPropertyDescriptor(e.prototype,`${r}Tracks`))==null?void 0:t.get}function yi(e){var t;let r=c(e).videoTracks;if(!r&&(r=new ct,c(e).videoTracks=r,si)){let s=si.call((t=e.nativeEl)!=null?t:e);for(let n of s)de(e,n);s.addEventListener("change",()=>{r.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...r].some(l=>l instanceof At)){for(let l of s)ue(l);return}de(e,n.track)}),s.addEventListener("removetrack",n=>{ue(n.track)})}return r}function Ai(e){var t;let r=c(e).audioTracks;if(!r&&(r=new ft,c(e).audioTracks=r,ni)){let s=ni.call((t=e.nativeEl)!=null?t:e);for(let n of s)he(e,n);s.addEventListener("change",()=>{r.dispatchEvent(new Event("change"))}),s.addEventListener("addtrack",n=>{if([...r].some(l=>l instanceof _t)){for(let l of s)le(l);return}he(e,n.track)}),s.addEventListener("removetrack",n=>{le(n.track)})}return r}ve.push("castchange","entercast","leavecast");var o={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"},Ui=Object.values(o),Yi=Ie(),ji="mux-video",M,Ot,Yt,Pt,jt,Wt,Ht,$t,zt,It,pe,_e=class extends Zt{constructor(){super();u(this,It);u(this,M,void 0);u(this,Ot,void 0);u(this,Yt,void 0);u(this,Pt,{});u(this,jt,{});u(this,Wt,void 0);u(this,Ht,void 0);u(this,$t,void 0);u(this,zt,void 0);h(this,Yt,Ri())}static get observedAttributes(){var t;return[...Ui,...(t=Zt.observedAttributes)!=null?t:[]]}get preferCmcd(){var t;return(t=this.getAttribute(o.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?ai.includes(t)?this.setAttribute(o.PREFER_CMCD,t):console.warn(`Invalid value for preferCmcd. Must be one of ${ai.join()}`):this.removeAttribute(o.PREFER_CMCD))}get playerInitTime(){return i(this,Yt)}get playerSoftwareName(){var t;return(t=i(this,$t))!=null?t:ji}set playerSoftwareName(t){h(this,$t,t)}get playerSoftwareVersion(){var t;return(t=i(this,Ht))!=null?t:Yi}set playerSoftwareVersion(t){h(this,Ht,t)}get _hls(){var t;return(t=i(this,M))==null?void 0:t.engine}get mux(){var t;return(t=this.nativeEl)==null?void 0:t.mux}get error(){var t;return(t=_i(this.nativeEl))!=null?t:null}get errorTranslator(){return i(this,zt)}set errorTranslator(t){h(this,zt,t)}get src(){return this.getAttribute("src")}set src(t){t!==this.src&&(t==null?this.removeAttribute("src"):this.setAttribute("src",t))}get type(){var t;return(t=this.getAttribute(o.TYPE))!=null?t:void 0}set type(t){t!==this.type&&(t?this.setAttribute(o.TYPE,t):this.removeAttribute(o.TYPE))}get autoplay(){let t=this.getAttribute("autoplay");return t===null?!1:t===""?!0:t}set autoplay(t){let s=this.autoplay;t!==s&&(t?this.setAttribute("autoplay",typeof t=="string"?t:""):this.removeAttribute("autoplay"))}get preload(){let t=this.getAttribute("preload");return t===""?"auto":["none","metadata","auto"].includes(t)?t:super.preload}set preload(t){t!=this.getAttribute("preload")&&(["","none","metadata","auto"].includes(t)?this.setAttribute("preload",t):this.removeAttribute("preload"))}get debug(){return this.getAttribute(o.DEBUG)!=null}set debug(t){t!==this.debug&&(t?this.setAttribute(o.DEBUG,""):this.removeAttribute(o.DEBUG))}get disableTracking(){return this.hasAttribute(o.DISABLE_TRACKING)}set disableTracking(t){t!==this.disableTracking&&this.toggleAttribute(o.DISABLE_TRACKING,!!t)}get disableCookies(){return this.hasAttribute(o.DISABLE_COOKIES)}set disableCookies(t){t!==this.disableCookies&&(t?this.setAttribute(o.DISABLE_COOKIES,""):this.removeAttribute(o.DISABLE_COOKIES))}get startTime(){let t=this.getAttribute(o.START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set startTime(t){t!==this.startTime&&(t==null?this.removeAttribute(o.START_TIME):this.setAttribute(o.START_TIME,`${t}`))}get playbackId(){var t;return this.hasAttribute(o.PLAYBACK_ID)?this.getAttribute(o.PLAYBACK_ID):(t=qi(this.src))!=null?t:void 0}set playbackId(t){t!==this.playbackId&&(t?this.setAttribute(o.PLAYBACK_ID,t):this.removeAttribute(o.PLAYBACK_ID))}get maxResolution(){var t;return(t=this.getAttribute(o.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(o.MAX_RESOLUTION,t):this.removeAttribute(o.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(o.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(o.MIN_RESOLUTION,t):this.removeAttribute(o.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(o.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(o.RENDITION_ORDER,t):this.removeAttribute(o.RENDITION_ORDER))}get programStartTime(){let t=this.getAttribute(o.PROGRAM_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programStartTime(t){t==null?this.removeAttribute(o.PROGRAM_START_TIME):this.setAttribute(o.PROGRAM_START_TIME,`${t}`)}get programEndTime(){let t=this.getAttribute(o.PROGRAM_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set programEndTime(t){t==null?this.removeAttribute(o.PROGRAM_END_TIME):this.setAttribute(o.PROGRAM_END_TIME,`${t}`)}get assetStartTime(){let t=this.getAttribute(o.ASSET_START_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetStartTime(t){t==null?this.removeAttribute(o.ASSET_START_TIME):this.setAttribute(o.ASSET_START_TIME,`${t}`)}get assetEndTime(){let t=this.getAttribute(o.ASSET_END_TIME);if(t==null)return;let s=+t;return Number.isNaN(s)?void 0:s}set assetEndTime(t){t==null?this.removeAttribute(o.ASSET_END_TIME):this.setAttribute(o.ASSET_END_TIME,`${t}`)}get customDomain(){var t;return(t=this.getAttribute(o.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(o.CUSTOM_DOMAIN,t):this.removeAttribute(o.CUSTOM_DOMAIN))}get drmToken(){var t;return(t=this.getAttribute(o.DRM_TOKEN))!=null?t:void 0}set drmToken(t){t!==this.drmToken&&(t?this.setAttribute(o.DRM_TOKEN,t):this.removeAttribute(o.DRM_TOKEN))}get playbackToken(){var t,s,n,l;if(this.hasAttribute(o.PLAYBACK_TOKEN))return(t=this.getAttribute(o.PLAYBACK_TOKEN))!=null?t:void 0;if(this.hasAttribute(o.PLAYBACK_ID)){let[,f]=Fi((s=this.playbackId)!=null?s:"");return(n=new URLSearchParams(f).get("token"))!=null?n:void 0}if(this.src)return(l=new URLSearchParams(this.src).get("token"))!=null?l:void 0}set playbackToken(t){t!==this.playbackToken&&(t?this.setAttribute(o.PLAYBACK_TOKEN,t):this.removeAttribute(o.PLAYBACK_TOKEN))}get tokens(){let t=this.getAttribute(o.PLAYBACK_TOKEN),s=this.getAttribute(o.DRM_TOKEN);return{...i(this,jt),...t!=null?{playback:t}:{},...s!=null?{drm:s}:{}}}set tokens(t){h(this,jt,t!=null?t:{})}get ended(){return Bi(this.nativeEl,this._hls)}get envKey(){var t;return(t=this.getAttribute(o.ENV_KEY))!=null?t:void 0}set envKey(t){t!==this.envKey&&(t?this.setAttribute(o.ENV_KEY,t):this.removeAttribute(o.ENV_KEY))}get beaconCollectionDomain(){var t;return(t=this.getAttribute(o.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(o.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(o.BEACON_COLLECTION_DOMAIN))}get streamType(){var t;return(t=this.getAttribute(o.STREAM_TYPE))!=null?t:Ni(this.nativeEl)}set streamType(t){t!==this.streamType&&(t?this.setAttribute(o.STREAM_TYPE,t):this.removeAttribute(o.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(o.TARGET_LIVE_WINDOW)?+this.getAttribute(o.TARGET_LIVE_WINDOW):Di(this.nativeEl)}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(o.TARGET_LIVE_WINDOW):this.setAttribute(o.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t,s;if(this.hasAttribute(o.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:n}=this,l=(t=this.nativeEl.seekable.end(0))!=null?t:0,f=(s=this.nativeEl.seekable.start(0))!=null?s:0;return Math.max(f,l-n)}return Vi(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(o.LIVE_EDGE_OFFSET))return+this.getAttribute(o.LIVE_EDGE_OFFSET)}set liveEdgeOffset(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(o.LIVE_EDGE_OFFSET):this.setAttribute(o.LIVE_EDGE_OFFSET,`${+t}`))}get seekable(){return Gi(this.nativeEl)}async addCuePoints(t){return Oi(this.nativeEl,t)}get activeCuePoint(){return Ii(this.nativeEl)}get cuePoints(){return Pi(this.nativeEl)}async addChapters(t){return Li(this.nativeEl,t)}get activeChapter(){return Mi(this.nativeEl)}get chapters(){return Ki(this.nativeEl)}getStartDate(){return wi(this.nativeEl,this._hls)}get currentPdt(){return xi(this.nativeEl,this._hls)}get preferPlayback(){let t=this.getAttribute(o.PREFER_PLAYBACK);if(t===me.MSE||t===me.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===me.MSE||t===me.NATIVE?this.setAttribute(o.PREFER_PLAYBACK,t):this.removeAttribute(o.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(s=>s.startsWith("metadata-")&&![o.METADATA_URL].includes(s)).reduce((s,n)=>{let l=this.getAttribute(n);return l!=null&&(s[n.replace(/^metadata-/,"").replace(/-/g,"_")]=l),s},{}),...i(this,Pt)}}set metadata(t){h(this,Pt,t!=null?t:{}),this.mux&&this.mux.emit("hb",i(this,Pt))}get _hlsConfig(){return i(this,Wt)}set _hlsConfig(t){h(this,Wt,t)}load(){h(this,M,ki(this,this.nativeEl,i(this,M)))}unload(){Si(this.nativeEl,i(this,M)),h(this,M,void 0)}attributeChangedCallback(t,s,n){var f,d;switch(Zt.observedAttributes.includes(t)&&!["src","autoplay","preload"].includes(t)&&super.attributeChangedCallback(t,s,n),t){case o.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=n!=null?n:void 0;break;case o.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=n!=null?n:void 0;break;case"src":{let T=!!s,C=!!n;!T&&C?A(this,It,pe).call(this):T&&!C?this.unload():T&&C&&(this.unload(),A(this,It,pe).call(this));break}case"autoplay":if(n===s)break;(f=i(this,M))==null||f.setAutoplay(this.autoplay);break;case"preload":if(n===s)break;(d=i(this,M))==null||d.setPreload(n);break;case o.PLAYBACK_ID:this.src=Ci(this);break;case o.DEBUG:{let T=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=T);break}case o.METADATA_URL:n&&fetch(n).then(T=>T.json()).then(T=>this.metadata=T).catch(()=>console.error(`Unable to load or parse metadata JSON from metadata-url ${n}!`));break;case o.STREAM_TYPE:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case o.TARGET_LIVE_WINDOW:(n==null||n!==s)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;default:break}}connectedCallback(){var t;(t=super.connectedCallback)==null||t.call(this),this.nativeEl&&this.src&&!i(this,M)&&A(this,It,pe).call(this)}disconnectedCallback(){this.unload()}};M=new WeakMap,Ot=new WeakMap,Yt=new WeakMap,Pt=new WeakMap,jt=new WeakMap,Wt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,zt=new WeakMap,It=new WeakSet,pe=async function(){i(this,Ot)||(await h(this,Ot,Promise.resolve()),h(this,Ot,null),this.load())};var Xt,Ut=class extends $e(oi(_e)){constructor(){super(...arguments);u(this,Xt,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 t;return(t=i(this,Xt))!=null?t:this.muxCastCustomData}set castCustomData(t){h(this,Xt,t)}};Xt=new WeakMap;Qt.customElements.get("mux-video")||(Qt.customElements.define("mux-video",Ut),Qt.MuxVideoElement=Ut);var Cs=Ut;export{o as Attributes,vs as MediaError,ve as VideoEvents,Cs as default}; //# sourceMappingURL=index.mjs.map