@mux/mux-player 3.13.2 → 3.13.3-canary.1

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.
@@ -135,7 +135,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
135
135
  <slot name="logo">
136
136
  ${this.getLogoHTML((e=i[k.LOGO])!=null?e:"")}
137
137
  </slot>
138
- `}get preferCmcd(){var i;return(i=this.getAttribute(k.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?la.includes(i)?this.setAttribute(k.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${la.join()}`):this.removeAttribute(k.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(k.PLAYER_INIT_TIME)?+this.getAttribute(k.PLAYER_INIT_TIME):pt(this,Xu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(k.PLAYER_INIT_TIME):this.setAttribute(k.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=pt(this,tc))!=null?i:f_}set playerSoftwareName(i){Pi(this,tc,i)}get playerSoftwareVersion(){var i;return(i=pt(this,ec))!=null?i:h_}set playerSoftwareVersion(i){Pi(this,ec,i)}get _hls(){var i;return(i=pt(this,Ei,nn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Ug(this.nativeEl))!=null?i:null}get errorTranslator(){return pt(this,ic)}set errorTranslator(i){Pi(this,ic,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(k.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(k.TYPE,i):this.removeAttribute(k.TYPE))}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(k.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(k.DEBUG,""):this.removeAttribute(k.DEBUG))}get disableTracking(){return this.hasAttribute(k.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(k.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(k.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(k.DISABLE_COOKIES,""):this.removeAttribute(k.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(k.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(k.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(k.DISABLE_PSEUDO_ENDED))}get maxReconnectRetries(){let i=this.getAttribute(k.MAX_RECONNECT_RETRIES);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set maxReconnectRetries(i){i!==this.maxReconnectRetries&&(i==null?this.removeAttribute(k.MAX_RECONNECT_RETRIES):this.setAttribute(k.MAX_RECONNECT_RETRIES,`${i}`))}get startTime(){let i=this.getAttribute(k.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(k.START_TIME):this.setAttribute(k.START_TIME,`${i}`))}get initialBandwidthEstimateKbps(){let i=this.getAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialBandwidthEstimateKbps(i){i!==this.initialBandwidthEstimateKbps&&(i==null?this.removeAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS):this.setAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS,`${i}`))}get initialEstimateSegments(){let i=this.getAttribute(k.INITIAL_ESTIMATE_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialEstimateSegments(i){i!==this.initialEstimateSegments&&(i==null?this.removeAttribute(k.INITIAL_ESTIMATE_SEGMENTS):this.setAttribute(k.INITIAL_ESTIMATE_SEGMENTS,`${i}`))}get minPreloadSegments(){let i=this.getAttribute(k.MIN_PRELOAD_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set minPreloadSegments(i){i!==this.minPreloadSegments&&(i==null?this.removeAttribute(k.MIN_PRELOAD_SEGMENTS):this.setAttribute(k.MIN_PRELOAD_SEGMENTS,`${i}`))}get playbackId(){var i;return this.hasAttribute(k.PLAYBACK_ID)?this.getAttribute(k.PLAYBACK_ID):(i=ju(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(k.PLAYBACK_ID,i):this.removeAttribute(k.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(k.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(k.MAX_RESOLUTION,i):this.removeAttribute(k.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(k.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(k.MIN_RESOLUTION,i):this.removeAttribute(k.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(k.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(k.MAX_AUTO_RESOLUTION):this.setAttribute(k.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(k.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(k.RENDITION_ORDER,i):this.removeAttribute(k.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(k.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(k.PROGRAM_START_TIME):this.setAttribute(k.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(k.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(k.PROGRAM_END_TIME):this.setAttribute(k.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(k.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(k.ASSET_START_TIME):this.setAttribute(k.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(k.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(k.ASSET_END_TIME):this.setAttribute(k.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(k.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(k.CUSTOM_DOMAIN,i):this.removeAttribute(k.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:pt(this,rc)}set capRenditionToPlayerSize(i){Pi(this,rc,i)}get drmToken(){var i;return(i=this.getAttribute(k.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(k.DRM_TOKEN,i):this.removeAttribute(k.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(k.PLAYBACK_TOKEN))return(i=this.getAttribute(k.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(k.PLAYBACK_ID)){let[,r]=Ku((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(k.PLAYBACK_TOKEN,i):this.removeAttribute(k.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(k.PLAYBACK_TOKEN),e=this.getAttribute(k.DRM_TOKEN);return{...pt(this,Zu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Zu,i!=null?i:{})}get ended(){return Bg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(k.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(k.ENV_KEY,i):this.removeAttribute(k.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(k.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(k.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(k.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(k.STREAM_TYPE))!=null?i:Gu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(k.STREAM_TYPE,i):this.removeAttribute(k.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(k.TARGET_LIVE_WINDOW)?+this.getAttribute(k.TARGET_LIVE_WINDOW):qb(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(k.TARGET_LIVE_WINDOW):this.setAttribute(k.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(k.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return Yb(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(k.LIVE_EDGE_OFFSET))return+this.getAttribute(k.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(k.LIVE_EDGE_OFFSET):this.setAttribute(k.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return zu(this.nativeEl)}async addCuePoints(i){return this.nativeEl.currentSrc||console.warn("addCuePoints() was called before the media element has loaded. Wait for the loadstart event before calling addCuePoints()."),Cg(this.nativeEl,i)}get activeCuePoint(){return wg(this.nativeEl)}get cuePoints(){return Fb(this.nativeEl)}async addChapters(i){return this.nativeEl.currentSrc||console.warn("addChapters() was called before the media element has loaded. Wait for the loadstart event before calling addChapters()."),Pg(this.nativeEl,i)}get activeChapter(){return Og(this.nativeEl)}get chapters(){return $b(this.nativeEl)}getStartDate(){return Hb(this.nativeEl,this._hls)}get currentPdt(){return Gb(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(k.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(k.PREFER_PLAYBACK,i):this.removeAttribute(k.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![k.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...pt(this,al)}}set metadata(i){Pi(this,al,i!=null?i:{}),this.mux&&this.mux.emit("hb",pt(this,al))}get _hlsConfig(){return pt(this,Ju)}set _hlsConfig(i){Pi(this,Ju,i)}get logo(){var i;return(i=this.getAttribute(k.LOGO))!=null?i:pt(this,ol)}set logo(i){i?this.setAttribute(k.LOGO,i):this.removeAttribute(k.LOGO)}load(){$g(this,this.nativeEl,pt(this,Ei,nn))}unload(){Hg(this.nativeEl,pt(this,Ei,nn),this)}attributeChangedCallback(i,e,t){var s,r;switch(rl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case k.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case k.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Qu(this,Ei,ll).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Qu(this,Ei,ll).call(this));break}case"autoplay":if(t===e)break;(s=pt(this,Ei,nn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=pt(this,Ei,nn))==null||r.setPreload(t);break;case k.PLAYBACK_ID:case k.CUSTOM_DOMAIN:case k.MAX_RESOLUTION:case k.MIN_RESOLUTION:case k.RENDITION_ORDER:case k.PROGRAM_START_TIME:case k.PROGRAM_END_TIME:case k.ASSET_START_TIME:case k.ASSET_END_TIME:case k.PLAYBACK_TOKEN:this.src=sl(this);break;case k.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 k.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 k.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case k.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case k.LOGO:(t==null||t!==e)&&this.updateLogo();break;case k.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),Qu(this,Ei,ll).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case k.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case k.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(pt(this,ol)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",pt(this,sc)),this.nativeEl&&this.src&&!pt(this,Ei,nn)&&Qu(this,Ei,ll).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",pt(this,sc)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};nl=new WeakMap,Xu=new WeakMap,al=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,ic=new WeakMap,ol=new WeakMap,sc=new WeakMap,Ei=new WeakSet,nn=function(){return jb(this.nativeEl)},rc=new WeakMap,ll=async function(){pt(this,nl)||(await Pi(this,nl,Promise.resolve()),Pi(this,nl,null),this.load())};var ts=new WeakMap,da=class extends Error{},nc=class extends Error{};var zw=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],g_=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 v_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function E_(){return globalThis.chrome}function y_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Ps(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function dl(){var i;return(i=Ps())==null?void 0:i.getCurrentSession()}function ac(){var i;return(i=dl())==null?void 0:i.getSessionObj().media[0]}function T_(i){return new Promise((e,t)=>{ac().editTracksInfo(i,e,t)})}function b_(i){return new Promise((e,t)=>{ac().getStatus(i,e,t)})}function qg(i){return Ps().setOptions({...Yg(),...i})}function Yg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Qw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Xw(i){let e=i.split(`
138
+ `}get preferCmcd(){var i;return(i=this.getAttribute(k.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?la.includes(i)?this.setAttribute(k.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${la.join()}`):this.removeAttribute(k.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(k.PLAYER_INIT_TIME)?+this.getAttribute(k.PLAYER_INIT_TIME):pt(this,Xu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(k.PLAYER_INIT_TIME):this.setAttribute(k.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=pt(this,tc))!=null?i:f_}set playerSoftwareName(i){Pi(this,tc,i)}get playerSoftwareVersion(){var i;return(i=pt(this,ec))!=null?i:h_}set playerSoftwareVersion(i){Pi(this,ec,i)}get _hls(){var i;return(i=pt(this,Ei,nn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Ug(this.nativeEl))!=null?i:null}get errorTranslator(){return pt(this,ic)}set errorTranslator(i){Pi(this,ic,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(k.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(k.TYPE,i):this.removeAttribute(k.TYPE))}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(k.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(k.DEBUG,""):this.removeAttribute(k.DEBUG))}get disableTracking(){return this.hasAttribute(k.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(k.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(k.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(k.DISABLE_COOKIES,""):this.removeAttribute(k.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(k.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(k.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(k.DISABLE_PSEUDO_ENDED))}get maxReconnectRetries(){let i=this.getAttribute(k.MAX_RECONNECT_RETRIES);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set maxReconnectRetries(i){i!==this.maxReconnectRetries&&(i==null?this.removeAttribute(k.MAX_RECONNECT_RETRIES):this.setAttribute(k.MAX_RECONNECT_RETRIES,`${i}`))}get startTime(){let i=this.getAttribute(k.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(k.START_TIME):this.setAttribute(k.START_TIME,`${i}`))}get initialBandwidthEstimateKbps(){let i=this.getAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialBandwidthEstimateKbps(i){i!==this.initialBandwidthEstimateKbps&&(i==null?this.removeAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS):this.setAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS,`${i}`))}get initialEstimateSegments(){let i=this.getAttribute(k.INITIAL_ESTIMATE_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialEstimateSegments(i){i!==this.initialEstimateSegments&&(i==null?this.removeAttribute(k.INITIAL_ESTIMATE_SEGMENTS):this.setAttribute(k.INITIAL_ESTIMATE_SEGMENTS,`${i}`))}get minPreloadSegments(){let i=this.getAttribute(k.MIN_PRELOAD_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set minPreloadSegments(i){i!==this.minPreloadSegments&&(i==null?this.removeAttribute(k.MIN_PRELOAD_SEGMENTS):this.setAttribute(k.MIN_PRELOAD_SEGMENTS,`${i}`))}get playbackId(){var i;return this.hasAttribute(k.PLAYBACK_ID)?this.getAttribute(k.PLAYBACK_ID):(i=ju(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(k.PLAYBACK_ID,i):this.removeAttribute(k.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(k.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(k.MAX_RESOLUTION,i):this.removeAttribute(k.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(k.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(k.MIN_RESOLUTION,i):this.removeAttribute(k.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(k.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(k.MAX_AUTO_RESOLUTION):this.setAttribute(k.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(k.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(k.RENDITION_ORDER,i):this.removeAttribute(k.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(k.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(k.PROGRAM_START_TIME):this.setAttribute(k.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(k.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(k.PROGRAM_END_TIME):this.setAttribute(k.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(k.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(k.ASSET_START_TIME):this.setAttribute(k.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(k.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(k.ASSET_END_TIME):this.setAttribute(k.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(k.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(k.CUSTOM_DOMAIN,i):this.removeAttribute(k.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:pt(this,rc)}set capRenditionToPlayerSize(i){Pi(this,rc,i)}get drmToken(){var i;return(i=this.getAttribute(k.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(k.DRM_TOKEN,i):this.removeAttribute(k.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(k.PLAYBACK_TOKEN))return(i=this.getAttribute(k.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(k.PLAYBACK_ID)){let[,r]=Ku((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(k.PLAYBACK_TOKEN,i):this.removeAttribute(k.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(k.PLAYBACK_TOKEN),e=this.getAttribute(k.DRM_TOKEN);return{...pt(this,Zu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Zu,i!=null?i:{})}get ended(){return Bg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(k.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(k.ENV_KEY,i):this.removeAttribute(k.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(k.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(k.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(k.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(k.STREAM_TYPE))!=null?i:Gu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(k.STREAM_TYPE,i):this.removeAttribute(k.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(k.TARGET_LIVE_WINDOW)?+this.getAttribute(k.TARGET_LIVE_WINDOW):qb(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(k.TARGET_LIVE_WINDOW):this.setAttribute(k.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(k.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return Yb(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(k.LIVE_EDGE_OFFSET))return+this.getAttribute(k.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(k.LIVE_EDGE_OFFSET):this.setAttribute(k.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return zu(this.nativeEl)}async addCuePoints(i){return this.nativeEl.currentSrc||console.warn("addCuePoints() was called before the media element has loaded. Wait for the loadstart event before calling addCuePoints()."),Cg(this.nativeEl,i)}get activeCuePoint(){return wg(this.nativeEl)}get cuePoints(){return Fb(this.nativeEl)}async addChapters(i){return this.nativeEl.currentSrc||console.warn("addChapters() was called before the media element has loaded. Wait for the loadstart event before calling addChapters()."),Pg(this.nativeEl,i)}get activeChapter(){return Og(this.nativeEl)}get chapters(){return $b(this.nativeEl)}getStartDate(){return Hb(this.nativeEl,this._hls)}get currentPdt(){return Gb(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(k.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(k.PREFER_PLAYBACK,i):this.removeAttribute(k.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![k.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...pt(this,al)}}set metadata(i){Pi(this,al,i!=null?i:{}),this.mux&&this.mux.emit("hb",pt(this,al))}get _hlsConfig(){return pt(this,Ju)}set _hlsConfig(i){Pi(this,Ju,i)}get logo(){var i;return(i=this.getAttribute(k.LOGO))!=null?i:pt(this,ol)}set logo(i){i?this.setAttribute(k.LOGO,i):this.removeAttribute(k.LOGO)}load(){$g(this,this.nativeEl,pt(this,Ei,nn))}unload(){Hg(this.nativeEl,pt(this,Ei,nn),this)}attributeChangedCallback(i,e,t){var s,r;switch(rl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case k.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case k.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Qu(this,Ei,ll).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Qu(this,Ei,ll).call(this));break}case"autoplay":if(t===e)break;(s=pt(this,Ei,nn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=pt(this,Ei,nn))==null||r.setPreload(t);break;case k.PLAYBACK_ID:case k.CUSTOM_DOMAIN:case k.MAX_RESOLUTION:case k.MIN_RESOLUTION:case k.RENDITION_ORDER:case k.PROGRAM_START_TIME:case k.PROGRAM_END_TIME:case k.ASSET_START_TIME:case k.ASSET_END_TIME:case k.PLAYBACK_TOKEN:this.hasAttribute(k.PLAYBACK_ID)&&(this.src=sl(this));break;case k.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 k.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 k.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case k.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case k.LOGO:(t==null||t!==e)&&this.updateLogo();break;case k.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),Qu(this,Ei,ll).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case k.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case k.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(pt(this,ol)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",pt(this,sc)),this.nativeEl&&this.src&&!pt(this,Ei,nn)&&Qu(this,Ei,ll).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",pt(this,sc)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};nl=new WeakMap,Xu=new WeakMap,al=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,ic=new WeakMap,ol=new WeakMap,sc=new WeakMap,Ei=new WeakSet,nn=function(){return jb(this.nativeEl)},rc=new WeakMap,ll=async function(){pt(this,nl)||(await Pi(this,nl,Promise.resolve()),Pi(this,nl,null),this.load())};var ts=new WeakMap,da=class extends Error{},nc=class extends Error{};var zw=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],g_=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 v_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function E_(){return globalThis.chrome}function y_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Ps(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function dl(){var i;return(i=Ps())==null?void 0:i.getCurrentSession()}function ac(){var i;return(i=dl())==null?void 0:i.getSessionObj().media[0]}function T_(i){return new Promise((e,t)=>{ac().editTracksInfo(i,e,t)})}function b_(i){return new Promise((e,t)=>{ac().getStatus(i,e,t)})}function qg(i){return Ps().setOptions({...Yg(),...i})}function Yg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Qw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Xw(i){let e=i.split(`
139
139
  `),t=[];for(let s=0;s<e.length;s++)if(e[s].trim().startsWith("#EXT-X-STREAM-INF")){let n=e[s+1]?e[s+1].trim():"";n&&!n.startsWith("#")&&t.push(n)}return t}function Zw(i){return i.split(`
140
140
  `).find(s=>!s.trim().startsWith("#")&&s.trim()!=="")}async function __(i){if(!i)return!1;if(/\.m3u8?(\?.*)?$/i.test(i))return!0;if(i.startsWith("blob:"))return!1;try{let t=(await fetch(i,{method:"HEAD"})).headers.get("Content-Type");return zw.some(s=>t===s)}catch(e){return console.error("Error while trying to get the Content-Type of the manifest",e),!1}}async function A_(i){if(!(!i||i.startsWith("blob:")))try{let e=await(await fetch(i)).text(),t=e,s=Xw(e);if(s.length>0){let a=new URL(s[0],i).toString();t=await(await fetch(a)).text()}let r=Zw(t);return Qw(r)}catch(e){console.error("Error while trying to parse the manifest playlist",e);return}}var oc=new g_,Os=new WeakSet,St;v_(()=>{var i,e,t,s;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}St||(St=cast.framework,Ps().addEventListener(St.CastContextEventType.CAST_STATE_CHANGED,r=>{oc.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,r)})}),Ps().addEventListener(St.CastContextEventType.SESSION_STATE_CHANGED,r=>{oc.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,r)})}),oc.forEach(r=>{var n,a;return(a=(n=ts.get(r)).init)==null?void 0:a.call(n)}))});var S_=0,Ce,ua,Gt,Oi,on,ln,ur,dc,ul,Qe,an,I_,L_,jg,R_,zg,x_,Qg,lc=class extends EventTarget{constructor(t){super();oe(this,Qe);oe(this,Ce);oe(this,ua);oe(this,Gt);oe(this,Oi);oe(this,on,"disconnected");oe(this,ln,!1);oe(this,ur,new Set);oe(this,dc,new WeakMap);oe(this,ul,()=>Ue(this,Qe,Qg).call(this));ie(this,Ce,t),oc.add(this),ts.set(this,{init:()=>Ue(this,Qe,zg).call(this),onCastStateChanged:()=>Ue(this,Qe,jg).call(this),onSessionStateChanged:()=>Ue(this,Qe,R_).call(this),getCastPlayer:()=>w(this,Qe,an)}),Ue(this,Qe,zg).call(this)}destroy(){var t,s,r;(s=(t=w(this,Ce))==null?void 0:t.textTracks)==null||s.removeEventListener("change",w(this,ul)),w(this,Oi)&&((r=w(this,Gt))!=null&&r.controller)&&Object.entries(w(this,Oi)).forEach(([n,a])=>{w(this,Gt).controller.removeEventListener(n,a)}),w(this,Ce)&&Os.delete(w(this,Ce)),ie(this,ua,!1)}get state(){return w(this,on)}async watchAvailability(t){if(w(this,Ce).disableRemotePlayback)throw new da("disableRemotePlayback attribute is present.");return w(this,dc).set(t,++S_),w(this,ur).add(t),queueMicrotask(()=>t(Ue(this,Qe,L_).call(this))),S_}async cancelWatchAvailability(t){if(w(this,Ce).disableRemotePlayback)throw new da("disableRemotePlayback attribute is present.");t?w(this,ur).delete(t):w(this,ur).clear()}async prompt(){var s,r,n,a;if(w(this,Ce).disableRemotePlayback)throw new da("disableRemotePlayback attribute is present.");if(!((r=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&r.isAvailable))throw new nc("The RemotePlayback API is disabled on this platform.");let t=Os.has(w(this,Ce));Os.add(w(this,Ce)),qg(w(this,Ce).castOptions),Object.entries(w(this,Oi)).forEach(([o,l])=>{w(this,Gt).controller.addEventListener(o,l)});try{await Ps().requestSession()}catch(o){if(t||Os.delete(w(this,Ce)),o==="cancel")return;throw new Error(o)}(a=(n=ts.get(w(this,Ce)))==null?void 0:n.loadOnPrompt)==null||a.call(n)}};Ce=new WeakMap,ua=new WeakMap,Gt=new WeakMap,Oi=new WeakMap,on=new WeakMap,ln=new WeakMap,ur=new WeakMap,dc=new WeakMap,ul=new WeakMap,Qe=new WeakSet,an=function(){if(Os.has(w(this,Ce)))return w(this,Gt)},I_=function(){Os.has(w(this,Ce))&&(Object.entries(w(this,Oi)).forEach(([t,s])=>{w(this,Gt).controller.removeEventListener(t,s)}),Os.delete(w(this,Ce)),w(this,Ce).muted=w(this,Gt).isMuted,w(this,Ce).currentTime=w(this,Gt).savedPlayerState.currentTime,w(this,Gt).savedPlayerState.isPaused===!1&&w(this,Ce).play())},L_=function(){var s;let t=(s=Ps())==null?void 0:s.getCastState();return t&&t!=="NO_DEVICES_AVAILABLE"},jg=function(){let t=Ps().getCastState();if(Os.has(w(this,Ce))&&t==="CONNECTING"&&(ie(this,on,"connecting"),this.dispatchEvent(new Event("connecting"))),!w(this,ln)&&(t!=null&&t.includes("CONNECT"))){ie(this,ln,!0);for(let s of w(this,ur))s(!0)}else if(w(this,ln)&&(!t||t==="NO_DEVICES_AVAILABLE")){ie(this,ln,!1);for(let s of w(this,ur))s(!1)}},R_=async function(){var s;let{SESSION_RESUMED:t}=St.SessionState;if(Ps().getSessionState()===t&&w(this,Ce).castSrc===((s=ac())==null?void 0:s.media.contentId)){Os.add(w(this,Ce)),Object.entries(w(this,Oi)).forEach(([r,n])=>{w(this,Gt).controller.addEventListener(r,n)});try{await b_(new chrome.cast.media.GetStatusRequest)}catch(r){console.error(r)}w(this,Oi)[St.RemotePlayerEventType.IS_PAUSED_CHANGED](),w(this,Oi)[St.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},zg=function(){!St||w(this,ua)||(ie(this,ua,!0),qg(w(this,Ce).castOptions),w(this,Ce).textTracks.addEventListener("change",w(this,ul)),Ue(this,Qe,jg).call(this),ie(this,Gt,new St.RemotePlayer),new St.RemotePlayerController(w(this,Gt)),ie(this,Oi,{[St.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(ie(this,on,"connected"),this.dispatchEvent(new Event("connect"))):(Ue(this,Qe,I_).call(this),ie(this,on,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[St.RemotePlayerEventType.DURATION_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("durationchange"))},[St.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("volumechange"))},[St.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("volumechange"))},[St.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=w(this,Qe,an))!=null&&t.isMediaLoaded&&w(this,Ce).dispatchEvent(new Event("timeupdate"))},[St.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("resize"))},[St.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event(this.paused?"pause":"play"))},[St.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=w(this,Qe,an))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&w(this,Ce).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=w(this,Qe,an))==null?void 0:s.playerState]))},[St.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=w(this,Qe,an))!=null&&t.isMediaLoaded&&(await Promise.resolve(),Ue(this,Qe,x_).call(this))}}))},x_=function(){Ue(this,Qe,Qg).call(this)},Qg=async function(){var h,f,m,p,g;if(!w(this,Qe,an))return;let s=((f=(h=w(this,Gt).mediaInfo)==null?void 0:h.tracks)!=null?f:[]).filter(({type:v})=>v===chrome.cast.media.TrackType.TEXT),r=[...w(this,Ce).textTracks].filter(({kind:v})=>v==="subtitles"||v==="captions"),n=s.map(({language:v,name:T,trackId:y})=>{var S;let{mode:b}=(S=r.find(R=>R.language===v&&R.label===T))!=null?S:{};return b?{mode:b,trackId:y}:!1}).filter(Boolean),o=n.filter(({mode:v})=>v!=="showing").map(({trackId:v})=>v),l=n.find(({mode:v})=>v==="showing"),d=(g=(p=(m=dl())==null?void 0:m.getSessionObj().media[0])==null?void 0:p.activeTrackIds)!=null?g:[],u=d;if(d.length&&(u=u.filter(v=>!o.includes(v))),l!=null&&l.trackId&&(u=[...u,l.trackId]),u=[...new Set(u)],!((v,T)=>v.length===T.length&&v.every(y=>T.includes(y)))(d,u))try{let v=new chrome.cast.media.EditTracksInfoRequest(u);await T_(v)}catch(v){console.error(v)}};var k_=i=>{var e,t,s,r,n,a,o,Me,D_;return t=class extends i{constructor(){super(...arguments);oe(this,o);oe(this,s,{paused:!1});oe(this,r,Yg());oe(this,n);oe(this,a)}get remote(){return w(this,a)?w(this,a):E_()?this.isConnected?(this.disableRemotePlayback||y_(),ts.set(this,{loadOnPrompt:()=>Ue(this,o,D_).call(this)}),ie(this,a,new lc(this))):void 0:super.remote}disconnectedCallback(){var h,f;(h=w(this,a))==null||h.destroy(),ie(this,a,null),ts.delete(this),(f=super.disconnectedCallback)==null||f.call(this)}attributeChangedCallback(h,f,m){if(super.attributeChangedCallback(h,f,m),h==="cast-receiver"&&m){w(this,r).receiverApplicationId=m;return}if(w(this,o,Me))switch(h){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var T,y;if(!w(this,o,Me))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:b,src:S})=>S&&(b==="subtitles"||b==="captions")),m=[],p=0;if(f.length&&(h.tracks=f.map(b=>{let S=++p;m.length===0&&b.track.mode==="showing"&&m.push(S);let R=new chrome.cast.media.Track(S,chrome.cast.media.TrackType.TEXT);return R.trackContentId=b.src,R.trackContentType="text/vtt",R.subtype=b.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,R.name=b.label,R.language=b.srclang,R})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}],await __(this.castSrc)){h.contentType||(h.contentType="application/x-mpegURL");let b=await A_(this.castSrc);(b==null?void 0:b.includes("m4s"))||(b==null?void 0:b.includes("mp4"))?(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.FMP4,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.FMP4):b!=null&&b.includes("ts")&&(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.TS,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.TS)}let v=new chrome.cast.media.LoadRequest(h);v.currentTime=(T=super.currentTime)!=null?T:0,v.autoplay=!w(this,s).paused,v.activeTrackIds=m,await((y=dl())==null?void 0:y.loadMedia(v)),this.dispatchEvent(new Event("volumechange"))}play(){var h;if(w(this,o,Me)){w(this,o,Me).isPaused&&((h=w(this,o,Me).controller)==null||h.playOrPause());return}return super.play()}pause(){var h;if(w(this,o,Me)){w(this,o,Me).isPaused||(h=w(this,o,Me).controller)==null||h.playOrPause();return}super.pause()}get castOptions(){return w(this,r)}get castReceiver(){var h;return(h=this.getAttribute("cast-receiver"))!=null?h:void 0}set castReceiver(h){this.castReceiver!=h&&this.setAttribute("cast-receiver",`${h}`)}get castSrc(){var m,p,g,v,T;let h=this.currentSrc,f=h!=null&&h.startsWith("blob:")?void 0:h;return(T=(v=(g=(p=this.getAttribute("cast-src"))!=null?p:(m=this.querySelector("source"))==null?void 0:m.src)!=null?g:f)!=null?v:this.getAttribute("src"))!=null?T:void 0}set castSrc(h){this.castSrc!=h&&this.setAttribute("cast-src",`${h}`)}get castContentType(){var h;return(h=this.getAttribute("cast-content-type"))!=null?h:void 0}set castContentType(h){this.setAttribute("cast-content-type",`${h}`)}get castStreamType(){var h,f;return(f=(h=this.getAttribute("cast-stream-type"))!=null?h:this.streamType)!=null?f:void 0}set castStreamType(h){this.setAttribute("cast-stream-type",`${h}`)}get castCustomData(){return w(this,n)}set castCustomData(h){let f=typeof h;if(!["object","undefined"].includes(f)){console.error(`castCustomData must be nullish or an object but value was of type ${f}`);return}ie(this,n,h)}get readyState(){if(w(this,o,Me))switch(w(this,o,Me).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 w(this,o,Me)?w(this,o,Me).isPaused:super.paused}get muted(){var h;return w(this,o,Me)?(h=w(this,o,Me))==null?void 0:h.isMuted:super.muted}set muted(h){var f;if(w(this,o,Me)){(h&&!w(this,o,Me).isMuted||!h&&w(this,o,Me).isMuted)&&((f=w(this,o,Me).controller)==null||f.muteOrUnmute());return}super.muted=h}get volume(){var h,f;return w(this,o,Me)?(f=(h=w(this,o,Me))==null?void 0:h.volumeLevel)!=null?f:1:super.volume}set volume(h){var f;if(w(this,o,Me)){w(this,o,Me).volumeLevel=+h,(f=w(this,o,Me).controller)==null||f.setVolumeLevel();return}super.volume=h}get duration(){var h,f,m;return w(this,o,Me)&&((h=w(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=w(this,o,Me))==null?void 0:f.duration)!=null?m:NaN:super.duration}get currentTime(){var h,f,m;return w(this,o,Me)&&((h=w(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=w(this,o,Me))==null?void 0:f.currentTime)!=null?m:0:super.currentTime}set currentTime(h){var f;if(w(this,o,Me)){w(this,o,Me).currentTime=h,(f=w(this,o,Me).controller)==null||f.seek();return}super.currentTime=h}},s=new WeakMap,r=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,Me=function(){var h,f;return(f=(h=ts.get(this.remote))==null?void 0:h.getCastPlayer)==null?void 0:f.call(h)},D_=async function(){w(this,s).paused=Md(t.prototype,this,"paused"),Md(t.prototype,this,"pause").call(this),this.muted=Md(t.prototype,this,"muted");try{await this.load()}catch(h){console.error(h)}},Ie(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var Ns=class extends Event{constructor(t,s){super(t);Ie(this,"track");this.track=s.track}};var Xg=new WeakMap;function X(i){var e;return(e=Xg.get(i))!=null?e:Jw(i,{})}function Jw(i,e){let t=Xg.get(i);return t||Xg.set(i,t={}),Object.assign(t,e)}function uc(i,e){let t=i.videoTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in un.prototype||Object.defineProperty(un.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ns("addtrack",{track:e}))})}function cc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ns("removetrack",{track:i}))})}function C_(i){var s,r,n;let e=(n=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks)!=null?n:[],t=!1;for(let a of e)a!==i&&(a.selected=!1,t=!0);if(t){if(X(e).changeRequested)return;X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var cr,hr,fr,dn,cl,un=class extends EventTarget{constructor(){super();oe(this,dn);oe(this,cr);oe(this,hr);oe(this,fr);X(this).trackSet=new Set}[Symbol.iterator](){return w(this,dn,cl).values()}get length(){return w(this,dn,cl).size}getTrackById(t){var s;return(s=[...w(this,dn,cl)].find(r=>r.id===t))!=null?s:null}get selectedIndex(){return[...w(this,dn,cl)].findIndex(t=>t.selected)}get onaddtrack(){return w(this,cr)}set onaddtrack(t){w(this,cr)&&(this.removeEventListener("addtrack",w(this,cr)),ie(this,cr,void 0)),typeof t=="function"&&(ie(this,cr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return w(this,hr)}set onremovetrack(t){w(this,hr)&&(this.removeEventListener("removetrack",w(this,hr)),ie(this,hr,void 0)),typeof t=="function"&&(ie(this,hr,t),this.addEventListener("removetrack",t))}get onchange(){return w(this,fr)}set onchange(t){w(this,fr)&&(this.removeEventListener("change",w(this,fr)),ie(this,fr,void 0)),typeof t=="function"&&(ie(this,fr,t),this.addEventListener("change",t))}};cr=new WeakMap,hr=new WeakMap,fr=new WeakMap,dn=new WeakSet,cl=function(){return X(this).trackSet};var Us=class extends Event{constructor(t,s){super(t);Ie(this,"rendition");this.rendition=s.rendition}};function w_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.videoRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in cn.prototype||Object.defineProperty(cn.prototype,r,{get(){return ca(this)[r]}}),queueMicrotask(()=>{!t||!i.selected||t.dispatchEvent(new Us("addrendition",{rendition:e}))})}function M_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.videoRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.selected||e.dispatchEvent(new Us("removerendition",{rendition:i}))})}function P_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.videoRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function ca(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.videoTracks].filter(s=>s.selected).flatMap(s=>[...X(s).renditionSet]):[]}var mr,pr,gr,cn=class extends EventTarget{constructor(){super(...arguments);oe(this,mr);oe(this,pr);oe(this,gr)}[Symbol.iterator](){return ca(this).values()}get length(){return ca(this).length}getRenditionById(t){var s;return(s=ca(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return ca(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of ca(this).entries())r.selected=s===t}get onaddrendition(){return w(this,mr)}set onaddrendition(t){w(this,mr)&&(this.removeEventListener("addrendition",w(this,mr)),ie(this,mr,void 0)),typeof t=="function"&&(ie(this,mr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return w(this,pr)}set onremoverendition(t){w(this,pr)&&(this.removeEventListener("removerendition",w(this,pr)),ie(this,pr,void 0)),typeof t=="function"&&(ie(this,pr,t),this.addEventListener("removerendition",t))}get onchange(){return w(this,gr)}set onchange(t){w(this,gr)&&(this.removeEventListener("change",w(this,gr)),ie(this,gr,void 0)),typeof t=="function"&&(ie(this,gr,t),this.addEventListener("change",t))}};mr=new WeakMap,pr=new WeakMap,gr=new WeakMap;var ha,hl=class{constructor(){Ie(this,"src");Ie(this,"id");Ie(this,"width");Ie(this,"height");Ie(this,"bitrate");Ie(this,"frameRate");Ie(this,"codec");oe(this,ha,!1)}get selected(){return w(this,ha)}set selected(e){w(this,ha)!==e&&(ie(this,ha,e),P_(this))}};ha=new WeakMap;var fa,ma=class{constructor(){Ie(this,"id");Ie(this,"kind");Ie(this,"label","");Ie(this,"language","");Ie(this,"sourceBuffer");oe(this,fa,!1)}addRendition(e,t,s,r,n,a){let o=new hl;return o.src=e,o.width=t,o.height=s,o.frameRate=a,o.bitrate=n,o.codec=r,w_(this,o),o}removeRendition(e){M_(e)}get selected(){return w(this,fa)}set selected(e){w(this,fa)!==e&&(ie(this,fa,e),e===!0&&C_(this))}};fa=new WeakMap;function O_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.audioRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in hn.prototype||Object.defineProperty(hn.prototype,r,{get(){return pa(this)[r]}}),queueMicrotask(()=>{!t||!i.enabled||t.dispatchEvent(new Us("addrendition",{rendition:e}))})}function N_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.audioRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.enabled||e.dispatchEvent(new Us("removerendition",{rendition:i}))})}function U_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function pa(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.audioTracks].filter(s=>s.enabled).flatMap(s=>[...X(s).renditionSet]):[]}var vr,Er,yr,hn=class extends EventTarget{constructor(){super(...arguments);oe(this,vr);oe(this,Er);oe(this,yr)}[Symbol.iterator](){return pa(this).values()}get length(){return pa(this).length}getRenditionById(t){var s;return(s=pa(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return pa(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of pa(this).entries())r.selected=s===t}get onaddrendition(){return w(this,vr)}set onaddrendition(t){w(this,vr)&&(this.removeEventListener("addrendition",w(this,vr)),ie(this,vr,void 0)),typeof t=="function"&&(ie(this,vr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return w(this,Er)}set onremoverendition(t){w(this,Er)&&(this.removeEventListener("removerendition",w(this,Er)),ie(this,Er,void 0)),typeof t=="function"&&(ie(this,Er,t),this.addEventListener("removerendition",t))}get onchange(){return w(this,yr)}set onchange(t){w(this,yr)&&(this.removeEventListener("change",w(this,yr)),ie(this,yr,void 0)),typeof t=="function"&&(ie(this,yr,t),this.addEventListener("change",t))}};vr=new WeakMap,Er=new WeakMap,yr=new WeakMap;var ga,fl=class{constructor(){Ie(this,"src");Ie(this,"id");Ie(this,"bitrate");Ie(this,"codec");oe(this,ga,!1)}get selected(){return w(this,ga)}set selected(e){w(this,ga)!==e&&(ie(this,ga,e),U_(this))}};ga=new WeakMap;function fc(i,e){let t=i.audioTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in fn.prototype||Object.defineProperty(fn.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ns("addtrack",{track:e}))})}function mc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.audioTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ns("removetrack",{track:i}))})}function F_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioTracks;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Tr,br,_r,va,hc,fn=class extends EventTarget{constructor(){super();oe(this,va);oe(this,Tr);oe(this,br);oe(this,_r);X(this).trackSet=new Set}[Symbol.iterator](){return w(this,va,hc).values()}get length(){return w(this,va,hc).size}getTrackById(t){var s;return(s=[...w(this,va,hc)].find(r=>r.id===t))!=null?s:null}get onaddtrack(){return w(this,Tr)}set onaddtrack(t){w(this,Tr)&&(this.removeEventListener("addtrack",w(this,Tr)),ie(this,Tr,void 0)),typeof t=="function"&&(ie(this,Tr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return w(this,br)}set onremovetrack(t){w(this,br)&&(this.removeEventListener("removetrack",w(this,br)),ie(this,br,void 0)),typeof t=="function"&&(ie(this,br,t),this.addEventListener("removetrack",t))}get onchange(){return w(this,_r)}set onchange(t){w(this,_r)&&(this.removeEventListener("change",w(this,_r)),ie(this,_r,void 0)),typeof t=="function"&&(ie(this,_r,t),this.addEventListener("change",t))}};Tr=new WeakMap,br=new WeakMap,_r=new WeakMap,va=new WeakSet,hc=function(){return X(this).trackSet};var Ea,ya=class{constructor(){Ie(this,"id");Ie(this,"kind");Ie(this,"label","");Ie(this,"language","");Ie(this,"sourceBuffer");oe(this,Ea,!1)}addRendition(e,t,s){let r=new fl;return r.src=e,r.codec=t,r.bitrate=s,O_(this,r),r}removeRendition(e){N_(e)}get enabled(){return w(this,Ea)}set enabled(e){w(this,Ea)!==e&&(ie(this,Ea,e),F_(this))}};Ea=new WeakMap;var B_=pc(globalThis.HTMLMediaElement,"video"),$_=pc(globalThis.HTMLMediaElement,"audio");function H_(i){if(!(i!=null&&i.prototype))return i;let e=pc(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return eM(this)}});let t=pc(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return tM(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new ma;return l.kind=n,l.label=a,l.language=o,uc(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cc),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new ya;return l.kind=n,l.label=a,l.language=o,fc(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=mc),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return s(this)}});let s=n=>{let a=X(n).videoRenditions;return a||(a=new cn,X(a).media=new WeakRef(n),X(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return r(this)}});let r=n=>{let a=X(n).audioRenditions;return a||(a=new hn,X(a).media=new WeakRef(n),X(n).audioRenditions=a),a};return i}function pc(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function eM(i){var t;let e=X(i).videoTracks;if(!e&&(e=new un,X(i).videoTracks=e,B_)){let s=B_.call((t=i.nativeEl)!=null?t:i);for(let o of s)uc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof ma)){for(let l of s)cc(l);return}uc(i,o.track)},a=o=>{cc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}function tM(i){var t;let e=X(i).audioTracks;if(!e&&(e=new fn,X(i).audioTracks=e,$_)){let s=$_.call((t=i.nativeEl)!=null?t:i);for(let o of s)fc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof ya)){for(let l of s)mc(l);return}fc(i,o.track)},a=o=>{mc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}var K_=i=>{throw TypeError(i)},V_=(i,e,t)=>e.has(i)||K_("Cannot "+t),W_=(i,e,t)=>(V_(i,e,"read from private field"),t?t.call(i):e.get(i)),q_=(i,e,t)=>e.has(i)?K_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Y_=(i,e,t,s)=>(V_(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Ec=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ec{}globalThis.DocumentFragment=i}var Jg=class extends Ec{},iM=class extends Ec{},sM={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Jg)}},gc,rM=class{constructor(i,e={}){q_(this,gc),Y_(this,gc,e==null?void 0:e.detail)}get detail(){return W_(this,gc)}initCustomEvent(){}};gc=new WeakMap;function nM(i,e){return new Jg}var j_={document:{createElement:nM},DocumentFragment,customElements:sM,CustomEvent:rM,EventTarget:Ec,HTMLElement:Jg,HTMLVideoElement:iM},z_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Zg=z_?j_:globalThis,eU=z_?j_.document:globalThis.document,vc,G_=class extends k_(H_(p_)){constructor(){super(...arguments),q_(this,vc)}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 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=W_(this,vc))!=null?i:this.muxCastCustomData}set castCustomData(i){Y_(this,vc,i)}};vc=new WeakMap;Zg.customElements.get("mux-video")||(Zg.customElements.define("mux-video",G_),Zg.MuxVideoElement=G_);var K={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Ee={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},e0={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},Q_=Object.entries(e0),_=Q_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),aM={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},ui=Q_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...aM}),cU=Object.entries(ui).reduce((i,[e,t])=>{let s=_[e];return s&&(i[t]=s),i},{userinactivechange:"userinactive"}),X_=Object.entries(_).reduce((i,[e,t])=>{let s=ui[e];return s&&(i[t]=s),i},{userinactive:"userinactivechange"}),Xt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Ar={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var yc={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Zt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ni={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Z_={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function J_(i){return i==null?void 0:i.map(lM).join(" ")}function eA(i){return i==null?void 0:i.split(/\s+/).map(dM)}function lM(i){if(i){let{id:e,width:t,height:s}=i;return[e,t,s].filter(r=>r!=null).join(":")}}function dM(i){if(i){let[e,t,s]=i.split(":");return{id:e,width:+t,height:+s}}}function tA(i){return i==null?void 0:i.map(uM).join(" ")}function iA(i){return i==null?void 0:i.split(/\s+/).map(cM)}function uM(i){if(i){let{id:e,kind:t,language:s,label:r}=i;return[e,t,s,r].filter(n=>n!=null).join(":")}}function cM(i){if(i){let[e,t,s,r]=i.split(":");return{id:e,kind:t,language:s,label:r}}}function sA(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ta(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Tc(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var bc=i=>new Promise(e=>setTimeout(e,i));var rA={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it.",hour:"hour",hours:"hours",minute:"minute",minutes:"minutes",second:"second",seconds:"seconds","{time} remaining":"{time} remaining","{currentTime} of {totalTime}":"{currentTime} of {totalTime}","video not loaded, unknown time.":"video not loaded, unknown time."};var nA,t0={en:rA},i0=((nA=globalThis.navigator)==null?void 0:nA.language)||"en",aA=i=>{i0=i};var hM=i=>{var e,t,s;let[r]=i0.split("-");return((e=t0[i0])==null?void 0:e[i])||((t=t0[r])==null?void 0:t[i])||((s=t0.en)==null?void 0:s[i])||i},F=(i,e={})=>hM(i).replace(/\{(\w+)\}/g,(t,s)=>s in e?String(e[s]):`{${s}}`);var oA=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],fM=(i,e)=>{let t=i===1?F(oA[e].singular):F(oA[e].plural);return`${i} ${t}`},mn=i=>{if(!Ta(i))return"";let e=Math.abs(i),t=e!==i,s=new Date(0,0,0,0,0,e,0),n=[s.getHours(),s.getMinutes(),s.getSeconds()].map((a,o)=>a&&fM(a,o)).filter(a=>a).join(", ");return t?F("{time} remaining",{time:n}):n};function Ui(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let s=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=s="0"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",s=s<10?"0"+s:s,(t?"-":"")+n+r+s}var EU=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}});var _c=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ac=class extends _c{},Sc=class extends Ac{constructor(){super(...arguments),this.role=null}},s0=class{observe(){}unobserve(){}disconnect(){}},lA={createElement:function(){return new ml.HTMLElement},createElementNS:function(){return new ml.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},ml={ResizeObserver:s0,document:lA,Node:Ac,Element:Sc,HTMLElement:class extends Sc{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ml.DocumentFragment}},DocumentFragment:class extends _c{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},dA="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",uA=Object.keys(ml).every(i=>i in globalThis),L=dA&&!uA?ml:globalThis,He=dA&&!uA?lA:globalThis.document;var cA=new WeakMap,r0=i=>{let e=cA.get(i);return e||cA.set(i,e=new Set),e},hA=new L.ResizeObserver(i=>{for(let e of i)for(let t of r0(e.target))t(e)});function Fs(i,e){r0(i).add(e),hA.observe(i)}function Bs(i,e){let t=r0(i);t.delete(e),t.size||hA.unobserve(i)}function Xe(i){let e={};for(let t of i)e[t.name]=t.value;return e}function Ye(i){var e;return(e=Ic(i))!=null?e:is(i,"media-controller")}function Ic(i){var e;let{MEDIA_CONTROLLER:t}=Ee,s=i.getAttribute(t);if(s)return(e=pn(i))==null?void 0:e.getElementById(s)}var Lc=(i,e,t=".value")=>{let s=i.querySelector(t);s&&(s.textContent=e)},pM=(i,e)=>{let t=`slot[name="${e}"]`,s=i.shadowRoot.querySelector(t);return s?s.children:[]},Rc=(i,e)=>pM(i,e)[0],Kt=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Kt(i,e.getRootNode().host),is=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||is(i.getRootNode().host,e)};function pl(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=pl(t.shadowRoot))!=null?e:t:null}function pn(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function xc(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:s=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:s});let r=i;for(;r&&e>0;){let n=getComputedStyle(r);if(t&&n.opacity==="0"||s&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function fA(i,e,t,s){let r=s.x-t.x,n=s.y-t.y,a=r*r+n*n;if(a===0)return 0;let o=((i-t.x)*r+(e-t.y)*n)/a;return Math.max(0,Math.min(1,o))}function je(i,e){let t=gM(i,s=>s===e);return t||gl(i,e)}function gM(i,e){var t,s;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(s=r.sheet)==null?void 0:s.cssRules}catch{continue}for(let a of n!=null?n:[])if(e(a.selectorText))return a}}function gl(i,e){var t,s;let r=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=r==null?void 0:r[r.length-1];if(!(n!=null&&n.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};let a=n==null?void 0:n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length);return(s=n.sheet.cssRules)==null?void 0:s[a]}function be(i,e,t=Number.NaN){let s=i.getAttribute(e);return s!=null?+s:t}function Re(i,e,t){let s=+t;if(t==null||Number.isNaN(s)){i.hasAttribute(e)&&i.removeAttribute(e);return}be(i,e,void 0)!==s&&i.setAttribute(e,`${s}`)}function le(i,e){return i.hasAttribute(e)}function de(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}le(i,e)!=t&&i.toggleAttribute(e,t)}function ge(i,e,t=null){var s;return(s=i.getAttribute(e))!=null?s:t}function pe(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let s=`${t}`;ge(i,e,void 0)!==s&&i.setAttribute(e,s)}var mA=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fi=(i,e,t)=>(mA(i,e,"read from private field"),t?t.call(i):e.get(i)),vM=(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)},kc=(i,e,t,s)=>(mA(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Mt;function EM(i){return`
141
141
  <style>
@@ -135,7 +135,7 @@ Schedule: ${l.map(p=>Ci(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Remo
135
135
  <slot name="logo">
136
136
  ${this.getLogoHTML((e=i[k.LOGO])!=null?e:"")}
137
137
  </slot>
138
- `}get preferCmcd(){var i;return(i=this.getAttribute(k.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?la.includes(i)?this.setAttribute(k.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${la.join()}`):this.removeAttribute(k.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(k.PLAYER_INIT_TIME)?+this.getAttribute(k.PLAYER_INIT_TIME):pt(this,Xu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(k.PLAYER_INIT_TIME):this.setAttribute(k.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=pt(this,tc))!=null?i:f_}set playerSoftwareName(i){Pi(this,tc,i)}get playerSoftwareVersion(){var i;return(i=pt(this,ec))!=null?i:h_}set playerSoftwareVersion(i){Pi(this,ec,i)}get _hls(){var i;return(i=pt(this,Ei,nn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Ug(this.nativeEl))!=null?i:null}get errorTranslator(){return pt(this,ic)}set errorTranslator(i){Pi(this,ic,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(k.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(k.TYPE,i):this.removeAttribute(k.TYPE))}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(k.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(k.DEBUG,""):this.removeAttribute(k.DEBUG))}get disableTracking(){return this.hasAttribute(k.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(k.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(k.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(k.DISABLE_COOKIES,""):this.removeAttribute(k.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(k.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(k.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(k.DISABLE_PSEUDO_ENDED))}get maxReconnectRetries(){let i=this.getAttribute(k.MAX_RECONNECT_RETRIES);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set maxReconnectRetries(i){i!==this.maxReconnectRetries&&(i==null?this.removeAttribute(k.MAX_RECONNECT_RETRIES):this.setAttribute(k.MAX_RECONNECT_RETRIES,`${i}`))}get startTime(){let i=this.getAttribute(k.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(k.START_TIME):this.setAttribute(k.START_TIME,`${i}`))}get initialBandwidthEstimateKbps(){let i=this.getAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialBandwidthEstimateKbps(i){i!==this.initialBandwidthEstimateKbps&&(i==null?this.removeAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS):this.setAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS,`${i}`))}get initialEstimateSegments(){let i=this.getAttribute(k.INITIAL_ESTIMATE_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialEstimateSegments(i){i!==this.initialEstimateSegments&&(i==null?this.removeAttribute(k.INITIAL_ESTIMATE_SEGMENTS):this.setAttribute(k.INITIAL_ESTIMATE_SEGMENTS,`${i}`))}get minPreloadSegments(){let i=this.getAttribute(k.MIN_PRELOAD_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set minPreloadSegments(i){i!==this.minPreloadSegments&&(i==null?this.removeAttribute(k.MIN_PRELOAD_SEGMENTS):this.setAttribute(k.MIN_PRELOAD_SEGMENTS,`${i}`))}get playbackId(){var i;return this.hasAttribute(k.PLAYBACK_ID)?this.getAttribute(k.PLAYBACK_ID):(i=ju(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(k.PLAYBACK_ID,i):this.removeAttribute(k.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(k.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(k.MAX_RESOLUTION,i):this.removeAttribute(k.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(k.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(k.MIN_RESOLUTION,i):this.removeAttribute(k.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(k.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(k.MAX_AUTO_RESOLUTION):this.setAttribute(k.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(k.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(k.RENDITION_ORDER,i):this.removeAttribute(k.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(k.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(k.PROGRAM_START_TIME):this.setAttribute(k.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(k.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(k.PROGRAM_END_TIME):this.setAttribute(k.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(k.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(k.ASSET_START_TIME):this.setAttribute(k.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(k.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(k.ASSET_END_TIME):this.setAttribute(k.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(k.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(k.CUSTOM_DOMAIN,i):this.removeAttribute(k.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:pt(this,rc)}set capRenditionToPlayerSize(i){Pi(this,rc,i)}get drmToken(){var i;return(i=this.getAttribute(k.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(k.DRM_TOKEN,i):this.removeAttribute(k.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(k.PLAYBACK_TOKEN))return(i=this.getAttribute(k.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(k.PLAYBACK_ID)){let[,r]=Ku((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(k.PLAYBACK_TOKEN,i):this.removeAttribute(k.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(k.PLAYBACK_TOKEN),e=this.getAttribute(k.DRM_TOKEN);return{...pt(this,Zu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Zu,i!=null?i:{})}get ended(){return Bg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(k.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(k.ENV_KEY,i):this.removeAttribute(k.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(k.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(k.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(k.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(k.STREAM_TYPE))!=null?i:Gu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(k.STREAM_TYPE,i):this.removeAttribute(k.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(k.TARGET_LIVE_WINDOW)?+this.getAttribute(k.TARGET_LIVE_WINDOW):qb(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(k.TARGET_LIVE_WINDOW):this.setAttribute(k.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(k.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return Yb(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(k.LIVE_EDGE_OFFSET))return+this.getAttribute(k.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(k.LIVE_EDGE_OFFSET):this.setAttribute(k.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return zu(this.nativeEl)}async addCuePoints(i){return this.nativeEl.currentSrc||console.warn("addCuePoints() was called before the media element has loaded. Wait for the loadstart event before calling addCuePoints()."),Cg(this.nativeEl,i)}get activeCuePoint(){return wg(this.nativeEl)}get cuePoints(){return Fb(this.nativeEl)}async addChapters(i){return this.nativeEl.currentSrc||console.warn("addChapters() was called before the media element has loaded. Wait for the loadstart event before calling addChapters()."),Pg(this.nativeEl,i)}get activeChapter(){return Og(this.nativeEl)}get chapters(){return $b(this.nativeEl)}getStartDate(){return Hb(this.nativeEl,this._hls)}get currentPdt(){return Gb(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(k.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(k.PREFER_PLAYBACK,i):this.removeAttribute(k.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![k.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...pt(this,al)}}set metadata(i){Pi(this,al,i!=null?i:{}),this.mux&&this.mux.emit("hb",pt(this,al))}get _hlsConfig(){return pt(this,Ju)}set _hlsConfig(i){Pi(this,Ju,i)}get logo(){var i;return(i=this.getAttribute(k.LOGO))!=null?i:pt(this,ol)}set logo(i){i?this.setAttribute(k.LOGO,i):this.removeAttribute(k.LOGO)}load(){$g(this,this.nativeEl,pt(this,Ei,nn))}unload(){Hg(this.nativeEl,pt(this,Ei,nn),this)}attributeChangedCallback(i,e,t){var s,r;switch(rl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case k.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case k.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Qu(this,Ei,ll).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Qu(this,Ei,ll).call(this));break}case"autoplay":if(t===e)break;(s=pt(this,Ei,nn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=pt(this,Ei,nn))==null||r.setPreload(t);break;case k.PLAYBACK_ID:case k.CUSTOM_DOMAIN:case k.MAX_RESOLUTION:case k.MIN_RESOLUTION:case k.RENDITION_ORDER:case k.PROGRAM_START_TIME:case k.PROGRAM_END_TIME:case k.ASSET_START_TIME:case k.ASSET_END_TIME:case k.PLAYBACK_TOKEN:this.src=sl(this);break;case k.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 k.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 k.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case k.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case k.LOGO:(t==null||t!==e)&&this.updateLogo();break;case k.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),Qu(this,Ei,ll).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case k.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case k.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(pt(this,ol)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",pt(this,sc)),this.nativeEl&&this.src&&!pt(this,Ei,nn)&&Qu(this,Ei,ll).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",pt(this,sc)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};nl=new WeakMap,Xu=new WeakMap,al=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,ic=new WeakMap,ol=new WeakMap,sc=new WeakMap,Ei=new WeakSet,nn=function(){return jb(this.nativeEl)},rc=new WeakMap,ll=async function(){pt(this,nl)||(await Pi(this,nl,Promise.resolve()),Pi(this,nl,null),this.load())};var ts=new WeakMap,da=class extends Error{},nc=class extends Error{};var zw=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],g_=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 v_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function E_(){return globalThis.chrome}function y_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Ps(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function dl(){var i;return(i=Ps())==null?void 0:i.getCurrentSession()}function ac(){var i;return(i=dl())==null?void 0:i.getSessionObj().media[0]}function T_(i){return new Promise((e,t)=>{ac().editTracksInfo(i,e,t)})}function b_(i){return new Promise((e,t)=>{ac().getStatus(i,e,t)})}function qg(i){return Ps().setOptions({...Yg(),...i})}function Yg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Qw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Xw(i){let e=i.split(`
138
+ `}get preferCmcd(){var i;return(i=this.getAttribute(k.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?la.includes(i)?this.setAttribute(k.PREFER_CMCD,i):console.warn(`Invalid value for preferCmcd. Must be one of ${la.join()}`):this.removeAttribute(k.PREFER_CMCD))}get playerInitTime(){return this.hasAttribute(k.PLAYER_INIT_TIME)?+this.getAttribute(k.PLAYER_INIT_TIME):pt(this,Xu)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(k.PLAYER_INIT_TIME):this.setAttribute(k.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=pt(this,tc))!=null?i:f_}set playerSoftwareName(i){Pi(this,tc,i)}get playerSoftwareVersion(){var i;return(i=pt(this,ec))!=null?i:h_}set playerSoftwareVersion(i){Pi(this,ec,i)}get _hls(){var i;return(i=pt(this,Ei,nn))==null?void 0:i.engine}get mux(){var i;return(i=this.nativeEl)==null?void 0:i.mux}get error(){var i;return(i=Ug(this.nativeEl))!=null?i:null}get errorTranslator(){return pt(this,ic)}set errorTranslator(i){Pi(this,ic,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(k.TYPE))!=null?i:void 0}set type(i){i!==this.type&&(i?this.setAttribute(k.TYPE,i):this.removeAttribute(k.TYPE))}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(k.DEBUG)!=null}set debug(i){i!==this.debug&&(i?this.setAttribute(k.DEBUG,""):this.removeAttribute(k.DEBUG))}get disableTracking(){return this.hasAttribute(k.DISABLE_TRACKING)}set disableTracking(i){i!==this.disableTracking&&this.toggleAttribute(k.DISABLE_TRACKING,!!i)}get disableCookies(){return this.hasAttribute(k.DISABLE_COOKIES)}set disableCookies(i){i!==this.disableCookies&&(i?this.setAttribute(k.DISABLE_COOKIES,""):this.removeAttribute(k.DISABLE_COOKIES))}get disablePseudoEnded(){return this.hasAttribute(k.DISABLE_PSEUDO_ENDED)}set disablePseudoEnded(i){i!==this.disablePseudoEnded&&(i?this.setAttribute(k.DISABLE_PSEUDO_ENDED,""):this.removeAttribute(k.DISABLE_PSEUDO_ENDED))}get maxReconnectRetries(){let i=this.getAttribute(k.MAX_RECONNECT_RETRIES);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set maxReconnectRetries(i){i!==this.maxReconnectRetries&&(i==null?this.removeAttribute(k.MAX_RECONNECT_RETRIES):this.setAttribute(k.MAX_RECONNECT_RETRIES,`${i}`))}get startTime(){let i=this.getAttribute(k.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(k.START_TIME):this.setAttribute(k.START_TIME,`${i}`))}get initialBandwidthEstimateKbps(){let i=this.getAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialBandwidthEstimateKbps(i){i!==this.initialBandwidthEstimateKbps&&(i==null?this.removeAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS):this.setAttribute(k.INITIAL_BANDWIDTH_ESTIMATE_KBPS,`${i}`))}get initialEstimateSegments(){let i=this.getAttribute(k.INITIAL_ESTIMATE_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set initialEstimateSegments(i){i!==this.initialEstimateSegments&&(i==null?this.removeAttribute(k.INITIAL_ESTIMATE_SEGMENTS):this.setAttribute(k.INITIAL_ESTIMATE_SEGMENTS,`${i}`))}get minPreloadSegments(){let i=this.getAttribute(k.MIN_PRELOAD_SEGMENTS);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set minPreloadSegments(i){i!==this.minPreloadSegments&&(i==null?this.removeAttribute(k.MIN_PRELOAD_SEGMENTS):this.setAttribute(k.MIN_PRELOAD_SEGMENTS,`${i}`))}get playbackId(){var i;return this.hasAttribute(k.PLAYBACK_ID)?this.getAttribute(k.PLAYBACK_ID):(i=ju(this.src))!=null?i:void 0}set playbackId(i){i!==this.playbackId&&(i?this.setAttribute(k.PLAYBACK_ID,i):this.removeAttribute(k.PLAYBACK_ID))}get maxResolution(){var i;return(i=this.getAttribute(k.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(k.MAX_RESOLUTION,i):this.removeAttribute(k.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(k.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(k.MIN_RESOLUTION,i):this.removeAttribute(k.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(k.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(k.MAX_AUTO_RESOLUTION):this.setAttribute(k.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(k.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(k.RENDITION_ORDER,i):this.removeAttribute(k.RENDITION_ORDER))}get programStartTime(){let i=this.getAttribute(k.PROGRAM_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programStartTime(i){i==null?this.removeAttribute(k.PROGRAM_START_TIME):this.setAttribute(k.PROGRAM_START_TIME,`${i}`)}get programEndTime(){let i=this.getAttribute(k.PROGRAM_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set programEndTime(i){i==null?this.removeAttribute(k.PROGRAM_END_TIME):this.setAttribute(k.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){let i=this.getAttribute(k.ASSET_START_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetStartTime(i){i==null?this.removeAttribute(k.ASSET_START_TIME):this.setAttribute(k.ASSET_START_TIME,`${i}`)}get assetEndTime(){let i=this.getAttribute(k.ASSET_END_TIME);if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}set assetEndTime(i){i==null?this.removeAttribute(k.ASSET_END_TIME):this.setAttribute(k.ASSET_END_TIME,`${i}`)}get customDomain(){var i;return(i=this.getAttribute(k.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(k.CUSTOM_DOMAIN,i):this.removeAttribute(k.CUSTOM_DOMAIN))}get capRenditionToPlayerSize(){var i;return((i=this._hlsConfig)==null?void 0:i.capLevelToPlayerSize)!=null?this._hlsConfig.capLevelToPlayerSize:pt(this,rc)}set capRenditionToPlayerSize(i){Pi(this,rc,i)}get drmToken(){var i;return(i=this.getAttribute(k.DRM_TOKEN))!=null?i:void 0}set drmToken(i){i!==this.drmToken&&(i?this.setAttribute(k.DRM_TOKEN,i):this.removeAttribute(k.DRM_TOKEN))}get playbackToken(){var i,e,t,s;if(this.hasAttribute(k.PLAYBACK_TOKEN))return(i=this.getAttribute(k.PLAYBACK_TOKEN))!=null?i:void 0;if(this.hasAttribute(k.PLAYBACK_ID)){let[,r]=Ku((e=this.playbackId)!=null?e:"");return(t=new URLSearchParams(r).get("token"))!=null?t:void 0}if(this.src)return(s=new URLSearchParams(this.src).get("token"))!=null?s:void 0}set playbackToken(i){i!==this.playbackToken&&(i?this.setAttribute(k.PLAYBACK_TOKEN,i):this.removeAttribute(k.PLAYBACK_TOKEN))}get tokens(){let i=this.getAttribute(k.PLAYBACK_TOKEN),e=this.getAttribute(k.DRM_TOKEN);return{...pt(this,Zu),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{}}}set tokens(i){Pi(this,Zu,i!=null?i:{})}get ended(){return Bg(this.nativeEl,this._hls)}get envKey(){var i;return(i=this.getAttribute(k.ENV_KEY))!=null?i:void 0}set envKey(i){i!==this.envKey&&(i?this.setAttribute(k.ENV_KEY,i):this.removeAttribute(k.ENV_KEY))}get beaconCollectionDomain(){var i;return(i=this.getAttribute(k.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(k.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(k.BEACON_COLLECTION_DOMAIN))}get streamType(){var i;return(i=this.getAttribute(k.STREAM_TYPE))!=null?i:Gu(this.nativeEl)}set streamType(i){i!==this.streamType&&(i?this.setAttribute(k.STREAM_TYPE,i):this.removeAttribute(k.STREAM_TYPE))}get targetLiveWindow(){return this.hasAttribute(k.TARGET_LIVE_WINDOW)?+this.getAttribute(k.TARGET_LIVE_WINDOW):qb(this.nativeEl)}set targetLiveWindow(i){i!=this.targetLiveWindow&&(i==null?this.removeAttribute(k.TARGET_LIVE_WINDOW):this.setAttribute(k.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i,e;if(this.hasAttribute(k.LIVE_EDGE_OFFSET)){let{liveEdgeOffset:t}=this,s=(i=this.nativeEl.seekable.end(0))!=null?i:0,r=(e=this.nativeEl.seekable.start(0))!=null?e:0;return Math.max(r,s-t)}return Yb(this.nativeEl)}get liveEdgeOffset(){if(this.hasAttribute(k.LIVE_EDGE_OFFSET))return+this.getAttribute(k.LIVE_EDGE_OFFSET)}set liveEdgeOffset(i){i!=this.liveEdgeOffset&&(i==null?this.removeAttribute(k.LIVE_EDGE_OFFSET):this.setAttribute(k.LIVE_EDGE_OFFSET,`${+i}`))}get seekable(){return zu(this.nativeEl)}async addCuePoints(i){return this.nativeEl.currentSrc||console.warn("addCuePoints() was called before the media element has loaded. Wait for the loadstart event before calling addCuePoints()."),Cg(this.nativeEl,i)}get activeCuePoint(){return wg(this.nativeEl)}get cuePoints(){return Fb(this.nativeEl)}async addChapters(i){return this.nativeEl.currentSrc||console.warn("addChapters() was called before the media element has loaded. Wait for the loadstart event before calling addChapters()."),Pg(this.nativeEl,i)}get activeChapter(){return Og(this.nativeEl)}get chapters(){return $b(this.nativeEl)}getStartDate(){return Hb(this.nativeEl,this._hls)}get currentPdt(){return Gb(this.nativeEl,this._hls)}get preferPlayback(){let i=this.getAttribute(k.PREFER_PLAYBACK);if(i===gi.MSE||i===gi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===gi.MSE||i===gi.NATIVE?this.setAttribute(k.PREFER_PLAYBACK,i):this.removeAttribute(k.PREFER_PLAYBACK))}get metadata(){return{...this.getAttributeNames().filter(i=>i.startsWith("metadata-")&&![k.METADATA_URL].includes(i)).reduce((i,e)=>{let t=this.getAttribute(e);return t!=null&&(i[e.replace(/^metadata-/,"").replace(/-/g,"_")]=t),i},{}),...pt(this,al)}}set metadata(i){Pi(this,al,i!=null?i:{}),this.mux&&this.mux.emit("hb",pt(this,al))}get _hlsConfig(){return pt(this,Ju)}set _hlsConfig(i){Pi(this,Ju,i)}get logo(){var i;return(i=this.getAttribute(k.LOGO))!=null?i:pt(this,ol)}set logo(i){i?this.setAttribute(k.LOGO,i):this.removeAttribute(k.LOGO)}load(){$g(this,this.nativeEl,pt(this,Ei,nn))}unload(){Hg(this.nativeEl,pt(this,Ei,nn),this)}attributeChangedCallback(i,e,t){var s,r;switch(rl.observedAttributes.includes(i)&&!["src","autoplay","preload"].includes(i)&&super.attributeChangedCallback(i,e,t),i){case k.PLAYER_SOFTWARE_NAME:this.playerSoftwareName=t!=null?t:void 0;break;case k.PLAYER_SOFTWARE_VERSION:this.playerSoftwareVersion=t!=null?t:void 0;break;case"src":{let n=!!e,a=!!t;!n&&a?Qu(this,Ei,ll).call(this):n&&!a?this.unload():n&&a&&(this.unload(),Qu(this,Ei,ll).call(this));break}case"autoplay":if(t===e)break;(s=pt(this,Ei,nn))==null||s.setAutoplay(this.autoplay);break;case"preload":if(t===e)break;(r=pt(this,Ei,nn))==null||r.setPreload(t);break;case k.PLAYBACK_ID:case k.CUSTOM_DOMAIN:case k.MAX_RESOLUTION:case k.MIN_RESOLUTION:case k.RENDITION_ORDER:case k.PROGRAM_START_TIME:case k.PROGRAM_END_TIME:case k.ASSET_START_TIME:case k.ASSET_END_TIME:case k.PLAYBACK_TOKEN:this.hasAttribute(k.PLAYBACK_ID)&&(this.src=sl(this));break;case k.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 k.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 k.STREAM_TYPE:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("streamtypechange",{composed:!0,bubbles:!0}));break;case k.TARGET_LIVE_WINDOW:(t==null||t!==e)&&this.dispatchEvent(new CustomEvent("targetlivewindowchange",{composed:!0,bubbles:!0,detail:this.targetLiveWindow}));break;case k.LOGO:(t==null||t!==e)&&this.updateLogo();break;case k.DISABLE_TRACKING:{if(t==null||t!==e){let n=this.currentTime,a=this.paused;this.unload(),Qu(this,Ei,ll).call(this).then(()=>{this.currentTime=n,a||this.play()})}break}case k.DISABLE_COOKIES:{(t==null||t!==e)&&this.disableCookies&&document.cookie.split(";").forEach(n=>{n.trim().startsWith("muxData")&&(document.cookie=n.replace(/^ +/,"").replace(/=.*/,"=;expires="+new Date().toUTCString()+";path=/"))});break}case k.CAP_RENDITION_TO_PLAYER_SIZE:(t==null||t!==e)&&(this.capRenditionToPlayerSize=t!=null?!0:void 0)}}updateLogo(){if(!this.shadowRoot)return;let i=this.shadowRoot.querySelector('slot[name="logo"]');if(!i)return;let e=this.constructor.getLogoHTML(pt(this,ol)||this.logo);i.innerHTML=e}connectedCallback(){var i,e;(i=super.connectedCallback)==null||i.call(this),(e=this.nativeEl)==null||e.addEventListener("muxmetadata",pt(this,sc)),this.nativeEl&&this.src&&!pt(this,Ei,nn)&&Qu(this,Ei,ll).call(this)}disconnectedCallback(){var i,e;(i=this.nativeEl)==null||i.removeEventListener("muxmetadata",pt(this,sc)),this.unload(),(e=super.disconnectedCallback)==null||e.call(this)}handleEvent(i){i.target===this.nativeEl&&this.dispatchEvent(new CustomEvent(i.type,{composed:!0,detail:i.detail}))}};nl=new WeakMap,Xu=new WeakMap,al=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,ec=new WeakMap,tc=new WeakMap,ic=new WeakMap,ol=new WeakMap,sc=new WeakMap,Ei=new WeakSet,nn=function(){return jb(this.nativeEl)},rc=new WeakMap,ll=async function(){pt(this,nl)||(await Pi(this,nl,Promise.resolve()),Pi(this,nl,null),this.load())};var ts=new WeakMap,da=class extends Error{},nc=class extends Error{};var zw=["application/x-mpegURL","application/vnd.apple.mpegurl","audio/mpegurl"],g_=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 v_(i){var e,t,s;(t=(e=globalThis.chrome)==null?void 0:e.cast)!=null&&t.isAvailable?(s=globalThis.cast)!=null&&s.framework?i():customElements.whenDefined("google-cast-button").then(i):globalThis.__onGCastApiAvailable=()=>{customElements.whenDefined("google-cast-button").then(i)}}function E_(){return globalThis.chrome}function y_(){var t;let i="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";if((t=globalThis.chrome)!=null&&t.cast||document.querySelector(`script[src="${i}"]`))return;let e=document.createElement("script");e.src=i,document.head.append(e)}function Ps(){var i,e;return(e=(i=globalThis.cast)==null?void 0:i.framework)==null?void 0:e.CastContext.getInstance()}function dl(){var i;return(i=Ps())==null?void 0:i.getCurrentSession()}function ac(){var i;return(i=dl())==null?void 0:i.getSessionObj().media[0]}function T_(i){return new Promise((e,t)=>{ac().editTracksInfo(i,e,t)})}function b_(i){return new Promise((e,t)=>{ac().getStatus(i,e,t)})}function qg(i){return Ps().setOptions({...Yg(),...i})}function Yg(){return{receiverApplicationId:"CC1AD845",autoJoinPolicy:"origin_scoped",androidReceiverCompatible:!1,language:"en-US",resumeSavedSession:!0}}function Qw(i){if(!i)return;let e=/\.([a-zA-Z0-9]+)(?:\?.*)?$/,t=i.match(e);return t?t[1]:null}function Xw(i){let e=i.split(`
139
139
  `),t=[];for(let s=0;s<e.length;s++)if(e[s].trim().startsWith("#EXT-X-STREAM-INF")){let n=e[s+1]?e[s+1].trim():"";n&&!n.startsWith("#")&&t.push(n)}return t}function Zw(i){return i.split(`
140
140
  `).find(s=>!s.trim().startsWith("#")&&s.trim()!=="")}async function __(i){if(!i)return!1;if(/\.m3u8?(\?.*)?$/i.test(i))return!0;if(i.startsWith("blob:"))return!1;try{let t=(await fetch(i,{method:"HEAD"})).headers.get("Content-Type");return zw.some(s=>t===s)}catch(e){return console.error("Error while trying to get the Content-Type of the manifest",e),!1}}async function A_(i){if(!(!i||i.startsWith("blob:")))try{let e=await(await fetch(i)).text(),t=e,s=Xw(e);if(s.length>0){let a=new URL(s[0],i).toString();t=await(await fetch(a)).text()}let r=Zw(t);return Qw(r)}catch(e){console.error("Error while trying to parse the manifest playlist",e);return}}var oc=new g_,Os=new WeakSet,St;v_(()=>{var i,e,t,s;if(!((e=(i=globalThis.chrome)==null?void 0:i.cast)!=null&&e.isAvailable)){console.debug("chrome.cast.isAvailable",(s=(t=globalThis.chrome)==null?void 0:t.cast)==null?void 0:s.isAvailable);return}St||(St=cast.framework,Ps().addEventListener(St.CastContextEventType.CAST_STATE_CHANGED,r=>{oc.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onCastStateChanged)==null?void 0:o.call(a,r)})}),Ps().addEventListener(St.CastContextEventType.SESSION_STATE_CHANGED,r=>{oc.forEach(n=>{var a,o;return(o=(a=ts.get(n)).onSessionStateChanged)==null?void 0:o.call(a,r)})}),oc.forEach(r=>{var n,a;return(a=(n=ts.get(r)).init)==null?void 0:a.call(n)}))});var S_=0,Ce,ua,Gt,Oi,on,ln,ur,dc,ul,Qe,an,I_,L_,jg,R_,zg,x_,Qg,lc=class extends EventTarget{constructor(t){super();oe(this,Qe);oe(this,Ce);oe(this,ua);oe(this,Gt);oe(this,Oi);oe(this,on,"disconnected");oe(this,ln,!1);oe(this,ur,new Set);oe(this,dc,new WeakMap);oe(this,ul,()=>Ue(this,Qe,Qg).call(this));ie(this,Ce,t),oc.add(this),ts.set(this,{init:()=>Ue(this,Qe,zg).call(this),onCastStateChanged:()=>Ue(this,Qe,jg).call(this),onSessionStateChanged:()=>Ue(this,Qe,R_).call(this),getCastPlayer:()=>w(this,Qe,an)}),Ue(this,Qe,zg).call(this)}destroy(){var t,s,r;(s=(t=w(this,Ce))==null?void 0:t.textTracks)==null||s.removeEventListener("change",w(this,ul)),w(this,Oi)&&((r=w(this,Gt))!=null&&r.controller)&&Object.entries(w(this,Oi)).forEach(([n,a])=>{w(this,Gt).controller.removeEventListener(n,a)}),w(this,Ce)&&Os.delete(w(this,Ce)),ie(this,ua,!1)}get state(){return w(this,on)}async watchAvailability(t){if(w(this,Ce).disableRemotePlayback)throw new da("disableRemotePlayback attribute is present.");return w(this,dc).set(t,++S_),w(this,ur).add(t),queueMicrotask(()=>t(Ue(this,Qe,L_).call(this))),S_}async cancelWatchAvailability(t){if(w(this,Ce).disableRemotePlayback)throw new da("disableRemotePlayback attribute is present.");t?w(this,ur).delete(t):w(this,ur).clear()}async prompt(){var s,r,n,a;if(w(this,Ce).disableRemotePlayback)throw new da("disableRemotePlayback attribute is present.");if(!((r=(s=globalThis.chrome)==null?void 0:s.cast)!=null&&r.isAvailable))throw new nc("The RemotePlayback API is disabled on this platform.");let t=Os.has(w(this,Ce));Os.add(w(this,Ce)),qg(w(this,Ce).castOptions),Object.entries(w(this,Oi)).forEach(([o,l])=>{w(this,Gt).controller.addEventListener(o,l)});try{await Ps().requestSession()}catch(o){if(t||Os.delete(w(this,Ce)),o==="cancel")return;throw new Error(o)}(a=(n=ts.get(w(this,Ce)))==null?void 0:n.loadOnPrompt)==null||a.call(n)}};Ce=new WeakMap,ua=new WeakMap,Gt=new WeakMap,Oi=new WeakMap,on=new WeakMap,ln=new WeakMap,ur=new WeakMap,dc=new WeakMap,ul=new WeakMap,Qe=new WeakSet,an=function(){if(Os.has(w(this,Ce)))return w(this,Gt)},I_=function(){Os.has(w(this,Ce))&&(Object.entries(w(this,Oi)).forEach(([t,s])=>{w(this,Gt).controller.removeEventListener(t,s)}),Os.delete(w(this,Ce)),w(this,Ce).muted=w(this,Gt).isMuted,w(this,Ce).currentTime=w(this,Gt).savedPlayerState.currentTime,w(this,Gt).savedPlayerState.isPaused===!1&&w(this,Ce).play())},L_=function(){var s;let t=(s=Ps())==null?void 0:s.getCastState();return t&&t!=="NO_DEVICES_AVAILABLE"},jg=function(){let t=Ps().getCastState();if(Os.has(w(this,Ce))&&t==="CONNECTING"&&(ie(this,on,"connecting"),this.dispatchEvent(new Event("connecting"))),!w(this,ln)&&(t!=null&&t.includes("CONNECT"))){ie(this,ln,!0);for(let s of w(this,ur))s(!0)}else if(w(this,ln)&&(!t||t==="NO_DEVICES_AVAILABLE")){ie(this,ln,!1);for(let s of w(this,ur))s(!1)}},R_=async function(){var s;let{SESSION_RESUMED:t}=St.SessionState;if(Ps().getSessionState()===t&&w(this,Ce).castSrc===((s=ac())==null?void 0:s.media.contentId)){Os.add(w(this,Ce)),Object.entries(w(this,Oi)).forEach(([r,n])=>{w(this,Gt).controller.addEventListener(r,n)});try{await b_(new chrome.cast.media.GetStatusRequest)}catch(r){console.error(r)}w(this,Oi)[St.RemotePlayerEventType.IS_PAUSED_CHANGED](),w(this,Oi)[St.RemotePlayerEventType.PLAYER_STATE_CHANGED]()}},zg=function(){!St||w(this,ua)||(ie(this,ua,!0),qg(w(this,Ce).castOptions),w(this,Ce).textTracks.addEventListener("change",w(this,ul)),Ue(this,Qe,jg).call(this),ie(this,Gt,new St.RemotePlayer),new St.RemotePlayerController(w(this,Gt)),ie(this,Oi,{[St.RemotePlayerEventType.IS_CONNECTED_CHANGED]:({value:t})=>{t===!0?(ie(this,on,"connected"),this.dispatchEvent(new Event("connect"))):(Ue(this,Qe,I_).call(this),ie(this,on,"disconnected"),this.dispatchEvent(new Event("disconnect")))},[St.RemotePlayerEventType.DURATION_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("durationchange"))},[St.RemotePlayerEventType.VOLUME_LEVEL_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("volumechange"))},[St.RemotePlayerEventType.IS_MUTED_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("volumechange"))},[St.RemotePlayerEventType.CURRENT_TIME_CHANGED]:()=>{var t;(t=w(this,Qe,an))!=null&&t.isMediaLoaded&&w(this,Ce).dispatchEvent(new Event("timeupdate"))},[St.RemotePlayerEventType.VIDEO_INFO_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event("resize"))},[St.RemotePlayerEventType.IS_PAUSED_CHANGED]:()=>{w(this,Ce).dispatchEvent(new Event(this.paused?"pause":"play"))},[St.RemotePlayerEventType.PLAYER_STATE_CHANGED]:()=>{var t,s;((t=w(this,Qe,an))==null?void 0:t.playerState)!==chrome.cast.media.PlayerState.PAUSED&&w(this,Ce).dispatchEvent(new Event({[chrome.cast.media.PlayerState.PLAYING]:"playing",[chrome.cast.media.PlayerState.BUFFERING]:"waiting",[chrome.cast.media.PlayerState.IDLE]:"emptied"}[(s=w(this,Qe,an))==null?void 0:s.playerState]))},[St.RemotePlayerEventType.IS_MEDIA_LOADED_CHANGED]:async()=>{var t;(t=w(this,Qe,an))!=null&&t.isMediaLoaded&&(await Promise.resolve(),Ue(this,Qe,x_).call(this))}}))},x_=function(){Ue(this,Qe,Qg).call(this)},Qg=async function(){var h,f,m,p,g;if(!w(this,Qe,an))return;let s=((f=(h=w(this,Gt).mediaInfo)==null?void 0:h.tracks)!=null?f:[]).filter(({type:v})=>v===chrome.cast.media.TrackType.TEXT),r=[...w(this,Ce).textTracks].filter(({kind:v})=>v==="subtitles"||v==="captions"),n=s.map(({language:v,name:T,trackId:y})=>{var S;let{mode:b}=(S=r.find(R=>R.language===v&&R.label===T))!=null?S:{};return b?{mode:b,trackId:y}:!1}).filter(Boolean),o=n.filter(({mode:v})=>v!=="showing").map(({trackId:v})=>v),l=n.find(({mode:v})=>v==="showing"),d=(g=(p=(m=dl())==null?void 0:m.getSessionObj().media[0])==null?void 0:p.activeTrackIds)!=null?g:[],u=d;if(d.length&&(u=u.filter(v=>!o.includes(v))),l!=null&&l.trackId&&(u=[...u,l.trackId]),u=[...new Set(u)],!((v,T)=>v.length===T.length&&v.every(y=>T.includes(y)))(d,u))try{let v=new chrome.cast.media.EditTracksInfoRequest(u);await T_(v)}catch(v){console.error(v)}};var k_=i=>{var e,t,s,r,n,a,o,Me,D_;return t=class extends i{constructor(){super(...arguments);oe(this,o);oe(this,s,{paused:!1});oe(this,r,Yg());oe(this,n);oe(this,a)}get remote(){return w(this,a)?w(this,a):E_()?this.isConnected?(this.disableRemotePlayback||y_(),ts.set(this,{loadOnPrompt:()=>Ue(this,o,D_).call(this)}),ie(this,a,new lc(this))):void 0:super.remote}disconnectedCallback(){var h,f;(h=w(this,a))==null||h.destroy(),ie(this,a,null),ts.delete(this),(f=super.disconnectedCallback)==null||f.call(this)}attributeChangedCallback(h,f,m){if(super.attributeChangedCallback(h,f,m),h==="cast-receiver"&&m){w(this,r).receiverApplicationId=m;return}if(w(this,o,Me))switch(h){case"cast-stream-type":case"cast-src":this.load();break}}async load(){var T,y;if(!w(this,o,Me))return super.load();let h=new chrome.cast.media.MediaInfo(this.castSrc,this.castContentType);h.customData=this.castCustomData;let f=[...this.querySelectorAll("track")].filter(({kind:b,src:S})=>S&&(b==="subtitles"||b==="captions")),m=[],p=0;if(f.length&&(h.tracks=f.map(b=>{let S=++p;m.length===0&&b.track.mode==="showing"&&m.push(S);let R=new chrome.cast.media.Track(S,chrome.cast.media.TrackType.TEXT);return R.trackContentId=b.src,R.trackContentType="text/vtt",R.subtype=b.kind==="captions"?chrome.cast.media.TextTrackType.CAPTIONS:chrome.cast.media.TextTrackType.SUBTITLES,R.name=b.label,R.language=b.srclang,R})),this.castStreamType==="live"?h.streamType=chrome.cast.media.StreamType.LIVE:h.streamType=chrome.cast.media.StreamType.BUFFERED,h.metadata=new chrome.cast.media.GenericMediaMetadata,h.metadata.title=this.title,h.metadata.images=[{url:this.poster}],await __(this.castSrc)){h.contentType||(h.contentType="application/x-mpegURL");let b=await A_(this.castSrc);(b==null?void 0:b.includes("m4s"))||(b==null?void 0:b.includes("mp4"))?(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.FMP4,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.FMP4):b!=null&&b.includes("ts")&&(h.hlsSegmentFormat=chrome.cast.media.HlsSegmentFormat.TS,h.hlsVideoSegmentFormat=chrome.cast.media.HlsVideoSegmentFormat.TS)}let v=new chrome.cast.media.LoadRequest(h);v.currentTime=(T=super.currentTime)!=null?T:0,v.autoplay=!w(this,s).paused,v.activeTrackIds=m,await((y=dl())==null?void 0:y.loadMedia(v)),this.dispatchEvent(new Event("volumechange"))}play(){var h;if(w(this,o,Me)){w(this,o,Me).isPaused&&((h=w(this,o,Me).controller)==null||h.playOrPause());return}return super.play()}pause(){var h;if(w(this,o,Me)){w(this,o,Me).isPaused||(h=w(this,o,Me).controller)==null||h.playOrPause();return}super.pause()}get castOptions(){return w(this,r)}get castReceiver(){var h;return(h=this.getAttribute("cast-receiver"))!=null?h:void 0}set castReceiver(h){this.castReceiver!=h&&this.setAttribute("cast-receiver",`${h}`)}get castSrc(){var m,p,g,v,T;let h=this.currentSrc,f=h!=null&&h.startsWith("blob:")?void 0:h;return(T=(v=(g=(p=this.getAttribute("cast-src"))!=null?p:(m=this.querySelector("source"))==null?void 0:m.src)!=null?g:f)!=null?v:this.getAttribute("src"))!=null?T:void 0}set castSrc(h){this.castSrc!=h&&this.setAttribute("cast-src",`${h}`)}get castContentType(){var h;return(h=this.getAttribute("cast-content-type"))!=null?h:void 0}set castContentType(h){this.setAttribute("cast-content-type",`${h}`)}get castStreamType(){var h,f;return(f=(h=this.getAttribute("cast-stream-type"))!=null?h:this.streamType)!=null?f:void 0}set castStreamType(h){this.setAttribute("cast-stream-type",`${h}`)}get castCustomData(){return w(this,n)}set castCustomData(h){let f=typeof h;if(!["object","undefined"].includes(f)){console.error(`castCustomData must be nullish or an object but value was of type ${f}`);return}ie(this,n,h)}get readyState(){if(w(this,o,Me))switch(w(this,o,Me).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 w(this,o,Me)?w(this,o,Me).isPaused:super.paused}get muted(){var h;return w(this,o,Me)?(h=w(this,o,Me))==null?void 0:h.isMuted:super.muted}set muted(h){var f;if(w(this,o,Me)){(h&&!w(this,o,Me).isMuted||!h&&w(this,o,Me).isMuted)&&((f=w(this,o,Me).controller)==null||f.muteOrUnmute());return}super.muted=h}get volume(){var h,f;return w(this,o,Me)?(f=(h=w(this,o,Me))==null?void 0:h.volumeLevel)!=null?f:1:super.volume}set volume(h){var f;if(w(this,o,Me)){w(this,o,Me).volumeLevel=+h,(f=w(this,o,Me).controller)==null||f.setVolumeLevel();return}super.volume=h}get duration(){var h,f,m;return w(this,o,Me)&&((h=w(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=w(this,o,Me))==null?void 0:f.duration)!=null?m:NaN:super.duration}get currentTime(){var h,f,m;return w(this,o,Me)&&((h=w(this,o,Me))!=null&&h.isMediaLoaded)?(m=(f=w(this,o,Me))==null?void 0:f.currentTime)!=null?m:0:super.currentTime}set currentTime(h){var f;if(w(this,o,Me)){w(this,o,Me).currentTime=h,(f=w(this,o,Me).controller)==null||f.seek();return}super.currentTime=h}},s=new WeakMap,r=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakSet,Me=function(){var h,f;return(f=(h=ts.get(this.remote))==null?void 0:h.getCastPlayer)==null?void 0:f.call(h)},D_=async function(){w(this,s).paused=Md(t.prototype,this,"paused"),Md(t.prototype,this,"pause").call(this),this.muted=Md(t.prototype,this,"muted");try{await this.load()}catch(h){console.error(h)}},Ie(t,"observedAttributes",[...(e=i.observedAttributes)!=null?e:[],"cast-src","cast-content-type","cast-stream-type","cast-receiver"]),t};var Ns=class extends Event{constructor(t,s){super(t);Ie(this,"track");this.track=s.track}};var Xg=new WeakMap;function X(i){var e;return(e=Xg.get(i))!=null?e:Jw(i,{})}function Jw(i,e){let t=Xg.get(i);return t||Xg.set(i,t={}),Object.assign(t,e)}function uc(i,e){let t=i.videoTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in un.prototype||Object.defineProperty(un.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ns("addtrack",{track:e}))})}function cc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ns("removetrack",{track:i}))})}function C_(i){var s,r,n;let e=(n=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.videoTracks)!=null?n:[],t=!1;for(let a of e)a!==i&&(a.selected=!1,t=!0);if(t){if(X(e).changeRequested)return;X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))})}}var cr,hr,fr,dn,cl,un=class extends EventTarget{constructor(){super();oe(this,dn);oe(this,cr);oe(this,hr);oe(this,fr);X(this).trackSet=new Set}[Symbol.iterator](){return w(this,dn,cl).values()}get length(){return w(this,dn,cl).size}getTrackById(t){var s;return(s=[...w(this,dn,cl)].find(r=>r.id===t))!=null?s:null}get selectedIndex(){return[...w(this,dn,cl)].findIndex(t=>t.selected)}get onaddtrack(){return w(this,cr)}set onaddtrack(t){w(this,cr)&&(this.removeEventListener("addtrack",w(this,cr)),ie(this,cr,void 0)),typeof t=="function"&&(ie(this,cr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return w(this,hr)}set onremovetrack(t){w(this,hr)&&(this.removeEventListener("removetrack",w(this,hr)),ie(this,hr,void 0)),typeof t=="function"&&(ie(this,hr,t),this.addEventListener("removetrack",t))}get onchange(){return w(this,fr)}set onchange(t){w(this,fr)&&(this.removeEventListener("change",w(this,fr)),ie(this,fr,void 0)),typeof t=="function"&&(ie(this,fr,t),this.addEventListener("change",t))}};cr=new WeakMap,hr=new WeakMap,fr=new WeakMap,dn=new WeakSet,cl=function(){return X(this).trackSet};var Us=class extends Event{constructor(t,s){super(t);Ie(this,"rendition");this.rendition=s.rendition}};function w_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.videoRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in cn.prototype||Object.defineProperty(cn.prototype,r,{get(){return ca(this)[r]}}),queueMicrotask(()=>{!t||!i.selected||t.dispatchEvent(new Us("addrendition",{rendition:e}))})}function M_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.videoRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.selected||e.dispatchEvent(new Us("removerendition",{rendition:i}))})}function P_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.videoRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.selected&&e.dispatchEvent(new Event("change"))}))}function ca(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.videoTracks].filter(s=>s.selected).flatMap(s=>[...X(s).renditionSet]):[]}var mr,pr,gr,cn=class extends EventTarget{constructor(){super(...arguments);oe(this,mr);oe(this,pr);oe(this,gr)}[Symbol.iterator](){return ca(this).values()}get length(){return ca(this).length}getRenditionById(t){var s;return(s=ca(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return ca(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of ca(this).entries())r.selected=s===t}get onaddrendition(){return w(this,mr)}set onaddrendition(t){w(this,mr)&&(this.removeEventListener("addrendition",w(this,mr)),ie(this,mr,void 0)),typeof t=="function"&&(ie(this,mr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return w(this,pr)}set onremoverendition(t){w(this,pr)&&(this.removeEventListener("removerendition",w(this,pr)),ie(this,pr,void 0)),typeof t=="function"&&(ie(this,pr,t),this.addEventListener("removerendition",t))}get onchange(){return w(this,gr)}set onchange(t){w(this,gr)&&(this.removeEventListener("change",w(this,gr)),ie(this,gr,void 0)),typeof t=="function"&&(ie(this,gr,t),this.addEventListener("change",t))}};mr=new WeakMap,pr=new WeakMap,gr=new WeakMap;var ha,hl=class{constructor(){Ie(this,"src");Ie(this,"id");Ie(this,"width");Ie(this,"height");Ie(this,"bitrate");Ie(this,"frameRate");Ie(this,"codec");oe(this,ha,!1)}get selected(){return w(this,ha)}set selected(e){w(this,ha)!==e&&(ie(this,ha,e),P_(this))}};ha=new WeakMap;var fa,ma=class{constructor(){Ie(this,"id");Ie(this,"kind");Ie(this,"label","");Ie(this,"language","");Ie(this,"sourceBuffer");oe(this,fa,!1)}addRendition(e,t,s,r,n,a){let o=new hl;return o.src=e,o.width=t,o.height=s,o.frameRate=a,o.bitrate=n,o.codec=r,w_(this,o),o}removeRendition(e){M_(e)}get selected(){return w(this,fa)}set selected(e){w(this,fa)!==e&&(ie(this,fa,e),e===!0&&C_(this))}};fa=new WeakMap;function O_(i,e){var n,a;let t=(a=(n=X(i).media)==null?void 0:n.deref())==null?void 0:a.audioRenditions;X(e).media=X(i).media,X(e).track=i;let s=X(i).renditionSet;s.add(e);let r=s.size-1;r in hn.prototype||Object.defineProperty(hn.prototype,r,{get(){return pa(this)[r]}}),queueMicrotask(()=>{!t||!i.enabled||t.dispatchEvent(new Us("addrendition",{rendition:e}))})}function N_(i){var r,n;let e=(n=(r=X(i).media)==null?void 0:r.deref())==null?void 0:n.audioRenditions,t=X(i).track;X(t).renditionSet.delete(i),queueMicrotask(()=>{let a=X(i).track;!e||!a.enabled||e.dispatchEvent(new Us("removerendition",{rendition:i}))})}function U_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioRenditions;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,X(i).track.enabled&&e.dispatchEvent(new Event("change"))}))}function pa(i){var t;let e=(t=X(i).media)==null?void 0:t.deref();return e?[...e.audioTracks].filter(s=>s.enabled).flatMap(s=>[...X(s).renditionSet]):[]}var vr,Er,yr,hn=class extends EventTarget{constructor(){super(...arguments);oe(this,vr);oe(this,Er);oe(this,yr)}[Symbol.iterator](){return pa(this).values()}get length(){return pa(this).length}getRenditionById(t){var s;return(s=pa(this).find(r=>`${r.id}`==`${t}`))!=null?s:null}get selectedIndex(){return pa(this).findIndex(t=>t.selected)}set selectedIndex(t){for(let[s,r]of pa(this).entries())r.selected=s===t}get onaddrendition(){return w(this,vr)}set onaddrendition(t){w(this,vr)&&(this.removeEventListener("addrendition",w(this,vr)),ie(this,vr,void 0)),typeof t=="function"&&(ie(this,vr,t),this.addEventListener("addrendition",t))}get onremoverendition(){return w(this,Er)}set onremoverendition(t){w(this,Er)&&(this.removeEventListener("removerendition",w(this,Er)),ie(this,Er,void 0)),typeof t=="function"&&(ie(this,Er,t),this.addEventListener("removerendition",t))}get onchange(){return w(this,yr)}set onchange(t){w(this,yr)&&(this.removeEventListener("change",w(this,yr)),ie(this,yr,void 0)),typeof t=="function"&&(ie(this,yr,t),this.addEventListener("change",t))}};vr=new WeakMap,Er=new WeakMap,yr=new WeakMap;var ga,fl=class{constructor(){Ie(this,"src");Ie(this,"id");Ie(this,"bitrate");Ie(this,"codec");oe(this,ga,!1)}get selected(){return w(this,ga)}set selected(e){w(this,ga)!==e&&(ie(this,ga,e),U_(this))}};ga=new WeakMap;function fc(i,e){let t=i.audioTracks;X(e).media=new WeakRef(i),X(e).renditionSet||(X(e).renditionSet=new Set);let s=X(t).trackSet;s.add(e);let r=s.size-1;r in fn.prototype||Object.defineProperty(fn.prototype,r,{get(){return[...X(this).trackSet][r]}}),queueMicrotask(()=>{t.dispatchEvent(new Ns("addtrack",{track:e}))})}function mc(i){var s,r;let e=(r=(s=X(i).media)==null?void 0:s.deref())==null?void 0:r.audioTracks;if(!e)return;X(e).trackSet.delete(i),queueMicrotask(()=>{e.dispatchEvent(new Ns("removetrack",{track:i}))})}function F_(i){var t,s;let e=(s=(t=X(i).media)==null?void 0:t.deref())==null?void 0:s.audioTracks;!e||X(e).changeRequested||(X(e).changeRequested=!0,queueMicrotask(()=>{delete X(e).changeRequested,e.dispatchEvent(new Event("change"))}))}var Tr,br,_r,va,hc,fn=class extends EventTarget{constructor(){super();oe(this,va);oe(this,Tr);oe(this,br);oe(this,_r);X(this).trackSet=new Set}[Symbol.iterator](){return w(this,va,hc).values()}get length(){return w(this,va,hc).size}getTrackById(t){var s;return(s=[...w(this,va,hc)].find(r=>r.id===t))!=null?s:null}get onaddtrack(){return w(this,Tr)}set onaddtrack(t){w(this,Tr)&&(this.removeEventListener("addtrack",w(this,Tr)),ie(this,Tr,void 0)),typeof t=="function"&&(ie(this,Tr,t),this.addEventListener("addtrack",t))}get onremovetrack(){return w(this,br)}set onremovetrack(t){w(this,br)&&(this.removeEventListener("removetrack",w(this,br)),ie(this,br,void 0)),typeof t=="function"&&(ie(this,br,t),this.addEventListener("removetrack",t))}get onchange(){return w(this,_r)}set onchange(t){w(this,_r)&&(this.removeEventListener("change",w(this,_r)),ie(this,_r,void 0)),typeof t=="function"&&(ie(this,_r,t),this.addEventListener("change",t))}};Tr=new WeakMap,br=new WeakMap,_r=new WeakMap,va=new WeakSet,hc=function(){return X(this).trackSet};var Ea,ya=class{constructor(){Ie(this,"id");Ie(this,"kind");Ie(this,"label","");Ie(this,"language","");Ie(this,"sourceBuffer");oe(this,Ea,!1)}addRendition(e,t,s){let r=new fl;return r.src=e,r.codec=t,r.bitrate=s,O_(this,r),r}removeRendition(e){N_(e)}get enabled(){return w(this,Ea)}set enabled(e){w(this,Ea)!==e&&(ie(this,Ea,e),F_(this))}};Ea=new WeakMap;var B_=pc(globalThis.HTMLMediaElement,"video"),$_=pc(globalThis.HTMLMediaElement,"audio");function H_(i){if(!(i!=null&&i.prototype))return i;let e=pc(i,"video");(!e||`${e}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"videoTracks",{get(){return eM(this)}});let t=pc(i,"audio");(!t||`${t}`.includes("[native code]"))&&Object.defineProperty(i.prototype,"audioTracks",{get(){return tM(this)}}),"addVideoTrack"in i.prototype||(i.prototype.addVideoTrack=function(n,a="",o=""){let l=new ma;return l.kind=n,l.label=a,l.language=o,uc(this,l),l}),"removeVideoTrack"in i.prototype||(i.prototype.removeVideoTrack=cc),"addAudioTrack"in i.prototype||(i.prototype.addAudioTrack=function(n,a="",o=""){let l=new ya;return l.kind=n,l.label=a,l.language=o,fc(this,l),l}),"removeAudioTrack"in i.prototype||(i.prototype.removeAudioTrack=mc),"videoRenditions"in i.prototype||Object.defineProperty(i.prototype,"videoRenditions",{get(){return s(this)}});let s=n=>{let a=X(n).videoRenditions;return a||(a=new cn,X(a).media=new WeakRef(n),X(n).videoRenditions=a),a};"audioRenditions"in i.prototype||Object.defineProperty(i.prototype,"audioRenditions",{get(){return r(this)}});let r=n=>{let a=X(n).audioRenditions;return a||(a=new hn,X(a).media=new WeakRef(n),X(n).audioRenditions=a),a};return i}function pc(i,e){var t;if(i!=null&&i.prototype)return(t=Object.getOwnPropertyDescriptor(i.prototype,`${e}Tracks`))==null?void 0:t.get}function eM(i){var t;let e=X(i).videoTracks;if(!e&&(e=new un,X(i).videoTracks=e,B_)){let s=B_.call((t=i.nativeEl)!=null?t:i);for(let o of s)uc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof ma)){for(let l of s)cc(l);return}uc(i,o.track)},a=o=>{cc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}function tM(i){var t;let e=X(i).audioTracks;if(!e&&(e=new fn,X(i).audioTracks=e,$_)){let s=$_.call((t=i.nativeEl)!=null?t:i);for(let o of s)fc(i,o);let r=()=>{e.dispatchEvent(new Event("change"))},n=o=>{if([...e].some(l=>l instanceof ya)){for(let l of s)mc(l);return}fc(i,o.track)},a=o=>{mc(o.track)};s.addEventListener("change",r),s.addEventListener("addtrack",n),s.addEventListener("removetrack",a)}return e}var K_=i=>{throw TypeError(i)},V_=(i,e,t)=>e.has(i)||K_("Cannot "+t),W_=(i,e,t)=>(V_(i,e,"read from private field"),t?t.call(i):e.get(i)),q_=(i,e,t)=>e.has(i)?K_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),Y_=(i,e,t,s)=>(V_(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Ec=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Ec{}globalThis.DocumentFragment=i}var Jg=class extends Ec{},iM=class extends Ec{},sM={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(Jg)}},gc,rM=class{constructor(i,e={}){q_(this,gc),Y_(this,gc,e==null?void 0:e.detail)}get detail(){return W_(this,gc)}initCustomEvent(){}};gc=new WeakMap;function nM(i,e){return new Jg}var j_={document:{createElement:nM},DocumentFragment,customElements:sM,CustomEvent:rM,EventTarget:Ec,HTMLElement:Jg,HTMLVideoElement:iM},z_=typeof window=="undefined"||typeof globalThis.customElements=="undefined",Zg=z_?j_:globalThis,eU=z_?j_.document:globalThis.document,vc,G_=class extends k_(H_(p_)){constructor(){super(...arguments),q_(this,vc)}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 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=W_(this,vc))!=null?i:this.muxCastCustomData}set castCustomData(i){Y_(this,vc,i)}};vc=new WeakMap;Zg.customElements.get("mux-video")||(Zg.customElements.define("mux-video",G_),Zg.MuxVideoElement=G_);var K={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Ee={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},e0={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},Q_=Object.entries(e0),_=Q_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),aM={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},ui=Q_.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...aM}),cU=Object.entries(ui).reduce((i,[e,t])=>{let s=_[e];return s&&(i[t]=s),i},{userinactivechange:"userinactive"}),X_=Object.entries(_).reduce((i,[e,t])=>{let s=ui[e];return s&&(i[t]=s),i},{userinactive:"userinactivechange"}),Xt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Ar={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var yc={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Zt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},Ni={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var Z_={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"};function J_(i){return i==null?void 0:i.map(lM).join(" ")}function eA(i){return i==null?void 0:i.split(/\s+/).map(dM)}function lM(i){if(i){let{id:e,width:t,height:s}=i;return[e,t,s].filter(r=>r!=null).join(":")}}function dM(i){if(i){let[e,t,s]=i.split(":");return{id:e,width:+t,height:+s}}}function tA(i){return i==null?void 0:i.map(uM).join(" ")}function iA(i){return i==null?void 0:i.split(/\s+/).map(cM)}function uM(i){if(i){let{id:e,kind:t,language:s,label:r}=i;return[e,t,s,r].filter(n=>n!=null).join(":")}}function cM(i){if(i){let[e,t,s,r]=i.split(":");return{id:e,kind:t,language:s,label:r}}}function sA(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ta(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Tc(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var bc=i=>new Promise(e=>setTimeout(e,i));var rA={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it.",hour:"hour",hours:"hours",minute:"minute",minutes:"minutes",second:"second",seconds:"seconds","{time} remaining":"{time} remaining","{currentTime} of {totalTime}":"{currentTime} of {totalTime}","video not loaded, unknown time.":"video not loaded, unknown time."};var nA,t0={en:rA},i0=((nA=globalThis.navigator)==null?void 0:nA.language)||"en",aA=i=>{i0=i};var hM=i=>{var e,t,s;let[r]=i0.split("-");return((e=t0[i0])==null?void 0:e[i])||((t=t0[r])==null?void 0:t[i])||((s=t0.en)==null?void 0:s[i])||i},F=(i,e={})=>hM(i).replace(/\{(\w+)\}/g,(t,s)=>s in e?String(e[s]):`{${s}}`);var oA=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],fM=(i,e)=>{let t=i===1?F(oA[e].singular):F(oA[e].plural);return`${i} ${t}`},mn=i=>{if(!Ta(i))return"";let e=Math.abs(i),t=e!==i,s=new Date(0,0,0,0,0,e,0),n=[s.getHours(),s.getMinutes(),s.getSeconds()].map((a,o)=>a&&fM(a,o)).filter(a=>a).join(", ");return t?F("{time} remaining",{time:n}):n};function Ui(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let s=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),a=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=s="0"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",s=s<10?"0"+s:s,(t?"-":"")+n+r+s}var EU=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}});var _c=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ac=class extends _c{},Sc=class extends Ac{constructor(){super(...arguments),this.role=null}},s0=class{observe(){}unobserve(){}disconnect(){}},lA={createElement:function(){return new ml.HTMLElement},createElementNS:function(){return new ml.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},ml={ResizeObserver:s0,document:lA,Node:Ac,Element:Sc,HTMLElement:class extends Sc{constructor(){super(...arguments),this.innerHTML=""}get content(){return new ml.DocumentFragment}},DocumentFragment:class extends _c{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},dA="global"in globalThis&&(globalThis==null?void 0:globalThis.global)===globalThis||typeof window=="undefined"||typeof window.customElements=="undefined",uA=Object.keys(ml).every(i=>i in globalThis),L=dA&&!uA?ml:globalThis,He=dA&&!uA?lA:globalThis.document;var cA=new WeakMap,r0=i=>{let e=cA.get(i);return e||cA.set(i,e=new Set),e},hA=new L.ResizeObserver(i=>{for(let e of i)for(let t of r0(e.target))t(e)});function Fs(i,e){r0(i).add(e),hA.observe(i)}function Bs(i,e){let t=r0(i);t.delete(e),t.size||hA.unobserve(i)}function Xe(i){let e={};for(let t of i)e[t.name]=t.value;return e}function Ye(i){var e;return(e=Ic(i))!=null?e:is(i,"media-controller")}function Ic(i){var e;let{MEDIA_CONTROLLER:t}=Ee,s=i.getAttribute(t);if(s)return(e=pn(i))==null?void 0:e.getElementById(s)}var Lc=(i,e,t=".value")=>{let s=i.querySelector(t);s&&(s.textContent=e)},pM=(i,e)=>{let t=`slot[name="${e}"]`,s=i.shadowRoot.querySelector(t);return s?s.children:[]},Rc=(i,e)=>pM(i,e)[0],Kt=(i,e)=>!i||!e?!1:i!=null&&i.contains(e)?!0:Kt(i,e.getRootNode().host),is=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||is(i.getRootNode().host,e)};function pl(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=pl(t.shadowRoot))!=null?e:t:null}function pn(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function xc(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:s=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:s});let r=i;for(;r&&e>0;){let n=getComputedStyle(r);if(t&&n.opacity==="0"||s&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function fA(i,e,t,s){let r=s.x-t.x,n=s.y-t.y,a=r*r+n*n;if(a===0)return 0;let o=((i-t.x)*r+(e-t.y)*n)/a;return Math.max(0,Math.min(1,o))}function je(i,e){let t=gM(i,s=>s===e);return t||gl(i,e)}function gM(i,e){var t,s;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(s=r.sheet)==null?void 0:s.cssRules}catch{continue}for(let a of n!=null?n:[])if(e(a.selectorText))return a}}function gl(i,e){var t,s;let r=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=r==null?void 0:r[r.length-1];if(!(n!=null&&n.sheet))return console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}};let a=n==null?void 0:n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length);return(s=n.sheet.cssRules)==null?void 0:s[a]}function be(i,e,t=Number.NaN){let s=i.getAttribute(e);return s!=null?+s:t}function Re(i,e,t){let s=+t;if(t==null||Number.isNaN(s)){i.hasAttribute(e)&&i.removeAttribute(e);return}be(i,e,void 0)!==s&&i.setAttribute(e,`${s}`)}function le(i,e){return i.hasAttribute(e)}function de(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}le(i,e)!=t&&i.toggleAttribute(e,t)}function ge(i,e,t=null){var s;return(s=i.getAttribute(e))!=null?s:t}function pe(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let s=`${t}`;ge(i,e,void 0)!==s&&i.setAttribute(e,s)}var mA=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fi=(i,e,t)=>(mA(i,e,"read from private field"),t?t.call(i):e.get(i)),vM=(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)},kc=(i,e,t,s)=>(mA(i,e,"write to private field"),s?s.call(i,t):e.set(i,t),t),Mt;function EM(i){return`
141
141
  <style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mux/mux-player",
3
- "version": "3.13.2",
3
+ "version": "3.13.3-canary.1",
4
4
  "description": "An open source Mux player web component that Just Works™",
5
5
  "homepage": "https://mux.com/player",
6
6
  "keywords": [