@mux/mux-player 2.3.2 → 2.3.3

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,4 +1,4 @@
1
- "use strict";var Wu=Object.create;var Ea=Object.defineProperty;var Fu=Object.getOwnPropertyDescriptor;var Ku=Object.getOwnPropertyNames;var Yu=Object.getPrototypeOf,Gu=Object.prototype.hasOwnProperty;var Zu=(i,e)=>{for(var t in e)Ea(i,t,{get:e[t],enumerable:!0})},Zs=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ku(e))!Gu.call(i,r)&&r!==t&&Ea(i,r,{get:()=>e[r],enumerable:!(a=Fu(e,r))||a.enumerable});return i};var qu=(i,e,t)=>(t=i!=null?Wu(Yu(i)):{},Zs(e||!i||!i.__esModule?Ea(t,"default",{value:i,enumerable:!0}):t,i)),Qu=i=>Zs(Ea({},"__esModule",{value:!0}),i);var Tn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var S=(i,e,t)=>(Tn(i,e,"read from private field"),t?t.call(i):e.get(i)),W=(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)},ce=(i,e,t,a)=>(Tn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var F=(i,e,t)=>(Tn(i,e,"access private method"),t);var _h={};Zu(_h,{MediaError:()=>g.MediaError,default:()=>Ah,getVideoAttribute:()=>Wt});module.exports=Qu(_h);var Yt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Yt{}globalThis.DocumentFragment=i}var ki=class extends Yt{},In=class extends Yt{},zu={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(ki)}},Si,kn=class{constructor(e,t={}){W(this,Si,void 0);ce(this,Si,t==null?void 0:t.detail)}get detail(){return S(this,Si)}initCustomEvent(){}};Si=new WeakMap;function Xu(i,e){return new ki}var qs={document:{createElement:Xu},DocumentFragment,customElements:zu,CustomEvent:kn,EventTarget:Yt,HTMLElement:ki,HTMLVideoElement:In},Qs=typeof window=="undefined"||typeof globalThis.customElements=="undefined",U=Qs?qs:globalThis,ne=Qs?qs.document:globalThis.document;var f={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_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},gt={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled"},zs=Object.entries(gt),o=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),Fe=zs.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),kh=Object.entries(Fe).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),Xs=Object.entries(o).reduce((i,[e,t])=>{let a=Fe[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),et={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},At={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Sn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},oe={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},fe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var q={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"},D={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",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"},ju={...q,...D};function Js(i){return i==null?void 0:i.map(ec).join(" ")}function js(i){return i==null?void 0:i.split(/\s+/).map(tc)}function ec(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function tc(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function el(i){return i==null?void 0:i.map(ic).join(" ")}function tl(i){return i==null?void 0:i.split(/\s+/).map(ac)}function ic(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function ac(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function fa(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 il(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function al(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function va(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var ga=i=>new Promise(e=>setTimeout(e,i));var rl=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],rc=(i,e)=>{let t=i===1?rl[e].singular:rl[e].plural;return`${i} ${t}`},_t=i=>{if(!al(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((d,u)=>d&&rc(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Se(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),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Lh=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var Aa=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},oc=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},_a=(i,e)=>oc(i,e)[0],tt=(i,e)=>!i||!e?!1:i.contains(e)?!0:tt(i,e.getRootNode().host),it=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||it(i.getRootNode().host,e)};function Mn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Mn(t.shadowRoot))!=null?e:t:null}function nl(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function ol(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function sl(i,e,t,a){let r=Cn(t,a),n=Cn(t,{x:i,y:e}),s=Cn(a,{x:i,y:e});return n>r||s>r?n>s?1:0:n/r}function Cn(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function N(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:()=>{},getPropertyValue:()=>""}}}function M(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function O(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}M(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function L(i,e){return i.hasAttribute(e)}function C(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}L(i,e)!=t&&i.toggleAttribute(e,t)}function x(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function R(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;x(i,e,void 0)!==a&&i.setAttribute(e,a)}var ya=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Ln=class{observe(){}unobserve(){}disconnect(){}},ll={createElement:function(){return new Rn.HTMLElement},addEventListener(){},removeEventListener(){}},Rn={ResizeObserver:Ln,document:ll,HTMLElement:class extends ya{},DocumentFragment:class extends ya{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[]}},dl=typeof window=="undefined"||typeof window.customElements=="undefined",ul=Object.keys(Rn).every(i=>i in globalThis),l=dl&&!ul?Rn:globalThis,c=dl&&!ul?ll:globalThis.document;var sc=Object.defineProperty,lc=(i,e,t)=>e in i?sc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,dc=(i,e,t)=>(lc(i,typeof e!="symbol"?e+"":e,t),t),cl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},me=(i,e,t)=>(cl(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)},Ia=(i,e,t,a)=>(cl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ce,ka,Gt,Sa,ml=c.createElement("template");ml.innerHTML=`
1
+ "use strict";var ec=Object.create;var _a=Object.defineProperty;var tc=Object.getOwnPropertyDescriptor;var ic=Object.getOwnPropertyNames;var ac=Object.getPrototypeOf,rc=Object.prototype.hasOwnProperty;var nc=(i,e)=>{for(var t in e)_a(i,t,{get:e[t],enumerable:!0})},tl=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ic(e))!rc.call(i,r)&&r!==t&&_a(i,r,{get:()=>e[r],enumerable:!(a=tc(e,r))||a.enumerable});return i};var oc=(i,e,t)=>(t=i!=null?ec(ac(i)):{},tl(e||!i||!i.__esModule?_a(t,"default",{value:i,enumerable:!0}):t,i)),sc=i=>tl(_a({},"__esModule",{value:!0}),i);var Rn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var S=(i,e,t)=>(Rn(i,e,"read from private field"),t?t.call(i):e.get(i)),K=(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)=>(Rn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t);var Y=(i,e,t)=>(Rn(i,e,"access private method"),t);var Uh={};nc(Uh,{MediaError:()=>g.MediaError,default:()=>Ph,getVideoAttribute:()=>Ft});module.exports=sc(Uh);var Gt=class{addEventListener(){}removeEventListener(){}dispatchEvent(e){return!0}};if(typeof DocumentFragment=="undefined"){class i extends Gt{}globalThis.DocumentFragment=i}var Si=class extends Gt{},wn=class extends Gt{},lc={get(i){},define(i,e,t){},upgrade(i){},whenDefined(i){return Promise.resolve(Si)}},Ci,xn=class{constructor(e,t={}){K(this,Ci,void 0);me(this,Ci,t==null?void 0:t.detail)}get detail(){return S(this,Ci)}initCustomEvent(){}};Ci=new WeakMap;function dc(i,e){return new Si}var il={document:{createElement:dc},DocumentFragment,customElements:lc,CustomEvent:xn,EventTarget:Gt,HTMLElement:Si,HTMLVideoElement:wn},al=typeof window=="undefined"||typeof globalThis.customElements=="undefined",U=al?il:globalThis,le=al?il.document:globalThis.document;var v={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_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},A={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},At={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_PAUSED:"mediaPaused",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_ENDED:"mediaEnded",MEDIA_MUTED:"mediaMuted",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_IS_PIP:"mediaIsPip",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_LOADING:"mediaLoading",MEDIA_BUFFERED:"mediaBuffered",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_CHAPTERS_CUES:"mediaChaptersCues"},rl=Object.entries(At),o=rl.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{}),qe=rl.reduce((i,[e,t])=>(i[e]=`${t.toLowerCase()}`,i),{USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"}),Wh=Object.entries(qe).reduce((i,[e,t])=>{let a=o[e];return a&&(i[t]=a),i},{userinactivechange:"userinactive"}),nl=Object.entries(o).reduce((i,[e,t])=>{let a=qe[e];return a&&(i[t]=a),i},{userinactive:"userinactivechange"}),Me={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},_t={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"};var Dn={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},de={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},fe={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"};var X={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",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},D={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",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"},cc={...X,...D};function ol(i){return i==null?void 0:i.map(mc).join(" ")}function sl(i){return i==null?void 0:i.split(/\s+/).map(hc)}function mc(i){if(i){let{id:e,width:t,height:a}=i;return[e,t,a].filter(r=>r!=null).join(":")}}function hc(i){if(i){let[e,t,a]=i.split(":");return{id:e,width:t,height:a}}}function ll(i){return i==null?void 0:i.map(pc).join(" ")}function dl(i){return i==null?void 0:i.split(/\s+/).map(bc)}function pc(i){if(i){let{id:e,kind:t,language:a,label:r}=i;return[e,t,a,r].filter(n=>n!=null).join(":")}}function bc(i){if(i){let[e,t,a,r]=i.split(":");return{id:e,kind:t,language:a,label:r}}}function ya(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 ul(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function cl(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Ta(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}var Ia=i=>new Promise(e=>setTimeout(e,i));var ml=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],Ec=(i,e)=>{let t=i===1?ml[e].singular:ml[e].plural;return`${i} ${t}`},yt=i=>{if(!cl(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((d,u)=>d&&Ec(d,u)).filter(d=>d).join(", ")}${t?" remaining":""}`};function Le(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),d=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=a="0"),n=n>0||d>0?n+":":"",r=((n||s>=10)&&r<10?"0"+r:r)+":",a=a<10?"0"+a:a,(t?"-":"")+n+r+a}var Yh=Object.freeze({length:0,start(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'start' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0},end(i){let e=i>>>0;if(e>=this.length)throw new DOMException(`Failed to execute 'end' on 'TimeRanges': The index provided (${e}) is greater than or equal to the maximum bound (${this.length}).`);return 0}});var ka=(i,e,t=".value")=>{let a=i.querySelector(t);a&&(a.textContent=e)},fc=(i,e)=>{let t=`slot[name="${e}"]`,a=i.shadowRoot.querySelector(t);return a?a.children:[]},Sa=(i,e)=>fc(i,e)[0],it=(i,e)=>!i||!e?!1:i.contains(e)?!0:it(i,e.getRootNode().host),at=(i,e)=>{if(!i)return null;let t=i.closest(e);return t||at(i.getRootNode().host,e)};function Nn(i=document){var e;let t=i==null?void 0:i.activeElement;return t?(e=Nn(t.shadowRoot))!=null?e:t:null}function hl(i){var e;let t=(e=i==null?void 0:i.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function pl(i,e=3){if(i.checkVisibility)return i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});let t=i;for(;t&&e>0;){let a=getComputedStyle(t);if(a.opacity==="0"||a.visibility==="hidden"||a.display==="none")return!1;t=t.parentElement,e--}return!0}function bl(i,e,t,a){let r=On(t,a),n=On(t,{x:i,y:e}),s=On(a,{x:i,y:e});return n>r||s>r?n>s?1:0:n/r}function On(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function N(i,e){let t=gc(i,a=>a===e);return t||Pn(i,e)}function gc(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(e(n.selectorText))return n}}function Pn(i,e){var t,a;let r=(t=i.querySelectorAll("style"))!=null?t:[],n=r==null?void 0:r[r.length-1];return n!=null&&n.sheet?(n==null||n.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(a=n.sheet.cssRules)==null?void 0:a[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function R(i,e,t=Number.NaN){let a=i.getAttribute(e);return a!=null?+a:t}function O(i,e,t){let a=+t;if(t==null||Number.isNaN(a)){i.hasAttribute(e)&&i.removeAttribute(e);return}R(i,e,void 0)!==a&&i.setAttribute(e,`${a}`)}function w(i,e){return i.hasAttribute(e)}function M(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}w(i,e)!=t&&i.toggleAttribute(e,t)}function L(i,e,t=null){var a;return(a=i.getAttribute(e))!=null?a:t}function C(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}let a=`${t}`;L(i,e,void 0)!==a&&i.setAttribute(e,a)}var Ca=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}},Un=class{observe(){}unobserve(){}disconnect(){}},El={createElement:function(){return new Ma.HTMLElement},createElementNS:function(){return new Ma.HTMLElement},addEventListener(){},removeEventListener(){}},Ma={ResizeObserver:Un,document:El,HTMLElement:class extends Ca{},DocumentFragment:class extends Ca{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}}},vl=typeof window=="undefined"||typeof window.customElements=="undefined",fl=Object.keys(Ma).every(i=>i in globalThis),l=vl&&!fl?Ma:globalThis,c=vl&&!fl?El:globalThis.document;var Ac=Object.defineProperty,_c=(i,e,t)=>e in i?Ac(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,yc=(i,e,t)=>(_c(i,typeof e!="symbol"?e+"":e,t),t),gl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},he=(i,e,t)=>(gl(i,e,"read from private field"),t?t.call(i):e.get(i)),La=(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)},Ra=(i,e,t,a)=>(gl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Re,wa,qt,xa,Al=c.createElement("template");Al.innerHTML=`
2
2
  <style>
3
3
  :host {
4
4
  font: var(--media-font,
@@ -47,10 +47,10 @@
47
47
  min-width: 100%;
48
48
  }
49
49
  </style>
50
- `;var w=class extends l.HTMLElement{constructor(e={}){if(super(),Ta(this,Ce,void 0),dc(this,"preventClick",!1),Ta(this,ka,a=>{this.preventClick||this.handleClick(a)}),Ta(this,Gt,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",me(this,Gt));return}this.preventClick||this.handleClick(a)}),Ta(this,Sa,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",me(this,Gt));return}this.addEventListener("keyup",me(this,Gt),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let a=ml.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(a)}let{style:t}=N(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",me(this,ka)),this.addEventListener("keydown",me(this,Sa)),this.tabIndex=0}disable(){this.removeEventListener("click",me(this,ka)),this.removeEventListener("keydown",me(this,Sa)),this.removeEventListener("keyup",me(this,Gt)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=me(this,Ce))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ia(this,Ce,null)),a&&this.isConnected&&(Ia(this,Ce,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=me(this,Ce))==null?void 0:d.associateElement)==null||u.call(d,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(A.MEDIA_CONTROLLER);r&&(Ia(this,Ce,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=me(this,Ce))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=me(this,Ce))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ia(this,Ce,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};Ce=new WeakMap;ka=new WeakMap;Gt=new WeakMap;Sa=new WeakMap;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",w);var hl=`<svg aria-hidden="true" viewBox="0 0 26 24">
50
+ `;var x=class extends l.HTMLElement{constructor(e={}){if(super(),La(this,Re,void 0),yc(this,"preventClick",!1),La(this,wa,t=>{this.preventClick||this.handleClick(t)}),La(this,qt,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",he(this,qt));return}this.preventClick||this.handleClick(t)}),La(this,xa,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",he(this,qt));return}this.addEventListener("keyup",he(this,qt),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});let t=Al.content.cloneNode(!0);this.nativeEl=t;let a=e.slotTemplate;a||(a=c.createElement("template"),a.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(a.content.cloneNode(!0)),this.shadowRoot.appendChild(t)}}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",he(this,wa)),this.addEventListener("keydown",he(this,xa)),this.tabIndex=0}disable(){this.removeEventListener("click",he(this,wa)),this.removeEventListener("keydown",he(this,xa)),this.removeEventListener("keyup",he(this,qt)),this.tabIndex=-1}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=he(this,Re))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ra(this,Re,null)),a&&this.isConnected&&(Ra(this,Re,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=he(this,Re))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");let n=this.getAttribute(A.MEDIA_CONTROLLER);n&&(Ra(this,Re,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=he(this,Re))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=he(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ra(this,Re,null)}get keysUsed(){return["Enter"," "]}handleClick(e){}};Re=new WeakMap;wa=new WeakMap;qt=new WeakMap;xa=new WeakMap;l.customElements.get("media-chrome-button")||l.customElements.define("media-chrome-button",x);var _l=`<svg aria-hidden="true" viewBox="0 0 26 24">
51
51
  <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"/>
52
52
  </svg>
53
- `,bl=c.createElement("template");bl.innerHTML=`
53
+ `,Tl=c.createElement("template");Tl.innerHTML=`
54
54
  <style>
55
55
  :host([${o.MEDIA_IS_AIRPLAYING}]) slot:not([name=exit]):not([name=icon]) {
56
56
  display: none !important;
@@ -63,10 +63,10 @@
63
63
  </style>
64
64
 
65
65
  <slot name="icon">
66
- <slot name="enter">${hl}</slot>
67
- <slot name="exit">${hl}</slot>
66
+ <slot name="enter">${_l}</slot>
67
+ <slot name="exit">${_l}</slot>
68
68
  </slot>
69
- `;var pl=i=>{let e=i.mediaIsAirplaying?D.EXIT_AIRPLAY():D.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},wn=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:bl,...e})}connectedCallback(){super.connectedCallback(),pl(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_AIRPLAYING&&pl(this)}get mediaIsAirplaying(){return L(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){C(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return x(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){R(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(f.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",wn);var uc='<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>',cc='<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>',fl=c.createElement("template");fl.innerHTML=`
69
+ `;var yl=i=>{let e=i.mediaIsAirplaying?D.EXIT_AIRPLAY():D.ENTER_AIRPLAY();i.setAttribute("aria-label",e)},Bn=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_AIRPLAYING,o.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Tl,...e})}connectedCallback(){super.connectedCallback(),yl(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_AIRPLAYING&&yl(this)}get mediaIsAirplaying(){return w(this,o.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){M(this,o.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return L(this,o.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){C(this,o.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){let e=new l.CustomEvent(v.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}};l.customElements.get("media-airplay-button")||l.customElements.define("media-airplay-button",Bn);var Tc='<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>',Ic='<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>',kl=c.createElement("template");kl.innerHTML=`
70
70
  <style>
71
71
  :host([${o.MEDIA_IS_CASTING}]) slot:not([name=exit]):not([name=icon]) {
72
72
  display: none !important;
@@ -79,17 +79,17 @@
79
79
  </style>
80
80
 
81
81
  <slot name="icon">
82
- <slot name="enter">${uc}</slot>
83
- <slot name="exit">${cc}</slot>
82
+ <slot name="enter">${Tc}</slot>
83
+ <slot name="exit">${Ic}</slot>
84
84
  </slot>
85
- `;var El=i=>{let e=i.mediaIsCasting?D.EXIT_CAST():D.ENTER_CAST();i.setAttribute("aria-label",e)},xn=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fl,...e})}connectedCallback(){super.connectedCallback(),El(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&El(this)}get mediaIsCasting(){return L(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){C(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return x(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){R(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?f.MEDIA_EXIT_CAST_REQUEST:f.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",xn);var vl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},at=(i,e,t)=>(vl(i,e,"read from private field"),t?t.call(i):e.get(i)),mc=(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)},Ca=(i,e,t,a)=>(vl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),te,gl=c.createElement("template");gl.innerHTML=`
85
+ `;var Il=i=>{let e=i.mediaIsCasting?D.EXIT_CAST():D.ENTER_CAST();i.setAttribute("aria-label",e)},Hn=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_CASTING,o.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:kl,...e})}connectedCallback(){super.connectedCallback(),Il(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_IS_CASTING&&Il(this)}get mediaIsCasting(){return w(this,o.MEDIA_IS_CASTING)}set mediaIsCasting(e){M(this,o.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return L(this,o.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){C(this,o.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){let e=this.mediaIsCasting?v.MEDIA_EXIT_CAST_REQUEST:v.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-cast-button")||l.customElements.define("media-cast-button",Hn);var Sl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rt=(i,e,t)=>(Sl(i,e,"read from private field"),t?t.call(i):e.get(i)),kc=(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)=>(Sl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ne,Cl=c.createElement("template");Cl.innerHTML=`
86
86
  <style>
87
87
  :host {
88
88
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
89
89
  box-sizing: border-box;
90
90
  }
91
91
  </style>
92
- `;var Dn=class extends l.HTMLElement{constructor(e={}){if(super(),mc(this,te,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=gl.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=at(this,te))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ca(this,te,null)),a&&this.isConnected&&(Ca(this,te,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=at(this,te))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Ca(this,te,hc(this)),this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=at(this,te))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=at(this,te))==null||a.addEventListener("pointerdown",this),(r=at(this,te))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=at(this,te))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=at(this,te))==null||a.removeEventListener("pointerdown",this),(r=at(this,te))==null||r.removeEventListener("click",this),Ca(this,te,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:d,top:u,width:h,height:m}=this.getBoundingClientRect(),b=n-d,E=s-u;if(b<0||E<0||b>h||E>m||h===0&&m===0)return;let{pointerType:I=this._pointerType}=e;if(this._pointerType=void 0,I===Sn.TOUCH){this.handleTap(e);return}else if(I===Sn.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};te=new WeakMap;function hc(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):it(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Dn);var Al=new WeakMap,On=i=>{let e=Al.get(i);return e||Al.set(i,e=new Set),e},_l=new l.ResizeObserver(i=>{for(let e of i)for(let t of On(e.target))t(e)});function Ci(i,e){On(i).add(e),_l.observe(i)}function Nn(i,e){let t=On(i);t.delete(e),t.size||_l.unobserve(i)}var pc=Object.defineProperty,bc=(i,e,t)=>e in i?pc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ec=(i,e,t)=>(bc(i,typeof e!="symbol"?e+"":e,t),t),Vn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Zt=(i,e,t)=>(Vn(i,e,"read from private field"),t?t.call(i):e.get(i)),yt=(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)},Un=(i,e,t,a)=>(Vn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ve=(i,e,t)=>(Vn(i,e,"access private method"),t),Ma,Ke,Pn,yl,Bn,Tl,Mi,Ra,wa,Hn,qt,Li,T={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},Il=c.createElement("template");Il.innerHTML=`
92
+ `;var Vn=class extends l.HTMLElement{constructor(e={}){if(super(),kc(this,ne,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Cl.content.cloneNode(!0);this.nativeEl=a;let r=e.slotTemplate;r||(r=c.createElement("template"),r.innerHTML=`<slot>${e.defaultContent||""}</slot>`),this.nativeEl.appendChild(r.content.cloneNode(!0)),t.appendChild(a)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=rt(this,ne))==null?void 0:r.unassociateElement)==null||n.call(r,this),Da(this,ne,null)),a&&this.isConnected&&(Da(this,ne,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=rt(this,ne))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),Da(this,ne,Sc(this)),this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=rt(this,ne))==null?void 0:e.associateElement)==null||t.call(e,this)),(a=rt(this,ne))==null||a.addEventListener("pointerdown",this),(r=rt(this,ne))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,t,a,r;this.getAttribute(A.MEDIA_CONTROLLER)&&((t=(e=rt(this,ne))==null?void 0:e.unassociateElement)==null||t.call(e,this)),(a=rt(this,ne))==null||a.removeEventListener("pointerdown",this),(r=rt(this,ne))==null||r.removeEventListener("click",this),Da(this,ne,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:d,top:u,width:m,height:h}=this.getBoundingClientRect(),p=n-d,b=s-u;if(p<0||b<0||p>m||b>h||m===0&&h===0)return;let{pointerType:_=this._pointerType}=e;if(this._pointerType=void 0,_===Dn.TOUCH){this.handleTap(e);return}else if(_===Dn.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){let t=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(t,{composed:!0,bubbles:!0}))}};ne=new WeakMap;function Sc(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):at(i,"media-controller")}l.customElements.get("media-gesture-receiver")||l.customElements.define("media-gesture-receiver",Vn);var Ml=new WeakMap,Wn=i=>{let e=Ml.get(i);return e||Ml.set(i,e=new Set),e},Ll=new l.ResizeObserver(i=>{for(let e of i)for(let t of Wn(e.target))t(e)});function Tt(i,e){Wn(i).add(e),Ll.observe(i)}function Mi(i,e){let t=Wn(i);t.delete(e),t.size||Ll.unobserve(i)}var Cc=Object.defineProperty,Mc=(i,e,t)=>e in i?Cc(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Lc=(i,e,t)=>(Mc(i,typeof e!="symbol"?e+"":e,t),t),Gn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fn=(i,e,t)=>(Gn(i,e,"read from private field"),t?t.call(i):e.get(i)),It=(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)},$n=(i,e,t,a)=>(Gn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ge=(i,e,t)=>(Gn(i,e,"access private method"),t),Oa,Zt,Kn,Rl,Yn,wl,Li,Pa,Ua,qn,Qt,Ri,k={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},xl=c.createElement("template");xl.innerHTML=`
93
93
  <style>
94
94
 
95
95
  :host([${o.MEDIA_IS_FULLSCREEN}]) ::slotted([slot=media]) {
@@ -104,7 +104,7 @@
104
104
  background-color: var(--media-background-color, #000);
105
105
  }
106
106
 
107
- :host(:not([${T.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
107
+ :host(:not([${k.AUDIO}])) [part~=layer]:not([part~=media-layer]) {
108
108
  position: absolute;
109
109
  top: 0;
110
110
  left: 0;
@@ -122,34 +122,34 @@
122
122
  }
123
123
 
124
124
 
125
- :host([${T.AUDIO}]) slot[name=media] {
125
+ :host([${k.AUDIO}]) slot[name=media] {
126
126
  display: var(--media-slot-display, none);
127
127
  }
128
128
 
129
129
 
130
- :host([${T.AUDIO}]) [part~=layer][part~=gesture-layer] {
130
+ :host([${k.AUDIO}]) [part~=layer][part~=gesture-layer] {
131
131
  height: 0;
132
132
  display: block;
133
133
  }
134
134
 
135
135
 
136
- :host(:not([${T.AUDIO}])[${T.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
137
- :host(:not([${T.AUDIO}])[${T.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
136
+ :host(:not([${k.AUDIO}])[${k.GESTURES_DISABLED}]) ::slotted([slot=gestures-chrome]),
137
+ :host(:not([${k.AUDIO}])[${k.GESTURES_DISABLED}]) media-gesture-receiver[slot=gestures-chrome] {
138
138
  display: none;
139
139
  }
140
140
 
141
141
 
142
- ::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator)) {
142
+ ::slotted(:not([slot=media]):not([slot=poster]):not(media-loading-indicator):not([hidden])) {
143
143
  pointer-events: auto;
144
144
  }
145
145
 
146
- :host(:not([${T.AUDIO}])) *[part~=layer][part~=centered-layer] {
146
+ :host(:not([${k.AUDIO}])) *[part~=layer][part~=centered-layer] {
147
147
  align-items: center;
148
148
  justify-content: center;
149
149
  }
150
150
 
151
- :host(:not([${T.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
152
- :host(:not([${T.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
151
+ :host(:not([${k.AUDIO}])) ::slotted(media-gesture-receiver[slot=gestures-chrome]),
152
+ :host(:not([${k.AUDIO}])) media-gesture-receiver[slot=gestures-chrome] {
153
153
  align-self: stretch;
154
154
  flex-grow: 1;
155
155
  }
@@ -169,7 +169,7 @@
169
169
  }
170
170
 
171
171
 
172
- :host(:not([${T.AUDIO}])) .spacer {
172
+ :host(:not([${k.AUDIO}])) .spacer {
173
173
  flex-grow: 1;
174
174
  }
175
175
 
@@ -181,18 +181,18 @@
181
181
  }
182
182
 
183
183
 
184
- ::slotted(:not([slot=media]):not([${T.NO_AUTOHIDE}]):not([hidden])) {
184
+ ::slotted(:not([slot=media]):not([slot=poster]):not([${k.NO_AUTOHIDE}]):not([hidden])) {
185
185
  opacity: 1;
186
186
  transition: opacity 0.25s;
187
187
  }
188
188
 
189
189
 
190
- :host([${T.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${T.AUDIO}])) ::slotted(:not([slot=media]):not([${T.NO_AUTOHIDE}])) {
190
+ :host([${k.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_AIRPLAYING}]):not([${o.MEDIA_IS_CASTING}]):not([${k.AUDIO}])) ::slotted(:not([slot=media]):not([slot=poster]):not([${k.NO_AUTOHIDE}])) {
191
191
  opacity: 0;
192
192
  transition: opacity 1s;
193
193
  }
194
194
 
195
- :host([${T.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${T.AUDIO}])) ::slotted([slot=media]) {
195
+ :host([${k.USER_INACTIVE}]:not([${o.MEDIA_PAUSED}]):not([${o.MEDIA_IS_CASTING}]):not([${k.AUDIO}])) ::slotted([slot=media]) {
196
196
  cursor: none;
197
197
  }
198
198
 
@@ -201,13 +201,17 @@
201
201
  }
202
202
 
203
203
 
204
- :host(:not([${T.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
204
+ :host(:not([${k.AUDIO}])[${o.MEDIA_HAS_PLAYED}]) slot[name=poster] {
205
205
  display: none;
206
206
  }
207
207
 
208
- ::slotted([role=menu]) {
208
+ ::slotted([role="menu"]) {
209
209
  align-self: end;
210
210
  }
211
+
212
+ ::slotted([role="dialog"]) {
213
+ align-self: center;
214
+ }
211
215
  </style>
212
216
 
213
217
  <slot name="media" part="layer media-layer"></slot>
@@ -222,7 +226,7 @@
222
226
 
223
227
  <slot part="bottom chrome"></slot>
224
228
  </span>
225
- `;var fc=Object.values(o),vc="sm:384 md:576 lg:768 xl:960";function gc(i){Ac(i.target,i.contentRect.width)}function Ac(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(T.BREAKPOINTS))!=null?t:vc,r=_c(a),n=yc(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),s=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(Fe.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function _c(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function yc(i,e){return Object.keys(i).filter(t=>e>=i[t])}var La=class extends l.HTMLElement{constructor(){super(),yt(this,Pn),yt(this,Bn),yt(this,Mi),yt(this,wa),yt(this,qt),yt(this,Ma,0),yt(this,Ke,void 0),Ec(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Il.content.cloneNode(!0)));let e=s=>{let d=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(h=>{if(h.slot=="media"&&u.target==this){let m=u.previousSibling&&u.previousSibling.previousElementSibling;if(!m||!d)this.mediaUnsetCallback(h);else{let b=m.slot!=="media";for(;(m=m.previousSibling)!==null;)m.slot=="media"&&(b=!1);b&&this.mediaUnsetCallback(h)}}}),d&&u.addedNodes.forEach(h=>{h===d&&d!==Zt(this,Ke)&&this.handleMediaUpdated(d).then(m=>this.mediaSetCallback(m))}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Ci(this,s=>{a||(setTimeout(()=>{gc(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(Fe.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){Zt(this,Ke)&&this.mediaUnsetCallback(Zt(this,Ke));return}this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(d=>this.mediaSetCallback(d))})}static get observedAttributes(){return[T.AUTOHIDE,T.GESTURES_DISABLED].concat(fc).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==T.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}async handleMediaUpdated(e){Un(this,Ke,e);let t=a=>(Un(this,Ke,null),console.error('Media Chrome: Media element set with slot="media" does not appear to be compatible.',a),Promise.reject(a));return e?(e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),e):t(e)}connectedCallback(){var e;let a=this.getAttribute(T.AUDIO)!=null?q.AUDIO_PLAYER():q.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.media&&this.media!==Zt(this,Ke)&&this.handleMediaUpdated(this.media).then(r=>this.mediaSetCallback(r)),this.setAttribute(T.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){}handleEvent(e){switch(e.type){case"pointerdown":Un(this,Ma,e.timeStamp);break;case"pointermove":ve(this,Pn,yl).call(this,e);break;case"pointerup":ve(this,Bn,Tl).call(this,e);break;case"mouseleave":ve(this,Mi,Ra).call(this);break;case"mouseup":this.removeAttribute(T.KEYBOARD_CONTROL);break;case"keyup":ve(this,qt,Li).call(this),this.setAttribute(T.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Ma=new WeakMap;Ke=new WeakMap;Pn=new WeakSet;yl=function(i){i.pointerType!=="mouse"&&i.timeStamp-Zt(this,Ma)<250||(ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&ve(this,qt,Li).call(this))};Bn=new WeakSet;Tl=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(T.USER_INACTIVE);[this,this.media].includes(i.target)&&e?ve(this,Mi,Ra).call(this):ve(this,qt,Li).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&ve(this,qt,Li).call(this)};Mi=new WeakSet;Ra=function(){if(this.autohide<0||this.hasAttribute(T.USER_INACTIVE))return;this.setAttribute(T.USER_INACTIVE,"");let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};wa=new WeakSet;Hn=function(){if(!this.hasAttribute(T.USER_INACTIVE))return;this.removeAttribute(T.USER_INACTIVE);let i=new l.CustomEvent(Fe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};qt=new WeakSet;Li=function(){ve(this,wa,Hn).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{ve(this,Mi,Ra).call(this)},this.autohide*1e3))};var kl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},K=(i,e,t)=>(kl(i,e,"read from private field"),t?t.call(i):e.get(i)),Ri=(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)},xa=(i,e,t,a)=>(kl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Qt,zt,Da,Tt,Ye,rt,nt=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){Ri(this,Ye),Ri(this,Qt,void 0),Ri(this,zt,void 0),Ri(this,Da,void 0),Ri(this,Tt,new Set),xa(this,Qt,e),xa(this,zt,t),xa(this,Da,new Set(a))}[Symbol.iterator](){return K(this,Ye,rt).values()}get length(){return K(this,Ye,rt).size}get value(){var e;return(e=[...K(this,Ye,rt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(xa(this,Tt,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...K(this,Ye,rt)][e]}values(){return K(this,Ye,rt).values()}forEach(e){K(this,Ye,rt).forEach(e)}add(...e){var t,a;e.forEach(r=>K(this,Tt).add(r)),!(this.value===""&&!((t=K(this,Qt))!=null&&t.hasAttribute(`${K(this,zt)}`)))&&((a=K(this,Qt))==null||a.setAttribute(`${K(this,zt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>K(this,Tt).delete(a)),(t=K(this,Qt))==null||t.setAttribute(`${K(this,zt)}`,`${this.value}`)}contains(e){return K(this,Ye,rt).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){return this.remove(e),this.add(t),e===t}};Qt=new WeakMap;zt=new WeakMap;Da=new WeakMap;Tt=new WeakMap;Ye=new WeakSet;rt=function(){return K(this,Tt).size?K(this,Tt):K(this,Da)};var Tc=(i="")=>i.split(/\s+/),Sl=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},wi=(i="",e={})=>Tc(i).map(t=>{let a=Sl(t);return{...e,...a}}),$n=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Sl(e):e):typeof i=="string"?wi(i):[i],Oa=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,It=(i=[])=>Array.prototype.map.call(i,Oa).join(" "),Ic=(i,e)=>t=>t[i]===e,Cl=i=>{let e=Object.entries(i).map(([t,a])=>Ic(t,a));return t=>e.every(a=>a(t))},Xt=(i,e=[],t=[])=>{let a=$n(t).map(Cl),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},Na=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Cl(e);return Array.from(i.textTracks).filter(t)},Ml=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);var B={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};c.fullscreenElement===void 0&&(B.enter="webkitRequestFullScreen",B.exit=c.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",B.rootEvents=["webkitfullscreenchange"],B.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],B.element="webkitFullscreenElement",B.error="webkitfullscreenerror",B.enabled="webkitFullscreenEnabled");var Ua,Wn=()=>{var i,e;return Ua||(Ua=(e=(i=c)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Ua)},Ll=async(i=Wn())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await ga(0),i.volume!==e},kc=(i=Wn())=>typeof(i==null?void 0:i.requestPictureInPicture)=="function",Sc=(i=Wn())=>{let e=c[B.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},Fn=Sc(),Rl=kc(),wl=!!l.WebKitPlaybackTargetAvailabilityEvent,xl=!!l.chrome;var Ba,Dl=Ll().then(i=>(Ba=i,Ba)),Cc=Object.values(fe),Pa=i=>Na(i.media,e=>[et.SUBTITLES,et.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),Ol=i=>Na(i.media,e=>e.mode===At.SHOWING&&[et.SUBTITLES,et.CAPTIONS].includes(e.kind)),ie={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","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:["playing","pause","timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return i.hasAttribute("defaultduration")&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?+i.getAttribute("defaultduration"):!e||!Number.isFinite(e.duration)?Number.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))]},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,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,s)=>[Number(r.start(s)).toFixed(3),Number(r.end(s)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(Cc.includes(t)){if(t===fe.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[fe.LIVE,fe.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return fe.LIVE;if(Number.isFinite(a))return fe.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([fe.LIVE,fe.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=ie.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===fe.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(!(ie.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){var t,a;let r=i.media;if(r&&c[B.element]===void 0&&"webkitDisplayingFullscreen"in r)return r.webkitDisplayingFullscreen&&r.webkitPresentationMode==="fullscreen";let n;return e?n=c[B.element]?e.target:null:n=(a=(t=nl(i))==null?void 0:t.fullscreenElement)!=null?a:c[B.element],tt(i.fullscreenElement,n)},rootEvents:B.rootEvents,mediaEvents:B.mediaEvents},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:c.pictureInPictureElement;return tt(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_AIRPLAYING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["playing","connect","connecting","disconnect"]},MEDIA_IS_CASTING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["connect","connecting","disconnect"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){if(!wl)return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_CAST_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){var t;let{media:a}=i;if(!xl||!((t=a==null?void 0:a.remote)!=null&&t.state))return oe.UNSUPPORTED;if(!(e==null||e===!0))return oe.UNAVAILABLE},mediaSetCallback(i,e){var t;(t=i.remote)==null||t.watchAvailability(a=>e({availability:a}))},mediaUnsetCallback(i){var e;(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return Fn?void 0:oe.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Rl?void 0:oe.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return oe.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_AUDIO_TRACK_UNAVAILABLE:{get:function(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return oe.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return oe.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(Ba!==void 0&&!Ba)return oe.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return oe.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return Pa(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i,e){var t;return i.hasAttribute("defaultsubtitles")&&["addtrack","removetrack"].includes(e==null?void 0:e.type)&&[et.CAPTIONS,et.SUBTITLES].includes((t=e==null?void 0:e.track)==null?void 0:t.kind)&&xi.MEDIA_TOGGLE_SUBTITLES_REQUEST(void 0,{detail:!0},i),Ol(i).map(({kind:a,label:r,language:n})=>({kind:a,label:r,language:n}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},MEDIA_AUDIO_TRACK_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_AUDIO_TRACK_ENABLED:{get:function(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]}},xi={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=ie.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==fe.LIVE&&n&&xi.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.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{l.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!Fn){console.warn("MediaChrome: Fullscreen support is unavailable; not entering fullscreen");return}c.pictureInPictureElement&&c.exitPictureInPicture(),t[B.enter]?t.fullscreenElement[B.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{c[B.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!c.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}c[B.element]&&c[B.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:()=>{c.pictureInPictureElement&&c.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:async i=>{var e;if(((e=i.remote)==null?void 0:e.state)==="disconnected"){if(c[B.element]&&c[B.exit](),!i.remote.prompt){console.warn("MediaChrome: Casting is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_EXIT_CAST_REQUEST:i=>{var e;((e=i.remote)==null?void 0:e.state)==="connected"&&i.remote.prompt()},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]=Na(i,{kind:et.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,m=>m.startTime>=r);if(!s)return;let d=/'^(?:[a-z]+:)?\/\//i.test(s.text)||(a=i.querySelector('track[label="thumbnails"]'))==null?void 0:a.src,u=new URL(s.text,d),h=new URLSearchParams(u.hash).get("#xywh");t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,u.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,h.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{var a;let r=Pa(t),{detail:n=[]}=e,s=$n(n),d=(a=s[0])==null?void 0:a.language;d&&!(t!=null&&t.hasAttribute("nosubtitleslangpref"))&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Xt(At.SHOWING,r,s)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=Pa(t),{detail:r=[]}=e;Xt(At.DISABLED,a,r)},MEDIA_TOGGLE_SUBTITLES_REQUEST:(i,e,t)=>{let{detail:a}=e!=null?e:{},r=Pa(t),n=Ol(t),s=!!n.length;if(r.length){if(a===!1||s&&a!==!0)Xt(At.DISABLED,r,n);else if(a===!0||!s&&a!==!1){let d=r[0];if(!(t!=null&&t.hasAttribute("nosubtitleslangpref"))){let b=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),E=b?[b,...l.navigator.languages]:l.navigator.languages,I=r.filter(H=>E.some(k=>H.language.toLowerCase().startsWith(k.split("-")[0]))).sort((H,k)=>{let $=E.findIndex(ee=>H.language.toLowerCase().startsWith(ee.split("-")[0])),Z=E.findIndex(ee=>k.language.toLowerCase().startsWith(ee.split("-")[0]));return $-Z});I[0]&&(d=I[0])}let{language:u,label:h,kind:m}=d;Xt(At.DISABLED,r,n),Xt(At.SHOWING,r,[{language:u,label:h,kind:m}])}}},MEDIA_AIRPLAY_REQUEST:async i=>{if(i!=null&&i.remote){if(!i.remote.prompt){console.warn("MediaChrome: AirPlay is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaChrome: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaChrome: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaChrome: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},MEDIA_AUDIO_TRACK_REQUEST:(i,e)=>{if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let t=e.detail;for(let a of i.audioTracks)a.enabled=t==a.id}};var Zn=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Me=(i,e,t)=>(Zn(i,e,"read from private field"),t?t.call(i):e.get(i)),Di=(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)},Kn=(i,e,t,a)=>(Zn(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),jt=(i,e,t)=>(Zn(i,e,"access private method"),t),ot,Oi,Jt,ei,Ni,Va,Yn,Hl=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],Mc=10,Nl=0,X={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},Ha=class extends La{constructor(){super(),Di(this,ei),Di(this,Va),Di(this,ot,new nt(this,X.HOTKEYS)),Di(this,Oi,void 0),Di(this,Jt,void 0),ie.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Dl.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,ie.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(xi).forEach(e=>{let t=`_handle${fa(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("MediaController: No media available.");return}xi[e](this.media,a,this)},this.addEventListener(f[e],this[t])}),this._mediaStatePropagators={},Object.keys(ie).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(gt[e],ie[e].get(this,t))}})}static get observedAttributes(){return super.observedAttributes.concat(X.NO_HOTKEYS,X.HOTKEYS,X.DEFAULT_STREAM_TYPE,X.DEFAULT_SUBTITLES,X.DEFAULT_DURATION)}get fullscreenElement(){var e;return(e=Me(this,Oi))!=null?e:this}set fullscreenElement(e){this.hasAttribute(X.FULLSCREEN_ELEMENT)&&this.removeAttribute(X.FULLSCREEN_ELEMENT),Kn(this,Oi,e)}attributeChangedCallback(e,t,a){var r;if(super.attributeChangedCallback(e,t,a),e===X.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(X.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===X.HOTKEYS)Me(this,ot).value=a;else if(e===X.DEFAULT_SUBTITLES&&a!==t&&a==="")this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!0}));else if(e===X.DEFAULT_STREAM_TYPE)this.propagateMediaState(gt.MEDIA_STREAM_TYPE);else if(e===X.FULLSCREEN_ELEMENT){let n=a?(r=Me(this,Jt))==null?void 0:r.getElementById(a):void 0;Kn(this,Oi,n)}}connectedCallback(){super.connectedCallback(),Kn(this,Jt,this.getRootNode()),this.enableHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this.disableHotkeys(),this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!1}))}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(ie).forEach(t=>{let{mediaSetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];a&&(a(e,m),m()),r==null||r.forEach(b=>{e.addEventListener(b,m),m()}),n==null||n.forEach(b=>{var E;(E=Me(this,Jt))==null||E.addEventListener(b,m),m()}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.addEventListener(b,m),m()}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.addEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.addEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.addEventListener(b,m),m()})}),!this.hasAttribute("novolumepref"))try{let t=l.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(ie).forEach(t=>{let{mediaUnsetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:h}=ie[t],m=this._mediaStatePropagators[t];r==null||r.forEach(b=>{e.removeEventListener(b,m)}),n==null||n.forEach(b=>{var E;(E=Me(this,Jt))==null||E.removeEventListener(b,m)}),s==null||s.forEach(b=>{var E;(E=e.textTracks)==null||E.removeEventListener(b,m)}),d==null||d.forEach(b=>{var E;(E=e.videoRenditions)==null||E.removeEventListener(b,m),m()}),u==null||u.forEach(b=>{var E;(E=e.audioTracks)==null||E.removeEventListener(b,m),m()}),h==null||h.forEach(b=>{var E;(E=e.remote)==null||E.removeEventListener(b,m),m()}),a&&(a(e,m),m())}),this.propagateMediaState(gt.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=Vl(this.mediaStateReceivers,e);if(Bl(this.mediaStateReceivers,e,t),a===Vl(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new l.CustomEvent(Xs[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}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=Oc(e,a,r);Object.keys(f).forEach(s=>{e.addEventListener(f[s],this[`_handle${fa(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(f).forEach(r=>{e.removeEventListener(f[r],this[`_handle${fa(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(ie).forEach(r=>{let n=ie[r];Bl([e],gt[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",jt(this,Va,Yn))}disableHotkeys(){this.removeEventListener("keydown",jt(this,Va,Yn)),this.removeEventListener("keyup",jt(this,ei,Ni))}get hotkeys(){return Me(this,ot)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(X.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(I=>I==="Space"?" ":I).filter(Boolean).includes(e.key))return;let d,u,h,m,b,E=Mc;if(!Me(this,ot).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&Me(this,ot).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h-E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),h=u&&!Number.isNaN(+u)?+u:Nl,m=Math.max(h+E,0),b=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:m}),this.dispatchEvent(b);break;default:break}}};ot=new WeakMap;Oi=new WeakMap;Jt=new WeakMap;ei=new WeakSet;Ni=function(i){let{key:e}=i;if(!Hl.includes(e)){this.removeEventListener("keyup",jt(this,ei,Ni));return}this.keyboardShortcutHandler(i)};Va=new WeakSet;Yn=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Hl.includes(a)){this.removeEventListener("keyup",jt(this,ei,Ni));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(Me(this,ot).contains(`no${a.toLowerCase()}`)||a===" "&&Me(this,ot).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",jt(this,ei,Ni),{once:!0})};var Lc=Object.values(o),Rc=Object.values(gt),qn=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>Lc.includes(d)):[]},wc=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Rc.some(a=>a in i)},Gn=i=>wc(i)||!!qn(i).length,Ul=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Pl={[o.MEDIA_SUBTITLES_LIST]:It,[o.MEDIA_SUBTITLES_SHOWING]:It,[o.MEDIA_SEEKABLE]:Ul,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Ul).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:Js,[o.MEDIA_AUDIO_TRACK_LIST]:el},xc=async(i,e,t)=>{var a,r;if(i.isConnected||await ga(0),typeof t=="boolean"||t==null)return C(i,e,t);if(typeof t=="number")return O(i,e,t);if(typeof t=="string")return R(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Pl[e])==null?void 0:a.call(Pl,t))!=null?r:t;return i.setAttribute(e,n)},Dc=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},kt=(i,e)=>{if(Dc(i))return;let t=(r,n)=>{var s,d;Gn(r)&&n(r);let{children:u=[]}=r!=null?r:{},h=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...h].forEach(b=>kt(b,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!Gn(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Bl=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=qn(a),n=e.toLowerCase();r.includes(n)&&xc(a,n,t)})},Vl=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=qn(t),r=e.toLowerCase();if(a.includes(r))return t.getAttribute(r)}},Oc=(i,e,t)=>{kt(i,e);let a=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;e(E)},r=m=>{var b;let E=(b=m==null?void 0:m.composedPath()[0])!=null?b:m.target;t(E)};i.addEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=m=>{m.forEach(b=>{let{addedNodes:E=[],removedNodes:I=[],type:H,target:k,attributeName:$}=b;H==="childList"?(Array.prototype.forEach.call(E,Z=>kt(Z,e)),Array.prototype.forEach.call(I,Z=>kt(Z,t))):H==="attributes"&&$===A.MEDIA_CHROME_ATTRIBUTES&&(Gn(k)?e(k):t(k))})},s=[],d=m=>{let b=m.target;b.name!=="media"&&(s.forEach(E=>kt(E,t)),s=[...b.assignedElements({flatten:!0})],s.forEach(E=>kt(E,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{kt(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(f.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(f.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Ha);var Qn=Ha;var io=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ge=(i,e,t)=>(io(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(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)},St=(i,e,t,a)=>(io(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Le=(i,e,t)=>(io(i,e,"access private method"),t),Re,qa,Ya,Ga,$a,Wa,Fa,zn,Ka,Xn,Za,ao,Jn,$l,jn,Wl,eo,Fl,to,Kl,Yl=c.createElement("template");Yl.innerHTML=`
229
+ `;var Rc=Object.values(o),wc="sm:384 md:576 lg:768 xl:960";function xc(i){Dc(i.target,i.contentRect.width)}function Dc(i,e){var t;if(!i.isConnected)return;let a=(t=i.getAttribute(k.BREAKPOINTS))!=null?t:wc,r=Oc(a),n=Nc(r,e),s=!1;if(Object.keys(r).forEach(d=>{if(n.includes(d)){i.hasAttribute(`breakpoint${d}`)||(i.setAttribute(`breakpoint${d}`,""),s=!0);return}i.hasAttribute(`breakpoint${d}`)&&(i.removeAttribute(`breakpoint${d}`),s=!0)}),s){let d=new CustomEvent(qe.BREAKPOINTS_CHANGE,{detail:n});i.dispatchEvent(d)}}function Oc(i){let e=i.split(/\s+/);return Object.fromEntries(e.map(t=>t.split(":")))}function Nc(i,e){return Object.keys(i).filter(t=>e>=i[t])}var Na=class extends l.HTMLElement{constructor(){super(),It(this,Kn),It(this,Yn),It(this,Li),It(this,Ua),It(this,Qt),It(this,Oa,0),It(this,Zt,void 0),Lc(this,"breakpointsComputed",!1),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(xl.content.cloneNode(!0)));let e=s=>{let d=this.media;for(let u of s)u.type==="childList"&&(u.removedNodes.forEach(m=>{if(m.slot=="media"&&u.target==this){let h=u.previousSibling&&u.previousSibling.previousElementSibling;if(!h||!d)this.mediaUnsetCallback(m);else{let p=h.slot!=="media";for(;(h=h.previousSibling)!==null;)h.slot=="media"&&(p=!1);p&&this.mediaUnsetCallback(m)}}}),d&&u.addedNodes.forEach(m=>{m===d&&this.handleMediaUpdated(d)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let a=!1;Tt(this,s=>{a||(setTimeout(()=>{xc(s),a=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(qe.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),a=!0)});let n=this.querySelector(":scope > slot[slot=media]");n&&n.addEventListener("slotchange",()=>{if(!n.assignedElements({flatten:!0}).length){Fn(this,Zt)&&this.mediaUnsetCallback(Fn(this,Zt));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[k.AUTOHIDE,k.GESTURES_DISABLED].concat(Rc).filter(e=>![o.MEDIA_RENDITION_LIST,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_CHAPTERS_CUES].includes(e))}attributeChangedCallback(e,t,a){e.toLowerCase()==k.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}async handleMediaUpdated(e){e&&($n(this,Zt,e),e.localName.includes("-")&&await l.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;let a=this.getAttribute(k.AUDIO)!=null?X.AUDIO_PLAYER():X.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",a),this.handleMediaUpdated(this.media),this.setAttribute(k.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=l.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=l.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){$n(this,Zt,null)}handleEvent(e){switch(e.type){case"pointerdown":$n(this,Oa,e.timeStamp);break;case"pointermove":ge(this,Kn,Rl).call(this,e);break;case"pointerup":ge(this,Yn,wl).call(this,e);break;case"mouseleave":ge(this,Li,Pa).call(this);break;case"mouseup":this.removeAttribute(k.KEYBOARD_CONTROL);break;case"keyup":ge(this,Qt,Ri).call(this),this.setAttribute(k.KEYBOARD_CONTROL,"");break}}set autohide(e){e=Number(e),this._autohide=isNaN(e)?0:e}get autohide(){return this._autohide===void 0?2:this._autohide}};Oa=new WeakMap;Zt=new WeakMap;Kn=new WeakSet;Rl=function(i){i.pointerType!=="mouse"&&i.timeStamp-Fn(this,Oa)<250||(ge(this,Ua,qn).call(this),clearTimeout(this._inactiveTimeout),[this,this.media].includes(i.target)&&ge(this,Qt,Ri).call(this))};Yn=new WeakSet;wl=function(i){if(i.pointerType==="touch"){let e=!this.hasAttribute(k.USER_INACTIVE);[this,this.media].includes(i.target)&&e?ge(this,Li,Pa).call(this):ge(this,Qt,Ri).call(this)}else i.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e==null?void 0:e.localName))&&ge(this,Qt,Ri).call(this)};Li=new WeakSet;Pa=function(){if(this.autohide<0||this.hasAttribute(k.USER_INACTIVE))return;this.setAttribute(k.USER_INACTIVE,"");let i=new l.CustomEvent(qe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(i)};Ua=new WeakSet;qn=function(){if(!this.hasAttribute(k.USER_INACTIVE))return;this.removeAttribute(k.USER_INACTIVE);let i=new l.CustomEvent(qe.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(i)};Qt=new WeakSet;Ri=function(){ge(this,Ua,qn).call(this),clearTimeout(this._inactiveTimeout),!(this.autohide<0)&&(this._inactiveTimeout=setTimeout(()=>{ge(this,Li,Pa).call(this)},this.autohide*1e3))};var Dl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Dl(i,e,"read from private field"),t?t.call(i):e.get(i)),wi=(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)},Ba=(i,e,t,a)=>(Dl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zt,Xt,Ha,kt,Ze,nt,ot=class{constructor(e,t,{defaultValue:a}={defaultValue:void 0}){wi(this,Ze),wi(this,zt,void 0),wi(this,Xt,void 0),wi(this,Ha,void 0),wi(this,kt,new Set),Ba(this,zt,e),Ba(this,Xt,t),Ba(this,Ha,new Set(a))}[Symbol.iterator](){return G(this,Ze,nt).values()}get length(){return G(this,Ze,nt).size}get value(){var e;return(e=[...G(this,Ze,nt)].join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(Ba(this,kt,new Set),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return[...G(this,Ze,nt)][e]}values(){return G(this,Ze,nt).values()}forEach(e){G(this,Ze,nt).forEach(e)}add(...e){var t,a;e.forEach(r=>G(this,kt).add(r)),!(this.value===""&&!((t=G(this,zt))!=null&&t.hasAttribute(`${G(this,Xt)}`)))&&((a=G(this,zt))==null||a.setAttribute(`${G(this,Xt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>G(this,kt).delete(a)),(t=G(this,zt))==null||t.setAttribute(`${G(this,Xt)}`,`${this.value}`)}contains(e){return G(this,Ze,nt).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){return this.remove(e),this.add(t),e===t}};zt=new WeakMap;Xt=new WeakMap;Ha=new WeakMap;kt=new WeakMap;Ze=new WeakSet;nt=function(){return G(this,kt).size?G(this,kt):G(this,Ha)};var Pc=(i="")=>i.split(/\s+/),Ol=(i="")=>{let[e,t,a]=i.split(":"),r=a?decodeURIComponent(a):void 0;return e=e==="cc"?"captions":"subtitles",{kind:e,language:t,label:r}},xi=(i="",e={})=>Pc(i).map(t=>{let a=Ol(t);return{...e,...a}}),Zn=i=>Array.isArray(i)?i.map(e=>typeof e=="string"?Ol(e):e):typeof i=="string"?xi(i):[i],Va=({kind:i,label:e,language:t}={kind:"subtitles"})=>e?`${i==="captions"?"cc":"sb"}:${t}:${encodeURIComponent(e)}`:t,St=(i=[])=>Array.prototype.map.call(i,Va).join(" "),Uc=(i,e)=>t=>t[i]===e,Nl=i=>{let e=Object.entries(i).map(([t,a])=>Uc(t,a));return t=>e.every(a=>a(t))},Jt=(i,e=[],t=[])=>{let a=Zn(t).map(Nl),r=n=>a.some(s=>s(n));Array.from(e).filter(r).forEach(n=>{n.mode=i})},jt=(i,e=()=>!0)=>{if(!(i!=null&&i.textTracks))return[];let t=typeof e=="function"?e:Nl(e);return Array.from(i.textTracks).filter(t)},Pl=i=>!!i.getAttribute(o.MEDIA_SUBTITLES_SHOWING);var W={enter:"requestFullscreen",exit:"exitFullscreen",rootEvents:["fullscreenchange"],mediaEvents:[],element:"fullscreenElement",error:"fullscreenerror",enabled:"fullscreenEnabled"};c.fullscreenElement===void 0&&(W.enter="webkitRequestFullScreen",W.exit=c.webkitExitFullscreen!=null?"webkitExitFullscreen":"webkitCancelFullScreen",W.rootEvents=["webkitfullscreenchange"],W.mediaEvents=["webkitbeginfullscreen","webkitendfullscreen"],W.element="webkitFullscreenElement",W.error="webkitfullscreenerror",W.enabled="webkitFullscreenEnabled");var Wa,Qn=()=>{var i,e;return Wa||(Wa=(e=(i=c)==null?void 0:i.createElement)==null?void 0:e.call(i,"video"),Wa)},Ul=async(i=Qn())=>{if(!i)return!1;let e=i.volume;return i.volume=e/2+.1,await Ia(0),i.volume!==e},Bc=/.*Version\/.*Safari\/.*/.test(l.navigator.userAgent),Hc=(i=Qn())=>l.matchMedia("(display-mode: standalone)").matches&&Bc?!1:typeof(i==null?void 0:i.requestPictureInPicture)=="function",Vc=(i=Qn())=>{let e=c[W.enabled];return!e&&i&&(e="webkitSupportsFullscreen"in i),e},zn=Vc(),Bl=Hc(),Hl=!!l.WebKitPlaybackTargetAvailabilityEvent,Vl=!!l.chrome;var Fa,Wl=Ul().then(i=>(Fa=i,Fa)),Wc=Object.values(fe),$a=i=>jt(i.media,e=>[Me.SUBTITLES,Me.CAPTIONS].includes(e.kind)).sort((e,t)=>e.kind>=t.kind?1:-1),$l=i=>jt(i.media,e=>e.mode===_t.SHOWING&&[Me.SUBTITLES,Me.CAPTIONS].includes(e.kind)),oe={MEDIA_PAUSED:{get:function(i){let{media:e}=i;return e?e.paused:!0},mediaEvents:["play","playing","pause","emptied"]},MEDIA_HAS_PLAYED:{get:function(i){let{media:e}=i;return e?!e.paused:!1},mediaEvents:["playing","emptied"]},MEDIA_ENDED:{get:function(i){let{media:e}=i;return e?e.ended:!1},mediaEvents:["seeked","ended","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:["playing","pause","timeupdate","loadedmetadata"]},MEDIA_DURATION:{get:function(i){let{media:e}=i;return i.hasAttribute("defaultduration")&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?+i.getAttribute("defaultduration"):!e||!Number.isFinite(e.duration)?Number.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))]},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,t,a;let r=(e=i.media)==null?void 0:e.buffered;return Array.from((a=(t=i.media)==null?void 0:t.buffered)!=null?a:[]).map((n,s)=>[Number(r.start(s)).toFixed(3),Number(r.end(s)).toFixed(3)])},mediaEvents:["progress","emptied"]},MEDIA_STREAM_TYPE:{get:function(i){let{media:e}=i;if(!e)return;let{streamType:t}=e;if(Wc.includes(t)){if(t===fe.UNKNOWN){let r=i.getAttribute("defaultstreamtype");return[fe.LIVE,fe.ON_DEMAND].includes(r)?r:void 0}return t}let a=e.duration;if(a===1/0)return fe.LIVE;if(Number.isFinite(a))return fe.ON_DEMAND;{let r=i.getAttribute("defaultstreamtype");if([fe.LIVE,fe.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=oe.MEDIA_STREAM_TYPE.get(i);return(t==null||Number.isNaN(t))&&a===fe.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(!(oe.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){var t,a;let r=i.media;if(r&&c[W.element]===void 0&&"webkitDisplayingFullscreen"in r)return r.webkitDisplayingFullscreen&&r.webkitPresentationMode==="fullscreen";let n;return e?n=c[W.element]?e.target:null:n=(a=(t=hl(i))==null?void 0:t.fullscreenElement)!=null?a:c[W.element],it(i.fullscreenElement,n)},rootEvents:W.rootEvents,mediaEvents:W.mediaEvents},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:c.pictureInPictureElement;return it(a,r)}},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},MEDIA_IS_AIRPLAYING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["playing","connect","connecting","disconnect"]},MEDIA_IS_CASTING:{get:function(i){var e;let{media:t}=i;return!(t!=null&&t.remote)||((e=t.remote)==null?void 0:e.state)==="disconnected"?!1:t.remote.state},remoteEvents:["connect","connecting","disconnect"]},MEDIA_AIRPLAY_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){if(!Hl)return de.UNSUPPORTED;if(!(e==null||e===!0))return de.UNAVAILABLE},mediaSetCallback(i,e){var t;i.disableRemotePlayback||i.hasAttribute("disableremoteplayback")||(t=i.remote)==null||t.watchAvailability(r=>e({availability:r})).catch(r=>{r.name==="NotSupportedError"?e({availability:null}):e({availability:!1})})},mediaUnsetCallback(i){var e;i.disableRemotePlayback||i.hasAttribute("disableremoteplayback")||(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_CAST_UNAVAILABLE:{get:function(i,{availability:e=!1}={}){var t;let{media:a}=i;if(!Vl||!((t=a==null?void 0:a.remote)!=null&&t.state))return de.UNSUPPORTED;if(!(e==null||e===!0))return de.UNAVAILABLE},mediaSetCallback(i,e){var t;i.disableRemotePlayback||i.hasAttribute("disableremoteplayback")||(t=i.remote)==null||t.watchAvailability(r=>e({availability:r})).catch(r=>{r.name==="NotSupportedError"?e({availability:null}):e({availability:!1})})},mediaUnsetCallback(i){var e;i.disableRemotePlayback||i.hasAttribute("disableremoteplayback")||(e=i.remote)==null||e.cancelWatchAvailability()}},MEDIA_FULLSCREEN_UNAVAILABLE:{get:function(){return zn?void 0:de.UNAVAILABLE}},MEDIA_PIP_UNAVAILABLE:{get:function(){return Bl?void 0:de.UNSUPPORTED}},MEDIA_RENDITION_UNAVAILABLE:{get:function(i){var e;let{media:t}=i;if(!(t!=null&&t.videoRenditions))return de.UNSUPPORTED;if(!((e=t.videoRenditions)!=null&&e.length))return de.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_AUDIO_TRACK_UNAVAILABLE:{get:function(i){var e,t;let{media:a}=i;if(!(a!=null&&a.audioTracks))return de.UNSUPPORTED;if(((t=(e=a.audioTracks)==null?void 0:e.length)!=null?t:0)<=1)return de.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_VOLUME_UNAVAILABLE:{get:function(i){if(Fa!==void 0&&!Fa)return de.UNSUPPORTED;let{media:e}=i;if(e&&typeof e.volume=="undefined")return de.UNAVAILABLE},mediaEvents:["loadstart"]},MEDIA_SUBTITLES_LIST:{get:function(i){return $a(i).map(({kind:e,label:t,language:a})=>({kind:e,label:t,language:a}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},MEDIA_SUBTITLES_SHOWING:{get:function(i,e){var t;return i.hasAttribute("defaultsubtitles")&&["addtrack","removetrack"].includes(e==null?void 0:e.type)&&[Me.CAPTIONS,Me.SUBTITLES].includes((t=e==null?void 0:e.track)==null?void 0:t.kind)&&Di.MEDIA_TOGGLE_SUBTITLES_REQUEST(void 0,{detail:!0},i),$l(i).map(({kind:a,label:r,language:n})=>({kind:a,label:r,language:n}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"]},MEDIA_CHAPTERS_CUES:{get:function(i){var e;let{media:t}=i;if(!t)return[];let[a]=jt(t,{kind:Me.CHAPTERS});return Array.from((e=a==null?void 0:a.cues)!=null?e:[]).map(({text:r,startTime:n,endTime:s})=>({text:r,startTime:n,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack"]},MEDIA_RENDITION_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.videoRenditions)!=null?e:[]]},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},MEDIA_RENDITION_SELECTED:{get:function(i){var e,t,a;let{media:r}=i;return(a=(t=r==null?void 0:r.videoRenditions)==null?void 0:t[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:a.id},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},MEDIA_AUDIO_TRACK_LIST:{get:function(i){var e;let{media:t}=i;return[...(e=t==null?void 0:t.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},MEDIA_AUDIO_TRACK_ENABLED:{get:function(i){var e,t;let{media:a}=i;return(t=[...(e=a==null?void 0:a.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:t.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]}},Di={MEDIA_PLAY_REQUEST:(i,e,t)=>{var a;let r=oe.MEDIA_STREAM_TYPE.get(t),n=t.getAttribute("noautoseektolive")===null;r==fe.LIVE&&n&&Di.MEDIA_SEEK_TO_LIVE_REQUEST(i),(a=i.play())==null||a.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{l.localStorage.setItem("media-chrome-pref-volume",a.toString())}catch{}},MEDIA_ENTER_FULLSCREEN_REQUEST:(i,e,t)=>{if(!zn){console.warn("MediaChrome: Fullscreen support is unavailable; not entering fullscreen");return}c.pictureInPictureElement&&c.exitPictureInPicture(),t[W.enter]?t.fullscreenElement[W.enter]():i.webkitEnterFullscreen?i.webkitEnterFullscreen():i.requestFullscreen?i.requestFullscreen():console.warn("MediaChrome: Fullscreen not supported")},MEDIA_EXIT_FULLSCREEN_REQUEST:()=>{c[W.exit]()},MEDIA_ENTER_PIP_REQUEST:i=>{if(!c.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}c[W.element]&&c[W.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:()=>{c.pictureInPictureElement&&c.exitPictureInPicture()},MEDIA_ENTER_CAST_REQUEST:async i=>{var e;if(((e=i.remote)==null?void 0:e.state)==="disconnected"){if(c[W.element]&&c[W.exit](),!i.remote.prompt){console.warn("MediaChrome: Casting is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_EXIT_CAST_REQUEST:i=>{var e;((e=i.remote)==null?void 0:e.state)==="connected"&&i.remote.prompt()},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,r,n,s,d,u;if(!i)return;let m=e.detail;if(m===null){t.propagateMediaState(o.MEDIA_PREVIEW_TIME,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,void 0),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,void 0);return}t.propagateMediaState(o.MEDIA_PREVIEW_TIME,m);let[h]=jt(i,{kind:Me.CHAPTERS}),p=Array.from((a=h==null?void 0:h.cues)!=null?a:[]).find(F=>F.startTime<=m&&F.endTime>m);t.propagateMediaState(o.MEDIA_PREVIEW_CHAPTER,p==null?void 0:p.text);let[b]=jt(i,{kind:Me.METADATA,label:"thumbnails"}),_=Array.from((r=b==null?void 0:b.cues)!=null?r:[]).find(F=>F.startTime>=m);if(!_)return;let P=/'^(?:[a-z]+:)?\/\//i.test((n=_==null?void 0:_.text)!=null?n:"")||(s=i.querySelector('track[label="thumbnails"]'))==null?void 0:s.src,I=new URL((d=_==null?void 0:_.text)!=null?d:"./",P),V=(u=new URLSearchParams(I.hash).get("#xywh"))!=null?u:"";t.propagateMediaState(o.MEDIA_PREVIEW_IMAGE,I.href),t.propagateMediaState(o.MEDIA_PREVIEW_COORDS,V.split(","))},MEDIA_SHOW_SUBTITLES_REQUEST:(i,e,t)=>{var a;let r=$a(t),{detail:n=[]}=e,s=Zn(n),d=(a=s[0])==null?void 0:a.language;d&&!(t!=null&&t.hasAttribute("nosubtitleslangpref"))&&l.localStorage.setItem("media-chrome-pref-subtitles-lang",d),Jt(_t.SHOWING,r,s)},MEDIA_DISABLE_SUBTITLES_REQUEST:(i,e,t)=>{let a=$a(t),{detail:r=[]}=e;Jt(_t.DISABLED,a,r)},MEDIA_TOGGLE_SUBTITLES_REQUEST:(i,e,t)=>{let{detail:a}=e!=null?e:{},r=$a(t),n=$l(t),s=!!n.length;if(r.length){if(a===!1||s&&a!==!0)Jt(_t.DISABLED,r,n);else if(a===!0||!s&&a!==!1){let d=r[0];if(!(t!=null&&t.hasAttribute("nosubtitleslangpref"))){let p=l.localStorage.getItem("media-chrome-pref-subtitles-lang"),b=p?[p,...l.navigator.languages]:l.navigator.languages,_=r.filter(P=>b.some(I=>P.language.toLowerCase().startsWith(I.split("-")[0]))).sort((P,I)=>{let V=b.findIndex(re=>P.language.toLowerCase().startsWith(re.split("-")[0])),F=b.findIndex(re=>I.language.toLowerCase().startsWith(re.split("-")[0]));return V-F});_[0]&&(d=_[0])}let{language:u,label:m,kind:h}=d;Jt(_t.DISABLED,r,n),Jt(_t.SHOWING,r,[{language:u,label:m,kind:h}])}}},MEDIA_AIRPLAY_REQUEST:async i=>{if(i!=null&&i.remote){if(!i.remote.prompt){console.warn("MediaChrome: AirPlay is not supported in this environment");return}try{await i.remote.prompt()}catch{}}},MEDIA_SEEK_TO_LIVE_REQUEST:i=>{let e=i.seekable;if(!e){console.warn("MediaChrome: Media element does not support seeking to live.");return}if(!e.length){console.warn("MediaChrome: Media is unable to seek to live.");return}i.currentTime=e.end(e.length-1)},MEDIA_RENDITION_REQUEST:(i,e)=>{if(!(i!=null&&i.videoRenditions)){console.warn("MediaChrome: Rendition selection not supported by this media.");return}let t=e.detail,a=[...i.videoRenditions].findIndex(r=>r.id==t);i.videoRenditions.selectedIndex!=a&&(i.videoRenditions.selectedIndex=a)},MEDIA_AUDIO_TRACK_REQUEST:(i,e)=>{if(!(i!=null&&i.audioTracks)){console.warn("MediaChrome: Audio track selection not supported by this media.");return}let t=e.detail;for(let a of i.audioTracks)a.enabled=t==a.id}};var eo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},we=(i,e,t)=>(eo(i,e,"read from private field"),t?t.call(i):e.get(i)),Oi=(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)},Xn=(i,e,t,a)=>(eo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ti=(i,e,t)=>(eo(i,e,"access private method"),t),st,Ni,ei,ii,Pi,Ka,Jn,Zl=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],$c=10,Fl=0,te={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys"},Ya=class extends Na{constructor(){super(),Oi(this,ii),Oi(this,Ka),Oi(this,st,new ot(this,te.HOTKEYS)),Oi(this,Ni,void 0),Oi(this,ei,void 0),oe.MEDIA_VOLUME_UNAVAILABLE.get(this)===void 0&&Wl.then(()=>{this.propagateMediaState(o.MEDIA_VOLUME_UNAVAILABLE,oe.MEDIA_VOLUME_UNAVAILABLE.get(this))}),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,this.associateElement(this),Object.keys(Di).forEach(e=>{let t=`_handle${ya(e,!0)}`;this[t]=a=>{if(a.stopPropagation(),!this.media){console.warn("Media Chrome: No media available.");return}Di[e](this.media,a,this)},this.addEventListener(v[e],this[t])}),this._mediaStatePropagators={},Object.keys(oe).forEach(e=>{this._mediaStatePropagators[e]=t=>{this.propagateMediaState(At[e],oe[e].get(this,t))}})}static get observedAttributes(){return super.observedAttributes.concat(te.NO_HOTKEYS,te.HOTKEYS,te.DEFAULT_STREAM_TYPE,te.DEFAULT_SUBTITLES,te.DEFAULT_DURATION)}get fullscreenElement(){var e;return(e=we(this,Ni))!=null?e:this}set fullscreenElement(e){this.hasAttribute(te.FULLSCREEN_ELEMENT)&&this.removeAttribute(te.FULLSCREEN_ELEMENT),Xn(this,Ni,e)}attributeChangedCallback(e,t,a){var r;if(super.attributeChangedCallback(e,t,a),e===te.NO_HOTKEYS)a!==t&&a===""?(this.hasAttribute(te.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):a!==t&&a===null&&this.enableHotkeys();else if(e===te.HOTKEYS)we(this,st).value=a;else if(e===te.DEFAULT_SUBTITLES&&a!==t&&a==="")this.dispatchEvent(new l.CustomEvent(v.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!0}));else if(e===te.DEFAULT_STREAM_TYPE)this.propagateMediaState(At.MEDIA_STREAM_TYPE);else if(e===te.FULLSCREEN_ELEMENT){let n=a?(r=we(this,ei))==null?void 0:r.getElementById(a):void 0;Xn(this,Ni,n)}}connectedCallback(){Xn(this,ei,this.getRootNode()),super.connectedCallback(),this.enableHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this.disableHotkeys(),this.dispatchEvent(new l.CustomEvent(v.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:!1}))}mediaSetCallback(e){if(super.mediaSetCallback(e),e.hasAttribute("tabindex")||(e.tabIndex=-1),Object.keys(oe).forEach(t=>{let{mediaSetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:m}=oe[t],h=this._mediaStatePropagators[t];a&&(a(e,h),h()),r==null||r.forEach(p=>{e.addEventListener(p,h),h()}),n==null||n.forEach(p=>{var b;(b=we(this,ei))==null||b.addEventListener(p,h),h()}),s==null||s.forEach(p=>{var b;(b=e.textTracks)==null||b.addEventListener(p,h),h()}),d==null||d.forEach(p=>{var b;(b=e.videoRenditions)==null||b.addEventListener(p,h),h()}),u==null||u.forEach(p=>{var b;(b=e.audioTracks)==null||b.addEventListener(p,h),h()}),m==null||m.forEach(p=>{var b;(b=e.remote)==null||b.addEventListener(p,h),h()})}),!this.hasAttribute("novolumepref"))try{let t=l.localStorage.getItem("media-chrome-pref-volume");t!==null&&(e.volume=t)}catch(t){console.debug("Media Chrome: Error getting volume pref",t)}}mediaUnsetCallback(e){super.mediaUnsetCallback(e),Object.keys(oe).forEach(t=>{let{mediaUnsetCallback:a,mediaEvents:r,rootEvents:n,textTracksEvents:s,videoRenditionsEvents:d,audioTracksEvents:u,remoteEvents:m}=oe[t],h=this._mediaStatePropagators[t];r==null||r.forEach(p=>{e.removeEventListener(p,h)}),n==null||n.forEach(p=>{var b;(b=we(this,ei))==null||b.removeEventListener(p,h)}),s==null||s.forEach(p=>{var b;(b=e.textTracks)==null||b.removeEventListener(p,h)}),d==null||d.forEach(p=>{var b;(b=e.videoRenditions)==null||b.removeEventListener(p,h),h()}),u==null||u.forEach(p=>{var b;(b=e.audioTracks)==null||b.removeEventListener(p,h),h()}),m==null||m.forEach(p=>{var b;(b=e.remote)==null||b.removeEventListener(p,h),h()}),a&&(a(e,h),h())}),this.propagateMediaState(At.MEDIA_PAUSED,!0)}propagateMediaState(e,t){let a=ql(this.mediaStateReceivers,e);if(Gl(this.mediaStateReceivers,e,t),a===ql(this.mediaStateReceivers,e))return;let r=e.toLowerCase(),n=new l.CustomEvent(nl[r],{composed:!0,bubbles:!0,detail:t});this.dispatchEvent(n)}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=Zc(e,a,r);Object.keys(v).forEach(s=>{e.addEventListener(v[s],this[`_handle${ya(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(v).forEach(r=>{e.removeEventListener(v[r],this[`_handle${ya(r,!0)}`])})}registerMediaStateReceiver(e){if(!e)return;let t=this.mediaStateReceivers;t.indexOf(e)>-1||(t.push(e),Object.keys(oe).forEach(r=>{let n=oe[r];Gl([e],At[r],n.get(this))}))}unregisterMediaStateReceiver(e){let t=this.mediaStateReceivers,a=t.indexOf(e);a<0||t.splice(a,1)}enableHotkeys(){this.addEventListener("keydown",ti(this,Ka,Jn))}disableHotkeys(){this.removeEventListener("keydown",ti(this,Ka,Jn)),this.removeEventListener("keyup",ti(this,ii,Pi))}get hotkeys(){return we(this,st)}keyboardShortcutHandler(e){var t,a,r,n;if(((n=(r=(t=e.target.getAttribute(te.KEYS_USED))==null?void 0:t.split(" "))!=null?r:(a=e.target)==null?void 0:a.keysUsed)!=null?n:[]).map(_=>_==="Space"?" ":_).filter(Boolean).includes(e.key))return;let d,u,m,h,p,b=$c;if(!we(this,st).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&we(this,st).contains("nospace")))switch(e.key){case" ":case"k":d=this.getAttribute(o.MEDIA_PAUSED)!=null?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"m":d=this.getAttribute(o.MEDIA_VOLUME_LEVEL)==="off"?v.MEDIA_UNMUTE_REQUEST:v.MEDIA_MUTE_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"f":d=this.getAttribute(o.MEDIA_IS_FULLSCREEN)!=null?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new l.CustomEvent(d,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new l.CustomEvent(v.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":u=this.getAttribute(o.MEDIA_CURRENT_TIME),m=u&&!Number.isNaN(+u)?+u:Fl,h=Math.max(m-b,0),p=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:h}),this.dispatchEvent(p);break;case"ArrowRight":u=this.getAttribute(o.MEDIA_CURRENT_TIME),m=u&&!Number.isNaN(+u)?+u:Fl,h=Math.max(m+b,0),p=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:h}),this.dispatchEvent(p);break;default:break}}};st=new WeakMap;Ni=new WeakMap;ei=new WeakMap;ii=new WeakSet;Pi=function(i){let{key:e}=i;if(!Zl.includes(e)){this.removeEventListener("keyup",ti(this,ii,Pi));return}this.keyboardShortcutHandler(i)};Ka=new WeakSet;Jn=function(i){let{metaKey:e,altKey:t,key:a}=i;if(e||t||!Zl.includes(a)){this.removeEventListener("keyup",ti(this,ii,Pi));return}[" ","ArrowLeft","ArrowRight"].includes(a)&&!(we(this,st).contains(`no${a.toLowerCase()}`)||a===" "&&we(this,st).contains("nospace"))&&i.preventDefault(),this.addEventListener("keyup",ti(this,ii,Pi),{once:!0})};var Fc=Object.values(o),Kc=Object.values(At),to=i=>{var e,t,a,r;let{observedAttributes:n}=i.constructor;!n&&((e=i.nodeName)!=null&&e.includes("-"))&&(l.customElements.upgrade(i),{observedAttributes:n}=i.constructor);let s=(r=(a=(t=i==null?void 0:i.getAttribute)==null?void 0:t.call(i,A.MEDIA_CHROME_ATTRIBUTES))==null?void 0:a.split)==null?void 0:r.call(a,/\s+/);return Array.isArray(n||s)?(n||s).filter(d=>Fc.includes(d)):[]},Yc=i=>{var e,t;return(e=i.nodeName)!=null&&e.includes("-")&&l.customElements.get((t=i.nodeName)==null?void 0:t.toLowerCase())&&!(i instanceof l.customElements.get(i.nodeName.toLowerCase()))&&l.customElements.upgrade(i),Kc.some(a=>a in i)},jn=i=>Yc(i)||!!to(i).length,Kl=i=>{var e;return(e=i==null?void 0:i.join)==null?void 0:e.call(i,":")},Yl={[o.MEDIA_SUBTITLES_LIST]:St,[o.MEDIA_SUBTITLES_SHOWING]:St,[o.MEDIA_SEEKABLE]:Kl,[o.MEDIA_BUFFERED]:i=>i==null?void 0:i.map(Kl).join(" "),[o.MEDIA_PREVIEW_COORDS]:i=>i==null?void 0:i.join(" "),[o.MEDIA_RENDITION_LIST]:ol,[o.MEDIA_AUDIO_TRACK_LIST]:ll},Gc=async(i,e,t)=>{var a,r;if(i.isConnected||await Ia(0),typeof t=="boolean"||t==null)return M(i,e,t);if(typeof t=="number")return O(i,e,t);if(typeof t=="string")return C(i,e,t);if(Array.isArray(t)&&!t.length)return i.removeAttribute(e);let n=(r=(a=Yl[e])==null?void 0:a.call(Yl,t))!=null?r:t;return i.setAttribute(e,n)},qc=i=>{var e;return!!((e=i.closest)!=null&&e.call(i,'*[slot="media"]'))},Ct=(i,e)=>{if(qc(i))return;let t=(r,n)=>{var s,d;jn(r)&&n(r);let{children:u=[]}=r!=null?r:{},m=(d=(s=r==null?void 0:r.shadowRoot)==null?void 0:s.children)!=null?d:[];[...u,...m].forEach(p=>Ct(p,n))},a=i==null?void 0:i.nodeName.toLowerCase();if(a.includes("-")&&!jn(i)){l.customElements.whenDefined(a).then(()=>{t(i,e)});return}t(i,e)},Gl=(i,e,t)=>{i.forEach(a=>{if(e in a){a[e]=t;return}let r=to(a),n=e.toLowerCase();r.includes(n)&&Gc(a,n,t)})},ql=(i,e)=>{for(let t of i){if(e in t)return t[e];let a=to(t),r=e.toLowerCase();if(a.includes(r))return t.getAttribute(r)}},Zc=(i,e,t)=>{Ct(i,e);let a=h=>{var p;let b=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;e(b)},r=h=>{var p;let b=(p=h==null?void 0:h.composedPath()[0])!=null?p:h.target;t(b)};i.addEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.addEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r);let n=h=>{h.forEach(p=>{let{addedNodes:b=[],removedNodes:_=[],type:P,target:I,attributeName:V}=p;P==="childList"?(Array.prototype.forEach.call(b,F=>Ct(F,e)),Array.prototype.forEach.call(_,F=>Ct(F,t))):P==="attributes"&&V===A.MEDIA_CHROME_ATTRIBUTES&&(jn(I)?e(I):t(I))})},s=[],d=h=>{let p=h.target;p.name!=="media"&&(s.forEach(b=>Ct(b,t)),s=[...p.assignedElements({flatten:!0})],s.forEach(b=>Ct(b,e)))};i.addEventListener("slotchange",d);let u=new MutationObserver(n);return u.observe(i,{childList:!0,attributes:!0,subtree:!0}),()=>{Ct(i,t),i.removeEventListener("slotchange",d),u.disconnect(),i.removeEventListener(v.REGISTER_MEDIA_STATE_RECEIVER,a),i.removeEventListener(v.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};l.customElements.get("media-controller")||l.customElements.define("media-controller",Ya);var io=Ya;var uo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},B=(i,e,t)=>(uo(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)},lt=(i,e,t,a)=>(uo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ae=(i,e,t)=>(uo(i,e,"access private method"),t),xe,tr,Ga,qa,_e,ja,Za,Qa,za,co,Ql,Xa,ao,Ja,ro,er,mo,no,zl,oo,Xl,so,Jl,lo,jl,ed=c.createElement("template");ed.innerHTML=`
226
230
  <style>
227
231
  :host {
228
232
  --_focus-box-shadow: var(--media-focus-box-shadow, inset 0 0 0 2px rgb(27 127 204 / .9));
@@ -332,6 +336,8 @@
332
336
  justify-content: center;
333
337
  width: 100%;
334
338
  position: absolute;
339
+
340
+ will-change: transform;
335
341
  }
336
342
 
337
343
  #background,
@@ -358,35 +364,33 @@
358
364
  overflow: hidden;
359
365
  }
360
366
 
361
- #progress {
362
- background: var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)));
363
- border-radius: var(--media-range-track-border-radius, 1px);
364
- transition: var(--media-range-track-transition);
367
+ #progress,
368
+ #highlight,
369
+ #pointer {
365
370
  position: absolute;
366
371
  height: 100%;
372
+ will-change: width;
367
373
  }
368
374
 
369
- #highlight {
370
- border-radius: var(--media-range-track-border-radius, 1px);
371
- position: absolute;
372
- height: 100%;
375
+ #progress {
376
+ background: var(--media-range-bar-color, var(--media-primary-color, rgb(238 238 238)));
377
+ transition: var(--media-range-track-transition);
373
378
  }
374
379
 
375
380
  #pointer {
376
381
  background: var(--media-range-track-pointer-background);
377
382
  border-right: var(--media-range-track-pointer-border-right);
378
- border-radius: var(--media-range-track-border-radius, 1px);
379
383
  transition: visibility .25s, opacity .25s;
380
384
  visibility: hidden;
381
385
  opacity: 0;
382
- position: absolute;
383
- height: 100%;
384
386
  }
385
387
 
386
- :host(:hover) #pointer {
387
- transition: visibility .5s, opacity .5s;
388
- visibility: visible;
389
- opacity: 1;
388
+ @media (hover: hover) {
389
+ :host(:hover) #pointer {
390
+ transition: visibility .5s, opacity .5s;
391
+ visibility: visible;
392
+ opacity: 1;
393
+ }
390
394
  }
391
395
 
392
396
  #thumb {
@@ -408,12 +412,44 @@
408
412
  :host([disabled]) #thumb {
409
413
  background-color: #777;
410
414
  }
415
+
416
+ .segments #appearance {
417
+ height: var(--media-range-segment-hover-height, 7px);
418
+ }
419
+
420
+ #background,
421
+ #track {
422
+ clip-path: url(#segments-clipping);
423
+ }
424
+
425
+ #segments {
426
+ --segments-gap: var(--media-range-segments-gap, 2px);
427
+ position: absolute;
428
+ width: 100%;
429
+ height: 100%;
430
+ }
431
+
432
+ #segments-clipping {
433
+ transform: translateX(calc(var(--segments-gap) / 2));
434
+ }
435
+
436
+ #segments-clipping:empty {
437
+ display: none;
438
+ }
439
+
440
+ #segments-clipping rect {
441
+ height: var(--media-range-track-height, 4px);
442
+ y: calc((var(--media-range-segment-hover-height, 7px) - var(--media-range-track-height, 4px)) / 2);
443
+ transition: var(--media-range-segment-transition, transform .1s ease-in-out);
444
+ transform: var(--media-range-segment-transform, scaleY(1));
445
+ transform-origin: center;
446
+ }
411
447
  </style>
412
448
  <div id="leftgap"></div>
413
449
  <div id="container">
414
450
  <div id="startpoint"></div>
415
451
  <div id="endpoint"></div>
416
- <div id="appearance">
452
+ <div id="appearance" part="appearance">
417
453
  <div id="background"></div>
418
454
  <div id="track">
419
455
  <div id="highlight"></div>
@@ -421,11 +457,12 @@
421
457
  <div id="progress"></div>
422
458
  </div>
423
459
  <div id="thumb"></div>
460
+ <svg id="segments"><clipPath id="segments-clipping"></clipPath></svg>
424
461
  </div>
425
462
  <input id="range" type="range" min="0" max="1" step="any" value="0">
426
463
  </div>
427
464
  <div id="rightgap"></div>
428
- `;var Ct=class extends l.HTMLElement{constructor(){super(),se(this,Fa),se(this,Ka),se(this,Za),se(this,Jn),se(this,jn),se(this,eo),se(this,to),se(this,Re,void 0),se(this,qa,void 0),se(this,Ya,void 0),se(this,Ga,void 0),se(this,$a,()=>{if(this.range.matches(":focus-visible")){let{style:t}=N(this.shadowRoot,":host");t.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),se(this,Wa,()=>{let{style:t}=N(this.shadowRoot,":host");t.removeProperty("--_focus-visible-box-shadow")}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Yl.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.container=this.shadowRoot.querySelector("#container"),St(this,Ya,this.shadowRoot.querySelector("#startpoint")),St(this,Ga,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range")}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=ge(this,Re))==null?void 0:r.unassociateElement)==null||n.call(r,this),St(this,Re,null)),a&&this.isConnected&&(St(this,Re,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ge(this,Re))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Le(this,Fa,zn).call(this)):(this.range.setAttribute(e,a),Le(this,Ka,Xn).call(this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(St(this,Re,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ge(this,Re))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",ge(this,$a)),this.shadowRoot.addEventListener("focusout",ge(this,Wa)),Le(this,Fa,zn).call(this)}disconnectedCallback(){var e,t;Le(this,Ka,Xn).call(this),(t=(e=ge(this,Re))==null?void 0:e.unassociateElement)==null||t.call(e,this),St(this,Re,null),this.shadowRoot.removeEventListener("focusin",ge(this,$a)),this.shadowRoot.removeEventListener("focusout",ge(this,Wa))}updatePointerBar(e){let t=this.range.getBoundingClientRect(),a=(e.clientX-t.left)/t.width;a=Math.max(0,Math.min(1,a))*100;let{style:r}=N(this.shadowRoot,"#pointer");r.setProperty("width",`${a}%`)}updateBar(){let e=this.range.valueAsNumber*100,t=N(this.shadowRoot,"#progress"),a=N(this.shadowRoot,"#thumb");t.style.setProperty("width",`${e}%`),a.style.setProperty("left",`${e}%`)}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"input":this.updateBar();break;case"pointerenter":Le(this,Jn,$l).call(this,e);break;case"pointerdown":Le(this,Za,ao).call(this,e);break;case"pointermove":Le(this,to,Kl).call(this,e);break;case"pointerup":Le(this,jn,Wl).call(this);break;case"pointerleave":Le(this,eo,Fl).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};Re=new WeakMap;qa=new WeakMap;Ya=new WeakMap;Ga=new WeakMap;$a=new WeakMap;Wa=new WeakMap;Fa=new WeakSet;zn=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Ka=new WeakSet;Xn=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=l.window)==null||i.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};Za=new WeakSet;ao=function(i){var e;St(this,qa,i.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};Jn=new WeakSet;$l=function(i){var e;i.pointerType!=="mouse"&&Le(this,Za,ao).call(this,i),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};jn=new WeakSet;Wl=function(){var i;(i=l.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};eo=new WeakSet;Fl=function(){var i;this.removeEventListener("pointerleave",this),(i=l.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};to=new WeakSet;Kl=function(i){if(this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),this.dragging&&(i.pointerType!=="mouse"||!ge(this,qa))){this.range.disabled=!0;let e=sl(i.clientX,i.clientY,ge(this,Ya).getBoundingClientRect(),ge(this,Ga).getBoundingClientRect());e=Math.max(0,Math.min(1,e)),this.range.valueAsNumber=e,this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}};l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Ct);var Gl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qa=(i,e,t)=>(Gl(i,e,"read from private field"),t?t.call(i):e.get(i)),Nc=(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)},za=(i,e,t,a)=>(Gl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),we,Zl=c.createElement("template");Zl.innerHTML=`
465
+ `;var Mt=class extends l.HTMLElement{constructor(){super(),Q(this,co),Q(this,Xa),Q(this,Ja),Q(this,er),Q(this,no),Q(this,oo),Q(this,so),Q(this,lo),Q(this,xe,void 0),Q(this,tr,void 0),Q(this,Ga,void 0),Q(this,qa,void 0),Q(this,_e,{}),Q(this,ja,[]),Q(this,Za,()=>{if(this.range.matches(":focus-visible")){let{style:e}=N(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),Q(this,Qa,()=>{let{style:e}=N(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),Q(this,za,()=>{let e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ed.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),lt(this,Ga,this.shadowRoot.querySelector("#startpoint")),lt(this,qa,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=B(this,xe))==null?void 0:r.unassociateElement)==null||n.call(r,this),lt(this,xe,null)),a&&this.isConnected&&(lt(this,xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=B(this,xe))==null?void 0:d.associateElement)==null||u.call(d,this))):(e==="disabled"||e==="aria-disabled"&&t!==a)&&(a==null?(this.range.removeAttribute(e),Ae(this,Xa,ao).call(this)):(this.range.setAttribute(e,a),Ae(this,Ja,ro).call(this)))}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),B(this,_e).pointer=N(this.shadowRoot,"#pointer"),B(this,_e).progress=N(this.shadowRoot,"#progress"),B(this,_e).thumb=N(this.shadowRoot,"#thumb");let n=this.getAttribute(A.MEDIA_CONTROLLER);n&&(lt(this,xe,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=B(this,xe))==null?void 0:t.associateElement)==null||a.call(t,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",B(this,Za)),this.shadowRoot.addEventListener("focusout",B(this,Qa)),Ae(this,Xa,ao).call(this),Tt(this.container,B(this,za))}disconnectedCallback(){var e,t;Ae(this,Ja,ro).call(this),(t=(e=B(this,xe))==null?void 0:e.unassociateElement)==null||t.call(e,this),lt(this,xe,null),this.shadowRoot.removeEventListener("focusin",B(this,Za)),this.shadowRoot.removeEventListener("focusout",B(this,Qa)),Mi(this.container,B(this,za))}updatePointerBar(e){var t;(t=B(this,_e).pointer)==null||t.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,t;let a=this.range.valueAsNumber*100;(e=B(this,_e).progress)==null||e.style.setProperty("width",`${a}%`),(t=B(this,_e).thumb)==null||t.style.setProperty("left",`${a}%`)}updateSegments(e){let t=this.shadowRoot.querySelector("#segments-clipping");if(t.textContent="",!(e!=null&&e.length))return;B(this,_e).activeSegment=Pn(this.shadowRoot,"#segments-clipping rect:nth-child(0)"),this.container.classList.toggle("segments",!!e.length);let a=[...new Set([+this.range.min,...e.flatMap(n=>[n.start,n.end]),+this.range.max])];lt(this,ja,[...a]);let r=a.pop();for(let[n,s]of a.entries()){let[d,u]=[n===0,n===a.length-1],m=d?"calc(var(--segments-gap) / -1)":`${s*100}%`,p=`calc(${((u?r:a[n+1])-s)*100}%${d||u?"":" - var(--segments-gap)"})`,b=c.createElementNS("http://www.w3.org/2000/svg","rect"),_=N(this.shadowRoot,`#segments-clipping rect:nth-child(${n+1})`);_.style.setProperty("x",m),_.style.setProperty("width",p),t.append(b)}}getPointerRatio(e){let t=bl(e.clientX,e.clientY,B(this,Ga).getBoundingClientRect(),B(this,qa).getBoundingClientRect());return Math.max(0,Math.min(1,t))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Ae(this,lo,jl).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Ae(this,no,zl).call(this,e);break;case"pointerdown":Ae(this,er,mo).call(this,e);break;case"pointerup":Ae(this,oo,Xl).call(this);break;case"pointerleave":Ae(this,so,Jl).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}};xe=new WeakMap;tr=new WeakMap;Ga=new WeakMap;qa=new WeakMap;_e=new WeakMap;ja=new WeakMap;Za=new WeakMap;Qa=new WeakMap;za=new WeakMap;co=new WeakSet;Ql=function(i){let e=B(this,_e).activeSegment;if(!e)return;let t=this.getPointerRatio(i),r=`#segments-clipping rect:nth-child(${B(this,ja).findIndex((n,s,d)=>{let u=d[s+1];return u!=null&&t>=n&&t<=u})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Xa=new WeakSet;ao=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Ja=new WeakSet;ro=function(){var i,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(i=l.window)==null||i.removeEventListener("pointerup",this),(e=l.window)==null||e.removeEventListener("pointermove",this)};er=new WeakSet;mo=function(i){var e;lt(this,tr,i.composedPath().includes(this.range)),(e=l.window)==null||e.addEventListener("pointerup",this)};no=new WeakSet;zl=function(i){var e;i.pointerType!=="mouse"&&Ae(this,er,mo).call(this,i),this.addEventListener("pointerleave",this),(e=l.window)==null||e.addEventListener("pointermove",this)};oo=new WeakSet;Xl=function(){var i;(i=l.window)==null||i.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};so=new WeakSet;Jl=function(){var i,e;this.removeEventListener("pointerleave",this),(i=l.window)==null||i.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=B(this,_e).activeSegment)==null||e.style.removeProperty("transform")};lo=new WeakSet;jl=function(i){this.toggleAttribute("dragging",i.buttons===1||i.pointerType!=="mouse"),this.updatePointerBar(i),Ae(this,co,Ql).call(this,i),this.dragging&&(i.pointerType!=="mouse"||!B(this,tr))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(i),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};l.customElements.get("media-chrome-range")||l.customElements.define("media-chrome-range",Mt);var td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ir=(i,e,t)=>(td(i,e,"read from private field"),t?t.call(i):e.get(i)),Qc=(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)},ar=(i,e,t,a)=>(td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),De,id=c.createElement("template");id.innerHTML=`
429
466
  <style>
430
467
  :host {
431
468
 
@@ -447,7 +484,7 @@
447
484
  </style>
448
485
 
449
486
  <slot></slot>
450
- `;var ro=class extends l.HTMLElement{constructor(){super(),Nc(this,we,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Zl.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Qa(this,we))==null?void 0:r.unassociateElement)==null||n.call(r,this),za(this,we,null)),a&&this.isConnected&&(za(this,we,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Qa(this,we))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(za(this,we,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Qa(this,we))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Qa(this,we))==null?void 0:e.unassociateElement)==null||t.call(e,this),za(this,we,null)}};we=new WeakMap;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",ro);var ql=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xa=(i,e,t)=>(ql(i,e,"read from private field"),t?t.call(i):e.get(i)),Uc=(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)},Ja=(i,e,t,a)=>(ql(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),xe,Ql=c.createElement("template");Ql.innerHTML=`
487
+ `;var ho=class extends l.HTMLElement{constructor(){super(),Qc(this,De,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(id.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ir(this,De))==null?void 0:r.unassociateElement)==null||n.call(r,this),ar(this,De,null)),a&&this.isConnected&&(ar(this,De,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ir(this,De))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(ar(this,De,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ir(this,De))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ir(this,De))==null?void 0:e.unassociateElement)==null||t.call(e,this),ar(this,De,null)}};De=new WeakMap;l.customElements.get("media-control-bar")||l.customElements.define("media-control-bar",ho);var ad=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},rr=(i,e,t)=>(ad(i,e,"read from private field"),t?t.call(i):e.get(i)),zc=(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)},nr=(i,e,t,a)=>(ad(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Oe,rd=c.createElement("template");rd.innerHTML=`
451
488
  <style>
452
489
  :host {
453
490
  font: var(--media-font,
@@ -480,11 +517,11 @@
480
517
  }
481
518
  </style>
482
519
  <slot></slot>
483
- `;var Ge=class extends l.HTMLElement{constructor(){super(),Uc(this,xe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ql.content.cloneNode(!0)));let{style:e}=N(this.shadowRoot,":host");e.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`)}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=Xa(this,xe))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ja(this,xe,null)),a&&this.isConnected&&(Ja(this,xe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=Xa(this,xe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ja(this,xe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=Xa(this,xe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=Xa(this,xe))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ja(this,xe,null)}};xe=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Ge);var Xl=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zl=(i,e,t)=>(Xl(i,e,"read from private field"),t?t.call(i):e.get(i)),Pc=(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)},Bc=(i,e,t,a)=>(Xl(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ui,no=class extends Ge{constructor(){super(),Pc(this,Ui,void 0),Bc(this,Ui,this.shadowRoot.querySelector("slot")),zl(this,Ui).textContent=Se(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(zl(this,Ui).textContent=Se(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}};Ui=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",no);var td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},oo=(i,e,t)=>(td(i,e,"read from private field"),t?t.call(i):e.get(i)),Vc=(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)},Hc=(i,e,t,a)=>(td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ti,Ae={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Jl=[...Object.values(Ae),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],jl=["Enter"," "],$c="&nbsp;/&nbsp;",ed=(i,{timesSep:e=$c}={})=>{var t,a,r,n;let s=i.hasAttribute(Ae.REMAINING),d=i.hasAttribute(Ae.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,h]=(a=i.mediaSeekable)!=null?a:[],m=(n=(r=i.mediaDuration)!=null?r:h)!=null?n:0,b=s?Se(0-(m-u)):Se(u);return d?`${b}${e}${Se(m)}`:b},Wc="video not loaded, unknown time.",Fc=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",Wc);return}let n=i.hasAttribute(Ae.REMAINING),s=i.hasAttribute(Ae.SHOW_DURATION),d=n?_t(0-(r-t)):_t(t);if(!s){i.setAttribute("aria-valuetext",d);return}let u=_t(r),h=`${d} of ${u}`;i.setAttribute("aria-valuetext",h)},so=class extends Ge{constructor(){super(),Vc(this,ti,void 0),Hc(this,ti,this.shadowRoot.querySelector("slot")),oo(this,ti).innerHTML=`${ed(this)}`;let{style:e}=N(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))")}static get observedAttributes(){return[...super.observedAttributes,...Jl,"disabled"]}connectedCallback(){this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",q.PLAYBACK_TIME());let e=t=>{let{key:a}=t;if(!jl.includes(a)){this.removeEventListener("keyup",e);return}this.toggleTimeDisplay()};this.addEventListener("keydown",t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!jl.includes(n)){this.removeEventListener("keyup",e);return}this.addEventListener("keyup",e)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){Jl.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return L(this,Ae.REMAINING)}set remaining(e){C(this,Ae.REMAINING,e)}get showDuration(){return L(this,Ae.SHOW_DURATION)}set showDuration(e){C(this,Ae.SHOW_DURATION,e)}get noToggle(){return L(this,Ae.NO_TOGGLE)}set noToggle(e){C(this,Ae.NO_TOGGLE,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=ed(this);Fc(this),e!==oo(this,ti).innerHTML&&(oo(this,ti).innerHTML=e)}};ti=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",so);var Kc=`<svg aria-hidden="true" viewBox="0 0 26 24">
520
+ `;var Ne=class extends l.HTMLElement{constructor(){super(),zc(this,Oe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(rd.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER&&(t&&((n=(r=rr(this,Oe))==null?void 0:r.unassociateElement)==null||n.call(r,this),nr(this,Oe,null)),a&&this.isConnected&&(nr(this,Oe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=rr(this,Oe))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(A.MEDIA_CONTROLLER);n&&(nr(this,Oe,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=rr(this,Oe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=rr(this,Oe))==null?void 0:e.unassociateElement)==null||t.call(e,this),nr(this,Oe,null)}};Oe=new WeakMap;l.customElements.get("media-text-display")||l.customElements.define("media-text-display",Ne);var nd=Ne;var sd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},od=(i,e,t)=>(sd(i,e,"read from private field"),t?t.call(i):e.get(i)),Xc=(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)},Jc=(i,e,t,a)=>(sd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ui,po=class extends Ne{constructor(){super(),Xc(this,Ui,void 0),Jc(this,Ui,this.shadowRoot.querySelector("slot")),od(this,Ui).textContent=Le(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_DURATION]}attributeChangedCallback(e,t,a){e===o.MEDIA_DURATION&&(od(this,Ui).textContent=Le(a)),super.attributeChangedCallback(e,t,a)}get mediaDuration(){return R(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}};Ui=new WeakMap;l.customElements.get("media-duration-display")||l.customElements.define("media-duration-display",po);var cd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},bo=(i,e,t)=>(cd(i,e,"read from private field"),t?t.call(i):e.get(i)),jc=(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)},em=(i,e,t,a)=>(cd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),ai,ye={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},ld=[...Object.values(ye),o.MEDIA_CURRENT_TIME,o.MEDIA_DURATION,o.MEDIA_SEEKABLE],dd=["Enter"," "],tm="&nbsp;/&nbsp;",ud=(i,{timesSep:e=tm}={})=>{var t,a,r,n;let s=i.hasAttribute(ye.REMAINING),d=i.hasAttribute(ye.SHOW_DURATION),u=(t=i.mediaCurrentTime)!=null?t:0,[,m]=(a=i.mediaSeekable)!=null?a:[],h=(n=(r=i.mediaDuration)!=null?r:m)!=null?n:0,p=s?Le(0-(h-u)):Le(u);return d?`${p}${e}${Le(h)}`:p},im="video not loaded, unknown time.",am=i=>{var e;let t=i.mediaCurrentTime,[,a]=(e=i.mediaSeekable)!=null?e:[],r=i.mediaDuration||a;if(t==null||r==null){i.setAttribute("aria-valuetext",im);return}let n=i.hasAttribute(ye.REMAINING),s=i.hasAttribute(ye.SHOW_DURATION),d=n?yt(0-(r-t)):yt(t);if(!s){i.setAttribute("aria-valuetext",d);return}let u=yt(r),m=`${d} of ${u}`;i.setAttribute("aria-valuetext",m)},Eo=class extends Ne{constructor(){super(),jc(this,ai,void 0),em(this,ai,this.shadowRoot.querySelector("slot")),bo(this,ai).innerHTML=`${ud(this)}`}static get observedAttributes(){return[...super.observedAttributes,...ld,"disabled"]}connectedCallback(){let{style:e}=N(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",X.PLAYBACK_TIME());let t=a=>{let{key:r}=a;if(!dd.includes(r)){this.removeEventListener("keyup",t);return}this.toggleTimeDisplay()};this.addEventListener("keydown",a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!dd.includes(s)){this.removeEventListener("keyup",t);return}this.addEventListener("keyup",t)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,t,a){ld.includes(e)?this.update():e==="disabled"&&a!==t&&(a==null?this.enable():this.disable()),super.attributeChangedCallback(e,t,a)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return w(this,ye.REMAINING)}set remaining(e){M(this,ye.REMAINING,e)}get showDuration(){return w(this,ye.SHOW_DURATION)}set showDuration(e){M(this,ye.SHOW_DURATION,e)}get noToggle(){return w(this,ye.NO_TOGGLE)}set noToggle(e){M(this,ye.NO_TOGGLE,e)}get mediaDuration(){return R(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}update(){let e=ud(this);am(this),e!==bo(this,ai).innerHTML&&(bo(this,ai).innerHTML=e)}};ai=new WeakMap;l.customElements.get("media-time-display")||l.customElements.define("media-time-display",Eo);var rm=`<svg aria-hidden="true" viewBox="0 0 26 24">
484
521
  <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"/>
485
- </svg>`,Yc=`<svg aria-hidden="true" viewBox="0 0 26 24">
522
+ </svg>`,nm=`<svg aria-hidden="true" viewBox="0 0 26 24">
486
523
  <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"/>
487
- </svg>`,nd=c.createElement("template");nd.innerHTML=`
524
+ </svg>`,bd=c.createElement("template");bd.innerHTML=`
488
525
  <style>
489
526
  :host([aria-checked="true"]) slot[name=off] {
490
527
  display: none !important;
@@ -497,16 +534,16 @@
497
534
  </style>
498
535
 
499
536
  <slot name="icon">
500
- <slot name="on">${Kc}</slot>
501
- <slot name="off">${Yc}</slot>
537
+ <slot name="on">${rm}</slot>
538
+ <slot name="off">${nm}</slot>
502
539
  </slot>
503
- `;var id=i=>{i.setAttribute("aria-checked",Ml(i))},lo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:nd,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",q.CLOSED_CAPTIONS()),id(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&id(this)}get mediaSubtitlesList(){return ad(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){rd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ad(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){rd(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(f.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},ad=(i,e)=>{let t=i.getAttribute(e);return t?wi(t):[]},rd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=It(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",lo);var ii={SEEK_OFFSET:"seekoffset"},ja=30,Gc=`<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)">${ja}</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>`,od=c.createElement("template");od.innerHTML=`
504
- <slot name="icon">${Gc}</slot>
505
- `;var Zc=0,uo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ii.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:od,...e})}connectedCallback(){this.seekOffset=M(this,ii.SEEK_OFFSET,ja),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ii.SEEK_OFFSET&&(this.seekOffset=M(this,ii.SEEK_OFFSET,ja)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ii.SEEK_OFFSET,ja)}set seekOffset(e){O(this,ii.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,Zc)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",uo);var qc=`<svg aria-hidden="true" viewBox="0 0 26 24">
540
+ `;var md=i=>{i.setAttribute("aria-checked",Pl(i))},vo=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:bd,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",X.CLOSED_CAPTIONS()),md(this)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_SHOWING&&md(this)}get mediaSubtitlesList(){return hd(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){pd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return hd(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){pd(this,o.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new l.CustomEvent(v.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}},hd=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},pd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=St(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-button")||l.customElements.define("media-captions-button",vo);var ri={SEEK_OFFSET:"seekoffset"},or=30,om=`<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)">${or}</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>`,Ed=c.createElement("template");Ed.innerHTML=`
541
+ <slot name="icon">${om}</slot>
542
+ `;var sm=0,fo=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ri.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:Ed,...e})}connectedCallback(){this.seekOffset=R(this,ri.SEEK_OFFSET,or),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ri.SEEK_OFFSET&&(this.seekOffset=R(this,ri.SEEK_OFFSET,or)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return R(this,ri.SEEK_OFFSET,or)}set seekOffset(e){O(this,ri.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),ka(Sa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return R(this,o.MEDIA_CURRENT_TIME,sm)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=this.mediaCurrentTime+this.seekOffset,t=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-forward-button")||l.customElements.define("media-seek-forward-button",fo);var lm=`<svg aria-hidden="true" viewBox="0 0 26 24">
506
543
  <path d="M16 3v2.5h3.5V9H22V3h-6ZM4 9h2.5V5.5H10V3H4v6Zm15.5 9.5H16V21h6v-6h-2.5v3.5ZM6.5 15H4v6h6v-2.5H6.5V15Z"/>
507
- </svg>`,Qc=`<svg aria-hidden="true" viewBox="0 0 26 24">
544
+ </svg>`,dm=`<svg aria-hidden="true" viewBox="0 0 26 24">
508
545
  <path d="M18.5 6.5V3H16v6h6V6.5h-3.5ZM16 21h2.5v-3.5H22V15h-6v6ZM4 17.5h3.5V21H10v-6H4v2.5Zm3.5-11H4V9h6V3H7.5v3.5Z"/>
509
- </svg>`,ld=c.createElement("template");ld.innerHTML=`
546
+ </svg>`,fd=c.createElement("template");fd.innerHTML=`
510
547
  <style>
511
548
  :host([${o.MEDIA_IS_FULLSCREEN}]) slot:not([name=exit]):not([name=icon]) {
512
549
  display: none !important;
@@ -519,10 +556,10 @@
519
556
  </style>
520
557
 
521
558
  <slot name="icon">
522
- <slot name="enter">${qc}</slot>
523
- <slot name="exit">${Qc}</slot>
559
+ <slot name="enter">${lm}</slot>
560
+ <slot name="exit">${dm}</slot>
524
561
  </slot>
525
- `;var sd=i=>{let e=i.mediaIsFullscreen?D.EXIT_FULLSCREEN():D.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},co=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ld,...e})}connectedCallback(){sd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&sd(this),super.attributeChangedCallback(e,t,a)}get mediaFullscreenUnavailable(){return x(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){R(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return L(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){C(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?f.MEDIA_EXIT_FULLSCREEN_REQUEST:f.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",co);var{MEDIA_TIME_IS_LIVE:er,MEDIA_PAUSED:Pi}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:zc,MEDIA_PLAY_REQUEST:Xc}=f,Jc='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',ud=c.createElement("template");ud.innerHTML=`
562
+ `;var vd=i=>{let e=i.mediaIsFullscreen?D.EXIT_FULLSCREEN():D.ENTER_FULLSCREEN();i.setAttribute("aria-label",e)},go=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_FULLSCREEN,o.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:fd,...e})}connectedCallback(){vd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_FULLSCREEN&&vd(this),super.attributeChangedCallback(e,t,a)}get mediaFullscreenUnavailable(){return L(this,o.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){C(this,o.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return w(this,o.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){M(this,o.MEDIA_IS_FULLSCREEN,e)}handleClick(){let e=this.mediaIsFullscreen?v.MEDIA_EXIT_FULLSCREEN_REQUEST:v.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-fullscreen-button")||l.customElements.define("media-fullscreen-button",go);var{MEDIA_TIME_IS_LIVE:sr,MEDIA_PAUSED:Bi}=o,{MEDIA_SEEK_TO_LIVE_REQUEST:um,MEDIA_PLAY_REQUEST:cm}=v,mm='<svg viewBox="0 0 6 12"><circle cx="3" cy="6" r="2"></circle></svg>',Ad=c.createElement("template");Ad.innerHTML=`
526
563
  <style>
527
564
 
528
565
  slot[name=indicator] > *,
@@ -533,57 +570,57 @@
533
570
  color: var(--media-live-button-icon-color, rgb(140, 140, 140));
534
571
  }
535
572
 
536
- :host([${er}]:not([${Pi}])) slot[name=indicator] > *,
537
- :host([${er}]:not([${Pi}])) ::slotted([slot=indicator]) {
573
+ :host([${sr}]:not([${Bi}])) slot[name=indicator] > *,
574
+ :host([${sr}]:not([${Bi}])) ::slotted([slot=indicator]) {
538
575
  fill: var(--media-live-button-indicator-color, rgb(255, 0, 0));
539
576
  color: var(--media-live-button-indicator-color, rgb(255, 0, 0));
540
577
  }
541
578
 
542
- :host([${er}]:not([${Pi}])) {
579
+ :host([${sr}]:not([${Bi}])) {
543
580
  cursor: not-allowed;
544
581
  }
545
582
 
546
583
  </style>
547
584
 
548
- <slot name="indicator">${Jc}</slot>
585
+ <slot name="indicator">${mm}</slot>
549
586
 
550
587
  <slot name="spacer">&nbsp;</slot><slot name="text">LIVE</slot>
551
- `;var dd=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?D.SEEK_LIVE():D.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},mo=class extends w{static get observedAttributes(){return[...super.observedAttributes,Pi,er]}constructor(e={}){super({slotTemplate:ud,...e})}connectedCallback(){dd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),dd(this)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return L(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){C(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(zc,{composed:!0,bubbles:!0})),this.hasAttribute(Pi)&&this.dispatchEvent(new l.CustomEvent(Xc,{composed:!0,bubbles:!0})))}};l.customElements.get("media-live-button")||l.customElements.define("media-live-button",mo);var{MEDIA_VOLUME_LEVEL:Bi}=o,jc=`<svg aria-hidden="true" viewBox="0 0 24 24">
588
+ `;var gd=i=>{let e=i.mediaPaused||!i.mediaTimeIsLive,t=e?D.SEEK_LIVE():D.PLAYING_LIVE();i.setAttribute("aria-label",t),e?i.removeAttribute("aria-disabled"):i.setAttribute("aria-disabled","true")},Ao=class extends x{static get observedAttributes(){return[...super.observedAttributes,Bi,sr]}constructor(e={}){super({slotTemplate:Ad,...e})}connectedCallback(){gd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),gd(this)}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return w(this,o.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){M(this,o.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new l.CustomEvent(um,{composed:!0,bubbles:!0})),this.hasAttribute(Bi)&&this.dispatchEvent(new l.CustomEvent(cm,{composed:!0,bubbles:!0})))}};l.customElements.get("media-live-button")||l.customElements.define("media-live-button",Ao);var{MEDIA_VOLUME_LEVEL:Hi}=o,hm=`<svg aria-hidden="true" viewBox="0 0 24 24">
552
589
  <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"/>
553
- </svg>`,cd=`<svg aria-hidden="true" viewBox="0 0 24 24">
590
+ </svg>`,_d=`<svg aria-hidden="true" viewBox="0 0 24 24">
554
591
  <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"/>
555
- </svg>`,em=`<svg aria-hidden="true" viewBox="0 0 24 24">
592
+ </svg>`,pm=`<svg aria-hidden="true" viewBox="0 0 24 24">
556
593
  <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"/>
557
- </svg>`,hd=c.createElement("template");hd.innerHTML=`
594
+ </svg>`,Td=c.createElement("template");Td.innerHTML=`
558
595
  <style>
559
596
 
560
- :host(:not([${Bi}])) slot:not([name=high]):not([name=icon]),
561
- :host([${Bi}=high]) slot:not([name=high]):not([name=icon]) {
597
+ :host(:not([${Hi}])) slot:not([name=high]):not([name=icon]),
598
+ :host([${Hi}=high]) slot:not([name=high]):not([name=icon]) {
562
599
  display: none !important;
563
600
  }
564
601
 
565
- :host([${Bi}=off]) slot:not([name=off]):not([name=icon]) {
602
+ :host([${Hi}=off]) slot:not([name=off]):not([name=icon]) {
566
603
  display: none !important;
567
604
  }
568
605
 
569
- :host([${Bi}=low]) slot:not([name=low]):not([name=icon]) {
606
+ :host([${Hi}=low]) slot:not([name=low]):not([name=icon]) {
570
607
  display: none !important;
571
608
  }
572
609
 
573
- :host([${Bi}=medium]) slot:not([name=medium]):not([name=icon]) {
610
+ :host([${Hi}=medium]) slot:not([name=medium]):not([name=icon]) {
574
611
  display: none !important;
575
612
  }
576
613
  </style>
577
614
 
578
615
  <slot name="icon">
579
- <slot name="off">${jc}</slot>
580
- <slot name="low">${cd}</slot>
581
- <slot name="medium">${cd}</slot>
582
- <slot name="high">${em}</slot>
616
+ <slot name="off">${hm}</slot>
617
+ <slot name="low">${_d}</slot>
618
+ <slot name="medium">${_d}</slot>
619
+ <slot name="high">${pm}</slot>
583
620
  </slot>
584
- `;var md=i=>{let t=i.mediaVolumeLevel==="off"?D.UNMUTE():D.MUTE();i.setAttribute("aria-label",t)},ho=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:hd,...e})}connectedCallback(){md(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&md(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return x(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){R(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?f.MEDIA_UNMUTE_REQUEST:f.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",ho);var pd=`<svg aria-hidden="true" viewBox="0 0 28 24">
621
+ `;var yd=i=>{let t=i.mediaVolumeLevel==="off"?D.UNMUTE():D.MUTE();i.setAttribute("aria-label",t)},_o=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:Td,...e})}connectedCallback(){yd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_VOLUME_LEVEL&&yd(this),super.attributeChangedCallback(e,t,a)}get mediaVolumeLevel(){return L(this,o.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){C(this,o.MEDIA_VOLUME_LEVEL,e)}handleClick(){let e=this.mediaVolumeLevel==="off"?v.MEDIA_UNMUTE_REQUEST:v.MEDIA_MUTE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-mute-button")||l.customElements.define("media-mute-button",_o);var Id=`<svg aria-hidden="true" viewBox="0 0 28 24">
585
622
  <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"/>
586
- </svg>`,Ed=c.createElement("template");Ed.innerHTML=`
623
+ </svg>`,Sd=c.createElement("template");Sd.innerHTML=`
587
624
  <style>
588
625
  :host([${o.MEDIA_IS_PIP}]) slot:not([name=exit]):not([name=icon]) {
589
626
  display: none !important;
@@ -596,14 +633,14 @@
596
633
  </style>
597
634
 
598
635
  <slot name="icon">
599
- <slot name="enter">${pd}</slot>
600
- <slot name="exit">${pd}</slot>
636
+ <slot name="enter">${Id}</slot>
637
+ <slot name="exit">${Id}</slot>
601
638
  </slot>
602
- `;var bd=i=>{let e=i.mediaIsPip?D.EXIT_PIP():D.ENTER_PIP();i.setAttribute("aria-label",e)},po=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ed,...e})}connectedCallback(){bd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&bd(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return x(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){R(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return L(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){C(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?f.MEDIA_EXIT_PIP_REQUEST:f.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",po);var tm=`<svg aria-hidden="true" viewBox="0 0 24 24">
639
+ `;var kd=i=>{let e=i.mediaIsPip?D.EXIT_PIP():D.ENTER_PIP();i.setAttribute("aria-label",e)},yo=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_IS_PIP,o.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Sd,...e})}connectedCallback(){kd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_IS_PIP&&kd(this),super.attributeChangedCallback(e,t,a)}get mediaPipUnavailable(){return L(this,o.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){C(this,o.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return w(this,o.MEDIA_IS_PIP)}set mediaIsPip(e){M(this,o.MEDIA_IS_PIP,e)}handleClick(){let e=this.mediaIsPip?v.MEDIA_EXIT_PIP_REQUEST:v.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-pip-button")||l.customElements.define("media-pip-button",yo);var bm=`<svg aria-hidden="true" viewBox="0 0 24 24">
603
640
  <path d="m6 21 15-9L6 3v18Z"/>
604
- </svg>`,im=`<svg aria-hidden="true" viewBox="0 0 24 24">
641
+ </svg>`,Em=`<svg aria-hidden="true" viewBox="0 0 24 24">
605
642
  <path d="M6 20h4V4H6v16Zm8-16v16h4V4h-4Z"/>
606
- </svg>`,vd=c.createElement("template");vd.innerHTML=`
643
+ </svg>`,Md=c.createElement("template");Md.innerHTML=`
607
644
  <style>
608
645
  :host([${o.MEDIA_PAUSED}]) slot[name=pause] {
609
646
  display: none !important;
@@ -615,10 +652,10 @@
615
652
  </style>
616
653
 
617
654
  <slot name="icon">
618
- <slot name="play">${tm}</slot>
619
- <slot name="pause">${im}</slot>
655
+ <slot name="play">${bm}</slot>
656
+ <slot name="pause">${Em}</slot>
620
657
  </slot>
621
- `;var fd=i=>{let e=i.mediaPaused?D.PLAY():D.PAUSE();i.setAttribute("aria-label",e)},bo=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:vd,...e})}connectedCallback(){fd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&fd(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?f.MEDIA_PLAY_REQUEST:f.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",bo);var am=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},tr=(i,e,t)=>(am(i,e,"read from private field"),t?t.call(i):e.get(i)),rm=(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,Eo={RATES:"rates"},vo=[1,1.2,1.5,1.7,2],ri=1,gd=c.createElement("template");gd.innerHTML=`
658
+ `;var Cd=i=>{let e=i.mediaPaused?D.PLAY():D.PAUSE();i.setAttribute("aria-label",e)},To=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:Md,...e})}connectedCallback(){Cd(this),super.connectedCallback()}attributeChangedCallback(e,t,a){e===o.MEDIA_PAUSED&&Cd(this),super.attributeChangedCallback(e,t,a)}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}handleClick(){let e=this.mediaPaused?v.MEDIA_PLAY_REQUEST:v.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new l.CustomEvent(e,{composed:!0,bubbles:!0}))}};l.customElements.get("media-play-button")||l.customElements.define("media-play-button",To);var vm=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},lr=(i,e,t)=>(vm(i,e,"read from private field"),t?t.call(i):e.get(i)),fm=(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)},ni,Io={RATES:"rates"},So=[1,1.2,1.5,1.7,2],oi=1,Ld=c.createElement("template");Ld.innerHTML=`
622
659
  <style>
623
660
  :host {
624
661
  min-width: 5ch;
@@ -626,7 +663,7 @@
626
663
  }
627
664
  </style>
628
665
  <slot name="icon"></slot>
629
- `;var fo=class extends w{constructor(e={}){super({slotTemplate:gd,...e}),rm(this,ai,new nt(this,Eo.RATES,{defaultValue:vo})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${ri}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Eo.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Eo.RATES&&(tr(this,ai).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?ri:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",q.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return tr(this,ai)}set rates(e){e?Array.isArray(e)&&(tr(this,ai).value=e.join(" ")):tr(this,ai).value=""}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,d)=>s-d),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:ri,n=new l.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};ai=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",fo);var De={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Ad=c.createElement("template");Ad.innerHTML=`
666
+ `;var ko=class extends x{constructor(e={}){super({slotTemplate:Ld,...e}),fm(this,ni,new ot(this,Io.RATES,{defaultValue:So})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${oi}x`}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PLAYBACK_RATE,Io.RATES]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===Io.RATES&&(lr(this,ni).value=a),e===o.MEDIA_PLAYBACK_RATE){let r=a?+a:Number.NaN,n=Number.isNaN(r)?oi:r;this.container.innerHTML=`${n}x`,this.setAttribute("aria-label",X.PLAYBACK_RATE({playbackRate:n}))}}get rates(){return lr(this,ni)}set rates(e){e?Array.isArray(e)&&(lr(this,ni).value=e.join(" ")):lr(this,ni).value=""}get mediaPlaybackRate(){return R(this,o.MEDIA_PLAYBACK_RATE,oi)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,t;let a=Array.from(this.rates.values(),s=>+s).sort((s,d)=>s-d),r=(t=(e=a.find(s=>s>this.mediaPlaybackRate))!=null?e:a[0])!=null?t:oi,n=new l.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(n)}};ni=new WeakMap;l.customElements.get("media-playback-rate-button")||l.customElements.define("media-playback-rate-button",ko);var Pe={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},Rd=c.createElement("template");Rd.innerHTML=`
630
667
  <style>
631
668
  :host {
632
669
  pointer-events: none;
@@ -648,9 +685,9 @@
648
685
  </style>
649
686
 
650
687
  <img part="poster img" aria-hidden="true" id="image"/>
651
- `;var nm=i=>{i.style.removeProperty("background-image")},om=(i,e)=>{i.style["background-image"]=`url('${e}')`},go=class extends l.HTMLElement{static get observedAttributes(){return[De.PLACEHOLDER_SRC,De.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ad.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===De.SRC&&(a==null?this.image.removeAttribute(De.SRC):this.image.setAttribute(De.SRC,a)),e===De.PLACEHOLDER_SRC&&(a==null?nm(this.image):om(this.image,a))}get placeholderSrc(){return x(this,De.PLACEHOLDER_SRC)}set placeholderSrc(e){R(this,De.SRC,e)}get src(){return x(this,De.SRC)}set src(e){R(this,De.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",go);var ni={SEEK_OFFSET:"seekoffset"},ir=30,sm=`<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)">${ir}</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>`,_d=c.createElement("template");_d.innerHTML=`
652
- <slot name="icon">${sm}</slot>
653
- `;var lm=0,Ao=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,ni.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:_d,...e})}connectedCallback(){this.seekOffset=M(this,ni.SEEK_OFFSET,ir),super.connectedCallback()}attributeChangedCallback(e,t,a){e===ni.SEEK_OFFSET&&(this.seekOffset=M(this,ni.SEEK_OFFSET,ir)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return M(this,ni.SEEK_OFFSET,ir)}set seekOffset(e){O(this,ni.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),Aa(_a(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME,lm)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Ao);var Td=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},yd=(i,e,t)=>(Td(i,e,"read from private field"),t?t.call(i):e.get(i)),dm=(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)},um=(i,e,t,a)=>(Td(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Vi,_o=class extends Ge{constructor(){super(),dm(this,Vi,void 0),um(this,Vi,this.shadowRoot.querySelector("slot")),yd(this,Vi).textContent=Se(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){e===o.MEDIA_PREVIEW_TIME&&a!=null&&(yd(this,Vi).textContent=Se(a)),super.attributeChangedCallback(e,t,a)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};Vi=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",_o);var Id=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ar=(i,e,t)=>(Id(i,e,"read from private field"),t?t.call(i):e.get(i)),cm=(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)},rr=(i,e,t,a)=>(Id(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Oe,kd=c.createElement("template");kd.innerHTML=`
688
+ `;var gm=i=>{i.style.removeProperty("background-image")},Am=(i,e)=>{i.style["background-image"]=`url('${e}')`},Co=class extends l.HTMLElement{static get observedAttributes(){return[Pe.PLACEHOLDER_SRC,Pe.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Rd.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,t,a){e===Pe.SRC&&(a==null?this.image.removeAttribute(Pe.SRC):this.image.setAttribute(Pe.SRC,a)),e===Pe.PLACEHOLDER_SRC&&(a==null?gm(this.image):Am(this.image,a))}get placeholderSrc(){return L(this,Pe.PLACEHOLDER_SRC)}set placeholderSrc(e){C(this,Pe.SRC,e)}get src(){return L(this,Pe.SRC)}set src(e){C(this,Pe.SRC,e)}};l.customElements.get("media-poster-image")||l.customElements.define("media-poster-image",Co);var si={SEEK_OFFSET:"seekoffset"},dr=30,_m=`<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)">${dr}</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>`,wd=c.createElement("template");wd.innerHTML=`
689
+ <slot name="icon">${_m}</slot>
690
+ `;var ym=0,Mo=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_CURRENT_TIME,si.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:wd,...e})}connectedCallback(){this.seekOffset=R(this,si.SEEK_OFFSET,dr),super.connectedCallback()}attributeChangedCallback(e,t,a){e===si.SEEK_OFFSET&&(this.seekOffset=R(this,si.SEEK_OFFSET,dr)),super.attributeChangedCallback(e,t,a)}get seekOffset(){return R(this,si.SEEK_OFFSET,dr)}set seekOffset(e){O(this,si.SEEK_OFFSET,e),this.setAttribute("aria-label",D.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),ka(Sa(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return R(this,o.MEDIA_CURRENT_TIME,ym)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}handleClick(){let e=Math.max(this.mediaCurrentTime-this.seekOffset,0),t=new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)}};l.customElements.get("media-seek-backward-button")||l.customElements.define("media-seek-backward-button",Mo);var Dd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},xd=(i,e,t)=>(Dd(i,e,"read from private field"),t?t.call(i):e.get(i)),Tm=(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)},Im=(i,e,t,a)=>(Dd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Vi,Lo=class extends Ne{constructor(){super(),Tm(this,Vi,void 0),Im(this,Vi,this.shadowRoot.querySelector("slot")),xd(this,Vi).textContent=Le(0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PREVIEW_TIME&&a!=null&&(xd(this,Vi).textContent=Le(a))}get mediaPreviewTime(){return R(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}};Vi=new WeakMap;l.customElements.get("media-preview-time-display")||l.customElements.define("media-preview-time-display",Lo);var Od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ur=(i,e,t)=>(Od(i,e,"read from private field"),t?t.call(i):e.get(i)),km=(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)=>(Od(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ue,Nd=c.createElement("template");Nd.innerHTML=`
654
691
  <style>
655
692
  :host {
656
693
  box-sizing: border-box;
@@ -664,7 +701,7 @@
664
701
  }
665
702
  </style>
666
703
  <img crossorigin loading="eager" decoding="async">
667
- `;var yo=class extends l.HTMLElement{constructor(){super(),cm(this,Oe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(kd.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(rr(this,Oe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ar(this,Oe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ar(this,Oe))==null?void 0:e.unassociateElement)==null||t.call(e,this),rr(this,Oe,null)}attributeChangedCallback(e,t,a){var r,n,s,d,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ar(this,Oe))==null?void 0:r.unassociateElement)==null||n.call(r,this),rr(this,Oe,null)),a&&this.isConnected&&(rr(this,Oe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ar(this,Oe))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:h,maxHeight:m,minWidth:b,minHeight:E}=u,I=Math.min(parseInt(h)/n,parseInt(m)/s),H=Math.max(parseInt(b)/n,parseInt(E)/s),k=I<1,$=k?I:H>1?H:1,{style:Z}=N(this.shadowRoot,":host"),ee=N(this.shadowRoot,"img").style,je=this.shadowRoot.querySelector("img"),Ii=k?"min":"max";Z.setProperty(`${Ii}-width`,"initial","important"),Z.setProperty(`${Ii}-height`,"initial","important"),Z.width=`${n*$}px`,Z.height=`${s*$}px`;let Kt=()=>{ee.width=`${this.imgWidth*$}px`,ee.height=`${this.imgHeight*$}px`,ee.display="block"};je.src!==d&&(je.onload=()=>{this.imgWidth=je.naturalWidth,this.imgHeight=je.naturalHeight,Kt()},je.src=d,Kt()),Kt(),ee.transform=`translate(-${a*$}px, -${r*$}px)`}};Oe=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",yo);var Sd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Y=(i,e,t)=>(Sd(i,e,"read from private field"),t?t.call(i):e.get(i)),Ne=(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)},le=(i,e,t,a)=>(Sd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),mm=(i,e,t,a)=>({set _(r){le(i,e,r,t)},get _(){return Y(i,e,a)}}),oi,nr,si,Hi,or,sr,lr,li,Mt,dr,ur=class{constructor(e,t,a){Ne(this,oi,void 0),Ne(this,nr,void 0),Ne(this,si,void 0),Ne(this,Hi,void 0),Ne(this,or,void 0),Ne(this,sr,void 0),Ne(this,lr,void 0),Ne(this,li,void 0),Ne(this,Mt,0),Ne(this,dr,(r=performance.now())=>{le(this,Mt,requestAnimationFrame(Y(this,dr))),le(this,Hi,performance.now()-Y(this,si));let n=1e3/this.fps;if(Y(this,Hi)>n){le(this,si,r-Y(this,Hi)%n);let s=1e3/((r-Y(this,nr))/++mm(this,or)._),d=(r-Y(this,sr))/1e3/this.duration,u=Y(this,lr)+d*this.playbackRate;u-Y(this,oi).valueAsNumber>0?le(this,li,this.playbackRate/this.duration/s):(le(this,li,.995*Y(this,li)),u=Y(this,oi).valueAsNumber+Y(this,li)),this.callback(u)}}),le(this,oi,e),this.callback=t,this.fps=a}start(){Y(this,Mt)===0&&(le(this,si,performance.now()),le(this,nr,Y(this,si)),le(this,or,0),Y(this,dr).call(this))}stop(){Y(this,Mt)!==0&&(cancelAnimationFrame(Y(this,Mt)),le(this,Mt,0))}update({start:e,duration:t,playbackRate:a}){let r=e-Y(this,oi).valueAsNumber;(r>0||r<-.03)&&this.callback(e),le(this,lr,e),le(this,sr,performance.now()),this.duration=t,this.playbackRate=a}};oi=new WeakMap;nr=new WeakMap;si=new WeakMap;Hi=new WeakMap;or=new WeakMap;sr=new WeakMap;lr=new WeakMap;li=new WeakMap;Mt=new WeakMap;dr=new WeakMap;var Co=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},de=(i,e,t)=>(Co(i,e,"read from private field"),t?t.call(i):e.get(i)),ae=(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)},st=(i,e,t,a)=>(Co(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),he=(i,e,t)=>(Co(i,e,"access private method"),t),di,Lt,cr,mr,$i,hr,pr,ui,Wi,Mo,Md,To,br,Lo,Io,Ld,Fi,Er,ko,Rd,hm="video not loaded, unknown time.",pm=i=>{let e=i.range,t=_t(+xd(i)),a=_t(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:hm;e.setAttribute("aria-valuetext",r)},wd=c.createElement("template");wd.innerHTML=`
704
+ `;var Ro=class extends l.HTMLElement{constructor(){super(),km(this,Ue,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Nd.content.cloneNode(!0)))}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(cr(this,Ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ur(this,Ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ur(this,Ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),cr(this,Ue,null)}attributeChangedCallback(e,t,a){var r,n,s,d,u;[o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ur(this,Ue))==null?void 0:r.unassociateElement)==null||n.call(r,this),cr(this,Ue,null)),a&&this.isConnected&&(cr(this,Ue,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ur(this,Ue))==null?void 0:d.associateElement)==null||u.call(d,this)))}get mediaPreviewImage(){return L(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){C(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){let e=this.getAttribute(o.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(t=>+t)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(o.MEDIA_PREVIEW_COORDS);return}this.setAttribute(o.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){let e=this.mediaPreviewCoords,t=this.mediaPreviewImage;if(!(e&&t))return;let[a,r,n,s]=e,d=t.split("#")[0],u=getComputedStyle(this),{maxWidth:m,maxHeight:h,minWidth:p,minHeight:b}=u,_=Math.min(parseInt(m)/n,parseInt(h)/s),P=Math.max(parseInt(p)/n,parseInt(b)/s),I=_<1,V=I?_:P>1?P:1,{style:F}=N(this.shadowRoot,":host"),re=N(this.shadowRoot,"img").style,tt=this.shadowRoot.querySelector("img"),ki=I?"min":"max";F.setProperty(`${ki}-width`,"initial","important"),F.setProperty(`${ki}-height`,"initial","important"),F.width=`${n*V}px`,F.height=`${s*V}px`;let Yt=()=>{re.width=`${this.imgWidth*V}px`,re.height=`${this.imgHeight*V}px`,re.display="block"};tt.src!==d&&(tt.onload=()=>{this.imgWidth=tt.naturalWidth,this.imgHeight=tt.naturalHeight,Yt()},tt.src=d,Yt()),Yt(),re.transform=`translate(-${a*V}px, -${r*V}px)`}};Ue=new WeakMap;l.customElements.get("media-preview-thumbnail")||l.customElements.define("media-preview-thumbnail",Ro);var Ud=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Pd=(i,e,t)=>(Ud(i,e,"read from private field"),t?t.call(i):e.get(i)),Sm=(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)},Cm=(i,e,t,a)=>(Ud(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wi,wo=class extends nd{constructor(){super(),Sm(this,Wi,void 0),Cm(this,Wi,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,t,a){if(super.attributeChangedCallback(e,t,a),e===o.MEDIA_PREVIEW_CHAPTER&&a!==t){if(a==null){Pd(this,Wi).textContent="",this.removeAttribute("aria-valuetext");return}Pd(this,Wi).textContent=a,this.setAttribute("aria-valuetext",`chapter: ${a}`)}}get mediaPreviewChapter(){return L(this,o.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){C(this,o.MEDIA_PREVIEW_CHAPTER,e)}};Wi=new WeakMap;l.customElements.get("media-preview-chapter-display")||l.customElements.define("media-preview-chapter-display",wo);var Bd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},q=(i,e,t)=>(Bd(i,e,"read from private field"),t?t.call(i):e.get(i)),Be=(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)},ue=(i,e,t,a)=>(Bd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Mm=(i,e,t,a)=>({set _(r){ue(i,e,r,t)},get _(){return q(i,e,a)}}),li,mr,di,$i,hr,pr,br,ui,Lt,Er,vr=class{constructor(e,t,a){Be(this,li,void 0),Be(this,mr,void 0),Be(this,di,void 0),Be(this,$i,void 0),Be(this,hr,void 0),Be(this,pr,void 0),Be(this,br,void 0),Be(this,ui,void 0),Be(this,Lt,0),Be(this,Er,(r=performance.now())=>{ue(this,Lt,requestAnimationFrame(q(this,Er))),ue(this,$i,performance.now()-q(this,di));let n=1e3/this.fps;if(q(this,$i)>n){ue(this,di,r-q(this,$i)%n);let s=1e3/((r-q(this,mr))/++Mm(this,hr)._),d=(r-q(this,pr))/1e3/this.duration,u=q(this,br)+d*this.playbackRate;u-q(this,li).valueAsNumber>0?ue(this,ui,this.playbackRate/this.duration/s):(ue(this,ui,.995*q(this,ui)),u=q(this,li).valueAsNumber+q(this,ui)),this.callback(u)}}),ue(this,li,e),this.callback=t,this.fps=a}start(){q(this,Lt)===0&&(ue(this,di,performance.now()),ue(this,mr,q(this,di)),ue(this,hr,0),q(this,Er).call(this))}stop(){q(this,Lt)!==0&&(cancelAnimationFrame(q(this,Lt)),ue(this,Lt,0))}update({start:e,duration:t,playbackRate:a}){let r=e-q(this,li).valueAsNumber;(r>0||r<-.03)&&this.callback(e),ue(this,br,e),ue(this,pr,performance.now()),this.duration=t,this.playbackRate=a}};li=new WeakMap;mr=new WeakMap;di=new WeakMap;$i=new WeakMap;hr=new WeakMap;pr=new WeakMap;br=new WeakMap;ui=new WeakMap;Lt=new WeakMap;Er=new WeakMap;var Po=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Z=(i,e,t)=>(Po(i,e,"read from private field"),t?t.call(i):e.get(i)),J=(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)=>(Po(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),pe=(i,e,t)=>(Po(i,e,"access private method"),t),ci,Rt,gr,Yi,Ar,Fi,_r,yr,mi,hi,Ki,Uo,Hd,xo,Tr,Bo,Do,Vd,Gi,Ir,Oo,Wd,Lm="video not loaded, unknown time.",Rm=i=>{let e=i.range,t=yt(+Fd(i)),a=yt(+i.mediaSeekableEnd),r=t&&a?`${t} of ${a}`:Lm;e.setAttribute("aria-valuetext",r)},$d=c.createElement("template");$d.innerHTML=`
668
705
  <style>
669
706
  :host {
670
707
  --media-preview-border-radius: 3px;
@@ -684,6 +721,7 @@
684
721
  left: 0;
685
722
  bottom: 100%;
686
723
  pointer-events: none;
724
+ will-change: transform;
687
725
  }
688
726
 
689
727
  [part~="box"] {
@@ -755,8 +793,40 @@
755
793
  }
756
794
  }
757
795
 
796
+ media-preview-chapter-display,
797
+ ::slotted(media-preview-chapter-display) {
798
+ display: none;
799
+ line-height: 1.3;
800
+ min-width: 0;
801
+
802
+ transition: min-width 0s, border-radius 0s, margin 0s, padding 0s;
803
+ transition-delay: calc(var(--media-preview-transition-delay-out, 0s) + var(--media-preview-transition-duration-out, .25s));
804
+ background: var(--media-preview-chapter-background, var(--media-preview-background, var(--media-control-background, var(--media-secondary-color, rgb(20 20 30 / .7)))));
805
+ border-radius: var(--media-preview-chapter-border-radius,
806
+ var(--media-preview-border-radius) var(--media-preview-border-radius)
807
+ var(--media-preview-border-radius) var(--media-preview-border-radius));
808
+ padding: var(--media-preview-chapter-padding, 4px 10px);
809
+ margin: var(--media-preview-chapter-margin, 0 0 5px);
810
+ text-shadow: var(--media-preview-chapter-text-shadow, 0 0 4px rgb(0 0 0 / .75));
811
+ }
812
+
813
+ :host([${o.MEDIA_PREVIEW_IMAGE}]) media-preview-chapter-display,
814
+ :host([${o.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-chapter-display) {
815
+ transition-delay: var(--media-preview-transition-delay-in, .25s);
816
+ border-radius: var(--media-preview-chapter-border-radius, 0);
817
+ padding: var(--media-preview-chapter-padding, 4px 10px 0);
818
+ margin: var(--media-preview-chapter-margin, 0);
819
+ min-width: 100%;
820
+ }
821
+
822
+ media-preview-chapter-display[${o.MEDIA_PREVIEW_CHAPTER}]:not([${o.MEDIA_PREVIEW_CHAPTER}=""]),
823
+ ::slotted(media-preview-chapter-display[${o.MEDIA_PREVIEW_CHAPTER}]:not([${o.MEDIA_PREVIEW_CHAPTER}=""])) {
824
+ display: initial;
825
+ }
826
+
758
827
  media-preview-time-display,
759
828
  ::slotted(media-preview-time-display) {
829
+ line-height: 1.3;
760
830
  min-width: 0;
761
831
 
762
832
  transition: min-width 0s, border-radius 0s;
@@ -765,7 +835,7 @@
765
835
  border-radius: var(--media-preview-time-border-radius,
766
836
  var(--media-preview-border-radius) var(--media-preview-border-radius)
767
837
  var(--media-preview-border-radius) var(--media-preview-border-radius));
768
- padding: var(--media-preview-time-padding, 1px 10px 0);
838
+ padding: var(--media-preview-time-padding, 4px 10px);
769
839
  margin: var(--media-preview-time-margin, 0 0 10px);
770
840
  text-shadow: var(--media-preview-time-text-shadow, 0 0 4px rgb(0 0 0 / .75));
771
841
  }
@@ -773,14 +843,19 @@
773
843
  :host([${o.MEDIA_PREVIEW_IMAGE}]) media-preview-time-display,
774
844
  :host([${o.MEDIA_PREVIEW_IMAGE}]) ::slotted(media-preview-time-display) {
775
845
  transition-delay: var(--media-preview-transition-delay-in, .25s);
776
- min-width: 100%;
777
846
  border-radius: var(--media-preview-time-border-radius,
778
847
  0 0 var(--media-preview-border-radius) var(--media-preview-border-radius));
848
+ min-width: 100%;
849
+ }
850
+
851
+ :host([${o.MEDIA_PREVIEW_TIME}]:hover) {
852
+ --media-time-range-hover-display: block;
779
853
  }
780
854
  </style>
781
855
  <div id="preview-rail">
782
856
  <slot name="preview" part="box preview-box">
783
857
  <media-preview-thumbnail></media-preview-thumbnail>
858
+ <media-preview-chapter-display></media-preview-chapter-display>
784
859
  <media-preview-time-display></media-preview-time-display>
785
860
  </slot>
786
861
  </div>
@@ -789,7 +864,7 @@
789
864
 
790
865
  </slot>
791
866
  </div>
792
- `;var Cd=(i,e=i.mediaCurrentTime)=>{if(Number.isNaN(i.mediaSeekableEnd))return 0;let t=(e-i.mediaSeekableStart)/(i.mediaSeekableEnd-i.mediaSeekableStart);return Math.max(0,Math.min(t,1))},xd=(i,e=i.range.valueAsNumber)=>Number.isNaN(i.mediaSeekableEnd)?0:e*(i.mediaSeekableEnd-i.mediaSeekableStart)+i.mediaSeekableStart,So=class extends Ct{constructor(){super(),ae(this,ui),ae(this,Mo),ae(this,br),ae(this,Io),ae(this,Fi),ae(this,ko),ae(this,di,void 0),ae(this,Lt,void 0),ae(this,cr,void 0),ae(this,mr,void 0),ae(this,$i,void 0),ae(this,hr,void 0),ae(this,pr,void 0),ae(this,To,t=>{this.dragging||(this.range.valueAsNumber=t,this.updateBar())}),this.container.appendChild(wd.content.cloneNode(!0)),st(this,cr,this.shadowRoot.querySelectorAll('[part~="box"]')),st(this,mr,this.shadowRoot.querySelector('[part~="preview-box"]')),st(this,$i,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);st(this,hr,parseInt(e.getPropertyValue("--media-box-padding-left"))),st(this,pr,parseInt(e.getPropertyValue("--media-box-padding-right"))),st(this,Lt,new ur(this.range,de(this,To),60))}static get observedAttributes(){return[...super.observedAttributes,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,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",q.SEEK()),he(this,ui,Wi).call(this),st(this,di,this.getRootNode()),(e=de(this,di))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),he(this,ui,Wi).call(this),(e=de(this,di))==null||e.removeEventListener("transitionstart",this),st(this,di,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(de(this,Lt).update({start:Cd(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),he(this,ui,Wi).call(this),pm(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar())}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return L(this,o.MEDIA_LOADING)}set mediaLoading(e){C(this,o.MEDIA_LOADING,e)}get mediaDuration(){return M(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return M(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return x(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){R(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return M(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return L(this,o.MEDIA_ENDED)}set mediaEnded(e){C(this,o.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([d,u])=>d<=n&&n<=u))!=null?e:[];a=Cd(this,s)}let{style:r}=N(this.shadowRoot,"#highlight");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!de(this,$i).assignedElements().length)return;let e=he(this,br,Lo).call(this,de(this,$i),this.range.valueAsNumber),{style:t}=N(this.shadowRoot,"#current-rail");t.transform=`translateX(${e})`}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":he(this,ko,Rd).call(this);break;case"pointermove":he(this,Io,Ld).call(this,e);break;case"pointerup":case"pointerleave":he(this,Fi,Er).call(this,null);break;case"transitionstart":tt(e.target,this)&&setTimeout(()=>he(this,ui,Wi).call(this),0);break}}};di=new WeakMap;Lt=new WeakMap;cr=new WeakMap;mr=new WeakMap;$i=new WeakMap;hr=new WeakMap;pr=new WeakMap;ui=new WeakSet;Wi=function(){he(this,Mo,Md).call(this)?de(this,Lt).start():de(this,Lt).stop()};Mo=new WeakSet;Md=function(){return this.isConnected&&ol(this)&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded};To=new WeakMap;br=new WeakSet;Lo=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?it(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),d=n.getBoundingClientRect(),u=(de(this,hr)-(s.left-d.left-r/2))/s.width*100,h=(d.right-s.left-r/2-de(this,pr))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(h)||(a=`min(${a}, ${h*100}%)`),a};Io=new WeakSet;Ld=function(i){let e=[...de(this,cr)].some(d=>i.composedPath().includes(d));if(!this.dragging&&(e||!i.composedPath().includes(this))){he(this,Fi,Er).call(this,null);return}let t=this.mediaDuration;if(!t)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=he(this,br,Lo).call(this,de(this,mr),r),{style:s}=N(this.shadowRoot,"#preview-rail");s.transform=`translateX(${n})`,he(this,Fi,Er).call(this,r*t)};Fi=new WeakSet;Er=function(i){this.dispatchEvent(new l.CustomEvent(f.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};ko=new WeakSet;Rd=function(){de(this,Lt).stop();let i=xd(this);this.dispatchEvent(new l.CustomEvent(f.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",So);var Od=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ci=(i,e,t)=>(Od(i,e,"read from private field"),t?t.call(i):e.get(i)),Ro=(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)},mi=(i,e,t,a)=>(Od(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ue,fr,vr,Dd={LOADING_DELAY:"loadingdelay"},Nd=500,Ud=c.createElement("template"),bm=`
867
+ `;var fr=(i,e=i.mediaCurrentTime)=>{if(Number.isNaN(i.mediaSeekableEnd))return 0;let t=(e-i.mediaSeekableStart)/(i.mediaSeekableEnd-i.mediaSeekableStart);return Math.max(0,Math.min(t,1))},Fd=(i,e=i.range.valueAsNumber)=>Number.isNaN(i.mediaSeekableEnd)?0:e*(i.mediaSeekableEnd-i.mediaSeekableStart)+i.mediaSeekableStart,No=class extends Mt{constructor(){super(),J(this,hi),J(this,Uo),J(this,Tr),J(this,Do),J(this,Gi),J(this,Oo),J(this,ci,void 0),J(this,Rt,void 0),J(this,gr,void 0),J(this,Yi,void 0),J(this,Ar,void 0),J(this,Fi,void 0),J(this,_r,void 0),J(this,yr,void 0),J(this,mi,void 0),J(this,xo,t=>{this.dragging||(this.range.valueAsNumber=t,this.updateBar())}),this.container.appendChild($d.content.cloneNode(!0)),He(this,gr,this.shadowRoot.querySelectorAll('[part~="box"]')),He(this,Ar,this.shadowRoot.querySelector('[part~="preview-box"]')),He(this,Fi,this.shadowRoot.querySelector('[part~="current-box"]'));let e=getComputedStyle(this);He(this,_r,parseInt(e.getPropertyValue("--media-box-padding-left"))),He(this,yr,parseInt(e.getPropertyValue("--media-box-padding-right"))),He(this,Rt,new vr(this.range,Z(this,xo),60))}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_PAUSED,o.MEDIA_DURATION,o.MEDIA_SEEKABLE,o.MEDIA_CURRENT_TIME,o.MEDIA_PREVIEW_IMAGE,o.MEDIA_PREVIEW_TIME,o.MEDIA_PREVIEW_CHAPTER,o.MEDIA_BUFFERED,o.MEDIA_PLAYBACK_RATE,o.MEDIA_LOADING,o.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",X.SEEK()),pe(this,hi,Ki).call(this),He(this,ci,this.getRootNode()),(e=Z(this,ci))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),pe(this,hi,Ki).call(this),(e=Z(this,ci))==null||e.removeEventListener("transitionstart",this),He(this,ci,null)}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),t!=a&&(e===o.MEDIA_CURRENT_TIME||e===o.MEDIA_PAUSED||e===o.MEDIA_ENDED||e===o.MEDIA_LOADING||e===o.MEDIA_DURATION||e===o.MEDIA_SEEKABLE?(Z(this,Rt).update({start:fr(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),pe(this,hi,Ki).call(this),Rm(this)):e===o.MEDIA_BUFFERED&&this.updateBufferedBar(),e===o.MEDIA_DURATION&&(this.mediaChaptersCues=Z(this,mi)))}get mediaChaptersCues(){return Z(this,mi)}set mediaChaptersCues(e){var t;He(this,mi,e),this.updateSegments((t=Z(this,mi))==null?void 0:t.map(a=>({start:fr(this,a.startTime),end:fr(this,a.endTime)})))}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,o.MEDIA_LOADING)}set mediaLoading(e){M(this,o.MEDIA_LOADING,e)}get mediaDuration(){return R(this,o.MEDIA_DURATION)}set mediaDuration(e){O(this,o.MEDIA_DURATION,e)}get mediaCurrentTime(){return R(this,o.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){O(this,o.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return R(this,o.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){let e=this.getAttribute(o.MEDIA_BUFFERED);return e?e.split(" ").map(t=>t.split(":").map(a=>+a)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(o.MEDIA_BUFFERED);return}let t=e.map(a=>a.join(":")).join(" ");this.setAttribute(o.MEDIA_BUFFERED,t)}get mediaSeekable(){let e=this.getAttribute(o.MEDIA_SEEKABLE);if(e)return e.split(":").map(t=>+t)}set mediaSeekable(e){if(e==null){this.removeAttribute(o.MEDIA_SEEKABLE);return}this.setAttribute(o.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;let[,t=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaSeekableStart(){var e;let[t=0]=(e=this.mediaSeekable)!=null?e:[];return t}get mediaPreviewImage(){return L(this,o.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){C(this,o.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return R(this,o.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){O(this,o.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return w(this,o.MEDIA_ENDED)}set mediaEnded(e){M(this,o.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;let t=this.mediaBuffered;if(!t.length)return;let a;if(this.mediaEnded)a=1;else{let n=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=t.find(([d,u])=>d<=n&&n<=u))!=null?e:[];a=fr(this,s)}let{style:r}=N(this.shadowRoot,"#highlight");r.setProperty("width",`${a*100}%`)}updateCurrentBox(){if(!Z(this,Fi).assignedElements().length)return;let e=pe(this,Tr,Bo).call(this,Z(this,Fi),this.range.valueAsNumber),{style:t}=N(this.shadowRoot,"#current-rail");t.transform=`translateX(${e})`}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":pe(this,Oo,Wd).call(this);break;case"pointermove":pe(this,Do,Vd).call(this,e);break;case"pointerup":case"pointerleave":pe(this,Gi,Ir).call(this,null);break;case"transitionstart":it(e.target,this)&&setTimeout(()=>pe(this,hi,Ki).call(this),0);break}}};ci=new WeakMap;Rt=new WeakMap;gr=new WeakMap;Yi=new WeakMap;Ar=new WeakMap;Fi=new WeakMap;_r=new WeakMap;yr=new WeakMap;mi=new WeakMap;hi=new WeakSet;Ki=function(){pe(this,Uo,Hd).call(this)?Z(this,Rt).start():Z(this,Rt).stop()};Uo=new WeakSet;Hd=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaDuration>0&&pl(this)};xo=new WeakMap;Tr=new WeakSet;Bo=function(i,e){var t;let a=`${e*100*100}%`,r=i.offsetWidth;if(!r)return a;let n=(t=this.getAttribute("bounds")?at(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?t:this,s=this.range.getBoundingClientRect(),d=n.getBoundingClientRect(),u=(Z(this,_r)-(s.left-d.left-r/2))/s.width*100,m=(d.right-s.left-r/2-Z(this,yr))/s.width*100;return Number.isNaN(u)||(a=`max(${u*100}%, ${a})`),Number.isNaN(m)||(a=`min(${a}, ${m*100}%)`),a};Do=new WeakSet;Vd=function(i){let e=[...Z(this,gr)].some(u=>i.composedPath().includes(u));if(!this.dragging&&(e||!i.composedPath().includes(this))){pe(this,Gi,Ir).call(this,null);return}let t=this.mediaDuration;if(!t)return;let a=this.range.getBoundingClientRect(),r=(i.clientX-a.left)/a.width;r=Math.max(0,Math.min(1,r));let n=pe(this,Tr,Bo).call(this,Z(this,Ar),r),{style:s}=N(this.shadowRoot,"#preview-rail");s.transform=`translateX(${n})`;let d=Math.round(Z(this,Yi))-Math.round(r*t);Math.abs(d)<1||(He(this,Yi,r*t),pe(this,Gi,Ir).call(this,Z(this,Yi)))};Gi=new WeakSet;Ir=function(i){this.dispatchEvent(new l.CustomEvent(v.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:i}))};Oo=new WeakSet;Wd=function(){Z(this,Rt).stop();let i=Fd(this);this.dispatchEvent(new l.CustomEvent(v.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:i}))};l.customElements.get("media-time-range")||l.customElements.define("media-time-range",No);var Gd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},qi=(i,e,t)=>(Gd(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)},Zi=(i,e,t,a)=>(Gd(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ve,kr,Yd={LOADING_DELAY:"loadingdelay"},qd=500,Zd=c.createElement("template"),wm=`
793
868
  <svg aria-hidden="true" viewBox="0 0 100 100">
794
869
  <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">
795
870
  <animateTransform
@@ -802,13 +877,13 @@
802
877
  repeatCount="indefinite" />
803
878
  </path>
804
879
  </svg>
805
- `;Ud.innerHTML=`
880
+ `;Zd.innerHTML=`
806
881
  <style>
807
882
  :host {
808
883
  display: var(--media-control-display, var(--media-loading-indicator-display, inline-block));
809
884
  vertical-align: middle;
810
885
  box-sizing: border-box;
811
- --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${Nd}ms);
886
+ --_loading-indicator-delay: var(--media-loading-indicator-transition-delay, ${qd}ms);
812
887
  }
813
888
 
814
889
  #status {
@@ -847,12 +922,12 @@ svg, img, ::slotted(svg), ::slotted(img) {
847
922
  }
848
923
  </style>
849
924
 
850
- <slot name="icon">${bm}</slot>
851
- <div id="status" role="status" aria-live="polite">${q.MEDIA_LOADING()}</div>
852
- `;var wo=class extends l.HTMLElement{constructor(){if(super(),Ro(this,Ue,void 0),Ro(this,fr,Nd),Ro(this,vr,void 0),!this.shadowRoot){let t=this.attachShadow({mode:"open"}),a=Ud.content.cloneNode(!0);t.appendChild(a)}let{style:e}=N(this.shadowRoot,":host");mi(this,vr,e)}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,Dd.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===Dd.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=ci(this,Ue))==null?void 0:r.unassociateElement)==null||n.call(r,this),mi(this,Ue,null)),a&&this.isConnected&&(mi(this,Ue,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=ci(this,Ue))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(mi(this,Ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=ci(this,Ue))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=ci(this,Ue))==null?void 0:e.unassociateElement)==null||t.call(e,this),mi(this,Ue,null)}get loadingDelay(){return ci(this,fr)}set loadingDelay(e){mi(this,fr,e),ci(this,vr).setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return L(this,o.MEDIA_PAUSED)}set mediaPaused(e){C(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return L(this,o.MEDIA_LOADING)}set mediaLoading(e){C(this,o.MEDIA_LOADING,e)}};Ue=new WeakMap;fr=new WeakMap;vr=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",wo);var Em=1,fm=i=>i.mediaMuted?0:i.mediaVolume,vm=({value:i})=>`${Math.round(i*100)}%`,xo=class extends Ct{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(f.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",q.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=fm(this),this.range.setAttribute("aria-valuetext",vm(this.range)),this.updateBar())}get mediaVolume(){return M(this,o.MEDIA_VOLUME,Em)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return L(this,o.MEDIA_MUTED)}set mediaMuted(e){C(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return x(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){R(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",xo);var Bo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},G=(i,e,t)=>(Bo(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)},ye=(i,e,t,a)=>(Bo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_e=(i,e,t)=>(Bo(i,e,"access private method"),t),Pe,lt,pi,Ki,gr,Ar,Do,hi,Oo,_r,No,Yi,yr,Tr,Uo,Po,Pd,Vo,Bd,gm=`
925
+ <slot name="icon">${wm}</slot>
926
+ <div id="status" role="status" aria-live="polite">${X.MEDIA_LOADING()}</div>
927
+ `;var Ho=class extends l.HTMLElement{constructor(){if(super(),Kd(this,Ve,void 0),Kd(this,kr,qd),!this.shadowRoot){let e=this.attachShadow({mode:"open"}),t=Zd.content.cloneNode(!0);e.appendChild(t)}}static get observedAttributes(){return[A.MEDIA_CONTROLLER,o.MEDIA_PAUSED,o.MEDIA_LOADING,Yd.LOADING_DELAY]}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===Yd.LOADING_DELAY&&t!==a?this.loadingDelay=Number(a):e===A.MEDIA_CONTROLLER&&(t&&((n=(r=qi(this,Ve))==null?void 0:r.unassociateElement)==null||n.call(r,this),Zi(this,Ve,null)),a&&this.isConnected&&(Zi(this,Ve,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=qi(this,Ve))==null?void 0:d.associateElement)==null||u.call(d,this)))}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Zi(this,Ve,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=qi(this,Ve))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;(t=(e=qi(this,Ve))==null?void 0:e.unassociateElement)==null||t.call(e,this),Zi(this,Ve,null)}get loadingDelay(){return qi(this,kr)}set loadingDelay(e){Zi(this,kr,e);let{style:t}=N(this.shadowRoot,":host");t.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return w(this,o.MEDIA_PAUSED)}set mediaPaused(e){M(this,o.MEDIA_PAUSED,e)}get mediaLoading(){return w(this,o.MEDIA_LOADING)}set mediaLoading(e){M(this,o.MEDIA_LOADING,e)}};Ve=new WeakMap;kr=new WeakMap;l.customElements.get("media-loading-indicator")||l.customElements.define("media-loading-indicator",Ho);var xm=1,Dm=i=>i.mediaMuted?0:i.mediaVolume,Om=({value:i})=>`${Math.round(i*100)}%`,Vo=class extends Mt{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_VOLUME,o.MEDIA_MUTED,o.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{let e=this.range.value,t=new l.CustomEvent(v.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(t)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",X.VOLUME())}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),(e===o.MEDIA_VOLUME||e===o.MEDIA_MUTED)&&(this.range.valueAsNumber=Dm(this),this.range.setAttribute("aria-valuetext",Om(this.range)),this.updateBar())}get mediaVolume(){return R(this,o.MEDIA_VOLUME,xm)}set mediaVolume(e){O(this,o.MEDIA_VOLUME,e)}get mediaMuted(){return w(this,o.MEDIA_MUTED)}set mediaMuted(e){M(this,o.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return L(this,o.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){C(this,o.MEDIA_VOLUME_UNAVAILABLE,e)}};l.customElements.get("media-volume-range")||l.customElements.define("media-volume-range",Vo);var Go=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},z=(i,e,t)=>(Go(i,e,"read from private field"),t?t.call(i):e.get(i)),ce=(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)=>(Go(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Te=(i,e,t)=>(Go(i,e,"access private method"),t),We,dt,bi,Qi,Sr,Cr,Wo,pi,$o,Mr,Fo,zi,Lr,Rr,Ko,Yo,Qd,qo,zd,Nm=`
853
928
  <svg aria-hidden="true" viewBox="0 1 24 24" part="select-indicator indicator">
854
929
  <path d="m10 15.17 9.193-9.191 1.414 1.414-10.606 10.606-6.364-6.364 1.414-1.414 4.95 4.95Z"/>
855
- </svg>`;function Be(i,e,t){let a=c.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=c.createElement("span");return r.textContent=i,a.append(r),a}function Te(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var Vd=c.createElement("template");Vd.innerHTML=`
930
+ </svg>`;function $e(i,e,t){let a=c.createElement("media-chrome-option");a.part.add("option"),a.value=e,a.selected=t;let r=c.createElement("span");return r.textContent=i,a.append(r),a}function ke(i,e){let t=i.querySelector(`:scope > [slot="${e}"]`);return(t==null?void 0:t.nodeName)=="SLOT"&&(t=t.assignedElements({flatten:!0})[0]),t?(t=t.cloneNode(!0),t.removeAttribute("slot"),t):i.shadowRoot.querySelector(`[name="${e}"] > svg`).cloneNode(!0)}var Xd=c.createElement("template");Xd.innerHTML=`
856
931
  <style>
857
932
  :host {
858
933
  font: var(--media-font,
@@ -931,8 +1006,8 @@ svg, img, ::slotted(svg), ::slotted(img) {
931
1006
  </style>
932
1007
  <slot name="header"></slot>
933
1008
  <slot id="container"></slot>
934
- <slot name="select-indicator" hidden>${gm}</slot>
935
- `;var pe=class extends l.HTMLElement{constructor(e={}){super(),ue(this,Ar),ue(this,_r),ue(this,Yi),ue(this,Tr),ue(this,Po),ue(this,Vo),ue(this,Pe,void 0),ue(this,lt,""),ue(this,pi,null),ue(this,Ki,!1),ue(this,gr,t=>{this.handleClick(t)}),ue(this,hi,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",G(this,hi));return}if(a==="Meta"){ye(this,Ki,!1);return}_e(this,Ar,Do).call(this,t)}),ue(this,Oo,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",G(this,hi));return}if(a==="Meta"){ye(this,Ki,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),G(this,Ki)&&this.keysUsed.includes(a)){_e(this,Ar,Do).call(this,t);return}this.addEventListener("keyup",G(this,hi),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=Vd.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled","style",A.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);t&&_e(this,Tr,Uo).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",G(this,gr)),this.addEventListener("keydown",G(this,Oo))}disable(){this.removeEventListener("click",G(this,gr)),this.removeEventListener("keyup",G(this,hi))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e==="style"&&a!==t?_e(this,_r,No).call(this):e===A.MEDIA_CONTROLLER?(t&&((n=(r=G(this,Pe))==null?void 0:r.unassociateElement)==null||n.call(r,this),ye(this,Pe,null)),a&&this.isConnected&&(ye(this,Pe,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=G(this,Pe))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;_e(this,_r,No).call(this),this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(ye(this,Pe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=G(this,Pe))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=G(this,Pe))==null?void 0:e.unassociateElement)==null||t.call(e,this),ye(this,Pe,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=_e(this,Yi,yr).call(this,e);a&&_e(this,Tr,Uo).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=_e(this,Yi,yr).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=_e(this,Po,Pd).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=_e(this,Yi,yr).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};Pe=new WeakMap;lt=new WeakMap;pi=new WeakMap;Ki=new WeakMap;gr=new WeakMap;Ar=new WeakSet;Do=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};hi=new WeakMap;Oo=new WeakMap;_r=new WeakSet;No=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=((i=getComputedStyle(this).getPropertyValue("--media-listbox-layout"))==null?void 0:i.trim())==="row";e.setAttribute("media",t?"":"width:0")};Yi=new WeakSet;yr=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Tr=new WeakSet;Uo=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};Po=new WeakSet;Pd=function(i){_e(this,Vo,Bd).call(this);let e=this.options,t=e.findIndex(h=>h.getAttribute("tabindex")==="0");ye(this,lt,G(this,lt)+i);let a=G(this,lt).split("").every(h=>h===i),r=e.slice(t+(a?1:0)).filter(h=>h.textContent.toLowerCase().startsWith(G(this,lt))),n=e.slice(0,t-(a?1:0)).filter(h=>h.textContent.toLowerCase().startsWith(G(this,lt))),s=[],d=[];return a&&(s=e.slice(t+(a?1:0)).filter(h=>h.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(h=>h.textContent.startsWith(i))),[...r,...n,...s,...d][0]};Vo=new WeakSet;Bd=function(){clearTimeout(G(this,pi)),ye(this,pi,null),ye(this,pi,setTimeout(()=>{ye(this,lt,""),ye(this,pi,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",pe);var Yo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Wo=(i,e,t)=>(Yo(i,e,"read from private field"),t?t.call(i):e.get(i)),Ho=(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)},$o=(i,e,t,a)=>(Yo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Hd=(i,e,t)=>(Yo(i,e,"access private method"),t),Ir,bi,kr,Fo,$d=c.createElement("template");$d.innerHTML=`
1009
+ <slot name="select-indicator" hidden>${Nm}</slot>
1010
+ `;var be=class extends l.HTMLElement{constructor(e={}){super(),ce(this,Cr),ce(this,Mr),ce(this,zi),ce(this,Rr),ce(this,Yo),ce(this,qo),ce(this,We,void 0),ce(this,dt,""),ce(this,bi,null),ce(this,Qi,!1),ce(this,Sr,t=>{this.handleClick(t)}),ce(this,pi,t=>{let{key:a}=t;if(a==="Escape"){this.removeEventListener("keyup",z(this,pi));return}if(a==="Meta"){Ie(this,Qi,!1);return}Te(this,Cr,Wo).call(this,t)}),ce(this,$o,t=>{let{key:a,altKey:r}=t;if(r){this.removeEventListener("keyup",z(this,pi));return}if(a==="Meta"){Ie(this,Qi,!0);return}if(this.keysUsed.includes(a)&&t.preventDefault(),z(this,Qi)&&this.keysUsed.includes(a)){Te(this,Cr,Wo).call(this,t);return}this.addEventListener("keyup",z(this,pi),{once:!0})}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.nativeEl=Xd.content.cloneNode(!0),e.slotTemplate&&this.nativeEl.append(e.slotTemplate.content.cloneNode(!0)),this.shadowRoot.append(this.nativeEl)),this.container=this.shadowRoot.querySelector("#container"),this.container.addEventListener("slotchange",t=>{for(let a of t.target.assignedNodes({flatten:!0}))a.nodeType===3&&a.textContent.trim()===""&&a.remove()})}static get observedAttributes(){return["disabled","style",A.MEDIA_CONTROLLER]}static formatOptionText(e){return e}formatOptionText(e,t){return this.constructor.formatOptionText(e,t)}get options(){var e;let t=this.querySelectorAll("media-chrome-option");return t.length||(t=(e=this.container)==null?void 0:e.querySelectorAll("media-chrome-option")),Array.from(t)}get selectedOptions(){return this.options.filter(e=>e.selected)}get value(){var e,t;return(t=(e=this.selectedOptions[0])==null?void 0:e.value)!=null?t:""}set value(e){let t=this.options.find(a=>a.value===e);t&&Te(this,Rr,Ko).call(this,t)}focus(){var e;(e=this.selectedOptions[0])==null||e.focus()}enable(){this.addEventListener("click",z(this,Sr)),this.addEventListener("keydown",z(this,$o))}disable(){this.removeEventListener("click",z(this,Sr)),this.removeEventListener("keyup",z(this,pi))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e==="style"&&a!==t?Te(this,Mr,Fo).call(this):e===A.MEDIA_CONTROLLER?(t&&((n=(r=z(this,We))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ie(this,We,null)),a&&this.isConnected&&(Ie(this,We,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=z(this,We))==null?void 0:d.associateElement)==null||u.call(d,this))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;Te(this,Mr,Fo).call(this),this.hasAttribute("disabled")||this.enable(),this.hasAttribute("role")||this.setAttribute("role","listbox");let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ie(this,We,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=z(this,We))==null?void 0:t.associateElement)==null||a.call(t,this))}disconnectedCallback(){var e,t;this.disable(),(t=(e=z(this,We))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ie(this,We,null)}get keysUsed(){return["Enter"," ","ArrowDown","ArrowUp","Home","End"]}handleSelection(e,t){let a=Te(this,zi,Lr).call(this,e);a&&Te(this,Rr,Ko).call(this,a,t)}handleMovement(e){let{key:t}=e,a=this.options,r=Te(this,zi,Lr).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=Te(this,Yo,Qd).call(this,t);break}n&&(a.forEach(s=>s.setAttribute("tabindex","-1")),n.setAttribute("tabindex","0"),n.focus())}handleClick(e){let t=Te(this,zi,Lr).call(this,e);!t||t.hasAttribute("disabled")||(this.options.forEach(a=>a.setAttribute("tabindex","-1")),t.setAttribute("tabindex","0"),this.handleSelection(e,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"))}};We=new WeakMap;dt=new WeakMap;bi=new WeakMap;Qi=new WeakMap;Sr=new WeakMap;Cr=new WeakSet;Wo=function(i){let{key:e}=i;e==="Enter"||e===" "?this.handleSelection(i,this.hasAttribute("aria-multiselectable")&&this.getAttribute("aria-multiselectable")==="true"):this.handleMovement(i)};pi=new WeakMap;$o=new WeakMap;Mr=new WeakSet;Fo=function(){var i;let e=this.shadowRoot.querySelector("#layout-row"),t=((i=getComputedStyle(this).getPropertyValue("--media-listbox-layout"))==null?void 0:i.trim())==="row";e.setAttribute("media",t?"":"width:0")};zi=new WeakSet;Lr=function(i){let e=i.composedPath(),t=e.findIndex(a=>a.nodeName==="MEDIA-CHROME-OPTION");return e[t]};Rr=new WeakSet;Ko=function(i,e){let t=[...this.selectedOptions];(!this.hasAttribute("aria-multiselectable")||this.getAttribute("aria-multiselectable")!=="true")&&this.options.forEach(a=>a.selected=!1),e?i.selected=!i.selected:i.selected=!0,this.selectedOptions.some((a,r)=>a!=t[r])&&this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))};Yo=new WeakSet;Qd=function(i){Te(this,qo,zd).call(this);let e=this.options,t=e.findIndex(m=>m.getAttribute("tabindex")==="0");Ie(this,dt,z(this,dt)+i);let a=z(this,dt).split("").every(m=>m===i),r=e.slice(t+(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(z(this,dt))),n=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.toLowerCase().startsWith(z(this,dt))),s=[],d=[];return a&&(s=e.slice(t+(a?1:0)).filter(m=>m.textContent.startsWith(i)),d=e.slice(0,t-(a?1:0)).filter(m=>m.textContent.startsWith(i))),[...r,...n,...s,...d][0]};qo=new WeakSet;zd=function(){clearTimeout(z(this,bi)),Ie(this,bi,null),Ie(this,bi,setTimeout(()=>{Ie(this,dt,""),Ie(this,bi,null)},500))};l.customElements.get("media-chrome-listbox")||l.customElements.define("media-chrome-listbox",be);var jo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},zo=(i,e,t)=>(jo(i,e,"read from private field"),t?t.call(i):e.get(i)),Zo=(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)},Qo=(i,e,t,a)=>(jo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Jd=(i,e,t)=>(jo(i,e,"access private method"),t),wr,Ei,xr,Xo,jd=c.createElement("template");jd.innerHTML=`
936
1011
  <style>
937
1012
  :host {
938
1013
  cursor: pointer;
@@ -970,7 +1045,7 @@ svg, img, ::slotted(svg), ::slotted(img) {
970
1045
  }
971
1046
  </style>
972
1047
  <slot></slot>
973
- `;var dt={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},Sr=class extends l.HTMLElement{constructor(){super(),Ho(this,kr),Ho(this,Ir,!1),Ho(this,bi,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($d.content.cloneNode(!0)))}static get observedAttributes(){return[dt.DISABLED,dt.SELECTED,dt.VALUE]}get value(){var e;return(e=this.getAttribute(dt.VALUE))!=null?e:this.text}set value(e){this.setAttribute(dt.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){$o(this,Ir,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}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){e===dt.SELECTED&&!Wo(this,Ir)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===dt.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(dt.DISABLED)||this.enable(),this.setAttribute("role","option"),$o(this,bi,Ko(this,this.parentNode)),Hd(this,kr,Fo).call(this)}disconnectedCallback(){this.disable(),Hd(this,kr,Fo).call(this),$o(this,bi,null)}handleClick(){}};Ir=new WeakMap;bi=new WeakMap;kr=new WeakSet;Fo=function(){var i;let e=(i=Wo(this,bi))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),Wo(this,bi).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function Ko(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Ko(i,t):e!=null&&e.options?e:Ko(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",Sr);var Zo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},v=(i,e,t)=>(Zo(i,e,"read from private field"),t?t.call(i):e.get(i)),re=(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)},Ve=(i,e,t,a)=>(Zo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Rt=(i,e,t)=>(Zo(i,e,"access private method"),t),He,Q,Gi,V,Ie,Ei,Cr,Mr,Lr,Rr,wr,Go,qo,Wd,fi,Zi,wt,Fd=c.createElement("template");Fd.innerHTML=`
1048
+ `;var ut={VALUE:"value",SELECTED:"selected",DISABLED:"disabled"},Dr=class extends l.HTMLElement{constructor(){super(),Zo(this,xr),Zo(this,wr,!1),Zo(this,Ei,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(jd.content.cloneNode(!0)))}static get observedAttributes(){return[ut.DISABLED,ut.SELECTED,ut.VALUE]}get value(){var e;return(e=this.getAttribute(ut.VALUE))!=null?e:this.text}set value(e){this.setAttribute(ut.VALUE,e)}get text(){var e;return((e=this.textContent)!=null?e:"").trim()}get selected(){return this.getAttribute("aria-selected")==="true"}set selected(e){Qo(this,wr,!0),this.setAttribute("aria-selected",e?"true":"false"),e?this.part.add("option-selected"):this.part.remove("option-selected")}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){e===ut.SELECTED&&!zo(this,wr)?this.setAttribute("aria-selected",a!=null?"true":"false"):e===ut.DISABLED&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){this.hasAttribute(ut.DISABLED)||this.enable(),this.setAttribute("role","option"),Qo(this,Ei,Jo(this,this.parentNode)),Jd(this,xr,Xo).call(this)}disconnectedCallback(){this.disable(),Jd(this,xr,Xo).call(this),Qo(this,Ei,null)}handleClick(){}};wr=new WeakMap;Ei=new WeakMap;xr=new WeakSet;Xo=function(){var i;let e=(i=zo(this,Ei))==null?void 0:i.options;if(!e)return;let t=e.filter(a=>a.getAttribute("aria-selected")==="true").pop();t||(t=e[0]),zo(this,Ei).getAttribute("aria-multiselectable")!=="true"&&e.forEach(a=>{a.setAttribute("tabindex","-1"),a.setAttribute("aria-selected","false")}),t==null||t.setAttribute("tabindex","0"),t==null||t.setAttribute("aria-selected","true")};function Jo(i,e){if(!i)return null;let{host:t}=i.getRootNode();return!e&&t?Jo(i,t):e!=null&&e.options?e:Jo(e,e==null?void 0:e.parentNode)}l.customElements.get("media-chrome-option")||l.customElements.define("media-chrome-option",Dr);var ts=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},f=(i,e,t)=>(ts(i,e,"read from private field"),t?t.call(i):e.get(i)),se=(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)},Fe=(i,e,t,a)=>(ts(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),wt=(i,e,t)=>(ts(i,e,"access private method"),t),Ke,j,Xi,$,Se,vi,Or,Nr,Pr,Ur,Br,es,is,eu,fi,Ji,xt,tu=c.createElement("template");tu.innerHTML=`
974
1049
  <style>
975
1050
  :host {
976
1051
  font: var(--media-font,
@@ -1021,22 +1096,22 @@ svg, img, ::slotted(svg), ::slotted(img) {
1021
1096
  <slot></slot>
1022
1097
  </media-chrome-listbox>
1023
1098
  </slot>
1024
- `;var be=class extends l.HTMLElement{constructor(){var e;super(),re(this,wr),re(this,qo),re(this,fi),re(this,He,void 0),re(this,Q,void 0),re(this,Gi,void 0),re(this,V,void 0),re(this,Ie,void 0),re(this,Ei,a=>{let{key:r}=a;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",v(this,Ei));return}a.composedPath().includes(v(this,Q))&&(r==="Enter"||r===" ")?Rt(this,wr,Go).call(this):r==="Escape"&&Rt(this,fi,Zi).call(this)}),re(this,Cr,a=>{let{metaKey:r,altKey:n,key:s}=a;if(r||n||!this.keysUsed.includes(s)){this.removeEventListener("keyup",v(this,Ei));return}a.preventDefault(),this.addEventListener("keyup",v(this,Ei),{once:!0})}),re(this,Mr,a=>{a.composedPath().includes(this)||Rt(this,fi,Zi).call(this)}),re(this,Lr,a=>{a.composedPath().includes(v(this,Q))&&Rt(this,wr,Go).call(this)}),re(this,Rr,()=>{Rt(this,fi,Zi).call(this)}),re(this,wt,()=>{if(v(this,V).offsetWidth===0)return;let a=v(this,V).offsetWidth,r=v(this,Q).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||v(this,Q).hasAttribute("mediacontroller")||v(this,V).hasAttribute("mediacontroller")){v(this,V).style.zIndex="1",v(this,V).style.bottom="unset",v(this,V).style.right=null,v(this,V).style.left="0",v(this,V).style.top=`${r.height}px`;return}let s=qi(this).getBoundingClientRect(),d=r.x+a,u=Math.max(r.right-d,r.right-s.right);v(this,V).style.left=null,v(this,V).style.right=`${u}px`,v(this,V).style.maxHeight=`${s.height-r.height}px`}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Fd.content.cloneNode(!0)));let{style:t}=N(this.shadowRoot,":host");t.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),(e=this.init)==null||e.call(this),Ve(this,Q,this.shadowRoot.querySelector("[part=button]")),Ve(this,V,this.shadowRoot.querySelector("[part=listbox]")),Ve(this,Gi,this.shadowRoot.querySelector("slot[name=button]")),v(this,Gi).addEventListener("slotchange",()=>{let a=v(this,Gi).assignedElements()[0];if(!a)return;Ve(this,Q,a),v(this,Q).preventClick=!0,this.hasAttribute("disabled")||v(this,Q).hasAttribute("disabled")?this.disable():(this.enable(),v(this,Q).setAttribute("aria-haspopup","listbox"))}),Ve(this,Ie,this.shadowRoot.querySelector("slot[name=listbox]")),v(this,Ie).addEventListener("slotchange",()=>{Ve(this,V,v(this,Ie).assignedElements()[0]||v(this,V))})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){v(this,Q).toggleAttribute("disabled",!1),this.addEventListener("change",v(this,Rr)),this.addEventListener("keydown",v(this,Cr)),this.addEventListener("click",v(this,Lr)),c.addEventListener("click",v(this,Mr))}disable(){v(this,Q).toggleAttribute("disabled",!0),this.removeEventListener("change",v(this,Rr)),this.removeEventListener("keydown",v(this,Cr)),this.removeEventListener("keyup",v(this,Ei)),this.removeEventListener("click",v(this,Lr)),c.removeEventListener("click",v(this,Mr))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=v(this,He))==null?void 0:r.unassociateElement)==null||n.call(r,this),Ve(this,He,null),v(this,V).removeAttribute(A.MEDIA_CONTROLLER)),a&&this.isConnected&&(Ve(this,He,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=v(this,He))==null?void 0:d.associateElement)==null||u.call(d,this),v(this,V).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let r=this.getAttribute(A.MEDIA_CONTROLLER);r&&(Ve(this,He,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(a=(t=v(this,He))==null?void 0:t.associateElement)==null||a.call(t,this),v(this,V).setAttribute(A.MEDIA_CONTROLLER,r)),this.hasAttribute("disabled")||this.enable(),v(this,Ie).hidden||Ci(qi(this),v(this,wt))}disconnectedCallback(){var e,t;Nn(qi(this),v(this,wt)),this.disable(),(t=(e=v(this,He))==null?void 0:e.unassociateElement)==null||t.call(e,this),Ve(this,He,null),v(this,V).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};He=new WeakMap;Q=new WeakMap;Gi=new WeakMap;V=new WeakMap;Ie=new WeakMap;Ei=new WeakMap;Cr=new WeakMap;Mr=new WeakMap;Lr=new WeakMap;Rr=new WeakMap;wr=new WeakSet;Go=function(){v(this,Ie).hidden?Rt(this,qo,Wd).call(this):Rt(this,fi,Zi).call(this)};qo=new WeakSet;Wd=function(){v(this,Ie).hidden&&(v(this,Ie).hidden=!1,v(this,Q).setAttribute("aria-expanded","true"),v(this,wt).call(this),v(this,V).focus(),Ci(qi(this),v(this,wt)))};fi=new WeakSet;Zi=function(){if(v(this,Ie).hidden)return;Nn(qi(this),v(this,wt));let i=Mn();v(this,Ie).hidden=!0,v(this,Q).setAttribute("aria-expanded","false"),tt(v(this,V),i)&&v(this,Q).focus()};wt=new WeakMap;function qi(i){var e;return(e=i.getAttribute("bounds")?it(i,`#${i.getAttribute("bounds")}`):Am(i)||i.parentElement)!=null?e:i}function Am(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):it(i,"media-controller")}l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",be);var jo=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_m=(i,e,t)=>(jo(i,e,"read from private field"),t?t.call(i):e.get(i)),Qo=(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)},ym=(i,e,t,a)=>(jo(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),zo=(i,e,t)=>(jo(i,e,"access private method"),t),Dr,Xo,Gd,xr,Jo,Tm=`
1099
+ `;var Ee=class extends l.HTMLElement{constructor(){var e;super(),se(this,Br),se(this,is),se(this,fi),se(this,Ke,void 0),se(this,j,void 0),se(this,Xi,void 0),se(this,$,void 0),se(this,Se,void 0),se(this,vi,t=>{let{key:a}=t;if(!this.keysUsed.includes(a)){this.removeEventListener("keyup",f(this,vi));return}t.composedPath().includes(f(this,j))&&(a==="Enter"||a===" ")?wt(this,Br,es).call(this):a==="Escape"&&wt(this,fi,Ji).call(this)}),se(this,Or,t=>{let{metaKey:a,altKey:r,key:n}=t;if(a||r||!this.keysUsed.includes(n)){this.removeEventListener("keyup",f(this,vi));return}t.preventDefault(),this.addEventListener("keyup",f(this,vi),{once:!0})}),se(this,Nr,t=>{t.composedPath().includes(this)||wt(this,fi,Ji).call(this)}),se(this,Pr,t=>{t.composedPath().includes(f(this,j))&&wt(this,Br,es).call(this)}),se(this,Ur,()=>{wt(this,fi,Ji).call(this)}),se(this,xt,()=>{if(f(this,$).offsetWidth===0)return;let t=f(this,$).offsetWidth,a=f(this,j).getBoundingClientRect();if(this.hasAttribute("mediacontroller")||f(this,j).hasAttribute("mediacontroller")||f(this,$).hasAttribute("mediacontroller")){f(this,$).style.zIndex="1",f(this,$).style.bottom="unset",f(this,$).style.right=null,f(this,$).style.left="0",f(this,$).style.top=`${a.height}px`;return}let n=ji(this).getBoundingClientRect(),s=a.x+t,d=Math.max(a.right-s,a.right-n.right);f(this,$).style.left=null,f(this,$).style.right=`${d}px`,f(this,$).style.maxHeight=`${n.height-a.height}px`}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(tu.content.cloneNode(!0))),(e=this.init)==null||e.call(this),Fe(this,j,this.shadowRoot.querySelector("[part=button]")),Fe(this,$,this.shadowRoot.querySelector("[part=listbox]")),Fe(this,Xi,this.shadowRoot.querySelector("slot[name=button]")),f(this,Xi).addEventListener("slotchange",()=>{let t=f(this,Xi).assignedElements()[0];if(!t)return;Fe(this,j,t),f(this,j).preventClick=!0,this.hasAttribute("disabled")||f(this,j).hasAttribute("disabled")?this.disable():(this.enable(),f(this,j).setAttribute("aria-haspopup","listbox"))}),Fe(this,Se,this.shadowRoot.querySelector("slot[name=listbox]")),f(this,Se).addEventListener("slotchange",()=>{Fe(this,$,f(this,Se).assignedElements()[0]||f(this,$))})}static get observedAttributes(){return["disabled",A.MEDIA_CONTROLLER]}enable(){f(this,j).toggleAttribute("disabled",!1),this.addEventListener("change",f(this,Ur)),this.addEventListener("keydown",f(this,Or)),this.addEventListener("click",f(this,Pr)),c.addEventListener("click",f(this,Nr))}disable(){f(this,j).toggleAttribute("disabled",!0),this.removeEventListener("change",f(this,Ur)),this.removeEventListener("keydown",f(this,Or)),this.removeEventListener("keyup",f(this,vi)),this.removeEventListener("click",f(this,Pr)),c.removeEventListener("click",f(this,Nr))}attributeChangedCallback(e,t,a){var r,n,s,d,u;e===A.MEDIA_CONTROLLER?(t&&((n=(r=f(this,Ke))==null?void 0:r.unassociateElement)==null||n.call(r,this),Fe(this,Ke,null),f(this,$).removeAttribute(A.MEDIA_CONTROLLER)),a&&this.isConnected&&(Fe(this,Ke,(s=this.getRootNode())==null?void 0:s.getElementById(a)),(u=(d=f(this,Ke))==null?void 0:d.associateElement)==null||u.call(d,this),f(this,$).setAttribute(A.MEDIA_CONTROLLER,a))):e==="disabled"&&a!==t&&(a==null?this.enable():this.disable())}connectedCallback(){var e,t,a;let{style:r}=N(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);let n=this.getAttribute(A.MEDIA_CONTROLLER);n&&(Fe(this,Ke,(e=this.getRootNode())==null?void 0:e.getElementById(n)),(a=(t=f(this,Ke))==null?void 0:t.associateElement)==null||a.call(t,this),f(this,$).setAttribute(A.MEDIA_CONTROLLER,n)),this.hasAttribute("disabled")||this.enable(),f(this,Se).hidden||Tt(ji(this),f(this,xt))}disconnectedCallback(){var e,t;Mi(ji(this),f(this,xt)),this.disable(),(t=(e=f(this,Ke))==null?void 0:e.unassociateElement)==null||t.call(e,this),Fe(this,Ke,null),f(this,$).removeAttribute(A.MEDIA_CONTROLLER)}get keysUsed(){return["Enter","Escape"," ","ArrowUp","ArrowDown","f","c","k","m"]}};Ke=new WeakMap;j=new WeakMap;Xi=new WeakMap;$=new WeakMap;Se=new WeakMap;vi=new WeakMap;Or=new WeakMap;Nr=new WeakMap;Pr=new WeakMap;Ur=new WeakMap;Br=new WeakSet;es=function(){f(this,Se).hidden?wt(this,is,eu).call(this):wt(this,fi,Ji).call(this)};is=new WeakSet;eu=function(){f(this,Se).hidden&&(f(this,Se).hidden=!1,f(this,j).setAttribute("aria-expanded","true"),f(this,xt).call(this),f(this,$).focus(),Tt(ji(this),f(this,xt)))};fi=new WeakSet;Ji=function(){if(f(this,Se).hidden)return;Mi(ji(this),f(this,xt));let i=Nn();f(this,Se).hidden=!0,f(this,j).setAttribute("aria-expanded","false"),it(f(this,$),i)&&f(this,j).focus()};xt=new WeakMap;function ji(i){var e;return(e=i.getAttribute("bounds")?at(i,`#${i.getAttribute("bounds")}`):Pm(i)||i.parentElement)!=null?e:i}function Pm(i){var e;let t=i.getAttribute(A.MEDIA_CONTROLLER);return t?(e=i.getRootNode())==null?void 0:e.getElementById(t):at(i,"media-controller")}l.customElements.get("media-chrome-selectmenu")||l.customElements.define("media-chrome-selectmenu",Ee);var ss=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Um=(i,e,t)=>(ss(i,e,"read from private field"),t?t.call(i):e.get(i)),as=(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)},Bm=(i,e,t,a)=>(ss(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),rs=(i,e,t)=>(ss(i,e,"access private method"),t),Vr,ns,ru,Hr,os,Hm=`
1025
1100
  <svg aria-hidden="true" viewBox="0 0 26 24" part="captions-indicator indicator">
1026
1101
  <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"/>
1027
- </svg>`,Zd=c.createElement("template");Zd.innerHTML=`
1028
- <slot name="captions-indicator" hidden>${Tm}</slot>
1029
- `;var Or=class extends pe{constructor(){super({slotTemplate:Zd}),Qo(this,Xo),Qo(this,xr),Qo(this,Dr,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?zo(this,Xo,Gd).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a: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.textTracks API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",zo(this,xr,Jo))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",zo(this,xr,Jo))}get mediaSubtitlesList(){return Kd(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){Yd(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return Kd(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){Yd(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Dr=new WeakMap;Xo=new WeakSet;Gd=function(){var i;if(_m(this,Dr)===JSON.stringify(this.mediaSubtitlesList))return;ym(this,Dr,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=Be(this.formatOptionText("Off"),"off",t);a.prepend(Te(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let s=Be(this.formatOptionText(n.label,n),Oa(n),this.value==Oa(n));s.prepend(Te(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&s.append(Te(this,"captions-indicator")),e.append(s)}};xr=new WeakSet;Jo=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(f.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(f.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};var Kd=(i,e)=>{let t=i.getAttribute(e);return t?wi(t):[]},Yd=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=It(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Or);var Nr=class extends be{init(){let e=c.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",Nr);var qd=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ur=(i,e,t)=>(qd(i,e,"read from private field"),t?t.call(i):e.get(i)),es=(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)=>(qd(i,e,"access private method"),t),vi,zi,Pr,Br,is,ts={RATES:"rates"},Vr=class extends pe{constructor(){super(),es(this,zi),es(this,Br),es(this,vi,new nt(this,ts.RATES,{defaultValue:vo})),Qi(this,zi,Pr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_PLAYBACK_RATE,ts.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===ts.RATES&&t!=a&&(Ur(this,vi).value=a,Qi(this,zi,Pr).call(this))}get rates(){return Ur(this,vi)}set rates(e){e?Array.isArray(e)&&(Ur(this,vi).value=e.join(" ")):Ur(this,vi).value="",Qi(this,zi,Pr).call(this)}get mediaPlaybackRate(){return M(this,o.MEDIA_PLAYBACK_RATE,ri)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Qi(this,Br,is))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Qi(this,Br,is))}};vi=new WeakMap;zi=new WeakSet;Pr=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=Be(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(Te(this,"select-indicator")),i.append(t)}};Br=new WeakSet;is=function(){if(!this.value)return;let i=new l.CustomEvent(f.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",Vr);var Hr=class extends be{init(){let e=c.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",Hr);var os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Qd=(i,e,t)=>(os(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)},as=(i,e,t,a)=>(os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Wr=(i,e,t)=>(os(i,e,"access private method"),t),Xi,Yr,Fr,rs,Kr,ns,Gr=class extends pe{constructor(){super(...arguments),$r(this,Fr),$r(this,Kr),$r(this,Xi,[]),$r(this,Yr,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a&&(as(this,Xi,js(a)),Wr(this,Fr,rs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Wr(this,Kr,ns))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Wr(this,Kr,ns))}get mediaRenditionList(){return Qd(this,Xi)}set mediaRenditionList(e){as(this,Xi,e),Wr(this,Fr,rs).call(this)}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,o.MEDIA_RENDITION_SELECTED,e)}};Xi=new WeakMap;Yr=new WeakMap;Fr=new WeakSet;rs=function(){if(Qd(this,Yr)===JSON.stringify(this.mediaRenditionList))return;as(this,Yr,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),s=Be(n,`${r.id}`,r.selected&&!t);s.prepend(Te(this,"select-indicator")),e.append(s)}let a=Be(this.formatOptionText("Auto"),"auto",t);a.prepend(Te(this,"select-indicator")),e.append(a)};Kr=new WeakSet;ns=function(){if(this.value==null)return;let i=new l.CustomEvent(f.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",Gr);var Im=`<svg aria-hidden="true" viewBox="0 0 24 24">
1102
+ </svg>`,nu=c.createElement("template");nu.innerHTML=`
1103
+ <slot name="captions-indicator" hidden>${Hm}</slot>
1104
+ `;var Wr=class extends be{constructor(){super({slotTemplate:nu}),as(this,ns),as(this,Hr),as(this,Vr,void 0)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_SUBTITLES_LIST,o.MEDIA_SUBTITLES_SHOWING]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_SUBTITLES_LIST&&t!==a?rs(this,ns,ru).call(this):e===o.MEDIA_SUBTITLES_SHOWING&&t!==a?this.value=a: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.textTracks API."))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",rs(this,Hr,os))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",rs(this,Hr,os))}get mediaSubtitlesList(){return iu(this,o.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){au(this,o.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return iu(this,o.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){au(this,o.MEDIA_SUBTITLES_SHOWING,e)}};Vr=new WeakMap;ns=new WeakSet;ru=function(){var i;if(Um(this,Vr)===JSON.stringify(this.mediaSubtitlesList))return;Bm(this,Vr,JSON.stringify(this.mediaSubtitlesList));let e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.value,a=$e(this.formatOptionText("Off"),"off",t);a.prepend(ke(this,"select-indicator")),e.append(a);let r=this.mediaSubtitlesList;for(let n of r){let s=$e(this.formatOptionText(n.label,n),Va(n),this.value==Va(n));s.prepend(ke(this,"select-indicator")),((i=n.kind)!=null?i:"subs")==="captions"&&s.append(ke(this,"captions-indicator")),e.append(s)}};Hr=new WeakSet;os=function(){let i=this.mediaSubtitlesShowing,e=this.getAttribute(o.MEDIA_SUBTITLES_SHOWING),t=this.value!==e;if(i!=null&&i.length&&t&&this.dispatchEvent(new l.CustomEvent(v.MEDIA_DISABLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:i})),!this.value||!t)return;let a=new l.CustomEvent(v.MEDIA_SHOW_SUBTITLES_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(a)};var iu=(i,e)=>{let t=i.getAttribute(e);return t?xi(t):[]},au=(i,e,t)=>{if(!(t!=null&&t.length)){i.removeAttribute(e);return}let a=St(t);i.getAttribute(e)!==a&&i.setAttribute(e,a)};l.customElements.get("media-captions-listbox")||l.customElements.define("media-captions-listbox",Wr);var $r=class extends Ee{init(){let e=c.createElement("media-captions-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-captions-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-captions-selectmenu")||l.customElements.define("media-captions-selectmenu",$r);var ou=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Fr=(i,e,t)=>(ou(i,e,"read from private field"),t?t.call(i):e.get(i)),ls=(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)},ea=(i,e,t)=>(ou(i,e,"access private method"),t),gi,ta,Kr,Yr,us,ds={RATES:"rates"},Gr=class extends be{constructor(){super(),ls(this,ta),ls(this,Yr),ls(this,gi,new ot(this,ds.RATES,{defaultValue:So})),ea(this,ta,Kr).call(this)}static get observedAttributes(){return[...super.observedAttributes,"aria-multiselectable",o.MEDIA_PLAYBACK_RATE,ds.RATES]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_PLAYBACK_RATE&&t!=a?this.value=a:e===ds.RATES&&t!=a&&(Fr(this,gi).value=a,ea(this,ta,Kr).call(this))}get rates(){return Fr(this,gi)}set rates(e){e?Array.isArray(e)&&(Fr(this,gi).value=e.join(" ")):Fr(this,gi).value="",ea(this,ta,Kr).call(this)}get mediaPlaybackRate(){return R(this,o.MEDIA_PLAYBACK_RATE,oi)}set mediaPlaybackRate(e){O(this,o.MEDIA_PLAYBACK_RATE,e)}connectedCallback(){super.connectedCallback(),this.addEventListener("change",ea(this,Yr,us))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",ea(this,Yr,us))}};gi=new WeakMap;ta=new WeakSet;Kr=function(){let i=this.shadowRoot.querySelector("#container");i.textContent="";for(let e of this.rates){let t=$e(this.formatOptionText(`${e}x`,e),e,this.mediaPlaybackRate==e);t.prepend(ke(this,"select-indicator")),i.append(t)}};Yr=new WeakSet;us=function(){if(!this.value)return;let i=new l.CustomEvent(v.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-playback-rate-listbox")||l.customElements.define("media-playback-rate-listbox",Gr);var qr=class extends Ee{init(){let e=c.createElement("media-playback-rate-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-playback-rate-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-playback-rate-selectmenu")||l.customElements.define("media-playback-rate-selectmenu",qr);var ps=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},su=(i,e,t)=>(ps(i,e,"read from private field"),t?t.call(i):e.get(i)),Zr=(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)},cs=(i,e,t,a)=>(ps(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Qr=(i,e,t)=>(ps(i,e,"access private method"),t),ia,Jr,zr,ms,Xr,hs,jr=class extends be{constructor(){super(...arguments),Zr(this,zr),Zr(this,Xr),Zr(this,ia,[]),Zr(this,Jr,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_LIST,o.MEDIA_RENDITION_SELECTED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_RENDITION_SELECTED&&t!==a?this.value=a!=null?a:"auto":e===o.MEDIA_RENDITION_LIST&&t!==a&&(cs(this,ia,sl(a)),Qr(this,zr,ms).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Qr(this,Xr,hs))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Qr(this,Xr,hs))}get mediaRenditionList(){return su(this,ia)}set mediaRenditionList(e){cs(this,ia,e),Qr(this,zr,ms).call(this)}get mediaRenditionSelected(){return L(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){C(this,o.MEDIA_RENDITION_SELECTED,e)}};ia=new WeakMap;Jr=new WeakMap;zr=new WeakSet;ms=function(){if(su(this,Jr)===JSON.stringify(this.mediaRenditionList))return;cs(this,Jr,JSON.stringify(this.mediaRenditionList));let i=this.mediaRenditionList.sort((r,n)=>n.height-r.height),e=this.shadowRoot.querySelector("#container");e.textContent="";let t=!this.mediaRenditionSelected;for(let r of i){let n=this.formatOptionText(`${Math.min(r.width,r.height)}p`,r),s=$e(n,`${r.id}`,r.selected&&!t);s.prepend(ke(this,"select-indicator")),e.append(s)}let a=$e(this.formatOptionText("Auto"),"auto",t);a.prepend(ke(this,"select-indicator")),e.append(a)};Xr=new WeakSet;hs=function(){if(this.value==null)return;let i=new l.CustomEvent(v.MEDIA_RENDITION_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-rendition-listbox")||l.customElements.define("media-rendition-listbox",jr);var Vm=`<svg aria-hidden="true" viewBox="0 0 24 24">
1030
1105
  <path d="M13.5 2.5h2v6h-2v-2h-11v-2h11v-2Zm4 2h4v2h-4v-2Zm-12 4h2v6h-2v-2h-3v-2h3v-2Zm4 2h12v2h-12v-2Zm1 4h2v6h-2v-2h-8v-2h8v-2Zm4 2h7v2h-7v-2Z" />
1031
- </svg>`,zd=c.createElement("template");zd.innerHTML=`
1032
- <slot name="icon">${Im}</slot>
1033
- `;var ss=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:zd})}get mediaRenditionSelected(){return x(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){R(this,o.MEDIA_RENDITION_SELECTED,e)}};l.customElements.get("media-rendition-button")||l.customElements.define("media-rendition-button",ss);var Zr=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}init(){let e=c.createElement("media-rendition-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-rendition-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-rendition-selectmenu")||l.customElements.define("media-rendition-selectmenu",Zr);var cs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Xd=(i,e,t)=>(cs(i,e,"read from private field"),t?t.call(i):e.get(i)),qr=(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)},ls=(i,e,t,a)=>(cs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Qr=(i,e,t)=>(cs(i,e,"access private method"),t),Ji,Jr,zr,ds,Xr,us,jr=class extends pe{constructor(){super(...arguments),qr(this,zr),qr(this,Xr),qr(this,Ji,[]),qr(this,Jr,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(ls(this,Ji,tl(a)),Qr(this,zr,ds).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",Qr(this,Xr,us))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",Qr(this,Xr,us))}get mediaAudioTrackList(){return Xd(this,Ji)}set mediaAudioTrackList(e){ls(this,Ji,e),Qr(this,zr,ds).call(this)}get mediaAudioTrackEnabled(){return x(this,o.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){R(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};Ji=new WeakMap;Jr=new WeakMap;zr=new WeakSet;ds=function(){if(Xd(this,Jr)===JSON.stringify(this.mediaAudioTrackList))return;ls(this,Jr,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList,e=this.shadowRoot.querySelector("#container");e.textContent="";for(let t of i){let a=this.formatOptionText(t.label,t),r=Be(a,`${t.id}`,t.enabled);r.prepend(Te(this,"select-indicator")),e.append(r)}};Xr=new WeakSet;us=function(){if(this.value==null)return;let i=new l.CustomEvent(f.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-listbox")||l.customElements.define("media-audio-track-listbox",jr);var km=`<svg aria-hidden="true" viewBox="0 0 24 24">
1106
+ </svg>`,lu=c.createElement("template");lu.innerHTML=`
1107
+ <slot name="icon">${Vm}</slot>
1108
+ `;var bs=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}constructor(){super({slotTemplate:lu})}get mediaRenditionSelected(){return L(this,o.MEDIA_RENDITION_SELECTED)}set mediaRenditionSelected(e){C(this,o.MEDIA_RENDITION_SELECTED,e)}};l.customElements.get("media-rendition-button")||l.customElements.define("media-rendition-button",bs);var en=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_RENDITION_SELECTED,o.MEDIA_RENDITION_UNAVAILABLE]}init(){let e=c.createElement("media-rendition-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-rendition-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-rendition-selectmenu")||l.customElements.define("media-rendition-selectmenu",en);var gs=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},du=(i,e,t)=>(gs(i,e,"read from private field"),t?t.call(i):e.get(i)),tn=(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)},Es=(i,e,t,a)=>(gs(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),an=(i,e,t)=>(gs(i,e,"access private method"),t),aa,on,rn,vs,nn,fs,sn=class extends be{constructor(){super(...arguments),tn(this,rn),tn(this,nn),tn(this,aa,[]),tn(this,on,void 0)}static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_LIST,o.MEDIA_AUDIO_TRACK_ENABLED]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e===o.MEDIA_AUDIO_TRACK_ENABLED&&t!==a?this.value=a:e===o.MEDIA_AUDIO_TRACK_LIST&&t!==a&&(Es(this,aa,dl(a)),an(this,rn,vs).call(this))}connectedCallback(){super.connectedCallback(),this.addEventListener("change",an(this,nn,fs))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",an(this,nn,fs))}get mediaAudioTrackList(){return du(this,aa)}set mediaAudioTrackList(e){Es(this,aa,e),an(this,rn,vs).call(this)}get mediaAudioTrackEnabled(){return L(this,o.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){C(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};aa=new WeakMap;on=new WeakMap;rn=new WeakSet;vs=function(){if(du(this,on)===JSON.stringify(this.mediaAudioTrackList))return;Es(this,on,JSON.stringify(this.mediaAudioTrackList));let i=this.mediaAudioTrackList,e=this.shadowRoot.querySelector("#container");e.textContent="";for(let t of i){let a=this.formatOptionText(t.label,t),r=$e(a,`${t.id}`,t.enabled);r.prepend(ke(this,"select-indicator")),e.append(r)}};nn=new WeakSet;fs=function(){if(this.value==null)return;let i=new l.CustomEvent(v.MEDIA_AUDIO_TRACK_REQUEST,{composed:!0,bubbles:!0,detail:this.value});this.dispatchEvent(i)};l.customElements.get("media-audio-track-listbox")||l.customElements.define("media-audio-track-listbox",sn);var Wm=`<svg aria-hidden="true" viewBox="0 0 24 24">
1034
1109
  <path d="M11 17H9.5V7H11v10Zm-3-3H6.5v-4H8v4Zm6-5h-1.5v6H14V9Zm3 7h-1.5V8H17v8Z"/>
1035
1110
  <path d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0Z"/>
1036
- </svg>`,Jd=c.createElement("template");Jd.innerHTML=`
1037
- <slot name="icon">${km}</slot>
1038
- `;var ms=class extends w{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:Jd})}get mediaAudioTrackEnabled(){return x(this,o.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){R(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",ms);var en=class extends be{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=c.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",en);var g=qu(require("@mux/mux-video")),P=require("@mux/playback-core");var lu=require("@mux/mux-video");var Sm="en",xt={code:Sm};var jd="en";function y(i,e=!0){var r,n;let t=e&&(n=(r=xt)==null?void 0:r[i])!=null?n:i,a=e?xt.code:jd;return new hs(t,a)}var hs=class{constructor(e,t=(a=>(a=xt.code)!=null?a:jd)()){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 eu(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${tn(t)}: ${a}; `)}),e?e.trim():void 0}function tn(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function an(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function $e(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function ps(i){let e=Cm(i).toString();return e?"?"+e:""}function Cm(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function ut(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 bs=(i,e)=>!i||!e?!1:i.contains(e)?!0:bs(i,e.getRootNode().host);var rn=require("@mux/playback-core");var tu="mux.com",Mm=()=>{try{return"2.3.2"}catch{}return"UNKNOWN"},Lm=Mm(),on=()=>Lm,iu=(i,{token:e,customDomain:t=tu,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=ut(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${ps({token:e,time:r})}`},au=(i,{token:e,customDomain:t=tu}={})=>{let{aud:a}=ut(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${ps({token:e,format:"webp"})}`},ji=i=>{if(i){if([rn.StreamTypes.LIVE,rn.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return rn.StreamTypes.LIVE}};var Rm={crossorigin:"crossOrigin",playsinline:"playsInline"};function ru(i){var e;return(e=Rm[i])!=null?e:an(i)}var Dt,Ot,J,nn=class{constructor(e,t){W(this,Dt,void 0);W(this,Ot,void 0);W(this,J,[]);ce(this,Dt,e),ce(this,Ot,t)}[Symbol.iterator](){return S(this,J).values()}get length(){return S(this,J).length}get value(){var e;return(e=S(this,J).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(ce(this,J,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return S(this,J)[e]}values(){return S(this,J).values()}keys(){return S(this,J).keys()}forEach(e){S(this,J).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||S(this,J).push(r)}),!(this.value===""&&!((t=S(this,Dt))!=null&&t.hasAttribute(`${S(this,Ot)}`)))&&((a=S(this,Dt))==null||a.setAttribute(`${S(this,Ot)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{S(this,J).splice(S(this,J).indexOf(a),1)}),(t=S(this,Dt))==null||t.setAttribute(`${S(this,Ot)}`,`${this.value}`)}contains(e){return S(this,J).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)}};Dt=new WeakMap,Ot=new WeakMap,J=new WeakMap;var nu=`[mux-player ${on()}]`;function ct(...i){console.warn(nu,...i)}function Ee(...i){console.error(nu,...i)}function Es(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+=` ${y("Read more: ")}
1039
- ${a}${i.file}`}ct(e)}var z={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Nt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},su=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}}),wm=lu.VideoEvents.filter(i=>i!=="error"),xm=Object.values(z).filter(i=>![z.PLAYSINLINE].includes(i)),Dm=Object.values(Nt);function du(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),wm.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var fs=class extends U.HTMLElement{static get observedAttributes(){return[...xm,...Dm]}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 d,u;let s=(d=this.media)==null?void 0:d.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 Nt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Nt.VOLUME:{let s=(r=$e(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Nt.PLAYBACKRATE:{let s=(n=$e(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 audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,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:su}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:su}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=$e(this.getAttribute(Nt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Nt.PLAYBACKRATE,`${e}`):this.removeAttribute(Nt.PLAYBACKRATE)}get crossOrigin(){return ea(this,z.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(z.CROSSORIGIN,`${e}`)}get autoplay(){return ea(this,z.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(z.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(z.AUTOPLAY)}get loop(){return ea(this,z.LOOP)!=null}set loop(e){e?this.setAttribute(z.LOOP,""):this.removeAttribute(z.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=!!e)}get defaultMuted(){return ea(this,z.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(z.MUTED,""):this.removeAttribute(z.MUTED)}get playsInline(){return ea(this,z.PLAYSINLINE)!=null}set playsInline(e){Ee("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(z.PRELOAD,e):this.removeAttribute(z.PRELOAD)}};function ea(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var vs=fs;var Om=Object.defineProperty,Nm=(i,e,t)=>e in i?Om(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Um=(i,e,t)=>(Nm(i,typeof e!="symbol"?e+"":e,t),t),pu=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},_=(i,e,t)=>(pu(i,e,"read from private field"),t?t.call(i):e.get(i)),We=(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)},Ze=(i,e,t,a)=>(pu(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),gi,sn,Ut,ta,mt,ht,pt,Pt,Ai,ln,ke,uu=1,cu=0,Pm=1,Bm={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 j&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof j?r.element[r.attributeName]=n:r.value=n}}}},qe=class extends l.DocumentFragment{constructor(e,t,a=Bm){var r;super(),We(this,gi,void 0),We(this,sn,void 0),this.append(e.content.cloneNode(!0)),Ze(this,gi,bu(this)),Ze(this,sn,a),(r=a.createCallback)==null||r.call(a,this,_(this,gi),t),a.processCallback(this,_(this,gi),t)}update(e){_(this,sn).processCallback(this,_(this,gi),e)}};gi=new WeakMap;sn=new WeakMap;var bu=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new gs;for([t,a]of hu(r.value))if(!t)n.append(a);else{let s=new j(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===uu&&!(r instanceof HTMLTemplateElement))bu(r,e);else if(r.nodeType===uu||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of hu(r.data))if(!t)n.push(new Text(a));else{let s=new Qe(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new ia(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},mu={},hu=i=>{let e="",t=0,a=mu[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([cu,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([Pm,e.trim()]),e="",r++):e+=n||"";return e&&a.push([cu,(t>0?"{{":"")+e]),mu[i]=a},Vm=11,dn=class{get value(){return""}set value(e){}toString(){return this.value}},Eu=new WeakMap,gs=class{constructor(){We(this,Ut,[])}[Symbol.iterator](){return _(this,Ut).values()}get length(){return _(this,Ut).length}item(e){return _(this,Ut)[e]}append(...e){for(let t of e)t instanceof j&&Eu.set(t,this),_(this,Ut).push(t)}toString(){return _(this,Ut).join("")}};Ut=new WeakMap;var j=class extends dn{constructor(e,t,a){super(),We(this,Pt),We(this,ta,""),We(this,mt,void 0),We(this,ht,void 0),We(this,pt,void 0),Ze(this,mt,e),Ze(this,ht,t),Ze(this,pt,a)}get attributeName(){return _(this,ht)}get attributeNamespace(){return _(this,pt)}get element(){return _(this,mt)}get value(){return _(this,ta)}set value(e){_(this,ta)!==e&&(Ze(this,ta,e),!_(this,Pt,Ai)||_(this,Pt,Ai).length===1?e==null?_(this,mt).removeAttributeNS(_(this,pt),_(this,ht)):_(this,mt).setAttributeNS(_(this,pt),_(this,ht),e):_(this,mt).setAttributeNS(_(this,pt),_(this,ht),_(this,Pt,Ai)))}get booleanValue(){return _(this,mt).hasAttributeNS(_(this,pt),_(this,ht))}set booleanValue(e){if(!_(this,Pt,Ai)||_(this,Pt,Ai).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};ta=new WeakMap;mt=new WeakMap;ht=new WeakMap;pt=new WeakMap;Pt=new WeakSet;Ai=function(){return Eu.get(this)};var Qe=class extends dn{constructor(e,t){super(),We(this,ln,void 0),We(this,ke,void 0),Ze(this,ln,e),Ze(this,ke,t?[...t]:[new Text])}get replacementNodes(){return _(this,ke)}get parentNode(){return _(this,ln)}get nextSibling(){return _(this,ke)[_(this,ke).length-1].nextSibling}get previousSibling(){return _(this,ke)[0].previousSibling}get value(){return _(this,ke).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===Vm?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Ze(this,ke,Hm(_(this,ke)[0].parentNode,_(this,ke),t,this.nextSibling))}};ln=new WeakMap;ke=new WeakMap;var ia=class extends Qe{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),Um(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function Hm(i,e,t,a=null){let r=0,n,s,d,u=t.length,h=e.length;for(;r<u&&r<h&&e[r]==t[r];)r++;for(;r<u&&r<h&&t[u-1]==e[h-1];)a=t[--h,--u];if(r==h)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<h;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<u&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var fu={string:i=>String(i)},cn=class{constructor(e){this.template=e,this.state=void 0}},Bt=new WeakMap,Vt=new WeakMap,As={partial:(i,e)=>{e[i.expression]=new cn(i.template)},if:(i,e)=>{var t;if(gu(i.expression,e))if(Bt.get(i)!==i.template){Bt.set(i,i.template);let a=new qe(i.template,e,mn);i.replace(a),Vt.set(i,a)}else(t=Vt.get(i))==null||t.update(e);else i.replace(""),Bt.delete(i),Vt.delete(i)}},$m=Object.keys(As),mn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof ia){if(!s.directive){let u=$m.find(h=>s.template.hasAttribute(h));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=As[s.directive])==null||a.call(As,s,t);continue}let d=gu(n,t);if(d instanceof cn){Bt.get(s)!==d.template?(Bt.set(s,d.template),d=new qe(d.template,d.state,mn),s.value=d,Vt.set(s,d)):(r=Vt.get(s))==null||r.update(d.state);continue}d?(s instanceof j&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof j?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Bt.delete(s),Vt.delete(s))):s instanceof j?s.value=void 0:(s.value=void 0,Bt.delete(s),Vt.delete(s))}}},vu={"!":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=fu[e])==null?void 0:t.call(fu,i)}};function Wm(i){return Fm(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function gu(i,e={}){var t,a,r,n,s,d,u;let h=Wm(i);if(h.length===0||h.some(({type:m})=>!m))return aa(i);if(((t=h[0])==null?void 0:t.token)===">"){let m=e[(a=h[1])==null?void 0:a.token];if(!m)return aa(i);let b={...e};m.state=b;let E=h.slice(2);for(let I=0;I<E.length;I+=3){let H=(r=E[I])==null?void 0:r.token,k=(n=E[I+1])==null?void 0:n.token,$=(s=E[I+2])==null?void 0:s.token;H&&k==="="&&(b[H]=ra($,e))}return m}if(h.length===1)return un(h[0])?ra(h[0].token,e):aa(i);if(h.length===2){let m=(d=h[0])==null?void 0:d.token,b=vu[m];if(!b||!un(h[1]))return aa(i);let E=ra(h[1].token,e);return b(E)}if(h.length===3){let m=(u=h[1])==null?void 0:u.token,b=vu[m];if(!b||!un(h[0])||!un(h[2]))return aa(i);let E=ra(h[0].token,e);if(m==="|")return b(E,h[2].token);let I=ra(h[2].token,e);return b(E,I)}}function aa(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function un({type:i}){return["number","boolean","string","param"].includes(i)}function ra(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):va(i)?parseFloat(i):e[i]}function Fm(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 Km=Object.defineProperty,Ym=(i,e,t)=>e in i?Km(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,oa=(i,e,t)=>(Ym(i,typeof e!="symbol"?e+"":e,t),t),Ss=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Ts=(i,e,t)=>(Ss(i,e,"read from private field"),t?t.call(i):e.get(i)),na=(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)},Ht=(i,e,t,a)=>(Ss(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),_s=(i,e,t)=>(Ss(i,e,"access private method"),t),_i,hn,yi,Is,Au,pn,ks,ys={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},_u=c.createElement("template");_u.innerHTML=`
1111
+ </svg>`,uu=c.createElement("template");uu.innerHTML=`
1112
+ <slot name="icon">${Wm}</slot>
1113
+ `;var As=class extends x{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}constructor(){super({slotTemplate:uu})}get mediaAudioTrackEnabled(){return L(this,o.MEDIA_AUDIO_TRACK_ENABLED)}set mediaAudioTrackEnabled(e){C(this,o.MEDIA_AUDIO_TRACK_ENABLED,e)}};l.customElements.get("media-audio-track-button")||l.customElements.define("media-audio-track-button",As);var ln=class extends Ee{static get observedAttributes(){return[...super.observedAttributes,o.MEDIA_AUDIO_TRACK_ENABLED,o.MEDIA_AUDIO_TRACK_UNAVAILABLE]}init(){let e=c.createElement("media-audio-track-button");e.part.add("button"),e.preventClick=!0;let t=c.createElement("media-audio-track-listbox");t.part.add("listbox"),t.setAttribute("exportparts","option, option-selected, indicator");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)}};l.customElements.get("media-audio-track-selectmenu")||l.customElements.define("media-audio-track-selectmenu",ln);var g=oc(require("@mux/mux-video")),H=require("@mux/playback-core");var Au=require("@mux/mux-video");var $m="en",Dt={code:$m};var cu="en";function T(i,e=!0){var r,n;let t=e&&(n=(r=Dt)==null?void 0:r[i])!=null?n:i,a=e?Dt.code:cu;return new _s(t,a)}var _s=class{constructor(e,t=(a=>(a=Dt.code)!=null?a:cu)()){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 mu(i){let e="";return Object.entries(i).forEach(([t,a])=>{a!=null&&(e+=`${dn(t)}: ${a}; `)}),e?e.trim():void 0}function dn(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function un(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function Ye(i){if(i==null)return;let e=+i;return Number.isNaN(e)?void 0:e}function ys(i){let e=Fm(i).toString();return e?"?"+e:""}function Fm(i){let e={};for(let t in i)i[t]!=null&&(e[t]=i[t]);return new URLSearchParams(e)}function ct(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 Ts=(i,e)=>!i||!e?!1:i.contains(e)?!0:Ts(i,e.getRootNode().host);var cn=require("@mux/playback-core");var hu="mux.com",Km=()=>{try{return"2.3.3"}catch{}return"UNKNOWN"},Ym=Km(),hn=()=>Ym,pu=(i,{token:e,customDomain:t=hu,thumbnailTime:a}={})=>{let r=e==null?a:void 0,{aud:n}=ct(e);if(!(e&&n!=="t"))return`https://image.${t}/${i}/thumbnail.webp${ys({token:e,time:r})}`},bu=(i,{token:e,customDomain:t=hu}={})=>{let{aud:a}=ct(e);if(!(e&&a!=="s"))return`https://image.${t}/${i}/storyboard.vtt${ys({token:e,format:"webp"})}`},ra=i=>{if(i){if([cn.StreamTypes.LIVE,cn.StreamTypes.ON_DEMAND].includes(i))return i;if(i!=null&&i.includes("live"))return cn.StreamTypes.LIVE}};var Gm={crossorigin:"crossOrigin",playsinline:"playsInline"};function Eu(i){var e;return(e=Gm[i])!=null?e:un(i)}var Ot,Nt,ie,mn=class{constructor(e,t){K(this,Ot,void 0);K(this,Nt,void 0);K(this,ie,[]);me(this,Ot,e),me(this,Nt,t)}[Symbol.iterator](){return S(this,ie).values()}get length(){return S(this,ie).length}get value(){var e;return(e=S(this,ie).join(" "))!=null?e:""}set value(e){var t;e!==this.value&&(me(this,ie,[]),this.add(...(t=e==null?void 0:e.split(" "))!=null?t:[]))}toString(){return this.value}item(e){return S(this,ie)[e]}values(){return S(this,ie).values()}keys(){return S(this,ie).keys()}forEach(e){S(this,ie).forEach(e)}add(...e){var t,a;e.forEach(r=>{this.contains(r)||S(this,ie).push(r)}),!(this.value===""&&!((t=S(this,Ot))!=null&&t.hasAttribute(`${S(this,Nt)}`)))&&((a=S(this,Ot))==null||a.setAttribute(`${S(this,Nt)}`,`${this.value}`))}remove(...e){var t;e.forEach(a=>{S(this,ie).splice(S(this,ie).indexOf(a),1)}),(t=S(this,Ot))==null||t.setAttribute(`${S(this,Nt)}`,`${this.value}`)}contains(e){return S(this,ie).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)}};Ot=new WeakMap,Nt=new WeakMap,ie=new WeakMap;var vu=`[mux-player ${hn()}]`;function mt(...i){console.warn(vu,...i)}function ve(...i){console.error(vu,...i)}function Is(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: ")}
1114
+ ${a}${i.file}`}mt(e)}var ee={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"loop",MUTED:"muted",PLAYSINLINE:"playsinline",PRELOAD:"preload"},Pt={VOLUME:"volume",PLAYBACKRATE:"playbackrate",MUTED:"muted"},gu=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}}),qm=Au.VideoEvents.filter(i=>i!=="error"),Zm=Object.values(ee).filter(i=>![ee.PLAYSINLINE].includes(i)),Qm=Object.values(Pt);function _u(i){i.querySelectorAll(":scope > track").forEach(e=>{var t;(t=i.media)==null||t.append(e.cloneNode())}),qm.forEach(e=>{var t;(t=i.media)==null||t.addEventListener(e,a=>{i.dispatchEvent(new Event(a.type))})})}var ks=class extends U.HTMLElement{static get observedAttributes(){return[...Zm,...Qm]}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 d,u;let s=(d=this.media)==null?void 0:d.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 Pt.MUTED:{this.media&&(this.media.muted=a!=null,this.media.defaultMuted=a!=null);return}case Pt.VOLUME:{let s=(r=Ye(a))!=null?r:1;this.media&&(this.media.volume=s);return}case Pt.PLAYBACKRATE:{let s=(n=Ye(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 audioTracks(){return this.media.audioTracks}get videoTracks(){return this.media.videoTracks}get audioRenditions(){return this.media.audioRenditions}get videoRenditions(){return this.media.videoRenditions}get paused(){var e,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:gu}get seekable(){var e,t;return(t=(e=this.media)==null?void 0:e.seekable)!=null?t:gu}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=Ye(this.getAttribute(Pt.PLAYBACKRATE)))!=null?e:1}set defaultPlaybackRate(e){e!=null?this.setAttribute(Pt.PLAYBACKRATE,`${e}`):this.removeAttribute(Pt.PLAYBACKRATE)}get crossOrigin(){return na(this,ee.CROSSORIGIN)}set crossOrigin(e){this.setAttribute(ee.CROSSORIGIN,`${e}`)}get autoplay(){return na(this,ee.AUTOPLAY)!=null}set autoplay(e){e?this.setAttribute(ee.AUTOPLAY,typeof e=="string"?e:""):this.removeAttribute(ee.AUTOPLAY)}get loop(){return na(this,ee.LOOP)!=null}set loop(e){e?this.setAttribute(ee.LOOP,""):this.removeAttribute(ee.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=!!e)}get defaultMuted(){return na(this,ee.MUTED)!=null}set defaultMuted(e){e?this.setAttribute(ee.MUTED,""):this.removeAttribute(ee.MUTED)}get playsInline(){return na(this,ee.PLAYSINLINE)!=null}set playsInline(e){ve("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(ee.PRELOAD,e):this.removeAttribute(ee.PRELOAD)}};function na(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ss=ks;var zm=Object.defineProperty,Xm=(i,e,t)=>e in i?zm(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Jm=(i,e,t)=>(Xm(i,typeof e!="symbol"?e+"":e,t),t),Su=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},y=(i,e,t)=>(Su(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)},Qe=(i,e,t,a)=>(Su(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ai,pn,Ut,oa,ht,pt,bt,Bt,_i,bn,Ce,yu=1,Tu=0,jm=1,eh={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 ae&&typeof r.element[r.attributeName]=="boolean"?r.booleanValue=n:typeof n=="function"&&r instanceof ae?r.element[r.attributeName]=n:r.value=n}}}},ze=class extends l.DocumentFragment{constructor(e,t,a=eh){var r;super(),Ge(this,Ai,void 0),Ge(this,pn,void 0),this.append(e.content.cloneNode(!0)),Qe(this,Ai,Cu(this)),Qe(this,pn,a),(r=a.createCallback)==null||r.call(a,this,y(this,Ai),t),a.processCallback(this,y(this,Ai),t)}update(e){y(this,pn).processCallback(this,y(this,Ai),e)}};Ai=new WeakMap;pn=new WeakMap;var Cu=(i,e=[])=>{let t,a;for(let r of i.attributes||[])if(r.value.includes("{{")){let n=new Cs;for([t,a]of ku(r.value))if(!t)n.append(a);else{let s=new ae(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===yu&&!(r instanceof HTMLTemplateElement))Cu(r,e);else if(r.nodeType===yu||r.data.includes("{{")){let n=[];if(r.data)for([t,a]of ku(r.data))if(!t)n.push(new Text(a));else{let s=new Xe(i);n.push(s),e.push([a,s])}else if(r instanceof HTMLTemplateElement){let s=new sa(i,r);n.push(s),e.push([s.expression,s])}r.replaceWith(...n.flatMap(s=>s.replacementNodes||[s]))}return e},Iu={},ku=i=>{let e="",t=0,a=Iu[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([Tu,e]),e="",r++):n==="}"&&i[r+1]==="}"&&i[r-1]!=="\\"&&!--t?(a.push([jm,e.trim()]),e="",r++):e+=n||"";return e&&a.push([Tu,(t>0?"{{":"")+e]),Iu[i]=a},th=11,En=class{get value(){return""}set value(e){}toString(){return this.value}},Mu=new WeakMap,Cs=class{constructor(){Ge(this,Ut,[])}[Symbol.iterator](){return y(this,Ut).values()}get length(){return y(this,Ut).length}item(e){return y(this,Ut)[e]}append(...e){for(let t of e)t instanceof ae&&Mu.set(t,this),y(this,Ut).push(t)}toString(){return y(this,Ut).join("")}};Ut=new WeakMap;var ae=class extends En{constructor(e,t,a){super(),Ge(this,Bt),Ge(this,oa,""),Ge(this,ht,void 0),Ge(this,pt,void 0),Ge(this,bt,void 0),Qe(this,ht,e),Qe(this,pt,t),Qe(this,bt,a)}get attributeName(){return y(this,pt)}get attributeNamespace(){return y(this,bt)}get element(){return y(this,ht)}get value(){return y(this,oa)}set value(e){y(this,oa)!==e&&(Qe(this,oa,e),!y(this,Bt,_i)||y(this,Bt,_i).length===1?e==null?y(this,ht).removeAttributeNS(y(this,bt),y(this,pt)):y(this,ht).setAttributeNS(y(this,bt),y(this,pt),e):y(this,ht).setAttributeNS(y(this,bt),y(this,pt),y(this,Bt,_i)))}get booleanValue(){return y(this,ht).hasAttributeNS(y(this,bt),y(this,pt))}set booleanValue(e){if(!y(this,Bt,_i)||y(this,Bt,_i).length===1)this.value=e?"":null;else throw new DOMException("Value is not fully templatized")}};oa=new WeakMap;ht=new WeakMap;pt=new WeakMap;bt=new WeakMap;Bt=new WeakSet;_i=function(){return Mu.get(this)};var Xe=class extends En{constructor(e,t){super(),Ge(this,bn,void 0),Ge(this,Ce,void 0),Qe(this,bn,e),Qe(this,Ce,t?[...t]:[new Text])}get replacementNodes(){return y(this,Ce)}get parentNode(){return y(this,bn)}get nextSibling(){return y(this,Ce)[y(this,Ce).length-1].nextSibling}get previousSibling(){return y(this,Ce)[0].previousSibling}get value(){return y(this,Ce).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===th?[...a.childNodes]:a.nodeType?[a]:[new Text(a)]);t.length||t.push(new Text),Qe(this,Ce,ih(y(this,Ce)[0].parentNode,y(this,Ce),t,this.nextSibling))}};bn=new WeakMap;Ce=new WeakMap;var sa=class extends Xe{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),Jm(this,"directive"),this.expression=r,this.template=t,this.directive=a}};function ih(i,e,t,a=null){let r=0,n,s,d,u=t.length,m=e.length;for(;r<u&&r<m&&e[r]==t[r];)r++;for(;r<u&&r<m&&t[u-1]==e[m-1];)a=t[--m,--u];if(r==m)for(;r<u;)i.insertBefore(t[r++],a);if(r==u)for(;r<m;)i.removeChild(e[r++]);else{for(n=e[r];r<u;)d=t[r++],s=n?n.nextSibling:a,n==d?n=s:r<u&&t[r]==s?(i.replaceChild(d,n),n=s):i.insertBefore(d,n);for(;n!=a;)s=n.nextSibling,i.removeChild(n),n=s}return t}var Lu={string:i=>String(i)},fn=class{constructor(e){this.template=e,this.state=void 0}},Ht=new WeakMap,Vt=new WeakMap,Ms={partial:(i,e)=>{e[i.expression]=new fn(i.template)},if:(i,e)=>{var t;if(wu(i.expression,e))if(Ht.get(i)!==i.template){Ht.set(i,i.template);let a=new ze(i.template,e,gn);i.replace(a),Vt.set(i,a)}else(t=Vt.get(i))==null||t.update(e);else i.replace(""),Ht.delete(i),Vt.delete(i)}},ah=Object.keys(Ms),gn={processCallback(i,e,t){var a,r;if(t)for(let[n,s]of e){if(s instanceof sa){if(!s.directive){let u=ah.find(m=>s.template.hasAttribute(m));u&&(s.directive=u,s.expression=s.template.getAttribute(u))}(a=Ms[s.directive])==null||a.call(Ms,s,t);continue}let d=wu(n,t);if(d instanceof fn){Ht.get(s)!==d.template?(Ht.set(s,d.template),d=new ze(d.template,d.state,gn),s.value=d,Vt.set(s,d)):(r=Vt.get(s))==null||r.update(d.state);continue}d?(s instanceof ae&&s.attributeName.startsWith("aria-")&&(d=String(d)),s instanceof ae?typeof d=="boolean"?s.booleanValue=d:typeof d=="function"?s.element[s.attributeName]=d:s.value=d:(s.value=d,Ht.delete(s),Vt.delete(s))):s instanceof ae?s.value=void 0:(s.value=void 0,Ht.delete(s),Vt.delete(s))}}},Ru={"!":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=Lu[e])==null?void 0:t.call(Lu,i)}};function rh(i){return nh(i,{boolean:/true|false/,number:/-?\d+\.?\d*/,string:/(["'])((?:\\.|[^\\])*?)\1/,operator:/[!=><][=!]?|\?\?|\|/,ws:/\s+/,param:/[$a-z_][$\w]*/i}).filter(({type:e})=>e!=="ws")}function wu(i,e={}){var t,a,r,n,s,d,u;let m=rh(i);if(m.length===0||m.some(({type:h})=>!h))return la(i);if(((t=m[0])==null?void 0:t.token)===">"){let h=e[(a=m[1])==null?void 0:a.token];if(!h)return la(i);let p={...e};h.state=p;let b=m.slice(2);for(let _=0;_<b.length;_+=3){let P=(r=b[_])==null?void 0:r.token,I=(n=b[_+1])==null?void 0:n.token,V=(s=b[_+2])==null?void 0:s.token;P&&I==="="&&(p[P]=da(V,e))}return h}if(m.length===1)return vn(m[0])?da(m[0].token,e):la(i);if(m.length===2){let h=(d=m[0])==null?void 0:d.token,p=Ru[h];if(!p||!vn(m[1]))return la(i);let b=da(m[1].token,e);return p(b)}if(m.length===3){let h=(u=m[1])==null?void 0:u.token,p=Ru[h];if(!p||!vn(m[0])||!vn(m[2]))return la(i);let b=da(m[0].token,e);if(h==="|")return p(b,m[2].token);let _=da(m[2].token,e);return p(b,_)}}function la(i){return console.warn(`Warning: invalid expression \`${i}\``),!1}function vn({type:i}){return["number","boolean","string","param"].includes(i)}function da(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):Ta(i)?parseFloat(i):e[i]}function nh(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 oh=Object.defineProperty,sh=(i,e,t)=>e in i?oh(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ca=(i,e,t)=>(sh(i,typeof e!="symbol"?e+"":e,t),t),Os=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},ws=(i,e,t)=>(Os(i,e,"read from private field"),t?t.call(i):e.get(i)),ua=(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)},Wt=(i,e,t,a)=>(Os(i,e,"write to private field"),a?a.call(i,t):e.set(i,t),t),Ls=(i,e,t)=>(Os(i,e,"access private method"),t),yi,An,Ti,xs,xu,_n,Ds,Rs={mediatargetlivewindow:"targetlivewindow",mediastreamtype:"streamtype"},Du=c.createElement("template");Du.innerHTML=`
1040
1115
  <style>
1041
1116
  :host {
1042
1117
  display: inline-block;
@@ -1060,7 +1135,7 @@ ${a}${i.file}`}ct(e)}var z={AUTOPLAY:"autoplay",CROSSORIGIN:"crossorigin",LOOP:"
1060
1135
  display: none;
1061
1136
  }
1062
1137
  </style>
1063
- `;var bt=class extends l.HTMLElement{constructor(){super(),na(this,Is),na(this,pn),oa(this,"renderRoot"),oa(this,"renderer"),na(this,_i,void 0),na(this,hn,void 0),na(this,yi,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(ys[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(Fe.BREAKPOINTS_COMPUTED,this.render),_s(this,Is,Au).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=Ts(this,_i))!=null?e:this.constructor.template}set template(e){Ht(this,yi,null),Ht(this,_i,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})=>ys[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let d=(a=ys[s.name])!=null?a:il(s.name),{value:u}=s;u!=null?(va(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&_s(this,pn,ks).call(this)}connectedCallback(){_s(this,pn,ks).call(this)}createRenderer(){this.template&&this.template!==Ts(this,hn)&&(Ht(this,hn,this.template),this.renderer=new qe(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(_u.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};_i=new WeakMap;hn=new WeakMap;yi=new WeakMap;Is=new WeakSet;Au=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};pn=new WeakSet;ks=function(){var i;let e=this.getAttribute("template");if(!e||e===Ts(this,yi))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){Ht(this,yi,e),Ht(this,_i,a),this.createRenderer();return}Gm(e)&&(Ht(this,yi,e),Zm(e).then(r=>{let n=c.createElement("template");n.innerHTML=r,Ht(this,_i,n),this.createRenderer()}).catch(console.error))};oa(bt,"template");oa(bt,"observedAttributes",["template"]);oa(bt,"processor",mn);function Gm(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 Zm(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()}l.customElements.get("media-theme")||l.customElements.define("media-theme",bt);var yu=`:host {
1138
+ `;var Et=class extends l.HTMLElement{constructor(){super(),ua(this,xs),ua(this,_n),ca(this,"renderRoot"),ca(this,"renderer"),ua(this,yi,void 0),ua(this,An,void 0),ua(this,Ti,void 0),this.shadowRoot?this.renderRoot=this.shadowRoot:(this.renderRoot=this.attachShadow({mode:"open"}),this.createRenderer());let e=new MutationObserver(t=>{var a;this.mediaController&&!((a=this.mediaController)!=null&&a.breakpointsComputed)||t.some(r=>{let n=r.target;return n===this?!0:n.localName!=="media-controller"?!1:!!(Rs[r.attributeName]||r.attributeName.startsWith("breakpoint"))})&&this.render()});e.observe(this,{attributes:!0}),e.observe(this.renderRoot,{attributes:!0,subtree:!0}),this.addEventListener(qe.BREAKPOINTS_COMPUTED,this.render),Ls(this,xs,xu).call(this,"template")}get mediaController(){return this.renderRoot.querySelector("media-controller")}get template(){var e;return(e=ws(this,yi))!=null?e:this.constructor.template}set template(e){Wt(this,Ti,null),Wt(this,yi,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})=>Rs[s]||s.startsWith("breakpoint")),...Array.from(this.attributes)],n={};for(let s of r){let d=(a=Rs[s.name])!=null?a:ul(s.name),{value:u}=s;u!=null?(Ta(u)&&(u=parseFloat(u)),n[d]=u===""?!0:u):n[d]=!1}return n}attributeChangedCallback(e,t,a){e==="template"&&t!=a&&Ls(this,_n,Ds).call(this)}connectedCallback(){Ls(this,_n,Ds).call(this)}createRenderer(){this.template&&this.template!==ws(this,An)&&(Wt(this,An,this.template),this.renderer=new ze(this.template,this.props,this.constructor.processor),this.renderRoot.textContent="",this.renderRoot.append(Du.content.cloneNode(!0),this.renderer))}render(){var e;(e=this.renderer)==null||e.update(this.props)}};yi=new WeakMap;An=new WeakMap;Ti=new WeakMap;xs=new WeakSet;xu=function(i){if(Object.prototype.hasOwnProperty.call(this,i)){let e=this[i];delete this[i],this[i]=e}};_n=new WeakSet;Ds=function(){var i;let e=this.getAttribute("template");if(!e||e===ws(this,Ti))return;let t=this.getRootNode(),a=(i=t==null?void 0:t.getElementById)==null?void 0:i.call(t,e);if(a){Wt(this,Ti,e),Wt(this,yi,a),this.createRenderer();return}lh(e)&&(Wt(this,Ti,e),dh(e).then(r=>{let n=c.createElement("template");n.innerHTML=r,Wt(this,yi,n),this.createRenderer()}).catch(console.error))};ca(Et,"template");ca(Et,"observedAttributes",["template"]);ca(Et,"processor",gn);function lh(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 dh(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()}l.customElements.get("media-theme")||l.customElements.define("media-theme",Et);var Ou=`:host {
1064
1139
  --media-control-display: var(--controls);
1065
1140
  --media-loading-indicator-display: var(--loading-indicator);
1066
1141
  --media-dialog-display: var(--dialog);
@@ -1207,7 +1282,7 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1207
1282
  --media-duration-display-display: var(--duration-display, var(--bottom-duration-display));
1208
1283
  --media-title-display-display: var(--title-display, var(--bottom-title-display));
1209
1284
  }
1210
- `;var Iu=`
1285
+ `;var Pu=`
1211
1286
  :host {
1212
1287
  z-index: 100;
1213
1288
  display: var(--media-dialog-display, flex);
@@ -1259,17 +1334,17 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1259
1334
  text-align: center;
1260
1335
  line-height: 1.4;
1261
1336
  }
1262
- `,ku=ne.createElement("template");ku.innerHTML=`
1337
+ `,Uu=le.createElement("template");Uu.innerHTML=`
1263
1338
  <style>
1264
- ${Iu}
1339
+ ${Pu}
1265
1340
  </style>
1266
1341
 
1267
1342
  <div class="dialog">
1268
1343
  <slot></slot>
1269
1344
  </div>
1270
- `;var Et=class extends U.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})),Tu(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),Qm(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")&&Tu(this)}};Et.styles=Iu,Et.template=ku,Et.observedAttributes=["open"];function Tu(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=Su(i.shadowRoot)),i._previouslyFocusedElement=ne.activeElement,ne.activeElement instanceof HTMLElement&&ne.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Su(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=Su(r[n].shadowRoot),a));n++);}return a}function Qm(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}U.customElements.get("media-dialog")||(U.customElements.define("media-dialog",Et),U.MediaDialog=Et);var Cs=Et;var Cu=ne.createElement("template");Cu.innerHTML=`
1345
+ `;var vt=class extends U.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})),Nu(this)}close(){this.hasAttribute("open")&&(this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("close",{composed:!0,bubbles:!0})),ch(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")&&Nu(this)}};vt.styles=Pu,vt.template=Uu,vt.observedAttributes=["open"];function Nu(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=Bu(i.shadowRoot)),i._previouslyFocusedElement=le.activeElement,le.activeElement instanceof HTMLElement&&le.activeElement.blur(),i.addEventListener("transitionend",()=>{t instanceof HTMLElement&&t.focus({preventScroll:!0})},{once:!0})}function Bu(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=Bu(r[n].shadowRoot),a));n++);}return a}function ch(i){i._previouslyFocusedElement instanceof HTMLElement&&i._previouslyFocusedElement.focus()}U.customElements.get("media-dialog")||(U.customElements.define("media-dialog",vt),U.MediaDialog=vt);var Ns=vt;var Hu=le.createElement("template");Hu.innerHTML=`
1271
1346
  <style>
1272
- ${Cs.styles}
1347
+ ${Ns.styles}
1273
1348
 
1274
1349
  .close {
1275
1350
  background: none;
@@ -1298,86 +1373,86 @@ media-poster-image:not([src]):not([placeholdersrc]) {
1298
1373
  </svg>
1299
1374
  </button>
1300
1375
  </slot>
1301
- `;var sa=class extends Cs{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};sa.template=Cu;U.customElements.get("mxp-dialog")||(U.customElements.define("mxp-dialog",sa),U.MxpDialog=sa);var la=new WeakMap,Ls=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=la.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=la.get(this.element);t&&t.delete(this.type)}}static for(e){la.has(e.element)||la.set(e.element,new Map);let t=e.attributeName.slice(2),a=la.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function zm(i,e){return i instanceof j&&i.attributeName.startsWith("on")?(Ls.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function Xm(i,e){return e instanceof bn&&i instanceof Qe?(e.renderInto(i),!0):!1}function Jm(i,e){return e instanceof DocumentFragment&&i instanceof Qe?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function jm(i,e){if(i instanceof j){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 eh(i,e){if(i instanceof j&&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 th(i,e){if(typeof e=="boolean"&&i instanceof j){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function ih(i,e){return e===!1&&i instanceof Qe?(i.replace(""),!0):!1}function ah(i,e){eh(i,e)||th(i,e)||zm(i,e)||ih(i,e)||Xm(i,e)||Jm(i,e)||jm(i,e)}var Ms=new Map,Mu=new WeakMap,Lu=new WeakMap,bn=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ms.has(this.stringsKey))return Ms.get(this.stringsKey);{let e=ne.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Ms.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(Mu.get(e)!==t){Mu.set(e,t);let n=new qe(t,this.values,this.processor);Lu.set(e,n),e instanceof Qe?e.replace(...n.children):e.appendChild(n);return}let a=Lu.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},rh={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:"";ah(n,s)}}}};function ze(i,...e){return new bn(i,e,rh)}function Ru(i,e){i.renderInto(e)}var da=require("@mux/playback-core"),wu=i=>ze`
1376
+ `;var ma=class extends Ns{constructor(){var e,t;super(),(t=(e=this.shadowRoot)==null?void 0:e.querySelector(".close"))==null||t.addEventListener("click",()=>{this.close()})}};ma.template=Hu;U.customElements.get("mxp-dialog")||(U.customElements.define("mxp-dialog",ma),U.MxpDialog=ma);var ha=new WeakMap,Us=class i{constructor(e,t){this.element=e;this.type=t;this.element.addEventListener(this.type,this);let a=ha.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=ha.get(this.element);t&&t.delete(this.type)}}static for(e){ha.has(e.element)||ha.set(e.element,new Map);let t=e.attributeName.slice(2),a=ha.get(e.element);return a&&a.has(t)?a.get(t):new i(e.element,t)}};function mh(i,e){return i instanceof ae&&i.attributeName.startsWith("on")?(Us.for(i).set(e),i.element.removeAttributeNS(i.attributeNamespace,i.attributeName),!0):!1}function hh(i,e){return e instanceof yn&&i instanceof Xe?(e.renderInto(i),!0):!1}function ph(i,e){return e instanceof DocumentFragment&&i instanceof Xe?(e.childNodes.length&&i.replace(...e.childNodes),!0):!1}function bh(i,e){if(i instanceof ae){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 Eh(i,e){if(i instanceof ae&&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 vh(i,e){if(typeof e=="boolean"&&i instanceof ae){let t=i.attributeNamespace,a=i.element.hasAttributeNS(t,i.attributeName);return e!==a&&(i.booleanValue=e),!0}return!1}function fh(i,e){return e===!1&&i instanceof Xe?(i.replace(""),!0):!1}function gh(i,e){Eh(i,e)||vh(i,e)||mh(i,e)||fh(i,e)||hh(i,e)||ph(i,e)||bh(i,e)}var Ps=new Map,Vu=new WeakMap,Wu=new WeakMap,yn=class{constructor(e,t,a){this.strings=e;this.values=t;this.processor=a;this.stringsKey=this.strings.join("")}get template(){if(Ps.has(this.stringsKey))return Ps.get(this.stringsKey);{let e=le.createElement("template"),t=this.strings.length-1;return e.innerHTML=this.strings.reduce((a,r,n)=>a+r+(n<t?`{{ ${n} }}`:""),""),Ps.set(this.stringsKey,e),e}}renderInto(e){var r;let t=this.template;if(Vu.get(e)!==t){Vu.set(e,t);let n=new ze(t,this.values,this.processor);Wu.set(e,n),e instanceof Xe?e.replace(...n.children):e.appendChild(n);return}let a=Wu.get(e);(r=a==null?void 0:a.update)==null||r.call(a,this.values)}},Ah={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:"";gh(n,s)}}}};function Je(i,...e){return new yn(i,e,Ah)}function $u(i,e){i.renderInto(e)}var pa=require("@mux/playback-core"),Fu=i=>Je`
1302
1377
  <style>
1303
- ${yu}
1378
+ ${Ou}
1304
1379
  </style>
1305
- ${lh(i)}
1306
- `,nh=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return ji(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},oh={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",SELECTMENU:"selectmenu",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},sh=Object.values(oh).join(", "),lh=i=>{var e,t,a,r,n,s,d,u,h,m,b,E,I,H,k,$,Z,ee,je,Ii,Kt,Ds,Os,Ns,Us,Ps,Bs,Vs,Hs,$s,Ws,Fs,Ks,Ys,Gs;return ze`
1380
+ ${Ih(i)}
1381
+ `,_h=i=>{let e=i.hotKeys?`${i.hotKeys}`:"";return ra(i.streamType)==="live"&&(e+=" noarrowleft noarrowright"),e},yh={TOP:"top",CENTER:"center",BOTTOM:"bottom",LAYER:"layer",MEDIA_LAYER:"media-layer",POSTER_LAYER:"poster-layer",VERTICAL_LAYER:"vertical-layer",CENTERED_LAYER:"centered-layer",GESTURE_LAYER:"gesture-layer",CONTROLLER_LAYER:"controller",BUTTON:"button",RANGE:"range",DISPLAY:"display",CONTROL_BAR:"control-bar",SELECTMENU:"selectmenu",LISTBOX:"listbox",OPTION:"option",POSTER:"poster",LIVE:"live",PLAY:"play",PRE_PLAY:"pre-play",SEEK_BACKWARD:"seek-backward",SEEK_FORWARD:"seek-forward",MUTE:"mute",CAPTIONS:"captions",AIRPLAY:"airplay",PIP:"pip",FULLSCREEN:"fullscreen",CAST:"cast",PLAYBACK_RATE:"playback-rate",VOLUME:"volume",TIME:"time",TITLE:"title",AUDIO_TRACK:"audio-track",RENDITION:"rendition"},Th=Object.values(yh).join(", "),Ih=i=>{var e,t,a,r,n,s,d,u,m,h,p,b,_,P,I,V,F,re,tt,ki,Yt,Ws,$s,Fs,Ks,Ys,Gs,qs,Zs,Qs,zs,Xs,Js,js,el;return Je`
1307
1382
  <media-theme
1308
1383
  template="${i.themeTemplate||!1}"
1309
1384
  defaultstreamtype="${(e=i.defaultStreamType)!=null?e:!1}"
1310
- hotkeys="${nh(i)||!1}"
1385
+ hotkeys="${_h(i)||!1}"
1311
1386
  nohotkeys="${i.noHotKeys||!i.hasSrc||i.isDialogOpen||!1}"
1312
- noautoseektolive="${!!((t=i.streamType)!=null&&t.includes(da.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
1387
+ noautoseektolive="${!!((t=i.streamType)!=null&&t.includes(pa.StreamTypes.LIVE))&&i.targetLiveWindow!==0}"
1313
1388
  novolumepref="${i.novolumepref||!1}"
1314
1389
  disabled="${!i.hasSrc||i.isDialogOpen}"
1315
1390
  audio="${(a=i.audio)!=null?a:!1}"
1316
- style="${(r=eu({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor,"--media-accent-color":i.accentColor}))!=null?r:!1}"
1391
+ style="${(r=mu({"--media-primary-color":i.primaryColor,"--media-secondary-color":i.secondaryColor,"--media-accent-color":i.accentColor}))!=null?r:!1}"
1317
1392
  defaultsubtitles="${!i.defaultHiddenCaptions}"
1318
1393
  forwardseekoffset="${(n=i.forwardSeekOffset)!=null?n:!1}"
1319
1394
  backwardseekoffset="${(s=i.backwardSeekOffset)!=null?s:!1}"
1320
1395
  playbackrates="${(d=i.playbackRates)!=null?d:!1}"
1321
1396
  defaultshowremainingtime="${(u=i.defaultShowRemainingTime)!=null?u:!1}"
1322
- defaultduration="${(h=i.defaultDuration)!=null?h:!1}"
1323
- hideduration="${(m=i.hideDuration)!=null?m:!1}"
1324
- title="${(b=i.title)!=null?b:!1}"
1325
- exportparts="${sh}"
1397
+ defaultduration="${(m=i.defaultDuration)!=null?m:!1}"
1398
+ hideduration="${(h=i.hideDuration)!=null?h:!1}"
1399
+ title="${(p=i.title)!=null?p:!1}"
1400
+ exportparts="${Th}"
1326
1401
  >
1327
1402
  <mux-video
1328
1403
  slot="media"
1329
- target-live-window="${(E=i.targetLiveWindow)!=null?E:!1}"
1330
- stream-type="${(I=ji(i.streamType))!=null?I:!1}"
1331
- crossorigin="${(H=i.crossOrigin)!=null?H:""}"
1404
+ target-live-window="${(b=i.targetLiveWindow)!=null?b:!1}"
1405
+ stream-type="${(_=ra(i.streamType))!=null?_:!1}"
1406
+ crossorigin="${(P=i.crossOrigin)!=null?P:""}"
1332
1407
  playsinline
1333
- autoplay="${(k=i.autoplay)!=null?k:!1}"
1334
- muted="${($=i.muted)!=null?$:!1}"
1335
- loop="${(Z=i.loop)!=null?Z:!1}"
1336
- preload="${(ee=i.preload)!=null?ee:!1}"
1337
- debug="${(je=i.debug)!=null?je:!1}"
1338
- prefer-cmcd="${(Ii=i.preferCmcd)!=null?Ii:!1}"
1339
- disable-cookies="${(Kt=i.disableCookies)!=null?Kt:!1}"
1340
- prefer-playback="${(Ds=i.preferPlayback)!=null?Ds:!1}"
1408
+ autoplay="${(I=i.autoplay)!=null?I:!1}"
1409
+ muted="${(V=i.muted)!=null?V:!1}"
1410
+ loop="${(F=i.loop)!=null?F:!1}"
1411
+ preload="${(re=i.preload)!=null?re:!1}"
1412
+ debug="${(tt=i.debug)!=null?tt:!1}"
1413
+ prefer-cmcd="${(ki=i.preferCmcd)!=null?ki:!1}"
1414
+ disable-cookies="${(Yt=i.disableCookies)!=null?Yt:!1}"
1415
+ prefer-playback="${(Ws=i.preferPlayback)!=null?Ws:!1}"
1341
1416
  start-time="${i.startTime!=null?i.startTime:!1}"
1342
- beacon-collection-domain="${(Os=i.beaconCollectionDomain)!=null?Os:!1}"
1343
- player-software-name="${(Ns=i.playerSoftwareName)!=null?Ns:!1}"
1344
- player-software-version="${(Us=i.playerSoftwareVersion)!=null?Us:!1}"
1345
- env-key="${(Ps=i.envKey)!=null?Ps:!1}"
1346
- custom-domain="${(Bs=i.customDomain)!=null?Bs:!1}"
1347
- src="${i.src?i.src:i.playbackId?(0,da.toMuxVideoURL)(i):!1}"
1348
- cast-src="${i.src?i.src:i.playbackId?(0,da.toMuxVideoURL)(i):!1}"
1417
+ beacon-collection-domain="${($s=i.beaconCollectionDomain)!=null?$s:!1}"
1418
+ player-software-name="${(Fs=i.playerSoftwareName)!=null?Fs:!1}"
1419
+ player-software-version="${(Ks=i.playerSoftwareVersion)!=null?Ks:!1}"
1420
+ env-key="${(Ys=i.envKey)!=null?Ys:!1}"
1421
+ custom-domain="${(Gs=i.customDomain)!=null?Gs:!1}"
1422
+ src="${i.src?i.src:i.playbackId?(0,pa.toMuxVideoURL)(i):!1}"
1423
+ cast-src="${i.src?i.src:i.playbackId?(0,pa.toMuxVideoURL)(i):!1}"
1349
1424
  exportparts="video"
1350
1425
  >
1351
- ${i.storyboard?ze`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:ze``}
1426
+ ${i.storyboard?Je`<track label="thumbnails" default kind="metadata" src="${i.storyboard}" />`:Je``}
1352
1427
  </mux-video>
1353
1428
  <slot name="poster" slot="poster">
1354
1429
  <media-poster-image
1355
1430
  part="poster"
1356
1431
  exportparts="poster, img"
1357
- src="${i.poster===""?!1:(Vs=i.poster)!=null?Vs:!1}"
1358
- placeholdersrc="${(Hs=i.placeholder)!=null?Hs:!1}"
1432
+ src="${i.poster===""?!1:(qs=i.poster)!=null?qs:!1}"
1433
+ placeholdersrc="${(Zs=i.placeholder)!=null?Zs:!1}"
1359
1434
  ></media-poster-image>
1360
1435
  </slot>
1361
1436
  <mxp-dialog
1362
1437
  no-auto-hide
1363
- open="${($s=i.isDialogOpen)!=null?$s:!1}"
1438
+ open="${(Qs=i.isDialogOpen)!=null?Qs:!1}"
1364
1439
  onclose="${i.onCloseErrorDialog}"
1365
1440
  oninitfocus="${i.onInitFocusDialog}"
1366
1441
  >
1367
- ${(Ws=i.dialog)!=null&&Ws.title?ze`<h3>${i.dialog.title}</h3>`:ze``}
1442
+ ${(zs=i.dialog)!=null&&zs.title?Je`<h3>${i.dialog.title}</h3>`:Je``}
1368
1443
  <p>
1369
- ${(Fs=i.dialog)==null?void 0:Fs.message}
1370
- ${(Ks=i.dialog)!=null&&Ks.linkUrl?ze`<a
1444
+ ${(Xs=i.dialog)==null?void 0:Xs.message}
1445
+ ${(Js=i.dialog)!=null&&Js.linkUrl?Je`<a
1371
1446
  href="${i.dialog.linkUrl}"
1372
1447
  target="_blank"
1373
1448
  rel="external noopener"
1374
- aria-label="${(Ys=i.dialog.linkText)!=null?Ys:""} ${y("(opens in a new window)")}"
1375
- >${(Gs=i.dialog.linkText)!=null?Gs:i.dialog.linkUrl}</a
1376
- >`:ze``}
1449
+ aria-label="${(js=i.dialog.linkText)!=null?js:""} ${T("(opens in a new window)")}"
1450
+ >${(el=i.dialog.linkText)!=null?el:i.dialog.linkUrl}</a
1451
+ >`:Je``}
1377
1452
  </p>
1378
1453
  </mxp-dialog>
1379
1454
  </media-theme>
1380
- `};var ua=require("@mux/mux-video");function En(i,e,t,a,r){var d,u,h;let n={},s={};switch(i.code){case ua.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=y("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.response.code){case 412:{n.title=y("Video is not currently available",r),n.message=y("The live stream or video file are not yet ready.",r),s.message=y("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=y("Video does not exist",r),n.message="",s.message=y("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=y("Invalid playback URL",r),n.message=y("The video URL or playback-token are formatted with incorrect or incomplete information.",r),s.message=y("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:m,aud:b,sub:E}=ut(a),I=Date.now()>m*1e3,H=E!==t,k=b!=="v",$={timeStyle:"medium",dateStyle:"medium"};if(I){n.title=y("Video URL has expired",r),n.message=y("The video\u2019s secured playback-token has expired.",r),s.message=y("The video\u2019s secured playback-token has expired.",r),s.context=y("Expired at: {expiredDate}. Current time: {currentDate}.",r).format({expiredDate:new Intl.DateTimeFormat(xt.code,$).format(m*1e3),currentDate:new Intl.DateTimeFormat(xt.code,$).format(Date.now())}),s.file="403-expired-token.md";break}if(H){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.message=y("The video\u2019s playback ID does not match the one encoded in the playback-token.",r),s.context=y("Specified playback ID: {playbackId} and the playback ID encoded in the playback-token: {tokenPlaybackId}",r).format({playbackId:t,tokenPlaybackId:E}),s.file="403-playback-id-mismatch.md";break}if(k){n.title=y("Video URL is formatted incorrectly",r),n.message=y("The playback-token is formatted with incorrect information.",r),s.message=y("The playback-token is formatted with incorrect information.",r),s.context=y("The playback-token has an incorrect aud value: {tokenType}. aud value should be v.",r).format({tokenType:b}),s.file="403-incorrect-aud-value.md";break}s.message=y("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 ua.MediaError.MEDIA_ERR_DECODE:{let{message:m}=i;n={title:y("Media Error",r),message:m},s.file="media-decode-error.md";break}case ua.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let m=(h=(u=i.data)==null?void 0:u.response)==null?void 0:h.code;if(m>=400&&m<500){i.code=ua.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:m}},{dialog:n,devlog:s}=En(i,e,t,a);break}n={title:y("Source Not Supported",r),message:i.message},s.file="media-src-not-supported.md";break}default:n={title:y("Error",r),message:i.message};break}return e&&(n={title:y("Your device appears to be offline",r),message:y("Check your internet connection and try reloading this video.",r)}),{dialog:n,devlog:s}}var xu=`<template id="media-theme-gerwig">
1455
+ `};var ba=require("@mux/mux-video");function Tn(i,e,t,a,r){var d,u,m;let n={},s={};switch(i.code){case ba.MediaError.MEDIA_ERR_NETWORK:{switch(n.title=T("Network Error",r),n.message=i.message,(d=i.data)==null?void 0:d.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:h,aud:p,sub:b}=ct(a),_=Date.now()>h*1e3,P=b!==t,I=p!=="v",V={timeStyle:"medium",dateStyle:"medium"};if(_){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(Dt.code,V).format(h*1e3),currentDate:new Intl.DateTimeFormat(Dt.code,V).format(Date.now())}),s.file="403-expired-token.md";break}if(P){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:b}),s.file="403-playback-id-mismatch.md";break}if(I){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:p}),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 ba.MediaError.MEDIA_ERR_DECODE:{let{message:h}=i;n={title:T("Media Error",r),message:h},s.file="media-decode-error.md";break}case ba.MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:{let h=(m=(u=i.data)==null?void 0:u.response)==null?void 0:m.code;if(h>=400&&h<500){i.code=ba.MediaError.MEDIA_ERR_NETWORK,i.data={response:{code:h}},{dialog:n,devlog:s}=Tn(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 Ku=`<template id="media-theme-gerwig">
1381
1456
  <style>
1382
1457
  @keyframes pre-play-hide {
1383
1458
  0% {
@@ -2371,5 +2446,5 @@ media-poster-image:not([src]):not([placeholdersrc]) {
2371
2446
  <slot></slot>
2372
2447
  </media-controller>
2373
2448
  </template>
2374
- `;var Rs=ne.createElement("template");"innerHTML"in Rs&&(Rs.innerHTML=xu);var Du,Ou,fn=class extends bt{};fn.template=(Ou=(Du=Rs.content)==null?void 0:Du.children)==null?void 0:Ou[0];U.customElements.get("media-theme-gerwig")||U.customElements.define("media-theme-gerwig",fn);var uh="gerwig";var Xe={SRC:"src",POSTER:"poster"},p={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref"},ws=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function ch(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(p.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:mh(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(p.NOHOTKEYS),hotKeys:i.getAttribute(p.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,minResolution:i.minResolution,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:ji(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(p.PRIMARY_COLOR),secondaryColor:i.getAttribute(p.SECONDARY_COLOR),accentColor:i.getAttribute(p.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:hh(i),playbackRates:i.getAttribute(p.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(p.TITLE),novolumepref:i.hasAttribute(p.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function mh(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=U.customElements.get(e);if(n!=null&&n.template)return n.template}}function hh(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 Nu(i){let e=i.hasAttribute(p.TITLE)?{video_title:i.getAttribute(p.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var ph=Object.values(g.Attributes),bh=Object.values(Xe),Eh=Object.values(p),fh=on(),vh="mux-player",Uu={dialog:void 0,isDialogOpen:!1},gh={redundant_streams:!0},ma,ha,ft,pa,Ft,Je,$t,vn,Pu,ba,xs,vt,Ti,gn,Bu,An,Vu,_n,Hu,yn,$u,ca=class extends vs{constructor(){super();W(this,Je);W(this,vn);W(this,ba);W(this,vt);W(this,gn);W(this,An);W(this,_n);W(this,yn);W(this,ma,!1);W(this,ha,{});W(this,ft,!0);W(this,pa,new nn(this,"hotkeys"));W(this,Ft,{...Uu,onCloseErrorDialog:()=>F(this,ba,xs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{bs(this,ne.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),F(this,vn,Pu).call(this),this.isConnected&&F(this,Je,$t).call(this)}static get observedAttributes(){var t;return[...(t=vs.observedAttributes)!=null?t:[],...bh,...ph,...Eh]}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=Nu(this))}attributeChangedCallback(t,a,r){switch(F(this,Je,$t).call(this),super.attributeChangedCallback(t,a,r),t){case p.HOTKEYS:S(this,pa).value=r;break;case p.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&ct(y("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case p.THUMBNAIL_TOKEN:{let{aud:s}=ut(r);r&&s!=="t"&&ct(y("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case p.STORYBOARD_TOKEN:{let{aud:s}=ut(r);r&&s!=="s"&&ct(y("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&Ee(y("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![P.StreamTypes.LIVE,P.StreamTypes.ON_DEMAND,P.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Es({file:"invalid-stream-type.md",message:y("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):r===P.StreamTypes.LIVE?this.getAttribute(p.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[g.Attributes.PLAYBACK_ID,Xe.SRC,p.PLAYBACK_TOKEN].includes(t)&&a!==r&&ce(this,Ft,{...S(this,Ft),...Uu}),F(this,vt,Ti).call(this,{[ru(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?P.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):ct(`Invalid value for preferCmcd. Must be one of ${P.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(o.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(p.THEME))!=null?t:uh}set theme(t){this.setAttribute(p.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(ws.includes(r))continue;let n=t.getAttribute(r);a[an(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;F(this,Je,$t).call(this);let a={...this.themeProps,...t};for(let s in a){if(ws.includes(s))continue;let d=t==null?void 0:t[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(tn(s),!!d):(n=this.mediaTheme)==null||n.setAttribute(tn(s),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Wt(this,Xe.SRC))!=null?t:void 0:(a=this.getAttribute(Xe.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(Xe.SRC,t):this.removeAttribute(Xe.SRC)}get poster(){var a;let t=this.getAttribute(Xe.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return iu(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(Xe.POSTER,t):this.removeAttribute(Xe.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(p.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(p.STORYBOARD_SRC,t):this.removeAttribute(p.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[P.StreamTypes.LIVE,P.StreamTypes.UNKNOWN].includes(this.streamType)))return au(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(p.AUDIO)}set audio(t){if(!t){this.removeAttribute(p.AUDIO);return}this.setAttribute(p.AUDIO,"")}get hotkeys(){return S(this,pa)}get nohotkeys(){return this.hasAttribute(p.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(p.NOHOTKEYS);return}this.setAttribute(p.NOHOTKEYS,"")}get thumbnailTime(){return $e(this.getAttribute(p.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(p.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(p.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(p.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Wt(this,p.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(p.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(p.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(p.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(p.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(p.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(p.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(p.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(p.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(p.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(p.PLAYBACK_RATES))return this.getAttribute(p.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(p.PLAYBACK_RATES);return}this.setAttribute(p.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(p.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=$e(this.getAttribute(p.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(p.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(p.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(p.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return $e(this.getAttribute(p.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(p.DEFAULT_DURATION):this.setAttribute(p.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:vh}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:fh}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(g.Attributes.MIN_RESOLUTION,t):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(g.Attributes.RENDITION_ORDER,t):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get extraSourceParams(){return this.hasAttribute(p.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(p.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):gh}set extraSourceParams(t){t==null?this.removeAttribute(p.EXTRA_SOURCE_PARAMS):this.setAttribute(p.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Wt(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(p.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(p.NO_VOLUME_PREF,""):this.removeAttribute(p.NO_VOLUME_PREF)}get debug(){return Wt(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return Wt(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:P.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(p.DEFAULT_STREAM_TYPE))!=null?r:P.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(p.DEFAULT_STREAM_TYPE,t):this.removeAttribute(p.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(p.TARGET_LIVE_WINDOW)?+this.getAttribute(p.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(p.TARGET_LIVE_WINDOW):this.setAttribute(p.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return $e(Wt(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===P.PlaybackTypes.MSE||t===P.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(F(this,Je,$t).call(this),!this.media){Ee("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Nu(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(F(this,Je,$t).call(this),!this.media){Ee("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(F(this,Je,$t).call(this),!this.media){Ee("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(p.PLAYBACK_TOKEN),a=this.getAttribute(p.THUMBNAIL_TOKEN),r=this.getAttribute(p.STORYBOARD_TOKEN);return{...S(this,ha),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){ce(this,ha,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(p.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(p.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(p.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(p.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(p.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(p.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,P.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,P.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};ma=new WeakMap,ha=new WeakMap,ft=new WeakMap,pa=new WeakMap,Ft=new WeakMap,Je=new WeakSet,$t=function(){var t,a,r;if(!S(this,ma)){ce(this,ma,!0),F(this,vt,Ti).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof U.HTMLElement))throw""}catch{Ee("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{Ee("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof Qn))throw""}catch{Ee("<media-controller> failed to upgrade!")}du(this),F(this,gn,Bu).call(this),F(this,An,Vu).call(this),F(this,_n,Hu).call(this),ce(this,ft,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(T.USER_INACTIVE))!=null?a:!0),F(this,yn,$u).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{F(this,vt,Ti).call(this)})}},vn=new WeakSet,Pu=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{}},ba=new WeakSet,xs=function(t){Object.assign(S(this,Ft),t),F(this,vt,Ti).call(this)},vt=new WeakSet,Ti=function(t={}){Ru(wu(ch(this,{...S(this,Ft),...t})),this.shadowRoot)},gn=new WeakSet,Bu=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(ws.includes(n))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.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)},An=new WeakSet,Vu=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){ct(n),n.data&&ct(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=En(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Es(d),Ee(n),n.data&&Ee(`${n.name} data:`,n.data),F(this,ba,xs).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=En((d=this.media)==null?void 0:d.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,d;let{detail:n}=r;if(!n){let{message:u,code:h}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new g.MediaError(u,h)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},_n=new WeakSet,Hu=function(){var a,r,n,s;let t=()=>F(this,vt,Ti).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)},yn=new WeakSet,$u=function(){var h,m;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===P.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(b,E,I=!1)=>{if(n())return;Array.from(b&&b.activeCues||[]).forEach(k=>{if(!(!k.snapToLines||k.line<-5||k.line>=0&&k.line<10))if(!E||this.paused){let $=k.text.split(`
2375
- `).length,Z=-3;this.streamType===P.StreamTypes.LIVE&&(Z=-2);let ee=Z-$;if(k.line===ee&&!I)return;r.has(k)||r.set(k,k.line),k.line=ee}else setTimeout(()=>{k.line=r.get(k)||"auto"},500)})},d=()=>{var b,E;s(a,(E=(b=this.mediaController)==null?void 0:b.hasAttribute(T.USER_INACTIVE))!=null?E:!1)},u=()=>{var I,H;let E=Array.from(((H=(I=this.mediaController)==null?void 0:I.media)==null?void 0:H.textTracks)||[]).filter(k=>["subtitles","captions"].includes(k.kind)&&k.mode==="showing")[0];E!==a&&(a==null||a.removeEventListener("cuechange",d)),a=E,a==null||a.addEventListener("cuechange",d),s(a,S(this,ft))};u(),(h=this.textTracks)==null||h.addEventListener("change",u),(m=this.textTracks)==null||m.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var E,I;let b=(I=(E=this.mediaController)==null?void 0:E.hasAttribute(T.USER_INACTIVE))!=null?I:!0;S(this,ft)!==b&&(ce(this,ft,b),s(a,S(this,ft)))})};function Wt(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}U.customElements.get("mux-player")||(U.customElements.define("mux-player",ca),U.MuxPlayerElement=ca);var Ah=ca;
2449
+ `;var Bs=le.createElement("template");"innerHTML"in Bs&&(Bs.innerHTML=Ku);var Yu,Gu,In=class extends Et{};In.template=(Gu=(Yu=Bs.content)==null?void 0:Yu.children)==null?void 0:Gu[0];U.customElements.get("media-theme-gerwig")||U.customElements.define("media-theme-gerwig",In);var Sh="gerwig";var je={SRC:"src",POSTER:"poster"},E={STYLE:"style",DEFAULT_HIDDEN_CAPTIONS:"default-hidden-captions",PRIMARY_COLOR:"primary-color",SECONDARY_COLOR:"secondary-color",ACCENT_COLOR:"accent-color",FORWARD_SEEK_OFFSET:"forward-seek-offset",BACKWARD_SEEK_OFFSET:"backward-seek-offset",PLAYBACK_TOKEN:"playback-token",THUMBNAIL_TOKEN:"thumbnail-token",STORYBOARD_TOKEN:"storyboard-token",STORYBOARD_SRC:"storyboard-src",THUMBNAIL_TIME:"thumbnail-time",AUDIO:"audio",NOHOTKEYS:"nohotkeys",HOTKEYS:"hotkeys",PLAYBACK_RATES:"playbackrates",DEFAULT_SHOW_REMAINING_TIME:"default-show-remaining-time",DEFAULT_DURATION:"default-duration",TITLE:"title",PLACEHOLDER:"placeholder",THEME:"theme",DEFAULT_STREAM_TYPE:"default-stream-type",TARGET_LIVE_WINDOW:"target-live-window",EXTRA_SOURCE_PARAMS:"extra-source-params",NO_VOLUME_PREF:"no-volume-pref"},Hs=["audio","backwardseekoffset","defaultduration","defaultshowremainingtime","defaultsubtitles","noautoseektolive","disabled","exportparts","forwardseekoffset","hideduration","hotkeys","nohotkeys","playbackrates","defaultstreamtype","streamtype","style","targetlivewindow","template","title","novolumepref"];function Ch(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(E.STORYBOARD_SRC),placeholder:i.getAttribute("placeholder"),themeTemplate:Mh(i),thumbnailTime:!i.tokens.thumbnail&&i.thumbnailTime,autoplay:i.autoplay,crossOrigin:i.crossOrigin,loop:i.loop,noHotKeys:i.hasAttribute(E.NOHOTKEYS),hotKeys:i.getAttribute(E.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,minResolution:i.minResolution,renditionOrder:i.renditionOrder,metadata:i.metadata,playerSoftwareName:i.playerSoftwareName,playerSoftwareVersion:i.playerSoftwareVersion,startTime:i.startTime,preferPlayback:i.preferPlayback,audio:i.audio,defaultStreamType:i.defaultStreamType,targetLiveWindow:i.getAttribute(g.Attributes.TARGET_LIVE_WINDOW),streamType:ra(i.getAttribute(g.Attributes.STREAM_TYPE)),primaryColor:i.getAttribute(E.PRIMARY_COLOR),secondaryColor:i.getAttribute(E.SECONDARY_COLOR),accentColor:i.getAttribute(E.ACCENT_COLOR),forwardSeekOffset:i.forwardSeekOffset,backwardSeekOffset:i.backwardSeekOffset,defaultHiddenCaptions:i.defaultHiddenCaptions,defaultDuration:i.defaultDuration,defaultShowRemainingTime:i.defaultShowRemainingTime,hideDuration:Lh(i),playbackRates:i.getAttribute(E.PLAYBACK_RATES),customDomain:(a=i.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?a:void 0,title:i.getAttribute(E.TITLE),novolumepref:i.hasAttribute(E.NO_VOLUME_PREF),...e,extraSourceParams:i.extraSourceParams}}function Mh(i){var t,a;let e=i.theme;if(e){let r=(a=(t=i.getRootNode())==null?void 0:t.getElementById)==null?void 0:a.call(t,e);if(r&&r instanceof HTMLTemplateElement)return r;e.startsWith("media-theme-")||(e=`media-theme-${e}`);let n=U.customElements.get(e);if(n!=null&&n.template)return n.template}}function Lh(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 qu(i){let e=i.hasAttribute(E.TITLE)?{video_title:i.getAttribute(E.TITLE)}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,a)=>{let r=i.getAttribute(a);return r!==null&&(t[a.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var Rh=Object.values(g.Attributes),wh=Object.values(je),xh=Object.values(E),Dh=hn(),Oh="mux-player",Zu={dialog:void 0,isDialogOpen:!1},Nh={redundant_streams:!0},va,fa,ft,ga,Kt,et,$t,kn,Qu,Aa,Vs,gt,Ii,Sn,zu,Cn,Xu,Mn,Ju,Ln,ju,Ea=class extends Ss{constructor(){super();K(this,et);K(this,kn);K(this,Aa);K(this,gt);K(this,Sn);K(this,Cn);K(this,Mn);K(this,Ln);K(this,va,!1);K(this,fa,{});K(this,ft,!0);K(this,ga,new mn(this,"hotkeys"));K(this,Kt,{...Zu,onCloseErrorDialog:()=>Y(this,Aa,Vs).call(this,{dialog:void 0,isDialogOpen:!1}),onInitFocusDialog:t=>{Ts(this,le.activeElement)||t.preventDefault()}});this.attachShadow({mode:"open"}),Y(this,kn,Qu).call(this),this.isConnected&&Y(this,et,$t).call(this)}static get observedAttributes(){var t;return[...(t=Ss.observedAttributes)!=null?t:[],...wh,...Rh,...xh]}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=qu(this))}attributeChangedCallback(t,a,r){switch(Y(this,et,$t).call(this),super.attributeChangedCallback(t,a,r),t){case E.HOTKEYS:S(this,ga).value=r;break;case E.THUMBNAIL_TIME:{r!=null&&this.tokens.thumbnail&&mt(T("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").format({}));break}case E.THUMBNAIL_TOKEN:{let{aud:s}=ct(r);r&&s!=="t"&&mt(T("The provided thumbnail-token should have audience value 't' instead of '{aud}'.").format({aud:s}));break}case E.STORYBOARD_TOKEN:{let{aud:s}=ct(r);r&&s!=="s"&&mt(T("The provided storyboard-token should have audience value 's' instead of '{aud}'.").format({aud:s}));break}case g.Attributes.PLAYBACK_ID:{r!=null&&r.includes("?token")&&ve(T("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:r}));break}case g.Attributes.STREAM_TYPE:r&&![H.StreamTypes.LIVE,H.StreamTypes.ON_DEMAND,H.StreamTypes.UNKNOWN].includes(r)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=r.includes("dvr")?Number.POSITIVE_INFINITY:0:Is({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})}):r===H.StreamTypes.LIVE?this.getAttribute(E.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN}[g.Attributes.PLAYBACK_ID,je.SRC,E.PLAYBACK_TOKEN].includes(t)&&a!==r&&me(this,Kt,{...S(this,Kt),...Zu}),Y(this,gt,Ii).call(this,{[Eu(t)]:r})}get preferCmcd(){var t;return(t=this.getAttribute(g.Attributes.PREFER_CMCD))!=null?t:void 0}set preferCmcd(t){t!==this.preferCmcd&&(t?H.CmcdTypeValues.includes(t)?this.setAttribute(g.Attributes.PREFER_CMCD,t):mt(`Invalid value for preferCmcd. Must be one of ${H.CmcdTypeValues.join()}`):this.removeAttribute(g.Attributes.PREFER_CMCD))}get hasPlayed(){var t,a;return(a=(t=this.mediaController)==null?void 0:t.hasAttribute(o.MEDIA_HAS_PLAYED))!=null?a:!1}get inLiveWindow(){var t;return(t=this.mediaController)==null?void 0:t.hasAttribute(o.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(E.THEME))!=null?t:Sh}set theme(t){this.setAttribute(E.THEME,`${t}`)}get themeProps(){let t=this.mediaTheme;if(!t)return;let a={};for(let r of t.getAttributeNames()){if(Hs.includes(r))continue;let n=t.getAttribute(r);a[un(r)]=n===""?!0:n}return a}set themeProps(t){var r,n;Y(this,et,$t).call(this);let a={...this.themeProps,...t};for(let s in a){if(Hs.includes(s))continue;let d=t==null?void 0:t[s];typeof d=="boolean"||d==null?(r=this.mediaTheme)==null||r.toggleAttribute(dn(s),!!d):(n=this.mediaTheme)==null||n.setAttribute(dn(s),d)}}get playbackId(){var t;return(t=this.getAttribute(g.Attributes.PLAYBACK_ID))!=null?t:void 0}set playbackId(t){t?this.setAttribute(g.Attributes.PLAYBACK_ID,t):this.removeAttribute(g.Attributes.PLAYBACK_ID)}get src(){var t,a;return this.playbackId?(t=Ft(this,je.SRC))!=null?t:void 0:(a=this.getAttribute(je.SRC))!=null?a:void 0}set src(t){t?this.setAttribute(je.SRC,t):this.removeAttribute(je.SRC)}get poster(){var a;let t=this.getAttribute(je.POSTER);if(t!=null)return t;if(this.playbackId&&!this.audio)return pu(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(a=this.thumbnailTime)!=null?a:this.startTime,token:this.tokens.thumbnail})}set poster(t){t||t===""?this.setAttribute(je.POSTER,t):this.removeAttribute(je.POSTER)}get storyboardSrc(){var t;return(t=this.getAttribute(E.STORYBOARD_SRC))!=null?t:void 0}set storyboardSrc(t){t?this.setAttribute(E.STORYBOARD_SRC,t):this.removeAttribute(E.STORYBOARD_SRC)}get storyboard(){if(this.storyboardSrc&&!this.tokens.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[H.StreamTypes.LIVE,H.StreamTypes.UNKNOWN].includes(this.streamType)))return bu(this.playbackId,{customDomain:this.customDomain,token:this.tokens.storyboard})}get audio(){return this.hasAttribute(E.AUDIO)}set audio(t){if(!t){this.removeAttribute(E.AUDIO);return}this.setAttribute(E.AUDIO,"")}get hotkeys(){return S(this,ga)}get nohotkeys(){return this.hasAttribute(E.NOHOTKEYS)}set nohotkeys(t){if(!t){this.removeAttribute(E.NOHOTKEYS);return}this.setAttribute(E.NOHOTKEYS,"")}get thumbnailTime(){return Ye(this.getAttribute(E.THUMBNAIL_TIME))}set thumbnailTime(t){this.setAttribute(E.THUMBNAIL_TIME,`${t}`)}get title(){var t;return(t=this.getAttribute(E.TITLE))!=null?t:""}set title(t){t!==this.title&&(t?this.setAttribute(E.TITLE,t):this.removeAttribute("title"),super.title=t)}get placeholder(){var t;return(t=Ft(this,E.PLACEHOLDER))!=null?t:""}set placeholder(t){this.setAttribute(E.PLACEHOLDER,`${t}`)}get primaryColor(){var a,r;let t=this.getAttribute(E.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_primary-color"))==null?void 0:r.trim(),t))return t}set primaryColor(t){this.setAttribute(E.PRIMARY_COLOR,`${t}`)}get secondaryColor(){var a,r;let t=this.getAttribute(E.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_secondary-color"))==null?void 0:r.trim(),t))return t}set secondaryColor(t){this.setAttribute(E.SECONDARY_COLOR,`${t}`)}get accentColor(){var a,r;let t=this.getAttribute(E.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(r=(a=U.getComputedStyle(this.mediaTheme))==null?void 0:a.getPropertyValue("--_accent-color"))==null?void 0:r.trim(),t))return t}set accentColor(t){this.setAttribute(E.ACCENT_COLOR,`${t}`)}get defaultShowRemainingTime(){return this.hasAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(t){t?this.setAttribute(E.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(E.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(E.PLAYBACK_RATES))return this.getAttribute(E.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(E.PLAYBACK_RATES);return}this.setAttribute(E.PLAYBACK_RATES,t.join(" "))}get forwardSeekOffset(){var t;return(t=Ye(this.getAttribute(E.FORWARD_SEEK_OFFSET)))!=null?t:10}set forwardSeekOffset(t){this.setAttribute(E.FORWARD_SEEK_OFFSET,`${t}`)}get backwardSeekOffset(){var t;return(t=Ye(this.getAttribute(E.BACKWARD_SEEK_OFFSET)))!=null?t:10}set backwardSeekOffset(t){this.setAttribute(E.BACKWARD_SEEK_OFFSET,`${t}`)}get defaultHiddenCaptions(){return this.hasAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(t){t?this.setAttribute(E.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(E.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return Ye(this.getAttribute(E.DEFAULT_DURATION))}set defaultDuration(t){t==null?this.removeAttribute(E.DEFAULT_DURATION):this.setAttribute(E.DEFAULT_DURATION,`${t}`)}get playerSoftwareName(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_NAME))!=null?t:Oh}get playerSoftwareVersion(){var t;return(t=this.getAttribute(g.Attributes.PLAYER_SOFTWARE_VERSION))!=null?t:Dh}get beaconCollectionDomain(){var t;return(t=this.getAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))!=null?t:void 0}set beaconCollectionDomain(t){t!==this.beaconCollectionDomain&&(t?this.setAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN,t):this.removeAttribute(g.Attributes.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var t;return(t=this.getAttribute(g.Attributes.MAX_RESOLUTION))!=null?t:void 0}set maxResolution(t){t!==this.maxResolution&&(t?this.setAttribute(g.Attributes.MAX_RESOLUTION,t):this.removeAttribute(g.Attributes.MAX_RESOLUTION))}get minResolution(){var t;return(t=this.getAttribute(g.Attributes.MIN_RESOLUTION))!=null?t:void 0}set minResolution(t){t!==this.minResolution&&(t?this.setAttribute(g.Attributes.MIN_RESOLUTION,t):this.removeAttribute(g.Attributes.MIN_RESOLUTION))}get renditionOrder(){var t;return(t=this.getAttribute(g.Attributes.RENDITION_ORDER))!=null?t:void 0}set renditionOrder(t){t!==this.renditionOrder&&(t?this.setAttribute(g.Attributes.RENDITION_ORDER,t):this.removeAttribute(g.Attributes.RENDITION_ORDER))}get extraSourceParams(){return this.hasAttribute(E.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(E.EXTRA_SOURCE_PARAMS)).entries()].reduce((t,[a,r])=>(t[a]=r,t),{}):Nh}set extraSourceParams(t){t==null?this.removeAttribute(E.EXTRA_SOURCE_PARAMS):this.setAttribute(E.EXTRA_SOURCE_PARAMS,new URLSearchParams(t).toString())}get customDomain(){var t;return(t=this.getAttribute(g.Attributes.CUSTOM_DOMAIN))!=null?t:void 0}set customDomain(t){t!==this.customDomain&&(t?this.setAttribute(g.Attributes.CUSTOM_DOMAIN,t):this.removeAttribute(g.Attributes.CUSTOM_DOMAIN))}get envKey(){var t;return(t=Ft(this,g.Attributes.ENV_KEY))!=null?t:void 0}set envKey(t){this.setAttribute(g.Attributes.ENV_KEY,`${t}`)}get noVolumePref(){return this.hasAttribute(E.NO_VOLUME_PREF)}set noVolumePref(t){t?this.setAttribute(E.NO_VOLUME_PREF,""):this.removeAttribute(E.NO_VOLUME_PREF)}get debug(){return Ft(this,g.Attributes.DEBUG)!=null}set debug(t){t?this.setAttribute(g.Attributes.DEBUG,""):this.removeAttribute(g.Attributes.DEBUG)}get disableCookies(){return Ft(this,g.Attributes.DISABLE_COOKIES)!=null}set disableCookies(t){t?this.setAttribute(g.Attributes.DISABLE_COOKIES,""):this.removeAttribute(g.Attributes.DISABLE_COOKIES)}get streamType(){var t,a,r;return(r=(a=this.getAttribute(g.Attributes.STREAM_TYPE))!=null?a:(t=this.media)==null?void 0:t.streamType)!=null?r:H.StreamTypes.UNKNOWN}set streamType(t){this.setAttribute(g.Attributes.STREAM_TYPE,`${t}`)}get defaultStreamType(){var t,a,r;return(r=(a=this.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?a:(t=this.mediaController)==null?void 0:t.getAttribute(E.DEFAULT_STREAM_TYPE))!=null?r:H.StreamTypes.ON_DEMAND}set defaultStreamType(t){t?this.setAttribute(E.DEFAULT_STREAM_TYPE,t):this.removeAttribute(E.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var t,a;return this.hasAttribute(E.TARGET_LIVE_WINDOW)?+this.getAttribute(E.TARGET_LIVE_WINDOW):(a=(t=this.media)==null?void 0:t.targetLiveWindow)!=null?a:Number.NaN}set targetLiveWindow(t){t==this.targetLiveWindow||Number.isNaN(t)&&Number.isNaN(this.targetLiveWindow)||(t==null?this.removeAttribute(E.TARGET_LIVE_WINDOW):this.setAttribute(E.TARGET_LIVE_WINDOW,`${+t}`))}get liveEdgeStart(){var t;return(t=this.media)==null?void 0:t.liveEdgeStart}get startTime(){return Ye(Ft(this,g.Attributes.START_TIME))}set startTime(t){this.setAttribute(g.Attributes.START_TIME,`${t}`)}get preferPlayback(){let t=this.getAttribute(g.Attributes.PREFER_PLAYBACK);if(t===H.PlaybackTypes.MSE||t===H.PlaybackTypes.NATIVE)return t}set preferPlayback(t){t!==this.preferPlayback&&(t===H.PlaybackTypes.MSE||t===H.PlaybackTypes.NATIVE?this.setAttribute(g.Attributes.PREFER_PLAYBACK,t):this.removeAttribute(g.Attributes.PREFER_PLAYBACK))}get metadata(){var t;return(t=this.media)==null?void 0:t.metadata}set metadata(t){if(Y(this,et,$t).call(this),!this.media){ve("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...qu(this),...t}}get _hlsConfig(){var t;return(t=this.media)==null?void 0:t._hlsConfig}set _hlsConfig(t){if(Y(this,et,$t).call(this),!this.media){ve("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=t}async addCuePoints(t){var a;if(Y(this,et,$t).call(this),!this.media){ve("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(E.PLAYBACK_TOKEN),a=this.getAttribute(E.THUMBNAIL_TOKEN),r=this.getAttribute(E.STORYBOARD_TOKEN);return{...S(this,fa),...t!=null?{playback:t}:{},...a!=null?{thumbnail:a}:{},...r!=null?{storyboard:r}:{}}}set tokens(t){me(this,fa,t!=null?t:{})}get playbackToken(){var t;return(t=this.getAttribute(E.PLAYBACK_TOKEN))!=null?t:void 0}set playbackToken(t){this.setAttribute(E.PLAYBACK_TOKEN,`${t}`)}get thumbnailToken(){var t;return(t=this.getAttribute(E.THUMBNAIL_TOKEN))!=null?t:void 0}set thumbnailToken(t){this.setAttribute(E.THUMBNAIL_TOKEN,`${t}`)}get storyboardToken(){var t;return(t=this.getAttribute(E.STORYBOARD_TOKEN))!=null?t:void 0}set storyboardToken(t){this.setAttribute(E.STORYBOARD_TOKEN,`${t}`)}addTextTrack(t,a,r,n){var d;let s=(d=this.media)==null?void 0:d.nativeEl;if(s)return(0,H.addTextTrack)(s,t,a,r,n)}removeTextTrack(t){var r;let a=(r=this.media)==null?void 0:r.nativeEl;if(a)return(0,H.removeTextTrack)(a,t)}get textTracks(){var t;return(t=this.media)==null?void 0:t.textTracks}};va=new WeakMap,fa=new WeakMap,ft=new WeakMap,ga=new WeakMap,Kt=new WeakMap,et=new WeakSet,$t=function(){var t,a,r;if(!S(this,va)){me(this,va,!0),Y(this,gt,Ii).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof U.HTMLElement))throw""}catch{ve("<media-theme> failed to upgrade!")}try{if(customElements.upgrade(this.media),!(this.media instanceof g.default))throw""}catch{ve("<mux-video> failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof io))throw""}catch{ve("<media-controller> failed to upgrade!")}_u(this),Y(this,Sn,zu).call(this),Y(this,Cn,Xu).call(this),Y(this,Mn,Ju).call(this),me(this,ft,(a=(t=this.mediaController)==null?void 0:t.hasAttribute(k.USER_INACTIVE))!=null?a:!0),Y(this,Ln,ju).call(this),(r=this.media)==null||r.addEventListener("streamtypechange",()=>{Y(this,gt,Ii).call(this)})}},kn=new WeakSet,Qu=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{}},Aa=new WeakSet,Vs=function(t){Object.assign(S(this,Kt),t),Y(this,gt,Ii).call(this)},gt=new WeakSet,Ii=function(t={}){$u(Fu(Ch(this,{...S(this,Kt),...t})),this.shadowRoot)},Sn=new WeakSet,zu=function(){let t=r=>{var d,u;if(!(r!=null&&r.startsWith("theme-")))return;let n=r.replace(/^theme-/,"");if(Hs.includes(n))return;let s=this.getAttribute(r);s!=null?(d=this.mediaTheme)==null||d.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)},Cn=new WeakSet,Xu=function(){var a;let t=r=>{let{detail:n}=r;if(n instanceof g.MediaError||(n=new g.MediaError(n.message,n.code,n.fatal)),!(n!=null&&n.fatal)){mt(n),n.data&&mt(`${n.name} data:`,n.data);return}let{dialog:s,devlog:d}=Tn(n,!window.navigator.onLine,this.playbackId,this.playbackToken);d.message&&Is(d),ve(n),n.data&&ve(`${n.name} data:`,n.data),Y(this,Aa,Vs).call(this,{isDialogOpen:!0,dialog:s})};this.addEventListener("error",t),this.media&&(this.media.errorTranslator=(r={})=>{var s,d,u;if(!(((s=this.media)==null?void 0:s.error)instanceof g.MediaError))return r;let{devlog:n}=Tn((d=this.media)==null?void 0:d.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,d;let{detail:n}=r;if(!n){let{message:u,code:m}=(d=(s=this.media)==null?void 0:s.error)!=null?d:{};n=new g.MediaError(u,m)}n!=null&&n.fatal&&this.dispatchEvent(new CustomEvent("error",{detail:n}))})},Mn=new WeakSet,Ju=function(){var a,r,n,s;let t=()=>Y(this,gt,Ii).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)},Ln=new WeakSet,ju=function(){var m,h;if(!/Firefox/i.test(navigator.userAgent))return;let a,r=new WeakMap,n=()=>this.streamType===H.StreamTypes.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,s=(p,b,_=!1)=>{if(n())return;Array.from(p&&p.activeCues||[]).forEach(I=>{if(!(!I.snapToLines||I.line<-5||I.line>=0&&I.line<10))if(!b||this.paused){let V=I.text.split(`
2450
+ `).length,F=-3;this.streamType===H.StreamTypes.LIVE&&(F=-2);let re=F-V;if(I.line===re&&!_)return;r.has(I)||r.set(I,I.line),I.line=re}else setTimeout(()=>{I.line=r.get(I)||"auto"},500)})},d=()=>{var p,b;s(a,(b=(p=this.mediaController)==null?void 0:p.hasAttribute(k.USER_INACTIVE))!=null?b:!1)},u=()=>{var _,P;let b=Array.from(((P=(_=this.mediaController)==null?void 0:_.media)==null?void 0:P.textTracks)||[]).filter(I=>["subtitles","captions"].includes(I.kind)&&I.mode==="showing")[0];b!==a&&(a==null||a.removeEventListener("cuechange",d)),a=b,a==null||a.addEventListener("cuechange",d),s(a,S(this,ft))};u(),(m=this.textTracks)==null||m.addEventListener("change",u),(h=this.textTracks)==null||h.addEventListener("addtrack",u),this.addEventListener("userinactivechange",()=>{var b,_;let p=(_=(b=this.mediaController)==null?void 0:b.hasAttribute(k.USER_INACTIVE))!=null?_:!0;S(this,ft)!==p&&(me(this,ft,p),s(a,S(this,ft)))})};function Ft(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}U.customElements.get("mux-player")||(U.customElements.define("mux-player",Ea),U.MuxPlayerElement=Ea);var Ph=Ea;