@mux/mux-player 1.4.0 → 1.5.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,713 +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,i)=>(et(e,a,"write to private field"),i?i.call(e,t):a.set(e,t),t);var p=(e,a,t)=>(et(e,a,"access private method"),t);var ne=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class e extends ne{}globalThis.DocumentFragment=e}var fe=class extends ne{},tt=class extends ne{},ui={get(e){},define(e,a,t){},upgrade(e){},whenDefined(e){return Promise.resolve(fe)}},ve,at=class{constructor(a,t={}){h(this,ve,void 0);A(this,ve,t==null?void 0:t.detail)}get detail(){return d(this,ve)}initCustomEvent(){}};ve=new WeakMap;function hi(e,a){return new fe}var Ft={document:{createElement:hi},DocumentFragment,customElements:ui,CustomEvent:at,EventTarget:ne,HTMLElement:fe,HTMLVideoElement:tt},Yt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",g=Yt?Ft:globalThis,O=Yt?Ft.document:globalThis.document;import{MediaController as vr}from"media-chrome";import yr,{MediaError as pt,Attributes as m}from"@mux/mux-video";import{StreamTypes as $,PlaybackTypes as Ye,addTextTrack as Er,removeTextTrack as kr,CmcdTypeValues as ai}from"@mux/playback-core";import{VideoEvents as Ti}from"@mux/mux-video";var bi="en",J={code:bi};var Zt="en";function u(e,a=!0){var r,n;let t=a&&(n=(r=J)==null?void 0:r[e])!=null?n:e,i=a?J.code:Zt;return new it(t,i)}var it=class{constructor(a,t=(i=>(i=J.code)!=null?i:Zt)()){this.message=a,this.locale=t}format(a){return this.message.replace(/\{(\w+)\}/g,(t,i)=>{var r;return(r=a[i])!=null?r:""})}toString(){return this.message}};function Wt(e){let a="";return Object.entries(e).forEach(([t,i])=>{i!=null&&(a+=`${pi(t)}: ${i}; `)}),a?a.trim():void 0}function pi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function zt(e){return e.replace(/[-_]([a-z])/g,(a,t)=>t.toUpperCase())}function _(e){if(e==null)return;let a=+e;return Number.isNaN(a)?void 0:a}function Oe(e){let a=gi(e).toString();return a?"?"+a:""}function gi(e){let a={};for(let t in e)e[t]!=null&&(a[t]=e[t]);return new URLSearchParams(a)}function z(e){let a=(e!=null?e:"").split(".")[1];if(!a)return{};let t=a.replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}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",fi=()=>{try{return"1.4.0"}catch{}return"UNKNOWN"},vi=fi(),Re=()=>vi,ot=(e,{token:a,domain:t=nt}={})=>`https://stream.${t}/${e}.m3u8${Oe(!!a?{token:a}:{redundant_streams:!0})}`,Gt=(e,{token:a,thumbnailTime:t,domain:i=nt}={})=>{let r=a==null?t:void 0,{aud:n}=z(a);if(!(a&&n!=="t"))return`https://image.${i}/${e}/thumbnail.jpg${Oe({token:a,time:r})}`},Xt=(e,{token:a,domain:t=nt}={})=>{let{aud:i}=z(a);if(!(a&&i!=="s"))return`https://image.${t}/${e}/storyboard.vtt${Oe({token:a})}`};function st(e){if(e&&/^media-theme-[\w-]+$/.test(e))return e}var yi={crossorigin:"crossOrigin",playsinline:"playsInline"};function Jt(e){var a;return(a=yi[e])!=null?a:zt(e)}var Qt=e=>{var t,i;let{media:a}=e;return(i=(t=a==null?void 0:a._hls)==null?void 0:t.liveSyncPosition)!=null?i:a!=null&&a.seekable.length?a==null?void 0:a.seekable.end(a.seekable.length-1):void 0},lt=e=>{let a=Qt(e);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}e.currentTime=a},Ei=1,ki=5,qt=3,jt=.5,ea=e=>{var n;let{streamType:a}=e,t=Qt(e),i=(n=e.media)==null?void 0:n.currentTime;if(t==null||i==null)return!1;let r=t-i;return a===Me.LL_LIVE||a===Me.LL_DVR?r<=Ei*(qt+jt):a===Me.LIVE||a===Me.DVR?r<=ki*(qt+jt):!1},Q,ee,x,Pe=class{constructor(a,t){h(this,Q,void 0);h(this,ee,void 0);h(this,x,[]);A(this,Q,a),A(this,ee,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,i;a.forEach(r=>{this.contains(r)||d(this,x).push(r)}),!(this.value===""&&!((t=d(this,Q))!=null&&t.hasAttribute(`${d(this,ee)}`)))&&((i=d(this,Q))==null||i.setAttribute(`${d(this,ee)}`,`${this.value}`))}remove(...a){var t;a.forEach(i=>{d(this,x).splice(d(this,x).indexOf(i),1)}),(t=d(this,Q))==null||t.setAttribute(`${d(this,ee)}`,`${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,ee=new WeakMap,x=new WeakMap;var ta=`[mux-player ${Re()}]`;function q(...e){console.warn(ta,...e)}function M(...e){console.error(ta,...e)}function Ie(e){var t;let a=(t=e.message)!=null?t:"";if(e.file){let i="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${u("Read more: ")}
2
- ${i}${e.file}`}q(a)}var T={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},te={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},ia=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}}),Ai=Ti.filter(e=>e!=="error"),xi=Object.values(T).filter(e=>![T.PLAYSINLINE].includes(e)),wi=Object.values(te);function ra(e){e.querySelectorAll(":scope > track").forEach(a=>{var t;(t=e.media)==null||t.append(a.cloneNode())}),Ai.forEach(a=>{var t;(t=e.media)==null||t.addEventListener(a,i=>{e.dispatchEvent(new Event(i.type))})})}var dt=class extends g.HTMLElement{static get observedAttributes(){return[...xi,...wi]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(i=>{var r;(r=this.media)==null||r.append(i.cloneNode())});let a=i=>{for(let r of i)r.type==="childList"&&(r.removedNodes.forEach(n=>{var c,b;let o=(c=this.media)==null?void 0:c.querySelector(`track[src="${n.src}"]`);o&&((b=this.media)==null||b.removeChild(o))}),r.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,i){var r,n;switch(a){case te.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case te.VOLUME:{let o=(r=_(i))!=null?r:1;this.media&&(this.media.volume=o);return}case te.PLAYBACKRATE:{let o=(n=_(i))!=null?n:1;this.media&&(this.media.playbackRate=o,this.media.defaultPlaybackRate=o);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:ia}get seekable(){var a,t;return(t=(a=this.media)==null?void 0:a.seekable)!=null?t:ia}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=_(this.getAttribute(te.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(te.PLAYBACKRATE,`${a}`):this.removeAttribute(te.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){M("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 er}from"media-chrome";import{TemplateInstance as la,NodeTemplatePart as De,createProcessor as Li,AttributeTemplatePart as ut}from"@github/template-parts";var Ee=new WeakMap,ke=class{constructor(a,t){this.element=a;this.type=t;this.element.addEventListener(this.type,this);let i=Ee.get(this.element);i&&i.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=Ee.get(this.element);t&&t.delete(this.type)}}static for(a){Ee.has(a.element)||Ee.set(a.element,new Map);let t=a.attributeName.slice(2),i=Ee.get(a.element);return i&&i.has(t)?i.get(t):new ke(a.element,t)}};function $i(e,a){return e instanceof ut&&e.attributeName.startsWith("on")?(ke.for(e).set(a),e.element.removeAttributeNS(e.attributeNamespace,e.attributeName),!0):!1}function Ci(e,a){return a instanceof Te&&e instanceof De?(a.renderInto(e),!0):!1}function Si(e,a){return a instanceof DocumentFragment&&e instanceof De?(a.childNodes.length&&e.replace(...a.childNodes),!0):!1}function Oi(e,a){if(e instanceof ut){let t=e.attributeNamespace,i=e.element.getAttributeNS(t,e.attributeName);return String(a)!==i&&(e.value=String(a)),!0}return e.value=String(a),!0}function Mi(e,a){if(typeof a=="boolean"&&e instanceof ut){let t=e.attributeNamespace,i=e.element.hasAttributeNS(t,e.attributeName);return a!==i&&(e.booleanValue=a),!0}return!1}function Pi(e,a){return a===!1&&e instanceof De?(e.replace(""),!0):!1}function Ri(e,a){Mi(e,a)||$i(e,a)||Pi(e,a)||Ci(e,a)||Si(e,a)||Oi(e,a)}var ct=new WeakMap,na=new WeakMap,oa=new WeakMap,Te=class{constructor(a,t,i){this.strings=a;this.values=t;this.processor=i}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((i,r,n)=>i+r+(n<t?`{{ ${n} }}`:""),""),ct.set(this.strings,a),a}}renderInto(a){let t=this.template;if(na.get(a)!==t){na.set(a,t);let r=new la(t,this.values,this.processor);oa.set(a,r),a instanceof De?a.replace(...r.children):a.appendChild(r);return}let i=oa.get(a);i&&i.update(this.values)}},sa=new Map,Ii=Li(Ri);function s(e,...a){let t=[""],i=[],r,n=!1,o=(c,b=[])=>{t[t.length-1]=t[t.length-1]+c[0],b.forEach((f,v)=>{(r=f==null?void 0:f.$static$)!==void 0?(r.forEach(S=>{o(S.strings,S.values)}),t[t.length-1]=t[t.length-1]+c[v+1],n=!0):(i.push(f),t.push(c[v+1]))})};if(o(e,a),n){let c=t.join("$$html$$");e=sa.get(c),e===void 0&&(t.raw=t,sa.set(c,e=t)),a=i}return new Te(e,a,Ii)}function _e(e,a){e.renderInto(a)}function y(e,a){let t=document.createElement("template");return t.innerHTML=e,new la(t,a)}var ht=(...e)=>({$static$:e.map(a=>a instanceof Te?a:/\w-/.test(a)?{strings:[a]}:{strings:[]})});var ma=`
1
+ var Ie=(t,a,e)=>{if(!a.has(t))throw TypeError("Cannot "+e)};var l=(t,a,e)=>(Ie(t,a,"read from private field"),e?e.call(t):a.get(t)),c=(t,a,e)=>{if(a.has(t))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(t):a.set(t,e)},k=(t,a,e,i)=>(Ie(t,a,"write to private field"),i?i.call(t,e):a.set(t,e),e);var p=(t,a,e)=>(Ie(t,a,"access private method"),e);var z=class{addEventListener(){}removeEventListener(){}dispatchEvent(a){return!0}};if(typeof DocumentFragment=="undefined"){class t extends z{}globalThis.DocumentFragment=t}var ae=class extends z{},_e=class extends z{},ea={get(t){},define(t,a,e){},upgrade(t){},whenDefined(t){return Promise.resolve(ae)}},ie,Ne=class{constructor(a,e={}){c(this,ie,void 0);k(this,ie,e==null?void 0:e.detail)}get detail(){return l(this,ie)}initCustomEvent(){}};ie=new WeakMap;function ta(t,a){return new ae}var pt={document:{createElement:ta},DocumentFragment,customElements:ea,CustomEvent:Ne,EventTarget:z,HTMLElement:ae,HTMLVideoElement:_e},bt=typeof window=="undefined"||typeof globalThis.customElements=="undefined",h=bt?pt:globalThis,E=bt?pt.document:globalThis.document;import{MediaController as Oa}from"media-chrome";import Ra,{MediaError as Je,Attributes as u}from"@mux/mux-video";import{StreamTypes as x,PlaybackTypes as xe,addTextTrack as Ma,removeTextTrack as Pa,CmcdTypeValues as Ut}from"@mux/playback-core";import{VideoEvents as ua}from"@mux/mux-video";var aa="en",H={code:aa};var ht="en";function d(t,a=!0){var r,o;let e=a&&(o=(r=H)==null?void 0:r[t])!=null?o:t,i=a?H.code:ht;return new Ve(e,i)}var Ve=class{constructor(a,e=(i=>(i=H.code)!=null?i:ht)()){this.message=a,this.locale=e}format(a){return this.message.replace(/\{(\w+)\}/g,(e,i)=>{var r;return(r=a[i])!=null?r:""})}toString(){return this.message}};function gt(t){let a="";return Object.entries(t).forEach(([e,i])=>{i!=null&&(a+=`${ia(e)}: ${i}; `)}),a?a.trim():void 0}function ia(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ft(t){return t.replace(/[-_]([a-z])/g,(a,e)=>e.toUpperCase())}function M(t){if(t==null)return;let a=+t;return Number.isNaN(a)?void 0:a}function be(t){let a=ra(t).toString();return a?"?"+a:""}function ra(t){let a={};for(let e in t)t[e]!=null&&(a[e]=t[e]);return new URLSearchParams(a)}function _(t){let a=(t!=null?t:"").split(".")[1];if(!a)return{};let e=a.replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(atob(e).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}var $e=(t,a)=>!t||!a?!1:t.contains(a)?!0:$e(t,a.getRootNode().host);import{StreamTypes as he}from"@mux/playback-core";var He="mux.com",oa=()=>{try{return"1.5.0"}catch{}return"UNKNOWN"},na=oa(),fe=()=>na,Ke=(t,{token:a,domain:e=He}={})=>`https://stream.${e}/${t}.m3u8${be(!!a?{token:a}:{redundant_streams:!0})}`,kt=(t,{token:a,thumbnailTime:e,domain:i=He}={})=>{let r=a==null?e:void 0,{aud:o}=_(a);if(!(a&&o!=="t"))return`https://image.${i}/${t}/thumbnail.jpg${be({token:a,time:r})}`},Et=(t,{token:a,domain:e=He}={})=>{let{aud:i}=_(a);if(!(a&&i!=="s"))return`https://image.${e}/${t}/storyboard.vtt${be({token:a})}`};var sa={crossorigin:"crossOrigin",playsinline:"playsInline"};function Tt(t){var a;return(a=sa[t])!=null?a:ft(t)}var At=t=>{var e,i;let{media:a}=t;return(i=(e=a==null?void 0:a._hls)==null?void 0:e.liveSyncPosition)!=null?i:a!=null&&a.seekable.length?a==null?void 0:a.seekable.end(a.seekable.length-1):void 0},Fe=t=>{let a=At(t);if(a==null){console.warn("attempting to seek to live but cannot determine live edge time!");return}t.currentTime=a},la=1,da=5,yt=3,vt=.5,xt=t=>{var o;let{streamType:a}=t,e=At(t),i=(o=t.media)==null?void 0:o.currentTime;if(e==null||i==null)return!1;let r=e-i;return a===he.LL_LIVE||a===he.LL_DVR?r<=la*(yt+vt):a===he.LIVE||a===he.DVR?r<=da*(yt+vt):!1},K,F,T,ge=class{constructor(a,e){c(this,K,void 0);c(this,F,void 0);c(this,T,[]);k(this,K,a),k(this,F,e)}[Symbol.iterator](){return l(this,T).values()}get length(){return l(this,T).length}get value(){var a;return(a=l(this,T).join(" "))!=null?a:""}set value(a){var e;a!==this.value&&(k(this,T,[]),this.add(...(e=a==null?void 0:a.split(" "))!=null?e:[]))}toString(){return this.value}item(a){return l(this,T)[a]}values(){return l(this,T).values()}keys(){return l(this,T).keys()}forEach(a){l(this,T).forEach(a)}add(...a){var e,i;a.forEach(r=>{this.contains(r)||l(this,T).push(r)}),!(this.value===""&&!((e=l(this,K))!=null&&e.hasAttribute(`${l(this,F)}`)))&&((i=l(this,K))==null||i.setAttribute(`${l(this,F)}`,`${this.value}`))}remove(...a){var e;a.forEach(i=>{l(this,T).splice(l(this,T).indexOf(i),1)}),(e=l(this,K))==null||e.setAttribute(`${l(this,F)}`,`${this.value}`)}contains(a){return l(this,T).includes(a)}toggle(a,e){return typeof e!="undefined"?e?(this.add(a),!0):(this.remove(a),!1):this.contains(a)?(this.remove(a),!1):(this.add(a),!0)}replace(a,e){this.remove(a),this.add(e)}};K=new WeakMap,F=new WeakMap,T=new WeakMap;var wt=`[mux-player ${fe()}]`;function N(...t){console.warn(wt,...t)}function L(...t){console.error(wt,...t)}function ye(t){var e;let a=(e=t.message)!=null?e:"";if(t.file){let i="https://github.com/muxinc/elements/blob/main/errors/";a+=` ${d("Read more: ")}
2
+ ${i}${t.file}`}N(a)}var v={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},U={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},St=Object.freeze({length:0,start(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(t){let a=t>>>0;if(a>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${a}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),ma=ua.filter(t=>t!=="error"),ca=Object.values(v).filter(t=>![v.PLAYSINLINE].includes(t)),pa=Object.values(U);function Ct(t){t.querySelectorAll(":scope > track").forEach(a=>{var e;(e=t.media)==null||e.append(a.cloneNode())}),ma.forEach(a=>{var e;(e=t.media)==null||e.addEventListener(a,i=>{t.dispatchEvent(new Event(i.type))})})}var Ue=class extends h.HTMLElement{static get observedAttributes(){return[...ca,...pa]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(i=>{var r;(r=this.media)==null||r.append(i.cloneNode())});let a=i=>{for(let r of i)r.type==="childList"&&(r.removedNodes.forEach(o=>{var m,b;let n=(m=this.media)==null?void 0:m.querySelector(`track[src="${o.src}"]`);n&&((b=this.media)==null||b.removeChild(n))}),r.addedNodes.forEach(o=>{var n;(n=this.media)==null||n.append(o.cloneNode())}))};new MutationObserver(a).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(a,e,i){var r,o;switch(a){case U.MUTED:{this.media&&(this.media.muted=i!=null,this.media.defaultMuted=i!=null);return}case U.VOLUME:{let n=(r=M(i))!=null?r:1;this.media&&(this.media.volume=n);return}case U.PLAYBACKRATE:{let n=(o=M(i))!=null?o:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var a,e;return(e=(a=this.media)==null?void 0:a.play())!=null?e:Promise.reject()}pause(){var a;(a=this.media)==null||a.pause()}requestCast(a){var e;return(e=this.media)==null?void 0:e.requestCast(a)}get media(){var a;return(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video")}get paused(){var a,e;return(e=(a=this.media)==null?void 0:a.paused)!=null?e:!0}get duration(){var a,e;return(e=(a=this.media)==null?void 0:a.duration)!=null?e:NaN}get ended(){var a,e;return(e=(a=this.media)==null?void 0:a.ended)!=null?e:!1}get buffered(){var a,e;return(e=(a=this.media)==null?void 0:a.buffered)!=null?e:St}get seekable(){var a,e;return(e=(a=this.media)==null?void 0:a.seekable)!=null?e:St}get readyState(){var a,e;return(e=(a=this.media)==null?void 0:a.readyState)!=null?e:0}get videoWidth(){var a,e;return(e=(a=this.media)==null?void 0:a.videoWidth)!=null?e:0}get videoHeight(){var a,e;return(e=(a=this.media)==null?void 0:a.videoHeight)!=null?e:0}get currentTime(){var a,e;return(e=(a=this.media)==null?void 0:a.currentTime)!=null?e:0}set currentTime(a){this.media&&(this.media.currentTime=Number(a))}get volume(){var a,e;return(e=(a=this.media)==null?void 0:a.volume)!=null?e:1}set volume(a){this.media&&(this.media.volume=Number(a))}get playbackRate(){var a,e;return(e=(a=this.media)==null?void 0:a.playbackRate)!=null?e:1}set playbackRate(a){this.media&&(this.media.playbackRate=Number(a))}get defaultPlaybackRate(){var a;return(a=M(this.getAttribute(U.PLAYBACKRATE)))!=null?a:1}set defaultPlaybackRate(a){a!=null?this.setAttribute(U.PLAYBACKRATE,`${a}`):this.removeAttribute(U.PLAYBACKRATE)}get crossOrigin(){return re(this,v.CROSSORIGIN)}set crossOrigin(a){this.setAttribute(v.CROSSORIGIN,`${a}`)}get autoplay(){return re(this,v.AUTOPLAY)!=null}set autoplay(a){a?this.setAttribute(v.AUTOPLAY,typeof a=="string"?a:""):this.removeAttribute(v.AUTOPLAY)}get loop(){return re(this,v.LOOP)!=null}set loop(a){a?this.setAttribute(v.LOOP,""):this.removeAttribute(v.LOOP)}get muted(){var a,e;return(e=(a=this.media)==null?void 0:a.muted)!=null?e:!1}set muted(a){this.media&&(this.media.muted=Boolean(a))}get defaultMuted(){return re(this,v.MUTED)!=null}set defaultMuted(a){a?this.setAttribute(v.MUTED,""):this.removeAttribute(v.MUTED)}get playsInline(){return re(this,v.PLAYSINLINE)!=null}set playsInline(a){L("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 re(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}var Ye=Ue;import"media-chrome/dist/media-theme-element.js";var Rt=`
3
3
  :host {
4
4
  cursor: pointer;
5
5
  }
6
6
  media-time-display {
7
7
  color: inherit;
8
8
  }
9
- `,ca=O.createElement("template");ca.innerHTML=`
9
+ `,Mt=E.createElement("template");Mt.innerHTML=`
10
10
  <style>
11
- ${ma}
11
+ ${Rt}
12
12
  </style>
13
13
  <media-time-display show-duration></media-time-display>
14
- `;var da=["Enter"," "],Ae,se,Ne,oe=class extends g.HTMLElement{constructor(){var t,i;super();h(this,se);h(this,Ae,void 0);this.attachShadow({mode:"open"}),(t=this.shadowRoot)==null||t.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(i=this.shadowRoot)==null?void 0:i.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var t,i,r;(t=this.timeDisplayEl)!=null&&t.hasAttribute("remaining")?(i=this.timeDisplayEl)==null||i.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let t=i=>{let{key:r}=i;if(!da.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",i=>{let{metaKey:r,altKey:n,key:o}=i;if(r||n||!da.includes(o)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),A(this,Ae,setInterval(p(this,se,Ne).bind(this),200)),requestAnimationFrame(()=>p(this,se,Ne).call(this))}disconnectedCallback(){clearInterval(d(this,Ae))}attributeChangedCallback(t,i,r){var n,o;t==="hide-duration"&&p(this,se,Ne).call(this),["remaining","disabled","aria-disabled"].includes(t)&&i!==r&&(r==null?(n=this.timeDisplayEl)==null||n.removeAttribute(t):(o=this.timeDisplayEl)==null||o.setAttribute(t,r))}};Ae=new WeakMap,se=new WeakSet,Ne=function(){var i,r,n,o;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(i=this.timeDisplayEl)!=null&&i.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(n=this.timeDisplayEl)!=null&&n.hasAttribute("show-duration")||(o=this.timeDisplayEl)==null||o.setAttribute("show-duration","")},oe.styles=ma,oe.template=ca;g.customElements.get("mxp-time-display")||(g.customElements.define("mxp-time-display",oe),g.MxpTimeDisplay=oe);var ua=`:host(:not([audio])) {
15
- --secondary-color: transparent;
16
- }
17
-
18
- :host {
19
- --_primary-color: var(--primary-color, #fff);
20
-
21
- --media-icon-color: var(--_primary-color);
22
- --media-range-thumb-background: var(--_primary-color);
23
- --media-range-bar-color: var(--_primary-color);
24
- --media-control-background: var(--secondary-color);
25
- --media-control-hover-background: var(--secondary-color);
26
- --media-time-buffered-color: rgba(255, 255, 255, 0.4);
27
- --media-range-track-background: rgba(255, 255, 255, 0.5);
28
- --media-range-track-border-radius: 3px;
29
- --media-preview-thumbnail-border: 1px solid #fff;
30
- --media-preview-thumbnail-border-radius: 2px;
31
- --media-preview-time-margin: 5px 0 2px;
32
- color: var(--_primary-color);
33
- display: inline-block;
34
- width: 100%;
35
- height: 100%;
36
- }
37
-
38
- :host(.two-tone:not([audio])) {
39
- --mux-time-range-padding: 0px; /* px is needed in calc() */
40
- --media-preview-thumbnail-border: 0;
41
- --media-preview-thumbnail-border-radius: 2px 2px 0 0;
42
- --media-preview-time-border-radius: 0 0 2px 2px;
43
- --media-preview-time-margin: 0 0 8px;
44
- --media-preview-time-text-shadow: none;
45
- }
46
-
47
- :host([audio]) {
48
- --media-preview-time-border-radius: 3px;
49
- --media-preview-time-margin: 0 0 5px;
50
- --media-preview-time-text-shadow: none;
51
- }
52
-
53
- :host(.two-tone:not([audio])) media-time-range {
54
- --media-range-track-border-radius: 0;
55
- }
56
-
57
- :host([audio]) ::slotted([slot='media']) {
58
- height: 0px;
59
- }
60
-
61
- :host([audio]) :is(media-poster-image, media-loading-indicator) {
62
- display: none;
63
- }
64
-
65
- :host([audio]) media-controller {
66
- background: transparent;
67
- }
68
-
69
- :host([audio]) media-controller::part(vertical-layer) {
70
- background: transparent;
71
- }
72
-
73
- :host([audio]) media-control-bar {
74
- width: 100%;
75
- }
76
-
77
- [disabled],
78
- [aria-disabled='true'] {
79
- opacity: 60%;
80
- cursor: not-allowed;
81
- }
82
-
83
- media-captions-button:not(:is([media-captions-list], [media-subtitles-list])) {
84
- --captions-button: none;
85
- }
86
-
87
- media-volume-range[media-volume-unavailable] {
88
- --volume-range: none;
89
- }
90
-
91
- media-airplay-button[media-airplay-unavailable] {
92
- --airplay-button: none;
93
- }
94
-
95
- media-fullscreen-button[media-fullscreen-unavailable] {
96
- --fullscreen-button: none;
97
- }
98
-
99
- media-cast-button[media-cast-unavailable] {
100
- --cast-button: none;
101
- }
102
-
103
- media-pip-button[media-pip-unavailable] {
104
- --pip-button: none;
105
- }
106
-
107
- media-controller {
108
- width: 100%;
109
- height: 100%;
110
- }
111
-
112
- :host media-time-range {
113
- color: var(--_primary-color);
114
- --media-range-thumb-opacity: 0;
115
- }
116
-
117
- :host(:not([audio])) media-time-range {
118
- --media-range-padding-left: var(--mux-time-range-padding, 10px);
119
- --media-range-padding-right: var(--mux-time-range-padding, 10px);
120
- --media-range-padding: 0;
121
- z-index: 10;
122
- height: 10px;
123
- bottom: -3px;
124
- background: linear-gradient(
125
- 180deg,
126
- transparent,
127
- transparent 3px,
128
- var(--media-control-background, rgba(20, 20, 30, 0.7)) 3px,
129
- var(--media-control-background, rgba(20, 20, 30, 0.7)) 7px,
130
- transparent 7px,
131
- transparent
132
- );
133
- width: 100%;
134
- }
135
-
136
- media-control-bar {
137
- --media-control-padding: 9px 7px;
138
- }
139
-
140
- .size-small media-control-bar {
141
- --media-control-padding: 9px 5px;
142
- }
143
-
144
- .size-extra-small media-control-bar {
145
- --media-control-padding: 4px 3px;
146
- }
147
-
148
- media-control-bar :is([role='button'], [role='switch'], button) {
149
- line-height: 0;
150
- }
151
-
152
- media-control-bar :is(media-text-display, mxp-time-display):first-child {
153
- --media-control-padding: 9px 5px 9px 10px;
154
- }
155
-
156
- .spacer {
157
- flex-grow: 1;
158
- background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
159
- }
160
-
161
- /* Add a small space on the right to have the play button and
162
- * fullscreen button aligned in relation to the progress bar. */
163
- media-control-bar:not([slot])::after {
164
- content: '';
165
- width: 2px;
166
- height: 100%;
167
- background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
168
- }
169
-
170
- media-control-bar[slot='top-chrome'] {
171
- min-height: 42px;
172
- pointer-events: none;
173
- }
174
-
175
- :host([title]) media-control-bar[slot='top-chrome']::before {
176
- content: '';
177
- position: absolute;
178
- width: 100%;
179
- padding-bottom: min(160px, 25%);
180
- background: linear-gradient(rgb(0 0 0 / 0.4), transparent);
181
- }
182
-
183
- media-control-bar[slot='top-chrome'] > * {
184
- --media-control-background: transparent;
185
- --media-control-hover-background: transparent;
186
- position: relative;
187
- }
188
-
189
- media-controller::part(vertical-layer) {
190
- transition: background-color 1s;
191
- }
192
-
193
- media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer) {
194
- background-color: var(--controls-backdrop-color, var(--controls, transparent));
195
- transition: background-color 0.25s;
196
- }
197
-
198
- .center-controls {
199
- --media-button-icon-width: 100%;
200
- --media-button-icon-height: auto;
201
- pointer-events: none;
202
- width: 100%;
203
- display: flex;
204
- flex-flow: row;
205
- align-items: center;
206
- justify-content: center;
207
- filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.25)) drop-shadow(0 0 6px rgb(0 0 0 / 0.25));
208
- paint-order: stroke;
209
- stroke: rgba(102, 102, 102, 1);
210
- stroke-width: 0.3px;
211
- text-shadow: 0 0 2px rgb(0 0 0 / 0.25), 0 0 6px rgb(0 0 0 / 0.25);
212
- }
213
-
214
- .center-controls media-play-button {
215
- --media-control-background: transparent;
216
- --media-control-hover-background: transparent;
217
- padding: 0;
218
- width: max(43px, min(10%, 55px));
219
- }
220
-
221
- .center-controls media-seek-backward-button,
222
- .center-controls media-seek-forward-button {
223
- --media-control-background: transparent;
224
- --media-control-hover-background: transparent;
225
- padding: 0;
226
- margin: 0 2%;
227
- width: max(33px, min(8%, 40px));
228
- }
229
-
230
- media-control-bar:not([slot]) media-seek-backward-button {
231
- padding-right: 5px;
232
- }
233
-
234
- media-control-bar:not([slot]) media-seek-forward-button {
235
- padding-left: 5px;
236
- }
237
-
238
- media-loading-indicator {
239
- --media-loading-icon-width: 100%;
240
- --media-button-icon-height: auto;
241
- pointer-events: none;
242
- position: absolute;
243
- width: min(15%, 150px);
244
- display: flex;
245
- flex-flow: row;
246
- align-items: center;
247
- justify-content: center;
248
- }
249
-
250
- /* Intentionally don't target the div for transition but the children
251
- of the div. Prevents messing with media-chrome's autohide feature. */
252
- media-loading-indicator + div * {
253
- transition: opacity 0.15s;
254
- opacity: 1;
255
- }
256
-
257
- media-loading-indicator[media-loading]:not([media-paused]) ~ div > * {
258
- opacity: 0;
259
- transition-delay: 400ms;
260
- }
261
-
262
- media-volume-range {
263
- width: min(100%, 100px);
264
- }
265
-
266
- media-time-display {
267
- white-space: nowrap;
268
- }
269
-
270
- :is(media-time-display, media-text-display, media-playback-rate-button[role='button']) {
271
- color: inherit;
272
- line-height: 24px;
273
- }
274
-
275
- .title-display {
276
- font-size: 16px;
277
- text-shadow: 0 0 2px rgb(0 0 0 / 0.6);
278
- }
279
-
280
- :host([audio]) .title-display {
281
- flex-grow: 1;
282
- font-size: 21px;
283
- }
284
- `;var ha=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
285
- <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"/>
286
- <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"/>
287
- </svg>
288
- `;var ba=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
289
- <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"/>
290
- </svg>
291
- `;var pa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
292
- <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"/>
293
- </svg>
294
- `;var ga=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
295
- <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"/>
296
- <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
297
- <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"/>
298
- </svg>
299
- `;var fa=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
300
- <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"/>
301
- <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z"/>
302
- <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"/>
303
- <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z"/>
304
- </svg>
305
- `;var va=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
306
- <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"/>
307
- </svg>
308
- `;var ya=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
309
- <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"/>
310
- </svg>
311
- `;var Ea=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
312
- <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"/>
313
- </svg>
314
- `;var ka=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
315
- <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"/>
316
- </svg>
317
- `;var Ta=`<svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
318
- <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"/>
319
- </svg>
320
- `;var Aa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
321
- <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"/>
322
- </svg>
323
- `;var xa=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
324
- <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"/>
325
- <text
326
- class="value"
327
- transform="translate(2.5 21)"
328
- style="font-size: 8px; font-family: 'ArialMT', 'Arial'"
329
- >
330
- {{value}}
331
- </text>
332
- </svg>
333
- `;var wa=`<svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
334
- <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"/>
335
- <text
336
- class="value"
337
- transform="translate(10 21)"
338
- style="font-size: 8px; font-family: 'ArialMT', 'Arial'"
339
- >
340
- {{value}}
341
- </text>
342
- </svg>
343
- `;var La=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
344
- <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"/>
345
- </svg>
346
- `;var $a=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
347
- <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"/>
348
- </svg>
349
- `;var Ca=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
350
- <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"/>
351
- </svg>
352
- `;var Sa=`<svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
353
- <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"/>
354
- </svg>
355
- `;var Oa=()=>y(ha),Ma=()=>y(ba),Pa=()=>y(pa),Ra=()=>y(ga),Ia=()=>y(fa),Da=()=>y(va),_a=()=>y(ya),Na=()=>y(Ea),Va=()=>y(ka),Ha=()=>y(Ta),Ba=()=>y(Aa),Ka=e=>y(xa,e),Ua=e=>y(wa,e),Fa=()=>y(La),Ya=()=>y($a),Za=()=>y(Ca),Wa=()=>y(Sa);import{StreamTypes as L}from"@mux/playback-core";var N={LG:"large",SM:"small",XS:"extra-small"},He,za,Ve=class extends er{constructor(){super();h(this,He);p(this,He,za).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 i,r,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,[L.LIVE,L.LL_LIVE,L.DVR,L.LL_DVR].includes(t.streamType)&&(t.hotkeys=t.hotkeys||"",t.hotkeys+=" noarrowleft noarrowright"),_e(s`
356
- <style>
357
- ${ua}
358
- </style>
359
- <media-controller
360
- gestures-disabled="${!t.hasSrc||t.isDialogOpen}"
361
- hotkeys="${t.hotkeys||!1}"
362
- nohotkeys="${t.nohotkeys||!1}"
363
- audio="${t.audio||!1}"
364
- class="size-${t.playerSize}"
365
- exportparts="layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer"
366
- >
367
- <slot name="media" slot="media"></slot>
368
- <media-poster-image
369
- slot="poster"
370
- part="poster"
371
- src="${(i=t.poster)!=null?i:!1}"
372
- placeholder-src="${(r=t.placeholder)!=null?r:!1}"
373
- ></media-poster-image>
374
- <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
375
- ${tr(t)}
376
- <slot></slot>
377
- </media-controller>
378
- `,this.shadowRoot),(n=this.shadowRoot)==null||n.querySelectorAll("*").forEach(o=>{if(!o.localName.includes("-"))return;let c=o.localName.match(/^([^-]+)-(.*)-(button|range|display)$/);if(!c)return;let[,,b,f]=c;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,za=function(){var t,i;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}};g.customElements.get("media-theme-mux")||g.customElements.define("media-theme-mux",Ve);var tr=e=>{let{streamType:a,playerSize:t,audio:i}=e;if(i)switch(a){case L.LIVE:case L.LL_LIVE:return rr(e);case L.DVR:case L.LL_DVR:return ir(e);case L.ON_DEMAND:default:return ar(e)}switch(a){case L.LIVE:case L.LL_LIVE:switch(t){case N.LG:return mr(e);case N.SM:return dr(e);case N.XS:return lr(e)}case L.DVR:case L.LL_DVR:switch(t){case N.LG:return hr(e);case N.SM:return ur(e);case N.XS:return cr(e)}case L.ON_DEMAND:default:switch(t){case N.LG:return sr(e);case N.SM:return or(e);case N.XS:return nr(e)}}},w=e=>s`
379
- <media-play-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
380
- ${Ba()}
381
- ${Na()}
382
- </media-play-button>`,le=({backwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>s`
383
- <media-seek-backward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
384
- ${Ka({value:e})}
385
- </media-seek-backward-button>`,de=({forwardSeekOffset:e,hasSrc:a,isDialogOpen:t})=>s`
386
- <media-seek-forward-button seek-offset="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
387
- ${Ua({value:e})}
388
- </media-seek-forward-button>`,C=({isDialogOpen:e})=>s`
389
- <media-mute-button disabled="${e}" aria-disabled="${e&&"true"}">
390
- ${Fa()}
391
- ${Za()}
392
- ${Ya()}
393
- ${Wa()}
394
- </media-mute-button>`,V=({defaultHiddenCaptions:e,isDialogOpen:a})=>s`
395
- <media-captions-button default-showing="${!e}" disabled="${a}" aria-disabled="${a&&"true"}">
396
- ${Ma()}
397
- ${Pa()}
398
- </media-captions-button>`,H=e=>s`
399
- <media-airplay-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
400
- ${Oa()}
401
- </media-airplay-button>`,me=e=>s`
402
- <media-pip-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
403
- ${Va()}
404
- ${Ha()}
405
- </media-pip-button>`,B=e=>s`
406
- <media-fullscreen-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
407
- ${Da()}
408
- ${_a()}
409
- </media-fullscreen-button>`,K=e=>s`
410
- <media-cast-button disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
411
- ${Ra()}
412
- ${Ia()}
413
- </media-cast-button>`,Be=({playbackRates:e,isDialogOpen:a})=>s`
414
- <media-playback-rate-button rates="${e!=null?e:!1}" disabled="${a}" aria-disabled="${a&&"true"}">
415
- </media-playback-rate-button>`,U=({isDialogOpen:e})=>s`
416
- <media-volume-range disabled="${e}" aria-disabled="${e&&"true"}">
417
- </media-volume-range>`,j=e=>s`
418
- <media-time-range disabled="${!e.hasSrc||e.isDialogOpen}" aria-disabled="${!e.hasSrc||e.isDialogOpen&&"true"}">
419
- </media-time-range>`,Ke=({defaultShowRemainingTime:e,hasSrc:a,isDialogOpen:t})=>s`
420
- <mxp-time-display remaining="${e}" disabled="${!a||t}" aria-disabled="${!a||t&&"true"}">
421
- </mxp-time-display>`,F=({title:e})=>s`
422
- <media-text-display part="title" class="title-display">${e}</media-text-display>`,ar=e=>s`
423
- ${e.title?s`<media-control-bar>${F(e)}</media-control-bar>`:s``}
424
- <media-control-bar>
425
- ${w(e)}
426
- ${le(e)}
427
- ${de(e)}
428
- ${Ke(e)}
429
- ${j(e)}
430
- ${C(e)}
431
- ${U(e)}
432
- ${Be(e)}
433
- ${H(e)}
434
- ${K(e)}
435
- </media-control-bar>
436
- `,ir=e=>s`
437
- ${e.title?s`<media-control-bar>${F(e)}</media-control-bar>`:s``}
438
- <media-control-bar>
439
- ${w(e)}
440
- <slot name="seek-live"></slot>
441
- ${le(e)}
442
- ${de(e)}
443
- ${Ke(e)}
444
- ${j(e)}
445
- ${C(e)}
446
- ${U(e)}
447
- ${Be(e)}
448
- ${H(e)}
449
- ${K(e)}
450
- </media-control-bar>
451
- `,rr=e=>s`
452
- ${e.title?s`<media-control-bar>${F(e)}</media-control-bar>`:s``}
453
- <media-control-bar>
454
- ${w(e)}
455
- <slot name="seek-live"></slot>
456
- ${C(e)}
457
- ${U(e)}
458
- <div class="spacer"></div>
459
- ${H(e)}
460
- ${K(e)}
461
- </media-control-bar>
462
- `,nr=e=>s`
463
- ${j(e)}
464
- <media-control-bar>
465
- ${w(e)}
466
- ${C(e)}
467
- <div class="spacer"></div>
468
- ${V(e)}
469
- ${B(e)}
470
- </media-control-bar>
471
- `,or=e=>s`
472
- <media-control-bar slot="top-chrome">
473
- ${e.title?F(e):s``}
474
- </media-control-bar>
475
- <div slot="centered-chrome" class="center-controls">
476
- ${le(e)}
477
- ${w(e)}
478
- ${de(e)}
479
- </div>
480
- ${j(e)}
481
- <media-control-bar>
482
- ${Ke(e)}
483
- ${C(e)}
484
- ${U(e)}
485
- <div class="spacer"></div>
486
- ${Be(e)}
487
- ${V(e)}
488
- ${H(e)}
489
- ${K(e)}
490
- ${me(e)}
491
- ${B(e)}
492
- </media-control-bar>
493
- `,sr=e=>s`
494
- <media-control-bar slot="top-chrome">
495
- ${e.title?F(e):s``}
496
- </media-control-bar>
497
- <div slot="centered-chrome" class="center-controls">
498
- ${w(e)}
499
- </div>
500
- ${j(e)}
501
- <media-control-bar>
502
- ${w(e)}
503
- ${le(e)}
504
- ${de(e)}
505
- ${Ke(e)}
506
- ${C(e)}
507
- ${U(e)}
508
- <div class="spacer"></div>
509
- ${Be(e)}
510
- ${V(e)}
511
- ${H(e)}
512
- ${K(e)}
513
- ${me(e)}
514
- ${B(e)}
515
- </media-control-bar>
516
- `,lr=e=>s`
517
- <media-control-bar slot="top-chrome">
518
- <slot name="seek-live"></slot>
519
- </media-control-bar>
520
- <media-control-bar>
521
- ${w(e)}
522
- ${C(e)}
523
- <div class="spacer"></div>
524
- ${V(e)}
525
- ${B(e)}
526
- </media-control-bar>
527
- `,dr=e=>s`
528
- <media-control-bar slot="top-chrome">
529
- <slot name="seek-live"></slot>
530
- ${e.title?F(e):s``}
531
- </media-control-bar>
532
- <div slot="centered-chrome" class="center-controls">
533
- ${w(e)}
534
- </div>
535
- <media-control-bar>
536
- ${C(e)}
537
- ${U(e)}
538
- <div class="spacer"></div>
539
- ${V(e)}
540
- ${H(e)}
541
- ${K(e)}
542
- ${me(e)}
543
- ${B(e)}
544
- </media-control-bar>
545
- `,mr=e=>s`
546
- <media-control-bar slot="top-chrome">
547
- <slot name="seek-live"></slot>
548
- ${e.title?F(e):s``}
549
- </media-control-bar>
550
- <div slot="centered-chrome" class="center-controls">
551
- ${w(e)}
552
- </div>
553
- <media-control-bar>
554
- ${w(e)}
555
- ${C(e)}
556
- ${U(e)}
557
- <div class="spacer"></div>
558
- ${V(e)}
559
- ${H(e)}
560
- ${K(e)}
561
- ${me(e)}
562
- ${B(e)}
563
- </media-control-bar>
564
- `,cr=e=>s`
565
- <media-control-bar slot="top-chrome">
566
- <slot name="seek-live"></slot>
567
- </media-control-bar>
568
- ${j(e)}
569
- <media-control-bar>
570
- ${w(e)}
571
- ${C(e)}
572
- <div class="spacer"></div>
573
- ${V(e)}
574
- ${B(e)}
575
- </media-control-bar>
576
- `,ur=e=>s`
577
- <media-control-bar slot="top-chrome">
578
- <slot name="seek-live"></slot>
579
- ${e.title?F(e):s``}
580
- </media-control-bar>
581
- <div slot="centered-chrome" class="center-controls">
582
- ${le(e)}
583
- ${w(e)}
584
- ${de(e)}
585
- </div>
586
- ${j(e)}
587
- <media-control-bar>
588
- ${C(e)}
589
- ${U(e)}
590
- <div class="spacer"></div>
591
- ${V(e)}
592
- ${H(e)}
593
- ${K(e)}
594
- ${me(e)}
595
- ${B(e)}
596
- </media-control-bar>
597
- `,hr=e=>s`
598
- <media-control-bar slot="top-chrome">
599
- <slot name="seek-live"></slot>
600
- ${e.title?F(e):s``}
601
- </media-control-bar>
602
- <div slot="centered-chrome" class="center-controls">
603
- ${w(e)}
604
- </div>
605
- ${j(e)}
606
- <media-control-bar>
607
- ${w(e)}
608
- ${le(e)}
609
- ${de(e)}
610
- ${C(e)}
611
- ${U(e)}
612
- <div class="spacer"></div>
613
- ${V(e)}
614
- ${H(e)}
615
- ${K(e)}
616
- ${me(e)}
617
- ${B(e)}
618
- </media-control-bar>
619
- `;var ja=`
620
- :host {
621
- z-index: 100;
622
- display: flex;
623
- justify-content: center;
624
- align-items: center;
625
- width: 100%;
626
- height: 100%;
627
- position: absolute;
628
- top: 0;
629
- left: 0;
630
- box-sizing: border-box;
631
- color: #fff;
632
- line-height: 18px;
633
- font-family: Arial, sans-serif;
634
- padding: var(--media-dialog-backdrop-padding, 0);
635
- background: var(--media-dialog-backdrop-background,
636
- linear-gradient(to bottom, rgba(20, 20, 30, 0.7) 50%, rgba(20, 20, 30, 0.9))
637
- );
638
- /* Needs to use !important to prevent overwrite of media-chrome */
639
- transition: var(--media-dialog-transition-open, visibility .2s, opacity .2s) !important;
640
- transform: var(--media-dialog-transform-open, none) !important;
641
- visibility: visible !important;
642
- opacity: 1 !important;
643
- pointer-events: auto !important;
644
- }
645
-
646
- :host(:not([open])) {
647
- /* Needs to use !important to prevent overwrite of media-chrome */
648
- transition: var(--media-dialog-transition-close, visibility .1s, opacity .1s) !important;
649
- transform: var(--media-dialog-transform-close, none) !important;
650
- visibility: hidden !important;
651
- opacity: 0 !important;
652
- pointer-events: none !important;
653
- }
654
-
655
- :focus-visible {
656
- box-shadow: 0 0 0 2px rgba(27, 127, 204, 0.9);
657
- }
658
-
659
- .dialog {
660
- position: relative;
661
- box-sizing: border-box;
662
- background: var(--media-dialog-background, none);
663
- padding: var(--media-dialog-padding, 10px);
664
- width: min(320px, 100%);
665
- word-wrap: break-word;
666
- max-height: 100%;
667
- overflow: auto;
668
- text-align: center;
669
- line-height: 1.4;
670
- }
671
- `,Ga=O.createElement("template");Ga.innerHTML=`
672
- <style>
673
- ${ja}
674
- </style>
675
-
676
- <div class="dialog">
677
- <slot></slot>
678
- </div>
679
- `;var G=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})),qa(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),br(this))}attributeChangedCallback(t,i,r){t==="open"&&i!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&qa(this)}};G.styles=ja,G.template=Ga,G.observedAttributes=["open"];function qa(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=Xa(e.shadowRoot)),e._previouslyFocusedElement=O.activeElement,O.activeElement instanceof HTMLElement&&O.activeElement.blur(),e.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Xa(e){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let i=e==null?void 0:e.querySelector(t.join(", "));if(!i&&"attachShadow"in Element.prototype){let r=(e==null?void 0:e.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(i=Xa(r[n].shadowRoot),i));n++);}return i}function br(e){e._previouslyFocusedElement instanceof HTMLElement&&e._previouslyFocusedElement.focus()}g.customElements.get("media-dialog")||(g.customElements.define("media-dialog",G),g.MediaDialog=G);var bt=G;var Ja=O.createElement("template");Ja.innerHTML=`
680
- <style>
681
- ${bt.styles}
682
-
683
- .close {
684
- background: none;
685
- color: inherit;
686
- border: none;
687
- padding: 0;
688
- font: inherit;
689
- cursor: pointer;
690
- outline: inherit;
691
- width: 28px;
692
- height: 28px;
693
- position: absolute;
694
- top: 1rem;
695
- right: 1rem;
696
- }
697
- </style>
698
-
699
- <div class="dialog">
700
- <slot></slot>
701
- </div>
702
-
703
- <slot name="close">
704
- <button class="close" tabindex="0">
705
- <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
706
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
707
- </svg>
708
- </button>
709
- </slot>
710
- `;var xe=class extends bt{constructor(){var a,t;super(),(t=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};xe.template=Ja;g.customElements.get("mxp-dialog")||(g.customElements.define("mxp-dialog",xe),g.MxpDialog=xe);var Qa=`:host {
14
+ `;var Ot=["Enter"," "],oe,j,ve,q=class extends h.HTMLElement{constructor(){var e,i;super();c(this,j);c(this,oe,void 0);this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0)),this.timeDisplayEl=(i=this.shadowRoot)==null?void 0:i.querySelector("media-time-display")}static get observedAttributes(){return["hide-duration","remaining","disabled","aria-disabled"]}toggleTimeDisplay(){var e,i,r;(e=this.timeDisplayEl)!=null&&e.hasAttribute("remaining")?(i=this.timeDisplayEl)==null||i.removeAttribute("remaining"):(r=this.timeDisplayEl)==null||r.setAttribute("remaining","")}connectedCallback(){let e=i=>{let{key:r}=i;if(!Ot.includes(r)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",i=>{let{metaKey:r,altKey:o,key:n}=i;if(r||o||!Ot.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),k(this,oe,setInterval(p(this,j,ve).bind(this),200)),requestAnimationFrame(()=>p(this,j,ve).call(this))}disconnectedCallback(){clearInterval(l(this,oe))}attributeChangedCallback(e,i,r){var o,n;e==="hide-duration"&&p(this,j,ve).call(this),["remaining","disabled","aria-disabled"].includes(e)&&i!==r&&(r==null?(o=this.timeDisplayEl)==null||o.removeAttribute(e):(n=this.timeDisplayEl)==null||n.setAttribute(e,r))}};oe=new WeakMap,j=new WeakSet,ve=function(){var i,r,o,n;getComputedStyle(this).getPropertyValue("--media-duration-display").trim()==="none"||this.getAttribute("hide-duration")!=null?(i=this.timeDisplayEl)!=null&&i.hasAttribute("show-duration")&&((r=this.timeDisplayEl)==null||r.removeAttribute("show-duration")):(o=this.timeDisplayEl)!=null&&o.hasAttribute("show-duration")||(n=this.timeDisplayEl)==null||n.setAttribute("show-duration","")},q.styles=Rt,q.template=Mt;h.customElements.get("mxp-time-display")||(h.customElements.define("mxp-time-display",q),h.MxpTimeDisplay=q);var Pt=`:host {
711
15
  display: inline-block;
712
16
  width: 100%;
713
17
  }
@@ -873,91 +177,820 @@ a {
873
177
  ::part(title display) {
874
178
  display: var(--media-controls, var(--media-title-display));
875
179
  }
876
- `;import{StreamTypes as ce}from"@mux/playback-core";var ti=e=>s`
180
+ `;var Bt=`<template id="media-theme-mux">
877
181
  <style>
878
- ${Qa}
182
+ :host(:not([audio])) {
183
+ --secondary-color: transparent;
184
+ }
185
+
186
+ :host {
187
+ --_primary-color: var(--primary-color, #fff);
188
+
189
+ --media-icon-color: var(--_primary-color);
190
+ --media-range-thumb-background: var(--_primary-color);
191
+ --media-range-bar-color: var(--_primary-color);
192
+ --media-control-background: var(--secondary-color);
193
+ --media-control-hover-background: var(--secondary-color);
194
+ --media-time-buffered-color: rgba(255, 255, 255, 0.4);
195
+ --media-range-track-background: rgba(255, 255, 255, 0.5);
196
+ --media-range-track-border-radius: 3px;
197
+ --media-preview-thumbnail-border: 1px solid #fff;
198
+ --media-preview-thumbnail-border-radius: 2px;
199
+ --media-preview-time-margin: 5px 0 2px;
200
+ color: var(--_primary-color);
201
+ display: inline-block;
202
+ width: 100%;
203
+ height: 100%;
204
+ }
205
+
206
+ :host(.two-tone:not([audio])) {
207
+ --mux-time-range-padding: 0px; /* px is needed in calc() */
208
+ --media-preview-thumbnail-border: 0;
209
+ --media-preview-thumbnail-border-radius: 2px 2px 0 0;
210
+ --media-preview-time-border-radius: 0 0 2px 2px;
211
+ --media-preview-time-margin: 0 0 8px;
212
+ --media-preview-time-text-shadow: none;
213
+ }
214
+
215
+ :host([audio]) {
216
+ --media-preview-time-border-radius: 3px;
217
+ --media-preview-time-margin: 0 0 5px;
218
+ --media-preview-time-text-shadow: none;
219
+ }
220
+
221
+ :host(.two-tone:not([audio])) media-time-range {
222
+ --media-range-track-border-radius: 0;
223
+ }
224
+
225
+ :host([audio]) ::slotted([slot='media']) {
226
+ height: 0px;
227
+ }
228
+
229
+ :host([audio]) :is(media-poster-image, media-loading-indicator) {
230
+ display: none;
231
+ }
232
+
233
+ :host([audio]) media-controller {
234
+ background: transparent;
235
+ }
236
+
237
+ :host([audio]) media-controller::part(vertical-layer) {
238
+ background: transparent;
239
+ }
240
+
241
+ :host([audio]) media-control-bar {
242
+ width: 100%;
243
+ }
244
+
245
+ [disabled],
246
+ [aria-disabled='true'] {
247
+ opacity: 60%;
248
+ cursor: not-allowed;
249
+ }
250
+
251
+ media-captions-button:not(:is([media-captions-list], [media-subtitles-list])) {
252
+ --captions-button: none;
253
+ }
254
+
255
+ media-volume-range[media-volume-unavailable] {
256
+ --volume-range: none;
257
+ }
258
+
259
+ media-airplay-button[media-airplay-unavailable] {
260
+ --airplay-button: none;
261
+ }
262
+
263
+ media-fullscreen-button[media-fullscreen-unavailable] {
264
+ --fullscreen-button: none;
265
+ }
266
+
267
+ media-cast-button[media-cast-unavailable] {
268
+ --cast-button: none;
269
+ }
270
+
271
+ media-pip-button[media-pip-unavailable] {
272
+ --pip-button: none;
273
+ }
274
+
275
+ media-controller {
276
+ width: 100%;
277
+ height: 100%;
278
+ }
279
+
280
+ :host media-time-range {
281
+ color: var(--_primary-color);
282
+ --media-range-thumb-opacity: 0;
283
+ }
284
+
285
+ :host(:not([audio])) media-time-range {
286
+ --media-range-padding-left: var(--mux-time-range-padding, 10px);
287
+ --media-range-padding-right: var(--mux-time-range-padding, 10px);
288
+ --media-range-padding: 0;
289
+ z-index: 10;
290
+ height: 10px;
291
+ bottom: -3px;
292
+ background: linear-gradient(
293
+ 180deg,
294
+ transparent,
295
+ transparent 3px,
296
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 3px,
297
+ var(--media-control-background, rgba(20, 20, 30, 0.7)) 7px,
298
+ transparent 7px,
299
+ transparent
300
+ );
301
+ width: 100%;
302
+ }
303
+
304
+ media-control-bar {
305
+ --media-control-padding: 9px 7px;
306
+ }
307
+
308
+ .size-small media-control-bar {
309
+ --media-control-padding: 9px 5px;
310
+ }
311
+
312
+ .size-extra-small media-control-bar {
313
+ --media-control-padding: 4px 3px;
314
+ }
315
+
316
+ media-control-bar :is([role='button'], [role='switch'], button) {
317
+ line-height: 0;
318
+ }
319
+
320
+ media-control-bar :is(media-text-display, mxp-time-display):first-child {
321
+ --media-control-padding: 9px 5px 9px 10px;
322
+ }
323
+
324
+ .spacer {
325
+ flex-grow: 1;
326
+ background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
327
+ }
328
+
329
+ /* Add a small space on the right to have the play button and
330
+ * fullscreen button aligned in relation to the progress bar. */
331
+ media-control-bar:not([slot])::after {
332
+ content: '';
333
+ width: 2px;
334
+ height: 100%;
335
+ background-color: var(--media-control-background, rgba(20, 20, 30, 0.7));
336
+ }
337
+
338
+ media-control-bar[slot='top-chrome'] {
339
+ min-height: 42px;
340
+ pointer-events: none;
341
+ }
342
+
343
+ :host([title]) media-control-bar[slot='top-chrome']::before {
344
+ content: '';
345
+ position: absolute;
346
+ width: 100%;
347
+ padding-bottom: min(160px, 25%);
348
+ background: linear-gradient(rgb(0 0 0 / 0.4), transparent);
349
+ }
350
+
351
+ media-control-bar[slot='top-chrome'] > * {
352
+ --media-control-background: transparent;
353
+ --media-control-hover-background: transparent;
354
+ position: relative;
355
+ }
356
+
357
+ media-controller::part(vertical-layer) {
358
+ transition: background-color 1s;
359
+ }
360
+
361
+ media-controller:is([media-paused], :not([user-inactive]))::part(vertical-layer) {
362
+ background-color: var(--controls-backdrop-color, var(--controls, transparent));
363
+ transition: background-color 0.25s;
364
+ }
365
+
366
+ .center-controls {
367
+ --media-button-icon-width: 100%;
368
+ --media-button-icon-height: auto;
369
+ pointer-events: none;
370
+ width: 100%;
371
+ display: flex;
372
+ flex-flow: row;
373
+ align-items: center;
374
+ justify-content: center;
375
+ filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.25)) drop-shadow(0 0 6px rgb(0 0 0 / 0.25));
376
+ paint-order: stroke;
377
+ stroke: rgba(102, 102, 102, 1);
378
+ stroke-width: 0.3px;
379
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.25), 0 0 6px rgb(0 0 0 / 0.25);
380
+ }
381
+
382
+ .center-controls media-play-button {
383
+ --media-control-background: transparent;
384
+ --media-control-hover-background: transparent;
385
+ padding: 0;
386
+ width: max(43px, min(10%, 55px));
387
+ }
388
+
389
+ .center-controls media-seek-backward-button,
390
+ .center-controls media-seek-forward-button {
391
+ --media-control-background: transparent;
392
+ --media-control-hover-background: transparent;
393
+ padding: 0;
394
+ margin: 0 2%;
395
+ width: max(33px, min(8%, 40px));
396
+ }
397
+
398
+ media-control-bar:not([slot]) media-seek-backward-button {
399
+ padding-right: 5px;
400
+ }
401
+
402
+ media-control-bar:not([slot]) media-seek-forward-button {
403
+ padding-left: 5px;
404
+ }
405
+
406
+ media-loading-indicator {
407
+ --media-loading-icon-width: 100%;
408
+ --media-button-icon-height: auto;
409
+ pointer-events: none;
410
+ position: absolute;
411
+ width: min(15%, 150px);
412
+ display: flex;
413
+ flex-flow: row;
414
+ align-items: center;
415
+ justify-content: center;
416
+ }
417
+
418
+ /* Intentionally don't target the div for transition but the children
419
+ of the div. Prevents messing with media-chrome's autohide feature. */
420
+ media-loading-indicator + div * {
421
+ transition: opacity 0.15s;
422
+ opacity: 1;
423
+ }
424
+
425
+ media-loading-indicator[media-loading]:not([media-paused]) ~ div > * {
426
+ opacity: 0;
427
+ transition-delay: 400ms;
428
+ }
429
+
430
+ media-volume-range {
431
+ width: min(100%, 100px);
432
+ }
433
+
434
+ media-time-display {
435
+ white-space: nowrap;
436
+ }
437
+
438
+ :is(media-time-display, media-text-display, media-playback-rate-button[role='button']) {
439
+ color: inherit;
440
+ line-height: 24px;
441
+ }
442
+
443
+ .title-display {
444
+ font-size: 16px;
445
+ text-shadow: 0 0 2px rgb(0 0 0 / 0.6);
446
+ }
447
+
448
+ :host([audio]) .title-display {
449
+ flex-grow: 1;
450
+ font-size: 21px;
451
+ }
879
452
  </style>
880
- ${fr(e)}
881
- `,ei=e=>[ce.LIVE,ce.LL_LIVE].includes(e.streamType),gr=e=>[ce.LIVE,ce.LL_LIVE,ce.DVR,ce.LL_DVR].includes(e.streamType),fr=e=>{var a,t,i,r,n,o,c,b,f,v,S,W,E,R,I,D,k,Se,ge,re,vt,yt,Et,kt,Tt,At,xt,wt,Lt,$t,Ct,St,Ot,Mt,Pt,Rt,It,Dt,_t,Nt,Vt,Ht,Bt,Kt;return s`
882
- <${ht((a=st(e.theme))!=null?a:"media-theme-mux")}
883
- has-src="${(t=e.hasSrc)!=null?t:!1}"
884
- has-open-dialog="${(i=e.isDialogOpen)!=null?i:!1}"
885
- nohotkeys="${(r=e.noHotKeys)!=null?r:!1}"
886
- audio="${(n=e.audio)!=null?n:!1}"
887
- style="${(o=Wt({"--primary-color":e.primaryColor,"--secondary-color":e.secondaryColor}))!=null?o:!1}"
888
- class="size-${e.playerSize}${e.secondaryColor?" two-tone":""}"
889
- stream-type="${(c=e.streamType)!=null?c:!1}"
890
- player-size="${(b=e.playerSize)!=null?b:!1}"
891
- default-hidden-captions="${(f=e.defaultHiddenCaptions)!=null?f:!1}"
892
- forward-seek-offset="${(v=e.forwardSeekOffset)!=null?v:!1}"
893
- backward-seek-offset="${(S=e.backwardSeekOffset)!=null?S:!1}"
894
- playbackrates="${(W=e.playbackRates)!=null?W:!1}"
895
- default-show-remaining-time="${(E=e.defaultShowRemainingTime)!=null?E:!1}"
896
- title="${(R=e.title)!=null?R:!1}"
897
- hotkeys="${(I=e.hotKeys)!=null?I:!1}"
898
- poster="${e.poster===""?!1:(D=e.poster)!=null?D:!1}"
899
- placeholder="${(k=e.placeholder)!=null?k:!1}"
453
+ <media-controller
454
+ gestures-disabled="{{disabled}}"
455
+ hotkeys="{{hotkeys}}"
456
+ nohotkeys="{{nohotkeys}}"
457
+ audio="{{audio}}"
458
+ class="size-{{playerSize}}"
459
+ exportparts="layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer"
460
+ >
461
+ <slot name="media" slot="media"></slot>
462
+ <media-poster-image
463
+ slot="poster"
464
+ part="poster"
465
+ src="{{poster}}"
466
+ placeholder-src="{{placeholder}}"
467
+ ></media-poster-image>
468
+ <media-loading-indicator slot="centered-chrome" no-auto-hide></media-loading-indicator>
469
+
470
+ <template partial="TitleDisplay">
471
+ <template if="title">
472
+ <media-text-display part="top title display" class="title-display"> {{title}} </media-text-display>
473
+ </template>
474
+ </template>
475
+
476
+ <template partial="PlayButton">
477
+ <media-play-button
478
+ part="{{section ?? 'bottom'}} play button"
479
+ disabled="{{disabled}}"
480
+ aria-disabled="{{disabled}}"
481
+ >
482
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="play">
483
+ <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" />
484
+ </svg>
485
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="pause">
486
+ <path
487
+ 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"
488
+ />
489
+ </svg>
490
+ </media-play-button>
491
+ </template>
492
+
493
+ <template partial="SeekBackwardButton">
494
+ <media-seek-backward-button
495
+ seek-offset="{{backwardSeekOffset}}"
496
+ part="{{section ?? 'bottom'}} seek-backward button"
497
+ disabled="{{disabled}}"
498
+ aria-disabled="{{disabled}}"
499
+ >
500
+ <svg aria-hidden="true" viewBox="0 0 22 24" slot="backward">
501
+ <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" />
502
+ <text class="value" transform="translate(2.5 21)" style="font-size: 8px; font-family: 'ArialMT', 'Arial'">
503
+ {{backwardSeekOffset}}
504
+ </text>
505
+ </svg>
506
+ </media-seek-backward-button>
507
+ </template>
508
+
509
+ <template partial="SeekForwardButton">
510
+ <media-seek-forward-button
511
+ seek-offset="{{forwardSeekOffset}}"
512
+ part="{{section ?? 'bottom'}} seek-forward button"
513
+ disabled="{{disabled}}"
514
+ aria-disabled="{{disabled}}"
515
+ >
516
+ <svg aria-hidden="true" viewBox="0 0 22 24" slot="forward">
517
+ <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" />
518
+ <text class="value" transform="translate(10 21)" style="font-size: 8px; font-family: 'ArialMT', 'Arial'">
519
+ {{forwardSeekOffset}}
520
+ </text>
521
+ </svg>
522
+ </media-seek-forward-button>
523
+ </template>
524
+
525
+ <template partial="MuteButton">
526
+ <media-mute-button part="bottom mute button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
527
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="high">
528
+ <path
529
+ 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"
530
+ />
531
+ </svg>
532
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="low">
533
+ <path
534
+ 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"
535
+ />
536
+ </svg>
537
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="medium">
538
+ <path
539
+ 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"
540
+ />
541
+ </svg>
542
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="off">
543
+ <path
544
+ 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"
545
+ />
546
+ </svg>
547
+ </media-mute-button>
548
+ </template>
549
+
550
+ <template partial="PipButton">
551
+ <media-pip-button part="bottom pip button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
552
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
553
+ <path
554
+ 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"
555
+ />
556
+ </svg>
557
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
558
+ <path
559
+ 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"
560
+ />
561
+ </svg>
562
+ </media-pip-button>
563
+ </template>
564
+
565
+ <template partial="CaptionsButton">
566
+ <media-captions-button
567
+ default-showing="{{defaultShowingCaptions}}"
568
+ part="bottom captions button"
569
+ disabled="{{disabled}}"
570
+ aria-disabled="{{disabled}}"
571
+ >
572
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="on">
573
+ <path
574
+ 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"
575
+ />
576
+ </svg>
577
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="off">
578
+ <path
579
+ 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"
580
+ />
581
+ </svg>
582
+ </media-captions-button>
583
+ </template>
584
+
585
+ <template partial="AirplayButton">
586
+ <media-airplay-button part="bottom airplay button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
587
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="airplay">
588
+ <path
589
+ 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"
590
+ />
591
+ <path
592
+ 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"
593
+ />
594
+ </svg>
595
+ </media-airplay-button>
596
+ </template>
597
+
598
+ <template partial="FullscreenButton">
599
+ <media-fullscreen-button part="bottom fullscreen button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
600
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="enter">
601
+ <path
602
+ 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"
603
+ />
604
+ </svg>
605
+ <svg aria-hidden="true" viewBox="0 0 24 24" slot="exit">
606
+ <path
607
+ 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"
608
+ />
609
+ </svg>
610
+ </media-fullscreen-button>
611
+ </template>
612
+
613
+ <template partial="CastButton">
614
+ <media-cast-button part="bottom cast button" disabled="{{disabled}}" aria-disabled="{{disabled}}">
615
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="enter">
616
+ <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" />
617
+ <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z" />
618
+ <path
619
+ 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"
620
+ />
621
+ </svg>
622
+ <svg aria-hidden="true" viewBox="0 0 26 24" slot="exit">
623
+ <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" />
624
+ <path d="M3 12.5V14c3.86 0 7 3.14 7 7h1.5A8.5 8.5 0 0 0 3 12.5Z" />
625
+ <path
626
+ 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"
627
+ />
628
+ <path d="M20.5 5.5h-15v5.811c3.52.906 6.283 3.67 7.189 7.19H20.5V5.5Z" />
629
+ </svg>
630
+ </media-cast-button>
631
+ </template>
632
+
633
+ <template partial="PlaybackRateButton">
634
+ <media-playback-rate-button
635
+ rates="{{playbackRates}}"
636
+ part="bottom playback-rate button"
637
+ disabled="{{disabled}}"
638
+ aria-disabled="{{disabled}}"
639
+ ></media-playback-rate-button>
640
+ </template>
641
+
642
+ <template partial="VolumeRange">
643
+ <media-volume-range
644
+ part="bottom volume range"
645
+ disabled="{{disabled}}"
646
+ aria-disabled="{{disabled}}"
647
+ ></media-volume-range>
648
+ </template>
649
+
650
+ <template partial="TimeDisplay">
651
+ <mxp-time-display
652
+ remaining="{{defaultShowRemainingTime}}"
653
+ part="bottom time display"
654
+ disabled="{{disabled}}"
655
+ aria-disabled="{{disabled}}"
656
+ ></mxp-time-display>
657
+ </template>
658
+
659
+ <template partial="TimeRange">
660
+ <media-time-range
661
+ part="bottom time range"
662
+ disabled="{{disabled}}"
663
+ aria-disabled="{{disabled}}"
664
+ ></media-time-range>
665
+ </template>
666
+
667
+ <template if="layout == 'audio on-demand'">
668
+ <template if="title">
669
+ <media-control-bar>{{>TitleDisplay}}</media-control-bar>
670
+ </template>
671
+ <media-control-bar>
672
+ {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>TimeRange}} {{>MuteButton}}
673
+ {{>VolumeRange}} {{>PlaybackRateButton}} {{>AirplayButton}} {{>CastButton}}
674
+ </media-control-bar>
675
+ </template>
676
+
677
+ <template if="layout == 'audio dvr'">
678
+ <template if="title">
679
+ <media-control-bar>{{>TitleDisplay}}</media-control-bar>
680
+ </template>
681
+ <media-control-bar>
682
+ {{>PlayButton}}
683
+ <slot name="seek-live"></slot>
684
+ {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>TimeRange}} {{>MuteButton}} {{>VolumeRange}}
685
+ {{>PlaybackRateButton}} {{>AirplayButton}} {{>CastButton}}
686
+ </media-control-bar>
687
+ </template>
688
+
689
+ <template if="layout == 'audio live'">
690
+ <template if="title">
691
+ <media-control-bar>{{>TitleDisplay}}</media-control-bar>
692
+ </template>
693
+ <media-control-bar>
694
+ {{>PlayButton}}
695
+ <slot name="seek-live"></slot>
696
+ {{>MuteButton}} {{>VolumeRange}}
697
+ <div class="spacer"></div>
698
+ {{>AirplayButton}} {{>CastButton}}
699
+ </media-control-bar>
700
+ </template>
701
+
702
+ <template if="layout == 'on-demand extra-small'">
703
+ {{>TimeRange}}
704
+ <media-control-bar>
705
+ {{>PlayButton}} {{>MuteButton}}
706
+ <div class="spacer"></div>
707
+ {{>CaptionsButton}} {{>FullscreenButton}}
708
+ </media-control-bar>
709
+ </template>
710
+
711
+ <template if="layout == 'on-demand small'">
712
+ <media-control-bar slot="top-chrome"> {{>TitleDisplay}} </media-control-bar>
713
+ <div slot="centered-chrome" class="center-controls">
714
+ {{>SeekBackwardButton section="center"}} {{>PlayButton section="center"}} {{>SeekForwardButton
715
+ section="center"}}
716
+ </div>
717
+ {{>TimeRange}}
718
+ <media-control-bar>
719
+ {{>TimeDisplay}} {{>MuteButton}} {{>VolumeRange}}
720
+ <div class="spacer"></div>
721
+ {{>PlaybackRateButton}} {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}
722
+ {{>FullscreenButton}}
723
+ </media-control-bar>
724
+ </template>
725
+
726
+ <template if="layout == 'on-demand large'">
727
+ <media-control-bar slot="top-chrome"> {{>TitleDisplay}} </media-control-bar>
728
+ <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
729
+ {{>TimeRange}}
730
+ <media-control-bar>
731
+ {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>TimeDisplay}} {{>MuteButton}} {{>VolumeRange}}
732
+ <div class="spacer"></div>
733
+ {{>PlaybackRateButton}} {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}}
734
+ {{>FullscreenButton}}
735
+ </media-control-bar>
736
+ </template>
737
+
738
+ <template if="layout == 'live extra-small'">
739
+ <media-control-bar slot="top-chrome">
740
+ <slot name="seek-live"></slot>
741
+ </media-control-bar>
742
+ <media-control-bar>
743
+ {{>PlayButton}} {{>MuteButton}}
744
+ <div class="spacer"></div>
745
+ {{>CaptionsButton}} {{>FullscreenButton}}
746
+ </media-control-bar>
747
+ </template>
748
+
749
+ <template if="layout == 'live small'">
750
+ <media-control-bar slot="top-chrome">
751
+ <slot name="seek-live"></slot>
752
+ {{>TitleDisplay}}
753
+ </media-control-bar>
754
+ <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
755
+ <media-control-bar>
756
+ {{>MuteButton}} {{>VolumeRange}}
757
+ <div class="spacer"></div>
758
+ {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
759
+ </media-control-bar>
760
+ </template>
761
+
762
+ <template if="layout == 'live large'">
763
+ <media-control-bar slot="top-chrome">
764
+ <slot name="seek-live"></slot>
765
+ {{>TitleDisplay}}
766
+ </media-control-bar>
767
+ <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
768
+ <media-control-bar>
769
+ {{>PlayButton}} {{>MuteButton}} {{>VolumeRange}}
770
+ <div class="spacer"></div>
771
+ {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
772
+ </media-control-bar>
773
+ </template>
774
+
775
+ <template if="layout == 'dvr extra-small'">
776
+ <media-control-bar slot="top-chrome">
777
+ <slot name="seek-live"></slot>
778
+ </media-control-bar>
779
+ {{>TimeRange}}
780
+ <media-control-bar>
781
+ {{>PlayButton}} {{>MuteButton}}
782
+ <div class="spacer"></div>
783
+ {{>CaptionsButton}} {{>FullscreenButton}}
784
+ </media-control-bar>
785
+ </template>
786
+
787
+ <template if="layout == 'dvr small'">
788
+ <media-control-bar slot="top-chrome">
789
+ <slot name="seek-live"></slot>
790
+ {{>TitleDisplay}}
791
+ </media-control-bar>
792
+ <div slot="centered-chrome" class="center-controls">
793
+ {{>SeekBackwardButton section="center"}} {{>PlayButton section="center"}} {{>SeekForwardButton
794
+ section="center"}}
795
+ </div>
796
+ {{>TimeRange}}
797
+ <media-control-bar>
798
+ {{>MuteButton}} {{>VolumeRange}}
799
+ <div class="spacer"></div>
800
+ {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
801
+ </media-control-bar>
802
+ </template>
803
+
804
+ <template if="layout == 'dvr large'">
805
+ <media-control-bar slot="top-chrome">
806
+ <slot name="seek-live"></slot>
807
+ {{>TitleDisplay}}
808
+ </media-control-bar>
809
+ <div slot="centered-chrome" class="center-controls">{{>PlayButton section="center"}}</div>
810
+ {{>TimeRange}}
811
+ <media-control-bar>
812
+ {{>PlayButton}} {{>SeekBackwardButton}} {{>SeekForwardButton}} {{>MuteButton}} {{>VolumeRange}}
813
+ <div class="spacer"></div>
814
+ {{>CaptionsButton}} {{>AirplayButton}} {{>CastButton}} {{>PipButton}} {{>FullscreenButton}}
815
+ </media-control-bar>
816
+ </template>
817
+
818
+ <slot></slot>
819
+ </media-controller>
820
+ </template>
821
+ `;var It=`
822
+ :host {
823
+ z-index: 100;
824
+ display: flex;
825
+ justify-content: center;
826
+ align-items: center;
827
+ width: 100%;
828
+ height: 100%;
829
+ position: absolute;
830
+ top: 0;
831
+ left: 0;
832
+ box-sizing: border-box;
833
+ color: #fff;
834
+ line-height: 18px;
835
+ font-family: Arial, sans-serif;
836
+ padding: var(--media-dialog-backdrop-padding, 0);
837
+ background: var(--media-dialog-backdrop-background,
838
+ linear-gradient(to bottom, rgba(20, 20, 30, 0.7) 50%, rgba(20, 20, 30, 0.9))
839
+ );
840
+ /* Needs to use !important to prevent overwrite of media-chrome */
841
+ transition: var(--media-dialog-transition-open, visibility .2s, opacity .2s) !important;
842
+ transform: var(--media-dialog-transform-open, none) !important;
843
+ visibility: visible !important;
844
+ opacity: 1 !important;
845
+ pointer-events: auto !important;
846
+ }
847
+
848
+ :host(:not([open])) {
849
+ /* Needs to use !important to prevent overwrite of media-chrome */
850
+ transition: var(--media-dialog-transition-close, visibility .1s, opacity .1s) !important;
851
+ transform: var(--media-dialog-transform-close, none) !important;
852
+ visibility: hidden !important;
853
+ opacity: 0 !important;
854
+ pointer-events: none !important;
855
+ }
856
+
857
+ :focus-visible {
858
+ box-shadow: 0 0 0 2px rgba(27, 127, 204, 0.9);
859
+ }
860
+
861
+ .dialog {
862
+ position: relative;
863
+ box-sizing: border-box;
864
+ background: var(--media-dialog-background, none);
865
+ padding: var(--media-dialog-padding, 10px);
866
+ width: min(320px, 100%);
867
+ word-wrap: break-word;
868
+ max-height: 100%;
869
+ overflow: auto;
870
+ text-align: center;
871
+ line-height: 1.4;
872
+ }
873
+ `,_t=E.createElement("template");_t.innerHTML=`
874
+ <style>
875
+ ${It}
876
+ </style>
877
+
878
+ <div class="dialog">
879
+ <slot></slot>
880
+ </div>
881
+ `;var V=class extends h.HTMLElement{constructor(){var e;super();this.attachShadow({mode:"open"}),(e=this.shadowRoot)==null||e.appendChild(this.constructor.template.content.cloneNode(!0))}show(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("open",{composed:!0,bubbles:!0})),Dt(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),ga(this))}attributeChangedCallback(e,i,r){e==="open"&&i!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&Dt(this)}};V.styles=It,V.template=_t,V.observedAttributes=["open"];function Dt(t){let a=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(t.dispatchEvent(a),a.defaultPrevented)return;let e=t.querySelector("[autofocus]:not([disabled])");!e&&t.tabIndex>=0&&(e=t),e||(e=Nt(t.shadowRoot)),t._previouslyFocusedElement=E.activeElement,E.activeElement instanceof HTMLElement&&E.activeElement.blur(),t.addEventListener("transitionend",()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},{once:!0})}function Nt(t){let e=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});e.push('[tabindex]:not([disabled]):not([tabindex=""])');let i=t==null?void 0:t.querySelector(e.join(", "));if(!i&&"attachShadow"in Element.prototype){let r=(t==null?void 0:t.querySelectorAll("*"))||[];for(let o=0;o<r.length&&!(r[o].tagName&&r[o].shadowRoot&&(i=Nt(r[o].shadowRoot),i));o++);}return i}function ga(t){t._previouslyFocusedElement instanceof HTMLElement&&t._previouslyFocusedElement.focus()}h.customElements.get("media-dialog")||(h.customElements.define("media-dialog",V),h.MediaDialog=V);var Ze=V;var Vt=E.createElement("template");Vt.innerHTML=`
882
+ <style>
883
+ ${Ze.styles}
884
+
885
+ .close {
886
+ background: none;
887
+ color: inherit;
888
+ border: none;
889
+ padding: 0;
890
+ font: inherit;
891
+ cursor: pointer;
892
+ outline: inherit;
893
+ width: 28px;
894
+ height: 28px;
895
+ position: absolute;
896
+ top: 1rem;
897
+ right: 1rem;
898
+ }
899
+ </style>
900
+
901
+ <div class="dialog">
902
+ <slot></slot>
903
+ </div>
904
+
905
+ <slot name="close">
906
+ <button class="close" tabindex="0">
907
+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
908
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
909
+ </svg>
910
+ </button>
911
+ </slot>
912
+ `;var ne=class extends Ze{constructor(){var a,e;super(),(e=(a=this.shadowRoot)==null?void 0:a.querySelector(".close"))==null||e.addEventListener("click",()=>{this.close()})}};ne.template=Vt;h.customElements.get("mxp-dialog")||(h.customElements.define("mxp-dialog",ne),h.MxpDialog=ne);import{TemplateInstance as fa,ChildNodePart as Ee,AttrPart as ze}from"media-chrome/dist/media-theme-element.js";var se=new WeakMap,le=class{constructor(a,e){this.element=a;this.type=e;this.element.addEventListener(this.type,this);let i=se.get(this.element);i&&i.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 e=se.get(this.element);e&&e.delete(this.type)}}static for(a){se.has(a.element)||se.set(a.element,new Map);let e=a.attributeName.slice(2),i=se.get(a.element);return i&&i.has(e)?i.get(e):new le(a.element,e)}};function ya(t,a){return t instanceof ze&&t.attributeName.startsWith("on")?(le.for(t).set(a),t.element.removeAttributeNS(t.attributeNamespace,t.attributeName),!0):!1}function va(t,a){return a instanceof ke&&t instanceof Ee?(a.renderInto(t),!0):!1}function ka(t,a){return a instanceof DocumentFragment&&t instanceof Ee?(a.childNodes.length&&t.replace(...a.childNodes),!0):!1}function Ea(t,a){if(t instanceof ze){let e=t.attributeNamespace,i=t.element.getAttributeNS(e,t.attributeName);return String(a)!==i&&(t.value=String(a)),!0}return t.value=String(a),!0}function Ta(t,a){if(typeof a=="boolean"&&t instanceof ze){let e=t.attributeNamespace,i=t.element.hasAttributeNS(e,t.attributeName);return a!==i&&(t.booleanValue=a),!0}return!1}function Aa(t,a){return a===!1&&t instanceof Ee?(t.replace(""),!0):!1}function xa(t,a){Ta(t,a)||ya(t,a)||Aa(t,a)||va(t,a)||ka(t,a)||Ea(t,a)}var We=new Map,$t=new WeakMap,Ht=new WeakMap,ke=class{constructor(a,e,i){this.strings=a;this.values=e;this.processor=i;this.stringsKey=this.strings.join("")}get template(){if(We.has(this.stringsKey))return We.get(this.stringsKey);{let a=E.createElement("template"),e=this.strings.length-1;return a.innerHTML=this.strings.reduce((i,r,o)=>i+r+(o<e?`{{ ${o} }}`:""),""),We.set(this.stringsKey,a),a}}renderInto(a){let e=this.template;if($t.get(a)!==e){$t.set(a,e);let r=new fa(e,this.values,this.processor);Ht.set(a,r),a instanceof Ee?a.replace(...r.children):a.appendChild(r);return}let i=Ht.get(a);i&&i.update(this.values)}},wa={processCallback(t,a,e){var i;if(!!e){for(let[r,o]of a)if(r in e){let n=(i=e[r])!=null?i:"";xa(o,n)}}}};function w(t,...a){return new ke(t,a,wa)}function Kt(t,a){t.renderInto(a)}import{StreamTypes as G}from"@mux/playback-core";var qe=E.createElement("template");"innerHTML"in qe&&(qe.innerHTML=Bt);var Ft=t=>w`
913
+ <style>
914
+ ${Pt}
915
+ </style>
916
+ ${qe.content.cloneNode(!0)}
917
+ ${Ca(t)}
918
+ `,je=t=>[G.LIVE,G.LL_LIVE].includes(t.streamType),Ge=t=>[G.LIVE,G.LL_LIVE,G.DVR,G.LL_DVR].includes(t.streamType),La=t=>{let a="";return t.audio&&(a+="audio "),je(t)?a+="live":Ge(t)?a+="dvr":a+=t.streamType||"on-demand",!t.audio&&t.playerSize&&(a+=` ${t.playerSize}`),a},Sa=t=>{let a=t.hotKeys?`${t.hotKeys}`:"";return Ge(t)&&(a+=" noarrowleft noarrowright"),a},Ca=t=>{var a,e,i,r,o,n,m,b,f,A,D,I,g,C,O,R,y,pe,te,W,et,tt,at,it,rt,ot,nt,st,lt,dt,ut,mt;return w`
919
+ <media-theme
920
+ template="${(a=t.theme)!=null?a:"media-theme-mux"}"
921
+ class="size-${t.playerSize}${t.secondaryColor?" two-tone":""}"
922
+ player-size="${(e=t.playerSize)!=null?e:!1}"
923
+ layout="${La(t)}"
924
+ hotkeys="${Sa(t)||!1}"
925
+ nohotkeys="${t.noHotKeys||!t.hasSrc||t.isDialogOpen||!1}"
926
+ disabled="${!t.hasSrc||t.isDialogOpen}"
927
+ audio="${(i=t.audio)!=null?i:!1}"
928
+ style="${(r=gt({"--primary-color":t.primaryColor,"--secondary-color":t.secondaryColor}))!=null?r:!1}"
929
+ default-showing-captions="${!t.defaultHiddenCaptions}"
930
+ forward-seek-offset="${(o=t.forwardSeekOffset)!=null?o:!1}"
931
+ backward-seek-offset="${(n=t.backwardSeekOffset)!=null?n:!1}"
932
+ playback-rates="${(m=t.playbackRates)!=null?m:!1}"
933
+ default-show-remaining-time="${(b=t.defaultShowRemainingTime)!=null?b:!1}"
934
+ title="${(f=t.title)!=null?f:!1}"
935
+ poster="${t.poster===""?!1:(A=t.poster)!=null?A:!1}"
936
+ placeholder="${(D=t.placeholder)!=null?D:!1}"
900
937
  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"
901
938
  >
902
939
  <mux-video
903
940
  slot="media"
904
- crossorigin="${(Se=e.crossOrigin)!=null?Se:""}"
941
+ crossorigin="${(I=t.crossOrigin)!=null?I:""}"
905
942
  playsinline
906
- autoplay="${(ge=e.autoplay)!=null?ge:!1}"
907
- muted="${(re=e.muted)!=null?re:!1}"
908
- loop="${(vt=e.loop)!=null?vt:!1}"
909
- preload="${(yt=e.preload)!=null?yt:!1}"
910
- debug="${(Et=e.debug)!=null?Et:!1}"
911
- experimental-cmcd="${(kt=e.experimentalCmcd)!=null?kt:!1}"
912
- prefer-cmcd="${(Tt=e.preferCmcd)!=null?Tt:!1}"
913
- disable-cookies="${(At=e.disableCookies)!=null?At:!1}"
914
- prefer-playback="${(xt=e.preferPlayback)!=null?xt:!1}"
915
- start-time="${e.startTime!=null?e.startTime:!1}"
916
- metadata-video-id="${(wt=e.metadataVideoId)!=null?wt:!1}"
917
- metadata-video-title="${($t=(Lt=e.metadataVideoTitle)!=null?Lt:e.title)!=null?$t:!1}"
918
- metadata-viewer-user-id="${(Ct=e.metadataViewerUserId)!=null?Ct:!1}"
919
- beacon-collection-domain="${(St=e.beaconCollectionDomain)!=null?St:!1}"
920
- player-software-name="${(Ot=e.playerSoftwareName)!=null?Ot:!1}"
921
- player-software-version="${(Mt=e.playerSoftwareVersion)!=null?Mt:!1}"
922
- env-key="${(Pt=e.envKey)!=null?Pt:!1}"
923
- stream-type="${(Rt=e.streamType)!=null?Rt:!1}"
924
- custom-domain="${(It=e.customDomain)!=null?It:!1}"
925
- src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
926
- cast-src="${e.src?e.src:e.playbackId?ot(e.playbackId,{domain:e.customDomain,token:e.tokens.playback}):!1}"
927
- cast-stream-type="${ei(e)?"live":!1}"
943
+ autoplay="${(g=t.autoplay)!=null?g:!1}"
944
+ muted="${(C=t.muted)!=null?C:!1}"
945
+ loop="${(O=t.loop)!=null?O:!1}"
946
+ preload="${(R=t.preload)!=null?R:!1}"
947
+ debug="${(y=t.debug)!=null?y:!1}"
948
+ prefer-cmcd="${(pe=t.preferCmcd)!=null?pe:!1}"
949
+ disable-cookies="${(te=t.disableCookies)!=null?te:!1}"
950
+ prefer-playback="${(W=t.preferPlayback)!=null?W:!1}"
951
+ start-time="${t.startTime!=null?t.startTime:!1}"
952
+ beacon-collection-domain="${(et=t.beaconCollectionDomain)!=null?et:!1}"
953
+ player-software-name="${(tt=t.playerSoftwareName)!=null?tt:!1}"
954
+ player-software-version="${(at=t.playerSoftwareVersion)!=null?at:!1}"
955
+ env-key="${(it=t.envKey)!=null?it:!1}"
956
+ stream-type="${(rt=t.streamType)!=null?rt:!1}"
957
+ custom-domain="${(ot=t.customDomain)!=null?ot:!1}"
958
+ src="${t.src?t.src:t.playbackId?Ke(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
959
+ cast-src="${t.src?t.src:t.playbackId?Ke(t.playbackId,{domain:t.customDomain,token:t.tokens.playback}):!1}"
960
+ cast-stream-type="${je(t)?"live":!1}"
928
961
  exportparts="video"
929
962
  >
930
- ${e.storyboard?s`<track label="thumbnails" default kind="metadata" src="${e.storyboard}" />`:s``}
963
+ ${t.storyboard?w`<track label="thumbnails" default kind="metadata" src="${t.storyboard}" />`:w``}
931
964
  </mux-video>
932
- ${gr(e)?s`<button
933
- slot="seek-live"
934
- part="${ei(e)?"top":"bottom"} seek-live button"
935
- disabled="${e.inLiveWindow||!e.hasSrc||e.isDialogOpen}"
936
- aria-disabled="${(e.inLiveWindow||!e.hasSrc||e.isDialogOpen)&&"true"}"
937
- in-live-window="${e.inLiveWindow}"
938
- onclick="${function(mi){var Ut;if((Ut=e.onSeekToLive)==null||Ut.call(e,mi),e.paused){let ci=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(ci)}}}"
939
- >
940
- <svg viewBox="0 0 8 8"><circle cx="4" cy="4" r="4"></circle></svg>
941
- Live
942
- </button>`:s``}
965
+ ${Ge(t)?w`<button
966
+ slot="seek-live"
967
+ part="${je(t)?"top":"bottom"} seek-live button"
968
+ disabled="${t.inLiveWindow||!t.hasSrc||t.isDialogOpen}"
969
+ aria-disabled="${(t.inLiveWindow||!t.hasSrc||t.isDialogOpen)&&"true"}"
970
+ in-live-window="${t.inLiveWindow}"
971
+ onclick="${function(Xt){var ct;if((ct=t.onSeekToLive)==null||ct.call(t,Xt),t.paused){let Qt=new CustomEvent("mediaplayrequest",{composed:!0,bubbles:!0});this.dispatchEvent(Qt)}}}"
972
+ >
973
+ <svg viewBox="0 0 8 8"><circle cx="4" cy="4" r="4"></circle></svg>
974
+ Live
975
+ </button>`:w``}
943
976
  <mxp-dialog
944
977
  no-auto-hide
945
- open="${(Dt=e.isDialogOpen)!=null?Dt:!1}"
946
- onclose="${e.onCloseErrorDialog}"
947
- oninitfocus="${e.onInitFocusDialog}"
978
+ open="${(nt=t.isDialogOpen)!=null?nt:!1}"
979
+ onclose="${t.onCloseErrorDialog}"
980
+ oninitfocus="${t.onInitFocusDialog}"
948
981
  >
949
- ${(_t=e.dialog)!=null&&_t.title?s`<h3>${e.dialog.title}</h3>`:s``}
982
+ ${(st=t.dialog)!=null&&st.title?w`<h3>${t.dialog.title}</h3>`:w``}
950
983
  <p>
951
- ${(Nt=e.dialog)==null?void 0:Nt.message}
952
- ${(Vt=e.dialog)!=null&&Vt.linkUrl?s`<a
953
- href="${e.dialog.linkUrl}"
954
- target="_blank"
955
- rel="external noopener"
956
- aria-label="${(Ht=e.dialog.linkText)!=null?Ht:""} ${u("(opens in a new window)")}"
957
- >${(Bt=e.dialog.linkText)!=null?Bt:e.dialog.linkUrl}</a
958
- >`:s``}
984
+ ${(lt=t.dialog)==null?void 0:lt.message}
985
+ ${(dt=t.dialog)!=null&&dt.linkUrl?w`<a
986
+ href="${t.dialog.linkUrl}"
987
+ target="_blank"
988
+ rel="external noopener"
989
+ aria-label="${(ut=t.dialog.linkText)!=null?ut:""} ${d("(opens in a new window)")}"
990
+ >${(mt=t.dialog.linkText)!=null?mt:t.dialog.linkUrl}</a
991
+ >`:w``}
959
992
  </p>
960
993
  </mxp-dialog>
961
- </${ht((Kt=st(e.theme))!=null?Kt:"media-theme-mux")}>
962
- `};import{MediaError as Ue}from"@mux/mux-video";function Fe(e,a,t,i,r){var c,b,f;let n={},o={};switch(e.code){case Ue.MEDIA_ERR_NETWORK:{switch(n.title=u("Network Error",r),n.message=e.message,(c=e.data)==null?void 0:c.response.code){case 412:{n.title=u("Video is not currently available",r),n.message=u("The live stream or video file are not yet ready.",r),o.message=u("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),o.file="412-not-playable.md";break}case 404:{n.title=u("Video does not exist",r),n.message="",o.message=u("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),o.file="404-not-found.md";break}case 403:{if(n.title=u("Invalid playback URL",r),n.message=u("The video URL or playback-token are formatted with incorrect or incomplete information.",r),o.message=u("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),o.file="missing-signed-tokens.md",!i)break;let{exp:v,aud:S,sub:W}=z(i),E=Date.now()>v*1e3,R=W!==t,I=S!=="v",D={timeStyle:"medium",dateStyle:"medium"};if(E){n.title=u("Video URL has expired",r),n.message=u("The video\u2019s secured playback-token has expired.",r),o.message=u("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(J.code,D).format(v*1e3),currentDate:new Intl.DateTimeFormat(J.code,D).format(Date.now())}),o.file="403-expired-token.md";break}if(R){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),o.message=u("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:t,tokenPlaybackId:W}),o.file="403-playback-id-mismatch.md";break}if(I){n.title=u("Video URL is formatted incorrectly",r),n.message=u("The playback-token is formatted with incorrect information.",r),o.message=u("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:S}),o.file="403-incorrect-aud-value.md";break}o.message=u("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),o.file="403-malformatted-token.md";break}}break}case Ue.MEDIA_ERR_DECODE:{let{message:v}=e;n={title:u("Media Error",r),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,i);break}n={title:u("Source Not Supported",r),message:e.message},o.file="media-src-not-supported.md";break}default:n={title:u("Error",r),message:e.message};break}return a&&(n={title:u("Your device appears to be offline",r),message:u("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:o}}var Tr=Object.values($),Ar=700,xr=300,gt={LG:"large",SM:"small",XS:"extra-small"};function Ze(e){let a=e.getBoundingClientRect();return a.width<xr?gt.XS:a.width<Ar?gt.SM:gt.LG}var Y={SRC:"src",POSTER:"poster"},l={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 wr(e,a){var i,r;return{src:!e.playbackId&&e.src,playbackId:e.playbackId,hasSrc:!!e.playbackId||!!e.src,poster:e.poster,storyboard:e.storyboard,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(l.NOHOTKEYS),hotKeys:e.getAttribute(l.HOTKEYS),muted:e.muted,paused:e.paused,preload:e.preload,envKey:e.envKey,experimentalCmcd:e.experimentalCmcd,preferCmcd:e.preferCmcd,debug:e.debug,disableCookies:e.disableCookies,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(l.PLAYBACK_RATES),customDomain:(i=e.getAttribute(m.CUSTOM_DOMAIN))!=null?i:void 0,playerSize:Ze((r=e.mediaController)!=null?r:e),metadataVideoId:e.getAttribute(m.METADATA_VIDEO_ID),metadataVideoTitle:e.getAttribute(m.METADATA_VIDEO_TITLE),metadataViewerUserId:e.getAttribute(m.METADATA_VIEWER_USER_ID),title:e.getAttribute(l.TITLE),...a}}var Lr=Object.values(m),$r=Object.values(Y),Cr=Object.values(l),Sr=Re(),Or="mux-player",ii={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},ie,Le,Z,$e,he,P,be,We,X,ue,pe,ze,Ce,ft,qe,ri,je,ni,Ge,oi,Xe,si,Je,li,Qe,di,we=class extends mt{constructor(){super();h(this,be);h(this,X);h(this,pe);h(this,Ce);h(this,qe);h(this,je);h(this,Ge);h(this,Xe);h(this,Je);h(this,Qe);h(this,ie,!1);h(this,Le,{});h(this,Z,!0);h(this,$e,new Pe(this,"hotkeys"));h(this,he,void 0);h(this,P,{...ii,onCloseErrorDialog:()=>p(this,X,ue).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{rt(this,O.activeElement)||t.preventDefault()},onSeekToLive:()=>lt(this)});this.attachShadow({mode:"open"}),this.isConnected&&p(this,be,We).call(this)}static get observedAttributes(){var t;return[...(t=mt.observedAttributes)!=null?t:[],...$r,...Lr,...Cr]}get theme(){var t,i;return Array.from((i=(t=this.shadowRoot)==null?void 0:t.children)!=null?i:[]).find(({localName:r})=>r.startsWith("media-theme-"))}get mediaController(){var t,i;return(i=(t=this.theme)==null?void 0:t.shadowRoot)==null?void 0:i.querySelector("media-controller")}connectedCallback(){p(this,Ce,ft).call(this),p(this,qe,ri).call(this)}disconnectedCallback(){p(this,je,ni).call(this)}attributeChangedCallback(t,i,r){switch(d(this,ie)||p(this,be,We).call(this),super.attributeChangedCallback(t,i,r),t){case l.HOTKEYS:d(this,$e).value=r;break;case l.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&q(u("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case l.THUMBNAIL_TOKEN:{let{aud:o}=z(r);r&&o!=="t"&&q(u("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:o}));break}case l.STORYBOARD_TOKEN:{let{aud:o}=z(r);r&&o!=="s"&&q(u("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:o}));break}case m.PLAYBACK_ID:{r!=null&&r.includes("?token")&&M(u("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!Tr.includes(this.streamType)&&Ie({file:"invalid-stream-type.md",message:u("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(u("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}}[m.PLAYBACK_ID,Y.SRC,l.PLAYBACK_TOKEN].includes(t)&&i!==r&&A(this,P,{...d(this,P),...ii}),p(this,pe,ze).call(this,{[Jt(t)]:r})}get experimentalCmcd(){return this.hasAttribute(m.EXPERIMENTAL_CMCD)}set experimentalCmcd(t){!!t!==this.experimentalCmcd&&(t?this.setAttribute(m.EXPERIMENTAL_CMCD,""):this.removeAttribute(m.EXPERIMENTAL_CMCD))}get preferCmcd(){var t;return(t=this.getAttribute(m.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?ai.includes(t)?this.setAttribute(m.PREFER_CMCD,t):q(`Invalid value for preferCmcd. Must be one of ${ai.join()}`):this.removeAttribute(m.PREFER_CMCD))}get hasPlayed(){var t,i;return(i=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?i:!1}get inLiveWindow(){return d(this,P).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(m.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(m.PLAYBACK_ID,t):this.removeAttribute(m.PLAYBACK_ID)}get src(){var t,i;return this.playbackId?(t=ae(this,Y.SRC))!=null?t:void 0:(i=this.getAttribute(Y.SRC))!=null?i:void 0}set src(t){t?this.setAttribute(Y.SRC,t):this.removeAttribute(Y.SRC)}get poster(){var i;let t=this.getAttribute(Y.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return Gt(this.playbackId,{domain:this.customDomain,thumbnailTime:(i=this.thumbnailTime)!=null?i:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Y.POSTER,t):this.removeAttribute(Y.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![$.LIVE,$.LL_LIVE,$.DVR,$.LL_DVR].includes(this.streamType)))return Xt(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(l.AUDIO)}set audio(t){if(!t){this.removeAttribute(l.AUDIO);return}this.setAttribute(l.AUDIO,"")}get hotkeys(){return d(this,$e)}get nohotkeys(){return this.hasAttribute(l.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(l.NOHOTKEYS);return}this.setAttribute(l.NOHOTKEYS,"")}get thumbnailTime(){return _(this.getAttribute(l.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(l.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(l.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(l.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ae(this,l.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(l.PLACEHOLDER,`${t}`)}get primaryColor(){var t;return(t=this.getAttribute(l.PRIMARY_COLOR))!=null?t:void 0}set primaryColor(t){this.setAttribute(l.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var t;return(t=this.getAttribute(l.SECONDARY_COLOR))!=null?t:"rgb(0 0 0 / .65)"}set secondaryColor(t){this.setAttribute(l.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(l.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(l.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(l.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(l.PLAYBACK_RATES))return this.getAttribute(l.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,i)=>t-i)}set playbackRates(t){if(!t){this.removeAttribute(l.PLAYBACK_RATES);return}this.setAttribute(l.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=_(this.getAttribute(l.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(l.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=_(this.getAttribute(l.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(l.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(l.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(l.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(l.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(m.PLAYER_SOFTWARE_NAME))!=null?t:Or}get playerSoftwareVersion(){var t;return(t=this.getAttribute(m.PLAYER_SOFTWARE_VERSION))!=null?t:Sr}get beaconCollectionDomain(){var t;return(t=this.getAttribute(m.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(m.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(m.BEACON_COLLECTION_DOMAIN))}get customDomain(){var t;return(t=this.getAttribute(m.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(m.CUSTOM_DOMAIN,t):this.removeAttribute(m.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ae(this,m.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(m.ENV_KEY,`${t}`)}get debug(){return ae(this,m.DEBUG)!=null}set debug(t){t?this.setAttribute(m.DEBUG,""):this.removeAttribute(m.DEBUG)}get disableCookies(){return ae(this,m.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(m.DISABLE_COOKIES,""):this.removeAttribute(m.DISABLE_COOKIES)}get streamType(){return ae(this,m.STREAM_TYPE)}set streamType(t){this.setAttribute(m.STREAM_TYPE,`${t}`)}get startTime(){return _(ae(this,m.START_TIME))}set startTime(t){this.setAttribute(m.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(m.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(m.PREFER_PLAYBACK,t):this.removeAttribute(m.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(d(this,ie)||p(this,be,We).call(this),!this.media){M("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(l.PLAYBACK_TOKEN),i=this.getAttribute(l.THUMBNAIL_TOKEN),r=this.getAttribute(l.STORYBOARD_TOKEN);return{...d(this,Le),...t!=null?{playback:t}:{},...i!=null?{thumbnail:i}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){A(this,Le,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(l.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(l.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(l.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(l.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(l.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(l.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,i,r,n){var c;let o=(c=this.media)==null?void 0:c.nativeEl;if(!!o)return Er(o,t,i,r,n)}removeTextTrack(t){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(!!i)return kr(i,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ie=new WeakMap,Le=new WeakMap,Z=new WeakMap,$e=new WeakMap,he=new WeakMap,P=new WeakMap,be=new WeakSet,We=function(){var t,i,r;if(!d(this,ie)){A(this,ie,!0),p(this,X,ue).call(this,{playerSize:Ze(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof g.HTMLElement))throw""}catch{M(`<${(t=this.theme)==null?void 0:t.localName}> failed to upgrade!`)}try{if(customElements.upgrade(this.media),!(this.media instanceof yr))throw""}catch{M("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof vr))throw""}catch{M("<media-controller> failed to upgrade!")}ra(this),p(this,Xe,si).call(this),p(this,Je,li).call(this),p(this,Ge,oi).call(this),A(this,Z,(r=(i=this.mediaController)==null?void 0:i.hasAttribute("user-inactive"))!=null?r:!0),p(this,Qe,di).call(this)}},X=new WeakSet,ue=function(t){Object.assign(d(this,P),t),p(this,pe,ze).call(this)},pe=new WeakSet,ze=function(t={}){_e(ti(wr(this,{...d(this,P),...t})),this.shadowRoot)},Ce=new WeakSet,ft=function(){var t,i;d(this,P).playerSize!=Ze((t=this.mediaController)!=null?t:this)&&p(this,X,ue).call(this,{playerSize:Ze((i=this.mediaController)!=null?i:this)})},qe=new WeakSet,ri=function(){var t;A(this,he,new ResizeObserver(()=>p(this,Ce,ft).call(this))),d(this,he).observe((t=this.mediaController)!=null?t:this)},je=new WeakSet,ni=function(){var t;(t=d(this,he))==null||t.disconnect()},Ge=new WeakSet,oi=function(){var i,r,n,o,c;(i=this.mediaController)==null||i.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[$.LIVE,$.LL_LIVE,$.DVR,$.LL_DVR].includes(this.streamType)&&this.hasPlayed&&lt(this)});let t=()=>{let b=ea(this),f=d(this,P).inLiveWindow;b!==f&&(p(this,X,ue).call(this,{inLiveWindow:b}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",t),(n=this.media)==null||n.addEventListener("waiting",t),(o=this.media)==null||o.addEventListener("timeupdate",t),(c=this.media)==null||c.addEventListener("emptied",t)},Xe=new WeakSet,si=function(){var i;let t=r=>{let{detail:n}=r;if(n instanceof pt||(n=new pt(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){q(n),n.data&&q(`${n.name} data:`,n.data);return}let{dialog:o,devlog:c}=Fe(n,!window.navigator.onLine,this.playbackId,this.playbackToken);c.message&&Ie(c),M(n),n.data&&M(`${n.name} data:`,n.data),p(this,X,ue).call(this,{isDialogOpen:!0,dialog:o})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var o,c,b;if(!((o=this.media)!=null&&o.error))return r;let{devlog:n}=Fe((c=this.media)==null?void 0:c.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):r.player_error_message}}),(i=this.media)==null||i.addEventListener("error",r=>{var o,c;let{detail:n}=r;if(!n){let{message:b,code:f}=(c=(o=this.media)==null?void 0:o.error)!=null?c:{};n=new pt(b,f)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Je=new WeakSet,li=function(){var i,r,n,o;let t=()=>p(this,pe,ze).call(this);(r=(i=this.media)==null?void 0:i.textTracks)==null||r.addEventListener("addtrack",t),(o=(n=this.media)==null?void 0:n.textTracks)==null||o.addEventListener("removetrack",t)},Qe=new WeakSet,di=function(){var v,S,W;let t=this.mediaController,i=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(i)return;let r,n=new WeakMap,o=()=>this.streamType&&[$.LIVE,$.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,c=(E,R,I=!1)=>{if(o())return;Array.from(E&&E.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!R||this.paused){let Se=k.text.split(`
963
- `).length,ge=i?-2:-3;this.streamType&&[$.LIVE,$.LL_LIVE].includes(this.streamType)&&(ge=i?-1:-2);let re=ge-Se;if(k.line===re&&!I)return;n.has(k)||n.set(k,k.line),k.line=re-1,k.line=re}else setTimeout(()=>{k.line=n.get(k)||"auto"},500)})},b=()=>{var E;c(r,(E=t==null?void 0:t.hasAttribute("user-inactive"))!=null?E:!1)},f=()=>{var I;let R=Array.from(((I=t==null?void 0:t.media)==null?void 0:I.textTracks)||[]).filter(D=>["subtitles","captions"].includes(D.kind)&&D.mode==="showing")[0];R!==r&&(r==null||r.removeEventListener("cuechange",b)),r=R,r==null||r.addEventListener("cuechange",b),c(r,d(this,Z))};if(f(),(v=t==null?void 0:t.media)==null||v.textTracks.addEventListener("change",f),(S=t==null?void 0:t.media)==null||S.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let E=()=>{c(r,d(this,Z),!0),this.paused||window.requestAnimationFrame(E)};(W=t==null?void 0:t.media)==null||W.addEventListener("playing",()=>{E()})}t==null||t.addEventListener("userinactivechange",()=>{let E=t==null?void 0:t.hasAttribute("user-inactive");d(this,Z)!==E&&(A(this,Z,E),c(r,d(this,Z)))})};function ae(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 vo=we;export{pt as MediaError,vo as default,ae as getVideoAttribute};
994
+ </media-theme>
995
+ `};import{MediaError as Te}from"@mux/mux-video";function Ae(t,a,e,i,r){var m,b,f;let o={},n={};switch(t.code){case Te.MEDIA_ERR_NETWORK:{switch(o.title=d("Network Error",r),o.message=t.message,(m=t.data)==null?void 0:m.response.code){case 412:{o.title=d("Video is not currently available",r),o.message=d("The live stream or video file are not yet ready.",r),n.message=d("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),n.file="412-not-playable.md";break}case 404:{o.title=d("Video does not exist",r),o.message="",n.message=d("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),n.file="404-not-found.md";break}case 403:{if(o.title=d("Invalid playback URL",r),o.message=d("The video URL or playback-token are formatted with incorrect or incomplete information.",r),n.message=d("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),n.file="missing-signed-tokens.md",!i)break;let{exp:A,aud:D,sub:I}=_(i),g=Date.now()>A*1e3,C=I!==e,O=D!=="v",R={timeStyle:"medium",dateStyle:"medium"};if(g){o.title=d("Video URL has expired",r),o.message=d("The video\u2019s secured playback-token has expired.",r),n.message=d("This playback is using signed URLs and the playback-token has expired. Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(H.code,R).format(A*1e3),currentDate:new Intl.DateTimeFormat(H.code,R).format(Date.now())}),n.file="403-expired-token.md";break}if(C){o.title=d("Video URL is formatted incorrectly",r),o.message=d("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.message=d("The specified playback ID {playbackId} and the playback ID encoded in the playback-token {tokenPlaybackId} do not match.",r).format({playbackId:e,tokenPlaybackId:I}),n.file="403-playback-id-mismatch.md";break}if(O){o.title=d("Video URL is formatted incorrectly",r),o.message=d("The playback-token is formatted with incorrect information.",r),n.message=d("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:D}),n.file="403-incorrect-aud-value.md";break}n.message=d("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),n.file="403-malformatted-token.md";break}}break}case Te.MEDIA_ERR_DECODE:{let{message:A}=t;o={title:d("Media Error",r),message:A},n.file="media-decode-error.md";break}case Te.MEDIA_ERR_SRC_NOT_SUPPORTED:{let A=(f=(b=t.data)==null?void 0:b.response)==null?void 0:f.code;if(A>=400&&A<500){t.code=Te.MEDIA_ERR_NETWORK,t.data={response:{code:A}},{dialog:o,devlog:n}=Ae(t,a,e,i);break}o={title:d("Source Not Supported",r),message:t.message},n.file="media-src-not-supported.md";break}default:o={title:d("Error",r),message:t.message};break}return a&&(o={title:d("Your device appears to be offline",r),message:d("Check your internet connection and try reloading this video.",r)}),{dialog:o,devlog:n}}var Ba=Object.values(x),Da=700,Ia=300,Xe={LG:"large",SM:"small",XS:"extra-small"};function we(t){let a=t.getBoundingClientRect();return a.width<Ia?Xe.XS:a.width<Da?Xe.SM:Xe.LG}var P={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 _a(t,a){var i,r;return{src:!t.playbackId&&t.src,playbackId:t.playbackId,hasSrc:!!t.playbackId||!!t.src,poster:t.poster,storyboard:t.storyboard,placeholder:t.getAttribute("placeholder"),theme:t.getAttribute("theme"),thumbnailTime:!t.tokens.thumbnail&&t.thumbnailTime,autoplay:t.autoplay,crossOrigin:t.crossOrigin,loop:t.loop,noHotKeys:t.hasAttribute(s.NOHOTKEYS),hotKeys:t.getAttribute(s.HOTKEYS),muted:t.muted,paused:t.paused,preload:t.preload,envKey:t.envKey,preferCmcd:t.preferCmcd,debug:t.debug,disableCookies:t.disableCookies,tokens:t.tokens,beaconCollectionDomain:t.beaconCollectionDomain,metadata:t.metadata,playerSoftwareName:t.playerSoftwareName,playerSoftwareVersion:t.playerSoftwareVersion,startTime:t.startTime,preferPlayback:t.preferPlayback,audio:t.audio,streamType:t.streamType,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,forwardSeekOffset:t.forwardSeekOffset,backwardSeekOffset:t.backwardSeekOffset,defaultHiddenCaptions:t.defaultHiddenCaptions,defaultShowRemainingTime:t.defaultShowRemainingTime,playbackRates:t.getAttribute(s.PLAYBACK_RATES),customDomain:(i=t.getAttribute(u.CUSTOM_DOMAIN))!=null?i:void 0,playerSize:we((r=t.mediaController)!=null?r:t),title:t.getAttribute(s.TITLE),...a}}var Na=Object.values(u),Va=Object.values(P),$a=Object.values(s),Ha=fe(),Ka="mux-player",Yt={dialog:void 0,isDialogOpen:!1,inLiveWindow:!1},Z,ue,B,me,X,S,Q,Le,Ce,Zt,$,J,ee,Se,ce,Qe,Oe,Wt,Re,zt,Me,qt,Pe,jt,Be,Gt,De,Jt,de=class extends Ye{constructor(){super();c(this,Q);c(this,Ce);c(this,$);c(this,ee);c(this,ce);c(this,Oe);c(this,Re);c(this,Me);c(this,Pe);c(this,Be);c(this,De);c(this,Z,!1);c(this,ue,{});c(this,B,!0);c(this,me,new ge(this,"hotkeys"));c(this,X,void 0);c(this,S,{...Yt,onCloseErrorDialog:()=>p(this,$,J).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:e=>{$e(this,E.activeElement)||e.preventDefault()},onSeekToLive:()=>Fe(this)});this.attachShadow({mode:"open"}),p(this,Ce,Zt).call(this),this.isConnected&&p(this,Q,Le).call(this)}static get observedAttributes(){var e;return[...(e=Ye.observedAttributes)!=null?e:[],...Va,...Na,...$a]}get theme(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("media-theme")}get mediaController(){var e,i;return(i=(e=this.theme)==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("media-controller")}get metadataFromAttrs(){return this.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,i)=>{let r=this.getAttribute(i);return r!==null&&(e[i.replace(/^metadata-/,"").replace(/-/g,"_")]=r),e},{})}connectedCallback(){var i;p(this,ce,Qe).call(this);let e=(i=this.shadowRoot)==null?void 0:i.querySelector("mux-video");e&&(e.metadata=this.metadataFromAttrs),p(this,Oe,Wt).call(this)}disconnectedCallback(){p(this,Re,zt).call(this)}attributeChangedCallback(e,i,r){switch(l(this,Z)||p(this,Q,Le).call(this),super.attributeChangedCallback(e,i,r),e){case s.HOTKEYS:l(this,me).value=r;break;case s.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&N(d("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case s.THUMBNAIL_TOKEN:{let{aud:n}=_(r);r&&n!=="t"&&N(d("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case s.STORYBOARD_TOKEN:{let{aud:n}=_(r);r&&n!=="s"&&N(d("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case u.PLAYBACK_ID:{r!=null&&r.includes("?token")&&L(d("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r})),this.streamType?this.streamType!=null&&!Ba.includes(this.streamType)&&ye({file:"invalid-stream-type.md",message:d("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})}):ye({file:"invalid-stream-type.md",message:String(d("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,P.SRC,s.PLAYBACK_TOKEN].includes(e)&&i!==r&&k(this,S,{...l(this,S),...Yt}),p(this,ee,Se).call(this,{[Tt(e)]:r})}get preferCmcd(){var e;return(e=this.getAttribute(u.PREFER_CMCD))!=null?e:void 0}set preferCmcd(e){e!==this.preferCmcd&&(e?Ut.includes(e)?this.setAttribute(u.PREFER_CMCD,e):N(`Invalid value for preferCmcd. Must be one of ${Ut.join()}`):this.removeAttribute(u.PREFER_CMCD))}get hasPlayed(){var e,i;return(i=(e=this.mediaController)==null?void 0:e.hasAttribute("media-has-played"))!=null?i:!1}get inLiveWindow(){return l(this,S).inLiveWindow}get _hls(){var e;return(e=this.media)==null?void 0:e._hls}get mux(){var e;return(e=this.media)==null?void 0:e.mux}get playbackId(){var e;return(e=this.getAttribute(u.PLAYBACK_ID))!=null?e:void 0}set playbackId(e){e?this.setAttribute(u.PLAYBACK_ID,e):this.removeAttribute(u.PLAYBACK_ID)}get src(){var e,i;return this.playbackId?(e=Y(this,P.SRC))!=null?e:void 0:(i=this.getAttribute(P.SRC))!=null?i:void 0}set src(e){e?this.setAttribute(P.SRC,e):this.removeAttribute(P.SRC)}get poster(){var i;let e=this.getAttribute(P.POSTER);if(e!=null)return e;if(this.playbackId&&!this.audio)return kt(this.playbackId,{domain:this.customDomain,thumbnailTime:(i=this.thumbnailTime)!=null?i:this.startTime,token:this.tokens.thumbnail})}set poster(e){e||e===""?this.setAttribute(P.POSTER,e):this.removeAttribute(P.POSTER)}get storyboard(){if(this.playbackId&&!this.audio&&(!this.streamType||![x.LIVE,x.LL_LIVE,x.DVR,x.LL_DVR].includes(this.streamType)))return Et(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(s.AUDIO)}set audio(e){if(!e){this.removeAttribute(s.AUDIO);return}this.setAttribute(s.AUDIO,"")}get hotkeys(){return l(this,me)}get nohotkeys(){return this.hasAttribute(s.NOHOTKEYS)}set nohotkeys(e){if(!e){this.removeAttribute(s.NOHOTKEYS);return}this.setAttribute(s.NOHOTKEYS,"")}get thumbnailTime(){return M(this.getAttribute(s.THUMBNAIL_TIME))}set thumbnailTime(e){this.setAttribute(s.THUMBNAIL_TIME,`${e}`)}get title(){var e;return(e=this.getAttribute(s.TITLE))!=null?e:""}set title(e){e!==this.title&&(e?this.setAttribute(s.TITLE,e):this.removeAttribute("title"),super.title=e)}get placeholder(){var e;return(e=Y(this,s.PLACEHOLDER))!=null?e:""}set placeholder(e){this.setAttribute(s.PLACEHOLDER,`${e}`)}get primaryColor(){var e;return(e=this.getAttribute(s.PRIMARY_COLOR))!=null?e:void 0}set primaryColor(e){this.setAttribute(s.PRIMARY_COLOR,`${e}`)}get secondaryColor(){var e;return(e=this.getAttribute(s.SECONDARY_COLOR))!=null?e:"rgb(0 0 0 / .65)"}set secondaryColor(e){this.setAttribute(s.SECONDARY_COLOR,`${e}`)}get defaultShowRemainingTime(){return this.hasAttribute(s.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(e){e?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(e=>Number(e)).filter(e=>!Number.isNaN(e)).sort((e,i)=>e-i)}set playbackRates(e){if(!e){this.removeAttribute(s.PLAYBACK_RATES);return}this.setAttribute(s.PLAYBACK_RATES,e.join(" "))}get forwardSeekOffset(){var e;return(e=M(this.getAttribute(s.FORWARD_SEEK_OFFSET)))!=null?e:10}set forwardSeekOffset(e){this.setAttribute(s.FORWARD_SEEK_OFFSET,`${e}`)}get backwardSeekOffset(){var e;return(e=M(this.getAttribute(s.BACKWARD_SEEK_OFFSET)))!=null?e:10}set backwardSeekOffset(e){this.setAttribute(s.BACKWARD_SEEK_OFFSET,`${e}`)}get defaultHiddenCaptions(){return this.hasAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(e){e?this.setAttribute(s.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(s.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var e;return(e=this.getAttribute(u.PLAYER_SOFTWARE_NAME))!=null?e:Ka}get playerSoftwareVersion(){var e;return(e=this.getAttribute(u.PLAYER_SOFTWARE_VERSION))!=null?e:Ha}get beaconCollectionDomain(){var e;return(e=this.getAttribute(u.BEACON_COLLECTION_DOMAIN))!=null?e:void 0}set beaconCollectionDomain(e){e!==this.beaconCollectionDomain&&(e?this.setAttribute(u.BEACON_COLLECTION_DOMAIN,e):this.removeAttribute(u.BEACON_COLLECTION_DOMAIN))}get customDomain(){var e;return(e=this.getAttribute(u.CUSTOM_DOMAIN))!=null?e:void 0}set customDomain(e){e!==this.customDomain&&(e?this.setAttribute(u.CUSTOM_DOMAIN,e):this.removeAttribute(u.CUSTOM_DOMAIN))}get envKey(){var e;return(e=Y(this,u.ENV_KEY))!=null?e:void 0}set envKey(e){this.setAttribute(u.ENV_KEY,`${e}`)}get debug(){return Y(this,u.DEBUG)!=null}set debug(e){e?this.setAttribute(u.DEBUG,""):this.removeAttribute(u.DEBUG)}get disableCookies(){return Y(this,u.DISABLE_COOKIES)!=null}set disableCookies(e){e?this.setAttribute(u.DISABLE_COOKIES,""):this.removeAttribute(u.DISABLE_COOKIES)}get streamType(){return Y(this,u.STREAM_TYPE)}set streamType(e){this.setAttribute(u.STREAM_TYPE,`${e}`)}get startTime(){return M(Y(this,u.START_TIME))}set startTime(e){this.setAttribute(u.START_TIME,`${e}`)}get preferPlayback(){let e=this.getAttribute(u.PREFER_PLAYBACK);if(e===xe.MSE||e===xe.NATIVE)return e}set preferPlayback(e){e!==this.preferPlayback&&(e===xe.MSE||e===xe.NATIVE?this.setAttribute(u.PREFER_PLAYBACK,e):this.removeAttribute(u.PREFER_PLAYBACK))}get metadata(){var e;return(e=this.media)==null?void 0:e.metadata}set metadata(e){if(l(this,Z)||p(this,Q,Le).call(this),!this.media){L("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...this.metadataFromAttrs,...e}}get tokens(){let e=this.getAttribute(s.PLAYBACK_TOKEN),i=this.getAttribute(s.THUMBNAIL_TOKEN),r=this.getAttribute(s.STORYBOARD_TOKEN);return{...l(this,ue),...e!=null?{playback:e}:{},...i!=null?{thumbnail:i}:{},...r!=null?{storyboard:r}:{}}}set tokens(e){k(this,ue,e!=null?e:{})}get playbackToken(){var e;return(e=this.getAttribute(s.PLAYBACK_TOKEN))!=null?e:void 0}set playbackToken(e){this.setAttribute(s.PLAYBACK_TOKEN,`${e}`)}get thumbnailToken(){var e;return(e=this.getAttribute(s.THUMBNAIL_TOKEN))!=null?e:void 0}set thumbnailToken(e){this.setAttribute(s.THUMBNAIL_TOKEN,`${e}`)}get storyboardToken(){var e;return(e=this.getAttribute(s.STORYBOARD_TOKEN))!=null?e:void 0}set storyboardToken(e){this.setAttribute(s.STORYBOARD_TOKEN,`${e}`)}addTextTrack(e,i,r,o){var m;let n=(m=this.media)==null?void 0:m.nativeEl;if(!!n)return Ma(n,e,i,r,o)}removeTextTrack(e){var r;let i=(r=this.media)==null?void 0:r.nativeEl;if(!!i)return Pa(i,e)}get textTracks(){var e;return(e=this.media)==null?void 0:e.textTracks}};Z=new WeakMap,ue=new WeakMap,B=new WeakMap,me=new WeakMap,X=new WeakMap,S=new WeakMap,Q=new WeakSet,Le=function(){var e,i;if(!l(this,Z)){k(this,Z,!0),p(this,$,J).call(this,{playerSize:we(this)});try{if(customElements.upgrade(this.theme),!(this.theme instanceof h.HTMLElement))throw""}catch{L("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof Ra))throw""}catch{L("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Oa))throw""}catch{L("<media-controller> failed to upgrade!")}Ct(this),p(this,Pe,jt).call(this),p(this,Be,Gt).call(this),p(this,Me,qt).call(this),k(this,B,(i=(e=this.mediaController)==null?void 0:e.hasAttribute("user-inactive"))!=null?i:!0),p(this,De,Jt).call(this)}},Ce=new WeakSet,Zt=function(){var e,i;try{(e=window==null?void 0:window.CSS)==null||e.registerProperty({name:"--primary-color",syntax:"<color>",inherits:!0,initialValue:"white"}),(i=window==null?void 0:window.CSS)==null||i.registerProperty({name:"--secondary-color",syntax:"<color>",inherits:!0,initialValue:"transparent"})}catch{}},$=new WeakSet,J=function(e){Object.assign(l(this,S),e),p(this,ee,Se).call(this)},ee=new WeakSet,Se=function(e={}){Kt(Ft(_a(this,{...l(this,S),...e})),this.shadowRoot)},ce=new WeakSet,Qe=function(){var e,i;l(this,S).playerSize!=we((e=this.mediaController)!=null?e:this)&&p(this,$,J).call(this,{playerSize:we((i=this.mediaController)!=null?i:this)})},Oe=new WeakSet,Wt=function(){var e;k(this,X,new ResizeObserver(()=>p(this,ce,Qe).call(this))),l(this,X).observe((e=this.mediaController)!=null?e:this)},Re=new WeakSet,zt=function(){var e;(e=l(this,X))==null||e.disconnect()},Me=new WeakSet,qt=function(){var i,r,o,n,m;(i=this.mediaController)==null||i.addEventListener("mediaplayrequest",b=>{var f;((f=b.target)==null?void 0:f.localName)==="media-play-button"&&this.streamType&&[x.LIVE,x.LL_LIVE,x.DVR,x.LL_DVR].includes(this.streamType)&&this.hasPlayed&&Fe(this)});let e=()=>{let b=xt(this),f=l(this,S).inLiveWindow;b!==f&&(p(this,$,J).call(this,{inLiveWindow:b}),this.dispatchEvent(new CustomEvent("inlivewindowchange",{composed:!0,bubbles:!0,detail:this.inLiveWindow})))};(r=this.media)==null||r.addEventListener("progress",e),(o=this.media)==null||o.addEventListener("waiting",e),(n=this.media)==null||n.addEventListener("timeupdate",e),(m=this.media)==null||m.addEventListener("emptied",e)},Pe=new WeakSet,jt=function(){var i;let e=r=>{let{detail:o}=r;if(o instanceof Je||(o=new Je(o.message,o.code,o.fatal)),!(o!=null&&o.fatal)){N(o),o.data&&N(`${o.name} data:`,o.data);return}let{dialog:n,devlog:m}=Ae(o,!window.navigator.onLine,this.playbackId,this.playbackToken);m.message&&ye(m),L(o),o.data&&L(`${o.name} data:`,o.data),p(this,$,J).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",e),this.media&&(this.media.errorTranslator=(r={})=>{var n,m,b;if(!((n=this.media)!=null&&n.error))return r;let{devlog:o}=Ae((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:o.message?String(o.message):r.player_error_message}}),(i=this.media)==null||i.addEventListener("error",r=>{var n,m;let{detail:o}=r;if(!o){let{message:b,code:f}=(m=(n=this.media)==null?void 0:n.error)!=null?m:{};o=new Je(b,f)}!(o!=null&&o.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:o}))})},Be=new WeakSet,Gt=function(){var i,r,o,n;let e=()=>p(this,ee,Se).call(this);(r=(i=this.media)==null?void 0:i.textTracks)==null||r.addEventListener("addtrack",e),(n=(o=this.media)==null?void 0:o.textTracks)==null||n.addEventListener("removetrack",e)},De=new WeakSet,Jt=function(){var A,D,I;let e=this.mediaController,i=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(i)return;let r,o=new WeakMap,n=()=>this.streamType&&[x.LIVE,x.LL_LIVE].includes(this.streamType)&&!this.secondaryColor&&this.offsetWidth>=800,m=(g,C,O=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(y=>{if(!(!y.snapToLines||y.line<-5||y.line>=0&&y.line<10))if(!C||this.paused){let pe=y.text.split(`
996
+ `).length,te=i?-2:-3;this.streamType&&[x.LIVE,x.LL_LIVE].includes(this.streamType)&&(te=i?-1:-2);let W=te-pe;if(y.line===W&&!O)return;o.has(y)||o.set(y,y.line),y.line=W-1,y.line=W}else setTimeout(()=>{y.line=o.get(y)||"auto"},500)})},b=()=>{var g;m(r,(g=e==null?void 0:e.hasAttribute("user-inactive"))!=null?g:!1)},f=()=>{var O;let C=Array.from(((O=e==null?void 0:e.media)==null?void 0:O.textTracks)||[]).filter(R=>["subtitles","captions"].includes(R.kind)&&R.mode==="showing")[0];C!==r&&(r==null||r.removeEventListener("cuechange",b)),r=C,r==null||r.addEventListener("cuechange",b),m(r,l(this,B))};if(f(),(A=e==null?void 0:e.media)==null||A.textTracks.addEventListener("change",f),(D=e==null?void 0:e.media)==null||D.textTracks.addEventListener("addtrack",f),navigator.userAgent.includes("Chrome/")){let g=()=>{m(r,l(this,B),!0),this.paused||window.requestAnimationFrame(g)};(I=e==null?void 0:e.media)==null||I.addEventListener("playing",()=>{g()})}e==null||e.addEventListener("userinactivechange",()=>{let g=e==null?void 0:e.hasAttribute("user-inactive");l(this,B)!==g&&(k(this,B,g),m(r,l(this,B)))})};function Y(t,a){return t.media?t.media.getAttribute(a):t.getAttribute(a)}h.customElements.get("mux-player")||(h.customElements.define("mux-player",de),h.MuxPlayerElement=de);var Yi=de;export{Je as MediaError,Yi as default,Y as getVideoAttribute};