@mux/mux-player 1.0.0 → 1.1.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,17 +1,17 @@
1
- var et=(e,a,t)=>{if(!a.has(e))throw TypeError("Cannot "+t)};var d=(e,a,t)=>(et(e,a,"read from private field"),t?t.call(e):a.get(e)),h=(e,a,t)=>{if(a.has(e))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(e):a.set(e,t)},A=(e,a,t,r)=>(et(e,a,"write to private field"),r?r.call(e,t):a.set(e,t),t);var b=(e,a,t)=>(et(e,a,"access private method"),t);var ae=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class e extends ae{}globalThis.DocumentFragment=e}var ge=class extends ae{},tt=class extends ae{},Ga={get(e){},define(e,a,t){},upgrade(e){},whenDefined(e){return Promise.resolve(ge)}},fe,at=class{constructor(a,t={}){h(this,fe,void 0);A(this,fe,t==null?void 0:t.detail)}get detail(){return d(this,fe)}initCustomEvent(){}};fe=new WeakMap;function Xa(e,a){return new ge}var Ot={document:{createElement:Xa},DocumentFragment,customElements:Ga,CustomEvent:at,EventTarget:ae,HTMLElement:ge,HTMLVideoElement:tt},Ct=typeof window=="undefined"||typeof globalThis.customElements=="undefined",g=Ct?Ot:globalThis,S=Ct?Ot.document:globalThis.document;import{MediaController as tr}from"media-chrome";import ar,{MediaError as ft,Attributes as u}from"@mux/mux-video";import{StreamTypes as B,PlaybackTypes as Ye,addTextTrack as ir,removeTextTrack as rr}from"@mux/playback-core";import{VideoEvents as oi}from"@mux/mux-video";var Ja="en",Z={code:Ja};var Mt="en";function c(e,a=!0){var i,n;let t=a&&(n=(i=Z)==null?void 0:i[e])!=null?n:e,r=a?Z.code:Mt;return new it(t,r)}var it=class{constructor(a,t=(r=>(r=Z.code)!=null?r:Mt)()){this.message=a,this.locale=t}format(a){return this.message.replace(/\{(\w+)\}/g,(t,r)=>{var i;return(i=a[r])!=null?i:""})}toString(){return this.message}};function Pt(e){let a="";return Object.entries(e).forEach(([t,r])=>{r!=null&&(a+=`${Qa(t)}: ${r}; `)}),a?a.trim():void 0}function Qa(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Rt(e){return e.replace(/[-_]([a-z])/g,(a,t)=>t.toUpperCase())}function W(e){if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}function Ce(e){let a=ei(e).toString();return a?"?"+a:""}function ei(e){let a={};for(let t in e)e[t]!=null&&(a[t]=e[t]);return new URLSearchParams(a)}function ve(e){let a=(e!=null?e:"").split(".")[1];if(!a)return{};let t=a.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(t).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}var rt=(e,a)=>!e||!a?!1:e.contains(a)?!0:rt(e,a.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var nt="mux.com",ti=()=>{try{return"1.0.0"}catch{}return"UNKNOWN"},ai=ti(),Re=()=>ai,ot=(e,{token:a,domain:t=nt}={})=>`https://stream.${t}/${e}.m3u8${Ce(!!a?{token:a}:{redundant_streams:!0})}`,st=(e,{token:a,thumbnailTime:t,domain:r=nt}={})=>{let i=a==null?t:void 0;return`https://image.${r}/${e}/thumbnail.jpg${Ce({token:a,time:i})}`},_t=(e,{token:a,domain:t=nt}={})=>`https://image.${t}/${e}/storyboard.vtt${Ce({token:a})}`;function lt(e){if(e&&/^media-theme-[\w-]+$/.test(e))return e}var ii={crossorigin:"crossOrigin",playsinline:"playsInline"};function Nt(e){var a;return(a=ii[e])!=null?a:Rt(e)}var Vt=e=>{var t,r;let{media:a}=e;return(r=(t=a==null?void 0:a._hls)==null?void 0:t.liveSyncPosition)!=null?r:a!=null&&a.seekable.length?a==null?void 0:a.seekable.end(a.seekable.length-1):void 0},dt=e=>{let a=Vt(e);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}e.currentTime=a},ri=1,ni=5,It=3,Dt=.5,Ht=e=>{var n;let{streamType:a}=e,t=Vt(e),r=(n=e.media)==null?void 0:n.currentTime;if(t==null||r==null)return!1;let i=t-r;return a===Me.LL_LIVE||a===Me.LL_DVR?i<=ri*(It+Dt):a===Me.LIVE||a===Me.DVR?i<=ni*(It+Dt):!1},z,q,x,Pe=class{constructor(a,t){h(this,z,void 0);h(this,q,void 0);h(this,x,[]);A(this,z,a),A(this,q,t)}[Symbol.iterator](){return d(this,x).values()}get length(){return d(this,x).length}get value(){var a;return(a=d(this,x).join(" "))!=null?a:""}set value(a){var t;a!==this.value&&(A(this,x,[]),this.add(...(t=a==null?void 0:a.split(" "))!=null?t:[]))}toString(){return this.value}item(a){return d(this,x)[a]}values(){return d(this,x).values()}keys(){return d(this,x).keys()}forEach(a){d(this,x).forEach(a)}add(...a){var t,r;a.forEach(i=>{this.contains(i)||d(this,x).push(i)}),!(this.value===""&&!((t=d(this,z))!=null&&t.hasAttribute(`${d(this,q)}`)))&&((r=d(this,z))==null||r.setAttribute(`${d(this,q)}`,`${this.value}`))}remove(...a){var t;a.forEach(r=>{d(this,x).splice(d(this,x).indexOf(r),1)}),(t=d(this,z))==null||t.setAttribute(`${d(this,q)}`,`${this.value}`)}contains(a){return d(this,x).includes(a)}toggle(a,t){return typeof t!="undefined"?t?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,t){this.remove(a),this.add(t)}};z=new WeakMap,q=new WeakMap,x=new WeakMap;var Bt=`[mux-player ${Re()}]`;function j(...e){console.warn(Bt,...e)}function O(...e){console.error(Bt,...e)}function Ie(e){var t;let a=(t=e.message)!=null?t:"";if(e.file){let r="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${c("Read more: ")}
2
- ${r}${e.file}`}j(a)}var v={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",SRC:"src",POSTER:"poster",PRELOAD:"preload"},G={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},si=Object.freeze({length:0,start(e){let a=e>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(e){let a=e>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),li=oi.filter(e=>e!=="error"),di=Object.values(v).filter(e=>![v.PLAYSINLINE].includes(e)),mi=Object.values(G);function Ut(e){e.querySelectorAll(":scope > track").forEach(a=>{var t;(t=e.media)==null||t.append(a.cloneNode())}),li.forEach(a=>{var t;(t=e.media)==null||t.addEventListener(a,r=>{e.dispatchEvent(new Event(r.type))})})}var mt=class extends g.HTMLElement{static get observedAttributes(){return[...di,...mi]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(r=>{var i;(i=this.media)==null||i.append(r.cloneNode())});let a=r=>{for(let i of r)i.type==="childList"&&(i.removedNodes.forEach(n=>{var m,p;let o=(m=this.media)==null?void 0:m.querySelector(`track[src="${n.src}"]`);o&&((p=this.media)==null||p.removeChild(o))}),i.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,t,r){switch(a){case G.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case G.VOLUME:{let i=+r;this.media&&!Number.isNaN(i)&&(this.media.volume=i);return}case G.PLAYBACKRATE:{let i=+r;this.media&&!Number.isNaN(i)&&(this.media.playbackRate=i,this.media.defaultPlaybackRate=i);return}}}play(){var a,t;return(t=(a=this.media)==null?void 0:a.play())!=null?t:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var t;return(t=this.media)==null?void 0:t.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get paused(){var a,t;return(t=(a=this.media)==null?void 0:a.paused)!=null?t:!0}get duration(){var a,t;return(t=(a=this.media)==null?void 0:a.duration)!=null?t:NaN}get ended(){var a,t;return(t=(a=this.media)==null?void 0:a.ended)!=null?t:!1}get buffered(){var a,t;return(t=(a=this.media)==null?void 0:a.buffered)!=null?t:si}get readyState(){var a,t;return(t=(a=this.media)==null?void 0:a.readyState)!=null?t:0}get videoWidth(){var a,t;return(t=(a=this.media)==null?void 0:a.videoWidth)!=null?t:0}get videoHeight(){var a,t;return(t=(a=this.media)==null?void 0:a.videoHeight)!=null?t:0}get currentTime(){var a,t;return(t=(a=this.media)==null?void 0:a.currentTime)!=null?t:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,t;return(t=(a=this.media)==null?void 0:a.volume)!=null?t:1}set volume(a){this.media&&(this.media.volume=Number(a))}get poster(){var a;return(a=ie(this,v.POSTER))!=null?a:""}set poster(a){this.setAttribute(v.POSTER,`${a}`)}get playbackRate(){var a,t;return(t=(a=this.media)==null?void 0:a.playbackRate)!=null?t:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=W(this.getAttribute(G.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(G.PLAYBACKRATE,`${a}`):this.removeAttribute(G.PLAYBACKRATE)}get crossOrigin(){return ie(this,v.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(v.CROSSORIGIN,`${a}`)}get autoplay(){return ie(this,v.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(v.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(v.AUTOPLAY)}get loop(){return ie(this,v.LOOP)!=null}set loop(a){a?this.setAttribute(v.LOOP,""):this.removeAttribute(v.LOOP)}get muted(){var a,t;return(t=(a=this.media)==null?void 0:a.muted)!=null?t:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return ie(this,v.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(v.MUTED,""):this.removeAttribute(v.MUTED)}get playsInline(){return ie(this,v.PLAYSINLINE)!=null}set playsInline(a){O("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(v.PRELOAD,a):this.removeAttribute(v.PRELOAD)}};function ie(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}var ct=mt;import{MediaTheme as Hi}from"media-chrome";import{TemplateInstance as Wt,NodeTemplatePart as De,createProcessor as ci,AttributeTemplatePart as ht}from"@github/template-parts";var ye=new WeakMap,ke=class{constructor(a,t){this.element=a;this.type=t;this.element.addEventListener(this.type,this);let r=ye.get(this.element);r&&r.set(this.type,this)}set(a){if(typeof a=="function")this.handleEvent=a.bind(this.element);else if(typeof a=="object"&&typeof a.handleEvent=="function")this.handleEvent=a.handleEvent.bind(a);else{this.element.removeEventListener(this.type,this);let t=ye.get(this.element);t&&t.delete(this.type)}}static for(a){ye.has(a.element)||ye.set(a.element,new Map);let t=a.attributeName.slice(2),r=ye.get(a.element);return r&&r.has(t)?r.get(t):new ke(a.element,t)}};function ui(e,a){return e instanceof ht&&e.attributeName.startsWith("on")?(ke.for(e).set(a),e.element.removeAttributeNS(e.attributeNamespace,e.attributeName),!0):!1}function hi(e,a){return a instanceof Ee&&e instanceof De?(a.renderInto(e),!0):!1}function bi(e,a){return a instanceof DocumentFragment&&e instanceof De?(a.childNodes.length&&e.replace(...a.childNodes),!0):!1}function pi(e,a){if(e instanceof ht){let t=e.attributeNamespace,r=e.element.getAttributeNS(t,e.attributeName);return String(a)!==r&&(e.value=String(a)),!0}return e.value=String(a),!0}function gi(e,a){if(typeof a=="boolean"&&e instanceof ht){let t=e.attributeNamespace,r=e.element.hasAttributeNS(t,e.attributeName);return a!==r&&(e.booleanValue=a),!0}return!1}function fi(e,a){return a===!1&&e instanceof De?(e.replace(""),!0):!1}function vi(e,a){gi(e,a)||ui(e,a)||fi(e,a)||hi(e,a)||bi(e,a)||pi(e,a)}var ut=new WeakMap,Ft=new WeakMap,Yt=new WeakMap,Ee=class{constructor(a,t,r){this.strings=a;this.values=t;this.processor=r}get template(){if(ut.has(this.strings))return ut.get(this.strings);{let a=document.createElement("template"),t=this.strings.length-1;return a.innerHTML=this.strings.reduce((r,i,n)=>r+i+(n<t?`{{ ${n} }}`:""),""),ut.set(this.strings,a),a}}renderInto(a){let t=this.template;if(Ft.get(a)!==t){Ft.set(a,t);let i=new Wt(t,this.values,this.processor);Yt.set(a,i),a instanceof De?a.replace(...i.children):a.appendChild(i);return}let r=Yt.get(a);r&&r.update(this.values)}},Zt=new Map,yi=ci(vi);function l(e,...a){let t=[""],r=[],i,n=!1,o=(m,p=[])=>{t[t.length-1]=t[t.length-1]+m[0],p.forEach((f,k)=>{(i=f==null?void 0:f.$static$)!==void 0?(i.forEach($=>{o($.strings,$.values)}),t[t.length-1]=t[t.length-1]+m[k+1],n=!0):(r.push(f),t.push(m[k+1]))})};if(o(e,a),n){let m=t.join("$$html$$");e=Zt.get(m),e===void 0&&(t.raw=t,Zt.set(m,e=t)),a=r}return new Ee(e,a,yi)}function _e(e,a){e.renderInto(a)}function y(e,a){let t=document.createElement("template");return t.innerHTML=e,new Wt(t,a)}var bt=(...e)=>({$static$:e.map(a=>a instanceof Ee?a:/\w-/.test(a)?{strings:[a]}:{strings:[]})});var qt=`
1
+ var et=(e,a,t)=>{if(!a.has(e))throw TypeError("Cannot "+t)};var d=(e,a,t)=>(et(e,a,"read from private field"),t?t.call(e):a.get(e)),h=(e,a,t)=>{if(a.has(e))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(e):a.set(e,t)},A=(e,a,t,r)=>(et(e,a,"write to private field"),r?r.call(e,t):a.set(e,t),t);var p=(e,a,t)=>(et(e,a,"access private method"),t);var ie=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class e extends ie{}globalThis.DocumentFragment=e}var ge=class extends ie{},tt=class extends ie{},li={get(e){},define(e,a,t){},upgrade(e){},whenDefined(e){return Promise.resolve(ge)}},fe,at=class{constructor(a,t={}){h(this,fe,void 0);A(this,fe,t==null?void 0:t.detail)}get detail(){return d(this,fe)}initCustomEvent(){}};fe=new WeakMap;function di(e,a){return new ge}var Bt={document:{createElement:di},DocumentFragment,customElements:li,CustomEvent:at,EventTarget:ie,HTMLElement:ge,HTMLVideoElement:tt},Kt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",g=Kt?Bt:globalThis,S=Kt?Bt.document:globalThis.document;import{MediaController as hr}from"media-chrome";import br,{MediaError as gt,Attributes as u}from"@mux/mux-video";import{StreamTypes as B,PlaybackTypes as Ye,addTextTrack as pr,removeTextTrack as gr}from"@mux/playback-core";import{VideoEvents as vi}from"@mux/mux-video";var mi="en",W={code:mi};var Ut="en";function c(e,a=!0){var i,n;let t=a&&(n=(i=W)==null?void 0:i[e])!=null?n:e,r=a?W.code:Ut;return new it(t,r)}var it=class{constructor(a,t=(r=>(r=W.code)!=null?r:Ut)()){this.message=a,this.locale=t}format(a){return this.message.replace(/\{(\w+)\}/g,(t,r)=>{var i;return(i=a[r])!=null?i:""})}toString(){return this.message}};function Ft(e){let a="";return Object.entries(e).forEach(([t,r])=>{r!=null&&(a+=`${ci(t)}: ${r}; `)}),a?a.trim():void 0}function ci(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Yt(e){return e.replace(/[-_]([a-z])/g,(a,t)=>t.toUpperCase())}function z(e){if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}function Ce(e){let a=ui(e).toString();return a?"?"+a:""}function ui(e){let a={};for(let t in e)e[t]!=null&&(a[t]=e[t]);return new URLSearchParams(a)}function ve(e){let a=(e!=null?e:"").split(".")[1];if(!a)return{};let t=a.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(t).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}var rt=(e,a)=>!e||!a?!1:e.contains(a)?!0:rt(e,a.getRootNode().host);import{StreamTypes as Me}from"@mux/playback-core";var nt="mux.com",hi=()=>{try{return"1.1.0"}catch{}return"UNKNOWN"},bi=hi(),Re=()=>bi,ot=(e,{token:a,domain:t=nt}={})=>`https://stream.${t}/${e}.m3u8${Ce(!!a?{token:a}:{redundant_streams:!0})}`,zt=(e,{token:a,thumbnailTime:t,domain:r=nt}={})=>{let i=a==null?t:void 0;return`https://image.${r}/${e}/thumbnail.jpg${Ce({token:a,time:i})}`},qt=(e,{token:a,domain:t=nt}={})=>`https://image.${t}/${e}/storyboard.vtt${Ce({token:a})}`;function st(e){if(e&&/^media-theme-[\w-]+$/.test(e))return e}var pi={crossorigin:"crossOrigin",playsinline:"playsInline"};function jt(e){var a;return(a=pi[e])!=null?a:Yt(e)}var Gt=e=>{var t,r;let{media:a}=e;return(r=(t=a==null?void 0:a._hls)==null?void 0:t.liveSyncPosition)!=null?r:a!=null&&a.seekable.length?a==null?void 0:a.seekable.end(a.seekable.length-1):void 0},lt=e=>{let a=Gt(e);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}e.currentTime=a},gi=1,fi=5,Zt=3,Wt=.5,Xt=e=>{var n;let{streamType:a}=e,t=Gt(e),r=(n=e.media)==null?void 0:n.currentTime;if(t==null||r==null)return!1;let i=t-r;return a===Me.LL_LIVE||a===Me.LL_DVR?i<=gi*(Zt+Wt):a===Me.LIVE||a===Me.DVR?i<=fi*(Zt+Wt):!1},q,j,x,Pe=class{constructor(a,t){h(this,q,void 0);h(this,j,void 0);h(this,x,[]);A(this,q,a),A(this,j,t)}[Symbol.iterator](){return d(this,x).values()}get length(){return d(this,x).length}get value(){var a;return(a=d(this,x).join(" "))!=null?a:""}set value(a){var t;a!==this.value&&(A(this,x,[]),this.add(...(t=a==null?void 0:a.split(" "))!=null?t:[]))}toString(){return this.value}item(a){return d(this,x)[a]}values(){return d(this,x).values()}keys(){return d(this,x).keys()}forEach(a){d(this,x).forEach(a)}add(...a){var t,r;a.forEach(i=>{this.contains(i)||d(this,x).push(i)}),!(this.value===""&&!((t=d(this,q))!=null&&t.hasAttribute(`${d(this,j)}`)))&&((r=d(this,q))==null||r.setAttribute(`${d(this,j)}`,`${this.value}`))}remove(...a){var t;a.forEach(r=>{d(this,x).splice(d(this,x).indexOf(r),1)}),(t=d(this,q))==null||t.setAttribute(`${d(this,j)}`,`${this.value}`)}contains(a){return d(this,x).includes(a)}toggle(a,t){return typeof t!="undefined"?t?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,t){this.remove(a),this.add(t)}};q=new WeakMap,j=new WeakMap,x=new WeakMap;var Jt=`[mux-player ${Re()}]`;function G(...e){console.warn(Jt,...e)}function O(...e){console.error(Jt,...e)}function Ie(e){var t;let a=(t=e.message)!=null?t:"";if(e.file){let r="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${c("Read more: ")}
2
+ ${r}${e.file}`}G(a)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},X={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},yi=Object.freeze({length:0,start(e){let a=e>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(e){let a=e>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ki=vi.filter(e=>e!=="error"),Ei=Object.values(T).filter(e=>![T.PLAYSINLINE].includes(e)),Ti=Object.values(X);function ea(e){e.querySelectorAll(":scope > track").forEach(a=>{var t;(t=e.media)==null||t.append(a.cloneNode())}),ki.forEach(a=>{var t;(t=e.media)==null||t.addEventListener(a,r=>{e.dispatchEvent(new Event(r.type))})})}var dt=class extends g.HTMLElement{static get observedAttributes(){return[...Ei,...Ti]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(r=>{var i;(i=this.media)==null||i.append(r.cloneNode())});let a=r=>{for(let i of r)i.type==="childList"&&(i.removedNodes.forEach(n=>{var m,b;let o=(m=this.media)==null?void 0:m.querySelector(`track[src="${n.src}"]`);o&&((b=this.media)==null||b.removeChild(o))}),i.addedNodes.forEach(n=>{var o;(o=this.media)==null||o.append(n.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,t,r){switch(a){case X.MUTED:{this.media&&(this.media.muted=r!=null,this.media.defaultMuted=r!=null);return}case X.VOLUME:{let i=+r;this.media&&!Number.isNaN(i)&&(this.media.volume=i);return}case X.PLAYBACKRATE:{let i=+r;this.media&&!Number.isNaN(i)&&(this.media.playbackRate=i,this.media.defaultPlaybackRate=i);return}}}play(){var a,t;return(t=(a=this.media)==null?void 0:a.play())!=null?t:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var t;return(t=this.media)==null?void 0:t.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get paused(){var a,t;return(t=(a=this.media)==null?void 0:a.paused)!=null?t:!0}get duration(){var a,t;return(t=(a=this.media)==null?void 0:a.duration)!=null?t:NaN}get ended(){var a,t;return(t=(a=this.media)==null?void 0:a.ended)!=null?t:!1}get buffered(){var a,t;return(t=(a=this.media)==null?void 0:a.buffered)!=null?t:yi}get readyState(){var a,t;return(t=(a=this.media)==null?void 0:a.readyState)!=null?t:0}get videoWidth(){var a,t;return(t=(a=this.media)==null?void 0:a.videoWidth)!=null?t:0}get videoHeight(){var a,t;return(t=(a=this.media)==null?void 0:a.videoHeight)!=null?t:0}get currentTime(){var a,t;return(t=(a=this.media)==null?void 0:a.currentTime)!=null?t:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,t;return(t=(a=this.media)==null?void 0:a.volume)!=null?t:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,t;return(t=(a=this.media)==null?void 0:a.playbackRate)!=null?t:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=z(this.getAttribute(X.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(X.PLAYBACKRATE,`${a}`):this.removeAttribute(X.PLAYBACKRATE)}get crossOrigin(){return ye(this,T.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(T.CROSSORIGIN,`${a}`)}get autoplay(){return ye(this,T.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(T.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(T.AUTOPLAY)}get loop(){return ye(this,T.LOOP)!=null}set loop(a){a?this.setAttribute(T.LOOP,""):this.removeAttribute(T.LOOP)}get muted(){var a,t;return(t=(a=this.media)==null?void 0:a.muted)!=null?t:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return ye(this,T.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(T.MUTED,""):this.removeAttribute(T.MUTED)}get playsInline(){return ye(this,T.PLAYSINLINE)!=null}set playsInline(a){O("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(a){["","none","metadata","auto"].includes(a)?this.setAttribute(T.PRELOAD,a):this.removeAttribute(T.PRELOAD)}};function ye(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}var mt=dt;import{MediaTheme as Xi}from"media-chrome";import{TemplateInstance as ra,NodeTemplatePart as De,createProcessor as Ai,AttributeTemplatePart as ut}from"@github/template-parts";var ke=new WeakMap,Ee=class{constructor(a,t){this.element=a;this.type=t;this.element.addEventListener(this.type,this);let r=ke.get(this.element);r&&r.set(this.type,this)}set(a){if(typeof a=="function")this.handleEvent=a.bind(this.element);else if(typeof a=="object"&&typeof a.handleEvent=="function")this.handleEvent=a.handleEvent.bind(a);else{this.element.removeEventListener(this.type,this);let t=ke.get(this.element);t&&t.delete(this.type)}}static for(a){ke.has(a.element)||ke.set(a.element,new Map);let t=a.attributeName.slice(2),r=ke.get(a.element);return r&&r.has(t)?r.get(t):new Ee(a.element,t)}};function xi(e,a){return e instanceof ut&&e.attributeName.startsWith("on")?(Ee.for(e).set(a),e.element.removeAttributeNS(e.attributeNamespace,e.attributeName),!0):!1}function wi(e,a){return a instanceof Te&&e instanceof De?(a.renderInto(e),!0):!1}function Li(e,a){return a instanceof DocumentFragment&&e instanceof De?(a.childNodes.length&&e.replace(...a.childNodes),!0):!1}function $i(e,a){if(e instanceof ut){let t=e.attributeNamespace,r=e.element.getAttributeNS(t,e.attributeName);return String(a)!==r&&(e.value=String(a)),!0}return e.value=String(a),!0}function Si(e,a){if(typeof a=="boolean"&&e instanceof ut){let t=e.attributeNamespace,r=e.element.hasAttributeNS(t,e.attributeName);return a!==r&&(e.booleanValue=a),!0}return!1}function Oi(e,a){return a===!1&&e instanceof De?(e.replace(""),!0):!1}function Ci(e,a){Si(e,a)||xi(e,a)||Oi(e,a)||wi(e,a)||Li(e,a)||$i(e,a)}var ct=new WeakMap,ta=new WeakMap,aa=new WeakMap,Te=class{constructor(a,t,r){this.strings=a;this.values=t;this.processor=r}get template(){if(ct.has(this.strings))return ct.get(this.strings);{let a=document.createElement("template"),t=this.strings.length-1;return a.innerHTML=this.strings.reduce((r,i,n)=>r+i+(n<t?`{{ ${n} }}`:""),""),ct.set(this.strings,a),a}}renderInto(a){let t=this.template;if(ta.get(a)!==t){ta.set(a,t);let i=new ra(t,this.values,this.processor);aa.set(a,i),a instanceof De?a.replace(...i.children):a.appendChild(i);return}let r=aa.get(a);r&&r.update(this.values)}},ia=new Map,Mi=Ai(Ci);function l(e,...a){let t=[""],r=[],i,n=!1,o=(m,b=[])=>{t[t.length-1]=t[t.length-1]+m[0],b.forEach((f,v)=>{(i=f==null?void 0:f.$static$)!==void 0?(i.forEach($=>{o($.strings,$.values)}),t[t.length-1]=t[t.length-1]+m[v+1],n=!0):(r.push(f),t.push(m[v+1]))})};if(o(e,a),n){let m=t.join("$$html$$");e=ia.get(m),e===void 0&&(t.raw=t,ia.set(m,e=t)),a=r}return new Te(e,a,Mi)}function _e(e,a){e.renderInto(a)}function y(e,a){let t=document.createElement("template");return t.innerHTML=e,new ra(t,a)}var ht=(...e)=>({$static$:e.map(a=>a instanceof Te?a:/\w-/.test(a)?{strings:[a]}:{strings:[]})});var oa=`
3
3
  :host {
4
4
  cursor: pointer;
5
5
  }
6
6
  media-time-display {
7
7
  color: inherit;
8
8
  }
9
- `,jt=S.createElement("template");jt.innerHTML=`
9
+ `,sa=S.createElement("template");sa.innerHTML=`
10
10
  <style>
11
- ${qt}
11
+ ${oa}
12
12
  </style>
13
13
  <media-time-display show-duration></media-time-display>
14
- `;var zt=["Enter"," "],Te,ne,Ne,re=class extends g.HTMLElement{constructor(){var t,r;super();h(this,ne);h(this,Te,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(r=this.shadowRoot)==null?void 0:r.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,r,i;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(r=this.timeDisplayEl)==null||r.removeAttribute("remaining"):(i=this.timeDisplayEl)==null||i.setAttribute("remaining","")}connectedCallback(){let t=r=>{let{key:i}=r;if(!zt.includes(i)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:i,altKey:n,key:o}=r;if(i||n||!zt.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),A(this,Te,setInterval(b(this,ne,Ne).bind(this),200)),requestAnimationFrame(()=>b(this,ne,Ne).call(this))}disconnectedCallback(){clearInterval(d(this,Te))}attributeChangedCallback(t,r,i){var n,o;t==="hide-duration"&&b(this,ne,Ne).call(this),["remaining","disabled","aria-disabled"].includes(t)&&r!==i&&(i==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(o=this.timeDisplayEl)==null||o.setAttribute(t,i))}};Te=new WeakMap,ne=new WeakSet,Ne=function(){var r,i,n,o;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(r=this.timeDisplayEl)!=null&&r.hasAttribute("show-duration")&&((i=this.timeDisplayEl)==null||i.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(o=this.timeDisplayEl)==null||o.setAttribute("show-duration","")},re.styles=qt,re.template=jt;g.customElements.get("mxp-time-display")||(g.customElements.define("mxp-time-display",re),g.MxpTimeDisplay=re);var Gt=`:host(:not([audio])) {
14
+ `;var na=["Enter"," "],Ae,ne,Ne,re=class extends g.HTMLElement{constructor(){var t,r;super();h(this,ne);h(this,Ae,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(r=this.shadowRoot)==null?void 0:r.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,r,i;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(r=this.timeDisplayEl)==null||r.removeAttribute("remaining"):(i=this.timeDisplayEl)==null||i.setAttribute("remaining","")}connectedCallback(){let t=r=>{let{key:i}=r;if(!na.includes(i)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",r=>{let{metaKey:i,altKey:n,key:o}=r;if(i||n||!na.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),A(this,Ae,setInterval(p(this,ne,Ne).bind(this),200)),requestAnimationFrame(()=>p(this,ne,Ne).call(this))}disconnectedCallback(){clearInterval(d(this,Ae))}attributeChangedCallback(t,r,i){var n,o;t==="hide-duration"&&p(this,ne,Ne).call(this),["remaining","disabled","aria-disabled"].includes(t)&&r!==i&&(i==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(o=this.timeDisplayEl)==null||o.setAttribute(t,i))}};Ae=new WeakMap,ne=new WeakSet,Ne=function(){var r,i,n,o;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(r=this.timeDisplayEl)!=null&&r.hasAttribute("show-duration")&&((i=this.timeDisplayEl)==null||i.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(o=this.timeDisplayEl)==null||o.setAttribute("show-duration","")},re.styles=oa,re.template=sa;g.customElements.get("mxp-time-display")||(g.customElements.define("mxp-time-display",re),g.MxpTimeDisplay=re);var la=`:host(:not([audio])) {
15
15
  --secondary-color: transparent;
16
16
  }
17
17
 
@@ -161,7 +161,7 @@ media-controller::part(vertical-layer) {
161
161
  }
162
162
 
163
163
  media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer) {
164
- background-color: var(--controls-backdrop-color, rgba(0, 0, 0, 0.6));
164
+ background-color: var(--controls-backdrop-color, var(--controls, rgba(0, 0, 0, 0.6)));
165
165
  transition: background-color 0.25s;
166
166
  }
167
167
 
@@ -237,46 +237,46 @@ media-time-display {
237
237
  flex-grow: 1;
238
238
  font-size: 21px;
239
239
  }
240
- `;var Xt=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
240
+ `;var da=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
241
241
  <path d="M13.19 14.22a.25.25 0 0 0-.38 0l-5.46 6.37a.25.25 0 0 0 .19.41h10.92a.25.25 0 0 0 .19-.41l-5.46-6.37Z"/>
242
242
  <path d="M22 3H4a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h2.94L8 16.75H4.25V4.25h17.5v12.5H18L19.06 18H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
243
243
  </svg>
244
- `;var Jt=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
244
+ `;var ma=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
245
245
  <path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-1.81-.12-4.67-.18-7.53-.18-2.86 0-5.72.06-7.53.18a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c1.81.12 4.67.18 7.53.18 2.86 0 5.72-.06 7.53-.18a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-1.49 12.53a1.11 1.11 0 0 1-.91 1.11c-1.67.11-4.45.18-7.43.18-2.98 0-5.76-.07-7.43-.18a1.11 1.11 0 0 1-.91-1.11c-.21-4.137-.21-8.283 0-12.42a1.11 1.11 0 0 1 .91-1.11c1.67-.11 4.43-.18 7.43-.18s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.137.21 8.283 0 12.42ZM10.843 14a1.55 1.55 0 0 1-.76.18 1.57 1.57 0 0 1-.71-.18 1.69 1.69 0 0 1-.57-.42 2.099 2.099 0 0 1-.38-.58 2.47 2.47 0 0 1 0-1.64 2 2 0 0 1 .39-.66 1.73 1.73 0 0 1 .58-.42c.23-.103.479-.158.73-.16.241-.004.48.044.7.14.199.088.373.222.51.39l1.08-.89a2.179 2.179 0 0 0-.47-.44 2.81 2.81 0 0 0-.54-.32 2.91 2.91 0 0 0-.58-.15 2.71 2.71 0 0 0-.56 0 4.08 4.08 0 0 0-1.38.15 3.27 3.27 0 0 0-1.09.67 3.14 3.14 0 0 0-.71 1.06 3.62 3.62 0 0 0-.26 1.39 3.57 3.57 0 0 0 .26 1.38 3 3 0 0 0 .71 1.06c.316.293.687.52 1.09.67.443.16.91.238 1.38.23a3.2 3.2 0 0 0 1.28-.27c.401-.183.747-.47 1-.83l-1.17-.88a1.42 1.42 0 0 1-.53.52Zm6.62 0a1.58 1.58 0 0 1-.76.18 1.54 1.54 0 0 1-.7-.18 1.69 1.69 0 0 1-.57-.42 2.12 2.12 0 0 1-.43-.58 2.29 2.29 0 0 1 .39-2.3 1.84 1.84 0 0 1 1.32-.58c.241-.003.48.045.7.14.199.088.373.222.51.39l1.08-.92a2.43 2.43 0 0 0-.47-.44 3.22 3.22 0 0 0-.53-.29 2.999 2.999 0 0 0-.57-.15 2.87 2.87 0 0 0-.57 0 4.06 4.06 0 0 0-1.36.15 3.17 3.17 0 0 0-1.09.67 3 3 0 0 0-.72 1.06 3.62 3.62 0 0 0-.25 1.39 3.57 3.57 0 0 0 .25 1.38c.16.402.405.764.72 1.06a3.17 3.17 0 0 0 1.09.67c.44.16.904.237 1.37.23.441 0 .877-.092 1.28-.27a2.45 2.45 0 0 0 1-.83l-1.15-.85a1.49 1.49 0 0 1-.54.49Z"/>
246
246
  </svg>
247
- `;var Qt=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
247
+ `;var ca=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
248
248
  <path d="M22.832 5.68a2.58 2.58 0 0 0-2.3-2.5c-3.62-.24-11.44-.24-15.06 0a2.58 2.58 0 0 0-2.3 2.5c-.23 4.21-.23 8.43 0 12.64a2.58 2.58 0 0 0 2.3 2.5c3.62.24 11.44.24 15.06 0a2.58 2.58 0 0 0 2.3-2.5c.23-4.21.23-8.43 0-12.64Zm-11.41 10.1a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 4 4 0 0 1-1.28-.83 3.67 3.67 0 0 1-.84-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.53 3.53 0 0 1 .84-1.21 3.89 3.89 0 0 1 1.29-.8 4.76 4.76 0 0 1 1.63-.27 4.06 4.06 0 0 1 1.35.24c.225.091.44.205.64.34a2.7 2.7 0 0 1 .55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.35 2.35 0 0 0-.46.77 2.78 2.78 0 0 0-.16 1c-.009.34.046.68.16 1 .104.283.26.545.46.77.188.21.415.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.88 2.88 0 0 1-1.22 1.01Zm7.52 0a3.63 3.63 0 0 1-1.51.32 4.76 4.76 0 0 1-1.63-.27 3.89 3.89 0 0 1-1.28-.83 3.55 3.55 0 0 1-.85-1.26 4.23 4.23 0 0 1-.3-1.63 4.28 4.28 0 0 1 .3-1.64 3.43 3.43 0 0 1 .85-1.25 3.75 3.75 0 0 1 1.28-.8 4.76 4.76 0 0 1 1.63-.27 4 4 0 0 1 1.35.24c.225.091.44.205.64.34.21.144.395.32.55.52l-1.27 1a1.79 1.79 0 0 0-.6-.46 2 2 0 0 0-.83-.16 2 2 0 0 0-1.56.69 2.352 2.352 0 0 0-.46.77 3.01 3.01 0 0 0-.16 1c-.003.34.05.678.16 1 .108.282.263.542.46.77.188.21.416.38.67.5a2 2 0 0 0 .84.18 1.87 1.87 0 0 0 .9-.21 1.78 1.78 0 0 0 .65-.6l1.38 1a2.82 2.82 0 0 1-1.21 1.05Z"/>
249
249
  </svg>
250
- `;var ea=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
250
+ `;var ua=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
251
251
  <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
252
252
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
253
253
  <path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
254
254
  </svg>
255
- `;var ta=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
255
+ `;var ha=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
256
256
  <path d="M3 15.5V17c2.206 0 4 1.794 4 4h1.5A5.5 5.5 0 0 0 3 15.5Zm0 3V21h2.5A2.5 2.5 0 0 0 3 18.5Z"/>
257
257
  <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
258
258
  <path d="M22 3H4a1 1 0 0 0-1 1v6.984c.424 0 .84.035 1.25.086V4.25h17.5v15.5h-8.82c.051.41.086.826.086 1.25H22a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Z"/>
259
259
  <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
260
260
  </svg>
261
- `;var aa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
261
+ `;var ba=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
262
262
  <path d="M20.25 14.5a.76.76 0 0 0-.75.75v4.25h-4.25a.75.75 0 1 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5a.76.76 0 0 0-.75-.75Zm0-11.5h-5a.76.76 0 0 0-.75.75.76.76 0 0 0 .75.75h4.25v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75ZM8.75 19.5H4.5v-4.25a.76.76 0 0 0-.75-.75.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75h5a.75.75 0 1 0 0-1.5Zm0-16.5h-5a.76.76 0 0 0-.75.75v5a.76.76 0 0 0 .75.75.76.76 0 0 0 .75-.75V4.5h4.25a.76.76 0 0 0 .75-.75.76.76 0 0 0-.75-.75Z"/>
263
263
  </svg>
264
- `;var ia=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
264
+ `;var pa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
265
265
  <path d="M20.25 14.5h-5a.76.76 0 0 0-.75.75v5a.75.75 0 1 0 1.5 0V16h4.25a.75.75 0 1 0 0-1.5Zm-5-5h5a.75.75 0 1 0 0-1.5H16V3.75a.75.75 0 1 0-1.5 0v5a.76.76 0 0 0 .75.75Zm-6.5 5h-5a.75.75 0 1 0 0 1.5H8v4.25a.75.75 0 1 0 1.5 0v-5a.76.76 0 0 0-.75-.75Zm0-11.5a.76.76 0 0 0-.75.75V8H3.75a.75.75 0 0 0 0 1.5h5a.76.76 0 0 0 .75-.75v-5A.76.76 0 0 0 8.75 3Z"/>
266
266
  </svg>
267
- `;var ra=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
267
+ `;var ga=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
268
268
  <path d="M6 19.5a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v15ZM14.5 4a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-15a.5.5 0 0 0-.5-.5h-3Z"/>
269
269
  </svg>
270
- `;var na=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
270
+ `;var fa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
271
271
  <path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
272
272
  </svg>
273
- `;var oa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
273
+ `;var va=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
274
274
  <path d="M22 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h6.75v-1.25h-6.5V4.25h17.5v6.5H23V4a1 1 0 0 0-1-1Zm0 10h-8a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1Zm-.5 6.5h-7v-5h7v5Z"/>
275
275
  </svg>
276
- `;var sa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
276
+ `;var ya=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
277
277
  <path d="m6.73 20.93 14.05-8.54a.46.46 0 0 0 0-.78L6.73 3.07a.48.48 0 0 0-.73.39v17.07a.48.48 0 0 0 .73.4Z"/>
278
278
  </svg>
279
- `;var la=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
279
+ `;var ka=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
280
280
  <path d="M11 6V3L5.37 7 11 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 11 6Z"/>
281
281
  <text
282
282
  class="value"
@@ -286,7 +286,7 @@ media-time-display {
286
286
  {{value}}
287
287
  </text>
288
288
  </svg>
289
- `;var da=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
289
+ `;var Ea=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
290
290
  <path d="M11 6V3l5.61 4L11 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 11 6Z"/>
291
291
  <text
292
292
  class="value"
@@ -296,21 +296,21 @@ media-time-display {
296
296
  {{value}}
297
297
  </text>
298
298
  </svg>
299
- `;var ma=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
299
+ `;var Ta=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
300
300
  <path d="m11.14 4.86-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.21a.5.5 0 0 0-.86-.35Zm2.74-1.56v1.52A7.52 7.52 0 0 1 19.47 12a7.52 7.52 0 0 1-5.59 7.18v1.52A9 9 0 0 0 21 12a9 9 0 0 0-7.12-8.7Zm3.56 8.7a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
301
301
  </svg>
302
- `;var ca=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
302
+ `;var Aa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
303
303
  <path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
304
304
  </svg>
305
- `;var ua=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
305
+ `;var xa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
306
306
  <path d="m11.14 4.853-4 4a.49.49 0 0 1-.35.14H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.5.5 0 0 0 .85-.36V5.203a.5.5 0 0 0-.86-.35Zm6.3 7.14a5.49 5.49 0 0 0-3.56-5.1v1.66a3.93 3.93 0 0 1 0 6.88v1.66a5.49 5.49 0 0 0 3.56-5.1Z"/>
307
307
  </svg>
308
- `;var ha=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
308
+ `;var wa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
309
309
  <path d="m3 4.05 4.48 4.47-.33.33a.49.49 0 0 1-.36.15H3.25a.25.25 0 0 0-.25.25v5.5a.25.25 0 0 0 .25.25h3.54a.49.49 0 0 1 .36.15l4 4a.48.48 0 0 0 .36.15.5.5 0 0 0 .5-.5v-5.75l4.67 4.66a7.71 7.71 0 0 1-2.79 1.47v1.52a9.32 9.32 0 0 0 3.87-1.91L20 21l1-1L4.06 3 3 4.05Zm5.36 5.36 2.39 2.39V17L8 14.26a1.74 1.74 0 0 0-1.24-.51H4.25v-3.5h2.54A1.74 1.74 0 0 0 8 9.74l.36-.33ZM19.47 12a7.19 7.19 0 0 1-.89 3.47l1.11 1.1A8.64 8.64 0 0 0 21 12a9 9 0 0 0-7.12-8.7v1.52A7.52 7.52 0 0 1 19.47 12ZM12 8.88V5.21a.5.5 0 0 0-.5-.5.48.48 0 0 0-.36.15L9.56 6.44 12 8.88ZM15.91 12a4.284 4.284 0 0 1-.07.72l1.22 1.22a5.2 5.2 0 0 0 .38-1.94 5.49 5.49 0 0 0-3.56-5.1v1.66A4 4 0 0 1 15.91 12Z"/>
310
310
  </svg>
311
- `;var ba=()=>y(Xt),pa=()=>y(Jt),ga=()=>y(Qt),fa=()=>y(ea),va=()=>y(ta),ya=()=>y(aa),ka=()=>y(ia),Ea=()=>y(ra),Ta=()=>y(na),Aa=()=>y(oa),xa=()=>y(sa),wa=e=>y(la,e),La=e=>y(da,e),$a=()=>y(ma),Sa=()=>y(ca),Oa=()=>y(ua),Ca=()=>y(ha);import{StreamTypes as w}from"@mux/playback-core";var N={LG:"large",SM:"small",XS:"extra-small"},He,Ma,Ve=class extends Hi{constructor(){super();h(this,He);b(this,He,Ma).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var r;let t={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};t.nohotkeys=t.nohotkeys||!t.hasSrc||t.isDialogOpen,[w.LIVE,w.LL_LIVE,w.DVR,w.LL_DVR].includes(t.streamType)&&(t.hotkeys=t.hotkeys||"",t.hotkeys+=" noarrowleft noarrowright"),_e(l`
311
+ `;var La=()=>y(da),$a=()=>y(ma),Sa=()=>y(ca),Oa=()=>y(ua),Ca=()=>y(ha),Ma=()=>y(ba),Pa=()=>y(pa),Ra=()=>y(ga),Ia=()=>y(fa),Da=()=>y(va),_a=()=>y(ya),Na=e=>y(ka,e),Va=e=>y(Ea,e),Ha=()=>y(Ta),Ba=()=>y(Aa),Ka=()=>y(xa),Ua=()=>y(wa);import{StreamTypes as w}from"@mux/playback-core";var N={LG:"large",SM:"small",XS:"extra-small"},He,Fa,Ve=class extends Xi{constructor(){super();h(this,He);p(this,He,Fa).call(this)}static get observedAttributes(){return["audio","has-open-dialog","has-src","nohotkeys","hotkeys","stream-type","player-size","default-hidden-captions","forward-seek-offset","backward-seek-offset","playbackrates","default-show-remaining-time","poster","placeholder","title"]}attributeChangedCallback(){this.render()}render(){var r,i,n;let t={hasSrc:this.hasAttribute("has-src"),isDialogOpen:this.hasAttribute("has-open-dialog"),audio:this.hasAttribute("audio"),nohotkeys:this.hasAttribute("nohotkeys"),hotkeys:this.getAttribute("hotkeys"),streamType:this.getAttribute("stream-type"),playerSize:this.getAttribute("player-size"),defaultHiddenCaptions:this.hasAttribute("default-hidden-captions"),forwardSeekOffset:this.getAttribute("forward-seek-offset"),backwardSeekOffset:this.getAttribute("backward-seek-offset"),playbackRates:this.getAttribute("playbackrates"),defaultShowRemainingTime:this.hasAttribute("default-show-remaining-time"),poster:this.getAttribute("poster"),placeholder:this.getAttribute("placeholder"),title:this.getAttribute("title")};t.nohotkeys=t.nohotkeys||!t.hasSrc||t.isDialogOpen,[w.LIVE,w.LL_LIVE,w.DVR,w.LL_DVR].includes(t.streamType)&&(t.hotkeys=t.hotkeys||"",t.hotkeys+=" noarrowleft noarrowright"),_e(l`
312
312
  <style>
313
- ${Gt}
313
+ ${la}
314
314
  </style>
315
315
  <media-controller
316
316
  gestures-disabled="${!t.hasSrc||t.isDialogOpen}"
@@ -323,48 +323,49 @@ media-time-display {
323
323
  <slot name="media" slot="media"></slot>
324
324
  <media-poster-image
325
325
  slot="poster"
326
- src="${t.poster}"
327
- placeholder-src="${t.placeholder}"
326
+ part="poster"
327
+ src="${(r=t.poster)!=null?r:!1}"
328
+ placeholder-src="${(i=t.placeholder)!=null?i:!1}"
328
329
  ></media-poster-image>
329
330
  <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
330
- ${Bi(t)}
331
+ ${Ji(t)}
331
332
  <slot></slot>
332
333
  </media-controller>
333
- `,this.shadowRoot),(r=this.shadowRoot)==null||r.querySelectorAll("*").forEach(i=>{if(!i.localName.includes("-"))return;let n=i.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!n)return;let[,,o,m]=n;o==="text"&&i.classList.contains("title-display")&&(o="title");let p=i.closest('[slot="top-chrome"]')?"top":i.closest('[slot="centered-chrome"]')?"center":"bottom";i.setAttribute("part",`${p} ${o} ${m}`)})}};He=new WeakSet,Ma=function(){var t,r,i;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--controls-backdrop-color",syntax:"<color>",inherits:!0,initialValue:"rgba(0, 0, 0, 0.6)"})}catch{}};g.customElements.get("media-theme-mux")||g.customElements.define("media-theme-mux",Ve);var Bi=e=>{let{streamType:a,playerSize:t,audio:r}=e;if(r)switch(a){case w.LIVE:case w.LL_LIVE:return Fi(e);case w.DVR:case w.LL_DVR:return Ui(e);case w.ON_DEMAND:default:return Ki(e)}switch(a){case w.LIVE:case w.LL_LIVE:switch(t){case N.LG:return qi(e);case N.SM:return zi(e);case N.XS:return Wi(e)}case w.DVR:case w.LL_DVR:switch(t){case N.LG:return Xi(e);case N.SM:return Gi(e);case N.XS:return ji(e)}case w.ON_DEMAND:default:switch(t){case N.LG:return Zi(e);case N.SM:return Yi(e);case N.XS:return pt(e)}}},L=e=>l`
334
+ `,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(o=>{if(!o.localName.includes("-"))return;let m=o.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!m)return;let[,,b,f]=m;b==="text"&&o.classList.contains("title-display")&&(b="title");let v=o.closest('[slot="top-chrome"]')?"top":o.closest('[slot="centered-chrome"]')?"center":"bottom";o.setAttribute("part",`${v} ${b} ${f}`)})}};He=new WeakSet,Fa=function(){var t,r,i;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(r=window==null?void 0:window.CSS)==null||r.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--controls-backdrop-color",syntax:"<color>",inherits:!0,initialValue:"rgba(0, 0, 0, 0.6)"})}catch{}};g.customElements.get("media-theme-mux")||g.customElements.define("media-theme-mux",Ve);var Ji=e=>{let{streamType:a,playerSize:t,audio:r}=e;if(r)switch(a){case w.LIVE:case w.LL_LIVE:return tr(e);case w.DVR:case w.LL_DVR:return er(e);case w.ON_DEMAND:default:return Qi(e)}switch(a){case w.LIVE:case w.LL_LIVE:switch(t){case N.LG:return or(e);case N.SM:return nr(e);case N.XS:return rr(e)}case w.DVR:case w.LL_DVR:switch(t){case N.LG:return dr(e);case N.SM:return lr(e);case N.XS:return sr(e)}case w.ON_DEMAND:default:switch(t){case N.LG:return ir(e);case N.SM:return ar(e);case N.XS:return bt(e)}}},L=e=>l`
334
335
  <media-play-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
335
- ${xa()}
336
- ${Ea()}
336
+ ${_a()}
337
+ ${Ra()}
337
338
  </media-play-button>`,oe=({backwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
338
339
  <media-seek-backward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
339
- ${wa({value:e})}
340
+ ${Na({value:e})}
340
341
  </media-seek-backward-button>`,se=({forwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>l`
341
342
  <media-seek-forward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
342
- ${La({value:e})}
343
+ ${Va({value:e})}
343
344
  </media-seek-forward-button>`,C=({isDialogOpen:e})=>l`
344
345
  <media-mute-button disabled="${e}" aria-disabled="${e&&"true"}">
346
+ ${Ha()}
347
+ ${Ka()}
348
+ ${Ba()}
349
+ ${Ua()}
350
+ </media-mute-button>`,J=({defaultHiddenCaptions:e,isDialogOpen:a})=>l`
351
+ <media-captions-button default-showing="${!e}" disabled="${a}" aria-disabled="${a&&"true"}">
345
352
  ${$a()}
346
- ${Oa()}
347
353
  ${Sa()}
348
- ${Ca()}
349
- </media-mute-button>`,X=({defaultHiddenCaptions:e,isDialogOpen:a})=>l`
350
- <media-captions-button default-showing="${!e}" disabled="${a}" aria-disabled="${a&&"true"}">
351
- ${pa()}
352
- ${ga()}
353
354
  </media-captions-button>`,M=e=>l`
354
355
  <media-airplay-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
355
- ${ba()}
356
- </media-airplay-button>`,J=e=>l`
356
+ ${La()}
357
+ </media-airplay-button>`,Q=e=>l`
357
358
  <media-pip-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
358
- ${Ta()}
359
- ${Aa()}
360
- </media-pip-button>`,Q=e=>l`
359
+ ${Ia()}
360
+ ${Da()}
361
+ </media-pip-button>`,ee=e=>l`
361
362
  <media-fullscreen-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
362
- ${ya()}
363
- ${ka()}
363
+ ${Ma()}
364
+ ${Pa()}
364
365
  </media-fullscreen-button>`,P=e=>l`
365
366
  <media-cast-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
366
- ${fa()}
367
- ${va()}
367
+ ${Oa()}
368
+ ${Ca()}
368
369
  </media-cast-button>`,Be=({playbackRates:e,isDialogOpen:a})=>l`
369
370
  <media-playback-rate-button rates="${e!=null?e:!1}" disabled="${a}" aria-disabled="${a&&"true"}">
370
371
  </media-playback-rate-button>`,V=({isDialogOpen:e})=>l`
@@ -374,7 +375,7 @@ media-time-display {
374
375
  </media-time-range>`,Ke=({defaultShowRemainingTime:e,hasSrc:a,isDialogOpen:t})=>l`
375
376
  <mxp-time-display remaining="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
376
377
  </mxp-time-display>`,H=({title:e})=>l`
377
- <media-text-display part="title" class="title-display">${e}</media-text-display>`,Ki=e=>l`
378
+ <media-text-display part="title" class="title-display">${e}</media-text-display>`,Qi=e=>l`
378
379
  ${e.title?`<media-control-bar>${H(e)}</media-control-bar>`:l``}
379
380
  <media-control-bar>
380
381
  ${L(e)}
@@ -388,7 +389,7 @@ media-time-display {
388
389
  ${M(e)}
389
390
  ${P(e)}
390
391
  </media-control-bar>
391
- `,Ui=e=>l`
392
+ `,er=e=>l`
392
393
  ${e.title?`<media-control-bar>${H(e)}</media-control-bar>`:l``}
393
394
  <media-control-bar>
394
395
  ${L(e)}
@@ -403,7 +404,7 @@ media-time-display {
403
404
  ${M(e)}
404
405
  ${P(e)}
405
406
  </media-control-bar>
406
- `,Fi=e=>l`
407
+ `,tr=e=>l`
407
408
  ${e.title?`<media-control-bar>${H(e)}</media-control-bar>`:l``}
408
409
  <media-control-bar>
409
410
  ${L(e)}
@@ -413,13 +414,13 @@ media-time-display {
413
414
  ${M(e)}
414
415
  ${P(e)}
415
416
  </media-control-bar>
416
- `,pt=e=>l`
417
+ `,bt=e=>l`
417
418
  <media-control-bar slot="top-chrome">
418
- ${X(e)}
419
+ ${J(e)}
419
420
  <div class="spacer"></div>
420
421
  ${M(e)}
421
422
  ${P(e)}
422
- ${J(e)}
423
+ ${Q(e)}
423
424
  </media-control-bar>
424
425
  <div slot="centered-chrome" class="center-controls">
425
426
  ${L(e)}
@@ -427,16 +428,16 @@ media-time-display {
427
428
  <media-control-bar>
428
429
  ${C(e)}
429
430
  <div class="spacer"></div>
430
- ${Q(e)}
431
+ ${ee(e)}
431
432
  </media-control-bar>
432
- `,Yi=e=>l`
433
+ `,ar=e=>l`
433
434
  <media-control-bar slot="top-chrome">
434
435
  ${e.title?H(e):l``}
435
436
  <div class="spacer"></div>
436
- ${X(e)}
437
+ ${J(e)}
437
438
  ${M(e)}
438
439
  ${P(e)}
439
- ${J(e)}
440
+ ${Q(e)}
440
441
  </media-control-bar>
441
442
  <div slot="centered-chrome" class="center-controls">
442
443
  ${oe(e)}
@@ -450,10 +451,10 @@ media-time-display {
450
451
  ${V(e)}
451
452
  <div class="spacer"></div>
452
453
  ${Be(e)}
453
- ${Q(e)}
454
+ ${ee(e)}
454
455
  <div class="padding-2"></div>
455
456
  </media-control-bar>
456
- `,Zi=e=>l`
457
+ `,ir=e=>l`
457
458
  <media-control-bar slot="top-chrome">
458
459
  ${e.title?H(e):l``}
459
460
  </media-control-bar>
@@ -470,21 +471,21 @@ media-time-display {
470
471
  ${V(e)}
471
472
  <div class="spacer"></div>
472
473
  ${Be(e)}
473
- ${X(e)}
474
+ ${J(e)}
474
475
  ${M(e)}
475
476
  ${P(e)}
476
- ${J(e)}
477
477
  ${Q(e)}
478
+ ${ee(e)}
478
479
  <div class="padding-2"></div>
479
480
  </media-control-bar>
480
- `,Wi=pt,zi=e=>l`
481
+ `,rr=bt,nr=e=>l`
481
482
  <media-control-bar slot="top-chrome">
482
483
  ${e.title?H(e):l``}
483
484
  <div class="spacer"></div>
484
- ${X(e)}
485
+ ${J(e)}
485
486
  ${M(e)}
486
487
  ${P(e)}
487
- ${J(e)}
488
+ ${Q(e)}
488
489
  </media-control-bar>
489
490
  <div slot="centered-chrome" class="center-controls">
490
491
  ${L(e)}
@@ -494,9 +495,9 @@ media-time-display {
494
495
  ${V(e)}
495
496
  <slot name="seek-live"></slot>
496
497
  <div class="spacer"></div>
497
- ${Q(e)}
498
+ ${ee(e)}
498
499
  </media-control-bar>
499
- `,qi=e=>l`
500
+ `,or=e=>l`
500
501
  <media-control-bar slot="top-chrome">
501
502
  ${e.title?H(e):l``}
502
503
  </media-control-bar>
@@ -508,20 +509,20 @@ media-time-display {
508
509
  ${V(e)}
509
510
  <slot name="seek-live"></slot>
510
511
  <div class="spacer"></div>
511
- ${X(e)}
512
+ ${J(e)}
512
513
  ${M(e)}
513
514
  ${P(e)}
514
- ${J(e)}
515
515
  ${Q(e)}
516
+ ${ee(e)}
516
517
  </media-control-bar>
517
- `,ji=pt,Gi=e=>l`
518
+ `,sr=bt,lr=e=>l`
518
519
  <media-control-bar slot="top-chrome">
519
520
  ${e.title?H(e):l``}
520
521
  <div class="spacer"></div>
521
- ${X(e)}
522
+ ${J(e)}
522
523
  ${M(e)}
523
524
  ${P(e)}
524
- ${J(e)}
525
+ ${Q(e)}
525
526
  </media-control-bar>
526
527
  <div slot="centered-chrome" class="center-controls">
527
528
  ${oe(e)}
@@ -534,10 +535,10 @@ media-time-display {
534
535
  ${V(e)}
535
536
  <slot name="seek-live"></slot>
536
537
  <div class="spacer"></div>
537
- ${Q(e)}
538
+ ${ee(e)}
538
539
  <div class="padding-2"></div>
539
540
  </media-control-bar>
540
- `,Xi=e=>l`
541
+ `,dr=e=>l`
541
542
  <media-control-bar slot="top-chrome">
542
543
  ${e.title?H(e):l``}
543
544
  </media-control-bar>
@@ -553,14 +554,14 @@ media-time-display {
553
554
  ${V(e)}
554
555
  <slot name="seek-live"></slot>
555
556
  <div class="spacer"></div>
556
- ${X(e)}
557
+ ${J(e)}
557
558
  ${M(e)}
558
559
  ${P(e)}
559
- ${J(e)}
560
560
  ${Q(e)}
561
+ ${ee(e)}
561
562
  <div class="padding-2"></div>
562
563
  </media-control-bar>
563
- `;var Ra=`
564
+ `;var Za=`
564
565
  :host {
565
566
  z-index: 100;
566
567
  display: flex;
@@ -618,17 +619,17 @@ media-time-display {
618
619
  text-align: center;
619
620
  line-height: 1.4;
620
621
  }
621
- `,Ia=S.createElement("template");Ia.innerHTML=`
622
+ `,Wa=S.createElement("template");Wa.innerHTML=`
622
623
  <style>
623
- ${Ra}
624
+ ${Za}
624
625
  </style>
625
626
 
626
627
  <div class="dialog">
627
628
  <slot></slot>
628
629
  </div>
629
- `;var F=class extends g.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Pa(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Ji(this))}attributeChangedCallback(t,r,i){t==="open"&&r!==i&&(i!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Pa(this)}};F.styles=Ra,F.template=Ia,F.observedAttributes=["open"];function Pa(e){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(e.dispatchEvent(a),a.defaultPrevented)return;let t=e.querySelector("[autofocus]:not([disabled])");!t&&e.tabIndex>=0&&(t=e),t||(t=Da(e.shadowRoot)),e._previouslyFocusedElement=S.activeElement,S.activeElement instanceof HTMLElement&&S.activeElement.blur(),e.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Da(e){let t=["button","input","keygen","select","textarea"].map(function(i){return i+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let r=e==null?void 0:e.querySelector(t.join(", "));if(!r&&"attachShadow"in Element.prototype){let i=(e==null?void 0:e.querySelectorAll("*"))||[];for(let n=0;n<i.length&&!(i[n].tagName&&i[n].shadowRoot&&(r=Da(i[n].shadowRoot),r));n++);}return r}function Ji(e){e._previouslyFocusedElement instanceof HTMLElement&&e._previouslyFocusedElement.focus()}g.customElements.get("media-dialog")||(g.customElements.define("media-dialog",F),g.MediaDialog=F);var gt=F;var _a=S.createElement("template");_a.innerHTML=`
630
+ `;var Y=class extends g.HTMLElement{constructor(){var t;super();this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Ya(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),mr(this))}attributeChangedCallback(t,r,i){t==="open"&&r!==i&&(i!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Ya(this)}};Y.styles=Za,Y.template=Wa,Y.observedAttributes=["open"];function Ya(e){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(e.dispatchEvent(a),a.defaultPrevented)return;let t=e.querySelector("[autofocus]:not([disabled])");!t&&e.tabIndex>=0&&(t=e),t||(t=za(e.shadowRoot)),e._previouslyFocusedElement=S.activeElement,S.activeElement instanceof HTMLElement&&S.activeElement.blur(),e.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function za(e){let t=["button","input","keygen","select","textarea"].map(function(i){return i+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let r=e==null?void 0:e.querySelector(t.join(", "));if(!r&&"attachShadow"in Element.prototype){let i=(e==null?void 0:e.querySelectorAll("*"))||[];for(let n=0;n<i.length&&!(i[n].tagName&&i[n].shadowRoot&&(r=za(i[n].shadowRoot),r));n++);}return r}function mr(e){e._previouslyFocusedElement instanceof HTMLElement&&e._previouslyFocusedElement.focus()}g.customElements.get("media-dialog")||(g.customElements.define("media-dialog",Y),g.MediaDialog=Y);var pt=Y;var qa=S.createElement("template");qa.innerHTML=`
630
631
  <style>
631
- ${gt.styles}
632
+ ${pt.styles}
632
633
 
633
634
  .close {
634
635
  background: none;
@@ -657,7 +658,7 @@ media-time-display {
657
658
  </svg>
658
659
  </button>
659
660
  </slot>
660
- `;var Ae=class extends gt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Ae.template=_a;g.customElements.get("mxp-dialog")||(g.customElements.define("mxp-dialog",Ae),g.MxpDialog=Ae);var Na=`:host {
661
+ `;var xe=class extends pt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};xe.template=qa;g.customElements.get("mxp-dialog")||(g.customElements.define("mxp-dialog",xe),g.MxpDialog=xe);var ja=`:host {
661
662
  display: inline-block;
662
663
  width: 100%;
663
664
  }
@@ -808,93 +809,92 @@ a {
808
809
  ::part(title display) {
809
810
  display: var(--media-controls, var(--media-title-display));
810
811
  }
811
- `;import{StreamTypes as de}from"@mux/playback-core";var Ba=e=>l`
812
+ `;import{StreamTypes as de}from"@mux/playback-core";var Ja=e=>l`
812
813
  <style>
813
- ${Na}
814
+ ${ja}
814
815
  </style>
815
- ${er(e)}
816
- `,Va=e=>[de.LIVE,de.LL_LIVE].includes(e.streamType),Ha=e=>[de.LIVE,de.LL_LIVE,de.DVR,de.LL_DVR].includes(e.streamType),er=e=>{var a,t,r,i,n,o,m,p,f,k,$,U,E,I,D,_,T,Oe,pe,te,kt,Et,Tt,At,xt,wt,Lt,$t;return l`
817
- <${bt((a=lt(e.theme))!=null?a:"media-theme-mux")}
818
- has-src="${e.hasSrc}"
819
- has-open-dialog="${e.isDialogOpen}"
820
- nohotkeys="${(t=e.noHotKeys)!=null?t:!1}"
821
- audio="${e.audio||!1}"
822
- style="${(r=Pt({"--primary-color":e.primaryColor,"--secondary-color":e.secondaryColor}))!=null?r:!1}"
816
+ ${ur(e)}
817
+ `,Ga=e=>[de.LIVE,de.LL_LIVE].includes(e.streamType),Xa=e=>[de.LIVE,de.LL_LIVE,de.DVR,de.LL_DVR].includes(e.streamType),ur=e=>{var a,t,r,i,n,o,m,b,f,v,$,F,k,I,D,_,E,Oe,pe,ae,yt,kt,Et,Tt,At,xt,wt,Lt,$t,St,Ot,Ct,Mt,Pt,Rt,It,Dt,_t,Nt,Vt;return l`
818
+ <${ht((a=st(e.theme))!=null?a:"media-theme-mux")}
819
+ has-src="${(t=e.hasSrc)!=null?t:!1}"
820
+ has-open-dialog="${(r=e.isDialogOpen)!=null?r:!1}"
821
+ nohotkeys="${(i=e.noHotKeys)!=null?i:!1}"
822
+ audio="${(n=e.audio)!=null?n:!1}"
823
+ style="${(o=Ft({"--primary-color":e.primaryColor,"--secondary-color":e.secondaryColor}))!=null?o:!1}"
823
824
  class="size-${e.playerSize}${e.secondaryColor?" two-tone":""}"
824
- stream-type="${e.streamType}"
825
- player-size="${e.playerSize}"
826
- default-hidden-captions="${e.defaultHiddenCaptions}"
827
- forward-seek-offset="${e.forwardSeekOffset}"
828
- backward-seek-offset="${e.backwardSeekOffset}"
829
- playbackrates="${(i=e.playbackRates)!=null?i:!1}"
830
- default-show-remaining-time="${(n=e.defaultShowRemainingTime)!=null?n:!1}"
831
- title="${(o=e.title)!=null?o:!1}"
832
- hotkeys="${e.hotKeys||!1}"
833
- poster="${e.poster?e.poster:e.playbackId&&!e.audio?st(e.playbackId,{domain:e.customDomain,thumbnailTime:(m=e.thumbnailTime)!=null?m:e.startTime,token:e.tokens.thumbnail}):!1}"
834
- placeholder="${e.placeholder}"
835
- exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
825
+ stream-type="${(m=e.streamType)!=null?m:!1}"
826
+ player-size="${(b=e.playerSize)!=null?b:!1}"
827
+ default-hidden-captions="${(f=e.defaultHiddenCaptions)!=null?f:!1}"
828
+ forward-seek-offset="${(v=e.forwardSeekOffset)!=null?v:!1}"
829
+ backward-seek-offset="${($=e.backwardSeekOffset)!=null?$:!1}"
830
+ playbackrates="${(F=e.playbackRates)!=null?F:!1}"
831
+ default-show-remaining-time="${(k=e.defaultShowRemainingTime)!=null?k:!1}"
832
+ title="${(I=e.title)!=null?I:!1}"
833
+ hotkeys="${(D=e.hotKeys)!=null?D:!1}"
834
+ poster="${e.poster===""?!1:(_=e.poster)!=null?_:!1}"
835
+ placeholder="${(E=e.placeholder)!=null?E:!1}"
836
+ exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, seek-live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
836
837
  >
837
838
  <mux-video
838
839
  slot="media"
839
- crossorigin="${(p=e.crossOrigin)!=null?p:""}"
840
+ crossorigin="${(Oe=e.crossOrigin)!=null?Oe:""}"
840
841
  playsinline
841
- autoplay="${(f=e.autoplay)!=null?f:!1}"
842
- muted="${(k=e.muted)!=null?k:!1}"
843
- loop="${($=e.loop)!=null?$:!1}"
844
- preload="${(U=e.preload)!=null?U:!1}"
845
- debug="${(E=e.debug)!=null?E:!1}"
846
- prefer-playback="${(I=e.preferPlayback)!=null?I:!1}"
842
+ autoplay="${(pe=e.autoplay)!=null?pe:!1}"
843
+ muted="${(ae=e.muted)!=null?ae:!1}"
844
+ loop="${(yt=e.loop)!=null?yt:!1}"
845
+ preload="${(kt=e.preload)!=null?kt:!1}"
846
+ debug="${(Et=e.debug)!=null?Et:!1}"
847
+ prefer-playback="${(Tt=e.preferPlayback)!=null?Tt:!1}"
847
848
  start-time="${e.startTime!=null?e.startTime:!1}"
848
- metadata-video-id="${(D=e.metadataVideoId)!=null?D:!1}"
849
- metadata-video-title="${(_=e.metadataVideoTitle)!=null?_:!1}"
850
- metadata-viewer-user-id="${(T=e.metadataViewerUserId)!=null?T:!1}"
851
- beacon-collection-domain="${(Oe=e.beaconCollectionDomain)!=null?Oe:!1}"
852
- player-software-name="${e.playerSoftwareName}"
853
- player-software-version="${e.playerSoftwareVersion}"
854
- env-key="${(pe=e.envKey)!=null?pe:!1}"
855
- stream-type="${(te=e.streamType)!=null?te:!1}"
856
- custom-domain="${(kt=e.customDomain)!=null?kt:!1}"
849
+ metadata-video-id="${(At=e.metadataVideoId)!=null?At:!1}"
850
+ metadata-video-title="${(xt=e.metadataVideoTitle)!=null?xt:!1}"
851
+ metadata-viewer-user-id="${(wt=e.metadataViewerUserId)!=null?wt:!1}"
852
+ beacon-collection-domain="${(Lt=e.beaconCollectionDomain)!=null?Lt:!1}"
853
+ player-software-name="${($t=e.playerSoftwareName)!=null?$t:!1}"
854
+ player-software-version="${(St=e.playerSoftwareVersion)!=null?St:!1}"
855
+ env-key="${(Ot=e.envKey)!=null?Ot:!1}"
856
+ stream-type="${(Ct=e.streamType)!=null?Ct:!1}"
857
+ custom-domain="${(Mt=e.customDomain)!=null?Mt:!1}"
857
858
  src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
858
- poster="${e.poster?e.poster:e.playbackId&&!e.audio?st(e.playbackId,{domain:e.customDomain,thumbnailTime:(Et=e.thumbnailTime)!=null?Et:e.startTime,token:e.tokens.thumbnail}):!1}"
859
859
  cast-src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
860
- cast-stream-type="${Va(e)?"live":!1}"
860
+ cast-stream-type="${Ga(e)?"live":!1}"
861
861
  exportparts="video"
862
862
  >
863
- ${e.playbackId&&!e.audio&&!Ha(e)?l`<track
863
+ ${e.playbackId&&!e.audio&&!Xa(e)?l`<track
864
864
  label="thumbnails"
865
865
  default
866
866
  kind="metadata"
867
- src="${_t(e.playbackId,{domain:e.customDomain,token:e.tokens.storyboard})}"
867
+ src="${qt(e.playbackId,{domain:e.customDomain,token:e.tokens.storyboard})}"
868
868
  />`:l``}
869
869
  </mux-video>
870
- ${Ha(e)?l`<button
870
+ ${Xa(e)?l`<button
871
871
  slot="seek-live"
872
- part="${Va(e)?"top":"bottom"} seek-live button"
872
+ part="${Ga(e)?"top":"bottom"} seek-live button"
873
873
  disabled="${e.inLiveWindow||!e.hasSrc||e.isDialogOpen}"
874
874
  aria-disabled="${(e.inLiveWindow||!e.hasSrc||e.isDialogOpen)&&"true"}"
875
875
  in-live-window="${e.inLiveWindow}"
876
- onclick="${function(qa){var St;if((St=e.onSeekToLive)==null||St.call(e,qa),e.paused){let ja=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(ja)}}}"
876
+ onclick="${function(oi){var Ht;if((Ht=e.onSeekToLive)==null||Ht.call(e,oi),e.paused){let si=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(si)}}}"
877
877
  >
878
878
  Live
879
879
  </button>`:l``}
880
880
  <mxp-dialog
881
881
  no-auto-hide
882
- open="${e.isDialogOpen}"
882
+ open="${(Pt=e.isDialogOpen)!=null?Pt:!1}"
883
883
  onclose="${e.onCloseErrorDialog}"
884
884
  oninitfocus="${e.onInitFocusDialog}"
885
885
  >
886
- ${(Tt=e.dialog)!=null&&Tt.title?l`<h3>${e.dialog.title}</h3>`:l``}
886
+ ${(Rt=e.dialog)!=null&&Rt.title?l`<h3>${e.dialog.title}</h3>`:l``}
887
887
  <p>
888
- ${(At=e.dialog)==null?void 0:At.message}
889
- ${(xt=e.dialog)!=null&&xt.linkUrl?l`<a
888
+ ${(It=e.dialog)==null?void 0:It.message}
889
+ ${(Dt=e.dialog)!=null&&Dt.linkUrl?l`<a
890
890
  href="${e.dialog.linkUrl}"
891
891
  target="_blank"
892
892
  rel="external noopener"
893
- aria-label="${(wt=e.dialog.linkText)!=null?wt:""} ${c("(opens in a new window)")}"
894
- >${(Lt=e.dialog.linkText)!=null?Lt:e.dialog.linkUrl}</a
893
+ aria-label="${(_t=e.dialog.linkText)!=null?_t:""} ${c("(opens in a new window)")}"
894
+ >${(Nt=e.dialog.linkText)!=null?Nt:e.dialog.linkUrl}</a
895
895
  >`:l``}
896
896
  </p>
897
897
  </mxp-dialog>
898
- </${bt(($t=lt(e.theme))!=null?$t:"media-theme-mux")}>
899
- `};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,r,i){var m,p,f;let n={},o={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(n.title=c("Network Error",i),n.message=e.message,(m=e.data)==null?void 0:m.response.code){case 412:{n.title=c("Video is not currently available",i),n.message=c("The live stream or video file are not yet ready.",i),o.message=c("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",i),o.file="412-not-playable.md";break}case 404:{n.title=c("Video does not exist",i),n.message="",o.message=c("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",i),o.file="404-not-found.md";break}case 403:{if(n.title=c("Invalid playback URL",i),n.message=c("The video URL or playback-token are formatted with incorrect or incomplete information.",i),o.message=c("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",i),o.file="missing-signed-tokens.md",!r)break;let{exp:k,aud:$,sub:U}=ve(r),E=Date.now()>k*1e3,I=U!==t,D=$!=="v",_={timeStyle:"medium",dateStyle:"medium"};if(E){n.title=c("Video URL has expired",i),n.message=c("The video\u2019s secured playback-token has expired.",i),o.message=c("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",i).format({expiredDate:new Intl.DateTimeFormat(Z.code,_).format(k*1e3),currentDate:new Intl.DateTimeFormat(Z.code,_).format(Date.now())}),o.file="403-expired-token.md";break}if(I){n.title=c("Video URL is formatted incorrectly",i),n.message=c("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),o.message=c("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",i).format({playbackId:t,tokenPlaybackId:U}),o.file="403-playback-id-mismatch.md";break}if(D){n.title=c("Video URL is formatted incorrectly",i),n.message=c("The playback-token is formatted with incorrect information.",i),o.message=c("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",i).format({tokenType:$}),o.file="403-incorrect-aud-value.md";break}o.message=c("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",i),o.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:k}=e;n={title:c("Media Error",i),message:k},o.file="media-decode-error.md";break}case Ue.MEDIA_ERR_SRC_NOT_SUPPORTED:{let k=(f=(p=e.data)==null?void 0:p.response)==null?void 0:f.code;if(k>=400&&k<500){e.code=Ue.MEDIA_ERR_NETWORK,e.data={response:{code:k}},{dialog:n,devlog:o}=Fe(e,a,t,r);break}n={title:c("Source Not Supported",i),message:e.message},o.file="media-src-not-supported.md";break}default:n={title:c("Error",i),message:e.message};break}return a&&(n={title:c("Your device appears to be offline",i),message:c("Check your internet connection and try reloading this video.",i)}),{dialog:n,devlog:o}}var nr=Object.values(B),or=700,sr=300,vt={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<sr?vt.XS:a.width<or?vt.SM:vt.LG}var xe={SRC:"src"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-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",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function lr(e,a){var t,r;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.getAttribute("poster"),placeholder:e.getAttribute("placeholder"),theme:e.getAttribute("theme"),thumbnailTime:!e.tokens.thumbnail&&e.thumbnailTime,autoplay:e.autoplay,crossOrigin:e.crossOrigin,loop:e.loop,noHotKeys:e.hasAttribute(s.NOHOTKEYS),hotKeys:e.getAttribute(s.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,debug:e.debug,tokens:e.tokens,beaconCollectionDomain:e.beaconCollectionDomain,metadata:e.metadata,playerSoftwareName:e.playerSoftwareName,playerSoftwareVersion:e.playerSoftwareVersion,startTime:e.startTime,preferPlayback:e.preferPlayback,audio:e.audio,streamType:e.streamType,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,forwardSeekOffset:e.forwardSeekOffset,backwardSeekOffset:e.backwardSeekOffset,defaultHiddenCaptions:e.defaultHiddenCaptions,defaultShowRemainingTime:e.defaultShowRemainingTime,playbackRates:e.getAttribute(s.PLAYBACK_RATES),customDomain:(t=e.getAttribute(u.CUSTOM_DOMAIN))!=null?t:void 0,playerSize:Ze((r=e.mediaController)!=null?r:e),metadataVideoId:e.getAttribute(u.METADATA_VIDEO_ID),metadataVideoTitle:e.getAttribute(u.METADATA_VIDEO_TITLE),metadataViewerUserId:e.getAttribute(u.METADATA_VIEWER_USER_ID),title:e.getAttribute(s.TITLE),...a}}var dr=Object.values(u),mr=Object.values(s),cr=Re(),ur="mux-player",Ka={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},ee,Le,K,$e,ue,R,he,We,Y,ce,be,ze,Se,yt,qe,Ua,je,Fa,Ge,Ya,Xe,Za,Je,Wa,Qe,za,we=class extends ct{constructor(){super();h(this,he);h(this,Y);h(this,be);h(this,Se);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,ee,!1);h(this,Le,{});h(this,K,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,ue,void 0);h(this,R,{...Ka,onCloseErrorDialog:()=>b(this,Y,ce).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,S.activeElement)||t.preventDefault()},onSeekToLive:()=>dt(this)});this.attachShadow({mode:"open"}),this.isConnected&&b(this,he,We).call(this)}static get observedAttributes(){var t;return[...(t=ct.observedAttributes)!=null?t:[],...dr,...mr]}get theme(){var t,r;return Array.from((r=(t=this.shadowRoot)==null?void 0:t.children)!=null?r:[]).find(({localName:i})=>i.startsWith("media-theme-"))}get mediaController(){var t,r;return(r=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:r.querySelector("media-controller")}connectedCallback(){b(this,Se,yt).call(this),b(this,qe,Ua).call(this)}disconnectedCallback(){b(this,je,Fa).call(this)}attributeChangedCallback(t,r,i){switch(d(this,ee)||b(this,he,We).call(this),super.attributeChangedCallback(t,r,i),t){case s.HOTKEYS:d(this,$e).value=i;break;case s.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&j(c("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:o}=ve(i);i&&o!=="t"&&j(c("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case s.STORYBOARD_TOKEN:{let{aud:o}=ve(i);i&&o!=="s"&&j(c("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case u.PLAYBACK_ID:{i!=null&&i.includes("?token")&&O(c("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i})),this.streamType?this.streamType!=null&&!nr.includes(this.streamType)&&Ie({file:"invalid-stream-type.md",message:c("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):Ie({file:"invalid-stream-type.md",message:String(c("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[u.PLAYBACK_ID,xe.SRC,s.PLAYBACK_TOKEN].includes(t)&&r!==i&&A(this,R,{...d(this,R),...Ka}),b(this,be,ze).call(this,{[Nt(t)]:i})}get hasPlayed(){var t,r;return(r=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?r:!1}get inLiveWindow(){return d(this,R).inLiveWindow}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get audio(){return this.hasAttribute(s.AUDIO)}set audio(t){if(!t){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return W(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(s.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(s.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(s.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=me(this,s.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(s.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(s.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(s.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(s.SECONDARY_COLOR))!=null?t:void 0}set secondaryColor(t){this.setAttribute(s.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,r)=>t-r)}set playbackRates(t){if(!t){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=W(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=W(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_NAME))!=null?t:ur}get playerSoftwareVersion(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_VERSION))!=null?t:cr}get beaconCollectionDomain(){var t;return(t=this.getAttribute(u.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(u.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(u.BEACON_COLLECTION_DOMAIN))}get playbackId(){var t;return(t=this.getAttribute(u.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(u.PLAYBACK_ID,t):this.removeAttribute(u.PLAYBACK_ID)}get src(){var t,r;return this.playbackId?(t=me(this,xe.SRC))!=null?t:void 0:(r=this.getAttribute(xe.SRC))!=null?r:void 0}set src(t){t?this.setAttribute(xe.SRC,t):this.removeAttribute(xe.SRC)}get customDomain(){var t;return(t=this.getAttribute(u.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(u.CUSTOM_DOMAIN,t):this.removeAttribute(u.CUSTOM_DOMAIN))}get envKey(){var t;return(t=me(this,u.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(u.ENV_KEY,`${t}`)}get debug(){return me(this,u.DEBUG)!=null}set debug(t){t?this.setAttribute(u.DEBUG,""):this.removeAttribute(u.DEBUG)}get streamType(){return me(this,u.STREAM_TYPE)}set streamType(t){this.setAttribute(u.STREAM_TYPE,`${t}`)}get startTime(){return W(me(this,u.START_TIME))}set startTime(t){this.setAttribute(u.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(u.PREFER_PLAYBACK);if(t===Ye.MSE||t===Ye.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===Ye.MSE||t===Ye.NATIVE?this.setAttribute(u.PREFER_PLAYBACK,t):this.removeAttribute(u.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(d(this,ee)||b(this,he,We).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=t}get tokens(){let t=this.getAttribute(s.PLAYBACK_TOKEN),r=this.getAttribute(s.THUMBNAIL_TOKEN),i=this.getAttribute(s.STORYBOARD_TOKEN);return{...d(this,Le),...t!=null?{playback:t}:{},...r!=null?{thumbnail:r}:{},...i!=null?{storyboard:i}:{}}}set tokens(t){A(this,Le,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(s.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(s.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(s.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(s.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(s.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,r,i,n){var m;let o=(m=this.media)==null?void 0:m.nativeEl;if(!!o)return ir(o,t,r,i,n)}removeTextTrack(t){var i;let r=(i=this.media)==null?void 0:i.nativeEl;if(!!r)return rr(r,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ee=new WeakMap,Le=new WeakMap,K=new WeakMap,$e=new WeakMap,ue=new WeakMap,R=new WeakMap,he=new WeakSet,We=function(){var t,r,i;if(!d(this,ee)){A(this,ee,!0),b(this,Y,ce).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{O(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof ar))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof tr))throw""}catch{O("<media-controller> failed to upgrade!")}Ut(this),b(this,Xe,Za).call(this),b(this,Je,Wa).call(this),b(this,Ge,Ya).call(this),A(this,K,(i=(r=this.mediaController)==null?void 0:r.hasAttribute("user-inactive"))!=null?i:!0),b(this,Qe,za).call(this)}},Y=new WeakSet,ce=function(t){Object.assign(d(this,R),t),b(this,be,ze).call(this)},be=new WeakSet,ze=function(t={}){_e(Ba(lr(this,{...d(this,R),...t})),this.shadowRoot)},Se=new WeakSet,yt=function(){var t,r;d(this,R).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&b(this,Y,ce).call(this,{playerSize:Ze((r=this.mediaController)!=null?r:this)})},qe=new WeakSet,Ua=function(){var t;A(this,ue,new ResizeObserver(()=>b(this,Se,yt).call(this))),d(this,ue).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,Fa=function(){var t;(t=d(this,ue))==null||t.disconnect()},Ge=new WeakSet,Ya=function(){var r,i,n,o,m;(r=this.mediaController)==null||r.addEventListener("mediaplayrequest",p=>{var f;((f=p.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[B.LIVE,B.LL_LIVE,B.DVR,B.LL_DVR].includes(this.streamType)&&this.hasPlayed&&dt(this)});let t=()=>{let p=Ht(this),f=d(this,R).inLiveWindow;p!==f&&(b(this,Y,ce).call(this,{inLiveWindow:p}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(i=this.media)==null||i.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(o=this.media)==null||o.addEventListener("timeupdate",t),(m=this.media)==null||m.addEventListener("emptied",t)},Xe=new WeakSet,Za=function(){var r;let t=i=>{let{detail:n}=i;if(n instanceof ft||(n=new ft(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){j(n),n.data&&j(`${n.name} data:`,n.data);return}let{dialog:o,devlog:m}=Fe(n,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Ie(m),O(n),n.data&&O(`${n.name} data:`,n.data),b(this,Y,ce).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(i={})=>{var o,m,p;if(!((o=this.media)!=null&&o.error))return i;let{devlog:n}=Fe((m=this.media)==null?void 0:m.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(p=this.media)==null?void 0:p.error.code,player_error_message:n.message?String(n.message):i.player_error_message}}),(r=this.media)==null||r.addEventListener("error",i=>{var o,m;let{detail:n}=i;if(!n){let{message:p,code:f}=(m=(o=this.media)==null?void 0:o.error)!=null?m:{};n=new ft(p,f)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Je=new WeakSet,Wa=function(){var r,i,n,o;let t=()=>b(this,be,ze).call(this);(i=(r=this.media)==null?void 0:r.textTracks)==null||i.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Qe=new WeakSet,za=function(){var k,$,U;let t=this.mediaController,r=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(r)return;let i,n=new WeakMap,o=()=>this.streamType&&[B.LIVE,B.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(E,I,D=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(T=>{if(!(!T.snapToLines||T.line<-5||T.line>=0&&T.line<10))if(!I||this.paused){let Oe=T.text.split(`
900
- `).length,pe=r?-2:-3;this.streamType&&[B.LIVE,B.LL_LIVE].includes(this.streamType)&&(pe=r?-1:-2);let te=pe-Oe;if(T.line===te&&!D)return;n.has(T)||n.set(T,T.line),T.line=te-1,T.line=te}else setTimeout(()=>{T.line=n.get(T)||"auto"},500)})},p=()=>{var E;m(i,(E=t==null?void 0:t.hasAttribute("user-inactive"))!=null?E:!1)},f=()=>{var D;let I=Array.from(((D=t==null?void 0:t.media)==null?void 0:D.textTracks)||[]).filter(_=>["subtitles","captions"].includes(_.kind)&&_.mode==="showing")[0];I!==i&&(i==null||i.removeEventListener("cuechange",p)),i=I,i==null||i.addEventListener("cuechange",p),m(i,d(this,K))};if(f(),(k=t==null?void 0:t.media)==null||k.textTracks.addEventListener("change",f),($=t==null?void 0:t.media)==null||$.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let E=()=>{m(i,d(this,K),!0),this.paused||window.requestAnimationFrame(E)};(U=t==null?void 0:t.media)==null||U.addEventListener("playing",()=>{E()})}t==null||t.addEventListener("userinactivechange",()=>{let E=t==null?void 0:t.hasAttribute("user-inactive");d(this,K)!==E&&(A(this,K,E),m(i,d(this,K)))})};function me(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}g.customElements.get("mux-player")||(g.customElements.define("mux-player",we),g.MuxPlayerElement=we);var Jn=we;export{ft as MediaError,Jn as default,me as getVideoAttribute};
898
+ </${ht((Vt=st(e.theme))!=null?Vt:"media-theme-mux")}>
899
+ `};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,r,i){var m,b,f;let n={},o={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(n.title=c("Network Error",i),n.message=e.message,(m=e.data)==null?void 0:m.response.code){case 412:{n.title=c("Video is not currently available",i),n.message=c("The live stream or video file are not yet ready.",i),o.message=c("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",i),o.file="412-not-playable.md";break}case 404:{n.title=c("Video does not exist",i),n.message="",o.message=c("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",i),o.file="404-not-found.md";break}case 403:{if(n.title=c("Invalid playback URL",i),n.message=c("The video URL or playback-token are formatted with incorrect or incomplete information.",i),o.message=c("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",i),o.file="missing-signed-tokens.md",!r)break;let{exp:v,aud:$,sub:F}=ve(r),k=Date.now()>v*1e3,I=F!==t,D=$!=="v",_={timeStyle:"medium",dateStyle:"medium"};if(k){n.title=c("Video URL has expired",i),n.message=c("The video\u2019s secured playback-token has expired.",i),o.message=c("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",i).format({expiredDate:new Intl.DateTimeFormat(W.code,_).format(v*1e3),currentDate:new Intl.DateTimeFormat(W.code,_).format(Date.now())}),o.file="403-expired-token.md";break}if(I){n.title=c("Video URL is formatted incorrectly",i),n.message=c("The video\u2019s playback ID does not match the one encoded in the playback-token.",i),o.message=c("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",i).format({playbackId:t,tokenPlaybackId:F}),o.file="403-playback-id-mismatch.md";break}if(D){n.title=c("Video URL is formatted incorrectly",i),n.message=c("The playback-token is formatted with incorrect information.",i),o.message=c("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",i).format({tokenType:$}),o.file="403-incorrect-aud-value.md";break}o.message=c("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",i),o.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:v}=e;n={title:c("Media Error",i),message:v},o.file="media-decode-error.md";break}case Ue.MEDIA_ERR_SRC_NOT_SUPPORTED:{let v=(f=(b=e.data)==null?void 0:b.response)==null?void 0:f.code;if(v>=400&&v<500){e.code=Ue.MEDIA_ERR_NETWORK,e.data={response:{code:v}},{dialog:n,devlog:o}=Fe(e,a,t,r);break}n={title:c("Source Not Supported",i),message:e.message},o.file="media-src-not-supported.md";break}default:n={title:c("Error",i),message:e.message};break}return a&&(n={title:c("Your device appears to be offline",i),message:c("Check your internet connection and try reloading this video.",i)}),{dialog:n,devlog:o}}var fr=Object.values(B),vr=700,yr=300,ft={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<yr?ft.XS:a.width<vr?ft.SM:ft.LG}var K={SRC:"src",POSTER:"poster"},s={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-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",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder"};function kr(e,a){var t,r;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.poster,placeholder:e.getAttribute("placeholder"),theme:e.getAttribute("theme"),thumbnailTime:!e.tokens.thumbnail&&e.thumbnailTime,autoplay:e.autoplay,crossOrigin:e.crossOrigin,loop:e.loop,noHotKeys:e.hasAttribute(s.NOHOTKEYS),hotKeys:e.getAttribute(s.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,debug:e.debug,tokens:e.tokens,beaconCollectionDomain:e.beaconCollectionDomain,metadata:e.metadata,playerSoftwareName:e.playerSoftwareName,playerSoftwareVersion:e.playerSoftwareVersion,startTime:e.startTime,preferPlayback:e.preferPlayback,audio:e.audio,streamType:e.streamType,primaryColor:e.primaryColor,secondaryColor:e.secondaryColor,forwardSeekOffset:e.forwardSeekOffset,backwardSeekOffset:e.backwardSeekOffset,defaultHiddenCaptions:e.defaultHiddenCaptions,defaultShowRemainingTime:e.defaultShowRemainingTime,playbackRates:e.getAttribute(s.PLAYBACK_RATES),customDomain:(t=e.getAttribute(u.CUSTOM_DOMAIN))!=null?t:void 0,playerSize:Ze((r=e.mediaController)!=null?r:e),metadataVideoId:e.getAttribute(u.METADATA_VIDEO_ID),metadataVideoTitle:e.getAttribute(u.METADATA_VIDEO_TITLE),metadataViewerUserId:e.getAttribute(u.METADATA_VIEWER_USER_ID),title:e.getAttribute(s.TITLE),...a}}var Er=Object.values(u),Tr=Object.values(K),Ar=Object.values(s),xr=Re(),wr="mux-player",Qa={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},te,Le,U,$e,ue,R,he,We,Z,ce,be,ze,Se,vt,qe,ei,je,ti,Ge,ai,Xe,ii,Je,ri,Qe,ni,we=class extends mt{constructor(){super();h(this,he);h(this,Z);h(this,be);h(this,Se);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,te,!1);h(this,Le,{});h(this,U,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,ue,void 0);h(this,R,{...Qa,onCloseErrorDialog:()=>p(this,Z,ce).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,S.activeElement)||t.preventDefault()},onSeekToLive:()=>lt(this)});this.attachShadow({mode:"open"}),this.isConnected&&p(this,he,We).call(this)}static get observedAttributes(){var t;return[...(t=mt.observedAttributes)!=null?t:[],...Tr,...Er,...Ar]}get theme(){var t,r;return Array.from((r=(t=this.shadowRoot)==null?void 0:t.children)!=null?r:[]).find(({localName:i})=>i.startsWith("media-theme-"))}get mediaController(){var t,r;return(r=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:r.querySelector("media-controller")}connectedCallback(){p(this,Se,vt).call(this),p(this,qe,ei).call(this)}disconnectedCallback(){p(this,je,ti).call(this)}attributeChangedCallback(t,r,i){switch(d(this,te)||p(this,he,We).call(this),super.attributeChangedCallback(t,r,i),t){case s.HOTKEYS:d(this,$e).value=i;break;case s.THUMBNAIL_TIME:{i!=null&&this.tokens.thumbnail&&G(c("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:o}=ve(i);i&&o!=="t"&&G(c("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case s.STORYBOARD_TOKEN:{let{aud:o}=ve(i);i&&o!=="s"&&G(c("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case u.PLAYBACK_ID:{i!=null&&i.includes("?token")&&O(c("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:i})),this.streamType?this.streamType!=null&&!fr.includes(this.streamType)&&Ie({file:"invalid-stream-type.md",message:c("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`").format({streamType:this.streamType})}):Ie({file:"invalid-stream-type.md",message:String(c("No stream-type value supplied. Defaulting to `on-demand`. Please provide stream-type as either: `on-demand`, `live`, `ll-live`, `live:dvr`, or `ll-live:dvr`"))});break}}[u.PLAYBACK_ID,K.SRC,s.PLAYBACK_TOKEN].includes(t)&&r!==i&&A(this,R,{...d(this,R),...Qa}),p(this,be,ze).call(this,{[jt(t)]:i})}get hasPlayed(){var t,r;return(r=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?r:!1}get inLiveWindow(){return d(this,R).inLiveWindow}get _hls(){var t;return(t=this.media)==null?void 0:t._hls}get mux(){var t;return(t=this.media)==null?void 0:t.mux}get playbackId(){var t;return(t=this.getAttribute(u.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(u.PLAYBACK_ID,t):this.removeAttribute(u.PLAYBACK_ID)}get src(){var t,r;return this.playbackId?(t=me(this,K.SRC))!=null?t:void 0:(r=this.getAttribute(K.SRC))!=null?r:void 0}set src(t){t?this.setAttribute(K.SRC,t):this.removeAttribute(K.SRC)}get poster(){var r;let t=this.getAttribute(K.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return zt(this.playbackId,{domain:this.customDomain,thumbnailTime:(r=this.thumbnailTime)!=null?r:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(K.POSTER,t):this.removeAttribute(K.POSTER)}get audio(){return this.hasAttribute(s.AUDIO)}set audio(t){if(!t){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return z(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(s.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(s.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(s.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=me(this,s.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(s.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(s.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(s.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(s.SECONDARY_COLOR))!=null?t:void 0}set secondaryColor(t){this.setAttribute(s.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(s.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(s.PLAYBACK_RATES))return this.getAttribute(s.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,r)=>t-r)}set playbackRates(t){if(!t){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=z(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=z(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_NAME))!=null?t:wr}get playerSoftwareVersion(){var t;return(t=this.getAttribute(u.PLAYER_SOFTWARE_VERSION))!=null?t:xr}get beaconCollectionDomain(){var t;return(t=this.getAttribute(u.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(u.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(u.BEACON_COLLECTION_DOMAIN))}get customDomain(){var t;return(t=this.getAttribute(u.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(u.CUSTOM_DOMAIN,t):this.removeAttribute(u.CUSTOM_DOMAIN))}get envKey(){var t;return(t=me(this,u.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(u.ENV_KEY,`${t}`)}get debug(){return me(this,u.DEBUG)!=null}set debug(t){t?this.setAttribute(u.DEBUG,""):this.removeAttribute(u.DEBUG)}get streamType(){return me(this,u.STREAM_TYPE)}set streamType(t){this.setAttribute(u.STREAM_TYPE,`${t}`)}get startTime(){return z(me(this,u.START_TIME))}set startTime(t){this.setAttribute(u.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(u.PREFER_PLAYBACK);if(t===Ye.MSE||t===Ye.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===Ye.MSE||t===Ye.NATIVE?this.setAttribute(u.PREFER_PLAYBACK,t):this.removeAttribute(u.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(d(this,te)||p(this,he,We).call(this),!this.media){O("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata=t}get tokens(){let t=this.getAttribute(s.PLAYBACK_TOKEN),r=this.getAttribute(s.THUMBNAIL_TOKEN),i=this.getAttribute(s.STORYBOARD_TOKEN);return{...d(this,Le),...t!=null?{playback:t}:{},...r!=null?{thumbnail:r}:{},...i!=null?{storyboard:i}:{}}}set tokens(t){A(this,Le,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(s.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(s.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(s.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(s.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(s.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,r,i,n){var m;let o=(m=this.media)==null?void 0:m.nativeEl;if(!!o)return pr(o,t,r,i,n)}removeTextTrack(t){var i;let r=(i=this.media)==null?void 0:i.nativeEl;if(!!r)return gr(r,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};te=new WeakMap,Le=new WeakMap,U=new WeakMap,$e=new WeakMap,ue=new WeakMap,R=new WeakMap,he=new WeakSet,We=function(){var t,r,i;if(!d(this,te)){A(this,te,!0),p(this,Z,ce).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{O(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof br))throw""}catch{O("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof hr))throw""}catch{O("<media-controller> failed to upgrade!")}ea(this),p(this,Xe,ii).call(this),p(this,Je,ri).call(this),p(this,Ge,ai).call(this),A(this,U,(i=(r=this.mediaController)==null?void 0:r.hasAttribute("user-inactive"))!=null?i:!0),p(this,Qe,ni).call(this)}},Z=new WeakSet,ce=function(t){Object.assign(d(this,R),t),p(this,be,ze).call(this)},be=new WeakSet,ze=function(t={}){_e(Ja(kr(this,{...d(this,R),...t})),this.shadowRoot)},Se=new WeakSet,vt=function(){var t,r;d(this,R).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&p(this,Z,ce).call(this,{playerSize:Ze((r=this.mediaController)!=null?r:this)})},qe=new WeakSet,ei=function(){var t;A(this,ue,new ResizeObserver(()=>p(this,Se,vt).call(this))),d(this,ue).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,ti=function(){var t;(t=d(this,ue))==null||t.disconnect()},Ge=new WeakSet,ai=function(){var r,i,n,o,m;(r=this.mediaController)==null||r.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[B.LIVE,B.LL_LIVE,B.DVR,B.LL_DVR].includes(this.streamType)&&this.hasPlayed&&lt(this)});let t=()=>{let b=Xt(this),f=d(this,R).inLiveWindow;b!==f&&(p(this,Z,ce).call(this,{inLiveWindow:b}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(i=this.media)==null||i.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(o=this.media)==null||o.addEventListener("timeupdate",t),(m=this.media)==null||m.addEventListener("emptied",t)},Xe=new WeakSet,ii=function(){var r;let t=i=>{let{detail:n}=i;if(n instanceof gt||(n=new gt(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){G(n),n.data&&G(`${n.name} data:`,n.data);return}let{dialog:o,devlog:m}=Fe(n,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&Ie(m),O(n),n.data&&O(`${n.name} data:`,n.data),p(this,Z,ce).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(i={})=>{var o,m,b;if(!((o=this.media)!=null&&o.error))return i;let{devlog:n}=Fe((m=this.media)==null?void 0:m.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(b=this.media)==null?void 0:b.error.code,player_error_message:n.message?String(n.message):i.player_error_message}}),(r=this.media)==null||r.addEventListener("error",i=>{var o,m;let{detail:n}=i;if(!n){let{message:b,code:f}=(m=(o=this.media)==null?void 0:o.error)!=null?m:{};n=new gt(b,f)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Je=new WeakSet,ri=function(){var r,i,n,o;let t=()=>p(this,be,ze).call(this);(i=(r=this.media)==null?void 0:r.textTracks)==null||i.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Qe=new WeakSet,ni=function(){var v,$,F;let t=this.mediaController,r=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(r)return;let i,n=new WeakMap,o=()=>this.streamType&&[B.LIVE,B.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(k,I,D=!1)=>{if(o())return;Array.from(k&&k.activeCues||[]).forEach(E=>{if(!(!E.snapToLines||E.line<-5||E.line>=0&&E.line<10))if(!I||this.paused){let Oe=E.text.split(`
900
+ `).length,pe=r?-2:-3;this.streamType&&[B.LIVE,B.LL_LIVE].includes(this.streamType)&&(pe=r?-1:-2);let ae=pe-Oe;if(E.line===ae&&!D)return;n.has(E)||n.set(E,E.line),E.line=ae-1,E.line=ae}else setTimeout(()=>{E.line=n.get(E)||"auto"},500)})},b=()=>{var k;m(i,(k=t==null?void 0:t.hasAttribute("user-inactive"))!=null?k:!1)},f=()=>{var D;let I=Array.from(((D=t==null?void 0:t.media)==null?void 0:D.textTracks)||[]).filter(_=>["subtitles","captions"].includes(_.kind)&&_.mode==="showing")[0];I!==i&&(i==null||i.removeEventListener("cuechange",b)),i=I,i==null||i.addEventListener("cuechange",b),m(i,d(this,U))};if(f(),(v=t==null?void 0:t.media)==null||v.textTracks.addEventListener("change",f),($=t==null?void 0:t.media)==null||$.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let k=()=>{m(i,d(this,U),!0),this.paused||window.requestAnimationFrame(k)};(F=t==null?void 0:t.media)==null||F.addEventListener("playing",()=>{k()})}t==null||t.addEventListener("userinactivechange",()=>{let k=t==null?void 0:t.hasAttribute("user-inactive");d(this,U)!==k&&(A(this,U,k),m(i,d(this,U)))})};function me(e,a){return e.media?e.media.getAttribute(a):e.getAttribute(a)}g.customElements.get("mux-player")||(g.customElements.define("mux-player",we),g.MuxPlayerElement=we);var uo=we;export{gt as MediaError,uo as default,me as getVideoAttribute};