@mux/mux-player 1.10.1 → 1.11.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.cjs.js CHANGED
@@ -1,31 +1,27 @@
1
- "use strict";var Tl=Object.create;var Pi=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var kl=Object.getOwnPropertyNames;var Ml=Object.getPrototypeOf,Sl=Object.prototype.hasOwnProperty;var wl=(i,e)=>{for(var t in e)Pi(i,t,{get:e[t],enumerable:!0})},Zs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kl(e))!Sl.call(i,r)&&r!==t&&Pi(i,r,{get:()=>e[r],enumerable:!(a=Il(e,r))||a.enumerable});return i};var Cl=(i,e,t)=>(t=i!=null?Tl(Ml(i)):{},Zs(e||!i||!i.__esModule?Pi(t,"default",{value:i,enumerable:!0}):t,i)),Ll=i=>Zs(Pi({},"__esModule",{value:!0}),i);var tr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var I=(i,e,t)=>(tr(i,e,"read from private field"),t?t.call(i):e.get(i)),R=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},j=(i,e,t,a)=>(tr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var U=(i,e,t)=>(tr(i,e,"access private method"),t);var Zc={};wl(Zc,{MediaError:()=>v.MediaError,default:()=>Gc,getVideoAttribute:()=>ct});module.exports=Ll(Zc);var ht=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends ht{}globalThis.DocumentFragment=i}var Ft=class extends ht{},ir=class extends ht{},xl={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Ft)}},Kt,ar=class{constructor(e,t={}){R(this,Kt,void 0);j(this,Kt,t==null?void 0:t.detail)}get detail(){return I(this,Kt)}initCustomEvent(){}};Kt=new WeakMap;function Rl(i,e){return new Ft}var qs={document:{createElement:Rl},DocumentFragment,customElements:xl,CustomEvent:ar,EventTarget:ht,HTMLElement:Ft,HTMLVideoElement:ir},Qs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",O=Qs?qs:globalThis,Q=Qs?qs.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},Yt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},E={MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered",MEDIA_STREAM_TYPE:"media-stream-type",MEDIA_TARGET_LIVE_WINDOW:"media-target-live-window",MEDIA_TIME_IS_LIVE:"media-time-is-live"},Xc=Object.entries(Yt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),zs=Object.entries(o).reduce((i,[e,t])=>{let a=Yt[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),pt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Ze={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var rr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},re={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},se={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var W={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},C={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`},Ol={...W,...C};function Ui(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function Xs(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Js(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Bi(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var js=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Nl=(i,e)=>{let t=i===1?js[e].singular:js[e].plural;return`${i} ${t}`},qe=i=>{if(!Js(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,c)=>l&&Nl(l,c)).filter(l=>l).join(", ")}${t?" remaining":""}`};function z(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),s=Math.floor(i/3600),n=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(s=r=a="-"),s=s>0||l>0?s+":":"",r=((s||n>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+s+r+a}var $i=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},Ul=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Hi=(i,e)=>Ul(i,e)[0],Gt=(i,e)=>!i||!e?!1:i.contains(e)?!0:Gt(i,e.getRootNode().host),Qe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Qe(i.getRootNode().host,e)};function D(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let s of r!=null?r:[])if(s.selectorText===e)return s}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}var Wi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},sr=class{observe(){}},en={ResizeObserver:sr,HTMLElement:class extends Wi{},DocumentFragment:class extends Wi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},Bl={createElement:function(){return new en.HTMLElement},addEventListener(){},removeEventListener(){}},tn=typeof window=="undefined"||typeof window.customElements=="undefined",d=tn?en:window,u=tn?Bl:window.document;var $l=Object.defineProperty,Hl=(i,e,t)=>e in i?$l(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Wl=(i,e,t)=>(Hl(i,typeof e!="symbol"?e+"":e,t),t),an=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ee=(i,e,t)=>(an(i,e,"read from private field"),t?t.call(i):e.get(i)),Vi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Fi=(i,e,t,a)=>(an(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ue,Ki,bt,Yi,rn=u.createElement("template");rn.innerHTML=`
1
+ "use strict";var Il=Object.create;var Ui=Object.defineProperty;var kl=Object.getOwnPropertyDescriptor;var Ml=Object.getOwnPropertyNames;var Sl=Object.getPrototypeOf,wl=Object.prototype.hasOwnProperty;var Ll=(i,e)=>{for(var t in e)Ui(i,t,{get:e[t],enumerable:!0})},ts=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ml(e))!wl.call(i,r)&&r!==t&&Ui(i,r,{get:()=>e[r],enumerable:!(a=kl(e,r))||a.enumerable});return i};var Cl=(i,e,t)=>(t=i!=null?Il(Sl(i)):{},ts(e||!i||!i.__esModule?Ui(t,"default",{value:i,enumerable:!0}):t,i)),Rl=i=>ts(Ui({},"__esModule",{value:!0}),i);var nr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var I=(i,e,t)=>(nr(i,e,"read from private field"),t?t.call(i):e.get(i)),x=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},te=(i,e,t,a)=>(nr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var P=(i,e,t)=>(nr(i,e,"access private method"),t);var Vu={};Ll(Vu,{MediaError:()=>E.MediaError,default:()=>Wu,getVideoAttribute:()=>ht});module.exports=Rl(Vu);var ft=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends ft{}globalThis.DocumentFragment=i}var Gt=class extends ft{},sr=class extends ft{},xl={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Gt)}},Zt,or=class{constructor(e,t={}){x(this,Zt,void 0);te(this,Zt,t==null?void 0:t.detail)}get detail(){return I(this,Zt)}initCustomEvent(){}};Zt=new WeakMap;function Dl(i,e){return new Gt}var is={document:{createElement:Dl},DocumentFragment,customElements:xl,CustomEvent:or,EventTarget:ft,HTMLElement:Gt,HTMLVideoElement:sr},as=typeof window=="undefined"||typeof globalThis.customElements=="undefined",O=as?is:globalThis,X=as?is.document:globalThis.document;var p={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_CAPTIONS_REQUEST:"mediashowcaptionsrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_CAPTIONS_REQUEST:"mediadisablecaptionsrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},qt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaairplayunavailablechange",MEDIA_PIP_UNAVAILABLE:"mediapipunavailablechange",MEDIA_PAUSED:"mediapausedchange",MEDIA_HAS_PLAYED:"mediahasplayedchange",MEDIA_MUTED:"mediamutedchange",MEDIA_VOLUME_LEVEL:"mediavolumelevelchange",MEDIA_VOLUME:"mediavolumechange",MEDIA_VOLUME_UNAVAILABLE:"mediavolumeunavailablechange",MEDIA_IS_PIP:"mediaispipchange",MEDIA_IS_CASTING:"mediaiscastingchange",MEDIA_CAPTIONS_LIST:"mediacaptionslistchange",MEDIA_SUBTITLES_LIST:"mediasubtitleslistchange",MEDIA_CAPTIONS_SHOWING:"mediacaptionsshowingchange",MEDIA_SUBTITLES_SHOWING:"mediasubtitlesshowingchange",MEDIA_IS_FULLSCREEN:"mediaisfullscreenchange",MEDIA_PLAYBACK_RATE:"mediaplaybackratechange",MEDIA_CURRENT_TIME:"mediacurrenttimechange",MEDIA_DURATION:"mediadurationchange",MEDIA_SEEKABLE:"mediaseekablechange",MEDIA_PREVIEW_IMAGE:"mediapreviewimagechange",MEDIA_PREVIEW_COORDS:"mediapreviewcoordschange",MEDIA_LOADING:"medialoadingchange",USER_INACTIVE:"userinactivechange"},v={MEDIA_CHROME_ATTRIBUTES:"media-chrome-attributes",MEDIA_CONTROLLER:"media-controller"},o={MEDIA_AIRPLAY_UNAVAILABLE:"media-airplay-unavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"media-fullscreen-unavailable",MEDIA_PIP_UNAVAILABLE:"media-pip-unavailable",MEDIA_CAST_UNAVAILABLE:"media-cast-unavailable",MEDIA_PAUSED:"media-paused",MEDIA_HAS_PLAYED:"media-has-played",MEDIA_MUTED:"media-muted",MEDIA_VOLUME_LEVEL:"media-volume-level",MEDIA_VOLUME:"media-volume",MEDIA_VOLUME_UNAVAILABLE:"media-volume-unavailable",MEDIA_IS_PIP:"media-is-pip",MEDIA_IS_CASTING:"media-is-casting",MEDIA_CAPTIONS_LIST:"media-captions-list",MEDIA_SUBTITLES_LIST:"media-subtitles-list",MEDIA_CAPTIONS_SHOWING:"media-captions-showing",MEDIA_SUBTITLES_SHOWING:"media-subtitles-showing",MEDIA_IS_FULLSCREEN:"media-is-fullscreen",MEDIA_PLAYBACK_RATE:"media-playback-rate",MEDIA_CURRENT_TIME:"media-current-time",MEDIA_DURATION:"media-duration",MEDIA_SEEKABLE:"media-seekable",MEDIA_PREVIEW_TIME:"media-preview-time",MEDIA_PREVIEW_IMAGE:"media-preview-image",MEDIA_PREVIEW_COORDS:"media-preview-coords",MEDIA_LOADING:"media-loading",MEDIA_BUFFERED:"media-buffered",MEDIA_STREAM_TYPE:"media-stream-type",MEDIA_TARGET_LIVE_WINDOW:"media-target-live-window",MEDIA_TIME_IS_LIVE:"media-time-is-live"},Gu=Object.entries(qt).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"user-inactive"}),rs=Object.entries(o).reduce((i,[e,t])=>{let a=qt[e];return a&&(i[t]=a),i},{"user-inactive":"userinactivechange"}),vt={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Qe={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var lr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Ae={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},se={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var W={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:i=1}={})=>`current playback rate ${i}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading"},S={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",AIRPLAY:()=>"air play",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:i=30}={})=>`seek forward ${i} seconds`,SEEK_BACK_N_SECS:({seekOffset:i=30}={})=>`seek back ${i} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"},Nl={...W,...S};function Bi(i,e=!1){return i.split("_").map(function(t,a){return(a||e?t[0].toUpperCase():t[0].toLowerCase())+t.slice(1).toLowerCase()}).join("")}function ns(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ss(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function $i(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Hi=i=>new Promise(e=>setTimeout(e,i));var os=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Pl=(i,e)=>{let t=i===1?os[e].singular:os[e].plural;return`${i} ${t}`},ze=i=>{if(!ss(i))return"";let e=Math.abs(i),t=e!==i,a=new Date(0,0,0,0,0,e,0);return`${[a.getHours(),a.getMinutes(),a.getSeconds()].map((l,u)=>l&&Pl(l,u)).filter(l=>l).join(", ")}${t?" remaining":""}`};function J(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let a=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600),s=Math.floor(e/60%60),l=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="-"),n=n>0||l>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Ul=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});function ls(i=Ul){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}var Wi=(i,e,t=".value")=>{let a=i.querySelector(t);!a||(a.textContent=e)},$l=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Vi=(i,e)=>$l(i,e)[0],Qt=(i,e)=>!i||!e?!1:i.contains(e)?!0:Qt(i,e.getRootNode().host),Xe=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||Xe(i.getRootNode().host,e)};function D(i,e){var t;let a;for(a of i.querySelectorAll("style")){let r;try{r=(t=a.sheet)==null?void 0:t.cssRules}catch{continue}for(let n of r!=null?r:[])if(n.selectorText===e)return n}return a!=null&&a.sheet?(a.sheet.insertRule(`${e}{}`,a.sheet.cssRules.length),a.sheet.cssRules[a.sheet.cssRules.length-1]):{style:{setProperty:()=>{},removeProperty:()=>{}}}}var Fi=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},dr=class{observe(){}},ds={ResizeObserver:dr,HTMLElement:class extends Fi{},DocumentFragment:class extends Fi{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){}},Hl={createElement:function(){return new ds.HTMLElement},addEventListener(){},removeEventListener(){}},us=typeof window=="undefined"||typeof window.customElements=="undefined",d=us?ds:window,m=us?Hl:window.document;var Wl=Object.defineProperty,Vl=(i,e,t)=>e in i?Wl(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Fl=(i,e,t)=>(Vl(i,typeof e!="symbol"?e+"":e,t),t),cs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ie=(i,e,t)=>(cs(i,e,"read from private field"),t?t.call(i):e.get(i)),Ki=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Yi=(i,e,t,a)=>(cs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ce,Gi,Et,Zi,ms=m.createElement("template");ms.innerHTML=`
2
2
  <style>
3
3
  :host {
4
+ font: var(--media-font,
5
+ var(--media-font-weight, bold)
6
+ var(--media-font-size, 14px) /
7
+ var(--media-text-content-height, var(--media-control-height, 24px))
8
+ var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
9
+ color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
10
+ background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
11
+ padding: var(--media-control-padding, 10px);
4
12
  display: inline-flex;
5
13
  align-items: center;
6
14
  justify-content: center;
7
15
  vertical-align: middle;
8
16
  box-sizing: border-box;
9
- background: var(--media-control-background, rgba(20,20,30, 0.7));
10
-
11
- padding: var(--media-control-padding, 10px);
12
-
13
-
14
- font-size: 14px;
15
- line-height: var(--media-text-content-height, var(--media-control-height, 24px));
16
- font-weight: bold;
17
- color: #fff;
18
-
19
- transition: background 0.15s linear;
20
-
17
+ transition: background .15s linear;
21
18
  pointer-events: auto;
22
19
  cursor: pointer;
23
- font-family: Arial, sans-serif;
24
20
  }
25
21
 
26
22
 
27
23
  :host(:focus-visible) {
28
- box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
24
+ box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
29
25
  outline: 0;
30
26
  }
31
27
 
@@ -35,7 +31,7 @@
35
31
  }
36
32
 
37
33
  :host(:hover) {
38
- background: var(--media-control-hover-background, rgba(50,50,70, 0.7));
34
+ background: var(--media-control-hover-background, rgba(50 50 70 / .7));
39
35
  }
40
36
 
41
37
  svg, img, ::slotted(svg), ::slotted(img) {
@@ -43,19 +39,19 @@
43
39
  height: var(--media-button-icon-height, var(--media-control-height, 24px));
44
40
  transform: var(--media-button-icon-transform);
45
41
  transition: var(--media-button-icon-transition);
46
- fill: var(--media-icon-color, #eee);
42
+ fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
47
43
  vertical-align: middle;
48
44
  max-width: 100%;
49
45
  max-height: 100%;
50
46
  min-width: 100%;
51
47
  }
52
48
  </style>
53
- `;var Gi=class extends d.HTMLElement{constructor(e={}){super(),Vi(this,ue,void 0),Wl(this,"preventClick",!1),Vi(this,Ki,s=>{this.preventClick||this.handleClick(s)}),Vi(this,bt,s=>{let{key:n}=s;if(!this.keysUsed.includes(n)){this.removeEventListener("keyup",ee(this,bt));return}this.preventClick||this.handleClick(s)}),Vi(this,Yi,s=>{let{metaKey:n,altKey:l,key:c}=s;if(n||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",ee(this,bt));return}this.addEventListener("keyup",ee(this,bt),{once:!0})}),this.attachShadow({mode:"open"});let t=rn.content.cloneNode(!0);this.nativeEl=t;let a=e.slotTemplate;a||(a=u.createElement("template"),a.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(a.content.cloneNode(!0)),this.shadowRoot.appendChild(t);let{style:r}=D(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",E.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",ee(this,Ki)),this.addEventListener("keydown",ee(this,Yi)),this.setAttribute("tabindex","0")}disable(){this.removeEventListener("click",ee(this,Ki)),this.removeEventListener("keydown",ee(this,Yi)),this.removeEventListener("keyup",ee(this,bt)),this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER?(t&&((s=(r=ee(this,ue))==null?void 0:r.unassociateElement)==null||s.call(r,this),Fi(this,ue,null)),a&&(Fi(this,ue,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=ee(this,ue))==null?void 0:l.associateElement)==null||c.call(l,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(Fi(this,ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ee(this,ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ee(this,ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),Fi(this,ue,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};ue=new WeakMap;Ki=new WeakMap;bt=new WeakMap;Yi=new WeakMap;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",Gi);var S=Gi;var Vl=`<svg aria-hidden="true" viewBox="0 0 26 24">
49
+ `;var qi=class extends d.HTMLElement{constructor(e={}){if(super(),Ki(this,ce,void 0),Fl(this,"preventClick",!1),Ki(this,Gi,a=>{this.preventClick||this.handleClick(a)}),Ki(this,Et,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",ie(this,Et));return}this.preventClick||this.handleClick(a)}),Ki(this,Zi,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",ie(this,Et));return}this.addEventListener("keyup",ie(this,Et),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=ms.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}let{style:t}=D(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",v.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",ie(this,Gi)),this.addEventListener("keydown",ie(this,Zi)),this.setAttribute("tabindex","0")}disable(){this.removeEventListener("click",ie(this,Gi)),this.removeEventListener("keydown",ie(this,Zi)),this.removeEventListener("keyup",ie(this,Et)),this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER?(t&&((n=(r=ie(this,ce))==null?void 0:r.unassociateElement)==null||n.call(r,this),Yi(this,ce,null)),a&&(Yi(this,ce,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ie(this,ce))==null?void 0:l.associateElement)==null||u.call(l,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(Yi(this,ce,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ie(this,ce))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=ie(this,ce))==null?void 0:e.unassociateElement)==null||t.call(e,this),Yi(this,ce,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};ce=new WeakMap;Gi=new WeakMap;Et=new WeakMap;Zi=new WeakMap;d.customElements.get("media-chrome-button")||d.customElements.define("media-chrome-button",qi);var L=qi;var Kl=`<svg aria-hidden="true" viewBox="0 0 26 24">
54
50
  <path d="M22.13 3H3.87a.87.87 0 0 0-.87.87v13.26a.87.87 0 0 0 .87.87h3.4L9 16H5V5h16v11h-4l1.72 2h3.4a.87.87 0 0 0 .87-.87V3.87a.87.87 0 0 0-.86-.87Zm-8.75 11.44a.5.5 0 0 0-.76 0l-4.91 5.73a.5.5 0 0 0 .38.83h9.82a.501.501 0 0 0 .38-.83l-4.91-5.73Z"/>
55
51
  </svg>
56
- `,sn=u.createElement("template");sn.innerHTML=`
57
- <slot name="airplay">${Vl}</slot>
58
- `;var nr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:sn,...e})}connectedCallback(){this.setAttribute("aria-label",C.AIRPLAY()),super.connectedCallback()}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",nr);var Fl='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Kl='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',on=u.createElement("template");on.innerHTML=`
52
+ `,hs=m.createElement("template");hs.innerHTML=`
53
+ <slot name="airplay">${Kl}</slot>
54
+ `;var ur=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:hs,...e})}connectedCallback(){this.setAttribute("aria-label",S.AIRPLAY()),super.connectedCallback()}handleClick(){let e=new d.CustomEvent(p.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};d.customElements.get("media-airplay-button")||d.customElements.define("media-airplay-button",ur);var Yl='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/></g></svg>',Gl='<svg aria-hidden="true" viewBox="0 0 24 24"><g><path class="cast_caf_icon_arch0" d="M1,18 L1,21 L4,21 C4,19.3 2.66,18 1,18 L1,18 Z"/><path class="cast_caf_icon_arch1" d="M1,14 L1,16 C3.76,16 6,18.2 6,21 L8,21 C8,17.13 4.87,14 1,14 L1,14 Z"/><path class="cast_caf_icon_arch2" d="M1,10 L1,12 C5.97,12 10,16.0 10,21 L12,21 C12,14.92 7.07,10 1,10 L1,10 Z"/><path class="cast_caf_icon_box" d="M21,3 L3,3 C1.9,3 1,3.9 1,5 L1,8 L3,8 L3,5 L21,5 L21,19 L14,19 L14,21 L21,21 C22.1,21 23,20.1 23,19 L23,5 C23,3.9 22.1,3 21,3 L21,3 Z"/><path class="cast_caf_icon_boxfill" d="M5,7 L5,8.63 C8,8.6 13.37,14 13.37,17 L19,17 L19,7 Z"/></g></svg>',bs=m.createElement("template");bs.innerHTML=`
59
55
  <style>
60
56
  :host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]) > *,
61
57
  :host([${o.MEDIA_IS_CASTING}]) ::slotted(:not([slot=exit])) {
@@ -69,16 +65,16 @@
69
65
  }
70
66
  </style>
71
67
 
72
- <slot name="enter">${Fl}</slot>
73
- <slot name="exit">${Kl}</slot>
74
- `;var nn=i=>{let t=i.getAttribute(o.MEDIA_IS_CASTING)!=null?C.EXIT_CAST():C.ENTER_CAST();i.setAttribute("aria-label",t)},or=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:on,...e})}connectedCallback(){nn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_CASTING&&nn(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",or);var ln=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Re=(i,e,t)=>(ln(i,e,"read from private field"),t?t.call(i):e.get(i)),Yl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Zi=(i,e,t,a)=>(ln(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Z,dn=u.createElement("template");dn.innerHTML=`
68
+ <slot name="enter">${Yl}</slot>
69
+ <slot name="exit">${Gl}</slot>
70
+ `;var ps=i=>{let t=i.getAttribute(o.MEDIA_IS_CASTING)!=null?S.EXIT_CAST():S.ENTER_CAST();i.setAttribute("aria-label",t)},cr=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:bs,...e})}connectedCallback(){ps(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_CASTING&&ps(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_CASTING)!=null?p.MEDIA_EXIT_CAST_REQUEST:p.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-cast-button")||d.customElements.define("media-cast-button",cr);var fs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},De=(i,e,t)=>(fs(i,e,"read from private field"),t?t.call(i):e.get(i)),Zl=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Qi=(i,e,t,a)=>(fs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),q,vs=m.createElement("template");vs.innerHTML=`
75
71
  <style>
76
72
  :host {
77
73
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
78
74
  box-sizing: border-box;
79
75
  }
80
76
  </style>
81
- `;var lr=class extends d.HTMLElement{constructor(e={}){super(),Yl(this,Z,void 0);let t=this.attachShadow({mode:"open"}),a=dn.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}static get observedAttributes(){return[E.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER&&(t&&((s=(r=Re(this,Z))==null?void 0:r.unassociateElement)==null||s.call(r,this),Zi(this,Z,null)),a&&(Zi(this,Z,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Re(this,Z))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a,r;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0),Zi(this,Z,Gl(this)),this.getAttribute(E.MEDIA_CONTROLLER)&&((t=(e=Re(this,Z))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=Re(this,Z))==null||a.addEventListener("pointerdown",this),(r=Re(this,Z))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(E.MEDIA_CONTROLLER)&&((t=(e=Re(this,Z))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=Re(this,Z))==null||a.removeEventListener("pointerdown",this),(r=Re(this,Z))==null||r.removeEventListener("click",this),Zi(this,Z,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:s,clientY:n}=e,{left:l,top:c,width:m,height:f}=this.getBoundingClientRect(),_=s-l,g=n-c;if(_<0||g<0||_>m||g>f||m===0&&f===0)return;let{pointerType:y=this._pointerType}=e;if(this._pointerType=void 0,y===rr.TOUCH){this.handleTap(e);return}else if(y===rr.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};Z=new WeakMap;function Gl(i){var e;let t=i.getAttribute(E.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Qe(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",lr);var cn=u.createElement("template");cn.innerHTML=`
77
+ `;var mr=class extends d.HTMLElement{constructor(e={}){if(super(),Zl(this,q,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=vs.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[v.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER&&(t&&((n=(r=De(this,q))==null?void 0:r.unassociateElement)==null||n.call(r,this),Qi(this,q,null)),a&&(Qi(this,q,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=De(this,q))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a,r;this.setAttribute("tabindex",-1),this.setAttribute("aria-hidden",!0),Qi(this,q,ql(this)),this.getAttribute(v.MEDIA_CONTROLLER)&&((t=(e=De(this,q))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=De(this,q))==null||a.addEventListener("pointerdown",this),(r=De(this,q))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(v.MEDIA_CONTROLLER)&&((t=(e=De(this,q))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=De(this,q))==null||a.removeEventListener("pointerdown",this),(r=De(this,q))==null||r.removeEventListener("click",this),Qi(this,q,null)}handleEvent(e){var t;let a=(t=e.composedPath())==null?void 0:t[0];if(!!["video","media-controller"].includes(a==null?void 0:a.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){let{clientX:n,clientY:s}=e,{left:l,top:u,width:c,height:f}=this.getBoundingClientRect(),A=n-l,g=s-u;if(A<0||g<0||A>c||g>f||c===0&&f===0)return;let{pointerType:y=this._pointerType}=e;if(this._pointerType=void 0,y===lr.TOUCH){this.handleTap(e);return}else if(y===lr.MOUSE){this.handleMouseClick(e);return}}}}handleTap(e){}handleMouseClick(e){let t=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}};q=new WeakMap;function ql(i){var e;let t=i.getAttribute(v.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):Xe(i,"media-controller")}d.customElements.get("media-gesture-receiver")||d.customElements.define("media-gesture-receiver",mr);var Es=m.createElement("template");Es.innerHTML=`
82
78
  <style>
83
79
 
