@mux/mux-player 2.9.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- var xe=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var u=(t,i,e)=>(xe(t,i,"read from private field"),e?e.call(t):i.get(t)),p=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},x=(t,i,e,a)=>(xe(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var b=(t,i,e)=>(xe(t,i,"access private method"),e);var G=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends G{}globalThis.DocumentFragment=t}var X=class extends G{},Le=class extends G{},Ft={get(t){},define(t,i,e){},upgrade(t){},whenDefined(t){return Promise.resolve(X)}},J,Re=class{constructor(i,e={}){p(this,J,void 0);x(this,J,e==null?void 0:e.detail)}get detail(){return u(this,J)}initCustomEvent(){}};J=new WeakMap;function Yt(t,i){return new X}var dt={document:{createElement:Yt},DocumentFragment,customElements:Ft,CustomEvent:Re,EventTarget:G,HTMLElement:X,HTMLVideoElement:Le},lt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",c=lt?dt:globalThis,T=lt?dt.document:globalThis.document;import{MediaController as Ea}from"media-chrome";import{Attributes as Be}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Nt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import ka,{MediaError as ye,Attributes as d}from"@mux/mux-video";import{StreamTypes as w,PlaybackTypes as ve,addTextTrack as Ta,removeTextTrack as Aa,CmcdTypeValues as It}from"@mux/playback-core";import{VideoEvents as zt}from"@mux/mux-video";var Wt="en",U={code:Wt};var mt="en";function m(t,i=!0){var r,o;let e=i&&(o=(r=U)==null?void 0:r[t])!=null?o:t,a=i?U.code:mt;return new we(e,a)}var we=class{constructor(i,e=(a=>(a=U.code)!=null?a:mt)()){this.message=i,this.locale=e}format(i){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var r;return(r=i[a])!=null?r:""})}toString(){return this.message}};function ut(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${de(e)}: ${a}; `)}),i?i.trim():void 0}function de(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function le(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function L(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function Oe(t){let i=Zt(t).toString();return i?"?"+i:""}function Zt(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}function N(t){let i=(t!=null?t:"").split(".")[1];if(!i)return{};let e=i.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Se=(t,i)=>!t||!i?!1:t.contains(i)?!0:Se(t,i.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var ct="mux.com",Gt=()=>{try{return"2.9.1"}catch{}return"UNKNOWN"},jt=Gt(),ue=()=>jt,pt=(t,{token:i,customDomain:e=ct,thumbnailTime:a,programTime:r}={})=>{let o=i==null?a:void 0,{aud:s}=N(i);if(!(i&&s!=="t"))return`https://image.${e}/${t}/thumbnail.webp${Oe({token:i,time:o,program_time:r})}`},bt=(t,{token:i,customDomain:e=ct,programStartTime:a,programEndTime:r}={})=>{let{aud:o}=N(i);if(!(i&&o!=="s"))return`https://image.${e}/${t}/storyboard.vtt${Oe({token:i,format:"webp",program_start_time:a,program_end_time:r})}`},Q=t=>{if(t){if([Me.LIVE,Me.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return Me.LIVE}};var qt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ht(t){var i;return(i=qt[t])!=null?i:le(t)}var K,$,E,me=class{constructor(i,e){p(this,K,void 0);p(this,$,void 0);p(this,E,[]);x(this,K,i),x(this,$,e)}[Symbol.iterator](){return u(this,E).values()}get length(){return u(this,E).length}get value(){var i;return(i=u(this,E).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(x(this,E,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return u(this,E)[i]}values(){return u(this,E).values()}keys(){return u(this,E).keys()}forEach(i){u(this,E).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||u(this,E).push(r)}),!(this.value===""&&!((e=u(this,K))!=null&&e.hasAttribute(`${u(this,$)}`)))&&((a=u(this,K))==null||a.setAttribute(`${u(this,$)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{u(this,E).splice(u(this,E).indexOf(a),1)}),(e=u(this,K))==null||e.setAttribute(`${u(this,$)}`,`${this.value}`)}contains(i){return u(this,E).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};K=new WeakMap,$=new WeakMap,E=new WeakMap;var gt=`[mux-player ${ue()}]`;function I(...t){console.warn(gt,...t)}function A(...t){console.error(gt,...t)}function _e(t){var e;let i=(e=t.message)!=null?e:"";if(t.context&&(i+=` ${t.context}`),t.file){let a="https://github.com/muxinc/elements/blob/main/errors/";i+=` ${m("Read more: ")}
2
- ${a}${t.file}`}I(i)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},F={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yt=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Xt=zt.filter(t=>t!=="error"),Jt=Object.values(y).filter(t=>![y.PLAYSINLINE].includes(t)),Qt=Object.values(F),j,Pe=class extends c.HTMLElement{constructor(){super();p(this,j,new WeakMap);let e=r=>{for(let o of r)o.type==="childList"&&(o.removedNodes.forEach(s=>{var l;(l=u(this,j).get(s))==null||l.remove()}),o.addedNodes.forEach(s=>{var h;let l=s;l!=null&&l.slot||(h=this.media)==null||h.append(vt(u(this,j),s))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...Jt,...Qt]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(e=>{var a;(a=this.media)==null||a.append(vt(u(this,j),e))}),Xt.forEach(e=>{var a;(a=this.media)==null||a.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,a,r){var o,s;switch(e){case F.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case F.VOLUME:{let l=(o=L(r))!=null?o:1;this.media&&(this.media.volume=l);return}case F.PLAYBACKRATE:{let l=(s=L(r))!=null?s:1;this.media&&(this.media.playbackRate=l,this.media.defaultPlaybackRate=l);return}}}play(){var e,a;return(a=(e=this.media)==null?void 0:e.play())!=null?a:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e,a;return(a=(e=this.media)==null?void 0:e.buffered)!=null?a:yt}get seekable(){var e,a;return(a=(e=this.media)==null?void 0:e.seekable)!=null?a:yt}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e,a;return(a=(e=this.media)==null?void 0:e.videoWidth)!=null?a:0}get videoHeight(){var e,a;return(a=(e=this.media)==null?void 0:e.videoHeight)!=null?a:0}get currentSrc(){var e,a;return(a=(e=this.media)==null?void 0:e.currentSrc)!=null?a:""}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=L(this.getAttribute(F.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(F.PLAYBACKRATE,`${e}`):this.removeAttribute(F.PLAYBACKRATE)}get crossOrigin(){return ee(this,y.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(y.CROSSORIGIN,`${e}`)}get autoplay(){return ee(this,y.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(y.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return ee(this,y.LOOP)!=null}set loop(e){e?this.setAttribute(y.LOOP,""):this.removeAttribute(y.LOOP)}get muted(){var e,a;return(a=(e=this.media)==null?void 0:e.muted)!=null?a:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return ee(this,y.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return ee(this,y.PLAYSINLINE)!=null}set playsInline(e){A("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(y.PRELOAD,e):this.removeAttribute(y.PRELOAD)}};j=new WeakMap;function ee(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}function vt(t,i){let e=t.get(i);return e||(e=i.cloneNode(),t.set(i,e)),e}var Ne=Pe;import"media-chrome/dist/media-theme-element.js";var Et=`:host {
1
+ var xe=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var u=(t,i,e)=>(xe(t,i,"read from private field"),e?e.call(t):i.get(t)),p=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},x=(t,i,e,a)=>(xe(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);var b=(t,i,e)=>(xe(t,i,"access private method"),e);var G=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment=="undefined"){class t extends G{}globalThis.DocumentFragment=t}var X=class extends G{},Re=class extends G{},Yt={get(t){},define(t,i,e){},getName(t){return null},upgrade(t){},whenDefined(t){return Promise.resolve(X)}},J,Le=class{constructor(i,e={}){p(this,J,void 0);x(this,J,e==null?void 0:e.detail)}get detail(){return u(this,J)}initCustomEvent(){}};J=new WeakMap;function Ft(t,i){return new X}var dt={document:{createElement:Ft},DocumentFragment,customElements:Yt,CustomEvent:Le,EventTarget:G,HTMLElement:X,HTMLVideoElement:Re},lt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",c=lt?dt:globalThis,A=lt?dt.document:globalThis.document;import{MediaController as Ea}from"media-chrome";import{Attributes as Be}from"media-chrome/dist/media-container.js";import{MediaUIAttributes as Nt}from"media-chrome/dist/constants.js";import"media-chrome/dist/experimental/index.js";import Ta,{MediaError as ye,Attributes as d}from"@mux/mux-video";import{StreamTypes as w,PlaybackTypes as ve,addTextTrack as ka,removeTextTrack as Aa,CmcdTypeValues as It}from"@mux/playback-core";import{VideoEvents as zt}from"@mux/mux-video";var Wt="en",U={code:Wt};var mt="en";function m(t,i=!0){var r,o;let e=i&&(o=(r=U)==null?void 0:r[t])!=null?o:t,a=i?U.code:mt;return new Oe(e,a)}var Oe=class{constructor(i,e=(a=>(a=U.code)!=null?a:mt)()){this.message=i,this.locale=e}format(i){return this.message.replace(/\{(\w+)\}/g,(e,a)=>{var r;return(r=i[a])!=null?r:""})}toString(){return this.message}};function ut(t){let i="";return Object.entries(t).forEach(([e,a])=>{a!=null&&(i+=`${de(e)}: ${a}; `)}),i?i.trim():void 0}function de(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function le(t){return t.replace(/[-_]([a-z])/g,(i,e)=>e.toUpperCase())}function R(t){if(t==null)return;let i=+t;return Number.isNaN(i)?void 0:i}function we(t){let i=Zt(t).toString();return i?"?"+i:""}function Zt(t){let i={};for(let e in t)t[e]!=null&&(i[e]=t[e]);return new URLSearchParams(i)}function _(t){let i=(t!=null?t:"").split(".")[1];if(!i)return{};let e=i.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Me=(t,i)=>!t||!i?!1:t.contains(i)?!0:Me(t,i.getRootNode().host);import{StreamTypes as _e}from"@mux/playback-core";var ct="mux.com",Gt=()=>{try{return"3.0.0"}catch{}return"UNKNOWN"},jt=Gt(),ue=()=>jt,pt=(t,{token:i,customDomain:e=ct,thumbnailTime:a,programTime:r}={})=>{let o=i==null?a:void 0,{aud:s}=_(i);if(!(i&&s!=="t"))return`https://image.${e}/${t}/thumbnail.webp${we({token:i,time:o,program_time:r})}`},bt=(t,{token:i,customDomain:e=ct,programStartTime:a,programEndTime:r}={})=>{let{aud:o}=_(i);if(!(i&&o!=="s"))return`https://image.${e}/${t}/storyboard.vtt${we({token:i,format:"webp",program_start_time:a,program_end_time:r})}`},Q=t=>{if(t){if([_e.LIVE,_e.ON_DEMAND].includes(t))return t;if(t!=null&&t.includes("live"))return _e.LIVE}};var qt={crossorigin:"crossOrigin",playsinline:"playsInline"};function ht(t){var i;return(i=qt[t])!=null?i:le(t)}var K,$,E,me=class{constructor(i,e){p(this,K,void 0);p(this,$,void 0);p(this,E,[]);x(this,K,i),x(this,$,e)}[Symbol.iterator](){return u(this,E).values()}get length(){return u(this,E).length}get value(){var i;return(i=u(this,E).join(" "))!=null?i:""}set value(i){var e;i!==this.value&&(x(this,E,[]),this.add(...(e=i==null?void 0:i.split(" "))!=null?e:[]))}toString(){return this.value}item(i){return u(this,E)[i]}values(){return u(this,E).values()}keys(){return u(this,E).keys()}forEach(i){u(this,E).forEach(i)}add(...i){var e,a;i.forEach(r=>{this.contains(r)||u(this,E).push(r)}),!(this.value===""&&!((e=u(this,K))!=null&&e.hasAttribute(`${u(this,$)}`)))&&((a=u(this,K))==null||a.setAttribute(`${u(this,$)}`,`${this.value}`))}remove(...i){var e;i.forEach(a=>{u(this,E).splice(u(this,E).indexOf(a),1)}),(e=u(this,K))==null||e.setAttribute(`${u(this,$)}`,`${this.value}`)}contains(i){return u(this,E).includes(i)}toggle(i,e){return typeof e!="undefined"?e?(this.add(i),!0):(this.remove(i),!1):this.contains(i)?(this.remove(i),!1):(this.add(i),!0)}replace(i,e){this.remove(i),this.add(e)}};K=new WeakMap,$=new WeakMap,E=new WeakMap;var gt=`[mux-player ${ue()}]`;function O(...t){console.warn(gt,...t)}function k(...t){console.error(gt,...t)}function Se(t){var e;let i=(e=t.message)!=null?e:"";if(t.context&&(i+=` ${t.context}`),t.file){let a="https://github.com/muxinc/elements/blob/main/errors/";i+=` ${m("Read more: ")}
2
+ ${a}${t.file}`}O(i)}var y={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Y={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yt=Object.freeze({length:0,start(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let i=t>>>0;if(i>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${i}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),Xt=zt.filter(t=>t!=="error"),Jt=Object.values(y).filter(t=>![y.PLAYSINLINE].includes(t)),Qt=Object.values(Y),j,Pe=class extends c.HTMLElement{constructor(){super();p(this,j,new WeakMap);let e=r=>{for(let o of r)o.type==="childList"&&(o.removedNodes.forEach(s=>{var l;(l=u(this,j).get(s))==null||l.remove()}),o.addedNodes.forEach(s=>{var h;let l=s;l!=null&&l.slot||(h=this.media)==null||h.append(vt(u(this,j),s))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}static get observedAttributes(){return[...Jt,...Qt]}init(){this.querySelectorAll(":scope > :not([slot])").forEach(e=>{var a;(a=this.media)==null||a.append(vt(u(this,j),e))}),Xt.forEach(e=>{var a;(a=this.media)==null||a.addEventListener(e,r=>{this.dispatchEvent(new Event(r.type))})})}attributeChangedCallback(e,a,r){var o,s;switch(e){case Y.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case Y.VOLUME:{let l=(o=R(r))!=null?o:1;this.media&&(this.media.volume=l);return}case Y.PLAYBACKRATE:{let l=(s=R(r))!=null?s:1;this.media&&(this.media.playbackRate=l,this.media.defaultPlaybackRate=l);return}}}play(){var e,a;return(a=(e=this.media)==null?void 0:e.play())!=null?a:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}load(){var e;(e=this.media)==null||e.load()}requestCast(e){var a;return(a=this.media)==null?void 0:a.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,a;return(a=(e=this.media)==null?void 0:e.paused)!=null?a:!0}get duration(){var e,a;return(a=(e=this.media)==null?void 0:e.duration)!=null?a:NaN}get ended(){var e,a;return(a=(e=this.media)==null?void 0:e.ended)!=null?a:!1}get buffered(){var e,a;return(a=(e=this.media)==null?void 0:e.buffered)!=null?a:yt}get seekable(){var e,a;return(a=(e=this.media)==null?void 0:e.seekable)!=null?a:yt}get readyState(){var e,a;return(a=(e=this.media)==null?void 0:e.readyState)!=null?a:0}get videoWidth(){var e,a;return(a=(e=this.media)==null?void 0:e.videoWidth)!=null?a:0}get videoHeight(){var e,a;return(a=(e=this.media)==null?void 0:e.videoHeight)!=null?a:0}get currentSrc(){var e,a;return(a=(e=this.media)==null?void 0:e.currentSrc)!=null?a:""}get currentTime(){var e,a;return(a=(e=this.media)==null?void 0:e.currentTime)!=null?a:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,a;return(a=(e=this.media)==null?void 0:e.volume)!=null?a:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,a;return(a=(e=this.media)==null?void 0:e.playbackRate)!=null?a:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=R(this.getAttribute(Y.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Y.PLAYBACKRATE,`${e}`):this.removeAttribute(Y.PLAYBACKRATE)}get crossOrigin(){return ee(this,y.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(y.CROSSORIGIN,`${e}`)}get autoplay(){return ee(this,y.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(y.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(y.AUTOPLAY)}get loop(){return ee(this,y.LOOP)!=null}set loop(e){e?this.setAttribute(y.LOOP,""):this.removeAttribute(y.LOOP)}get muted(){var e,a;return(a=(e=this.media)==null?void 0:e.muted)!=null?a:!1}set muted(e){this.media&&(this.media.muted=!!e)}get defaultMuted(){return ee(this,y.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(y.MUTED,""):this.removeAttribute(y.MUTED)}get playsInline(){return ee(this,y.PLAYSINLINE)!=null}set playsInline(e){k("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(y.PRELOAD,e):this.removeAttribute(y.PRELOAD)}};j=new WeakMap;function ee(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}function vt(t,i){let e=t.get(i);return e||(e=i.cloneNode(),t.set(i,e)),e}var Ne=Pe;import"media-chrome/dist/media-theme-element.js";var Et=`:host {
3
3
  --media-control-display: var(--controls);
4
4
  --media-loading-indicator-display: var(--loading-indicator);
5
5
  --media-dialog-display: var(--dialog);
@@ -146,7 +146,11 @@ media-poster-image:not([src]):not([placeholdersrc]) {
146
146
  --media-duration-display-display: var(--duration-display, var(--bottom-duration-display));
147
147
  --media-title-display-display: var(--title-display, var(--bottom-title-display));
148
148
  }
149
- `;var Tt=`
149
+
150
+ :host([no-tooltips]) {
151
+ --media-tooltip-display: none;
152
+ }
153
+ `;var kt=`
150
154
  :host {
151
155
  z-index: 100;
152
156
  display: var(--media-dialog-display, flex);
@@ -198,15 +202,15 @@ media-poster-image:not([src]):not([placeholdersrc]) {
198
202
  text-align: center;
199
203
  line-height: 1.4;
200
204
  }
201
- `,At=T.createElement("template");At.innerHTML=`
205
+ `,At=A.createElement("template");At.innerHTML=`
202
206
  <style>
203
- ${Tt}
207
+ ${kt}
204
208
  </style>
205
209
 
206
210
  <div class="dialog">
207
211
  <slot></slot>
208
212
  </div>
209
- `;var D=class extends c.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),kt(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),ta(this))}attributeChangedCallback(e,a,r){e==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&kt(this)}};D.styles=Tt,D.template=At,D.observedAttributes=["open"];function kt(t){let i=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(i),i.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=Ct(t.shadowRoot)),t._previouslyFocusedElement=T.activeElement,T.activeElement instanceof HTMLElement&&T.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function Ct(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=t==null?void 0:t.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let o=0;o<r.length&&!(r[o].tagName&&r[o].shadowRoot&&(a=Ct(r[o].shadowRoot),a));o++);}return a}function ta(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}c.customElements.get("media-dialog")||(c.customElements.define("media-dialog",D),c.MediaDialog=D);var Ie=D;var xt=T.createElement("template");xt.innerHTML=`
213
+ `;var D=class extends c.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Tt(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),ta(this))}attributeChangedCallback(e,a,r){e==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Tt(this)}};D.styles=kt,D.template=At,D.observedAttributes=["open"];function Tt(t){let i=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(i),i.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=Ct(t.shadowRoot)),t._previouslyFocusedElement=A.activeElement,A.activeElement instanceof HTMLElement&&A.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function Ct(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=t==null?void 0:t.querySelector(e.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let o=0;o<r.length&&!(r[o].tagName&&r[o].shadowRoot&&(a=Ct(r[o].shadowRoot),a));o++);}return a}function ta(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}c.customElements.get("media-dialog")||(c.customElements.define("media-dialog",D),c.MediaDialog=D);var Ie=D;var xt=A.createElement("template");xt.innerHTML=`
210
214
  <style>
211
215
  ${Ie.styles}
212
216
 
@@ -237,13 +241,13 @@ media-poster-image:not([src]):not([placeholdersrc]) {
237
241
  </svg>
238
242
  </button>
239
243
  </slot>
240
- `;var te=class extends Ie{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};te.template=xt;c.customElements.get("mxp-dialog")||(c.customElements.define("mxp-dialog",te),c.MxpDialog=te);import{TemplateInstance as aa,ChildNodePart as pe,AttrPart as be}from"media-chrome/dist/media-theme-element.js";var ae=new WeakMap,Ve=class t{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=ae.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=ae.get(this.element);e&&e.delete(this.type)}}static for(i){ae.has(i.element)||ae.set(i.element,new Map);let e=i.attributeName.slice(2),a=ae.get(i.element);return a&&a.has(e)?a.get(e):new t(i.element,e)}};function ia(t,i){return t instanceof be&&t.attributeName.startsWith("on")?(Ve.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ra(t,i){return i instanceof ce&&t instanceof pe?(i.renderInto(t),!0):!1}function oa(t,i){return i instanceof DocumentFragment&&t instanceof pe?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function na(t,i){if(t instanceof be){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function sa(t,i){if(t instanceof be&&i instanceof Element){let e=t.element;return e[t.attributeName]!==i&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),e[t.attributeName]=i),!0}return!1}function da(t,i){if(typeof i=="boolean"&&t instanceof be){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function la(t,i){return i===!1&&t instanceof pe?(t.replace(""),!0):!1}function ma(t,i){sa(t,i)||da(t,i)||ia(t,i)||la(t,i)||ra(t,i)||oa(t,i)||na(t,i)}var De=new Map,Lt=new WeakMap,Rt=new WeakMap,ce=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(De.has(this.stringsKey))return De.get(this.stringsKey);{let i=T.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<e?`{{ ${o} }}`:""),""),De.set(this.stringsKey,i),i}}renderInto(i){var r;let e=this.template;if(Lt.get(i)!==e){Lt.set(i,e);let o=new aa(e,this.values,this.processor);Rt.set(i,o),i instanceof pe?i.replace(...o.children):i.appendChild(o);return}let a=Rt.get(i);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},ua={processCallback(t,i,e){var a;if(e){for(let[r,o]of i)if(r in e){let s=(a=e[r])!=null?a:"";ma(o,s)}}}};function S(t,...i){return new ce(t,i,ua)}function wt(t,i){t.renderInto(i)}import{StreamTypes as ca,toMuxVideoURL as Ot}from"@mux/playback-core";var pa=t=>{let{tokens:i}=t;return i.drm?":host { --_cast-button-drm-display: none; }":""},St=t=>S`
244
+ `;var te=class extends Ie{constructor(){var i,e;super(),(e=(i=this.shadowRoot)==null?void 0:i.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};te.template=xt;c.customElements.get("mxp-dialog")||(c.customElements.define("mxp-dialog",te),c.MxpDialog=te);import{TemplateInstance as aa,ChildNodePart as pe,AttrPart as be}from"media-chrome/dist/media-theme-element.js";var ae=new WeakMap,Ve=class t{constructor(i,e){this.element=i;this.type=e;this.element.addEventListener(this.type,this);let a=ae.get(this.element);a&&a.set(this.type,this)}set(i){if(typeof i=="function")this.handleEvent=i.bind(this.element);else if(typeof i=="object"&&typeof i.handleEvent=="function")this.handleEvent=i.handleEvent.bind(i);else{this.element.removeEventListener(this.type,this);let e=ae.get(this.element);e&&e.delete(this.type)}}static for(i){ae.has(i.element)||ae.set(i.element,new Map);let e=i.attributeName.slice(2),a=ae.get(i.element);return a&&a.has(e)?a.get(e):new t(i.element,e)}};function ia(t,i){return t instanceof be&&t.attributeName.startsWith("on")?(Ve.for(t).set(i),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function ra(t,i){return i instanceof ce&&t instanceof pe?(i.renderInto(t),!0):!1}function oa(t,i){return i instanceof DocumentFragment&&t instanceof pe?(i.childNodes.length&&t.replace(...i.childNodes),!0):!1}function na(t,i){if(t instanceof be){let e=t.attributeNamespace,a=t.element.getAttributeNS(e,t.attributeName);return String(i)!==a&&(t.value=String(i)),!0}return t.value=String(i),!0}function sa(t,i){if(t instanceof be&&i instanceof Element){let e=t.element;return e[t.attributeName]!==i&&(t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),e[t.attributeName]=i),!0}return!1}function da(t,i){if(typeof i=="boolean"&&t instanceof be){let e=t.attributeNamespace,a=t.element.hasAttributeNS(e,t.attributeName);return i!==a&&(t.booleanValue=i),!0}return!1}function la(t,i){return i===!1&&t instanceof pe?(t.replace(""),!0):!1}function ma(t,i){sa(t,i)||da(t,i)||ia(t,i)||la(t,i)||ra(t,i)||oa(t,i)||na(t,i)}var De=new Map,Rt=new WeakMap,Lt=new WeakMap,ce=class{constructor(i,e,a){this.strings=i;this.values=e;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(De.has(this.stringsKey))return De.get(this.stringsKey);{let i=A.createElement("template"),e=this.strings.length-1;return i.innerHTML=this.strings.reduce((a,r,o)=>a+r+(o<e?`{{ ${o} }}`:""),""),De.set(this.stringsKey,i),i}}renderInto(i){var r;let e=this.template;if(Rt.get(i)!==e){Rt.set(i,e);let o=new aa(e,this.values,this.processor);Lt.set(i,o),i instanceof pe?i.replace(...o.children):i.appendChild(o);return}let a=Lt.get(i);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},ua={processCallback(t,i,e){var a;if(e){for(let[r,o]of i)if(r in e){let s=(a=e[r])!=null?a:"";ma(o,s)}}}};function S(t,...i){return new ce(t,i,ua)}function Ot(t,i){t.renderInto(i)}import{StreamTypes as ca,toMuxVideoURL as wt}from"@mux/playback-core";var pa=t=>{let{tokens:i}=t;return i.drm?":host { --_cast-button-drm-display: none; }":""},Mt=t=>S`
241
245
  <style>
242
246
  ${pa(t)}
243
247
  ${Et}
244
248
  </style>
245
249
  ${fa(t)}
246
- `,ba=t=>{let i=t.hotKeys?`${t.hotKeys}`:"";return Q(t.streamType)==="live"&&(i+=" noarrowleft noarrowright"),i},ha={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",SELECTMENU:"selectmenu",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},ga=Object.values(ha).join(", "),fa=t=>{var i,e,a,r,o,s,l,h,R,k,v,f,C,P,g,B,q,z,$e,Fe,Ye,We,Ze,Ge,je,qe,ze,Xe,Je,Qe,et,tt,at,it,rt,ot,nt,st;return S`
250
+ `,ba=t=>{let i=t.hotKeys?`${t.hotKeys}`:"";return Q(t.streamType)==="live"&&(i+=" noarrowleft noarrowright"),i},ha={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",SELECTMENU:"selectmenu",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},ga=Object.values(ha).join(", "),fa=t=>{var i,e,a,r,o,s,l,h,L,T,v,f,C,I,g,B,q,z,$e,Ye,Fe,We,Ze,Ge,je,qe,ze,Xe,Je,Qe,et,tt,at,it,rt,ot,nt,st;return S`
247
251
  <media-theme
248
252
  template="${t.themeTemplate||!1}"
249
253
  defaultstreamtype="${(i=t.defaultStreamType)!=null?i:!1}"
@@ -259,8 +263,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
259
263
  backwardseekoffset="${(s=t.backwardSeekOffset)!=null?s:!1}"
260
264
  playbackrates="${(l=t.playbackRates)!=null?l:!1}"
261
265
  defaultshowremainingtime="${(h=t.defaultShowRemainingTime)!=null?h:!1}"
262
- defaultduration="${(R=t.defaultDuration)!=null?R:!1}"
263
- hideduration="${(k=t.hideDuration)!=null?k:!1}"
266
+ defaultduration="${(L=t.defaultDuration)!=null?L:!1}"
267
+ hideduration="${(T=t.hideDuration)!=null?T:!1}"
264
268
  title="${(v=t.title)!=null?v:!1}"
265
269
  exportparts="${ga}"
266
270
  >
@@ -268,15 +272,15 @@ media-poster-image:not([src]):not([placeholdersrc]) {
268
272
  slot="media"
269
273
  target-live-window="${(f=t.targetLiveWindow)!=null?f:!1}"
270
274
  stream-type="${(C=Q(t.streamType))!=null?C:!1}"
271
- crossorigin="${(P=t.crossOrigin)!=null?P:""}"
275
+ crossorigin="${(I=t.crossOrigin)!=null?I:""}"
272
276
  playsinline
273
277
  autoplay="${(g=t.autoplay)!=null?g:!1}"
274
278
  muted="${(B=t.muted)!=null?B:!1}"
275
279
  loop="${(q=t.loop)!=null?q:!1}"
276
280
  preload="${(z=t.preload)!=null?z:!1}"
277
281
  debug="${($e=t.debug)!=null?$e:!1}"
278
- prefer-cmcd="${(Fe=t.preferCmcd)!=null?Fe:!1}"
279
- disable-tracking="${(Ye=t.disableTracking)!=null?Ye:!1}"
282
+ prefer-cmcd="${(Ye=t.preferCmcd)!=null?Ye:!1}"
283
+ disable-tracking="${(Fe=t.disableTracking)!=null?Fe:!1}"
280
284
  disable-cookies="${(We=t.disableCookies)!=null?We:!1}"
281
285
  prefer-playback="${(Ze=t.preferPlayback)!=null?Ze:!1}"
282
286
  start-time="${t.startTime!=null?t.startTime:!1}"
@@ -285,9 +289,10 @@ media-poster-image:not([src]):not([placeholdersrc]) {
285
289
  player-software-version="${(qe=t.playerSoftwareVersion)!=null?qe:!1}"
286
290
  env-key="${(ze=t.envKey)!=null?ze:!1}"
287
291
  custom-domain="${(Xe=t.customDomain)!=null?Xe:!1}"
288
- src="${t.src?t.src:t.playbackId?Ot(t):!1}"
289
- cast-src="${t.src?t.src:t.playbackId?Ot(t):!1}"
290
- drm-token="${(Qe=(Je=t.tokens)==null?void 0:Je.drm)!=null?Qe:!1}"
292
+ src="${t.src?t.src:t.playbackId?wt(t):!1}"
293
+ cast-src="${t.src?t.src:t.playbackId?wt(t):!1}"
294
+ cast-receiver="${(Je=t.castReceiver)!=null?Je:!1}"
295
+ drm-token="${(et=(Qe=t.tokens)==null?void 0:Qe.drm)!=null?et:!1}"
291
296
  exportparts="video"
292
297
  >
293
298
  ${t.storyboard?S`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:S``}
@@ -296,7 +301,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
296
301
  <media-poster-image
297
302
  part="poster"
298
303
  exportparts="poster, img"
299
- src="${t.poster===""?!1:(et=t.poster)!=null?et:!1}"
304
+ src="${t.poster?t.poster:!1}"
300
305
  placeholdersrc="${(tt=t.placeholder)!=null?tt:!1}"
301
306
  ></media-poster-image>
302
307
  </slot>
@@ -319,7 +324,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
319
324
  </p>
320
325
  </mxp-dialog>
321
326
  </media-theme>
322
- `};import{MediaError as he}from"@mux/mux-video";function ge(t,i,e,a,r){var l,h,R;let o={},s={};switch(t.code){case he.MEDIA_ERR_NETWORK:{switch(o.title=m("Network Error",r),o.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{o.title=m("Video is not currently available",r),o.message=m("The live stream or video file are not yet ready.",r),s.message=m("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{o.title=m("Video does not exist",r),o.message="",s.message=m("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(o.title=m("Invalid playback URL",r),o.message=m("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=m("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:k,aud:v,sub:f}=N(a),C=Date.now()>k*1e3,P=f!==e,g=v!=="v",B={timeStyle:"medium",dateStyle:"medium"};if(C){o.title=m("Video URL has expired",r),o.message=m("The video\u2019s secured playback-token has expired.",r),s.message=m("The video\u2019s secured playback-token has expired.",r),s.context=m("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(U.code,B).format(k*1e3),currentDate:new Intl.DateTimeFormat(U.code,B).format(Date.now())}),s.file="403-expired-token.md";break}if(P){o.title=m("Video URL is formatted incorrectly",r),o.message=m("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=m("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=m("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:e,tokenPlaybackId:f}),s.file="403-playback-id-mismatch.md";break}if(g){o.title=m("Video URL is formatted incorrectly",r),o.message=m("The playback-token is formatted with incorrect information.",r),s.message=m("The playback-token is formatted with incorrect information.",r),s.context=m("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:v}),s.file="403-incorrect-aud-value.md";break}s.message=m("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case he.MEDIA_ERR_DECODE:{let{message:k}=t;o={title:m("Media Error",r),message:k},s.file="media-decode-error.md";break}case he.MEDIA_ERR_SRC_NOT_SUPPORTED:{let k=(R=(h=t.data)==null?void 0:h.response)==null?void 0:R.code;if(k>=400&&k<500){t.code=he.MEDIA_ERR_NETWORK,t.data={response:{code:k}},{dialog:o,devlog:s}=ge(t,i,e,a);break}o={title:m("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:o={title:m("Error",r),message:t.message};break}return i&&(o={title:m("Your device appears to be offline",r),message:m("Check your internet connection and try reloading this video.",r)}),{dialog:o,devlog:s}}var Mt=`<template id="media-theme-gerwig">
327
+ `};import{MediaError as he}from"@mux/mux-video";function ge(t,i,e,a,r){var l,h,L;let o={},s={};switch(t.code){case he.MEDIA_ERR_NETWORK:{switch(o.title=m("Network Error",r),o.message=t.message,(l=t.data)==null?void 0:l.response.code){case 412:{o.title=m("Video is not currently available",r),o.message=m("The live stream or video file are not yet ready.",r),s.message=m("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{o.title=m("Video does not exist",r),o.message="",s.message=m("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(o.title=m("Invalid playback URL",r),o.message=m("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=m("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:T,aud:v,sub:f}=_(a),C=Date.now()>T*1e3,I=f!==e,g=v!=="v",B={timeStyle:"medium",dateStyle:"medium"};if(C){o.title=m("Video URL has expired",r),o.message=m("The video\u2019s secured playback-token has expired.",r),s.message=m("The video\u2019s secured playback-token has expired.",r),s.context=m("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(U.code,B).format(T*1e3),currentDate:new Intl.DateTimeFormat(U.code,B).format(Date.now())}),s.file="403-expired-token.md";break}if(I){o.title=m("Video URL is formatted incorrectly",r),o.message=m("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=m("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=m("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:e,tokenPlaybackId:f}),s.file="403-playback-id-mismatch.md";break}if(g){o.title=m("Video URL is formatted incorrectly",r),o.message=m("The playback-token is formatted with incorrect information.",r),s.message=m("The playback-token is formatted with incorrect information.",r),s.context=m("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:v}),s.file="403-incorrect-aud-value.md";break}s.message=m("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case he.MEDIA_ERR_DECODE:{let{message:T}=t;o={title:m("Media Error",r),message:T},s.file="media-decode-error.md";break}case he.MEDIA_ERR_SRC_NOT_SUPPORTED:{let T=(L=(h=t.data)==null?void 0:h.response)==null?void 0:L.code;if(T>=400&&T<500){t.code=he.MEDIA_ERR_NETWORK,t.data={response:{code:T}},{dialog:o,devlog:s}=ge(t,i,e,a);break}o={title:m("Source Not Supported",r),message:t.message},s.file="media-src-not-supported.md";break}default:o={title:m("Error",r),message:t.message};break}return i&&(o={title:m("Your device appears to be offline",r),message:m("Check your internet connection and try reloading this video.",r)}),{dialog:o,devlog:s}}var _t=`<template id="media-theme-gerwig">
323
328
  <style>
324
329
  @keyframes pre-play-hide {
325
330
  0% {
@@ -350,6 +355,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
350
355
  --media-preview-time-text-shadow: none;
351
356
  --media-control-height: 14px;
352
357
  --media-control-padding: 6px;
358
+ --media-tooltip-container-margin: 6px;
359
+ --media-tooltip-distance: 18px;
353
360
 
354
361
  color: var(--_primary-color);
355
362
  display: inline-block;
@@ -451,18 +458,18 @@ media-poster-image:not([src]):not([placeholdersrc]) {
451
458
  border-bottom-width: 0;
452
459
  }
453
460
 
454
- [part~='listbox'] {
461
+ [part~='menu'] {
455
462
  border-radius: 2px;
456
463
  border: 1px solid rgba(0, 0, 0, 0.1);
457
- bottom: calc(100% + 16px);
464
+ bottom: 50px;
458
465
  padding: 2.5px 10px;
459
466
  }
460
467
 
461
- [part~='listbox']::part(indicator) {
468
+ [part~='menu']::part(indicator) {
462
469
  fill: var(--_accent-color);
463
470
  }
464
471
 
465
- [part~='listbox']::part(option) {
472
+ [part~='menu']::part(menu-item) {
466
473
  box-sizing: border-box;
467
474
  display: flex;
468
475
  align-items: center;
@@ -470,44 +477,47 @@ media-poster-image:not([src]):not([placeholdersrc]) {
470
477
  min-height: 34px;
471
478
  }
472
479
 
473
- [part~='listbox']::part(option-selected) {
480
+ [part~='menu']::part(checked) {
474
481
  font-weight: 700;
475
482
  }
476
483
 
477
- media-captions-selectmenu,
478
- media-rendition-selectmenu,
479
- media-audio-track-selectmenu,
480
- media-playback-rate-listbox[part~='listbox'] {
481
- --media-listbox-background: var(--_primary-color);
482
- --media-option-selected-background: transparent;
483
- --media-option-hover-background: transparent;
484
- --media-option-hover-outline: var(--_accent-color) solid 1px;
484
+ media-captions-menu,
485
+ media-rendition-menu,
486
+ media-audio-track-menu,
487
+ media-playback-rate-menu {
488
+ position: absolute; /* ensure they don't take up space in DOM on load */
489
+ --media-menu-background: var(--_primary-color);
490
+ --media-menu-item-checked-background: transparent;
485
491
  --media-text-color: var(--_text-color);
492
+ --media-menu-item-hover-background: transparent;
493
+ --media-menu-item-hover-outline: var(--_accent-color) solid 1px;
486
494
  }
487
495
 
488
496
  /* The icon is a circle so make it 16px high instead of 14px for more balance. */
489
- media-audio-track-selectmenu {
497
+ media-audio-track-menu-button {
490
498
  --media-control-padding: 5px;
491
499
  --media-control-height: 16px;
492
500
  }
493
501
 
494
- media-playback-rate-button {
502
+ media-playback-rate-menu-button {
495
503
  --media-control-padding: 6px 3px;
496
504
  min-width: 4.4ch;
497
505
  }
498
506
 
499
- media-playback-rate-listbox[part~='listbox'] {
500
- --media-listbox-layout: row;
501
- --media-option-selected-background: var(--_accent-color);
507
+ media-playback-rate-menu {
508
+ --media-menu-flex-direction: row;
509
+ --media-menu-item-checked-background: var(--_accent-color);
510
+ --media-menu-item-checked-indicator-display: none;
502
511
  margin-right: 6px;
503
512
  padding: 0;
513
+ --media-menu-gap: 0.25em;
504
514
  }
505
515
 
506
- media-playback-rate-listbox[part~='listbox']::part(option) {
507
- padding: 6px 4px;
516
+ media-playback-rate-menu[part~='menu']::part(menu-item) {
517
+ padding: 6px 6px 6px 8px;
508
518
  }
509
519
 
510
- media-playback-rate-listbox[part~='listbox']::part(option-selected) {
520
+ media-playback-rate-menu[part~='menu']::part(checked) {
511
521
  color: #fff;
512
522
  }
513
523
 
@@ -571,7 +581,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
571
581
  }
572
582
 
573
583
  media-control-bar[part~='bottom'] > * {
574
- z-index: 2;
584
+ z-index: 20;
575
585
  }
576
586
 
577
587
  media-control-bar[part~='bottom'] {
@@ -596,6 +606,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
596
606
  .center-controls {
597
607
  --media-button-icon-width: 100%;
598
608
  --media-button-icon-height: auto;
609
+ --media-tooltip-display: none;
599
610
  pointer-events: none;
600
611
  width: 100%;
601
612
  display: flex;
@@ -962,55 +973,55 @@ media-poster-image:not([src]):not([placeholdersrc]) {
962
973
  </media-pip-button>
963
974
  </template>
964
975
 
965
- <template partial="CaptionsMenuButton">
966
- <media-captions-selectmenu part="bottom captions selectmenu" disabled="{{disabled}}" aria-disabled="{{disabled}}">
967
- <media-captions-button
968
- slot="button"
969
- part="bottom captions button"
970
- disabled="{{disabled}}"
971
- aria-disabled="{{disabled}}"
972
- >
973
- <svg aria-hidden="true" viewBox="0 0 18 14" slot="on">
974
- <path
975
- d="M15.989 0H2.011C0.9004 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9004 14 2.011 14H15.989C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.989 0ZM4.2292 8.7639C4.5954 9.1902 5.0935 9.4031 5.7233 9.4031C6.1852 9.4031 6.5544 9.301 6.8302 9.0969C7.1061 8.8933 7.2863 8.614 7.3702 8.26H8.4322C8.3062 8.884 8.0093 9.3733 7.5411 9.7273C7.0733 10.0813 6.4703 10.2581 5.732 10.2581C5.108 10.2581 4.5699 10.1219 4.1168 9.8489C3.6637 9.5759 3.3141 9.1946 3.0685 8.7058C2.8224 8.2165 2.6994 7.6511 2.6994 7.009C2.6994 6.3611 2.8224 5.7927 3.0685 5.3034C3.3141 4.8146 3.6637 4.4323 4.1168 4.1559C4.5699 3.88 5.108 3.7418 5.732 3.7418C6.4703 3.7418 7.0733 3.922 7.5411 4.2818C8.0094 4.6422 8.3062 5.1461 8.4322 5.794H7.3702C7.2862 5.4283 7.106 5.1368 6.8302 4.921C6.5544 4.7052 6.1852 4.5968 5.7233 4.5968C5.0934 4.5968 4.5954 4.8116 4.2292 5.2404C3.8635 5.6696 3.6804 6.259 3.6804 7.009C3.6804 7.7531 3.8635 8.3381 4.2292 8.7639ZM11.0974 8.7639C11.4636 9.1902 11.9617 9.4031 12.5915 9.4031C13.0534 9.4031 13.4226 9.301 13.6984 9.0969C13.9743 8.8933 14.1545 8.614 14.2384 8.26H15.3004C15.1744 8.884 14.8775 9.3733 14.4093 9.7273C13.9415 10.0813 13.3385 10.2581 12.6002 10.2581C11.9762 10.2581 11.4381 10.1219 10.985 9.8489C10.5319 9.5759 10.1823 9.1946 9.9367 8.7058C9.6906 8.2165 9.5676 7.6511 9.5676 7.009C9.5676 6.3611 9.6906 5.7927 9.9367 5.3034C10.1823 4.8146 10.5319 4.4323 10.985 4.1559C11.4381 3.88 11.9762 3.7418 12.6002 3.7418C13.3385 3.7418 13.9415 3.922 14.4093 4.2818C14.8776 4.6422 15.1744 5.1461 15.3004 5.794H14.2384C14.1544 5.4283 13.9742 5.1368 13.6984 4.921C13.4226 4.7052 13.0534 4.5968 12.5915 4.5968C11.9616 4.5968 11.4636 4.8116 11.0974 5.2404C10.7317 5.6696 10.5486 6.259 10.5486 7.009C10.5486 7.7531 10.7317 8.3381 11.0974 8.7639Z"
976
- />
977
- </svg>
978
- <svg aria-hidden="true" viewBox="0 0 18 14" slot="off">
979
- <path
980
- d="M5.73219 10.258C5.10819 10.258 4.57009 10.1218 4.11699 9.8488C3.66389 9.5758 3.31429 9.1945 3.06869 8.7057C2.82259 8.2164 2.69958 7.651 2.69958 7.0089C2.69958 6.361 2.82259 5.7926 3.06869 5.3033C3.31429 4.8145 3.66389 4.4322 4.11699 4.1558C4.57009 3.8799 5.10819 3.7417 5.73219 3.7417C6.47049 3.7417 7.07348 3.9219 7.54128 4.2817C8.00958 4.6421 8.30638 5.146 8.43238 5.7939H7.37039C7.28639 5.4282 7.10618 5.1367 6.83039 4.9209C6.55459 4.7051 6.18538 4.5967 5.72348 4.5967C5.09358 4.5967 4.59559 4.8115 4.22939 5.2403C3.86369 5.6695 3.68058 6.2589 3.68058 7.0089C3.68058 7.753 3.86369 8.338 4.22939 8.7638C4.59559 9.1901 5.09368 9.403 5.72348 9.403C6.18538 9.403 6.55459 9.3009 6.83039 9.0968C7.10629 8.8932 7.28649 8.6139 7.37039 8.2599H8.43238C8.30638 8.8839 8.00948 9.3732 7.54128 9.7272C7.07348 10.0812 6.47049 10.258 5.73219 10.258Z"
981
- />
982
- <path
983
- d="M12.6003 10.258C11.9763 10.258 11.4382 10.1218 10.9851 9.8488C10.532 9.5758 10.1824 9.1945 9.93685 8.7057C9.69075 8.2164 9.56775 7.651 9.56775 7.0089C9.56775 6.361 9.69075 5.7926 9.93685 5.3033C10.1824 4.8145 10.532 4.4322 10.9851 4.1558C11.4382 3.8799 11.9763 3.7417 12.6003 3.7417C13.3386 3.7417 13.9416 3.9219 14.4094 4.2817C14.8777 4.6421 15.1745 5.146 15.3005 5.7939H14.2385C14.1545 5.4282 13.9743 5.1367 13.6985 4.9209C13.4227 4.7051 13.0535 4.5967 12.5916 4.5967C11.9617 4.5967 11.4637 4.8115 11.0975 5.2403C10.7318 5.6695 10.5487 6.2589 10.5487 7.0089C10.5487 7.753 10.7318 8.338 11.0975 8.7638C11.4637 9.1901 11.9618 9.403 12.5916 9.403C13.0535 9.403 13.4227 9.3009 13.6985 9.0968C13.9744 8.8932 14.1546 8.6139 14.2385 8.2599H15.3005C15.1745 8.8839 14.8776 9.3732 14.4094 9.7272C13.9416 10.0812 13.3386 10.258 12.6003 10.258Z"
984
- />
976
+ <template partial="CaptionsMenu">
977
+ <media-captions-menu-button part="bottom captions button">
978
+ <svg aria-hidden="true" viewBox="0 0 18 14" slot="on">
979
+ <path
980
+ d="M15.989 0H2.011C0.9004 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9004 14 2.011 14H15.989C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.989 0ZM4.2292 8.7639C4.5954 9.1902 5.0935 9.4031 5.7233 9.4031C6.1852 9.4031 6.5544 9.301 6.8302 9.0969C7.1061 8.8933 7.2863 8.614 7.3702 8.26H8.4322C8.3062 8.884 8.0093 9.3733 7.5411 9.7273C7.0733 10.0813 6.4703 10.2581 5.732 10.2581C5.108 10.2581 4.5699 10.1219 4.1168 9.8489C3.6637 9.5759 3.3141 9.1946 3.0685 8.7058C2.8224 8.2165 2.6994 7.6511 2.6994 7.009C2.6994 6.3611 2.8224 5.7927 3.0685 5.3034C3.3141 4.8146 3.6637 4.4323 4.1168 4.1559C4.5699 3.88 5.108 3.7418 5.732 3.7418C6.4703 3.7418 7.0733 3.922 7.5411 4.2818C8.0094 4.6422 8.3062 5.1461 8.4322 5.794H7.3702C7.2862 5.4283 7.106 5.1368 6.8302 4.921C6.5544 4.7052 6.1852 4.5968 5.7233 4.5968C5.0934 4.5968 4.5954 4.8116 4.2292 5.2404C3.8635 5.6696 3.6804 6.259 3.6804 7.009C3.6804 7.7531 3.8635 8.3381 4.2292 8.7639ZM11.0974 8.7639C11.4636 9.1902 11.9617 9.4031 12.5915 9.4031C13.0534 9.4031 13.4226 9.301 13.6984 9.0969C13.9743 8.8933 14.1545 8.614 14.2384 8.26H15.3004C15.1744 8.884 14.8775 9.3733 14.4093 9.7273C13.9415 10.0813 13.3385 10.2581 12.6002 10.2581C11.9762 10.2581 11.4381 10.1219 10.985 9.8489C10.5319 9.5759 10.1823 9.1946 9.9367 8.7058C9.6906 8.2165 9.5676 7.6511 9.5676 7.009C9.5676 6.3611 9.6906 5.7927 9.9367 5.3034C10.1823 4.8146 10.5319 4.4323 10.985 4.1559C11.4381 3.88 11.9762 3.7418 12.6002 3.7418C13.3385 3.7418 13.9415 3.922 14.4093 4.2818C14.8776 4.6422 15.1744 5.1461 15.3004 5.794H14.2384C14.1544 5.4283 13.9742 5.1368 13.6984 4.921C13.4226 4.7052 13.0534 4.5968 12.5915 4.5968C11.9616 4.5968 11.4636 4.8116 11.0974 5.2404C10.7317 5.6696 10.5486 6.259 10.5486 7.009C10.5486 7.7531 10.7317 8.3381 11.0974 8.7639Z"
981
+ />
982
+ </svg>
983
+ <svg aria-hidden="true" viewBox="0 0 18 14" slot="off">
984
+ <path
985
+ d="M5.73219 10.258C5.10819 10.258 4.57009 10.1218 4.11699 9.8488C3.66389 9.5758 3.31429 9.1945 3.06869 8.7057C2.82259 8.2164 2.69958 7.651 2.69958 7.0089C2.69958 6.361 2.82259 5.7926 3.06869 5.3033C3.31429 4.8145 3.66389 4.4322 4.11699 4.1558C4.57009 3.8799 5.10819 3.7417 5.73219 3.7417C6.47049 3.7417 7.07348 3.9219 7.54128 4.2817C8.00958 4.6421 8.30638 5.146 8.43238 5.7939H7.37039C7.28639 5.4282 7.10618 5.1367 6.83039 4.9209C6.55459 4.7051 6.18538 4.5967 5.72348 4.5967C5.09358 4.5967 4.59559 4.8115 4.22939 5.2403C3.86369 5.6695 3.68058 6.2589 3.68058 7.0089C3.68058 7.753 3.86369 8.338 4.22939 8.7638C4.59559 9.1901 5.09368 9.403 5.72348 9.403C6.18538 9.403 6.55459 9.3009 6.83039 9.0968C7.10629 8.8932 7.28649 8.6139 7.37039 8.2599H8.43238C8.30638 8.8839 8.00948 9.3732 7.54128 9.7272C7.07348 10.0812 6.47049 10.258 5.73219 10.258Z"
986
+ />
987
+ <path
988
+ d="M12.6003 10.258C11.9763 10.258 11.4382 10.1218 10.9851 9.8488C10.532 9.5758 10.1824 9.1945 9.93685 8.7057C9.69075 8.2164 9.56775 7.651 9.56775 7.0089C9.56775 6.361 9.69075 5.7926 9.93685 5.3033C10.1824 4.8145 10.532 4.4322 10.9851 4.1558C11.4382 3.8799 11.9763 3.7417 12.6003 3.7417C13.3386 3.7417 13.9416 3.9219 14.4094 4.2817C14.8777 4.6421 15.1745 5.146 15.3005 5.7939H14.2385C14.1545 5.4282 13.9743 5.1367 13.6985 4.9209C13.4227 4.7051 13.0535 4.5967 12.5916 4.5967C11.9617 4.5967 11.4637 4.8115 11.0975 5.2403C10.7318 5.6695 10.5487 6.2589 10.5487 7.0089C10.5487 7.753 10.7318 8.338 11.0975 8.7638C11.4637 9.1901 11.9618 9.403 12.5916 9.403C13.0535 9.403 13.4227 9.3009 13.6985 9.0968C13.9744 8.8932 14.1546 8.6139 14.2385 8.2599H15.3005C15.1745 8.8839 14.8776 9.3732 14.4094 9.7272C13.9416 10.0812 13.3386 10.258 12.6003 10.258Z"
989
+ />
990
+ <path
991
+ d="M15.9891 1C16.5465 1 17 1.4535 17 2.011V11.9891C17 12.5465 16.5465 13 15.9891 13H2.0109C1.4535 13 1 12.5465 1 11.9891V2.0109C1 1.4535 1.4535 0.9999 2.0109 0.9999L15.9891 1ZM15.9891 0H2.0109C0.9003 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9003 14 2.0109 14H15.9891C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.9891 0Z"
992
+ />
993
+ </svg>
994
+ </media-captions-menu-button>
995
+ <media-captions-menu
996
+ hidden
997
+ anchor="auto"
998
+ part="bottom captions menu"
999
+ disabled="{{disabled}}"
1000
+ aria-disabled="{{disabled}}"
1001
+ exportparts="menu-item"
1002
+ >
1003
+ <div slot="checked-indicator">
1004
+ <style>
1005
+ .indicator {
1006
+ position: relative;
1007
+ top: 1px;
1008
+ width: 0.9em;
1009
+ height: auto;
1010
+ fill: var(--_accent-color);
1011
+ margin-right: 5px;
1012
+ }
1013
+
1014
+ [aria-checked='false'] .indicator {
1015
+ display: none;
1016
+ }
1017
+ </style>
1018
+ <svg viewBox="0 0 14 18" class="indicator">
985
1019
  <path
986
- d="M15.9891 1C16.5465 1 17 1.4535 17 2.011V11.9891C17 12.5465 16.5465 13 15.9891 13H2.0109C1.4535 13 1 12.5465 1 11.9891V2.0109C1 1.4535 1.4535 0.9999 2.0109 0.9999L15.9891 1ZM15.9891 0H2.0109C0.9003 0 0 0.9003 0 2.0109V11.9891C0 13.0997 0.9003 14 2.0109 14H15.9891C17.0997 14 18 13.0997 18 11.9891V2.0109C18 0.9003 17.0997 0 15.9891 0Z"
1020
+ d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
1021
+ fill-rule="evenodd"
987
1022
  />
988
- </svg>
989
- </media-captions-button>
990
- <media-captions-listbox slot="listbox" exportparts="option" part="bottom captions listbox">
991
- <div slot="select-indicator">
992
- <style>
993
- .listbox-indicator {
994
- position: relative;
995
- top: 1px;
996
- width: 0.9em;
997
- height: auto;
998
- fill: var(--_accent-color);
999
- }
1000
-
1001
- [aria-selected='false'] .listbox-indicator {
1002
- display: none;
1003
- }
1004
- </style>
1005
- <svg viewBox="0 0 14 18" class="listbox-indicator">
1006
- <path
1007
- d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
1008
- fill-rule="evenodd"
1009
- />
1010
- </svg>
1011
- </div>
1012
- </media-captions-listbox>
1013
- </media-captions-selectmenu>
1023
+ </svg></div
1024
+ ></media-captions-menu>
1014
1025
  </template>
1015
1026
 
1016
1027
  <template partial="AirplayButton">
@@ -1081,20 +1092,17 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1081
1092
  </media-live-button>
1082
1093
  </template>
1083
1094
 
1084
- <template partial="PlaybackRateSelect">
1085
- <media-playback-rate-selectmenu
1086
- part="bottom playback-rate selectmenu"
1095
+ <template partial="PlaybackRateMenu">
1096
+ <media-playback-rate-menu-button part="bottom playback-rate button"></media-playback-rate-menu-button>
1097
+ <media-playback-rate-menu
1098
+ hidden
1099
+ anchor="auto"
1100
+ rates="{{playbackrates}}"
1101
+ exportparts="menu-item"
1102
+ part="bottom playback-rate menu"
1087
1103
  disabled="{{disabled}}"
1088
1104
  aria-disabled="{{disabled}}"
1089
- >
1090
- <media-playback-rate-button slot="button" part="bottom playback-rate button"></media-playback-rate-button>
1091
- <media-playback-rate-listbox
1092
- slot="listbox"
1093
- rates="{{playbackrates}}"
1094
- exportparts="option"
1095
- part="bottom playback-rate listbox"
1096
- ></media-playback-rate-listbox>
1097
- </media-playback-rate-selectmenu>
1105
+ ></media-playback-rate-menu>
1098
1106
  </template>
1099
1107
 
1100
1108
  <template partial="VolumeRange">
@@ -1124,79 +1132,86 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1124
1132
  </media-time-range>
1125
1133
  </template>
1126
1134
 
1127
- <template partial="AudioTrackSelect">
1128
- <media-audio-track-selectmenu
1129
- part="bottom audio-track selectmenu"
1135
+ <template partial="AudioTrackMenu">
1136
+ <media-audio-track-menu-button part="bottom audio-track button">
1137
+ <svg aria-hidden="true" slot="icon" viewBox="0 0 18 16">
1138
+ <path d="M9 15A7 7 0 1 1 9 1a7 7 0 0 1 0 14Zm0 1A8 8 0 1 0 9 0a8 8 0 0 0 0 16Z" />
1139
+ <path
1140
+ d="M5.2 6.3a.5.5 0 0 1 .5.5v2.4a.5.5 0 1 1-1 0V6.8a.5.5 0 0 1 .5-.5Zm2.4-2.4a.5.5 0 0 1 .5.5v7.2a.5.5 0 0 1-1 0V4.4a.5.5 0 0 1 .5-.5ZM10 5.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.4-.8a.5.5 0 0 1 .5.5v5.6a.5.5 0 0 1-1 0V5.2a.5.5 0 0 1 .5-.5Z"
1141
+ />
1142
+ </svg>
1143
+ </media-audio-track-menu-button>
1144
+ <media-audio-track-menu
1145
+ hidden
1146
+ anchor="auto"
1147
+ part="bottom audio-track menu"
1130
1148
  disabled="{{disabled}}"
1131
1149
  aria-disabled="{{disabled}}"
1150
+ exportparts="menu-item"
1132
1151
  >
1133
- <media-audio-track-button slot="button" part="bottom audio-track button">
1134
- <svg aria-hidden="true" slot="icon" viewBox="0 0 18 16">
1135
- <path d="M9 15A7 7 0 1 1 9 1a7 7 0 0 1 0 14Zm0 1A8 8 0 1 0 9 0a8 8 0 0 0 0 16Z" />
1152
+ <div slot="checked-indicator">
1153
+ <style>
1154
+ .indicator {
1155
+ position: relative;
1156
+ top: 1px;
1157
+ width: 0.9em;
1158
+ height: auto;
1159
+ fill: var(--_accent-color);
1160
+ margin-right: 5px;
1161
+ }
1162
+
1163
+ [aria-checked='false'] .indicator {
1164
+ display: none;
1165
+ }
1166
+ </style>
1167
+ <svg viewBox="0 0 14 18" class="indicator">
1136
1168
  <path
1137
- d="M5.2 6.3a.5.5 0 0 1 .5.5v2.4a.5.5 0 1 1-1 0V6.8a.5.5 0 0 1 .5-.5Zm2.4-2.4a.5.5 0 0 1 .5.5v7.2a.5.5 0 0 1-1 0V4.4a.5.5 0 0 1 .5-.5ZM10 5.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5Zm2.4-.8a.5.5 0 0 1 .5.5v5.6a.5.5 0 0 1-1 0V5.2a.5.5 0 0 1 .5-.5Z"
1169
+ d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
1170
+ fill-rule="evenodd"
1138
1171
  />
1139
1172
  </svg>
1140
- </media-audio-track-button>
1141
- <media-audio-track-listbox slot="listbox" exportparts="option" part="bottom audio-track listbox">
1142
- <div slot="select-indicator">
1143
- <style>
1144
- .listbox-indicator {
1145
- position: relative;
1146
- top: 1px;
1147
- width: 0.9em;
1148
- height: auto;
1149
- fill: var(--_accent-color);
1150
- }
1151
-
1152
- [aria-selected='false'] .listbox-indicator {
1153
- display: none;
1154
- }
1155
- </style>
1156
- <svg viewBox="0 0 14 18" class="listbox-indicator">
1157
- <path
1158
- d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
1159
- fill-rule="evenodd"
1160
- />
1161
- </svg>
1162
- </div>
1163
- </media-audio-track-listbox>
1164
- </media-audio-track-selectmenu>
1173
+ </div>
1174
+ </media-audio-track-menu>
1165
1175
  </template>
1166
1176
 
1167
- <template partial="RenditionSelect">
1168
- <media-rendition-selectmenu part="bottom rendition selectmenu" disabled="{{disabled}}" aria-disabled="{{disabled}}">
1169
- <media-rendition-button slot="button" part="bottom rendition button">
1170
- <svg aria-hidden="true" slot="icon" viewBox="0 0 18 14">
1177
+ <template partial="RenditionMenu">
1178
+ <media-rendition-menu-button part="bottom rendition button">
1179
+ <svg aria-hidden="true" slot="icon" viewBox="0 0 18 14">
1180
+ <path
1181
+ d="M2.25 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm6.75 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"
1182
+ />
1183
+ </svg>
1184
+ </media-rendition-menu-button>
1185
+ <media-rendition-menu
1186
+ hidden
1187
+ anchor="auto"
1188
+ part="bottom rendition menu"
1189
+ disabled="{{disabled}}"
1190
+ aria-disabled="{{disabled}}"
1191
+ >
1192
+ <div slot="checked-indicator">
1193
+ <style>
1194
+ .indicator {
1195
+ position: relative;
1196
+ top: 1px;
1197
+ width: 0.9em;
1198
+ height: auto;
1199
+ fill: var(--_accent-color);
1200
+ margin-right: 5px;
1201
+ }
1202
+
1203
+ [aria-checked='false'] .indicator {
1204
+ display: none;
1205
+ }
1206
+ </style>
1207
+ <svg viewBox="0 0 14 18" class="indicator">
1171
1208
  <path
1172
- d="M2.25 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM9 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm6.75 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"
1209
+ d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
1210
+ fill-rule="evenodd"
1173
1211
  />
1174
1212
  </svg>
1175
- </media-rendition-button>
1176
- <media-rendition-listbox slot="listbox" exportparts="option" part="bottom rendition listbox">
1177
- <div slot="select-indicator">
1178
- <style>
1179
- .listbox-indicator {
1180
- position: relative;
1181
- top: 1px;
1182
- width: 0.9em;
1183
- height: auto;
1184
- fill: var(--_accent-color);
1185
- }
1186
-
1187
- [aria-selected='false'] .listbox-indicator {
1188
- display: none;
1189
- }
1190
- </style>
1191
- <svg viewBox="0 0 14 18" class="listbox-indicator">
1192
- <path
1193
- d="M12.252 3.48c-.115.033-.301.161-.425.291-.059.063-1.407 1.815-2.995 3.894s-2.897 3.79-2.908 3.802c-.013.014-.661-.616-1.672-1.624-.908-.905-1.702-1.681-1.765-1.723-.401-.27-.783-.211-1.176.183a1.285 1.285 0 0 0-.261.342.582.582 0 0 0-.082.35c0 .165.01.205.08.35.075.153.213.296 2.182 2.271 1.156 1.159 2.17 2.159 2.253 2.222.189.143.338.196.539.194.203-.003.412-.104.618-.299.205-.193 6.7-8.693 6.804-8.903a.716.716 0 0 0 .085-.345c.01-.179.005-.203-.062-.339-.124-.252-.45-.531-.746-.639a.784.784 0 0 0-.469-.027"
1194
- fill-rule="evenodd"
1195
- />
1196
- </svg>
1197
- </div>
1198
- </media-rendition-listbox>
1199
- </media-rendition-selectmenu>
1213
+ </div>
1214
+ </media-rendition-menu>
1200
1215
  </template>
1201
1216
 
1202
1217
  <media-controller
@@ -1223,27 +1238,13 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1223
1238
 
1224
1239
  <template if="!audio">
1225
1240
  <!-- Pre-playback UI -->
1241
+ <!-- same for both on-demand and live -->
1226
1242
  <div slot="centered-chrome" class="center-controls pre-playback">
1227
- <template if="streamtype == 'on-demand'">
1228
- <template if="!breakpointsm"> {{>SeekBackwardButton section="center"}} </template>
1229
- <template if="!breakpointsm"> {{>PlayButton section="center"}} </template>
1230
- <template if="breakpointsm"> {{>PrePlayButton section="center"}} </template>
1231
- <template if="!breakpointsm"> {{>SeekForwardButton section="center"}} </template>
1232
- </template>
1233
-
1234
- <template if="streamtype == 'live'">
1235
- <template if="!breakpointsm">
1236
- <template if="targetlivewindow > 0"> {{>SeekBackwardButton section="center"}} </template>
1237
- </template>
1238
- <template if="!breakpointsm"> {{>PlayButton section="center"}} </template>
1239
- <template if="breakpointsm"> {{>PrePlayButton section="center"}} </template>
1240
- <template if="!breakpointsm">
1241
- <template if="targetlivewindow > 0"> {{>SeekForwardButton section="center"}} </template>
1242
- </template>
1243
- </template>
1243
+ <template if="!breakpointsm">{{>PlayButton section="center"}}</template>
1244
+ <template if="breakpointsm">{{>PrePlayButton section="center"}}</template>
1244
1245
  </div>
1245
1246
 
1246
- <!-- Auotplay centered unmute button -->
1247
+ <!-- Autoplay centered unmute button -->
1247
1248
  <!--
1248
1249
  todo: figure out how show this with available state variables
1249
1250
  needs to show when:
@@ -1271,7 +1272,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1271
1272
  {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>MuteButton}}
1272
1273
  {{>VolumeRange}}
1273
1274
  <div class="spacer"></div>
1274
- {{>RenditionSelect}} {{>PlaybackRateSelect}} {{>AudioTrackSelect}} {{>CaptionsMenuButton}} {{>AirplayButton}}
1275
+ {{>RenditionMenu}} {{>PlaybackRateMenu}} {{>AudioTrackMenu}} {{>CaptionsMenu}} {{>AirplayButton}}
1275
1276
  {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
1276
1277
  </media-control-bar>
1277
1278
  </template>
@@ -1287,8 +1288,8 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1287
1288
  <template if="targetlivewindow > 0">{{>SeekBackwardButton}} {{>SeekForwardButton}}</template>
1288
1289
  {{>MuteButton}} {{>VolumeRange}}
1289
1290
  <div class="spacer"></div>
1290
- {{>RenditionSelect}} {{>AudioTrackSelect}} {{>CaptionsMenuButton}} {{>AirplayButton}} {{>CastButton}}
1291
- {{>PipButton}} {{>FullscreenButton}}
1291
+ {{>RenditionMenu}} {{>AudioTrackMenu}} {{>CaptionsMenu}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}
1292
+ {{>FullscreenButton}}
1292
1293
  </media-control-bar>
1293
1294
  </template>
1294
1295
  </template>
@@ -1304,7 +1305,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1304
1305
  {{>MuteButton}}
1305
1306
  <template if="breakpointsm">{{>VolumeRange}}</template>
1306
1307
  {{>TimeDisplay}} {{>TimeRange}}
1307
- <template if="breakpointsm">{{>PlaybackRateSelect}}</template>
1308
+ <template if="breakpointsm">{{>PlaybackRateMenu}}</template>
1308
1309
  {{>AirplayButton}} {{>CastButton}}
1309
1310
  </media-control-bar>
1310
1311
  </template>
@@ -1314,8 +1315,9 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1314
1315
  <media-control-bar part="control-bar top">{{>TitleDisplay}}</media-control-bar>
1315
1316
  </template>
1316
1317
  <media-control-bar part="control-bar bottom">
1318
+ {{>PlayButton}} {{>LiveButton section="bottom"}} {{>MuteButton}}
1317
1319
  <template if="breakpointsm">
1318
- {{>PlayButton}} {{>LiveButton section="bottom"}} {{>MuteButton}} {{>VolumeRange}}
1320
+ {{>VolumeRange}}
1319
1321
  <template if="targetlivewindow > 0"> {{>SeekBackwardButton}} {{>SeekForwardButton}} </template>
1320
1322
  </template>
1321
1323
  <template if="targetlivewindow > 0"> {{>TimeDisplay}} {{>TimeRange}} </template>
@@ -1328,5 +1330,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1328
1330
  <slot></slot>
1329
1331
  </media-controller>
1330
1332
  </template>
1331
- `;import{MediaThemeElement as va}from"media-chrome/dist/media-theme-element.js";var He=T.createElement("template");"innerHTML"in He&&(He.innerHTML=Mt);var _t,Pt,fe=class extends va{};fe.template=(Pt=(_t=He.content)==null?void 0:_t.children)==null?void 0:Pt[0];c.customElements.get("media-theme-gerwig")||c.customElements.define("media-theme-gerwig",fe);var Ca="gerwig";var M={SRC:"src",POSTER:"poster"},n={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref"},Ue=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function xa(t,i){var a;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(n.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:La(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(n.NOHOTKEYS),hotKeys:t.getAttribute(n.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(d.TARGET_LIVE_WINDOW),streamType:Q(t.getAttribute(d.STREAM_TYPE)),primaryColor:t.getAttribute(n.PRIMARY_COLOR),secondaryColor:t.getAttribute(n.SECONDARY_COLOR),accentColor:t.getAttribute(n.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:Ra(t),playbackRates:t.getAttribute(n.PLAYBACK_RATES),customDomain:(a=t.getAttribute(d.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(n.TITLE),novolumepref:t.hasAttribute(n.NO_VOLUME_PREF),...i,extraSourceParams:t.extraSourceParams}}function La(t){var e,a;let i=t.theme;if(i){let r=(a=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:a.call(e,i);if(r&&r instanceof HTMLTemplateElement)return r;i.startsWith("media-theme-")||(i=`media-theme-${i}`);let o=c.customElements.get(i);if(o!=null&&o.template)return o.template}}function Ra(t){var e;let i=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return i&&getComputedStyle(i).getPropertyValue("--media-duration-display-display").trim()==="none"}function Dt(t){let i=t.hasAttribute(n.TITLE)?{video_title:t.getAttribute(n.TITLE)}:{};return t.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,a)=>{let r=t.getAttribute(a);return r!==null&&(e[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),e},i)}var wa=Object.values(d),Oa=Object.values(M),Sa=Object.values(n),Ma=ue(),_a="mux-player",Vt={dialog:void 0,isDialogOpen:!1},Pa={redundant_streams:!0},re,oe,H,ne,Z,O,V,Ee,Ht,se,Ke,_,W,ke,Bt,Te,Ut,Ae,Kt,Ce,$t,ie=class extends Ne{constructor(){super();p(this,O);p(this,Ee);p(this,se);p(this,_);p(this,ke);p(this,Te);p(this,Ae);p(this,Ce);p(this,re,!1);p(this,oe,{});p(this,H,!0);p(this,ne,new me(this,"hotkeys"));p(this,Z,{...Vt,onCloseErrorDialog:()=>b(this,se,Ke).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Se(this,T.activeElement)||e.preventDefault()}});this.attachShadow({mode:"open"}),b(this,Ee,Ht).call(this),this.isConnected&&b(this,O,V).call(this)}static get observedAttributes(){var e;return[...(e=Ne.observedAttributes)!=null?e:[],...Oa,...wa,...Sa]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,a;return(a=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let e=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");e&&(e.metadata=Dt(this))}attributeChangedCallback(e,a,r){switch(b(this,O,V).call(this),super.attributeChangedCallback(e,a,r),e){case n.HOTKEYS:u(this,ne).value=r;break;case n.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&I(m("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case n.THUMBNAIL_TOKEN:{let{aud:s}=N(r);r&&s!=="t"&&I(m("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case n.STORYBOARD_TOKEN:{let{aud:s}=N(r);r&&s!=="s"&&I(m("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case d.PLAYBACK_ID:{r!=null&&r.includes("?token")&&A(m("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case d.STREAM_TYPE:r&&![w.LIVE,w.ON_DEMAND,w.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:_e({file:"invalid-stream-type.md",message:m("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===w.LIVE?this.getAttribute(n.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[d.PLAYBACK_ID,M.SRC,n.PLAYBACK_TOKEN].includes(e)&&a!==r&&x(this,Z,{...u(this,Z),...Vt}),b(this,_,W).call(this,{[ht(e)]:r})}get preferCmcd(){var e;return(e=this.getAttribute(d.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?It.includes(e)?this.setAttribute(d.PREFER_CMCD,e):I(`Invalid value for preferCmcd. Must be one of ${It.join()}`):this.removeAttribute(d.PREFER_CMCD))}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute(Nt.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute(Nt.MEDIA_TIME_IS_LIVE)}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(n.THEME))!=null?e:Ca}set theme(e){this.setAttribute(n.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let a={};for(let r of e.getAttributeNames()){if(Ue.includes(r))continue;let o=e.getAttribute(r);a[le(r)]=o===""?!0:o}return a}set themeProps(e){var r,o;b(this,O,V).call(this);let a={...this.themeProps,...e};for(let s in a){if(Ue.includes(s))continue;let l=e==null?void 0:e[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(de(s),!!l):(o=this.mediaTheme)==null||o.setAttribute(de(s),l)}}get playbackId(){var e;return(e=this.getAttribute(d.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(d.PLAYBACK_ID,e):this.removeAttribute(d.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=Y(this,M.SRC))!=null?e:void 0:(a=this.getAttribute(M.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(M.SRC,e):this.removeAttribute(M.SRC)}get poster(){var a;let e=this.getAttribute(M.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return pt(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,programTime:this.programStartTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(M.POSTER,e):this.removeAttribute(M.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(n.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(n.STORYBOARD_SRC,e):this.removeAttribute(n.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[w.LIVE,w.UNKNOWN].includes(this.streamType)))return bt(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(n.AUDIO)}set audio(e){if(!e){this.removeAttribute(n.AUDIO);return}this.setAttribute(n.AUDIO,"")}get hotkeys(){return u(this,ne)}get nohotkeys(){return this.hasAttribute(n.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(n.NOHOTKEYS);return}this.setAttribute(n.NOHOTKEYS,"")}get thumbnailTime(){return L(this.getAttribute(n.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(n.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(n.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(n.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=Y(this,n.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(n.PLACEHOLDER,`${e}`)}get primaryColor(){var a,r;let e=this.getAttribute(n.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=c.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),e))return e}set primaryColor(e){this.setAttribute(n.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var a,r;let e=this.getAttribute(n.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=c.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),e))return e}set secondaryColor(e){this.setAttribute(n.SECONDARY_COLOR,`${e}`)}get accentColor(){var a,r;let e=this.getAttribute(n.ACCENT_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=c.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),e))return e}set accentColor(e){this.setAttribute(n.ACCENT_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(n.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(n.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(n.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(n.PLAYBACK_RATES))return this.getAttribute(n.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(n.PLAYBACK_RATES);return}this.setAttribute(n.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=L(this.getAttribute(n.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(n.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=L(this.getAttribute(n.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(n.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(n.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(n.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(n.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return L(this.getAttribute(n.DEFAULT_DURATION))}set defaultDuration(e){e==null?this.removeAttribute(n.DEFAULT_DURATION):this.setAttribute(n.DEFAULT_DURATION,`${e}`)}get playerSoftwareName(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_NAME))!=null?e:_a}get playerSoftwareVersion(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_VERSION))!=null?e:Ma}get beaconCollectionDomain(){var e;return(e=this.getAttribute(d.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(d.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(d.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(d.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(d.MAX_RESOLUTION,e):this.removeAttribute(d.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(d.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(d.MIN_RESOLUTION,e):this.removeAttribute(d.MIN_RESOLUTION))}get renditionOrder(){var e;return(e=this.getAttribute(d.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(d.RENDITION_ORDER,e):this.removeAttribute(d.RENDITION_ORDER))}get programStartTime(){return L(this.getAttribute(d.PROGRAM_START_TIME))}set programStartTime(e){e==null?this.removeAttribute(d.PROGRAM_START_TIME):this.setAttribute(d.PROGRAM_START_TIME,`${e}`)}get programEndTime(){return L(this.getAttribute(d.PROGRAM_END_TIME))}set programEndTime(e){e==null?this.removeAttribute(d.PROGRAM_END_TIME):this.setAttribute(d.PROGRAM_END_TIME,`${e}`)}get extraSourceParams(){return this.hasAttribute(n.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(n.EXTRA_SOURCE_PARAMS)).entries()].reduce((e,[a,r])=>(e[a]=r,e),{}):Pa}set extraSourceParams(e){e==null?this.removeAttribute(n.EXTRA_SOURCE_PARAMS):this.setAttribute(n.EXTRA_SOURCE_PARAMS,new URLSearchParams(e).toString())}get customDomain(){var e;return(e=this.getAttribute(d.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(d.CUSTOM_DOMAIN,e):this.removeAttribute(d.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Y(this,d.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(d.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(n.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(n.NO_VOLUME_PREF,""):this.removeAttribute(n.NO_VOLUME_PREF)}get debug(){return Y(this,d.DEBUG)!=null}set debug(e){e?this.setAttribute(d.DEBUG,""):this.removeAttribute(d.DEBUG)}get disableTracking(){return Y(this,d.DISABLE_TRACKING)!=null}set disableTracking(e){this.toggleAttribute(d.DISABLE_TRACKING,!!e)}get disableCookies(){return Y(this,d.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(d.DISABLE_COOKIES,""):this.removeAttribute(d.DISABLE_COOKIES)}get streamType(){var e,a,r;return(r=(a=this.getAttribute(d.STREAM_TYPE))!=null?a:(e=this.media)==null?void 0:e.streamType)!=null?r:w.UNKNOWN}set streamType(e){this.setAttribute(d.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,a,r;return(r=(a=this.getAttribute(n.DEFAULT_STREAM_TYPE))!=null?a:(e=this.mediaController)==null?void 0:e.getAttribute(n.DEFAULT_STREAM_TYPE))!=null?r:w.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(n.DEFAULT_STREAM_TYPE,e):this.removeAttribute(n.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,a;return this.hasAttribute(n.TARGET_LIVE_WINDOW)?+this.getAttribute(n.TARGET_LIVE_WINDOW):(a=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(e){e==this.targetLiveWindow||Number.isNaN(e)&&Number.isNaN(this.targetLiveWindow)||(e==null?this.removeAttribute(n.TARGET_LIVE_WINDOW):this.setAttribute(n.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return L(Y(this,d.START_TIME))}set startTime(e){this.setAttribute(d.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(d.PREFER_PLAYBACK);if(e===ve.MSE||e===ve.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===ve.MSE||e===ve.NATIVE?this.setAttribute(d.PREFER_PLAYBACK,e):this.removeAttribute(d.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(b(this,O,V).call(this),!this.media){A("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Dt(this),...e}}get _hlsConfig(){var e;return(e=this.media)==null?void 0:e._hlsConfig}set _hlsConfig(e){if(b(this,O,V).call(this),!this.media){A("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=e}async addCuePoints(e){var a;if(b(this,O,V).call(this),!this.media){A("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,a;return(a=(e=this.media)==null?void 0:e.cuePoints)!=null?a:[]}addChapters(e){var a;if(b(this,O,V).call(this),!this.media){A("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(e)}get activeChapter(){var e;return(e=this.media)==null?void 0:e.activeChapter}get chapters(){var e,a;return(a=(e=this.media)==null?void 0:e.chapters)!=null?a:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(n.PLAYBACK_TOKEN),a=this.getAttribute(n.DRM_TOKEN),r=this.getAttribute(n.THUMBNAIL_TOKEN),o=this.getAttribute(n.STORYBOARD_TOKEN);return{...u(this,oe),...e!=null?{playback:e}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(e){x(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(n.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(n.PLAYBACK_TOKEN,`${e}`)}get drmToken(){var e;return(e=this.getAttribute(n.DRM_TOKEN))!=null?e:void 0}set drmToken(e){this.setAttribute(n.DRM_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(n.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(n.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(n.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(n.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,o){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return Ta(s,e,a,r,o)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return Aa(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};re=new WeakMap,oe=new WeakMap,H=new WeakMap,ne=new WeakMap,Z=new WeakMap,O=new WeakSet,V=function(){var e,a,r,o;if(!u(this,re)){x(this,re,!0),b(this,_,W).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof c.HTMLElement))throw""}catch{A("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof ka))throw""}catch{A("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Ea))throw""}catch{A("<media-controller> failed to upgrade!")}this.init(),b(this,ke,Bt).call(this),b(this,Te,Ut).call(this),b(this,Ae,Kt).call(this),x(this,H,(a=(e=this.mediaController)==null?void 0:e.hasAttribute(Be.USER_INACTIVE))!=null?a:!0),b(this,Ce,$t).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>b(this,_,W).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>b(this,_,W).call(this))}},Ee=new WeakSet,Ht=function(){var e,a;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},se=new WeakSet,Ke=function(e){Object.assign(u(this,Z),e),b(this,_,W).call(this)},_=new WeakSet,W=function(e={}){wt(St(xa(this,{...u(this,Z),...e})),this.shadowRoot)},ke=new WeakSet,Bt=function(){let e=r=>{var l,h;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(Ue.includes(o))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(o,s):(h=this.mediaTheme)==null||h.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)e(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},Te=new WeakSet,Ut=function(){var a;let e=r=>{let{detail:o}=r;if(o instanceof ye||(o=new ye(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){I(o),o.data&&I(`${o.name} data:`,o.data);return}let{dialog:s,devlog:l}=ge(o,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&_e(l),A(o),o.data&&A(`${o.name} data:`,o.data),b(this,se,Ke).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,h;if(!(((s=this.media)==null?void 0:s.error)instanceof ye))return r;let{devlog:o}=ge((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(h=this.media)==null?void 0:h.error.code,player_error_message:o.message?String(o.message):r.player_error_message,player_error_context:o.context?String(o.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:o}=r;if(!o){let{message:h,code:R}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};o=new ye(h,R)}o!=null&&o.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:o}))})},Ae=new WeakSet,Kt=function(){var a,r,o,s;let e=()=>b(this,_,W).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",e)},Ce=new WeakSet,$t=function(){var R,k;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===w.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(v,f,C=!1)=>{if(o())return;Array.from(v&&v.activeCues||[]).forEach(g=>{if(!(!g.snapToLines||g.line<-5||g.line>=0&&g.line<10))if(!f||this.paused){let B=g.text.split(`
1332
- `).length,q=-3;this.streamType===w.LIVE&&(q=-2);let z=q-B;if(g.line===z&&!C)return;r.has(g)||r.set(g,g.line),g.line=z}else setTimeout(()=>{g.line=r.get(g)||"auto"},500)})},l=()=>{var v,f;s(a,(f=(v=this.mediaController)==null?void 0:v.hasAttribute(Be.USER_INACTIVE))!=null?f:!1)},h=()=>{var C,P;let f=Array.from(((P=(C=this.mediaController)==null?void 0:C.media)==null?void 0:P.textTracks)||[]).filter(g=>["subtitles","captions"].includes(g.kind)&&g.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,a==null||a.addEventListener("cuechange",l),s(a,u(this,H))};h(),(R=this.textTracks)==null||R.addEventListener("change",h),(k=this.textTracks)==null||k.addEventListener("addtrack",h),this.addEventListener("userinactivechange",()=>{var f,C;let v=(C=(f=this.mediaController)==null?void 0:f.hasAttribute(Be.USER_INACTIVE))!=null?C:!0;u(this,H)!==v&&(x(this,H,v),s(a,u(this,H)))})};function Y(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}c.customElements.get("mux-player")||(c.customElements.define("mux-player",ie),c.MuxPlayerElement=ie);var Bi=ie;export{ye as MediaError,Bi as default,Y as getVideoAttribute};
1333
+ `;import{MediaThemeElement as va}from"media-chrome/dist/media-theme-element.js";import"media-chrome/menu";var He=A.createElement("template");"innerHTML"in He&&(He.innerHTML=_t);var St,Pt,fe=class extends va{};fe.template=(Pt=(St=He.content)==null?void 0:St.children)==null?void 0:Pt[0];c.customElements.get("media-theme-gerwig")||c.customElements.define("media-theme-gerwig",fe);var Ca="gerwig";var P={SRC:"src",POSTER:"poster"},n={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",DRM_TOKEN:"drm-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref",CAST_RECEIVER:"cast-receiver",NO_TOOLTIPS:"no-tooltips"},Ue=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function xa(t,i){var a;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src||!!t.currentSrc,poster:t.poster,storyboard:t.storyboard,storyboardSrc:t.getAttribute(n.STORYBOARD_SRC),placeholder:t.getAttribute("placeholder"),themeTemplate:Ra(t),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(n.NOHOTKEYS),hotKeys:t.getAttribute(n.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableTracking:t.disableTracking,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,maxResolution:t.maxResolution,minResolution:t.minResolution,programStartTime:t.programStartTime,programEndTime:t.programEndTime,renditionOrder:t.renditionOrder,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,defaultStreamType:t.defaultStreamType,targetLiveWindow:t.getAttribute(d.TARGET_LIVE_WINDOW),streamType:Q(t.getAttribute(d.STREAM_TYPE)),primaryColor:t.getAttribute(n.PRIMARY_COLOR),secondaryColor:t.getAttribute(n.SECONDARY_COLOR),accentColor:t.getAttribute(n.ACCENT_COLOR),forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultDuration:t.defaultDuration,defaultShowRemainingTime:t.defaultShowRemainingTime,hideDuration:La(t),playbackRates:t.getAttribute(n.PLAYBACK_RATES),customDomain:(a=t.getAttribute(d.CUSTOM_DOMAIN))!=null?a:void 0,title:t.getAttribute(n.TITLE),novolumepref:t.hasAttribute(n.NO_VOLUME_PREF),castReceiver:t.castReceiver,...i,extraSourceParams:t.extraSourceParams}}function Ra(t){var e,a;let i=t.theme;if(i){let r=(a=(e=t.getRootNode())==null?void 0:e.getElementById)==null?void 0:a.call(e,i);if(r&&r instanceof HTMLTemplateElement)return r;i.startsWith("media-theme-")||(i=`media-theme-${i}`);let o=c.customElements.get(i);if(o!=null&&o.template)return o.template}}function La(t){var e;let i=(e=t.mediaController)==null?void 0:e.querySelector("media-time-display");return i&&getComputedStyle(i).getPropertyValue("--media-duration-display-display").trim()==="none"}function Dt(t){let i=t.hasAttribute(n.TITLE)?{video_title:t.getAttribute(n.TITLE)}:{};return t.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,a)=>{let r=t.getAttribute(a);return r!==null&&(e[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),e},i)}var Oa=Object.values(d),wa=Object.values(P),Ma=Object.values(n),_a=ue(),Sa="mux-player",Vt={dialog:void 0,isDialogOpen:!1},Pa={redundant_streams:!0},re,oe,H,ne,Z,M,V,Ee,Ht,se,Ke,N,W,Te,Bt,ke,Ut,Ae,Kt,Ce,$t,ie=class extends Ne{constructor(){super();p(this,M);p(this,Ee);p(this,se);p(this,N);p(this,Te);p(this,ke);p(this,Ae);p(this,Ce);p(this,re,!1);p(this,oe,{});p(this,H,!0);p(this,ne,new me(this,"hotkeys"));p(this,Z,{...Vt,onCloseErrorDialog:()=>b(this,se,Ke).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{Me(this,A.activeElement)||e.preventDefault()}});this.attachShadow({mode:"open"}),b(this,Ee,Ht).call(this),this.isConnected&&b(this,M,V).call(this)}static get observedAttributes(){var e;return[...(e=Ne.observedAttributes)!=null?e:[],...wa,...Oa,...Ma]}get mediaTheme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,a;return(a=(e=this.mediaTheme)==null?void 0:e.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let e=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");e&&(e.metadata=Dt(this))}attributeChangedCallback(e,a,r){switch(b(this,M,V).call(this),super.attributeChangedCallback(e,a,r),e){case n.HOTKEYS:u(this,ne).value=r;break;case n.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&O(m("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case n.THUMBNAIL_TOKEN:{if(r){let{aud:s}=_(r);s!=="t"&&O(m("The provided thumbnail-token should have audience value 'd' instead of '{aud}'.").format({aud:s}))}break}case n.STORYBOARD_TOKEN:{if(r){let{aud:s}=_(r);s!=="s"&&O(m("The provided storyboard-token should have audience value 'd' instead of '{aud}'.").format({aud:s}))}break}case n.DRM_TOKEN:{if(r){let{aud:s}=_(r);s!=="d"&&O(m("The provided drm-token should have audience value 'd' instead of '{aud}'.").format({aud:s}))}break}case d.PLAYBACK_ID:{r!=null&&r.includes("?token")&&k(m("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case d.STREAM_TYPE:r&&![w.LIVE,w.ON_DEMAND,w.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Se({file:"invalid-stream-type.md",message:m("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===w.LIVE?this.getAttribute(n.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[d.PLAYBACK_ID,P.SRC,n.PLAYBACK_TOKEN].includes(e)&&a!==r&&x(this,Z,{...u(this,Z),...Vt}),b(this,N,W).call(this,{[ht(e)]:r})}get preferCmcd(){var e;return(e=this.getAttribute(d.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?It.includes(e)?this.setAttribute(d.PREFER_CMCD,e):O(`Invalid value for preferCmcd. Must be one of ${It.join()}`):this.removeAttribute(d.PREFER_CMCD))}get hasPlayed(){var e,a;return(a=(e=this.mediaController)==null?void 0:e.hasAttribute(Nt.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var e;return(e=this.mediaController)==null?void 0:e.hasAttribute(Nt.MEDIA_TIME_IS_LIVE)}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get theme(){var e;return(e=this.getAttribute(n.THEME))!=null?e:Ca}set theme(e){this.setAttribute(n.THEME,`${e}`)}get themeProps(){let e=this.mediaTheme;if(!e)return;let a={};for(let r of e.getAttributeNames()){if(Ue.includes(r))continue;let o=e.getAttribute(r);a[le(r)]=o===""?!0:o}return a}set themeProps(e){var r,o;b(this,M,V).call(this);let a={...this.themeProps,...e};for(let s in a){if(Ue.includes(s))continue;let l=e==null?void 0:e[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(de(s),!!l):(o=this.mediaTheme)==null||o.setAttribute(de(s),l)}}get playbackId(){var e;return(e=this.getAttribute(d.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(d.PLAYBACK_ID,e):this.removeAttribute(d.PLAYBACK_ID)}get src(){var e,a;return this.playbackId?(e=F(this,P.SRC))!=null?e:void 0:(a=this.getAttribute(P.SRC))!=null?a:void 0}set src(e){e?this.setAttribute(P.SRC,e):this.removeAttribute(P.SRC)}get poster(){var r;let e=this.getAttribute(P.POSTER);if(e!=null)return e;let{tokens:a}=this;if(a.playback&&!a.thumbnail){O("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return pt(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,programTime:this.programStartTime,token:a.thumbnail})}set poster(e){e||e===""?this.setAttribute(P.POSTER,e):this.removeAttribute(P.POSTER)}get storyboardSrc(){var e;return(e=this.getAttribute(n.STORYBOARD_SRC))!=null?e:void 0}set storyboardSrc(e){e?this.setAttribute(n.STORYBOARD_SRC,e):this.removeAttribute(n.STORYBOARD_SRC)}get storyboard(){let{tokens:e}=this;if(this.storyboardSrc&&!e.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[w.LIVE,w.UNKNOWN].includes(this.streamType)||e.playback&&!e.storyboard))return bt(this.playbackId,{customDomain:this.customDomain,token:e.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(n.AUDIO)}set audio(e){if(!e){this.removeAttribute(n.AUDIO);return}this.setAttribute(n.AUDIO,"")}get hotkeys(){return u(this,ne)}get nohotkeys(){return this.hasAttribute(n.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(n.NOHOTKEYS);return}this.setAttribute(n.NOHOTKEYS,"")}get thumbnailTime(){return R(this.getAttribute(n.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(n.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(n.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(n.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=F(this,n.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(n.PLACEHOLDER,`${e}`)}get primaryColor(){var a,r;let e=this.getAttribute(n.PRIMARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=c.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),e))return e}set primaryColor(e){this.setAttribute(n.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var a,r;let e=this.getAttribute(n.SECONDARY_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=c.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),e))return e}set secondaryColor(e){this.setAttribute(n.SECONDARY_COLOR,`${e}`)}get accentColor(){var a,r;let e=this.getAttribute(n.ACCENT_COLOR);if(e!=null||this.mediaTheme&&(e=(r=(a=c.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),e))return e}set accentColor(e){this.setAttribute(n.ACCENT_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(n.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?this.setAttribute(n.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(n.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(n.PLAYBACK_RATES))return this.getAttribute(n.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,a)=>e-a)}set playbackRates(e){if(!e){this.removeAttribute(n.PLAYBACK_RATES);return}this.setAttribute(n.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=R(this.getAttribute(n.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(n.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=R(this.getAttribute(n.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(n.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(n.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(n.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(n.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return R(this.getAttribute(n.DEFAULT_DURATION))}set defaultDuration(e){e==null?this.removeAttribute(n.DEFAULT_DURATION):this.setAttribute(n.DEFAULT_DURATION,`${e}`)}get playerSoftwareName(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_NAME))!=null?e:Sa}get playerSoftwareVersion(){var e;return(e=this.getAttribute(d.PLAYER_SOFTWARE_VERSION))!=null?e:_a}get beaconCollectionDomain(){var e;return(e=this.getAttribute(d.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(d.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(d.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var e;return(e=this.getAttribute(d.MAX_RESOLUTION))!=null?e:void 0}set maxResolution(e){e!==this.maxResolution&&(e?this.setAttribute(d.MAX_RESOLUTION,e):this.removeAttribute(d.MAX_RESOLUTION))}get minResolution(){var e;return(e=this.getAttribute(d.MIN_RESOLUTION))!=null?e:void 0}set minResolution(e){e!==this.minResolution&&(e?this.setAttribute(d.MIN_RESOLUTION,e):this.removeAttribute(d.MIN_RESOLUTION))}get renditionOrder(){var e;return(e=this.getAttribute(d.RENDITION_ORDER))!=null?e:void 0}set renditionOrder(e){e!==this.renditionOrder&&(e?this.setAttribute(d.RENDITION_ORDER,e):this.removeAttribute(d.RENDITION_ORDER))}get programStartTime(){return R(this.getAttribute(d.PROGRAM_START_TIME))}set programStartTime(e){e==null?this.removeAttribute(d.PROGRAM_START_TIME):this.setAttribute(d.PROGRAM_START_TIME,`${e}`)}get programEndTime(){return R(this.getAttribute(d.PROGRAM_END_TIME))}set programEndTime(e){e==null?this.removeAttribute(d.PROGRAM_END_TIME):this.setAttribute(d.PROGRAM_END_TIME,`${e}`)}get extraSourceParams(){return this.hasAttribute(n.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(n.EXTRA_SOURCE_PARAMS)).entries()].reduce((e,[a,r])=>(e[a]=r,e),{}):Pa}set extraSourceParams(e){e==null?this.removeAttribute(n.EXTRA_SOURCE_PARAMS):this.setAttribute(n.EXTRA_SOURCE_PARAMS,new URLSearchParams(e).toString())}get customDomain(){var e;return(e=this.getAttribute(d.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(d.CUSTOM_DOMAIN,e):this.removeAttribute(d.CUSTOM_DOMAIN))}get envKey(){var e;return(e=F(this,d.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(d.ENV_KEY,`${e}`)}get noVolumePref(){return this.hasAttribute(n.NO_VOLUME_PREF)}set noVolumePref(e){e?this.setAttribute(n.NO_VOLUME_PREF,""):this.removeAttribute(n.NO_VOLUME_PREF)}get debug(){return F(this,d.DEBUG)!=null}set debug(e){e?this.setAttribute(d.DEBUG,""):this.removeAttribute(d.DEBUG)}get disableTracking(){return F(this,d.DISABLE_TRACKING)!=null}set disableTracking(e){this.toggleAttribute(d.DISABLE_TRACKING,!!e)}get disableCookies(){return F(this,d.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(d.DISABLE_COOKIES,""):this.removeAttribute(d.DISABLE_COOKIES)}get streamType(){var e,a,r;return(r=(a=this.getAttribute(d.STREAM_TYPE))!=null?a:(e=this.media)==null?void 0:e.streamType)!=null?r:w.UNKNOWN}set streamType(e){this.setAttribute(d.STREAM_TYPE,`${e}`)}get defaultStreamType(){var e,a,r;return(r=(a=this.getAttribute(n.DEFAULT_STREAM_TYPE))!=null?a:(e=this.mediaController)==null?void 0:e.getAttribute(n.DEFAULT_STREAM_TYPE))!=null?r:w.ON_DEMAND}set defaultStreamType(e){e?this.setAttribute(n.DEFAULT_STREAM_TYPE,e):this.removeAttribute(n.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var e,a;return this.hasAttribute(n.TARGET_LIVE_WINDOW)?+this.getAttribute(n.TARGET_LIVE_WINDOW):(a=(e=this.media)==null?void 0:e.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(e){e==this.targetLiveWindow||Number.isNaN(e)&&Number.isNaN(this.targetLiveWindow)||(e==null?this.removeAttribute(n.TARGET_LIVE_WINDOW):this.setAttribute(n.TARGET_LIVE_WINDOW,`${+e}`))}get liveEdgeStart(){var e;return(e=this.media)==null?void 0:e.liveEdgeStart}get startTime(){return R(F(this,d.START_TIME))}set startTime(e){this.setAttribute(d.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(d.PREFER_PLAYBACK);if(e===ve.MSE||e===ve.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===ve.MSE||e===ve.NATIVE?this.setAttribute(d.PREFER_PLAYBACK,e):this.removeAttribute(d.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(b(this,M,V).call(this),!this.media){k("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Dt(this),...e}}get _hlsConfig(){var e;return(e=this.media)==null?void 0:e._hlsConfig}set _hlsConfig(e){if(b(this,M,V).call(this),!this.media){k("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=e}async addCuePoints(e){var a;if(b(this,M,V).call(this),!this.media){k("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(e)}get activeCuePoint(){var e;return(e=this.media)==null?void 0:e.activeCuePoint}get cuePoints(){var e,a;return(a=(e=this.media)==null?void 0:e.cuePoints)!=null?a:[]}addChapters(e){var a;if(b(this,M,V).call(this),!this.media){k("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(a=this.media)==null?void 0:a.addChapters(e)}get activeChapter(){var e;return(e=this.media)==null?void 0:e.activeChapter}get chapters(){var e,a;return(a=(e=this.media)==null?void 0:e.chapters)!=null?a:[]}getStartDate(){var e;return(e=this.media)==null?void 0:e.getStartDate()}get currentPdt(){var e;return(e=this.media)==null?void 0:e.currentPdt}get tokens(){let e=this.getAttribute(n.PLAYBACK_TOKEN),a=this.getAttribute(n.DRM_TOKEN),r=this.getAttribute(n.THUMBNAIL_TOKEN),o=this.getAttribute(n.STORYBOARD_TOKEN);return{...u(this,oe),...e!=null?{playback:e}:{},...a!=null?{drm:a}:{},...r!=null?{thumbnail:r}:{},...o!=null?{storyboard:o}:{}}}set tokens(e){x(this,oe,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(n.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(n.PLAYBACK_TOKEN,`${e}`)}get drmToken(){var e;return(e=this.getAttribute(n.DRM_TOKEN))!=null?e:void 0}set drmToken(e){this.setAttribute(n.DRM_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(n.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(n.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(n.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(n.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,a,r,o){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(s)return ka(s,e,a,r,o)}removeTextTrack(e){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return Aa(a,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}get castReceiver(){var e;return(e=this.getAttribute(n.CAST_RECEIVER))!=null?e:void 0}set castReceiver(e){e!==this.castReceiver&&(e?this.setAttribute(n.CAST_RECEIVER,e):this.removeAttribute(n.CAST_RECEIVER))}get castCustomData(){var e;return(e=this.media)==null?void 0:e.castCustomData}set castCustomData(e){if(!this.media){k("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=e}get noTooltips(){return this.hasAttribute(n.NO_TOOLTIPS)}set noTooltips(e){if(!e){this.removeAttribute(n.NO_TOOLTIPS);return}this.setAttribute(n.NO_TOOLTIPS,"")}};re=new WeakMap,oe=new WeakMap,H=new WeakMap,ne=new WeakMap,Z=new WeakMap,M=new WeakSet,V=function(){var e,a,r,o;if(!u(this,re)){x(this,re,!0),b(this,N,W).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof c.HTMLElement))throw""}catch{k("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof Ta))throw""}catch{k("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Ea))throw""}catch{k("<media-controller> failed to upgrade!")}this.init(),b(this,Te,Bt).call(this),b(this,ke,Ut).call(this),b(this,Ae,Kt).call(this),x(this,H,(a=(e=this.mediaController)==null?void 0:e.hasAttribute(Be.USER_INACTIVE))!=null?a:!0),b(this,Ce,$t).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>b(this,N,W).call(this)),(o=this.media)==null||o.addEventListener("loadstart",()=>b(this,N,W).call(this))}},Ee=new WeakSet,Ht=function(){var e,a;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},se=new WeakSet,Ke=function(e){Object.assign(u(this,Z),e),b(this,N,W).call(this)},N=new WeakSet,W=function(e={}){Ot(Mt(xa(this,{...u(this,Z),...e})),this.shadowRoot)},Te=new WeakSet,Bt=function(){let e=r=>{var l,h;if(!(r!=null&&r.startsWith("theme-")))return;let o=r.replace(/^theme-/,"");if(Ue.includes(o))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(o,s):(h=this.mediaTheme)==null||h.removeAttribute(o)};new MutationObserver(r=>{for(let{attributeName:o}of r)e(o)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(e)},ke=new WeakSet,Ut=function(){var a;let e=r=>{let{detail:o}=r;if(o instanceof ye||(o=new ye(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){O(o),o.data&&O(`${o.name} data:`,o.data);return}let{dialog:s,devlog:l}=ge(o,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&Se(l),k(o),o.data&&k(`${o.name} data:`,o.data),b(this,se,Ke).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,h;if(!(((s=this.media)==null?void 0:s.error)instanceof ye))return r;let{devlog:o}=ge((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(h=this.media)==null?void 0:h.error.code,player_error_message:o.message?String(o.message):r.player_error_message,player_error_context:o.context?String(o.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:o}=r;if(!o){let{message:h,code:L}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};o=new ye(h,L)}o!=null&&o.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:o}))})},Ae=new WeakSet,Kt=function(){var a,r,o,s;let e=()=>b(this,N,W).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",e),(s=(o=this.media)==null?void 0:o.textTracks)==null||s.addEventListener("removetrack",e)},Ce=new WeakSet,$t=function(){var L,T;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,o=()=>this.streamType===w.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(v,f,C=!1)=>{if(o())return;Array.from(v&&v.activeCues||[]).forEach(g=>{if(!(!g.snapToLines||g.line<-5||g.line>=0&&g.line<10))if(!f||this.paused){let B=g.text.split(`
1334
+ `).length,q=-3;this.streamType===w.LIVE&&(q=-2);let z=q-B;if(g.line===z&&!C)return;r.has(g)||r.set(g,g.line),g.line=z}else setTimeout(()=>{g.line=r.get(g)||"auto"},500)})},l=()=>{var v,f;s(a,(f=(v=this.mediaController)==null?void 0:v.hasAttribute(Be.USER_INACTIVE))!=null?f:!1)},h=()=>{var C,I;let f=Array.from(((I=(C=this.mediaController)==null?void 0:C.media)==null?void 0:I.textTracks)||[]).filter(g=>["subtitles","captions"].includes(g.kind)&&g.mode==="showing")[0];f!==a&&(a==null||a.removeEventListener("cuechange",l)),a=f,a==null||a.addEventListener("cuechange",l),s(a,u(this,H))};h(),(L=this.textTracks)==null||L.addEventListener("change",h),(T=this.textTracks)==null||T.addEventListener("addtrack",h),this.addEventListener("userinactivechange",()=>{var f,C;let v=(C=(f=this.mediaController)==null?void 0:f.hasAttribute(Be.USER_INACTIVE))!=null?C:!0;u(this,H)!==v&&(x(this,H,v),s(a,u(this,H)))})};function F(t,i){return t.media?t.media.getAttribute(i):t.getAttribute(i)}c.customElements.get("mux-player")||(c.customElements.define("mux-player",ie),c.MuxPlayerElement=ie);var Ui=ie;export{ye as MediaError,Ui as default,F as getVideoAttribute};