84
80
  :host([media-is-fullscreen]) ::slotted([slot=media]) {
@@ -193,43 +189,43 @@
193
189
 
194
190
  <slot part="bottom chrome"></slot>
195
191
  </span>
196
- `;var Zl=Object.values(o),ql="sm:384 md:576 lg:768 xl:960",Ql=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:ql,s=zl(r),n=Xl(s,t.contentRect);Object.keys(s).forEach(l=>{if(n.includes(l)){a.hasAttribute(`breakpoint-${l}`)||a.setAttribute(`breakpoint-${l}`,"");return}a.removeAttribute(`breakpoint-${l}`)})}};function zl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Xl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var qi=class extends d.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(cn.content.cloneNode(!0));let e=n=>{let l=this.media;for(let c of n)c.type==="childList"&&(c.removedNodes.forEach(m=>{if(m.slot=="media"&&c.target==this){let f=c.previousSibling&&c.previousSibling.previousElementSibling;if(!f||!l)this.mediaUnsetCallback(m);else{let _=f.slot!=="media";for(;(f=f.previousSibling)!==null;)f.slot=="media"&&(_=!1);_&&this.mediaUnsetCallback(m)}}}),l&&c.addedNodes.forEach(m=>{m==l&&this.handleMediaUpdated(l).then(f=>this.mediaSetCallback(f))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=new ResizeObserver(Ql);this.resizeObserver=a,a.observe(this);let r=this.media,s=this.querySelector(":scope > slot[slot=media]");s&&s.addEventListener("slotchange",()=>{if(!s.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(Zl)}attributeChangedCallback(e,t,a){e.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=s=>Promise.resolve(s),a=s=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',s),Promise.reject(s));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?W.AUDIO_PLAYER():W.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(n=>this.mediaSetCallback(n)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0||this.hasAttribute("user-inactive"))return;this.setAttribute("user-inactive","");let n=new d.CustomEvent(Yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(n)},r=()=>{if(!this.hasAttribute("user-inactive"))return;this.removeAttribute("user-inactive");let n=new d.CustomEvent(Yt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(n)},s=()=>{r(),d.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=d.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{s()}),this.addEventListener("pointerup",n=>{n.pointerType==="touch"?[this,this.media].includes(n.target)&&!this.hasAttribute("user-inactive")?a():s():n.composedPath().some(l=>{var c;return["media-play-button","media-fullscreen-button"].includes((c=l==null?void 0:l.nodeName)==null?void 0:c.toLowerCase())})&&s()}),this.addEventListener("pointermove",n=>{n.pointerType==="mouse"&&n.target!==this&&(r(),d.clearTimeout(this._inactiveTimeout),[this,this.media].includes(n.target)&&s())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),d.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};d.customElements.get("media-container-temp")||d.customElements.define("media-container-temp",qi);var un=qi;var mn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},V=(i,e,t)=>(mn(i,e,"read from private field"),t?t.call(i):e.get(i)),dr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},cr=(i,e,t,a)=>(mn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ft,Et,X,Qi=class{constructor(e,t){dr(this,ft,void 0),dr(this,Et,void 0),dr(this,X,new Set),cr(this,ft,e),cr(this,Et,t)}[Symbol.iterator](){return V(this,X).values()}get length(){return V(this,X).size}get value(){var e;return(e=[...V(this,X)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(cr(this,X,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...V(this,X)][e]}values(){return V(this,X).values()}keys(){return V(this,X).keys()}forEach(e){V(this,X).forEach(e)}add(...e){var t,a;e.forEach(r=>V(this,X).add(r)),!(this.value===""&&!((t=V(this,ft))!=null&&t.hasAttribute(`${V(this,Et)}`)))&&((a=V(this,ft))==null||a.setAttribute(`${V(this,Et)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>V(this,X).delete(a)),(t=V(this,ft))==null||t.setAttribute(`${V(this,Et)}`,`${this.value}`)}contains(e){return V(this,X).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};ft=new WeakMap;Et=new WeakMap;X=new WeakMap;var N={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};u.fullscreenElement===void 0&&(N.enter="webkitRequestFullScreen",N.exit=u.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",N.event="webkitfullscreenchange",N.element="webkitFullscreenElement",N.error="webkitfullscreenerror",N.enabled="webkitFullscreenEnabled");var ur=(i="")=>i.split(/\s+/),hn=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},Zt=(i="",e={})=>ur(i).map(t=>{let a=hn(t);return{...e,...a}}),Jl=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?hn(e):e):typeof i=="string"?Zt(i):[i],mr=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,ne=(i=[])=>Array.prototype.map.call(i,mr).join(" "),jl=(i,e)=>t=>t[i]===e,pn=i=>{let e=Object.entries(i).map(([t,a])=>jl(t,a));return t=>e.every(a=>a(t))},qt=(i,e=[],t=[])=>{let a=Jl(t).map(pn),r=s=>a.some(n=>n(s));Array.from(e).filter(r).forEach(s=>{s.mode=i})},vt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:pn(e);return Array.from(i.textTracks).filter(t)},hr=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},ze=i=>{var e,t,a,r;if(hr(i)){let n=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(n){let c=new window.CustomEvent(p.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(c)}let l=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(l&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}else{let[n]=(t=ur((e=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?e:""))!=null?t:[];if(n){let l=new window.CustomEvent(p.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:n});i.dispatchEvent(l)}else if(i.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[l]=(r=ur((a=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?a:""))!=null?r:[];if(l){let c=new window.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}}}};var vr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Je=(i,e,t)=>(vr(i,e,"read from private field"),t?t.call(i):e.get(i)),zi=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bn=(i,e,t,a)=>(vr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gt=(i,e,t)=>(vr(i,e,"access private method"),t),De,zt,_t,ei,Ji,pr,ed=Object.values(se),gn=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],td=10,fn=0,ea=class extends un{constructor(){super(),zi(this,_t),zi(this,Ji),zi(this,De,new Qi(this,"hotkeys")),zi(this,zt,void 0),ud||(this._airplayUnavailable=re.UNSUPPORTED),vn||(this._fullscreenUnavailable=re.UNAVAILABLE),md||(this._castUnavailable=re.UNSUPPORTED),dd||(this._pipUnavailable=re.UNSUPPORTED),jt!==void 0?jt||(this._volumeUnavailable=re.UNSUPPORTED):cd.then(()=>{jt||(this._volumeUnavailable=re.UNSUPPORTED,this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this);let e={MEDIA_PLAY_REQUEST:(t,a)=>{let r=Qt[o.MEDIA_STREAM_TYPE](this),s=this.getAttribute("noautoseektolive")===null;r==se.LIVE&&s&&e.MEDIA_SEEK_TO_LIVE_REQUEST(t,a),this.media.play().catch(()=>{})},MEDIA_PAUSE_REQUEST:()=>this.media.pause(),MEDIA_MUTE_REQUEST:()=>this.media.muted=!0,MEDIA_UNMUTE_REQUEST:()=>{let t=this.media;t.muted=!1,t.volume===0&&(t.volume=.25)},MEDIA_VOLUME_REQUEST:t=>{let a=this.media,r=t.detail;a.volume=r,r>0&&a.muted&&(a.muted=!1);try{d.localStorage.setItem("media-chrome-pref-volume",r.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:()=>{if(!vn){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}let t=this.media;u.pictureInPictureElement&&u.exitPictureInPicture(),super[N.enter]?this.fullscreenElement[N.enter]():t.webkitEnterFullscreen?t.webkitEnterFullscreen():t.requestFullscreen?t.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{u[N.exit]()},MEDIA_ENTER_PIP_REQUEST:()=>{let t=this.media;if(!u.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!t.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}u[N.element]&&u[N.exit]();let a=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};t.requestPictureInPicture().catch(r=>{if(r.code===11)if(t.readyState===0&&t.preload==="none"){let s=()=>{t.removeEventListener("loadedmetadata",n),t.preload="none"},n=()=>{t.requestPictureInPicture().catch(a),s()};t.addEventListener("loadedmetadata",n),t.preload="metadata",setTimeout(()=>{t.readyState===0&&a(),s()},1e3)}else throw r;else throw r})},MEDIA_EXIT_PIP_REQUEST:()=>{u.pictureInPictureElement&&u.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:()=>{var t;let a=this.media;!((t=globalThis.CastableVideoElement)!=null&&t.castEnabled)||(u[N.element]&&u[N.exit](),a.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var t;(t=globalThis.CastableVideoElement)!=null&&t.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:t=>{let a=this.media,r=t.detail;(a.readyState>0||a.readyState===void 0)&&(a.currentTime=r)},MEDIA_PLAYBACK_RATE_REQUEST:t=>{this.media.playbackRate=t.detail},MEDIA_PREVIEW_REQUEST:t=>{var a;let r=this.media;if(!r)return;let s=t.detail;s===null&&this.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_TIME,s);let[n]=vt(r,{kind:pt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(s===null){this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let l=Array.prototype.find.call(n.cues,_=>_.startTime>=s);if(!l)return;let c=/'^(?:[a-z]+:)?\/\//i.test(l.text)||(a=r.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,m=new URL(l.text,c),f=new URLSearchParams(m.hash).get("#xywh");this.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,m.href),this.propagateMediaState(o.MEDIA_PREVIEW_COORDS,f.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:t=>{let a=ji(this),{detail:r=[]}=t;qt(Ze.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:t=>{let a=ji(this),{detail:r=[]}=t;qt(Ze.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:t=>{let a=Jt(this),{detail:r=[]}=t;qt(Ze.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:t=>{let a=Jt(this),{detail:r=[]}=t;qt(Ze.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:()=>{let{media:t}=this;if(!!t){if(!(t.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}t.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:(t,a)=>{let r=a.seekable;if(!r){console.warn("MediaController: Media element does not support seeking to live.");return}if(!r.length){console.warn("MediaController: Media is unable to seek to live.");return}a.currentTime=r.end(r.length-1)}};if(Object.keys(e).forEach(t=>{let a=`_handle${Ui(t,!0)}`;this[a]=r=>{if(r.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}e[t](r,this.media)},this.addEventListener(p[t],this[a])}),this._mediaStatePropagators={"play,pause,emptied":()=>{this.propagateMediaState(o.MEDIA_PAUSED,_n(this))},"playing,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_HAS_PLAYED,!((t=this.media)!=null&&t.paused))},volumechange:()=>{this.propagateMediaState(o.MEDIA_MUTED,An(this)),this.propagateMediaState(o.MEDIA_VOLUME,yn(this)),this.propagateMediaState(o.MEDIA_VOLUME_LEVEL,Tn(this))},[N.event]:t=>{let r=!!u[N.element]&&(t==null?void 0:t.target),s=Gt(this.fullscreenElement,r);this.propagateMediaState(o.MEDIA_IS_FULLSCREEN,s)},"enterpictureinpicture,leavepictureinpicture":t=>{var a;let r;if(t)r=t.type=="enterpictureinpicture";else{let s=(a=this.getRootNode().pictureInPictureElement)!=null?a:u.pictureInPictureElement;r=this.media&&Gt(this.media,s)}this.propagateMediaState(o.MEDIA_IS_PIP,r)},"entercast,leavecast,castchange":t=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castElement,s=this.media&&Gt(this.media,r);(t==null?void 0:t.type)==="castchange"&&(t==null?void 0:t.detail)==="CONNECTING"&&(s="connecting"),this.propagateMediaState(o.MEDIA_IS_CASTING,s)},"timeupdate,loadedmetadata":()=>{this.propagateMediaState(o.MEDIA_CURRENT_TIME,In(this))},"durationchange,loadedmetadata,emptied":()=>{this.propagateMediaState(o.MEDIA_DURATION,kn(this))},"emptied,durationchange,loadedmetadata,streamtypechange":()=>{this.propagateMediaState(o.MEDIA_STREAM_TYPE)},"emptied,durationchange,loadedmetadata,streamtypechange,targetlivewindowchange":()=>{this.propagateMediaState(o.MEDIA_TARGET_LIVE_WINDOW)},"loadedmetadata,emptied,progress":()=>{var t;this.propagateMediaState(o.MEDIA_SEEKABLE,(t=Mn(this))==null?void 0:t.join(":"))},"progress,emptied":()=>{var t;this.propagateMediaState(o.MEDIA_BUFFERED,bd((t=this.media)==null?void 0:t.buffered))},"ratechange,loadstart":()=>{this.propagateMediaState(o.MEDIA_PLAYBACK_RATE,Sn(this))},"waiting,playing,emptied":()=>{var t;let a=((t=this.media)==null?void 0:t.readyState)<3;this.propagateMediaState(o.MEDIA_LOADING,a)},"playing,timeupdate,progress,waiting,emptied":()=>{this.propagateMediaState(o.MEDIA_TIME_IS_LIVE)}},this._airplayUnavailable!==re.UNSUPPORTED){let t=a=>{(a==null?void 0:a.availability)==="available"?this._airplayUnavailable=void 0:(a==null?void 0:a.availability)==="not-available"&&(this._airplayUnavailable=re.UNAVAILABLE),this.propagateMediaState(o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable)};this._mediaStatePropagators.webkitplaybacktargetavailabilitychanged=t}if(this._castUnavailable!==re.UNSUPPORTED){let t=()=>{var a;let r=(a=globalThis.CastableVideoElement)==null?void 0:a.castState;r!=null&&r.includes("CONNECT")?this._castUnavailable=void 0:this._castUnavailable=re.UNAVAILABLE,this.propagateMediaState(o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable)};this._mediaStatePropagators.castchange=t}this._textTrackMediaStatePropagators={"addtrack,removetrack,loadstart":()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_LIST,ne(ji(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_LIST,ne(Jt(this))||void 0),this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,ne(br(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,ne(En(this))||void 0)},change:()=>{this.propagateMediaState(o.MEDIA_CAPTIONS_SHOWING,ne(br(this))||void 0),this.propagateMediaState(o.MEDIA_SUBTITLES_SHOWING,ne(En(this))||void 0)}},this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=Je(this,zt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),bn(this,zt,e)}attributeChangedCallback(e,t,a){var r;if(e==="nohotkeys")a!==t&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e==="hotkeys")Je(this,De).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let s=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;bn(this,zt,s)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){super.mediaSetCallback(e),e.hasAttribute("tabindex")||e.setAttribute("tabindex",-1),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(s=>{(s==N.event?this.getRootNode():e).addEventListener(s,r)}),r()}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(s=>{e.textTracks&&e.textTracks.addEventListener(s,a)}),a()});try{let t=d.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(this._mediaStatePropagators).forEach(t=>{let a=t.split(","),r=this._mediaStatePropagators[t];a.forEach(s=>{(s==N.event?this.getRootNode():e).removeEventListener(s,r)})}),Object.entries(this._textTrackMediaStatePropagators).forEach(([t,a])=>{t.split(",").forEach(s=>{e.textTracks&&e.textTracks.removeEventListener(s,a)}),a()}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){arguments.length===1&&(t=Qt[e](this));let a=this.getAttribute(e);if(Xe(this.mediaStateReceivers,e,t),a===this.getAttribute(e))return;let r=zs[e];if(!r)return;let s=new d.CustomEvent(r,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(s)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),s=nd(e,a,r);Object.keys(p).forEach(n=>{e.addEventListener(p[n],this[`_handle${Ui(n,!0)}`])}),t.set(e,s)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(p).forEach(r=>{e.removeEventListener(p[r],this[`_handle${Ui(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Xe([e],o.MEDIA_VOLUME_UNAVAILABLE,this._volumeUnavailable),Xe([e],o.MEDIA_AIRPLAY_UNAVAILABLE,this._airplayUnavailable),Xe([e],o.MEDIA_FULLSCREEN_UNAVAILABLE,this._fullscreenUnavailable),Xe([e],o.MEDIA_CAST_UNAVAILABLE,this._castUnavailable),Xe([e],o.MEDIA_PIP_UNAVAILABLE,this._pipUnavailable),this.media&&Object.keys(o).forEach(r=>{r.includes("UNAVAILABLE")||Xe([e],o[r],Qt[o[r]]?Qt[o[r]](this):Qt.default(this,o[r]))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",gt(this,Ji,pr))}disableHotkeys(){this.removeEventListener("keydown",gt(this,Ji,pr)),this.removeEventListener("keyup",gt(this,_t,ei))}get hotkeys(){return Je(this,De)}keyboardShortcutHandler(e){var t,a,r,s;if(((s=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?s:[]).map(y=>y==="Space"?" ":y).filter(Boolean).includes(e.key))return;let l,c,m,f,_,g=td;if(!Je(this,De).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Je(this,De).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":ze(this);break;case"ArrowLeft":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:fn,f=Math.max(m-g,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;case"ArrowRight":c=this.getAttribute(o.MEDIA_CURRENT_TIME),m=c&&!Number.isNaN(+c)?+c:fn,f=Math.max(m+g,0),_=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(_);break;default:break}}};De=new WeakMap;zt=new WeakMap;_t=new WeakSet;ei=function(i){let{key:e}=i;if(!gn.includes(e)){this.removeEventListener("keyup",gt(this,_t,ei));return}this.keyboardShortcutHandler(i)};Ji=new WeakSet;pr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!gn.includes(a)){this.removeEventListener("keyup",gt(this,_t,ei));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Je(this,De).contains(`no${a.toLowerCase()}`)||a===" "&&Je(this,De).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",gt(this,_t,ei),{once:!0})};var Qt={default(i,e){return i.getAttribute(e)},[o.MEDIA_CAPTIONS_LIST](i){return ne(ji(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return ne(Jt(i))||void 0},[o.MEDIA_SUBTITLES_LIST](i){return ne(Jt(i))||void 0},[o.MEDIA_CAPTIONS_SHOWING](i){return ne(br(i))||void 0},[o.MEDIA_PAUSED](i){return _n(i)},[o.MEDIA_MUTED](i){return An(i)},[o.MEDIA_VOLUME](i){return yn(i)},[o.MEDIA_VOLUME_LEVEL](i){return Tn(i)},[o.MEDIA_CURRENT_TIME](i){return In(i)},[o.MEDIA_DURATION](i){return kn(i)},[o.MEDIA_SEEKABLE](i){var e;return(e=Mn(i))==null?void 0:e.join(":")},[o.MEDIA_PLAYBACK_RATE](i){return Sn(i)},[o.MEDIA_STREAM_TYPE](i){return fr(i)},[o.MEDIA_TARGET_LIVE_WINDOW](i){return id(i)},[o.MEDIA_TIME_IS_LIVE](i){let e=i.media;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(fr(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,s=a.end(a.length-1)-r;return e.currentTime>=s}},_n=i=>i.media?i.media.paused:!0,An=i=>!!(i.media&&i.media.muted),yn=i=>{let e=i.media;return e?e.volume:1},Tn=i=>{let e="high";if(!i.media)return e;let{muted:t,volume:a}=i.media;return a===0||t?e="off":a<.5?e="low":a<.75&&(e="medium"),e},In=i=>{let e=i.media;return e?e.currentTime:0},kn=i=>{let e=i==null?void 0:i.media;return Number.isFinite(e==null?void 0:e.duration)?e.duration:NaN},Mn=i=>{var e;let t=i==null?void 0:i.media;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))]},Sn=i=>{let e=i.media;return e?e.playbackRate:1},Jt=i=>vt(i.media,{kind:pt.SUBTITLES}),ji=i=>vt(i.media,{kind:pt.CAPTIONS}),En=i=>vt(i.media,{kind:pt.SUBTITLES,mode:Ze.SHOWING}),br=i=>vt(i.media,{kind:pt.CAPTIONS,mode:Ze.SHOWING}),fr=i=>{let{media:e}=i;if(!e)return;let{streamType:t}=e;if(ed.includes(t)){if(t===se.UNKNOWN){let r=i.getAttribute("default-stream-type");return[se.LIVE,se.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return se.LIVE;if(Number.isFinite(a))return se.ON_DEMAND;{let r=i.getAttribute("default-stream-type");if([se.LIVE,se.ON_DEMAND].includes(r))return r}},id=i=>{let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e;return(t==null||Number.isNaN(t))&&fr(i)===se.LIVE?0:t},ad=Object.values(o),wn=i=>{var e,t,a,r;let{observedAttributes:s}=i.constructor;!s&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:s}=i.constructor);let n=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,E.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(s||n)?(s||n).filter(l=>ad.includes(l)):[]},Er=i=>!!wn(i).length,rd=async(i,e,t)=>(i.isConnected||await Cn(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),sd=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Xt=(i,e)=>{if(sd(i))return;let t=(r,s)=>{var n,l;Er(r)&&s(r);let{children:c=[]}=r!=null?r:{},m=(l=(n=r==null?void 0:r.shadowRoot)==null?void 0:n.children)!=null?l:[];[...c,...m].forEach(_=>Xt(_,s))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Er(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Xe=(i,e,t)=>{i.forEach(a=>{!wn(a).includes(e)||rd(a,e,t)})},nd=(i,e,t)=>{Xt(i,e);let a=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;e(f)},r=c=>{var m;let f=(m=c==null?void 0:c.composedPath()[0])!=null?m:c.target;t(f)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let s=c=>{c.forEach(m=>{let{addedNodes:f=[],removedNodes:_=[],type:g,target:y,attributeName:x}=m;g==="childList"?(Array.prototype.forEach.call(f,$=>Xt($,e)),Array.prototype.forEach.call(_,$=>Xt($,t))):g==="attributes"&&x===E.MEDIA_CHROME_ATTRIBUTES&&(Er(y)?e(y):t(y))})},n=new MutationObserver(s);return n.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Xt(i,t),n.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}},Xi,gr=()=>{var i,e;return Xi||(Xi=(e=(i=u)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Xi)},od=async(i=gr())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Cn(0),i.volume!==e},Cn=i=>new Promise(e=>setTimeout(e,i)),ld=(i=gr())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",dd=ld(),jt,cd=od().then(i=>(jt=i,jt)),ud=!!d.WebKitPlaybackTargetAvailabilityEvent,md=!!d.chrome,hd=(i=gr())=>{let e=u[N.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},vn=hd(),pd=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});function bd(i=pd){return Array.from(i).map((e,t)=>[Number(i.start(t).toFixed(3)),Number(i.end(t).toFixed(3))].join(":")).join(" ")}d.customElements.get("media-controller")||d.customElements.define("media-controller",ea);var ti=ea;var xn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ae=(i,e,t)=>(xn(i,e,"read from private field"),t?t.call(i):e.get(i)),ta=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ii=(i,e,t,a)=>(xn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ia,me,aa,ra,Rn=u.createElement("template"),Ln=`
192
+ `;var Ql=Object.values(o),zl="sm:384 md:576 lg:768 xl:960",Xl=i=>{var e;for(let t of i){let a=t.target;if(!a.isConnected)continue;let r=(e=a.getAttribute("breakpoints"))!=null?e:zl,n=Jl(r),s=jl(n,t.contentRect);Object.keys(n).forEach(l=>{if(s.includes(l)){a.hasAttribute(`breakpoint-${l}`)||a.setAttribute(`breakpoint-${l}`,"");return}a.removeAttribute(`breakpoint-${l}`)})}};function Jl(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function jl(i,e){return Object.keys(i).filter(t=>e.width>=i[t])}var zi=class extends d.HTMLElement{constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Es.content.cloneNode(!0)));let e=s=>{let l=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(c=>{if(c.slot=="media"&&u.target==this){let f=u.previousSibling&&u.previousSibling.previousElementSibling;if(!f||!l)this.mediaUnsetCallback(c);else{let A=f.slot!=="media";for(;(f=f.previousSibling)!==null;)f.slot=="media"&&(A=!1);A&&this.mediaUnsetCallback(c)}}}),l&&u.addedNodes.forEach(c=>{c==l&&this.handleMediaUpdated(l).then(f=>this.mediaSetCallback(f))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=new ResizeObserver(Xl);this.resizeObserver=a,a.observe(this);let r=this.media,n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){this.mediaUnsetCallback(r);return}this.media&&(r=this.media,this.handleMediaUpdated(this.media).then(l=>this.mediaSetCallback(l)))})}static get observedAttributes(){return["autohide","gestures-disabled"].concat(Ql)}attributeChangedCallback(e,t,a){e.toLowerCase()=="autohide"&&(this.autohide=a)}get media(){let e=this.querySelector(":scope > [slot=media]");return(e==null?void 0:e.nodeName)=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}mediaSetCallback(e){this._mediaClickPlayToggle=()=>{let t=e.paused?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(t,{composed:!0,bubbles:!0}))}}handleMediaUpdated(e){let t=n=>Promise.resolve(n),a=n=>(console.error('<media-chrome>: Media element set with slot="media" does not appear to be compatible.',n),Promise.reject(n));if(!e)return a(e);let r=e.nodeName.toLowerCase();return r.includes("-")?d.customElements.whenDefined(r).then(()=>t(e)):t(e)}mediaUnsetCallback(e){}connectedCallback(){let t=this.getAttribute("audio")!=null?W.AUDIO_PLAYER():W.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",t),this.media&&this.handleMediaUpdated(this.media).then(s=>this.mediaSetCallback(s)),this.setAttribute("user-inactive","user-inactive");let a=()=>{if(this.autohide<0||this.hasAttribute("user-inactive"))return;this.setAttribute("user-inactive","");let s=new d.CustomEvent(qt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(s)},r=()=>{if(!this.hasAttribute("user-inactive"))return;this.removeAttribute("user-inactive");let s=new d.CustomEvent(qt.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(s)},n=()=>{r(),d.clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=d.setTimeout(()=>{a()},this.autohide*1e3))};this.addEventListener("keyup",()=>{n()}),this.addEventListener("pointerup",s=>{s.pointerType==="touch"?[this,this.media].includes(s.target)&&!this.hasAttribute("user-inactive")?a():n():s.composedPath().some(l=>{var u;return["media-play-button","media-fullscreen-button"].includes((u=l==null?void 0:l.nodeName)==null?void 0:u.toLowerCase())})&&n()}),this.addEventListener("pointermove",s=>{s.pointerType==="mouse"&&s.target!==this&&(r(),d.clearTimeout(this._inactiveTimeout),[this,this.media].includes(s.target)&&n())}),this.addEventListener("mouseleave",()=>{a()}),this.addEventListener("keyup",()=>{this.setAttribute("media-keyboard-control","")}),d.addEventListener("mouseup",()=>{this.removeAttribute("media-keyboard-control")})}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};d.customElements.get("media-container-temp")||d.customElements.define("media-container-temp",zi);var gs=zi;var As=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},V=(i,e,t)=>(As(i,e,"read from private field"),t?t.call(i):e.get(i)),hr=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},pr=(i,e,t,a)=>(As(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gt,At,j,Xi=class{constructor(e,t){hr(this,gt,void 0),hr(this,At,void 0),hr(this,j,new Set),pr(this,gt,e),pr(this,At,t)}[Symbol.iterator](){return V(this,j).values()}get length(){return V(this,j).size}get value(){var e;return(e=[...V(this,j)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(pr(this,j,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...V(this,j)][e]}values(){return V(this,j).values()}keys(){return V(this,j).keys()}forEach(e){V(this,j).forEach(e)}add(...e){var t,a;e.forEach(r=>V(this,j).add(r)),!(this.value===""&&!((t=V(this,gt))!=null&&t.hasAttribute(`${V(this,At)}`)))&&((a=V(this,gt))==null||a.setAttribute(`${V(this,At)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>V(this,j).delete(a)),(t=V(this,gt))==null||t.setAttribute(`${V(this,At)}`,`${this.value}`)}contains(e){return V(this,j).has(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};gt=new WeakMap;At=new WeakMap;j=new WeakMap;var br=(i="")=>i.split(/\s+/),_s=(i="")=>{let[e,t]=i.split(":"),a=t?decodeURIComponent(t):void 0;return{language:e,label:a}},zt=(i="",e={})=>br(i).map(t=>{let a=_s(t);return{...e,...a}}),ed=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?_s(e):e):typeof i=="string"?zt(i):[i],fr=({label:i,language:e}={})=>i?`${e}:${encodeURIComponent(i)}`:e,Xt=(i=[])=>Array.prototype.map.call(i,fr).join(" "),td=(i,e)=>t=>t[i]===e,ys=i=>{let e=Object.entries(i).map(([t,a])=>td(t,a));return t=>e.every(a=>a(t))},Jt=(i,e=[],t=[])=>{let a=ed(t).map(ys),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},_t=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:ys(e);return Array.from(i.textTracks).filter(t)},vr=i=>{let e=!!i.getAttribute(o.MEDIA_CAPTIONS_SHOWING),t=!i.hasAttribute("no-subtitles-fallback")&&!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);return e||t},Je=(i,e=!1)=>{var t,a,r,n;if(vr(i)){let l=i.getAttribute(o.MEDIA_CAPTIONS_SHOWING);if(l){let c=new window.CustomEvent(p.MEDIA_DISABLE_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(c)}let u=i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);if(u&&!i.hasAttribute("no-subtitles-fallback")){let c=new window.CustomEvent(p.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:u});i.dispatchEvent(c)}}else if(!e){let[l]=(a=br((t=i.getAttribute(o.MEDIA_CAPTIONS_LIST))!=null?t:""))!=null?a:[];if(l){let u=new window.CustomEvent(p.MEDIA_SHOW_CAPTIONS_REQUEST,{composed:!0,bubbles:!0,detail:l});i.dispatchEvent(u)}else if(i.hasAttribute("no-subtitles-fallback"))console.error("Attempting to enable closed captions but none are available! Please verify your media content if this is unexpected.");else{let[u]=(n=br((r=i.getAttribute(o.MEDIA_SUBTITLES_LIST))!=null?r:""))!=null?n:[];if(u){let c=new window.CustomEvent(p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:u});i.dispatchEvent(c)}}}};var U={enter:"requestFullscreen",exit:"exitFullscreen",event:"fullscreenchange",element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};m.fullscreenElement===void 0&&(U.enter="webkitRequestFullScreen",U.exit=m.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",U.event="webkitfullscreenchange",U.element="webkitFullscreenElement",U.error="webkitfullscreenerror",U.enabled="webkitFullscreenEnabled");var Ji,Er=()=>{var i,e;return Ji||(Ji=(e=(i=m)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ji)},Ts=async(i=Er())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Hi(0),i.volume!==e},id=(i=Er())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",ad=(i=Er())=>{let e=m[U.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},gr=ad(),Is=id(),ks=!!d.WebKitPlaybackTargetAvailabilityEvent,Ms=!!d.chrome;var ji,Ss=Ts().then(i=>(ji=i,ji)),rd=Object.values(se),Ar=i=>_t(i.media,{kind:vt.SUBTITLES}),_r=i=>_t(i.media,{kind:vt.CAPTIONS}),nd=i=>_t(i.media,{kind:vt.SUBTITLES,mode:Qe.SHOWING}),sd=i=>_t(i.media,{kind:vt.CAPTIONS,mode:Qe.SHOWING}),Q={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_PLAYBACK_RATE:{get:function(i){let{media:e}=i;return!e||typeof e.playbackRate=="undefined"?1:e.playbackRate},mediaEvents:["ratechange","loadstart"]},MEDIA_MUTED:{get:function(i){let{media:e}=i;return!e||typeof e.muted=="undefined"?!1:e.muted},mediaEvents:["volumechange"]},MEDIA_VOLUME:{get:function(i){let{media:e}=i;return!e||typeof e.volume=="undefined"?1:Number(e.volume)},mediaEvents:["volumechange"]},MEDIA_VOLUME_LEVEL:{get:function(i){let{media:e}=i,t="high";if(!e||typeof e.volume=="undefined")return t;let{muted:a,volume:r}=e;return r===0||a?t="off":r<.5?t="low":r<.75&&(t="medium"),t},mediaEvents:["volumechange"]},MEDIA_CURRENT_TIME:{get:function(i){let{media:e}=i;return!e||typeof e.currentTime=="undefined"?0:e.currentTime},mediaEvents:["timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return!e||!Number.isFinite(e.duration)?NaN:e.duration},mediaEvents:["durationchange","loadedmetadata","emptied"]},MEDIA_SEEKABLE:{get:function(i){var e;let{media:t}=i;if(!((e=t==null?void 0:t.seekable)!=null&&e.length))return;let a=t.seekable.start(0),r=t.seekable.end(t.seekable.length-1);if(!(!a&&!r))return[Number(a.toFixed(3)),Number(r.toFixed(3))].join(":")},mediaEvents:["loadedmetadata","emptied","progress"]},MEDIA_LOADING:{get:function(i){var e;return((e=i.media)==null?void 0:e.readyState)<3},mediaEvents:["waiting","playing","emptied"]},MEDIA_BUFFERED:{get:function(i){var e;ls((e=i.media)==null?void 0:e.buffered)},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(rd.includes(t)){if(t===se.UNKNOWN){let r=i.getAttribute("default-stream-type");return[se.LIVE,se.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return se.LIVE;if(Number.isFinite(a))return se.ON_DEMAND;{let r=i.getAttribute("default-stream-type");if([se.LIVE,se.ON_DEMAND].includes(r))return r}},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},MEDIA_TARGET_LIVE_WINDOW:{get:function(i){let{media:e}=i;if(!e)return Number.NaN;let{targetLiveWindow:t}=e,a=Q.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===se.LIVE?0:t},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},MEDIA_TIME_IS_LIVE:{get:function(i){let{media:e}=i;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(Q.MEDIA_STREAM_TYPE.get(i)==="live"))return!1;let a=e.seekable;if(!a)return!0;if(!a.length)return!1;let r=i.hasAttribute("liveedgeoffset")?Number(i.getAttribute("liveedgeoffset")):10,n=a.end(a.length-1)-r;return e.currentTime>=n},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},MEDIA_IS_FULLSCREEN:{get:function(i,e){let a=!!m[U.element]&&(e==null?void 0:e.target);return Qt(i.fullscreenElement,a)},rootEvents:[U.event]},MEDIA_IS_PIP:{get:function(i,e){var t;let a=i.media;if(!a)return!1;if(e)return e.type=="enterpictureinpicture";{let r=(t=i.getRootNode().pictureInPictureElement)!=null?t:m.pictureInPictureElement;return Qt(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_CASTING:{get:function(i,e){var t;let{media:a}=i;if(!a)return!1;let r=(t=globalThis.CastableVideoElement)==null?void 0:t.castElement,n=Qt(a,r);return(e==null?void 0:e.type)==="castchange"&&(e==null?void 0:e.detail)==="CONNECTING"&&(n="connecting"),n},mediaEvents:["entercast","leavecast","castchange"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,e){if(!ks)return Ae.UNSUPPORTED;if(!!e&&e.availability!=="available"&&e.availability==="not-available")return Ae.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"]},MEDIA_CAST_UNAVAILABLE:{get:function(){var i;let e=(i=globalThis.CastableVideoElement)==null?void 0:i.castState;if(!Ms||!e)return Ae.UNSUPPORTED;if(!e.includes("CONNECT"))return Ae.UNAVAILABLE},mediaEvents:["castchange"]},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return gr?void 0:Ae.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Is?void 0:Ae.UNSUPPORTED}},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(ji!==void 0&&!ji)return Ae.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return Ae.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_CAPTIONS_LIST:{get:function(i){return Xt(_r(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Xt(Ar(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack"]},MEDIA_CAPTIONS_SHOWING:{get:function(i){return Xt(sd(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack","change"]},MEDIA_SUBTITLES_SHOWING:{get:function(i){return Xt(nd(i))||void 0},mediaEvents:["loadstart"],trackListEvents:["addtrack","removetrack","change"]}},ea={MEDIA_PLAY_REQUEST:(i,e,t)=>{let a=Q.MEDIA_STREAM_TYPE.get(t),r=t.getAttribute("noautoseektolive")===null;a==se.LIVE&&r&&ea.MEDIA_SEEK_TO_LIVE_REQUEST(i),i.play().catch(()=>{})},MEDIA_PAUSE_REQUEST:i=>i.pause(),MEDIA_MUTE_REQUEST:i=>i.muted=!0,MEDIA_UNMUTE_REQUEST:i=>{i.muted=!1,i.volume===0&&(i.volume=.25)},MEDIA_VOLUME_REQUEST:(i,e,t)=>{let a=e.detail;if(i.volume=a,a>0&&i.muted&&(i.muted=!1),!t.hasAttribute("novolumepref"))try{d.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!gr){console.warn("Fullscreen support is unavailable; not entering fullscreen");return}m.pictureInPictureElement&&m.exitPictureInPicture(),t[U.enter]?t.fullscreenElement[U.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{m[U.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!m.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!i.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}m[U.element]&&m[U.exit]();let e=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};i.requestPictureInPicture().catch(t=>{if(t.code===11)if(i.readyState===0&&i.preload==="none"){let a=()=>{i.removeEventListener("loadedmetadata",r),i.preload="none"},r=()=>{i.requestPictureInPicture().catch(e),a()};i.addEventListener("loadedmetadata",r),i.preload="metadata",setTimeout(()=>{i.readyState===0&&e(),a()},1e3)}else throw t;else throw t})},MEDIA_EXIT_PIP_REQUEST:()=>{m.pictureInPictureElement&&m.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:i=>{var e;!((e=globalThis.CastableVideoElement)!=null&&e.castEnabled)||(m[U.element]&&m[U.exit](),i.requestCast())},MEDIA_EXIT_CAST_REQUEST:async()=>{var i;(i=globalThis.CastableVideoElement)!=null&&i.castElement&&globalThis.CastableVideoElement.exitCast()},MEDIA_SEEK_REQUEST:(i,e)=>{let t=e.detail;(i.readyState>0||i.readyState===void 0)&&(i.currentTime=t)},MEDIA_PLAYBACK_RATE_REQUEST:(i,e)=>{i.playbackRate=e.detail},MEDIA_PREVIEW_REQUEST:(i,e,t)=>{var a;if(!i)return;let r=e.detail;r===null&&t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_TIME,r);let[n]=_t(i,{kind:vt.METADATA,label:"thumbnails"});if(!(n&&n.cues))return;if(r===null){t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}let s=Array.prototype.find.call(n.cues,f=>f.startTime>=r);if(!s)return;let l=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,l),c=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,c.split(",").join(" "))},MEDIA_SHOW_CAPTIONS_REQUEST:(i,e,t)=>{let a=_r(t),{detail:r=[]}=e;Jt(Qe.SHOWING,a,r)},MEDIA_DISABLE_CAPTIONS_REQUEST:(i,e,t)=>{let a=_r(t),{detail:r=[]}=e;Jt(Qe.DISABLED,a,r)},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{let a=Ar(t),{detail:r=[]}=e;Jt(Qe.SHOWING,a,r)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Ar(t),{detail:r=[]}=e;Jt(Qe.DISABLED,a,r)},MEDIA_AIRPLAY_REQUEST:i=>{if(!!i){if(!(i.webkitShowPlaybackTargetPicker&&d.WebKitPlaybackTargetAvailabilityEvent)){console.warn("received a request to select AirPlay but AirPlay is not supported in this environment");return}i.webkitShowPlaybackTargetPicker()}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaController: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaController: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)}};var Ir=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},je=(i,e,t)=>(Ir(i,e,"read from private field"),t?t.call(i):e.get(i)),ta=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ws=(i,e,t,a)=>(Ir(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),yt=(i,e,t)=>(Ir(i,e,"access private method"),t),Oe,jt,Tt,ti,ia,yr,Rs=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],od=10,Ls=0,aa=class extends gs{constructor(){super(),ta(this,Tt),ta(this,ia),ta(this,Oe,new Xi(this,"hotkeys")),ta(this,jt,void 0),Q.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Ss.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,Q.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(ea).forEach(e=>{let t=`_handle${Bi(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}ea[e](this.media,a,this)},this.addEventListener(p[e],this[t])}),this._mediaStatePropagators={},Object.keys(Q).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(o[e],Q[e].get(this,t))}}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat("nohotkeys","hotkeys","default-stream-type")}get fullscreenElement(){var e;return(e=je(this,jt))!=null?e:this}set fullscreenElement(e){this.hasAttribute("fullscreen-element")&&this.removeAttribute("fullscreen-element"),ws(this,jt,e)}attributeChangedCallback(e,t,a){var r;if(e==="nohotkeys")a!==t&&a===""?(this.hasAttribute("hotkeys")&&console.warn("Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e==="hotkeys")je(this,Oe).value=a;else if(e==="default-stream-type")this.propagateMediaState(o.MEDIA_STREAM_TYPE);else if(e==="fullscreen-element"){let n=a?(r=this.getRootNode())==null?void 0:r.getElementById(a):void 0;ws(this,jt,n)}super.attributeChangedCallback(e,t,a)}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||e.setAttribute("tabindex",-1),Object.keys(Q).forEach(t=>{let{mediaEvents:a,rootEvents:r,trackListEvents:n}=Q[t],s=this._mediaStatePropagators[t];a==null||a.forEach(l=>{e.addEventListener(l,s)}),r==null||r.forEach(l=>{this.getRootNode().addEventListener(l,s)}),n==null||n.forEach(l=>{var u;(u=e.textTracks)==null||u.addEventListener(l,s)})}),!this.hasAttribute("novolumepref"))try{let t=d.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(Q).forEach(t=>{let{mediaEvents:a,rootEvents:r,trackListEvents:n}=Q[t],s=this._mediaStatePropagators[t];a==null||a.forEach(l=>{e.removeEventListener(l,s)}),r==null||r.forEach(l=>{this.getRootNode().removeEventListener(l,s)}),n==null||n.forEach(l=>{var u;(u=e.textTracks)==null||u.removeEventListener(l,s)})}),this.propagateMediaState(o.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=this.getAttribute(e);if(Cs(this.mediaStateReceivers,e,t),a===this.getAttribute(e))return;let r=new d.CustomEvent(rs[e],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(r)}associateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(t.has(e))return;let a=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),n=cd(e,a,r);Object.keys(p).forEach(s=>{e.addEventListener(p[s],this[`_handle${Bi(s,!0)}`])}),t.set(e,n)}unassociateElement(e){if(!e)return;let{associatedElementSubscriptions:t}=this;if(!t.has(e))return;t.get(e)(),t.delete(e),Object.keys(p).forEach(r=>{e.removeEventListener(p[r],this[`_handle${Bi(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(Q).forEach(r=>{let n=Q[r];Cs([e],o[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",yt(this,ia,yr))}disableHotkeys(){this.removeEventListener("keydown",yt(this,ia,yr)),this.removeEventListener("keyup",yt(this,Tt,ti))}get hotkeys(){return je(this,Oe)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute("keysused"))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(y=>y==="Space"?" ":y).filter(Boolean).includes(e.key))return;let l,u,c,f,A,g=od;if(!je(this,Oe).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&je(this,Oe).contains("nospace")))switch(e.key){case" ":case"k":l=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"m":l=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"f":l=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new d.CustomEvent(l,{composed:!0,bubbles:!0}));break;case"c":Je(this);break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Ls,f=Math.max(c-g,0),A=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(A);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),c=u&&!Number.isNaN(+u)?+u:Ls,f=Math.max(c+g,0),A=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:f}),this.dispatchEvent(A);break;default:break}}};Oe=new WeakMap;jt=new WeakMap;Tt=new WeakSet;ti=function(i){let{key:e}=i;if(!Rs.includes(e)){this.removeEventListener("keyup",yt(this,Tt,ti));return}this.keyboardShortcutHandler(i)};ia=new WeakSet;yr=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Rs.includes(a)){this.removeEventListener("keyup",yt(this,Tt,ti));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(je(this,Oe).contains(`no${a.toLowerCase()}`)||a===" "&&je(this,Oe).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",yt(this,Tt,ti),{once:!0})};var ld=Object.values(o),xs=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)==null?void 0:e.includes("-"))&&(d.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,v.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(l=>ld.includes(l)):[]},Tr=i=>!!xs(i).length,dd=async(i,e,t)=>(i.isConnected||await Hi(0),t==null?i.removeAttribute(e):typeof t=="boolean"?t?i.setAttribute(e,""):i.removeAttribute(e):Number.isNaN(t)?i.removeAttribute(e):i.setAttribute(e,t)),ud=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},ei=(i,e)=>{if(ud(i))return;let t=(r,n)=>{var s,l;Tr(r)&&n(r);let{children:u=[]}=r!=null?r:{},c=(l=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?l:[];[...u,...c].forEach(A=>ei(A,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Tr(i)){d.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Cs=(i,e,t)=>{i.forEach(a=>{!xs(a).includes(e)||dd(a,e,t)})},cd=(i,e,t)=>{ei(i,e);let a=u=>{var c;let f=(c=u==null?void 0:u.composedPath()[0])!=null?c:u.target;e(f)},r=u=>{var c;let f=(c=u==null?void 0:u.composedPath()[0])!=null?c:u.target;t(f)};i.addEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=u=>{u.forEach(c=>{let{addedNodes:f=[],removedNodes:A=[],type:g,target:y,attributeName:R}=c;g==="childList"?(Array.prototype.forEach.call(f,$=>ei($,e)),Array.prototype.forEach.call(A,$=>ei($,t))):g==="attributes"&&R===v.MEDIA_CHROME_ATTRIBUTES&&(Tr(y)?e(y):t(y))})},s=new MutationObserver(n);return s.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{ei(i,t),s.disconnect(),i.removeEventListener(p.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(p.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};d.customElements.get("media-controller")||d.customElements.define("media-controller",aa);var ii=aa;var Os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_e=(i,e,t)=>(Os(i,e,"read from private field"),t?t.call(i):e.get(i)),ra=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ai=(i,e,t,a)=>(Os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),na,me,sa,oa,Ns=m.createElement("template"),Ds=`
197
193
  height: var(--thumb-height);
198
194
  width: var(--media-range-thumb-width, 10px);
199
195
  border: var(--media-range-thumb-border, none);
200
196
  border-radius: var(--media-range-thumb-border-radius, 10px);
201
- background: var(--media-range-thumb-background, #fff);
197
+ background: var(--media-range-thumb-background, var(--media-primary-color, rgb(238 238 238)));
202
198
  box-shadow: var(--media-range-thumb-box-shadow, 1px 1px 1px transparent);
203
199
  cursor: pointer;
204
200
  transition: var(--media-range-thumb-transition, none);
205
201
  transform: var(--media-range-thumb-transform, none);
206
202
  opacity: var(--media-range-thumb-opacity, 1);
207
- `,_r=`
203
+ `,kr=`
208
204
  min-width: 40px;
209
205
  height: var(--track-height);
210
206
  border: var(--media-range-track-border, none);
211
207
  outline: var(--media-range-track-outline);
212
208
  outline-offset: var(--media-range-track-outline-offset);
213
- border-radius: var(--media-range-track-border-radius, 0);
214
- background: var(--media-range-track-progress-internal, var(--media-range-track-background, #eee));
209
+ border-radius: var(--media-range-track-border-radius, 1px);
210
+ background: var(--media-range-track-progress-internal, var(--media-range-track-background, rgb(255 255 255 / .2)));
215
211
  box-shadow: var(--media-range-track-box-shadow, none);
216
212
  transition: var(--media-range-track-transition, none);
217
213
  transform: translate(var(--media-range-track-translate-x, 0), var(--media-range-track-translate-y, 0));
218
214
  cursor: pointer;
219
- `;Rn.innerHTML=`
215
+ `;Ns.innerHTML=`
220
216
  <style>
221
217
  :host {
222
218
  --thumb-height: var(--media-range-thumb-height, 10px);
223
219
  --track-height: var(--media-range-track-height, 4px);
224
- --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgba(27, 127, 204, 0.9));
220
+ --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
225
221
  --_media-range-padding: var(--media-range-padding, var(--media-control-padding, 10px));
226
222
 
227
223
  vertical-align: middle;
228
224
  box-sizing: border-box;
229
225
  display: inline-block;
230
226
  position: relative;
231
- background: var(--media-control-background, rgba(20,20,30, 0.7));
232
- transition: background 0.15s linear;
227
+ background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
228
+ transition: background .15s linear;
233
229
  width: 100px;
234
230
  height: calc(var(--media-control-height, 24px) + 2 * var(--_media-range-padding));
235
231
  padding-left: var(--media-range-padding-left, var(--_media-range-padding));
@@ -249,7 +245,7 @@
249
245
  }
250
246
 
251
247
  :host(:hover) {
252
- background: var(--media-control-hover-background, rgba(50,50,60, 0.7));
248
+ background: var(--media-control-hover-background, rgb(50 50 70 / .7));
253
249
  }
254
250
 
255
251
  #container {
@@ -274,19 +270,19 @@
274
270
 
275
271
  input[type=range]::-webkit-slider-thumb {
276
272
  -webkit-appearance: none;
277
- ${Ln}
273
+ ${Ds}
278
274
 
279
275
  margin-top: calc(calc(0px - var(--thumb-height) + var(--track-height)) / 2);
280
276
  }
281
277
 
282
278
 
283
279
  input[type=range]::-moz-range-thumb {
284
- ${Ln}
280
+ ${Ds}
285
281
  translate: var(--media-range-track-translate-x, 0) var(--media-range-track-translate-y, 0);
286
282
  }
287
283
 
288
- input[type=range]::-webkit-slider-runnable-track { ${_r} }
289
- input[type=range]::-moz-range-track { ${_r} }
284
+ input[type=range]::-webkit-slider-runnable-track { ${kr} }
285
+ input[type=range]::-moz-range-track { ${kr} }
290
286
  input[type=range]::-ms-track {
291
287
 
292
288
  width: 100%;
@@ -296,7 +292,7 @@
296
292
  border-color: transparent;
297
293
  color: transparent;
298
294
 
299
- ${_r}
295
+ ${kr}
300
296
  }
301
297
 
302
298
  #background,
@@ -304,11 +300,11 @@
304
300
  min-width: 40px;
305
301
  width: var(--media-range-track-width, 100%);
306
302
  height: var(--track-height);
307
- border-radius: var(--media-range-track-border-radius, 0);
303
+ border-radius: var(--media-range-track-border-radius, 1px);
308
304
  position: absolute;
309
305
  top: 50%;
310
306
  transform: translate(var(--media-range-track-translate-x, 0px), calc(var(--media-range-track-translate-y, 0px) - 50%));
311
- background: var(--media-range-track-background, #333);
307
+ background: var(--media-range-track-background, rgb(255 255 255 / .2));
312
308
  }
313
309
 
314
310
  #pointer {
@@ -356,13 +352,13 @@
356
352
  <div id="hoverzone"></div>
357
353
  <input id="range" type="range" min="0" max="1000" step="any" value="0">
358
354
  </div>
359
- `;var sa=class extends d.HTMLElement{constructor(){super(),ta(this,ia,void 0),ta(this,me,void 0),ta(this,aa,()=>{if(this.range.matches(":focus-visible")){let{style:t}=D(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ta(this,ra,()=>{let{style:t}=D(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Rn.content.cloneNode(!0));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),ii(this,ia,parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10))}static get observedAttributes(){return["disabled","aria-disabled",E.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER?(t&&((s=(r=Ae(this,me))==null?void 0:r.unassociateElement)==null||s.call(r,this),ii(this,me,null)),a&&(ii(this,me,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Ae(this,me))==null?void 0:l.associateElement)==null||c.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(ii(this,me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ae(this,me))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",Ae(this,aa)),this.shadowRoot.addEventListener("focusout",Ae(this,ra))}disconnectedCallback(){var e,t;(t=(e=Ae(this,me))==null?void 0:e.unassociateElement)==null||t.call(e,this),ii(this,me,null),this.shadowRoot.removeEventListener("focusin",Ae(this,aa)),this.shadowRoot.removeEventListener("focusout",Ae(this,ra))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=D(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(s=>{s[1]<a||(t=t+`${s[0]} ${a}%, ${s[0]} ${s[1]}%,`,a=s[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=D(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getBarColors(){let e=this.range,t=e.value-e.min,a=e.max-e.min,r=t/a*100,s=0;return e.value>e.min&&e.value<e.max&&(s=Ae(this,ia)*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, #fff)",r+s],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};ia=new WeakMap;me=new WeakMap;aa=new WeakMap;ra=new WeakMap;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",sa);var ai=sa;var Dn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},na=(i,e,t)=>(Dn(i,e,"read from private field"),t?t.call(i):e.get(i)),fd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},oa=(i,e,t,a)=>(Dn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),he,On=u.createElement("template");On.innerHTML=`
355
+ `;var la=class extends d.HTMLElement{constructor(){super(),ra(this,na,void 0),ra(this,me,void 0),ra(this,sa,()=>{if(this.range.matches(":focus-visible")){let{style:t}=D(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),ra(this,oa,()=>{let{style:t}=D(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ns.content.cloneNode(!0)));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-block))`),this.container=this.shadowRoot.querySelector("#container"),this.range=this.shadowRoot.querySelector("#range"),this.range.addEventListener("input",this.updateBar.bind(this)),ai(this,na,parseInt(getComputedStyle(this).getPropertyValue("--media-range-thumb-width")||"10",10))}static get observedAttributes(){return["disabled","aria-disabled",v.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER?(t&&((n=(r=_e(this,me))==null?void 0:r.unassociateElement)==null||n.call(r,this),ai(this,me,null)),a&&(ai(this,me,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=_e(this,me))==null?void 0:l.associateElement)==null||u.call(l,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?this.range.removeAttribute(e):this.range.setAttribute(e,a))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(ai(this,me,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=_e(this,me))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",_e(this,sa)),this.shadowRoot.addEventListener("focusout",_e(this,oa))}disconnectedCallback(){var e,t;(t=(e=_e(this,me))==null?void 0:e.unassociateElement)==null||t.call(e,this),ai(this,me,null),this.shadowRoot.removeEventListener("focusin",_e(this,sa)),this.shadowRoot.removeEventListener("focusout",_e(this,oa))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a));let{style:r}=D(this.shadowRoot,"#pointer");r.setProperty("width",`${a*t.width}px`)}updateBar(){let e=this.getBarColors(),t="linear-gradient(to right, ",a=0;e.forEach(n=>{n[1]<a||(t=t+`${n[0]} ${a}%, ${n[0]} ${n[1]}%,`,a=n[1])}),t=t.slice(0,t.length-1)+")";let{style:r}=D(this.shadowRoot,"#range");r.setProperty("--media-range-track-progress-internal",t)}getBarColors(){let e=this.range,t=e.value-e.min,a=e.max-e.min,r=t/a*100,n=0;return e.value>e.min&&e.value<e.max&&(n=_e(this,na)*(.5-r/100)/e.offsetWidth*100),[["var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)))",r+n],["var(--media-range-track-color, transparent)",100]]}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};na=new WeakMap;me=new WeakMap;sa=new WeakMap;oa=new WeakMap;d.customElements.get("media-chrome-range")||d.customElements.define("media-chrome-range",la);var ri=la;var Ps=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},da=(i,e,t)=>(Ps(i,e,"read from private field"),t?t.call(i):e.get(i)),md=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ua=(i,e,t,a)=>(Ps(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),he,Us=m.createElement("template");Us.innerHTML=`
360
356
  <style>
361
357
  :host {
362
358
 
363
359
  box-sizing: border-box;
364
360
  display: var(--media-control-display, var(--media-control-bar-display, inline-flex));
365
- color: var(--media-icon-color, #eee);
361
+ color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
366
362
  --media-loading-icon-width: 44px;
367
363
  }
368
364
 
@@ -375,29 +371,29 @@
375
371
  </style>
376
372
 
377
373
  <slot></slot>
378
- `;var Ar=class extends d.HTMLElement{constructor(){super(),fd(this,he,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(On.content.cloneNode(!0))}static get observedAttributes(){return[E.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER&&(t&&((s=(r=na(this,he))==null?void 0:r.unassociateElement)==null||s.call(r,this),oa(this,he,null)),a&&(oa(this,he,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=na(this,he))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(oa(this,he,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=na(this,he))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=na(this,he))==null?void 0:e.unassociateElement)==null||t.call(e,this),oa(this,he,null)}};he=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Ar);var Nn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},la=(i,e,t)=>(Nn(i,e,"read from private field"),t?t.call(i):e.get(i)),Ed=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},da=(i,e,t,a)=>(Nn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),pe,Pn=u.createElement("template");Pn.innerHTML=`
374
+ `;var Mr=class extends d.HTMLElement{constructor(){super(),md(this,he,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Us.content.cloneNode(!0)))}static get observedAttributes(){return[v.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER&&(t&&((n=(r=da(this,he))==null?void 0:r.unassociateElement)==null||n.call(r,this),ua(this,he,null)),a&&(ua(this,he,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=da(this,he))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(ua(this,he,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=da(this,he))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=da(this,he))==null?void 0:e.unassociateElement)==null||t.call(e,this),ua(this,he,null)}};he=new WeakMap;d.customElements.get("media-control-bar")||d.customElements.define("media-control-bar",Mr);var Bs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ca=(i,e,t)=>(Bs(i,e,"read from private field"),t?t.call(i):e.get(i)),hd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ma=(i,e,t,a)=>(Bs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),pe,$s=m.createElement("template");$s.innerHTML=`
379
375
  <style>
380
376
  :host {
377
+ font: var(--media-font,
378
+ var(--media-font-weight, normal)
379
+ var(--media-font-size, 14px) /
380
+ var(--media-text-content-height, var(--media-control-height, 24px))
381
+ var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
382
+ color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
383
+ background: var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)));
384
+ padding: var(--media-control-padding, 10px);
381
385
  display: inline-flex;
382
386
  justify-content: center;
383
387
  align-items: center;
384
388
  vertical-align: middle;
385
389
  box-sizing: border-box;
386
- background: var(--media-control-background, rgba(20,20,30, 0.7));
387
-
388
- padding: var(--media-control-padding, 10px);
389
-
390
- font-size: 14px;
391
- line-height: var(--media-text-content-height, var(--media-control-height, 24px));
392
- font-family: Arial, sans-serif;
393
390
  text-align: center;
394
- color: #ffffff;
395
391
  pointer-events: auto;
396
392
  }
397
393
 
398
394
 
399
395
  :host(:focus-visible) {
400
- box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
396
+ box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
401
397
  outline: 0;
402
398
  }
403
399
 
@@ -408,11 +404,11 @@
408
404
  }
409
405
  </style>
410
406
  <slot></slot>
411
- `;var ca=class extends d.HTMLElement{constructor(){super(),Ed(this,pe,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Pn.content.cloneNode(!0));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[E.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,s,n,l,c;e===E.MEDIA_CONTROLLER&&(t&&((s=(r=la(this,pe))==null?void 0:r.unassociateElement)==null||s.call(r,this),da(this,pe,null)),a&&(da(this,pe,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=la(this,pe))==null?void 0:l.associateElement)==null||c.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(da(this,pe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=la(this,pe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=la(this,pe))==null?void 0:e.unassociateElement)==null||t.call(e,this),da(this,pe,null)}};pe=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",ca);var Oe=ca;var Bn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Un=(i,e,t)=>(Bn(i,e,"read from private field"),t?t.call(i):e.get(i)),vd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},gd=(i,e,t,a)=>(Bn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ri,yr=class extends Oe{constructor(){super(),vd(this,ri,void 0),gd(this,ri,this.shadowRoot.querySelector("slot")),Un(this,ri).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_CURRENT_TIME&&(Un(this,ri).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};ri=new WeakMap;d.customElements.get("media-current-time-display")||d.customElements.define("media-current-time-display",yr);var Hn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},$n=(i,e,t)=>(Hn(i,e,"read from private field"),t?t.call(i):e.get(i)),_d=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ad=(i,e,t,a)=>(Hn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),si,Tr=class extends Oe{constructor(){super(),_d(this,si,void 0),Ad(this,si,this.shadowRoot.querySelector("slot")),$n(this,si).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&($n(this,si).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};si=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",Tr);var Fn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ir=(i,e,t)=>(Fn(i,e,"read from private field"),t?t.call(i):e.get(i)),yd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Td=(i,e,t,a)=>(Fn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),At,Wn=["Enter"," "],Id="&nbsp;/&nbsp;",Vn=(i,{timesSep:e=Id}={})=>{var t,a,r;let s=i.getAttribute("remaining")!=null,n=i.getAttribute("show-duration")!=null,l=(t=i.mediaCurrentTime)!=null?t:0,c=(r=(a=i.mediaDuration)!=null?a:i.mediaSeekableEnd)!=null?r:0,m=s?z(0-(c-l)):z(l);return n?`${m}${e}${z(c)}`:m},kd="video not loaded, unknown time.",Md=i=>{let e=i.mediaCurrentTime,t=i.mediaDuration||i.mediaSeekableEnd;if(e==null||t==null){i.setAttribute("aria-valuetext",kd);return}let a=i.hasAttribute("remaining"),r=i.hasAttribute("show-duration"),s=a?qe(0-(t-e)):qe(e);if(!r){i.setAttribute("aria-valuetext",s);return}let n=qe(t),l=`${s} of ${n}`;i.setAttribute("aria-valuetext",l)},kr=class extends Oe{constructor(){super(),yd(this,At,void 0),Td(this,At,this.shadowRoot.querySelector("slot")),Ir(this,At).innerHTML=`${Vn(this)}`;let{style:e}=D(this.shadowRoot,":host");e.setProperty("cursor","pointer")}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",W.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!Wn.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:s}=t;if(a||r||!Wn.includes(s)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining","")}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(e)){let r=Vn(this);Md(this),r!==Ir(this,At).innerHTML&&(Ir(this,At).innerHTML=r)}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());super.attributeChangedCallback(e,t,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}};At=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",kr);var Sd=`<svg aria-hidden="true" viewBox="0 0 26 24">
407
+ `;var ha=class extends d.HTMLElement{constructor(){super(),hd(this,pe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($s.content.cloneNode(!0)));let{style:e}=D(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[v.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,l,u;e===v.MEDIA_CONTROLLER&&(t&&((n=(r=ca(this,pe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ma(this,pe,null)),a&&(ma(this,pe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ca(this,pe))==null?void 0:l.associateElement)==null||u.call(l,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(ma(this,pe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ca(this,pe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ca(this,pe))==null?void 0:e.unassociateElement)==null||t.call(e,this),ma(this,pe,null)}};pe=new WeakMap;d.customElements.get("media-text-display")||d.customElements.define("media-text-display",ha);var Ne=ha;var Ws=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Hs=(i,e,t)=>(Ws(i,e,"read from private field"),t?t.call(i):e.get(i)),pd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},bd=(i,e,t,a)=>(Ws(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ni,Sr=class extends Ne{constructor(){super(),pd(this,ni,void 0),bd(this,ni,this.shadowRoot.querySelector("slot")),Hs(this,ni).textContent=J(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_CURRENT_TIME&&(Hs(this,ni).textContent=J(a)),super.attributeChangedCallback(e,t,a)}};ni=new WeakMap;d.customElements.get("media-current-time-display")||d.customElements.define("media-current-time-display",Sr);var Fs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Vs=(i,e,t)=>(Fs(i,e,"read from private field"),t?t.call(i):e.get(i)),fd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},vd=(i,e,t,a)=>(Fs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),si,wr=class extends Ne{constructor(){super(),fd(this,si,void 0),vd(this,si,this.shadowRoot.querySelector("slot")),Vs(this,si).textContent=J(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(Vs(this,si).textContent=J(a)),super.attributeChangedCallback(e,t,a)}};si=new WeakMap;d.customElements.get("media-duration-display")||d.customElements.define("media-duration-display",wr);var Gs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Lr=(i,e,t)=>(Gs(i,e,"read from private field"),t?t.call(i):e.get(i)),Ed=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},gd=(i,e,t,a)=>(Gs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),It,Ks=["Enter"," "],Ad="&nbsp;/&nbsp;",Ys=(i,{timesSep:e=Ad}={})=>{var t,a,r;let n=i.getAttribute("remaining")!=null,s=i.getAttribute("show-duration")!=null,l=(t=i.mediaCurrentTime)!=null?t:0,u=(r=(a=i.mediaDuration)!=null?a:i.mediaSeekableEnd)!=null?r:0,c=n?J(0-(u-l)):J(l);return s?`${c}${e}${J(u)}`:c},_d="video not loaded, unknown time.",yd=i=>{let e=i.mediaCurrentTime,t=i.mediaDuration||i.mediaSeekableEnd;if(e==null||t==null){i.setAttribute("aria-valuetext",_d);return}let a=i.hasAttribute("remaining"),r=i.hasAttribute("show-duration"),n=a?ze(0-(t-e)):ze(e);if(!r){i.setAttribute("aria-valuetext",n);return}let s=ze(t),l=`${n} of ${s}`;i.setAttribute("aria-valuetext",l)},Cr=class extends Ne{constructor(){super(),Ed(this,It,void 0),gd(this,It,this.shadowRoot.querySelector("slot")),Lr(this,It).innerHTML=`${Ys(this)}`;let{style:e}=D(this.shadowRoot,":host");e.setProperty("cursor","pointer")}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration","disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",W.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!Ks.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!Ks.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining","")}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){if([o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,"remaining","show-duration"].includes(e)){let r=Ys(this);yd(this),r!==Lr(this,It).innerHTML&&(Lr(this,It).innerHTML=r)}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable());super.attributeChangedCallback(e,t,a)}enable(){this.setAttribute("tabindex",0)}disable(){this.removeAttribute("tabindex")}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}};It=new WeakMap;d.customElements.get("media-time-display")||d.customElements.define("media-time-display",Cr);var Td=`<svg aria-hidden="true" viewBox="0 0 26 24">
412
408
  <path d="M22.83 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.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
413
- </svg>`,wd=`<svg aria-hidden="true" viewBox="0 0 26 24">
409
+ </svg>`,Id=`<svg aria-hidden="true" viewBox="0 0 26 24">
414
410
  <path d="M17.73 14.09a1.4 1.4 0 0 1-1 .37 1.579 1.579 0 0 1-1.27-.58A3 3 0 0 1 15 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34A2.89 2.89 0 0 0 19 9.07a3 3 0 0 0-2.14-.78 3.14 3.14 0 0 0-2.42 1 3.91 3.91 0 0 0-.93 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.17 3.17 0 0 0 1.07-1.74l-1.4-.45c-.083.43-.3.822-.62 1.12Zm-7.22 0a1.43 1.43 0 0 1-1 .37 1.58 1.58 0 0 1-1.27-.58A3 3 0 0 1 7.76 12a2.8 2.8 0 0 1 .5-1.85 1.63 1.63 0 0 1 1.29-.57 1.47 1.47 0 0 1 1.51 1.2l1.43-.34a2.81 2.81 0 0 0-.74-1.32 2.94 2.94 0 0 0-2.13-.78 3.18 3.18 0 0 0-2.43 1 4 4 0 0 0-.92 2.78 3.74 3.74 0 0 0 .92 2.66 3.07 3.07 0 0 0 2.34 1 3.07 3.07 0 0 0 1.91-.57 3.23 3.23 0 0 0 1.07-1.74l-1.4-.45a2.06 2.06 0 0 1-.6 1.07Zm12.32-8.41a2.59 2.59 0 0 0-2.3-2.51C18.72 3.05 15.86 3 13 3c-2.86 0-5.72.05-7.53.17a2.59 2.59 0 0 0-2.3 2.51c-.23 4.207-.23 8.423 0 12.63a2.57 2.57 0 0 0 2.3 2.5c1.81.13 4.67.19 7.53.19 2.86 0 5.72-.06 7.53-.19a2.57 2.57 0 0 0 2.3-2.5c.23-4.207.23-8.423 0-12.63Zm-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.14-.21-8.29 0-12.43a1.11 1.11 0 0 1 .91-1.11C7.24 4.56 10 4.49 13 4.49s5.76.07 7.43.18a1.11 1.11 0 0 1 .91 1.11c.21 4.14.21 8.29 0 12.43Z"/>
415
- </svg>`,Yn=u.createElement("template");Yn.innerHTML=`
411
+ </svg>`,qs=m.createElement("template");qs.innerHTML=`
416
412
  <style>
417
413
  :host([aria-checked="true"]) slot:not([name=on]) > *,
418
414
  :host([aria-checked="true"]) ::slotted(:not([slot=on])) {
@@ -426,15 +422,15 @@
426
422
  }
427
423
  </style>
428
424
 
429
- <slot name="on">${Sd}</slot>
430
- <slot name="off">${wd}</slot>
431
- `;var Kn=i=>{i.setAttribute("aria-checked",hr(i))},Mr=class extends S{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Yn,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",W.CLOSED_CAPTIONS()),Kn(this)}attributeChangedCallback(e,t,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(e)&&Kn(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let r=!this.hasAttribute("no-subtitles-fallback");if((r?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let n=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(r&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==n&&(this._captionsReady=n,this._captionsReady&&ze(this))}}super.attributeChangedCallback(e,t,a)}handleClick(){ze(this)}};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",Mr);var Sr="30",Cd=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${Sr}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,qn=u.createElement("template");qn.innerHTML=`
432
- <slot name="forward">${Cd}</slot>
433
- `;var Ld=0,Gn=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=C.SEEK_FORWARD_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},Zn=i=>{let e=Hi(i,"forward"),t=i.getAttribute("seek-offset");$i(e,t)},wr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(e={}){super({slotTemplate:qn,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Sr),Gn(this),Zn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",Sr),Zn(this),Gn(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),r=(e&&!Number.isNaN(+e)?+e:Ld)+t,s=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",wr);var xd=`<svg aria-hidden="true" viewBox="0 0 26 24">
425
+ <slot name="on">${Td}</slot>
426
+ <slot name="off">${Id}</slot>
427
+ `;var Zs=i=>{i.setAttribute("aria-checked",vr(i))},Rr=class extends L{static get observedAttributes(){return[...super.observedAttributes,"no-subtitles-fallback","default-showing",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:qs,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",W.CLOSED_CAPTIONS()),Zs(this)}attributeChangedCallback(e,t,a){if([o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_SHOWING].includes(e)&&Zs(this),this.hasAttribute("default-showing")&&this.getAttribute("aria-checked")!=="true"){let r=!this.hasAttribute("no-subtitles-fallback");if((r?[o.MEDIA_CAPTIONS_LIST,o.MEDIA_SUBTITLES_LIST]:[o.MEDIA_CAPTIONS_LIST]).includes(e)){let s=!!this.getAttribute(o.MEDIA_CAPTIONS_LIST)||!!(r&&this.getAttribute(o.MEDIA_SUBTITLES_LIST));this._captionsReady!==s&&(this._captionsReady=s,this._captionsReady&&Je(this))}}super.attributeChangedCallback(e,t,a)}handleClick(){Je(this)}};d.customElements.get("media-captions-button")||d.customElements.define("media-captions-button",Rr);var xr="30",kd=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(8.9 19.87)">${xr}</text><path d="M10 6V3l5.61 4L10 10.94V8a5.54 5.54 0 0 0-1.9 10.48v2.12A7.5 7.5 0 0 1 10 6Z"/></svg>`,Xs=m.createElement("template");Xs.innerHTML=`
428
+ <slot name="forward">${kd}</slot>
429
+ `;var Md=0,Qs=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=S.SEEK_FORWARD_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},zs=i=>{let e=Vi(i,"forward"),t=i.getAttribute("seek-offset");Wi(e,t)},Dr=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,"seek-offset"]}constructor(e={}){super({slotTemplate:Xs,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",xr),Qs(this),zs(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",xr),zs(this),Qs(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),r=(e&&!Number.isNaN(+e)?+e:Md)+t,n=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};d.customElements.get("media-seek-forward-button")||d.customElements.define("media-seek-forward-button",Dr);var Sd=`<svg aria-hidden="true" viewBox="0 0 26 24">
434
430
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
435
- </svg>`,Rd=`<svg aria-hidden="true" viewBox="0 0 26 24">
431
+ </svg>`,wd=`<svg aria-hidden="true" viewBox="0 0 26 24">
436
432
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
437
- </svg>`,zn=u.createElement("template");zn.innerHTML=`
433
+ </svg>`,js=m.createElement("template");js.innerHTML=`
438
434
  <style>
439
435
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]) > *,
440
436
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted(:not([slot=exit])) {
@@ -448,9 +444,9 @@
448
444
  }
449
445
  </style>
450
446
 
451
- <slot name="enter">${xd}</slot>
452
- <slot name="exit">${Rd}</slot>
453
- `;var Qn=i=>{let t=i.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?C.EXIT_FULLSCREEN():C.ENTER_FULLSCREEN();i.setAttribute("aria-label",t)},Cr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:zn,...e})}connectedCallback(){Qn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&Qn(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Cr);var{MEDIA_TIME_IS_LIVE:ni,MEDIA_PAUSED:yt}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Dd,MEDIA_PLAY_REQUEST:Od}=p,Nd='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',Xn=u.createElement("template");Xn.innerHTML=`
447
+ <slot name="enter">${Sd}</slot>
448
+ <slot name="exit">${wd}</slot>
449
+ `;var Js=i=>{let t=i.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?S.EXIT_FULLSCREEN():S.ENTER_FULLSCREEN();i.setAttribute("aria-label",t)},Or=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:js,...e})}connectedCallback(){Js(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&Js(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?p.MEDIA_EXIT_FULLSCREEN_REQUEST:p.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-fullscreen-button")||d.customElements.define("media-fullscreen-button",Or);var{MEDIA_TIME_IS_LIVE:kt,MEDIA_PAUSED:et}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:Ld,MEDIA_PLAY_REQUEST:Cd}=p,Rd='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',eo=m.createElement("template");eo.innerHTML=`
454
450
  <style>
455
451
 
456
452
  slot[name=indicator] > *,
@@ -461,28 +457,28 @@
461
457
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
462
458
  }
463
459
 
464
- :host([${ni}]:not([${yt}])) slot[name=indicator] > *,
465
- :host([${ni}]:not([${yt}])) ::slotted([slot=indicator]) {
460
+ :host([${kt}]:not([${et}])) slot[name=indicator] > *,
461
+ :host([${kt}]:not([${et}])) ::slotted([slot=indicator]) {
466
462
  fill: var(--media-live-indicator-color, rgb(255, 0, 0));
467
463
  color: var(--media-live-indicator-color, rgb(255, 0, 0));
468
464
  }
469
465
 
470
- :host([${ni}]:not([${yt}])) {
466
+ :host([${kt}]:not([${et}])) {
471
467
  cursor: not-allowed;
472
468
  }
473
469
 
474
470
  </style>
475
471
 
476
- <slot name="indicator">${Nd}</slot>
472
+ <slot name="indicator">${Rd}</slot>
477
473
 
478
474
  <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
479
- `;var Lr=class extends S{static get observedAttributes(){return[...super.observedAttributes,yt,ni]}constructor(e={}){super({slotTemplate:Xn,...e}),this.setAttribute("aria-label","Seek to Live")}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a)}handleClick(){!this.hasAttribute(yt)&&this.hasAttribute(ni)||(this.dispatchEvent(new d.CustomEvent(Dd,{composed:!0,bubbles:!0})),this.hasAttribute(yt)&&this.dispatchEvent(new d.CustomEvent(Od,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Lr);var Pd=`<svg aria-hidden="true" viewBox="0 0 24 24">
475
+ `;var Nr=class extends L{static get observedAttributes(){return[...super.observedAttributes,et,kt]}constructor(e={}){super({slotTemplate:eo,...e}),this.setAttribute("aria-label",S.SEEK_LIVE())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),this.hasAttribute(et)||!this.hasAttribute(kt)?(this.setAttribute("aria-label",S.SEEK_LIVE()),this.removeAttribute("aria-disabled")):(this.setAttribute("aria-label",S.PLAYING_LIVE()),this.setAttribute("aria-disabled","true"))}handleClick(){!this.hasAttribute(et)&&this.hasAttribute(kt)||(this.dispatchEvent(new d.CustomEvent(Ld,{composed:!0,bubbles:!0})),this.hasAttribute(et)&&this.dispatchEvent(new d.CustomEvent(Cd,{composed:!0,bubbles:!0})))}};d.customElements.get("media-live-button")||d.customElements.define("media-live-button",Nr);var xd=`<svg aria-hidden="true" viewBox="0 0 24 24">
480
476
  <path d="M16.5 12A4.5 4.5 0 0 0 14 8v2.18l2.45 2.45a4.22 4.22 0 0 0 .05-.63Zm2.5 0a6.84 6.84 0 0 1-.54 2.64L20 16.15A8.8 8.8 0 0 0 21 12a9 9 0 0 0-7-8.77v2.06A7 7 0 0 1 19 12ZM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25A6.92 6.92 0 0 1 14 18.7v2.06A9 9 0 0 0 17.69 19l2 2.05L21 19.73l-9-9L4.27 3ZM12 4 9.91 6.09 12 8.18V4Z"/>
481
- </svg>`,Jn=`<svg aria-hidden="true" viewBox="0 0 24 24">
477
+ </svg>`,to=`<svg aria-hidden="true" viewBox="0 0 24 24">
482
478
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4Z"/>
483
- </svg>`,Ud=`<svg aria-hidden="true" viewBox="0 0 24 24">
479
+ </svg>`,Dd=`<svg aria-hidden="true" viewBox="0 0 24 24">
484
480
  <path d="M3 9v6h4l5 5V4L7 9H3Zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.47 4.47 0 0 0 2.5-4ZM14 3.23v2.06a7 7 0 0 1 0 13.42v2.06a9 9 0 0 0 0-17.54Z"/>
485
- </svg>`,eo=u.createElement("template");eo.innerHTML=`
481
+ </svg>`,ao=m.createElement("template");ao.innerHTML=`
486
482
  <style>
487
483
 
488
484
  :host(:not([${o.MEDIA_VOLUME_LEVEL}])) slot:not([name=high]) > *,
@@ -508,13 +504,13 @@
508
504
  }
509
505
  </style>
510
506
 
511
- <slot name="off">${Pd}</slot>
512
- <slot name="low">${Jn}</slot>
513
- <slot name="medium">${Jn}</slot>
514
- <slot name="high">${Ud}</slot>
515
- `;var jn=i=>{let t=i.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?C.UNMUTE():C.MUTE();i.setAttribute("aria-label",t)},xr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:eo,...e})}connectedCallback(){jn(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&jn(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",xr);var to=`<svg aria-hidden="true" viewBox="0 0 28 24">
507
+ <slot name="off">${xd}</slot>
508
+ <slot name="low">${to}</slot>
509
+ <slot name="medium">${to}</slot>
510
+ <slot name="high">${Dd}</slot>
511
+ `;var io=i=>{let t=i.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?S.UNMUTE():S.MUTE();i.setAttribute("aria-label",t)},Pr=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:ao,...e})}connectedCallback(){io(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&io(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?p.MEDIA_UNMUTE_REQUEST:p.MEDIA_MUTE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-mute-button")||d.customElements.define("media-mute-button",Pr);var ro=`<svg aria-hidden="true" viewBox="0 0 28 24">
516
512
  <path d="M24 3H4a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1Zm-1 16H5V5h18v14Zm-3-8h-7v5h7v-5Z"/>
517
- </svg>`,ao=u.createElement("template");ao.innerHTML=`
513
+ </svg>`,so=m.createElement("template");so.innerHTML=`
518
514
  <style>
519
515
  :host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]) > *,
520
516
  :host([${o.MEDIA_IS_PIP}]) ::slotted(:not([slot=exit])) {
@@ -528,13 +524,13 @@
528
524
  }
529
525
  </style>
530
526
 
531
- <slot name="enter">${to}</slot>
532
- <slot name="exit">${to}</slot>
533
- `;var io=i=>{let t=i.getAttribute(o.MEDIA_IS_PIP)!=null?C.EXIT_PIP():C.ENTER_PIP();i.setAttribute("aria-label",t)},Rr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ao,...e})}connectedCallback(){io(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&io(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_PIP)!=null?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Rr);var Bd=`<svg aria-hidden="true" viewBox="0 0 24 24">
527
+ <slot name="enter">${ro}</slot>
528
+ <slot name="exit">${ro}</slot>
529
+ `;var no=i=>{let t=i.getAttribute(o.MEDIA_IS_PIP)!=null?S.EXIT_PIP():S.ENTER_PIP();i.setAttribute("aria-label",t)},Ur=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:so,...e})}connectedCallback(){no(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&no(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_IS_PIP)!=null?p.MEDIA_EXIT_PIP_REQUEST:p.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-pip-button")||d.customElements.define("media-pip-button",Ur);var Od=`<svg aria-hidden="true" viewBox="0 0 24 24">
534
530
  <path d="m6 21 15-9L6 3v18Z"/>
535
- </svg>`,$d=`<svg aria-hidden="true" viewBox="0 0 24 24">
531
+ </svg>`,Nd=`<svg aria-hidden="true" viewBox="0 0 24 24">
536
532
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
537
- </svg>`,so=u.createElement("template");so.innerHTML=`
533
+ </svg>`,lo=m.createElement("template");lo.innerHTML=`
538
534
  <style>
539
535
  :host([${o.MEDIA_PAUSED}]) slot[name=pause] > *,
540
536
  :host([${o.MEDIA_PAUSED}]) ::slotted([slot=pause]) {
@@ -547,11 +543,11 @@
547
543
  }
548
544
  </style>
549
545
 
550
- <slot name="play">${Bd}</slot>
551
- <slot name="pause">${$d}</slot>
552
- `;var ro=i=>{let t=i.getAttribute(o.MEDIA_PAUSED)!=null?C.PLAY():C.PAUSE();i.setAttribute("aria-label",t)},Dr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(e={}){super({slotTemplate:so,...e})}connectedCallback(){ro(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&ro(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Dr);var no=[1,1.25,1.5,1.75,2],ua=1,oo=u.createElement("template");oo.innerHTML=`
546
+ <slot name="play">${Od}</slot>
547
+ <slot name="pause">${Nd}</slot>
548
+ `;var oo=i=>{let t=i.getAttribute(o.MEDIA_PAUSED)!=null?S.PLAY():S.PAUSE();i.setAttribute("aria-label",t)},Br=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED]}constructor(e={}){super({slotTemplate:lo,...e})}connectedCallback(){oo(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&oo(this),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_PAUSED)!=null?p.MEDIA_PLAY_REQUEST:p.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new d.CustomEvent(e,{composed:!0,bubbles:!0}))}};d.customElements.get("media-play-button")||d.customElements.define("media-play-button",Br);var uo=[1,1.25,1.5,1.75,2],pa=1,co=m.createElement("template");co.innerHTML=`
553
549
  <span id="container"></span>
554
- `;var Or=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(e={}){super({slotTemplate:oo,...e}),this._rates=no,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${ua}x`}attributeChangedCallback(e,t,a){if(e==="rates"){let r=(a!=null?a:"").trim().split(/\s*,?\s+/).map(s=>Number(s)).filter(s=>!Number.isNaN(s)).sort((s,n)=>s-n);this._rates=r.length?r:no;return}if(e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,s=Number.isNaN(r)?ua:r;this.container.innerHTML=`${s}x`,this.setAttribute("aria-label",W.PLAYBACK_RATE({playbackRate:s}));return}super.attributeChangedCallback(e,t,a)}handleClick(){var e,t;let a=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||ua,r=(t=(e=this._rates.find(n=>n>a))!=null?e:this._rates[0])!=null?t:ua,s=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)}};d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",Or);var lo=u.createElement("template");lo.innerHTML=`
550
+ `;var $r=class extends L{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,"rates"]}constructor(e={}){super({slotTemplate:co,...e}),this._rates=uo,this.container=this.shadowRoot.querySelector("#container"),this.container.innerHTML=`${pa}x`}attributeChangedCallback(e,t,a){if(e==="rates"){let r=(a!=null?a:"").trim().split(/\s*,?\s+/).map(n=>Number(n)).filter(n=>!Number.isNaN(n)).sort((n,s)=>n-s);this._rates=r.length?r:uo;return}if(e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?pa:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",W.PLAYBACK_RATE({playbackRate:n}));return}super.attributeChangedCallback(e,t,a)}handleClick(){var e,t;let a=+this.getAttribute(o.MEDIA_PLAYBACK_RATE)||pa,r=(t=(e=this._rates.find(s=>s>a))!=null?e:this._rates[0])!=null?t:pa,n=new d.CustomEvent(p.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};d.customElements.get("media-playback-rate-button")||d.customElements.define("media-playback-rate-button",$r);var mo=m.createElement("template");mo.innerHTML=`
555
551
  <style>
556
552
  :host {
557
553
  pointer-events: none;
@@ -573,16 +569,28 @@
573
569
  </style>
574
570
 
575
571
  <img aria-hidden="true" id="image"/>
576
- `;var Hd=i=>{i.style.removeProperty("background-image")},Wd=(i,e)=>{i.style["background-image"]=`url('${e}')`},Nr=class extends d.HTMLElement{static get observedAttributes(){return["placeholder-src","src"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(lo.content.cloneNode(!0)),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),e==="placeholder-src"&&(a==null?Hd(this.image):Wd(this.image,a))}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Nr);var Wr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},B=(i,e,t)=>(Wr(i,e,"read from private field"),t?t.call(i):e.get(i)),q=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ne=(i,e,t,a)=>(Wr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oi=(i,e,t)=>(Wr(i,e,"access private method"),t),li,ma,di,fa,Ea,ha,Ur,pa,Tt,ci,Br,va,_a,ba,$r,Hr,co,Vd="video not loaded, unknown time.",Pr=i=>{let e=i.range,t=qe(+e.value),a=qe(+e.max),r=t&&a?`${t} of ${a}`:Vd;e.setAttribute("aria-valuetext",r)},uo=u.createElement("template");uo.innerHTML=`
572
+ `;var Pd=i=>{i.style.removeProperty("background-image")},Ud=(i,e)=>{i.style["background-image"]=`url('${e}')`},Hr=class extends d.HTMLElement{static get observedAttributes(){return["placeholder-src","src"]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(mo.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e==="src"&&(a==null?this.image.removeAttribute("src"):this.image.setAttribute("src",a)),e==="placeholder-src"&&(a==null?Pd(this.image):Ud(this.image,a))}};d.customElements.get("media-poster-image")||d.customElements.define("media-poster-image",Hr);var Wr="30",Bd=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${Wr}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,bo=m.createElement("template");bo.innerHTML=`
573
+ <slot name="backward">${Bd}</slot>
574
+ `;var $d=0,ho=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=S.SEEK_BACK_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},po=i=>{let e=Vi(i,"backward"),t=i.getAttribute("seek-offset");Wi(e,t)},Vr=class extends L{static get observedAttributes(){return[...super.observedAttributes,"seek-offset",o.MEDIA_CURRENT_TIME]}constructor(e={}){super({slotTemplate:bo,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Wr),ho(this),po(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",Wr),po(this),ho(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),a=e&&!Number.isNaN(+e)?+e:$d,r=Math.max(a-t,0),n=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Vr);var vo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},fo=(i,e,t)=>(vo(i,e,"read from private field"),t?t.call(i):e.get(i)),Hd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Wd=(i,e,t,a)=>(vo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oi,Fr=class extends Ne{constructor(){super(),Hd(this,oi,void 0),Wd(this,oi,this.shadowRoot.querySelector("slot")),fo(this,oi).textContent=J(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(fo(this,oi).textContent=J(a)),super.attributeChangedCallback(e,t,a)}};oi=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Fr);var Eo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ba=(i,e,t)=>(Eo(i,e,"read from private field"),t?t.call(i):e.get(i)),Vd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},fa=(i,e,t,a)=>(Eo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),be,go=m.createElement("template");go.innerHTML=`
575
+ <style>
576
+ :host {
577
+ box-sizing: border-box;
578
+ display: var(--media-control-display, var(--media-preview-thumbnail-display, inline-block));
579
+ overflow: hidden;
580
+ }
581
+
582
+ img {
583
+ display: none;
584
+ position: relative;
585
+ }
586
+ </style>
587
+ <img crossorigin loading="eager" decoding="async" />
588
+ `;var Kr=class extends d.HTMLElement{constructor(){super(),Vd(this,be,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(go.content.cloneNode(!0)))}static get observedAttributes(){return[v.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(fa(this,be,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ba(this,be))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ba(this,be))==null?void 0:e.unassociateElement)==null||t.call(e,this),fa(this,be,null)}attributeChangedCallback(e,t,a){var r,n,s,l,u;["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===v.MEDIA_CONTROLLER&&(t&&((n=(r=ba(this,be))==null?void 0:r.unassociateElement)==null||n.call(r,this),fa(this,be,null)),a&&(fa(this,be,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(l=ba(this,be))==null?void 0:l.associateElement)==null||u.call(l,this)))}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,n,s]=e.split(/\s+/).map(Pi=>+Pi),l=t.split("#")[0],u=getComputedStyle(this),{maxWidth:c,maxHeight:f,minWidth:A,minHeight:g}=u,y=Math.min(parseInt(c)/n,parseInt(f)/s),R=Math.max(parseInt(A)/n,parseInt(g)/s),$=y<1,k=$?y:R>1?R:1,{style:ge}=D(this.shadowRoot,":host"),ue=D(this.shadowRoot,"img").style,ee=this.shadowRoot.querySelector("img"),Yt=$?"min":"max";ge.setProperty(`${Yt}-width`,"initial","important"),ge.setProperty(`${Yt}-height`,"initial","important"),ge.width=`${n*k}px`,ge.height=`${s*k}px`;let bt=()=>{ue.width=`${this.imgWidth*k}px`,ue.height=`${this.imgHeight*k}px`,ue.display="block"};ee.src!==l&&(ee.onload=()=>{this.imgWidth=ee.naturalWidth,this.imgHeight=ee.naturalHeight,bt()},ee.src=l,bt()),bt(),ue.transform=`translate(-${a*k}px, -${r*k}px)`}};be=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Kr);var Xr=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},B=(i,e,t)=>(Xr(i,e,"read from private field"),t?t.call(i):e.get(i)),z=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Pe=(i,e,t,a)=>(Xr(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),li=(i,e,t)=>(Xr(i,e,"access private method"),t),di,va,ui,_a,ya,Ea,Gr,ga,Mt,ci,Zr,Ta,Ia,Aa,qr,Qr,Ao,Fd="video not loaded, unknown time.",Yr=i=>{let e=i.range,t=ze(+e.value),a=ze(+e.max),r=t&&a?`${t} of ${a}`:Fd;e.setAttribute("aria-valuetext",r)},_o=m.createElement("template");_o.innerHTML=`
577
589
  <style>
578
590
  :host {
579
- --media-preview-background-color: rgba(20,20,30, .5);
580
- --media-preview-background: var(--media-control-background,
581
- var(--media-preview-background-color));
582
591
  --media-preview-border-radius: 3px;
583
592
  --media-box-padding-left: 10px;
584
593
  --media-box-padding-right: 10px;
585
- color: #fff;
586
594
  }
587
595
 
588
596
  #preview-rail,
@@ -627,8 +635,8 @@
627
635
 
628
636
  transition: visibility 0s .25s;
629
637
  transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
630
- background: var(--media-preview-time-background, var(--media-preview-background));
631
- box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgba(0,0,0, .2));
638
+ background: var(--media-preview-time-background, var(--media-preview-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)))));
639
+ box-shadow: var(--media-preview-thumbnail-box-shadow, 0 0 4px rgb(0 0 0 / .2));
632
640
  max-width: var(--media-preview-thumbnail-max-width, 180px);
633
641
  max-height: var(--media-preview-thumbnail-max-height, 160px);
634
642
  min-width: var(--media-preview-thumbnail-min-width, 120px);
@@ -646,18 +654,17 @@
646
654
 
647
655
  media-preview-time-display,
648
656
  ::slotted(media-preview-time-display) {
649
- color: unset;
650
657
  min-width: 0;
651
658
 
652
659
  transition: min-width 0s, border-radius 0s;
653
660
  transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
654
- background: var(--media-preview-time-background, var(--media-preview-background));
661
+ background: var(--media-preview-time-background, var(--media-preview-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)))));
655
662
  border-radius: var(--media-preview-time-border-radius,
656
663
  var(--media-preview-border-radius) var(--media-preview-border-radius)
657
664
  var(--media-preview-border-radius) var(--media-preview-border-radius));
658
665
  padding: var(--media-preview-time-padding, 1px 10px 0);
659
666
  margin: var(--media-preview-time-margin, 0 0 10px);
660
- text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgba(0,0,0, .75));
667
+ text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));
661
668
  }
662
669
 
663
670
  :host([${o.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
@@ -683,23 +690,7 @@
683
690
 
684
691
  </slot>
685
692
  </div>
686
- `;var ga=class extends ai{constructor(){super(),q(this,ha),q(this,ba),q(this,Hr),q(this,li,void 0),q(this,ma,void 0),q(this,di,void 0),q(this,fa,void 0),q(this,Ea,void 0),q(this,pa,t=>{if([...B(this,li)].some(f=>t.composedPath().includes(f)))return;this.updatePointerBar(t);let a=+this.getAttribute(o.MEDIA_DURATION);if(!a)return;let r=this.range.getBoundingClientRect(),s=(t.clientX-r.left)/r.width;s=Math.max(0,Math.min(1,s));let n=oi(this,ha,Ur).call(this,B(this,ma),s),{style:l}=D(this.shadowRoot,"#preview-rail");l.transform=`translateX(${n})`;let c=s*a,m=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:c});this.dispatchEvent(m)}),q(this,Tt,!1),q(this,ci,t=>{(!t.composedPath().includes(this)||[...B(this,li)].some(a=>t.composedPath().includes(a)))&&(d.removeEventListener("pointermove",B(this,ci)),Ne(this,Tt,!1),B(this,va).call(this))}),q(this,Br,()=>{d.addEventListener("pointermove",B(this,pa),!1)}),q(this,va,()=>{d.removeEventListener("pointermove",B(this,pa));let t=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),q(this,_a,()=>{let t=this.getAttribute(o.MEDIA_DURATION);!B(this,Tt)&&t&&(Ne(this,Tt,!0),B(this,Br).call(this),d.addEventListener("pointermove",B(this,ci),!1))}),this.container.appendChild(uo.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Ne(this,li,this.shadowRoot.querySelectorAll('[part~="box"]')),Ne(this,ma,this.shadowRoot.querySelector('[part~="preview-box"]')),Ne(this,di,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Ne(this,fa,parseInt(e.getPropertyValue("--media-box-padding-left"))),Ne(this,Ea,parseInt(e.getPropertyValue("--media-box-padding-right"))),oi(this,ba,$r).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",W.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,s,n,l,c;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Pr(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(s=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?s:1e3,Pr(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(n=this.mediaSeekableStart)!=null?n:0,this.range.max=(c=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?c:1e3,Pr(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?oi(this,ba,$r).call(this):oi(this,Hr,co).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaPlaybackRate(){let e=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return e!=null?+e:1}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,s=this.mediaBuffered;if(!s.length||!Number.isFinite(r)||r<=0)return t;let n=this.mediaCurrentTime,[,l=a.min]=(e=s.find(([f,_])=>f<=n&&n<=_))!=null?e:[],m=(l-a.min)/r*100;return t.splice(1,0,["var(--media-time-buffered-color, rgba(255,255,255, .4))",m]),t}updateCurrentBox(){if(!B(this,di).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=oi(this,ha,Ur).call(this,B(this,di),e),{style:a}=D(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};li=new WeakMap;ma=new WeakMap;di=new WeakMap;fa=new WeakMap;Ea=new WeakMap;ha=new WeakSet;Ur=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let s=(t=this.getAttribute("bounds")?Qe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,n=this.range.getBoundingClientRect(),l=s.getBoundingClientRect(),c=(B(this,fa)-(n.left-l.left-r/2))/n.width*100,m=(l.right-n.left-r/2-B(this,Ea))/n.width*100;return Number.isNaN(c)||(a=`max(${c*100}%, ${a})`),Number.isNaN(m)||(a=`min(${a}, ${m*100}%)`),a};pa=new WeakMap;Tt=new WeakMap;ci=new WeakMap;Br=new WeakMap;va=new WeakMap;_a=new WeakMap;ba=new WeakSet;$r=function(){this.addEventListener("pointermove",B(this,_a),!1)};Hr=new WeakSet;co=function(){d.removeEventListener("pointermove",B(this,ci)),this.removeEventListener("pointermove",B(this,_a)),Ne(this,Tt,!1),B(this,va).call(this)};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",ga);var Vr=ga;var Fr=class extends Vr{constructor(){super(),console.warn("MediaChrome: <media-progress-range> is deprecated. Use <media-time-range> instead.")}};d.customElements.get("media-progress-range")||d.customElements.define("media-progress-range",Fr);var Kr="30",Fd=`<svg aria-hidden="true" viewBox="0 0 20 24"><defs><style>.text{font-size:8px;font-family:Arial-BoldMT, Arial;font-weight:700;}</style></defs><text class="text value" transform="translate(2.18 19.87)">${Kr}</text><path d="M10 6V3L4.37 7 10 10.94V8a5.54 5.54 0 0 1 1.9 10.48v2.12A7.5 7.5 0 0 0 10 6Z"/></svg>`,po=u.createElement("template");po.innerHTML=`
687
- <slot name="backward">${Fd}</slot>
688
- `;var Kd=0,mo=i=>{let e=Math.abs(+i.getAttribute("seek-offset")),t=C.SEEK_BACK_N_SECS({seekOffset:e});i.setAttribute("aria-label",t)},ho=i=>{let e=Hi(i,"backward"),t=i.getAttribute("seek-offset");$i(e,t)},Yr=class extends S{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME]}constructor(e={}){super({slotTemplate:po,...e})}connectedCallback(){this.hasAttribute("seek-offset")||this.setAttribute("seek-offset",Kr),mo(this),ho(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e==="seek-offset"&&(a==null&&this.setAttribute("seek-offset",Kr),ho(this),mo(this)),super.attributeChangedCallback(e,t,a)}handleClick(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME),t=+this.getAttribute("seek-offset"),a=e&&!Number.isNaN(+e)?+e:Kd,r=Math.max(a-t,0),s=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)}};d.customElements.get("media-seek-backward-button")||d.customElements.define("media-seek-backward-button",Yr);var fo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},bo=(i,e,t)=>(fo(i,e,"read from private field"),t?t.call(i):e.get(i)),Yd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Gd=(i,e,t,a)=>(fo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ui,Gr=class extends Oe{constructor(){super(),Yd(this,ui,void 0),Gd(this,ui,this.shadowRoot.querySelector("slot")),bo(this,ui).textContent=z(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(bo(this,ui).textContent=z(a)),super.attributeChangedCallback(e,t,a)}};ui=new WeakMap;d.customElements.get("media-preview-time-display")||d.customElements.define("media-preview-time-display",Gr);var Eo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Aa=(i,e,t)=>(Eo(i,e,"read from private field"),t?t.call(i):e.get(i)),Zd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ya=(i,e,t,a)=>(Eo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),be,vo=u.createElement("template");vo.innerHTML=`
689
- <style>
690
- :host {
691
- box-sizing: border-box;
692
- display: var(--media-control-display, var(--media-preview-thumbnail-display, inline-block));
693
- overflow: hidden;
694
- }
695
-
696
- img {
697
- display: none;
698
- position: relative;
699
- }
700
- </style>
701
- <img crossorigin loading="eager" decoding="async" />
702
- `;var Zr=class extends d.HTMLElement{constructor(){super(),Zd(this,be,void 0),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(vo.content.cloneNode(!0))}static get observedAttributes(){return[E.MEDIA_CONTROLLER,"time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(ya(this,be,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Aa(this,be))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Aa(this,be))==null?void 0:e.unassociateElement)==null||t.call(e,this),ya(this,be,null)}attributeChangedCallback(e,t,a){var r,s,n,l,c;["time",o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===E.MEDIA_CONTROLLER&&(t&&((s=(r=Aa(this,be))==null?void 0:r.unassociateElement)==null||s.call(r,this),ya(this,be,null)),a&&(ya(this,be,(n=this.getRootNode())==null?void 0:n.getElementById(a)),(c=(l=Aa(this,be))==null?void 0:l.associateElement)==null||c.call(l,this)))}update(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS),t=this.getAttribute(o.MEDIA_PREVIEW_IMAGE);if(!(e&&t))return;let[a,r,s,n]=e.split(/\s+/).map(Ni=>+Ni),l=t.split("#")[0],c=getComputedStyle(this),{maxWidth:m,maxHeight:f,minWidth:_,minHeight:g}=c,y=Math.min(parseInt(m)/s,parseInt(f)/n),x=Math.max(parseInt(_)/s,parseInt(g)/n),$=y<1,k=$?y:x>1?x:1,{style:_e}=D(this.shadowRoot,":host"),ce=D(this.shadowRoot,"img").style,J=this.shadowRoot.querySelector("img"),Vt=$?"min":"max";_e.setProperty(`${Vt}-width`,"initial","important"),_e.setProperty(`${Vt}-height`,"initial","important"),_e.width=`${s*k}px`,_e.height=`${n*k}px`;let mt=()=>{ce.width=`${this.imgWidth*k}px`,ce.height=`${this.imgHeight*k}px`,ce.display="block"};J.src!==l&&(J.onload=()=>{this.imgWidth=J.naturalWidth,this.imgHeight=J.naturalHeight,mt()},J.src=l,mt()),mt(),ce.transform=`translate(-${a*k}px, -${r*k}px)`}};be=new WeakMap;d.customElements.get("media-preview-thumbnail")||d.customElements.define("media-preview-thumbnail",Zr);var go=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ta=(i,e,t)=>(go(i,e,"read from private field"),t?t.call(i):e.get(i)),qd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ia=(i,e,t,a)=>(go(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fe,_o=u.createElement("template"),Qd=`
693
+ `;var zr=class extends ri{constructor(){super(),z(this,Ea),z(this,Aa),z(this,Qr),z(this,di,void 0),z(this,va,void 0),z(this,ui,void 0),z(this,_a,void 0),z(this,ya,void 0),z(this,ga,t=>{if([...B(this,di)].some(f=>t.composedPath().includes(f)))return;this.updatePointerBar(t);let a=+this.getAttribute(o.MEDIA_DURATION);if(!a)return;let r=this.range.getBoundingClientRect(),n=(t.clientX-r.left)/r.width;n=Math.max(0,Math.min(1,n));let s=li(this,Ea,Gr).call(this,B(this,va),n),{style:l}=D(this.shadowRoot,"#preview-rail");l.transform=`translateX(${s})`;let u=n*a,c=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:u});this.dispatchEvent(c)}),z(this,Mt,!1),z(this,ci,t=>{(!t.composedPath().includes(this)||[...B(this,di)].some(a=>t.composedPath().includes(a)))&&(d.removeEventListener("pointermove",B(this,ci)),Pe(this,Mt,!1),B(this,Ta).call(this))}),z(this,Zr,()=>{d.addEventListener("pointermove",B(this,ga),!1)}),z(this,Ta,()=>{d.removeEventListener("pointermove",B(this,ga));let t=new d.CustomEvent(p.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:null});this.dispatchEvent(t)}),z(this,Ia,()=>{let t=this.getAttribute(o.MEDIA_DURATION);!B(this,Mt)&&t&&(Pe(this,Mt,!0),B(this,Zr).call(this),d.addEventListener("pointermove",B(this,ci),!1))}),this.container.appendChild(_o.content.cloneNode(!0)),this.range.addEventListener("input",()=>{cancelAnimationFrame(this._refreshId);let a=this.range.value,r=new d.CustomEvent(p.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:a});this.dispatchEvent(r)}),this._refreshBar=()=>{let t=(performance.now()-this._updateTimestamp)/1e3;this.range.value=this.mediaCurrentTime+t*this.mediaPlaybackRate,this.updateBar(),this.updateCurrentBox(),this._refreshId=requestAnimationFrame(this._refreshBar)},Pe(this,di,this.shadowRoot.querySelectorAll('[part~="box"]')),Pe(this,va,this.shadowRoot.querySelector('[part~="preview-box"]')),Pe(this,ui,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);Pe(this,_a,parseInt(e.getPropertyValue("--media-box-padding-left"))),Pe(this,ya,parseInt(e.getPropertyValue("--media-box-padding-right"))),li(this,Aa,qr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"thumbnails","disabled",o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING]}connectedCallback(){this.range.setAttribute("aria-label",W.SEEK()),super.connectedCallback()}disconnectedCallback(){cancelAnimationFrame(this._refreshId),super.disconnectedCallback()}attributeChangedCallback(e,t,a){var r,n,s,l,u;(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_LOADING)&&(this._updateTimestamp=performance.now(),this.range.value=this.mediaCurrentTime,Yr(this),this.updateBar(),this.updateCurrentBox(),cancelAnimationFrame(this._refreshId),!this.mediaPaused&&!this.mediaLoading&&(this._refreshId=requestAnimationFrame(this._refreshBar))),e===o.MEDIA_DURATION&&(this.range.max=(n=(r=this.mediaSeekableEnd)!=null?r:this.mediaDuration)!=null?n:1e3,Yr(this),this.updateBar(),this.updateCurrentBox()),e===o.MEDIA_SEEKABLE&&(this.range.min=(s=this.mediaSeekableStart)!=null?s:0,this.range.max=(u=(l=this.mediaSeekableEnd)!=null?l:this.mediaDuration)!=null?u:1e3,Yr(this),this.updateBar()),e===o.MEDIA_BUFFERED&&this.updateBar(),e==="disabled"&&(a==null?li(this,Aa,qr).call(this):li(this,Qr,Ao).call(this)),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return this.hasAttribute(o.MEDIA_PAUSED)}get mediaLoading(){return this.hasAttribute(o.MEDIA_LOADING)}get mediaDuration(){let e=this.getAttribute(o.MEDIA_DURATION);return e!=null?+e:void 0}get mediaCurrentTime(){let e=this.getAttribute(o.MEDIA_CURRENT_TIME);return e!=null?+e:void 0}get mediaPlaybackRate(){let e=this.getAttribute(o.MEDIA_PLAYBACK_RATE);return e!=null?+e:1}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(!!e)return e.split(":").map(t=>+t)}get mediaSeekableEnd(){var e;let[,t]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t]=(e=this.mediaSeekable)!=null?e:[];return t}getBarColors(){var e;let t=super.getBarColors(),{range:a}=this,r=a.max-a.min,n=this.mediaBuffered;if(!n.length||!Number.isFinite(r)||r<=0)return t;let s=this.mediaCurrentTime,[,l=a.min]=(e=n.find(([f,A])=>f<=s&&s<=A))!=null?e:[],c=(l-a.min)/r*100;return t.splice(1,0,["var(--media-time-buffered-color, rgb(255 255 255 / .4))",c]),t}updateCurrentBox(){if(!B(this,ui).assignedElements().length)return;let e=this.range.value/(this.range.max-this.range.min),t=li(this,Ea,Gr).call(this,B(this,ui),e),{style:a}=D(this.shadowRoot,"#current-rail");a.transform=`translateX(${t})`}};di=new WeakMap;va=new WeakMap;ui=new WeakMap;_a=new WeakMap;ya=new WeakMap;Ea=new WeakSet;Gr=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?Xe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),l=n.getBoundingClientRect(),u=(B(this,_a)-(s.left-l.left-r/2))/s.width*100,c=(l.right-s.left-r/2-B(this,ya))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(c)||(a=`min(${a}, ${c*100}%)`),a};ga=new WeakMap;Mt=new WeakMap;ci=new WeakMap;Zr=new WeakMap;Ta=new WeakMap;Ia=new WeakMap;Aa=new WeakSet;qr=function(){this.addEventListener("pointermove",B(this,Ia),!1)};Qr=new WeakSet;Ao=function(){d.removeEventListener("pointermove",B(this,ci)),this.removeEventListener("pointermove",B(this,Ia)),Pe(this,Mt,!1),B(this,Ta).call(this)};d.customElements.get("media-time-range")||d.customElements.define("media-time-range",zr);var yo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ka=(i,e,t)=>(yo(i,e,"read from private field"),t?t.call(i):e.get(i)),Kd=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ma=(i,e,t,a)=>(yo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),fe,To=m.createElement("template"),Yd=`
703
694
  <svg aria-hidden="true" viewBox="0 0 100 100">
704
695
  <path d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50">
705
696
  <animateTransform
@@ -712,7 +703,7 @@
712
703
  repeatCount="indefinite" />
713
704
  </path>
714
705
  </svg>
715
- `;_o.innerHTML=`
706
+ `;To.innerHTML=`
716
707
  <style>
717
708
  :host {
718
709
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
@@ -744,54 +735,52 @@
744
735
  svg, img, ::slotted(svg), ::slotted(img) {
745
736
  width: var(--media-loading-icon-width, 100px);
746
737
  height: var(--media-loading-icon-height);
747
- fill: var(--media-icon-color, #fff);
738
+ fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
748
739
  vertical-align: middle;
749
740
  }
750
741
  </style>
751
742
 
752
- <slot name="loading">${Qd}</slot>
743
+ <slot name="loading">${Yd}</slot>
753
744
  <div id="status" role="status" aria-live="polite">${W.MEDIA_LOADING()}</div>
754
- `;var zd=500,qr=class extends d.HTMLElement{constructor(){super(),qd(this,fe,void 0);let e=this.attachShadow({mode:"open"}),t=_o.content.cloneNode(!0);e.appendChild(t)}static get observedAttributes(){return[E.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}attributeChangedCallback(e,t,a){var r,s,n,l,c,m;if(e===o.MEDIA_LOADING||e===o.MEDIA_PAUSED){let f=this.getAttribute(o.MEDIA_PAUSED)!=null,_=this.getAttribute(o.MEDIA_LOADING)!=null,g=!f&&_;if(!g)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&g){let y=+((r=this.getAttribute("loading-delay"))!=null?r:zd);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},y)}}else e===E.MEDIA_CONTROLLER&&(t&&((n=(s=Ta(this,fe))==null?void 0:s.unassociateElement)==null||n.call(s,this),Ia(this,fe,null)),a&&(Ia(this,fe,(l=this.getRootNode())==null?void 0:l.getElementById(a)),(m=(c=Ta(this,fe))==null?void 0:c.associateElement)==null||m.call(c,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(E.MEDIA_CONTROLLER);r&&(Ia(this,fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Ta(this,fe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),(t=(e=Ta(this,fe))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ia(this,fe,null)}};fe=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",qr);var Ao=u.createElement("template");Ao.innerHTML=`
755
- <style>
756
- :host {
757
- }
758
- </style>
759
- <slot></slot>
760
- `;var Qr=class extends d.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ao.content.cloneNode(!0))}};d.customElements.get("media-title-bar")||d.customElements.define("media-title-bar",Qr);var Xd=100,Jd=i=>{var e;if(i.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((e=i.getAttribute(o.MEDIA_VOLUME))!=null?e:1);return Math.round(a*i.range.max)},jd=({value:i,max:e})=>`${Math.round(i/e*100)}%`,zr=class extends ai{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Xd,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",W.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=Jd(this);this.range.value=r,this.range.setAttribute("aria-valuetext",jd(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",zr);var Xr=class extends ti{};d.customElements.get("media-chrome")||d.customElements.define("media-chrome",Xr);var Jr=class extends ti{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};d.customElements.get("media-container")||d.customElements.define("media-container",Jr);var is=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(is(i,e,"read from private field"),t?t.call(i):e.get(i)),te=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ee=(i,e,t,a)=>(is(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mi=(i,e,t)=>(is(i,e,"access private method"),t),Pe,kt,hi,wt,ye,Mt,jr,je,St,ka,It,es,pi,Ma,ts,yo,as,To,Io=u.createElement("template");Io.innerHTML=`
745
+ `;var Gd=500,Jr=class extends d.HTMLElement{constructor(){if(super(),Kd(this,fe,void 0),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=To.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[v.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,"loading-delay"]}attributeChangedCallback(e,t,a){var r,n,s,l,u,c;if(e===o.MEDIA_LOADING||e===o.MEDIA_PAUSED){let f=this.getAttribute(o.MEDIA_PAUSED)!=null,A=this.getAttribute(o.MEDIA_LOADING)!=null,g=!f&&A;if(!g)this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),this.removeAttribute("is-loading");else if(!this.loadingDelayHandle&&g){let y=+((r=this.getAttribute("loading-delay"))!=null?r:Gd);this.loadingDelayHandle=setTimeout(()=>{this.setAttribute("is-loading",""),this.loadingDelayHandle=void 0},y)}}else e===v.MEDIA_CONTROLLER&&(t&&((s=(n=ka(this,fe))==null?void 0:n.unassociateElement)==null||s.call(n,this),Ma(this,fe,null)),a&&(Ma(this,fe,(l=this.getRootNode())==null?void 0:l.getElementById(a)),(c=(u=ka(this,fe))==null?void 0:u.associateElement)==null||c.call(u,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(v.MEDIA_CONTROLLER);r&&(Ma(this,fe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ka(this,fe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.loadingDelayHandle&&(clearTimeout(this.loadingDelayHandle),this.loadingDelayHandle=void 0),(t=(e=ka(this,fe))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ma(this,fe,null)}};fe=new WeakMap;d.customElements.get("media-loading-indicator")||d.customElements.define("media-loading-indicator",Jr);var Zd=100,qd=i=>{var e;if(i.getAttribute(o.MEDIA_MUTED)!=null)return 0;let a=+((e=i.getAttribute(o.MEDIA_VOLUME))!=null?e:1);return Math.round(a*i.range.max)},Qd=({value:i,max:e})=>`${Math.round(i/e*100)}%`,jr=class extends ri{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.max=Zd,this.range.addEventListener("input",()=>{let t=this.range.value/this.range.max,a=new d.CustomEvent(p.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(a)})}connectedCallback(){this.range.setAttribute("aria-label",W.VOLUME()),super.connectedCallback()}attributeChangedCallback(e,t,a){if(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED){let r=qd(this);this.range.value=r,this.range.setAttribute("aria-valuetext",Qd(this.range)),this.updateBar()}super.attributeChangedCallback(e,t,a)}};d.customElements.get("media-volume-range")||d.customElements.define("media-volume-range",jr);var en=class extends ii{};d.customElements.get("media-chrome")||d.customElements.define("media-chrome",en);var tn=class extends ii{constructor(){super(),console.warn("MediaChrome: <media-container> is deprecated. Use <media-controller>.")}};d.customElements.get("media-container")||d.customElements.define("media-container",tn);var ln=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},M=(i,e,t)=>(ln(i,e,"read from private field"),t?t.call(i):e.get(i)),Y=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ae=(i,e,t,a)=>(ln(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ye=(i,e,t)=>(ln(i,e,"access private method"),t),Be,wt,mi,Lt,hi,Te,Ct,an,Ue,tt,Sa,wa,rn,St,nn,pi,La,Ca,sn,on,Io,dn,ko,Mo=m.createElement("template");Mo.innerHTML=`
761
746
  <style>
762
747
  :host ul {
748
+ font: var(--media-font,
749
+ var(--media-font-weight, normal)
750
+ var(--media-font-size, 1em) /
751
+ var(--media-text-content-height, var(--media-control-height, 24px))
752
+ var(--media-font-family, helvetica neue, segoe ui, roboto, arial, sans-serif));
753
+ color: var(--media-text-color, var(--media-primary-color, rgb(238 238 238)));
754
+ background: var(--media-listbox-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .8))));
763
755
  list-style: none;
764
756
  display: inline-flex;
765
757
  flex-direction: column;
766
758
  gap: 0.5em;
767
759
  margin: 0;
768
760
  padding: 0.5em;
769
- background-color: var(--media-listbox-background, var(--media-control-background, rgba(10,10,15, .8)));
770
- color: var(--media-text-color, white);
771
- font-family: Arial, sans-serif;
772
761
  }
773
762
 
774
763
  ::slotted(media-chrome-listitem[tabindex="0"]:focus-visible),
775
764
  media-chrome-listitem[tabindex="0"]:focus-visible {
776
- box-shadow: inset 0 0 0 2px rgba(27, 127, 204, 0.9);
765
+ box-shadow: inset 0 0 0 2px rgb(27 127 204 / .9);
777
766
  outline: 0;
778
767
  }
779
768
 
780
769
  ::slotted(media-chrome-listitem[aria-selected="true"]),
781
770
  media-chrome-listitem[aria-selected="true"] {
782
- background-color: var(--media-listbox-selected-background, rgba(122,122,184, .8));
771
+ background-color: var(--media-listbox-selected-background, rgb(122 122 184 / .8));
783
772
  }
784
773
 
785
774
  ::slotted(media-chrome-listitem:hover),
786
775
  media-chrome-listitem:hover {
787
- background-color: var(--media-listbox-hover-background, rgba(82,82,122, .8));
776
+ background-color: var(--media-listbox-hover-background, rgb(82 82 122 / .8));
788
777
  outline: var(--media-listbox-hover-outline, none);
789
778
  }
790
779
  </style>
791
780
  <ul tabindex="0">
792
781
  <slot></slot>
793
782
  </ul>
794
- `;var Sa=class extends d.HTMLElement{constructor(e={}){super(),te(this,ye),te(this,je),te(this,pi),te(this,ts),te(this,as),te(this,Pe,""),te(this,kt,null),te(this,hi,void 0),te(this,wt,void 0),te(this,ka,s=>{this.handleClick(s)}),te(this,It,s=>{let{key:n}=s;if(n==="Escape"){this.removeEventListener("keyup",M(this,It));return}n==="Enter"||n===" "?this.handleSelection(s):this.handleMovement(s)}),te(this,es,s=>{let{metaKey:n,altKey:l}=s;if(n||l){this.removeEventListener("keyup",M(this,It));return}s.preventDefault(),this.addEventListener("keyup",M(this,It),{once:!0})});let t=this.attachShadow({mode:"open"}),a=Io.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=u.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a),Ee(this,hi,this.shadowRoot.querySelector("slot")),M(this,hi).addEventListener("slotchange",()=>{Ee(this,ye,M(this,hi).assignedElements({flatten:!0}),jr),M(this,ye,Mt).length===1&&M(this,ye,Mt)[0].nodeName.toLowerCase()==="slot"&&Ee(this,ye,M(this,ye,Mt)[0].assignedElements({flatten:!0}),jr);let s=M(this,je,St);if(s.some(c=>c.getAttribute("tabindex")==="0"))return;let l=s.filter(c=>c.getAttribute("aria-selected")==="true")[0];l||(l=s[0]),l&&(l.setAttribute("tabindex",0),l.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",E.MEDIA_CONTROLLER]}get selectedOptions(){return M(this,je,St).filter(e=>e.getAttribute("aria-selected")==="true")}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",M(this,ka)),this.addEventListener("keydown",M(this,es))}disable(){this.removeEventListener("click",M(this,ka)),this.removeEventListener("keyup",M(this,It))}attributeChangedCallback(e,t,a){var r,s;if(e===E.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e){let t=mi(this,pi,Ma).call(this,e);if(!t)return;let a=t.getAttribute("aria-selected")==="true";this.getAttribute("aria-multiselectable")!=="true"&&M(this,ye,Mt).forEach(r=>r.setAttribute("aria-selected","false")),a?t.setAttribute("aria-selected","false"):t.setAttribute("aria-selected","true"),this.dispatchEvent(new Event("change"))}handleMovement(e){let{key:t}=e,a=M(this,je,St),r=mi(this,pi,Ma).call(this,e);r||(r=a.filter(n=>n.getAttribute("tabindex")==="0")[0]);let s;switch(t){case"ArrowDown":s=r.nextElementSibling,s!=null&&s.hasAttribute("disabled")&&(s=s.nextElementSibling);break;case"ArrowUp":s=r.previousElementSibling,s!=null&&s.hasAttribute("disabled")&&(s=s.previousElementSibling);break;case"Home":s=a[0];break;case"End":s=a[a.length-1];break;default:s=mi(this,ts,yo).call(this,t);break}s&&(a.forEach(n=>n.setAttribute("tabindex","-1")),s.setAttribute("tabindex","0"),s.focus())}handleClick(e){let t=mi(this,pi,Ma).call(this,e);!t||t.hasAttribute("disabled")||(M(this,je,St).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e))}};Pe=new WeakMap;kt=new WeakMap;hi=new WeakMap;wt=new WeakMap;ye=new WeakSet;Mt=function(){return M(this,wt)||Ee(this,wt,Array.from(this.shadowRoot.querySelectorAll("media-chrome-listitem"))),M(this,wt)};jr=function(i){Ee(this,wt,i)};je=new WeakSet;St=function(){return M(this,ye,Mt).filter(i=>!i.hasAttribute("disabled"))};ka=new WeakMap;It=new WeakMap;es=new WeakMap;pi=new WeakSet;Ma=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};ts=new WeakSet;yo=function(i){mi(this,as,To).call(this);let e=M(this,je,St),t=e.findIndex(m=>m.getAttribute("tabindex")==="0");Ee(this,Pe,M(this,Pe)+i);let a=M(this,Pe).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Pe))),s=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(M(this,Pe))),n=[],l=[];return a&&(n=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),l=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...s,...n,...l][0]};as=new WeakSet;To=function(){d.clearTimeout(M(this,kt)),Ee(this,kt,null),Ee(this,kt,d.setTimeout(()=>{Ee(this,Pe,""),Ee(this,kt,null)},500))};d.customElements.get("media-chrome-listbox")||d.customElements.define("media-chrome-listbox",Sa);var ko=Sa;var ns=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},b=(i,e,t)=>(ns(i,e,"read from private field"),t?t.call(i):e.get(i)),F=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},ie=(i,e,t,a)=>(ns(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Te=(i,e,t)=>(ns(i,e,"access private method"),t),Ct,bi,Lt,P,fi,L,ve,Ei,et,xt,wa,rs,Mo,ss,So,Rt,vi,os,wo,Ca,ls,Co=u.createElement("template");Co.innerHTML=`
783
+ `;var Ra=class extends d.HTMLElement{constructor(e={}){if(super(),Y(this,Te),Y(this,Ue),Y(this,wa),Y(this,pi),Y(this,Ca),Y(this,on),Y(this,dn),Y(this,Be,""),Y(this,wt,null),Y(this,mi,void 0),Y(this,Lt,void 0),Y(this,hi,!1),Y(this,Sa,t=>{this.handleClick(t)}),Y(this,St,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",M(this,St));return}if(a==="Meta"){ae(this,hi,!1);return}ye(this,wa,rn).call(this,t)}),Y(this,nn,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",M(this,St));return}if(a==="Meta"){ae(this,hi,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),M(this,hi)&&this.keysUsed.includes(a)){ye(this,wa,rn).call(this,t);return}this.addEventListener("keyup",M(this,St),{once:!0})}),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Mo.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=m.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}ae(this,mi,this.shadowRoot.querySelector("slot")),M(this,mi).addEventListener("slotchange",()=>{ae(this,Te,M(this,mi).assignedElements({flatten:!0}),an),M(this,Te,Ct).length===1&&M(this,Te,Ct)[0].nodeName.toLowerCase()==="slot"&&ae(this,Te,M(this,Te,Ct)[0].assignedElements({flatten:!0}),an);let t=M(this,Ue,tt);if(t.some(n=>n.getAttribute("tabindex")==="0"))return;let r=t.filter(n=>n.getAttribute("aria-selected")==="true")[0];r||(r=t[0]),r&&(r.setAttribute("tabindex",0),r.setAttribute("aria-selected","true"))})}static get observedAttributes(){return["disabled",v.MEDIA_CONTROLLER]}get selectedOptions(){return M(this,Ue,tt).filter(e=>e.getAttribute("aria-selected")==="true")}get value(){return this.selectedOptions[0].value||this.selectedOptions[0].textContent}set value(e){let t=M(this,Ue,tt).find(a=>a.value===e||a.textContent===e);!t||ye(this,Ca,sn).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",M(this,Sa)),this.addEventListener("keydown",M(this,nn))}disable(){this.removeEventListener("click",M(this,Sa)),this.removeEventListener("keyup",M(this,St))}attributeChangedCallback(e,t,a){var r,n;if(e===v.MEDIA_CONTROLLER){if(t){let s=m.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=m.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=m.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=m.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=ye(this,pi,La).call(this,e);!a||ye(this,Ca,sn).call(this,a,t)}handleMovement(e){let{key:t}=e,a=M(this,Ue,tt),r=ye(this,pi,La).call(this,e);r||(r=a.filter(s=>s.getAttribute("tabindex")==="0")[0]);let n;switch(t){case"ArrowDown":n=r.nextElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.nextElementSibling);break;case"ArrowUp":n=r.previousElementSibling,n!=null&&n.hasAttribute("disabled")&&(n=n.previousElementSibling);break;case"Home":n=a[0];break;case"End":n=a[a.length-1];break;default:n=ye(this,on,Io).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=ye(this,pi,La).call(this,e);!t||t.hasAttribute("disabled")||(M(this,Ue,tt).forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};Be=new WeakMap;wt=new WeakMap;mi=new WeakMap;Lt=new WeakMap;hi=new WeakMap;Te=new WeakSet;Ct=function(){return M(this,Lt)||ae(this,Lt,Array.from(this.shadowRoot.querySelectorAll("media-chrome-listitem"))),M(this,Lt)};an=function(i){ae(this,Lt,i)};Ue=new WeakSet;tt=function(){return M(this,Te,Ct).filter(i=>!i.hasAttribute("disabled"))};Sa=new WeakMap;wa=new WeakSet;rn=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};St=new WeakMap;nn=new WeakMap;pi=new WeakSet;La=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-LISTITEM");return e[t]};Ca=new WeakSet;sn=function(i,e){(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&M(this,Te,Ct).forEach(t=>t.setAttribute("aria-selected","false")),e&&i.getAttribute("aria-selected")==="true"?i.setAttribute("aria-selected","false"):i.setAttribute("aria-selected","true"),this.dispatchEvent(new Event("change"))};on=new WeakSet;Io=function(i){ye(this,dn,ko).call(this);let e=M(this,Ue,tt),t=e.findIndex(c=>c.getAttribute("tabindex")==="0");ae(this,Be,M(this,Be)+i);let a=M(this,Be).split("").every(c=>c===i),r=e.slice(t+(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(M(this,Be))),n=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.toLowerCase().startsWith(M(this,Be))),s=[],l=[];return a&&(s=e.slice(t+(a?1:0)).filter(c=>c.textContent.startsWith(i)),l=e.slice(0,t-(a?1:0)).filter(c=>c.textContent.startsWith(i))),[...r,...n,...s,...l][0]};dn=new WeakSet;ko=function(){d.clearTimeout(M(this,wt)),ae(this,wt,null),ae(this,wt,d.setTimeout(()=>{ae(this,Be,""),ae(this,wt,null)},500))};d.customElements.get("media-chrome-listbox")||d.customElements.define("media-chrome-listbox",Ra);var So=Ra;var mn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},b=(i,e,t)=>(mn(i,e,"read from private field"),t?t.call(i):e.get(i)),F=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},re=(i,e,t,a)=>(mn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ie=(i,e,t)=>(mn(i,e,"access private method"),t),Rt,bi,xt,N,fi,w,ve,vi,it,Dt,xa,un,wo,cn,Lo,Ot,Ei,hn,Co,Da,pn,Ro=m.createElement("template");Ro.innerHTML=`
795
784
  <style>
796
785
  :host {
797
786
  display: inline-flex;
@@ -819,7 +808,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
819
808
  <slot></slot>
820
809
  </media-chrome-listbox>
821
810
  </slot>
822
- `;var La=class extends d.HTMLElement{constructor(){var e;super(),F(this,rs),F(this,ss),F(this,Rt),F(this,os),F(this,Ca),F(this,Ct,void 0),F(this,bi,void 0),F(this,Lt,!0),F(this,P,void 0),F(this,fi,void 0),F(this,L,void 0),F(this,ve,void 0),F(this,Ei,!1),F(this,et,s=>{let{key:n}=s;if(!this.keysUsed.includes(n)){this.removeEventListener("keyup",b(this,et));return}s.composedPath().includes(b(this,P))&&(n==="Enter"||n===" ")?b(this,Ct).call(this):n==="Escape"&&!b(this,ve).hidden&&Te(this,Rt,vi).call(this)}),F(this,xt,s=>{let{metaKey:n,altKey:l,key:c}=s;if(n||l||!this.keysUsed.includes(c)){this.removeEventListener("keyup",b(this,et));return}s.preventDefault(),this.addEventListener("keyup",b(this,et),{once:!0})}),F(this,wa,s=>{s.composedPath().includes(this)||b(this,ve).hidden||Te(this,Rt,vi).call(this)});let t=this.attachShadow({mode:"open"}),a=Co.content.cloneNode(!0);this.nativeEl=a,t.appendChild(a);let{style:r}=D(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),ie(this,Ct,Te(this,rs,Mo).bind(this)),ie(this,bi,Te(this,ss,So).bind(this)),(e=this.init)==null||e.call(this),ie(this,P,this.shadowRoot.querySelector("[part=button]")),ie(this,L,this.shadowRoot.querySelector("[part=listbox]")),ie(this,fi,this.shadowRoot.querySelector("slot[name=button]")),b(this,fi).addEventListener("slotchange",()=>{let s=b(this,fi).assignedElements()[0];!s||(this.disable(),ie(this,P,s),b(this,P).preventClick=!0,b(this,P).hasAttribute("disabled")&&ie(this,Lt,!1),b(this,Lt)?(this.enable(),b(this,P).setAttribute("aria-haspopup","listbox")):this.disable())}),ie(this,ve,this.shadowRoot.querySelector("slot[name=listbox]")),b(this,ve).addEventListener("slotchange",()=>{this.disable(),ie(this,L,b(this,ve).assignedElements()[0]||b(this,L)),this.enable()})}static get observedAttributes(){return["disabled",E.MEDIA_CONTROLLER]}enable(){b(this,P).removeAttribute("disabled"),b(this,P).addEventListener("click",b(this,Ct)),b(this,P).addEventListener("keydown",b(this,xt)),b(this,L).addEventListener("keydown",b(this,xt)),Te(this,Ca,ls).call(this),b(this,L).addEventListener("change",b(this,bi)),u.addEventListener("click",b(this,wa))}disable(){b(this,P).setAttribute("disabled",""),b(this,P).removeEventListener("click",b(this,Ct)),b(this,P).removeEventListener("keydown",b(this,xt)),b(this,P).removeEventListener("keyup",b(this,et)),b(this,L).removeEventListener("keydown",b(this,xt)),b(this,L).removeEventListener("keyup",b(this,et)),b(this,L).addEventListener("change",b(this,bi)),u.removeEventListener("click",b(this,wa))}attributeChangedCallback(e,t,a){var r,s;if(e===E.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this),b(this,L).removeAttribute(E.MEDIA_CONTROLLER)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this),b(this,L).setAttribute(E.MEDIA_CONTROLLER,a)}}else e==="disabled"&&a!==t&&(a==null?(ie(this,Lt,!0),this.enable()):(ie(this,Lt,!1),this.disable()))}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this),b(this,L).setAttribute(E.MEDIA_CONTROLLER,t)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this),b(this,L).removeAttribute(E.MEDIA_CONTROLLER)}}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Ct=new WeakMap;bi=new WeakMap;Lt=new WeakMap;P=new WeakMap;fi=new WeakMap;L=new WeakMap;ve=new WeakMap;Ei=new WeakMap;et=new WeakMap;xt=new WeakMap;wa=new WeakMap;rs=new WeakSet;Mo=function(){Te(this,Rt,vi).call(this)};ss=new WeakSet;So=function(){Te(this,Rt,vi).call(this)};Rt=new WeakSet;vi=function(){b(this,ve).hidden=!b(this,ve).hidden,Te(this,Ca,ls).call(this),b(this,ve).hidden?b(this,P).focus():(b(this,L).focus(),Te(this,os,wo).call(this))};os=new WeakSet;wo=function(){var i;if(b(this,L).offsetWidth===0)return;let e=b(this,P).getBoundingClientRect();if(this.hasAttribute("media-controller")||b(this,P).hasAttribute("media-controller")||b(this,L).hasAttribute("media-controller")){b(this,L).style.zIndex="1",b(this,L).style.bottom="unset",b(this,L).style.top=e.height+"px";return}let a=((i=this.getAttribute("bounds")?Qe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this).getBoundingClientRect(),r=b(this,L).getBoundingClientRect(),s=-Math.max(e.x+r.width-a.right,0);b(this,L).style.transform=`translateX(${s}px)`};Ca=new WeakSet;ls=function(){ie(this,Ei,!b(this,Ei)),b(this,P).setAttribute("aria-expanded",b(this,Ei))};d.customElements.get("media-chrome-selectmenu")||d.customElements.define("media-chrome-selectmenu",La);var Lo=La;var xo=u.createElement("template");xo.innerHTML=`
811
+ `;var Oa=class extends d.HTMLElement{constructor(){var e;if(super(),F(this,un),F(this,cn),F(this,Ot),F(this,hn),F(this,Da),F(this,Rt,void 0),F(this,bi,void 0),F(this,xt,!0),F(this,N,void 0),F(this,fi,void 0),F(this,w,void 0),F(this,ve,void 0),F(this,vi,!1),F(this,it,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",b(this,it));return}a.composedPath().includes(b(this,N))&&(r==="Enter"||r===" ")?b(this,Rt).call(this):r==="Escape"&&!b(this,ve).hidden&&Ie(this,Ot,Ei).call(this)}),F(this,Dt,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",b(this,it));return}a.preventDefault(),this.addEventListener("keyup",b(this,it),{once:!0})}),F(this,xa,a=>{a.composedPath().includes(this)||b(this,ve).hidden||Ie(this,Ot,Ei).call(this)}),!this.shadowRoot){let a=this.attachShadow({mode:"open"}),r=Ro.content.cloneNode(!0);this.nativeEl=r,a.appendChild(r)}let{style:t}=D(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),re(this,Rt,Ie(this,un,wo).bind(this)),re(this,bi,Ie(this,cn,Lo).bind(this)),(e=this.init)==null||e.call(this),re(this,N,this.shadowRoot.querySelector("[part=button]")),re(this,w,this.shadowRoot.querySelector("[part=listbox]")),re(this,fi,this.shadowRoot.querySelector("slot[name=button]")),b(this,fi).addEventListener("slotchange",()=>{let a=b(this,fi).assignedElements()[0];!a||(this.disable(),re(this,N,a),b(this,N).preventClick=!0,b(this,N).hasAttribute("disabled")&&re(this,xt,!1),b(this,xt)?(this.enable(),b(this,N).setAttribute("aria-haspopup","listbox")):this.disable())}),re(this,ve,this.shadowRoot.querySelector("slot[name=listbox]")),b(this,ve).addEventListener("slotchange",()=>{this.disable(),re(this,w,b(this,ve).assignedElements()[0]||b(this,w)),this.enable()})}static get observedAttributes(){return["disabled",v.MEDIA_CONTROLLER]}enable(){b(this,N).removeAttribute("disabled"),b(this,N).addEventListener("click",b(this,Rt)),b(this,N).addEventListener("keydown",b(this,Dt)),b(this,w).addEventListener("keydown",b(this,Dt)),Ie(this,Da,pn).call(this),b(this,w).addEventListener("change",b(this,bi)),m.addEventListener("click",b(this,xa))}disable(){b(this,N).setAttribute("disabled",""),b(this,N).removeEventListener("click",b(this,Rt)),b(this,N).removeEventListener("keydown",b(this,Dt)),b(this,N).removeEventListener("keyup",b(this,it)),b(this,w).removeEventListener("keydown",b(this,Dt)),b(this,w).removeEventListener("keyup",b(this,it)),b(this,w).addEventListener("change",b(this,bi)),m.removeEventListener("click",b(this,xa))}attributeChangedCallback(e,t,a){var r,n;if(e===v.MEDIA_CONTROLLER){if(t){let s=m.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this),b(this,w).removeAttribute(v.MEDIA_CONTROLLER)}if(a){let s=m.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this),b(this,w).setAttribute(v.MEDIA_CONTROLLER,a)}}else e==="disabled"&&a!==t&&(a==null?(re(this,xt,!0),this.enable()):(re(this,xt,!1),this.disable()))}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=m.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this),b(this,w).setAttribute(v.MEDIA_CONTROLLER,t)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=m.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this),b(this,w).removeAttribute(v.MEDIA_CONTROLLER)}}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Rt=new WeakMap;bi=new WeakMap;xt=new WeakMap;N=new WeakMap;fi=new WeakMap;w=new WeakMap;ve=new WeakMap;vi=new WeakMap;it=new WeakMap;Dt=new WeakMap;xa=new WeakMap;un=new WeakSet;wo=function(){Ie(this,Ot,Ei).call(this)};cn=new WeakSet;Lo=function(){Ie(this,Ot,Ei).call(this,!0)};Ot=new WeakSet;Ei=function(i){b(this,ve).hidden=!b(this,ve).hidden||i,Ie(this,Da,pn).call(this,i),b(this,ve).hidden?(this.shadowRoot.activeElement===b(this,w)||b(this,w).contains(this.shadowRoot.activeElement))&&b(this,N).focus():(b(this,w).focus(),Ie(this,hn,Co).call(this))};hn=new WeakSet;Co=function(){var i;if(b(this,w).offsetWidth===0)return;let e=b(this,N).getBoundingClientRect();if(this.hasAttribute("media-controller")||b(this,N).hasAttribute("media-controller")||b(this,w).hasAttribute("media-controller")){b(this,w).style.zIndex="1",b(this,w).style.bottom="unset",b(this,w).style.top=e.height+"px";return}let a=((i=this.getAttribute("bounds")?Xe(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?i:this).getBoundingClientRect(),r=b(this,w).getBoundingClientRect(),n=-Math.max(e.x+r.width-a.right,0);b(this,w).style.transform=`translateX(${n}px)`};Da=new WeakSet;pn=function(i=!1){re(this,vi,!b(this,vi)||i),b(this,N).setAttribute("aria-expanded",b(this,vi))};d.customElements.get("media-chrome-selectmenu")||d.customElements.define("media-chrome-selectmenu",Oa);var xo=Oa;var Do=m.createElement("template");Do.innerHTML=`
823
812
  <style>
824
813
  :host {
825
814
  display: list-item;
@@ -836,24 +825,24 @@ svg, img, ::slotted(svg), ::slotted(img) {
836
825
  <li>
837
826
  <slot></slot>
838
827
  </li>
839
- `;var ds=class extends d.HTMLElement{static get observedAttributes(){return["disabled","aria-selected","value",E.MEDIA_CONTROLLER]}constructor(){super();let e=this.attachShadow({mode:"open"}),t=xo.content.cloneNode(!0);this.nativeEl=t,e.appendChild(t)}set value(e){this.setAttribute("value",e)}get value(){return this.getAttribute("value")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,s;if(e===E.MEDIA_CONTROLLER){if(t){let n=u.getElementById(t);(r=n==null?void 0:n.unassociateElement)==null||r.call(n,this)}if(a){let n=u.getElementById(a);(s=n==null?void 0:n.associateElement)==null||s.call(n,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","option");let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(E.MEDIA_CONTROLLER);if(t){let a=u.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};d.customElements.get("media-chrome-listitem")||d.customElements.define("media-chrome-listitem",ds);var ps=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(ps(i,e,"read from private field"),t?t.call(i):e.get(i)),Ue=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Be=(i,e,t,a)=>(ps(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oe=(i,e,t)=>(ps(i,e,"access private method"),t),Ot,Nt,Ie,ae,xa,cs,Da,us,tt,Dt,Ra,ms,Do=`
840
- fill: var(--media-icon-color, #eee);
828
+ `;var bn=class extends d.HTMLElement{static get observedAttributes(){return["disabled","aria-selected","value",v.MEDIA_CONTROLLER]}constructor(){if(super(),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=Do.content.cloneNode(!0);this.nativeEl=t,e.appendChild(t)}}set value(e){this.setAttribute("value",e)}get value(){return this.getAttribute("value")}enable(){this.hasAttribute("tabindex")||this.setAttribute("tabindex",-1),this.hasAttribute("aria-selected")||this.setAttribute("aria-selected","false")}disable(){this.removeAttribute("tabindex")}attributeChangedCallback(e,t,a){var r,n;if(e===v.MEDIA_CONTROLLER){if(t){let s=m.getElementById(t);(r=s==null?void 0:s.unassociateElement)==null||r.call(s,this)}if(a){let s=m.getElementById(a);(n=s==null?void 0:s.associateElement)==null||n.call(s,this)}}else e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e;this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","option");let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=m.getElementById(t);(e=a==null?void 0:a.associateElement)==null||e.call(a,this)}}disconnectedCallback(){var e;this.disable();let t=this.getAttribute(v.MEDIA_CONTROLLER);if(t){let a=m.getElementById(t);(e=a==null?void 0:a.unassociateElement)==null||e.call(a,this)}}handleClick(){}};d.customElements.get("media-chrome-listitem")||d.customElements.define("media-chrome-listitem",bn);var An=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},H=(i,e,t)=>(An(i,e,"read from private field"),t?t.call(i):e.get(i)),$e=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},He=(i,e,t,a)=>(An(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),oe=(i,e,t)=>(An(i,e,"access private method"),t),Pt,Ut,ke,ne,Na,fn,Ua,vn,at,Nt,Pa,En,No=`
829
+ fill: var(--media-icon-color, var(--media-primary-color, rgb(238 238 238)));
841
830
  height: var(--media-captions-indicator-height, 1em);
842
831
  vertical-align: var(--media-captions-indicator-vertical-align, bottom);
843
832
  margin-inline-start: 1ch;
844
- `,ec=`
845
- <svg style="${Do}" aria-hidden="true" viewBox="0 0 26 24">
833
+ `,zd=`
834
+ <svg style="${No}" aria-hidden="true" viewBox="0 0 26 24">
846
835
  <path d="M22.83 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.39 9.45a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.92 3.92 0 0 1 .92-2.77 3.18 3.18 0 0 1 2.43-1 2.94 2.94 0 0 1 2.13.78c.364.359.62.813.74 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.17 1.61 1.61 0 0 0-1.29.58 2.79 2.79 0 0 0-.5 1.89 3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.48 1.48 0 0 0 1-.37 2.1 2.1 0 0 0 .59-1.14l1.4.44a3.23 3.23 0 0 1-1.07 1.69Zm7.22 0a3.07 3.07 0 0 1-1.91.57 3.06 3.06 0 0 1-2.34-1 3.75 3.75 0 0 1-.92-2.67 3.88 3.88 0 0 1 .93-2.77 3.14 3.14 0 0 1 2.42-1 3 3 0 0 1 2.16.82 2.8 2.8 0 0 1 .73 1.31l-1.43.35a1.49 1.49 0 0 0-1.51-1.21 1.61 1.61 0 0 0-1.29.58A2.79 2.79 0 0 0 15 12a3 3 0 0 0 .49 1.93 1.61 1.61 0 0 0 1.27.58 1.44 1.44 0 0 0 1-.37 2.1 2.1 0 0 0 .6-1.15l1.4.44a3.17 3.17 0 0 1-1.1 1.7Z"/>
847
- </svg>`,Oo=u.createElement("template");Oo.innerHTML=`
836
+ </svg>`,Po=m.createElement("template");Po.innerHTML=`
848
837
  <style>
849
838
  media-chrome-listitem {
850
839
  white-space: var(--media-captions-listbox-white-space, nowrap);
851
840
  }
852
841
 
853
842
  </style>
854
- <slot hidden name="captions-indicator">${ec}</slot>
855
- `;var Ro=(i,e)=>i.label===e.label&&i.language===e.language,hs=class extends ko{constructor(){super({slotTemplate:Oo}),Ue(this,xa),Ue(this,Da),Ue(this,tt),Ue(this,Ra),Ue(this,Ot,[]),Ue(this,Nt,[]),Ue(this,Ie,void 0),Ue(this,ae,void 0);let e=u.createElement("media-chrome-listitem");e.part.add("listitem"),e.value="off",e.textContent="Off",Be(this,Ie,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');Be(this,ae,t.firstElementChild),t.addEventListener("slotchange",()=>{let a=t.assignedElements();if(a.length===1&&a[0].nodeName.toLowerCase()==="slot"){let r=a[0].assignedElements();r.length===0?Be(this,ae,a[0].firstElementChild):r.length===1&&Be(this,ae,r[0])}H(this,ae)||Be(this,ae,t.firstElementChild),Be(this,ae,H(this,ae).cloneNode(!0)),H(this,ae).removeAttribute("slot"),H(this,ae).setAttribute("style",Do)})}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){if(e===o.MEDIA_SUBTITLES_LIST&&t!==a)Be(this,Ot,oe(this,xa,cs).call(this,a,H(this,Ot))),oe(this,tt,Dt).call(this);else if(e===o.MEDIA_CAPTIONS_LIST&&t!==a)Be(this,Nt,oe(this,xa,cs).call(this,a,H(this,Nt))),oe(this,tt,Dt).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=Zt(a!=null?a:"")[0];H(this,Ot).forEach(s=>{s.selected=s.language===r.language&&s.label===r.label}),oe(this,tt,Dt).call(this)}else if(e===o.MEDIA_CAPTIONS_SHOWING&&t!==a){let r=Zt(a!=null?a:"")[0];H(this,Nt).forEach(s=>{s.selected=s.language===r.language&&s.label===r.label}),oe(this,tt,Dt).call(this)}else e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."));super.attributeChangedCallback(e,t,a)}connectedCallback(){oe(this,tt,Dt).call(this),this.addEventListener("change",oe(this,Ra,ms)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",oe(this,Ra,ms)),super.disconnectedCallback()}};Ot=new WeakMap;Nt=new WeakMap;Ie=new WeakMap;ae=new WeakMap;xa=new WeakSet;cs=function(i,e){let t=i?Zt(i!=null?i:""):[],a=[],r=[];return e.forEach(s=>{t.some(n=>Ro(n,s))||a.push(s)}),t.forEach(s=>{e.some(n=>Ro(n,s))||r.push(s)}),a.forEach(s=>s.el.remove()),e.filter(s=>!a.includes(s)).concat(r)};Da=new WeakSet;us=function(i,e){let t=this.shadowRoot.querySelector("ul slot");i.forEach(a=>{let r=a.el,s=!0;if(!r){r=u.createElement("media-chrome-listitem"),s=!1,r.part.add("listitem"),r.value=e+"!"+mr(a);let n=u.createElement("span");n.textContent=a.label,r.append(n),e==="cc"&&r.append(H(this,ae).cloneNode(!0))}a.selected?r.setAttribute("aria-selected","true"):r.setAttribute("aria-selected","false"),s||(t.append(r),a.el=r)})};tt=new WeakSet;Dt=function(){let i=this.shadowRoot.querySelector("ul slot");i.contains(H(this,Ie))||i.append(H(this,Ie)),!this.hasAttribute(o.MEDIA_CAPTIONS_SHOWING)&&!this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(H(this,Ie).setAttribute("aria-selected","true"),H(this,Ie).setAttribute("tabindex","0")):(H(this,Ie).setAttribute("aria-selected","false"),H(this,Ie).setAttribute("tabindex","-1")),oe(this,Da,us).call(this,H(this,Nt),"cc"),oe(this,Da,us).call(this,H(this,Ot),"subs")};Ra=new WeakSet;ms=function(){var i,e,t;let[a,r]=(t=(e=(i=this.selectedOptions[0])==null?void 0:i.value)==null?void 0:e.split("!"))!=null?t:[];if(ze(this),!r)return;let s=new d.CustomEvent(a==="cc"?p.MEDIA_SHOW_CAPTIONS_REQUEST:p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(s)};d.customElements.get("media-captions-listbox")||d.customElements.define("media-captions-listbox",hs);var bs=class extends Lo{constructor(){super()}init(){let e=u.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0,this.hasAttribute("default-showing")&&e.setAttribute("default-showing","");let t=u.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","listitem");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-captions-selectmenu")||d.customElements.define("media-captions-selectmenu",bs);var v=Cl(require("@mux/mux-video")),w=require("@mux/playback-core");var Fo=require("@mux/mux-video");var tc="en",it={code:tc};var No="en";function T(i,e=!0){var r,s;let t=e&&(s=(r=it)==null?void 0:r[i])!=null?s:i,a=e?it.code:No;return new fs(t,a)}var fs=class{constructor(e,t=(a=>(a=it.code)!=null?a:No)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function Po(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Oa(t)}: ${a}; `)}),e?e.trim():void 0}function Oa(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Na(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function ke(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Pa(i){let e=ic(i).toString();return e?"?"+e:""}function ic(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function $e(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Es=(i,e)=>!i||!e?!1:i.contains(e)?!0:Es(i,e.getRootNode().host);var Ua=require("@mux/playback-core");var vs="mux.com",ac=()=>{try{return"1.10.1"}catch{}return"UNKNOWN"},rc=ac(),$a=()=>rc,gs=(i,{maxResolution:e,token:t,domain:a=vs}={})=>{let n=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${Pa(n)}`},Uo=(i,{token:e,thumbnailTime:t,domain:a=vs}={})=>{let r=e==null?t:void 0,{aud:s}=$e(e);if(!(e&&s!=="t"))return`https://image.${a}/${i}/thumbnail.webp${Pa({token:e,time:r})}`},Bo=(i,{token:e,domain:t=vs}={})=>{let{aud:a}=$e(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Pa({token:e,format:"webp"})}`},gi=i=>{if(!!i){if([Ua.StreamTypes.LIVE,Ua.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Ua.StreamTypes.LIVE}};var sc={crossorigin:"crossOrigin",playsinline:"playsInline"};function $o(i){var e;return(e=sc[i])!=null?e:Na(i)}var at,rt,Y,Ba=class{constructor(e,t){R(this,at,void 0);R(this,rt,void 0);R(this,Y,[]);j(this,at,e),j(this,rt,t)}[Symbol.iterator](){return I(this,Y).values()}get length(){return I(this,Y).length}get value(){var e;return(e=I(this,Y).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(j(this,Y,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return I(this,Y)[e]}values(){return I(this,Y).values()}keys(){return I(this,Y).keys()}forEach(e){I(this,Y).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||I(this,Y).push(r)}),!(this.value===""&&!((t=I(this,at))!=null&&t.hasAttribute(`${I(this,rt)}`)))&&((a=I(this,at))==null||a.setAttribute(`${I(this,rt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{I(this,Y).splice(I(this,Y).indexOf(a),1)}),(t=I(this,at))==null||t.setAttribute(`${I(this,rt)}`,`${this.value}`)}contains(e){return I(this,Y).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};at=new WeakMap,rt=new WeakMap,Y=new WeakMap;var Ho=`[mux-player ${$a()}]`;function He(...i){console.warn(Ho,...i)}function le(...i){console.error(Ho,...i)}function _s(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${T("Read more: ")}
856
- ${a}${i.file}`}He(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},st={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Vo=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),nc=Fo.VideoEvents.filter(i=>i!=="error"),oc=Object.values(K).filter(i=>![K.PLAYSINLINE].includes(i)),lc=Object.values(st);function Ko(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),nc.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var As=class extends O.HTMLElement{static get observedAttributes(){return[...oc,...lc]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(s=>{var l,c;let n=(l=this.media)==null?void 0:l.querySelector(`track[src="${s.src}"]`);n&&((c=this.media)==null||c.removeChild(n))}),r.addedNodes.forEach(s=>{var n;(n=this.media)==null||n.append(s.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,s;switch(e){case st.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case st.VOLUME:{let n=(r=ke(a))!=null?r:1;this.media&&(this.media.volume=n);return}case st.PLAYBACKRATE:{let n=(s=ke(a))!=null?s:1;this.media&&(this.media.playbackRate=n,this.media.defaultPlaybackRate=n);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:Vo}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:Vo}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=ke(this.getAttribute(st.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(st.PLAYBACKRATE,`${e}`):this.removeAttribute(st.PLAYBACKRATE)}get crossOrigin(){return _i(this,K.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(K.CROSSORIGIN,`${e}`)}get autoplay(){return _i(this,K.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(K.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(K.AUTOPLAY)}get loop(){return _i(this,K.LOOP)!=null}set loop(e){e?this.setAttribute(K.LOOP,""):this.removeAttribute(K.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return _i(this,K.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(K.MUTED,""):this.removeAttribute(K.MUTED)}get playsInline(){return _i(this,K.PLAYSINLINE)!=null}set playsInline(e){le("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(K.PRELOAD,e):this.removeAttribute(K.PRELOAD)}};function _i(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var ys=As;var dc=Object.defineProperty,cc=(i,e,t)=>e in i?dc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,uc=(i,e,t)=>(cc(i,typeof e!="symbol"?e+"":e,t),t),Qo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},A=(i,e,t)=>(Qo(i,e,"read from private field"),t?t.call(i):e.get(i)),ge=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Me=(i,e,t,a)=>(Qo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Pt,Ha,nt,Ai,We,Ve,Fe,ot,Ut,Wa,de,Yo=1,Go=0,mc=1,hc={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let s=t[a];typeof s=="boolean"&&r instanceof G&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=s:typeof s=="function"&&r instanceof G?r.element[r.attributeName]=s:r.value=s}}}},Se=class extends d.DocumentFragment{constructor(e,t,a=hc){var r;super(),ge(this,Pt,void 0),ge(this,Ha,void 0),this.append(e.content.cloneNode(!0)),Me(this,Pt,zo(this)),Me(this,Ha,a),(r=a.createCallback)==null||r.call(a,this,A(this,Pt),t),a.processCallback(this,A(this,Pt),t)}update(e){A(this,Ha).processCallback(this,A(this,Pt),e)}};Pt=new WeakMap;Ha=new WeakMap;var zo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let s=new Ts;for([t,a]of qo(r.value))if(!t)s.append(a);else{let n=new G(i,r.name,r.namespaceURI);s.append(n),e.push([a,n])}r.value=s.toString()}for(let r of i.childNodes)if(r.nodeType===Yo&&!(r instanceof HTMLTemplateElement))zo(r,e);else if(r.nodeType===Yo||r.data.includes("{{")){let s=[];if(r.data)for([t,a]of qo(r.data))if(!t)s.push(new Text(a));else{let n=new we(i);s.push(n),e.push([a,n])}else if(r instanceof HTMLTemplateElement){let n=new yi(i,r);s.push(n),e.push([n.expression,n])}r.replaceWith(...s.flatMap(n=>n.replacementNodes||[n]))}return e},Zo={},qo=i=>{let e="",t=0,a=Zo[i],r=0,s;if(a)return a;for(a=[];s=i[r];r++)s==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([Go,e]),e="",r++):s==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([mc,e.trim()]),e="",r++):e+=s||"";return e&&a.push([Go,(t>0?"{{":"")+e]),Zo[i]=a},pc=11,Va=class{get value(){return""}set value(e){}toString(){return this.value}},Xo=new WeakMap,Ts=class{constructor(){ge(this,nt,[])}[Symbol.iterator](){return A(this,nt).values()}get length(){return A(this,nt).length}item(e){return A(this,nt)[e]}append(...e){for(let t of e)t instanceof G&&Xo.set(t,this),A(this,nt).push(t)}toString(){return A(this,nt).join("")}};nt=new WeakMap;var G=class extends Va{constructor(e,t,a){super(),ge(this,ot),ge(this,Ai,""),ge(this,We,void 0),ge(this,Ve,void 0),ge(this,Fe,void 0),Me(this,We,e),Me(this,Ve,t),Me(this,Fe,a)}get attributeName(){return A(this,Ve)}get attributeNamespace(){return A(this,Fe)}get element(){return A(this,We)}get value(){return A(this,Ai)}set value(e){A(this,Ai)!==e&&(Me(this,Ai,e),!A(this,ot,Ut)||A(this,ot,Ut).length===1?e==null?A(this,We).removeAttributeNS(A(this,Fe),A(this,Ve)):A(this,We).setAttributeNS(A(this,Fe),A(this,Ve),e):A(this,We).setAttributeNS(A(this,Fe),A(this,Ve),A(this,ot,Ut)))}get booleanValue(){return A(this,We).hasAttributeNS(A(this,Fe),A(this,Ve))}set booleanValue(e){if(!A(this,ot,Ut)||A(this,ot,Ut).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};Ai=new WeakMap;We=new WeakMap;Ve=new WeakMap;Fe=new WeakMap;ot=new WeakSet;Ut=function(){return Xo.get(this)};var we=class extends Va{constructor(e,t){super(),ge(this,Wa,void 0),ge(this,de,void 0),Me(this,Wa,e),Me(this,de,t?[...t]:[new Text])}get replacementNodes(){return A(this,de)}get parentNode(){return A(this,Wa)}get nextSibling(){return A(this,de)[A(this,de).length-1].nextSibling}get previousSibling(){return A(this,de)[0].previousSibling}get value(){return A(this,de).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===pc?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Me(this,de,bc(A(this,de)[0].parentNode,A(this,de),t,this.nextSibling))}};Wa=new WeakMap;de=new WeakMap;var yi=class extends we{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),uc(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function bc(i,e,t,a=null){let r=0,s,n,l,c=t.length,m=e.length;for(;r<c&&r<m&&e[r]==t[r];)r++;for(;r<c&&r<m&&t[c-1]==e[m-1];)a=t[--m,--c];if(r==m)for(;r<c;)i.insertBefore(t[r++],a);if(r==c)for(;r<m;)i.removeChild(e[r++]);else{for(s=e[r];r<c;)l=t[r++],n=s?s.nextSibling:a,s==l?s=n:r<c&&t[r]==n?(i.replaceChild(l,s),s=n):i.insertBefore(l,s);for(;s!=a;)n=s.nextSibling,i.removeChild(s),s=n}return t}var Jo={string:i=>String(i)},Ka=class{constructor(e){this.template=e,this.state=void 0}},lt=new WeakMap,dt=new WeakMap,Is={partial:(i,e)=>{e[i.expression]=new Ka(i.template)},if:(i,e)=>{var t;if(el(i.expression,e))if(lt.get(i)!==i.template){lt.set(i,i.template);let a=new Se(i.template,e,Ya);i.replace(a),dt.set(i,a)}else(t=dt.get(i))==null||t.update(e);else i.replace(""),lt.delete(i),dt.delete(i)}},fc=Object.keys(Is),Ya={processCallback(i,e,t){var a,r;if(!!t)for(let[s,n]of e){if(n instanceof yi){if(!n.directive){let c=fc.find(m=>n.template.hasAttribute(m));c&&(n.directive=c,n.expression=n.template.getAttribute(c))}(a=Is[n.directive])==null||a.call(Is,n,t);continue}let l=el(s,t);if(l instanceof Ka){lt.get(n)!==l.template?(lt.set(n,l.template),l=new Se(l.template,l.state,Ya),n.value=l,dt.set(n,l)):(r=dt.get(n))==null||r.update(l.state);continue}l?(n instanceof G&&n.attributeName.startsWith("aria-")&&(l=String(l)),n instanceof G?typeof l=="boolean"?n.booleanValue=l:typeof l=="function"?n.element[n.attributeName]=l:n.value=l:(n.value=l,lt.delete(n),dt.delete(n))):n instanceof G?n.value=void 0:(n.value=void 0,lt.delete(n),dt.delete(n))}}},jo={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=Jo[e])==null?void 0:t.call(Jo,i)}};function Ec(i){return vc(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function el(i,e={}){var t,a,r,s,n,l,c;let m=Ec(i);if(m.length===0||m.some(({type:f})=>!f))return Ti(i);if(((t=m[0])==null?void 0:t.token)===">"){let f=e[(a=m[1])==null?void 0:a.token];if(!f)return Ti(i);let _={...e};f.state=_;let g=m.slice(2);for(let y=0;y<g.length;y+=3){let x=(r=g[y])==null?void 0:r.token,$=(s=g[y+1])==null?void 0:s.token,k=(n=g[y+2])==null?void 0:n.token;x&&$==="="&&(_[x]=Ii(k,e))}return f}if(m.length===1)return Fa(m[0])?Ii(m[0].token,e):Ti(i);if(m.length===2){let f=(l=m[0])==null?void 0:l.token,_=jo[f];if(!_||!Fa(m[1]))return Ti(i);let g=Ii(m[1].token,e);return _(g)}if(m.length===3){let f=(c=m[1])==null?void 0:c.token,_=jo[f];if(!_||!Fa(m[0])||!Fa(m[2]))return Ti(i);let g=Ii(m[0].token,e);if(f==="|")return _(g,m[2].token);let y=Ii(m[2].token,e);return _(g,y)}}function Ti(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Fa({type:i}){return["number","boolean","string","param"].includes(i)}function Ii(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):Bi(i)?parseFloat(i):e[i]}function vc(i,e){let t,a,r,s=[];for(;i;){r=null,t=i.length;for(let n in e)a=e[n].exec(i),a&&a.index<t&&(r={token:a[0],type:n,matches:a.slice(1)},t=a.index);t&&s.push({token:i.substr(0,t),type:void 0}),r&&s.push(r),i=i.substr(t+(r?r.token.length:0))}return s}var gc=Object.defineProperty,_c=(i,e,t)=>e in i?gc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ki=(i,e,t)=>(_c(i,typeof e!="symbol"?e+"":e,t),t),ws=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tl=(i,e,t)=>(ws(i,e,"read from private field"),t?t.call(i):e.get(i)),ks=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Ga=(i,e,t,a)=>(ws(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ac=(i,e,t)=>(ws(i,e,"access private method"),t),Bt,Za,Ss,il,Ms={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},al=u.createElement("template");al.innerHTML=`
843
+ <slot hidden name="captions-indicator">${zd}</slot>
844
+ `;var Oo=(i,e)=>i.label===e.label&&i.language===e.language,gn=class extends So{constructor(){super({slotTemplate:Po}),$e(this,Na),$e(this,Ua),$e(this,at),$e(this,Pa),$e(this,Pt,[]),$e(this,Ut,[]),$e(this,ke,void 0),$e(this,ne,void 0);let e=m.createElement("media-chrome-listitem");e.part.add("listitem"),e.value="off",e.textContent="Off",He(this,ke,e);let t=this.shadowRoot.querySelector('[name="captions-indicator"]');He(this,ne,t.firstElementChild),t.addEventListener("slotchange",()=>{let a=t.assignedElements();if(a.length===1&&a[0].nodeName.toLowerCase()==="slot"){let r=a[0].assignedElements();r.length===0?He(this,ne,a[0].firstElementChild):r.length===1&&He(this,ne,r[0])}H(this,ne)||He(this,ne,t.firstElementChild),He(this,ne,H(this,ne).cloneNode(!0)),H(this,ne).removeAttribute("slot"),H(this,ne).setAttribute("style",No)})}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_CAPTIONS_LIST,o.MEDIA_CAPTIONS_SHOWING,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){if(e===o.MEDIA_SUBTITLES_LIST&&t!==a)He(this,Pt,oe(this,Na,fn).call(this,a,H(this,Pt))),oe(this,at,Nt).call(this);else if(e===o.MEDIA_CAPTIONS_LIST&&t!==a)He(this,Ut,oe(this,Na,fn).call(this,a,H(this,Ut))),oe(this,at,Nt).call(this);else if(e===o.MEDIA_SUBTITLES_SHOWING&&t!==a){let r=zt(a!=null?a:"")[0];H(this,Pt).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),oe(this,at,Nt).call(this)}else if(e===o.MEDIA_CAPTIONS_SHOWING&&t!==a){let r=zt(a!=null?a:"")[0];H(this,Ut).forEach(n=>{n.selected=n.language===r.language&&n.label===r.label}),oe(this,at,Nt).call(this)}else e==="aria-multiselectable"&&(this.removeAttribute("aria-multiselectable"),console.warn("Captions List doesn't currently support multiple selections. You can enable multiple items via the media.textTrack API."));super.attributeChangedCallback(e,t,a)}connectedCallback(){oe(this,at,Nt).call(this),this.addEventListener("change",oe(this,Pa,En)),super.connectedCallback()}disconnectedCallback(){this.removeEventListener("change",oe(this,Pa,En)),super.disconnectedCallback()}};Pt=new WeakMap;Ut=new WeakMap;ke=new WeakMap;ne=new WeakMap;Na=new WeakSet;fn=function(i,e){let t=i?zt(i!=null?i:""):[],a=[],r=[];return e.forEach(n=>{t.some(s=>Oo(s,n))||a.push(n)}),t.forEach(n=>{e.some(s=>Oo(s,n))||r.push(n)}),a.forEach(n=>n.el.remove()),e.filter(n=>!a.includes(n)).concat(r)};Ua=new WeakSet;vn=function(i,e){let t=this.shadowRoot.querySelector("ul slot");i.forEach(a=>{let r=a.el,n=!0;if(!r){r=m.createElement("media-chrome-listitem"),n=!1,r.part.add("listitem"),r.value=e+"!"+fr(a);let s=m.createElement("span");s.textContent=a.label,r.append(s),e==="cc"&&r.append(H(this,ne).cloneNode(!0))}a.selected?r.setAttribute("aria-selected","true"):r.setAttribute("aria-selected","false"),n||(t.append(r),a.el=r)})};at=new WeakSet;Nt=function(){let i=this.shadowRoot.querySelector("ul slot");i.contains(H(this,ke))||i.append(H(this,ke)),!this.hasAttribute(o.MEDIA_CAPTIONS_SHOWING)&&!this.hasAttribute(o.MEDIA_SUBTITLES_SHOWING)?(H(this,ke).setAttribute("aria-selected","true"),H(this,ke).setAttribute("tabindex","0")):(H(this,ke).setAttribute("aria-selected","false"),H(this,ke).setAttribute("tabindex","-1")),oe(this,Ua,vn).call(this,H(this,Ut),"cc"),oe(this,Ua,vn).call(this,H(this,Pt),"subs")};Pa=new WeakSet;En=function(){var i,e,t;let[a,r]=(t=(e=(i=this.selectedOptions[0])==null?void 0:i.value)==null?void 0:e.split("!"))!=null?t:[];if(Je(this,!0),!r)return;let n=new d.CustomEvent(a==="cc"?p.MEDIA_SHOW_CAPTIONS_REQUEST:p.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)};d.customElements.get("media-captions-listbox")||d.customElements.define("media-captions-listbox",gn);var _n=class extends xo{constructor(){super()}init(){let e=m.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0,this.hasAttribute("default-showing")&&e.setAttribute("default-showing","");let t=m.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","listitem");let a=this.shadowRoot.querySelector("slot[name=button]"),r=this.shadowRoot.querySelector("slot[name=listbox]");a.textContent="",r.textContent="",a.append(e),r.append(t)}};d.customElements.get("media-captions-selectmenu")||d.customElements.define("media-captions-selectmenu",_n);var E=Cl(require("@mux/mux-video")),C=require("@mux/playback-core");var Yo=require("@mux/mux-video");var Xd="en",rt={code:Xd};var Uo="en";function T(i,e=!0){var r,n;let t=e&&(n=(r=rt)==null?void 0:r[i])!=null?n:i,a=e?rt.code:Uo;return new yn(t,a)}var yn=class{constructor(e,t=(a=>(a=rt.code)!=null?a:Uo)()){this.message=e,this.locale=t}format(e){return this.message.replace(/\{(\w+)\}/g,(t,a)=>{var r;return(r=e[a])!=null?r:""})}toString(){return this.message}};function Bo(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${Ba(t)}: ${a}; `)}),e?e.trim():void 0}function Ba(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function $a(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Me(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function Ha(i){let e=Jd(i).toString();return e?"?"+e:""}function Jd(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function We(i){let e=(i!=null?i:"").split(".")[1];if(!e)return{};let t=e.replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(t).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}var Tn=(i,e)=>!i||!e?!1:i.contains(e)?!0:Tn(i,e.getRootNode().host);var Wa=require("@mux/playback-core");var In="mux.com",jd=()=>{try{return"1.11.0"}catch{}return"UNKNOWN"},eu=jd(),Fa=()=>eu,kn=(i,{maxResolution:e,token:t,domain:a=In}={})=>{let s=!!t?{token:t}:{redundant_streams:!0,...e?{max_resolution:e}:{}};return`https://stream.${a}/${i}.m3u8${Ha(s)}`},$o=(i,{token:e,thumbnailTime:t,domain:a=In}={})=>{let r=e==null?t:void 0,{aud:n}=We(e);if(!(e&&n!=="t"))return`https://image.${a}/${i}/thumbnail.webp${Ha({token:e,time:r})}`},Ho=(i,{token:e,domain:t=In}={})=>{let{aud:a}=We(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${Ha({token:e,format:"webp"})}`},gi=i=>{if(!!i){if([Wa.StreamTypes.LIVE,Wa.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return Wa.StreamTypes.LIVE}};var tu={crossorigin:"crossOrigin",playsinline:"playsInline"};function Wo(i){var e;return(e=tu[i])!=null?e:$a(i)}var nt,st,G,Va=class{constructor(e,t){x(this,nt,void 0);x(this,st,void 0);x(this,G,[]);te(this,nt,e),te(this,st,t)}[Symbol.iterator](){return I(this,G).values()}get length(){return I(this,G).length}get value(){var e;return(e=I(this,G).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(te(this,G,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return I(this,G)[e]}values(){return I(this,G).values()}keys(){return I(this,G).keys()}forEach(e){I(this,G).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||I(this,G).push(r)}),!(this.value===""&&!((t=I(this,nt))!=null&&t.hasAttribute(`${I(this,st)}`)))&&((a=I(this,nt))==null||a.setAttribute(`${I(this,st)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{I(this,G).splice(I(this,G).indexOf(a),1)}),(t=I(this,nt))==null||t.setAttribute(`${I(this,st)}`,`${this.value}`)}contains(e){return I(this,G).includes(e)}toggle(e,t){return typeof t!="undefined"?t?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,t){this.remove(e),this.add(t)}};nt=new WeakMap,st=new WeakMap,G=new WeakMap;var Vo=`[mux-player ${Fa()}]`;function Ve(...i){console.warn(Vo,...i)}function le(...i){console.error(Vo,...i)}function Mn(i){var t;let e=(t=i.message)!=null?t:"";if(i.context&&(e+=` ${i.context}`),i.file){let a="https://github.com/muxinc/elements/blob/main/errors/";e+=` ${T("Read more: ")}
845
+ ${a}${i.file}`}Ve(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},ot={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},Ko=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}}),iu=Yo.VideoEvents.filter(i=>i!=="error"),au=Object.values(K).filter(i=>![K.PLAYSINLINE].includes(i)),ru=Object.values(ot);function Go(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),iu.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var Sn=class extends O.HTMLElement{static get observedAttributes(){return[...au,...ru]}constructor(){super(),this.querySelectorAll(":scope > track").forEach(a=>{var r;(r=this.media)==null||r.append(a.cloneNode())});let e=a=>{for(let r of a)r.type==="childList"&&(r.removedNodes.forEach(n=>{var l,u;let s=(l=this.media)==null?void 0:l.querySelector(`track[src="${n.src}"]`);s&&((u=this.media)==null||u.removeChild(s))}),r.addedNodes.forEach(n=>{var s;(s=this.media)==null||s.append(n.cloneNode())}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0})}attributeChangedCallback(e,t,a){var r,n;switch(e){case ot.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case ot.VOLUME:{let s=(r=Me(a))!=null?r:1;this.media&&(this.media.volume=s);return}case ot.PLAYBACKRATE:{let s=(n=Me(a))!=null?n:1;this.media&&(this.media.playbackRate=s,this.media.defaultPlaybackRate=s);return}}}play(){var e,t;return(t=(e=this.media)==null?void 0:e.play())!=null?t:Promise.reject()}pause(){var e;(e=this.media)==null||e.pause()}requestCast(e){var t;return(t=this.media)==null?void 0:t.requestCast(e)}get media(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("mux-video")}get paused(){var e,t;return(t=(e=this.media)==null?void 0:e.paused)!=null?t:!0}get duration(){var e,t;return(t=(e=this.media)==null?void 0:e.duration)!=null?t:NaN}get ended(){var e,t;return(t=(e=this.media)==null?void 0:e.ended)!=null?t:!1}get buffered(){var e,t;return(t=(e=this.media)==null?void 0:e.buffered)!=null?t:Ko}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:Ko}get readyState(){var e,t;return(t=(e=this.media)==null?void 0:e.readyState)!=null?t:0}get videoWidth(){var e,t;return(t=(e=this.media)==null?void 0:e.videoWidth)!=null?t:0}get videoHeight(){var e,t;return(t=(e=this.media)==null?void 0:e.videoHeight)!=null?t:0}get currentTime(){var e,t;return(t=(e=this.media)==null?void 0:e.currentTime)!=null?t:0}set currentTime(e){this.media&&(this.media.currentTime=Number(e))}get volume(){var e,t;return(t=(e=this.media)==null?void 0:e.volume)!=null?t:1}set volume(e){this.media&&(this.media.volume=Number(e))}get playbackRate(){var e,t;return(t=(e=this.media)==null?void 0:e.playbackRate)!=null?t:1}set playbackRate(e){this.media&&(this.media.playbackRate=Number(e))}get defaultPlaybackRate(){var e;return(e=Me(this.getAttribute(ot.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(ot.PLAYBACKRATE,`${e}`):this.removeAttribute(ot.PLAYBACKRATE)}get crossOrigin(){return Ai(this,K.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(K.CROSSORIGIN,`${e}`)}get autoplay(){return Ai(this,K.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(K.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(K.AUTOPLAY)}get loop(){return Ai(this,K.LOOP)!=null}set loop(e){e?this.setAttribute(K.LOOP,""):this.removeAttribute(K.LOOP)}get muted(){var e,t;return(t=(e=this.media)==null?void 0:e.muted)!=null?t:!1}set muted(e){this.media&&(this.media.muted=Boolean(e))}get defaultMuted(){return Ai(this,K.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(K.MUTED,""):this.removeAttribute(K.MUTED)}get playsInline(){return Ai(this,K.PLAYSINLINE)!=null}set playsInline(e){le("playsInline is set to true by default and is not currently supported as a setter.")}get preload(){return this.media?this.media.preload:this.getAttribute("preload")}set preload(e){["","none","metadata","auto"].includes(e)?this.setAttribute(K.PRELOAD,e):this.removeAttribute(K.PRELOAD)}};function Ai(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var wn=Sn;var nu=Object.defineProperty,su=(i,e,t)=>e in i?nu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ou=(i,e,t)=>(su(i,typeof e!="symbol"?e+"":e,t),t),Xo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(Xo(i,e,"read from private field"),t?t.call(i):e.get(i)),Ee=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Se=(i,e,t,a)=>(Xo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Bt,Ka,lt,_i,Fe,Ke,Ye,dt,$t,Ya,de,Zo=1,qo=0,lu=1,du={processCallback(i,e,t){if(!!t){for(let[a,r]of e)if(a in t){let n=t[a];typeof n=="boolean"&&r instanceof Z&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof Z?r.element[r.attributeName]=n:r.value=n}}}},we=class extends d.DocumentFragment{constructor(e,t,a=du){var r;super(),Ee(this,Bt,void 0),Ee(this,Ka,void 0),this.append(e.content.cloneNode(!0)),Se(this,Bt,Jo(this)),Se(this,Ka,a),(r=a.createCallback)==null||r.call(a,this,_(this,Bt),t),a.processCallback(this,_(this,Bt),t)}update(e){_(this,Ka).processCallback(this,_(this,Bt),e)}};Bt=new WeakMap;Ka=new WeakMap;var Jo=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Ln;for([t,a]of zo(r.value))if(!t)n.append(a);else{let s=new Z(i,r.name,r.namespaceURI);n.append(s),e.push([a,s])}r.value=n.toString()}for(let r of i.childNodes)if(r.nodeType===Zo&&!(r instanceof HTMLTemplateElement))Jo(r,e);else if(r.nodeType===Zo||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of zo(r.data))if(!t)n.push(new Text(a));else{let s=new Le(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new yi(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},Qo={},zo=i=>{let e="",t=0,a=Qo[i],r=0,n;if(a)return a;for(a=[];n=i[r];r++)n==="{"&&i[r+1]==="{"&&i[r-1]!=="\\"&&i[r+2]&&++t==1?(e&&a.push([qo,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([lu,e.trim()]),e="",r++):e+=n||"";return e&&a.push([qo,(t>0?"{{":"")+e]),Qo[i]=a},uu=11,Ga=class{get value(){return""}set value(e){}toString(){return this.value}},jo=new WeakMap,Ln=class{constructor(){Ee(this,lt,[])}[Symbol.iterator](){return _(this,lt).values()}get length(){return _(this,lt).length}item(e){return _(this,lt)[e]}append(...e){for(let t of e)t instanceof Z&&jo.set(t,this),_(this,lt).push(t)}toString(){return _(this,lt).join("")}};lt=new WeakMap;var Z=class extends Ga{constructor(e,t,a){super(),Ee(this,dt),Ee(this,_i,""),Ee(this,Fe,void 0),Ee(this,Ke,void 0),Ee(this,Ye,void 0),Se(this,Fe,e),Se(this,Ke,t),Se(this,Ye,a)}get attributeName(){return _(this,Ke)}get attributeNamespace(){return _(this,Ye)}get element(){return _(this,Fe)}get value(){return _(this,_i)}set value(e){_(this,_i)!==e&&(Se(this,_i,e),!_(this,dt,$t)||_(this,dt,$t).length===1?e==null?_(this,Fe).removeAttributeNS(_(this,Ye),_(this,Ke)):_(this,Fe).setAttributeNS(_(this,Ye),_(this,Ke),e):_(this,Fe).setAttributeNS(_(this,Ye),_(this,Ke),_(this,dt,$t)))}get booleanValue(){return _(this,Fe).hasAttributeNS(_(this,Ye),_(this,Ke))}set booleanValue(e){if(!_(this,dt,$t)||_(this,dt,$t).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};_i=new WeakMap;Fe=new WeakMap;Ke=new WeakMap;Ye=new WeakMap;dt=new WeakSet;$t=function(){return jo.get(this)};var Le=class extends Ga{constructor(e,t){super(),Ee(this,Ya,void 0),Ee(this,de,void 0),Se(this,Ya,e),Se(this,de,t?[...t]:[new Text])}get replacementNodes(){return _(this,de)}get parentNode(){return _(this,Ya)}get nextSibling(){return _(this,de)[_(this,de).length-1].nextSibling}get previousSibling(){return _(this,de)[0].previousSibling}get value(){return _(this,de).map(e=>e.textContent).join("")}set value(e){this.replace(e)}replace(...e){let t=e.flat().flatMap(a=>a==null?[new Text]:a.forEach?[...a]:a.nodeType===uu?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Se(this,de,cu(_(this,de)[0].parentNode,_(this,de),t,this.nextSibling))}};Ya=new WeakMap;de=new WeakMap;var yi=class extends Le{constructor(e,t){let a=t.getAttribute("directive")||t.getAttribute("type"),r=t.getAttribute("expression")||t.getAttribute(a)||"";r.startsWith("{{")&&(r=r.trim().slice(2,-2).trim()),super(e),ou(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function cu(i,e,t,a=null){let r=0,n,s,l,u=t.length,c=e.length;for(;r<u&&r<c&&e[r]==t[r];)r++;for(;r<u&&r<c&&t[u-1]==e[c-1];)a=t[--c,--u];if(r==c)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<c;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)l=t[r++],s=n?n.nextSibling:a,n==l?n=s:r<u&&t[r]==s?(i.replaceChild(l,n),n=s):i.insertBefore(l,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var el={string:i=>String(i)},qa=class{constructor(e){this.template=e,this.state=void 0}},ut=new WeakMap,ct=new WeakMap,Cn={partial:(i,e)=>{e[i.expression]=new qa(i.template)},if:(i,e)=>{var t;if(il(i.expression,e))if(ut.get(i)!==i.template){ut.set(i,i.template);let a=new we(i.template,e,Qa);i.replace(a),ct.set(i,a)}else(t=ct.get(i))==null||t.update(e);else i.replace(""),ut.delete(i),ct.delete(i)}},mu=Object.keys(Cn),Qa={processCallback(i,e,t){var a,r;if(!!t)for(let[n,s]of e){if(s instanceof yi){if(!s.directive){let u=mu.find(c=>s.template.hasAttribute(c));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Cn[s.directive])==null||a.call(Cn,s,t);continue}let l=il(n,t);if(l instanceof qa){ut.get(s)!==l.template?(ut.set(s,l.template),l=new we(l.template,l.state,Qa),s.value=l,ct.set(s,l)):(r=ct.get(s))==null||r.update(l.state);continue}l?(s instanceof Z&&s.attributeName.startsWith("aria-")&&(l=String(l)),s instanceof Z?typeof l=="boolean"?s.booleanValue=l:typeof l=="function"?s.element[s.attributeName]=l:s.value=l:(s.value=l,ut.delete(s),ct.delete(s))):s instanceof Z?s.value=void 0:(s.value=void 0,ut.delete(s),ct.delete(s))}}},tl={"!":i=>!i,"!!":i=>!!i,"==":(i,e)=>i==e,"!=":(i,e)=>i!=e,">":(i,e)=>i>e,">=":(i,e)=>i>=e,"<":(i,e)=>i<e,"<=":(i,e)=>i<=e,"??":(i,e)=>i!=null?i:e,"|":(i,e)=>{var t;return(t=el[e])==null?void 0:t.call(el,i)}};function hu(i){return pu(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function il(i,e={}){var t,a,r,n,s,l,u;let c=hu(i);if(c.length===0||c.some(({type:f})=>!f))return Ti(i);if(((t=c[0])==null?void 0:t.token)===">"){let f=e[(a=c[1])==null?void 0:a.token];if(!f)return Ti(i);let A={...e};f.state=A;let g=c.slice(2);for(let y=0;y<g.length;y+=3){let R=(r=g[y])==null?void 0:r.token,$=(n=g[y+1])==null?void 0:n.token,k=(s=g[y+2])==null?void 0:s.token;R&&$==="="&&(A[R]=Ii(k,e))}return f}if(c.length===1)return Za(c[0])?Ii(c[0].token,e):Ti(i);if(c.length===2){let f=(l=c[0])==null?void 0:l.token,A=tl[f];if(!A||!Za(c[1]))return Ti(i);let g=Ii(c[1].token,e);return A(g)}if(c.length===3){let f=(u=c[1])==null?void 0:u.token,A=tl[f];if(!A||!Za(c[0])||!Za(c[2]))return Ti(i);let g=Ii(c[0].token,e);if(f==="|")return A(g,c[2].token);let y=Ii(c[2].token,e);return A(g,y)}}function Ti(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function Za({type:i}){return["number","boolean","string","param"].includes(i)}function Ii(i,e){let t=i[0],a=i.slice(-1);return i==="true"||i==="false"?i==="true":t===a&&["'",'"'].includes(t)?i.slice(1,-1):$i(i)?parseFloat(i):e[i]}function pu(i,e){let t,a,r,n=[];for(;i;){r=null,t=i.length;for(let s in e)a=e[s].exec(i),a&&a.index<t&&(r={token:a[0],type:s,matches:a.slice(1)},t=a.index);t&&n.push({token:i.substr(0,t),type:void 0}),r&&n.push(r),i=i.substr(t+(r?r.token.length:0))}return n}var bu=Object.defineProperty,fu=(i,e,t)=>e in i?bu(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mi=(i,e,t)=>(fu(i,typeof e!="symbol"?e+"":e,t),t),Pn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Dn=(i,e,t)=>(Pn(i,e,"read from private field"),t?t.call(i):e.get(i)),ki=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},mt=(i,e,t,a)=>(Pn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rn=(i,e,t)=>(Pn(i,e,"access private method"),t),Ht,za,Wt,On,al,Xa,Nn,xn={"media-target-live-window":"targetLiveWindow","media-stream-type":"streamType"},rl=m.createElement("template");rl.innerHTML=`
857
846
  <style>
858
847
  :host {
859
848
  display: inline-block;
@@ -865,7 +854,7 @@ ${a}${i.file}`}He(e)}var K={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
865
854
  height: 100%;
866
855
  }
867
856
  </style>
868
- `;var $t=class extends d.HTMLElement{constructor(){super(),ks(this,Ss),ki(this,"renderRoot"),ki(this,"renderer"),ks(this,Bt,void 0),ks(this,Za,void 0),this.renderRoot=this.attachShadow({mode:"open"});let e=new MutationObserver(t=>{t.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(Ms[a.attributeName]||a.attributeName.startsWith("breakpoint-"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.createRenderer(),Ac(this,Ss,il).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=tl(this,Bt))!=null?e:this.constructor.template}set template(e){Ga(this,Bt,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:n})=>Ms[n]||n.startsWith("breakpoint-")),...Array.from(this.attributes)],s={};for(let n of r){let l=(a=Ms[n.name])!=null?a:Xs(n.name),{value:c}=n;c!=null?(Bi(c)&&(c=parseFloat(c)),s[l]=c===""?!0:c):s[l]=!1}return s}async attributeChangedCallback(e,t,a){var r;if(e==="template"&&t!=a){if(a){let s=(r=this.getRootNode())==null?void 0:r.getElementById(a);if(s)Ga(this,Bt,s);else if(yc(a))try{let n=await Tc(a),l=u.createElement("template");l.innerHTML=n,Ga(this,Bt,l)}catch{console.warn(`"${a}" is not a valid template element ID or a valid URL to a template file.`)}}this.createRenderer()}}createRenderer(){this.template&&this.template!==tl(this,Za)&&(Ga(this,Za,this.template),this.renderer=new Se(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(al.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Bt=new WeakMap;Za=new WeakMap;Ss=new WeakSet;il=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};ki($t,"template");ki($t,"observedAttributes",["template"]);ki($t,"processor",Ya);function yc(i){let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Tc(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",$t);var rl=`:host {
857
+ `;var Vt=class extends d.HTMLElement{constructor(){super(),ki(this,On),ki(this,Xa),Mi(this,"renderRoot"),Mi(this,"renderer"),ki(this,Ht,void 0),ki(this,za,void 0),ki(this,Wt,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{t.some(a=>{let r=a.target;return r===this?!0:r.localName!=="media-controller"?!1:!!(xn[a.attributeName]||a.attributeName.startsWith("breakpoint-"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),Rn(this,On,al).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Dn(this,Ht))!=null?e:this.constructor.template}set template(e){mt(this,Wt,null),mt(this,Ht,e),this.createRenderer()}get props(){var e,t,a;let r=[...Array.from((t=(e=this.mediaController)==null?void 0:e.attributes)!=null?t:[]).filter(({name:s})=>xn[s]||s.startsWith("breakpoint-")),...Array.from(this.attributes)],n={};for(let s of r){let l=(a=xn[s.name])!=null?a:ns(s.name),{value:u}=s;u!=null?($i(u)&&(u=parseFloat(u)),n[l]=u===""?!0:u):n[l]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&Rn(this,Xa,Nn).call(this)}connectedCallback(){Rn(this,Xa,Nn).call(this)}createRenderer(){this.template&&this.template!==Dn(this,za)&&(mt(this,za,this.template),this.renderer=new we(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(rl.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};Ht=new WeakMap;za=new WeakMap;Wt=new WeakMap;On=new WeakSet;al=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};Xa=new WeakSet;Nn=function(){var i;let e=this.getAttribute("template");if(!e||e===Dn(this,Wt))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){mt(this,Wt,e),mt(this,Ht,a),this.createRenderer();return}vu(e)&&(mt(this,Wt,e),Eu(e).then(r=>{let n=m.createElement("template");n.innerHTML=r,mt(this,Ht,n),this.createRenderer()}).catch(console.error))};Mi(Vt,"template");Mi(Vt,"observedAttributes",["template"]);Mi(Vt,"processor",Qa);function vu(i){if(!/^(\/|\.\/|https?:\/\/)/.test(i))return!1;let e=/^https?:\/\//.test(i)?void 0:location.origin;try{new URL(i,e)}catch{return!1}return!0}async function Eu(i){let e=await fetch(i);if(e.status!==200)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);return e.text()}d.customElements.get("media-theme")||d.customElements.define("media-theme",Vt);var nl=`:host {
869
858
  --media-control-display: var(--controls);
870
859
  --media-loading-indicator-display: var(--loading-indicator);
871
860
  --media-dialog-display: var(--dialog);
@@ -1470,6 +1459,7 @@ media-theme {
1470
1459
  gestures-disabled="{{disabled}}"
1471
1460
  hotkeys="{{hotkeys}}"
1472
1461
  nohotkeys="{{nohotkeys}}"
1462
+ novolumepref="{{novolumepref}}"
1473
1463
  audio="{{audio}}"
1474
1464
  noautoseektolive="{{noautoseektolive}}"
1475
1465
  exportparts="layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer"
@@ -1744,7 +1734,7 @@ media-theme {
1744
1734
 
1745
1735
  </media-controller>
1746
1736
  </template>
1747
- `;var ol=`
1737
+ `;var ll=`
1748
1738
  :host {
1749
1739
  z-index: 100;
1750
1740
  display: var(--media-dialog-display, flex);
@@ -1796,17 +1786,17 @@ media-theme {
1796
1786
  text-align: center;
1797
1787
  line-height: 1.4;
1798
1788
  }
1799
- `,ll=Q.createElement("template");ll.innerHTML=`
1789
+ `,dl=X.createElement("template");dl.innerHTML=`
1800
1790
  <style>
1801
- ${ol}
1791
+ ${ll}
1802
1792
  </style>
1803
1793
 
1804
1794
  <div class="dialog">
1805
1795
  <slot></slot>
1806
1796
  </div>
1807
- `;var Ke=class extends O.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})),nl(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Mc(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&nl(this)}};Ke.styles=ol,Ke.template=ll,Ke.observedAttributes=["open"];function nl(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=dl(i.shadowRoot)),i._previouslyFocusedElement=Q.activeElement,Q.activeElement instanceof HTMLElement&&Q.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function dl(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let s=0;s<r.length&&!(r[s].tagName&&r[s].shadowRoot&&(a=dl(r[s].shadowRoot),a));s++);}return a}function Mc(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}O.customElements.get("media-dialog")||(O.customElements.define("media-dialog",Ke),O.MediaDialog=Ke);var Cs=Ke;var cl=Q.createElement("template");cl.innerHTML=`
1797
+ `;var Ge=class extends O.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})),ol(this)}close(){!this.hasAttribute("open")||(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),_u(this))}attributeChangedCallback(t,a,r){t==="open"&&a!==r&&(r!=null?this.show():this.close())}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")&&ol(this)}};Ge.styles=ll,Ge.template=dl,Ge.observedAttributes=["open"];function ol(i){let e=new CustomEvent("initfocus",{composed:!0,bubbles:!0,cancelable:!0});if(i.dispatchEvent(e),e.defaultPrevented)return;let t=i.querySelector("[autofocus]:not([disabled])");!t&&i.tabIndex>=0&&(t=i),t||(t=ul(i.shadowRoot)),i._previouslyFocusedElement=X.activeElement,X.activeElement instanceof HTMLElement&&X.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function ul(i){let t=["button","input","keygen","select","textarea"].map(function(r){return r+":not([disabled])"});t.push('[tabindex]:not([disabled]):not([tabindex=""])');let a=i==null?void 0:i.querySelector(t.join(", "));if(!a&&"attachShadow"in Element.prototype){let r=(i==null?void 0:i.querySelectorAll("*"))||[];for(let n=0;n<r.length&&!(r[n].tagName&&r[n].shadowRoot&&(a=ul(r[n].shadowRoot),a));n++);}return a}function _u(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}O.customElements.get("media-dialog")||(O.customElements.define("media-dialog",Ge),O.MediaDialog=Ge);var Un=Ge;var cl=X.createElement("template");cl.innerHTML=`
1808
1798
  <style>
1809
- ${Cs.styles}
1799
+ ${Un.styles}
1810
1800
 
1811
1801
  .close {
1812
1802
  background: none;
@@ -1835,52 +1825,53 @@ media-theme {
1835
1825
  </svg>
1836
1826
  </button>
1837
1827
  </slot>
1838
- `;var Mi=class extends Cs{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Mi.template=cl;O.customElements.get("mxp-dialog")||(O.customElements.define("mxp-dialog",Mi),O.MxpDialog=Mi);var Si=new WeakMap,wi=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=Si.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=Si.get(this.element);t&&t.delete(this.type)}}static for(e){Si.has(e.element)||Si.set(e.element,new Map);let t=e.attributeName.slice(2),a=Si.get(e.element);return a&&a.has(t)?a.get(t):new wi(e.element,t)}};function Sc(i,e){return i instanceof G&&i.attributeName.startsWith("on")?(wi.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function wc(i,e){return e instanceof qa&&i instanceof we?(e.renderInto(i),!0):!1}function Cc(i,e){return e instanceof DocumentFragment&&i instanceof we?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function Lc(i,e){if(i instanceof G){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function xc(i,e){if(i instanceof G&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Rc(i,e){if(typeof e=="boolean"&&i instanceof G){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function Dc(i,e){return e===!1&&i instanceof we?(i.replace(""),!0):!1}function Oc(i,e){xc(i,e)||Rc(i,e)||Sc(i,e)||Dc(i,e)||wc(i,e)||Cc(i,e)||Lc(i,e)}var Ls=new Map,ul=new WeakMap,ml=new WeakMap,qa=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ls.has(this.stringsKey))return Ls.get(this.stringsKey);{let e=Q.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,s)=>a+r+(s<t?`{{ ${s} }}`:""),""),Ls.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(ul.get(e)!==t){ul.set(e,t);let s=new Se(t,this.values,this.processor);ml.set(e,s),e instanceof we?e.replace(...s.children):e.appendChild(s);return}let a=ml.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Nc={processCallback(i,e,t){var a;if(!!t){for(let[r,s]of e)if(r in t){let n=(a=t[r])!=null?a:"";Oc(s,n)}}}};function Ce(i,...e){return new qa(i,e,Nc)}function hl(i,e){i.renderInto(e)}var pl=require("@mux/playback-core"),xs=Q.createElement("template");"innerHTML"in xs&&(xs.innerHTML=sl);var bl=i=>Ce`
1828
+ `;var Si=class extends Un{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};Si.template=cl;O.customElements.get("mxp-dialog")||(O.customElements.define("mxp-dialog",Si),O.MxpDialog=Si);var wi=new WeakMap,Li=class{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=wi.get(this.element);a&&a.set(this.type,this)}set(e){if(typeof e=="function")this.handleEvent=e.bind(this.element);else if(typeof e=="object"&&typeof e.handleEvent=="function")this.handleEvent=e.handleEvent.bind(e);else{this.element.removeEventListener(this.type,this);let t=wi.get(this.element);t&&t.delete(this.type)}}static for(e){wi.has(e.element)||wi.set(e.element,new Map);let t=e.attributeName.slice(2),a=wi.get(e.element);return a&&a.has(t)?a.get(t):new Li(e.element,t)}};function yu(i,e){return i instanceof Z&&i.attributeName.startsWith("on")?(Li.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function Tu(i,e){return e instanceof Ja&&i instanceof Le?(e.renderInto(i),!0):!1}function Iu(i,e){return e instanceof DocumentFragment&&i instanceof Le?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function ku(i,e){if(i instanceof Z){let t=i.attributeNamespace,a=i.element.getAttributeNS(t,i.attributeName);return String(e)!==a&&(i.value=String(e)),!0}return i.value=String(e),!0}function Mu(i,e){if(i instanceof Z&&e instanceof Element){let t=i.element;return t[i.attributeName]!==e&&(i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),t[i.attributeName]=e),!0}return!1}function Su(i,e){if(typeof e=="boolean"&&i instanceof Z){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function wu(i,e){return e===!1&&i instanceof Le?(i.replace(""),!0):!1}function Lu(i,e){Mu(i,e)||Su(i,e)||yu(i,e)||wu(i,e)||Tu(i,e)||Iu(i,e)||ku(i,e)}var Bn=new Map,ml=new WeakMap,hl=new WeakMap,Ja=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Bn.has(this.stringsKey))return Bn.get(this.stringsKey);{let e=X.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Bn.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(ml.get(e)!==t){ml.set(e,t);let n=new we(t,this.values,this.processor);hl.set(e,n),e instanceof Le?e.replace(...n.children):e.appendChild(n);return}let a=hl.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Cu={processCallback(i,e,t){var a;if(!!t){for(let[r,n]of e)if(r in t){let s=(a=t[r])!=null?a:"";Lu(n,s)}}}};function Ce(i,...e){return new Ja(i,e,Cu)}function pl(i,e){i.renderInto(e)}var bl=require("@mux/playback-core"),$n=X.createElement("template");"innerHTML"in $n&&($n.innerHTML=sl);var fl=i=>Ce`
1839
1829
  <style>
1840
- ${rl}
1830
+ ${nl}
1841
1831
  </style>
1842
- ${Uc(i)}
1843
- `,Pc=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return gi(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},Uc=i=>{var e,t,a,r,s,n,l,c,m,f,_,g,y,x,$,k,_e,ce,J,Vt,mt,Ni,Os,Ns,Ps,Us,Bs,$s,Hs,Ws,Vs,Fs,Ks,Ys,Gs;return Ce`
1832
+ ${xu(i)}
1833
+ `,Ru=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return gi(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},xu=i=>{var e,t,a,r,n,s,l,u,c,f,A,g,y,R,$,k,ge,ue,ee,Yt,bt,Pi,Vn,Fn,Kn,Yn,Gn,Zn,qn,Qn,zn,Xn,Jn,jn,es;return Ce`
1844
1834
  <media-theme
1845
- template="${(e=i.themeTemplate)!=null?e:xs.content.children[0]}"
1835
+ template="${(e=i.themeTemplate)!=null?e:$n.content.children[0]}"
1846
1836
  default-stream-type="${(t=i.defaultStreamType)!=null?t:!1}"
1847
- hotkeys="${Pc(i)||!1}"
1837
+ hotkeys="${Ru(i)||!1}"
1848
1838
  nohotkeys="${i.noHotKeys||!i.hasSrc||i.isDialogOpen||!1}"
1849
- noautoseektolive="${!!((a=i.streamType)!=null&&a.includes(pl.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
1839
+ noautoseektolive="${!!((a=i.streamType)!=null&&a.includes(bl.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
1840
+ novolumepref="${i.novolumepref||!1}"
1850
1841
  disabled="${!i.hasSrc||i.isDialogOpen}"
1851
1842
  audio="${(r=i.audio)!=null?r:!1}"
1852
- style="${(s=Po({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor}))!=null?s:!1}"
1843
+ style="${(n=Bo({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor}))!=null?n:!1}"
1853
1844
  default-showing-captions="${!i.defaultHiddenCaptions}"
1854
- forward-seek-offset="${(n=i.forwardSeekOffset)!=null?n:!1}"
1845
+ forward-seek-offset="${(s=i.forwardSeekOffset)!=null?s:!1}"
1855
1846
  backward-seek-offset="${(l=i.backwardSeekOffset)!=null?l:!1}"
1856
- playback-rates="${(c=i.playbackRates)!=null?c:!1}"
1857
- default-show-remaining-time="${(m=i.defaultShowRemainingTime)!=null?m:!1}"
1847
+ playback-rates="${(u=i.playbackRates)!=null?u:!1}"
1848
+ default-show-remaining-time="${(c=i.defaultShowRemainingTime)!=null?c:!1}"
1858
1849
  hide-duration="${(f=i.hideDuration)!=null?f:!1}"
1859
- title="${(_=i.title)!=null?_:!1}"
1850
+ title="${(A=i.title)!=null?A:!1}"
1860
1851
  exportparts="top, center, bottom, layer, media-layer, poster-layer, vertical-layer, centered-layer, gesture-layer, poster, live, play, button, seek-backward, seek-forward, mute, captions, airplay, pip, fullscreen, cast, playback-rate, volume, range, time, display"
1861
1852
  >
1862
1853
  <mux-video
1863
1854
  slot="media"
1864
1855
  target-live-window="${(g=i.targetLiveWindow)!=null?g:!1}"
1865
1856
  stream-type="${(y=gi(i.streamType))!=null?y:!1}"
1866
- crossorigin="${(x=i.crossOrigin)!=null?x:""}"
1857
+ crossorigin="${(R=i.crossOrigin)!=null?R:""}"
1867
1858
  playsinline
1868
1859
  autoplay="${($=i.autoplay)!=null?$:!1}"
1869
1860
  muted="${(k=i.muted)!=null?k:!1}"
1870
- loop="${(_e=i.loop)!=null?_e:!1}"
1871
- preload="${(ce=i.preload)!=null?ce:!1}"
1872
- debug="${(J=i.debug)!=null?J:!1}"
1873
- prefer-cmcd="${(Vt=i.preferCmcd)!=null?Vt:!1}"
1874
- disable-cookies="${(mt=i.disableCookies)!=null?mt:!1}"
1875
- prefer-playback="${(Ni=i.preferPlayback)!=null?Ni:!1}"
1861
+ loop="${(ge=i.loop)!=null?ge:!1}"
1862
+ preload="${(ue=i.preload)!=null?ue:!1}"
1863
+ debug="${(ee=i.debug)!=null?ee:!1}"
1864
+ prefer-cmcd="${(Yt=i.preferCmcd)!=null?Yt:!1}"
1865
+ disable-cookies="${(bt=i.disableCookies)!=null?bt:!1}"
1866
+ prefer-playback="${(Pi=i.preferPlayback)!=null?Pi:!1}"
1876
1867
  start-time="${i.startTime!=null?i.startTime:!1}"
1877
- beacon-collection-domain="${(Os=i.beaconCollectionDomain)!=null?Os:!1}"
1878
- player-software-name="${(Ns=i.playerSoftwareName)!=null?Ns:!1}"
1879
- player-software-version="${(Ps=i.playerSoftwareVersion)!=null?Ps:!1}"
1880
- env-key="${(Us=i.envKey)!=null?Us:!1}"
1881
- custom-domain="${(Bs=i.customDomain)!=null?Bs:!1}"
1882
- src="${i.src?i.src:i.playbackId?gs(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
1883
- cast-src="${i.src?i.src:i.playbackId?gs(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
1868
+ beacon-collection-domain="${(Vn=i.beaconCollectionDomain)!=null?Vn:!1}"
1869
+ player-software-name="${(Fn=i.playerSoftwareName)!=null?Fn:!1}"
1870
+ player-software-version="${(Kn=i.playerSoftwareVersion)!=null?Kn:!1}"
1871
+ env-key="${(Yn=i.envKey)!=null?Yn:!1}"
1872
+ custom-domain="${(Gn=i.customDomain)!=null?Gn:!1}"
1873
+ src="${i.src?i.src:i.playbackId?kn(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
1874
+ cast-src="${i.src?i.src:i.playbackId?kn(i.playbackId,{maxResolution:i.maxResolution,domain:i.customDomain,token:i.tokens.playback}):!1}"
1884
1875
  exportparts="video"
1885
1876
  >
1886
1877
  ${i.storyboard?Ce`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:Ce``}
@@ -1888,27 +1879,27 @@ media-theme {
1888
1879
  <media-poster-image
1889
1880
  slot="poster"
1890
1881
  part="poster"
1891
- src="${i.poster===""?!1:($s=i.poster)!=null?$s:!1}"
1892
- placeholder-src="${(Hs=i.placeholder)!=null?Hs:!1}"
1882
+ src="${i.poster===""?!1:(Zn=i.poster)!=null?Zn:!1}"
1883
+ placeholder-src="${(qn=i.placeholder)!=null?qn:!1}"
1893
1884
  ></media-poster-image>
1894
1885
  <mxp-dialog
1895
1886
  no-auto-hide
1896
- open="${(Ws=i.isDialogOpen)!=null?Ws:!1}"
1887
+ open="${(Qn=i.isDialogOpen)!=null?Qn:!1}"
1897
1888
  onclose="${i.onCloseErrorDialog}"
1898
1889
  oninitfocus="${i.onInitFocusDialog}"
1899
1890
  >
1900
- ${(Vs=i.dialog)!=null&&Vs.title?Ce`<h3>${i.dialog.title}</h3>`:Ce``}
1891
+ ${(zn=i.dialog)!=null&&zn.title?Ce`<h3>${i.dialog.title}</h3>`:Ce``}
1901
1892
  <p>
1902
- ${(Fs=i.dialog)==null?void 0:Fs.message}
1903
- ${(Ks=i.dialog)!=null&&Ks.linkUrl?Ce`<a
1893
+ ${(Xn=i.dialog)==null?void 0:Xn.message}
1894
+ ${(Jn=i.dialog)!=null&&Jn.linkUrl?Ce`<a
1904
1895
  href="${i.dialog.linkUrl}"
1905
1896
  target="_blank"
1906
1897
  rel="external noopener"
1907
- aria-label="${(Ys=i.dialog.linkText)!=null?Ys:""} ${T("(opens in a new window)")}"
1908
- >${(Gs=i.dialog.linkText)!=null?Gs:i.dialog.linkUrl}</a
1898
+ aria-label="${(jn=i.dialog.linkText)!=null?jn:""} ${T("(opens in a new window)")}"
1899
+ >${(es=i.dialog.linkText)!=null?es:i.dialog.linkUrl}</a
1909
1900
  >`:Ce``}
1910
1901
  </p>
1911
1902
  </mxp-dialog>
1912
1903
  </media-theme>
1913
- `};var Ci=require("@mux/mux-video");function Qa(i,e,t,a,r){var l,c,m;let s={},n={};switch(i.code){case Ci.MediaError.MEDIA_ERR_NETWORK:{switch(s.title=T("Network Error",r),s.message=i.message,(l=i.data)==null?void 0:l.response.code){case 412:{s.title=T("Video is not currently available",r),s.message=T("The live stream or video file are not yet ready.",r),n.message=T("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:{s.title=T("Video does not exist",r),s.message="",n.message=T("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(s.title=T("Invalid playback URL",r),s.message=T("The video URL or playback-token are formatted with incorrect or incomplete information.",r),n.message=T("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",!a)break;let{exp:f,aud:_,sub:g}=$e(a),y=Date.now()>f*1e3,x=g!==t,$=_!=="v",k={timeStyle:"medium",dateStyle:"medium"};if(y){s.title=T("Video URL has expired",r),s.message=T("The video\u2019s secured playback-token has expired.",r),n.message=T("The video\u2019s secured playback-token has expired.",r),n.context=T("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(it.code,k).format(f*1e3),currentDate:new Intl.DateTimeFormat(it.code,k).format(Date.now())}),n.file="403-expired-token.md";break}if(x){s.title=T("Video URL is formatted incorrectly",r),s.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),n.context=T("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:g}),n.file="403-playback-id-mismatch.md";break}if($){s.title=T("Video URL is formatted incorrectly",r),s.message=T("The playback-token is formatted with incorrect information.",r),n.message=T("The playback-token is formatted with incorrect information.",r),n.context=T("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:_}),n.file="403-incorrect-aud-value.md";break}n.message=T("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 Ci.MediaError.MEDIA_ERR_DECODE:{let{message:f}=i;s={title:T("Media Error",r),message:f},n.file="media-decode-error.md";break}case Ci.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(m=(c=i.data)==null?void 0:c.response)==null?void 0:m.code;if(f>=400&&f<500){i.code=Ci.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:f}},{dialog:s,devlog:n}=Qa(i,e,t,a);break}s={title:T("Source Not Supported",r),message:i.message},n.file="media-src-not-supported.md";break}default:s={title:T("Error",r),message:i.message};break}return e&&(s={title:T("Your device appears to be offline",r),message:T("Check your internet connection and try reloading this video.",r)}),{dialog:s,devlog:n}}var Le={SRC:"src",POSTER:"poster"},h={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",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window"},Rs=["audio","backward-seek-offset","default-show-remaining-time","default-showing-captions","noautoseektolive","disabled","exportparts","forward-seek-offset","hide-duration","hotkeys","nohotkeys","playbackrates","default-stream-type","stream-type","style","target-live-window","template","title"];function Bc(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:$c(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(v.Attributes.TARGET_LIVE_WINDOW),streamType:gi(i.getAttribute(v.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Hc(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),...e}}function $c(i){var t,a;let e=i.getAttribute(h.THEME);if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let s=O.customElements.get(e);if(s!=null&&s.template)return s.template}}function Hc(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function fl(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Wc=Object.values(v.Attributes),Vc=Object.values(Le),Fc=Object.values(h),Kc=$a(),Yc="mux-player",El={dialog:void 0,isDialogOpen:!1},xi,Ri,xe,Di,ut,Ye,Ht,za,vl,Oi,Ds,Ge,Wt,Xa,gl,Ja,_l,ja,Al,er,yl,Li=class extends ys{constructor(){super();R(this,Ye);R(this,za);R(this,Oi);R(this,Ge);R(this,Xa);R(this,Ja);R(this,ja);R(this,er);R(this,xi,!1);R(this,Ri,{});R(this,xe,!0);R(this,Di,new Ba(this,"hotkeys"));R(this,ut,{...El,onCloseErrorDialog:()=>U(this,Oi,Ds).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Es(this,Q.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),U(this,za,vl).call(this),this.isConnected&&U(this,Ye,Ht).call(this)}static get observedAttributes(){var t;return[...(t=ys.observedAttributes)!=null?t:[],...Vc,...Wc,...Fc]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=fl(this))}attributeChangedCallback(t,a,r){switch(U(this,Ye,Ht).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:I(this,Di).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&He(T("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case h.THUMBNAIL_TOKEN:{let{aud:n}=$e(r);r&&n!=="t"&&He(T("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:n}));break}case h.STORYBOARD_TOKEN:{let{aud:n}=$e(r);r&&n!=="s"&&He(T("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:n}));break}case v.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&le(T("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case v.Attributes.STREAM_TYPE:r&&![w.StreamTypes.LIVE,w.StreamTypes.ON_DEMAND,w.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:_s({file:"invalid-stream-type.md",message:T("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===w.StreamTypes.LIVE?0:Number.NaN}[v.Attributes.PLAYBACK_ID,Le.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&j(this,ut,{...I(this,ut),...El}),U(this,Ge,Wt).call(this,{[$o(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(v.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?w.CmcdTypeValues.includes(t)?this.setAttribute(v.Attributes.PREFER_CMCD,t):He(`Invalid value for preferCmcd. Must be one of ${w.CmcdTypeValues.join()}`):this.removeAttribute(v.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}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 theme(){var t;return(t=this.getAttribute(h.THEME))!=null?t:""}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Rs.includes(r))continue;let s=t.getAttribute(r);a[Na(r)]=s===""?!0:s}return a}set themeProps(t){var r,s;U(this,Ye,Ht).call(this);let a={...this.themeProps,...t};for(let n in a){if(Rs.includes(n))continue;let l=t==null?void 0:t[n];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Oa(n),Boolean(l)):(s=this.mediaTheme)==null||s.setAttribute(Oa(n),l)}}get playbackId(){var t;return(t=this.getAttribute(v.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(v.Attributes.PLAYBACK_ID,t):this.removeAttribute(v.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=ct(this,Le.SRC))!=null?t:void 0:(a=this.getAttribute(Le.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Le.SRC,t):this.removeAttribute(Le.SRC)}get poster(){var a;let t=this.getAttribute(Le.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return Uo(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Le.POSTER,t):this.removeAttribute(Le.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[w.StreamTypes.LIVE,w.StreamTypes.UNKNOWN].includes(this.streamType)))return Bo(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return I(this,Di)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return ke(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ct(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=ke(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=ke(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Yc}get playerSoftwareVersion(){var t;return(t=this.getAttribute(v.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Kc}get beaconCollectionDomain(){var t;return(t=this.getAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(v.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(v.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(v.Attributes.MAX_RESOLUTION,t):this.removeAttribute(v.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(v.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(v.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(v.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ct(this,v.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(v.Attributes.ENV_KEY,`${t}`)}get debug(){return ct(this,v.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(v.Attributes.DEBUG,""):this.removeAttribute(v.Attributes.DEBUG)}get disableCookies(){return ct(this,v.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(v.Attributes.DISABLE_COOKIES,""):this.removeAttribute(v.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(v.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:w.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(v.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:w.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return ke(ct(this,v.Attributes.START_TIME))}set startTime(t){this.setAttribute(v.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(v.Attributes.PREFER_PLAYBACK);if(t===w.PlaybackTypes.MSE||t===w.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===w.PlaybackTypes.MSE||t===w.PlaybackTypes.NATIVE?this.setAttribute(v.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(v.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(U(this,Ye,Ht).call(this),!this.media){le("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...fl(this),...t}}async addCuePoints(t){var a;if(U(this,Ye,Ht).call(this),!this.media){le("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(h.PLAYBACK_TOKEN),a=this.getAttribute(h.THUMBNAIL_TOKEN),r=this.getAttribute(h.STORYBOARD_TOKEN);return{...I(this,Ri),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){j(this,Ri,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,s){var l;let n=(l=this.media)==null?void 0:l.nativeEl;if(!!n)return(0,w.addTextTrack)(n,t,a,r,s)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,w.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};xi=new WeakMap,Ri=new WeakMap,xe=new WeakMap,Di=new WeakMap,ut=new WeakMap,Ye=new WeakSet,Ht=function(){var t,a,r;if(!I(this,xi)){j(this,xi,!0),U(this,Ge,Wt).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof O.HTMLElement))throw""}catch{le("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof v.default))throw""}catch{le("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ti))throw""}catch{le("<media-controller> failed to upgrade!")}Ko(this),U(this,Xa,gl).call(this),U(this,Ja,_l).call(this),U(this,ja,Al).call(this),j(this,xe,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),U(this,er,yl).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{U(this,Ge,Wt).call(this)})}},za=new WeakSet,vl=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Oi=new WeakSet,Ds=function(t){Object.assign(I(this,ut),t),U(this,Ge,Wt).call(this)},Ge=new WeakSet,Wt=function(t={}){hl(bl(Bc(this,{...I(this,ut),...t})),this.shadowRoot)},Xa=new WeakSet,gl=function(){let t=r=>{var l,c;if(!(r!=null&&r.startsWith("theme-")))return;let s=r.replace(/^theme-/,"");if(Rs.includes(s))return;let n=this.getAttribute(r);n!=null?(l=this.mediaTheme)==null||l.setAttribute(s,n):(c=this.mediaTheme)==null||c.removeAttribute(s)};new MutationObserver(r=>{for(let{attributeName:s}of r)t(s)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},Ja=new WeakSet,_l=function(){var a;let t=r=>{let{detail:s}=r;if(s instanceof v.MediaError||(s=new v.MediaError(s.message,s.code,s.fatal)),!(s!=null&&s.fatal)){He(s),s.data&&He(`${s.name} data:`,s.data);return}let{dialog:n,devlog:l}=Qa(s,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&_s(l),le(s),s.data&&le(`${s.name} data:`,s.data),U(this,Oi,Ds).call(this,{isDialogOpen:!0,dialog:n})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var n,l,c;if(!(((n=this.media)==null?void 0:n.error)instanceof v.MediaError))return r;let{devlog:s}=Qa((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(c=this.media)==null?void 0:c.error.code,player_error_message:s.message?String(s.message):r.player_error_message,player_error_context:s.context?String(s.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var n,l;let{detail:s}=r;if(!s){let{message:c,code:m}=(l=(n=this.media)==null?void 0:n.error)!=null?l:{};s=new v.MediaError(c,m)}!(s!=null&&s.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:s}))})},ja=new WeakSet,Al=function(){var a,r,s,n;let t=()=>U(this,Ge,Wt).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(n=(s=this.media)==null?void 0:s.textTracks)==null||n.addEventListener("removetrack",t)},er=new WeakSet,yl=function(){var f,_;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,s=new WeakMap,n=()=>this.streamType===w.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,l=(g,y,x=!1)=>{if(n())return;Array.from(g&&g.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!y||this.paused){let _e=k.text.split(`
1914
- `).length,ce=t?-2:-3;this.streamType===w.StreamTypes.LIVE&&(ce=t?-1:-2);let J=ce-_e;if(k.line===J&&!x)return;s.has(k)||s.set(k,k.line),k.line=J-1,k.line=J}else setTimeout(()=>{k.line=s.get(k)||"auto"},500)})},c=()=>{var g,y;l(r,(y=(g=this.mediaController)==null?void 0:g.hasAttribute("user-inactive"))!=null?y:!1)},m=()=>{var x,$;let y=Array.from((($=(x=this.mediaController)==null?void 0:x.media)==null?void 0:$.textTracks)||[]).filter(k=>["subtitles","captions"].includes(k.kind)&&k.mode==="showing")[0];y!==r&&(r==null||r.removeEventListener("cuechange",c)),r=y,r==null||r.addEventListener("cuechange",c),l(r,I(this,xe))};if(m(),(f=this.textTracks)==null||f.addEventListener("change",m),(_=this.textTracks)==null||_.addEventListener("addtrack",m),navigator.userAgent.includes("Chrome/")){let g=()=>{l(r,I(this,xe),!0),this.paused||window.requestAnimationFrame(g)};this.addEventListener("playing",()=>{g()})}this.addEventListener("userinactivechange",()=>{var y,x;let g=(x=(y=this.mediaController)==null?void 0:y.hasAttribute("user-inactive"))!=null?x:!0;I(this,xe)!==g&&(j(this,xe,g),l(r,I(this,xe)))})};function ct(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}O.customElements.get("mux-player")||(O.customElements.define("mux-player",Li),O.MuxPlayerElement=Li);var Gc=Li;
1904
+ `};var Ci=require("@mux/mux-video");function ja(i,e,t,a,r){var l,u,c;let n={},s={};switch(i.code){case Ci.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=T("Network Error",r),n.message=i.message,(l=i.data)==null?void 0:l.response.code){case 412:{n.title=T("Video is not currently available",r),n.message=T("The live stream or video file are not yet ready.",r),s.message=T("This playback-id may belong to a live stream that is not currently active or an asset that is not ready.",r),s.file="412-not-playable.md";break}case 404:{n.title=T("Video does not exist",r),n.message="",s.message=T("This playback-id does not exist. You may have used an Asset ID or an ID from a different resource.",r),s.file="404-not-found.md";break}case 403:{if(n.title=T("Invalid playback URL",r),n.message=T("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=T("403 error trying to access this playback URL. If this is a signed URL, you might need to provide a playback-token.",r),s.file="missing-signed-tokens.md",!a)break;let{exp:f,aud:A,sub:g}=We(a),y=Date.now()>f*1e3,R=g!==t,$=A!=="v",k={timeStyle:"medium",dateStyle:"medium"};if(y){n.title=T("Video URL has expired",r),n.message=T("The video\u2019s secured playback-token has expired.",r),s.message=T("The video\u2019s secured playback-token has expired.",r),s.context=T("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(rt.code,k).format(f*1e3),currentDate:new Intl.DateTimeFormat(rt.code,k).format(Date.now())}),s.file="403-expired-token.md";break}if(R){n.title=T("Video URL is formatted incorrectly",r),n.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=T("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=T("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:g}),s.file="403-playback-id-mismatch.md";break}if($){n.title=T("Video URL is formatted incorrectly",r),n.message=T("The playback-token is formatted with incorrect information.",r),s.message=T("The playback-token is formatted with incorrect information.",r),s.context=T("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:A}),s.file="403-incorrect-aud-value.md";break}s.message=T("403 error trying to access this playback URL. If this is a signed playback ID, the token might not have been generated correctly.",r),s.file="403-malformatted-token.md";break}}break}case Ci.MediaError.MEDIA_ERR_DECODE:{let{message:f}=i;n={title:T("Media Error",r),message:f},s.file="media-decode-error.md";break}case Ci.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let f=(c=(u=i.data)==null?void 0:u.response)==null?void 0:c.code;if(f>=400&&f<500){i.code=Ci.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:f}},{dialog:n,devlog:s}=ja(i,e,t,a);break}n={title:T("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:T("Error",r),message:i.message};break}return e&&(n={title:T("Your device appears to be offline",r),message:T("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var Re={SRC:"src",POSTER:"poster"},h={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",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",NO_VOLUME_PREF:"no-volume-pref"},Hn=["audio","backward-seek-offset","default-show-remaining-time","default-showing-captions","noautoseektolive","disabled","exportparts","forward-seek-offset","hide-duration","hotkeys","nohotkeys","playbackrates","default-stream-type","stream-type","style","target-live-window","template","title","no-volume-pref"];function Du(i,e){var a;return{src:!i.playbackId&&i.src,playbackId:i.playbackId,hasSrc:!!i.playbackId||!!i.src,poster:i.poster,storyboard:i.storyboard,storyboardSrc:i.getAttribute(h.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:Ou(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(h.NOHOTKEYS),hotKeys:i.getAttribute(h.HOTKEYS),muted:i.muted,paused:i.paused,preload:i.preload,envKey:i.envKey,preferCmcd:i.preferCmcd,debug:i.debug,disableCookies:i.disableCookies,tokens:i.tokens,beaconCollectionDomain:i.beaconCollectionDomain,maxResolution:i.maxResolution,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(E.Attributes.TARGET_LIVE_WINDOW),streamType:gi(i.getAttribute(E.Attributes.STREAM_TYPE)),primaryColor:i.primaryColor,secondaryColor:i.secondaryColor,forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Nu(i),playbackRates:i.getAttribute(h.PLAYBACK_RATES),customDomain:(a=i.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(h.TITLE),novolumepref:i.hasAttribute(h.NO_VOLUME_PREF),...e}}function Ou(i){var t,a;let e=i.getAttribute(h.THEME);if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=O.customElements.get(e);if(n!=null&&n.template)return n.template}}function Nu(i){var t;let e=(t=i.mediaController)==null?void 0:t.querySelector("media-time-display");return e&&getComputedStyle(e).getPropertyValue("--media-duration-display-display").trim()==="none"}function vl(i){return i.getAttributeNames().filter(e=>e.startsWith("metadata-")).reduce((e,t)=>{let a=i.getAttribute(t);return a!==null&&(e[t.replace(/^metadata-/,"").replace(/-/g,"_")]=a),e},{})}var Pu=Object.values(E.Attributes),Uu=Object.values(Re),Bu=Object.values(h),$u=Fa(),Hu="mux-player",El={dialog:void 0,isDialogOpen:!1},xi,Di,xe,Oi,pt,Ze,Ft,er,gl,Ni,Wn,qe,Kt,tr,Al,ir,_l,ar,yl,rr,Tl,Ri=class extends wn{constructor(){super();x(this,Ze);x(this,er);x(this,Ni);x(this,qe);x(this,tr);x(this,ir);x(this,ar);x(this,rr);x(this,xi,!1);x(this,Di,{});x(this,xe,!0);x(this,Oi,new Va(this,"hotkeys"));x(this,pt,{...El,onCloseErrorDialog:()=>P(this,Ni,Wn).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Tn(this,X.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),P(this,er,gl).call(this),this.isConnected&&P(this,Ze,Ft).call(this)}static get observedAttributes(){var t;return[...(t=wn.observedAttributes)!=null?t:[],...Uu,...Pu,...Bu]}get mediaTheme(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("media-theme")}get mediaController(){var t,a;return(a=(t=this.mediaTheme)==null?void 0:t.shadowRoot)==null?void 0:a.querySelector("media-controller")}connectedCallback(){var a;let t=(a=this.shadowRoot)==null?void 0:a.querySelector("mux-video");t&&(t.metadata=vl(this))}attributeChangedCallback(t,a,r){switch(P(this,Ze,Ft).call(this),super.attributeChangedCallback(t,a,r),t){case h.HOTKEYS:I(this,Oi).value=r;break;case h.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&Ve(T("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case h.THUMBNAIL_TOKEN:{let{aud:s}=We(r);r&&s!=="t"&&Ve(T("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case h.STORYBOARD_TOKEN:{let{aud:s}=We(r);r&&s!=="s"&&Ve(T("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case E.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&le(T("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case E.Attributes.STREAM_TYPE:r&&![C.StreamTypes.LIVE,C.StreamTypes.ON_DEMAND,C.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Mn({file:"invalid-stream-type.md",message:T("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):this.targetLiveWindow=r===C.StreamTypes.LIVE?0:Number.NaN}[E.Attributes.PLAYBACK_ID,Re.SRC,h.PLAYBACK_TOKEN].includes(t)&&a!==r&&te(this,pt,{...I(this,pt),...El}),P(this,qe,Kt).call(this,{[Wo(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(E.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?C.CmcdTypeValues.includes(t)?this.setAttribute(E.Attributes.PREFER_CMCD,t):Ve(`Invalid value for preferCmcd. Must be one of ${C.CmcdTypeValues.join()}`):this.removeAttribute(E.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute("media-has-played"))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute("media-time-is-live")}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 theme(){var t;return(t=this.getAttribute(h.THEME))!=null?t:""}set theme(t){this.setAttribute(h.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Hn.includes(r))continue;let n=t.getAttribute(r);a[$a(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;P(this,Ze,Ft).call(this);let a={...this.themeProps,...t};for(let s in a){if(Hn.includes(s))continue;let l=t==null?void 0:t[s];typeof l=="boolean"||l==null?(r=this.mediaTheme)==null||r.toggleAttribute(Ba(s),Boolean(l)):(n=this.mediaTheme)==null||n.setAttribute(Ba(s),l)}}get playbackId(){var t;return(t=this.getAttribute(E.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(E.Attributes.PLAYBACK_ID,t):this.removeAttribute(E.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=ht(this,Re.SRC))!=null?t:void 0:(a=this.getAttribute(Re.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Re.SRC,t):this.removeAttribute(Re.SRC)}get poster(){var a;let t=this.getAttribute(Re.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return $o(this.playbackId,{domain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Re.POSTER,t):this.removeAttribute(Re.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(h.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(h.STORYBOARD_SRC,t):this.removeAttribute(h.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[C.StreamTypes.LIVE,C.StreamTypes.UNKNOWN].includes(this.streamType)))return Ho(this.playbackId,{domain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(h.AUDIO)}set audio(t){if(!t){this.removeAttribute(h.AUDIO);return}this.setAttribute(h.AUDIO,"")}get hotkeys(){return I(this,Oi)}get nohotkeys(){return this.hasAttribute(h.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(h.NOHOTKEYS);return}this.setAttribute(h.NOHOTKEYS,"")}get thumbnailTime(){return Me(this.getAttribute(h.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(h.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(h.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(h.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=ht(this,h.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(h.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(h.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(h.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(h.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=O.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(h.SECONDARY_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(h.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(h.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(!!this.hasAttribute(h.PLAYBACK_RATES))return this.getAttribute(h.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(t=>Number(t)).filter(t=>!Number.isNaN(t)).sort((t,a)=>t-a)}set playbackRates(t){if(!t){this.removeAttribute(h.PLAYBACK_RATES);return}this.setAttribute(h.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Me(this.getAttribute(h.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(h.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Me(this.getAttribute(h.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(h.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(h.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(h.DEFAULT_HIDDEN_CAPTIONS)}get playerSoftwareName(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Hu}get playerSoftwareVersion(){var t;return(t=this.getAttribute(E.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:$u}get beaconCollectionDomain(){var t;return(t=this.getAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(E.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(E.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(E.Attributes.MAX_RESOLUTION,t):this.removeAttribute(E.Attributes.MAX_RESOLUTION))}get customDomain(){var t;return(t=this.getAttribute(E.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(E.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(E.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=ht(this,E.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(E.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(h.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(h.NO_VOLUME_PREF,""):this.removeAttribute(h.NO_VOLUME_PREF)}get debug(){return ht(this,E.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(E.Attributes.DEBUG,""):this.removeAttribute(E.Attributes.DEBUG)}get disableCookies(){return ht(this,E.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(E.Attributes.DISABLE_COOKIES,""):this.removeAttribute(E.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(E.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:C.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(E.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(h.DEFAULT_STREAM_TYPE))!=null?r:C.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(h.DEFAULT_STREAM_TYPE,t):this.removeAttribute(h.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(h.TARGET_LIVE_WINDOW)?+this.getAttribute(h.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t!=this.targetLiveWindow&&(t==null?this.removeAttribute(h.TARGET_LIVE_WINDOW):this.setAttribute(h.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Me(ht(this,E.Attributes.START_TIME))}set startTime(t){this.setAttribute(E.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(E.Attributes.PREFER_PLAYBACK);if(t===C.PlaybackTypes.MSE||t===C.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===C.PlaybackTypes.MSE||t===C.PlaybackTypes.NATIVE?this.setAttribute(E.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(E.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(P(this,Ze,Ft).call(this),!this.media){le("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...vl(this),...t}}async addCuePoints(t){var a;if(P(this,Ze,Ft).call(this),!this.media){le("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(a=this.media)==null?void 0:a.addCuePoints(t)}get activeCuePoint(){var t;return(t=this.media)==null?void 0:t.activeCuePoint}get cuePoints(){var t,a;return(a=(t=this.media)==null?void 0:t.cuePoints)!=null?a:[]}getStartDate(){var t;return(t=this.media)==null?void 0:t.getStartDate()}get currentPdt(){var t;return(t=this.media)==null?void 0:t.currentPdt}get tokens(){let t=this.getAttribute(h.PLAYBACK_TOKEN),a=this.getAttribute(h.THUMBNAIL_TOKEN),r=this.getAttribute(h.STORYBOARD_TOKEN);return{...I(this,Di),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){te(this,Di,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(h.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(h.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(h.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(h.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(h.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(h.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var l;let s=(l=this.media)==null?void 0:l.nativeEl;if(!!s)return(0,C.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(!!a)return(0,C.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};xi=new WeakMap,Di=new WeakMap,xe=new WeakMap,Oi=new WeakMap,pt=new WeakMap,Ze=new WeakSet,Ft=function(){var t,a,r;if(!I(this,xi)){te(this,xi,!0),P(this,qe,Kt).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof O.HTMLElement))throw""}catch{le("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof E.default))throw""}catch{le("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof ii))throw""}catch{le("<media-controller> failed to upgrade!")}Go(this),P(this,tr,Al).call(this),P(this,ir,_l).call(this),P(this,ar,yl).call(this),te(this,xe,(a=(t=this.mediaController)==null?void 0:t.hasAttribute("user-inactive"))!=null?a:!0),P(this,rr,Tl).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{P(this,qe,Kt).call(this)})}},er=new WeakSet,gl=function(){var t,a;try{(t=window==null?void 0:window.CSS)==null||t.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(a=window==null?void 0:window.CSS)==null||a.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Ni=new WeakSet,Wn=function(t){Object.assign(I(this,pt),t),P(this,qe,Kt).call(this)},qe=new WeakSet,Kt=function(t={}){pl(fl(Du(this,{...I(this,pt),...t})),this.shadowRoot)},tr=new WeakSet,Al=function(){let t=r=>{var l,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(Hn.includes(n))return;let s=this.getAttribute(r);s!=null?(l=this.mediaTheme)==null||l.setAttribute(n,s):(u=this.mediaTheme)==null||u.removeAttribute(n)};new MutationObserver(r=>{for(let{attributeName:n}of r)t(n)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(t)},ir=new WeakSet,_l=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof E.MediaError||(n=new E.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){Ve(n),n.data&&Ve(`${n.name} data:`,n.data);return}let{dialog:s,devlog:l}=ja(n,!window.navigator.onLine,this.playbackId,this.playbackToken);l.message&&Mn(l),le(n),n.data&&le(`${n.name} data:`,n.data),P(this,Ni,Wn).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,l,u;if(!(((s=this.media)==null?void 0:s.error)instanceof E.MediaError))return r;let{devlog:n}=ja((l=this.media)==null?void 0:l.error,!window.navigator.onLine,this.playbackId,this.playbackToken,!1);return{player_error_code:(u=this.media)==null?void 0:u.error.code,player_error_message:n.message?String(n.message):r.player_error_message,player_error_context:n.context?String(n.context):r.player_error_context}}),(a=this.media)==null||a.addEventListener("error",r=>{var s,l;let{detail:n}=r;if(!n){let{message:u,code:c}=(l=(s=this.media)==null?void 0:s.error)!=null?l:{};n=new E.MediaError(u,c)}!(n!=null&&n.fatal)||this.dispatchEvent(new CustomEvent("error",{detail:n}))})},ar=new WeakSet,yl=function(){var a,r,n,s;let t=()=>P(this,qe,Kt).call(this);(r=(a=this.media)==null?void 0:a.textTracks)==null||r.addEventListener("addtrack",t),(s=(n=this.media)==null?void 0:n.textTracks)==null||s.addEventListener("removetrack",t)},rr=new WeakSet,Tl=function(){var f,A;let t=/.*Version\/.*Safari\/.*/.test(navigator.userAgent);if(!/Firefox/i.test(navigator.userAgent))return;let r,n=new WeakMap,s=()=>this.streamType===C.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,l=(g,y,R=!1)=>{if(s())return;Array.from(g&&g.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!y||this.paused){let ge=k.text.split(`
1905
+ `).length,ue=t?-2:-3;this.streamType===C.StreamTypes.LIVE&&(ue=t?-1:-2);let ee=ue-ge;if(k.line===ee&&!R)return;n.has(k)||n.set(k,k.line),k.line=ee-1,k.line=ee}else setTimeout(()=>{k.line=n.get(k)||"auto"},500)})},u=()=>{var g,y;l(r,(y=(g=this.mediaController)==null?void 0:g.hasAttribute("user-inactive"))!=null?y:!1)},c=()=>{var R,$;let y=Array.from((($=(R=this.mediaController)==null?void 0:R.media)==null?void 0:$.textTracks)||[]).filter(k=>["subtitles","captions"].includes(k.kind)&&k.mode==="showing")[0];y!==r&&(r==null||r.removeEventListener("cuechange",u)),r=y,r==null||r.addEventListener("cuechange",u),l(r,I(this,xe))};if(c(),(f=this.textTracks)==null||f.addEventListener("change",c),(A=this.textTracks)==null||A.addEventListener("addtrack",c),navigator.userAgent.includes("Chrome/")){let g=()=>{l(r,I(this,xe),!0),this.paused||window.requestAnimationFrame(g)};this.addEventListener("playing",()=>{g()})}this.addEventListener("userinactivechange",()=>{var y,R;let g=(R=(y=this.mediaController)==null?void 0:y.hasAttribute("user-inactive"))!=null?R:!0;I(this,xe)!==g&&(te(this,xe,g),l(r,I(this,xe)))})};function ht(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}O.customElements.get("mux-player")||(O.customElements.define("mux-player",Ri),O.MuxPlayerElement=Ri);var Wu=Ri;